summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--JavaScriptCore/Android.mk1
-rw-r--r--JavaScriptCore/CMakeLists.txt1
-rw-r--r--JavaScriptCore/CMakeListsEfl.txt2
-rw-r--r--JavaScriptCore/ChangeLog567
-rw-r--r--JavaScriptCore/Configurations/FeatureDefines.xcconfig3
-rw-r--r--JavaScriptCore/Configurations/Version.xcconfig2
-rw-r--r--JavaScriptCore/GNUmakefile.am4
-rw-r--r--JavaScriptCore/JavaScriptCore.gypi4
-rw-r--r--JavaScriptCore/JavaScriptCore.pro4
-rw-r--r--JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj4
-rw-r--r--JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj8
-rw-r--r--JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj18
-rw-r--r--JavaScriptCore/jit/ExecutableAllocator.cpp44
-rw-r--r--JavaScriptCore/jit/ExecutableAllocator.h33
-rw-r--r--JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp124
-rw-r--r--JavaScriptCore/jit/ExecutableAllocatorSymbian.cpp80
-rw-r--r--JavaScriptCore/jit/JIT.h2
-rw-r--r--JavaScriptCore/jit/JITArithmetic.cpp4
-rw-r--r--JavaScriptCore/jit/JITArithmetic32_64.cpp4
-rw-r--r--JavaScriptCore/jit/JITOpcodes.cpp6
-rw-r--r--JavaScriptCore/jit/JITOpcodes32_64.cpp4
-rw-r--r--JavaScriptCore/jit/JITStubs.h7
-rw-r--r--JavaScriptCore/jsc.cpp2
-rw-r--r--JavaScriptCore/parser/ASTBuilder.h53
-rw-r--r--JavaScriptCore/qt/ChangeLog143
-rw-r--r--JavaScriptCore/qt/api/QtScript.pro3
-rw-r--r--JavaScriptCore/qt/api/qscriptengine.cpp107
-rw-r--r--JavaScriptCore/qt/api/qscriptengine.h11
-rw-r--r--JavaScriptCore/qt/api/qscriptengine_p.cpp36
-rw-r--r--JavaScriptCore/qt/api/qscriptengine_p.h7
-rw-r--r--JavaScriptCore/qt/api/qscriptfunction.cpp145
-rw-r--r--JavaScriptCore/qt/api/qscriptfunction_p.h57
-rw-r--r--JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h12
-rw-r--r--JavaScriptCore/qt/api/qscriptvalue_p.h48
-rw-r--r--JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp141
-rw-r--r--JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.cpp62
-rw-r--r--JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.h114
-rw-r--r--JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_comparison.cpp253
-rw-r--r--JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_init.cpp278
-rw-r--r--JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_istype.cpp387
-rw-r--r--JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_totype.cpp407
-rw-r--r--JavaScriptCore/runtime/JSByteArray.h27
-rw-r--r--JavaScriptCore/runtime/JSGlobalData.h3
-rw-r--r--JavaScriptCore/runtime/JSGlobalObject.cpp12
-rw-r--r--JavaScriptCore/runtime/RegExp.cpp3
-rw-r--r--JavaScriptCore/runtime/TimeoutChecker.h1
-rw-r--r--JavaScriptCore/wscript2
-rw-r--r--JavaScriptCore/wtf/BumpPointerAllocator.h253
-rw-r--r--JavaScriptCore/wtf/CMakeListsEfl.txt10
-rw-r--r--JavaScriptCore/wtf/PageAllocation.cpp231
-rw-r--r--JavaScriptCore/wtf/PageAllocation.h125
-rw-r--r--JavaScriptCore/wtf/Platform.h142
-rw-r--r--JavaScriptCore/wtf/TCSpinLock.h39
-rw-r--r--JavaScriptCore/yarr/RegexInterpreter.cpp33
-rw-r--r--JavaScriptCore/yarr/RegexInterpreter.h15
-rw-r--r--JavaScriptGlue/ChangeLog20
-rw-r--r--JavaScriptGlue/Configurations/Version.xcconfig2
-rw-r--r--JavaScriptGlue/ForwardingHeaders/wtf/BumpPointerAllocator.h1
-rw-r--r--JavaScriptGlue/ForwardingHeaders/wtf/PageAllocation.h1
-rw-r--r--LayoutTests/fast/dom/DeviceOrientation/script-tests/window-property.js5
-rw-r--r--LayoutTests/fast/dom/DeviceOrientation/window-property-expected.txt5
-rw-r--r--LayoutTests/platform/android-v8/fast/dom/DeviceOrientation/window-property-expected.txt18
-rw-r--r--LayoutTests/platform/android/fast/text/hyphenate-character-expected.txt118
-rw-r--r--LayoutTests/platform/android/fast/text/hyphens-expected.txt115
-rw-r--r--LayoutTests/storage/change-version.html6
-rw-r--r--LayoutTests/storage/indexeddb/basics-expected.txt (renamed from LayoutTests/storage/indexeddb/indexed-database-request-expected.txt)2
-rw-r--r--LayoutTests/storage/indexeddb/basics.html (renamed from LayoutTests/storage/indexeddb/idb-keyrange.html)2
-rw-r--r--LayoutTests/storage/indexeddb/database-basics-expected.txt (renamed from LayoutTests/storage/indexeddb/idb-database-request-expected.txt)2
-rw-r--r--LayoutTests/storage/indexeddb/database-basics.html (renamed from LayoutTests/storage/indexeddb/idb-database-request.html)2
-rw-r--r--LayoutTests/storage/indexeddb/keyrange-expected.txt (renamed from LayoutTests/storage/indexeddb/idb-keyrange-expected.txt)50
-rw-r--r--LayoutTests/storage/indexeddb/keyrange.html (renamed from LayoutTests/storage/indexeddb/idb-objectstore-request.html)2
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-basics-expected.txt (renamed from LayoutTests/storage/indexeddb/idb-objectstore-request-expected.txt)6
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-basics.html (renamed from LayoutTests/storage/indexeddb/indexed-database-request.html)2
-rw-r--r--LayoutTests/storage/indexeddb/resources/shared.js1
-rw-r--r--LayoutTests/storage/indexeddb/script-tests/basics.js (renamed from LayoutTests/storage/indexeddb/script-tests/indexed-database-request.js)6
-rw-r--r--LayoutTests/storage/indexeddb/script-tests/database-basics.js (renamed from LayoutTests/storage/indexeddb/script-tests/idb-database-request.js)4
-rw-r--r--LayoutTests/storage/indexeddb/script-tests/keyrange.js (renamed from LayoutTests/storage/indexeddb/script-tests/idb-keyrange.js)13
-rw-r--r--LayoutTests/storage/indexeddb/script-tests/objectstore-basics.js (renamed from LayoutTests/storage/indexeddb/script-tests/idb-objectstore-request.js)9
-rw-r--r--WebCore/Android.derived.v8bindings.mk4
-rw-r--r--WebCore/Android.mk4
-rw-r--r--WebCore/CMakeLists.txt8
-rw-r--r--WebCore/CMakeListsEfl.txt58
-rw-r--r--WebCore/ChangeLog3412
-rw-r--r--WebCore/Configurations/FeatureDefines.xcconfig3
-rw-r--r--WebCore/Configurations/Version.xcconfig2
-rw-r--r--WebCore/DerivedSources.cpp1
-rw-r--r--WebCore/DerivedSources.make14
-rw-r--r--WebCore/ForwardingHeaders/wtf/BumpPointerAllocator.h4
-rw-r--r--WebCore/ForwardingHeaders/wtf/PageAllocation.h4
-rw-r--r--WebCore/GNUmakefile.am228
-rw-r--r--WebCore/WebCore.exp.in54
-rw-r--r--WebCore/WebCore.gyp/WebCore.gyp10
-rw-r--r--WebCore/WebCore.gypi24
-rw-r--r--WebCore/WebCore.order2
-rw-r--r--WebCore/WebCore.pri12
-rw-r--r--WebCore/WebCore.pro14
-rw-r--r--WebCore/WebCore.vcproj/WebCore.vcproj312
-rw-r--r--WebCore/WebCore.xcodeproj/project.pbxproj102
-rw-r--r--WebCore/accessibility/AccessibilityObject.cpp27
-rw-r--r--WebCore/accessibility/AccessibilityObject.h10
-rw-r--r--WebCore/accessibility/AccessibilityRenderObject.cpp78
-rw-r--r--WebCore/accessibility/AccessibilityRenderObject.h4
-rw-r--r--WebCore/accessibility/AccessibilityTable.cpp10
-rw-r--r--WebCore/accessibility/AccessibilityTableCell.cpp2
-rw-r--r--WebCore/accessibility/AccessibilityTableColumn.cpp2
-rw-r--r--WebCore/accessibility/mac/AccessibilityObjectWrapper.mm61
-rw-r--r--WebCore/bindings/generic/RuntimeEnabledFeatures.h1
-rw-r--r--WebCore/bindings/js/JSDatabaseCustom.cpp23
-rw-r--r--WebCore/bindings/js/JSDatabaseSyncCustom.cpp15
-rw-r--r--WebCore/bindings/js/JSHTMLAppletElementCustom.cpp4
-rw-r--r--WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp4
-rw-r--r--WebCore/bindings/js/JSHTMLObjectElementCustom.cpp4
-rw-r--r--WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp4
-rw-r--r--WebCore/bindings/js/JSPluginElementFunctions.cpp66
-rw-r--r--WebCore/bindings/js/JSPluginElementFunctions.h5
-rw-r--r--WebCore/bindings/js/ScriptObject.cpp9
-rw-r--r--WebCore/bindings/js/ScriptObject.h2
-rw-r--r--WebCore/bindings/js/ScriptValue.cpp59
-rw-r--r--WebCore/bindings/js/ScriptValue.h5
-rw-r--r--WebCore/bindings/js/SerializedScriptValue.cpp11
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorCPP.pm2
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorJS.pm6
-rw-r--r--WebCore/bindings/scripts/IDLStructure.pm8
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h8
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestObj.cpp56
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestObj.h6
-rw-r--r--WebCore/bindings/scripts/test/ObjC/DOMTestObj.h8
-rw-r--r--WebCore/bindings/scripts/test/TestObj.idl6
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestObj.cpp12
-rw-r--r--WebCore/bindings/v8/ScriptObject.cpp8
-rw-r--r--WebCore/bindings/v8/ScriptObject.h2
-rw-r--r--WebCore/bindings/v8/ScriptProfile.cpp1
-rwxr-xr-xWebCore/bindings/v8/ScriptValue.cpp57
-rw-r--r--WebCore/bindings/v8/ScriptValue.h3
-rw-r--r--WebCore/bindings/v8/SerializedScriptValue.cpp7
-rw-r--r--WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp2
-rw-r--r--WebCore/bindings/v8/custom/V8DatabaseCustom.cpp6
-rw-r--r--WebCore/bindings/v8/custom/V8DatabaseSyncCustom.cpp2
-rw-r--r--WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp2
-rw-r--r--WebCore/bridge/jsc/BridgeJSC.cpp2
-rw-r--r--WebCore/bridge/jsc/BridgeJSC.h2
-rw-r--r--WebCore/bridge/qt/qt_runtime.cpp3
-rw-r--r--WebCore/css/CSSParser.cpp40
-rw-r--r--WebCore/css/CSSPrimitiveValueMappings.h1
-rw-r--r--WebCore/css/CSSSelector.cpp74
-rw-r--r--WebCore/css/CSSSelector.h21
-rw-r--r--WebCore/css/CSSStyleSelector.cpp4
-rw-r--r--WebCore/dom/Clipboard.h4
-rw-r--r--WebCore/dom/ContainerNode.cpp5
-rw-r--r--WebCore/dom/DeviceOrientationController.cpp39
-rw-r--r--WebCore/dom/DeviceOrientationController.h11
-rw-r--r--WebCore/dom/Document.cpp9
-rw-r--r--WebCore/dom/Document.h6
-rw-r--r--WebCore/dom/DocumentParser.h3
-rw-r--r--WebCore/dom/InputElement.cpp37
-rw-r--r--WebCore/dom/InputElement.h5
-rw-r--r--WebCore/dom/ScriptElement.cpp41
-rw-r--r--WebCore/dom/ScriptElement.h3
-rw-r--r--WebCore/dom/UserTypingGestureIndicator.cpp66
-rw-r--r--WebCore/dom/UserTypingGestureIndicator.h52
-rw-r--r--WebCore/editing/ApplyStyleCommand.cpp102
-rw-r--r--WebCore/editing/ApplyStyleCommand.h9
-rw-r--r--WebCore/editing/CompositeEditCommand.cpp3
-rw-r--r--WebCore/editing/Editor.cpp7
-rw-r--r--WebCore/editing/Editor.h3
-rw-r--r--WebCore/editing/InsertListCommand.cpp53
-rw-r--r--WebCore/editing/SplitTextNodeCommand.cpp43
-rw-r--r--WebCore/editing/SplitTextNodeCommand.h2
-rw-r--r--WebCore/editing/SplitTextNodeContainingElementCommand.cpp2
-rw-r--r--WebCore/editing/android/EditorAndroid.cpp2
-rw-r--r--WebCore/editing/brew/EditorBrew.cpp2
-rw-r--r--WebCore/editing/chromium/EditorChromium.cpp5
-rw-r--r--WebCore/editing/haiku/EditorHaiku.cpp2
-rw-r--r--WebCore/editing/mac/EditorMac.mm4
-rw-r--r--WebCore/editing/qt/EditorQt.cpp2
-rw-r--r--WebCore/editing/visible_units.cpp4
-rw-r--r--WebCore/editing/wx/EditorWx.cpp2
-rw-r--r--WebCore/history/PageCache.cpp2
-rw-r--r--WebCore/html/Blob.cpp10
-rw-r--r--WebCore/html/Blob.h18
-rw-r--r--WebCore/html/Blob.idl4
-rw-r--r--WebCore/html/BlobBuilder.cpp4
-rw-r--r--WebCore/html/BlobBuilder.h3
-rw-r--r--WebCore/html/BlobBuilder.idl4
-rw-r--r--WebCore/html/File.cpp8
-rw-r--r--WebCore/html/File.h12
-rw-r--r--WebCore/html/FileThreadTask.h49
-rw-r--r--WebCore/html/HTMLConstructionSite.cpp4
-rw-r--r--WebCore/html/HTMLDocumentParser.cpp12
-rw-r--r--WebCore/html/HTMLDocumentParser.h1
-rw-r--r--WebCore/html/HTMLElement.cpp15
-rw-r--r--WebCore/html/HTMLElementStack.cpp54
-rw-r--r--WebCore/html/HTMLElementStack.h15
-rw-r--r--WebCore/html/HTMLFormElement.cpp100
-rw-r--r--WebCore/html/HTMLFormElement.h13
-rw-r--r--WebCore/html/HTMLInputElement.cpp165
-rw-r--r--WebCore/html/HTMLInputElement.h5
-rw-r--r--WebCore/html/HTMLInputStream.h17
-rw-r--r--WebCore/html/HTMLLinkElement.cpp9
-rw-r--r--WebCore/html/HTMLMediaElement.cpp24
-rw-r--r--WebCore/html/HTMLMediaElement.h2
-rw-r--r--WebCore/html/HTMLMediaElement.idl2
-rw-r--r--WebCore/html/HTMLPlugInElement.cpp14
-rw-r--r--WebCore/html/HTMLPlugInElement.h3
-rw-r--r--WebCore/html/HTMLScriptRunner.cpp2
-rw-r--r--WebCore/html/HTMLScriptRunner.h2
-rw-r--r--WebCore/html/HTMLSourceElement.cpp5
-rw-r--r--WebCore/html/HTMLSourceElement.h1
-rw-r--r--WebCore/html/HTMLSourceElement.idl2
-rw-r--r--WebCore/html/HTMLTagNames.in7
-rw-r--r--WebCore/html/HTMLToken.h23
-rw-r--r--WebCore/html/HTMLTokenizer.cpp7
-rw-r--r--WebCore/html/HTMLTokenizer.h13
-rw-r--r--WebCore/html/HTMLTreeBuilder.cpp119
-rw-r--r--WebCore/html/HTMLTreeBuilder.h5
-rw-r--r--WebCore/html/HTMLVideoElement.cpp5
-rw-r--r--WebCore/html/HTMLVideoElement.h3
-rw-r--r--WebCore/html/HTMLVideoElement.idl2
-rw-r--r--WebCore/html/canvas/CanvasRenderingContext2D.cpp150
-rw-r--r--WebCore/html/canvas/CanvasRenderingContext2D.h451
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.cpp14
-rw-r--r--WebCore/inspector/CodeGeneratorInspector.pm148
-rw-r--r--WebCore/inspector/ConsoleMessage.cpp55
-rw-r--r--WebCore/inspector/ConsoleMessage.h11
-rw-r--r--WebCore/inspector/InjectedScript.cpp7
-rw-r--r--WebCore/inspector/InjectedScript.h3
-rw-r--r--WebCore/inspector/Inspector.idl7
-rw-r--r--WebCore/inspector/InspectorApplicationCacheAgent.cpp54
-rw-r--r--WebCore/inspector/InspectorApplicationCacheAgent.h49
-rw-r--r--WebCore/inspector/InspectorBackend.cpp19
-rw-r--r--WebCore/inspector/InspectorBackend.h6
-rw-r--r--WebCore/inspector/InspectorBackend.idl148
-rw-r--r--WebCore/inspector/InspectorCSSStore.cpp8
-rw-r--r--WebCore/inspector/InspectorCSSStore.h2
-rw-r--r--WebCore/inspector/InspectorController.cpp17
-rw-r--r--WebCore/inspector/InspectorController.h3
-rw-r--r--WebCore/inspector/InspectorDOMAgent.cpp8
-rw-r--r--WebCore/inspector/InspectorDOMAgent.h2
-rw-r--r--WebCore/inspector/InspectorFrontendClient.h2
-rw-r--r--WebCore/inspector/InspectorFrontendClientLocal.cpp11
-rw-r--r--WebCore/inspector/InspectorFrontendClientLocal.h2
-rw-r--r--WebCore/inspector/InspectorFrontendHost.cpp5
-rw-r--r--WebCore/inspector/InspectorFrontendHost.h1
-rw-r--r--WebCore/inspector/InspectorFrontendHost.idl1
-rw-r--r--WebCore/inspector/InspectorResource.cpp23
-rw-r--r--WebCore/inspector/InspectorValues.cpp27
-rw-r--r--WebCore/inspector/InspectorValues.h4
-rw-r--r--WebCore/inspector/front-end/ConsoleView.js4
-rw-r--r--WebCore/inspector/front-end/DOMAgent.js1
-rw-r--r--WebCore/inspector/front-end/ElementsPanel.js2
-rw-r--r--WebCore/inspector/front-end/InjectedScript.js5
-rw-r--r--WebCore/inspector/front-end/InjectedScriptAccess.js6
-rw-r--r--WebCore/inspector/front-end/InspectorBackendStub.js342
-rw-r--r--WebCore/inspector/front-end/ResourceView.js3
-rw-r--r--WebCore/inspector/front-end/ResourcesPanel.js165
-rw-r--r--WebCore/inspector/front-end/ScriptView.js2
-rw-r--r--WebCore/inspector/front-end/ScriptsPanel.js24
-rw-r--r--WebCore/inspector/front-end/Settings.js19
-rw-r--r--WebCore/inspector/front-end/SourceView.js2
-rw-r--r--WebCore/inspector/front-end/inspector.css16
-rw-r--r--WebCore/inspector/front-end/inspector.js5
-rw-r--r--WebCore/inspector/front-end/utilities.js5
-rw-r--r--WebCore/loader/DocumentLoadTiming.h (renamed from JavaScriptCore/jit/ExecutableAllocatorPosix.cpp)73
-rw-r--r--WebCore/loader/DocumentLoader.h1
-rw-r--r--WebCore/loader/FormSubmission.cpp127
-rw-r--r--WebCore/loader/FormSubmission.h52
-rw-r--r--WebCore/loader/FrameLoader.cpp8
-rw-r--r--WebCore/loader/FrameLoaderTypes.h26
-rw-r--r--WebCore/loader/MainResourceLoader.cpp8
-rw-r--r--WebCore/loader/MainResourceLoader.h1
-rw-r--r--WebCore/loader/SubframeLoader.cpp6
-rw-r--r--WebCore/loader/appcache/ApplicationCacheHost.cpp31
-rw-r--r--WebCore/loader/appcache/ApplicationCacheHost.h44
-rw-r--r--WebCore/manual-tests/autoscroll-over-scrollbar.html8
-rw-r--r--WebCore/mathml/mathattrs.in1
-rw-r--r--WebCore/page/DOMWindow.cpp10
-rw-r--r--WebCore/page/DOMWindow.h3
-rw-r--r--WebCore/page/DOMWindow.idl5
-rw-r--r--WebCore/page/DragController.cpp6
-rw-r--r--WebCore/page/EventHandler.cpp10
-rw-r--r--WebCore/page/EventHandler.h4
-rw-r--r--WebCore/page/Frame.cpp1
-rw-r--r--WebCore/page/FrameView.cpp43
-rw-r--r--WebCore/page/FrameView.h2
-rw-r--r--WebCore/page/Geolocation.cpp7
-rw-r--r--WebCore/page/GeolocationController.cpp26
-rw-r--r--WebCore/page/GeolocationController.h7
-rw-r--r--WebCore/page/GeolocationControllerClient.h5
-rw-r--r--WebCore/page/History.cpp12
-rw-r--r--WebCore/page/Page.cpp52
-rw-r--r--WebCore/page/Page.h34
-rw-r--r--WebCore/page/PrintContext.cpp4
-rw-r--r--WebCore/page/SecurityOrigin.cpp130
-rw-r--r--WebCore/page/SecurityOrigin.h17
-rw-r--r--WebCore/page/Settings.cpp10
-rw-r--r--WebCore/page/Settings.h15
-rw-r--r--WebCore/page/SpeechInput.cpp37
-rw-r--r--WebCore/page/SpeechInput.h17
-rw-r--r--WebCore/page/SpeechInputClient.h12
-rw-r--r--WebCore/page/SpeechInputListener.h14
-rw-r--r--WebCore/page/Timing.cpp33
-rw-r--r--WebCore/page/animation/AnimationBase.cpp113
-rw-r--r--WebCore/page/animation/AnimationBase.h1
-rw-r--r--WebCore/page/chromium/EventHandlerChromium.cpp2
-rw-r--r--WebCore/page/gtk/EventHandlerGtk.cpp2
-rw-r--r--WebCore/page/mac/WebCoreViewFactory.h116
-rw-r--r--WebCore/page/win/EventHandlerWin.cpp2
-rw-r--r--WebCore/platform/ContextMenu.cpp2
-rw-r--r--WebCore/platform/ContextMenuItem.h2
-rw-r--r--WebCore/platform/DragData.h3
-rw-r--r--WebCore/platform/LocalizationStrategy.h172
-rw-r--r--WebCore/platform/PlatformStrategies.h21
-rw-r--r--WebCore/platform/PopupMenuClient.h1
-rw-r--r--WebCore/platform/SchemeRegistry.cpp172
-rw-r--r--WebCore/platform/SchemeRegistry.h61
-rw-r--r--WebCore/platform/ScrollView.cpp1
-rw-r--r--WebCore/platform/android/ClipboardAndroid.cpp5
-rw-r--r--WebCore/platform/android/DragDataAndroid.cpp6
-rw-r--r--WebCore/platform/brew/ClipboardBrew.cpp5
-rw-r--r--WebCore/platform/brew/DragDataBrew.cpp6
-rw-r--r--WebCore/platform/chromium/ChromiumBridge.h4
-rw-r--r--WebCore/platform/chromium/ClipboardChromium.cpp18
-rw-r--r--WebCore/platform/chromium/ClipboardChromium.h6
-rw-r--r--WebCore/platform/chromium/DragDataChromium.cpp10
-rw-r--r--WebCore/platform/chromium/PlatformThemeChromiumGtk.cpp4
-rw-r--r--WebCore/platform/chromium/PopupMenuChromium.cpp37
-rw-r--r--WebCore/platform/efl/ClipboardEfl.cpp7
-rw-r--r--WebCore/platform/efl/DragDataEfl.cpp6
-rw-r--r--WebCore/platform/efl/FileSystemEfl.cpp8
-rw-r--r--WebCore/platform/efl/LoggingEfl.cpp31
-rw-r--r--WebCore/platform/efl/WidgetEfl.cpp4
-rw-r--r--WebCore/platform/graphics/BitmapImage.h2
-rw-r--r--WebCore/platform/graphics/Font.cpp6
-rw-r--r--WebCore/platform/graphics/FontDescription.h7
-rw-r--r--WebCore/platform/graphics/GraphicsContext.h10
-rw-r--r--WebCore/platform/graphics/Path.h1
-rw-r--r--WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp6
-rw-r--r--WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp2
-rw-r--r--WebCore/platform/graphics/cg/GraphicsContextCG.cpp12
-rw-r--r--WebCore/platform/graphics/cg/ImageBufferCG.cpp2
-rw-r--r--WebCore/platform/graphics/chromium/GLES2Canvas.cpp523
-rw-r--r--WebCore/platform/graphics/chromium/GLES2Canvas.h115
-rw-r--r--WebCore/platform/graphics/chromium/GLES2Texture.cpp128
-rw-r--r--WebCore/platform/graphics/chromium/GLES2Texture.h63
-rw-r--r--WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp7
-rw-r--r--WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp2
-rw-r--r--WebCore/platform/graphics/qt/GraphicsContextQt.cpp10
-rw-r--r--WebCore/platform/graphics/qt/ImageBufferQt.cpp118
-rw-r--r--WebCore/platform/graphics/skia/GraphicsContextSkia.cpp108
-rw-r--r--WebCore/platform/graphics/skia/ImageBufferSkia.cpp12
-rw-r--r--WebCore/platform/graphics/skia/PlatformContextSkia.cpp127
-rw-r--r--WebCore/platform/graphics/skia/PlatformContextSkia.h38
-rw-r--r--WebCore/platform/graphics/wince/GraphicsContextWince.cpp18
-rw-r--r--WebCore/platform/graphics/wince/ImageBufferWince.cpp20
-rw-r--r--WebCore/platform/graphics/wince/PlatformPathWince.cpp2
-rw-r--r--WebCore/platform/graphics/wx/FontPlatformDataWx.cpp8
-rw-r--r--WebCore/platform/graphics/wx/GraphicsContextWx.cpp2
-rw-r--r--WebCore/platform/gtk/ClipboardGtk.cpp20
-rw-r--r--WebCore/platform/gtk/ClipboardGtk.h14
-rw-r--r--WebCore/platform/gtk/DragDataGtk.cpp5
-rw-r--r--WebCore/platform/haiku/ClipboardHaiku.cpp5
-rw-r--r--WebCore/platform/haiku/DragDataHaiku.cpp6
-rw-r--r--WebCore/platform/mac/ClipboardMac.mm10
-rw-r--r--WebCore/platform/mac/DragDataMac.mm7
-rw-r--r--WebCore/platform/mac/LocalizedStringsMac.mm513
-rw-r--r--WebCore/platform/network/FormDataBuilder.cpp84
-rw-r--r--WebCore/platform/network/FormDataBuilder.h34
-rw-r--r--WebCore/platform/qt/ClipboardQt.cpp6
-rw-r--r--WebCore/platform/qt/DragDataQt.cpp6
-rw-r--r--WebCore/platform/text/transcoder/FontTranscoder.cpp17
-rw-r--r--WebCore/platform/text/transcoder/FontTranscoder.h7
-rw-r--r--WebCore/platform/win/BitmapInfo.cpp21
-rw-r--r--WebCore/platform/win/BitmapInfo.h20
-rw-r--r--WebCore/platform/win/ClipboardUtilitiesWin.cpp154
-rw-r--r--WebCore/platform/win/ClipboardUtilitiesWin.h1
-rw-r--r--WebCore/platform/win/ClipboardWin.cpp24
-rw-r--r--WebCore/platform/win/ClipboardWin.h13
-rw-r--r--WebCore/platform/win/DragDataWin.cpp7
-rw-r--r--WebCore/platform/win/EditorWin.cpp5
-rw-r--r--WebCore/platform/win/PasteboardWin.cpp72
-rw-r--r--WebCore/platform/win/PopupMenuWin.cpp7
-rw-r--r--WebCore/platform/wince/DragDataWince.cpp6
-rw-r--r--WebCore/platform/wince/EditorWince.cpp2
-rw-r--r--WebCore/platform/wx/ClipboardWx.cpp5
-rw-r--r--WebCore/platform/wx/DragDataWx.cpp6
-rw-r--r--WebCore/platform/wx/MouseEventWx.cpp2
-rw-r--r--WebCore/plugins/PluginViewBase.h8
-rw-r--r--WebCore/plugins/win/PluginDatabaseWin.cpp2
-rw-r--r--WebCore/rendering/AutoTableLayout.cpp6
-rw-r--r--WebCore/rendering/HitTestRequest.h6
-rw-r--r--WebCore/rendering/RenderBoxModelObject.cpp38
-rw-r--r--WebCore/rendering/RenderBoxModelObject.h2
-rw-r--r--WebCore/rendering/RenderInline.h4
-rw-r--r--WebCore/rendering/RenderLayer.cpp2
-rw-r--r--WebCore/rendering/RenderLayerBacking.cpp65
-rw-r--r--WebCore/rendering/RenderLayerCompositor.cpp52
-rw-r--r--WebCore/rendering/RenderLayerCompositor.h9
-rw-r--r--WebCore/rendering/RenderMediaControlsChromium.cpp2
-rw-r--r--WebCore/rendering/RenderMenuList.cpp5
-rw-r--r--WebCore/rendering/RenderMenuList.h1
-rw-r--r--WebCore/rendering/RenderSVGAllInOne.cpp4
-rw-r--r--WebCore/rendering/RenderSVGHiddenContainer.h5
-rw-r--r--WebCore/rendering/RenderSVGResourceContainer.cpp131
-rw-r--r--WebCore/rendering/RenderSVGResourceContainer.h110
-rw-r--r--WebCore/rendering/RenderTable.cpp42
-rw-r--r--WebCore/rendering/RenderTableSection.cpp272
-rw-r--r--WebCore/rendering/RenderTableSection.h27
-rw-r--r--WebCore/rendering/RenderText.cpp6
-rw-r--r--WebCore/rendering/RenderTextControlSingleLine.cpp5
-rw-r--r--WebCore/rendering/RenderTextControlSingleLine.h1
-rw-r--r--WebCore/rendering/SVGResources.cpp360
-rw-r--r--WebCore/rendering/SVGResources.h103
-rw-r--r--WebCore/rendering/SVGResourcesCache.cpp179
-rw-r--r--WebCore/rendering/SVGResourcesCache.h65
-rw-r--r--WebCore/rendering/SVGResourcesCycleSolver.cpp296
-rw-r--r--WebCore/rendering/SVGResourcesCycleSolver.h52
-rw-r--r--WebCore/rendering/TextControlInnerElements.cpp19
-rw-r--r--WebCore/rendering/TextControlInnerElements.h4
-rw-r--r--WebCore/rendering/break_lines.cpp119
-rw-r--r--WebCore/storage/DatabaseAuthorizer.cpp3
-rw-r--r--WebCore/storage/IDBDatabaseImpl.cpp2
-rw-r--r--WebCore/storage/IDBKeyRange.cpp28
-rw-r--r--WebCore/storage/IDBKeyRange.h19
-rw-r--r--WebCore/storage/IDBKeyRange.idl9
-rw-r--r--WebCore/storage/IndexedDatabaseRequest.cpp23
-rw-r--r--WebCore/storage/IndexedDatabaseRequest.h7
-rw-r--r--WebCore/storage/IndexedDatabaseRequest.idl4
-rw-r--r--WebCore/storage/SQLTransaction.cpp3
-rw-r--r--WebCore/storage/SQLTransactionSync.cpp2
-rw-r--r--WebCore/storage/chromium/DatabaseObserver.h4
-rw-r--r--WebCore/storage/chromium/DatabaseTrackerChromium.cpp4
-rw-r--r--WebCore/storage/chromium/QuotaTracker.cpp5
-rw-r--r--WebCore/storage/chromium/QuotaTracker.h6
-rw-r--r--WebCore/storage/chromium/SQLTransactionClientChromium.cpp4
-rw-r--r--WebCore/svg/SVGDocumentExtensions.cpp5
-rw-r--r--WebCore/svg/SVGDocumentExtensions.h4
-rw-r--r--WebCore/svg/SVGFEDiffuseLightingElement.cpp12
-rw-r--r--WebCore/svg/SVGFEDiffuseLightingElement.h1
-rw-r--r--WebCore/svg/SVGFEOffsetElement.cpp10
-rw-r--r--WebCore/svg/SVGFEOffsetElement.h1
-rw-r--r--WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp20
-rw-r--r--WebCore/svg/SVGFilterPrimitiveStandardAttributes.h11
-rw-r--r--WebCore/svg/SVGForeignObjectElement.cpp2
-rw-r--r--WebCore/svg/SVGForeignObjectElement.h3
-rw-r--r--WebCore/svg/SVGMaskElement.cpp7
-rw-r--r--WebCore/svg/SVGMaskElement.h6
-rw-r--r--WebCore/svg/graphics/SVGImage.cpp18
-rw-r--r--WebCore/wml/WMLGoElement.cpp33
-rw-r--r--WebCore/wml/WMLGoElement.h4
-rw-r--r--WebCore/wml/WMLInputElement.h1
-rw-r--r--WebCore/wscript17
-rw-r--r--WebKit/CMakeLists.txt12
-rw-r--r--WebKit/ChangeLog65
-rw-r--r--WebKit/chromium/ChangeLog558
-rw-r--r--WebKit/chromium/DEPS2
-rw-r--r--WebKit/chromium/WebKit.gyp24
-rw-r--r--WebKit/chromium/WebKit.gypi1
-rw-r--r--WebKit/chromium/features.gypi2
-rw-r--r--WebKit/chromium/public/WebAccessibilityObject.h7
-rw-r--r--WebKit/chromium/public/WebAttribute.h74
-rw-r--r--WebKit/chromium/public/WebDOMStringList.h2
-rw-r--r--WebKit/chromium/public/WebDocument.h7
-rw-r--r--WebKit/chromium/public/WebDocumentType.h68
-rw-r--r--WebKit/chromium/public/WebElement.h3
-rw-r--r--WebKit/chromium/public/WebFloatPoint.h91
-rw-r--r--WebKit/chromium/public/WebFloatRect.h103
-rw-r--r--WebKit/chromium/public/WebFont.h100
-rw-r--r--WebKit/chromium/public/WebFontDescription.h106
-rw-r--r--WebKit/chromium/public/WebInputEvent.h4
-rw-r--r--WebKit/chromium/public/WebNamedNodeMap.h74
-rw-r--r--WebKit/chromium/public/WebSettings.h1
-rw-r--r--WebKit/chromium/public/WebSpeechInputController.h67
-rw-r--r--WebKit/chromium/public/WebSpeechInputListener.h70
-rw-r--r--WebKit/chromium/public/WebTextRun.h68
-rw-r--r--WebKit/chromium/public/WebView.h2
-rw-r--r--WebKit/chromium/public/WebViewClient.h10
-rw-r--r--WebKit/chromium/src/ApplicationCacheHost.cpp30
-rw-r--r--WebKit/chromium/src/AssertMatchingEnums.cpp30
-rw-r--r--WebKit/chromium/src/AutoFillPopupMenuClient.cpp25
-rw-r--r--WebKit/chromium/src/AutoFillPopupMenuClient.h9
-rw-r--r--WebKit/chromium/src/ChromiumBridge.cpp4
-rw-r--r--WebKit/chromium/src/ContextMenuClientImpl.cpp2
-rw-r--r--WebKit/chromium/src/DatabaseObserver.cpp4
-rw-r--r--WebKit/chromium/src/InspectorFrontendClientImpl.cpp11
-rw-r--r--WebKit/chromium/src/InspectorFrontendClientImpl.h1
-rw-r--r--WebKit/chromium/src/SpeechInputClientImpl.cpp94
-rw-r--r--WebKit/chromium/src/SpeechInputClientImpl.h74
-rw-r--r--WebKit/chromium/src/ToolsAgent.h8
-rw-r--r--WebKit/chromium/src/WebAccessibilityObject.cpp65
-rw-r--r--WebKit/chromium/src/WebAttribute.cpp68
-rw-r--r--WebKit/chromium/src/WebDOMStringList.cpp5
-rw-r--r--WebKit/chromium/src/WebDatabase.cpp16
-rw-r--r--WebKit/chromium/src/WebDevToolsAgentImpl.cpp53
-rw-r--r--WebKit/chromium/src/WebDevToolsAgentImpl.h9
-rw-r--r--WebKit/chromium/src/WebDevToolsFrontendImpl.cpp4
-rw-r--r--WebKit/chromium/src/WebDocument.cpp7
-rw-r--r--WebKit/chromium/src/WebDocumentType.cpp64
-rw-r--r--WebKit/chromium/src/WebElement.cpp7
-rw-r--r--WebKit/chromium/src/WebFontDescription.cpp71
-rw-r--r--WebKit/chromium/src/WebFontImpl.cpp126
-rw-r--r--WebKit/chromium/src/WebFontImpl.h66
-rw-r--r--WebKit/chromium/src/WebInputEventConversion.cpp22
-rw-r--r--WebKit/chromium/src/WebInputEventConversion.h4
-rw-r--r--WebKit/chromium/src/WebNamedNodeMap.cpp69
-rw-r--r--WebKit/chromium/src/WebPluginContainerImpl.cpp5
-rw-r--r--WebKit/chromium/src/WebSecurityPolicy.cpp7
-rw-r--r--WebKit/chromium/src/WebSettingsImpl.cpp5
-rw-r--r--WebKit/chromium/src/WebSettingsImpl.h1
-rw-r--r--WebKit/chromium/src/WebTextRun.cpp (renamed from WebCore/page/SpeechInputClientListener.h)29
-rw-r--r--WebKit/chromium/src/WebViewImpl.cpp33
-rw-r--r--WebKit/chromium/src/WebViewImpl.h9
-rw-r--r--WebKit/chromium/src/js/DebuggerScript.js6
-rw-r--r--WebKit/chromium/src/js/DevTools.js59
-rw-r--r--WebKit/chromium/src/js/DevToolsHostStub.js1
-rw-r--r--WebKit/chromium/src/js/InspectorControllerImpl.js161
-rw-r--r--WebKit/chromium/tests/PopupMenuTest.cpp1
-rw-r--r--WebKit/efl/CMakeListsEfl.txt (renamed from WebKit/CMakeListsEfl.txt)50
-rw-r--r--WebKit/efl/ChangeLog92
-rw-r--r--WebKit/efl/EWebLauncher/main.c21
-rw-r--r--WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp2
-rw-r--r--WebKit/efl/WebCoreSupport/EditorClientEfl.cpp2
-rw-r--r--WebKit/efl/ewk/ewk_cookies.cpp22
-rw-r--r--WebKit/efl/ewk/ewk_main.cpp8
-rw-r--r--WebKit/efl/ewk/ewk_private.h2
-rw-r--r--WebKit/efl/ewk/ewk_settings.cpp24
-rw-r--r--WebKit/efl/ewk/ewk_settings.h1
-rw-r--r--WebKit/efl/ewk/ewk_view.cpp97
-rw-r--r--WebKit/efl/ewk/ewk_view.h15
-rw-r--r--WebKit/gtk/ChangeLog10
-rw-r--r--WebKit/gtk/webkit/webkitwebview.cpp9
-rw-r--r--WebKit/mac/ChangeLog73
-rw-r--r--WebKit/mac/Configurations/FeatureDefines.xcconfig3
-rw-r--r--WebKit/mac/Configurations/Version.xcconfig2
-rw-r--r--WebKit/mac/WebCoreSupport/WebContextMenuClient.mm75
-rw-r--r--WebKit/mac/WebCoreSupport/WebEditorClient.mm6
-rw-r--r--WebKit/mac/WebCoreSupport/WebGeolocationControllerClient.h1
-rw-r--r--WebKit/mac/WebCoreSupport/WebPlatformStrategies.h108
-rw-r--r--WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm689
-rw-r--r--WebKit/mac/WebCoreSupport/WebViewFactory.mm673
-rw-r--r--WebKit/mac/WebView/WebView.mm18
-rw-r--r--WebKit/qt/Api/qgraphicswebview.cpp5
-rw-r--r--WebKit/qt/Api/qwebframe.cpp4
-rw-r--r--WebKit/qt/Api/qwebkitglobal.h4
-rw-r--r--WebKit/qt/Api/qwebpage.cpp44
-rw-r--r--WebKit/qt/Api/qwebpage.h16
-rw-r--r--WebKit/qt/Api/qwebpage_p.h3
-rw-r--r--WebKit/qt/Api/qwebsecurityorigin.cpp7
-rw-r--r--WebKit/qt/Api/qwebsettings.cpp32
-rw-r--r--WebKit/qt/Api/qwebview.cpp5
-rw-r--r--WebKit/qt/ChangeLog185
-rw-r--r--WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp26
-rw-r--r--WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h18
-rw-r--r--WebKit/qt/WebCoreSupport/EditorClientQt.cpp26
-rw-r--r--WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp10
-rw-r--r--WebKit/qt/WebCoreSupport/InspectorClientQt.cpp27
-rw-r--r--WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp107
-rw-r--r--WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h17
-rw-r--r--WebKit/qt/declarative/qdeclarativewebview.cpp2
-rw-r--r--WebKit/qt/qt_webkit_version.pri5
-rw-r--r--WebKit/qt/tests/qwebframe/tst_qwebframe.cpp28
-rw-r--r--WebKit/qt/tests/qwebview/tst_qwebview.cpp23
-rw-r--r--WebKit/win/ChangeLog46
-rw-r--r--WebKit/win/WebCoreSupport/WebEditorClient.cpp6
-rw-r--r--WebKit/win/WebCoreSupport/WebGeolocationControllerClient.h1
-rw-r--r--WebKit/win/WebView.cpp23
-rw-r--r--WebKit/wx/ChangeLog73
-rw-r--r--WebKit/wx/WebBrowserShell.cpp54
-rw-r--r--WebKit/wx/WebBrowserShell.h2
-rw-r--r--WebKit/wx/WebDOMSelection.cpp (renamed from JavaScriptCore/jit/ExecutableAllocatorWin.cpp)71
-rw-r--r--WebKit/wx/WebDOMSelection.h (renamed from WebCore/platform/win/PlatformScrollBarWin.cpp)50
-rw-r--r--WebKit/wx/WebEdit.h (renamed from WebCore/platform/win/PlatformScrollBar.h)50
-rw-r--r--WebKit/wx/WebFrame.cpp58
-rw-r--r--WebKit/wx/WebFrame.h31
-rw-r--r--WebKit/wx/WebKitDefines.h3
-rw-r--r--WebKit/wx/WebKitSupport/EditorClientWx.cpp6
-rw-r--r--WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp24
-rw-r--r--WebKit/wx/WebView.cpp98
-rw-r--r--WebKit/wx/WebView.h12
-rw-r--r--WebKit/wx/bindings/python/webview.i71
-rw-r--r--WebKit/wx/bindings/python/wscript6
-rw-r--r--WebKit/wx/wscript2
-rw-r--r--WebKitLibraries/ChangeLog10
-rw-r--r--WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops7
-rw-r--r--WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops7
-rw-r--r--WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json24
-rw-r--r--WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg13
-rw-r--r--WebKitTools/ChangeLog702
-rw-r--r--WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp25
-rw-r--r--WebKitTools/DumpRenderTree/AccessibilityUIElement.h2
-rw-r--r--WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp12
-rw-r--r--WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp4
-rw-r--r--WebKitTools/DumpRenderTree/gtk/EventSender.cpp51
-rw-r--r--WebKitTools/DumpRenderTree/gtk/EventSender.h7
-rw-r--r--WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm31
-rw-r--r--WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp57
-rw-r--r--WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h5
-rw-r--r--WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp8
-rw-r--r--WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h3
-rw-r--r--WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp10
-rw-r--r--WebKitTools/DumpRenderTree/wscript1
-rw-r--r--WebKitTools/Makefile2
-rw-r--r--WebKitTools/MiniBrowser/MiniBrowser.vcproj22
-rw-r--r--WebKitTools/MiniBrowser/mac/AppDelegate.m64
-rw-r--r--WebKitTools/MiniBrowser/mac/BrowserWindowController.m207
-rw-r--r--WebKitTools/MiniBrowser/mac/WebBundle/WebBundleMain.m7
-rw-r--r--WebKitTools/MiniBrowser/win/stdafx.h1
-rw-r--r--WebKitTools/QtTestBrowser/main.cpp146
-rw-r--r--WebKitTools/QtTestBrowser/webpage.cpp23
-rw-r--r--WebKitTools/QtTestBrowser/webpage.h3
-rwxr-xr-xWebKitTools/Scripts/build-webkit5
-rwxr-xr-xWebKitTools/Scripts/check-for-inappropriate-files-in-framework10
-rwxr-xr-xWebKitTools/Scripts/check-for-webkit-framework-include-consistency10
-rwxr-xr-xWebKitTools/Scripts/old-run-webkit-tests16
-rwxr-xr-xWebKitTools/Scripts/svn-unapply6
-rw-r--r--WebKitTools/Scripts/webkitdirs.pm2
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py22
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/cpp.py14
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py24
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/abstractstep.py7
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/options.py4
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm20
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h5
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl25
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp20
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h6
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp407
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h69
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp149
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h62
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/win/InjectedBundle.vcproj21
-rw-r--r--WebKitTools/WebKitTestRunner/TestController.cpp10
-rw-r--r--WebKitTools/WebKitTestRunner/TestController.h4
-rw-r--r--WebKitTools/WebKitTestRunner/TestInvocation.cpp2
-rw-r--r--WebKitTools/WebKitTestRunner/TestInvocation.h2
-rw-r--r--WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp2
-rw-r--r--WebKitTools/gdb/wtf.py133
-rw-r--r--WebKitTools/wx/browser/wscript3
-rw-r--r--WebKitTools/wx/build/settings.py8
638 files changed, 21001 insertions, 6668 deletions
diff --git a/JavaScriptCore/Android.mk b/JavaScriptCore/Android.mk
index 42df087..d55d8ab 100644
--- a/JavaScriptCore/Android.mk
+++ b/JavaScriptCore/Android.mk
@@ -167,6 +167,7 @@ LOCAL_SRC_FILES := \
wtf/HashTable.cpp \
wtf/MD5.cpp \
wtf/MainThread.cpp \
+ jit/PageAllocation.cpp\
wtf/RandomNumber.cpp \
wtf/RefCountedLeakCounter.cpp \
wtf/TCSystemAlloc.cpp \
diff --git a/JavaScriptCore/CMakeLists.txt b/JavaScriptCore/CMakeLists.txt
index efcc05d..08a0e72 100644
--- a/JavaScriptCore/CMakeLists.txt
+++ b/JavaScriptCore/CMakeLists.txt
@@ -168,6 +168,7 @@ SET(JavaScriptCore_SOURCES
yarr/RegexJIT.cpp
wtf/DateMath.cpp
+ wtf/PageAllocation.cpp
)
SET(JavaScriptCore_HEADERS )
diff --git a/JavaScriptCore/CMakeListsEfl.txt b/JavaScriptCore/CMakeListsEfl.txt
index 945ad52..7897ea5 100644
--- a/JavaScriptCore/CMakeListsEfl.txt
+++ b/JavaScriptCore/CMakeListsEfl.txt
@@ -1,6 +1,6 @@
LIST(APPEND JavaScriptCore_SOURCES
jit/ExecutableAllocatorFixedVMPool.cpp
- jit/ExecutableAllocatorPosix.cpp
+ jit/ExecutableAllocator.cpp
runtime/MarkStackPosix.cpp
)
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 5e01de2..2e8c1d1 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,570 @@
+2010-07-28 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Bug 43162 - Add support for MADV_FREE to PageAllocation.
+
+ * wtf/PageAllocation.cpp:
+ (WTF::PageAllocation::commit):
+ (WTF::PageAllocation::decommit):
+
+2010-07-27 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ Add FILE_SYSTEM build flag for FileSystem API
+ https://bugs.webkit.org/show_bug.cgi?id=42915
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2010-07-27 Gavin Barraclough <barraclough@apple.com>
+
+ Temporarily rolling out http://trac.webkit.org/changeset/64177,
+ this seems to give QT ARM/Win a headache (specifically, looks
+ like structure layour differs, objects get too large -
+ "..\..\..\JavaScriptCore\runtime\ArrayPrototype.cpp:41:"
+ "error: size of array 'dummyclass_fits_in_cell' is negative").
+
+ * jit/JITPropertyAccess.cpp:
+ (JSC::JIT::emit_op_get_by_val):
+ (JSC::JIT::emit_op_put_by_val):
+ (JSC::JIT::privateCompilePatchGetArrayLength):
+ * jit/JITPropertyAccess32_64.cpp:
+ (JSC::JIT::emit_op_get_by_val):
+ (JSC::JIT::emit_op_put_by_val):
+ (JSC::JIT::privateCompilePatchGetArrayLength):
+ * runtime/ArrayPrototype.cpp:
+ (JSC::arrayProtoFuncShift):
+ (JSC::arrayProtoFuncSplice):
+ (JSC::arrayProtoFuncUnShift):
+ * runtime/JSArray.cpp:
+ (JSC::increasedVectorLength):
+ (JSC::JSArray::JSArray):
+ (JSC::JSArray::~JSArray):
+ (JSC::JSArray::getOwnPropertySlot):
+ (JSC::JSArray::getOwnPropertyDescriptor):
+ (JSC::JSArray::put):
+ (JSC::JSArray::putSlowCase):
+ (JSC::JSArray::deleteProperty):
+ (JSC::JSArray::getOwnPropertyNames):
+ (JSC::JSArray::increaseVectorLength):
+ (JSC::JSArray::setLength):
+ (JSC::JSArray::pop):
+ (JSC::JSArray::push):
+ (JSC::JSArray::sortNumeric):
+ (JSC::JSArray::sort):
+ (JSC::JSArray::fillArgList):
+ (JSC::JSArray::copyToRegisters):
+ (JSC::JSArray::compactForSorting):
+ (JSC::JSArray::subclassData):
+ (JSC::JSArray::setSubclassData):
+ (JSC::JSArray::checkConsistency):
+ * runtime/JSArray.h:
+ (JSC::JSArray::length):
+ (JSC::JSArray::canGetIndex):
+ (JSC::JSArray::getIndex):
+ (JSC::JSArray::setIndex):
+ (JSC::JSArray::uncheckedSetIndex):
+ (JSC::JSArray::markChildrenDirect):
+
+2010-07-27 Gavin Barraclough <barraclough@apple.com>
+
+ Speculative build fix for Chromium/Win
+
+ * wtf/Platform.h:
+
+2010-07-27 Gavin Barraclough <barraclough@apple.com>
+
+ Oh! that makes more sense! Maybe C++-style comments are bringing teh bad mojo.
+
+ * wtf/Platform.h:
+
+2010-07-27 Gavin Barraclough <barraclough@apple.com>
+
+ Speculative build fix for GTK/64 ... seems to be barfing on a comment o_O
+
+ * wtf/Platform.h:
+
+2010-07-27 Michael Saboff <msaboff@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ Changed the handling for removing and adding elements at the front
+ of an array. The code now keeps a bias that indicates the amount of
+ JSValue sized holes are prior to the ArrayStorage block. This means
+ that shift operations are now memmove's of the header part of
+ the ArrayStorage and unshift operations are similar, but may require a
+ realloc first to create the space. Similar operations are performed
+ for special cases of splice and slice.
+ Also optimized the new Array(size) case so that we don't allocate and
+ initialize array elements until the JS code starts using elements.
+ The array growth code is slightly more aggressive for initial growth
+ based on size growth of any previous array.
+
+ * Configurations/JavaScriptCore.xcconfig:
+ * jit/JITPropertyAccess.cpp:
+ (JSC::JIT::emit_op_get_by_val):
+ (JSC::JIT::emit_op_put_by_val):
+ (JSC::JIT::privateCompilePatchGetArrayLength):
+ * jit/JITPropertyAccess32_64.cpp:
+ (JSC::JIT::emit_op_get_by_val):
+ (JSC::JIT::emit_op_put_by_val):
+ (JSC::JIT::privateCompilePatchGetArrayLength):
+ * runtime/ArrayPrototype.cpp:
+ (JSC::arrayProtoFuncShift):
+ (JSC::arrayProtoFuncSplice):
+ (JSC::arrayProtoFuncUnShift):
+ * runtime/JSArray.cpp:
+ (JSC::JSArray::JSArray):
+ (JSC::JSArray::~JSArray):
+ (JSC::JSArray::getOwnPropertySlot):
+ (JSC::JSArray::getOwnPropertyDescriptor):
+ (JSC::JSArray::put):
+ (JSC::JSArray::putSlowCase):
+ (JSC::JSArray::deleteProperty):
+ (JSC::JSArray::getOwnPropertyNames):
+ (JSC::JSArray::getNewVectorLength):
+ (JSC::JSArray::increaseVectorLength):
+ (JSC::JSArray::increaseVectorPrefixLength):
+ (JSC::JSArray::setLength):
+ (JSC::JSArray::pop):
+ (JSC::JSArray::push):
+ (JSC::JSArray::shiftCount):
+ (JSC::JSArray::unshiftCount):
+ (JSC::JSArray::sortNumeric):
+ (JSC::JSArray::sort):
+ (JSC::JSArray::fillArgList):
+ (JSC::JSArray::copyToRegisters):
+ (JSC::JSArray::compactForSorting):
+ (JSC::JSArray::subclassData):
+ (JSC::JSArray::setSubclassData):
+ (JSC::JSArray::checkConsistency):
+ * runtime/JSArray.h:
+ (JSC::JSArray::length):
+ (JSC::JSArray::canGetIndex):
+ (JSC::JSArray::getIndex):
+ (JSC::JSArray::setIndex):
+ (JSC::JSArray::uncheckedSetIndex):
+ (JSC::JSArray::arrayStorage):
+ (JSC::JSArray::setArrayStorage):
+ (JSC::JSArray::markChildrenDirect):
+
+2010-07-27 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Bug 43089 - Cleanup JIT related switched in Platform.h
+
+ The code the enable to JIT checks every permutation of platform & OS individually, but
+ now the JIT is enabled on the majority much all x86/x86-64/ARM/MIPS systems. It should
+ be cleaner to just enable by default on these platforms, and explicitly disable on configs
+ that don't aren't supported.
+
+ Also, rename ENABLE_JIT_OPTIMIZE_MOD to ENABLE_JIT_USE_SOFT_MODULO. I always find this
+ confusing since enabling this "optimization" would be possible, but would be a regression
+ on x86/x86-64 systems! I think it's clearer to reserve "JIT_OPTIMIZE" for compiler
+ technologies applicable to all platforms, and make a more optional behaviour like this a
+ "USE".
+
+ * jit/ExecutableAllocator.h:
+ (JSC::ExecutableAllocator::cacheFlush):
+ * jit/JIT.h:
+ * jit/JITArithmetic.cpp:
+ (JSC::JIT::emit_op_mod):
+ (JSC::JIT::emitSlow_op_mod):
+ * jit/JITArithmetic32_64.cpp:
+ (JSC::JIT::emit_op_mod):
+ (JSC::JIT::emitSlow_op_mod):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::privateCompileCTIMachineTrampolines):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::privateCompileCTIMachineTrampolines):
+ * wtf/Platform.h:
+
+2010-07-27 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [chromium] Make PLATFORM(CHROMIUM) and not OS(MAC) turn USE(GLES2_RENDERING) on
+ https://bugs.webkit.org/show_bug.cgi?id=43084
+
+ This turns USE(GLES2_RENDERING) on for chromium on windows/linux. This causes no
+ change in behavior, that's all controlled by ENABLE() macros that are currently off.
+
+ * wtf/Platform.h:
+
+2010-07-23 Helder Correia <heldercorreia@codeaurora.org>
+
+ Reviewed by Darin Adler.
+
+ Canvas tests 2d.imageData.object.round and 2d.imageData.object.wrap are
+ failing. For canvas image data manipulation, the values passed should
+ be truncated and wrapped. Also fix the canvas-ImageData-behaviour test
+ to expect wrapping rather than clamping, and add some new checkings.
+ https://bugs.webkit.org/show_bug.cgi?id=40272
+
+ * runtime/JSByteArray.h:
+ (JSC::JSByteArray::setIndex):
+ (JSC::JSByteArray::JSByteArray):
+
+2010-07-27 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Bug 42621 - Add a bump allocator for the YARR interpreter
+
+ The regex engine requires lifo allocation, however currently uses the general purpose
+ malloc/free memory allocation. A simple bump pointer allocator should provide a lower
+ overhead allocation solution.
+
+ When using YARR interpreter, 15% progression on v8-regex.
+
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * runtime/JSGlobalData.h:
+ * runtime/RegExp.cpp:
+ (JSC::RegExp::compile):
+ * wtf/BumpPointerAllocator.h: Added.
+ (WTF::BumpPointerPool::ensureCapacity):
+ (WTF::BumpPointerPool::alloc):
+ (WTF::BumpPointerPool::dealloc):
+ (WTF::BumpPointerPool::operator new):
+ (WTF::BumpPointerPool::BumpPointerPool):
+ (WTF::BumpPointerPool::create):
+ (WTF::BumpPointerPool::shrink):
+ (WTF::BumpPointerPool::destroy):
+ (WTF::BumpPointerPool::ensureCapacityCrossPool):
+ (WTF::BumpPointerPool::deallocCrossPool):
+ (WTF::BumpPointerAllocator::BumpPointerAllocator):
+ (WTF::BumpPointerAllocator::~BumpPointerAllocator):
+ (WTF::BumpPointerAllocator::startAllocator):
+ (WTF::BumpPointerAllocator::stopAllocator):
+ * yarr/RegexInterpreter.cpp:
+ (JSC::Yarr::Interpreter::allocDisjunctionContext):
+ (JSC::Yarr::Interpreter::freeDisjunctionContext):
+ (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
+ (JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext):
+ (JSC::Yarr::Interpreter::interpret):
+ (JSC::Yarr::Interpreter::Interpreter):
+ (JSC::Yarr::ByteCompiler::compile):
+ (JSC::Yarr::byteCompileRegex):
+ * yarr/RegexInterpreter.h:
+ (JSC::Yarr::BytecodePattern::BytecodePattern):
+
+2010-07-26 Gavin Barraclough <barraclough@apple.com>
+
+ Windows build fix from Chromium/GTK build fix!
+
+ * wtf/PageAllocation.cpp:
+
+2010-07-26 Gavin Barraclough <barraclough@apple.com>
+
+ Chromium/GTK build fix
+
+ * wtf/PageAllocation.cpp:
+
+2010-07-26 Gavin Barraclough <barraclough@apple.com>
+
+ Build fix for !Mac platforms.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * JavaScriptCore.gypi:
+ * JavaScriptCore.pro:
+ * JavaScriptCore.vcproj/WTF/WTF.vcproj:
+
+2010-07-26 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Bug 43009 - Abstract out page allocation from executable allocators
+
+ It would be great to have a single platform abstraction for block allocation, rather than copy/paste code.
+
+ In this initial implementation I've made Symbian fall back to use malloc/free for non-executable memory.
+ I think this will match current behaviour for the next client we will want to port across (RegisterFile &
+ Collector).
+
+ * CMakeListsEfl.txt:
+ * GNUmakefile.am:
+ * JavaScriptCore.gypi:
+ * JavaScriptCore.pro:
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * jit/ExecutableAllocator.cpp:
+ (JSC::ExecutableAllocator::intializePageSize):
+ (JSC::ExecutablePool::systemAlloc):
+ (JSC::ExecutablePool::systemRelease):
+ (JSC::ExecutableAllocator::isValid):
+ * jit/ExecutableAllocator.h:
+ (JSC::ExecutablePool::ExecutablePool):
+ (JSC::ExecutablePool::poolAllocate):
+ * jit/ExecutableAllocatorFixedVMPool.cpp:
+ (JSC::FixedVMPoolAllocator::release):
+ (JSC::FixedVMPoolAllocator::reuse):
+ (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
+ (JSC::FixedVMPoolAllocator::alloc):
+ (JSC::FixedVMPoolAllocator::free):
+ (JSC::FixedVMPoolAllocator::isValid):
+ (JSC::FixedVMPoolAllocator::isWithinVMPool):
+ (JSC::ExecutablePool::systemAlloc):
+ (JSC::ExecutablePool::systemRelease):
+ * jit/ExecutableAllocatorPosix.cpp: Removed.
+ * jit/ExecutableAllocatorSymbian.cpp: Removed.
+ * jit/ExecutableAllocatorWin.cpp: Removed.
+ * wscript:
+ * wtf/PageAllocator.cpp: Added.
+ (WTF::protection):
+ (WTF::PageAllocation::commit):
+ (WTF::PageAllocation::decommit):
+ (WTF::PageAllocator::allocate):
+ (WTF::PageAllocator::reserve):
+ (WTF::PageAllocator::deallocate):
+ (WTF::PageAllocator::pagesize):
+ * wtf/PageAllocator.h: Added.
+ (WTF::PageAllocation::PageAllocation):
+ (WTF::PageAllocation::base):
+ (WTF::PageAllocation::size):
+ (WTF::PageAllocation::chunk):
+ (WTF::PageAllocation::operator!):
+ (WTF::PageAllocator::):
+
+2010-07-26 Gavin Barraclough <barraclough@apple.com>
+
+ Rolling out r64097:64100, oops, more b0rked than I relized by my last changes, sorry!
+
+ * CMakeListsEfl.txt:
+ * GNUmakefile.am:
+ * JavaScriptCore.gypi:
+ * JavaScriptCore.pro:
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * jit/ExecutableAllocator.cpp:
+ (JSC::ExecutableAllocator::reprotectRegion):
+ (JSC::ExecutableAllocator::cacheFlush):
+ * jit/ExecutableAllocator.h:
+ (JSC::ExecutablePool::ExecutablePool):
+ (JSC::ExecutablePool::poolAllocate):
+ * jit/ExecutableAllocatorFixedVMPool.cpp:
+ (JSC::FixedVMPoolAllocator::release):
+ (JSC::FixedVMPoolAllocator::reuse):
+ (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
+ (JSC::FixedVMPoolAllocator::alloc):
+ (JSC::FixedVMPoolAllocator::free):
+ (JSC::FixedVMPoolAllocator::isValid):
+ (JSC::FixedVMPoolAllocator::isWithinVMPool):
+ (JSC::ExecutablePool::systemAlloc):
+ (JSC::ExecutablePool::systemRelease):
+ * jit/ExecutableAllocatorPosix.cpp: Added.
+ (JSC::ExecutableAllocator::intializePageSize):
+ (JSC::ExecutablePool::systemAlloc):
+ (JSC::ExecutablePool::systemRelease):
+ (JSC::ExecutableAllocator::isValid):
+ * jit/ExecutableAllocatorSymbian.cpp: Added.
+ (JSC::ExecutableAllocator::intializePageSize):
+ (JSC::ExecutablePool::systemAlloc):
+ (JSC::ExecutablePool::systemRelease):
+ (JSC::ExecutableAllocator::isValid):
+ * jit/ExecutableAllocatorWin.cpp: Added.
+ (JSC::ExecutableAllocator::intializePageSize):
+ (JSC::ExecutablePool::systemAlloc):
+ (JSC::ExecutablePool::systemRelease):
+ (JSC::ExecutableAllocator::isValid):
+ * wscript:
+ * wtf/PageAllocation.cpp: Removed.
+ * wtf/PageAllocation.h: Removed.
+
+2010-07-26 Gavin Barraclough <barraclough@apple.com>
+
+ Speculative !debug build fix II.
+
+ * wtf/PageAllocation.h:
+ (WTF::PageAllocation::PageAllocation):
+
+2010-07-26 Gavin Barraclough <barraclough@apple.com>
+
+ Speculative !debug build fix.
+
+ * wtf/PageAllocation.h:
+ (WTF::PageAllocation::PageAllocation):
+
+2010-07-26 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Bug 43009 - Abstract out page allocation from executable allocators
+
+ It would be great to have a single platform abstraction for block allocation, rather than copy/paste code.
+
+ In this initial implementation I've made Symbian fall back to use malloc/free for non-executable memory.
+ I think this will match current behaviour for the next client we will want to port across (RegisterFile &
+ Collector).
+
+ * CMakeListsEfl.txt:
+ * GNUmakefile.am:
+ * JavaScriptCore.gypi:
+ * JavaScriptCore.pro:
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * jit/ExecutableAllocator.cpp:
+ (JSC::ExecutableAllocator::intializePageSize):
+ (JSC::ExecutablePool::systemAlloc):
+ (JSC::ExecutablePool::systemRelease):
+ (JSC::ExecutableAllocator::isValid):
+ * jit/ExecutableAllocator.h:
+ (JSC::ExecutablePool::ExecutablePool):
+ (JSC::ExecutablePool::poolAllocate):
+ * jit/ExecutableAllocatorFixedVMPool.cpp:
+ (JSC::FixedVMPoolAllocator::release):
+ (JSC::FixedVMPoolAllocator::reuse):
+ (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
+ (JSC::FixedVMPoolAllocator::alloc):
+ (JSC::FixedVMPoolAllocator::free):
+ (JSC::FixedVMPoolAllocator::isValid):
+ (JSC::FixedVMPoolAllocator::isWithinVMPool):
+ (JSC::ExecutablePool::systemAlloc):
+ (JSC::ExecutablePool::systemRelease):
+ * jit/ExecutableAllocatorPosix.cpp: Removed.
+ * jit/ExecutableAllocatorSymbian.cpp: Removed.
+ * jit/ExecutableAllocatorWin.cpp: Removed.
+ * wscript:
+ * wtf/PageAllocator.cpp: Added.
+ (WTF::protection):
+ (WTF::PageAllocation::commit):
+ (WTF::PageAllocation::decommit):
+ (WTF::PageAllocator::allocate):
+ (WTF::PageAllocator::reserve):
+ (WTF::PageAllocator::deallocate):
+ (WTF::PageAllocator::pagesize):
+ * wtf/PageAllocator.h: Added.
+ (WTF::PageAllocation::PageAllocation):
+ (WTF::PageAllocation::base):
+ (WTF::PageAllocation::size):
+ (WTF::PageAllocation::chunk):
+ (WTF::PageAllocation::operator!):
+ (WTF::PageAllocator::):
+
+2009-10-30 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Use the default timeout interval for JS as the HTML tokenizer delay for setHtml()
+
+ This ensures that long-running JavaScript (for example due to a modal alert() dialog),
+ will not trigger a deferred load after only 500ms (the default tokenizer delay) while
+ still giving a reasonable timeout (10 seconds) to prevent deadlock.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29381
+
+ * runtime/TimeoutChecker.h: Add getter for the timeout interval
+
+2010-07-25 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Kent Tamura.
+
+ [WINCE] Buildfix for JSC in release mode
+ https://bugs.webkit.org/show_bug.cgi?id=42934
+
+ * jsc.cpp: Don't use __try on WinCE.
+
+2010-07-24 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Darin Adler.
+
+ [MSVC] Ensure 4 byte alignment on ARM
+ https://bugs.webkit.org/show_bug.cgi?id=42935
+
+ * jit/JITStubs.h: Added #pragma pack(4) around JITStackFrame.
+
+2010-07-24 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Darin Adler.
+
+ [WINCE] Cleanup defines in Platform.h
+ https://bugs.webkit.org/show_bug.cgi?id=42933
+
+ * wtf/Platform.h:
+
+2010-07-23 Rafael Antognolli <antognolli@profusion.mobi>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Cleanup glib support (make it optional)
+ https://bugs.webkit.org/show_bug.cgi?id=42480
+
+ Remove gobject/GRefPtr.cpp if not using soup/glib.
+
+ * wtf/CMakeListsEfl.txt:
+
+2010-07-23 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Implement TCSpinLock.
+ https://bugs.webkit.org/show_bug.cgi?id=41792
+
+ Implement the SpinLock with InterlockedExchange from the Windows API.
+
+ * wtf/TCSpinLock.h:
+ (TCMalloc_SpinLock::Lock):
+ (TCMalloc_SpinLock::Unlock):
+ (TCMalloc_SpinLock::IsHeld):
+ (TCMalloc_SpinLock::Init):
+ (TCMalloc_SlowLock):
+
+2010-07-22 Csaba Osztrogonác <ossy@webkit.org>
+
+ Unreviewed rolling out r63947 and r63948, because they broke Qt Windows build.
+
+ * jit/JITStubs.cpp:
+ * jit/JITStubs.h:
+
+2010-07-22 Gavin Barraclough <barraclough@apple.com>
+
+ Eeeep! r63947 hosed all non-x86 builds!
+
+ * jit/JITStubs.h:
+
+2010-07-22 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Bug 42818 - [Qt] REGRESSION(63348): jsc is broken
+ Speculative fix, need fastcall conventions on Qt/Win.
+
+ * jit/JITStubs.cpp:
+ * jit/JITStubs.h:
+
+2010-07-22 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ Do more constant folding
+ https://bugs.webkit.org/show_bug.cgi?id=42867
+
+ Constant fold a few more operations. SunSpider says this is
+ a win but I suspect that's just code motion at play.
+
+ * parser/ASTBuilder.h:
+ (JSC::ASTBuilder::makeModNode):
+ (JSC::ASTBuilder::makeURightShiftNode):
+ (JSC::ASTBuilder::makeBitOrNode):
+ (JSC::ASTBuilder::makeBitAndNode):
+ (JSC::ASTBuilder::makeBitXOrNode):
+ (JSC::ASTBuilder::makeBinaryNode):
+
+2010-07-22 Kent Hansen <kent.hansen@nokia.com>
+
+ Reviewed by Kent Tamura.
+
+ Error properties of the Global Object are missing the DontEnum attribute
+ https://bugs.webkit.org/show_bug.cgi?id=28771
+
+ Add the attributes to become spec compliant.
+
+ * runtime/JSGlobalObject.cpp:
+ (JSC::JSGlobalObject::reset):
+
2010-07-20 Steve Falkenburg <sfalken@apple.com>
Reviewed by Adam Roben.
diff --git a/JavaScriptCore/Configurations/FeatureDefines.xcconfig b/JavaScriptCore/Configurations/FeatureDefines.xcconfig
index 4b363aa..8e33a91 100644
--- a/JavaScriptCore/Configurations/FeatureDefines.xcconfig
+++ b/JavaScriptCore/Configurations/FeatureDefines.xcconfig
@@ -55,6 +55,7 @@ ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE;
ENABLE_FILTERS = ENABLE_FILTERS;
ENABLE_FILE_READER = ENABLE_FILE_READER;
ENABLE_FILE_WRITER = ;
+ENABLE_FILE_SYSTEM = ;
ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
ENABLE_ICONDATABASE = ENABLE_ICONDATABASE;
ENABLE_IMAGE_RESIZER = ;
@@ -85,4 +86,4 @@ ENABLE_XHTMLMP = ;
ENABLE_XPATH = ENABLE_XPATH;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_FILE_SYSTEM) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
diff --git a/JavaScriptCore/Configurations/Version.xcconfig b/JavaScriptCore/Configurations/Version.xcconfig
index 2749545..c1b6b32 100644
--- a/JavaScriptCore/Configurations/Version.xcconfig
+++ b/JavaScriptCore/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 534;
-MINOR_VERSION = 3;
+MINOR_VERSION = 4;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/JavaScriptCore/GNUmakefile.am b/JavaScriptCore/GNUmakefile.am
index 9a2886f..98f491c 100644
--- a/JavaScriptCore/GNUmakefile.am
+++ b/JavaScriptCore/GNUmakefile.am
@@ -456,6 +456,8 @@ javascriptcore_sources += \
JavaScriptCore/wtf/OwnFastMallocPtr.h \
JavaScriptCore/wtf/OwnPtrCommon.h \
JavaScriptCore/wtf/OwnPtr.h \
+ JavaScriptCore/wtf/PageAllocation.cpp \
+ JavaScriptCore/wtf/PageAllocation.h \
JavaScriptCore/wtf/PassOwnPtr.h \
JavaScriptCore/wtf/PassRefPtr.h \
JavaScriptCore/wtf/Platform.h \
@@ -526,12 +528,10 @@ javascriptcore_sources += \
if TARGET_WIN32
javascriptcore_sources += \
JavaScriptCore/wtf/ThreadSpecificWin.cpp \
- JavaScriptCore/jit/ExecutableAllocatorWin.cpp \
JavaScriptCore/runtime/MarkStackWin.cpp
else
javascriptcore_sources += \
JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp \
- JavaScriptCore/jit/ExecutableAllocatorPosix.cpp \
JavaScriptCore/runtime/MarkStackPosix.cpp
endif
diff --git a/JavaScriptCore/JavaScriptCore.gypi b/JavaScriptCore/JavaScriptCore.gypi
index 066e1ff..9281576 100644
--- a/JavaScriptCore/JavaScriptCore.gypi
+++ b/JavaScriptCore/JavaScriptCore.gypi
@@ -110,8 +110,6 @@
'jit/ExecutableAllocator.cpp',
'jit/ExecutableAllocator.h',
'jit/ExecutableAllocatorFixedVMPool.cpp',
- 'jit/ExecutableAllocatorPosix.cpp',
- 'jit/ExecutableAllocatorWin.cpp',
'jit/JIT.cpp',
'jit/JIT.h',
'jit/JITArithmetic.cpp',
@@ -396,6 +394,8 @@
'wtf/OwnFastMallocPtr.h',
'wtf/OwnPtr.h',
'wtf/OwnPtrCommon.h',
+ 'wtf/PageAllocation.cpp',
+ 'wtf/PageAllocation.h',
'wtf/PassOwnPtr.h',
'wtf/PassRefPtr.h',
'wtf/Platform.h',
diff --git a/JavaScriptCore/JavaScriptCore.pro b/JavaScriptCore/JavaScriptCore.pro
index 84ce83c..2489580 100644
--- a/JavaScriptCore/JavaScriptCore.pro
+++ b/JavaScriptCore/JavaScriptCore.pro
@@ -94,9 +94,6 @@ SOURCES += \
interpreter/Interpreter.cpp \
interpreter/RegisterFile.cpp \
jit/ExecutableAllocatorFixedVMPool.cpp \
- jit/ExecutableAllocatorPosix.cpp \
- jit/ExecutableAllocatorSymbian.cpp \
- jit/ExecutableAllocatorWin.cpp \
jit/ExecutableAllocator.cpp \
jit/JITArithmetic.cpp \
jit/JITArithmetic32_64.cpp \
@@ -215,6 +212,7 @@ SOURCES += \
wtf/qt/MainThreadQt.cpp \
wtf/qt/StringQt.cpp \
wtf/qt/ThreadingQt.cpp \
+ wtf/PageAllocation.cpp \
wtf/RandomNumber.cpp \
wtf/RefCountedLeakCounter.cpp \
wtf/symbian/BlockAllocatorSymbian.cpp \
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
index dbddfe0..7819f99 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
+++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
@@ -1641,10 +1641,6 @@
>
</File>
<File
- RelativePath="..\..\jit\ExecutableAllocatorWin.cpp"
- >
- </File>
- <File
RelativePath="..\..\jit\JIT.cpp"
>
</File>
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj b/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
index f7652df..7f18f7e 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
+++ b/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
@@ -429,6 +429,14 @@
>
</File>
<File
+ RelativePath="..\..\wtf\PageAllocation.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\wtf\PageAllocation.h"
+ >
+ </File>
+ <File
RelativePath="..\..\wtf\PassOwnPtr.h"
>
</File>
diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index 562b4a1..9e86120 100644
--- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -198,10 +198,13 @@
860161E50F3A83C100F84710 /* MacroAssemblerX86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 860161E10F3A83C100F84710 /* MacroAssemblerX86_64.h */; };
860161E60F3A83C100F84710 /* MacroAssemblerX86Common.h in Headers */ = {isa = PBXBuildFile; fileRef = 860161E20F3A83C100F84710 /* MacroAssemblerX86Common.h */; };
8626BECF11928E3900782FAB /* StringStatics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8626BECE11928E3900782FAB /* StringStatics.cpp */; };
+ 8627E5EB11F1281900A313B5 /* PageAllocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8627E5E911F1281900A313B5 /* PageAllocation.cpp */; };
+ 8627E5EC11F1281900A313B5 /* PageAllocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 8627E5EA11F1281900A313B5 /* PageAllocation.h */; settings = {ATTRIBUTES = (Private, ); }; };
863B23E00FC6118900703AA4 /* MacroAssemblerCodeRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 863B23DF0FC60E6200703AA4 /* MacroAssemblerCodeRef.h */; settings = {ATTRIBUTES = (Private, ); }; };
86565742115BE3DA00291F40 /* CString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86565740115BE3DA00291F40 /* CString.cpp */; };
86565743115BE3DA00291F40 /* CString.h in Headers */ = {isa = PBXBuildFile; fileRef = 86565741115BE3DA00291F40 /* CString.h */; settings = {ATTRIBUTES = (Private, ); }; };
865F408810E7D56300947361 /* APIShims.h in Headers */ = {isa = PBXBuildFile; fileRef = 865F408710E7D56300947361 /* APIShims.h */; };
+ 86676D5211FED9BC004B6863 /* BumpPointerAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 86676D4D11FED55D004B6863 /* BumpPointerAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; };
868BFA08117CEFD100B908B1 /* AtomicString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 868BFA00117CEFD100B908B1 /* AtomicString.cpp */; };
868BFA09117CEFD100B908B1 /* AtomicString.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA01117CEFD100B908B1 /* AtomicString.h */; settings = {ATTRIBUTES = (Private, ); }; };
868BFA0A117CEFD100B908B1 /* AtomicStringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA02117CEFD100B908B1 /* AtomicStringImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -312,7 +315,6 @@
A76C51761182748D00715B05 /* JSInterfaceJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = A76C51741182748D00715B05 /* JSInterfaceJIT.h */; };
A76EE6590FAE59D5003F069A /* NativeFunctionWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = A76EE6580FAE59D5003F069A /* NativeFunctionWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
A7795590101A74D500114E55 /* MarkStack.h in Headers */ = {isa = PBXBuildFile; fileRef = A779558F101A74D500114E55 /* MarkStack.h */; settings = {ATTRIBUTES = (Private, ); }; };
- A782F1A50EEC9FA20036273F /* ExecutableAllocatorPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A782F1A40EEC9FA20036273F /* ExecutableAllocatorPosix.cpp */; };
A783A0D111A36DCA00563D20 /* JSObjectWithGlobalObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A783A0D011A36DCA00563D20 /* JSObjectWithGlobalObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
A783A2AB11A5BE8400563D20 /* JSObjectWithGlobalObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A783A2AA11A5BE8400563D20 /* JSObjectWithGlobalObject.cpp */; };
A784A26111D16622005776AC /* ASTBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A7EE7411B98B8D0065A14F /* ASTBuilder.h */; };
@@ -767,10 +769,13 @@
860161E10F3A83C100F84710 /* MacroAssemblerX86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerX86_64.h; sourceTree = "<group>"; };
860161E20F3A83C100F84710 /* MacroAssemblerX86Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerX86Common.h; sourceTree = "<group>"; };
8626BECE11928E3900782FAB /* StringStatics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringStatics.cpp; path = text/StringStatics.cpp; sourceTree = "<group>"; };
+ 8627E5E911F1281900A313B5 /* PageAllocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageAllocation.cpp; sourceTree = "<group>"; };
+ 8627E5EA11F1281900A313B5 /* PageAllocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageAllocation.h; sourceTree = "<group>"; };
863B23DF0FC60E6200703AA4 /* MacroAssemblerCodeRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerCodeRef.h; sourceTree = "<group>"; };
86565740115BE3DA00291F40 /* CString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CString.cpp; path = text/CString.cpp; sourceTree = "<group>"; };
86565741115BE3DA00291F40 /* CString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CString.h; path = text/CString.h; sourceTree = "<group>"; };
865F408710E7D56300947361 /* APIShims.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIShims.h; sourceTree = "<group>"; };
+ 86676D4D11FED55D004B6863 /* BumpPointerAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BumpPointerAllocator.h; sourceTree = "<group>"; };
867FC35F11B763950025105E /* JavaScriptCore.JSVALUE32_64only.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = JavaScriptCore.JSVALUE32_64only.exp; sourceTree = "<group>"; };
867FC36011B763950025105E /* JavaScriptCore.JSVALUE32only.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = JavaScriptCore.JSVALUE32only.exp; sourceTree = "<group>"; };
867FC36111B763950025105E /* JavaScriptCore.JSVALUE64only.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = JavaScriptCore.JSVALUE64only.exp; sourceTree = "<group>"; };
@@ -812,7 +817,6 @@
86D3B2C210156BDE002865E7 /* MacroAssemblerARM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerARM.h; sourceTree = "<group>"; };
86D3B3C110159D7F002865E7 /* LinkBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkBuffer.h; sourceTree = "<group>"; };
86D3B3C210159D7F002865E7 /* RepatchBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RepatchBuffer.h; sourceTree = "<group>"; };
- 86DB645F0F954E9100D7D921 /* ExecutableAllocatorWin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutableAllocatorWin.cpp; sourceTree = "<group>"; };
86DB64630F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutableAllocatorFixedVMPool.cpp; sourceTree = "<group>"; };
86E116B00FE75AC800B512BC /* CodeLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeLocation.h; sourceTree = "<group>"; };
86E85538111B9968001AF51E /* JSStringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStringBuilder.h; sourceTree = "<group>"; };
@@ -914,7 +918,6 @@
A76C51741182748D00715B05 /* JSInterfaceJIT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInterfaceJIT.h; sourceTree = "<group>"; };
A76EE6580FAE59D5003F069A /* NativeFunctionWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeFunctionWrapper.h; sourceTree = "<group>"; };
A779558F101A74D500114E55 /* MarkStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkStack.h; sourceTree = "<group>"; };
- A782F1A40EEC9FA20036273F /* ExecutableAllocatorPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutableAllocatorPosix.cpp; sourceTree = "<group>"; };
A783A0D011A36DCA00563D20 /* JSObjectWithGlobalObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSObjectWithGlobalObject.h; sourceTree = "<group>"; };
A783A2AA11A5BE8400563D20 /* JSObjectWithGlobalObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSObjectWithGlobalObject.cpp; sourceTree = "<group>"; };
A791EF260F11E07900AE1F68 /* JSByteArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSByteArray.h; sourceTree = "<group>"; };
@@ -1253,8 +1256,6 @@
A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */,
A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */,
86DB64630F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp */,
- A782F1A40EEC9FA20036273F /* ExecutableAllocatorPosix.cpp */,
- 86DB645F0F954E9100D7D921 /* ExecutableAllocatorWin.cpp */,
1429D92D0ED22D7000B89619 /* JIT.cpp */,
1429D92E0ED22D7000B89619 /* JIT.h */,
86A90ECF0EE7D51F00AB350D /* JITArithmetic.cpp */,
@@ -1405,6 +1406,7 @@
65E217B708E7EECC0023E5F6 /* Assertions.h */,
BC5F7BBB11823B590052C02C /* Atomics.h */,
E1A596370DE3E1C300C17E37 /* AVLTree.h */,
+ 86676D4D11FED55D004B6863 /* BumpPointerAllocator.h */,
A7A1F7AA0F252B3C00E184E2 /* ByteArray.cpp */,
A7A1F7AB0F252B3C00E184E2 /* ByteArray.h */,
0BDFFAD40FC6171000D69EF4 /* CrossThreadRefCounted.h */,
@@ -1446,6 +1448,8 @@
0BDFFAD10FC616EC00D69EF4 /* OwnFastMallocPtr.h */,
9303F567099118FA00AD71B8 /* OwnPtr.h */,
440B7AED0FAF7FCB0073323E /* OwnPtrCommon.h */,
+ 8627E5E911F1281900A313B5 /* PageAllocation.cpp */,
+ 8627E5EA11F1281900A313B5 /* PageAllocation.h */,
44DD48520FAEA85000D6B4EB /* PassOwnPtr.h */,
6580F795094070560082C219 /* PassRefPtr.h */,
65D6D87E09B5A32E0002E4D7 /* Platform.h */,
@@ -1920,6 +1924,7 @@
BC18C3EB0E16F5CD00B34460 /* AVLTree.h in Headers */,
147B83AC0E6DB8C9004775A4 /* BatchedTransitionOptimizer.h in Headers */,
BC18C3EC0E16F5CD00B34460 /* BooleanObject.h in Headers */,
+ 86676D5211FED9BC004B6863 /* BumpPointerAllocator.h in Headers */,
A7A1F7AD0F252B3C00E184E2 /* ByteArray.h in Headers */,
969A07230ED1CE3300F1F681 /* BytecodeGenerator.h in Headers */,
869D04AF1193B54D00803475 /* CachedTranscendentalFunction.h in Headers */,
@@ -2082,6 +2087,7 @@
0BDFFAE10FC6193100D69EF4 /* OwnFastMallocPtr.h in Headers */,
BC18C44A0E16F5CD00B34460 /* OwnPtr.h in Headers */,
4409D8470FAF80A200523B87 /* OwnPtrCommon.h in Headers */,
+ 8627E5EC11F1281900A313B5 /* PageAllocation.h in Headers */,
BC18C44B0E16F5CD00B34460 /* Parser.h in Headers */,
93052C350FB792190048FDC3 /* ParserArena.h in Headers */,
44DD48530FAEA85000D6B4EB /* PassOwnPtr.h in Headers */,
@@ -2496,7 +2502,6 @@
86CA032E1038E8440028A609 /* Executable.cpp in Sources */,
A7B48F490EE8936F00DCBDB6 /* ExecutableAllocator.cpp in Sources */,
86DB64640F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp in Sources */,
- A782F1A50EEC9FA20036273F /* ExecutableAllocatorPosix.cpp in Sources */,
14F8BA3E107EC886009892DC /* FastMalloc.cpp in Sources */,
147F39CB107EC37600427A48 /* FunctionConstructor.cpp in Sources */,
147F39CC107EC37600427A48 /* FunctionPrototype.cpp in Sources */,
@@ -2627,6 +2632,7 @@
E1EF79AA0CE97BA60088D500 /* UTF8.cpp in Sources */,
868BFA17117CF19900B908B1 /* WTFString.cpp in Sources */,
86D08D5311793613006E5ED0 /* WTFThreadData.cpp in Sources */,
+ 8627E5EB11F1281900A313B5 /* PageAllocation.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/JavaScriptCore/jit/ExecutableAllocator.cpp b/JavaScriptCore/jit/ExecutableAllocator.cpp
index 5e10e86..86c24fd 100644
--- a/JavaScriptCore/jit/ExecutableAllocator.cpp
+++ b/JavaScriptCore/jit/ExecutableAllocator.cpp
@@ -33,7 +33,48 @@ namespace JSC {
size_t ExecutableAllocator::pageSize = 0;
+#if ENABLE(EXECUTABLE_ALLOCATOR_DEMAND)
+
+void ExecutableAllocator::intializePageSize()
+{
+#if CPU(ARMV5_OR_LOWER)
+ // The moving memory model (as used in ARMv5 and earlier platforms)
+ // on Symbian OS limits the number of chunks for each process to 16.
+ // To mitigate this limitation increase the pagesize to allocate
+ // fewer, larger chunks. Set the page size to 256 Kb to compensate
+ // for moving memory model limitation
+ ExecutableAllocator::pageSize = 256 * 1024;
+#else
+ ExecutableAllocator::pageSize = PageAllocation::pagesize();
+#endif
+}
+
+ExecutablePool::Allocation ExecutablePool::systemAlloc(size_t size)
+{
+ PageAllocation allocation = PageAllocation::allocate(size, PageAllocation::JSJITCodePages, EXECUTABLE_POOL_WRITABLE, true);
+ if (!allocation)
+ CRASH();
+ return allocation;
+}
+
+void ExecutablePool::systemRelease(ExecutablePool::Allocation& allocation)
+{
+ allocation.deallocate();
+}
+
+bool ExecutableAllocator::isValid() const
+{
+ return true;
+}
+
+#endif
+
#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
+
+#if OS(WINDOWS) || OS(SYMBIAN)
+#error "ASSEMBLER_WX_EXCLUSIVE not yet suported on this platform."
+#endif
+
void ExecutableAllocator::reprotectRegion(void* start, size_t size, ProtectionSeting setting)
{
if (!pageSize)
@@ -52,9 +93,11 @@ void ExecutableAllocator::reprotectRegion(void* start, size_t size, ProtectionSe
mprotect(pageStart, size, (setting == Writable) ? PROTECTION_FLAGS_RW : PROTECTION_FLAGS_RX);
}
+
#endif
#if CPU(ARM_TRADITIONAL) && OS(LINUX) && COMPILER(RVCT)
+
__asm void ExecutableAllocator::cacheFlush(void* code, size_t size)
{
ARM
@@ -67,6 +110,7 @@ __asm void ExecutableAllocator::cacheFlush(void* code, size_t size)
pop {r7}
bx lr
}
+
#endif
}
diff --git a/JavaScriptCore/jit/ExecutableAllocator.h b/JavaScriptCore/jit/ExecutableAllocator.h
index 8fd6b71..f8e991f 100644
--- a/JavaScriptCore/jit/ExecutableAllocator.h
+++ b/JavaScriptCore/jit/ExecutableAllocator.h
@@ -28,6 +28,7 @@
#include <stddef.h> // for ptrdiff_t
#include <limits>
#include <wtf/Assertions.h>
+#include <wtf/PageAllocation.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/UnusedParam.h>
@@ -58,9 +59,9 @@ extern "C" __declspec(dllimport) void CacheRangeFlush(LPVOID pAddr, DWORD dwLeng
#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
#define PROTECTION_FLAGS_RW (PROT_READ | PROT_WRITE)
#define PROTECTION_FLAGS_RX (PROT_READ | PROT_EXEC)
-#define INITIAL_PROTECTION_FLAGS PROTECTION_FLAGS_RX
+#define EXECUTABLE_POOL_WRITABLE false
#else
-#define INITIAL_PROTECTION_FLAGS (PROT_READ | PROT_WRITE | PROT_EXEC)
+#define EXECUTABLE_POOL_WRITABLE true
#endif
namespace JSC {
@@ -85,13 +86,7 @@ namespace JSC {
class ExecutablePool : public RefCounted<ExecutablePool> {
private:
- struct Allocation {
- char* pages;
- size_t size;
-#if OS(SYMBIAN)
- RChunk* chunk;
-#endif
- };
+ typedef PageAllocation Allocation;
typedef Vector<Allocation, 2> AllocationList;
public:
@@ -121,8 +116,8 @@ public:
~ExecutablePool()
{
- AllocationList::const_iterator end = m_pools.end();
- for (AllocationList::const_iterator ptr = m_pools.begin(); ptr != end; ++ptr)
+ AllocationList::iterator end = m_pools.end();
+ for (AllocationList::iterator ptr = m_pools.begin(); ptr != end; ++ptr)
ExecutablePool::systemRelease(*ptr);
}
@@ -130,7 +125,7 @@ public:
private:
static Allocation systemAlloc(size_t n);
- static void systemRelease(const Allocation& alloc);
+ static void systemRelease(Allocation& alloc);
ExecutablePool(size_t n);
@@ -204,8 +199,8 @@ public:
#elif CPU(MIPS)
static void cacheFlush(void* code, size_t size)
{
-#if COMPILER(GCC) && (GCC_VERSION >= 40300)
-#if WTF_MIPS_ISA_REV(2) && (GCC_VERSION < 40403)
+#if COMPILER(GCC) && GCC_VERSION_AT_LEAST(4,3,0)
+#if WTF_MIPS_ISA_REV(2) && GCC_VERSION_AT_LEAST(4,4,3)
int lineSize;
asm("rdhwr %0, $1" : "=r" (lineSize));
//
@@ -296,7 +291,7 @@ inline ExecutablePool::ExecutablePool(size_t n)
size_t allocSize = roundUpAllocationSize(n, JIT_ALLOCATOR_PAGE_SIZE);
Allocation mem = systemAlloc(allocSize);
m_pools.append(mem);
- m_freePtr = mem.pages;
+ m_freePtr = static_cast<char*>(mem.base());
if (!m_freePtr)
CRASH(); // Failed to allocate
m_end = m_freePtr + allocSize;
@@ -307,18 +302,18 @@ inline void* ExecutablePool::poolAllocate(size_t n)
size_t allocSize = roundUpAllocationSize(n, JIT_ALLOCATOR_PAGE_SIZE);
Allocation result = systemAlloc(allocSize);
- if (!result.pages)
+ if (!result.base())
CRASH(); // Failed to allocate
ASSERT(m_end >= m_freePtr);
if ((allocSize - n) > static_cast<size_t>(m_end - m_freePtr)) {
// Replace allocation pool
- m_freePtr = result.pages + n;
- m_end = result.pages + allocSize;
+ m_freePtr = static_cast<char*>(result.base()) + n;
+ m_end = static_cast<char*>(result.base()) + allocSize;
}
m_pools.append(result);
- return result.pages;
+ return result.base();
}
}
diff --git a/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp b/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
index 65c9c13..421c34b 100644
--- a/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
+++ b/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
@@ -124,30 +124,17 @@ class FixedVMPoolAllocator
// The free list is stored in a sorted tree.
typedef AVLTree<AVLTreeAbstractorForFreeList, 40> SizeSortedFreeTree;
- // Use madvise as apropriate to prevent freed pages from being spilled,
- // and to attempt to ensure that used memory is reported correctly.
-#if HAVE(MADV_FREE_REUSE)
void release(void* position, size_t size)
{
- while (madvise(position, size, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { }
+ m_allocation.decommit(position, size);
}
void reuse(void* position, size_t size)
{
- while (madvise(position, size, MADV_FREE_REUSE) == -1 && errno == EAGAIN) { }
- }
-#elif HAVE(MADV_DONTNEED)
- void release(void* position, size_t size)
- {
- while (madvise(position, size, MADV_DONTNEED) == -1 && errno == EAGAIN) { }
+ bool okay = m_allocation.commit(position, size, EXECUTABLE_POOL_WRITABLE, true);
+ ASSERT_UNUSED(okay, okay);
}
- void reuse(void*, size_t) {}
-#else
- void release(void*, size_t) {}
- void reuse(void*, size_t) {}
-#endif
-
// All addition to the free list should go through this method, rather than
// calling insert directly, to avoid multiple entries beging added with the
// same key. All nodes being added should be singletons, they should not
@@ -288,7 +275,6 @@ public:
FixedVMPoolAllocator(size_t commonSize, size_t totalHeapSize)
: m_commonSize(commonSize)
, m_countFreedSinceLastCoalesce(0)
- , m_totalHeapSize(totalHeapSize)
{
// Cook up an address to allocate at, using the following recipe:
// 17 bits of zero, stay in userspace kids.
@@ -299,36 +285,67 @@ public:
// for now instead of 2^26 bits of ASLR lets stick with 25 bits of randomization plus
// 2^24, which should put up somewhere in the middle of usespace (in the address range
// 0x200000000000 .. 0x5fffffffffff).
- intptr_t randomLocation = 0;
#if VM_POOL_ASLR
+ intptr_t randomLocation = 0;
randomLocation = arc4random() & ((1 << 25) - 1);
randomLocation += (1 << 24);
randomLocation <<= 21;
+ m_allocation = PageAllocation::reserveAt(reinterpret_cast<void*>(randomLocation), false, totalHeapSize, PageAllocation::JSJITCodePages, EXECUTABLE_POOL_WRITABLE, true);
+#else
+ m_allocation = PageAllocation::reserve(totalHeapSize, PageAllocation::JSJITCodePages, EXECUTABLE_POOL_WRITABLE, true);
#endif
- m_base = mmap(reinterpret_cast<void*>(randomLocation), m_totalHeapSize, INITIAL_PROTECTION_FLAGS, MAP_PRIVATE | MAP_ANON, VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY, 0);
-
- if (m_base) {
- // For simplicity, we keep all memory in m_freeList in a 'released' state.
- // This means that we can simply reuse all memory when allocating, without
- // worrying about it's previous state, and also makes coalescing m_freeList
- // simpler since we need not worry about the possibility of coalescing released
- // chunks with non-released ones.
- release(m_base, m_totalHeapSize);
- m_freeList.insert(new FreeListEntry(m_base, m_totalHeapSize));
- }
+
+ if (!!m_allocation)
+ m_freeList.insert(new FreeListEntry(m_allocation.base(), m_allocation.size()));
#if !ENABLE(INTERPRETER)
else
CRASH();
#endif
}
- void* alloc(size_t size)
+ PageAllocation alloc(size_t size)
+ {
+ return PageAllocation(allocInternal(size), size, m_allocation);
+ }
+
+ void free(PageAllocation allocation)
+ {
+ void* pointer = allocation.base();
+ size_t size = allocation.size();
+
+ ASSERT(!!m_allocation);
+ // Call release to report to the operating system that this
+ // memory is no longer in use, and need not be paged out.
+ ASSERT(isWithinVMPool(pointer, size));
+ release(pointer, size);
+
+ // Common-sized allocations are stored in the m_commonSizedAllocations
+ // vector; all other freed chunks are added to m_freeList.
+ if (size == m_commonSize)
+ m_commonSizedAllocations.append(pointer);
+ else
+ addToFreeList(new FreeListEntry(pointer, size));
+
+ // Do some housekeeping. Every time we reach a point that
+ // 16MB of allocations have been freed, sweep m_freeList
+ // coalescing any neighboring fragments.
+ m_countFreedSinceLastCoalesce += size;
+ if (m_countFreedSinceLastCoalesce >= COALESCE_LIMIT) {
+ m_countFreedSinceLastCoalesce = 0;
+ coalesceFreeSpace();
+ }
+ }
+
+ bool isValid() const { return !!m_allocation; }
+
+private:
+ void* allocInternal(size_t size)
{
#if ENABLE(INTERPRETER)
- if (!m_base)
+ if (!m_allocation)
return 0;
#else
- ASSERT(m_base);
+ ASSERT(!!m_allocation);
#endif
void* result;
@@ -390,39 +407,10 @@ public:
return result;
}
- void free(void* pointer, size_t size)
- {
- ASSERT(m_base);
- // Call release to report to the operating system that this
- // memory is no longer in use, and need not be paged out.
- ASSERT(isWithinVMPool(pointer, size));
- release(pointer, size);
-
- // Common-sized allocations are stored in the m_commonSizedAllocations
- // vector; all other freed chunks are added to m_freeList.
- if (size == m_commonSize)
- m_commonSizedAllocations.append(pointer);
- else
- addToFreeList(new FreeListEntry(pointer, size));
-
- // Do some housekeeping. Every time we reach a point that
- // 16MB of allocations have been freed, sweep m_freeList
- // coalescing any neighboring fragments.
- m_countFreedSinceLastCoalesce += size;
- if (m_countFreedSinceLastCoalesce >= COALESCE_LIMIT) {
- m_countFreedSinceLastCoalesce = 0;
- coalesceFreeSpace();
- }
- }
-
- bool isValid() const { return !!m_base; }
-
-private:
-
#ifndef NDEBUG
bool isWithinVMPool(void* pointer, size_t size)
{
- return pointer >= m_base && (reinterpret_cast<char*>(pointer) + size <= reinterpret_cast<char*>(m_base) + m_totalHeapSize);
+ return pointer >= m_allocation.base() && (reinterpret_cast<char*>(pointer) + size <= reinterpret_cast<char*>(m_allocation.base()) + m_allocation.size());
}
#endif
@@ -436,8 +424,7 @@ private:
// This is used for housekeeping, to trigger defragmentation of the freed lists.
size_t m_countFreedSinceLastCoalesce;
- void* m_base;
- size_t m_totalHeapSize;
+ PageAllocation m_allocation;
};
void ExecutableAllocator::intializePageSize()
@@ -459,18 +446,15 @@ bool ExecutableAllocator::isValid() const
ExecutablePool::Allocation ExecutablePool::systemAlloc(size_t size)
{
SpinLockHolder lock_holder(&spinlock);
-
ASSERT(allocator);
- ExecutablePool::Allocation alloc = {reinterpret_cast<char*>(allocator->alloc(size)), size};
- return alloc;
+ return allocator->alloc(size);
}
-void ExecutablePool::systemRelease(const ExecutablePool::Allocation& allocation)
+void ExecutablePool::systemRelease(ExecutablePool::Allocation& allocation)
{
SpinLockHolder lock_holder(&spinlock);
-
ASSERT(allocator);
- allocator->free(allocation.pages, allocation.size);
+ allocator->free(allocation);
}
}
diff --git a/JavaScriptCore/jit/ExecutableAllocatorSymbian.cpp b/JavaScriptCore/jit/ExecutableAllocatorSymbian.cpp
deleted file mode 100644
index 8b0553d..0000000
--- a/JavaScriptCore/jit/ExecutableAllocatorSymbian.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
- *
- * 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 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA
- *
- */
-
-#include "config.h"
-
-#include "ExecutableAllocator.h"
-
-#if ENABLE(EXECUTABLE_ALLOCATOR_DEMAND) && OS(SYMBIAN)
-
-#include <e32hal.h>
-#include <e32std.h>
-
-// Set the page size to 256 Kb to compensate for moving memory model limitation
-const size_t MOVING_MEM_PAGE_SIZE = 256 * 1024;
-
-namespace JSC {
-
-void ExecutableAllocator::intializePageSize()
-{
-#if CPU(ARMV5_OR_LOWER)
- // The moving memory model (as used in ARMv5 and earlier platforms)
- // on Symbian OS limits the number of chunks for each process to 16.
- // To mitigate this limitation increase the pagesize to
- // allocate less of larger chunks.
- ExecutableAllocator::pageSize = MOVING_MEM_PAGE_SIZE;
-#else
- TInt page_size;
- UserHal::PageSizeInBytes(page_size);
- ExecutableAllocator::pageSize = page_size;
-#endif
-}
-
-ExecutablePool::Allocation ExecutablePool::systemAlloc(size_t n)
-{
- RChunk* codeChunk = new RChunk();
-
- TInt errorCode = codeChunk->CreateLocalCode(n, n);
-
- char* allocation = reinterpret_cast<char*>(codeChunk->Base());
- if (!allocation)
- CRASH();
- ExecutablePool::Allocation alloc = { allocation, n, codeChunk };
- return alloc;
-}
-
-void ExecutablePool::systemRelease(const ExecutablePool::Allocation& alloc)
-{
- alloc.chunk->Close();
- delete alloc.chunk;
-}
-
-bool ExecutableAllocator::isValid() const
-{
- return true;
-}
-
-#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
-#error "ASSEMBLER_WX_EXCLUSIVE not yet suported on this platform."
-#endif
-
-}
-
-#endif // HAVE(ASSEMBLER)
diff --git a/JavaScriptCore/jit/JIT.h b/JavaScriptCore/jit/JIT.h
index f9be930..d398d51 100644
--- a/JavaScriptCore/jit/JIT.h
+++ b/JavaScriptCore/jit/JIT.h
@@ -783,7 +783,7 @@ namespace JSC {
void emit_op_to_primitive(Instruction*);
void emit_op_unexpected_load(Instruction*);
void emit_op_urshift(Instruction*);
-#if ENABLE(JIT_OPTIMIZE_MOD)
+#if ENABLE(JIT_USE_SOFT_MODULO)
void softModulo();
#endif
diff --git a/JavaScriptCore/jit/JITArithmetic.cpp b/JavaScriptCore/jit/JITArithmetic.cpp
index 0f6d290..a9d0bcd 100644
--- a/JavaScriptCore/jit/JITArithmetic.cpp
+++ b/JavaScriptCore/jit/JITArithmetic.cpp
@@ -1196,7 +1196,7 @@ void JIT::emit_op_mod(Instruction* currentInstruction)
unsigned op1 = currentInstruction[2].u.operand;
unsigned op2 = currentInstruction[3].u.operand;
-#if ENABLE(JIT_OPTIMIZE_MOD)
+#if ENABLE(JIT_USE_SOFT_MODULO)
emitGetVirtualRegisters(op1, regT0, op2, regT2);
emitJumpSlowCaseIfNotImmediateInteger(regT0);
emitJumpSlowCaseIfNotImmediateInteger(regT2);
@@ -1216,7 +1216,7 @@ void JIT::emit_op_mod(Instruction* currentInstruction)
void JIT::emitSlow_op_mod(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
-#if ENABLE(JIT_OPTIMIZE_MOD)
+#if ENABLE(JIT_USE_SOFT_MODULO)
unsigned result = currentInstruction[1].u.operand;
unsigned op1 = currentInstruction[2].u.operand;
unsigned op2 = currentInstruction[3].u.operand;
diff --git a/JavaScriptCore/jit/JITArithmetic32_64.cpp b/JavaScriptCore/jit/JITArithmetic32_64.cpp
index 232e287..5a69d5a 100644
--- a/JavaScriptCore/jit/JITArithmetic32_64.cpp
+++ b/JavaScriptCore/jit/JITArithmetic32_64.cpp
@@ -1363,7 +1363,7 @@ void JIT::emit_op_mod(Instruction* currentInstruction)
unsigned op1 = currentInstruction[2].u.operand;
unsigned op2 = currentInstruction[3].u.operand;
-#if ENABLE(JIT_OPTIMIZE_MOD)
+#if ENABLE(JIT_USE_SOFT_MODULO)
emitLoad2(op1, regT1, regT0, op2, regT3, regT2);
addSlowCase(branch32(NotEqual, regT1, Imm32(JSValue::Int32Tag)));
addSlowCase(branch32(NotEqual, regT3, Imm32(JSValue::Int32Tag)));
@@ -1383,7 +1383,7 @@ void JIT::emit_op_mod(Instruction* currentInstruction)
void JIT::emitSlow_op_mod(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
-#if ENABLE(JIT_OPTIMIZE_MOD)
+#if ENABLE(JIT_USE_SOFT_MODULO)
unsigned result = currentInstruction[1].u.operand;
unsigned op1 = currentInstruction[2].u.operand;
unsigned op2 = currentInstruction[3].u.operand;
diff --git a/JavaScriptCore/jit/JITOpcodes.cpp b/JavaScriptCore/jit/JITOpcodes.cpp
index 949dee3..852de4e 100644
--- a/JavaScriptCore/jit/JITOpcodes.cpp
+++ b/JavaScriptCore/jit/JITOpcodes.cpp
@@ -45,7 +45,7 @@ namespace JSC {
void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executablePool, JSGlobalData* globalData, TrampolineStructure *trampolines)
{
-#if ENABLE(JIT_OPTIMIZE_MOD)
+#if ENABLE(JIT_USE_SOFT_MODULO)
Label softModBegin = align();
softModulo();
#endif
@@ -184,7 +184,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
trampolines->ctiVirtualConstruct = trampolineAt(finalCode, virtualConstructBegin);
trampolines->ctiNativeCall = trampolineAt(finalCode, nativeCallThunk);
trampolines->ctiNativeConstruct = trampolineAt(finalCode, nativeConstructThunk);
-#if ENABLE(JIT_OPTIMIZE_MOD)
+#if ENABLE(JIT_USE_SOFT_MODULO)
trampolines->ctiSoftModulo = trampolineAt(finalCode, softModBegin);
#endif
#if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS)
@@ -1531,7 +1531,7 @@ void JIT::emit_op_new_regexp(Instruction* currentInstruction)
}
// For both JSValue32_64 and JSValue32
-#if ENABLE(JIT_OPTIMIZE_MOD)
+#if ENABLE(JIT_USE_SOFT_MODULO)
#if CPU(ARM_TRADITIONAL)
void JIT::softModulo()
{
diff --git a/JavaScriptCore/jit/JITOpcodes32_64.cpp b/JavaScriptCore/jit/JITOpcodes32_64.cpp
index 658ebc5..5622e9c 100644
--- a/JavaScriptCore/jit/JITOpcodes32_64.cpp
+++ b/JavaScriptCore/jit/JITOpcodes32_64.cpp
@@ -42,7 +42,7 @@ namespace JSC {
void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executablePool, JSGlobalData* globalData, TrampolineStructure *trampolines)
{
-#if ENABLE(JIT_OPTIMIZE_MOD)
+#if ENABLE(JIT_USE_SOFT_MODULO)
Label softModBegin = align();
softModulo();
#endif
@@ -187,7 +187,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
trampolines->ctiVirtualCallLink = trampolineAt(finalCode, virtualCallLinkBegin);
trampolines->ctiVirtualConstructLink = trampolineAt(finalCode, virtualConstructLinkBegin);
#endif
-#if ENABLE(JIT_OPTIMIZE_MOD)
+#if ENABLE(JIT_USE_SOFT_MODULO)
trampolines->ctiSoftModulo = trampolineAt(finalCode, softModBegin);
#endif
}
diff --git a/JavaScriptCore/jit/JITStubs.h b/JavaScriptCore/jit/JITStubs.h
index ba9e15f..306e475 100644
--- a/JavaScriptCore/jit/JITStubs.h
+++ b/JavaScriptCore/jit/JITStubs.h
@@ -171,6 +171,10 @@ namespace JSC {
ReturnAddressPtr* returnAddressSlot() { return &thunkReturnAddress; }
};
#elif CPU(ARM_TRADITIONAL)
+#if COMPILER(MSVC)
+#pragma pack(push)
+#pragma pack(4)
+#endif // COMPILER(MSVC)
struct JITStackFrame {
JITStubArg padding; // Unused
JITStubArg args[7];
@@ -195,6 +199,9 @@ namespace JSC {
// When JIT code makes a call, it pushes its return address just below the rest of the stack.
ReturnAddressPtr* returnAddressSlot() { return &thunkReturnAddress; }
};
+#if COMPILER(MSVC)
+#pragma pack(pop)
+#endif // COMPILER(MSVC)
#elif CPU(MIPS)
struct JITStackFrame {
void* reserved; // Unused
diff --git a/JavaScriptCore/jsc.cpp b/JavaScriptCore/jsc.cpp
index c91bcb3..03bc411 100644
--- a/JavaScriptCore/jsc.cpp
+++ b/JavaScriptCore/jsc.cpp
@@ -308,7 +308,7 @@ EncodedJSValue JSC_HOST_CALL functionQuit(ExecState* exec)
// be in a separate main function because the jscmain function requires object
// unwinding.
-#if COMPILER(MSVC) && !defined(_DEBUG)
+#if COMPILER(MSVC) && !defined(_DEBUG) && !OS(WINCE)
#define TRY __try {
#define EXCEPT(x) } __except (EXCEPTION_EXECUTE_HANDLER) { x; }
#else
diff --git a/JavaScriptCore/parser/ASTBuilder.h b/JavaScriptCore/parser/ASTBuilder.h
index 3b7ffb5..f627756 100644
--- a/JavaScriptCore/parser/ASTBuilder.h
+++ b/JavaScriptCore/parser/ASTBuilder.h
@@ -124,10 +124,15 @@ public:
ExpressionNode* makeBitwiseNotNode(ExpressionNode*);
ExpressionNode* makeMultNode(ExpressionNode* left, ExpressionNode* right, bool rightHasAssignments);
ExpressionNode* makeDivNode(ExpressionNode* left, ExpressionNode* right, bool rightHasAssignments);
+ ExpressionNode* makeModNode(ExpressionNode* left, ExpressionNode* right, bool rightHasAssignments);
ExpressionNode* makeAddNode(ExpressionNode* left, ExpressionNode* right, bool rightHasAssignments);
ExpressionNode* makeSubNode(ExpressionNode* left, ExpressionNode* right, bool rightHasAssignments);
+ ExpressionNode* makeBitXOrNode(ExpressionNode* left, ExpressionNode* right, bool rightHasAssignments);
+ ExpressionNode* makeBitAndNode(ExpressionNode* left, ExpressionNode* right, bool rightHasAssignments);
+ ExpressionNode* makeBitOrNode(ExpressionNode* left, ExpressionNode* right, bool rightHasAssignments);
ExpressionNode* makeLeftShiftNode(ExpressionNode* left, ExpressionNode* right, bool rightHasAssignments);
ExpressionNode* makeRightShiftNode(ExpressionNode* left, ExpressionNode* right, bool rightHasAssignments);
+ ExpressionNode* makeURightShiftNode(ExpressionNode* left, ExpressionNode* right, bool rightHasAssignments);
ExpressionNode* createLogicalNot(ExpressionNode* expr) { return new (m_globalData) LogicalNotNode(m_globalData, expr); }
ExpressionNode* createUnaryPlus(ExpressionNode* expr) { return new (m_globalData) UnaryPlusNode(m_globalData, expr); }
@@ -690,6 +695,16 @@ ExpressionNode* ASTBuilder::makeDivNode(ExpressionNode* expr1, ExpressionNode* e
return new (m_globalData) DivNode(m_globalData, expr1, expr2, rightHasAssignments);
}
+ExpressionNode* ASTBuilder::makeModNode(ExpressionNode* expr1, ExpressionNode* expr2, bool rightHasAssignments)
+{
+ expr1 = expr1->stripUnaryPlus();
+ expr2 = expr2->stripUnaryPlus();
+
+ if (expr1->isNumber() && expr2->isNumber())
+ return createNumber(fmod(static_cast<NumberNode*>(expr1)->value(), static_cast<NumberNode*>(expr2)->value()));
+ return new (m_globalData) ModNode(m_globalData, expr1, expr2, rightHasAssignments);
+}
+
ExpressionNode* ASTBuilder::makeAddNode(ExpressionNode* expr1, ExpressionNode* expr2, bool rightHasAssignments)
{
if (expr1->isNumber() && expr2->isNumber())
@@ -721,6 +736,34 @@ ExpressionNode* ASTBuilder::makeRightShiftNode(ExpressionNode* expr1, Expression
return new (m_globalData) RightShiftNode(m_globalData, expr1, expr2, rightHasAssignments);
}
+ExpressionNode* ASTBuilder::makeURightShiftNode(ExpressionNode* expr1, ExpressionNode* expr2, bool rightHasAssignments)
+{
+ if (expr1->isNumber() && expr2->isNumber())
+ return createNumber(toUInt32(static_cast<NumberNode*>(expr1)->value()) >> (toUInt32(static_cast<NumberNode*>(expr2)->value()) & 0x1f));
+ return new (m_globalData) UnsignedRightShiftNode(m_globalData, expr1, expr2, rightHasAssignments);
+}
+
+ExpressionNode* ASTBuilder::makeBitOrNode(ExpressionNode* expr1, ExpressionNode* expr2, bool rightHasAssignments)
+{
+ if (expr1->isNumber() && expr2->isNumber())
+ return createNumber(toInt32(static_cast<NumberNode*>(expr1)->value()) | toInt32(static_cast<NumberNode*>(expr2)->value()));
+ return new (m_globalData) BitOrNode(m_globalData, expr1, expr2, rightHasAssignments);
+}
+
+ExpressionNode* ASTBuilder::makeBitAndNode(ExpressionNode* expr1, ExpressionNode* expr2, bool rightHasAssignments)
+{
+ if (expr1->isNumber() && expr2->isNumber())
+ return createNumber(toInt32(static_cast<NumberNode*>(expr1)->value()) & toInt32(static_cast<NumberNode*>(expr2)->value()));
+ return new (m_globalData) BitAndNode(m_globalData, expr1, expr2, rightHasAssignments);
+}
+
+ExpressionNode* ASTBuilder::makeBitXOrNode(ExpressionNode* expr1, ExpressionNode* expr2, bool rightHasAssignments)
+{
+ if (expr1->isNumber() && expr2->isNumber())
+ return createNumber(toInt32(static_cast<NumberNode*>(expr1)->value()) ^ toInt32(static_cast<NumberNode*>(expr2)->value()));
+ return new (m_globalData) BitXOrNode(m_globalData, expr1, expr2, rightHasAssignments);
+}
+
ExpressionNode* ASTBuilder::makeFunctionCallNode(ExpressionNode* func, ArgumentsNode* args, int start, int divot, int end)
{
if (!func->isLocation())
@@ -763,13 +806,13 @@ ExpressionNode* ASTBuilder::makeBinaryNode(int token, pair<ExpressionNode*, Bina
return new (m_globalData) LogicalOpNode(m_globalData, lhs.first, rhs.first, OpLogicalAnd);
case BITOR:
- return new (m_globalData) BitOrNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+ return makeBitOrNode(lhs.first, rhs.first, rhs.second.hasAssignment);
case BITXOR:
- return new (m_globalData) BitXOrNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+ return makeBitXOrNode(lhs.first, rhs.first, rhs.second.hasAssignment);
case BITAND:
- return new (m_globalData) BitAndNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+ return makeBitAndNode(lhs.first, rhs.first, rhs.second.hasAssignment);
case EQEQ:
return new (m_globalData) EqualNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
@@ -814,7 +857,7 @@ ExpressionNode* ASTBuilder::makeBinaryNode(int token, pair<ExpressionNode*, Bina
return makeRightShiftNode(lhs.first, rhs.first, rhs.second.hasAssignment);
case URSHIFT:
- return new (m_globalData) UnsignedRightShiftNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+ return makeURightShiftNode(lhs.first, rhs.first, rhs.second.hasAssignment);
case PLUS:
return makeAddNode(lhs.first, rhs.first, rhs.second.hasAssignment);
@@ -829,7 +872,7 @@ ExpressionNode* ASTBuilder::makeBinaryNode(int token, pair<ExpressionNode*, Bina
return makeDivNode(lhs.first, rhs.first, rhs.second.hasAssignment);
case MOD:
- return new (m_globalData) ModNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+ return makeModNode(lhs.first, rhs.first, rhs.second.hasAssignment);
}
CRASH();
return 0;
diff --git a/JavaScriptCore/qt/ChangeLog b/JavaScriptCore/qt/ChangeLog
index 448a59e..e80493b 100644
--- a/JavaScriptCore/qt/ChangeLog
+++ b/JavaScriptCore/qt/ChangeLog
@@ -1,3 +1,146 @@
+2010-07-27 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Update the QScriptValue autotests suite.
+
+ QScriptValue generated files were updated, changes are:
+ - More tested values (for example QSE::newObject() and QSE::newArray())
+ - Tested values are recreated before each test and are not reused.
+ The change implies better code coverage and some expected result changes.
+ - A new test to check copy and assign functions.
+ - Tests are using standard QTestLib interface, without any custom macros.
+
+ [Qt] Improve test coverage for the QScriptValue
+ https://bugs.webkit.org/show_bug.cgi?id=42366
+
+ * tests/qscriptvalue/tst_qscriptvalue.cpp:
+ (tst_QScriptValue::tst_QScriptValue):
+ (tst_QScriptValue::~tst_QScriptValue):
+ (tst_QScriptValue::assignAndCopyConstruct_data):
+ (tst_QScriptValue::assignAndCopyConstruct):
+ * tests/qscriptvalue/tst_qscriptvalue.h:
+ * tests/qscriptvalue/tst_qscriptvalue_generated_comparison.cpp:
+ (tst_QScriptValue::equals_data):
+ (tst_QScriptValue::equals):
+ (tst_QScriptValue::strictlyEquals_data):
+ (tst_QScriptValue::strictlyEquals):
+ (tst_QScriptValue::instanceOf_data):
+ (tst_QScriptValue::instanceOf):
+ * tests/qscriptvalue/tst_qscriptvalue_generated_init.cpp:
+ (tst_QScriptValue::initScriptValues):
+ * tests/qscriptvalue/tst_qscriptvalue_generated_istype.cpp:
+ (tst_QScriptValue::isValid_data):
+ (tst_QScriptValue::isValid):
+ (tst_QScriptValue::isBool_data):
+ (tst_QScriptValue::isBool):
+ (tst_QScriptValue::isBoolean_data):
+ (tst_QScriptValue::isBoolean):
+ (tst_QScriptValue::isNumber_data):
+ (tst_QScriptValue::isNumber):
+ (tst_QScriptValue::isFunction_data):
+ (tst_QScriptValue::isFunction):
+ (tst_QScriptValue::isNull_data):
+ (tst_QScriptValue::isNull):
+ (tst_QScriptValue::isString_data):
+ (tst_QScriptValue::isString):
+ (tst_QScriptValue::isUndefined_data):
+ (tst_QScriptValue::isUndefined):
+ (tst_QScriptValue::isObject_data):
+ (tst_QScriptValue::isObject):
+ (tst_QScriptValue::isArray_data):
+ (tst_QScriptValue::isArray):
+ (tst_QScriptValue::isError_data):
+ (tst_QScriptValue::isError):
+ * tests/qscriptvalue/tst_qscriptvalue_generated_totype.cpp:
+ (tst_QScriptValue::toString_data):
+ (tst_QScriptValue::toString):
+ (tst_QScriptValue::toNumber_data):
+ (tst_QScriptValue::toNumber):
+ (tst_QScriptValue::toBool_data):
+ (tst_QScriptValue::toBool):
+ (tst_QScriptValue::toBoolean_data):
+ (tst_QScriptValue::toBoolean):
+ (tst_QScriptValue::toInteger_data):
+ (tst_QScriptValue::toInteger):
+ (tst_QScriptValue::toInt32_data):
+ (tst_QScriptValue::toInt32):
+ (tst_QScriptValue::toUInt32_data):
+ (tst_QScriptValue::toUInt32):
+ (tst_QScriptValue::toUInt16_data):
+ (tst_QScriptValue::toUInt16):
+
+2010-07-27 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Implement QScriptEngine::newFunction() parts that doesn't depend on QScriptContext
+ https://bugs.webkit.org/show_bug.cgi?id=42174
+
+ Since our function can be called in Javascript both as a function
+ and as a constructor, we couldn't use the existing
+ JSObjectMakeFunctionWithCallback() and JSObjectMakeConstructor().
+
+ Instead, a JSClassRef was created, implementing the needed
+ callbacks (the callAsConstructor is not there yet because its
+ behaviour depends on QScriptContext).
+
+ For the moment, QScriptContext is defined as a void type, since we
+ still don't use it.
+
+ The variant of newFunction() that also takes an external argument
+ was also implemented. The details of implementation were added to
+ the qscriptfunction{.c,_p.h} files.
+
+ This commit also adds tests, some of them from Qt's upstream.
+
+ * api/QtScript.pro:
+ * api/qscriptengine.cpp:
+ (QScriptEngine::newFunction):
+ * api/qscriptengine.h:
+ * api/qscriptengine_p.cpp:
+ (QScriptEnginePrivate::QScriptEnginePrivate):
+ (QScriptEnginePrivate::~QScriptEnginePrivate):
+ (QScriptEnginePrivate::newFunction):
+ * api/qscriptengine_p.h:
+ * api/qscriptfunction.cpp: Added.
+ (qt_NativeFunction_finalize):
+ (qt_NativeFunction_callAsFunction):
+ (qt_NativeFunctionWithArg_finalize):
+ (qt_NativeFunctionWithArg_callAsFunction):
+ * api/qscriptfunction_p.h: Added.
+ (QNativeFunctionData::QNativeFunctionData):
+ (QNativeFunctionWithArgData::QNativeFunctionWithArgData):
+ * api/qscriptoriginalglobalobject_p.h:
+ (QScriptOriginalGlobalObject::QScriptOriginalGlobalObject):
+ (QScriptOriginalGlobalObject::~QScriptOriginalGlobalObject):
+ (QScriptOriginalGlobalObject::functionPrototype):
+ * tests/qscriptengine/tst_qscriptengine.cpp:
+ (myFunction):
+ (myFunctionWithArg):
+ (myFunctionThatReturns):
+ (myFunctionThatReturnsWithoutEngine):
+ (myFunctionThatReturnsWrongEngine):
+ (tst_QScriptEngine::newFunction):
+
+2010-07-23 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ QScriptValue::equals benchmark crash fix.
+
+ Patch changes QScriptValue::equals implementation to cover
+ more edge cases.
+
+ Problem exposes an issue in our autotests (all values got
+ bound to an engine too fast - bug 42366).
+
+ [Qt] QScriptValue::equals asserts
+ https://bugs.webkit.org/show_bug.cgi?id=42363
+
+ * api/qscriptvalue_p.h:
+ (QScriptValuePrivate::equals):
+
2010-07-14 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/JavaScriptCore/qt/api/QtScript.pro b/JavaScriptCore/qt/api/QtScript.pro
index c2c6f83..490758c 100644
--- a/JavaScriptCore/qt/api/QtScript.pro
+++ b/JavaScriptCore/qt/api/QtScript.pro
@@ -28,6 +28,7 @@ SOURCES += $$PWD/qscriptengine.cpp \
$$PWD/qscriptstring.cpp \
$$PWD/qscriptprogram.cpp \
$$PWD/qscriptsyntaxcheckresult.cpp \
+ $$PWD/qscriptfunction.cpp
HEADERS += $$PWD/qtscriptglobal.h \
$$PWD/qscriptengine.h \
@@ -43,7 +44,7 @@ HEADERS += $$PWD/qtscriptglobal.h \
$$PWD/qscriptprogram_p.h \
$$PWD/qscriptsyntaxcheckresult.h \
$$PWD/qscriptoriginalglobalobject_p.h \
-
+ $$PWD/qscriptfunction_p.h
!static: DEFINES += QT_MAKEDLL
diff --git a/JavaScriptCore/qt/api/qscriptengine.cpp b/JavaScriptCore/qt/api/qscriptengine.cpp
index 4b2319b..7ef7c8e 100644
--- a/JavaScriptCore/qt/api/qscriptengine.cpp
+++ b/JavaScriptCore/qt/api/qscriptengine.cpp
@@ -258,6 +258,93 @@ QScriptValue QScriptEngine::undefinedValue()
}
/*!
+ Creates a QScriptValue that wraps a native (C++) function. \a fun
+ must be a C++ function with signature QScriptEngine::FunctionSignature.
+ \a length is the number of arguments that \a fun expects; this becomes
+ the \c{length} property of the created QScriptValue.
+
+ Note that \a length only gives an indication of the number of
+ arguments that the function expects; an actual invocation of a
+ function can include any number of arguments. You can check the
+ \l{QScriptContext::argumentCount()}{argumentCount()} of the
+ QScriptContext associated with the invocation to determine the
+ actual number of arguments passed.
+
+ A \c{prototype} property is automatically created for the resulting
+ function object, to provide for the possibility that the function
+ will be used as a constructor.
+
+ By combining newFunction() and the property flags
+ QScriptValue::PropertyGetter and QScriptValue::PropertySetter, you
+ can create script object properties that behave like normal
+ properties in script code, but are in fact accessed through
+ functions (analogous to how properties work in \l{Qt's Property
+ System}). Example:
+
+ \snippet doc/src/snippets/code/src_script_qscriptengine.cpp 11
+
+ When the property \c{foo} of the script object is subsequently
+ accessed in script code, \c{getSetFoo()} will be invoked to handle
+ the access. In this particular case, we chose to store the "real"
+ value of \c{foo} as a property of the accessor function itself; you
+ are of course free to do whatever you like in this function.
+
+ In the above example, a single native function was used to handle
+ both reads and writes to the property; the argument count is used to
+ determine if we are handling a read or write. You can also use two
+ separate functions; just specify the relevant flag
+ (QScriptValue::PropertyGetter or QScriptValue::PropertySetter) when
+ setting the property, e.g.:
+
+ \snippet doc/src/snippets/code/src_script_qscriptengine.cpp 12
+
+ \sa QScriptValue::call()
+*/
+QScriptValue QScriptEngine::newFunction(QScriptEngine::FunctionSignature fun, int length)
+{
+ return QScriptValuePrivate::get(d_ptr->newFunction(fun, 0, length));
+}
+
+/*!
+ Creates a constructor function from \a fun, with the given \a length.
+ The \c{prototype} property of the resulting function is set to be the
+ given \a prototype. The \c{constructor} property of \a prototype is
+ set to be the resulting function.
+
+ When a function is called as a constructor (e.g. \c{new Foo()}), the
+ `this' object associated with the function call is the new object
+ that the function is expected to initialize; the prototype of this
+ default constructed object will be the function's public
+ \c{prototype} property. If you always want the function to behave as
+ a constructor (e.g. \c{Foo()} should also create a new object), or
+ if you need to create your own object rather than using the default
+ `this' object, you should make sure that the prototype of your
+ object is set correctly; either by setting it manually, or, when
+ wrapping a custom type, by having registered the defaultPrototype()
+ of that type. Example:
+
+ \snippet doc/src/snippets/code/src_script_qscriptengine.cpp 9
+
+ To wrap a custom type and provide a constructor for it, you'd typically
+ do something like this:
+
+ \snippet doc/src/snippets/code/src_script_qscriptengine.cpp 10
+*/
+QScriptValue QScriptEngine::newFunction(QScriptEngine::FunctionSignature fun, const QScriptValue& prototype, int length)
+{
+ return QScriptValuePrivate::get(d_ptr->newFunction(fun, QScriptValuePrivate::get(prototype), length));
+}
+
+/*!
+ \internal
+ \since 4.4
+*/
+QScriptValue QScriptEngine::newFunction(QScriptEngine::FunctionWithArgSignature fun, void* arg)
+{
+ return QScriptValuePrivate::get(d_ptr->newFunction(fun, arg));
+}
+
+/*!
Creates a QtScript object of class Object.
The prototype of the created object will be the Object
@@ -294,3 +381,23 @@ QScriptValue QScriptEngine::globalObject() const
{
return QScriptValuePrivate::get(d_ptr->globalObject());
}
+
+/*!
+ \typedef QScriptEngine::FunctionSignature
+ \relates QScriptEngine
+
+ The function signature \c{QScriptValue f(QScriptContext *, QScriptEngine *)}.
+
+ A function with such a signature can be passed to
+ QScriptEngine::newFunction() to wrap the function.
+*/
+
+/*!
+ \typedef QScriptEngine::FunctionWithArgSignature
+ \relates QScriptEngine
+
+ The function signature \c{QScriptValue f(QScriptContext *, QScriptEngine *, void *)}.
+
+ A function with such a signature can be passed to
+ QScriptEngine::newFunction() to wrap the function.
+*/
diff --git a/JavaScriptCore/qt/api/qscriptengine.h b/JavaScriptCore/qt/api/qscriptengine.h
index 1a87a37..b85dc52 100644
--- a/JavaScriptCore/qt/api/qscriptengine.h
+++ b/JavaScriptCore/qt/api/qscriptengine.h
@@ -30,6 +30,9 @@
class QScriptValue;
class QScriptEnginePrivate;
+// FIXME: Remove this once QScriptContext is properly defined.
+typedef void QScriptContext;
+
// Internal typedef
typedef QExplicitlySharedDataPointer<QScriptEnginePrivate> QScriptEnginePtr;
@@ -56,6 +59,14 @@ public:
QScriptValue nullValue();
QScriptValue undefinedValue();
+
+ typedef QScriptValue (*FunctionSignature)(QScriptContext *, QScriptEngine *);
+ typedef QScriptValue (*FunctionWithArgSignature)(QScriptContext *, QScriptEngine *, void *);
+
+ QScriptValue newFunction(FunctionSignature fun, int length = 0);
+ QScriptValue newFunction(FunctionSignature fun, const QScriptValue& prototype, int length = 0);
+ QScriptValue newFunction(FunctionWithArgSignature fun, void* arg);
+
QScriptValue newObject();
QScriptValue newArray(uint length = 0);
QScriptValue globalObject() const;
diff --git a/JavaScriptCore/qt/api/qscriptengine_p.cpp b/JavaScriptCore/qt/api/qscriptengine_p.cpp
index e3311ed..a708a34 100644
--- a/JavaScriptCore/qt/api/qscriptengine_p.cpp
+++ b/JavaScriptCore/qt/api/qscriptengine_p.cpp
@@ -21,6 +21,7 @@
#include "qscriptengine_p.h"
+#include "qscriptfunction_p.h"
#include "qscriptprogram_p.h"
#include "qscriptvalue_p.h"
@@ -33,11 +34,15 @@ QScriptEnginePrivate::QScriptEnginePrivate(const QScriptEngine* engine)
, m_context(JSGlobalContextCreate(0))
, m_exception(0)
, m_originalGlobalObject(m_context)
+ , m_nativeFunctionClass(JSClassCreate(&qt_NativeFunctionClass))
+ , m_nativeFunctionWithArgClass(JSClassCreate(&qt_NativeFunctionWithArgClass))
{
}
QScriptEnginePrivate::~QScriptEnginePrivate()
{
+ JSClassRelease(m_nativeFunctionClass);
+ JSClassRelease(m_nativeFunctionWithArgClass);
if (m_exception)
JSValueUnprotect(m_context, m_exception);
JSGlobalContextRelease(m_context);
@@ -86,6 +91,37 @@ QScriptValuePrivate* QScriptEnginePrivate::uncaughtException() const
return m_exception ? new QScriptValuePrivate(this, m_exception) : new QScriptValuePrivate();
}
+QScriptValuePrivate* QScriptEnginePrivate::newFunction(QScriptEngine::FunctionSignature fun, QScriptValuePrivate* prototype, int length)
+{
+ // Note that this private data will be deleted in the object finalize function.
+ QNativeFunctionData* data = new QNativeFunctionData(this, fun);
+ JSObjectRef funJS = JSObjectMake(m_context, m_nativeFunctionClass, reinterpret_cast<void*>(data));
+ QScriptValuePrivate* proto = prototype ? prototype : newObject();
+ return newFunction(funJS, proto);
+}
+
+QScriptValuePrivate* QScriptEnginePrivate::newFunction(QScriptEngine::FunctionWithArgSignature fun, void* arg)
+{
+ // Note that this private data will be deleted in the object finalize function.
+ QNativeFunctionWithArgData* data = new QNativeFunctionWithArgData(this, fun, arg);
+ JSObjectRef funJS = JSObjectMake(m_context, m_nativeFunctionWithArgClass, reinterpret_cast<void*>(data));
+ QScriptValuePrivate* proto = newObject();
+ return newFunction(funJS, proto);
+}
+
+QScriptValuePrivate* QScriptEnginePrivate::newFunction(JSObjectRef funJS, QScriptValuePrivate* prototype)
+{
+ JSObjectSetPrototype(m_context, funJS, m_originalGlobalObject.functionPrototype());
+
+ QScriptValuePrivate* result = new QScriptValuePrivate(this, funJS);
+ static JSStringRef protoName = QScriptConverter::toString("prototype");
+ static JSStringRef constructorName = QScriptConverter::toString("constructor");
+ result->setProperty(protoName, prototype, QScriptValue::Undeletable);
+ prototype->setProperty(constructorName, result, QScriptValue::PropertyFlags(QScriptValue::Undeletable | QScriptValue::SkipInEnumeration));
+
+ return result;
+}
+
QScriptValuePrivate* QScriptEnginePrivate::newObject() const
{
return new QScriptValuePrivate(this, JSObjectMake(m_context, /* jsClass */ 0, /* userData */ 0));
diff --git a/JavaScriptCore/qt/api/qscriptengine_p.h b/JavaScriptCore/qt/api/qscriptengine_p.h
index d54cdcc..eec1929 100644
--- a/JavaScriptCore/qt/api/qscriptengine_p.h
+++ b/JavaScriptCore/qt/api/qscriptengine_p.h
@@ -71,6 +71,10 @@ public:
inline JSValueRef makeJSValue(bool number) const;
inline JSValueRef makeJSValue(QScriptValue::SpecialValue value) const;
+ QScriptValuePrivate* newFunction(QScriptEngine::FunctionSignature fun, QScriptValuePrivate* prototype, int length);
+ QScriptValuePrivate* newFunction(QScriptEngine::FunctionWithArgSignature fun, void* arg);
+ QScriptValuePrivate* newFunction(JSObjectRef funObject, QScriptValuePrivate* prototype);
+
QScriptValuePrivate* newObject() const;
QScriptValuePrivate* newArray(uint length);
QScriptValuePrivate* globalObject() const;
@@ -89,6 +93,9 @@ private:
JSValueRef m_exception;
QScriptOriginalGlobalObject m_originalGlobalObject;
+
+ JSClassRef m_nativeFunctionClass;
+ JSClassRef m_nativeFunctionWithArgClass;
};
diff --git a/JavaScriptCore/qt/api/qscriptfunction.cpp b/JavaScriptCore/qt/api/qscriptfunction.cpp
new file mode 100644
index 0000000..9fe37e6
--- /dev/null
+++ b/JavaScriptCore/qt/api/qscriptfunction.cpp
@@ -0,0 +1,145 @@
+/*
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+ 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.
+*/
+
+// Contains the necessary helper structures to make possible expose
+// C/C++ functions to JavaScript environment.
+
+#include "config.h"
+
+#include "qscriptfunction_p.h"
+
+static void qt_NativeFunction_finalize(JSObjectRef object)
+{
+ void* priv = JSObjectGetPrivate(object);
+ delete reinterpret_cast<QNativeFunctionData*>(priv);
+}
+
+static JSValueRef qt_NativeFunction_callAsFunction(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ QNativeFunctionData* data = reinterpret_cast<QNativeFunctionData*>(JSObjectGetPrivate(object));
+
+ // TODO: build a QScriptContext and use it in the native call.
+ QScriptContext* scriptContext = 0;
+ Q_UNUSED(context);
+ Q_UNUSED(thisObject);
+ Q_UNUSED(argumentCount);
+ Q_UNUSED(arguments);
+ Q_UNUSED(exception);
+
+ QScriptEnginePrivate* engine = data->engine;
+ QScriptValuePrivate* result = QScriptValuePrivate::get(data->fun(scriptContext, QScriptEnginePrivate::get(engine)));
+ if (!result->isValid()) {
+ qWarning("Invalid value returned from native function, returning undefined value instead.");
+ return engine->makeJSValue(QScriptValue::UndefinedValue);
+ }
+
+ // Make sure that the result will be assigned to the correct engine.
+ if (!result->engine()) {
+ Q_ASSERT(result->isValid());
+ result->assignEngine(engine);
+ } else if (result->engine() != engine) {
+ qWarning("Value from different engine returned from native function, returning undefined value instead.");
+ return engine->makeJSValue(QScriptValue::UndefinedValue);
+ }
+
+ return *result;
+}
+
+JSClassDefinition qt_NativeFunctionClass = {
+ 0, // version
+ kJSClassAttributeNoAutomaticPrototype, // attributes
+
+ "", // className
+ 0, // parentClass
+
+ 0, // staticValues
+ 0, // staticFunctions
+
+ 0, // initialize
+ qt_NativeFunction_finalize, // finalize
+ 0, // hasProperty
+ 0, // getProperty
+ 0, // setProperty
+ 0, // deleteProperty
+ 0, // getPropertyNames
+ qt_NativeFunction_callAsFunction, // callAsFunction
+ 0, // callAsConstructor
+ 0, // hasInstance
+ 0 // convertToType
+};
+
+static void qt_NativeFunctionWithArg_finalize(JSObjectRef object)
+{
+ void* priv = JSObjectGetPrivate(object);
+ delete reinterpret_cast<QNativeFunctionWithArgData*>(priv);
+}
+
+static JSValueRef qt_NativeFunctionWithArg_callAsFunction(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ QNativeFunctionWithArgData* data = reinterpret_cast<QNativeFunctionWithArgData*>(JSObjectGetPrivate(object));
+
+ // TODO: build a QScriptContext and use it in the native call.
+ QScriptContext* scriptContext = 0;
+ Q_UNUSED(context);
+ Q_UNUSED(thisObject);
+ Q_UNUSED(argumentCount);
+ Q_UNUSED(arguments);
+ Q_UNUSED(exception);
+
+ QScriptEnginePrivate* engine = data->engine;
+ QScriptValuePrivate* result = QScriptValuePrivate::get(data->fun(scriptContext, QScriptEnginePrivate::get(engine), data->arg));
+ if (!result->isValid()) {
+ qWarning("Invalid value returned from native function, returning undefined value instead.");
+ return engine->makeJSValue(QScriptValue::UndefinedValue);
+ }
+
+ // Make sure that the result will be assigned to the correct engine.
+ if (!result->engine()) {
+ Q_ASSERT(result->isValid());
+ result->assignEngine(engine);
+ } else if (result->engine() != engine) {
+ qWarning("Value from different engine returned from native function, returning undefined value instead.");
+ return engine->makeJSValue(QScriptValue::UndefinedValue);
+ }
+
+ return *result;
+}
+
+JSClassDefinition qt_NativeFunctionWithArgClass = {
+ 0, // version
+ kJSClassAttributeNoAutomaticPrototype, // attributes
+
+ "", // className
+ 0, // parentClass
+
+ 0, // staticValues
+ 0, // staticFunctions
+
+ 0, // initialize
+ qt_NativeFunctionWithArg_finalize, // finalize
+ 0, // hasProperty
+ 0, // getProperty
+ 0, // setProperty
+ 0, // deleteProperty
+ 0, // getPropertyNames
+ qt_NativeFunctionWithArg_callAsFunction, // callAsFunction
+ 0, // callAsConstructor
+ 0, // hasInstance
+ 0 // convertToType
+};
diff --git a/JavaScriptCore/qt/api/qscriptfunction_p.h b/JavaScriptCore/qt/api/qscriptfunction_p.h
new file mode 100644
index 0000000..65b6046
--- /dev/null
+++ b/JavaScriptCore/qt/api/qscriptfunction_p.h
@@ -0,0 +1,57 @@
+/*
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+ 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 qscriptfunction_p_h
+#define qscriptfunction_p_h
+
+#include "config.h"
+
+#include "qscriptengine.h"
+#include "qscriptvalue_p.h"
+
+extern JSClassDefinition qt_NativeFunctionClass;
+extern JSClassDefinition qt_NativeFunctionWithArgClass;
+
+struct QNativeFunctionData
+{
+ QNativeFunctionData(QScriptEnginePrivate* engine, QScriptEngine::FunctionSignature fun)
+ : engine(engine)
+ , fun(fun)
+ {
+ }
+
+ QScriptEnginePrivate* engine;
+ QScriptEngine::FunctionSignature fun;
+};
+
+struct QNativeFunctionWithArgData
+{
+ QNativeFunctionWithArgData(QScriptEnginePrivate* engine, QScriptEngine::FunctionWithArgSignature fun, void* arg)
+ : engine(engine)
+ , fun(fun)
+ , arg(arg)
+ {
+ }
+
+ QScriptEnginePrivate* engine;
+ QScriptEngine::FunctionWithArgSignature fun;
+ void* arg;
+};
+
+#endif
diff --git a/JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h b/JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h
index 8d080fb..31e94f7 100644
--- a/JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h
+++ b/JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h
@@ -45,6 +45,8 @@ public:
inline bool isArray(JSValueRef value) const;
inline bool isError(JSValueRef value) const;
+
+ inline JSValueRef functionPrototype() const;
private:
inline bool isType(JSValueRef value, JSObjectRef constructor, JSValueRef prototype) const;
inline void initializeMember(JSObjectRef globalObject, JSStringRef prototypeName, const char* type, JSObjectRef& constructor, JSValueRef& prototype);
@@ -57,6 +59,8 @@ private:
JSValueRef m_arrayPrototype;
JSObjectRef m_errorConstructor;
JSValueRef m_errorPrototype;
+ JSObjectRef m_functionConstructor;
+ JSValueRef m_functionPrototype;
// Reference to standard JS functions that are not exposed by JSC C API.
JSObjectRef m_hasOwnPropertyFunction;
@@ -73,6 +77,7 @@ QScriptOriginalGlobalObject::QScriptOriginalGlobalObject(JSGlobalContextRef cont
propertyName.adopt(JSStringCreateWithUTF8CString("prototype"));
initializeMember(globalObject, propertyName.get(), "Array", m_arrayConstructor, m_arrayPrototype);
initializeMember(globalObject, propertyName.get(), "Error", m_errorConstructor, m_errorPrototype);
+ initializeMember(globalObject, propertyName.get(), "Function", m_functionConstructor, m_functionPrototype);
propertyName.adopt(JSStringCreateWithUTF8CString("hasOwnProperty"));
m_hasOwnPropertyFunction = const_cast<JSObjectRef>(JSObjectGetProperty(m_context, globalObject, propertyName.get(), &exception));
@@ -119,6 +124,8 @@ QScriptOriginalGlobalObject::~QScriptOriginalGlobalObject()
JSValueUnprotect(m_context, m_arrayPrototype);
JSValueUnprotect(m_context, m_errorConstructor);
JSValueUnprotect(m_context, m_errorPrototype);
+ JSValueUnprotect(m_context, m_functionConstructor);
+ JSValueUnprotect(m_context, m_functionPrototype);
JSValueUnprotect(m_context, m_hasOwnPropertyFunction);
JSValueUnprotect(m_context, m_getOwnPropertyNamesFunction);
JSGlobalContextRelease(m_context);
@@ -173,6 +180,11 @@ inline bool QScriptOriginalGlobalObject::isError(JSValueRef value) const
return isType(value, m_errorConstructor, m_errorPrototype);
}
+inline JSValueRef QScriptOriginalGlobalObject::functionPrototype() const
+{
+ return m_functionPrototype;
+}
+
inline bool QScriptOriginalGlobalObject::isType(JSValueRef value, JSObjectRef constructor, JSValueRef prototype) const
{
// JSC API doesn't export the [[Class]] information for the builtins. But we know that a value
diff --git a/JavaScriptCore/qt/api/qscriptvalue_p.h b/JavaScriptCore/qt/api/qscriptvalue_p.h
index 6e93a07..6fbf98b 100644
--- a/JavaScriptCore/qt/api/qscriptvalue_p.h
+++ b/JavaScriptCore/qt/api/qscriptvalue_p.h
@@ -699,16 +699,48 @@ bool QScriptValuePrivate::equals(QScriptValuePrivate* other)
if (!other->isValid())
return false;
- if ((m_state == other->m_state) && !isJSBased()) {
- if (isNumberBased())
- return u.m_number == other->u.m_number;
- Q_ASSERT(isStringBased());
- return *u.m_string == *(other->u.m_string);
+ if (!isJSBased() && !other->isJSBased()) {
+ switch (m_state) {
+ case CNull:
+ case CUndefined:
+ return other->isUndefined() || other->isNull();
+ case CNumber:
+ switch (other->m_state) {
+ case CBool:
+ case CString:
+ return u.m_number == other->toNumber();
+ case CNumber:
+ return u.m_number == other->u.m_number;
+ default:
+ return false;
+ }
+ case CBool:
+ switch (other->m_state) {
+ case CBool:
+ return u.m_bool == other->u.m_bool;
+ case CNumber:
+ return toNumber() == other->u.m_number;
+ case CString:
+ return toNumber() == other->toNumber();
+ default:
+ return false;
+ }
+ case CString:
+ switch (other->m_state) {
+ case CBool:
+ return toNumber() == other->toNumber();
+ case CNumber:
+ return toNumber() == other->u.m_number;
+ case CString:
+ return *u.m_string == *other->u.m_string;
+ default:
+ return false;
+ }
+ default:
+ Q_ASSERT_X(false, "equals()", "Not all states are included in the previous switch statement.");
+ }
}
- if (!isJSBased() && !other->isJSBased())
- return false;
-
if (isJSBased() && !other->isJSBased()) {
if (!other->assignEngine(engine())) {
qWarning("equals(): Cannot compare to a value created in a different engine");
diff --git a/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp b/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp
index 72ca9b1..58a1587 100644
--- a/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp
+++ b/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp
@@ -35,6 +35,7 @@ public slots:
void cleanup() {}
private slots:
+ void newFunction();
void newObject();
void globalObject();
void evaluate();
@@ -59,6 +60,146 @@ void tst_QScriptEngine::evaluate()
QVERIFY2(engine.evaluate("ping").isValid(), "Script throwing an unhandled exception should return an exception value");
}
+static QScriptValue myFunction(QScriptContext*, QScriptEngine* eng)
+{
+ return eng->nullValue();
+}
+
+static QScriptValue myFunctionWithArg(QScriptContext*, QScriptEngine* eng, void* arg)
+{
+ int* result = reinterpret_cast<int*>(arg);
+ return QScriptValue(eng, *result);
+}
+
+static QScriptValue myFunctionThatReturns(QScriptContext*, QScriptEngine* eng)
+{
+ return QScriptValue(eng, 42);
+}
+
+static QScriptValue myFunctionThatReturnsWithoutEngine(QScriptContext*, QScriptEngine*)
+{
+ return QScriptValue(1024);
+}
+
+static QScriptValue myFunctionThatReturnsWrongEngine(QScriptContext*, QScriptEngine*, void* arg)
+{
+ QScriptEngine* wrongEngine = reinterpret_cast<QScriptEngine*>(arg);
+ return QScriptValue(wrongEngine, 42);
+}
+
+void tst_QScriptEngine::newFunction()
+{
+ QScriptEngine eng;
+ {
+ QScriptValue fun = eng.newFunction(myFunction);
+ QCOMPARE(fun.isValid(), true);
+ QCOMPARE(fun.isFunction(), true);
+ QCOMPARE(fun.isObject(), true);
+ // QCOMPARE(fun.scriptClass(), (QScriptClass*)0);
+ // a prototype property is automatically constructed
+ {
+ QScriptValue prot = fun.property("prototype", QScriptValue::ResolveLocal);
+ QVERIFY(prot.isObject());
+ QVERIFY(prot.property("constructor").strictlyEquals(fun));
+ QEXPECT_FAIL("", "JSCallbackObject::getOwnPropertyDescriptor() doesn't return correct information yet", Continue);
+ QCOMPARE(fun.propertyFlags("prototype"), QScriptValue::Undeletable);
+ QEXPECT_FAIL("", "WebKit bug: 40613 (The JSObjectSetProperty doesn't overwrite property flags)", Continue);
+ QCOMPARE(prot.propertyFlags("constructor"), QScriptValue::PropertyFlags(QScriptValue::Undeletable | QScriptValue::SkipInEnumeration));
+ }
+ // prototype should be Function.prototype
+ QCOMPARE(fun.prototype().isValid(), true);
+ QCOMPARE(fun.prototype().isFunction(), true);
+ QCOMPARE(fun.prototype().strictlyEquals(eng.evaluate("Function.prototype")), true);
+
+ QCOMPARE(fun.call().isNull(), true);
+ // QCOMPARE(fun.construct().isObject(), true);
+ }
+ // the overload that takes an extra argument
+ {
+ int expectedResult = 42;
+ QScriptValue fun = eng.newFunction(myFunctionWithArg, reinterpret_cast<void*>(&expectedResult));
+ QVERIFY(fun.isFunction());
+ // QCOMPARE(fun.scriptClass(), (QScriptClass*)0);
+ // a prototype property is automatically constructed
+ {
+ QScriptValue prot = fun.property("prototype", QScriptValue::ResolveLocal);
+ QVERIFY(prot.isObject());
+ QVERIFY(prot.property("constructor").strictlyEquals(fun));
+ QEXPECT_FAIL("", "JSCallbackObject::getOwnPropertyDescriptor() doesn't return correct information yet", Continue);
+ QCOMPARE(fun.propertyFlags("prototype"), QScriptValue::Undeletable);
+ QEXPECT_FAIL("", "WebKit bug: 40613 (The JSObjectSetProperty doesn't overwrite property flags)", Continue);
+ QCOMPARE(prot.propertyFlags("constructor"), QScriptValue::PropertyFlags(QScriptValue::Undeletable | QScriptValue::SkipInEnumeration));
+ }
+ // prototype should be Function.prototype
+ QCOMPARE(fun.prototype().isValid(), true);
+ QCOMPARE(fun.prototype().isFunction(), true);
+ QCOMPARE(fun.prototype().strictlyEquals(eng.evaluate("Function.prototype")), true);
+
+ QScriptValue result = fun.call();
+ QCOMPARE(result.isNumber(), true);
+ QCOMPARE(result.toInt32(), expectedResult);
+ }
+ // the overload that takes a prototype
+ {
+ QScriptValue proto = eng.newObject();
+ QScriptValue fun = eng.newFunction(myFunction, proto);
+ QCOMPARE(fun.isValid(), true);
+ QCOMPARE(fun.isFunction(), true);
+ QCOMPARE(fun.isObject(), true);
+ // internal prototype should be Function.prototype
+ QCOMPARE(fun.prototype().isValid(), true);
+ QCOMPARE(fun.prototype().isFunction(), true);
+ QCOMPARE(fun.prototype().strictlyEquals(eng.evaluate("Function.prototype")), true);
+ // public prototype should be the one we passed
+ QCOMPARE(fun.property("prototype").strictlyEquals(proto), true);
+ QEXPECT_FAIL("", "JSCallbackObject::getOwnPropertyDescriptor() doesn't return correct information yet", Continue);
+ QCOMPARE(fun.propertyFlags("prototype"), QScriptValue::Undeletable);
+ QCOMPARE(proto.property("constructor").strictlyEquals(fun), true);
+ QEXPECT_FAIL("", "WebKit bug: 40613 (The JSObjectSetProperty doesn't overwrite property flags)", Continue);
+ QCOMPARE(proto.propertyFlags("constructor"), QScriptValue::PropertyFlags(QScriptValue::Undeletable | QScriptValue::SkipInEnumeration));
+
+ QCOMPARE(fun.call().isNull(), true);
+ // QCOMPARE(fun.construct().isObject(), true);
+ }
+ // whether the return value is correct
+ {
+ QScriptValue fun = eng.newFunction(myFunctionThatReturns);
+ QCOMPARE(fun.isValid(), true);
+ QCOMPARE(fun.isFunction(), true);
+ QCOMPARE(fun.isObject(), true);
+
+ QScriptValue result = fun.call();
+ QCOMPARE(result.isNumber(), true);
+ QCOMPARE(result.toInt32(), 42);
+ }
+ // whether the return value is assigned to the correct engine
+ {
+ QScriptValue fun = eng.newFunction(myFunctionThatReturnsWithoutEngine);
+ QCOMPARE(fun.isValid(), true);
+ QCOMPARE(fun.isFunction(), true);
+ QCOMPARE(fun.isObject(), true);
+
+ QScriptValue result = fun.call();
+ QCOMPARE(result.engine(), &eng);
+ QCOMPARE(result.isNumber(), true);
+ QCOMPARE(result.toInt32(), 1024);
+ }
+ // whether the return value is undefined when returning a value with wrong engine
+ {
+ QScriptEngine wrongEngine;
+
+ QScriptValue fun = eng.newFunction(myFunctionThatReturnsWrongEngine, reinterpret_cast<void*>(&wrongEngine));
+ QCOMPARE(fun.isValid(), true);
+ QCOMPARE(fun.isFunction(), true);
+ QCOMPARE(fun.isObject(), true);
+
+ QTest::ignoreMessage(QtWarningMsg, "Value from different engine returned from native function, returning undefined value instead.");
+ QScriptValue result = fun.call();
+ QCOMPARE(result.isValid(), true);
+ QCOMPARE(result.isUndefined(), true);
+ }
+}
+
void tst_QScriptEngine::newObject()
{
QScriptEngine engine;
diff --git a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.cpp b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.cpp
index a82347e..e04d3e9 100644
--- a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.cpp
+++ b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.cpp
@@ -21,40 +21,15 @@
#include <QtCore/qnumeric.h>
tst_QScriptValue::tst_QScriptValue()
- : engine(0)
+ : m_engine(0)
{
}
tst_QScriptValue::~tst_QScriptValue()
{
- delete engine;
+ delete m_engine;
}
-void tst_QScriptValue::dataHelper(InitDataFunction init, DefineDataFunction define)
-{
- QTest::addColumn<QString>("__expression__");
- (this->*init)();
- QHash<QString, QScriptValue>::const_iterator it;
- for (it = m_values.constBegin(); it != m_values.constEnd(); ++it) {
- m_currentExpression = it.key();
- (this->*define)(it.key().toLatin1());
- }
- m_currentExpression = QString();
-}
-
-QTestData& tst_QScriptValue::newRow(const char* tag)
-{
- return QTest::newRow(tag) << m_currentExpression;
-}
-
-void tst_QScriptValue::testHelper(TestFunction fun)
-{
- QFETCH(QString, __expression__);
- QScriptValue value = m_values.value(__expression__);
- (this->*fun)(__expression__.toLatin1(), value);
-}
-
-
void tst_QScriptValue::ctor()
{
QScriptEngine eng;
@@ -1285,4 +1260,37 @@ void tst_QScriptValue::globalObjectChanges()
QVERIFY(!object.property("foo", QScriptValue::ResolveLocal).isValid());
}
+void tst_QScriptValue::assignAndCopyConstruct_data()
+{
+ QTest::addColumn<QScriptValue>("value");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine;
+ // Copy & assign code is the same for all types, so it is enough to check only a few value.
+ for (unsigned i = 0; i < 10; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second;
+ }
+}
+
+void tst_QScriptValue::assignAndCopyConstruct()
+{
+ QFETCH(QScriptValue, value);
+ QScriptValue copy(value);
+ QEXPECT_FAIL("QScriptValue(QScriptValue::NullValue)", "FIXME: WebKit bug 43038", Abort);
+ QEXPECT_FAIL("QScriptValue(QScriptValue::UndefinedValue)", "FIXME: WebKit bug 43038", Abort);
+ QCOMPARE(copy.strictlyEquals(value), !value.isNumber() || !qIsNaN(value.toNumber()));
+ QCOMPARE(copy.engine(), value.engine());
+
+ QScriptValue assigned = copy;
+ QCOMPARE(assigned.strictlyEquals(value), !copy.isNumber() || !qIsNaN(copy.toNumber()));
+ QCOMPARE(assigned.engine(), assigned.engine());
+
+ QScriptValue other(!value.toBool());
+ assigned = other;
+ QVERIFY(!assigned.strictlyEquals(copy));
+ QVERIFY(assigned.strictlyEquals(other));
+ QCOMPARE(assigned.engine(), other.engine());
+}
+
QTEST_MAIN(tst_QScriptValue)
diff --git a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.h b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.h
index 41b99cd..7b7d9bc 100644
--- a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.h
+++ b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.h
@@ -29,6 +29,8 @@
Q_DECLARE_METATYPE(QScriptValue*);
Q_DECLARE_METATYPE(QScriptValue);
+typedef QPair<QString, QScriptValue> QPairQStringAndQScriptValue;
+Q_DECLARE_METATYPE(QPairQStringAndQScriptValue);
class tst_QScriptValue : public QObject {
Q_OBJECT
@@ -61,14 +63,22 @@ private slots:
void propertyFlag_data();
void propertyFlag();
void globalObjectChanges();
+ void assignAndCopyConstruct_data();
+ void assignAndCopyConstruct();
// Generated test functions.
+ void isArray_data();
+ void isArray();
+
void isBool_data();
void isBool();
void isBoolean_data();
void isBoolean();
+ void isError_data();
+ void isError();
+
void isNumber_data();
void isNumber();
@@ -124,108 +134,10 @@ private slots:
void instanceOf();
private:
- typedef void (tst_QScriptValue::*InitDataFunction)();
- typedef void (tst_QScriptValue::*DefineDataFunction)(const char*);
- void dataHelper(InitDataFunction init, DefineDataFunction define);
- QTestData& newRow(const char* tag);
-
- typedef void (tst_QScriptValue::*TestFunction)(const char*, const QScriptValue&);
- void testHelper(TestFunction fun);
-
- // Generated functions
-
- void initScriptValues();
-
- void isBool_initData();
- void isBool_makeData(const char* expr);
- void isBool_test(const char* expr, const QScriptValue& value);
-
- void isBoolean_initData();
- void isBoolean_makeData(const char* expr);
- void isBoolean_test(const char* expr, const QScriptValue& value);
-
- void isNumber_initData();
- void isNumber_makeData(const char* expr);
- void isNumber_test(const char* expr, const QScriptValue&);
-
- void isFunction_initData();
- void isFunction_makeData(const char* expr);
- void isFunction_test(const char* expr, const QScriptValue& value);
-
- void isNull_initData();
- void isNull_makeData(const char* expr);
- void isNull_test(const char* expr, const QScriptValue& value);
-
- void isObject_initData();
- void isObject_makeData(const char* expr);
- void isObject_test(const char* expr, const QScriptValue& value);
-
- void isString_initData();
- void isString_makeData(const char* expr);
- void isString_test(const char* expr, const QScriptValue& value);
-
- void isUndefined_initData();
- void isUndefined_makeData(const char* expr);
- void isUndefined_test(const char* expr, const QScriptValue& value);
-
- void isValid_initData();
- void isValid_makeData(const char* expr);
- void isValid_test(const char* expr, const QScriptValue& value);
-
- void toString_initData();
- void toString_makeData(const char*);
- void toString_test(const char*, const QScriptValue&);
+ // Generated function
+ QPair<QString, QScriptValue> initScriptValues(uint idx);
- void toNumber_initData();
- void toNumber_makeData(const char*);
- void toNumber_test(const char*, const QScriptValue&);
-
- void toBool_initData();
- void toBool_makeData(const char*);
- void toBool_test(const char*, const QScriptValue&);
-
- void toBoolean_initData();
- void toBoolean_makeData(const char*);
- void toBoolean_test(const char*, const QScriptValue&);
-
- void toInteger_initData();
- void toInteger_makeData(const char*);
- void toInteger_test(const char*, const QScriptValue&);
-
- void toInt32_initData();
- void toInt32_makeData(const char*);
- void toInt32_test(const char*, const QScriptValue&);
-
- void toUInt32_initData();
- void toUInt32_makeData(const char*);
- void toUInt32_test(const char*, const QScriptValue&);
-
- void toUInt16_initData();
- void toUInt16_makeData(const char*);
- void toUInt16_test(const char*, const QScriptValue&);
-
- void equals_initData();
- void equals_makeData(const char*);
- void equals_test(const char*, const QScriptValue&);
-
- void strictlyEquals_initData();
- void strictlyEquals_makeData(const char*);
- void strictlyEquals_test(const char*, const QScriptValue&);
-
- void instanceOf_initData();
- void instanceOf_makeData(const char*);
- void instanceOf_test(const char*, const QScriptValue&);
-
-private:
- QScriptEngine* engine;
- QHash<QString, QScriptValue> m_values;
- QString m_currentExpression;
+ QScriptEngine* m_engine;
};
-#define DEFINE_TEST_FUNCTION(name) \
-void tst_QScriptValue::name##_data() { dataHelper(&tst_QScriptValue::name##_initData, &tst_QScriptValue::name##_makeData); } \
-void tst_QScriptValue::name() { testHelper(&tst_QScriptValue::name##_test); }
-
-
-
#endif // tst_qscriptvalue_h
diff --git a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_comparison.cpp b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_comparison.cpp
index 7586b15..3209530 100644
--- a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_comparison.cpp
+++ b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_comparison.cpp
@@ -23,14 +23,7 @@
#include "tst_qscriptvalue.h"
-void tst_QScriptValue::equals_initData()
-{
- QTest::addColumn<QScriptValue>("other");
- QTest::addColumn<bool>("expected");
- initScriptValues();
-}
-
-static QString equals_array[] = {
+static const QString equals_array[] = {
"QScriptValue() <=> QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(QScriptValue::NullValue)",
@@ -84,6 +77,7 @@ static QString equals_array[] = {
"QScriptValue(false) <=> engine->evaluate(\"0.0\")",
"QScriptValue(false) <=> engine->evaluate(\"''\")",
"QScriptValue(false) <=> engine->evaluate(\"'0'\")",
+ "QScriptValue(false) <=> engine->newArray()",
"QScriptValue(int(122)) <=> QScriptValue(int(122))",
"QScriptValue(int(122)) <=> QScriptValue(0, int(122))",
"QScriptValue(int(122)) <=> QScriptValue(engine, int(122))",
@@ -118,6 +112,7 @@ static QString equals_array[] = {
"QScriptValue(0) <=> engine->evaluate(\"0.0\")",
"QScriptValue(0) <=> engine->evaluate(\"''\")",
"QScriptValue(0) <=> engine->evaluate(\"'0'\")",
+ "QScriptValue(0) <=> engine->newArray()",
"QScriptValue(0.0) <=> QScriptValue(false)",
"QScriptValue(0.0) <=> QScriptValue(0)",
"QScriptValue(0.0) <=> QScriptValue(0.0)",
@@ -144,6 +139,7 @@ static QString equals_array[] = {
"QScriptValue(0.0) <=> engine->evaluate(\"0.0\")",
"QScriptValue(0.0) <=> engine->evaluate(\"''\")",
"QScriptValue(0.0) <=> engine->evaluate(\"'0'\")",
+ "QScriptValue(0.0) <=> engine->newArray()",
"QScriptValue(123.0) <=> QScriptValue(123.0)",
"QScriptValue(123.0) <=> QScriptValue(QString(\"123\"))",
"QScriptValue(123.0) <=> QScriptValue(0, 123.0)",
@@ -239,6 +235,7 @@ static QString equals_array[] = {
"QScriptValue(QString(\"\")) <=> engine->evaluate(\"0\")",
"QScriptValue(QString(\"\")) <=> engine->evaluate(\"0.0\")",
"QScriptValue(QString(\"\")) <=> engine->evaluate(\"''\")",
+ "QScriptValue(QString(\"\")) <=> engine->newArray()",
"QScriptValue(QString()) <=> QScriptValue(false)",
"QScriptValue(QString()) <=> QScriptValue(0)",
"QScriptValue(QString()) <=> QScriptValue(0.0)",
@@ -261,6 +258,7 @@ static QString equals_array[] = {
"QScriptValue(QString()) <=> engine->evaluate(\"0\")",
"QScriptValue(QString()) <=> engine->evaluate(\"0.0\")",
"QScriptValue(QString()) <=> engine->evaluate(\"''\")",
+ "QScriptValue(QString()) <=> engine->newArray()",
"QScriptValue(QString(\"0\")) <=> QScriptValue(false)",
"QScriptValue(QString(\"0\")) <=> QScriptValue(0)",
"QScriptValue(QString(\"0\")) <=> QScriptValue(0.0)",
@@ -339,6 +337,7 @@ static QString equals_array[] = {
"QScriptValue(0, false) <=> engine->evaluate(\"0.0\")",
"QScriptValue(0, false) <=> engine->evaluate(\"''\")",
"QScriptValue(0, false) <=> engine->evaluate(\"'0'\")",
+ "QScriptValue(0, false) <=> engine->newArray()",
"QScriptValue(0, int(122)) <=> QScriptValue(int(122))",
"QScriptValue(0, int(122)) <=> QScriptValue(0, int(122))",
"QScriptValue(0, int(122)) <=> QScriptValue(engine, int(122))",
@@ -373,6 +372,7 @@ static QString equals_array[] = {
"QScriptValue(0, 0) <=> engine->evaluate(\"0.0\")",
"QScriptValue(0, 0) <=> engine->evaluate(\"''\")",
"QScriptValue(0, 0) <=> engine->evaluate(\"'0'\")",
+ "QScriptValue(0, 0) <=> engine->newArray()",
"QScriptValue(0, 0.0) <=> QScriptValue(false)",
"QScriptValue(0, 0.0) <=> QScriptValue(0)",
"QScriptValue(0, 0.0) <=> QScriptValue(0.0)",
@@ -399,6 +399,7 @@ static QString equals_array[] = {
"QScriptValue(0, 0.0) <=> engine->evaluate(\"0.0\")",
"QScriptValue(0, 0.0) <=> engine->evaluate(\"''\")",
"QScriptValue(0, 0.0) <=> engine->evaluate(\"'0'\")",
+ "QScriptValue(0, 0.0) <=> engine->newArray()",
"QScriptValue(0, 123.0) <=> QScriptValue(123.0)",
"QScriptValue(0, 123.0) <=> QScriptValue(QString(\"123\"))",
"QScriptValue(0, 123.0) <=> QScriptValue(0, 123.0)",
@@ -494,6 +495,7 @@ static QString equals_array[] = {
"QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"0\")",
"QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"0.0\")",
"QScriptValue(0, QString(\"\")) <=> engine->evaluate(\"''\")",
+ "QScriptValue(0, QString(\"\")) <=> engine->newArray()",
"QScriptValue(0, QString()) <=> QScriptValue(false)",
"QScriptValue(0, QString()) <=> QScriptValue(0)",
"QScriptValue(0, QString()) <=> QScriptValue(0.0)",
@@ -516,6 +518,7 @@ static QString equals_array[] = {
"QScriptValue(0, QString()) <=> engine->evaluate(\"0\")",
"QScriptValue(0, QString()) <=> engine->evaluate(\"0.0\")",
"QScriptValue(0, QString()) <=> engine->evaluate(\"''\")",
+ "QScriptValue(0, QString()) <=> engine->newArray()",
"QScriptValue(0, QString(\"0\")) <=> QScriptValue(false)",
"QScriptValue(0, QString(\"0\")) <=> QScriptValue(0)",
"QScriptValue(0, QString(\"0\")) <=> QScriptValue(0.0)",
@@ -593,6 +596,7 @@ static QString equals_array[] = {
"QScriptValue(engine, false) <=> engine->evaluate(\"0.0\")",
"QScriptValue(engine, false) <=> engine->evaluate(\"''\")",
"QScriptValue(engine, false) <=> engine->evaluate(\"'0'\")",
+ "QScriptValue(engine, false) <=> engine->newArray()",
"QScriptValue(engine, int(122)) <=> QScriptValue(int(122))",
"QScriptValue(engine, int(122)) <=> QScriptValue(0, int(122))",
"QScriptValue(engine, int(122)) <=> QScriptValue(engine, int(122))",
@@ -627,6 +631,7 @@ static QString equals_array[] = {
"QScriptValue(engine, 0) <=> engine->evaluate(\"0.0\")",
"QScriptValue(engine, 0) <=> engine->evaluate(\"''\")",
"QScriptValue(engine, 0) <=> engine->evaluate(\"'0'\")",
+ "QScriptValue(engine, 0) <=> engine->newArray()",
"QScriptValue(engine, 0.0) <=> QScriptValue(false)",
"QScriptValue(engine, 0.0) <=> QScriptValue(0)",
"QScriptValue(engine, 0.0) <=> QScriptValue(0.0)",
@@ -653,6 +658,7 @@ static QString equals_array[] = {
"QScriptValue(engine, 0.0) <=> engine->evaluate(\"0.0\")",
"QScriptValue(engine, 0.0) <=> engine->evaluate(\"''\")",
"QScriptValue(engine, 0.0) <=> engine->evaluate(\"'0'\")",
+ "QScriptValue(engine, 0.0) <=> engine->newArray()",
"QScriptValue(engine, 123.0) <=> QScriptValue(123.0)",
"QScriptValue(engine, 123.0) <=> QScriptValue(QString(\"123\"))",
"QScriptValue(engine, 123.0) <=> QScriptValue(0, 123.0)",
@@ -748,6 +754,7 @@ static QString equals_array[] = {
"QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"0\")",
"QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"0.0\")",
"QScriptValue(engine, QString(\"\")) <=> engine->evaluate(\"''\")",
+ "QScriptValue(engine, QString(\"\")) <=> engine->newArray()",
"QScriptValue(engine, QString()) <=> QScriptValue(false)",
"QScriptValue(engine, QString()) <=> QScriptValue(0)",
"QScriptValue(engine, QString()) <=> QScriptValue(0.0)",
@@ -770,6 +777,7 @@ static QString equals_array[] = {
"QScriptValue(engine, QString()) <=> engine->evaluate(\"0\")",
"QScriptValue(engine, QString()) <=> engine->evaluate(\"0.0\")",
"QScriptValue(engine, QString()) <=> engine->evaluate(\"''\")",
+ "QScriptValue(engine, QString()) <=> engine->newArray()",
"QScriptValue(engine, QString(\"0\")) <=> QScriptValue(false)",
"QScriptValue(engine, QString(\"0\")) <=> QScriptValue(0)",
"QScriptValue(engine, QString(\"0\")) <=> QScriptValue(0.0)",
@@ -810,7 +818,6 @@ static QString equals_array[] = {
"engine->evaluate(\"[]\") <=> QScriptValue(engine, 0.0)",
"engine->evaluate(\"[]\") <=> QScriptValue(engine, QString(\"\"))",
"engine->evaluate(\"[]\") <=> QScriptValue(engine, QString())",
- "engine->evaluate(\"[]\") <=> engine->evaluate(\"[]\")",
"engine->evaluate(\"[]\") <=> engine->evaluate(\"false\")",
"engine->evaluate(\"[]\") <=> engine->evaluate(\"0\")",
"engine->evaluate(\"[]\") <=> engine->evaluate(\"0.0\")",
@@ -854,11 +861,6 @@ static QString equals_array[] = {
"engine->evaluate(\"Array\") <=> engine->evaluate(\"Array\")",
"engine->evaluate(\"Number\") <=> engine->evaluate(\"Number\")",
"engine->evaluate(\"Function\") <=> engine->evaluate(\"Function\")",
- "engine->evaluate(\"(function() { return 1; })\") <=> engine->evaluate(\"(function() { return 1; })\")",
- "engine->evaluate(\"(function() { return 'ciao'; })\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
- "engine->evaluate(\"(function() { throw new Error('foo' })\") <=> engine->evaluate(\"(function() { throw new Error('foo' })\")",
- "engine->evaluate(\"/foo/\") <=> engine->evaluate(\"/foo/\")",
- "engine->evaluate(\"new Object()\") <=> engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\") <=> QScriptValue(false)",
"engine->evaluate(\"new Array()\") <=> QScriptValue(0)",
"engine->evaluate(\"new Array()\") <=> QScriptValue(0.0)",
@@ -874,17 +876,11 @@ static QString equals_array[] = {
"engine->evaluate(\"new Array()\") <=> QScriptValue(engine, 0.0)",
"engine->evaluate(\"new Array()\") <=> QScriptValue(engine, QString(\"\"))",
"engine->evaluate(\"new Array()\") <=> QScriptValue(engine, QString())",
- "engine->evaluate(\"new Array()\") <=> engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Array()\") <=> engine->evaluate(\"false\")",
"engine->evaluate(\"new Array()\") <=> engine->evaluate(\"0\")",
"engine->evaluate(\"new Array()\") <=> engine->evaluate(\"0.0\")",
"engine->evaluate(\"new Array()\") <=> engine->evaluate(\"''\")",
- "engine->evaluate(\"new Error()\") <=> engine->evaluate(\"new Error()\")",
- "engine->evaluate(\"a = new Object( a.foo = 22; a.foo\") <=> engine->evaluate(\"a = new Object( a.foo = 22; a.foo\")",
- "engine->evaluate(\"Undefined\") <=> engine->evaluate(\"Undefined\")",
- "engine->evaluate(\"Null\") <=> engine->evaluate(\"Null\")",
- "engine->evaluate(\"True\") <=> engine->evaluate(\"True\")",
- "engine->evaluate(\"False\") <=> engine->evaluate(\"False\")",
+ "engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"undefined\") <=> QScriptValue(QScriptValue::UndefinedValue)",
"engine->evaluate(\"undefined\") <=> QScriptValue(QScriptValue::NullValue)",
"engine->evaluate(\"undefined\") <=> QScriptValue(0, QScriptValue::UndefinedValue)",
@@ -937,6 +933,7 @@ static QString equals_array[] = {
"engine->evaluate(\"false\") <=> engine->evaluate(\"0.0\")",
"engine->evaluate(\"false\") <=> engine->evaluate(\"''\")",
"engine->evaluate(\"false\") <=> engine->evaluate(\"'0'\")",
+ "engine->evaluate(\"false\") <=> engine->newArray()",
"engine->evaluate(\"122\") <=> QScriptValue(int(122))",
"engine->evaluate(\"122\") <=> QScriptValue(0, int(122))",
"engine->evaluate(\"122\") <=> QScriptValue(engine, int(122))",
@@ -971,6 +968,7 @@ static QString equals_array[] = {
"engine->evaluate(\"0\") <=> engine->evaluate(\"0.0\")",
"engine->evaluate(\"0\") <=> engine->evaluate(\"''\")",
"engine->evaluate(\"0\") <=> engine->evaluate(\"'0'\")",
+ "engine->evaluate(\"0\") <=> engine->newArray()",
"engine->evaluate(\"0.0\") <=> QScriptValue(false)",
"engine->evaluate(\"0.0\") <=> QScriptValue(0)",
"engine->evaluate(\"0.0\") <=> QScriptValue(0.0)",
@@ -997,6 +995,7 @@ static QString equals_array[] = {
"engine->evaluate(\"0.0\") <=> engine->evaluate(\"0.0\")",
"engine->evaluate(\"0.0\") <=> engine->evaluate(\"''\")",
"engine->evaluate(\"0.0\") <=> engine->evaluate(\"'0'\")",
+ "engine->evaluate(\"0.0\") <=> engine->newArray()",
"engine->evaluate(\"123.0\") <=> QScriptValue(123.0)",
"engine->evaluate(\"123.0\") <=> QScriptValue(QString(\"123\"))",
"engine->evaluate(\"123.0\") <=> QScriptValue(0, 123.0)",
@@ -1068,6 +1067,7 @@ static QString equals_array[] = {
"engine->evaluate(\"''\") <=> engine->evaluate(\"0\")",
"engine->evaluate(\"''\") <=> engine->evaluate(\"0.0\")",
"engine->evaluate(\"''\") <=> engine->evaluate(\"''\")",
+ "engine->evaluate(\"''\") <=> engine->newArray()",
"engine->evaluate(\"'0'\") <=> QScriptValue(false)",
"engine->evaluate(\"'0'\") <=> QScriptValue(0)",
"engine->evaluate(\"'0'\") <=> QScriptValue(0.0)",
@@ -1115,41 +1115,73 @@ static QString equals_array[] = {
"engine->undefinedValue() <=> engine->evaluate(\"undefined\")",
"engine->undefinedValue() <=> engine->evaluate(\"null\")",
"engine->undefinedValue() <=> engine->nullValue()",
- "engine->undefinedValue() <=> engine->undefinedValue()"};
+ "engine->undefinedValue() <=> engine->undefinedValue()",
+ "engine->newArray() <=> QScriptValue(false)",
+ "engine->newArray() <=> QScriptValue(0)",
+ "engine->newArray() <=> QScriptValue(0.0)",
+ "engine->newArray() <=> QScriptValue(QString(\"\"))",
+ "engine->newArray() <=> QScriptValue(QString())",
+ "engine->newArray() <=> QScriptValue(0, false)",
+ "engine->newArray() <=> QScriptValue(0, 0)",
+ "engine->newArray() <=> QScriptValue(0, 0.0)",
+ "engine->newArray() <=> QScriptValue(0, QString(\"\"))",
+ "engine->newArray() <=> QScriptValue(0, QString())",
+ "engine->newArray() <=> QScriptValue(engine, false)",
+ "engine->newArray() <=> QScriptValue(engine, 0)",
+ "engine->newArray() <=> QScriptValue(engine, 0.0)",
+ "engine->newArray() <=> QScriptValue(engine, QString(\"\"))",
+ "engine->newArray() <=> QScriptValue(engine, QString())",
+ "engine->newArray() <=> engine->evaluate(\"false\")",
+ "engine->newArray() <=> engine->evaluate(\"0\")",
+ "engine->newArray() <=> engine->evaluate(\"0.0\")",
+ "engine->newArray() <=> engine->evaluate(\"''\")"};
-void tst_QScriptValue::equals_makeData(const char *expr)
+void tst_QScriptValue::equals_data()
{
- static QSet<QString> equals;
- if (equals.isEmpty()) {
- equals.reserve(1085);
- for (unsigned i = 0; i < 1085; ++i)
- equals.insert(equals_array[i]);
- }
- QHash<QString, QScriptValue>::const_iterator it;
- for (it = m_values.constBegin(); it != m_values.constEnd(); ++it) {
- QString tag = QString::fromLatin1("%20 <=> %21").arg(expr).arg(it.key());
- newRow(tag.toLatin1()) << it.value() << equals.contains(tag);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<QScriptValue>("other");
+ QTest::addColumn<bool>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QSet<QString> equals;
+ equals.reserve(1111);
+ for (unsigned i = 0; i < 1111; ++i)
+ equals.insert(equals_array[i]);
+ for (unsigned i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> value1 = initScriptValues(i);
+ for (unsigned j = 0; j < 135; ++j) {
+ QPair<QString, QScriptValue> value2 = initScriptValues(j);
+ QString tag = QString::fromLatin1("%20 <=> %21").arg(value1.first, value2.first);
+ QTest::newRow(tag.toAscii().constData()) << value1.second << value2.second << equals.contains(tag); }
}
}
-void tst_QScriptValue::equals_test(const char *, const QScriptValue& value)
+void tst_QScriptValue::equals()
{
+ QFETCH(QScriptValue, value);
QFETCH(QScriptValue, other);
QFETCH(bool, expected);
+ QEXPECT_FAIL("QScriptValue(qInf()) <=> QScriptValue(\"-Infinity\")", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(qInf()) <=> QScriptValue(0, \"-Infinity\")", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(-qInf()) <=> QScriptValue(\"-Infinity\")", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(-qInf()) <=> QScriptValue(0, \"-Infinity\")", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(\"-Infinity\") <=> QScriptValue(qInf())", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(\"-Infinity\") <=> QScriptValue(-qInf())", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(\"-Infinity\") <=> QScriptValue(0, qInf())", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(\"-Infinity\") <=> QScriptValue(0, -qInf())", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, qInf()) <=> QScriptValue(\"-Infinity\")", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, qInf()) <=> QScriptValue(0, \"-Infinity\")", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, -qInf()) <=> QScriptValue(\"-Infinity\")", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, -qInf()) <=> QScriptValue(0, \"-Infinity\")", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, \"-Infinity\") <=> QScriptValue(qInf())", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, \"-Infinity\") <=> QScriptValue(-qInf())", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, \"-Infinity\") <=> QScriptValue(0, qInf())", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, \"-Infinity\") <=> QScriptValue(0, -qInf())", "FIXME: WebKit bug 43038", Continue);
QCOMPARE(value.equals(other), expected);
}
-DEFINE_TEST_FUNCTION(equals)
-
-
-void tst_QScriptValue::strictlyEquals_initData()
-{
- QTest::addColumn<QScriptValue>("other");
- QTest::addColumn<bool>("expected");
- initScriptValues();
-}
-
-static QString strictlyEquals_array[] = {
+static const QString strictlyEquals_array[] = {
"QScriptValue() <=> QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(0, QScriptValue::UndefinedValue)",
@@ -1515,7 +1547,6 @@ static QString strictlyEquals_array[] = {
"QScriptValue(engine, QString(\"123\")) <=> QScriptValue(engine, QString(\"123\"))",
"QScriptValue(engine, QString(\"123\")) <=> engine->evaluate(\"'123'\")",
"QScriptValue(engine, QString(\"1.23\")) <=> QScriptValue(engine, QString(\"1.23\"))",
- "engine->evaluate(\"[]\") <=> engine->evaluate(\"[]\")",
"engine->evaluate(\"{}\") <=> QScriptValue(QScriptValue::UndefinedValue)",
"engine->evaluate(\"{}\") <=> QScriptValue(0, QScriptValue::UndefinedValue)",
"engine->evaluate(\"{}\") <=> QScriptValue(engine, QScriptValue::UndefinedValue)",
@@ -1531,18 +1562,7 @@ static QString strictlyEquals_array[] = {
"engine->evaluate(\"Array\") <=> engine->evaluate(\"Array\")",
"engine->evaluate(\"Number\") <=> engine->evaluate(\"Number\")",
"engine->evaluate(\"Function\") <=> engine->evaluate(\"Function\")",
- "engine->evaluate(\"(function() { return 1; })\") <=> engine->evaluate(\"(function() { return 1; })\")",
- "engine->evaluate(\"(function() { return 'ciao'; })\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")",
- "engine->evaluate(\"(function() { throw new Error('foo' })\") <=> engine->evaluate(\"(function() { throw new Error('foo' })\")",
- "engine->evaluate(\"/foo/\") <=> engine->evaluate(\"/foo/\")",
- "engine->evaluate(\"new Object()\") <=> engine->evaluate(\"new Object()\")",
- "engine->evaluate(\"new Array()\") <=> engine->evaluate(\"new Array()\")",
- "engine->evaluate(\"new Error()\") <=> engine->evaluate(\"new Error()\")",
- "engine->evaluate(\"a = new Object( a.foo = 22; a.foo\") <=> engine->evaluate(\"a = new Object( a.foo = 22; a.foo\")",
- "engine->evaluate(\"Undefined\") <=> engine->evaluate(\"Undefined\")",
- "engine->evaluate(\"Null\") <=> engine->evaluate(\"Null\")",
- "engine->evaluate(\"True\") <=> engine->evaluate(\"True\")",
- "engine->evaluate(\"False\") <=> engine->evaluate(\"False\")",
+ "engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\") <=> engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"undefined\") <=> QScriptValue(QScriptValue::UndefinedValue)",
"engine->evaluate(\"undefined\") <=> QScriptValue(0, QScriptValue::UndefinedValue)",
"engine->evaluate(\"undefined\") <=> QScriptValue(engine, QScriptValue::UndefinedValue)",
@@ -1654,39 +1674,66 @@ static QString strictlyEquals_array[] = {
"engine->undefinedValue() <=> engine->evaluate(\"undefined\")",
"engine->undefinedValue() <=> engine->undefinedValue()"};
-void tst_QScriptValue::strictlyEquals_makeData(const char* expr)
+void tst_QScriptValue::strictlyEquals_data()
{
- static QSet<QString> equals;
- if (equals.isEmpty()) {
- equals.reserve(503);
- for (unsigned i = 0; i < 503; ++i)
- equals.insert(strictlyEquals_array[i]);
- }
- QHash<QString, QScriptValue>::const_iterator it;
- for (it = m_values.constBegin(); it != m_values.constEnd(); ++it) {
- QString tag = QString::fromLatin1("%20 <=> %21").arg(expr).arg(it.key());
- newRow(tag.toLatin1()) << it.value() << equals.contains(tag);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<QScriptValue>("other");
+ QTest::addColumn<bool>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QSet<QString> equals;
+ equals.reserve(491);
+ for (unsigned i = 0; i < 491; ++i)
+ equals.insert(strictlyEquals_array[i]);
+ for (unsigned i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> value1 = initScriptValues(i);
+ for (unsigned j = 0; j < 135; ++j) {
+ QPair<QString, QScriptValue> value2 = initScriptValues(j);
+ QString tag = QString::fromLatin1("%20 <=> %21").arg(value1.first, value2.first);
+ QTest::newRow(tag.toAscii().constData()) << value1.second << value2.second << equals.contains(tag); }
}
}
-void tst_QScriptValue::strictlyEquals_test(const char*, const QScriptValue& value)
+void tst_QScriptValue::strictlyEquals()
{
+ QFETCH(QScriptValue, value);
QFETCH(QScriptValue, other);
QFETCH(bool, expected);
+ QEXPECT_FAIL("QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(QScriptValue::UndefinedValue)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(0, QScriptValue::UndefinedValue)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(QScriptValue::UndefinedValue) <=> engine->evaluate(\"{}\")", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(QScriptValue::UndefinedValue) <=> engine->evaluate(\"undefined\")", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(QScriptValue::UndefinedValue) <=> engine->undefinedValue()", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(QScriptValue::NullValue)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(0, QScriptValue::NullValue)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::NullValue)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"null\")", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(QScriptValue::NullValue) <=> engine->nullValue()", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(true) <=> QScriptValue(true)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(true) <=> QScriptValue(0, true)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(false) <=> QScriptValue(false)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(false) <=> QScriptValue(0, false)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, QScriptValue::UndefinedValue) <=> QScriptValue(QScriptValue::UndefinedValue)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, QScriptValue::UndefinedValue) <=> QScriptValue(0, QScriptValue::UndefinedValue)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, QScriptValue::UndefinedValue) <=> engine->evaluate(\"{}\")", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, QScriptValue::UndefinedValue) <=> engine->evaluate(\"undefined\")", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, QScriptValue::UndefinedValue) <=> engine->undefinedValue()", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(QScriptValue::NullValue)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(0, QScriptValue::NullValue)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::NullValue)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"null\")", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, QScriptValue::NullValue) <=> engine->nullValue()", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, true) <=> QScriptValue(true)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, true) <=> QScriptValue(0, true)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, false) <=> QScriptValue(false)", "FIXME: WebKit bug 43038", Continue);
+ QEXPECT_FAIL("QScriptValue(0, false) <=> QScriptValue(0, false)", "FIXME: WebKit bug 43038", Continue);
QCOMPARE(value.strictlyEquals(other), expected);
}
-DEFINE_TEST_FUNCTION(strictlyEquals)
-
-
-void tst_QScriptValue::instanceOf_initData()
-{
- QTest::addColumn<QScriptValue>("other");
- QTest::addColumn<bool>("expected");
- initScriptValues();
-}
-
-static QString instanceOf_array[] = {
+static const QString instanceOf_array[] = {
"engine->evaluate(\"[]\") <=> engine->evaluate(\"Object\")",
"engine->evaluate(\"[]\") <=> engine->evaluate(\"Array\")",
"engine->evaluate(\"Date.prototype\") <=> engine->evaluate(\"Object\")",
@@ -1705,38 +1752,48 @@ static QString instanceOf_array[] = {
"engine->evaluate(\"(function() { return 1; })\") <=> engine->evaluate(\"Function\")",
"engine->evaluate(\"(function() { return 'ciao'; })\") <=> engine->evaluate(\"Object\")",
"engine->evaluate(\"(function() { return 'ciao'; })\") <=> engine->evaluate(\"Function\")",
- "engine->evaluate(\"(function() { throw new Error('foo' })\") <=> engine->evaluate(\"Object\")",
+ "engine->evaluate(\"(function() { throw new Error('foo'); })\") <=> engine->evaluate(\"Object\")",
+ "engine->evaluate(\"(function() { throw new Error('foo'); })\") <=> engine->evaluate(\"Function\")",
"engine->evaluate(\"/foo/\") <=> engine->evaluate(\"Object\")",
"engine->evaluate(\"new Object()\") <=> engine->evaluate(\"Object\")",
"engine->evaluate(\"new Array()\") <=> engine->evaluate(\"Object\")",
"engine->evaluate(\"new Array()\") <=> engine->evaluate(\"Array\")",
"engine->evaluate(\"new Error()\") <=> engine->evaluate(\"Object\")",
- "engine->evaluate(\"a = new Object( a.foo = 22; a.foo\") <=> engine->evaluate(\"Object\")",
"engine->evaluate(\"Undefined\") <=> engine->evaluate(\"Object\")",
"engine->evaluate(\"Null\") <=> engine->evaluate(\"Object\")",
"engine->evaluate(\"True\") <=> engine->evaluate(\"Object\")",
- "engine->evaluate(\"False\") <=> engine->evaluate(\"Object\")"};
+ "engine->evaluate(\"False\") <=> engine->evaluate(\"Object\")",
+ "engine->newObject() <=> engine->evaluate(\"Object\")",
+ "engine->newArray() <=> engine->evaluate(\"Object\")",
+ "engine->newArray() <=> engine->evaluate(\"Array\")",
+ "engine->newArray(10) <=> engine->evaluate(\"Object\")",
+ "engine->newArray(10) <=> engine->evaluate(\"Array\")"};
-void tst_QScriptValue::instanceOf_makeData(const char *expr)
+void tst_QScriptValue::instanceOf_data()
{
- static QSet<QString> equals;
- if (equals.isEmpty()) {
- equals.reserve(29);
- for (unsigned i = 0; i < 29; ++i)
- equals.insert(instanceOf_array[i]);
- }
- QHash<QString, QScriptValue>::const_iterator it;
- for (it = m_values.constBegin(); it != m_values.constEnd(); ++it) {
- QString tag = QString::fromLatin1("%20 <=> %21").arg(expr).arg(it.key());
- newRow(tag.toLatin1()) << it.value() << equals.contains(tag);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<QScriptValue>("other");
+ QTest::addColumn<bool>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QSet<QString> equals;
+ equals.reserve(34);
+ for (unsigned i = 0; i < 34; ++i)
+ equals.insert(instanceOf_array[i]);
+ for (unsigned i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> value1 = initScriptValues(i);
+ for (unsigned j = 0; j < 135; ++j) {
+ QPair<QString, QScriptValue> value2 = initScriptValues(j);
+ QString tag = QString::fromLatin1("%20 <=> %21").arg(value1.first, value2.first);
+ QTest::newRow(tag.toAscii().constData()) << value1.second << value2.second << equals.contains(tag); }
}
}
-void tst_QScriptValue::instanceOf_test(const char *, const QScriptValue& value)
+void tst_QScriptValue::instanceOf()
{
+ QFETCH(QScriptValue, value);
QFETCH(QScriptValue, other);
QFETCH(bool, expected);
QCOMPARE(value.instanceOf(other), expected);
}
-
-DEFINE_TEST_FUNCTION(instanceOf)
diff --git a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_init.cpp b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_init.cpp
index b68aaf2..4c97dd4 100644
--- a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_init.cpp
+++ b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_init.cpp
@@ -24,142 +24,146 @@
#include "tst_qscriptvalue.h"
-void tst_QScriptValue::initScriptValues()
+QPair<QString, QScriptValue> tst_QScriptValue::initScriptValues(uint idx)
{
- m_values.clear();
- if (engine)
- delete engine;
- engine = new QScriptEngine;
- DEFINE_TEST_VALUE(QScriptValue());
- DEFINE_TEST_VALUE(QScriptValue(QScriptValue::UndefinedValue));
- DEFINE_TEST_VALUE(QScriptValue(QScriptValue::NullValue));
- DEFINE_TEST_VALUE(QScriptValue(true));
- DEFINE_TEST_VALUE(QScriptValue(false));
- DEFINE_TEST_VALUE(QScriptValue(int(122)));
- DEFINE_TEST_VALUE(QScriptValue(uint(124)));
- DEFINE_TEST_VALUE(QScriptValue(0));
- DEFINE_TEST_VALUE(QScriptValue(0.0));
- DEFINE_TEST_VALUE(QScriptValue(123.0));
- DEFINE_TEST_VALUE(QScriptValue(6.37e-8));
- DEFINE_TEST_VALUE(QScriptValue(-6.37e-8));
- DEFINE_TEST_VALUE(QScriptValue(0x43211234));
- DEFINE_TEST_VALUE(QScriptValue(0x10000));
- DEFINE_TEST_VALUE(QScriptValue(0x10001));
- DEFINE_TEST_VALUE(QScriptValue(qSNaN()));
- DEFINE_TEST_VALUE(QScriptValue(qQNaN()));
- DEFINE_TEST_VALUE(QScriptValue(qInf()));
- DEFINE_TEST_VALUE(QScriptValue(-qInf()));
- DEFINE_TEST_VALUE(QScriptValue("NaN"));
- DEFINE_TEST_VALUE(QScriptValue("Infinity"));
- DEFINE_TEST_VALUE(QScriptValue("-Infinity"));
- DEFINE_TEST_VALUE(QScriptValue("ciao"));
- DEFINE_TEST_VALUE(QScriptValue(QString::fromLatin1("ciao")));
- DEFINE_TEST_VALUE(QScriptValue(QString("")));
- DEFINE_TEST_VALUE(QScriptValue(QString()));
- DEFINE_TEST_VALUE(QScriptValue(QString("0")));
- DEFINE_TEST_VALUE(QScriptValue(QString("123")));
- DEFINE_TEST_VALUE(QScriptValue(QString("12.4")));
- DEFINE_TEST_VALUE(QScriptValue(0, QScriptValue::UndefinedValue));
- DEFINE_TEST_VALUE(QScriptValue(0, QScriptValue::NullValue));
- DEFINE_TEST_VALUE(QScriptValue(0, true));
- DEFINE_TEST_VALUE(QScriptValue(0, false));
- DEFINE_TEST_VALUE(QScriptValue(0, int(122)));
- DEFINE_TEST_VALUE(QScriptValue(0, uint(124)));
- DEFINE_TEST_VALUE(QScriptValue(0, 0));
- DEFINE_TEST_VALUE(QScriptValue(0, 0.0));
- DEFINE_TEST_VALUE(QScriptValue(0, 123.0));
- DEFINE_TEST_VALUE(QScriptValue(0, 6.37e-8));
- DEFINE_TEST_VALUE(QScriptValue(0, -6.37e-8));
- DEFINE_TEST_VALUE(QScriptValue(0, 0x43211234));
- DEFINE_TEST_VALUE(QScriptValue(0, 0x10000));
- DEFINE_TEST_VALUE(QScriptValue(0, 0x10001));
- DEFINE_TEST_VALUE(QScriptValue(0, qSNaN()));
- DEFINE_TEST_VALUE(QScriptValue(0, qQNaN()));
- DEFINE_TEST_VALUE(QScriptValue(0, qInf()));
- DEFINE_TEST_VALUE(QScriptValue(0, -qInf()));
- DEFINE_TEST_VALUE(QScriptValue(0, "NaN"));
- DEFINE_TEST_VALUE(QScriptValue(0, "Infinity"));
- DEFINE_TEST_VALUE(QScriptValue(0, "-Infinity"));
- DEFINE_TEST_VALUE(QScriptValue(0, "ciao"));
- DEFINE_TEST_VALUE(QScriptValue(0, QString::fromLatin1("ciao")));
- DEFINE_TEST_VALUE(QScriptValue(0, QString("")));
- DEFINE_TEST_VALUE(QScriptValue(0, QString()));
- DEFINE_TEST_VALUE(QScriptValue(0, QString("0")));
- DEFINE_TEST_VALUE(QScriptValue(0, QString("123")));
- DEFINE_TEST_VALUE(QScriptValue(0, QString("12.3")));
- DEFINE_TEST_VALUE(QScriptValue(engine, QScriptValue::UndefinedValue));
- DEFINE_TEST_VALUE(QScriptValue(engine, QScriptValue::NullValue));
- DEFINE_TEST_VALUE(QScriptValue(engine, true));
- DEFINE_TEST_VALUE(QScriptValue(engine, false));
- DEFINE_TEST_VALUE(QScriptValue(engine, int(122)));
- DEFINE_TEST_VALUE(QScriptValue(engine, uint(124)));
- DEFINE_TEST_VALUE(QScriptValue(engine, 0));
- DEFINE_TEST_VALUE(QScriptValue(engine, 0.0));
- DEFINE_TEST_VALUE(QScriptValue(engine, 123.0));
- DEFINE_TEST_VALUE(QScriptValue(engine, 6.37e-8));
- DEFINE_TEST_VALUE(QScriptValue(engine, -6.37e-8));
- DEFINE_TEST_VALUE(QScriptValue(engine, 0x43211234));
- DEFINE_TEST_VALUE(QScriptValue(engine, 0x10000));
- DEFINE_TEST_VALUE(QScriptValue(engine, 0x10001));
- DEFINE_TEST_VALUE(QScriptValue(engine, qSNaN()));
- DEFINE_TEST_VALUE(QScriptValue(engine, qQNaN()));
- DEFINE_TEST_VALUE(QScriptValue(engine, qInf()));
- DEFINE_TEST_VALUE(QScriptValue(engine, -qInf()));
- DEFINE_TEST_VALUE(QScriptValue(engine, "NaN"));
- DEFINE_TEST_VALUE(QScriptValue(engine, "Infinity"));
- DEFINE_TEST_VALUE(QScriptValue(engine, "-Infinity"));
- DEFINE_TEST_VALUE(QScriptValue(engine, "ciao"));
- DEFINE_TEST_VALUE(QScriptValue(engine, QString::fromLatin1("ciao")));
- DEFINE_TEST_VALUE(QScriptValue(engine, QString("")));
- DEFINE_TEST_VALUE(QScriptValue(engine, QString()));
- DEFINE_TEST_VALUE(QScriptValue(engine, QString("0")));
- DEFINE_TEST_VALUE(QScriptValue(engine, QString("123")));
- DEFINE_TEST_VALUE(QScriptValue(engine, QString("1.23")));
- DEFINE_TEST_VALUE(engine->evaluate("[]"));
- DEFINE_TEST_VALUE(engine->evaluate("{}"));
- DEFINE_TEST_VALUE(engine->evaluate("Object.prototype"));
- DEFINE_TEST_VALUE(engine->evaluate("Date.prototype"));
- DEFINE_TEST_VALUE(engine->evaluate("Array.prototype"));
- DEFINE_TEST_VALUE(engine->evaluate("Function.prototype"));
- DEFINE_TEST_VALUE(engine->evaluate("Error.prototype"));
- DEFINE_TEST_VALUE(engine->evaluate("Object"));
- DEFINE_TEST_VALUE(engine->evaluate("Array"));
- DEFINE_TEST_VALUE(engine->evaluate("Number"));
- DEFINE_TEST_VALUE(engine->evaluate("Function"));
- DEFINE_TEST_VALUE(engine->evaluate("(function() { return 1; })"));
- DEFINE_TEST_VALUE(engine->evaluate("(function() { return 'ciao'; })"));
- DEFINE_TEST_VALUE(engine->evaluate("(function() { throw new Error('foo' })"));
- DEFINE_TEST_VALUE(engine->evaluate("/foo/"));
- DEFINE_TEST_VALUE(engine->evaluate("new Object()"));
- DEFINE_TEST_VALUE(engine->evaluate("new Array()"));
- DEFINE_TEST_VALUE(engine->evaluate("new Error()"));
- DEFINE_TEST_VALUE(engine->evaluate("a = new Object( a.foo = 22; a.foo"));
- DEFINE_TEST_VALUE(engine->evaluate("Undefined"));
- DEFINE_TEST_VALUE(engine->evaluate("Null"));
- DEFINE_TEST_VALUE(engine->evaluate("True"));
- DEFINE_TEST_VALUE(engine->evaluate("False"));
- DEFINE_TEST_VALUE(engine->evaluate("undefined"));
- DEFINE_TEST_VALUE(engine->evaluate("null"));
- DEFINE_TEST_VALUE(engine->evaluate("true"));
- DEFINE_TEST_VALUE(engine->evaluate("false"));
- DEFINE_TEST_VALUE(engine->evaluate("122"));
- DEFINE_TEST_VALUE(engine->evaluate("124"));
- DEFINE_TEST_VALUE(engine->evaluate("0"));
- DEFINE_TEST_VALUE(engine->evaluate("0.0"));
- DEFINE_TEST_VALUE(engine->evaluate("123.0"));
- DEFINE_TEST_VALUE(engine->evaluate("6.37e-8"));
- DEFINE_TEST_VALUE(engine->evaluate("-6.37e-8"));
- DEFINE_TEST_VALUE(engine->evaluate("0x43211234"));
- DEFINE_TEST_VALUE(engine->evaluate("0x10000"));
- DEFINE_TEST_VALUE(engine->evaluate("0x10001"));
- DEFINE_TEST_VALUE(engine->evaluate("NaN"));
- DEFINE_TEST_VALUE(engine->evaluate("Infinity"));
- DEFINE_TEST_VALUE(engine->evaluate("-Infinity"));
- DEFINE_TEST_VALUE(engine->evaluate("'ciao'"));
- DEFINE_TEST_VALUE(engine->evaluate("''"));
- DEFINE_TEST_VALUE(engine->evaluate("'0'"));
- DEFINE_TEST_VALUE(engine->evaluate("'123'"));
- DEFINE_TEST_VALUE(engine->evaluate("'12.4'"));
- DEFINE_TEST_VALUE(engine->nullValue());
- DEFINE_TEST_VALUE(engine->undefinedValue());
+ QScriptEngine* engine = m_engine;
+ switch (idx) {
+ case 0: return QPair<QString, QScriptValue>("QScriptValue()", QScriptValue());
+ case 1: return QPair<QString, QScriptValue>("QScriptValue(QScriptValue::UndefinedValue)", QScriptValue(QScriptValue::UndefinedValue));
+ case 2: return QPair<QString, QScriptValue>("QScriptValue(QScriptValue::NullValue)", QScriptValue(QScriptValue::NullValue));
+ case 3: return QPair<QString, QScriptValue>("QScriptValue(true)", QScriptValue(true));
+ case 4: return QPair<QString, QScriptValue>("QScriptValue(false)", QScriptValue(false));
+ case 5: return QPair<QString, QScriptValue>("QScriptValue(int(122))", QScriptValue(int(122)));
+ case 6: return QPair<QString, QScriptValue>("QScriptValue(uint(124))", QScriptValue(uint(124)));
+ case 7: return QPair<QString, QScriptValue>("QScriptValue(0)", QScriptValue(0));
+ case 8: return QPair<QString, QScriptValue>("QScriptValue(0.0)", QScriptValue(0.0));
+ case 9: return QPair<QString, QScriptValue>("QScriptValue(123.0)", QScriptValue(123.0));
+ case 10: return QPair<QString, QScriptValue>("QScriptValue(6.37e-8)", QScriptValue(6.37e-8));
+ case 11: return QPair<QString, QScriptValue>("QScriptValue(-6.37e-8)", QScriptValue(-6.37e-8));
+ case 12: return QPair<QString, QScriptValue>("QScriptValue(0x43211234)", QScriptValue(0x43211234));
+ case 13: return QPair<QString, QScriptValue>("QScriptValue(0x10000)", QScriptValue(0x10000));
+ case 14: return QPair<QString, QScriptValue>("QScriptValue(0x10001)", QScriptValue(0x10001));
+ case 15: return QPair<QString, QScriptValue>("QScriptValue(qSNaN())", QScriptValue(qSNaN()));
+ case 16: return QPair<QString, QScriptValue>("QScriptValue(qQNaN())", QScriptValue(qQNaN()));
+ case 17: return QPair<QString, QScriptValue>("QScriptValue(qInf())", QScriptValue(qInf()));
+ case 18: return QPair<QString, QScriptValue>("QScriptValue(-qInf())", QScriptValue(-qInf()));
+ case 19: return QPair<QString, QScriptValue>("QScriptValue(\"NaN\")", QScriptValue("NaN"));
+ case 20: return QPair<QString, QScriptValue>("QScriptValue(\"Infinity\")", QScriptValue("Infinity"));
+ case 21: return QPair<QString, QScriptValue>("QScriptValue(\"-Infinity\")", QScriptValue("-Infinity"));
+ case 22: return QPair<QString, QScriptValue>("QScriptValue(\"ciao\")", QScriptValue("ciao"));
+ case 23: return QPair<QString, QScriptValue>("QScriptValue(QString::fromLatin1(\"ciao\"))", QScriptValue(QString::fromLatin1("ciao")));
+ case 24: return QPair<QString, QScriptValue>("QScriptValue(QString(\"\"))", QScriptValue(QString("")));
+ case 25: return QPair<QString, QScriptValue>("QScriptValue(QString())", QScriptValue(QString()));
+ case 26: return QPair<QString, QScriptValue>("QScriptValue(QString(\"0\"))", QScriptValue(QString("0")));
+ case 27: return QPair<QString, QScriptValue>("QScriptValue(QString(\"123\"))", QScriptValue(QString("123")));
+ case 28: return QPair<QString, QScriptValue>("QScriptValue(QString(\"12.4\"))", QScriptValue(QString("12.4")));
+ case 29: return QPair<QString, QScriptValue>("QScriptValue(0, QScriptValue::UndefinedValue)", QScriptValue(0, QScriptValue::UndefinedValue));
+ case 30: return QPair<QString, QScriptValue>("QScriptValue(0, QScriptValue::NullValue)", QScriptValue(0, QScriptValue::NullValue));
+ case 31: return QPair<QString, QScriptValue>("QScriptValue(0, true)", QScriptValue(0, true));
+ case 32: return QPair<QString, QScriptValue>("QScriptValue(0, false)", QScriptValue(0, false));
+ case 33: return QPair<QString, QScriptValue>("QScriptValue(0, int(122))", QScriptValue(0, int(122)));
+ case 34: return QPair<QString, QScriptValue>("QScriptValue(0, uint(124))", QScriptValue(0, uint(124)));
+ case 35: return QPair<QString, QScriptValue>("QScriptValue(0, 0)", QScriptValue(0, 0));
+ case 36: return QPair<QString, QScriptValue>("QScriptValue(0, 0.0)", QScriptValue(0, 0.0));
+ case 37: return QPair<QString, QScriptValue>("QScriptValue(0, 123.0)", QScriptValue(0, 123.0));
+ case 38: return QPair<QString, QScriptValue>("QScriptValue(0, 6.37e-8)", QScriptValue(0, 6.37e-8));
+ case 39: return QPair<QString, QScriptValue>("QScriptValue(0, -6.37e-8)", QScriptValue(0, -6.37e-8));
+ case 40: return QPair<QString, QScriptValue>("QScriptValue(0, 0x43211234)", QScriptValue(0, 0x43211234));
+ case 41: return QPair<QString, QScriptValue>("QScriptValue(0, 0x10000)", QScriptValue(0, 0x10000));
+ case 42: return QPair<QString, QScriptValue>("QScriptValue(0, 0x10001)", QScriptValue(0, 0x10001));
+ case 43: return QPair<QString, QScriptValue>("QScriptValue(0, qSNaN())", QScriptValue(0, qSNaN()));
+ case 44: return QPair<QString, QScriptValue>("QScriptValue(0, qQNaN())", QScriptValue(0, qQNaN()));
+ case 45: return QPair<QString, QScriptValue>("QScriptValue(0, qInf())", QScriptValue(0, qInf()));
+ case 46: return QPair<QString, QScriptValue>("QScriptValue(0, -qInf())", QScriptValue(0, -qInf()));
+ case 47: return QPair<QString, QScriptValue>("QScriptValue(0, \"NaN\")", QScriptValue(0, "NaN"));
+ case 48: return QPair<QString, QScriptValue>("QScriptValue(0, \"Infinity\")", QScriptValue(0, "Infinity"));
+ case 49: return QPair<QString, QScriptValue>("QScriptValue(0, \"-Infinity\")", QScriptValue(0, "-Infinity"));
+ case 50: return QPair<QString, QScriptValue>("QScriptValue(0, \"ciao\")", QScriptValue(0, "ciao"));
+ case 51: return QPair<QString, QScriptValue>("QScriptValue(0, QString::fromLatin1(\"ciao\"))", QScriptValue(0, QString::fromLatin1("ciao")));
+ case 52: return QPair<QString, QScriptValue>("QScriptValue(0, QString(\"\"))", QScriptValue(0, QString("")));
+ case 53: return QPair<QString, QScriptValue>("QScriptValue(0, QString())", QScriptValue(0, QString()));
+ case 54: return QPair<QString, QScriptValue>("QScriptValue(0, QString(\"0\"))", QScriptValue(0, QString("0")));
+ case 55: return QPair<QString, QScriptValue>("QScriptValue(0, QString(\"123\"))", QScriptValue(0, QString("123")));
+ case 56: return QPair<QString, QScriptValue>("QScriptValue(0, QString(\"12.3\"))", QScriptValue(0, QString("12.3")));
+ case 57: return QPair<QString, QScriptValue>("QScriptValue(engine, QScriptValue::UndefinedValue)", QScriptValue(engine, QScriptValue::UndefinedValue));
+ case 58: return QPair<QString, QScriptValue>("QScriptValue(engine, QScriptValue::NullValue)", QScriptValue(engine, QScriptValue::NullValue));
+ case 59: return QPair<QString, QScriptValue>("QScriptValue(engine, true)", QScriptValue(engine, true));
+ case 60: return QPair<QString, QScriptValue>("QScriptValue(engine, false)", QScriptValue(engine, false));
+ case 61: return QPair<QString, QScriptValue>("QScriptValue(engine, int(122))", QScriptValue(engine, int(122)));
+ case 62: return QPair<QString, QScriptValue>("QScriptValue(engine, uint(124))", QScriptValue(engine, uint(124)));
+ case 63: return QPair<QString, QScriptValue>("QScriptValue(engine, 0)", QScriptValue(engine, 0));
+ case 64: return QPair<QString, QScriptValue>("QScriptValue(engine, 0.0)", QScriptValue(engine, 0.0));
+ case 65: return QPair<QString, QScriptValue>("QScriptValue(engine, 123.0)", QScriptValue(engine, 123.0));
+ case 66: return QPair<QString, QScriptValue>("QScriptValue(engine, 6.37e-8)", QScriptValue(engine, 6.37e-8));
+ case 67: return QPair<QString, QScriptValue>("QScriptValue(engine, -6.37e-8)", QScriptValue(engine, -6.37e-8));
+ case 68: return QPair<QString, QScriptValue>("QScriptValue(engine, 0x43211234)", QScriptValue(engine, 0x43211234));
+ case 69: return QPair<QString, QScriptValue>("QScriptValue(engine, 0x10000)", QScriptValue(engine, 0x10000));
+ case 70: return QPair<QString, QScriptValue>("QScriptValue(engine, 0x10001)", QScriptValue(engine, 0x10001));
+ case 71: return QPair<QString, QScriptValue>("QScriptValue(engine, qSNaN())", QScriptValue(engine, qSNaN()));
+ case 72: return QPair<QString, QScriptValue>("QScriptValue(engine, qQNaN())", QScriptValue(engine, qQNaN()));
+ case 73: return QPair<QString, QScriptValue>("QScriptValue(engine, qInf())", QScriptValue(engine, qInf()));
+ case 74: return QPair<QString, QScriptValue>("QScriptValue(engine, -qInf())", QScriptValue(engine, -qInf()));
+ case 75: return QPair<QString, QScriptValue>("QScriptValue(engine, \"NaN\")", QScriptValue(engine, "NaN"));
+ case 76: return QPair<QString, QScriptValue>("QScriptValue(engine, \"Infinity\")", QScriptValue(engine, "Infinity"));
+ case 77: return QPair<QString, QScriptValue>("QScriptValue(engine, \"-Infinity\")", QScriptValue(engine, "-Infinity"));
+ case 78: return QPair<QString, QScriptValue>("QScriptValue(engine, \"ciao\")", QScriptValue(engine, "ciao"));
+ case 79: return QPair<QString, QScriptValue>("QScriptValue(engine, QString::fromLatin1(\"ciao\"))", QScriptValue(engine, QString::fromLatin1("ciao")));
+ case 80: return QPair<QString, QScriptValue>("QScriptValue(engine, QString(\"\"))", QScriptValue(engine, QString("")));
+ case 81: return QPair<QString, QScriptValue>("QScriptValue(engine, QString())", QScriptValue(engine, QString()));
+ case 82: return QPair<QString, QScriptValue>("QScriptValue(engine, QString(\"0\"))", QScriptValue(engine, QString("0")));
+ case 83: return QPair<QString, QScriptValue>("QScriptValue(engine, QString(\"123\"))", QScriptValue(engine, QString("123")));
+ case 84: return QPair<QString, QScriptValue>("QScriptValue(engine, QString(\"1.23\"))", QScriptValue(engine, QString("1.23")));
+ case 85: return QPair<QString, QScriptValue>("engine->evaluate(\"[]\")", engine->evaluate("[]"));
+ case 86: return QPair<QString, QScriptValue>("engine->evaluate(\"{}\")", engine->evaluate("{}"));
+ case 87: return QPair<QString, QScriptValue>("engine->evaluate(\"Object.prototype\")", engine->evaluate("Object.prototype"));
+ case 88: return QPair<QString, QScriptValue>("engine->evaluate(\"Date.prototype\")", engine->evaluate("Date.prototype"));
+ case 89: return QPair<QString, QScriptValue>("engine->evaluate(\"Array.prototype\")", engine->evaluate("Array.prototype"));
+ case 90: return QPair<QString, QScriptValue>("engine->evaluate(\"Function.prototype\")", engine->evaluate("Function.prototype"));
+ case 91: return QPair<QString, QScriptValue>("engine->evaluate(\"Error.prototype\")", engine->evaluate("Error.prototype"));
+ case 92: return QPair<QString, QScriptValue>("engine->evaluate(\"Object\")", engine->evaluate("Object"));
+ case 93: return QPair<QString, QScriptValue>("engine->evaluate(\"Array\")", engine->evaluate("Array"));
+ case 94: return QPair<QString, QScriptValue>("engine->evaluate(\"Number\")", engine->evaluate("Number"));
+ case 95: return QPair<QString, QScriptValue>("engine->evaluate(\"Function\")", engine->evaluate("Function"));
+ case 96: return QPair<QString, QScriptValue>("engine->evaluate(\"(function() { return 1; })\")", engine->evaluate("(function() { return 1; })"));
+ case 97: return QPair<QString, QScriptValue>("engine->evaluate(\"(function() { return 'ciao'; })\")", engine->evaluate("(function() { return 'ciao'; })"));
+ case 98: return QPair<QString, QScriptValue>("engine->evaluate(\"(function() { throw new Error('foo'); })\")", engine->evaluate("(function() { throw new Error('foo'); })"));
+ case 99: return QPair<QString, QScriptValue>("engine->evaluate(\"/foo/\")", engine->evaluate("/foo/"));
+ case 100: return QPair<QString, QScriptValue>("engine->evaluate(\"new Object()\")", engine->evaluate("new Object()"));
+ case 101: return QPair<QString, QScriptValue>("engine->evaluate(\"new Array()\")", engine->evaluate("new Array()"));
+ case 102: return QPair<QString, QScriptValue>("engine->evaluate(\"new Error()\")", engine->evaluate("new Error()"));
+ case 103: return QPair<QString, QScriptValue>("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", engine->evaluate("a = new Object(); a.foo = 22; a.foo"));
+ case 104: return QPair<QString, QScriptValue>("engine->evaluate(\"Undefined\")", engine->evaluate("Undefined"));
+ case 105: return QPair<QString, QScriptValue>("engine->evaluate(\"Null\")", engine->evaluate("Null"));
+ case 106: return QPair<QString, QScriptValue>("engine->evaluate(\"True\")", engine->evaluate("True"));
+ case 107: return QPair<QString, QScriptValue>("engine->evaluate(\"False\")", engine->evaluate("False"));
+ case 108: return QPair<QString, QScriptValue>("engine->evaluate(\"undefined\")", engine->evaluate("undefined"));
+ case 109: return QPair<QString, QScriptValue>("engine->evaluate(\"null\")", engine->evaluate("null"));
+ case 110: return QPair<QString, QScriptValue>("engine->evaluate(\"true\")", engine->evaluate("true"));
+ case 111: return QPair<QString, QScriptValue>("engine->evaluate(\"false\")", engine->evaluate("false"));
+ case 112: return QPair<QString, QScriptValue>("engine->evaluate(\"122\")", engine->evaluate("122"));
+ case 113: return QPair<QString, QScriptValue>("engine->evaluate(\"124\")", engine->evaluate("124"));
+ case 114: return QPair<QString, QScriptValue>("engine->evaluate(\"0\")", engine->evaluate("0"));
+ case 115: return QPair<QString, QScriptValue>("engine->evaluate(\"0.0\")", engine->evaluate("0.0"));
+ case 116: return QPair<QString, QScriptValue>("engine->evaluate(\"123.0\")", engine->evaluate("123.0"));
+ case 117: return QPair<QString, QScriptValue>("engine->evaluate(\"6.37e-8\")", engine->evaluate("6.37e-8"));
+ case 118: return QPair<QString, QScriptValue>("engine->evaluate(\"-6.37e-8\")", engine->evaluate("-6.37e-8"));
+ case 119: return QPair<QString, QScriptValue>("engine->evaluate(\"0x43211234\")", engine->evaluate("0x43211234"));
+ case 120: return QPair<QString, QScriptValue>("engine->evaluate(\"0x10000\")", engine->evaluate("0x10000"));
+ case 121: return QPair<QString, QScriptValue>("engine->evaluate(\"0x10001\")", engine->evaluate("0x10001"));
+ case 122: return QPair<QString, QScriptValue>("engine->evaluate(\"NaN\")", engine->evaluate("NaN"));
+ case 123: return QPair<QString, QScriptValue>("engine->evaluate(\"Infinity\")", engine->evaluate("Infinity"));
+ case 124: return QPair<QString, QScriptValue>("engine->evaluate(\"-Infinity\")", engine->evaluate("-Infinity"));
+ case 125: return QPair<QString, QScriptValue>("engine->evaluate(\"'ciao'\")", engine->evaluate("'ciao'"));
+ case 126: return QPair<QString, QScriptValue>("engine->evaluate(\"''\")", engine->evaluate("''"));
+ case 127: return QPair<QString, QScriptValue>("engine->evaluate(\"'0'\")", engine->evaluate("'0'"));
+ case 128: return QPair<QString, QScriptValue>("engine->evaluate(\"'123'\")", engine->evaluate("'123'"));
+ case 129: return QPair<QString, QScriptValue>("engine->evaluate(\"'12.4'\")", engine->evaluate("'12.4'"));
+ case 130: return QPair<QString, QScriptValue>("engine->nullValue()", engine->nullValue());
+ case 131: return QPair<QString, QScriptValue>("engine->undefinedValue()", engine->undefinedValue());
+ case 132: return QPair<QString, QScriptValue>("engine->newObject()", engine->newObject());
+ case 133: return QPair<QString, QScriptValue>("engine->newArray()", engine->newArray());
+ case 134: return QPair<QString, QScriptValue>("engine->newArray(10)", engine->newArray(10));
+ }
+ Q_ASSERT(false);
+ return qMakePair(QString(), QScriptValue());
}
diff --git a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_istype.cpp b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_istype.cpp
index f1de77d..433597f 100644
--- a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_istype.cpp
+++ b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_istype.cpp
@@ -25,13 +25,7 @@
#include "tst_qscriptvalue.h"
-void tst_QScriptValue::isValid_initData()
-{
- QTest::addColumn<bool>("expected");
- initScriptValues();
-}
-
-static QString isValid_array[] = {
+static const QString isValid_array[] = {
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
"QScriptValue(true)",
@@ -129,12 +123,12 @@ static QString isValid_array[] = {
"engine->evaluate(\"Function\")",
"engine->evaluate(\"(function() { return 1; })\")",
"engine->evaluate(\"(function() { return 'ciao'; })\")",
- "engine->evaluate(\"(function() { throw new Error('foo' })\")",
+ "engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"/foo/\")",
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
- "engine->evaluate(\"a = new Object( a.foo = 22; a.foo\")",
+ "engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
"engine->evaluate(\"True\")",
@@ -162,36 +156,37 @@ static QString isValid_array[] = {
"engine->evaluate(\"'123'\")",
"engine->evaluate(\"'12.4'\")",
"engine->nullValue()",
- "engine->undefinedValue()"};
+ "engine->undefinedValue()",
+ "engine->newObject()",
+ "engine->newArray()",
+ "engine->newArray(10)"};
-void tst_QScriptValue::isValid_makeData(const char* expr)
+void tst_QScriptValue::isValid_data()
{
- static QSet<QString> isValid;
- if (isValid.isEmpty()) {
- isValid.reserve(131);
- for (unsigned i = 0; i < 131; ++i)
- isValid.insert(isValid_array[i]);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<bool>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QSet<QString> expectedValue;
+ expectedValue.reserve(134);
+ for (uint i = 0; i < 134; ++i)
+ expectedValue.insert(isValid_array[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue.contains(testcase.first);
}
- newRow(expr) << isValid.contains(expr);
}
-void tst_QScriptValue::isValid_test(const char*, const QScriptValue& value)
+void tst_QScriptValue::isValid()
{
+ QFETCH(QScriptValue, value);
QFETCH(bool, expected);
QCOMPARE(value.isValid(), expected);
QCOMPARE(value.isValid(), expected);
}
-DEFINE_TEST_FUNCTION(isValid)
-
-
-void tst_QScriptValue::isBool_initData()
-{
- QTest::addColumn<bool>("expected");
- initScriptValues();
-}
-
-static QString isBool_array[] = {
+static const QString isBool_array[] = {
"QScriptValue(true)",
"QScriptValue(false)",
"QScriptValue(0, true)",
@@ -201,34 +196,32 @@ static QString isBool_array[] = {
"engine->evaluate(\"true\")",
"engine->evaluate(\"false\")"};
-void tst_QScriptValue::isBool_makeData(const char* expr)
+void tst_QScriptValue::isBool_data()
{
- static QSet<QString> isBool;
- if (isBool.isEmpty()) {
- isBool.reserve(8);
- for (unsigned i = 0; i < 8; ++i)
- isBool.insert(isBool_array[i]);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<bool>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QSet<QString> expectedValue;
+ expectedValue.reserve(8);
+ for (uint i = 0; i < 8; ++i)
+ expectedValue.insert(isBool_array[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue.contains(testcase.first);
}
- newRow(expr) << isBool.contains(expr);
}
-void tst_QScriptValue::isBool_test(const char*, const QScriptValue& value)
+void tst_QScriptValue::isBool()
{
+ QFETCH(QScriptValue, value);
QFETCH(bool, expected);
QCOMPARE(value.isBool(), expected);
QCOMPARE(value.isBool(), expected);
}
-DEFINE_TEST_FUNCTION(isBool)
-
-
-void tst_QScriptValue::isBoolean_initData()
-{
- QTest::addColumn<bool>("expected");
- initScriptValues();
-}
-
-static QString isBoolean_array[] = {
+static const QString isBoolean_array[] = {
"QScriptValue(true)",
"QScriptValue(false)",
"QScriptValue(0, true)",
@@ -238,34 +231,32 @@ static QString isBoolean_array[] = {
"engine->evaluate(\"true\")",
"engine->evaluate(\"false\")"};
-void tst_QScriptValue::isBoolean_makeData(const char* expr)
+void tst_QScriptValue::isBoolean_data()
{
- static QSet<QString> isBoolean;
- if (isBoolean.isEmpty()) {
- isBoolean.reserve(8);
- for (unsigned i = 0; i < 8; ++i)
- isBoolean.insert(isBoolean_array[i]);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<bool>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QSet<QString> expectedValue;
+ expectedValue.reserve(8);
+ for (uint i = 0; i < 8; ++i)
+ expectedValue.insert(isBoolean_array[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue.contains(testcase.first);
}
- newRow(expr) << isBoolean.contains(expr);
}
-void tst_QScriptValue::isBoolean_test(const char*, const QScriptValue& value)
+void tst_QScriptValue::isBoolean()
{
+ QFETCH(QScriptValue, value);
QFETCH(bool, expected);
QCOMPARE(value.isBoolean(), expected);
QCOMPARE(value.isBoolean(), expected);
}
-DEFINE_TEST_FUNCTION(isBoolean)
-
-
-void tst_QScriptValue::isNumber_initData()
-{
- QTest::addColumn<bool>("expected");
- initScriptValues();
-}
-
-static QString isNumber_array[] = {
+static const QString isNumber_array[] = {
"QScriptValue(int(122))",
"QScriptValue(uint(124))",
"QScriptValue(0)",
@@ -308,6 +299,7 @@ static QString isNumber_array[] = {
"QScriptValue(engine, qQNaN())",
"QScriptValue(engine, qInf())",
"QScriptValue(engine, -qInf())",
+ "engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"122\")",
"engine->evaluate(\"124\")",
"engine->evaluate(\"0\")",
@@ -322,34 +314,32 @@ static QString isNumber_array[] = {
"engine->evaluate(\"Infinity\")",
"engine->evaluate(\"-Infinity\")"};
-void tst_QScriptValue::isNumber_makeData(const char* expr)
+void tst_QScriptValue::isNumber_data()
{
- static QSet<QString> isNumber;
- if (isNumber.isEmpty()) {
- isNumber.reserve(55);
- for (unsigned i = 0; i < 55; ++i)
- isNumber.insert(isNumber_array[i]);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<bool>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QSet<QString> expectedValue;
+ expectedValue.reserve(56);
+ for (uint i = 0; i < 56; ++i)
+ expectedValue.insert(isNumber_array[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue.contains(testcase.first);
}
- newRow(expr) << isNumber.contains(expr);
}
-void tst_QScriptValue::isNumber_test(const char*, const QScriptValue& value)
+void tst_QScriptValue::isNumber()
{
+ QFETCH(QScriptValue, value);
QFETCH(bool, expected);
QCOMPARE(value.isNumber(), expected);
QCOMPARE(value.isNumber(), expected);
}
-DEFINE_TEST_FUNCTION(isNumber)
-
-
-void tst_QScriptValue::isFunction_initData()
-{
- QTest::addColumn<bool>("expected");
- initScriptValues();
-}
-
-static QString isFunction_array[] = {
+static const QString isFunction_array[] = {
"engine->evaluate(\"Function.prototype\")",
"engine->evaluate(\"Object\")",
"engine->evaluate(\"Array\")",
@@ -357,70 +347,67 @@ static QString isFunction_array[] = {
"engine->evaluate(\"Function\")",
"engine->evaluate(\"(function() { return 1; })\")",
"engine->evaluate(\"(function() { return 'ciao'; })\")",
+ "engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"/foo/\")"};
-void tst_QScriptValue::isFunction_makeData(const char* expr)
+void tst_QScriptValue::isFunction_data()
{
- static QSet<QString> isFunction;
- if (isFunction.isEmpty()) {
- isFunction.reserve(8);
- for (unsigned i = 0; i < 8; ++i)
- isFunction.insert(isFunction_array[i]);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<bool>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QSet<QString> expectedValue;
+ expectedValue.reserve(9);
+ for (uint i = 0; i < 9; ++i)
+ expectedValue.insert(isFunction_array[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue.contains(testcase.first);
}
- newRow(expr) << isFunction.contains(expr);
}
-void tst_QScriptValue::isFunction_test(const char*, const QScriptValue& value)
+void tst_QScriptValue::isFunction()
{
+ QFETCH(QScriptValue, value);
QFETCH(bool, expected);
QCOMPARE(value.isFunction(), expected);
QCOMPARE(value.isFunction(), expected);
}
-DEFINE_TEST_FUNCTION(isFunction)
-
-
-void tst_QScriptValue::isNull_initData()
-{
- QTest::addColumn<bool>("expected");
- initScriptValues();
-}
-
-static QString isNull_array[] = {
+static const QString isNull_array[] = {
"QScriptValue(QScriptValue::NullValue)",
"QScriptValue(0, QScriptValue::NullValue)",
"QScriptValue(engine, QScriptValue::NullValue)",
"engine->evaluate(\"null\")",
"engine->nullValue()"};
-void tst_QScriptValue::isNull_makeData(const char* expr)
+void tst_QScriptValue::isNull_data()
{
- static QSet<QString> isNull;
- if (isNull.isEmpty()) {
- isNull.reserve(5);
- for (unsigned i = 0; i < 5; ++i)
- isNull.insert(isNull_array[i]);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<bool>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QSet<QString> expectedValue;
+ expectedValue.reserve(5);
+ for (uint i = 0; i < 5; ++i)
+ expectedValue.insert(isNull_array[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue.contains(testcase.first);
}
- newRow(expr) << isNull.contains(expr);
}
-void tst_QScriptValue::isNull_test(const char*, const QScriptValue& value)
+void tst_QScriptValue::isNull()
{
+ QFETCH(QScriptValue, value);
QFETCH(bool, expected);
QCOMPARE(value.isNull(), expected);
QCOMPARE(value.isNull(), expected);
}
-DEFINE_TEST_FUNCTION(isNull)
-
-
-void tst_QScriptValue::isString_initData()
-{
- QTest::addColumn<bool>("expected");
- initScriptValues();
-}
-
-static QString isString_array[] = {
+static const QString isString_array[] = {
"QScriptValue(\"NaN\")",
"QScriptValue(\"Infinity\")",
"QScriptValue(\"-Infinity\")",
@@ -457,34 +444,32 @@ static QString isString_array[] = {
"engine->evaluate(\"'123'\")",
"engine->evaluate(\"'12.4'\")"};
-void tst_QScriptValue::isString_makeData(const char* expr)
+void tst_QScriptValue::isString_data()
{
- static QSet<QString> isString;
- if (isString.isEmpty()) {
- isString.reserve(35);
- for (unsigned i = 0; i < 35; ++i)
- isString.insert(isString_array[i]);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<bool>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QSet<QString> expectedValue;
+ expectedValue.reserve(35);
+ for (uint i = 0; i < 35; ++i)
+ expectedValue.insert(isString_array[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue.contains(testcase.first);
}
- newRow(expr) << isString.contains(expr);
}
-void tst_QScriptValue::isString_test(const char*, const QScriptValue& value)
+void tst_QScriptValue::isString()
{
+ QFETCH(QScriptValue, value);
QFETCH(bool, expected);
QCOMPARE(value.isString(), expected);
QCOMPARE(value.isString(), expected);
}
-DEFINE_TEST_FUNCTION(isString)
-
-
-void tst_QScriptValue::isUndefined_initData()
-{
- QTest::addColumn<bool>("expected");
- initScriptValues();
-}
-
-static QString isUndefined_array[] = {
+static const QString isUndefined_array[] = {
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(0, QScriptValue::UndefinedValue)",
"QScriptValue(engine, QScriptValue::UndefinedValue)",
@@ -492,37 +477,35 @@ static QString isUndefined_array[] = {
"engine->evaluate(\"undefined\")",
"engine->undefinedValue()"};
-void tst_QScriptValue::isUndefined_makeData(const char* expr)
+void tst_QScriptValue::isUndefined_data()
{
- static QSet<QString> isUndefined;
- if (isUndefined.isEmpty()) {
- isUndefined.reserve(6);
- for (unsigned i = 0; i < 6; ++i)
- isUndefined.insert(isUndefined_array[i]);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<bool>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QSet<QString> expectedValue;
+ expectedValue.reserve(6);
+ for (uint i = 0; i < 6; ++i)
+ expectedValue.insert(isUndefined_array[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue.contains(testcase.first);
}
- newRow(expr) << isUndefined.contains(expr);
}
-void tst_QScriptValue::isUndefined_test(const char*, const QScriptValue& value)
+void tst_QScriptValue::isUndefined()
{
+ QFETCH(QScriptValue, value);
QFETCH(bool, expected);
QCOMPARE(value.isUndefined(), expected);
QCOMPARE(value.isUndefined(), expected);
}
-DEFINE_TEST_FUNCTION(isUndefined)
-
-
-void tst_QScriptValue::isObject_initData()
-{
- QTest::addColumn<bool>("expected");
- initScriptValues();
-}
-
-static QString isObject_array[] = {
+static const QString isObject_array[] = {
"engine->evaluate(\"[]\")",
"engine->evaluate(\"Object.prototype\")",
"engine->evaluate(\"Date.prototype\")",
@@ -535,33 +518,105 @@ static QString isObject_array[] = {
"engine->evaluate(\"Function\")",
"engine->evaluate(\"(function() { return 1; })\")",
"engine->evaluate(\"(function() { return 'ciao'; })\")",
- "engine->evaluate(\"(function() { throw new Error('foo' })\")",
+ "engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"/foo/\")",
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
- "engine->evaluate(\"a = new Object( a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
"engine->evaluate(\"True\")",
- "engine->evaluate(\"False\")"};
+ "engine->evaluate(\"False\")",
+ "engine->newObject()",
+ "engine->newArray()",
+ "engine->newArray(10)"};
-void tst_QScriptValue::isObject_makeData(const char* expr)
+void tst_QScriptValue::isObject_data()
{
- static QSet<QString> isObject;
- if (isObject.isEmpty()) {
- isObject.reserve(22);
- for (unsigned i = 0; i < 22; ++i)
- isObject.insert(isObject_array[i]);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<bool>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QSet<QString> expectedValue;
+ expectedValue.reserve(24);
+ for (uint i = 0; i < 24; ++i)
+ expectedValue.insert(isObject_array[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue.contains(testcase.first);
}
- newRow(expr) << isObject.contains(expr);
}
-void tst_QScriptValue::isObject_test(const char*, const QScriptValue& value)
+void tst_QScriptValue::isObject()
{
+ QFETCH(QScriptValue, value);
QFETCH(bool, expected);
QCOMPARE(value.isObject(), expected);
QCOMPARE(value.isObject(), expected);
}
-DEFINE_TEST_FUNCTION(isObject)
+static const QString isArray_array[] = {
+ "engine->evaluate(\"[]\")",
+ "engine->evaluate(\"Array.prototype\")",
+ "engine->evaluate(\"new Array()\")",
+ "engine->newArray()",
+ "engine->newArray(10)"};
+
+void tst_QScriptValue::isArray_data()
+{
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<bool>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QSet<QString> expectedValue;
+ expectedValue.reserve(5);
+ for (uint i = 0; i < 5; ++i)
+ expectedValue.insert(isArray_array[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue.contains(testcase.first);
+ }
+}
+
+void tst_QScriptValue::isArray()
+{
+ QFETCH(QScriptValue, value);
+ QFETCH(bool, expected);
+ QCOMPARE(value.isArray(), expected);
+ QCOMPARE(value.isArray(), expected);
+}
+
+static const QString isError_array[] = {
+ "engine->evaluate(\"Error.prototype\")",
+ "engine->evaluate(\"new Error()\")",
+ "engine->evaluate(\"Undefined\")",
+ "engine->evaluate(\"Null\")",
+ "engine->evaluate(\"True\")",
+ "engine->evaluate(\"False\")"};
+
+void tst_QScriptValue::isError_data()
+{
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<bool>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QSet<QString> expectedValue;
+ expectedValue.reserve(6);
+ for (uint i = 0; i < 6; ++i)
+ expectedValue.insert(isError_array[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue.contains(testcase.first);
+ }
+}
+
+void tst_QScriptValue::isError()
+{
+ QFETCH(QScriptValue, value);
+ QFETCH(bool, expected);
+ QCOMPARE(value.isError(), expected);
+ QCOMPARE(value.isError(), expected);
+}
diff --git a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_totype.cpp b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_totype.cpp
index a946aef..eaa5d14 100644
--- a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_totype.cpp
+++ b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated_totype.cpp
@@ -23,15 +23,7 @@
#include "tst_qscriptvalue.h"
-
-
-void tst_QScriptValue::toString_initData()
-{
- QTest::addColumn<QString>("expected");
- initScriptValues();
-}
-
-static QString toString_tagArray[] = {
+static const QString toString_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -130,12 +122,12 @@ static QString toString_tagArray[] = {
"engine->evaluate(\"Function\")",
"engine->evaluate(\"(function() { return 1; })\")",
"engine->evaluate(\"(function() { return 'ciao'; })\")",
- "engine->evaluate(\"(function() { throw new Error('foo' })\")",
+ "engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"/foo/\")",
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
- "engine->evaluate(\"a = new Object( a.foo = 22; a.foo\")",
+ "engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
"engine->evaluate(\"True\")",
@@ -163,9 +155,12 @@ static QString toString_tagArray[] = {
"engine->evaluate(\"'123'\")",
"engine->evaluate(\"'12.4'\")",
"engine->nullValue()",
- "engine->undefinedValue()"};
+ "engine->undefinedValue()",
+ "engine->newObject()",
+ "engine->newArray()",
+ "engine->newArray(10)"};
-static QString toString_valueArray[] = {
+static const QString toString_valueArray[] = {
"", "undefined",
"null", "true",
"false", "122",
@@ -215,9 +210,9 @@ static QString toString_valueArray[] = {
"function Object() {\n [native code]\n}", "function Array() {\n [native code]\n}",
"function Number() {\n [native code]\n}", "function Function() {\n [native code]\n}",
"function () { return 1; }", "function () { return 'ciao'; }",
- "SyntaxError: Parse error", "/foo/",
+ "function () { throw new Error('foo'); }", "/foo/",
"[object Object]", "",
- "Error: Unknown error", "SyntaxError: Parse error",
+ "Error: Unknown error", "22",
"ReferenceError: Can't find variable: Undefined", "ReferenceError: Can't find variable: Null",
"ReferenceError: Can't find variable: True", "ReferenceError: Can't find variable: False",
"undefined", "null",
@@ -231,36 +226,36 @@ static QString toString_valueArray[] = {
"-Infinity", "ciao",
"", "0",
"123", "12.4",
- "null", "undefined"};
+ "null", "undefined",
+ "[object Object]", "",
+ ",,,,,,,,,"};
-void tst_QScriptValue::toString_makeData(const char* expr)
+void tst_QScriptValue::toString_data()
{
- static QHash<QString, QString> toString;
- if (toString.isEmpty()) {
- toString.reserve(132);
- for (unsigned i = 0; i < 132; ++i)
- toString.insert(toString_tagArray[i], toString_valueArray[i]);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<QString>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QHash<QString, QString> expectedValue;
+ expectedValue.reserve(135);
+ for (uint i = 0; i < 135; ++i)
+ expectedValue.insert(toString_tagArray[i], toString_valueArray[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue[testcase.first];
}
- newRow(expr) << toString.value(expr);
}
-void tst_QScriptValue::toString_test(const char*, const QScriptValue& value)
+void tst_QScriptValue::toString()
{
+ QFETCH(QScriptValue, value);
QFETCH(QString, expected);
QCOMPARE(value.toString(), expected);
QCOMPARE(value.toString(), expected);
}
-DEFINE_TEST_FUNCTION(toString)
-
-
-void tst_QScriptValue::toNumber_initData()
-{
- QTest::addColumn<qsreal>("expected");
- initScriptValues();
-}
-
-static QString toNumber_tagArray[] = {
+static const QString toNumber_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -359,12 +354,12 @@ static QString toNumber_tagArray[] = {
"engine->evaluate(\"Function\")",
"engine->evaluate(\"(function() { return 1; })\")",
"engine->evaluate(\"(function() { return 'ciao'; })\")",
- "engine->evaluate(\"(function() { throw new Error('foo' })\")",
+ "engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"/foo/\")",
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
- "engine->evaluate(\"a = new Object( a.foo = 22; a.foo\")",
+ "engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
"engine->evaluate(\"True\")",
@@ -392,8 +387,12 @@ static QString toNumber_tagArray[] = {
"engine->evaluate(\"'123'\")",
"engine->evaluate(\"'12.4'\")",
"engine->nullValue()",
- "engine->undefinedValue()"};
-static qsreal toNumber_valueArray[] = {
+ "engine->undefinedValue()",
+ "engine->newObject()",
+ "engine->newArray()",
+ "engine->newArray(10)"};
+
+static const qsreal toNumber_valueArray[] = {
0, qQNaN(), 0, 1, 0, 122, 124, 0, 0, 123,
6.369999999999999e-08, -6.369999999999999e-08, 1126240820, 65536, 65537, qQNaN(), qQNaN(), qInf(), qInf(), qQNaN(),
qInf(), qInf(), qQNaN(), qQNaN(), 0, 0, 0, 123, 12.4, qQNaN(),
@@ -404,23 +403,31 @@ static qsreal toNumber_valueArray[] = {
65537, qQNaN(), qQNaN(), qInf(), qInf(), qQNaN(), qInf(), qInf(), qQNaN(), qQNaN(),
0, 0, 0, 123, 1.23, 0, qQNaN(), qQNaN(), qQNaN(), 0,
qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(),
- qQNaN(), 0, qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), 0,
+ qQNaN(), 0, qQNaN(), 22, qQNaN(), qQNaN(), qQNaN(), qQNaN(), qQNaN(), 0,
1, 0, 122, 124, 0, 0, 123, 6.369999999999999e-08, -6.369999999999999e-08, 1126240820,
65536, 65537, qQNaN(), qInf(), qInf(), qQNaN(), 0, 0, 123, 12.4,
- 0, qQNaN()};
-void tst_QScriptValue::toNumber_makeData(const char* expr)
+ 0, qQNaN(), qQNaN(), 0, qQNaN()};
+
+void tst_QScriptValue::toNumber_data()
{
- static QHash<QString, qsreal> toNumber;
- if (toNumber.isEmpty()) {
- toNumber.reserve(132);
- for (unsigned i = 0; i < 132; ++i)
- toNumber.insert(toNumber_tagArray[i], toNumber_valueArray[i]);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<qsreal>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QHash<QString, qsreal> expectedValue;
+ expectedValue.reserve(135);
+ for (uint i = 0; i < 135; ++i)
+ expectedValue.insert(toNumber_tagArray[i], toNumber_valueArray[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue[testcase.first];
}
- newRow(expr) << toNumber.value(expr);
}
-void tst_QScriptValue::toNumber_test(const char*, const QScriptValue& value)
+void tst_QScriptValue::toNumber()
{
+ QFETCH(QScriptValue, value);
QFETCH(qsreal, expected);
if (qIsNaN(expected)) {
QVERIFY(qIsNaN(value.toNumber()));
@@ -435,16 +442,7 @@ void tst_QScriptValue::toNumber_test(const char*, const QScriptValue& value)
QCOMPARE(value.toNumber(), expected);
}
-DEFINE_TEST_FUNCTION(toNumber)
-
-
-void tst_QScriptValue::toBool_initData()
-{
- QTest::addColumn<bool>("expected");
- initScriptValues();
-}
-
-static QString toBool_tagArray[] = {
+static const QString toBool_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -543,12 +541,12 @@ static QString toBool_tagArray[] = {
"engine->evaluate(\"Function\")",
"engine->evaluate(\"(function() { return 1; })\")",
"engine->evaluate(\"(function() { return 'ciao'; })\")",
- "engine->evaluate(\"(function() { throw new Error('foo' })\")",
+ "engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"/foo/\")",
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
- "engine->evaluate(\"a = new Object( a.foo = 22; a.foo\")",
+ "engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
"engine->evaluate(\"True\")",
@@ -576,9 +574,12 @@ static QString toBool_tagArray[] = {
"engine->evaluate(\"'123'\")",
"engine->evaluate(\"'12.4'\")",
"engine->nullValue()",
- "engine->undefinedValue()"};
+ "engine->undefinedValue()",
+ "engine->newObject()",
+ "engine->newArray()",
+ "engine->newArray(10)"};
-static bool toBool_valueArray[] = {
+static const bool toBool_valueArray[] = {
false, false,
false, true,
false, true,
@@ -644,36 +645,36 @@ static bool toBool_valueArray[] = {
true, true,
false, true,
true, true,
- false, false};
+ false, false,
+ true, true,
+ true};
-void tst_QScriptValue::toBool_makeData(const char* expr)
+void tst_QScriptValue::toBool_data()
{
- static QHash<QString, bool> toBool;
- if (toBool.isEmpty()) {
- toBool.reserve(132);
- for (unsigned i = 0; i < 132; ++i)
- toBool.insert(toBool_tagArray[i], toBool_valueArray[i]);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<bool>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QHash<QString, bool> expectedValue;
+ expectedValue.reserve(135);
+ for (uint i = 0; i < 135; ++i)
+ expectedValue.insert(toBool_tagArray[i], toBool_valueArray[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue[testcase.first];
}
- newRow(expr) << toBool.value(expr);
}
-void tst_QScriptValue::toBool_test(const char*, const QScriptValue& value)
+void tst_QScriptValue::toBool()
{
+ QFETCH(QScriptValue, value);
QFETCH(bool, expected);
QCOMPARE(value.toBool(), expected);
QCOMPARE(value.toBool(), expected);
}
-DEFINE_TEST_FUNCTION(toBool)
-
-
-void tst_QScriptValue::toBoolean_initData()
-{
- QTest::addColumn<bool>("expected");
- initScriptValues();
-}
-
-static QString toBoolean_tagArray[] = {
+static const QString toBoolean_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -772,12 +773,12 @@ static QString toBoolean_tagArray[] = {
"engine->evaluate(\"Function\")",
"engine->evaluate(\"(function() { return 1; })\")",
"engine->evaluate(\"(function() { return 'ciao'; })\")",
- "engine->evaluate(\"(function() { throw new Error('foo' })\")",
+ "engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"/foo/\")",
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
- "engine->evaluate(\"a = new Object( a.foo = 22; a.foo\")",
+ "engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
"engine->evaluate(\"True\")",
@@ -805,9 +806,12 @@ static QString toBoolean_tagArray[] = {
"engine->evaluate(\"'123'\")",
"engine->evaluate(\"'12.4'\")",
"engine->nullValue()",
- "engine->undefinedValue()"};
+ "engine->undefinedValue()",
+ "engine->newObject()",
+ "engine->newArray()",
+ "engine->newArray(10)"};
-static bool toBoolean_valueArray[] = {
+static const bool toBoolean_valueArray[] = {
false, false,
false, true,
false, true,
@@ -873,36 +877,36 @@ static bool toBoolean_valueArray[] = {
true, true,
false, true,
true, true,
- false, false};
+ false, false,
+ true, true,
+ true};
-void tst_QScriptValue::toBoolean_makeData(const char* expr)
+void tst_QScriptValue::toBoolean_data()
{
- static QHash<QString, bool> toBoolean;
- if (toBoolean.isEmpty()) {
- toBoolean.reserve(132);
- for (unsigned i = 0; i < 132; ++i)
- toBoolean.insert(toBoolean_tagArray[i], toBoolean_valueArray[i]);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<bool>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QHash<QString, bool> expectedValue;
+ expectedValue.reserve(135);
+ for (uint i = 0; i < 135; ++i)
+ expectedValue.insert(toBoolean_tagArray[i], toBoolean_valueArray[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue[testcase.first];
}
- newRow(expr) << toBoolean.value(expr);
}
-void tst_QScriptValue::toBoolean_test(const char*, const QScriptValue& value)
+void tst_QScriptValue::toBoolean()
{
+ QFETCH(QScriptValue, value);
QFETCH(bool, expected);
QCOMPARE(value.toBoolean(), expected);
QCOMPARE(value.toBoolean(), expected);
}
-DEFINE_TEST_FUNCTION(toBoolean)
-
-
-void tst_QScriptValue::toInteger_initData()
-{
- QTest::addColumn<qsreal>("expected");
- initScriptValues();
-}
-
-static QString toInteger_tagArray[] = {
+static const QString toInteger_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -1001,12 +1005,12 @@ static QString toInteger_tagArray[] = {
"engine->evaluate(\"Function\")",
"engine->evaluate(\"(function() { return 1; })\")",
"engine->evaluate(\"(function() { return 'ciao'; })\")",
- "engine->evaluate(\"(function() { throw new Error('foo' })\")",
+ "engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"/foo/\")",
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
- "engine->evaluate(\"a = new Object( a.foo = 22; a.foo\")",
+ "engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
"engine->evaluate(\"True\")",
@@ -1034,8 +1038,12 @@ static QString toInteger_tagArray[] = {
"engine->evaluate(\"'123'\")",
"engine->evaluate(\"'12.4'\")",
"engine->nullValue()",
- "engine->undefinedValue()"};
-static qsreal toInteger_valueArray[] = {
+ "engine->undefinedValue()",
+ "engine->newObject()",
+ "engine->newArray()",
+ "engine->newArray(10)"};
+
+static const qsreal toInteger_valueArray[] = {
0, 0, 0, 1, 0, 122, 124, 0, 0, 123,
0, 0, 1126240820, 65536, 65537, 0, 0, qInf(), qInf(), 0,
qInf(), qInf(), 0, 0, 0, 0, 0, 123, 12, 0,
@@ -1046,23 +1054,31 @@ static qsreal toInteger_valueArray[] = {
65537, 0, 0, qInf(), qInf(), 0, qInf(), qInf(), 0, 0,
0, 0, 0, 123, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 22, 0, 0, 0, 0, 0, 0,
1, 0, 122, 124, 0, 0, 123, 0, 0, 1126240820,
65536, 65537, 0, qInf(), qInf(), 0, 0, 0, 123, 12,
- 0, 0};
-void tst_QScriptValue::toInteger_makeData(const char* expr)
+ 0, 0, 0, 0, 0};
+
+void tst_QScriptValue::toInteger_data()
{
- static QHash<QString, qsreal> toInteger;
- if (toInteger.isEmpty()) {
- toInteger.reserve(132);
- for (unsigned i = 0; i < 132; ++i)
- toInteger.insert(toInteger_tagArray[i], toInteger_valueArray[i]);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<qsreal>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QHash<QString, qsreal> expectedValue;
+ expectedValue.reserve(135);
+ for (uint i = 0; i < 135; ++i)
+ expectedValue.insert(toInteger_tagArray[i], toInteger_valueArray[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue[testcase.first];
}
- newRow(expr) << toInteger.value(expr);
}
-void tst_QScriptValue::toInteger_test(const char*, const QScriptValue& value)
+void tst_QScriptValue::toInteger()
{
+ QFETCH(QScriptValue, value);
QFETCH(qsreal, expected);
if (qIsInf(expected)) {
QVERIFY(qIsInf(value.toInteger()));
@@ -1073,16 +1089,7 @@ void tst_QScriptValue::toInteger_test(const char*, const QScriptValue& value)
QCOMPARE(value.toInteger(), expected);
}
-DEFINE_TEST_FUNCTION(toInteger)
-
-
-void tst_QScriptValue::toInt32_initData()
-{
- QTest::addColumn<qint32>("expected");
- initScriptValues();
-}
-
-static QString toInt32_tagArray[] = {
+static const QString toInt32_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -1181,12 +1188,12 @@ static QString toInt32_tagArray[] = {
"engine->evaluate(\"Function\")",
"engine->evaluate(\"(function() { return 1; })\")",
"engine->evaluate(\"(function() { return 'ciao'; })\")",
- "engine->evaluate(\"(function() { throw new Error('foo' })\")",
+ "engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"/foo/\")",
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
- "engine->evaluate(\"a = new Object( a.foo = 22; a.foo\")",
+ "engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
"engine->evaluate(\"True\")",
@@ -1214,9 +1221,12 @@ static QString toInt32_tagArray[] = {
"engine->evaluate(\"'123'\")",
"engine->evaluate(\"'12.4'\")",
"engine->nullValue()",
- "engine->undefinedValue()"};
+ "engine->undefinedValue()",
+ "engine->newObject()",
+ "engine->newArray()",
+ "engine->newArray(10)"};
-static qint32 toInt32_valueArray[] = {
+static const qint32 toInt32_valueArray[] = {
0, 0,
0, 1,
0, 122,
@@ -1268,7 +1278,7 @@ static qint32 toInt32_valueArray[] = {
0, 0,
0, 0,
0, 0,
- 0, 0,
+ 0, 22,
0, 0,
0, 0,
0, 0,
@@ -1282,36 +1292,36 @@ static qint32 toInt32_valueArray[] = {
0, 0,
0, 0,
123, 12,
- 0, 0};
+ 0, 0,
+ 0, 0,
+ 0};
-void tst_QScriptValue::toInt32_makeData(const char* expr)
+void tst_QScriptValue::toInt32_data()
{
- static QHash<QString, qint32> toInt32;
- if (toInt32.isEmpty()) {
- toInt32.reserve(132);
- for (unsigned i = 0; i < 132; ++i)
- toInt32.insert(toInt32_tagArray[i], toInt32_valueArray[i]);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<qint32>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QHash<QString, qint32> expectedValue;
+ expectedValue.reserve(135);
+ for (uint i = 0; i < 135; ++i)
+ expectedValue.insert(toInt32_tagArray[i], toInt32_valueArray[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue[testcase.first];
}
- newRow(expr) << toInt32.value(expr);
}
-void tst_QScriptValue::toInt32_test(const char*, const QScriptValue& value)
+void tst_QScriptValue::toInt32()
{
+ QFETCH(QScriptValue, value);
QFETCH(qint32, expected);
QCOMPARE(value.toInt32(), expected);
QCOMPARE(value.toInt32(), expected);
}
-DEFINE_TEST_FUNCTION(toInt32)
-
-
-void tst_QScriptValue::toUInt32_initData()
-{
- QTest::addColumn<quint32>("expected");
- initScriptValues();
-}
-
-static QString toUInt32_tagArray[] = {
+static const QString toUInt32_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -1410,12 +1420,12 @@ static QString toUInt32_tagArray[] = {
"engine->evaluate(\"Function\")",
"engine->evaluate(\"(function() { return 1; })\")",
"engine->evaluate(\"(function() { return 'ciao'; })\")",
- "engine->evaluate(\"(function() { throw new Error('foo' })\")",
+ "engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"/foo/\")",
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
- "engine->evaluate(\"a = new Object( a.foo = 22; a.foo\")",
+ "engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
"engine->evaluate(\"True\")",
@@ -1443,9 +1453,12 @@ static QString toUInt32_tagArray[] = {
"engine->evaluate(\"'123'\")",
"engine->evaluate(\"'12.4'\")",
"engine->nullValue()",
- "engine->undefinedValue()"};
+ "engine->undefinedValue()",
+ "engine->newObject()",
+ "engine->newArray()",
+ "engine->newArray(10)"};
-static quint32 toUInt32_valueArray[] = {
+static const quint32 toUInt32_valueArray[] = {
0, 0,
0, 1,
0, 122,
@@ -1497,7 +1510,7 @@ static quint32 toUInt32_valueArray[] = {
0, 0,
0, 0,
0, 0,
- 0, 0,
+ 0, 22,
0, 0,
0, 0,
0, 0,
@@ -1511,36 +1524,36 @@ static quint32 toUInt32_valueArray[] = {
0, 0,
0, 0,
123, 12,
- 0, 0};
+ 0, 0,
+ 0, 0,
+ 0};
-void tst_QScriptValue::toUInt32_makeData(const char* expr)
+void tst_QScriptValue::toUInt32_data()
{
- static QHash<QString, quint32> toUInt32;
- if (toUInt32.isEmpty()) {
- toUInt32.reserve(132);
- for (unsigned i = 0; i < 132; ++i)
- toUInt32.insert(toUInt32_tagArray[i], toUInt32_valueArray[i]);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<quint32>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QHash<QString, quint32> expectedValue;
+ expectedValue.reserve(135);
+ for (uint i = 0; i < 135; ++i)
+ expectedValue.insert(toUInt32_tagArray[i], toUInt32_valueArray[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue[testcase.first];
}
- newRow(expr) << toUInt32.value(expr);
}
-void tst_QScriptValue::toUInt32_test(const char*, const QScriptValue& value)
+void tst_QScriptValue::toUInt32()
{
+ QFETCH(QScriptValue, value);
QFETCH(quint32, expected);
QCOMPARE(value.toUInt32(), expected);
QCOMPARE(value.toUInt32(), expected);
}
-DEFINE_TEST_FUNCTION(toUInt32)
-
-
-void tst_QScriptValue::toUInt16_initData()
-{
- QTest::addColumn<quint16>("expected");
- initScriptValues();
-}
-
-static QString toUInt16_tagArray[] = {
+static const QString toUInt16_tagArray[] = {
"QScriptValue()",
"QScriptValue(QScriptValue::UndefinedValue)",
"QScriptValue(QScriptValue::NullValue)",
@@ -1639,12 +1652,12 @@ static QString toUInt16_tagArray[] = {
"engine->evaluate(\"Function\")",
"engine->evaluate(\"(function() { return 1; })\")",
"engine->evaluate(\"(function() { return 'ciao'; })\")",
- "engine->evaluate(\"(function() { throw new Error('foo' })\")",
+ "engine->evaluate(\"(function() { throw new Error('foo'); })\")",
"engine->evaluate(\"/foo/\")",
"engine->evaluate(\"new Object()\")",
"engine->evaluate(\"new Array()\")",
"engine->evaluate(\"new Error()\")",
- "engine->evaluate(\"a = new Object( a.foo = 22; a.foo\")",
+ "engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")",
"engine->evaluate(\"Undefined\")",
"engine->evaluate(\"Null\")",
"engine->evaluate(\"True\")",
@@ -1672,9 +1685,12 @@ static QString toUInt16_tagArray[] = {
"engine->evaluate(\"'123'\")",
"engine->evaluate(\"'12.4'\")",
"engine->nullValue()",
- "engine->undefinedValue()"};
+ "engine->undefinedValue()",
+ "engine->newObject()",
+ "engine->newArray()",
+ "engine->newArray(10)"};
-static quint16 toUInt16_valueArray[] = {
+static const quint16 toUInt16_valueArray[] = {
0, 0,
0, 1,
0, 122,
@@ -1726,7 +1742,7 @@ static quint16 toUInt16_valueArray[] = {
0, 0,
0, 0,
0, 0,
- 0, 0,
+ 0, 22,
0, 0,
0, 0,
0, 0,
@@ -1740,24 +1756,31 @@ static quint16 toUInt16_valueArray[] = {
0, 0,
0, 0,
123, 12,
- 0, 0};
+ 0, 0,
+ 0, 0,
+ 0};
-void tst_QScriptValue::toUInt16_makeData(const char* expr)
+void tst_QScriptValue::toUInt16_data()
{
- static QHash<QString, quint16> toUInt16;
- if (toUInt16.isEmpty()) {
- toUInt16.reserve(132);
- for (unsigned i = 0; i < 132; ++i)
- toUInt16.insert(toUInt16_tagArray[i], toUInt16_valueArray[i]);
+ QTest::addColumn<QScriptValue>("value");
+ QTest::addColumn<quint16>("expected");
+ if (m_engine)
+ delete m_engine;
+ m_engine = new QScriptEngine();
+ QHash<QString, quint16> expectedValue;
+ expectedValue.reserve(135);
+ for (uint i = 0; i < 135; ++i)
+ expectedValue.insert(toUInt16_tagArray[i], toUInt16_valueArray[i]);
+ for (uint i = 0; i < 135; ++i) {
+ QPair<QString, QScriptValue> testcase = initScriptValues(i);
+ QTest::newRow(testcase.first.toAscii().constData()) << testcase.second << expectedValue[testcase.first];
}
- newRow(expr) << toUInt16.value(expr);
}
-void tst_QScriptValue::toUInt16_test(const char*, const QScriptValue& value)
+void tst_QScriptValue::toUInt16()
{
+ QFETCH(QScriptValue, value);
QFETCH(quint16, expected);
QCOMPARE(value.toUInt16(), expected);
QCOMPARE(value.toUInt16(), expected);
}
-
-DEFINE_TEST_FUNCTION(toUInt16)
diff --git a/JavaScriptCore/runtime/JSByteArray.h b/JavaScriptCore/runtime/JSByteArray.h
index 5b7adcf..e9a6c64 100644
--- a/JavaScriptCore/runtime/JSByteArray.h
+++ b/JavaScriptCore/runtime/JSByteArray.h
@@ -45,25 +45,18 @@ namespace JSC {
void setIndex(unsigned i, int value)
{
ASSERT(canAccessIndex(i));
- if (value & ~0xFF) {
- if (value < 0)
- value = 0;
- else
- value = 255;
- }
m_storage->data()[i] = static_cast<unsigned char>(value);
}
-
+
void setIndex(unsigned i, double value)
{
ASSERT(canAccessIndex(i));
- if (!(value > 0)) // Clamp NaN to 0
- value = 0;
- else if (value > 255)
- value = 255;
- m_storage->data()[i] = static_cast<unsigned char>(value + 0.5);
+ // The largest integer value that a double can represent without loss of precision
+ // is 2^53. long long is the smallest integral type that gives correct results
+ // when casting numbers larger than 2^31 from a value of type double.
+ m_storage->data()[i] = static_cast<unsigned char>(static_cast<long long>(value));
}
-
+
void setIndex(ExecState* exec, unsigned i, JSValue value)
{
double byteValue = value.toNumber(exec);
@@ -75,7 +68,7 @@ namespace JSC {
JSByteArray(ExecState* exec, NonNullPassRefPtr<Structure>, WTF::ByteArray* storage, const JSC::ClassInfo* = &s_defaultInfo);
static PassRefPtr<Structure> createStructure(JSValue prototype);
-
+
virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
virtual bool getOwnPropertySlot(JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
@@ -86,7 +79,7 @@ namespace JSC {
virtual const ClassInfo* classInfo() const { return m_classInfo; }
static const ClassInfo s_defaultInfo;
-
+
size_t length() const { return m_storage->length(); }
WTF::ByteArray* storage() const { return m_storage.get(); }
@@ -100,7 +93,7 @@ namespace JSC {
private:
enum VPtrStealingHackType { VPtrStealingHack };
- JSByteArray(VPtrStealingHackType)
+ JSByteArray(VPtrStealingHackType)
: JSObject(createStructure(jsNull()))
, m_classInfo(0)
{
@@ -109,7 +102,7 @@ namespace JSC {
RefPtr<WTF::ByteArray> m_storage;
const ClassInfo* m_classInfo;
};
-
+
JSByteArray* asByteArray(JSValue value);
inline JSByteArray* asByteArray(JSValue value)
{
diff --git a/JavaScriptCore/runtime/JSGlobalData.h b/JavaScriptCore/runtime/JSGlobalData.h
index 23b6b21..63f9ad8 100644
--- a/JavaScriptCore/runtime/JSGlobalData.h
+++ b/JavaScriptCore/runtime/JSGlobalData.h
@@ -41,6 +41,7 @@
#include "Terminator.h"
#include "TimeoutChecker.h"
#include "WeakRandom.h"
+#include <wtf/BumpPointerAllocator.h>
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/RefCounted.h>
@@ -219,6 +220,8 @@ namespace JSC {
RegExpCache* m_regExpCache;
+ BumpPointerAllocator m_regexAllocator;
+
#ifndef NDEBUG
ThreadIdentifier exclusiveThread;
#endif
diff --git a/JavaScriptCore/runtime/JSGlobalObject.cpp b/JavaScriptCore/runtime/JSGlobalObject.cpp
index 69e09c1..c317e13 100644
--- a/JavaScriptCore/runtime/JSGlobalObject.cpp
+++ b/JavaScriptCore/runtime/JSGlobalObject.cpp
@@ -291,12 +291,12 @@ void JSGlobalObject::reset(JSValue prototype)
putDirectFunctionWithoutTransition(Identifier(exec, "Date"), dateConstructor, DontEnum);
putDirectFunctionWithoutTransition(Identifier(exec, "RegExp"), d()->regExpConstructor, DontEnum);
putDirectFunctionWithoutTransition(Identifier(exec, "Error"), d()->errorConstructor, DontEnum);
- putDirectFunctionWithoutTransition(Identifier(exec, "EvalError"), d()->evalErrorConstructor);
- putDirectFunctionWithoutTransition(Identifier(exec, "RangeError"), d()->rangeErrorConstructor);
- putDirectFunctionWithoutTransition(Identifier(exec, "ReferenceError"), d()->referenceErrorConstructor);
- putDirectFunctionWithoutTransition(Identifier(exec, "SyntaxError"), d()->syntaxErrorConstructor);
- putDirectFunctionWithoutTransition(Identifier(exec, "TypeError"), d()->typeErrorConstructor);
- putDirectFunctionWithoutTransition(Identifier(exec, "URIError"), d()->URIErrorConstructor);
+ putDirectFunctionWithoutTransition(Identifier(exec, "EvalError"), d()->evalErrorConstructor, DontEnum);
+ putDirectFunctionWithoutTransition(Identifier(exec, "RangeError"), d()->rangeErrorConstructor, DontEnum);
+ putDirectFunctionWithoutTransition(Identifier(exec, "ReferenceError"), d()->referenceErrorConstructor, DontEnum);
+ putDirectFunctionWithoutTransition(Identifier(exec, "SyntaxError"), d()->syntaxErrorConstructor, DontEnum);
+ putDirectFunctionWithoutTransition(Identifier(exec, "TypeError"), d()->typeErrorConstructor, DontEnum);
+ putDirectFunctionWithoutTransition(Identifier(exec, "URIError"), d()->URIErrorConstructor, DontEnum);
// Set global values.
GlobalPropertyInfo staticGlobals[] = {
diff --git a/JavaScriptCore/runtime/RegExp.cpp b/JavaScriptCore/runtime/RegExp.cpp
index d8b217d..59e3f35 100644
--- a/JavaScriptCore/runtime/RegExp.cpp
+++ b/JavaScriptCore/runtime/RegExp.cpp
@@ -85,8 +85,7 @@ void RegExp::compile(JSGlobalData* globalData)
#if ENABLE(YARR_JIT)
Yarr::jitCompileRegex(globalData, m_regExpJITCode, m_pattern, m_numSubpatterns, m_constructionError, ignoreCase(), multiline());
#else
- UNUSED_PARAM(globalData);
- m_regExpBytecode.set(Yarr::byteCompileRegex(m_pattern, m_numSubpatterns, m_constructionError, ignoreCase(), multiline()));
+ m_regExpBytecode = Yarr::byteCompileRegex(m_pattern, m_numSubpatterns, m_constructionError, &globalData->m_regexAllocator, ignoreCase(), multiline());
#endif
}
diff --git a/JavaScriptCore/runtime/TimeoutChecker.h b/JavaScriptCore/runtime/TimeoutChecker.h
index 18bc36b..71ce169 100644
--- a/JavaScriptCore/runtime/TimeoutChecker.h
+++ b/JavaScriptCore/runtime/TimeoutChecker.h
@@ -44,6 +44,7 @@ namespace JSC {
TimeoutChecker();
void setTimeoutInterval(unsigned timeoutInterval) { m_timeoutInterval = timeoutInterval; }
+ unsigned timeoutInterval() const { return m_timeoutInterval; }
unsigned ticksUntilNextCheck() { return m_ticksUntilNextCheck; }
diff --git a/JavaScriptCore/wscript b/JavaScriptCore/wscript
index 99859f0..4f9d868 100644
--- a/JavaScriptCore/wscript
+++ b/JavaScriptCore/wscript
@@ -38,7 +38,7 @@ jscore_excludes.extend(get_excludes(jscore_dir, ['*None.cpp']))
if building_on_win32:
jscore_excludes += ['ExecutableAllocatorPosix.cpp', 'MarkStackPosix.cpp', 'ThreadingPthreads.cpp']
- sources += ['jit/ExecutableAllocatorWin.cpp', 'runtime/MarkStackWin.cpp']
+ sources += ['runtime/MarkStackWin.cpp']
else:
jscore_excludes.append('JSStringRefBSTR.cpp')
jscore_excludes.extend(get_excludes(jscore_dir, ['*Win.cpp']))
diff --git a/JavaScriptCore/wtf/BumpPointerAllocator.h b/JavaScriptCore/wtf/BumpPointerAllocator.h
new file mode 100644
index 0000000..3deefe6
--- /dev/null
+++ b/JavaScriptCore/wtf/BumpPointerAllocator.h
@@ -0,0 +1,253 @@
+/*
+ * Copyright (C) 2010 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. 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.
+ */
+
+#ifndef BumpPointerAllocator_h
+#define BumpPointerAllocator_h
+
+#include <wtf/PageAllocation.h>
+
+namespace WTF {
+
+#define MINIMUM_BUMP_POOL_SIZE 0x1000
+
+class BumpPointerPool {
+public:
+ // ensureCapacity will check whether the current pool has capacity to
+ // allocate 'size' bytes of memory If it does not, it will attempt to
+ // allocate a new pool (which will be added to this one in a chain).
+ //
+ // If allocation fails (out of memory) this method will return null.
+ // If the return value is non-null, then callers should update any
+ // references they have to this current (possibly full) BumpPointerPool
+ // to instead point to the newly returned BumpPointerPool.
+ BumpPointerPool* ensureCapacity(size_t size)
+ {
+ void* allocationEnd = static_cast<char*>(m_current) + size;
+ ASSERT(allocationEnd > m_current); // check for overflow
+ if (allocationEnd <= static_cast<void*>(this))
+ return this;
+ return ensureCapacityCrossPool(this, size);
+ }
+
+ // alloc should only be called after calling ensureCapacity; as such
+ // alloc will never fail.
+ void* alloc(size_t size)
+ {
+ void* current = m_current;
+ void* allocationEnd = static_cast<char*>(current) + size;
+ ASSERT(allocationEnd > current); // check for overflow
+ ASSERT(allocationEnd <= static_cast<void*>(this));
+ m_current = allocationEnd;
+ return current;
+ }
+
+ // The dealloc method releases memory allocated using alloc. Memory
+ // must be released in a LIFO fashion, e.g. if the client calls alloc
+ // four times, returning pointer A, B, C, D, then the only valid order
+ // in which these may be deallocaed is D, C, B, A.
+ //
+ // The client may optionally skip some deallocations. In the example
+ // above, it would be valid to only explicitly dealloc C, A (D being
+ // dealloced along with C, B along with A).
+ //
+ // If pointer was not allocated from this pool (or pools) then dealloc
+ // will CRASH(). Callers should update any references they have to
+ // this current BumpPointerPool to instead point to the returned
+ // BumpPointerPool.
+ BumpPointerPool* dealloc(void* position)
+ {
+ if ((position >= m_start) && (position <= static_cast<void*>(this))) {
+ ASSERT(position <= m_current);
+ m_current = position;
+ return this;
+ }
+ return deallocCrossPool(this, position);
+ }
+
+private:
+ // Placement operator new, returns the last 'size' bytes of allocation for use as this.
+ void* operator new(size_t size, const PageAllocation& allocation)
+ {
+ ASSERT(size < allocation.size());
+ return reinterpret_cast<char*>(reinterpret_cast<intptr_t>(allocation.base()) + allocation.size()) - size;
+ }
+
+ BumpPointerPool(const PageAllocation& allocation)
+ : m_current(allocation.base())
+ , m_start(allocation.base())
+ , m_next(0)
+ , m_previous(0)
+ , m_allocation(allocation)
+ {
+ }
+
+ static BumpPointerPool* create(size_t minimumCapacity = 0)
+ {
+ // Add size of BumpPointerPool object, check for overflow.
+ minimumCapacity += sizeof(BumpPointerPool);
+ if (minimumCapacity < sizeof(BumpPointerPool))
+ return 0;
+
+ size_t poolSize = MINIMUM_BUMP_POOL_SIZE;
+ while (poolSize < minimumCapacity) {
+ poolSize <<= 1;
+ // The following if check relies on MINIMUM_BUMP_POOL_SIZE being a power of 2!
+ ASSERT(!(MINIMUM_BUMP_POOL_SIZE & (MINIMUM_BUMP_POOL_SIZE - 1)));
+ if (!poolSize)
+ return 0;
+ }
+
+ PageAllocation allocation = PageAllocation::allocate(poolSize);
+ if (!!allocation)
+ return new(allocation) BumpPointerPool(allocation);
+ return 0;
+ }
+
+ void shrink()
+ {
+ ASSERT(!m_previous);
+ m_current = m_start;
+ while (m_next) {
+ BumpPointerPool* nextNext = m_next->m_next;
+ m_next->destroy();
+ m_next = nextNext;
+ }
+ }
+
+ void destroy()
+ {
+ // Don't call deallocate on allocation, because allocation is *inside* allocation,
+ // and it will get deallocated before deallocate has completed!
+ PageAllocation allocation = m_allocation;
+ allocation.deallocate();
+ }
+
+ static BumpPointerPool* ensureCapacityCrossPool(BumpPointerPool* previousPool, size_t size)
+ {
+ // The pool passed should not have capacity, so we'll start with the next one.
+ ASSERT(previousPool);
+ ASSERT((static_cast<char*>(previousPool->m_current) + size) > previousPool->m_current); // check for overflow
+ ASSERT((static_cast<char*>(previousPool->m_current) + size) > static_cast<void*>(previousPool));
+ BumpPointerPool* pool = previousPool->m_next;
+
+ while (true) {
+ if (!pool) {
+ // We've run to the end; allocate a new pool.
+ pool = BumpPointerPool::create(size);
+ previousPool->m_next = pool;
+ pool->m_previous = previousPool;
+ return pool;
+ }
+
+ //
+ void* current = pool->m_current;
+ void* allocationEnd = static_cast<char*>(current) + size;
+ ASSERT(allocationEnd > current); // check for overflow
+ if (allocationEnd <= static_cast<void*>(pool))
+ return pool;
+ }
+ }
+
+ static BumpPointerPool* deallocCrossPool(BumpPointerPool* pool, void* position)
+ {
+ // Should only be called if position is not in the current pool.
+ ASSERT((position < pool->m_start) || (position > static_cast<void*>(pool)));
+
+ while (true) {
+ // Unwind the current pool to the start, move back in the chain to the previous pool.
+ pool->m_current = pool->m_start;
+ pool = pool->m_previous;
+
+ // position was nowhere in the chain!
+ if (!pool)
+ CRASH();
+
+ if ((position >= pool->m_start) && (position <= static_cast<void*>(pool))) {
+ ASSERT(position <= pool->m_current);
+ pool->m_current = position;
+ return pool;
+ }
+ }
+ }
+
+ void* m_current;
+ void* m_start;
+ BumpPointerPool* m_next;
+ BumpPointerPool* m_previous;
+ PageAllocation m_allocation;
+
+ friend class BumpPointerAllocator;
+};
+
+// A BumpPointerAllocator manages a set of BumpPointerPool objects, which
+// can be used for LIFO (stack like) allocation.
+//
+// To begin allocating using this class call startAllocator(). The result
+// of this method will be null if the initial pool allocation fails, or a
+// pointer to a BumpPointerPool object that can be used to perform
+// allocations. Whilst running no memory will be released until
+// stopAllocator() is called. At this point all allocations made through
+// this allocator will be reaped, and underlying memory may be freed.
+//
+// (In practice we will still hold on to the initial pool to allow allocation
+// to be quickly restared, but aditional pools will be freed).
+//
+// This allocator is non-renetrant, it is encumbant on the clients to ensure
+// startAllocator() is not called again until stopAllocator() has been called.
+class BumpPointerAllocator {
+public:
+ BumpPointerAllocator()
+ : m_head(0)
+ {
+ }
+
+ ~BumpPointerAllocator()
+ {
+ if (m_head)
+ m_head->destroy();
+ }
+
+ BumpPointerPool* startAllocator()
+ {
+ if (!m_head)
+ m_head = BumpPointerPool::create();
+ return m_head;
+ }
+
+ void stopAllocator()
+ {
+ if (m_head)
+ m_head->shrink();
+ }
+
+private:
+ BumpPointerPool* m_head;
+};
+
+}
+
+using WTF::BumpPointerAllocator;
+
+#endif // BumpPointerAllocator_h
diff --git a/JavaScriptCore/wtf/CMakeListsEfl.txt b/JavaScriptCore/wtf/CMakeListsEfl.txt
index 3e128be..3cd3c8e 100644
--- a/JavaScriptCore/wtf/CMakeListsEfl.txt
+++ b/JavaScriptCore/wtf/CMakeListsEfl.txt
@@ -3,15 +3,19 @@ ADD_DEFINITIONS(-DUSE_SYSTEM_MALLOC=1)
LIST(APPEND WTF_SOURCES
efl/MainThreadEfl.cpp
- gobject/GOwnPtr.cpp
- gobject/GRefPtr.cpp
-
ThreadIdentifierDataPthreads.cpp
ThreadingPthreads.cpp
unicode/icu/CollatorICU.cpp
)
+IF (ENABLE_GLIB_SUPPORT)
+ LIST(APPEND WTF_SOURCES
+ gobject/GOwnPtr.cpp
+ gobject/GRefPtr.cpp
+ )
+ENDIF ()
+
LIST(APPEND WTF_LIBRARIES
pthread
${ICU_LIBRARIES}
diff --git a/JavaScriptCore/wtf/PageAllocation.cpp b/JavaScriptCore/wtf/PageAllocation.cpp
new file mode 100644
index 0000000..58a10f6
--- /dev/null
+++ b/JavaScriptCore/wtf/PageAllocation.cpp
@@ -0,0 +1,231 @@
+/*
+ * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. 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 "PageAllocation.h"
+
+#if HAVE(ERRNO_H)
+#include <errno.h>
+#endif
+
+#if HAVE(MMAP)
+#include <sys/mman.h>
+#include <unistd.h>
+#endif
+
+#if OS(WINDOWS)
+#include "windows.h"
+#endif
+
+#if OS(SYMBIAN)
+#include <e32hal.h>
+#endif
+
+namespace WTF {
+
+#if HAVE(MMAP)
+
+bool PageAllocation::commit(void* start, size_t size, bool, bool) const
+{
+#if HAVE(MADV_FREE_REUSE)
+ while (madvise(start, size, MADV_FREE_REUSE) == -1 && errno == EAGAIN) { }
+#else
+ UNUSED_PARAM(start);
+ UNUSED_PARAM(size);
+#endif
+ return true;
+}
+
+void PageAllocation::decommit(void* start, size_t size) const
+{
+#if HAVE(MADV_FREE_REUSE)
+ while (madvise(start, size, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { }
+#elif HAVE(MADV_FREE)
+ while (madvise(start, size, MADV_FREE) == -1 && errno == EAGAIN) { }
+#elif HAVE(MADV_DONTNEED)
+ while (madvise(start, size, MADV_DONTNEED) == -1 && errno == EAGAIN) { }
+#else
+ UNUSED_PARAM(start);
+ UNUSED_PARAM(size);
+#endif
+}
+
+PageAllocation PageAllocation::allocate(size_t size, Usage usage, bool writable, bool executable)
+{
+ return allocateAt(0, false, size, usage, writable, executable);
+}
+
+PageAllocation PageAllocation::reserve(size_t size, Usage usage, bool writable, bool executable)
+{
+ return reserveAt(0, false, size, usage, writable, executable);
+}
+
+PageAllocation PageAllocation::allocateAt(void* address, bool fixed, size_t size, Usage usage, bool writable, bool executable)
+{
+ int flags = MAP_PRIVATE | MAP_ANON;
+ if (fixed)
+ flags |= MAP_FIXED;
+
+ int protection = PROT_READ;
+ if (writable)
+ protection |= PROT_WRITE;
+ if (executable)
+ protection |= PROT_EXEC;
+
+ void* base = mmap(address, size, protection, flags, usage, 0);
+ if (base == MAP_FAILED)
+ base = 0;
+
+ return PageAllocation(base, size);
+}
+
+PageAllocation PageAllocation::reserveAt(void* address, bool fixed, size_t size, Usage usage, bool writable, bool executable)
+{
+ PageAllocation result = allocateAt(address, fixed, size, usage, writable, executable);
+ if (!!result)
+ result.decommit(result.base(), size);
+ return result;
+}
+
+void PageAllocation::deallocate()
+{
+ int result = munmap(m_base, m_size);
+ ASSERT_UNUSED(result, !result);
+ m_base = 0;
+}
+
+size_t PageAllocation::pagesize()
+{
+ static size_t size = 0;
+ if (!size)
+ size = getpagesize();
+ return size;
+}
+
+#elif HAVE(VIRTUALALLOC)
+
+static DWORD protection(bool writable, bool executable)
+{
+ if (executable)
+ return writable ?PAGE_EXECUTE_READWRITE : PAGE_EXECUTE_READ;
+ return writable ?PAGE_READWRITE : PAGE_READONLY;
+}
+
+bool PageAllocation::commit(void* start, size_t size, bool writable, bool executable) const
+{
+ return VirtualAlloc(start, size, MEM_COMMIT, protection(writable, executable)) == start;
+}
+
+void PageAllocation::decommit(void* start, size_t size) const
+{
+ VirtualFree(start, size, MEM_DECOMMIT);
+}
+
+PageAllocation PageAllocation::allocate(size_t size, Usage, bool writable, bool executable)
+{
+ return PageAllocation(VirtualAlloc(0, size, MEM_COMMIT | MEM_RESERVE, protection(writable, executable)), size);
+}
+
+PageAllocation PageAllocation::reserve(size_t size, Usage usage, bool writable, bool executable)
+{
+ return PageAllocation(VirtualAlloc(0, size, MEM_RESERVE, protection(writable, executable)), size);
+}
+
+void PageAllocation::deallocate()
+{
+ VirtualFree(m_base, 0, MEM_RELEASE);
+ m_base = 0;
+}
+
+size_t PageAllocation::pagesize()
+{
+ static size_t size = 0;
+ if (!size) {
+ SYSTEM_INFO system_info;
+ GetSystemInfo(&system_info);
+ size = system_info.dwPageSize;
+ }
+ return size;
+}
+
+#elif OS(SYMBIAN)
+
+bool PageAllocation::commit(void* start, size_t size, bool writable, bool executable) const
+{
+ if (m_chunk) {
+ intptr_t offset = static_cast<intptr_t>(base()) - static_cast<intptr_t>(start);
+ m_chunk->Commit(offset, size);
+ }
+ return true;
+}
+
+void PageAllocation::decommit(void* start, size_t size) const
+{
+ if (m_chunk) {
+ intptr_t offset = static_cast<intptr_t>(base()) - static_cast<intptr_t>(start);
+ m_chunk->Decommit(offset, size);
+ }
+}
+
+PageAllocation PageAllocation::allocate(size_t size, Usage usage, bool writable, bool executable)
+{
+ if (!executable)
+ return PageAllocation(fastMalloc(size), size, 0);
+ RChunk* rchunk = new RChunk();
+ TInt errorCode = rchunk->CreateLocalCode(size, size);
+ return PageAllocation(rchunk->Base(), size, rchunk);
+}
+
+PageAllocation PageAllocation::reserve(size_t size, Usage usage, bool writable, bool executable)
+{
+ if (!executable)
+ return PageAllocation(fastMalloc(size), size, 0);
+ RChunk* rchunk = new RChunk();
+ TInt errorCode = rchunk->CreateLocalCode(0, size);
+ return PageAllocation(rchunk, rchunk->Base(), size);
+}
+
+void PageAllocation::deallocate()
+{
+ if (m_chunk) {
+ m_chunk->Close();
+ delete m_chunk;
+ } else
+ fastFree(m_base);
+ m_base = 0;
+}
+
+size_t PageAllocation::pagesize()
+{
+ static TInt page_size = 0;
+ if (!page_size)
+ UserHal::PageSizeInBytes(page_size);
+ return page_size;
+}
+
+#endif
+
+}
diff --git a/JavaScriptCore/wtf/PageAllocation.h b/JavaScriptCore/wtf/PageAllocation.h
new file mode 100644
index 0000000..00b5363
--- /dev/null
+++ b/JavaScriptCore/wtf/PageAllocation.h
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2010 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. 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.
+ */
+
+#ifndef PageAllocation_h
+#define PageAllocation_h
+
+#include <wtf/UnusedParam.h>
+#include <wtf/VMTags.h>
+
+#if OS(SYMBIAN)
+#include <e32std.h>
+#endif
+
+#if HAVE(MMAP)
+#define PAGE_ALLOCATION_ALLOCATE_AT 1
+#else
+#define PAGE_ALLOCATION_ALLOCATE_AT 0
+#endif
+
+namespace WTF {
+
+class PageAllocation {
+public:
+ enum Usage {
+ UnknownUsage = -1,
+ FastMallocPages = VM_TAG_FOR_TCMALLOC_MEMORY,
+ JSGCHeapPages = VM_TAG_FOR_COLLECTOR_MEMORY,
+ JSVMStackPages = VM_TAG_FOR_REGISTERFILE_MEMORY,
+ JSJITCodePages = VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY,
+ };
+
+ PageAllocation()
+ : m_base(0)
+ , m_size(0)
+#if OS(SYMBIAN)
+ , m_chunk(0)
+#endif
+ {
+ }
+
+ // Create a PageAllocation object representing a sub-region of an existing allocation;
+ // deallocate should never be called on an object represnting a subregion, only on the
+ // initial allocation.
+ PageAllocation(void* base, size_t size, const PageAllocation& parent)
+ : m_base(base)
+ , m_size(size)
+#if OS(SYMBIAN)
+ , m_chunk(parent.chunk)
+#endif
+ {
+#if defined(NDEBUG) && !OS(SYMBIAN)
+ UNUSED_PARAM(parent);
+#endif
+ ASSERT(base >= parent.m_base);
+ ASSERT(size <= parent.m_size);
+ ASSERT(static_cast<char*>(base) + size <= static_cast<char*>(parent.m_base) + parent.m_size);
+ }
+
+ void* base() const { return m_base; }
+ size_t size() const { return m_size; }
+
+ bool operator!() const { return !m_base; }
+
+ bool commit(void*, size_t, bool writable = true, bool executable = false) const;
+ void decommit(void*, size_t) const;
+ void deallocate();
+
+ static PageAllocation allocate(size_t, Usage = UnknownUsage, bool writable = true, bool executable = false);
+ static PageAllocation reserve(size_t, Usage = UnknownUsage, bool writable = true, bool executable = false);
+#if PAGE_ALLOCATION_ALLOCATE_AT
+ static PageAllocation allocateAt(void* address, bool fixed, size_t, Usage = UnknownUsage, bool writable = true, bool executable = false);
+ static PageAllocation reserveAt(void* address, bool fixed, size_t, Usage = UnknownUsage, bool writable = true, bool executable = false);
+#endif
+ static size_t pagesize();
+
+private:
+#if OS(SYMBIAN)
+ PageAllocation(void* base, size_t size, RChunk* chunk)
+ : m_base(base)
+ , m_size(size)
+ , m_chunk(chunk)
+ {
+ }
+#else
+ PageAllocation(void* base, size_t size)
+ : m_base(base)
+ , m_size(size)
+ {
+ }
+#endif
+
+ void* m_base;
+ size_t m_size;
+#if OS(SYMBIAN)
+ RChunk* m_chunk;
+#endif
+};
+
+}
+
+using WTF::PageAllocation;
+
+#endif // PageAllocation_h
diff --git a/JavaScriptCore/wtf/Platform.h b/JavaScriptCore/wtf/Platform.h
index 4166ad9..ed618b0 100644
--- a/JavaScriptCore/wtf/Platform.h
+++ b/JavaScriptCore/wtf/Platform.h
@@ -80,6 +80,10 @@
#if defined(__GNUC__) && !COMPILER(RVCT)
#define WTF_COMPILER_GCC 1
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
+#define GCC_VERSION_AT_LEAST(major, minor, patch) (GCC_VERSION >= (major * 10000 + minor * 100 + patch))
+#else
+/* define this for !GCC compilers, just so we can write things like COMPILER(GCC) && GCC_VERSION_AT_LEAST(4,1,0) */
+#define GCC_VERSION_AT_LEAST(major, minor, patch) 0
#endif
/* COMPILER(MINGW) - MinGW GCC */
@@ -522,6 +526,7 @@
#define WTF_USE_CORE_TEXT 1
#else
#define WTF_PLATFORM_SKIA 1
+#define WTF_USE_GLES2_RENDERING 1
#endif
#endif
@@ -548,16 +553,6 @@
#endif
#if OS(WINCE) && !PLATFORM(QT)
-#undef ENABLE_JSC_MULTIPLE_THREADS
-#define ENABLE_JSC_MULTIPLE_THREADS 0
-#define USE_SYSTEM_MALLOC 0
-#define ENABLE_ICONDATABASE 0
-#define ENABLE_JAVASCRIPT_DEBUGGER 0
-#define ENABLE_FTPDIR 0
-#define ENABLE_PAN_SCROLLING 0
-#define ENABLE_WML 1
-#define HAVE_ACCESSIBILITY 0
-
#define NOMINMAX /* Windows min and max conflict with standard macros */
#define NOSHLWAPI /* shlwapi.h not available on WinCe */
@@ -650,7 +645,13 @@
This prevents unnecessary invals. */
#define ENABLE_TEXT_CARET 1
#define ENABLE_JAVASCRIPT_DEBUGGER 0
+<<<<<<< HEAD
#define ENABLE_ORIENTATION_EVENTS 1
+=======
+#if !defined(ENABLE_JIT) && !ENABLE(ANDROID_JSC_JIT)
+#define ENABLE_JIT 0
+#endif
+>>>>>>> webkit.org at r64264
#endif
#if PLATFORM(WIN)
@@ -936,86 +937,50 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */
#define ENABLE_REPAINT_THROTTLING 0
#endif
-#if !defined(ENABLE_JIT)
-
-/* The JIT is tested & working on x86_64 Mac */
-#if CPU(X86_64) && PLATFORM(MAC)
- #define ENABLE_JIT 1
-/* The JIT is tested & working on x86 Mac */
-#elif CPU(X86) && PLATFORM(MAC)
- #define ENABLE_JIT 1
-#elif CPU(ARM_THUMB2) && PLATFORM(IPHONE)
- #define ENABLE_JIT 1
-/* The JIT is tested & working on Android */
-#elif CPU(ARM_THUMB2) && PLATFORM(ANDROID) && ENABLE(ANDROID_JSC_JIT)
- #define ENABLE_JIT 1
-/* The JIT is tested & working on x86 Windows */
-#elif CPU(X86) && PLATFORM(WIN)
- #define ENABLE_JIT 1
-#endif
-
-#if PLATFORM(QT) || PLATFORM(WX)
-#if CPU(X86_64) && OS(DARWIN)
- #define ENABLE_JIT 1
-#elif CPU(X86) && OS(DARWIN)
- #define ENABLE_JIT 1
-#elif CPU(X86) && OS(WINDOWS) && COMPILER(MINGW) && GCC_VERSION >= 40100
- #define ENABLE_JIT 1
-#elif CPU(X86) && OS(WINDOWS) && COMPILER(MSVC)
- #define ENABLE_JIT 1
-#elif CPU(X86) && OS(LINUX) && GCC_VERSION >= 40100
- #define ENABLE_JIT 1
-#elif CPU(X86_64) && OS(LINUX) && GCC_VERSION >= 40100
- #define ENABLE_JIT 1
-#elif CPU(ARM_TRADITIONAL) && OS(LINUX)
- #define ENABLE_JIT 1
-#elif CPU(ARM_TRADITIONAL) && OS(SYMBIAN) && COMPILER(RVCT)
- #define ENABLE_JIT 1
-#elif CPU(MIPS) && OS(LINUX)
- #define ENABLE_JIT 1
-#endif
-#endif /* PLATFORM(QT) */
-
-#endif /* !defined(ENABLE_JIT) */
-
-#if !ENABLE(JIT)
-#define ENABLE_INTERPRETER 1
+/* Disable the JIT on versiond of GCC prior to 4.1 */
+#if !defined(ENABLE_JIT) && COMPILER(GCC) && !GCC_VERSION_AT_LEAST(4,1,0)
+#define ENABLE_JIT 0
#endif
-#if !(ENABLE(JIT) || ENABLE(INTERPRETER))
-#error You have to have at least one execution model enabled to build JSC
+/* The JIT is enabled by default on all x86, x64-64, ARM & MIPS platforms. */
+#if !defined(ENABLE_JIT) \
+ && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(MIPS)) \
+ && (OS(DARWIN) || !COMPILER(GCC) || GCC_VERSION_AT_LEAST(4,1,0))
+#define ENABLE_JIT 1
#endif
-/* CPU architecture specific optimizations */
-#if CPU(ARM_TRADITIONAL)
-#if ENABLE(JIT) && !defined(ENABLE_JIT_OPTIMIZE_MOD) && WTF_ARM_ARCH_AT_LEAST(5)
-#define ENABLE_JIT_OPTIMIZE_MOD 1
-#endif
-#endif
-#if (CPU(X86) && USE(JSVALUE32_64)) || (CPU(X86_64) && USE(JSVALUE64)) \
- || CPU(ARM) \
- || CPU(MIPS)
-#if ENABLE(JIT) && !defined(ENABLE_JIT_OPTIMIZE_NATIVE_CALL)
-#define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 1
+/* Ensure that either the JIT or the interpreter has been enabled. */
+#if !defined(ENABLE_INTERPRETER) && !ENABLE(JIT)
+#define ENABLE_INTERPRETER 1
#endif
+#if !(ENABLE(JIT) || ENABLE(INTERPRETER))
+#error You have to have at least one execution model enabled to build JSC
#endif
+/* Configure the JIT */
#if ENABLE(JIT)
-#ifndef ENABLE_JIT_OPTIMIZE_CALL
-#define ENABLE_JIT_OPTIMIZE_CALL 1
-#endif
-#ifndef ENABLE_JIT_OPTIMIZE_NATIVE_CALL
-#define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 0
-#endif
-#ifndef ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
-#define ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS 1
-#endif
-#ifndef ENABLE_JIT_OPTIMIZE_METHOD_CALLS
-#define ENABLE_JIT_OPTIMIZE_METHOD_CALLS 1
-#endif
-#ifndef ENABLE_JIT_OPTIMIZE_MOD
-#define ENABLE_JIT_OPTIMIZE_MOD 0
-#endif
+ #if CPU(ARM_TRADITIONAL)
+ #if !defined(ENABLE_JIT_USE_SOFT_MODULO) && WTF_ARM_ARCH_AT_LEAST(5)
+ #define ENABLE_JIT_USE_SOFT_MODULO 1
+ #endif
+ #endif
+
+ #if !defined(ENABLE_JIT_OPTIMIZE_NATIVE_CALL) && CPU(X86) && USE(JSVALUE32)
+ #define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 0
+ #endif
+
+ #ifndef ENABLE_JIT_OPTIMIZE_CALL
+ #define ENABLE_JIT_OPTIMIZE_CALL 1
+ #endif
+ #ifndef ENABLE_JIT_OPTIMIZE_NATIVE_CALL
+ #define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 1
+ #endif
+ #ifndef ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
+ #define ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS 1
+ #endif
+ #ifndef ENABLE_JIT_OPTIMIZE_METHOD_CALLS
+ #define ENABLE_JIT_OPTIMIZE_METHOD_CALLS 1
+ #endif
#endif
#if CPU(X86) && COMPILER(MSVC)
@@ -1026,25 +991,20 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */
#define JSC_HOST_CALL
#endif
+/* Configure the interpreter */
#if COMPILER(GCC)
#define HAVE_COMPUTED_GOTO 1
#endif
-
#if HAVE(COMPUTED_GOTO) && ENABLE(INTERPRETER)
#define ENABLE_COMPUTED_GOTO_INTERPRETER 1
#endif
-/* Yet Another Regex Runtime. */
-#if !defined(ENABLE_YARR_JIT)
-
-/* YARR and YARR_JIT is usually turned on for JIT enabled ports */
-#if ENABLE(JIT)
+/* Yet Another Regex Runtime - turned on by default for JIT enabled ports. */
+#if ENABLE(JIT) && !defined(ENABLE_YARR) && !defined(ENABLE_YARR_JIT)
#define ENABLE_YARR 1
#define ENABLE_YARR_JIT 1
#endif
-#endif /* !defined(ENABLE_YARR_JIT) */
-
/* Sanity Check */
#if ENABLE(YARR_JIT) && !ENABLE(YARR)
#error "YARR_JIT requires YARR"
@@ -1100,7 +1060,7 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */
/* FIXME: Defining ENABLE_3D_RENDERING here isn't really right, but it's always used with
with WTF_USE_ACCELERATED_COMPOSITING, and it allows the feature to be turned on and
off in one place. */
-#if PLATFORM(WIN)
+#if PLATFORM(WIN) && !OS(WINCE)
#include "QuartzCorePresent.h"
#if QUARTZCORE_PRESENT
#define WTF_USE_ACCELERATED_COMPOSITING 1
diff --git a/JavaScriptCore/wtf/TCSpinLock.h b/JavaScriptCore/wtf/TCSpinLock.h
index 8a73e13..240b497 100644
--- a/JavaScriptCore/wtf/TCSpinLock.h
+++ b/JavaScriptCore/wtf/TCSpinLock.h
@@ -1,4 +1,5 @@
// Copyright (c) 2005, 2006, Google Inc.
+// Copyright (c) 2010, Patrick Gansterer <paroga@paroga.com>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -189,6 +190,44 @@ static void TCMalloc_SlowLock(volatile unsigned int* lockword) {
}
}
+#elif OS(WINDOWS)
+
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+#include <windows.h>
+
+static void TCMalloc_SlowLock(LPLONG lockword);
+
+// The following is a struct so that it can be initialized at compile time
+struct TCMalloc_SpinLock {
+
+ inline void Lock() {
+ if (InterlockedExchange(&m_lockword, 1))
+ TCMalloc_SlowLock(&m_lockword);
+ }
+
+ inline void Unlock() {
+ InterlockedExchange(&m_lockword, 0);
+ }
+
+ inline bool IsHeld() const {
+ return m_lockword != 0;
+ }
+
+ inline void Init() { m_lockword = 0; }
+
+ LONG m_lockword;
+};
+
+#define SPINLOCK_INITIALIZER { 0 }
+
+static void TCMalloc_SlowLock(LPLONG lockword) {
+ Sleep(0); // Yield immediately since fast path failed
+ while (InterlockedExchange(lockword, 1))
+ Sleep(2);
+}
+
#else
#include <pthread.h>
diff --git a/JavaScriptCore/yarr/RegexInterpreter.cpp b/JavaScriptCore/yarr/RegexInterpreter.cpp
index 4fb5f92..d50c6c8 100644
--- a/JavaScriptCore/yarr/RegexInterpreter.cpp
+++ b/JavaScriptCore/yarr/RegexInterpreter.cpp
@@ -28,6 +28,7 @@
#include "RegexCompiler.h"
#include "RegexPattern.h"
+#include <wtf/BumpPointerAllocator.h>
#ifndef NDEBUG
#include <stdio.h>
@@ -104,12 +105,16 @@ public:
DisjunctionContext* allocDisjunctionContext(ByteDisjunction* disjunction)
{
- return new(malloc(sizeof(DisjunctionContext) + (disjunction->m_frameSize - 1) * sizeof(uintptr_t))) DisjunctionContext();
+ size_t size = sizeof(DisjunctionContext) - sizeof(uintptr_t) + disjunction->m_frameSize * sizeof(uintptr_t);
+ allocatorPool = allocatorPool->ensureCapacity(size);
+ if (!allocatorPool)
+ CRASH();
+ return new(allocatorPool->alloc(size)) DisjunctionContext();
}
void freeDisjunctionContext(DisjunctionContext* context)
{
- free(context);
+ allocatorPool = allocatorPool->dealloc(context);
}
struct ParenthesesDisjunctionContext
@@ -150,12 +155,16 @@ public:
ParenthesesDisjunctionContext* allocParenthesesDisjunctionContext(ByteDisjunction* disjunction, int* output, ByteTerm& term)
{
- return new(malloc(sizeof(ParenthesesDisjunctionContext) + (((term.atom.parenthesesDisjunction->m_numSubpatterns << 1) - 1) * sizeof(int)) + sizeof(DisjunctionContext) + (disjunction->m_frameSize - 1) * sizeof(uintptr_t))) ParenthesesDisjunctionContext(output, term);
+ size_t size = sizeof(ParenthesesDisjunctionContext) - sizeof(int) + (term.atom.parenthesesDisjunction->m_numSubpatterns << 1) * sizeof(int) + sizeof(DisjunctionContext) - sizeof(uintptr_t) + disjunction->m_frameSize * sizeof(uintptr_t);
+ allocatorPool = allocatorPool->ensureCapacity(size);
+ if (!allocatorPool)
+ CRASH();
+ return new(allocatorPool->alloc(size)) ParenthesesDisjunctionContext(output, term);
}
void freeParenthesesDisjunctionContext(ParenthesesDisjunctionContext* context)
{
- free(context);
+ allocatorPool = allocatorPool->dealloc(context);
}
class InputStream {
@@ -1190,6 +1199,10 @@ public:
int interpret()
{
+ allocatorPool = pattern->m_allocator->startAllocator();
+ if (!allocatorPool)
+ CRASH();
+
for (unsigned i = 0; i < ((pattern->m_body->m_numSubpatterns + 1) << 1); ++i)
output[i] = -1;
@@ -1202,6 +1215,8 @@ public:
freeDisjunctionContext(context);
+ pattern->m_allocator->stopAllocator();
+
return output[0];
}
@@ -1209,6 +1224,7 @@ public:
: pattern(pattern)
, output(output)
, input(inputChar, start, length)
+ , allocatorPool(0)
{
}
@@ -1216,6 +1232,7 @@ private:
BytecodePattern *pattern;
int* output;
InputStream input;
+ BumpPointerPool* allocatorPool;
};
@@ -1238,13 +1255,13 @@ public:
m_currentAlternativeIndex = 0;
}
- PassOwnPtr<BytecodePattern> compile()
+ PassOwnPtr<BytecodePattern> compile(BumpPointerAllocator* allocator)
{
regexBegin(m_pattern.m_numSubpatterns, m_pattern.m_body->m_callFrameSize);
emitDisjunction(m_pattern.m_body);
regexEnd();
- return adoptPtr(new BytecodePattern(m_bodyDisjunction.release(), m_allParenthesesInfo, m_pattern));
+ return adoptPtr(new BytecodePattern(m_bodyDisjunction.release(), m_allParenthesesInfo, m_pattern, allocator));
}
void checkInput(unsigned count)
@@ -1574,7 +1591,7 @@ private:
};
-PassOwnPtr<BytecodePattern> byteCompileRegex(const UString& patternString, unsigned& numSubpatterns, const char*& error, bool ignoreCase, bool multiline)
+PassOwnPtr<BytecodePattern> byteCompileRegex(const UString& patternString, unsigned& numSubpatterns, const char*& error, BumpPointerAllocator* allocator, bool ignoreCase, bool multiline)
{
RegexPattern pattern(ignoreCase, multiline);
@@ -1583,7 +1600,7 @@ PassOwnPtr<BytecodePattern> byteCompileRegex(const UString& patternString, unsig
numSubpatterns = pattern.m_numSubpatterns;
- return ByteCompiler(pattern).compile();
+ return ByteCompiler(pattern).compile(allocator);
}
int interpretRegex(BytecodePattern* regex, const UChar* input, unsigned start, unsigned length, int* output)
diff --git a/JavaScriptCore/yarr/RegexInterpreter.h b/JavaScriptCore/yarr/RegexInterpreter.h
index af63a7b..4da9cc5 100644
--- a/JavaScriptCore/yarr/RegexInterpreter.h
+++ b/JavaScriptCore/yarr/RegexInterpreter.h
@@ -33,6 +33,11 @@
#include <wtf/PassOwnPtr.h>
#include <wtf/unicode/Unicode.h>
+namespace WTF {
+class BumpPointerAllocator;
+}
+using WTF::BumpPointerAllocator;
+
namespace JSC { namespace Yarr {
class ByteDisjunction;
@@ -293,10 +298,11 @@ public:
};
struct BytecodePattern : FastAllocBase {
- BytecodePattern(PassOwnPtr<ByteDisjunction> body, Vector<ByteDisjunction*> allParenthesesInfo, RegexPattern& pattern)
+ BytecodePattern(PassOwnPtr<ByteDisjunction> body, Vector<ByteDisjunction*> allParenthesesInfo, RegexPattern& pattern, BumpPointerAllocator* allocator)
: m_body(body)
, m_ignoreCase(pattern.m_ignoreCase)
, m_multiline(pattern.m_multiline)
+ , m_allocator(allocator)
{
newlineCharacterClass = pattern.newlineCharacterClass();
wordcharCharacterClass = pattern.wordcharCharacterClass();
@@ -318,7 +324,10 @@ struct BytecodePattern : FastAllocBase {
OwnPtr<ByteDisjunction> m_body;
bool m_ignoreCase;
bool m_multiline;
-
+ // Each BytecodePattern is associated with a RegExp, each RegExp is associated
+ // with a JSGlobalData. Cache a pointer to out JSGlobalData's m_regexAllocator.
+ BumpPointerAllocator* m_allocator;
+
CharacterClass* newlineCharacterClass;
CharacterClass* wordcharCharacterClass;
private:
@@ -326,7 +335,7 @@ private:
Vector<CharacterClass*> m_userCharacterClasses;
};
-PassOwnPtr<BytecodePattern> byteCompileRegex(const UString& pattern, unsigned& numSubpatterns, const char*& error, bool ignoreCase = false, bool multiline = false);
+PassOwnPtr<BytecodePattern> byteCompileRegex(const UString& pattern, unsigned& numSubpatterns, const char*& error, BumpPointerAllocator*, bool ignoreCase = false, bool multiline = false);
int interpretRegex(BytecodePattern* v_regex, const UChar* input, unsigned start, unsigned length, int* output);
} } // namespace JSC::Yarr
diff --git a/JavaScriptGlue/ChangeLog b/JavaScriptGlue/ChangeLog
index 4dc0cf0..17aaffe 100644
--- a/JavaScriptGlue/ChangeLog
+++ b/JavaScriptGlue/ChangeLog
@@ -1,3 +1,23 @@
+2010-07-27 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Bug 42621 - Add a bump allocator for the YARR interpreter
+
+ The regex engine requires lifo allocation, however currently uses the general purpose
+ malloc/free memory allocation. A simple bump pointer allocator should provide a lower
+ overhead allocation solution.
+
+ * ForwardingHeaders/wtf/BumpPointerAllocator.h: Added.
+
+2010-07-26 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Bug 43009 - Abstract out page allocation from executable allocators
+
+ * ForwardingHeaders/wtf/PageAllocation.h: Added.
+
2010-07-01 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej Stachowiak.
diff --git a/JavaScriptGlue/Configurations/Version.xcconfig b/JavaScriptGlue/Configurations/Version.xcconfig
index 2749545..c1b6b32 100644
--- a/JavaScriptGlue/Configurations/Version.xcconfig
+++ b/JavaScriptGlue/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 534;
-MINOR_VERSION = 3;
+MINOR_VERSION = 4;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/JavaScriptGlue/ForwardingHeaders/wtf/BumpPointerAllocator.h b/JavaScriptGlue/ForwardingHeaders/wtf/BumpPointerAllocator.h
new file mode 100644
index 0000000..f685611
--- /dev/null
+++ b/JavaScriptGlue/ForwardingHeaders/wtf/BumpPointerAllocator.h
@@ -0,0 +1 @@
+#include <JavaScriptCore/BumpPointerAllocator.h>
diff --git a/JavaScriptGlue/ForwardingHeaders/wtf/PageAllocation.h b/JavaScriptGlue/ForwardingHeaders/wtf/PageAllocation.h
new file mode 100644
index 0000000..54dfcdf
--- /dev/null
+++ b/JavaScriptGlue/ForwardingHeaders/wtf/PageAllocation.h
@@ -0,0 +1 @@
+#include <JavaScriptCore/PageAllocation.h>
diff --git a/LayoutTests/fast/dom/DeviceOrientation/script-tests/window-property.js b/LayoutTests/fast/dom/DeviceOrientation/script-tests/window-property.js
index e7458b4..8e65059 100644
--- a/LayoutTests/fast/dom/DeviceOrientation/script-tests/window-property.js
+++ b/LayoutTests/fast/dom/DeviceOrientation/script-tests/window-property.js
@@ -9,7 +9,8 @@ function hasDeviceOrientationEventProperty()
return false;
}
-shouldBeTrue("typeof window.DeviceOrientationEvent == 'function'");
+shouldBeTrue("typeof window.DeviceOrientationEvent == 'object'");
+shouldBeFalse("typeof window.DeviceOrientationEvent == 'function'");
shouldBeTrue("hasDeviceOrientationEventProperty()");
shouldBeTrue("'DeviceOrientationEvent' in window");
shouldBeTrue("window.hasOwnProperty('DeviceOrientationEvent')");
@@ -26,6 +27,6 @@ function hasOnDeviceOrientationProperty()
shouldBeTrue("typeof window.ondeviceorientation == 'object'");
shouldBeTrue("hasOnDeviceOrientationProperty()");
shouldBeTrue("'ondeviceorientation' in window");
-shouldBeFalse("window.hasOwnProperty('ondeviceorientation')");
+shouldBeTrue("window.hasOwnProperty('ondeviceorientation')");
window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/DeviceOrientation/window-property-expected.txt b/LayoutTests/fast/dom/DeviceOrientation/window-property-expected.txt
index 95075a0..308ab7a 100644
--- a/LayoutTests/fast/dom/DeviceOrientation/window-property-expected.txt
+++ b/LayoutTests/fast/dom/DeviceOrientation/window-property-expected.txt
@@ -3,14 +3,15 @@ Tests that the window.DeviceOrientationEvent and window.ondeviceorientation prop
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS typeof window.DeviceOrientationEvent == 'function' is true
+PASS typeof window.DeviceOrientationEvent == 'object' is true
+PASS typeof window.DeviceOrientationEvent == 'function' is false
PASS hasDeviceOrientationEventProperty() is true
PASS 'DeviceOrientationEvent' in window is true
PASS window.hasOwnProperty('DeviceOrientationEvent') is true
PASS typeof window.ondeviceorientation == 'object' is true
PASS hasOnDeviceOrientationProperty() is true
PASS 'ondeviceorientation' in window is true
-PASS window.hasOwnProperty('ondeviceorientation') is false
+PASS window.hasOwnProperty('ondeviceorientation') is true
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/platform/android-v8/fast/dom/DeviceOrientation/window-property-expected.txt b/LayoutTests/platform/android-v8/fast/dom/DeviceOrientation/window-property-expected.txt
new file mode 100644
index 0000000..900c9ca
--- /dev/null
+++ b/LayoutTests/platform/android-v8/fast/dom/DeviceOrientation/window-property-expected.txt
@@ -0,0 +1,18 @@
+Tests that the window.DeviceOrientationEvent and window.ondeviceorientation properties are present.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+FAIL typeof window.DeviceOrientationEvent == 'object' should be true. Was false.
+FAIL typeof window.DeviceOrientationEvent == 'function' should be false. Was true.
+PASS hasDeviceOrientationEventProperty() is true
+PASS 'DeviceOrientationEvent' in window is true
+PASS window.hasOwnProperty('DeviceOrientationEvent') is true
+PASS typeof window.ondeviceorientation == 'object' is true
+PASS hasOnDeviceOrientationProperty() is true
+PASS 'ondeviceorientation' in window is true
+FAIL window.hasOwnProperty('ondeviceorientation') should be true. Was false.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/android/fast/text/hyphenate-character-expected.txt b/LayoutTests/platform/android/fast/text/hyphenate-character-expected.txt
new file mode 100644
index 0000000..1ed68b7
--- /dev/null
+++ b/LayoutTests/platform/android/fast/text/hyphenate-character-expected.txt
@@ -0,0 +1,118 @@
+layer at (0,0) size 356x1211
+ RenderView at (0,0) size 313x483
+layer at (0,0) size 356x1211
+ RenderBlock {HTML} at (0,0) size 313x483
+ RenderBody {BODY} at (8,8) size 297x467
+ RenderBlock (floating) {DIV} at (4,0) size 344x296
+ RenderBlock {P} at (0,16) size 344x19
+ RenderText {#text} at (0,0) size 227x19
+ text run at (0,0) width 227: "The initial value (should be like "
+ RenderInline {TT} at (0,0) size 32x15
+ RenderText {#text} at (227,4) size 32x15
+ text run at (227,4) width 32: "auto"
+ RenderText {#text} at (259,0) size 5x19
+ text run at (259,0) width 5: ")"
+ RenderBlock {DIV} at (0,51) size 344x245 [border: (3px solid #000000)]
+ RenderBlock (floating) {DIV} at (262,7) size 75x90 [bgcolor=#F0F8FF]
+ RenderText {#text} at (7,7) size 330x231
+ text run at (7,7) width 245: "The chief difficulty Alice"
+ text run at (7,28) width 245: "found at first was in manag"
+ text run at (7,49) width 79: "ing her "
+ text run at (86,49) width 166: "flamingo: she suc"
+ text run at (7,70) width 245: "ceeded in getting its body"
+ text run at (7,91) width 147: "tucked away, "
+ text run at (154,91) width 98: "comfortably"
+ text run at (7,112) width 330: "enough, under her arm, with its legs"
+ text run at (7,133) width 125: "hanging down, "
+ text run at (132,133) width 205: "but generally, just as she"
+ text run at (7,154) width 298: "had got its neck nicely straightened "
+ text run at (305,154) width 32: "out,"
+ text run at (7,175) width 330: "and was going to give the hedgehog a"
+ text run at (7,196) width 186: "blow with its head, it "
+ text run at (193,196) width 144: "would twist itself"
+ text run at (7,217) width 260: "round and look up in her face\x{2026}"
+ RenderBlock (floating) {DIV} at (4,296) size 344x296
+ RenderBlock {P} at (0,16) size 344x19
+ RenderText {#text} at (0,0) size 91x19
+ text run at (0,0) width 91: "The default ("
+ RenderInline {TT} at (0,0) size 198x15
+ RenderText {#text} at (91,4) size 198x15
+ text run at (91,4) width 198: "hyphenate-character: auto"
+ RenderText {#text} at (289,0) size 5x19
+ text run at (289,0) width 5: ")"
+ RenderBlock {DIV} at (0,51) size 344x245 [border: (3px solid #000000)]
+ RenderBlock (floating) {DIV} at (262,7) size 75x90 [bgcolor=#F0F8FF]
+ RenderText {#text} at (7,7) size 330x231
+ text run at (7,7) width 245: "The chief difficulty Alice"
+ text run at (7,28) width 245: "found at first was in manag"
+ text run at (7,49) width 79: "ing her "
+ text run at (86,49) width 166: "flamingo: she suc"
+ text run at (7,70) width 245: "ceeded in getting its body"
+ text run at (7,91) width 147: "tucked away, "
+ text run at (154,91) width 98: "comfortably"
+ text run at (7,112) width 330: "enough, under her arm, with its legs"
+ text run at (7,133) width 125: "hanging down, "
+ text run at (132,133) width 205: "but generally, just as she"
+ text run at (7,154) width 298: "had got its neck nicely straightened "
+ text run at (305,154) width 32: "out,"
+ text run at (7,175) width 330: "and was going to give the hedgehog a"
+ text run at (7,196) width 186: "blow with its head, it "
+ text run at (193,196) width 144: "would twist itself"
+ text run at (7,217) width 260: "round and look up in her face\x{2026}"
+ RenderBlock (floating) {DIV} at (4,592) size 344x296
+ RenderBlock {P} at (0,16) size 344x19
+ RenderText {#text} at (0,0) size 51x19
+ text run at (0,0) width 51: "Bullet ("
+ RenderInline {TT} at (0,0) size 221x15
+ RenderText {#text} at (51,4) size 221x15
+ text run at (51,4) width 221: "hyphenate-character: \"\\2022\""
+ RenderText {#text} at (272,0) size 5x19
+ text run at (272,0) width 5: ")"
+ RenderBlock {DIV} at (0,51) size 344x245 [border: (3px solid #000000)]
+ RenderBlock (floating) {DIV} at (262,7) size 75x90 [bgcolor=#F0F8FF]
+ RenderText {#text} at (7,7) size 330x231
+ text run at (7,7) width 245: "The chief difficulty Alice"
+ text run at (7,28) width 245: "found at first was in manag"
+ text run at (7,49) width 78: "ing her "
+ text run at (85,49) width 167: "flamingo: she suc"
+ text run at (7,70) width 245: "ceeded in getting its body"
+ text run at (7,91) width 147: "tucked away, "
+ text run at (154,91) width 98: "comfortably"
+ text run at (7,112) width 330: "enough, under her arm, with its legs"
+ text run at (7,133) width 125: "hanging down, "
+ text run at (132,133) width 205: "but generally, just as she"
+ text run at (7,154) width 298: "had got its neck nicely straightened "
+ text run at (305,154) width 32: "out,"
+ text run at (7,175) width 330: "and was going to give the hedgehog a"
+ text run at (7,196) width 186: "blow with its head, it "
+ text run at (193,196) width 144: "would twist itself"
+ text run at (7,217) width 260: "round and look up in her face\x{2026}"
+ RenderBlock (floating) {DIV} at (4,888) size 344x315
+ RenderBlock {P} at (0,16) size 344x38
+ RenderText {#text} at (0,0) size 156x19
+ text run at (0,0) width 156: "Middle dot and tilde ("
+ RenderInline {TT} at (0,0) size 314x34
+ RenderText {#text} at (156,4) size 314x34
+ text run at (156,4) width 158: "hyphenate-character:"
+ text run at (0,23) width 47: "\"\\B7~\""
+ RenderText {#text} at (47,19) size 5x19
+ text run at (47,19) width 5: ")"
+ RenderBlock {DIV} at (0,70) size 344x245 [border: (3px solid #000000)]
+ RenderBlock (floating) {DIV} at (262,7) size 75x90 [bgcolor=#F0F8FF]
+ RenderText {#text} at (7,7) size 330x231
+ text run at (7,7) width 245: "The chief difficulty Alice"
+ text run at (7,28) width 245: "found at first was in manag"
+ text run at (7,49) width 74: "ing her "
+ text run at (81,49) width 171: "flamingo: she suc"
+ text run at (7,70) width 245: "ceeded in getting its body"
+ text run at (7,91) width 147: "tucked away, "
+ text run at (154,91) width 98: "comfortably"
+ text run at (7,112) width 330: "enough, under her arm, with its legs"
+ text run at (7,133) width 125: "hanging down, "
+ text run at (132,133) width 205: "but generally, just as she"
+ text run at (7,154) width 298: "had got its neck nicely straightened "
+ text run at (305,154) width 32: "out,"
+ text run at (7,175) width 330: "and was going to give the hedgehog a"
+ text run at (7,196) width 186: "blow with its head, it "
+ text run at (193,196) width 144: "would twist itself"
+ text run at (7,217) width 260: "round and look up in her face\x{2026}"
diff --git a/LayoutTests/platform/android/fast/text/hyphens-expected.txt b/LayoutTests/platform/android/fast/text/hyphens-expected.txt
new file mode 100644
index 0000000..e68f861
--- /dev/null
+++ b/LayoutTests/platform/android/fast/text/hyphens-expected.txt
@@ -0,0 +1,115 @@
+layer at (0,0) size 356x1213
+ RenderView at (0,0) size 313x483
+layer at (0,0) size 356x1213
+ RenderBlock {HTML} at (0,0) size 313x483
+ RenderBody {BODY} at (8,8) size 297x467
+ RenderBlock (floating) {DIV} at (4,0) size 344x296
+ RenderBlock {P} at (0,16) size 344x19
+ RenderInline {TT} at (0,0) size 118x15
+ RenderText {#text} at (0,4) size 118x15
+ text run at (0,4) width 118: "hyphens: manual"
+ RenderText {#text} at (118,0) size 157x19
+ text run at (118,0) width 157: " without soft hyphens"
+ RenderBlock {DIV} at (0,51) size 344x245 [border: (3px solid #000000)]
+ RenderBlock (floating) {DIV} at (262,7) size 75x90 [bgcolor=#F0F8FF]
+ RenderText {#text} at (7,7) size 330x231
+ text run at (7,7) width 245: "The chief difficulty Alice"
+ text run at (7,28) width 245: "found at first was in"
+ text run at (7,49) width 128: "managing her "
+ text run at (135,49) width 117: "flamingo: she"
+ text run at (7,70) width 245: "succeeded in getting its body"
+ text run at (7,91) width 147: "tucked away, "
+ text run at (154,91) width 98: "comfortably"
+ text run at (7,112) width 330: "enough, under her arm, with its legs"
+ text run at (7,133) width 125: "hanging down, "
+ text run at (132,133) width 205: "but generally, just as she"
+ text run at (7,154) width 298: "had got its neck nicely straightened "
+ text run at (305,154) width 32: "out,"
+ text run at (7,175) width 330: "and was going to give the hedgehog a"
+ text run at (7,196) width 186: "blow with its head, it "
+ text run at (193,196) width 144: "would twist itself"
+ text run at (7,217) width 260: "round and look up in her face\x{2026}"
+ RenderBlock (floating) {DIV} at (4,296) size 344x317
+ RenderBlock {P} at (0,16) size 344x19
+ RenderInline {TT} at (0,0) size 103x15
+ RenderText {#text} at (0,4) size 103x15
+ text run at (0,4) width 103: "hyphens: none"
+ RenderText {#text} at (103,0) size 133x19
+ text run at (103,0) width 133: " with soft hyphens"
+ RenderBlock {DIV} at (0,51) size 344x266 [border: (3px solid #000000)]
+ RenderBlock (floating) {DIV} at (262,7) size 75x90 [bgcolor=#F0F8FF]
+ RenderText {#text} at (7,7) size 330x252
+ text run at (7,7) width 245: "The chief difficulty Alice"
+ text run at (7,28) width 245: "found at first was in"
+ text run at (7,49) width 128: "managing her "
+ text run at (135,49) width 117: "flamingo: she"
+ text run at (7,70) width 141: "succeeded in get"
+ text run at (148,70) width 104: "ting its body"
+ text run at (7,91) width 181: "tucked away, com"
+ text run at (188,91) width 64: "fortably"
+ text run at (7,112) width 330: "enough, under her arm, with its legs"
+ text run at (7,133) width 125: "hanging down, "
+ text run at (132,133) width 205: "but generally, just as she"
+ text run at (7,154) width 289: "had got its neck nicely straight"
+ text run at (296,154) width 41: "ened"
+ text run at (7,175) width 330: "out, and was going to give the"
+ text run at (7,196) width 50: "hedge"
+ text run at (57,196) width 280: "hog a blow with its head, it"
+ text run at (7,217) width 330: "would twist itself round and look up in"
+ text run at (7,238) width 81: "her face\x{2026}"
+ RenderBlock (floating) {DIV} at (4,613) size 344x296
+ RenderBlock {P} at (0,16) size 344x19
+ RenderInline {TT} at (0,0) size 118x15
+ RenderText {#text} at (0,4) size 118x15
+ text run at (0,4) width 118: "hyphens: manual"
+ RenderText {#text} at (118,0) size 133x19
+ text run at (118,0) width 133: " with soft hyphens"
+ RenderBlock {DIV} at (0,51) size 344x245 [border: (3px solid #000000)]
+ RenderBlock (floating) {DIV} at (262,7) size 75x90 [bgcolor=#F0F8FF]
+ RenderText {#text} at (7,7) size 330x231
+ text run at (7,7) width 245: "The chief difficulty Alice"
+ text run at (7,28) width 245: "found at first was in"
+ text run at (7,49) width 128: "managing her "
+ text run at (135,49) width 117: "flamingo: she"
+ text run at (7,70) width 141: "succeeded in get"
+ text run at (148,70) width 104: "ting its body"
+ text run at (7,91) width 146: "tucked away, "
+ text run at (153,91) width 35: "com"
+ text run at (188,91) width 64: "fortably"
+ text run at (7,112) width 330: "enough, under her arm, with its legs"
+ text run at (7,133) width 125: "hanging down, "
+ text run at (132,133) width 205: "but generally, just as she"
+ text run at (7,154) width 251: "had got its neck nicely straight"
+ text run at (258,154) width 47: "ened "
+ text run at (305,154) width 32: "out,"
+ text run at (7,175) width 281: "and was going to give the hedge"
+ text run at (288,175) width 49: "hog a"
+ text run at (7,196) width 186: "blow with its head, it "
+ text run at (193,196) width 144: "would twist itself"
+ text run at (7,217) width 260: "round and look up in her face\x{2026}"
+ RenderBlock (floating) {DIV} at (4,909) size 344x296
+ RenderBlock {P} at (0,16) size 344x19
+ RenderInline {TT} at (0,0) size 103x15
+ RenderText {#text} at (0,4) size 103x15
+ text run at (0,4) width 103: "hyphens: auto"
+ RenderText {#text} at (103,0) size 157x19
+ text run at (103,0) width 157: " without soft hyphens"
+ RenderBlock {DIV} at (0,51) size 344x245 [border: (3px solid #000000)]
+ RenderBlock (floating) {DIV} at (262,7) size 75x90 [bgcolor=#F0F8FF]
+ RenderText {#text} at (7,7) size 330x231
+ text run at (7,7) width 245: "The chief difficulty Alice"
+ text run at (7,28) width 245: "found at first was in manag"
+ text run at (7,49) width 79: "ing her "
+ text run at (86,49) width 166: "flamingo: she suc"
+ text run at (7,70) width 245: "ceeded in getting its body"
+ text run at (7,91) width 147: "tucked away, "
+ text run at (154,91) width 98: "comfortably"
+ text run at (7,112) width 330: "enough, under her arm, with its legs"
+ text run at (7,133) width 125: "hanging down, "
+ text run at (132,133) width 205: "but generally, just as she"
+ text run at (7,154) width 298: "had got its neck nicely straightened "
+ text run at (305,154) width 32: "out,"
+ text run at (7,175) width 330: "and was going to give the hedgehog a"
+ text run at (7,196) width 186: "blow with its head, it "
+ text run at (193,196) width 144: "would twist itself"
+ text run at (7,217) width 260: "round and look up in her face\x{2026}"
diff --git a/LayoutTests/storage/change-version.html b/LayoutTests/storage/change-version.html
index 9b6876c..79bb9df 100644
--- a/LayoutTests/storage/change-version.html
+++ b/LayoutTests/storage/change-version.html
@@ -44,6 +44,10 @@ function runTest()
if (window.location.search == "?2") {
db1 = window.openDatabase("changeversion-test", "", "Test for the database.changeVersion() function", 1024);
log("Finished tests with version " + db1.version + "; expected version: " + EXPECTED_VERSION_AFTER_RELOAD);
+
+ // Reset the DB version or the next run might fail.
+ db1.changeVersion(db1.version, "1");
+
finishTest();
} else
testPart1();
@@ -60,7 +64,7 @@ function testPart1() {
var db2 = window.openDatabase("changeversion-test", "1", "Test for the database.changeVersion() function", 1024);
// First run Hixie's test to ensure basic changeVersion functionality works (see bug 28418).
- db1.changeVersion("1", EXPECTED_VERSION_AFTER_HIXIE_TEST, emptyFunction, function (e) {
+ db1.changeVersion("1", EXPECTED_VERSION_AFTER_HIXIE_TEST, null, function (e) {
log("FAIL in changeVersion:" + e);
finishTest();
}, function () {
diff --git a/LayoutTests/storage/indexeddb/indexed-database-request-expected.txt b/LayoutTests/storage/indexeddb/basics-expected.txt
index 1734ff9..5365901 100644
--- a/LayoutTests/storage/indexeddb/indexed-database-request-expected.txt
+++ b/LayoutTests/storage/indexeddb/basics-expected.txt
@@ -1,4 +1,4 @@
-Test IndexedDB's IndexedDatabaseRequest.
+Test IndexedDB's basics.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/LayoutTests/storage/indexeddb/idb-keyrange.html b/LayoutTests/storage/indexeddb/basics.html
index 800a8cc..24af453 100644
--- a/LayoutTests/storage/indexeddb/idb-keyrange.html
+++ b/LayoutTests/storage/indexeddb/basics.html
@@ -8,6 +8,6 @@
<body>
<p id="description"></p>
<div id="console"></div>
-<script src="script-tests/idb-keyrange.js"></script>
+<script src="script-tests/basics.js"></script>
</body>
</html>
diff --git a/LayoutTests/storage/indexeddb/idb-database-request-expected.txt b/LayoutTests/storage/indexeddb/database-basics-expected.txt
index 2651dd8..ea869e0 100644
--- a/LayoutTests/storage/indexeddb/idb-database-request-expected.txt
+++ b/LayoutTests/storage/indexeddb/database-basics-expected.txt
@@ -1,4 +1,4 @@
-Test IndexedDB's IDBDatabaseRequest.
+Test the basics of IndexedDB's IDBDatabase.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/LayoutTests/storage/indexeddb/idb-database-request.html b/LayoutTests/storage/indexeddb/database-basics.html
index 3ea2893..9c92194 100644
--- a/LayoutTests/storage/indexeddb/idb-database-request.html
+++ b/LayoutTests/storage/indexeddb/database-basics.html
@@ -8,6 +8,6 @@
<body>
<p id="description"></p>
<div id="console"></div>
-<script src="script-tests/idb-database-request.js"></script>
+<script src="script-tests/database-basics.js"></script>
</body>
</html>
diff --git a/LayoutTests/storage/indexeddb/idb-keyrange-expected.txt b/LayoutTests/storage/indexeddb/keyrange-expected.txt
index 316a97b..fc61b2f 100644
--- a/LayoutTests/storage/indexeddb/idb-keyrange-expected.txt
+++ b/LayoutTests/storage/indexeddb/keyrange-expected.txt
@@ -3,113 +3,113 @@ Test IndexedDB's KeyRange.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-indexedDB.makeSingleKeyRange(1)
+IDBKeyRange.only(1)
PASS keyRange.left is 1
PASS keyRange.right is 1
PASS keyRange.flags is keyRange.SINGLE
-indexedDB.makeSingleKeyRange('a')
+IDBKeyRange.only('a')
PASS keyRange.left is 'a'
PASS keyRange.right is 'a'
PASS keyRange.flags is keyRange.SINGLE
-indexedDB.makeLeftBoundKeyRange(10,true)
+IDBKeyRange.leftBound(10,true)
PASS keyRange.left is 10
PASS keyRange.right is null
PASS keyRange.flags is keyRange.LEFT_OPEN
-indexedDB.makeLeftBoundKeyRange(11,false)
+IDBKeyRange.leftBound(11,false)
PASS keyRange.left is 11
PASS keyRange.right is null
PASS keyRange.flags is keyRange.LEFT_BOUND
-indexedDB.makeLeftBoundKeyRange(12,undefined)
+IDBKeyRange.leftBound(12,undefined)
PASS keyRange.left is 12
PASS keyRange.right is null
PASS keyRange.flags is keyRange.LEFT_BOUND
-indexedDB.makeLeftBoundKeyRange('aa',true)
+IDBKeyRange.leftBound('aa',true)
PASS keyRange.left is 'aa'
PASS keyRange.right is null
PASS keyRange.flags is keyRange.LEFT_OPEN
-indexedDB.makeLeftBoundKeyRange('ab',false)
+IDBKeyRange.leftBound('ab',false)
PASS keyRange.left is 'ab'
PASS keyRange.right is null
PASS keyRange.flags is keyRange.LEFT_BOUND
-indexedDB.makeLeftBoundKeyRange('ac',undefined)
+IDBKeyRange.leftBound('ac',undefined)
PASS keyRange.left is 'ac'
PASS keyRange.right is null
PASS keyRange.flags is keyRange.LEFT_BOUND
-indexedDB.makeRightBoundKeyRange(20,true)
+IDBKeyRange.rightBound(20,true)
PASS keyRange.right is 20
PASS keyRange.left is null
PASS keyRange.flags is keyRange.RIGHT_OPEN
-indexedDB.makeRightBoundKeyRange(21,false)
+IDBKeyRange.rightBound(21,false)
PASS keyRange.right is 21
PASS keyRange.left is null
PASS keyRange.flags is keyRange.RIGHT_BOUND
-indexedDB.makeRightBoundKeyRange(22,undefined)
+IDBKeyRange.rightBound(22,undefined)
PASS keyRange.right is 22
PASS keyRange.left is null
PASS keyRange.flags is keyRange.RIGHT_BOUND
-indexedDB.makeRightBoundKeyRange('ba',true)
+IDBKeyRange.rightBound('ba',true)
PASS keyRange.right is 'ba'
PASS keyRange.left is null
PASS keyRange.flags is keyRange.RIGHT_OPEN
-indexedDB.makeRightBoundKeyRange('bb',false)
+IDBKeyRange.rightBound('bb',false)
PASS keyRange.right is 'bb'
PASS keyRange.left is null
PASS keyRange.flags is keyRange.RIGHT_BOUND
-indexedDB.makeRightBoundKeyRange('bc',undefined)
+IDBKeyRange.rightBound('bc',undefined)
PASS keyRange.right is 'bc'
PASS keyRange.left is null
PASS keyRange.flags is keyRange.RIGHT_BOUND
-indexedDB.makeBoundKeyRange(30,40,undefined,undefined)
+IDBKeyRange.bound(30,40,undefined,undefined)
PASS keyRange.left is 30
PASS keyRange.right is 40
PASS leftFlags is keyRange.LEFT_BOUND
PASS rightFlags is keyRange.RIGHT_BOUND
-indexedDB.makeBoundKeyRange(31,41,false,false)
+IDBKeyRange.bound(31,41,false,false)
PASS keyRange.left is 31
PASS keyRange.right is 41
PASS leftFlags is keyRange.LEFT_BOUND
PASS rightFlags is keyRange.RIGHT_BOUND
-indexedDB.makeBoundKeyRange(32,42,false,true)
+IDBKeyRange.bound(32,42,false,true)
PASS keyRange.left is 32
PASS keyRange.right is 42
PASS leftFlags is keyRange.LEFT_BOUND
PASS rightFlags is keyRange.RIGHT_OPEN
-indexedDB.makeBoundKeyRange(33,43,true,false)
+IDBKeyRange.bound(33,43,true,false)
PASS keyRange.left is 33
PASS keyRange.right is 43
PASS leftFlags is keyRange.LEFT_OPEN
PASS rightFlags is keyRange.RIGHT_BOUND
-indexedDB.makeBoundKeyRange(34,44,true,true)
+IDBKeyRange.bound(34,44,true,true)
PASS keyRange.left is 34
PASS keyRange.right is 44
PASS leftFlags is keyRange.LEFT_OPEN
PASS rightFlags is keyRange.RIGHT_OPEN
-indexedDB.makeBoundKeyRange('aaa','aba',false,false)
+IDBKeyRange.bound('aaa','aba',false,false)
PASS keyRange.left is 'aaa'
PASS keyRange.right is 'aba'
PASS leftFlags is keyRange.LEFT_BOUND
PASS rightFlags is keyRange.RIGHT_BOUND
-indexedDB.makeBoundKeyRange('aab','abb',undefined,undefined)
+IDBKeyRange.bound('aab','abb',undefined,undefined)
PASS keyRange.left is 'aab'
PASS keyRange.right is 'abb'
PASS leftFlags is keyRange.LEFT_BOUND
PASS rightFlags is keyRange.RIGHT_BOUND
-indexedDB.makeBoundKeyRange('aac','abc',false,false)
+IDBKeyRange.bound('aac','abc',false,false)
PASS keyRange.left is 'aac'
PASS keyRange.right is 'abc'
PASS leftFlags is keyRange.LEFT_BOUND
PASS rightFlags is keyRange.RIGHT_BOUND
-indexedDB.makeBoundKeyRange('aad','abd',false,true)
+IDBKeyRange.bound('aad','abd',false,true)
PASS keyRange.left is 'aad'
PASS keyRange.right is 'abd'
PASS leftFlags is keyRange.LEFT_BOUND
PASS rightFlags is keyRange.RIGHT_OPEN
-indexedDB.makeBoundKeyRange('aae','abe',true,false)
+IDBKeyRange.bound('aae','abe',true,false)
PASS keyRange.left is 'aae'
PASS keyRange.right is 'abe'
PASS leftFlags is keyRange.LEFT_OPEN
PASS rightFlags is keyRange.RIGHT_BOUND
-indexedDB.makeBoundKeyRange('aaf','abf',true,true)
+IDBKeyRange.bound('aaf','abf',true,true)
PASS keyRange.left is 'aaf'
PASS keyRange.right is 'abf'
PASS leftFlags is keyRange.LEFT_OPEN
diff --git a/LayoutTests/storage/indexeddb/idb-objectstore-request.html b/LayoutTests/storage/indexeddb/keyrange.html
index 87c34ea..d4ef58e 100644
--- a/LayoutTests/storage/indexeddb/idb-objectstore-request.html
+++ b/LayoutTests/storage/indexeddb/keyrange.html
@@ -8,6 +8,6 @@
<body>
<p id="description"></p>
<div id="console"></div>
-<script src="script-tests/idb-objectstore-request.js"></script>
+<script src="script-tests/keyrange.js"></script>
</body>
</html>
diff --git a/LayoutTests/storage/indexeddb/idb-objectstore-request-expected.txt b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
index 30bac34..105058d 100644
--- a/LayoutTests/storage/indexeddb/idb-objectstore-request-expected.txt
+++ b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
@@ -1,4 +1,4 @@
-Test IndexedDB's IDBObjectStoreRequest.
+Test the basics of IndexedDB's IDBObjectStore.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
@@ -45,8 +45,11 @@ PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
store = event.result
+storeNames = db.objectStores
PASS store.name is "storeName"
PASS store.keyPath is null
+PASS storeNames.contains('storeName') is true
+PASS storeNames.length is 1
store.add('value', 'key')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
@@ -115,4 +118,3 @@ PASS event.result is null
PASS successfullyParsed is true
TEST COMPLETE
-
diff --git a/LayoutTests/storage/indexeddb/indexed-database-request.html b/LayoutTests/storage/indexeddb/objectstore-basics.html
index c22934b..09eb68c 100644
--- a/LayoutTests/storage/indexeddb/indexed-database-request.html
+++ b/LayoutTests/storage/indexeddb/objectstore-basics.html
@@ -8,6 +8,6 @@
<body>
<p id="description"></p>
<div id="console"></div>
-<script src="script-tests/indexed-database-request.js"></script>
+<script src="script-tests/objectstore-basics.js"></script>
</body>
</html>
diff --git a/LayoutTests/storage/indexeddb/resources/shared.js b/LayoutTests/storage/indexeddb/resources/shared.js
index 809bdec..e510be1 100644
--- a/LayoutTests/storage/indexeddb/resources/shared.js
+++ b/LayoutTests/storage/indexeddb/resources/shared.js
@@ -1,6 +1,5 @@
function done()
{
- window.successfullyParsed = true;
isSuccessfullyParsed();
if (window.layoutTestController)
layoutTestController.notifyDone()
diff --git a/LayoutTests/storage/indexeddb/script-tests/indexed-database-request.js b/LayoutTests/storage/indexeddb/script-tests/basics.js
index 6f77279..cebd48f 100644
--- a/LayoutTests/storage/indexeddb/script-tests/indexed-database-request.js
+++ b/LayoutTests/storage/indexeddb/script-tests/basics.js
@@ -1,5 +1,5 @@
-description("Test IndexedDB's IndexedDatabaseRequest.");
-if (window.layoutTestController)
+description("Test IndexedDB's basics.");
+if (window.layoutTestController)
layoutTestController.waitUntilDone();
function openCallback()
@@ -22,3 +22,5 @@ function test()
}
test();
+
+var successfullyParsed = true;
diff --git a/LayoutTests/storage/indexeddb/script-tests/idb-database-request.js b/LayoutTests/storage/indexeddb/script-tests/database-basics.js
index ae6a563..a317b71 100644
--- a/LayoutTests/storage/indexeddb/script-tests/idb-database-request.js
+++ b/LayoutTests/storage/indexeddb/script-tests/database-basics.js
@@ -1,4 +1,4 @@
-description("Test IndexedDB's IDBDatabaseRequest.");
+description("Test the basics of IndexedDB's IDBDatabase.");
if (window.layoutTestController)
layoutTestController.waitUntilDone();
@@ -29,3 +29,5 @@ function test()
}
test();
+
+var successfullyParsed = true;
diff --git a/LayoutTests/storage/indexeddb/script-tests/idb-keyrange.js b/LayoutTests/storage/indexeddb/script-tests/keyrange.js
index 2951876..26d283f 100644
--- a/LayoutTests/storage/indexeddb/script-tests/idb-keyrange.js
+++ b/LayoutTests/storage/indexeddb/script-tests/keyrange.js
@@ -4,7 +4,7 @@ if (window.layoutTestController)
function checkSingleKeyRange(value)
{
- keyRange = evalAndLog("indexedDB.makeSingleKeyRange(" + value + ")");
+ keyRange = evalAndLog("IDBKeyRange.only(" + value + ")");
shouldBe("keyRange.left", "" + value);
shouldBe("keyRange.right", "" + value);
shouldBe("keyRange.flags", "keyRange.SINGLE");
@@ -12,7 +12,7 @@ function checkSingleKeyRange(value)
function checkLeftBoundKeyRange(value, open)
{
- keyRange = evalAndLog("indexedDB.makeLeftBoundKeyRange(" + value + "," + open + ")");
+ keyRange = evalAndLog("IDBKeyRange.leftBound(" + value + "," + open + ")");
shouldBe("keyRange.left", "" + value);
shouldBeNull("keyRange.right");
shouldBe("keyRange.flags", open ? "keyRange.LEFT_OPEN" : "keyRange.LEFT_BOUND");
@@ -20,7 +20,7 @@ function checkLeftBoundKeyRange(value, open)
function checkRightBoundKeyRange(value, open)
{
- keyRange = evalAndLog("indexedDB.makeRightBoundKeyRange(" + value + "," + open + ")");
+ keyRange = evalAndLog("IDBKeyRange.rightBound(" + value + "," + open + ")");
shouldBe("keyRange.right", "" + value);
shouldBeNull("keyRange.left");
shouldBe("keyRange.flags", open ? "keyRange.RIGHT_OPEN" : "keyRange.RIGHT_BOUND");
@@ -28,7 +28,7 @@ function checkRightBoundKeyRange(value, open)
function checkBoundKeyRange(left, right, openLeft, openRight)
{
- keyRange = evalAndLog("indexedDB.makeBoundKeyRange(" + left + "," + right + "," + openLeft + "," + openRight + ")");
+ keyRange = evalAndLog("IDBKeyRange.bound(" + left + "," + right + "," + openLeft + "," + openRight + ")");
shouldBe("keyRange.left", "" + left);
shouldBe("keyRange.right", "" + right);
leftFlags = keyRange.flags & (keyRange.LEFT_OPEN | keyRange.LEFT_BOUND);
@@ -68,8 +68,9 @@ function test()
checkBoundKeyRange("'aad'", "'abd'", false, true);
checkBoundKeyRange("'aae'", "'abe'", true, false);
checkBoundKeyRange("'aaf'", "'abf'", true, true);
-
- done();
}
test();
+
+var successfullyParsed = true;
+done();
diff --git a/LayoutTests/storage/indexeddb/script-tests/idb-objectstore-request.js b/LayoutTests/storage/indexeddb/script-tests/objectstore-basics.js
index 045db12..9869579 100644
--- a/LayoutTests/storage/indexeddb/script-tests/idb-objectstore-request.js
+++ b/LayoutTests/storage/indexeddb/script-tests/objectstore-basics.js
@@ -1,4 +1,4 @@
-description("Test IndexedDB's IDBObjectStoreRequest.");
+description("Test the basics of IndexedDB's IDBObjectStore.");
if (window.layoutTestController)
layoutTestController.waitUntilDone();
@@ -14,7 +14,7 @@ function openSuccess()
{
debug("openSuccess():");
verifySuccessEvent(event);
- var db = evalAndLog("db = event.result");
+ db = evalAndLog("db = event.result");
// FIXME: remove any previously created object stores.
// This requires IDBDatabaseRequest::removeObjectStore to be implemented.
@@ -30,9 +30,12 @@ function createSuccess()
debug("createSuccess():");
verifySuccessEvent(event);
var store = evalAndLog("store = event.result");
+ var storeNames = evalAndLog("storeNames = db.objectStores");
shouldBeEqualToString("store.name", "storeName");
shouldBeNull("store.keyPath");
+ shouldBe("storeNames.contains('storeName')", "true");
+ shouldBe("storeNames.length", "1");
// FIXME: test store.indexNames, as well as all object store's methods.
result = evalAndLog("store.add('value', 'key')");
@@ -76,3 +79,5 @@ function removeSuccess()
}
test();
+
+var successfullyParsed = true;
diff --git a/WebCore/Android.derived.v8bindings.mk b/WebCore/Android.derived.v8bindings.mk
index 6072766..bca703f 100644
--- a/WebCore/Android.derived.v8bindings.mk
+++ b/WebCore/Android.derived.v8bindings.mk
@@ -612,10 +612,14 @@ $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/bindings/%.cpp : $(intermediates)
# These headers are required by the V8 bindings even when Inspector is disabled
GEN := \
$(intermediates)/bindings/V8InjectedScriptHost.h \
+<<<<<<< HEAD
$(intermediates)/bindings/V8Inspector.h \
$(intermediates)/bindings/V8InspectorBackend.h \
$(intermediates)/bindings/V8InspectorFrontendHost.h \
$(intermediates)/bindings/V8ScriptProfile.h
+=======
+ $(intermediates)/bindings/V8InspectorFrontendHost.h
+>>>>>>> webkit.org at r64264
$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
$(GEN): PRIVATE_CUSTOM_TOOL = SOURCE_ROOT=$(PRIVATE_PATH) perl -I$(PRIVATE_PATH)/bindings/scripts $(PRIVATE_PATH)/bindings/scripts/generate-bindings.pl --defines "$(FEATURE_DEFINES) LANGUAGE_JAVASCRIPT" --generator V8 --include dom --include html --outputdir $(dir $@) $<
diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index 641c0f9..d43fabc 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -701,6 +701,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
rendering/RenderSVGModelObject.cpp \
rendering/RenderSVGResource.cpp \
rendering/RenderSVGResourceClipper.cpp \
+ rendering/RenderSVGResourceContainer.cpp \
rendering/RenderSVGResourceFilter.cpp \
rendering/RenderSVGResourceGradient.cpp \
rendering/RenderSVGResourceLinearGradient.cpp \
@@ -750,6 +751,9 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
rendering/SVGMarkerLayoutInfo.cpp \
rendering/SVGRenderSupport.cpp \
rendering/SVGRenderTreeAsText.cpp \
+ rendering/SVGResources.cpp \
+ rendering/SVGResourcesCache.cpp \
+ rendering/SVGResourcesCycleSolver.cpp \
rendering/SVGRootInlineBox.cpp \
rendering/SVGShadowTreeElements.cpp \
rendering/SVGTextChunkLayoutInfo.cpp \
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index 7919317..a0f5123 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -293,7 +293,6 @@ SET(WebCore_IDL_FILES
html/canvas/Uint8Array.idl
inspector/InjectedScriptHost.idl
- inspector/InspectorBackend.idl
inspector/InspectorFrontendHost.idl
inspector/JavaScriptCallFrame.idl
inspector/ScriptProfile.idl
@@ -535,6 +534,7 @@ SET(WebCore_SOURCES
${DERIVED_SOURCES_DIR}/XMLNames.cpp
${DERIVED_SOURCES_DIR}/XMLNSNames.cpp
${DERIVED_SOURCES_DIR}/XPathGrammar.cpp
+ ${DERIVED_SOURCES_DIR}/InspectorBackendDispatcher.cpp
accessibility/AXObjectCache.cpp
accessibility/AccessibilityARIAGrid.cpp
@@ -854,6 +854,7 @@ SET(WebCore_SOURCES
dom/UIEvent.cpp
dom/UIEventWithKeyState.cpp
dom/UserGestureIndicator.cpp
+ dom/UserTypingGestureIndicator.cpp
dom/ViewportArguments.cpp
dom/WebKitAnimationEvent.cpp
dom/WebKitTransitionEvent.cpp
@@ -1201,6 +1202,7 @@ SET(WebCore_SOURCES
platform/ScrollbarThemeComposite.cpp
platform/ScrollView.cpp
platform/SharedBuffer.cpp
+ platform/SchemeRegistry.cpp
platform/ThreadGlobalData.cpp
platform/ThreadTimers.cpp
platform/Timer.cpp
@@ -1543,6 +1545,7 @@ IF (ENABLE_SVG)
rendering/RenderSVGModelObject.cpp
rendering/RenderSVGResource.cpp
rendering/RenderSVGResourceClipper.cpp
+ rendering/RenderSVGResourceContainer.cpp
rendering/RenderSVGResourceFilter.cpp
rendering/RenderSVGResourceGradient.cpp
rendering/RenderSVGResourceLinearGradient.cpp
@@ -1565,6 +1568,9 @@ IF (ENABLE_SVG)
rendering/SVGMarkerLayoutInfo.cpp
rendering/SVGRenderSupport.cpp
rendering/SVGRenderTreeAsText.cpp
+ rendering/SVGResources.cpp
+ rendering/SVGResourcesCache.cpp
+ rendering/SVGResourcesCycleSolver.cpp
rendering/SVGRootInlineBox.cpp
rendering/SVGShadowTreeElements.cpp
rendering/SVGTextChunkLayoutInfo.cpp
diff --git a/WebCore/CMakeListsEfl.txt b/WebCore/CMakeListsEfl.txt
index ab475f5..0837b02 100644
--- a/WebCore/CMakeListsEfl.txt
+++ b/WebCore/CMakeListsEfl.txt
@@ -97,6 +97,19 @@ IF (WTF_USE_SOUP)
)
ENDIF ()
+IF (WTF_USE_CURL)
+ LIST(APPEND WebCore_INCLUDE_DIRECTORIES
+ "${WEBCORE_DIR}/platform/network/curl"
+ )
+ LIST(APPEND WebCore_SOURCES
+ platform/network/curl/CookieJarCurl.cpp
+ platform/network/curl/DNSCurl.cpp
+ platform/network/curl/FormDataStreamCurl.cpp
+ platform/network/curl/ResourceHandleCurl.cpp
+ platform/network/curl/ResourceHandleManager.cpp
+ )
+ENDIF ()
+
IF (WTF_USE_ICU_UNICODE)
LIST(APPEND WebCore_SOURCES
editing/SmartReplaceICU.cpp
@@ -112,30 +125,57 @@ LIST(APPEND WebCore_LIBRARIES
${EFLDEPS_LIBRARIES}
${EVAS_LIBRARIES}
${Freetype_LIBRARIES}
- ${GDK_LIBRARIES}
- ${Glib_LIBRARIES}
- ${GTK_LIBRARIES}
${ICU_LIBRARIES}
- ${LIBSOUP24_LIBRARIES}
${LIBXML2_LIBRARIES}
${LIBXSLT_LIBRARIES}
${Pango_LIBRARIES}
${SQLITE_LIBRARIES}
)
+IF (WTF_USE_SOUP)
+ LIST(APPEND WebCore_LIBRARIES
+ ${LIBSOUP24_LIBRARIES}
+ )
+ENDIF ()
+
+IF (WTF_USE_CURL)
+ LIST(APPEND WebCore_LIBRARIES
+ ${CURL_LIBRARIES}
+ )
+ENDIF ()
+
LIST(APPEND WebCore_INCLUDE_DIRECTORIES
${Cairo_INCLUDE_DIRS}
${ECORE_X_INCLUDE_DIRS}
${EFLDEPS_INCLUDE_DIRS}
${EVAS_INCLUDE_DIRS}
${Freetype_INCLUDE_DIRS}
- ${GDK_INCLUDE_DIRS}
- ${Glib_INCLUDE_DIRS}
- ${GTK_INCLUDE_DIRS}
${ICU_INCLUDE_DIRS}
- ${LIBSOUP24_INCLUDE_DIRS}
- ${LIBXML2_INCLUDE_DIRS}
+ ${LIBXML2_INCLUDE_DIR}
${LIBXSLT_INCLUDE_DIRS}
${Pango_INCLUDE_DIRS}
${SQLITE_INCLUDE_DIRS}
)
+
+IF (ENABLE_GLIB_SUPPORT)
+ LIST(APPEND WebCore_LIBRARIES
+ ${GDK_LIBRARIES}
+ ${Glib_LIBRARIES}
+ )
+ LIST(APPEND WebCore_INCLUDE_DIRECTORIES
+ ${GDK_INCLUDE_DIRS}
+ ${Glib_INCLUDE_DIRS}
+ )
+ENDIF ()
+
+IF (WTF_USE_SOUP)
+ LIST(APPEND WebCore_INCLUDE_DIRECTORIES
+ ${LIBSOUP24_INCLUDE_DIRS}
+ )
+ENDIF ()
+
+IF (WTF_USE_CURL)
+ LIST(APPEND WebCore_INCLUDE_DIRECTORIES
+ ${CURL_INCLUDE_DIRS}
+ )
+ENDIF ()
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 79eb390..999b591 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,3415 @@
+2010-07-28 Bryan Gislason <bgislason@rim.com>
+
+ Reviewed by Nate Chapin.
+
+ Minor compile errors in loadMediaPlayerProxyPlugin
+ https://bugs.webkit.org/show_bug.cgi?id=43141
+
+ * WebCore/loader/SubframeLoader.cpp:
+
+2010-07-28 Dominic Mazzoni <dmazzoni@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ Add a missing dependency.
+ https://bugs.webkit.org/show_bug.cgi?id=43044
+
+ * css/CSSPrimitiveValueMappings.h:
+
+2010-07-28 Alex Nicolaou <anicolao@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ Set incorrect but close expectations for mask-colorspace.svg on mac
+ https://bugs.webkit.org/show_bug.cgi?id=43102
+
+ Blocks:
+ [chromium] r63450 caused some svg mask tests to fail pixel tests
+ https://bugs.webkit.org/show_bug.cgi?id=42403
+
+ ImageBufferCG.cpp uses CoreGraphics to do the transform of SVG masks
+ into LinearRGB, but only for MAC which means not for CHROMIUM, so I
+ have changed the #if to account for both platforms. I am assuming this
+ isn't in for windows because it's missing in CG itself, but I didn't
+ verify that.
+
+ * platform/graphics/cg/ImageBufferCG.cpp:
+ (WebCore::ImageBuffer::ImageBuffer):
+
+2010-07-28 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] Improve read-only arrow button appearance
+ https://bugs.webkit.org/show_bug.cgi?id=43108
+
+ No new tests. This is a fix for fast/forms/
+ input-appearance-spinbutton-disabled-readonly.html
+
+ * platform/chromium/PlatformThemeChromiumGtk.cpp:
+ (WebCore::PlatformThemeChromiumGtk::paintArrowButton):
+ If the button has ReadOnlyState, paint the button as same as it is disabled.
+
+2010-07-28 Tony Chang <tony@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ implement getData('text/html') for webkit win
+ https://bugs.webkit.org/show_bug.cgi?id=37981
+
+ * platform/win/ClipboardUtilitiesWin.cpp:
+ (WebCore::extractMarkupFromCFHTML):
+ (WebCore::getCFHTML):
+ (WebCore::fragmentFromCFHTML):
+ (WebCore::fragmentFromHTML):
+ * platform/win/ClipboardUtilitiesWin.h:
+ * platform/win/ClipboardWin.cpp:
+ (WebCore::):
+ (WebCore::clipboardTypeFromMIMEType):
+ (WebCore::ClipboardWin::getData):
+
+2010-07-28 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Update numbered header element closing to match recent spec change
+ https://bugs.webkit.org/show_bug.cgi?id=43072
+
+ Pretty straightforward transcription of the spec change.
+
+ * html/HTMLElementStack.cpp:
+ (WebCore::HTMLNames::isNumberedHeaderElement):
+ (WebCore::HTMLElementStack::popUntilNumberedHeaderElementPopped):
+ (WebCore::HTMLElementStack::hasOnlyHTMLElementsInScope):
+ (WebCore::HTMLElementStack::hasNumberedHeaderElementInScope):
+ * html/HTMLElementStack.h:
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+ (WebCore::HTMLTreeBuilder::processEndTagForInBody):
+
+2010-07-28 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add support for calling NPObject methods
+ https://bugs.webkit.org/show_bug.cgi?id=43145
+
+ * WebCore.exp.in:
+ Export JSHTMLElement::s_info and pluginScriptObject.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ Make JSHTMLElement.h and JSPluginElementFunctions.h private headers.
+
+ * bindings/js/JSPluginElementFunctions.cpp:
+ (WebCore::pluginScriptObject):
+ * bindings/js/JSPluginElementFunctions.h:
+ Make pluginScriptObject a public function.
+
+2010-07-28 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [chromium] Add a bool to Settings to control accelerated 2d canvas
+ https://bugs.webkit.org/show_bug.cgi?id=43094
+
+ Currently this doesn't control anything, but it will soon.
+
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings):
+ (WebCore::Settings::setAccelerated2dCanvasEnabled):
+ * page/Settings.h:
+ (WebCore::Settings::accelerated2dCanvasEnabled):
+
+2010-07-28 Robin Dunn <robin@alldunn.com>
+
+ Reviewed by Kevin Ollivier.
+
+ Add DOM bindings support for wx port.
+
+ * DerivedSources.make:
+ * bindings/scripts/CodeGeneratorCPP.pm:
+ * platform/graphics/wx/FontPlatformDataWx.cpp:
+ (WebCore::FontPlatformData::FontPlatformData):
+ * platform/wx/MouseEventWx.cpp:
+ (WebCore::PlatformMouseEvent::PlatformMouseEvent):
+ * wscript:
+
+2010-07-28 Stephen White <senorblanco@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Hook the GLES2 rendering path up to GraphicsContextSkia.
+ https://bugs.webkit.org/show_bug.cgi?id=43119
+
+ This connects the state-setting and drawing calls implemented in
+ so far in GLES2Canvas, and calls PlatformContextSkia's
+ prepareForSoftwareDraw() for all the non-accelerated paths.
+
+ * platform/graphics/skia/GraphicsContextSkia.cpp:
+ (WebCore::GraphicsContext::addInnerRoundedRectClip):
+ (WebCore::GraphicsContext::addPath):
+ (WebCore::GraphicsContext::beginPath):
+ (WebCore::GraphicsContext::clip):
+ (WebCore::GraphicsContext::drawConvexPolygon):
+ (WebCore::GraphicsContext::drawEllipse):
+ (WebCore::GraphicsContext::drawFocusRing):
+ (WebCore::GraphicsContext::drawLine):
+ (WebCore::GraphicsContext::drawLineForMisspellingOrBadGrammar):
+ (WebCore::GraphicsContext::drawLineForText):
+ (WebCore::GraphicsContext::drawRect):
+ (WebCore::GraphicsContext::fillPath):
+ (WebCore::GraphicsContext::fillRoundedRect):
+ (WebCore::GraphicsContext::strokeArc):
+ (WebCore::GraphicsContext::strokePath):
+ (WebCore::GraphicsContext::strokeRect):
+ These calls are software-only; call preSoftwareDraw() for these.
+ (WebCore::GraphicsContext::savePlatformState):
+ (WebCore::GraphicsContext::restorePlatformState):
+ (WebCore::GraphicsContext::setAlpha):
+ (WebCore::GraphicsContext::setCompositeOperation):
+ (WebCore::GraphicsContext::setPlatformFillColor):
+ (WebCore::GraphicsContext::scale):
+ (WebCore::GraphicsContext::rotate):
+ (WebCore::GraphicsContext::translate):
+ (WebCore::GraphicsContext::concatCTM):
+ These ones set state on both Skia and GLES2Canvas.
+ (WebCore::GraphicsContext::clearRect):
+ (WebCore::GraphicsContext::fillRect):
+ These ones have a GLES2 implementation; call through to it if PlatformContextSkia's useGPU() flag is set and the state permits.
+ * platform/graphics/skia/PlatformContextSkia.cpp:
+ (PlatformContextSkia::prepareForSoftwareDraw):
+ (PlatformContextSkia::prepareForHardwareDraw):
+ Rename preXXXDraw() -> prepareForXXXDraw().
+ * platform/graphics/skia/PlatformContextSkia.h:
+ (PlatformContextSkia::prepareForSoftwareDraw):
+ (PlatformContextSkia::prepareForHardwareDraw):
+ Rename preXXXDraw() -> prepareForXXXDraw().
+
+2010-07-28 fsamuel@chromium.org <fsamuel@chromium.org>
+
+ Reviewed by David Hyatt.
+
+ REGRESSION (r63994): Bank of America's home page is horribly mis-rendered
+ https://bugs.webkit.org/show_bug.cgi?id=42993
+
+ Fixed bug introduced by patch for bug 40775.
+
+ The new table rendering code did not take into account table layouts starting
+ during a partial construction of the table render tree. As such,
+ multiple layouts on the same table resulted in more columns being generated.
+ This patch solves this issue.
+
+ * rendering/AutoTableLayout.cpp:
+ (WebCore::AutoTableLayout::recalcColumn):
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::cellAbove):
+ (WebCore::RenderTable::cellBelow):
+ (WebCore::RenderTable::cellBefore):
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::ensureRows):
+ (WebCore::RenderTableSection::addCell):
+ (WebCore::RenderTableSection::setCellWidths):
+ (WebCore::RenderTableSection::calcRowHeight):
+ (WebCore::RenderTableSection::layoutRows):
+ (WebCore::RenderTableSection::paintObject):
+ (WebCore::RenderTableSection::appendColumn):
+ (WebCore::RenderTableSection::splitColumn):
+ * rendering/RenderTableSection.h:
+ (WebCore::RenderTableSection::CellStruct::CellStruct):
+
+2010-07-28 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Exclude DNS and SSL time from connect time
+ https://bugs.webkit.org/show_bug.cgi?id=43083
+
+ The ResourceLoadTiming API's definition of the connect phase includes
+ DNS and SSL time. However, the Web Timing spec wants just the TCP time.
+ So this patch subtracts those phases out.
+
+ No new tests because ResourceLoadTiming fields are not populated by
+ TestShell yet.
+
+ * page/Timing.cpp:
+ (WebCore::Timing::connectStart):
+ (WebCore::Timing::connectEnd):
+
+2010-07-26 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Page clients should be passed to Page constructor via structure of pointers
+ https://bugs.webkit.org/show_bug.cgi?id=42834
+
+ No new tests, refactoring only.
+
+ * WebCore.exp.in:
+ * page/Page.cpp:
+ (WebCore::Page::Page):
+ * page/Page.h:
+ (WebCore::Page::PageClients::PageClients):
+ * svg/graphics/SVGImage.cpp:
+ (WebCore::SVGImage::dataChanged):
+
+2010-07-28 Xianzhu Wang <phnixwxz@gmail.com>
+
+ Reviewed by Dan Bernstein.
+
+ Line not wrapped at certain punctuations
+ https://bugs.webkit.org/show_bug.cgi?id=37698
+ Added a line breaking table for all printable ASCII chars to replace
+ the original line breaking table for only '?'.
+
+ Test: fast/text/line-breaks-after-closing-punctuations.html
+
+ * rendering/break_lines.cpp:
+ (WebCore::isBreakableSpace):
+ (WebCore::):
+ (WebCore::shouldBreakAfter):
+ (WebCore::needsLineBreakIterator):
+
+2010-07-28 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Unreviewed build fix.
+
+ Fix EFL build with SHARED_CORE=ON after r64124.
+
+ * CMakeLists.txt:
+
+2010-07-28 Jay Civelli <jcivelli@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ [Chromium] The popup now layouts properly its rows by
+ taking into account the label width.
+ https://bugs.webkit.org/show_bug.cgi?id=42910
+
+ * platform/chromium/PopupMenuChromium.cpp:
+ (WebCore::PopupListBox::layout):
+
+2010-07-28 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed: chromium tests fix.
+ Chromium Dev Tools: [REGRESSION] Pause is not working.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43118
+
+ * inspector/front-end/InspectorBackendStub.js:
+
+2010-07-28 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ WebInspector: Navigating to anchor prior to opening WebInspector
+ makes resource have 'other' type.
+ https://bugs.webkit.org/show_bug.cgi?id=43110
+
+ * inspector/InspectorResource.cpp:
+ (WebCore::InspectorResource::type):
+ (WebCore::InspectorResource::resourceData):
+ * inspector/front-end/ResourceView.js:
+ (WebInspector.ResourceView.prototype._innerSelectContentTab):
+
+2010-07-28 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] putImageData(): Combine premultiplication and BGR->RGB
+ https://bugs.webkit.org/show_bug.cgi?id=43114
+
+ Further optimized putImageData() by doing BGR->RGB inside the
+ premultiplication routine.
+
+ * platform/graphics/qt/ImageBufferQt.cpp:
+ (WebCore::premultiplyABGRtoARGB): Renamed from premultiply.
+ (WebCore::putImageData):
+
+2010-07-28 Andrei Popescu <andreip@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ [IndexedDB] IDBKeyRange should be a runtime-enabled feature.
+ https://bugs.webkit.org/show_bug.cgi?id=43116
+
+ IDBKeyRange should be enabled at runtime only when IndexedDB is also
+ enabled.
+
+ No new tests needed, functionality not changed.
+
+ * bindings/generic/RuntimeEnabledFeatures.h:
+ (WebCore::RuntimeEnabledFeatures::iDBKeyRangeEnabled):
+ * page/DOMWindow.idl:
+
+2010-07-28 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Not reviewed. Forgot to land GNUmakefile.am changes, broke build in r64196.
+
+ * GNUmakefile.am: Add SVGResources.* / SVGResourcesCache.* / SVGResourcesCycleSolver.* to build.
+
+2010-07-28 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ SVGMaskElement/SVGForeignObjectElement should not inherit from SVGURIReference
+ https://bugs.webkit.org/show_bug.cgi?id=43113
+
+ Remove wrong SVGURIReference inheritance for SVGMaskElement/SVGForeignObjectElement. Old copy/paste bug.
+
+ * svg/SVGForeignObjectElement.cpp:
+ (WebCore::SVGForeignObjectElement::synchronizeProperty):
+ * svg/SVGForeignObjectElement.h:
+ * svg/SVGMaskElement.cpp:
+ (WebCore::SVGMaskElement::SVGMaskElement):
+ (WebCore::SVGMaskElement::parseMappedAttribute):
+ (WebCore::SVGMaskElement::svgAttributeChanged):
+ (WebCore::SVGMaskElement::synchronizeProperty):
+ * svg/SVGMaskElement.h:
+
+2010-07-28 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ WebKit shouldn't ignore resource cycles, but break them as Opera does
+ https://bugs.webkit.org/show_bug.cgi?id=43031
+
+ Don't ignore resources containing cyclic references, but break them, as discussed on SVG WG mailing lists - to be compatible with Opera which already does that.
+
+ We used to lookup RenderSVGResourceContainers objects, by extracting the URI reference from the SVGRenderStyle, then utilizing getElementById() to lookup the
+ node, and access its renderer. Opera ignores such references, if they point to resources that contain cyclic references. Ignoring them would mean we have
+ to mutate the render style to empty the resource strings. That obviously doesn't work, as it would break expectations (getComputedStyle, etc.).
+
+ Introduce a SVGResources class that stores pointers to all resources, that can be applied to a RenderObject (clipper/filter/markers/masker).
+ Add a SVGResourcesCache class, which is basically a HashMap<RenderObject*, SVGResources*>. Whenever a RenderObject receives style, we extract the URI references
+ from the SVGRenderStyle, look up the RenderSVGResourceContainer* objects, and store them in a SVGResources* class. Then we execute a cycle detection logic,
+ which detects cyclic references and breaks them. Breaking them means just nulling the pointer to the resource in the SVGResources object. Those SVGResources
+ objects are cached, and used throughout the render tree to access resources. This way it's guaranteed that all cyclic references are resolved until layout/paint
+ phase begins.
+
+ This is the first chunk, which just adds the new SVGResources/SVGResourcesCache/SVGResourcesCycleSolver files, and does minor cleanups.
+ It's not yet glued in and doesn't affect any tests.
+
+ * Android.mk: Add SVGResources.* / SVGResourcesCache.* / SVGResourcesCycleSolver.* to build.
+ * CMakeLists.txt: Ditto.
+ * WebCore.gypi: Ditto.
+ * WebCore.pro: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * rendering/RenderInline.h: Make styleDidChange protected, RenderSVGInline wants to override it.
+ * rendering/RenderSVGAllInOne.cpp: Add SVGResources.* / SVGResourcesCache.* / SVGResourcesCycleSolver.* to build.
+ * rendering/RenderSVGHiddenContainer.h:
+ (WebCore::RenderSVGHiddenContainer::isSVGHiddenContainer): Make isSVGHiddenContainer() private and renderName() public.
+ * rendering/RenderSVGResourceContainer.cpp: Added. Moved most methods from the header in the implementation file.
+ (WebCore::RenderSVGResourceContainer::RenderSVGResourceContainer):
+ (WebCore::RenderSVGResourceContainer::~RenderSVGResourceContainer):
+ (WebCore::RenderSVGResourceContainer::idChanged):
+ (WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke):
+ (WebCore::RenderSVGResourceContainer::containsCyclicReference):
+ * rendering/RenderSVGResourceContainer.h: Add stubs, that SVGResourcesCache uses - a follow-up patch will add the logic.
+ (WebCore::RenderSVGResourceContainer::addClient):
+ (WebCore::RenderSVGResourceContainer::removeClient):
+ * rendering/SVGResources.cpp: Added. Holds a list of resources applyable to a RenderObject (fill/stroke, mask/markers/clipper/filter)
+ (WebCore::paintingResourceFromSVGPaint): Helper function looking up a RenderSVGResource for a SVGPaint object.
+ (WebCore::registerPendingResource): Helper function that register a RenderSVGResource as pending in the SVGDocumentExtensions.
+ (WebCore::SVGResources::buildCachedResources): Build a list of resources for a RenderObject/RenderStyle pair, handles pending resources, if needed.
+ (WebCore::SVGResources::invalidateClient): Helper function that calls invalidateClient() on all resources.
+ (WebCore::SVGResources::resourceDestroyed): Helper function that calls invalidateClients() on a certain resource, and nulls it.
+ (WebCore::SVGResources::buildSetOfResources): Helper function that stashes all resources present in the SVGResources members in a HashSet, used in SVGResourcesCycleSolver.
+ (WebCore::SVGResources::resetClipper): Helper methods nulling a resource.
+ (WebCore::SVGResources::resetFilter): Ditto.
+ (WebCore::SVGResources::resetMarkerStart): Ditto.
+ (WebCore::SVGResources::resetMarkerMid): Ditto.
+ (WebCore::SVGResources::resetMarkerEnd): Ditto.
+ (WebCore::SVGResources::resetMasker): Ditto.
+ (WebCore::SVGResources::resetFill): Ditto.
+ (WebCore::SVGResources::resetStroke): Ditto.
+ (WebCore::SVGResources::dump):
+ * rendering/SVGResources.h: Added.
+ (WebCore::SVGResources::clipper): Accesor of the cached m_foo variable.
+ (WebCore::SVGResources::filter): Ditto.
+ (WebCore::SVGResources::markerStart): Ditto.
+ (WebCore::SVGResources::markerMid): Ditto.
+ (WebCore::SVGResources::markerEnd): Ditto.
+ (WebCore::SVGResources::masker): Ditto.
+ (WebCore::SVGResources::fill): Ditto.
+ (WebCore::SVGResources::stroke): Ditto.
+ * rendering/SVGResourcesCache.cpp: Added. Holds a HashMap<RenderObject*, SVGResources*> and utility functions that update/invalidate the cache.
+ (WebCore::SVGResourcesCache::SVGResourcesCache):
+ (WebCore::SVGResourcesCache::~SVGResourcesCache):
+ (WebCore::SVGResourcesCache::addResourcesFromRenderObject): Build a SVGResources object for a RenderObject and adds it to the cache, then detects & breaks cycles using SVGResourcesCycleSolver.
+ (WebCore::SVGResourcesCache::removeResourcesFromRenderObject): Remove a SVGResources object from the cache.
+ (WebCore::resourcesCacheFromRenderObject): Helper function, retrieving a SVGResourcesCache method from a RenderObject.
+ (WebCore::SVGResourcesCache::cachedResourcesForRenderObject): Returns a SVGResources object from the cache.
+ (WebCore::SVGResourcesCache::clientLayoutChanged): (static) Calls invalidateClient() on all resources that are used by the passed RenderObject.
+ (WebCore::SVGResourcesCache::clientStyleChanged): (static) Updates the cache (calling removeResourceFromRenderObject/addResourcesFrom...) and invalidates resources in the ancestor chain.
+ (WebCore::SVGResourcesCache::clientUpdatedFromElement): (static) Does the same, without invalidating the ancestor chain.
+ (WebCore::SVGResourcesCache::clientDestroyed): (static) Calls removeResourcesFromRenderObject() on the SVGResourcesCache, for the given renderer.
+ (WebCore::SVGResourcesCache::resourceDestroyed): (static) Updates all SVGResources objects in the cache, that refer to the given resource.
+ * rendering/SVGResourcesCache.h: Added.
+ * rendering/SVGResourcesCycleSolver.cpp: Added. Detects and breaks cyclic references, just the way Opera handles it. Break cycles as they are detected.
+ (WebCore::SVGResourcesCycleSolver::SVGResourcesCycleSolver):
+ (WebCore::SVGResourcesCycleSolver::~SVGResourcesCycleSolver):
+ (WebCore::SVGResourcesCycleSolver::resourceContainsCycles): Operates only on the render tree
+ (WebCore::targetReferenceFromResource): Helper method for chainableResourceContainsCycles().
+ (WebCore::setFollowLinkForChainableResource): Ditto.
+ (WebCore::SVGResourcesCycleSolver::chainableResourceContainsCycles): Handles cycles for resources that are chainable through xlink:href (filter/gradient/pattern).
+ (WebCore::SVGResourcesCycleSolver::resolveCycles): Main method executing the cycle breaking logic, utilizing (chainableResource)resourceContainsCycles.
+ (WebCore::SVGResourcesCycleSolver::breakCycle): Nulls a resource in the given SVGResources* object, to avoid using an invalid resource while rendering/layouting.
+ * rendering/SVGResourcesCycleSolver.h: Added.
+ * svg/SVGDocumentExtensions.cpp:
+ (WebCore::SVGDocumentExtensions::SVGDocumentExtensions): Create SVGResourcesCache object once per SVGDocumentExtensions.
+ * svg/SVGDocumentExtensions.h:
+ (WebCore::SVGDocumentExtensions::resourcesCache): Expose accesor method for the SVGResourcesCache.
+
+2010-07-28 Zoltan Herczeg <zherczeg@webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ SVGFilterElement & SVGFE*Element don't support dynamic invalidation, when attributes change
+ https://bugs.webkit.org/show_bug.cgi?id=42244
+
+ Implementing svgAttributeChanged for SVGFEOffsetElement object.
+
+ Tests: svg/dynamic-updates/SVGFEOffsetElement-dom-dx-attr.html
+ svg/dynamic-updates/SVGFEOffsetElement-dom-dy-attr.html
+ svg/dynamic-updates/SVGFEOffsetElement-dom-in-attr.html
+ svg/dynamic-updates/SVGFEOffsetElement-svgdom-dx-prop.html
+ svg/dynamic-updates/SVGFEOffsetElement-svgdom-dy-prop.html
+ svg/dynamic-updates/SVGFEOffsetElement-svgdom-in-prop.html
+
+ * svg/SVGFEOffsetElement.cpp:
+ (WebCore::SVGFEOffsetElement::svgAttributeChanged):
+ * svg/SVGFEOffsetElement.h:
+
+2010-07-28 Zoltan Herczeg <zherczeg@webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ SVGFilterElement & SVGFE*Element don't support dynamic invalidation, when attributes change
+ https://bugs.webkit.org/show_bug.cgi?id=42244
+
+ Implementing svgAttributeChanged for SVGFEDiffuseLightingElement object.
+
+ Tests: svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-diffuseConstant-attr.html
+ svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-in-attr.html
+ svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-lighting-color-attr.html
+ svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-surfaceScale-attr.html
+ svg/dynamic-updates/SVGFEDiffuseLightingElement-lighting-color-css-prop.html
+ svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-diffuseConstant-prop.html
+ svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-in-prop.html
+ svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-surfaceScale-prop.html
+
+ * svg/SVGFEDiffuseLightingElement.cpp:
+ (WebCore::SVGFEDiffuseLightingElement::svgAttributeChanged):
+ * svg/SVGFEDiffuseLightingElement.h:
+
+2010-07-27 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ Add FILE_SYSTEM build flag for FileSystem API
+ https://bugs.webkit.org/show_bug.cgi?id=42915
+
+ * Configurations/FeatureDefines.xcconfig:
+ * GNUmakefile.am:
+ * WebCore.pri:
+
+2010-07-26 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Shinichiro Hamaji.
+
+ @page rules in media queries should be tested.
+ https://bugs.webkit.org/show_bug.cgi?id=42971
+
+ * page/PrintContext.cpp:
+ (WebCore::PrintContext::pageProperty): Fixed to properly begin
+ printing. Added support for size property.
+
+2010-07-27 James Hawkins <jhawkins@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Add itemIcon() method to the PopupMenuClient, used by Chrome AutoFill
+ to display right-aligned credit card icons in the suggestions popup.
+ https://bugs.webkit.org/show_bug.cgi?id=43076
+
+ No new tests as this is only used by the Chromium WebKit API.
+
+ * platform/PopupMenuClient.h:
+ * platform/chromium/PopupMenuChromium.cpp:
+ (WebCore::PopupListBox::paintRow):
+ * rendering/RenderMenuList.cpp:
+ (WebCore::RenderMenuList::itemIcon):
+ * rendering/RenderMenuList.h:
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore::RenderTextControlSingleLine::itemIcon):
+ * rendering/RenderTextControlSingleLine.h:
+
+2010-07-27 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] putImageData(): Fast premultiply() if alpha == 255
+
+ * platform/graphics/qt/ImageBufferQt.cpp:
+ (WebCore::premultiply): Do nothing for opaque pixels.
+
+2010-07-27 Jian Li <jianli@chromium.org>
+
+ Reviewed by David Levin.
+
+ Enhance FileThreadTask to support return type.
+ https://bugs.webkit.org/show_bug.cgi?id=43078
+
+ This is needed to support synchronous calls of FileStream methods in
+ addition to asynchronous calls via FileThreadTask.
+
+ * html/FileThreadTask.h:
+ (WebCore::createFileThreadTask):
+
+2010-07-27 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [chromium] Let PlatformContextSkia draw to a GLES2Canvas in addition to an SkCanvas
+ https://bugs.webkit.org/show_bug.cgi?id=43070
+
+ This adds a GLES2Canvas as drawing surface to PlatformContextSkia and lets callers
+ issue draw commands to either. The PlatformContextSkia keeps track of where
+ rendering results are being accumulated and can blend the hardware and software
+ backing stores into each other when necessary.
+
+ Still just plumbing, no functionality change.
+
+ * platform/graphics/chromium/GLES2Canvas.cpp:
+ (WebCore::GLES2Canvas::GLES2Canvas):
+ * platform/graphics/chromium/GLES2Canvas.h:
+ * platform/graphics/skia/PlatformContextSkia.cpp:
+ (PlatformContextSkia::PlatformContextSkia):
+ (PlatformContextSkia::setGLES2Context):
+ (PlatformContextSkia::preSoftwareDraw):
+ (PlatformContextSkia::preHardwareDraw):
+ (PlatformContextSkia::forceToSoftware):
+ (PlatformContextSkia::uploadSoftwareToHardware):
+ (PlatformContextSkia::readbackHardwareToSoftware):
+ * platform/graphics/skia/PlatformContextSkia.h:
+ (PlatformContextSkia::useGPU):
+ (PlatformContextSkia::gpuCanvas):
+ (PlatformContextSkia::preSoftwareDraw):
+ (PlatformContextSkia::preHardwareDraw):
+ (PlatformContextSkia::forceToSoftware):
+ (PlatformContextSkia::):
+
+2010-07-27 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Incomplete repaint of some Safari extension content which falls into a composited iframe
+ <rdar://problem/8235044>
+
+ syncCompositingStateRecursive() bails if it thinks that a layout is pending, because
+ the layout may update layers and make this sync obsolete. However, it only checked for an
+ active layout timer. This ignores other sources of pending style changes and layouts, like
+ the document's style recalc timer. So use needsLayout(), which does check this.
+
+ Unable to create a test because it depends on Safari extension behavior.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::syncCompositingStateRecursive):
+
+2010-07-27 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] putImageData() optimizations
+ https://bugs.webkit.org/show_bug.cgi?id=43059
+
+ - Single-pass premultiplication and BGR->RGB conversion
+ - Use ARGB32PM for the temporary image so Qt calls the
+ fast Source composition function
+
+ * platform/graphics/qt/ImageBufferQt.cpp:
+ (WebCore::premultiply): Added (static inline)
+ (WebCore::putImageData):
+
+2010-07-27 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Expose interface for returning the plug-in script JSObject
+ https://bugs.webkit.org/show_bug.cgi?id=43074
+
+ PluginViewBase::scriptObject should be a virtual function.
+
+ * plugins/PluginViewBase.h:
+ (WebCore::PluginViewBase::scriptObject):
+
+2010-07-27 Jian Li <jianli@chromium.org>
+
+ Reviewed by David Levin.
+
+ Add ScriptExecutionContext argument to File/Blob constructors.
+ https://bugs.webkit.org/show_bug.cgi?id=40587
+
+ Remove DragData::createClipboard and add Clipboard::create for it to be
+ called directly in DragController. This is because we need to pass
+ Frame pointer to Clipboard class and use it to get ScriptExecutionContext
+ in order to construct File objects in Clipboard::files().
+
+ * bindings/js/SerializedScriptValue.cpp:
+ (WebCore::DeserializingTreeWalker::convertIfTerminal):
+ * bindings/v8/SerializedScriptValue.cpp:
+ (WebCore::ZigZag::Reader::readBlob):
+ (WebCore::ZigZag::Reader::readFile):
+ (WebCore::ZigZag::Reader::readFileList):
+ * dom/Clipboard.h:
+ * editing/Editor.cpp:
+ (WebCore::Editor::dispatchCPPEvent):
+ * editing/Editor.h:
+ * editing/android/EditorAndroid.cpp:
+ (WebCore::Editor::newGeneralClipboard):
+ * editing/brew/EditorBrew.cpp:
+ (WebCore::Editor::newGeneralClipboard):
+ * editing/chromium/EditorChromium.cpp:
+ (WebCore::Editor::newGeneralClipboard):
+ * editing/haiku/EditorHaiku.cpp:
+ (WebCore::Editor::newGeneralClipboard):
+ * editing/mac/EditorMac.mm:
+ (WebCore::Editor::newGeneralClipboard):
+ * editing/qt/EditorQt.cpp:
+ (WebCore::Editor::newGeneralClipboard):
+ * editing/wx/EditorWx.cpp:
+ (WebCore::Editor::newGeneralClipboard):
+ * html/Blob.cpp:
+ (WebCore::Blob::Blob):
+ (WebCore::Blob::slice):
+ * html/Blob.h:
+ (WebCore::Blob::create):
+ * html/Blob.idl:
+ * html/BlobBuilder.cpp:
+ (WebCore::BlobBuilder::getBlob):
+ * html/BlobBuilder.h:
+ * html/BlobBuilder.idl:
+ * html/File.cpp:
+ (WebCore::File::File):
+ * html/File.h:
+ (WebCore::File::create):
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::appendFormData):
+ (WebCore::HTMLInputElement::setFileListFromRenderer):
+ * page/DragController.cpp:
+ (WebCore::DragController::dragExited):
+ (WebCore::DragController::performDrag):
+ (WebCore::DragController::tryDHTMLDrag):
+ * page/chromium/EventHandlerChromium.cpp:
+ (WebCore::EventHandler::createDraggingClipboard):
+ * page/gtk/EventHandlerGtk.cpp:
+ (WebCore::EventHandler::createDraggingClipboard):
+ * page/win/EventHandlerWin.cpp:
+ (WebCore::EventHandler::createDraggingClipboard):
+ * platform/DragData.h:
+ * platform/android/ClipboardAndroid.cpp:
+ (WebCore::Clipboard::create):
+ * platform/android/DragDataAndroid.cpp:
+ * platform/brew/ClipboardBrew.cpp:
+ (WebCore::Clipboard::create):
+ * platform/brew/DragDataBrew.cpp:
+ * platform/chromium/ClipboardChromium.cpp:
+ (WebCore::Clipboard::create):
+ (WebCore::ClipboardChromium::ClipboardChromium):
+ (WebCore::ClipboardChromium::create):
+ (WebCore::ClipboardChromium::files):
+ * platform/chromium/ClipboardChromium.h:
+ * platform/chromium/DragDataChromium.cpp:
+ * platform/efl/ClipboardEfl.cpp:
+ (WebCore::Editor::newGeneralClipboard):
+ (WebCore::Clipboard::create):
+ * platform/efl/DragDataEfl.cpp:
+ * platform/gtk/ClipboardGtk.cpp:
+ (WebCore::Editor::newGeneralClipboard):
+ (WebCore::Clipboard::create):
+ (WebCore::ClipboardGtk::ClipboardGtk):
+ (WebCore::ClipboardGtk::files):
+ * platform/gtk/ClipboardGtk.h:
+ (WebCore::ClipboardGtk::create):
+ * platform/gtk/DragDataGtk.cpp:
+ * platform/haiku/ClipboardHaiku.cpp:
+ (WebCore::Clipboard::create):
+ * platform/haiku/DragDataHaiku.cpp:
+ * platform/mac/ClipboardMac.mm:
+ (WebCore::Clipboard::create):
+ (WebCore::ClipboardMac::files):
+ * platform/mac/DragDataMac.mm:
+ * platform/qt/ClipboardQt.cpp:
+ (WebCore::Clipboard::create):
+ * platform/qt/DragDataQt.cpp:
+ * platform/win/ClipboardWin.cpp:
+ (WebCore::Clipboard::create):
+ (WebCore::ClipboardWin::ClipboardWin):
+ (WebCore::ClipboardWin::files):
+ * platform/win/ClipboardWin.h:
+ (WebCore::ClipboardWin::create):
+ * platform/win/DragDataWin.cpp:
+ * platform/win/EditorWin.cpp:
+ (WebCore::Editor::newGeneralClipboard):
+ * platform/wince/DragDataWince.cpp:
+ * platform/wince/EditorWince.cpp:
+ (WebCore::Editor::newGeneralClipboard):
+ * platform/wx/ClipboardWx.cpp:
+ (WebCore::Clipboard::create):
+ * platform/wx/DragDataWx.cpp:
+
+2010-07-27 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by David Levin.
+
+ Move all WebSQLDatabases-specific code behind #if ENABLE(DATABASE).
+ https://bugs.webkit.org/show_bug.cgi?id=43035
+
+ Make Chromium compile with ENABLE_DATABASE=0. The #ifdefs in
+ DatabaseAuthorizer and ChromiumBridge are removed, because they're
+ used by non-HTML5 DBs too (the classes in WebCore/platform/sql/),
+ which are used by other features too. So they need to be compiled
+ in even if HTML5 DBs are disabled.
+
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ * page/DOMWindow.idl:
+ * platform/chromium/ChromiumBridge.h:
+ * storage/DatabaseAuthorizer.cpp:
+ * storage/chromium/DatabaseObserver.h:
+ * storage/chromium/DatabaseTrackerChromium.cpp:
+ * storage/chromium/QuotaTracker.cpp:
+ * storage/chromium/QuotaTracker.h:
+ * storage/chromium/SQLTransactionClientChromium.cpp:
+
+2010-07-27 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by David Kilzer.
+
+ AX: Misspellings not shown in AXAttributedStringForTextMarkerRange when selection is on word
+ https://bugs.webkit.org/show_bug.cgi?id=41817
+
+ Change how misspelled words are identified for accessibility. No longer rely on the
+ cached markers in Document. Calculate on the fly, which is more accurate in a variety of
+ circumstances (like when selection has not moved across words, of if the cursor is in the middle
+ of a misspelled word).
+
+ Test: platform/mac/accessibility/attributed-string-includes-misspelled-with-selection.html
+
+ * accessibility/mac/AccessibilityObjectWrapper.mm:
+ (AXAttributeStringSetSpelling):
+ (AXAttributedStringAppendText):
+ (-[AccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]):
+
+2010-07-27 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Bug 42621 - Add a bump allocator for the YARR interpreter
+
+ The regex engine requires lifo allocation, however currently uses the general purpose
+ malloc/free memory allocation. A simple bump pointer allocator should provide a lower
+ overhead allocation solution.
+
+ * ForwardingHeaders/wtf/BumpPointerAllocator.h: Added.
+
+2010-07-27 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Joseph Pecoraro.
+
+ Web Inspector: render network timing as gant chart in popover.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43051
+
+ * inspector/InspectorResource.cpp:
+ (WebCore::InspectorResource::buildObjectForTiming):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel.prototype._showPopover):
+ * inspector/front-end/inspector.css:
+ (.resource-timing-row):
+ (.resource-timing-bar):
+ (.resource-timing-bar-title):
+ * inspector/front-end/utilities.js:
+
+2010-07-27 Victor Wang <victorw@chromium.org>
+
+ Unreviewed, rolling out r64104.
+ http://trac.webkit.org/changeset/64104
+ https://bugs.webkit.org/show_bug.cgi?id=40768
+
+ The patch causes chromium webkit socket laytest crashes on
+ windows randomly
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::addResource):
+ (WebCore::InspectorController::removeResource):
+ * inspector/InspectorController.h:
+ * inspector/InspectorResource.cpp:
+ (WebCore::InspectorResource::InspectorResource):
+ (WebCore::InspectorResource::updateScriptObject):
+ (WebCore::InspectorResource::cachedResource):
+ (WebCore::InspectorResource::type):
+ (WebCore::InspectorResource::resourceData):
+ * inspector/InspectorResource.h:
+ (WebCore::InspectorResource::):
+ (WebCore::InspectorResource::create):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.Type.toString):
+ (WebInspector.Resource.prototype.set type):
+ (WebInspector.Resource.prototype._mimeTypeIsConsistentWithType):
+ * inspector/front-end/ResourceView.js:
+ (WebInspector.ResourceView.prototype._refreshRequestHeaders):
+ (WebInspector.ResourceView.prototype._refreshResponseHeaders):
+ (WebInspector.ResourceView.prototype._refreshHeaders):
+ * inspector/front-end/inspector.css:
+ (.resources-category-scripts, .resources-category-xhr, .resources-category-fonts, .resources-category-other):
+ * inspector/front-end/inspector.js:
+ (WebInspector.loaded):
+ (WebInspector.updateResource):
+ * websockets/WebSocketChannel.cpp:
+ (WebCore::WebSocketChannel::WebSocketChannel):
+ (WebCore::WebSocketChannel::disconnect):
+ (WebCore::WebSocketChannel::didOpen):
+ (WebCore::WebSocketChannel::didClose):
+ (WebCore::WebSocketChannel::processBuffer):
+ * websockets/WebSocketChannel.h:
+
+2010-07-27 Andrei Popescu <andreip@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ [IndexedDB] Key range methods belong to the IDBKeyRange interface
+ https://bugs.webkit.org/show_bug.cgi?id=43052
+
+ Move the key range methods from the IndexedDatabaseRequest interface
+ to the IDBKeyRange interface. Also add a global IDBKeyRange object
+ that can be used to access the IDBKeyRange constants and factory methods.
+
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::clear):
+ (WebCore::DOMWindow::iDBKeyRange):
+ * page/DOMWindow.h:
+ * page/DOMWindow.idl:
+ * storage/IDBKeyRange.cpp:
+ (WebCore::IDBKeyRange::only):
+ (WebCore::IDBKeyRange::leftBound):
+ (WebCore::IDBKeyRange::rightBound):
+ (WebCore::IDBKeyRange::bound):
+ * storage/IDBKeyRange.h:
+ * storage/IDBKeyRange.idl:
+ * storage/IndexedDatabaseRequest.cpp:
+ * storage/IndexedDatabaseRequest.h:
+ * storage/IndexedDatabaseRequest.idl:
+
+2010-07-27 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ AX: consolidate parentObjectIfExists() and parentObject() code
+ https://bugs.webkit.org/show_bug.cgi?id=42981
+
+ Consolidate duplicate code in parentObject and parentObjectIfExists
+
+ No tests. No functionality changed.
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::renderParentObject):
+ (WebCore::AccessibilityRenderObject::parentObjectIfExists):
+ (WebCore::AccessibilityRenderObject::parentObject):
+ * accessibility/AccessibilityRenderObject.h:
+
+2010-07-27 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Adam Barth.
+
+ AX: replace m_renderer->document->axObjectCache() with just axObjectCache()
+ https://bugs.webkit.org/show_bug.cgi?id=42979
+
+ No new tests. Code cleanup only.
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::firstChild):
+ (WebCore::AccessibilityRenderObject::lastChild):
+ (WebCore::AccessibilityRenderObject::previousSibling):
+ (WebCore::AccessibilityRenderObject::nextSibling):
+ (WebCore::AccessibilityRenderObject::parentObjectIfExists):
+ (WebCore::AccessibilityRenderObject::parentObject):
+ (WebCore::AccessibilityRenderObject::menuForMenuButton):
+ (WebCore::AccessibilityRenderObject::menuButtonForMenu):
+ (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers):
+ (WebCore::AccessibilityRenderObject::axObjectCache):
+ (WebCore::AccessibilityRenderObject::contentChanged):
+ (WebCore::AccessibilityRenderObject::addChildren):
+
+2010-07-27 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: do not activate all breakpoints on page reload
+ https://bugs.webkit.org/show_bug.cgi?id=41461
+
+ Test: inspector/debugger-breakpoints-not-activated-on-reload.html
+
+ * inspector/front-end/ScriptView.js:
+ (WebInspector.ScriptView.prototype._addBreakpoint):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel):
+ (WebInspector.ScriptsPanel.prototype._breakpointAdded):
+ (WebInspector.ScriptsPanel.prototype.toggleBreakpointsClicked):
+ * inspector/front-end/SourceView.js:
+ (WebInspector.SourceView.prototype._addBreakpoint):
+
+2010-07-27 Pranav Kedia <pranavk@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Chrome browser Bug: Pause button stays when <audio> hits end
+ https://bugs.webkit.org/show_bug.cgi?id=42677
+
+ The change is just in chromium media. Tested using media part of
+ WebKit layout tests. The following test that was failing is passing.
+ media/video-duration-known-after-eos.html -> unexpected pass
+
+ * rendering/RenderMediaControlsChromium.cpp:
+ (WebCore::paintMediaPlayButton):
+ Using mediaElement->canPlay() instead of mediaElement->paused() to
+ paint the play/pause button.
+
+2010-07-27 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Client-based Geolocation does not pass enableHighAccuracy option to controller and client
+ https://bugs.webkit.org/show_bug.cgi?id=40374
+
+ This change passes the enableHighAccuracy request option to the GeolocationController.
+ The GeolocationController tracks whether this should be used by the client.
+
+ No new tests possible as the mock provider doesn't support this feature.
+
+ * page/Geolocation.cpp:
+ (WebCore::Geolocation::setIsAllowed):
+ (WebCore::Geolocation::startUpdating):
+ * page/GeolocationController.cpp:
+ (WebCore::GeolocationController::addObserver):
+ (WebCore::GeolocationController::removeObserver):
+ * page/GeolocationController.h:
+ * page/GeolocationControllerClient.h:
+
+2010-07-27 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ WebInspector: Current implementation of message based inspector
+ transport generated by CodeGeneratorInspector should be upstreamed
+ from WebKit/chromium to WebCore.
+ https://bugs.webkit.org/show_bug.cgi?id=42983
+
+ * Android.derived.v8bindings.mk:
+ * CMakeLists.txt:
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * GNUmakefile.am:
+ * WebCore.exp.in:
+ * WebCore.gypi:
+ * WebCore.pri:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/ScriptObject.cpp:
+ * bindings/js/ScriptObject.h:
+ * bindings/v8/ScriptObject.cpp:
+ * bindings/v8/ScriptObject.h:
+ * inspector/CodeGeneratorInspector.pm:
+ * inspector/InspectorBackend.idl: Removed.
+ * inspector/InspectorFrontendClient.h:
+ * inspector/InspectorFrontendClientLocal.cpp:
+ (WebCore::InspectorFrontendClientLocal::windowObjectCleared):
+ (WebCore::InspectorFrontendClientLocal::sendMessageToBackend):
+ * inspector/InspectorFrontendClientLocal.h:
+ * inspector/InspectorFrontendHost.cpp:
+ (WebCore::InspectorFrontendHost::sendMessageToBackend):
+ * inspector/InspectorFrontendHost.h:
+ * inspector/InspectorFrontendHost.idl:
+ * inspector/front-end/InspectorBackendStub.js:
+ (.WebInspector.InspectorBackendStub):
+ (.WebInspector.InspectorBackendStub.prototype._registerDelegate):
+ (.WebInspector.InspectorBackendStub.prototype.sendMessageToBackend):
+
+2010-07-27 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ Simplify speech input plumbing in webcore and webkit
+ https://bugs.webkit.org/show_bug.cgi?id=43008
+
+ No new tests as functionality is not changed.
+
+ * GNUmakefile.am: Removed a header file.
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * page/Page.cpp:
+ (WebCore::Page::speechInput): Creates and returns SpeechInput when needed.
+ * page/Page.h:
+ * page/SpeechInput.cpp: Added methods to proxy and callbacks between input elements and WebKit
+ (WebCore::SpeechInput::SpeechInput):
+ (WebCore::SpeechInput::didCompleteRecording):
+ (WebCore::SpeechInput::didCompleteRecognition):
+ (WebCore::SpeechInput::setRecognitionResult):
+ (WebCore::SpeechInput::startRecognition):
+ (WebCore::SpeechInput::stopRecording):
+ * page/SpeechInput.h:
+ * page/SpeechInputClient.h:
+ * page/SpeechInputClientListener.h: Removed.
+ * page/SpeechInputListener.h:
+ * rendering/TextControlInnerElements.cpp: Added one more callback.
+ (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::speechInput):
+ (WebCore::InputFieldSpeechButtonElement::didCompleteRecognition):
+ * rendering/TextControlInnerElements.h:
+
+2010-07-27 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ Add a runtime setting for interactive form validation.
+ https://bugs.webkit.org/show_bug.cgi?id=40520
+
+ The interactive validation feature was disabled for non-strict
+ modes by r61059 to avoid a compatibility issue. This removes the
+ mode checking and introduce a runtime setting to enable/disable
+ the feature instead.
+ The default value is 'disable' and we'll remove the setting when
+ the compatibility issue is resolved and interactive validation
+ implementation is completed.
+
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::validateInteractively):
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings):
+ * page/Settings.h:
+ (WebCore::Settings::setInteractiveFormValidationEnabled):
+ (WebCore::Settings::interactiveFormValidationEnabled):
+
+2010-07-26 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Bug 43009 - Abstract out page allocation from executable allocators
+
+ * ForwardingHeaders/wtf/PageAllocation.h: Added.
+
+2010-07-26 Yuta Kitamura <yutak@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Add WebSocket resource type to Web Inspector.
+
+ When a new WebSocket connection is established, a line for that connection
+ will appear in Web Inspector's Resources tab. If the resource name is
+ clicked, the details of handshake request and response will be shown.
+
+ Web Inspector: WebSocket in Resources tab
+ https://bugs.webkit.org/show_bug.cgi?id=40768
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::addResource): WebSocket resource does not
+ have an associated loader, thus frame might be null. Need to check it.
+ (WebCore::InspectorController::removeResource): Ditto.
+ (WebCore::InspectorController::didCreateWebSocket):
+ (WebCore::InspectorController::willSendWebSocketHandshakeRequest):
+ (WebCore::InspectorController::didReceiveWebSocketHandshakeResponse):
+ (WebCore::InspectorController::didCloseWebSocket):
+ * inspector/InspectorController.h:
+ * inspector/InspectorResource.cpp: Add null checks of m_loader and m_frame,
+ because WebSocket does not have a loader and we need to allow null for
+ these variables.
+ (WebCore::createReadableStringFromBinary):
+ (WebCore::InspectorResource::InspectorResource):
+ (WebCore::InspectorResource::create): Factory function of
+ regular (non-WebSocket) resources.
+ (WebCore::InspectorResource::createWebSocket): Factory function of
+ WebSocket resources.
+ (WebCore::InspectorResource::updateWebSocketRequest):
+ (WebCore::InspectorResource::updateWebSocketResponse):
+ (WebCore::InspectorResource::updateScriptObject): m_frame->document() becomes
+ available when Frame::setDocument() is called. We cannot obtain documentURL
+ during the constructor or updateRequest() function, because m_frame->document()
+ is not available yet at that point and documentURL will contain a wrong URL.
+ As far as I know, updateScriptObject() is the only place where we can safely
+ obtain documentURL.
+ (WebCore::InspectorResource::cachedResource):
+ (WebCore::InspectorResource::type):
+ (WebCore::InspectorResource::resourceData):
+ * inspector/InspectorResource.h:
+ (WebCore::InspectorResource::):
+ (WebCore::InspectorResource::markWebSocket):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.Type.toString):
+ (WebInspector.Resource.prototype.set type):
+ (WebInspector.Resource.prototype._mimeTypeIsConsistentWithType):
+ * inspector/front-end/ResourceView.js:
+ (WebInspector.ResourceView.prototype._refreshRequestHeaders):
+ (WebInspector.ResourceView.prototype._refreshResponseHeaders):
+ (WebInspector.ResourceView.prototype._refreshHeaders):
+ * inspector/front-end/inspector.css:
+ (.resources-category-websockets, .resources-category-other):
+ (.resources-category-websockets .resources-graph-bar):
+ (.resources-category-websockets.resource-cached .resources-graph-bar):
+ * inspector/front-end/inspector.js:
+ (WebInspector.loaded):
+ (WebInspector.updateResource):
+ * websockets/WebSocketChannel.cpp:
+ (WebCore::WebSocketChannel::WebSocketChannel):
+ (WebCore::WebSocketChannel::disconnect):
+ (WebCore::WebSocketChannel::didOpen):
+ (WebCore::WebSocketChannel::didClose):
+ (WebCore::WebSocketChannel::processBuffer):
+ (WebCore::WebSocketChannel::identifier):
+ * websockets/WebSocketChannel.h:
+
+2010-07-26 Cosmin Truta <ctruta@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Some SVGs with empty <g> elements crash Chromium on Linux
+ https://bugs.webkit.org/show_bug.cgi?id=41175
+
+ Redo the old fix using a different approach, to avoid regressing
+ svg/batik/filters/filterRegions.svg with Chromium on Linux.
+ Specifically, handle empty SkBitmap objects by exiting early upon
+ encountering unconfigured (i.e. empty) bitmaps.
+
+ No new tests. This bug's old test (svg/filters/filter-empty-g.svg)
+ and the above-mentioned regressed test are expected to pass.
+
+ * WebCore/platform/graphics/skia/ImageBufferSkia.cpp:
+ (ImageBuffer::ImageBuffer): Undo the old fix.
+ (getImageData): The new fix.
+
+2010-07-26 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Google image search results broken on pages with Flash
+ https://bugs.webkit.org/show_bug.cgi?id=43014
+
+ The test for overflow added in r63452 is wrong in that it ignores the effects
+ of positioning on overflow.
+
+ The correct approach is to start by using RenderView's layoutOverflowRect as the largest bounds,
+ then getting the oveflow rect via backgroundClipRect() relative to the root layer.
+
+ Test: compositing/geometry/limit-layer-bounds-overflow-root.html
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::layerOrAncestorIsTransformed):
+ (WebCore::RenderLayerBacking::updateCompositedBounds):
+
+2010-07-26 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Plug-in views should be able to return JSObjects directly
+ https://bugs.webkit.org/show_bug.cgi?id=43019
+
+ * bindings/js/JSHTMLAppletElementCustom.cpp:
+ (WebCore::JSHTMLAppletElement::putDelegate):
+ (WebCore::JSHTMLAppletElement::getCallData):
+ * bindings/js/JSHTMLEmbedElementCustom.cpp:
+ (WebCore::JSHTMLEmbedElement::putDelegate):
+ (WebCore::JSHTMLEmbedElement::getCallData):
+ * bindings/js/JSHTMLObjectElementCustom.cpp:
+ (WebCore::JSHTMLObjectElement::putDelegate):
+ (WebCore::JSHTMLObjectElement::getCallData):
+ runtimeObjectCustomPut and runtimeObjectGetCallData now take a JSHTMLElement instead of a HTMLElement.
+
+ * bindings/js/JSPluginElementFunctions.cpp:
+ (WebCore::pluginScriptObject):
+ First, ask the PluginViewBase for a JSObject and fall back to getting the JSObject from the instance.
+
+ (WebCore::runtimeObjectPropertyGetter):
+ (WebCore::runtimeObjectCustomGetOwnPropertySlot):
+ (WebCore::runtimeObjectCustomGetOwnPropertyDescriptor):
+ Call pluginScriptObject.
+
+ (WebCore::runtimeObjectCustomPut):
+ Change to take a JSHTMLElement. Call pluginScriptObject.
+
+ (WebCore::runtimeObjectGetCallData):
+ Change to take a JSHTMLElement.
+
+ * bridge/jsc/BridgeJSC.cpp:
+ * bridge/jsc/BridgeJSC.h:
+ (JSC::Bindings::Instance::createRuntimeObject):
+ Change this to return a JSObject.
+
+ * html/HTMLPlugInElement.cpp:
+ (WebCore::HTMLPlugInElement::getInstance):
+ Call pluginWidget.
+
+ (WebCore::HTMLPlugInElement::pluginWidget):
+ Return the plug-in widget for this element.
+
+ * html/HTMLPlugInElement.h:
+ * plugins/PluginViewBase.h:
+ (WebCore::PluginViewBase::scriptObject):
+ Add default implementation of scriptObject.
+
+2010-07-26 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ AX: Safari does not support ARIA mixed checkboxes
+ https://bugs.webkit.org/show_bug.cgi?id=43016
+
+ Test: platform/mac/accessibility/mixed-checkbox.html
+
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::AccessibilityObject::checkboxOrRadioValue):
+ * accessibility/AccessibilityObject.h:
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::isNativeCheckboxOrRadio):
+ (WebCore::AccessibilityRenderObject::checkboxOrRadioValue):
+ * accessibility/AccessibilityRenderObject.h:
+ * accessibility/mac/AccessibilityObjectWrapper.mm:
+ (-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
+
+2010-07-26 Shimeng (Simon) Wang <swang@google.com>
+
+ Reviewed by Darin Adler.
+
+ Add auto hyphenation support for Android.
+ https://bugs.webkit.org/show_bug.cgi?id=42800
+
+ * platform/text/android/HyphenationAndroid.cpp: Added.
+ (WebCore::loadHyphenationDictionary):
+ (WebCore::lastHyphenLocation):
+
+2010-07-26 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=43013
+ Part of <rdar://problem/8152434>
+ Add support for scrolling using the keyboard in WebKit2
+
+ Add a new export and make WindowsKeyboardCodes private.
+
+ * WebCore.exp.in:
+ * WebCore.xcodeproj/project.pbxproj:
+
+2010-07-26 Darin Adler <darin@apple.com>
+
+ Reviewed by Eric Carlson.
+
+ Don't handle empty URL attributes specially in reflection, even in cases such as <img src="">
+ https://bugs.webkit.org/show_bug.cgi?id=42087
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::insertedIntoDocument): Check if the src attribute is empty
+ by calling getAttribute instead of calling the src function. This keeps the behavior
+ correct with the reflection change, and has a side benefit of being more efficient as
+ well since there is no reason to resolve the URL.
+ (WebCore::HTMLMediaElement::loadResource): Call getNonEmptyURLAttribute directly here
+ instead of using the poster function.
+ (WebCore::HTMLMediaElement::getPluginProxyParams): Ditto.
+
+ * html/HTMLMediaElement.h: Removed the poster virtual function. The code that gets the
+ poster attribute is already video-specific and uses generic attribute fetching code, so
+ we no longer need a virtual function. Removed the src function. Since this would give
+ a different result from the JavaScript reflected src attribute, it's safer not to have
+ it, and it was easy to convert all the callers.
+
+ * html/HTMLMediaElement.idl: Removed the NonEmpty extended attribute from the src
+ attribute.
+
+ * html/HTMLSourceElement.cpp: Removed the src function for the same reason as above.
+ * html/HTMLSourceElement.h: Ditto.
+
+ * html/HTMLSourceElement.idl: Removed the NonEmpty extended attribute from the src
+ attribute.
+
+ * html/HTMLVideoElement.cpp:
+ (WebCore::HTMLVideoElement::parseMappedAttribute): Removed code to update m_posterURL,
+ which is no longer needed. Changed call site that used the poster() function to instead
+ use getNonEmptyURLAttribute.
+ (WebCore::HTMLVideoElement::updatePosterImage): Check if the poster attribute is empty
+ by calling getAttribute instead of calling the poster function. This keeps the behavior
+ correct with the reflection change, and has a side benefit of being more efficient as
+ well since there is no reason to resolve the URL.
+
+ * html/HTMLVideoElement.h: Removed the poster function for the same reason we removed
+ the src function above. Also removed now-unneeded m_posterURL data member.
+
+ * html/HTMLVideoElement.idl: Removed the NonEmpty extended attribute from the poster
+ attribute.
+
+2010-07-26 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ AX: remove intValue() hasIntValue() from AccessibilityObject
+ https://bugs.webkit.org/show_bug.cgi?id=43006
+
+ These methods are very Mac centric. The mac centric code should be moved into the Mac wrapper.
+
+ No new tests, existing tests cover changes to logic.
+
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::AccessibilityObject::checkboxOrRadioValue):
+ * accessibility/AccessibilityObject.h:
+ (WebCore::):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::selectedRadioButton):
+ (WebCore::AccessibilityRenderObject::selectedTabItem):
+ (WebCore::AccessibilityRenderObject::checkboxOrRadioValue):
+ * accessibility/AccessibilityRenderObject.h:
+ * accessibility/mac/AccessibilityObjectWrapper.mm:
+ (-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
+
+2010-07-26 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Applying inline style to a text node whose parent is an inline editable root causes crash
+ https://bugs.webkit.org/show_bug.cgi?id=39989
+
+ The crash was caused by splitTextElementAtStart and splitTextElementAtEnd assuming that the parent
+ and the grandparent of the specified text node is editable.
+
+ Modified splitTextElementAtStart and splitTextElementAtEnd so that they call splitTextAtStart
+ and splitTextAtEnd respectively when the grandparent is not editable.
+
+ Also modified SplitTextNodeContainingElement to exit early if the grandparent of m_text is not editable.
+
+ Test: editing/style/style-text-node-without-editable-parent.html
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::ApplyStyleCommand::splitTextElementAtStart):
+ (WebCore::ApplyStyleCommand::splitTextElementAtEnd):
+ * editing/SplitTextNodeContainingElementCommand.cpp:
+ (WebCore::SplitTextNodeContainingElementCommand::doApply):
+
+2010-07-26 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Gmail compose is upside-down after r64054
+ https://bugs.webkit.org/show_bug.cgi?id=43000
+
+ We need to call setGeometryOrientation() whenever the iframe compositing layer attachment changes,
+ not just when requiresScrollLayer() returns false. This ensures that the orientation is updated
+ correctly.
+
+ Test: compositing/iframes/iframe-content-flipping.html
+
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::ensureRootPlatformLayer):
+
+2010-07-26 Justin Schuh <jschuh@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Check history state against origin before setting
+ https://bugs.webkit.org/show_bug.cgi?id=42858
+
+ Tests: fast/loader/stateobjects/replacestate-base-illegal.html
+ fast/loader/stateobjects/replacestate-base-legal.html
+
+ * page/History.cpp:
+ (WebCore::History::urlForState):
+ (WebCore::History::stateObjectAdded):
+
+2010-07-26 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Get rid of libgdom
+ https://bugs.webkit.org/show_bug.cgi?id=42378
+
+ Remove all build steps for building GObject DOM bindings.
+
+ * GNUmakefile.am: Remove GObject DOM bindings build.
+
+2010-07-26 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ <http://webkit.org/b/42990> REGRESSION (r63854): Safari RSS layout is broken due to changes in vendor prefix handling
+
+ In r63854 support for properties with the -khtml vendor prefix was removed. This breaks the layout of
+ Safari's RSS interface, several Dashboard widgets that are included with Mac OS X, and at least one
+ popular third-party Mac OS X application. This change will need to be revisited in a manner that has
+ a clearer backwards-compatibility strategy. <http://webkit.org/b/42093> will be reopened to track that.
+
+ * css/CSSParser.cpp:
+ (WebCore::cssPropertyID): Revert the WebCore change from r63854.
+
+2010-07-26 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add ability for WK2 to register a scheme to always be displayed as an empty document
+ https://bugs.webkit.org/show_bug.cgi?id=42995
+
+ No new tests. (Currently not possible to test in WebKit1 DRT, can be testing in future WK2 tester)
+
+ * WebCore.exp.in:
+
+ * loader/MainResourceLoader.cpp:
+ (WebCore::shouldLoadAsEmptyDocument):
+
+ * platform/SchemeRegistry.cpp:
+ (WebCore::emptyDocumentSchemes):
+ (WebCore::SchemeRegistry::registerURLSchemeAsEmptyDocument):
+ (WebCore::SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument):
+ * platform/SchemeRegistry.h:
+
+2010-07-26 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Kent Tamura.
+
+ [WINCE] Port ClipboardUtilities to WinCE
+ https://bugs.webkit.org/show_bug.cgi?id=42929
+
+ Make ClipboardUtilitiesWin more portable and remove the global namespace prefix
+ from GlobalLock/GlobalUnlock, since they are only macros on WinCE.
+
+ * platform/win/ClipboardUtilitiesWin.cpp:
+ (WebCore::urlFromPath):
+ (WebCore::getWebLocData):
+ (WebCore::createGlobalData):
+ (WebCore::getURL):
+ (WebCore::getPlainText):
+ (WebCore::fragmentFromHTML):
+
+2010-07-26 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Buildfix for BitmapImage.h
+ https://bugs.webkit.org/show_bug.cgi?id=42931
+
+ Use AffineTransform insted of TransformationMatrix.
+
+ * platform/graphics/BitmapImage.h:
+
+2010-07-26 Dirk Schulze <krit@webkit.org>
+
+ Unreviewed sort of XCode project file.
+
+ * WebCore.xcodeproj/project.pbxproj:
+
+2010-07-26 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/42982> Streamline Inspector Source build phase script should use CONFIGURATION not BUILD_STYLE
+ <rdar://problem/6341764>
+
+ Reviewed by Mark Rowe.
+
+ * WebCore.xcodeproj/project.pbxproj: Switched Streamline
+ Inspector Source build phase script to use CONFIGURATION instead
+ of BUILD_STYLE.
+
+2010-07-23 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ crash in insertParagraph in a contentEditable list
+ https://bugs.webkit.org/show_bug.cgi?id=42919
+
+ Don't try to break out of a list item if the list it's in
+ is the rootEditableElement.
+
+ * editing/CompositeEditCommand.cpp:
+ (WebCore::CompositeEditCommand::breakOutOfEmptyListItem):
+
+2010-07-26 Marcus Bulach <bulach@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Moves IDBKeyRange to use IDBKey rather than SerializedScriptValue / IDBAny.
+ https://bugs.webkit.org/show_bug.cgi?id=42583
+
+ Tests: existing storage/indexeddb/idb-keyrange.html must pass.
+
+ * storage/IDBKeyRange.cpp:
+ (WebCore::IDBKeyRange::IDBKeyRange):
+ * storage/IDBKeyRange.h:
+ (WebCore::IDBKeyRange::create):
+ (WebCore::IDBKeyRange::left):
+ (WebCore::IDBKeyRange::right):
+ * storage/IDBKeyRange.idl:
+ * storage/IndexedDatabaseRequest.cpp:
+ (WebCore::IndexedDatabaseRequest::makeSingleKeyRange):
+ (WebCore::IndexedDatabaseRequest::makeLeftBoundKeyRange):
+ (WebCore::IndexedDatabaseRequest::makeRightBoundKeyRange):
+ (WebCore::IndexedDatabaseRequest::makeBoundKeyRange):
+ * storage/IndexedDatabaseRequest.h:
+ * storage/IndexedDatabaseRequest.idl:
+
+2010-07-26 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Composited layers don't scroll in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=42771
+
+ Rename two methods on RenderLayerCompositor to make their use more clear, and call them
+ when the FrameView gets resized and scrolled.
+
+ * page/FrameView.h:
+ * page/FrameView.cpp:
+ (WebCore::FrameView::setFrameRect): override so we know when the size of the FrameView changes, so that the
+ RenderLayerCompositor can update its clipping layer.
+ (WebCore::FrameView::scrollPositionChanged): Call compositor()->frameViewDidScroll().
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateAfterWidgetResize): updateContentLayerOffset() was renamed.
+
+ * rendering/RenderLayerCompositor.h:
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::frameViewDidChangeSize): Renamed from updateContentLayerOffset().
+ (WebCore::RenderLayerCompositor::frameViewDidScroll): Renamed from updateContentLayerScrollPosition().
+ (WebCore::RenderLayerCompositor::shouldPropagateCompositingToEnclosingIFrame): Propagate compositing on Mac
+ for any FrameView that doesn't have a native widget, which is the case with WebKit2.
+ (WebCore::RenderLayerCompositor::requiresScrollLayer): New method to tell us whether we need to handle
+ scrolling (and clipping) ourselves.
+ (WebCore::RenderLayerCompositor::ensureRootPlatformLayer): Do geometry flipping on the root platform
+ layer only if we're not doing our own scrolling, and use the new requiresScrollLayer() method.
+ (WebCore::RenderLayerCompositor::attachRootPlatformLayer): Send out the rootPlatformLayer(),
+ so that it returns the clipping layer if we have one.
+
+2010-07-26 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Move DocumentLoadTiming struct to a new file
+ https://bugs.webkit.org/show_bug.cgi?id=42917
+
+ Also makes DocumentLoadTiming Noncopyable.
+
+ No new tests because no new functionality.
+
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * loader/DocumentLoadTiming.h: Added.
+ (WebCore::DocumentLoadTiming::DocumentLoadTiming):
+ * loader/DocumentLoader.h:
+ * loader/FrameLoader.cpp:
+ * loader/FrameLoaderTypes.h:
+ * loader/MainResourceLoader.cpp:
+ * page/Timing.cpp:
+
+2010-07-26 Mark Rowe <mrowe@apple.com>
+
+ Fix an #if in WebCore.exp.in to correctly detect whether SVG filters are enabled.
+
+ * WebCore.exp.in:
+
+2010-07-26 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ DeviceOrientation event listeners should never be called synchronously from addEventListener()
+ https://bugs.webkit.org/show_bug.cgi?id=42304
+
+ No new tests as there are currently no implementations to test. Tests will be
+ added once LayoutTestController methods for providing a mock implementation are
+ in place, see Bug 39589.
+
+ * dom/DeviceOrientationController.cpp:
+ (WebCore::DeviceOrientationController::DeviceOrientationController):
+ (WebCore::DeviceOrientationController::timerFired):
+ (WebCore::DeviceOrientationController::addListener):
+ (WebCore::DeviceOrientationController::removeListener):
+ (WebCore::DeviceOrientationController::removeAllListeners):
+ * dom/DeviceOrientationController.h:
+
+2010-07-26 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Canvas: Optimize GraphicsContext::addPath()
+
+ Avoid "deep concatenating" the canvas path onto the GC path
+ if the GC path has no elements.
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::addPath):
+
+2010-07-23 Stephen White <senorblanco@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Implement OpenGLES2 helper classes.
+ https://bugs.webkit.org/show_bug.cgi?id=42905
+
+ GLES2Canvas and GLES2Texture are some simple OpenGLES2 helper classes
+ for managing state, samplers and textures.
+
+ When this is hooked up, it will be covered by many layout tests.
+
+ * WebCore.gypi:
+ Add new files to chromium build (contents are protected by #if's for now).
+ * platform/graphics/chromium/GLES2Canvas.cpp: Added.
+ (WebCore::affineTo3x3):
+ (WebCore::GLES2Canvas::State::State):
+ (WebCore::GLES2Canvas::GLES2Canvas):
+ (WebCore::GLES2Canvas::~GLES2Canvas):
+ (WebCore::GLES2Canvas::clearRect):
+ (WebCore::GLES2Canvas::fillRect):
+ (WebCore::GLES2Canvas::setFillColor):
+ (WebCore::GLES2Canvas::setAlpha):
+ (WebCore::GLES2Canvas::translate):
+ (WebCore::GLES2Canvas::rotate):
+ (WebCore::GLES2Canvas::scale):
+ (WebCore::GLES2Canvas::concatCTM):
+ (WebCore::GLES2Canvas::save):
+ (WebCore::GLES2Canvas::restore):
+ (WebCore::GLES2Canvas::drawTexturedRect):
+ (WebCore::GLES2Canvas::setCompositeOperation):
+ (WebCore::GLES2Canvas::applyCompositeOperator):
+ (WebCore::GLES2Canvas::getQuadVertices):
+ (WebCore::GLES2Canvas::getQuadIndices):
+ (WebCore::loadShader):
+ (WebCore::GLES2Canvas::getSimpleProgram):
+ (WebCore::GLES2Canvas::getTexProgram):
+ (WebCore::GLES2Canvas::createTexture):
+ (WebCore::GLES2Canvas::getTexture):
+ (WebCore::GLES2Canvas::checkGLError):
+ * platform/graphics/chromium/GLES2Canvas.h: Added.
+ (WebCore::GLES2Canvas::gles2Context):
+ * platform/graphics/chromium/GLES2Texture.cpp: Added.
+ (WebCore::GLES2Texture::GLES2Texture):
+ (WebCore::GLES2Texture::~GLES2Texture):
+ (WebCore::GLES2Texture::create):
+ (WebCore::convertFormat):
+ (WebCore::GLES2Texture::load):
+ (WebCore::GLES2Texture::bind):
+ * platform/graphics/chromium/GLES2Texture.h: Added.
+ (WebCore::GLES2Texture::):
+ (WebCore::GLES2Texture::format):
+ (WebCore::GLES2Texture::width):
+ (WebCore::GLES2Texture::height):
+
+
+2010-07-26 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Fix IndexedDB release build on mac
+ https://bugs.webkit.org/show_bug.cgi?id=42377
+
+ * storage/IDBDatabaseImpl.cpp:
+ (WebCore::IDBDatabaseImpl::objectStore):
+
+2010-07-26 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Add WebKit plumbing to connect speech requests and callbacks between WebCore and the embedder.
+ https://bugs.webkit.org/show_bug.cgi?id=42367
+
+ No new tests, the relevant LayoutTestController bindings will be added in the next patch.
+
+ * page/SpeechInput.cpp: renamed a method.
+ * page/SpeechInput.h: renamed a method.
+ * page/SpeechInputClient.h: added an extra method to optionally let users stop recording once they have spoken.
+ * page/SpeechInputClientListener.h: renamed a method.
+ * page/SpeechInputListener.h: renamed a method.
+
+2010-07-26 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] getImageData(): Single-pass RGB->BGR and un-premultiplication
+ https://bugs.webkit.org/show_bug.cgi?id=42945
+
+ Combine the two operations into a single loop over the pixel data.
+ Yields a considerable FPS gain on http://www.semantix.gr/statue.html
+
+ * platform/graphics/qt/ImageBufferQt.cpp:
+ (WebCore::getImageData):
+
+2010-07-26 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Web Inspector: make sure proxy objects are JSON-stringifiable.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42961
+
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor):
+
+2010-07-26 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Joseph Pecoraro.
+
+ Inspector should remember resources sorting set by the user
+ https://bugs.webkit.org/show_bug.cgi?id=19208
+
+ Sorting options both for time and size graphs are memorized in a single property,
+ which makes them possible to retrieve in a single message (e.g. useful for remote debugging).
+
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel.prototype.populateSidebar):
+ (WebInspector.ResourcesPanel.prototype._settingsLoaded):
+ (WebInspector.ResourcesPanel.prototype._loadSortOptions):
+ (WebInspector.ResourcesPanel.prototype._loadSortOptionForGraph):
+ (WebInspector.ResourcesPanel.prototype._graphSelected):
+ (WebInspector.ResourcesPanel.prototype._changeSortingFunction):
+ (WebInspector.ResourcesPanel.prototype._selectedOptionNameForGraph):
+ (WebInspector.ResourcesPanel.prototype._doChangeSortingFunction):
+ * inspector/front-end/Settings.js:
+ (WebInspector.populateApplicationSettings):
+
+2010-07-25 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Redo fails after text node is split by SplitTextNodeCommand
+ https://bugs.webkit.org/show_bug.cgi?id=42941
+
+ The bug was caused by SplitTextNodeCommand not implementing doReapply.
+ Implemented doReapply and added insertText1AndTrimText2 to share the code between doApply and doReapply.
+
+ Test: editing/undo/redo-split-text-node.html
+ editing/undo/redo-split-text-node-with-removal.html
+
+ * editing/SplitTextNodeCommand.cpp:
+ (WebCore::SplitTextNodeCommand::doApply): Calls executeApply.
+ (WebCore::SplitTextNodeCommand::doUnapply): Don't delete m_text1, which is later used in doReapply.
+ (WebCore::SplitTextNodeCommand::doReapply): Added.
+ (WebCore::SplitTextNodeCommand::insertText1AndTrimText2): Added.
+ * editing/SplitTextNodeCommand.h:
+
+2010-07-23 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Eric Carlson.
+
+ [GTK] media/media-can-play-mpeg-audio.html fails
+ https://bugs.webkit.org/show_bug.cgi?id=42895
+
+ Fixed advertizing of mp3, mpeg and mp4 mime-types in the player.
+
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+ (WebCore::mimeTypeCache):
+
+2010-07-23 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Eric Carlson.
+
+ LayoutTests/media/media-document-audio-size.html failure
+ https://bugs.webkit.org/show_bug.cgi?id=38376
+
+ Advertize audio/x-wav along with audio/wav when appropriate,
+ otherwise WebKit attempts to use a plugin to play the media.
+
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+ (WebCore::mimeTypeCache):
+
+2010-07-25 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Kent Tamura.
+
+ splitTextAt*IfNeed and splitTextElementAt*IfNeed need to be cleaned up
+ https://bugs.webkit.org/show_bug.cgi?id=42937
+
+ Isolated the code to decide whether or not text node should be split into isValidCaretPositionInTextNode.
+ Moved the condition check out of *IfNeeded methods to applyRelativeFontStyleChange and applyInlineStyle.
+
+ No new tests added since this is a clean up.
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): Uses isValidCaretPositionInTextNode.
+ (WebCore::ApplyStyleCommand::applyInlineStyle): Uses isValidCaretPositionInTextNode.
+ (WebCore::ApplyStyleCommand::splitTextAtStart): Renamed from splitTextAtStartIfNeeded.
+ (WebCore::ApplyStyleCommand::splitTextAtEnd): Renamed from splitTextAtEndIfNeeded.
+ (WebCore::ApplyStyleCommand::splitTextElementAtStart): Renamed from splitTextElementAtStartIfNeeded.
+ (WebCore::ApplyStyleCommand::splitTextElementAtEnd): Renamed from splitTextElementAtEndIfNeeded.
+ (WebCore::ApplyStyleCommand::isValidCaretPositionInTextNode): Returns true if the position lies within a text node.
+ * editing/ApplyStyleCommand.h:
+
+2010-07-25 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Kent Tamura.
+
+ [WINCE] Buildfix for ImageBufferWince
+ https://bugs.webkit.org/show_bug.cgi?id=42928
+
+ * platform/graphics/wince/ImageBufferWince.cpp:
+ (WebCore::):
+ (WebCore::BufferedImage::draw): Pass through ColorSpace parameter.
+ (WebCore::BufferedImage::drawPattern): Ditto.
+ (WebCore::ImageBuffer::platformTransformColorSpace): Added.
+
+2010-07-25 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Kent Tamura.
+
+ [WINCE] Buildfix for PopupMenuWin.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=42932
+
+ Add #if !OS(WINCE) around unsupported window messages.
+
+ * platform/win/PopupMenuWin.cpp:
+ (WebCore::PopupMenu::show):
+ (WebCore::PopupMenu::wndProc):
+
+2010-07-25 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Implement adjustMathMLAttributes
+ https://bugs.webkit.org/show_bug.cgi?id=42952
+
+ This is kind of mechanical overkill for adjusting one attribute name,
+ but it's nice to use the same machinery as SVG.
+
+ * html/HTMLTreeBuilder.cpp:
+ * mathml/mathattrs.in:
+
+2010-07-25 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Functions supporting the legacy tree builder are confusing
+ https://bugs.webkit.org/show_bug.cgi?id=42951
+
+ This patch just inlines these functions into their one call site and
+ removes the notImplemented() calls. We thought we were going to grow
+ these to support the new tree builder, but we took a different path.
+ Previous to this patch, these functions were confusing because they
+ looked like part of the new tree builder.
+
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::passTokenToLegacyParser):
+ * html/HTMLTreeBuilder.h:
+
+2010-07-25 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Recent HTML5 TreeBuilder Regression? All canvas tests ASSERT
+ https://bugs.webkit.org/show_bug.cgi?id=42948
+
+ Remove ASSERT and replace with correct branch. I put this ASSERT in
+ to make sure we had test coverage for this branch. I guess we do. :)
+
+ * html/HTMLConstructionSite.cpp:
+ (WebCore::HTMLConstructionSite::attach):
+
+2010-07-25 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: check of jQuery object type prior to treating it as an array.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42946
+
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor):
+
+2010-07-24 Daniel Bates <dbates@rim.com>
+
+ Unreviewed, build fix when building with WML support.
+
+ PageCache.cpp compile error when WML is enabled
+ https://bugs.webkit.org/show_bug.cgi?id=40765
+
+ Remove extraneous semicolon.
+
+ Note, building with WML support enabled is broken
+ even with this fix. See Bug #42943 for more details.
+
+ * history/PageCache.cpp:
+ (WebCore::PageCache::canCachePageContainingThisFrame):
+
+2010-07-24 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Atomize strings used by the HTML5 tree builder
+ https://bugs.webkit.org/show_bug.cgi?id=42875
+
+ This is about a 1% improvement to the parsing benchmark.
+
+ * html/HTMLTagNames.in:
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processStartTagForInBody):
+ (WebCore::HTMLTreeBuilder::processStartTag):
+ (WebCore::HTMLTreeBuilder::processEndTagForInBody):
+ (WebCore::HTMLTreeBuilder::processStartTagForInHead):
+
+2010-07-24 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Darin Adler.
+
+ Buildfix for !ENABLE(INSPECTOR) after r63891.
+ https://bugs.webkit.org/show_bug.cgi?id=42925
+
+ * bindings/js/ScriptValue.cpp: Added property svn:eol-style.
+ * bindings/js/ScriptValue.h: Added property svn:eol-style.
+ * inspector/ConsoleMessage.cpp: Added property svn:eol-style.
+ * inspector/ConsoleMessage.h: Added property svn:eol-style.
+
+2010-07-24 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Re-order whitespace checks in the tokenizer
+ https://bugs.webkit.org/show_bug.cgi?id=42923
+
+ This saves about 0.5% on the parsing benchmark.
+
+ * html/HTMLTokenizer.cpp:
+
+2010-07-24 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] tst_QWebFrame::callQtInvokable() fails
+ https://bugs.webkit.org/show_bug.cgi?id=41065
+
+ Converting JS objects to QVariantMaps was broken.
+ This is a partial revert of <http://trac.webkit.org/changeset/61478>
+
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::convertValueToQVariant): Remove erroneous crash guard
+ around JSObject::getPropertyNames()
+
+2010-07-24 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Save a per-character branch in the HTML parser
+ https://bugs.webkit.org/show_bug.cgi?id=42921
+
+ The parsing benchmark claims this is a wash, but it makes me feel
+ better.
+
+ * html/HTMLToken.h:
+ (WebCore::HTMLToken::clear):
+ (WebCore::HTMLToken::beginStartTag):
+ (WebCore::HTMLToken::beginEndTag):
+ (WebCore::HTMLToken::ensureIsCharacterToken):
+ (WebCore::HTMLToken::beginComment):
+ (WebCore::HTMLToken::beginDOCTYPE):
+ * html/HTMLTokenizer.cpp:
+ (WebCore::HTMLTokenizer::bufferCharacter):
+
+2010-07-23 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Darin Adler.
+
+ Buildfix for !ENABLE(FILTERS) after r63531.
+ https://bugs.webkit.org/show_bug.cgi?id=42914
+
+ * rendering/RenderSVGContainer.cpp: Add missing header.
+
+2010-07-23 Kavita Kanetkar <kkanetkar@chromium.org>
+
+ Reviewed by Joseph Pecoraro.
+
+ Implement remaining Inspector support for chrome's appcache
+ https://bugs.webkit.org/show_bug.cgi?id=42426
+
+ * inspector/InspectorApplicationCacheAgent.cpp:
+ (WebCore::InspectorApplicationCacheAgent::getApplicationCaches):
+ (WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCache):
+ (WebCore::InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources):
+ (WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource):
+ * inspector/InspectorApplicationCacheAgent.h:
+ (WebCore::InspectorController::connectFrontend):
+ * loader/appcache/ApplicationCacheHost.cpp:
+ (WebCore::ApplicationCacheHost::fillResourceList):
+ (WebCore::ApplicationCacheHost::applicationCacheInfo):
+ * loader/appcache/ApplicationCacheHost.h: Changed creation + update times to double and moved appcache info here from InspectorApplicationCacheAgent.h
+ (WebCore::ApplicationCacheHost::CacheInfo::CacheInfo):
+ (WebCore::ApplicationCacheHost::ResourceInfo::ResourceInfo):
+
+2010-07-23 Rafael Antognolli <antognolli@profusion.mobi>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Cleanup glib support (make it optional)
+ https://bugs.webkit.org/show_bug.cgi?id=42480
+
+ No new tests, no new features added.
+ Just add flags and directories for glib if necessary.
+ Put some ifdefs on glib calls.
+
+ * CMakeListsEfl.txt:
+ * platform/graphics/cairo/FontPlatformDataCairo.cpp:
+ (WebCore::FontPlatformData::FontPlatformData):
+
+2010-07-23 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ CanvasRenderingContext2D has lots of style errors
+ https://bugs.webkit.org/show_bug.cgi?id=42918
+
+ CanvasRenderingContext2D.h and .cpp have lots of style errors. I'm planning to post patches
+ to both of these files soon, so to minimize merge conflicts and additional style violations
+ it seems best to fix all of these errors in bulk before posting any functional changes. In
+ particular the header file is incorrectly indented so any correctly formatted addition will
+ be out of place.
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
+ (WebCore::CanvasRenderingContext2D::setFillStyle):
+ (WebCore::CanvasRenderingContext2D::transform):
+ (WebCore::CanvasRenderingContext2D::setTransform):
+ (WebCore::CanvasRenderingContext2D::arcTo):
+ (WebCore::CanvasRenderingContext2D::arc):
+ (WebCore::validateRectForCanvas):
+ (WebCore::CanvasRenderingContext2D::strokeRect):
+ (WebCore::CanvasRenderingContext2D::drawImage):
+ (WebCore::CanvasRenderingContext2D::createRadialGradient):
+ (WebCore::CanvasRenderingContext2D::createPattern):
+ (WebCore::CanvasRenderingContext2D::willDraw):
+ (WebCore::CanvasRenderingContext2D::createImageData):
+ (WebCore::CanvasRenderingContext2D::putImageData):
+ (WebCore::CanvasRenderingContext2D::setFont):
+ (WebCore::CanvasRenderingContext2D::drawTextInternal):
+ * html/canvas/CanvasRenderingContext2D.h:
+ (WebCore::CanvasRenderingContext2D::is2d):
+ (WebCore::CanvasRenderingContext2D::getLineCap):
+ (WebCore::CanvasRenderingContext2D::getLineJoin):
+ (WebCore::CanvasRenderingContext2D::state):
+ (WebCore::CanvasRenderingContext2D::):
+
+2010-07-23 Adam Barth <abarth@webkit.org>
+
+ Remove FIXME that we already fixed.
+
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processCharacter):
+
+2010-06-24 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ Move more form submission logic into FormSubmission.
+ https://bugs.webkit.org/show_bug.cgi?id=41110
+
+ Two major moves:
+ * Fold HTMLFormElement::prepareFormSubmission into FormSubmission::create
+ * Move non-static (non-FormData-building) methods of FormDataBuilder
+ to FormSubmission::Attributes.
+
+ Mechanical moving, no change in behavior, so no new tests.
+
+ * WebCore.xcodeproj/project.pbxproj: Gave FormDataBuilder.h "project" and
+ FormSubmission.h "private" visibility.
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::submit): Changed to use FormSubmission::create.
+ (WebCore::HTMLFormElement::parseMappedAttribute): Changed to use m_attributes.
+ * html/HTMLFormElement.h:
+ (WebCore::HTMLFormElement::enctype): Ditto.
+ (WebCore::HTMLFormElement::encoding): Ditto.
+ (WebCore::HTMLFormElement::acceptCharset): Ditto.
+ * loader/FormSubmission.cpp:
+ (WebCore::generateFormDataIdentifier): Moved from HTMLFormElement.
+ (WebCore::appendMailtoPostFormDataToURL): Ditto.
+ (WebCore::FormSubmission::Attributes::parseAction): Moved from FormDataBuilder.
+ (WebCore::FormSubmission::Attributes::parseEncodingType): Ditto.
+ (WebCore::FormSubmission::Attributes::parseMethodType): Ditto.
+ (WebCore::FormSubmission::FormSubmission): Made inline.
+ (WebCore::FormSubmission::create): Added logic that used to be in
+ HTMLFormElement::prepareFormSubmission.
+ * loader/FormSubmission.h:
+ (WebCore::FormSubmission::):
+ (WebCore::FormSubmission::Attributes::Attributes): Added new class.
+ (WebCore::FormSubmission::Attributes::method): Moved from FormDataBuilder.
+ (WebCore::FormSubmission::Attributes::isMultiPartForm): Ditto.
+ (WebCore::FormSubmission::Attributes::action): Ditto.
+ (WebCore::FormSubmission::Attributes::target): Ditto.
+ (WebCore::FormSubmission::Attributes::setTarget): Ditto.
+ (WebCore::FormSubmission::Attributes::encodingType): Ditto.
+ (WebCore::FormSubmission::Attributes::acceptCharset): Ditto.
+ (WebCore::FormSubmission::Attributes::setAcceptCharset): Ditto.
+ (WebCore::FormSubmission::target): Ditto.
+ (WebCore::FormSubmission::contentType): Const-ified return type.
+ (WebCore::FormSubmission::boundary): Ditto.
+ * platform/network/FormDataBuilder.cpp:
+ (WebCore::FormDataBuilder::encodingFromAcceptCharset): Renamed method for clarity,
+ made it use param instead of a class member.
+ * platform/network/FormDataBuilder.h:
+ (WebCore::FormDataBuilder::FormDataBuilder): Made constructor private.
+ * wml/WMLGoElement.cpp: Changed to use FormSubmision::Attributes.
+ * wml/WMLGoElement.h: Ditto.
+
+2010-07-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ HTML5 Parser: document.write in a asynchronous script which is specified to load before page finish blows away document
+ https://bugs.webkit.org/show_bug.cgi?id=42365
+
+ This patch implements the changes Ian made to HTML5 to address these
+ issues. Let's try it and see how well it works.
+
+ Test: http/tests/misc/write-from-dom-script.html
+
+ * dom/Document.cpp:
+ (WebCore::Document::Document):
+ (WebCore::Document::write):
+ * dom/Document.h:
+ (WebCore::Document::writeDisabled):
+ (WebCore::Document::setWriteDisabled):
+ * dom/DocumentParser.h:
+ (WebCore::DocumentParser::hasInsertionPoint):
+ * dom/ScriptElement.cpp:
+ (WebCore::ScriptElement::insertedIntoDocument):
+ (WebCore::ScriptElementData::ScriptElementData):
+ (WebCore::ScriptElementData::evaluateScript):
+ * dom/ScriptElement.h:
+ (WebCore::ScriptElementData::writeDisabled):
+ (WebCore::ScriptElementData::setWriteDisabled):
+ * html/HTMLDocumentParser.cpp:
+ (WebCore::HTMLDocumentParser::hasInsertionPoint):
+ (WebCore::HTMLDocumentParser::insert):
+ * html/HTMLDocumentParser.h:
+
+2010-07-23 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Buildfix for PopupMenuWin.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=42906
+
+ Use correct API for BitmapInfo landed in r63944.
+
+ * platform/win/PopupMenuWin.cpp:
+ (WebCore::PopupMenu::paint):
+
+2010-07-23 fsamuel@chromium.org <fsamuel@chromium.org>
+
+ Reviewed by David Hyatt.
+
+ Updated table painting to draw cell layers in the correct order.
+
+ Table Cell Layering
+ https://bugs.webkit.org/show_bug.cgi?id=40775
+
+ Tests: tables/layering/paint-test-layering-1.html
+ tables/layering/paint-test-layering-2.html
+
+ * accessibility/AccessibilityTable.cpp:
+ (WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
+ (WebCore::AccessibilityTable::addChildren):
+ (WebCore::AccessibilityTable::cellForColumnAndRow):
+ * accessibility/AccessibilityTableCell.cpp:
+ (WebCore::AccessibilityTableCell::titleUIElement):
+ * accessibility/AccessibilityTableColumn.cpp:
+ (WebCore::AccessibilityTableColumn::headerObjectForSection):
+ * rendering/AutoTableLayout.cpp:
+ (WebCore::AutoTableLayout::recalcColumn):
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::splitColumn):
+ (WebCore::RenderTable::calcBorderLeft):
+ (WebCore::RenderTable::calcBorderRight):
+ (WebCore::RenderTable::cellAbove):
+ (WebCore::RenderTable::cellBelow):
+ (WebCore::RenderTable::cellBefore):
+ (WebCore::RenderTable::cellAfter):
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::RenderTableSection):
+ (WebCore::RenderTableSection::ensureRows):
+ (WebCore::RenderTableSection::addCell):
+ (WebCore::RenderTableSection::setCellWidths):
+ (WebCore::RenderTableSection::calcRowHeight):
+ (WebCore::RenderTableSection::layoutRows):
+ (WebCore::RenderTableSection::calcOuterBorderTop):
+ (WebCore::RenderTableSection::calcOuterBorderBottom):
+ (WebCore::RenderTableSection::calcOuterBorderLeft):
+ (WebCore::RenderTableSection::calcOuterBorderRight):
+ (WebCore::RenderTableSection::firstLineBoxBaseline):
+ (WebCore::compareCellPositions):
+ (WebCore::RenderTableSection::paintCell):
+ (WebCore::RenderTableSection::paintObject):
+ (WebCore::RenderTableSection::numColumns):
+ (WebCore::RenderTableSection::appendColumn):
+ (WebCore::RenderTableSection::splitColumn):
+ (WebCore::RenderTableSection::nodeAtPoint):
+ * rendering/RenderTableSection.h:
+ (WebCore::RenderTableSection::CellStruct::CellStruct):
+ (WebCore::RenderTableSection::CellStruct::primaryCell):
+ (WebCore::RenderTableSection::CellStruct::hasCells):
+ (WebCore::RenderTableSection::primaryCellAt):
+
+2010-07-23 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Buildfix for Path.h
+ https://bugs.webkit.org/show_bug.cgi?id=42904
+
+ * platform/graphics/Path.h: Add missing typedef PlatformPath.
+
+2010-07-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Reserve capacity for attributes
+ https://bugs.webkit.org/show_bug.cgi?id=42877
+
+ This is about a 1.7% improvement to the parsing benchmark.
+
+ * html/HTMLToken.h:
+ (WebCore::AtomicHTMLToken::AtomicHTMLToken):
+
+2010-07-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Inline HTMLElementStack::top
+ https://bugs.webkit.org/show_bug.cgi?id=42879
+
+ According to sampling, HTMLElementStack::top is the hotest function in
+ the treebuilder. Inlining it is about a 0.3% improvement to the
+ parsing benchmark. This squares with how often it occurs in samples.
+
+ * html/HTMLElementStack.cpp:
+ * html/HTMLElementStack.h:
+ (WebCore::HTMLElementStack::top):
+
+2010-07-23 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Buildfix for GraphicsContext
+ https://bugs.webkit.org/show_bug.cgi?id=42888
+
+ Use AffineTransform insted of TransformationMatrix and
+ add ColorSpace parameter to the drawBitmap methods.
+
+ * platform/graphics/GraphicsContext.h:
+ * platform/graphics/wince/GraphicsContextWince.cpp:
+ (WebCore::GraphicsContext::affineTransform):
+ (WebCore::GraphicsContext::fillRoundedRect):
+ (WebCore::GraphicsContext::drawBitmap):
+ (WebCore::GraphicsContext::drawBitmapPattern):
+
+2010-07-23 Rafael Antognolli <antognolli@profusion.mobi>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Add support for using libcurl network backend.
+ https://bugs.webkit.org/show_bug.cgi?id=42286
+
+ Add files and flags for soup/curl specific backend being
+ used.
+ Put some ifdefs around soup/glib calls.
+
+ No new tests, no new features implemented.
+
+ * CMakeListsEfl.txt:
+ * platform/efl/FileSystemEfl.cpp:
+ (WebCore::fileSystemRepresentation):
+
+2010-07-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add fast-reject path for InputStreamPreprocessor::peek
+ https://bugs.webkit.org/show_bug.cgi?id=42881
+
+ This is about a 2.5% speedup on the parsing benchmark.
+
+ * html/HTMLTokenizer.h:
+ (WebCore::HTMLTokenizer::InputStreamPreprocessor::peek):
+
+2010-07-23 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Merge PasteboardWince.cpp into PasteboardWin.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=42885
+
+ Make PasteboardWin more portable and remove the global namespace prefix
+ from GlobalLock/GlobalUnlock, since they are only macros on WinCE.
+
+ * platform/win/PasteboardWin.cpp:
+ (WebCore::PasteboardOwnerWndProc):
+ (WebCore::Pasteboard::Pasteboard):
+ (WebCore::Pasteboard::plainText):
+ (WebCore::Pasteboard::documentFragment):
+
+2010-07-23 Justin Schuh <jschuh@chromium.org>
+
+ Unreviewed, rolling out r63925.
+ http://trac.webkit.org/changeset/63925
+ https://bugs.webkit.org/show_bug.cgi?id=42858
+
+ Introduced a regression in history state.
+
+ * page/History.cpp:
+ (WebCore::History::urlForState):
+
+2010-07-23 Martin Robinson <mrobinson@igalia.com>
+
+ Unreviewed build fix.
+
+ Fix make dist by aligning the source list with currently used headers.
+
+ * GNUmakefile.am:
+
+2010-07-23 Alex Milowski <alex@milowski.com>
+
+ Reviewed by Darin Adler.
+
+ Moved the 'mathml' group back to where it belongs as
+ siblings of the other major folders.
+
+ * WebCore.xcodeproj/project.pbxproj:
+
+2010-07-23 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Adam Roben.
+
+ Buildfix for WinCE graphics after r56015.
+ https://bugs.webkit.org/show_bug.cgi?id=41354
+
+ Use fabs() insetead of abs().
+
+ * platform/graphics/wince/GraphicsContextWince.cpp:
+ (WebCore::GraphicsContext::fillRect):
+ * platform/graphics/wince/PlatformPathWince.cpp:
+ (WebCore::PlatformPath::addArcTo):
+
+2010-07-23 ryuan choi <ryuan.choi@samsung.com>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL]build break because of r63927
+ https://bugs.webkit.org/show_bug.cgi?id=42864
+
+ * CMakeLists.txt:
+
+2010-07-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Inline HTMLTokenizer::InputStreamPreprocessor::peek
+ https://bugs.webkit.org/show_bug.cgi?id=42880
+
+ According to sampling HTMLTokenizer::InputStreamPreprocessor::peek is
+ the hotest function in the tokenizer. Inlining this function is about
+ a 2.2% speedup on the parser benchmark. Turns out the tokenizer is
+ much hotter than the tree builder. :)
+
+ * html/HTMLTokenizer.h:
+ (WebCore::HTMLTokenizer::InputStreamPreprocessor::peek):
+
+2010-07-23 Andras Becsi <abecsi@webkit.org>
+
+ Unreviewed build fix.
+
+ [Qt] Fix WebKit2 linkage.
+
+ No new tests needed.
+
+ * WebCore.pro: add InjectedBundlePageEditorClient.cpp to WK2 sources
+
+2010-07-23 Balazs Kelemen <kb@inf.u-szeged.hu>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Setup the QtWebProcess
+
+ https://bugs.webkit.org/show_bug.cgi?id=42623
+
+ * WebCore.pro: Added WebProcessMainQt.cpp to SOURCES.
+
+2010-07-23 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed: Chromium tests fix.
+
+ * inspector/CodeGeneratorInspector.pm:
+
+2010-07-23 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Buildfix for PluginDatabaseWin.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=41887
+
+ Define KEY_ENUMERATE_SUB_KEYS only if not defined.
+
+ * plugins/win/PluginDatabaseWin.cpp:
+
+2010-07-23 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Chromium DevTools: migrate from utility context-based injected
+ script dispatch to upstream schema.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42883
+
+ * bindings/v8/ScriptProfile.cpp:
+ (WebCore::ScriptProfile::title):
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::getProfile):
+ * inspector/front-end/InjectedScriptAccess.js:
+
+2010-07-23 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed: rolling out r63963.
+
+ * bindings/v8/ScriptProfile.cpp:
+ (WebCore::ScriptProfile::title):
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::getProfile):
+ * inspector/front-end/InjectedScriptAccess.js:
+
+2010-07-23 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Chromium DevTools: migrate from utility context-based injected
+ script dispatch to upstream schema.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42883
+
+ * bindings/v8/ScriptProfile.cpp:
+ (WebCore::ScriptProfile::title):
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::getProfile):
+ * inspector/front-end/InjectedScriptAccess.js:
+ (InjectedScriptAccess.get if):
+ (InjectedScriptAccess):
+
+2010-07-23 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: error info propagation in InspectorBackendDispatch should be improved
+ https://bugs.webkit.org/show_bug.cgi?id=42873
+
+ * inspector/CodeGeneratorInspector.pm: report wrong parameter count and wrong
+ parametere type errror to the dispatch method caller
+
+2010-07-23 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: injectedScriptId is missing in the stack frame wrappers.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42889
+
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor):
+
+2010-07-23 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ Backslash isn't transcoded in <input>
+ https://bugs.webkit.org/show_bug.cgi?id=42878
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+
+2010-07-22 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ WebInspector: CodeGeneratorInspector was extended and now it can
+ generate InspectorBackedDispatcher's code. This dispatcher will
+ validate and dispatch incoming inspector commands only by native
+ code without using javaScript. That is necessary step for
+ RemoteDebugging support.
+ https://bugs.webkit.org/show_bug.cgi?id=42588
+
+ * GNUmakefile.am:
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * WebCore.pri:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * inspector/CodeGeneratorInspector.pm:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ * inspector/InspectorController.h:
+ (WebCore::InspectorController::inspectorBackendDispatcher):
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel.prototype.setDocument):
+
+2010-07-22 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ Backslash is transcoded into yen sign even when non japanese font is specified
+ https://bugs.webkit.org/show_bug.cgi?id=39654
+
+ Test: fast/text/backslash-to-yen-sign-euc.html
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty): Call FontDescriptor::setIsSpecifiedFont.
+ * platform/graphics/Font.cpp:
+ (WebCore::Font::Font):
+ * platform/graphics/FontDescription.h: Added m_isSpecifiedFont and its accessors.
+ (WebCore::FontDescription::FontDescription):
+ (WebCore::FontDescription::isSpecifiedFont):
+ (WebCore::FontDescription::setIsSpecifiedFont):
+ (WebCore::FontDescription::operator==):
+ * platform/text/transcoder/FontTranscoder.cpp:
+ (WebCore::FontTranscoder::converterType): Don't transcode backslashes if a font family is explicitly specified.
+ (WebCore::FontTranscoder::convert):
+ (WebCore::FontTranscoder::needsTranscoding):
+ * platform/text/transcoder/FontTranscoder.h: Change the arguments from AtomicString fontFamily to Font.
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::updateNeedsTranscoding):
+ (WebCore::RenderText::setTextInternal):
+
+2010-07-22 Jon Honeycutt <jhoneycutt@apple.com>
+
+ Windows build fix.
+
+ Commit some changes missed by the commit-queue in r63944.
+
+ * platform/win/BitmapInfo.h:
+ (WebCore::BitmapInfo::is16bit):
+ (WebCore::BitmapInfo::is32bit):
+ (WebCore::BitmapInfo::width):
+ (WebCore::BitmapInfo::height):
+ (WebCore::BitmapInfo::size):
+ (WebCore::BitmapInfo::paddedWidth):
+ (WebCore::BitmapInfo::numPixels):
+ (WebCore::BitmapInfo::paddedBytesPerLine):
+ (WebCore::BitmapInfo::bytesPerLine):
+
+2010-07-22 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Add additonal methods to BitmapInfo.
+ https://bugs.webkit.org/show_bug.cgi?id=42071
+
+ Added a parameter to create 16bit BitmapInfo and
+ some additional accessors for the WinCE port.
+
+ Set bmiHeader.biSize only at constructor.
+
+ * platform/win/BitmapInfo.cpp: Added property svn:eol-style.
+ (WebCore::bitmapInfoForSize):
+ (WebCore::BitmapInfo::create):
+ (WebCore::BitmapInfo::createBottomUp):
+ * platform/win/BitmapInfo.h: Added property svn:eol-style.
+ (WebCore::BitmapInfo::is16bit):
+ (WebCore::BitmapInfo::is32bit):
+ (WebCore::BitmapInfo::width):
+ (WebCore::BitmapInfo::height):
+ (WebCore::BitmapInfo::size):
+ (WebCore::BitmapInfo::paddedWidth):
+ (WebCore::BitmapInfo::numPixels):
+ (WebCore::BitmapInfo::paddedBytesPerLine):
+ (WebCore::BitmapInfo::bytesPerLine):
+
+2010-07-22 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Ojan Vafai.
+
+ Autoscroll on selection should take scrollbars into account as outside of the content.
+ https://bugs.webkit.org/show_bug.cgi?id=40403
+
+ ScrollView's scroll-bar was considered as a part of content rect,
+ that prevents autoscroll to happen when the pointer is over the
+ scroll-bar. This change excluded scroll-bar region from scrolling
+ delta calculation.
+
+ Test: WebCore/manual-tests/autoscroll-over-scrollbar.html
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::scrollRectToVisible):
+
+2010-07-22 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ maxLength should not be applied to non-text types
+ https://bugs.webkit.org/show_bug.cgi?id=42814
+
+ According to the HTML5 specification, maxLength attribute should
+ be applied to text, search, url, tel, email, and password types.
+
+ Test: fast/forms/input-maxlength-unsupported.html
+
+ * dom/InputElement.cpp:
+ (WebCore::InputElement::handleBeforeTextInsertedEvent):
+ Apply maxLength() only if supportsMaxLength() is true.
+ * dom/InputElement.h:
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::patternMismatch):
+ Code cleanup by isTextType().
+ (WebCore::HTMLInputElement::tooLong):
+ ditto.
+ (WebCore::HTMLInputElement::isTextType):
+ Added. This returns true for types with maxLength/pattern/placeholder.
+ * html/HTMLInputElement.h:
+ (WebCore::HTMLInputElement::supportsMaxLength):
+ Added. Just calls isTextType().
+ (WebCore::HTMLInputElement::supportsPlaceholder):
+ Code cleanup by isTextType().
+ * wml/WMLInputElement.h:
+ (WebCore::WMLInputElement::supportsMaxLength):
+ Added. Always returns true.
+
+2010-07-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Kent Tamura.
+
+ [cleanup] logic to extract adjacent lists and list children in listifyParagraph and unlistifyParagraph should be isolated
+ https://bugs.webkit.org/show_bug.cgi?id=42841
+
+ Added enclosingListChild that takes the list node containing the node for the second argument
+ to ensure that it only returns the enclosing list child of the specified list node.
+
+ Added adjacentEnclosingList that finds adjacent lists of the specified position.
+ It takes the current position, the adjacent position that may or may not have a list, and the list type,
+ and avoids a list that belongs to a different table cell or an outer list that contains the current position.
+
+ No new tests needed.
+
+ * editing/InsertListCommand.cpp:
+ (WebCore::enclosingListChild): Added. See above.
+ (WebCore::InsertListCommand::unlistifyParagraph): Uses enclosingListChild.
+ (WebCore::adjacentEnclosingList): Added. See above.
+ (WebCore::InsertListCommand::listifyParagraph): Uses adjacentEnclosingList.
+
+2010-07-22 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Adam Roben.
+
+ [WIN] Correct DeleteObject usage in PasteboardWin
+ https://bugs.webkit.org/show_bug.cgi?id=41956
+
+ Call DeleteObject() if OpenClipboard() fails and don't
+ call DeleteObject() on objects returned from SelectObject().
+
+ * platform/win/PasteboardWin.cpp:
+ (WebCore::Pasteboard::writeImage):
+
+2010-07-22 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Log function is incorrectly used.
+ r63804 used LOG function, but it should receive one more parameter.
+ Used LOG_ERROR instead, since this is an error message.
+ https://bugs.webkit.org/show_bug.cgi?id=42842
+
+ * platform/efl/WidgetEfl.cpp:
+ (WebCore::Widget::applyFallbackCursor): use LOG_ERROR in place of LOG
+
+2010-07-22 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ Cancel button of search input field should fire input/change events
+ https://bugs.webkit.org/show_bug.cgi?id=34393
+
+ Test: fast/forms/search-cancel-button-events.html
+
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
+
+2010-07-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ Fix for <rdar://problem/8222626>
+ Send textDidChangeInTextField delegate callback only in response to typing or other forms of user text input.
+
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ Update project files.
+
+ * dom/UserTypingGestureIndicator.cpp: Copied from dom/UserGestureIndicator.cpp.
+ (WebCore::UserTypingGestureIndicator::processingUserTypingGesture):
+ (WebCore::focusedNode):
+ (WebCore::UserTypingGestureIndicator::focusedElementAtGestureStart):
+ (WebCore::UserTypingGestureIndicator::UserTypingGestureIndicator):
+ (WebCore::UserTypingGestureIndicator::~UserTypingGestureIndicator):
+ * dom/UserTypingGestureIndicator.h: Copied from dom/UserGestureIndicator.h.
+ Version of UserGestureIndicator that just tracks keyboard gestures and the focused
+ node they were targeting.
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::confirmComposition):
+ (WebCore::Editor::setComposition):
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::keyEvent):
+ Put UserTypingGestureIndicator on the stack for user generated keyboard events.
+
+2010-07-22 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ <input type=number> stepper buttons should dispatch input/change events
+ https://bugs.webkit.org/show_bug.cgi?id=42440
+
+ Test: fast/forms/input-number-events.html
+
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::stepUpFromRenderer):
+ Sets a flag to dispatch 'change' event and dispatches 'input' event
+ if the value is changed.
+
+2010-07-22 Justin Schuh <jschuh@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Make history state methods validate against document URL
+ https://bugs.webkit.org/show_bug.cgi?id=42858
+
+ Test: fast/history/history-replace-illegal.html
+
+ * page/History.cpp:
+ (WebCore::History::urlForState):
+
+2010-07-22 Andy Estes <aestes@apple.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ When there are no beforeload listeners on a document,
+ HTMLLinkElement::process() should be called immediately when the node is
+ inserted into the document, rather than waiting until after attach is
+ performed.
+ <https://bugs.webkit.org/show_bug.cgi?id=42859>
+ <rdar://problem/8194528>
+
+ No new tests.
+
+ * html/HTMLLinkElement.cpp:
+ (WebCore::HTMLLinkElement::insertedIntoDocument): If there are no
+ beforeload listeners, call process() immediately. Otherwise, add it as
+ a post-attach callback.
+
+2010-07-22 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Simon Fraser.
+
+ REGRESSION: box shadows on WebGL canvas elements repainted every frame
+ https://bugs.webkit.org/show_bug.cgi?id=42852
+
+ Avoid calling HTMLCanvasElement::willDraw() every time a WebGL canvas'
+ contents update. This call is only needed in the non-compositing
+ rendering path.
+
+ Covered by fast/canvas/webgl/canvas-test.html
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::markContextChanged):
+ (WebCore::WebGLRenderingContext::paintRenderingResultsToCanvas):
+
+2010-07-22 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Ojan Vafai.
+
+ Remove useless PlatformScrollBar
+ https://bugs.webkit.org/show_bug.cgi?id=41911
+
+ * WebCore.gypi:
+ * platform/win/PlatformScrollBar.h: Removed.
+ * platform/win/PlatformScrollBarWin.cpp: Removed.
+
+2010-07-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Ojan Vafai.
+
+ [Windows] Home hey doesn't work in first DIV inside a TABLE
+ https://bugs.webkit.org/show_bug.cgi?id=42767
+
+ The bug was caused by positionAvoidingFirstPositionInTable moving outside of the editing region.
+ Added a check so that it avoids the first position in the table only if the table is editable.
+
+ Test: editing/selection/home-inside-noneditable-table.html
+
+ * editing/visible_units.cpp:
+ (WebCore::positionAvoidingFirstPositionInTable):
+
+2010-07-22 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Laszlo Gombos.
+
+ Fix build warning for missing parentheses.
+
+ WebCore/html/HTMLInputElement.cpp:113: warning: suggest parentheses around '&&' within '||'
+
+ * html/HTMLInputElement.cpp:
+ (WebCore::isNumberCharacter):
+
+2010-07-22 John Gregg <johnnyg@google.com>
+
+ Reviewed by Kent Tamura.
+
+ [chromium] fast/forms/input-file-directory-upload.html fails on win after r63454
+ https://bugs.webkit.org/show_bug.cgi?id=42768
+
+ Normalize path separators for the script API by convering \'s to /'s.
+
+ Covered by input-file-directory-upload.html
+
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::setFileListFromRenderer):
+
+2010-07-22 Dmitry Titov <dimich@chromium.org>
+
+ Rubberstamped by Simon Fraser.
+
+ * platform/PlatformStrategies.h:
+ (WebCore::PlatformStrategies::PlatformStrategies): Add initialization of m_localizationStrategy.
+
+2010-07-22 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ Make db.changeVersion()'s third parameter optional, as required by the spec.
+ https://bugs.webkit.org/show_bug.cgi?id=42787
+
+ * bindings/js/JSDatabaseCustom.cpp:
+ (WebCore::JSDatabase::changeVersion):
+ * bindings/js/JSDatabaseSyncCustom.cpp:
+ (WebCore::JSDatabaseSync::changeVersion):
+ * bindings/v8/custom/V8DatabaseCustom.cpp:
+ (WebCore::V8Database::changeVersionCallback):
+ * bindings/v8/custom/V8DatabaseSyncCustom.cpp:
+ (WebCore::V8DatabaseSync::changeVersionCallback):
+ * storage/SQLTransaction.cpp:
+ (WebCore::SQLTransaction::deliverTransactionCallback):
+ * storage/SQLTransactionSync.cpp:
+ (WebCore::SQLTransactionSync::execute):
+
+2010-07-20 Jessie Berlin <jberlin@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Code Generator: Allow negative and string constants.
+ Also add tests for hexadecimal numbers.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ If it is a string, do not try to cast it to an int.
+
+ * bindings/scripts/IDLStructure.pm:
+ Add a regex just for constant values that allows strings, hexadecimal numbers, and integral numbers.
+
+ * bindings/scripts/test/CPP/WebDOMTestObj.h:
+ Update the tests.
+
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ Ditto.
+
+ * bindings/scripts/test/JS/JSTestObj.h:
+ Ditto.
+
+ * bindings/scripts/test/ObjC/DOMTestObj.h:
+ Ditto.
+
+ * bindings/scripts/test/TestObj.idl:
+ Add tests for negative numbers, strings, and hexadecimal numbers.
+
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ Update the tests.
+
+2010-07-22 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Composited layers don't scroll in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=42771
+
+ More prep work: make a single scrollPositionChanged() bottleneck method, and use it to
+ send the scroll event, repaint fixed elements, and update compositing layers.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::scrollPositionChangedViaPlatformWidget):
+ (WebCore::FrameView::scrollPositionChanged):
+ (WebCore::FrameView::repaintFixedElementsAfterScrolling):
+ (WebCore::FrameView::valueChanged):
+ * page/FrameView.h:
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::valueChanged):
+
+2010-07-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=42836
+ Add localized strings stubs for WebKit2.
+
+ - Convert WebKit (mac) to use a LocalizationStrategy rather than the WebCoreViewFactory
+ for localized strings.
+
+ Gets us below 200 tests failing in WebKitTestRunner.
+
+ * WebCore.exp.in:
+ * WebCore.xcodeproj/project.pbxproj:
+ * page/mac/WebCoreViewFactory.h:
+ * platform/LocalizationStrategy.h: Added.
+ (WebCore::LocalizationStrategy::~LocalizationStrategy):
+ * platform/PlatformStrategies.h:
+ (WebCore::PlatformStrategies::pluginStrategy):
+ (WebCore::PlatformStrategies::localizationStrategy):
+ (WebCore::PlatformStrategies::PlatformStrategies):
+ (WebCore::PlatformStrategies::~PlatformStrategies):
+ * platform/mac/LocalizedStringsMac.mm:
+
+2010-07-22 Andras Becsi <abecsi@webkit.org>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] Implement WebContext::applicationCacheDirectory() for the Qt port of WebKit2.
+ https://bugs.webkit.org/show_bug.cgi?id=42830
+
+ No new tests needed.
+
+ * WebCore.pri: add ApplicationCacheStorage.h to wk2 headers
+ * WebCore.pro: add WebContextQt.cpp to sources
+
+2010-07-22 Joone Hur <joone.hur@samsung.com>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] add support for logging
+ https://bugs.webkit.org/show_bug.cgi?id=40807
+
+ Enable to turn log channels on for EFL port
+
+ * platform/efl/LoggingEfl.cpp:
+ (WebCore::InitializeLoggingChannelsIfNecessary):
+
+2010-07-22 Balazs Kelemen <kb@inf.u-szeged.hu>
+
+ Ureviewed build fix.
+
+ [Qt] Fix WebKit2 build
+
+ https://bugs.webkit.org/show_bug.cgi?id=42638
+
+ * WebCore.pri:
+ * WebCore.pro:
+
+2010-07-22 Andrey Kosyakov <caseq@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Stop granting universal access to inspector front-end page.
+ https://bugs.webkit.org/show_bug.cgi?id=42817
+
+ * inspector/InspectorFrontendClientLocal.cpp:
+ (WebCore::InspectorFrontendClientLocal::windowObjectCleared):
+
+2010-07-22 Yury Semikhatsky <yurys@chromium.org>
+
+ Unreviewed. Fix inspector console tests crashes.
+
+ * bindings/v8/ScriptValue.cpp:
+ (WebCore::v8ToInspectorValue):
+ (WebCore::ScriptValue::toInspectorValue): enter v8 context before calling GetPropertyNames
+
+2010-07-22 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Unreviewed build fix.
+
+ [EFL] Build break for SVN r63881
+ https://bugs.webkit.org/show_bug.cgi?id=42813
+
+ * CMakeLists.txt: Add platform/SchemeRegistry.cpp
+
+2010-07-22 Hayato Ito <hayato@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Refactor CSSSelector's destructor and make it inline.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42726
+
+ Refactor with no behavior change, thus no new tests.
+
+ * css/CSSSelector.cpp:
+ (WebCore::CSSSelectorBag::~CSSSelectorBag): Make sure the bag is empty.
+ (WebCore::CSSSelectorBag::add): Renamed from append().
+ (WebCore::CSSSelector::releaseOwnedSelectorsToBag):
+ (WebCore::CSSSelector::deleteReachableSelectors):
+ * css/CSSSelector.h:
+ (WebCore::CSSSelector::~CSSSelector):
+
+2010-07-22 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: should be possible to convert console message arguments to InspectorValues
+ https://bugs.webkit.org/show_bug.cgi?id=42457
+
+ Now it is possible to convert simple JavaScript objects to
+ InspectorValues.
+
+ * bindings/js/ScriptValue.cpp:
+ (WebCore::jsToInspectorValue):
+ (WebCore::ScriptValue::toInspectorValue):
+ * bindings/js/ScriptValue.h:
+ * bindings/v8/ScriptValue.cpp:
+ (WebCore::v8ToInspectorValue):
+ (WebCore::ScriptValue::toInspectorValue):
+ * bindings/v8/ScriptValue.h:
+ * inspector/ConsoleMessage.cpp: console notifications are pushed to RemoteInspectorFrontend instead of InspectorFrontend.
+ (WebCore::ConsoleMessage::CallFrame::buildInspectorObject):
+ (WebCore::ConsoleMessage::addToFrontend):
+ (WebCore::ConsoleMessage::updateRepeatCountInConsole):
+ * inspector/ConsoleMessage.h:
+ * inspector/InjectedScript.cpp:
+ (WebCore::InjectedScript::wrapForConsole): return InspectorValue instead of SerializedScriptValue
+ * inspector/InjectedScript.h:
+ * inspector/Inspector.idl:
+ * inspector/InspectorBackend.cpp:
+ (WebCore::InspectorBackend::clearConsoleMessages): send response directly from the backend
+ (WebCore::InspectorBackend::remoteFrontend):
+ * inspector/InspectorBackend.h:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::addConsoleMessage):
+ (WebCore::InspectorController::clearConsoleMessages): don't send notification to the front end,
+ it will be send either from InspectorBackend.cpp if it was a user request or reset message will
+ be send to the front end if the messages are cleared due to page navigation.
+ (WebCore::InspectorController::populateScriptObjects):
+ * inspector/front-end/ConsoleView.js:
+ * inspector/front-end/inspector.js:
+
+2010-07-22 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Modifying settings actually modifies defaultValues
+ https://bugs.webkit.org/show_bug.cgi?id=42816
+
+ Avoid using live modifiable objects as property default values.
+
+ * inspector/front-end/Settings.js:
+ (WebInspector.Settings):
+ (WebInspector.Settings.prototype.reset):
+ (WebInspector.Settings.prototype._load):
+ (WebInspector.Settings.prototype.installSetting):
+ (WebInspector.Settings.prototype._get):
+
+2010-07-22 Ben Murdoch <benm@google.com>
+
+ Reviewed by Simon Fraser.
+
+ Touch events do not affect the :active CSS state
+ https://bugs.webkit.org/show_bug.cgi?id=39493
+
+ Clean the code up by using a typedef based on comments
+ post landing of the original patch.
+
+ No change in functionality so no new tests.
+
+ * rendering/HitTestRequest.h: Typedef the HitTestRequestType to unsigned.
+ * WebCore.exp.in: Update export signature.
+ * WebCore.order: Ditto.
+ * page/EventHandler.cpp: use the new typedef.
+ * page/EventHandler.h: ditto.
+
+
+2010-07-22 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Rename method for CSS rule source range retrieval and fix return object format
+ https://bugs.webkit.org/show_bug.cgi?id=42379
+
+ * inspector/Inspector.idl:
+ * inspector/InspectorBackend.cpp:
+ (WebCore::InspectorBackend::getRuleRanges):
+ * inspector/InspectorBackend.h:
+ * inspector/InspectorBackend.idl:
+ * inspector/InspectorCSSStore.cpp:
+ (WebCore::InspectorCSSStore::getRuleRanges):
+ * inspector/InspectorCSSStore.h:
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::getRuleRanges):
+ * inspector/InspectorDOMAgent.h:
+ * inspector/front-end/DOMAgent.js:
+
+2010-07-21 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Chromium Dev Tools: Separators are missing in the context menu.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42761
+
+ * bindings/js/JSInspectorFrontendHostCustom.cpp:
+ (WebCore::JSInspectorFrontendHost::showContextMenu):
+ * bindings/v8/custom/V8InspectorFrontendHostCustom.cpp:
+ (WebCore::V8InspectorFrontendHost::showContextMenuCallback):
+ * platform/ContextMenuItem.h:
+ (WebCore::):
+
+2010-07-22 Zoltan Herczeg <zherczeg@webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ SVGFilterElement & SVGFE*Element don't support dynamic invalidation, when attributes change
+ https://bugs.webkit.org/show_bug.cgi?id=42244
+
+ Implementing svgAttributeChanged and childrenChanged for the base class of all filters,
+ called SVGFilterPrimitiveStandardAttributes.
+
+ Tests: svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-dom-height-attr.html
+ svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-dom-result-attr.html
+ svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-dom-width-attr.html
+ svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-dom-x-attr.html
+ svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-dom-y-attr.html
+ svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-svgdom-height-prop.html
+ svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-svgdom-result-prop.html
+ svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-svgdom-width-prop.html
+ svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-svgdom-x-prop.html
+ svg/dynamic-updates/SVGFilterPrimitiveStandardAttributes-svgdom-y-prop.html
+
+ * svg/SVGFilterPrimitiveStandardAttributes.cpp:
+ (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged):
+ (WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged):
+ * svg/SVGFilterPrimitiveStandardAttributes.h:
+ (WebCore::SVGFilterPrimitiveStandardAttributes::invalidateFilter):
+
+2010-07-22 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Small refactoring for input value sanitization
+ https://bugs.webkit.org/show_bug.cgi?id=42807
+
+ Rename some functions to clarify their roles.
+
+ * dom/InputElement.cpp:
+ (WebCore::replaceEOLAndLimitLength):
+ Renamed from sanitizeUserInputValue().
+ (WebCore::InputElement::sanitizeValueForTextField):
+ Renamed from sanitizeValue(), and call replaceEOLAndLimitLength()
+ instead of sanitizeUserInputValue().
+ (WebCore::InputElement::sanitizeUserInputValue):
+ Just call replaceEOLAndLimitLength().
+ (WebCore::InputElement::updateValueIfNeeded):
+ Use non-static sanitizeValue() for consistency.
+ * dom/InputElement.h:
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::setInputType):
+ Revert the change of r63876. It is not needed because of the
+ updateValueIfNeeded() change.
+ (WebCore::HTMLInputElement::sanitizeValue):
+ Apply the sanitizeValue() renaming.
+
+2010-07-22 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ webkitPerformance.timing.responseEnd should not include document parse time
+ https://bugs.webkit.org/show_bug.cgi?id=42797
+
+ No new tests because timing based test would be flaky.
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::finishedLoading): finishedLoading() is called by the platform at the right time, but didReceiveData() synchronously invokes parsing without returning to the event loop prior to this. So by the time the didFinishLoading() method is executed, parsing is finished. The solution is to move this time to didReceiveData() prior to parsing.
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::didReceiveData): Update the time each time didReceiveData() is called.
+ (WebCore::MainResourceLoader::didFinishLoading): When finished, and after parsing, set responseEnd appropriately.
+ * loader/MainResourceLoader.h:
+ * page/Timing.cpp:
+ (WebCore::Timing::resourceLoadTimeRelativeToAbsolute): Now that responseEnd is set correctly, it can be much shorter for very fast loads (like local files). This exposed the fact that this skew check was not tight enough. We need to make sure that the whole range of values from the ResourceLoadTiming API fit within fetchStart-responseEnd, not just that requestTime fits in this range.
+
+2010-07-21 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Assertion failure by changing the type of an input element with a
+ non-number value to 'range'.
+ https://bugs.webkit.org/show_bug.cgi?id=42643
+
+ Test: fast/forms/input-value-sanitization.html
+
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::setInputType):
+ Update the value by HTMLInputElement::sanitizeValue() in a case that
+ storesValueSeparateFromAttribute() state is not changed.
+
+2010-07-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Implement spec changes for basefont and bgsound
+ https://bugs.webkit.org/show_bug.cgi?id=42792
+
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processStartTagForInBody):
+ (WebCore::HTMLTreeBuilder::processStartTag):
+ (WebCore::HTMLTreeBuilder::processStartTagForInHead):
+
+2010-07-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Update a list of tags to match changes in the HTML5 spec
+ https://bugs.webkit.org/show_bug.cgi?id=42791
+
+ We need to atomize these strings at some point.
+
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processStartTagForInBody):
+
+2010-07-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ HTMLTreeBuilder needs to update to match new spec behavior for <button>
+ https://bugs.webkit.org/show_bug.cgi?id=42233
+
+ The spec has some typos in this area, but this is my best guess for
+ what Ian means. I've filed bugs against the spec for each typo.
+
+ * html/HTMLElementStack.cpp:
+ (WebCore::HTMLNames::isScopeMarker):
+ (WebCore::HTMLNames::isButtonScopeMarker):
+ (WebCore::HTMLElementStack::inButtonScope):
+ * html/HTMLElementStack.h:
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processFakePEndTagIfPInButtonScope):
+ (WebCore::HTMLTreeBuilder::processCloseWhenNestedTag):
+ (WebCore::HTMLTreeBuilder::processStartTagForInBody):
+ (WebCore::HTMLTreeBuilder::processEndTagForInBody):
+ * html/HTMLTreeBuilder.h:
+
+2010-07-21 Justin Schuh <jschuh@chromium.org>
+
+ Reviewed by Oliver Hunt.
+
+ Prevent DeleteButtonController enable state from changing when not editing
+ https://bugs.webkit.org/show_bug.cgi?id=42659
+
+ Test: svg/custom/use-invalid-html.xhtml
+
+ * dom/ContainerNode.cpp:
+ (WebCore::ContainerNode::cloneChildNodes):
+
+2010-07-21 Beth Dakin <bdakin@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=42605 New border-
+ radius path-based drawing code has some issues with corner-joins
+
+ GraphicsContext::clipConvexPolygon() now takes a boolean parameter
+ indicating whether or not the clip should be antialiased.
+ * platform/graphics/GraphicsContext.h:
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::GraphicsContext::clipConvexPolygon):
+ * platform/graphics/cg/GraphicsContextCG.cpp:
+ (WebCore::GraphicsContext::clipConvexPolygon):
+ * platform/graphics/haiku/GraphicsContextHaiku.cpp:
+ (WebCore::GraphicsContext::clipConvexPolygon):
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::clipConvexPolygon):
+ * platform/graphics/skia/GraphicsContextSkia.cpp:
+ (WebCore::GraphicsContext::clipConvexPolygon):
+ * platform/graphics/wince/GraphicsContextWince.cpp:
+ (WebCore::GraphicsContext::clipConvexPolygon):
+ * platform/graphics/wx/GraphicsContextWx.cpp:
+ (WebCore::GraphicsContext::clipConvexPolygon):
+
+ Compute 4 booleans determining if each edge is a "matching" edge of
+ not. Send the two appropriate values to clipBorderSidePolygon() so
+ we can decide there whether or not to antialias the clip based on
+ matchy-ness.
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::paintBorder):
+
+ If both edges are matching, don't antialias. If neither edge
+ matches, never antialias. If one edge matches and one does not,
+ apply two clips to get the appropriate antialiasing in each corner.
+ (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
+ * rendering/RenderBoxModelObject.h:
+
+2010-07-21 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ Break out "scheme registration" functionality from SecurityOrigin to a SchemeRegistry
+ https://bugs.webkit.org/show_bug.cgi?id=42783
+
+ No new tests. (No change in behavior)
+
+ * GNUmakefile.am:
+ * WebCore.exp.in:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::isMixedContent):
+ (WebCore::FrameLoader::loadFrameRequest):
+
+ * page/SecurityOrigin.cpp:
+ (WebCore::SecurityOrigin::SecurityOrigin):
+ (WebCore::SecurityOrigin::canLoad):
+ (WebCore::SecurityOrigin::isLocal):
+ * page/SecurityOrigin.h:
+
+ * platform/SchemeRegistry.cpp: Added.
+ (WebCore::localSchemes):
+ (WebCore::secureSchemes):
+ (WebCore::schemesWithUniqueOrigins):
+ (WebCore::SchemeRegistry::registerURLSchemeAsLocal):
+ (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
+ (WebCore::SchemeRegistry::localURLSchemes):
+ (WebCore::SchemeRegistry::shouldTreatURLAsLocal):
+ (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal):
+ (WebCore::SchemeRegistry::registerURLSchemeAsNoAccess):
+ (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess):
+ (WebCore::SchemeRegistry::registerURLSchemeAsSecure):
+ (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure):
+ * platform/SchemeRegistry.h: Added.
+
+2010-07-21 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Assertion failure in AnimationBase::updateStateMachine() coming out of paused state
+ https://bugs.webkit.org/show_bug.cgi?id=37993
+
+ Added logic to properly handle pausing and resuming when in the
+ AnimationStateStartWaitStyleAvailable state. This was causing an
+ assert when going out of the pause state because the paused flag
+ was not set.
+
+ The fix is a straightforward implementation, going into a new
+ AnimationStatePausedWaitStyleAvailable state and setting the paused
+ flag (actually setting the m_pauseTime variable to something other
+ than -1). Also added handling of the new state, both when the
+ "style available" callback comes in while in this state and when
+ unpausing while in this state.
+
+ For now a LayoutTest is not possible since there's no way to go in
+ and out of the pause state. I've opened https://bugs.webkit.org/show_bug.cgi?id=42790
+ to track this.
+
+ * page/animation/AnimationBase.cpp:
+ (WebCore::AnimationBase::updateStateMachine):
+ * page/animation/AnimationBase.h:
+ (WebCore::AnimationBase::):
+
2010-07-21 Bo Liu <boliu@chromium.org>
Reviewed by Darin Fisher.
diff --git a/WebCore/Configurations/FeatureDefines.xcconfig b/WebCore/Configurations/FeatureDefines.xcconfig
index 4b363aa..8e33a91 100644
--- a/WebCore/Configurations/FeatureDefines.xcconfig
+++ b/WebCore/Configurations/FeatureDefines.xcconfig
@@ -55,6 +55,7 @@ ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE;
ENABLE_FILTERS = ENABLE_FILTERS;
ENABLE_FILE_READER = ENABLE_FILE_READER;
ENABLE_FILE_WRITER = ;
+ENABLE_FILE_SYSTEM = ;
ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
ENABLE_ICONDATABASE = ENABLE_ICONDATABASE;
ENABLE_IMAGE_RESIZER = ;
@@ -85,4 +86,4 @@ ENABLE_XHTMLMP = ;
ENABLE_XPATH = ENABLE_XPATH;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_FILE_SYSTEM) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
diff --git a/WebCore/Configurations/Version.xcconfig b/WebCore/Configurations/Version.xcconfig
index 2749545..c1b6b32 100644
--- a/WebCore/Configurations/Version.xcconfig
+++ b/WebCore/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 534;
-MINOR_VERSION = 3;
+MINOR_VERSION = 4;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/WebCore/DerivedSources.cpp b/WebCore/DerivedSources.cpp
index 78c523f..ea6e47e 100644
--- a/WebCore/DerivedSources.cpp
+++ b/WebCore/DerivedSources.cpp
@@ -190,7 +190,6 @@
#include "JSImageData.cpp"
#include "JSIndexedDatabaseRequest.cpp"
#include "JSInjectedScriptHost.cpp"
-#include "JSInspectorBackend.cpp"
#include "JSInspectorFrontendHost.cpp"
#include "JSJavaScriptCallFrame.cpp"
#include "JSKeyboardEvent.cpp"
diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
index 7c53e86..3b0f38d 100644
--- a/WebCore/DerivedSources.make
+++ b/WebCore/DerivedSources.make
@@ -233,7 +233,6 @@ DOM_CLASSES = \
ImageData \
IndexedDatabaseRequest \
InjectedScriptHost \
- InspectorBackend \
InspectorFrontendHost \
KeyboardEvent \
Location \
@@ -477,10 +476,16 @@ INSPECTOR_CLASSES = Inspector
JS_DOM_HEADERS=$(filter-out JSEventListener.h JSEventTarget.h,$(DOM_CLASSES:%=JS%.h) $(INSPECTOR_CLASSES:%=Remote%Frontend.h))
+WEB_DOM_HEADERS :=
+ifeq ($(findstring BUILDING_WX,$(FEATURE_DEFINES)), BUILDING_WX)
+WEB_DOM_HEADERS := $(filter-out WebDOMXSLTProcessor.h,$(DOM_CLASSES:%=WebDOM%.h))
+endif # BUILDING_WX
+
all : \
remove-stray-plugin-and-mime-type-files \
\
$(JS_DOM_HEADERS) \
+ $(WEB_DOM_HEADERS) \
\
JSJavaScriptCallFrame.h \
\
@@ -813,6 +818,13 @@ Remote%Frontend.h : %.idl $(INSPECTOR_GENERATOR_SCRIPTS)
-include $(JS_DOM_HEADERS:.h=.dep)
+ifeq ($(findstring BUILDING_WX,$(FEATURE_DEFINES)), BUILDING_WX)
+CPP_BINDINGS_SCRIPTS = $(GENERATE_SCRIPTS) bindings/scripts/CodeGeneratorCPP.pm
+
+WebDOM%.h : %.idl $(CPP_BINDINGS_SCRIPTS)
+ $(call generator_script, $(CPP_BINDINGS_SCRIPTS)) $(IDL_COMMON_ARGS) --defines "$(FEATURE_DEFINES) $(ADDITIONAL_IDL_DEFINES) LANGUAGE_CPP" --generator CPP $<
+endif # BUILDING_WX
+
# ------------------------
# Mac-specific rules
diff --git a/WebCore/ForwardingHeaders/wtf/BumpPointerAllocator.h b/WebCore/ForwardingHeaders/wtf/BumpPointerAllocator.h
new file mode 100644
index 0000000..25acbf4
--- /dev/null
+++ b/WebCore/ForwardingHeaders/wtf/BumpPointerAllocator.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_BumpPointerAllocator_h
+#define WebCore_FWD_BumpPointerAllocator_h
+#include <JavaScriptCore/BumpPointerAllocator.h>
+#endif
diff --git a/WebCore/ForwardingHeaders/wtf/PageAllocation.h b/WebCore/ForwardingHeaders/wtf/PageAllocation.h
new file mode 100644
index 0000000..6471b73
--- /dev/null
+++ b/WebCore/ForwardingHeaders/wtf/PageAllocation.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_PageAllocation_h
+#define WebCore_FWD_PageAllocation_h
+#include <JavaScriptCore/PageAllocation.h>
+#endif
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 2aac9a1..8389ed6 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -1,6 +1,3 @@
-
-WebCore := $(srcdir)/WebCore
-
FEATURE_DEFINES :=
SVG_FEATURES :=
HTML_FEATURES :=
@@ -86,8 +83,7 @@ webcoregtk_cppflags += \
webcore_built_nosources += \
DerivedSources/WebCore/DocTypeStrings.cpp \
DerivedSources/WebCore/tokenizer.cpp \
- DerivedSources/WebCore/ColorData.cpp \
- DerivedSources/webkit/webkitdomdummy.c
+ DerivedSources/WebCore/ColorData.cpp
webcore_built_sources += \
DerivedSources/WebCore/CSSGrammar.cpp \
@@ -99,6 +95,8 @@ webcore_built_sources += \
DerivedSources/WebCore/HTMLEntityNames.cpp \
DerivedSources/WebCore/HTMLNames.cpp \
DerivedSources/WebCore/HTMLNames.h \
+ DerivedSources/WebCore/InspectorBackendDispatcher.cpp \
+ DerivedSources/WebCore/InspectorBackendDispatcher.h \
DerivedSources/WebCore/JSAbstractWorker.cpp \
DerivedSources/WebCore/JSAbstractWorker.h \
DerivedSources/WebCore/JSArrayBuffer.cpp \
@@ -394,8 +392,6 @@ webcore_built_sources += \
DerivedSources/WebCore/JSImageData.h \
DerivedSources/WebCore/JSInjectedScriptHost.cpp \
DerivedSources/WebCore/JSInjectedScriptHost.h \
- DerivedSources/WebCore/JSInspectorBackend.cpp \
- DerivedSources/WebCore/JSInspectorBackend.h \
DerivedSources/WebCore/JSInspectorFrontendHost.cpp \
DerivedSources/WebCore/JSInspectorFrontendHost.h \
DerivedSources/WebCore/JSInt16Array.cpp \
@@ -1164,6 +1160,8 @@ webcore_sources += \
WebCore/dom/UIEventWithKeyState.h \
WebCore/dom/UserGestureIndicator.cpp \
WebCore/dom/UserGestureIndicator.h \
+ WebCore/dom/UserTypingGestureIndicator.cpp \
+ WebCore/dom/UserTypingGestureIndicator.h \
WebCore/dom/ViewportArguments.cpp \
WebCore/dom/ViewportArguments.h \
WebCore/dom/WebKitAnimationEvent.cpp \
@@ -1647,6 +1645,7 @@ webcore_sources += \
WebCore/loader/CrossOriginPreflightResultCache.h \
WebCore/loader/DocLoader.cpp \
WebCore/loader/DocLoader.h \
+ WebCore/loader/DocumentLoadTiming.h \
WebCore/loader/DocumentLoader.cpp \
WebCore/loader/DocumentLoader.h \
WebCore/loader/DocumentThreadableLoader.cpp \
@@ -1915,6 +1914,8 @@ webcore_sources += \
WebCore/platform/ScrollTypes.h \
WebCore/platform/ScrollView.cpp \
WebCore/platform/ScrollView.h \
+ WebCore/platform/SchemeRegistry.cpp \
+ WebCore/platform/SchemeRegistry.h \
WebCore/platform/Scrollbar.cpp \
WebCore/platform/Scrollbar.h \
WebCore/platform/ScrollbarClient.h \
@@ -2154,9 +2155,9 @@ webcore_sources += \
WebCore/plugins/PluginQuirkSet.h \
WebCore/plugins/PluginStream.cpp \
WebCore/plugins/PluginStream.h \
- WebCore/plugins/PluginWidget.h \
WebCore/plugins/PluginView.cpp \
WebCore/plugins/PluginView.h \
+ WebCore/plugins/PluginViewBase.h \
WebCore/plugins/npapi.cpp \
WebCore/plugins/npfunctions.h \
WebCore/rendering/AutoTableLayout.cpp \
@@ -2275,6 +2276,7 @@ webcore_sources += \
WebCore/rendering/RenderScrollbarPart.h \
WebCore/rendering/RenderScrollbarTheme.cpp \
WebCore/rendering/RenderScrollbarTheme.h \
+ WebCore/rendering/RenderSVGResourceContainer.cpp \
WebCore/rendering/RenderSVGResourceContainer.h \
WebCore/rendering/RenderSelectionInfo.h \
WebCore/rendering/RenderSlider.cpp \
@@ -2938,6 +2940,14 @@ webcore_sources += \
endif # END ENABLE_DOM_STORAGE
# ----
+# HTML5 FileSystem API support
+# ----
+if ENABLE_FILE_SYSTEM
+FEATURE_DEFINES += ENABLE_FILE_SYSTEM=1
+webcore_cppflags += -DENABLE_FILE_SYSTEM=1
+endif # END ENABLE_FILE_SYSTEM
+
+# ----
# Speech Input API support
# ----
if ENABLE_INPUT_SPEECH
@@ -2949,7 +2959,6 @@ webcore_sources += \
WebCore/page/SpeechInput.cpp \
WebCore/page/SpeechInput.h \
WebCore/page/SpeechInputClient.h \
- WebCore/page/SpeechInputClientListener.h \
WebCore/page/SpeechInputListener.h
else
@@ -3829,6 +3838,12 @@ webcore_sources += \
WebCore/rendering/SVGRenderSupport.h \
WebCore/rendering/SVGRenderTreeAsText.cpp \
WebCore/rendering/SVGRenderTreeAsText.h \
+ WebCore/rendering/SVGResources.cpp \
+ WebCore/rendering/SVGResources.h \
+ WebCore/rendering/SVGResourcesCache.cpp \
+ WebCore/rendering/SVGResourcesCache.h \
+ WebCore/rendering/SVGResourcesCycleSolver.cpp \
+ WebCore/rendering/SVGResourcesCycleSolver.h \
WebCore/rendering/SVGRootInlineBox.cpp \
WebCore/rendering/SVGRootInlineBox.h \
WebCore/rendering/SVGShadowTreeElements.cpp \
@@ -4392,8 +4407,8 @@ DerivedSources/WebCore/XMLNSNames.cpp DerivedSources/WebCore/XMLNSNames.h: $(Web
DerivedSources/WebCore/XMLNames.cpp DerivedSources/WebCore/XMLNames.h: $(WebCore)/dom/make_names.pl $(WebCore)/xml/xmlattrs.in
$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --attrs $(WebCore)/xml/xmlattrs.in --outputDir "$(GENSOURCES_WEBCORE)"
-# Remote Inspector frontend
-DerivedSources/WebCore/RemoteInspectorFrontend.cpp DerivedSources/WebCore/RemoteInspectorFrontend.h: $(WebCore)/inspector/Inspector.idl $(SCRIPTS_BINDINGS) $(WebCore)/inspector/CodeGeneratorInspector.pm
+# RemoteInspectorFrontend and InspectorBackendDispatcher
+DerivedSources/WebCore/RemoteInspectorFrontend.cpp DerivedSources/WebCore/RemoteInspectorFrontend.h DerivedSources/WebCore/InspectorBackendDispatcher.cpp DerivedSources/WebCore/InspectorBackendDispatcher.h: $(WebCore)/inspector/Inspector.idl $(SCRIPTS_BINDINGS) $(WebCore)/inspector/CodeGeneratorInspector.pm
$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts -I$(WebCore)/inspector $(WebCore)/bindings/scripts/generate-bindings.pl $(IDL_PATH:%=--include "%") --outputDir "$(GENSOURCES_WEBCORE)" --defines "LANGUAGE_JAVASCRIPT=1 $(FEATURE_DEFINES)" --generator Inspector $<
IDL_PATH := \
@@ -4421,197 +4436,6 @@ DerivedSources/WebCore/JS%.h: DerivedSources/WebCore/JS%.cpp;
DerivedSources/WebCore/JS%.cpp: %.idl $(SCRIPTS_BINDINGS) $(WebCore)/bindings/scripts/CodeGeneratorJS.pm
$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $(WebCore)/bindings/scripts/generate-bindings.pl $(IDL_PATH:%=--include "%") --outputDir "$(GENSOURCES_WEBCORE)" --defines "LANGUAGE_JAVASCRIPT=1 $(FEATURE_DEFINES)" --generator JS $<
-DerivedSources/webkit/webkitdomdummy.c:
- $(AM_V_GEN)mkdir -p DerivedSources/webkit || echo > $@
-
-# Because WebCore/bindings/gobject/WebKitDOMObject.h is static source but is also a distributed header
-# required by other distributed headers (both static and auto-generated), need to move this to the
-# DerivedSources/webkit directory. The reason is that we want all header files distributed in the
-# include/webkit-x.y/webkit directory, but do not want to name the WebCore/bindings/gobject directory
-# "webkit", as that's a bit presumptuous for a GTK binding.
-$(top_builddir)/DerivedSources/webkit/WebKitDOMObject.h: $(WebCore)/bindings/gobject/WebKitDOMObject.h
- $(AM_V_GEN)cp -f $< $@
-
-$(top_builddir)/DerivedSources/webkit/WebKitDOMEventTarget.h: $(WebCore)/bindings/gobject/WebKitDOMEventTarget.h
- $(AM_V_GEN)cp -f $< $@
-
-# Start with a subset of all the DOM bindings
-IDL_BINDINGS_GDOM += \
- WebCore/css/CSSRule.idl \
- WebCore/css/CSSRuleList.idl \
- WebCore/css/CSSStyleDeclaration.idl \
- WebCore/css/CSSStyleSheet.idl \
- WebCore/css/CSSValue.idl \
- WebCore/css/MediaList.idl \
- WebCore/css/StyleMedia.idl \
- WebCore/css/StyleSheet.idl \
- WebCore/css/StyleSheetList.idl \
- WebCore/dom/Attr.idl \
- WebCore/dom/CDATASection.idl \
- WebCore/dom/CharacterData.idl \
- WebCore/dom/Comment.idl \
- WebCore/dom/Document.idl \
- WebCore/dom/DocumentFragment.idl \
- WebCore/dom/DocumentType.idl \
- WebCore/dom/DOMImplementation.idl \
- WebCore/dom/DOMStringList.idl \
- WebCore/dom/DOMStringMap.idl \
- WebCore/dom/Element.idl \
- WebCore/dom/EntityReference.idl \
- WebCore/dom/Event.idl \
- WebCore/dom/MessagePort.idl \
- WebCore/dom/NamedNodeMap.idl \
- WebCore/dom/Node.idl \
- WebCore/dom/NodeFilter.idl \
- WebCore/dom/NodeIterator.idl \
- WebCore/dom/NodeList.idl \
- WebCore/dom/ProcessingInstruction.idl \
- WebCore/dom/Range.idl \
- WebCore/dom/Text.idl \
- WebCore/dom/TreeWalker.idl \
- WebCore/html/Blob.idl \
- WebCore/html/File.idl \
- WebCore/html/FileList.idl \
- WebCore/html/HTMLAnchorElement.idl \
- WebCore/html/HTMLAppletElement.idl \
- WebCore/html/HTMLAreaElement.idl \
- WebCore/html/HTMLBaseElement.idl \
- WebCore/html/HTMLBaseFontElement.idl \
- WebCore/html/HTMLBlockquoteElement.idl \
- WebCore/html/HTMLBodyElement.idl \
- WebCore/html/HTMLBRElement.idl \
- WebCore/html/HTMLButtonElement.idl \
- WebCore/html/HTMLCanvasElement.idl \
- WebCore/html/HTMLCollection.idl \
- WebCore/html/HTMLDirectoryElement.idl \
- WebCore/html/HTMLDivElement.idl \
- WebCore/html/HTMLDListElement.idl \
- WebCore/html/HTMLDocument.idl \
- WebCore/html/HTMLElement.idl \
- WebCore/html/HTMLEmbedElement.idl \
- WebCore/html/HTMLFieldSetElement.idl \
- WebCore/html/HTMLFontElement.idl \
- WebCore/html/HTMLFormElement.idl \
- WebCore/html/HTMLFrameElement.idl \
- WebCore/html/HTMLFrameSetElement.idl \
- WebCore/html/HTMLHeadElement.idl \
- WebCore/html/HTMLHeadingElement.idl \
- WebCore/html/HTMLHRElement.idl \
- WebCore/html/HTMLHtmlElement.idl \
- WebCore/html/HTMLIFrameElement.idl \
- WebCore/html/HTMLImageElement.idl \
- WebCore/html/HTMLInputElement.idl \
- WebCore/html/HTMLIsIndexElement.idl \
- WebCore/html/HTMLLabelElement.idl \
- WebCore/html/HTMLLegendElement.idl \
- WebCore/html/HTMLLIElement.idl \
- WebCore/html/HTMLLinkElement.idl \
- WebCore/html/HTMLMapElement.idl \
- WebCore/html/HTMLMarqueeElement.idl \
- WebCore/html/HTMLMenuElement.idl \
- WebCore/html/HTMLMetaElement.idl \
- WebCore/html/HTMLModElement.idl \
- WebCore/html/HTMLObjectElement.idl \
- WebCore/html/HTMLOListElement.idl \
- WebCore/html/HTMLOptGroupElement.idl \
- WebCore/html/HTMLOptionElement.idl \
- WebCore/html/HTMLOptionsCollection.idl \
- WebCore/html/HTMLParagraphElement.idl \
- WebCore/html/HTMLParamElement.idl \
- WebCore/html/HTMLPreElement.idl \
- WebCore/html/HTMLQuoteElement.idl \
- WebCore/html/HTMLScriptElement.idl \
- WebCore/html/HTMLSelectElement.idl \
- WebCore/html/HTMLStyleElement.idl \
- WebCore/html/HTMLTableElement.idl \
- WebCore/html/HTMLTableCaptionElement.idl \
- WebCore/html/HTMLTableColElement.idl \
- WebCore/html/HTMLTableSectionElement.idl \
- WebCore/html/HTMLTableCellElement.idl \
- WebCore/html/HTMLTextAreaElement.idl \
- WebCore/html/HTMLTitleElement.idl \
- WebCore/html/HTMLTableRowElement.idl \
- WebCore/html/HTMLUListElement.idl \
- WebCore/html/ValidityState.idl \
- WebCore/loader/appcache/DOMApplicationCache.idl \
- WebCore/page/BarInfo.idl \
- WebCore/page/Console.idl \
- WebCore/page/DOMWindow.idl \
- WebCore/page/DOMSelection.idl \
- WebCore/page/History.idl \
- WebCore/page/Location.idl \
- WebCore/page/MemoryInfo.idl \
- WebCore/page/Navigator.idl \
- WebCore/page/Screen.idl \
- WebCore/page/WebKitPoint.idl \
- WebCore/plugins/DOMMimeType.idl \
- WebCore/plugins/DOMMimeTypeArray.idl \
- WebCore/plugins/DOMPlugin.idl \
- WebCore/plugins/DOMPluginArray.idl \
- WebCore/storage/Database.idl \
- WebCore/storage/Storage.idl \
- WebCore/xml/XPathExpression.idl \
- WebCore/xml/XPathNSResolver.idl \
- WebCore/xml/XPathResult.idl
-
-if ENABLE_GEOLOCATION
-IDL_BINDINGS_GDOM += \
- WebCore/page/Geolocation.idl
-endif # END ENABLE_GEOLOCATION
-
-
-# All classes autogenerated in the GObject DOM bindings
-GDOM_AUTO_CLASSES += $(basename $(notdir $(IDL_BINDINGS_GDOM)))
-
-# The classes implemented manually
-GDOM_FIXED_CLASSES += Object EventTarget
-
-GDOM_CLASSES += $(GDOM_AUTO_CLASSES) $(GDOM_FIXED_CLASSES)
-
-# Filter out SVG for now
-FEATURE_DEFINES_GDOM := $(filter-out ENABLE-SVG%, $(FEATURE_DEFINES))
-
-# Autogenerated header files
-GDOM_HEADERS_BUILT += $(patsubst %,$(top_builddir)/DerivedSources/webkit/WebKitDOM%.h,$(GDOM_AUTO_CLASSES)) \
- $(top_builddir)/DerivedSources/webkit/webkitdom.h \
- $(top_builddir)/DerivedSources/webkit/webkitdomdefines.h \
- $(top_builddir)/DerivedSources/webkit/WebKitDOMEventTarget.h \
- $(top_builddir)/DerivedSources/webkit/WebKitDOMObject.h
-
-# Autogenerated source files
-GDOM_SOURCES_BUILT := $(patsubst %,DerivedSources/webkit/WebKitDOM%.cpp,$(GDOM_AUTO_CLASSES))
-
-# Hand-coded header files
-GDOM_HEADERS_FIXED += $(patsubst %,$(srcdir)/WebCore/bindings/gobject/WebKitDOM%.h,$(GDOM_FIXED_CLASSES))
-
-# All header files that get installed
-libgdom_h_api += $(GDOM_HEADERS_FIXED) $(GDOM_HEADERS_BUILT)
-
-DerivedSources/webkit/webkitdom.h: $(WebCore)/bindings/scripts/gobject-generate-headers.pl $(WebCore)/GNUmakefile.am
- $(AM_V_GEN)echo $(GDOM_CLASSES) | $(PERL) $< gdom > $@
-
-DerivedSources/webkit/webkitdomdefines.h: $(WebCore)/bindings/scripts/gobject-generate-headers.pl $(IDL_BINDINGS_GDOM) $(WebCore)/GNUmakefile.am
- $(AM_V_GEN)echo $(GDOM_CLASSES) | $(PERL) $< defines > $@
-
-DerivedSources/webkit/WebKitDOM%.h: DerivedSources/webkit/WebKitDOM%.cpp;
-
-DerivedSources/webkit/WebKitDOM%.cpp: %.idl $(SCRIPTS_BINDINGS) $(WebCore)/bindings/scripts/CodeGeneratorGObject.pm $(webcoregtk_dom_sources)
- $(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $(WebCore)/bindings/scripts/generate-bindings.pl --include $(WebCore)/dom --include $(WebCore)/html --include $(WebCore)/css --include $(WebCore)/page --include $(WebCore)/xml --include $(WebCore)/svg --outputDir "$(GENSOURCES_WEBKIT)" --defines "LANGUAGE_GOBJECT=1 $(FEATURE_DEFINES_GDOM)" --generator GObject $<
-
-gdom_built_nosources := $(GDOM_HEADERS_BUILT) $(GDOM_SOURCES_BUILT)
-
-libgdom_objects := $(subst .cpp,.lo,$(GDOM_SOURCES_BUILT))
-libgdom_depfiles := $(patsubst %.lo,$(top_builddir)/DerivedSources/webkit/$(DEPDIR)/%.Plo,$(notdir $(libgdom_objects)))
-libgdom_depfiles += $(patsubst %.h,$(WebCore)/bindings/gobject/$(DEPDIR)/%.Plo,$(notdir $(GDOM_HEADERS_FIXED)))
-
--include $(libgdom_depfiles)
-
-$(libgdom_objects): AM_CPPFLAGS+=$(libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS)
-$(libgdom_objects): AM_CXXFLAGS+=$(libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CXXFLAGS)
-
-libgdom.la: $(libgdom_objects)
- $(CXXLINK) $(libgdom_objects) $(LIBS)
-
EXTRA_DIST += \
$(shell ls $(srcdir)/WebCore/css/*.idl) \
$(shell ls $(srcdir)/WebCore/dom/*.idl) \
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index cf66285..c1079d5 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -215,8 +215,9 @@ __ZN7WebCore12EventHandler14currentNSEventEv
__ZN7WebCore12EventHandler14scrollOverflowENS_15ScrollDirectionENS_17ScrollGranularityEPNS_4NodeE
__ZN7WebCore12EventHandler15sendScrollEventEv
__ZN7WebCore12EventHandler16handleWheelEventERNS_18PlatformWheelEventE
+__ZN7WebCore12EventHandler17scrollRecursivelyENS_15ScrollDirectionENS_17ScrollGranularityEPNS_4NodeE
__ZN7WebCore12EventHandler20handleTextInputEventERKNS_6StringEPNS_5EventEbb
-__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbbNS_17HitTestScrollbarsEi
+__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbbNS_17HitTestScrollbarsEj
__ZN7WebCore12EventHandler21handleMousePressEventERKNS_18PlatformMouseEventE
__ZN7WebCore12EventHandler23handleMouseReleaseEventERKNS_18PlatformMouseEventE
__ZN7WebCore12EventHandler27capsLockStateMayHaveChangedEv
@@ -284,6 +285,7 @@ __ZN7WebCore13HitTestResultC1ERKS0_
__ZN7WebCore13HitTestResultD1Ev
__ZN7WebCore13IdentifierRep3getEPKc
__ZN7WebCore13IdentifierRep3getEi
+__ZN7WebCore13JSHTMLElement6s_infoE
__ZN7WebCore13KeyboardEventC1ERKNS_12AtomicStringEbbPNS_9DOMWindowERKNS_6StringEjbbbbb
__ZN7WebCore13TypingCommand39insertParagraphSeparatorInQuotedContentEPNS_8DocumentE
__ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindow
@@ -310,11 +312,12 @@ __ZN7WebCore14ResourceHandle20forceContentSniffingEv
__ZN7WebCore14ResourceLoader14cancelledErrorEv
__ZN7WebCore14ResourceLoader19setShouldBufferDataEb
__ZN7WebCore14SVGSMILElement13isSMILElementEPNS_4NodeE
+__ZN7WebCore14SchemeRegistry24registerURLSchemeAsLocalERKNS_6StringE
+__ZN7WebCore14SchemeRegistry25registerURLSchemeAsSecureERKNS_6StringE
+__ZN7WebCore14SchemeRegistry32registerURLSchemeAsEmptyDocumentERKNS_6StringE
__ZN7WebCore14SecurityOrigin16createFromStringERKNS_6StringE
__ZN7WebCore14SecurityOrigin18setLocalLoadPolicyENS0_15LocalLoadPolicyE
__ZN7WebCore14SecurityOrigin18shouldHideReferrerERKNS_4KURLERKNS_6StringE
-__ZN7WebCore14SecurityOrigin24registerURLSchemeAsLocalERKNS_6StringE
-__ZN7WebCore14SecurityOrigin25registerURLSchemeAsSecureERKNS_6StringE
__ZN7WebCore14SecurityOrigin27resetOriginAccessWhitelistsEv
__ZN7WebCore14SecurityOrigin29addOriginAccessWhitelistEntryERKS0_RKNS_6StringES5_b
__ZN7WebCore14SecurityOrigin32removeOriginAccessWhitelistEntryERKS0_RKNS_6StringES5_b
@@ -406,6 +409,7 @@ __ZN7WebCore17nameForCursorTypeENS_6Cursor4TypeE
__ZN7WebCore17openTemporaryFileEPKcRi
__ZN7WebCore18deprecatedParseURLERKNS_6StringE
__ZN7WebCore18isStartOfParagraphERKNS_15VisiblePositionE
+__ZN7WebCore18pluginScriptObjectEPN3JSC9ExecStateEPNS_13JSHTMLElementE
__ZN7WebCore19AnimationController16resumeAnimationsEPNS_8DocumentE
__ZN7WebCore19AnimationController17suspendAnimationsEPNS_8DocumentE
__ZN7WebCore19AnimationController20pauseAnimationAtTimeEPNS_12RenderObjectERKNS_6StringEd
@@ -450,6 +454,7 @@ __ZN7WebCore21reportThreadViolationEPKcNS_20ThreadViolationRoundE
__ZN7WebCore21setPlatformStrategiesEPNS_18PlatformStrategiesE
__ZN7WebCore22ScriptExecutionContext26canSuspendActiveDOMObjectsEv
__ZN7WebCore22applicationIsAppleMailEv
+__ZN7WebCore22contextMenuItemTagBoldEv
__ZN7WebCore22counterValueForElementEPNS_7ElementE
__ZN7WebCore22createFragmentFromTextEPNS_5RangeERKNS_6StringE
__ZN7WebCore22externalRepresentationEPNS_5FrameEj
@@ -461,6 +466,8 @@ __ZN7WebCore23ApplicationCacheStorage5emptyEv
__ZN7WebCore23ReplaceSelectionCommandC1EPNS_8DocumentEN3WTF10PassRefPtrINS_16DocumentFragmentEEEbbbbbNS_10EditActionE
__ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0EEE
__ZN7WebCore24BinaryPropertyListWriter17writePropertyListEv
+__ZN7WebCore24contextMenuItemTagItalicEv
+__ZN7WebCore24contextMenuItemTagStylesEv
__ZN7WebCore24createFragmentFromMarkupEPNS_8DocumentERKNS_6StringES4_NS_27FragmentScriptingPermissionE
__ZN7WebCore24decodeURLEscapeSequencesERKNS_6StringE
__ZN7WebCore24notifyHistoryItemChangedE
@@ -474,21 +481,55 @@ __ZN7WebCore25PluginMainThreadScheduler12scheduleCallEP4_NPPPFvPvES3_
__ZN7WebCore25PluginMainThreadScheduler14registerPluginEP4_NPP
__ZN7WebCore25PluginMainThreadScheduler16unregisterPluginEP4_NPP
__ZN7WebCore25PluginMainThreadScheduler9schedulerEv
+__ZN7WebCore25contextMenuItemTagOutlineEv
__ZN7WebCore26CSSMutableStyleDeclarationC1Ev
__ZN7WebCore26NetscapePlugInStreamLoader6createEPNS_5FrameEPNS_32NetscapePlugInStreamLoaderClientE
+__ZN7WebCore26UserTypingGestureIndicator27processingUserTypingGestureEv
+__ZN7WebCore26UserTypingGestureIndicator28focusedElementAtGestureStartEv
+__ZN7WebCore26contextMenuItemTagFontMenuEv
+__ZN7WebCore26contextMenuItemTagOpenLinkEv
__ZN7WebCore26usesTestModeFocusRingColorEv
__ZN7WebCore27CSSComputedStyleDeclarationC1EN3WTF10PassRefPtrINS_4NodeEEEbRKNS_6StringE
__ZN7WebCore27applicationIsAdobeInstallerEv
+__ZN7WebCore27contextMenuItemTagShowFontsEv
+__ZN7WebCore27contextMenuItemTagUnderlineEv
+__ZN7WebCore28contextMenuItemTagCapitalizeEv
+__ZN7WebCore28contextMenuItemTagShowColorsEv
+__ZN7WebCore28contextMenuItemTagSmartLinksEv
+__ZN7WebCore28contextMenuItemTagSpeechMenuEv
+__ZN7WebCore29contextMenuItemTagLeftToRightEv
+__ZN7WebCore29contextMenuItemTagRightToLeftEv
+__ZN7WebCore29contextMenuItemTagSmartDashesEv
+__ZN7WebCore29contextMenuItemTagSmartQuotesEv
__ZN7WebCore29isCharacterSmartReplaceExemptEib
__ZN7WebCore29setUsesTestModeFocusRingColorEb
+__ZN7WebCore30contextMenuItemTagSpellingMenuEv
+__ZN7WebCore30contextMenuItemTagStopSpeakingEv
__ZN7WebCore31CrossOriginPreflightResultCache5emptyEv
__ZN7WebCore31CrossOriginPreflightResultCache6sharedEv
__ZN7WebCore31applicationIsMicrosoftMessengerEv
+__ZN7WebCore31contextMenuItemTagCheckSpellingEv
+__ZN7WebCore31contextMenuItemTagIgnoreGrammarEv
+__ZN7WebCore31contextMenuItemTagMakeLowerCaseEv
+__ZN7WebCore31contextMenuItemTagMakeUpperCaseEv
+__ZN7WebCore31contextMenuItemTagStartSpeakingEv
+__ZN7WebCore32contextMenuItemTagInspectElementEv
+__ZN7WebCore32contextMenuItemTagSmartCopyPasteEv
__ZN7WebCore32plainTextToMallocAllocatedBufferEPKNS_5RangeERjb
+__ZN7WebCore33contextMenuItemTagTextReplacementEv
__ZN7WebCore33setDefaultThreadViolationBehaviorENS_23ThreadViolationBehaviorENS_20ThreadViolationRoundE
+__ZN7WebCore34contextMenuItemTagDefaultDirectionEv
+__ZN7WebCore35contextMenuItemTagShowSpellingPanelEb
+__ZN7WebCore35contextMenuItemTagShowSubstitutionsEb
+__ZN7WebCore35contextMenuItemTagSubstitutionsMenuEv
__ZN7WebCore36InitializeLoggingChannelsIfNecessaryEv
+__ZN7WebCore37contextMenuItemTagTransformationsMenuEv
+__ZN7WebCore38contextMenuItemTagWritingDirectionMenuEv
__ZN7WebCore3macERKNS_10CredentialE
__ZN7WebCore3macERKNS_23AuthenticationChallengeE
+__ZN7WebCore42contextMenuItemTagCheckGrammarWithSpellingEv
+__ZN7WebCore42contextMenuItemTagCheckSpellingWhileTypingEv
+__ZN7WebCore46contextMenuItemTagCorrectSpellingAutomaticallyEv
__ZN7WebCore4Font11setCodePathENS0_8CodePathE
__ZN7WebCore4Font18shouldUseSmoothingEv
__ZN7WebCore4Font21setShouldUseSmoothingEb
@@ -526,7 +567,7 @@ __ZN7WebCore4Page6goBackEv
__ZN7WebCore4Page8goToItemEPNS_11HistoryItemENS_13FrameLoadTypeE
__ZN7WebCore4Page9goForwardEv
__ZN7WebCore4Page9initGroupEv
-__ZN7WebCore4PageC1EPNS_12ChromeClientEPNS_17ContextMenuClientEPNS_12EditorClientEPNS_10DragClientEPNS_15InspectorClientEPNS_18PluginHalterClientEPNS_27GeolocationControllerClientEPNS_23DeviceOrientationClientEPNS_27BackForwardControllerClientE
+__ZN7WebCore4PageC1ERKNS0_11PageClientsE
__ZN7WebCore4PageD1Ev
__ZN7WebCore4coreEP20NSURLProtectionSpace
__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_19CSSStyleDeclarationE
@@ -726,13 +767,13 @@ __ZN7WebCore9FrameView16setPaintBehaviorEj
__ZN7WebCore9FrameView18updateControlTintsEv
__ZN7WebCore9FrameView20enterCompositingModeEv
__ZN7WebCore9FrameView21flushDeferredRepaintsEv
-__ZN7WebCore9FrameView38scrollPositionChangedViaPlatformWidgetEv
__ZN7WebCore9FrameView22setBaseBackgroundColorENS_5ColorE
__ZN7WebCore9FrameView23layoutIfNeededRecursiveEv
__ZN7WebCore9FrameView23updateCanHaveScrollbarsEv
__ZN7WebCore9FrameView29forceLayoutWithPageWidthRangeEffb
__ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb
__ZN7WebCore9FrameView29syncCompositingStateRecursiveEv
+__ZN7WebCore9FrameView38scrollPositionChangedViaPlatformWidgetEv
__ZN7WebCore9FrameView6createEPNS_5FrameE
__ZN7WebCore9FrameView6createEPNS_5FrameERKNS_7IntSizeE
__ZN7WebCore9HTMLNames10listingTagE
@@ -1156,6 +1197,7 @@ __ZN7WebCore28InspectorFrontendClientLocal17setAttachedWindowEb
__ZN7WebCore28InspectorFrontendClientLocal19requestAttachWindowEv
__ZN7WebCore28InspectorFrontendClientLocal19requestDetachWindowEv
__ZN7WebCore28InspectorFrontendClientLocal19windowObjectClearedEv
+__ZN7WebCore28InspectorFrontendClientLocal20sendMessageToBackendERKNS_6StringE
__ZN7WebCore28InspectorFrontendClientLocal26changeAttachedWindowHeightEj
__ZN7WebCore28InspectorFrontendClientLocal27restoreAttachedWindowHeightEv
__ZN7WebCore28InspectorFrontendClientLocalC2EPNS_19InspectorControllerEPNS_4PageE
@@ -1347,7 +1389,7 @@ __ZNK7WebCore15ProtectionSpace20authenticationSchemeEv
.objc_class_name_DOMSVGZoomEvent
#endif
-#if ENABLE(SVG_FILTERS) && ENABLE(SVG_DOM_OBJC_BINDINGS)
+#if ENABLE(FILTERS) && ENABLE(SVG_DOM_OBJC_BINDINGS)
.objc_class_name_DOMSVGComponentTransferFunctionElement
.objc_class_name_DOMSVGFEBlendElement
.objc_class_name_DOMSVGFEColorMatrixElement
diff --git a/WebCore/WebCore.gyp/WebCore.gyp b/WebCore/WebCore.gyp/WebCore.gyp
index 6193294..abd49e7 100644
--- a/WebCore/WebCore.gyp/WebCore.gyp
+++ b/WebCore/WebCore.gyp/WebCore.gyp
@@ -476,15 +476,20 @@
},
{
'action_name': 'RemoteInspectorFrontend',
+ # The second input item will be used as item name in vcproj.
+ # It is not possible to put Inspector.idl there because
+ # all idl files are marking as excluded by gyp generator.
'inputs': [
'../bindings/scripts/generate-bindings.pl',
+ '../inspector/CodeGeneratorInspector.pm',
'../bindings/scripts/CodeGenerator.pm',
'../bindings/scripts/IDLParser.pm',
'../bindings/scripts/IDLStructure.pm',
- '../inspector/CodeGeneratorInspector.pm',
'../inspector/Inspector.idl',
],
'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/InspectorBackendDispatcher.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/InspectorBackendDispatcher.h',
'<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/RemoteInspectorFrontend.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/RemoteInspectorFrontend.h',
],
@@ -505,7 +510,7 @@
'--generator', 'Inspector',
'<@(generator_include_dirs)'
],
- 'message': 'Generating RemoteInspectorFrontend class from Inspector.idl',
+ 'message': 'Generating Inspector interface classes from Inspector.idl',
},
{
'action_name': 'XMLNames',
@@ -714,6 +719,7 @@
# Additional .cpp files from the webcore_inspector_sources list.
'<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/RemoteInspectorFrontend.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/InspectorBackendDispatcher.cpp',
],
'conditions': [
['javascript_engine=="v8"', {
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 7aa5d60..698e302 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -196,7 +196,6 @@
'html/ValidityState.idl',
'html/VoidCallback.idl',
'inspector/InjectedScriptHost.idl',
- 'inspector/InspectorBackend.idl',
'inspector/InspectorFrontendHost.idl',
'inspector/JavaScriptCallFrame.idl',
'inspector/ScriptProfile.idl',
@@ -278,9 +277,6 @@
'xml/XPathResult.idl',
'xml/XSLTProcessor.idl',
],
- 'webcore_inspector_idl_files': [
- 'inspector/Inspector.idl',
- ],
'webcore_svg_bindings_idl_files': [
'svg/ElementTimeControl.idl',
'svg/SVGAElement.idl',
@@ -1273,6 +1269,8 @@
'dom/UIEventWithKeyState.h',
'dom/UserGestureIndicator.cpp',
'dom/UserGestureIndicator.h',
+ 'dom/UserTypingGestureIndicator.cpp',
+ 'dom/UserTypingGestureIndicator.h',
'dom/ViewportArguments.cpp',
'dom/ViewportArguments.h',
'dom/WebKitAnimationEvent.cpp',
@@ -1827,6 +1825,7 @@
'loader/CrossOriginPreflightResultCache.h',
'loader/DocLoader.cpp',
'loader/DocLoader.h',
+ 'loader/DocumentLoadTiming.h',
'loader/DocumentLoader.cpp',
'loader/DocumentLoader.h',
'loader/DocumentThreadableLoader.cpp',
@@ -2040,7 +2039,6 @@
'page/SpeechInput.cpp',
'page/SpeechInput.h',
'page/SpeechInputClient.h',
- 'page/SpeechInputClientListener.h',
'page/SpeechInputListener.h',
'page/SuspendableTimer.cpp',
'page/SuspendableTimer.h',
@@ -2183,6 +2181,10 @@
'platform/graphics/chromium/FontPlatformDataLinux.h',
'platform/graphics/chromium/FontUtilsChromiumWin.cpp',
'platform/graphics/chromium/FontUtilsChromiumWin.h',
+ 'platform/graphics/chromium/GLES2Canvas.cpp',
+ 'platform/graphics/chromium/GLES2Canvas.h',
+ 'platform/graphics/chromium/GLES2Texture.cpp',
+ 'platform/graphics/chromium/GLES2Texture.h',
'platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp',
'platform/graphics/chromium/GlyphPageTreeNodeLinux.cpp',
'platform/graphics/chromium/GraphicsLayerChromium.cpp',
@@ -2906,8 +2908,6 @@
'platform/win/PasteboardWin.cpp',
'platform/win/PlatformMouseEventWin.cpp',
'platform/win/PlatformScreenWin.cpp',
- 'platform/win/PlatformScrollBar.h',
- 'platform/win/PlatformScrollBarWin.cpp',
'platform/win/PopupMenuWin.cpp',
'platform/win/ScrollbarThemeSafari.cpp',
'platform/win/ScrollbarThemeSafari.h',
@@ -3029,6 +3029,8 @@
'platform/ScrollTypes.h',
'platform/ScrollView.cpp',
'platform/ScrollView.h',
+ 'platform/SchemeRegistry.cpp',
+ 'platform/SchemeRegistry.h',
'platform/Scrollbar.cpp',
'platform/Scrollbar.h',
'platform/ScrollbarClient.h',
@@ -3310,6 +3312,8 @@
'rendering/RenderSVGResource.h',
'rendering/RenderSVGResourceClipper.cpp',
'rendering/RenderSVGResourceClipper.h',
+ 'rendering/RenderSVGResourceContainer.cpp',
+ 'rendering/RenderSVGResourceContainer.h',
'rendering/RenderSVGResourceFilter.cpp',
'rendering/RenderSVGResourceFilter.h',
'rendering/RenderSVGResourceGradient.cpp',
@@ -3416,6 +3420,12 @@
'rendering/SVGRenderSupport.h',
'rendering/SVGRenderTreeAsText.cpp',
'rendering/SVGRenderTreeAsText.h',
+ 'rendering/SVGResources.cpp',
+ 'rendering/SVGResources.h',
+ 'rendering/SVGResourcesCache.cpp',
+ 'rendering/SVGResourcesCache.h',
+ 'rendering/SVGResourcesCycleSolver.cpp',
+ 'rendering/SVGResourcesCycleSolver.h',
'rendering/SVGRootInlineBox.cpp',
'rendering/SVGRootInlineBox.h',
'rendering/SVGShadowTreeElements.cpp',
diff --git a/WebCore/WebCore.order b/WebCore/WebCore.order
index 8fa6586..0ac5610 100644
--- a/WebCore/WebCore.order
+++ b/WebCore/WebCore.order
@@ -2999,7 +2999,7 @@ __ZN7WebCore24StringWrapperCFAllocatorL22deallocateOnMainThreadEPv
__ZNK7WebCore12RenderObject5themeEv
__ZNK7WebCore14RenderThemeMac20supportsControlTintsEv
__ZN7WebCore15GraphicsContext23setUpdatingControlTintsEb
-__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbbNS_17HitTestScrollbarsEi
+__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbbNS_17HitTestScrollbarsEj
__ZNK7WebCore13HitTestResult10isSelectedEv
__ZN7WebCore19SelectionController8containsERKNS_8IntPointE
__ZN7WebCore13InlineTextBox11nodeAtPointERKNS_14HitTestRequestERNS_13HitTestResultEiiii
diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri
index 7205add..ef87a45 100644
--- a/WebCore/WebCore.pri
+++ b/WebCore/WebCore.pri
@@ -42,6 +42,7 @@ contains(DEFINES, ENABLE_SINGLE_THREADED=1) {
!contains(DEFINES, ENABLE_CHANNEL_MESSAGING=.): DEFINES += ENABLE_CHANNEL_MESSAGING=1
!contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=0
!contains(DEFINES, ENABLE_DIRECTORY_UPLOAD=.): DEFINES += ENABLE_DIRECTORY_UPLOAD=0
+!contains(DEFINES, ENABLE_FILE_SYSTEM=.): DEFINES += ENABLE_FILE_SYSTEM=0
# turn on SQLITE support if any of the dependent features are turned on
!contains(DEFINES, ENABLE_SQLITE=.) {
@@ -448,7 +449,6 @@ IDL_BINDINGS += \
html/ValidityState.idl \
html/VoidCallback.idl \
inspector/InjectedScriptHost.idl \
- inspector/InspectorBackend.idl \
inspector/InspectorFrontendHost.idl \
inspector/JavaScriptCallFrame.idl \
inspector/ScriptProfile.idl \
@@ -681,6 +681,7 @@ WEBCORE_HEADERS_FOR_WEBKIT2 += \
html/HTMLFormElement.h \
html/HTMLFrameOwnerElement.h \
inspector/InspectorClient.h \
+ loader/appcache/ApplicationCacheStorage.h \
loader/DocumentLoader.h \
loader/FormState.h \
loader/FrameLoader.h \
@@ -702,11 +703,17 @@ WEBCORE_HEADERS_FOR_WEBKIT2 += \
page/Page.h \
page/Settings.h \
page/WindowFeatures.h \
+ platform/Cursor.h \
platform/PlatformKeyboardEvent.h \
platform/PlatformMouseEvent.h \
platform/PlatformWheelEvent.h \
platform/Widget.h \
platform/KURL.h \
+ platform/graphics/Color.h \
+ platform/graphics/ColorSpace.h \
+ platform/graphics/GraphicsTypes.h \
+ platform/graphics/Image.h \
+ platform/graphics/ImageSource.h \
platform/graphics/FloatRect.h \
platform/graphics/GraphicsContext.h \
platform/graphics/GraphicsLayerClient.h \
@@ -716,6 +723,7 @@ WEBCORE_HEADERS_FOR_WEBKIT2 += \
platform/graphics/Tile.h \
platform/graphics/TiledBackingStore.h \
platform/graphics/TiledBackingStoreClient.h \
+ platform/sql/SQLiteDatabase.h \
platform/text/PlatformString.h \
platform/text/StringImpl.h \
platform/MIMETypeRegistry.h \
@@ -808,7 +816,7 @@ idl.depends = $$PWD/bindings/scripts/CodeGenerator.pm \
addExtraCompiler(idl)
# GENERATOR 2: inspector idl compiler
-inspectorIDL.output = $${WC_GENERATED_SOURCES_DIR}/Remote${QMAKE_FILE_BASE}Frontend.cpp
+inspectorIDL.output = $${WC_GENERATED_SOURCES_DIR}/Remote${QMAKE_FILE_BASE}Frontend.cpp $${WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}BackendDispatcher.cpp
inspectorIDL.input = INSPECTOR_INTERFACES
inspectorIDL.wkScript = $$PWD/bindings/scripts/generate-bindings.pl
inspectorIDL.commands = perl -I$$PWD/bindings/scripts -I$$PWD/inspector $$inspectorIDL.wkScript --defines \"$${FEATURE_DEFINES_JAVASCRIPT}\" --generator Inspector --outputDir $$WC_GENERATED_SOURCES_DIR --preprocessor \"$${QMAKE_MOC} -E\" ${QMAKE_FILE_NAME}
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 8ed7157..b7f152e 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -549,6 +549,7 @@ SOURCES += \
dom/UIEvent.cpp \
dom/UIEventWithKeyState.cpp \
dom/UserGestureIndicator.cpp \
+ dom/UserTypingGestureIndicator.cpp \
dom/ViewportArguments.cpp \
dom/WebKitAnimationEvent.cpp \
dom/WebKitTransitionEvent.cpp \
@@ -925,6 +926,7 @@ SOURCES += \
platform/network/ResourceRequestBase.cpp \
platform/network/ResourceResponseBase.cpp \
platform/text/RegularExpression.cpp \
+ platform/SchemeRegistry.cpp \
platform/Scrollbar.cpp \
platform/ScrollbarThemeComposite.cpp \
platform/ScrollView.cpp \
@@ -1610,7 +1612,6 @@ HEADERS += \
page/SpatialNavigation.h \
page/SpeechInput.h \
page/SpeechInputClient.h \
- page/SpeechInputClientListener.h \
page/SpeechInputListener.h \
page/WindowFeatures.h \
page/WorkerNavigator.h \
@@ -1825,6 +1826,7 @@ HEADERS += \
rendering/RenderSVGModelObject.h \
rendering/RenderSVGResource.h \
rendering/RenderSVGResourceClipper.h \
+ rendering/RenderSVGResourceContainer.h \
rendering/RenderSVGResourceFilter.h \
rendering/RenderSVGResourceGradient.h \
rendering/RenderSVGResourceLinearGradient.h \
@@ -1893,6 +1895,9 @@ HEADERS += \
rendering/SVGMarkerLayoutInfo.h \
rendering/SVGRenderSupport.h \
rendering/SVGRenderTreeAsText.h \
+ rendering/SVGResources.h \
+ rendering/SVGResourcesCache.h \
+ rendering/SVGResourcesCycleSolver.h \
rendering/SVGRootInlineBox.h \
rendering/SVGShadowTreeElements.h \
rendering/SVGTextChunkLayoutInfo.h \
@@ -2905,6 +2910,7 @@ contains(DEFINES, ENABLE_SVG=1) {
rendering/RenderSVGModelObject.cpp \
rendering/RenderSVGResource.cpp \
rendering/RenderSVGResourceClipper.cpp \
+ rendering/RenderSVGResourceContainer.cpp \
rendering/RenderSVGResourceFilter.cpp \
rendering/RenderSVGResourceGradient.cpp \
rendering/RenderSVGResourceLinearGradient.cpp \
@@ -2926,6 +2932,9 @@ contains(DEFINES, ENABLE_SVG=1) {
rendering/SVGInlineTextBox.cpp \
rendering/SVGMarkerLayoutInfo.cpp \
rendering/SVGRenderSupport.cpp \
+ rendering/SVGResources.cpp \
+ rendering/SVGResourcesCache.cpp \
+ rendering/SVGResourcesCycleSolver.cpp \
rendering/SVGRootInlineBox.cpp \
rendering/SVGShadowTreeElements.cpp \
rendering/SVGTextChunkLayoutInfo.cpp \
@@ -3342,11 +3351,13 @@ SOURCES += \
../WebKit2/UIProcess/WebProcessProxy.cpp \
../WebKit2/UIProcess/WebUIClient.cpp \
../WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp \
+ ../WebKit2/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp \
../WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp \
../WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp \
../WebKit2/WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp \
../WebKit2/UIProcess/API/qt/ClientImpl.cpp \
../WebKit2/UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp \
+ ../WebKit2/UIProcess/qt/WebContextQt.cpp \
../WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp \
../WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp \
../WebKit2/WebProcess/WebCoreSupport/WebDragClient.cpp \
@@ -3363,6 +3374,7 @@ SOURCES += \
../WebKit2/WebProcess/WebPage/qt/ChunkedUpdateDrawingAreaQt.cpp \
../WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp \
../WebKit2/WebProcess/WebProcess.cpp \
+ ../WebKit2/WebProcess/qt/WebProcessMainQt.cpp
}
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 17a6b7f..de4b3c4 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -8781,62 +8781,6 @@
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorBackend.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Internal|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_All|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorBackend.h"
- >
- </File>
- <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorFrontendHost.cpp"
>
<FileConfiguration
@@ -20741,6 +20685,14 @@
>
</File>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\InspectorBackendDispatcher.cpp"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\InspectorBackendDispatcher.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\RemoteInspectorFrontend.cpp"
>
</File>
@@ -22513,10 +22465,6 @@
>
</File>
<File
- RelativePath="..\page\SpeechInputClientListener.h"
- >
- </File>
- <File
RelativePath="..\page\SpeechInputListener.h"
>
</File>
@@ -22777,6 +22725,10 @@
>
</File>
<File
+ RelativePath="..\loader\DocumentLoadTiming.h"
+ >
+ </File>
+ <File
RelativePath="..\loader\DocumentLoader.cpp"
>
</File>
@@ -23477,6 +23429,14 @@
>
</File>
<File
+ RelativePath="..\platform\SchemeRegistry.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\SchemeRegistry.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\Scrollbar.cpp"
>
</File>
@@ -29945,6 +29905,62 @@
>
</File>
<File
+ RelativePath="..\rendering\RenderSVGResourceContainer.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\rendering\RenderSVGResourceContainer.h"
+ >
+ </File>
+ <File
RelativePath="..\rendering\RenderSVGResourceFilter.cpp"
>
<FileConfiguration
@@ -31419,6 +31435,174 @@
>
</File>
<File
+ RelativePath="..\rendering\SVGResources.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\rendering\SVGResources.h"
+ >
+ </File>
+ <File
+ RelativePath="..\rendering\SVGResourcesCache.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\rendering\SVGResourcesCache.h"
+ >
+ </File>
+ <File
+ RelativePath="..\rendering\SVGResourcesCycleSolver.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\rendering\SVGResourcesCycleSolver.h"
+ >
+ </File>
+ <File
RelativePath="..\rendering\SVGRootInlineBox.cpp"
>
<FileConfiguration
@@ -33025,6 +33209,14 @@
>
</File>
<File
+ RelativePath="..\dom\UserTypingGestureIndicator.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\dom\UserTypingGestureIndicator.h"
+ >
+ </File>
+ <File
RelativePath="..\dom\ViewportArguments.cpp"
>
</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index af1949f..7af6387 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -99,6 +99,10 @@
084CE5CC0F27DADC00E6240E /* WMLOptGroupElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 084CE5C80F27DADC00E6240E /* WMLOptGroupElement.h */; };
084CE5CD0F27DADC00E6240E /* WMLOptionElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 084CE5C90F27DADC00E6240E /* WMLOptionElement.cpp */; };
084CE5CE0F27DADC00E6240E /* WMLOptionElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 084CE5CA0F27DADC00E6240E /* WMLOptionElement.h */; };
+ 084D0E3C11F5816100081E1A /* SVGResources.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 084D0E3811F5816100081E1A /* SVGResources.cpp */; };
+ 084D0E3D11F5816100081E1A /* SVGResources.h in Headers */ = {isa = PBXBuildFile; fileRef = 084D0E3911F5816100081E1A /* SVGResources.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 084D0E3E11F5816100081E1A /* SVGResourcesCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 084D0E3A11F5816100081E1A /* SVGResourcesCache.cpp */; };
+ 084D0E3F11F5816100081E1A /* SVGResourcesCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 084D0E3B11F5816100081E1A /* SVGResourcesCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
084D2833110A7FCB0038239A /* SVGAnimatedPropertySynchronizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 084D2831110A7FCB0038239A /* SVGAnimatedPropertySynchronizer.h */; settings = {ATTRIBUTES = (Private, ); }; };
084D2834110A7FCB0038239A /* SVGAnimatedPropertyTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 084D2832110A7FCB0038239A /* SVGAnimatedPropertyTraits.h */; settings = {ATTRIBUTES = (Private, ); }; };
084DBAA10ED39D360038C226 /* WMLVariables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 084DBA9D0ED39D350038C226 /* WMLVariables.cpp */; };
@@ -112,10 +116,13 @@
08591AA50F085C4E009BACB1 /* InputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08591AA40F085C4E009BACB1 /* InputElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
085AFDC80F2977350061F2B3 /* WMLFormControlElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 085AFDC60F2977350061F2B3 /* WMLFormControlElement.cpp */; };
085AFDC90F2977350061F2B3 /* WMLFormControlElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 085AFDC70F2977350061F2B3 /* WMLFormControlElement.h */; settings = {ATTRIBUTES = (); }; };
+ 085B05C211FAE16C004D65F6 /* SVGResourcesCycleSolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 085B05C011FAE16C004D65F6 /* SVGResourcesCycleSolver.cpp */; };
+ 085B05C311FAE16C004D65F6 /* SVGResourcesCycleSolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 085B05C111FAE16C004D65F6 /* SVGResourcesCycleSolver.h */; };
085B92BA0EFDE73D00E6123C /* FormDataBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 085B92B80EFDE73D00E6123C /* FormDataBuilder.cpp */; };
- 085B92BB0EFDE73D00E6123C /* FormDataBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 085B92B90EFDE73D00E6123C /* FormDataBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 085B92BB0EFDE73D00E6123C /* FormDataBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 085B92B90EFDE73D00E6123C /* FormDataBuilder.h */; settings = {ATTRIBUTES = (); }; };
0865CCE60EDDF51B00DF9EC3 /* WMLNoopElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0865CCE40EDDF51B00DF9EC3 /* WMLNoopElement.cpp */; };
0865CCE70EDDF51B00DF9EC3 /* WMLNoopElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 0865CCE50EDDF51B00DF9EC3 /* WMLNoopElement.h */; };
+ 086A400611F6D6B7002CEC53 /* RenderSVGResourceContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 086A400511F6D6B7002CEC53 /* RenderSVGResourceContainer.cpp */; };
08700BE70F086C5300919419 /* InputElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08700BE60F086C5300919419 /* InputElement.cpp */; };
087281550F26B9B600AFC596 /* OptionElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 087281510F26B9B600AFC596 /* OptionElement.cpp */; };
087281560F26B9B600AFC596 /* OptionElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 087281520F26B9B600AFC596 /* OptionElement.h */; };
@@ -345,7 +352,7 @@
1A3417C90CECFF250049CBDE /* JSCustomVoidCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3417C70CECFF250049CBDE /* JSCustomVoidCallback.h */; };
1A3417CA0CECFF250049CBDE /* JSCustomVoidCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3417C80CECFF250049CBDE /* JSCustomVoidCallback.cpp */; };
1A494BFA0A122F4400FDAFC1 /* JSHTMLElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A494BF80A122F4400FDAFC1 /* JSHTMLElement.cpp */; };
- 1A494BFB0A122F4400FDAFC1 /* JSHTMLElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A494BF90A122F4400FDAFC1 /* JSHTMLElement.h */; };
+ 1A494BFB0A122F4400FDAFC1 /* JSHTMLElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A494BF90A122F4400FDAFC1 /* JSHTMLElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
1A494E340A12358B00FDAFC1 /* JSHTMLDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A494E320A12358A00FDAFC1 /* JSHTMLDocument.cpp */; };
1A494E350A12358B00FDAFC1 /* JSHTMLDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A494E330A12358B00FDAFC1 /* JSHTMLDocument.h */; };
1A494EDE0A123F4C00FDAFC1 /* JSDocumentFragment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A494EDC0A123F4C00FDAFC1 /* JSDocumentFragment.cpp */; };
@@ -806,7 +813,7 @@
416E75CB0EDF90C700360E1D /* ScriptCallFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 416E75C90EDF90C700360E1D /* ScriptCallFrame.h */; };
416E75CC0EDF90C700360E1D /* ScriptCallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 416E75CA0EDF90C700360E1D /* ScriptCallFrame.cpp */; };
416F45F00ED7B311008215B6 /* ScriptString.h in Headers */ = {isa = PBXBuildFile; fileRef = 416F45EF0ED7B311008215B6 /* ScriptString.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 41885B9311B6FDA6003383BB /* FormSubmission.h in Headers */ = {isa = PBXBuildFile; fileRef = 41885B9111B6FDA6003383BB /* FormSubmission.h */; };
+ 41885B9311B6FDA6003383BB /* FormSubmission.h in Headers */ = {isa = PBXBuildFile; fileRef = 41885B9111B6FDA6003383BB /* FormSubmission.h */; settings = {ATTRIBUTES = (Private, ); }; };
41885B9411B6FDA6003383BB /* FormSubmission.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41885B9211B6FDA6003383BB /* FormSubmission.cpp */; };
418F88040FF957AE0080F045 /* JSAbstractWorker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 418F88020FF957AE0080F045 /* JSAbstractWorker.cpp */; };
418F88050FF957AF0080F045 /* JSAbstractWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = 418F88030FF957AE0080F045 /* JSAbstractWorker.h */; };
@@ -832,8 +839,6 @@
41E1B1D10FF5986900576B3B /* AbstractWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = 41E1B1CB0FF5986900576B3B /* AbstractWorker.h */; };
41E1B1D30FF5986900576B3B /* SharedWorker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41E1B1CD0FF5986900576B3B /* SharedWorker.cpp */; };
41E1B1D40FF5986900576B3B /* SharedWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = 41E1B1CE0FF5986900576B3B /* SharedWorker.h */; };
- 41F060CD0F5EEB2B00A07EAC /* JSInspectorBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F060CB0F5EEB2B00A07EAC /* JSInspectorBackend.cpp */; };
- 41F060CE0F5EEB2B00A07EAC /* JSInspectorBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F060CC0F5EEB2B00A07EAC /* JSInspectorBackend.h */; };
41F061740F5F00AC00A07EAC /* InspectorDOMStorageResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F061720F5F00AC00A07EAC /* InspectorDOMStorageResource.h */; };
41F061750F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F061730F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp */; };
41F0618E0F5F069800A07EAC /* ConsoleMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F0618C0F5F069800A07EAC /* ConsoleMessage.h */; };
@@ -1030,6 +1035,8 @@
4F3289B511A42AAB005ABE7E /* InspectorValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F3289B311A42AAB005ABE7E /* InspectorValues.cpp */; };
4F3289B611A42AAB005ABE7E /* InspectorValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F3289B411A42AAB005ABE7E /* InspectorValues.h */; settings = {ATTRIBUTES = (Private, ); }; };
4F4F5FFB11CBD2E100A186BF /* RemoteInspectorFrontend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F4F5FFA11CBD2D200A186BF /* RemoteInspectorFrontend.cpp */; };
+ 4F707A9911EF679400ACDA69 /* InspectorBackendDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F707A9711EF679400ACDA69 /* InspectorBackendDispatcher.cpp */; };
+ 4F707A9A11EF679400ACDA69 /* InspectorBackendDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F707A9811EF679400ACDA69 /* InspectorBackendDispatcher.h */; };
4FD8D0F2119C718B002FA825 /* ScriptGCEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FD8D0F0119C718B002FA825 /* ScriptGCEvent.cpp */; };
4FD8D0F3119C718B002FA825 /* ScriptGCEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FD8D0F1119C718B002FA825 /* ScriptGCEvent.h */; };
510184690B08602A004A825F /* CachedPage.h in Headers */ = {isa = PBXBuildFile; fileRef = 510184670B08602A004A825F /* CachedPage.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1106,6 +1113,8 @@
5160300B0CC4251200C8AC25 /* FileSystemPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5160300A0CC4251200C8AC25 /* FileSystemPOSIX.cpp */; };
5160306C0CC4362300C8AC25 /* FileSystemCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5160306B0CC4362300C8AC25 /* FileSystemCF.cpp */; };
5160F4980B0AA75F00C1D2AF /* HistoryItemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */; };
+ 5162C7F411F77EFB00612EFE /* SchemeRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */; };
+ 5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 5162C7F311F77EFB00612EFE /* SchemeRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
516BB7940CE91E6800512F79 /* JSTreeWalkerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */; };
51721FBB11D2790700638B42 /* BeforeProcessEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 51721FB911D2790700638B42 /* BeforeProcessEvent.h */; };
51721FD211D27EF200638B42 /* JSBeforeProcessEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51721FD011D27EF200638B42 /* JSBeforeProcessEvent.cpp */; };
@@ -1347,7 +1356,6 @@
7578F90B11DDF26900D933C5 /* SpeechInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7578F90811DDF26900D933C5 /* SpeechInput.cpp */; };
7578F90C11DDF26900D933C5 /* SpeechInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 7578F90911DDF26900D933C5 /* SpeechInput.h */; };
7578F90D11DDF26900D933C5 /* SpeechInputClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7578F90A11DDF26900D933C5 /* SpeechInputClient.h */; };
- 7578F91F11E4E32800D933C5 /* SpeechInputClientListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7578F91D11E4E32800D933C5 /* SpeechInputClientListener.h */; };
7578F92011E4E32800D933C5 /* SpeechInputListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7578F91E11E4E32800D933C5 /* SpeechInputListener.h */; };
75793E830D0CE0B3007FC0AC /* MessageEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */; };
75793E840D0CE0B3007FC0AC /* MessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793E810D0CE0B3007FC0AC /* MessageEvent.h */; };
@@ -2323,6 +2331,7 @@
89BED5EC11BE11CE00448492 /* BlobBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 89BED5EA11BE11CE00448492 /* BlobBuilder.h */; };
89CD029311C85B870070B791 /* JSBlobBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89CD029111C85B870070B791 /* JSBlobBuilder.cpp */; };
89CD029411C85B870070B791 /* JSBlobBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 89CD029211C85B870070B791 /* JSBlobBuilder.h */; };
+ 8A12E35D11FA33280025836A /* DocumentLoadTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A12E35C11FA33280025836A /* DocumentLoadTiming.h */; settings = {ATTRIBUTES = (Private, ); }; };
8A81BF8511DCFD9000DA2B98 /* ResourceLoadTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A81BF8411DCFD9000DA2B98 /* ResourceLoadTiming.h */; settings = {ATTRIBUTES = (Private, ); }; };
8A844D0411D3C18E0014065C /* Performance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A844D0111D3C18E0014065C /* Performance.cpp */; };
8A844D0511D3C18E0014065C /* Performance.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A844D0211D3C18E0014065C /* Performance.h */; };
@@ -2448,7 +2457,7 @@
934F71420D5A6F4400018D69 /* ResourceError.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F71410D5A6F4400018D69 /* ResourceError.h */; settings = {ATTRIBUTES = (Private, ); }; };
934F71440D5A6F5300018D69 /* AuthenticationChallenge.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F71430D5A6F5300018D69 /* AuthenticationChallenge.h */; settings = {ATTRIBUTES = (Private, ); }; };
934FE9E50B5CA539003E4A73 /* FileChooser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 934FE9E40B5CA539003E4A73 /* FileChooser.cpp */; };
- 935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 935207BD09BD410A00F2038D /* LocalizedStrings.h */; };
+ 935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 935207BD09BD410A00F2038D /* LocalizedStrings.h */; settings = {ATTRIBUTES = (Private, ); }; };
935207C009BD412100F2038D /* LocalizedStringsMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 935207BF09BD412000F2038D /* LocalizedStringsMac.mm */; };
9352084509BD43B900F2038D /* Language.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9352084409BD43B900F2038D /* Language.mm */; };
9352087709BD453400F2038D /* CookieJar.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9352087609BD453400F2038D /* CookieJar.mm */; };
@@ -2506,7 +2515,7 @@
93B70D6909EB0C7C009D8468 /* JSEventListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D4D09EB0C7C009D8468 /* JSEventListener.cpp */; };
93B70D6A09EB0C7C009D8468 /* JSEventListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D4E09EB0C7C009D8468 /* JSEventListener.h */; };
93B70D6B09EB0C7C009D8468 /* JSPluginElementFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D4F09EB0C7C009D8468 /* JSPluginElementFunctions.cpp */; };
- 93B70D6C09EB0C7C009D8468 /* JSPluginElementFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D5009EB0C7C009D8468 /* JSPluginElementFunctions.h */; };
+ 93B70D6C09EB0C7C009D8468 /* JSPluginElementFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D5009EB0C7C009D8468 /* JSPluginElementFunctions.h */; settings = {ATTRIBUTES = (Private, ); }; };
93B70D6F09EB0C7C009D8468 /* ScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D5309EB0C7C009D8468 /* ScriptController.cpp */; };
93B70D7009EB0C7C009D8468 /* ScriptController.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D5409EB0C7C009D8468 /* ScriptController.h */; settings = {ATTRIBUTES = (Private, ); }; };
93B77A380ADD792500EA4B81 /* FrameLoaderTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B77A370ADD792500EA4B81 /* FrameLoaderTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -4501,6 +4510,7 @@
BC5A86850C33676000EEA649 /* DOMSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5A86820C33676000EEA649 /* DOMSelection.h */; };
BC5A86B50C3367E800EEA649 /* JSDOMSelection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC5A86B30C3367E800EEA649 /* JSDOMSelection.cpp */; };
BC5A86B60C3367E800EEA649 /* JSDOMSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5A86B40C3367E800EEA649 /* JSDOMSelection.h */; };
+ BC5CFCA911F793320099ED09 /* LocalizationStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5CFCA811F793320099ED09 /* LocalizationStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC5EB5DB0E81B7EA00B25965 /* BorderValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5EB5DA0E81B7EA00B25965 /* BorderValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC5EB5DD0E81B8DD00B25965 /* OutlineValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5EB5DC0E81B8DD00B25965 /* OutlineValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC5EB5DF0E81B9AB00B25965 /* CollapsedBorderValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5EB5DE0E81B9AB00B25965 /* CollapsedBorderValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -4782,6 +4792,8 @@
BCDBB8AD0E088CA500C60FF6 /* FileList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDBB8AB0E088CA500C60FF6 /* FileList.cpp */; };
BCDBB8CD0E08958400C60FF6 /* File.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDBB8CB0E08958400C60FF6 /* File.h */; };
BCDBB8CE0E08958400C60FF6 /* File.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDBB8CC0E08958400C60FF6 /* File.cpp */; };
+ BCDF317B11F8D683003C5BF8 /* UserTypingGestureIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDF317911F8D683003C5BF8 /* UserTypingGestureIndicator.cpp */; };
+ BCDF317C11F8D683003C5BF8 /* UserTypingGestureIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDF317A11F8D683003C5BF8 /* UserTypingGestureIndicator.h */; settings = {ATTRIBUTES = (Private, ); }; };
BCDFD48E0E305290009D10AD /* XMLHttpRequestUpload.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDFD48C0E305290009D10AD /* XMLHttpRequestUpload.h */; };
BCDFD48F0E305290009D10AD /* XMLHttpRequestUpload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDFD48D0E305290009D10AD /* XMLHttpRequestUpload.cpp */; };
BCDFD4920E3056BD009D10AD /* JSXMLHttpRequestUploadCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDFD4910E3056BD009D10AD /* JSXMLHttpRequestUploadCustom.cpp */; };
@@ -5087,7 +5099,7 @@
E1C8BE5D0E8BD15A0064CB7D /* JSWorker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1C8BE5C0E8BD15A0064CB7D /* JSWorker.cpp */; };
E1CA5CBC0E8CDCAF00E8EF90 /* JSWorkerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1CA5CBB0E8CDCAF00E8EF90 /* JSWorkerCustom.cpp */; };
E1CAA5C60E8BD23600A73ECA /* JSWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = E1CAA5C50E8BD23600A73ECA /* JSWorker.h */; };
- E1E1BF00115FF6FB006F52CA /* WindowsKeyboardCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = E1E1BEFF115FF6FB006F52CA /* WindowsKeyboardCodes.h */; };
+ E1E1BF00115FF6FB006F52CA /* WindowsKeyboardCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = E1E1BEFF115FF6FB006F52CA /* WindowsKeyboardCodes.h */; settings = {ATTRIBUTES = (Private, ); }; };
E1E6EEA40B628DA8005F2F70 /* JSHTMLSelectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1E6EEA30B628DA8005F2F70 /* JSHTMLSelectElement.cpp */; };
E1E6EEA80B628DB3005F2F70 /* JSHTMLSelectElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E1E6EEA70B628DB3005F2F70 /* JSHTMLSelectElement.h */; };
E1EBBBD40AAC9B87001FE8E2 /* CSSCharsetRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EBBBD30AAC9B87001FE8E2 /* CSSCharsetRule.cpp */; };
@@ -5749,6 +5761,10 @@
084CE5C80F27DADC00E6240E /* WMLOptGroupElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLOptGroupElement.h; sourceTree = "<group>"; };
084CE5C90F27DADC00E6240E /* WMLOptionElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLOptionElement.cpp; sourceTree = "<group>"; };
084CE5CA0F27DADC00E6240E /* WMLOptionElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLOptionElement.h; sourceTree = "<group>"; };
+ 084D0E3811F5816100081E1A /* SVGResources.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResources.cpp; sourceTree = "<group>"; };
+ 084D0E3911F5816100081E1A /* SVGResources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGResources.h; sourceTree = "<group>"; };
+ 084D0E3A11F5816100081E1A /* SVGResourcesCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResourcesCache.cpp; sourceTree = "<group>"; };
+ 084D0E3B11F5816100081E1A /* SVGResourcesCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGResourcesCache.h; sourceTree = "<group>"; };
084D2831110A7FCB0038239A /* SVGAnimatedPropertySynchronizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertySynchronizer.h; sourceTree = "<group>"; };
084D2832110A7FCB0038239A /* SVGAnimatedPropertyTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyTraits.h; sourceTree = "<group>"; };
084DBA9D0ED39D350038C226 /* WMLVariables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLVariables.cpp; sourceTree = "<group>"; };
@@ -5762,10 +5778,13 @@
08591AA40F085C4E009BACB1 /* InputElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputElement.h; sourceTree = "<group>"; };
085AFDC60F2977350061F2B3 /* WMLFormControlElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLFormControlElement.cpp; sourceTree = "<group>"; };
085AFDC70F2977350061F2B3 /* WMLFormControlElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLFormControlElement.h; sourceTree = "<group>"; };
+ 085B05C011FAE16C004D65F6 /* SVGResourcesCycleSolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResourcesCycleSolver.cpp; sourceTree = "<group>"; };
+ 085B05C111FAE16C004D65F6 /* SVGResourcesCycleSolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGResourcesCycleSolver.h; sourceTree = "<group>"; };
085B92B80EFDE73D00E6123C /* FormDataBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormDataBuilder.cpp; sourceTree = "<group>"; };
085B92B90EFDE73D00E6123C /* FormDataBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormDataBuilder.h; sourceTree = "<group>"; };
0865CCE40EDDF51B00DF9EC3 /* WMLNoopElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLNoopElement.cpp; sourceTree = "<group>"; };
0865CCE50EDDF51B00DF9EC3 /* WMLNoopElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLNoopElement.h; sourceTree = "<group>"; };
+ 086A400511F6D6B7002CEC53 /* RenderSVGResourceContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourceContainer.cpp; sourceTree = "<group>"; };
08700BE60F086C5300919419 /* InputElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InputElement.cpp; sourceTree = "<group>"; };
087281510F26B9B600AFC596 /* OptionElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionElement.cpp; sourceTree = "<group>"; };
087281520F26B9B600AFC596 /* OptionElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OptionElement.h; sourceTree = "<group>"; };
@@ -6533,8 +6552,6 @@
41E1B1CD0FF5986900576B3B /* SharedWorker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SharedWorker.cpp; path = workers/SharedWorker.cpp; sourceTree = "<group>"; };
41E1B1CE0FF5986900576B3B /* SharedWorker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SharedWorker.h; path = workers/SharedWorker.h; sourceTree = "<group>"; };
41E1B1CF0FF5986900576B3B /* SharedWorker.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = SharedWorker.idl; path = workers/SharedWorker.idl; sourceTree = "<group>"; };
- 41F060CB0F5EEB2B00A07EAC /* JSInspectorBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInspectorBackend.cpp; sourceTree = "<group>"; };
- 41F060CC0F5EEB2B00A07EAC /* JSInspectorBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInspectorBackend.h; sourceTree = "<group>"; };
41F061720F5F00AC00A07EAC /* InspectorDOMStorageResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMStorageResource.h; sourceTree = "<group>"; };
41F061730F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDOMStorageResource.cpp; sourceTree = "<group>"; };
41F0618C0F5F069800A07EAC /* ConsoleMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsoleMessage.h; sourceTree = "<group>"; };
@@ -6772,6 +6789,8 @@
4F3289B411A42AAB005ABE7E /* InspectorValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorValues.h; sourceTree = "<group>"; };
4F4F5FFA11CBD2D200A186BF /* RemoteInspectorFrontend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteInspectorFrontend.cpp; sourceTree = "<group>"; };
4F4F5FFC11CBD30100A186BF /* RemoteInspectorFrontend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteInspectorFrontend.h; sourceTree = "<group>"; };
+ 4F707A9711EF679400ACDA69 /* InspectorBackendDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorBackendDispatcher.cpp; sourceTree = "<group>"; };
+ 4F707A9811EF679400ACDA69 /* InspectorBackendDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorBackendDispatcher.h; sourceTree = "<group>"; };
4FD8D0F0119C718B002FA825 /* ScriptGCEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptGCEvent.cpp; sourceTree = "<group>"; };
4FD8D0F1119C718B002FA825 /* ScriptGCEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptGCEvent.h; sourceTree = "<group>"; };
510184670B08602A004A825F /* CachedPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedPage.h; sourceTree = "<group>"; };
@@ -6850,6 +6869,8 @@
5160300A0CC4251200C8AC25 /* FileSystemPOSIX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystemPOSIX.cpp; sourceTree = "<group>"; };
5160306B0CC4362300C8AC25 /* FileSystemCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystemCF.cpp; sourceTree = "<group>"; };
5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = HistoryItemMac.mm; path = mac/HistoryItemMac.mm; sourceTree = "<group>"; };
+ 5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SchemeRegistry.cpp; sourceTree = "<group>"; };
+ 5162C7F311F77EFB00612EFE /* SchemeRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SchemeRegistry.h; sourceTree = "<group>"; };
516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTreeWalkerCustom.cpp; sourceTree = "<group>"; };
51721FB911D2790700638B42 /* BeforeProcessEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BeforeProcessEvent.h; sourceTree = "<group>"; };
51721FBA11D2790700638B42 /* BeforeProcessEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BeforeProcessEvent.idl; sourceTree = "<group>"; };
@@ -7114,7 +7135,6 @@
7578F90811DDF26900D933C5 /* SpeechInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechInput.cpp; sourceTree = "<group>"; };
7578F90911DDF26900D933C5 /* SpeechInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInput.h; sourceTree = "<group>"; };
7578F90A11DDF26900D933C5 /* SpeechInputClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInputClient.h; sourceTree = "<group>"; };
- 7578F91D11E4E32800D933C5 /* SpeechInputClientListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInputClientListener.h; sourceTree = "<group>"; };
7578F91E11E4E32800D933C5 /* SpeechInputListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInputListener.h; sourceTree = "<group>"; };
75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MessageEvent.cpp; path = dom/MessageEvent.cpp; sourceTree = SOURCE_ROOT; };
75793E810D0CE0B3007FC0AC /* MessageEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MessageEvent.h; path = dom/MessageEvent.h; sourceTree = SOURCE_ROOT; };
@@ -7161,7 +7181,6 @@
7A24587A1021EAF4000A00AA /* InspectorDOMAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMAgent.h; sourceTree = "<group>"; };
7A674BD90F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroupLoadDeferrer.cpp; sourceTree = "<group>"; };
7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageGroupLoadDeferrer.h; sourceTree = "<group>"; };
- 7A74ECB61018399A00BF939E /* InspectorBackend.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = InspectorBackend.idl; sourceTree = "<group>"; };
7A74ECB8101839A500BF939E /* InspectorBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorBackend.cpp; sourceTree = "<group>"; };
7A74ECB9101839A600BF939E /* InspectorBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorBackend.h; sourceTree = "<group>"; };
7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInspectorFrontendHostCustom.cpp; sourceTree = "<group>"; };
@@ -8046,6 +8065,7 @@
89CD027911C859A80070B791 /* BlobBuilder.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BlobBuilder.idl; sourceTree = "<group>"; };
89CD029111C85B870070B791 /* JSBlobBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBlobBuilder.cpp; sourceTree = "<group>"; };
89CD029211C85B870070B791 /* JSBlobBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBlobBuilder.h; sourceTree = "<group>"; };
+ 8A12E35C11FA33280025836A /* DocumentLoadTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentLoadTiming.h; sourceTree = "<group>"; };
8A81BF8411DCFD9000DA2B98 /* ResourceLoadTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadTiming.h; sourceTree = "<group>"; };
8A844D0111D3C18E0014065C /* Performance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Performance.cpp; sourceTree = "<group>"; };
8A844D0211D3C18E0014065C /* Performance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Performance.h; sourceTree = "<group>"; };
@@ -10121,6 +10141,7 @@
BC5A86830C33676000EEA649 /* DOMSelection.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = DOMSelection.idl; sourceTree = "<group>"; };
BC5A86B30C3367E800EEA649 /* JSDOMSelection.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMSelection.cpp; sourceTree = "<group>"; };
BC5A86B40C3367E800EEA649 /* JSDOMSelection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSDOMSelection.h; sourceTree = "<group>"; };
+ BC5CFCA811F793320099ED09 /* LocalizationStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalizationStrategy.h; sourceTree = "<group>"; };
BC5EB5DA0E81B7EA00B25965 /* BorderValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BorderValue.h; path = style/BorderValue.h; sourceTree = "<group>"; };
BC5EB5DC0E81B8DD00B25965 /* OutlineValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OutlineValue.h; path = style/OutlineValue.h; sourceTree = "<group>"; };
BC5EB5DE0E81B9AB00B25965 /* CollapsedBorderValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CollapsedBorderValue.h; path = style/CollapsedBorderValue.h; sourceTree = "<group>"; };
@@ -10422,6 +10443,8 @@
BCDBB8AB0E088CA500C60FF6 /* FileList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileList.cpp; sourceTree = "<group>"; };
BCDBB8CB0E08958400C60FF6 /* File.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = File.h; sourceTree = "<group>"; };
BCDBB8CC0E08958400C60FF6 /* File.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = File.cpp; sourceTree = "<group>"; };
+ BCDF317911F8D683003C5BF8 /* UserTypingGestureIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserTypingGestureIndicator.cpp; sourceTree = "<group>"; };
+ BCDF317A11F8D683003C5BF8 /* UserTypingGestureIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserTypingGestureIndicator.h; sourceTree = "<group>"; };
BCDFD48C0E305290009D10AD /* XMLHttpRequestUpload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLHttpRequestUpload.h; sourceTree = "<group>"; };
BCDFD48D0E305290009D10AD /* XMLHttpRequestUpload.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLHttpRequestUpload.cpp; sourceTree = "<group>"; };
BCDFD4900E305644009D10AD /* XMLHttpRequestUpload.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XMLHttpRequestUpload.idl; sourceTree = "<group>"; };
@@ -11010,6 +11033,7 @@
93EEC1EC09C2877700C515D1 /* html */,
1C81B94D0E9732D900266E07 /* inspector */,
BCB16BFB0979C38700467741 /* loader */,
+ FABE72EC1059C1EB00D999DD /* mathml */,
333F703D0FB49C16008E12A6 /* notifications */,
65BF02180974806300C43196 /* page */,
BCF1A5BA097832090061A123 /* platform */,
@@ -11416,10 +11440,10 @@
1C5FAECA0DCFD8C900D58F78 /* Inspector */ = {
isa = PBXGroup;
children = (
+ 4F707A9711EF679400ACDA69 /* InspectorBackendDispatcher.cpp */,
+ 4F707A9811EF679400ACDA69 /* InspectorBackendDispatcher.h */,
7A0E76D810BF059800A0276E /* JSInjectedScriptHost.cpp */,
7A0E76D910BF059800A0276E /* JSInjectedScriptHost.h */,
- 41F060CB0F5EEB2B00A07EAC /* JSInspectorBackend.cpp */,
- 41F060CC0F5EEB2B00A07EAC /* JSInspectorBackend.h */,
7A0E771C10C00DB100A0276E /* JSInspectorFrontendHost.cpp */,
7A0E771D10C00DB100A0276E /* JSInspectorFrontendHost.h */,
1C5FAECF0DCFD90100D58F78 /* JSJavaScriptCallFrame.cpp */,
@@ -11449,7 +11473,6 @@
B885E8D311E06DD2009FFBF4 /* InspectorApplicationCacheAgent.h */,
7A74ECB8101839A500BF939E /* InspectorBackend.cpp */,
7A74ECB9101839A600BF939E /* InspectorBackend.h */,
- 7A74ECB61018399A00BF939E /* InspectorBackend.idl */,
1C81B9580E97330800266E07 /* InspectorClient.h */,
1C81B9570E97330800266E07 /* InspectorController.cpp */,
1C81B9560E97330800266E07 /* InspectorController.h */,
@@ -12367,7 +12390,6 @@
7578F90811DDF26900D933C5 /* SpeechInput.cpp */,
7578F90911DDF26900D933C5 /* SpeechInput.h */,
7578F90A11DDF26900D933C5 /* SpeechInputClient.h */,
- 7578F91D11E4E32800D933C5 /* SpeechInputClientListener.h */,
7578F91E11E4E32800D933C5 /* SpeechInputListener.h */,
62C1217A11AB9E76003C462C /* SuspendableTimer.cpp */,
62C1217B11AB9E77003C462C /* SuspendableTimer.h */,
@@ -15612,14 +15634,14 @@
BC1A3790097C6F970019F3D8 /* bindings */ = {
isa = PBXGroup;
children = (
- 8C6EA61711EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp */,
- 8C6EA61811EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h */,
BC1A3793097C6FB10019F3D8 /* js */,
BC1A3794097C6FC40019F3D8 /* objc */,
93F8B3050A300FE100F61AB8 /* CodeGenerator.pm */,
93F8B3070A300FEA00F61AB8 /* generate-bindings.pl */,
14813BF309EDF88E00F757E1 /* IDLParser.pm */,
93F8B3080A300FEA00F61AB8 /* IDLStructure.pm */,
+ 8C6EA61711EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp */,
+ 8C6EA61811EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h */,
97EF7DFD107E55B700D7C49C /* ScriptControllerBase.cpp */,
CE02F0C311E83ADD00C6684A /* ScriptControllerBase.h */,
);
@@ -16005,7 +16027,6 @@
512DD8E80D91E691000F89EE /* archive */,
5126E6B60A2E3AEF005C29FA /* icon */,
93A1EAA20A5634D8006960A0 /* mac */,
- FABE72EC1059C1EB00D999DD /* mathml */,
BCB16BFE0979C3BD00467741 /* Cache.cpp */,
BCB16BFF0979C3BD00467741 /* Cache.h */,
BCB16C000979C3BD00467741 /* CachedCSSStyleSheet.cpp */,
@@ -16037,6 +16058,7 @@
BCB16C110979C3BD00467741 /* DocLoader.h */,
93E227DB0AF589AD00D48324 /* DocumentLoader.cpp */,
656D371E0ADBA5DE00A4554D /* DocumentLoader.h */,
+ 8A12E35C11FA33280025836A /* DocumentLoadTiming.h */,
0B9056150F2578BE0095FF6A /* DocumentThreadableLoader.cpp */,
0B9056160F2578BE0095FF6A /* DocumentThreadableLoader.h */,
9738899E116EA9DC00ADF313 /* DocumentWriter.cpp */,
@@ -16217,6 +16239,7 @@
BCFF64900EAD15C200C1D6F7 /* LengthSize.h */,
A7AD2F850EC89D07008AB002 /* LinkHash.cpp */,
A7AD2F860EC89D07008AB002 /* LinkHash.h */,
+ BC5CFCA811F793320099ED09 /* LocalizationStrategy.h */,
935207BD09BD410A00F2038D /* LocalizedStrings.h */,
A8239DFE09B3CF8A00B60641 /* Logging.cpp */,
A8239DFF09B3CF8A00B60641 /* Logging.h */,
@@ -16235,6 +16258,8 @@
BC3BE12A0E98092F00835588 /* PopupMenuStyle.h */,
E4D687780ED7AE4F006EA978 /* PurgeableBuffer.h */,
1C63A2460F71646600C09D5A /* RunLoopTimer.h */,
+ 5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */,
+ 5162C7F311F77EFB00612EFE /* SchemeRegistry.h */,
BC7B2AF80450824100A8000F /* Scrollbar.h */,
BC9BC64D0E7C4889008B9849 /* ScrollbarClient.h */,
BC8B854A0E7C7F5600AB6984 /* ScrollbarTheme.h */,
@@ -16755,6 +16780,7 @@
083192A7112B43050083C3B9 /* RenderSVGResource.h */,
84BDA16911358D2A00DBF64C /* RenderSVGResourceClipper.cpp */,
84BDA16A11358D2A00DBF64C /* RenderSVGResourceClipper.h */,
+ 086A400511F6D6B7002CEC53 /* RenderSVGResourceContainer.cpp */,
08082372117987C100241DE8 /* RenderSVGResourceContainer.h */,
841FDC241178C9BE00F8AC9B /* RenderSVGResourceFilter.cpp */,
841FDC251178C9BE00F8AC9B /* RenderSVGResourceFilter.h */,
@@ -16841,6 +16867,12 @@
A8F4FB930C169E7B002AFED5 /* SVGRenderSupport.h */,
B2EBDC9A0AF77E3400AE4A68 /* SVGRenderTreeAsText.cpp */,
B2EBDC9B0AF77E3400AE4A68 /* SVGRenderTreeAsText.h */,
+ 084D0E3811F5816100081E1A /* SVGResources.cpp */,
+ 084D0E3911F5816100081E1A /* SVGResources.h */,
+ 084D0E3A11F5816100081E1A /* SVGResourcesCache.cpp */,
+ 084D0E3B11F5816100081E1A /* SVGResourcesCache.h */,
+ 085B05C011FAE16C004D65F6 /* SVGResourcesCycleSolver.cpp */,
+ 085B05C111FAE16C004D65F6 /* SVGResourcesCycleSolver.h */,
853CA9E40AEEC608002372DC /* SVGRootInlineBox.cpp */,
853CA9E50AEEC608002372DC /* SVGRootInlineBox.h */,
08DAB9C01103D9C1003E7ABA /* SVGShadowTreeElements.cpp */,
@@ -17118,6 +17150,8 @@
85031B390A44EFC700F992E0 /* UIEventWithKeyState.h */,
2542F4D81166C25A00E89A86 /* UserGestureIndicator.cpp */,
2542F4D91166C25A00E89A86 /* UserGestureIndicator.h */,
+ BCDF317911F8D683003C5BF8 /* UserTypingGestureIndicator.cpp */,
+ BCDF317A11F8D683003C5BF8 /* UserTypingGestureIndicator.h */,
CEF418CC1179678C009D112C /* ViewportArguments.cpp */,
CEF418CD1179678C009D112C /* ViewportArguments.h */,
31C0FF1B0E4CEB6E007D6FE5 /* WebKitAnimationEvent.cpp */,
@@ -17172,8 +17206,7 @@
FA7EFB031120D25400CF79C7 /* RenderMathMLUnderOver.cpp */,
FA7EFB041120D25400CF79C7 /* RenderMathMLUnderOver.h */,
);
- name = mathml;
- path = ../mathml;
+ path = mathml;
sourceTree = "<group>";
};
/* End PBXGroup section */
@@ -17445,6 +17478,7 @@
A8185F4009765766005826D9 /* Document.h in Headers */,
A8185F3D09765766005826D9 /* DocumentFragment.h in Headers */,
656D37360ADBA5DE00A4554D /* DocumentLoader.h in Headers */,
+ 8A12E35D11FA33280025836A /* DocumentLoadTiming.h in Headers */,
ED2BA83C09A24B91006C0AC4 /* DocumentMarker.h in Headers */,
BCCFBAE80B5152ED0001F1D7 /* DocumentParser.h in Headers */,
0B90561A0F2578BF0095FF6A /* DocumentThreadableLoader.h in Headers */,
@@ -18498,6 +18532,7 @@
93309DF2099E64920056E581 /* InsertTextCommand.h in Headers */,
B885E8D511E06DD2009FFBF4 /* InspectorApplicationCacheAgent.h in Headers */,
7A74ECBB101839A600BF939E /* InspectorBackend.h in Headers */,
+ 4F707A9A11EF679400ACDA69 /* InspectorBackendDispatcher.h in Headers */,
1C81B95C0E97330800266E07 /* InspectorClient.h in Headers */,
1C81B95A0E97330800266E07 /* InspectorController.h in Headers */,
82B658981189E39200E052A1 /* InspectorCSSStore.h in Headers */,
@@ -18716,7 +18751,6 @@
A77979290D6B9E64003851B9 /* JSImageData.h in Headers */,
C585A69711D4FB13004C3E4B /* JSIndexedDatabaseRequest.h in Headers */,
7A0E76DB10BF059800A0276E /* JSInjectedScriptHost.h in Headers */,
- 41F060CE0F5EEB2B00A07EAC /* JSInspectorBackend.h in Headers */,
7A0E771F10C00DB100A0276E /* JSInspectorFrontendHost.h in Headers */,
49EECF07105070C400099FAB /* JSInt16Array.h in Headers */,
49EECF05105070C400099FAB /* JSInt32Array.h in Headers */,
@@ -18989,6 +19023,7 @@
BCB16C2D0979C3BD00467741 /* loader.h in Headers */,
656D37320ADBA5DE00A4554D /* LoaderNSURLExtras.h in Headers */,
06E81ED70AB5D5E900C87837 /* LocalCurrentGraphicsContext.h in Headers */,
+ BC5CFCA911F793320099ED09 /* LocalizationStrategy.h in Headers */,
935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */,
511F23180DC160DA004F0032 /* LocalStorageTask.h in Headers */,
511F231A0DC160DA004F0032 /* LocalStorageThread.h in Headers */,
@@ -19276,9 +19311,11 @@
1A569D230D7E2B82007C3983 /* runtime_object.h in Headers */,
1A569D250D7E2B82007C3983 /* runtime_root.h in Headers */,
447D69030FA626810015CCB1 /* RuntimeApplicationChecks.h in Headers */,
+ 8C6EA61A11EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h in Headers */,
49E911CB0EF86D47009D0CAF /* ScaleTransformOperation.h in Headers */,
5DFE8F570D16477C0076E937 /* ScheduledAction.h in Headers */,
1CEFC9B90D78DC8C007D2579 /* SchedulePair.h in Headers */,
+ 5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */,
BCEC01BE0C274DAC009F4EC9 /* Screen.h in Headers */,
A84D82C111D3474800972990 /* ScriptableDocumentParser.h in Headers */,
7A1E88F6101CC384000C4DF5 /* ScriptArray.h in Headers */,
@@ -19355,7 +19392,6 @@
626CDE0F1140424C001E5A68 /* SpatialNavigation.h in Headers */,
7578F90C11DDF26900D933C5 /* SpeechInput.h in Headers */,
7578F90D11DDF26900D933C5 /* SpeechInputClient.h in Headers */,
- 7578F91F11E4E32800D933C5 /* SpeechInputClientListener.h in Headers */,
7578F92011E4E32800D933C5 /* SpeechInputListener.h in Headers */,
93309E12099E64920056E581 /* SplitElementCommand.h in Headers */,
93309E14099E64920056E581 /* SplitTextNodeCommand.h in Headers */,
@@ -19686,6 +19722,7 @@
BCA2B08B10505BCD0043BD1C /* UserScriptTypes.h in Headers */,
BC8BF151105813BF00A40A07 /* UserStyleSheet.h in Headers */,
BC8BF15A1058141800A40A07 /* UserStyleSheetTypes.h in Headers */,
+ BCDF317C11F8D683003C5BF8 /* UserTypingGestureIndicator.h in Headers */,
2E3BBF081162DA1100B9409A /* UUID.h in Headers */,
15C7708D100D3C6B005BA267 /* ValidityState.h in Headers */,
CEF418CF1179678C009D112C /* ViewportArguments.h in Headers */,
@@ -19831,7 +19868,9 @@
E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */,
- 8C6EA61A11EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h in Headers */,
+ 084D0E3D11F5816100081E1A /* SVGResources.h in Headers */,
+ 084D0E3F11F5816100081E1A /* SVGResourcesCache.h in Headers */,
+ 085B05C311FAE16C004D65F6 /* SVGResourcesCycleSolver.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -19891,7 +19930,6 @@
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
compatibilityVersion = "Xcode 2.4";
- developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
@@ -19976,7 +20014,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "# Don't do anything for Debug builds, so the Inspector is easier to debug.\nif [[ ${BUILD_STYLE:=Debug} == \"Debug\" ]]; then\n exit\nfi\n\n# Combine all script resources in the inspector.html file.\n\"$SRCROOT/combine-javascript-resources\" --input-html \"${SRCROOT}/inspector/front-end/inspector.html\" --output-dir \"${DERIVED_FILE_DIR}/WebCore\" --output-script-name inspector.js\n\nif [ -d \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\" ]; then\n # Remove any JavaScript files, since they will be replaced with the combined file.\n cd \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\n rm *.js\n\n # Copy the modified HTML file and the combined script.\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.html\" inspector.html\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.js\" inspector.js\nfi\n";
+ shellScript = "# Don't do anything for Debug builds, so the Inspector is easier to debug.\nif [[ ${CONFIGURATION:=Debug} == \"Debug\" ]]; then\n exit\nfi\n\n# Combine all script resources in the inspector.html file.\n\"$SRCROOT/combine-javascript-resources\" --input-html \"${SRCROOT}/inspector/front-end/inspector.html\" --output-dir \"${DERIVED_FILE_DIR}/WebCore\" --output-script-name inspector.js\n\nif [ -d \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\" ]; then\n # Remove any JavaScript files, since they will be replaced with the combined file.\n cd \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\n rm *.js\n\n # Copy the modified HTML file and the combined script.\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.html\" inspector.html\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.js\" inspector.js\nfi\n";
};
1C81BA330E97357C00266E07 /* Copy Inspector Resources */ = {
isa = PBXShellScriptBuildPhase;
@@ -20911,6 +20949,7 @@
93309DF1099E64920056E581 /* InsertTextCommand.cpp in Sources */,
B885E8D411E06DD2009FFBF4 /* InspectorApplicationCacheAgent.cpp in Sources */,
7A74ECBA101839A600BF939E /* InspectorBackend.cpp in Sources */,
+ 4F707A9911EF679400ACDA69 /* InspectorBackendDispatcher.cpp in Sources */,
1C81B95B0E97330800266E07 /* InspectorController.cpp in Sources */,
82B6589A1189E47600E052A1 /* InspectorCSSStore.cpp in Sources */,
41F062150F5F192600A07EAC /* InspectorDatabaseResource.cpp in Sources */,
@@ -21178,7 +21217,6 @@
C585A69611D4FB13004C3E4B /* JSIndexedDatabaseRequest.cpp in Sources */,
7A0E76DA10BF059800A0276E /* JSInjectedScriptHost.cpp in Sources */,
7A0E76D510BF050700A0276E /* JSInjectedScriptHostCustom.cpp in Sources */,
- 41F060CD0F5EEB2B00A07EAC /* JSInspectorBackend.cpp in Sources */,
7A0E771E10C00DB100A0276E /* JSInspectorFrontendHost.cpp in Sources */,
7A74ECBD101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp in Sources */,
49EECF06105070C400099FAB /* JSInt16Array.cpp in Sources */,
@@ -21741,10 +21779,12 @@
1A569D220D7E2B82007C3983 /* runtime_object.cpp in Sources */,
1A569D240D7E2B82007C3983 /* runtime_root.cpp in Sources */,
447D69040FA626810015CCB1 /* RuntimeApplicationChecks.mm in Sources */,
+ 8C6EA61911EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp in Sources */,
49E911CA0EF86D47009D0CAF /* ScaleTransformOperation.cpp in Sources */,
5DFE8F560D16477B0076E937 /* ScheduledAction.cpp in Sources */,
1CEFC9BA0D78DC8C007D2579 /* SchedulePair.cpp in Sources */,
1CE24F970D7CAF0E007E04C2 /* SchedulePairMac.mm in Sources */,
+ 5162C7F411F77EFB00612EFE /* SchemeRegistry.cpp in Sources */,
BCEC01BD0C274DAC009F4EC9 /* Screen.cpp in Sources */,
A84D82C211D3474800972990 /* ScriptableDocumentParser.cpp in Sources */,
7A1E88F5101CC384000C4DF5 /* ScriptArray.cpp in Sources */,
@@ -22096,6 +22136,7 @@
65DF326109D1E199000BE325 /* UserAgentStyleSheetsData.cpp in Sources */,
BCACF3BC1072921A00C0C8A3 /* UserContentURLPattern.cpp in Sources */,
2542F4DA1166C25A00E89A86 /* UserGestureIndicator.cpp in Sources */,
+ BCDF317B11F8D683003C5BF8 /* UserTypingGestureIndicator.cpp in Sources */,
2E3BBF071162DA1100B9409A /* UUID.cpp in Sources */,
15C7708E100D3C6B005BA267 /* ValidityState.cpp in Sources */,
CEF418CE1179678C009D112C /* ViewportArguments.cpp in Sources */,
@@ -22225,7 +22266,10 @@
93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
- 8C6EA61911EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp in Sources */,
+ 084D0E3C11F5816100081E1A /* SVGResources.cpp in Sources */,
+ 084D0E3E11F5816100081E1A /* SVGResourcesCache.cpp in Sources */,
+ 086A400611F6D6B7002CEC53 /* RenderSVGResourceContainer.cpp in Sources */,
+ 085B05C211FAE16C004D65F6 /* SVGResourcesCycleSolver.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebCore/accessibility/AccessibilityObject.cpp b/WebCore/accessibility/AccessibilityObject.cpp
index bc4e2f5..a0959e6 100644
--- a/WebCore/accessibility/AccessibilityObject.cpp
+++ b/WebCore/accessibility/AccessibilityObject.cpp
@@ -977,31 +977,18 @@ bool AccessibilityObject::supportsARIALiveRegion() const
return equalIgnoringCase(liveRegion, "polite") || equalIgnoringCase(liveRegion, "assertive");
}
-int AccessibilityObject::intValue() const
+AccessibilityButtonState AccessibilityObject::checkboxOrRadioValue() const
{
- if (isPasswordField())
- return 0;
-
- if (isHeading())
- return headingLevel();
-
// If this is a real checkbox or radio button, AccessibilityRenderObject will handle.
// If it's an ARIA checkbox or radio, the aria-checked attribute should be used.
- if (isCheckboxOrRadio())
- return equalIgnoringCase(getAttribute(aria_checkedAttr), "true");
-
- return 0;
-}
-bool AccessibilityObject::hasIntValue() const
-{
- if (isHeading())
- return true;
+ const AtomicString& result = getAttribute(aria_checkedAttr);
+ if (equalIgnoringCase(result, "true"))
+ return ButtonStateOn;
+ if (equalIgnoringCase(result, "mixed"))
+ return ButtonStateMixed;
- if (isCheckboxOrRadio())
- return true;
-
- return false;
+ return ButtonStateOff;
}
} // namespace WebCore
diff --git a/WebCore/accessibility/AccessibilityObject.h b/WebCore/accessibility/AccessibilityObject.h
index 400a200..b8b0875 100644
--- a/WebCore/accessibility/AccessibilityObject.h
+++ b/WebCore/accessibility/AccessibilityObject.h
@@ -209,6 +209,12 @@ enum AccessibilityObjectInclusion {
IgnoreObject,
DefaultBehavior,
};
+
+enum AccessibilityButtonState {
+ ButtonStateOff = 0,
+ ButtonStateOn,
+ ButtonStateMixed,
+};
struct VisiblePositionRange {
@@ -327,9 +333,6 @@ public:
virtual bool canSetSelectedChildrenAttribute() const { return false; }
virtual bool canSetExpandedAttribute() const { return false; }
- bool hasIntValue() const;
- virtual int intValue() const;
-
// A programmatic way to set a name on an AccessibleObject.
virtual void setAccessibleName(String&) { }
@@ -338,6 +341,7 @@ public:
virtual bool accessibilityIsIgnored() const { return true; }
virtual int headingLevel() const { return 0; }
+ virtual AccessibilityButtonState checkboxOrRadioValue() const;
virtual String valueDescription() const { return String(); }
virtual float valueForRange() const { return 0.0f; }
virtual float maxValueForRange() const { return 0.0f; }
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index 1b3c461..5144950 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -189,7 +189,7 @@ AccessibilityObject* AccessibilityRenderObject::firstChild() const
if (!firstChild)
return 0;
- return m_renderer->document()->axObjectCache()->getOrCreate(firstChild);
+ return axObjectCache()->getOrCreate(firstChild);
}
AccessibilityObject* AccessibilityRenderObject::lastChild() const
@@ -202,7 +202,7 @@ AccessibilityObject* AccessibilityRenderObject::lastChild() const
if (!lastChild)
return 0;
- return m_renderer->document()->axObjectCache()->getOrCreate(lastChild);
+ return axObjectCache()->getOrCreate(lastChild);
}
static inline RenderInline* startOfContinuations(RenderObject* r)
@@ -304,7 +304,7 @@ AccessibilityObject* AccessibilityRenderObject::previousSibling() const
if (!previousSibling)
return 0;
- return m_renderer->document()->axObjectCache()->getOrCreate(previousSibling);
+ return axObjectCache()->getOrCreate(previousSibling);
}
static inline bool lastChildHasContinuation(RenderObject* renderer)
@@ -354,10 +354,10 @@ AccessibilityObject* AccessibilityRenderObject::nextSibling() const
if (!nextSibling)
return 0;
- return m_renderer->document()->axObjectCache()->getOrCreate(nextSibling);
+ return axObjectCache()->getOrCreate(nextSibling);
}
-AccessibilityObject* AccessibilityRenderObject::parentObjectIfExists() const
+RenderObject* AccessibilityRenderObject::renderParentObject() const
{
if (!m_renderer)
return 0;
@@ -374,11 +374,13 @@ AccessibilityObject* AccessibilityRenderObject::parentObjectIfExists() const
// the earliest node in the continuation chain.
else if (parent && parent->isRenderInline() && (startOfConts = startOfContinuations(parent)))
parent = startOfConts;
-
- if (!parent)
- return 0;
-
- return m_renderer->document()->axObjectCache()->get(parent);
+
+ return parent;
+}
+
+AccessibilityObject* AccessibilityRenderObject::parentObjectIfExists() const
+{
+ return axObjectCache()->get(renderParentObject());
}
AccessibilityObject* AccessibilityRenderObject::parentObject() const
@@ -386,24 +388,8 @@ AccessibilityObject* AccessibilityRenderObject::parentObject() const
if (!m_renderer)
return 0;
- RenderObject* parent = m_renderer->parent();
-
- // Case 1: node is a block and is an inline's continuation. Parent
- // is the start of the continuation chain.
- RenderInline* startOfConts = 0;
- if (m_renderer->isRenderBlock() && (startOfConts = startOfContinuations(m_renderer)))
- parent = startOfConts;
-
- // Case 2: node's parent is an inline which is some node's continuation; parent is
- // the earliest node in the continuation chain.
- else if (parent && parent->isRenderInline() && (startOfConts = startOfContinuations(parent)))
- parent = startOfConts;
-
- if (!parent)
- return 0;
-
if (ariaRoleAttribute() == MenuBarRole)
- return m_renderer->document()->axObjectCache()->getOrCreate(parent);
+ return axObjectCache()->getOrCreate(m_renderer->parent());
// menuButton and its corresponding menu are DOM siblings, but Accessibility needs them to be parent/child
if (ariaRoleAttribute() == MenuRole) {
@@ -412,7 +398,7 @@ AccessibilityObject* AccessibilityRenderObject::parentObject() const
return parent;
}
- return m_renderer->document()->axObjectCache()->getOrCreate(parent);
+ return axObjectCache()->getOrCreate(renderParentObject());
}
bool AccessibilityRenderObject::isWebArea() const
@@ -569,6 +555,15 @@ bool AccessibilityRenderObject::isIndeterminate() const
return inputElement->isIndeterminate();
}
+bool AccessibilityRenderObject::isNativeCheckboxOrRadio() const
+{
+ Node* elementNode = node();
+ if (elementNode && elementNode->isElementNode())
+ return toInputElement(static_cast<Element*>(elementNode));
+
+ return false;
+}
+
bool AccessibilityRenderObject::isChecked() const
{
ASSERT(m_renderer);
@@ -724,7 +719,7 @@ AccessibilityObject* AccessibilityRenderObject::selectedRadioButton()
int count = m_children.size();
for (int i = 0; i < count; ++i) {
AccessibilityObject* object = m_children[i].get();
- if (object->roleValue() == RadioButtonRole && object->intValue() == 1)
+ if (object->roleValue() == RadioButtonRole && object->checkboxOrRadioValue() == ButtonStateOn)
return object;
}
return 0;
@@ -742,7 +737,7 @@ AccessibilityObject* AccessibilityRenderObject::selectedTabItem()
int count = tabs.size();
for (int i = 0; i < count; ++i) {
AccessibilityObject* object = m_children[i].get();
- if (object->isTabItem() && object->intValue() == 1)
+ if (object->isTabItem() && object->isChecked())
return object;
}
return 0;
@@ -882,7 +877,7 @@ AccessibilityObject* AccessibilityRenderObject::menuForMenuButton() const
{
Element* menu = menuElementForMenuButton();
if (menu && menu->renderer())
- return m_renderer->document()->axObjectCache()->getOrCreate(menu->renderer());
+ return axObjectCache()->getOrCreate(menu->renderer());
return 0;
}
@@ -900,7 +895,7 @@ AccessibilityObject* AccessibilityRenderObject::menuButtonForMenu() const
if (menuItem && menuItem->renderer()) {
// ARIA just has generic menu items. AppKit needs to know if this is a top level items like MenuBarButton or MenuBarItem
- AccessibilityObject* menuItemAX = m_renderer->document()->axObjectCache()->getOrCreate(menuItem->renderer());
+ AccessibilityObject* menuItemAX = axObjectCache()->getOrCreate(menuItem->renderer());
if (menuItemAX->isMenuButton())
return menuItemAX;
}
@@ -1009,12 +1004,12 @@ Node* AccessibilityRenderObject::node() const
return m_renderer ? m_renderer->node() : 0;
}
-int AccessibilityRenderObject::intValue() const
+AccessibilityButtonState AccessibilityRenderObject::checkboxOrRadioValue() const
{
- if (isCheckboxOrRadio())
- return isChecked() ? 1 : 0;
-
- return AccessibilityObject::intValue();
+ if (isNativeCheckboxOrRadio())
+ return isChecked() ? ButtonStateOn : ButtonStateOff;
+
+ return AccessibilityObject::checkboxOrRadioValue();
}
String AccessibilityRenderObject::valueDescription() const
@@ -1468,7 +1463,7 @@ void AccessibilityRenderObject::addRadioButtonGroupMembers(AccessibilityChildren
unsigned len = formElements.size();
for (unsigned i = 0; i < len; ++i) {
Node* associateElement = formElements[i].get();
- if (AccessibilityObject* object = m_renderer->document()->axObjectCache()->getOrCreate(associateElement->renderer()))
+ if (AccessibilityObject* object = axObjectCache()->getOrCreate(associateElement->renderer()))
linkedUIElements.append(object);
}
} else {
@@ -1478,7 +1473,7 @@ void AccessibilityRenderObject::addRadioButtonGroupMembers(AccessibilityChildren
if (list->item(i)->hasTagName(inputTag)) {
HTMLInputElement* associateElement = static_cast<HTMLInputElement*>(list->item(i));
if (associateElement->isRadioButton() && associateElement->name() == input->name()) {
- if (AccessibilityObject* object = m_renderer->document()->axObjectCache()->getOrCreate(associateElement->renderer()))
+ if (AccessibilityObject* object = axObjectCache()->getOrCreate(associateElement->renderer()))
linkedUIElements.append(object);
}
}
@@ -2267,6 +2262,7 @@ Widget* AccessibilityRenderObject::widget() const
AXObjectCache* AccessibilityRenderObject::axObjectCache() const
{
+ ASSERT(m_renderer);
return m_renderer->document()->axObjectCache();
}
@@ -3176,7 +3172,7 @@ bool AccessibilityRenderObject::canSetTextRangeAttributes() const
void AccessibilityRenderObject::contentChanged()
{
// If this element supports ARIA live regions, then notify the AT of changes.
- AXObjectCache* cache = m_renderer->document()->axObjectCache();
+ AXObjectCache* cache = axObjectCache();
for (RenderObject* renderParent = m_renderer; renderParent; renderParent = renderParent->parent()) {
AccessibilityObject* parent = cache->get(renderParent);
if (!parent)
@@ -3298,7 +3294,7 @@ void AccessibilityRenderObject::addChildren()
// add an <area> element for this child if it has a link
if (current->hasTagName(areaTag) && current->isLink()) {
- AccessibilityImageMapLink* areaObject = static_cast<AccessibilityImageMapLink*>(m_renderer->document()->axObjectCache()->getOrCreate(ImageMapLinkRole));
+ AccessibilityImageMapLink* areaObject = static_cast<AccessibilityImageMapLink*>(axObjectCache()->getOrCreate(ImageMapLinkRole));
areaObject->setHTMLAreaElement(static_cast<HTMLAreaElement*>(current));
areaObject->setHTMLMapElement(map);
areaObject->setParent(this);
diff --git a/WebCore/accessibility/AccessibilityRenderObject.h b/WebCore/accessibility/AccessibilityRenderObject.h
index 526324f..c05bc2d 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.h
+++ b/WebCore/accessibility/AccessibilityRenderObject.h
@@ -117,7 +117,7 @@ public:
virtual bool accessibilityIsIgnored() const;
virtual int headingLevel() const;
- virtual int intValue() const;
+ virtual AccessibilityButtonState checkboxOrRadioValue() const;
virtual String valueDescription() const;
virtual float valueForRange() const;
virtual float maxValueForRange() const;
@@ -283,12 +283,14 @@ private:
AccessibilityRole determineAriaRoleAttribute() const;
bool isTabItemSelected() const;
+ bool isNativeCheckboxOrRadio() const;
IntRect checkboxOrRadioRect() const;
void addRadioButtonGroupMembers(AccessibilityChildrenVector& linkedUIElements) const;
AccessibilityObject* internalLinkElement() const;
AccessibilityObject* accessibilityImageMapHitTest(HTMLAreaElement*, const IntPoint&) const;
AccessibilityObject* accessibilityParentForImageMap(HTMLMapElement* map) const;
bool renderObjectIsObservable(RenderObject*) const;
+ RenderObject* renderParentObject() const;
void ariaSelectedRows(AccessibilityChildrenVector&);
diff --git a/WebCore/accessibility/AccessibilityTable.cpp b/WebCore/accessibility/AccessibilityTable.cpp
index a0bb655..04ecac3 100644
--- a/WebCore/accessibility/AccessibilityTable.cpp
+++ b/WebCore/accessibility/AccessibilityTable.cpp
@@ -145,7 +145,7 @@ bool AccessibilityTable::isTableExposableThroughAccessibility()
int headersInFirstRowCount = 0;
for (int col = 0; col < numCols; ++col) {
- RenderTableCell* cell = firstBody->cellAt(row, col).cell;
+ RenderTableCell* cell = firstBody->primaryCellAt(row, col);
if (!cell)
continue;
Node* cellNode = cell->node();
@@ -287,7 +287,7 @@ void AccessibilityTable::addChildren()
for (unsigned rowIndex = 0; rowIndex < numRows; ++rowIndex) {
for (unsigned colIndex = 0; colIndex < numCols; ++colIndex) {
- RenderTableCell* cell = tableSection->cellAt(rowIndex, colIndex).cell;
+ RenderTableCell* cell = tableSection->primaryCellAt(rowIndex, colIndex);
if (!cell)
continue;
@@ -441,7 +441,7 @@ AccessibilityTableCell* AccessibilityTable::cellForColumnAndRow(unsigned column,
unsigned sectionSpecificRow = row - rowOffset;
if (row < rowCount && column < numCols && sectionSpecificRow < numRows) {
- cell = tableSection->cellAt(sectionSpecificRow, column).cell;
+ cell = tableSection->primaryCellAt(sectionSpecificRow, column);
// we didn't find the cell, which means there's spanning happening
// search backwards to find the spanning cell
@@ -449,7 +449,7 @@ AccessibilityTableCell* AccessibilityTable::cellForColumnAndRow(unsigned column,
// first try rows
for (int testRow = sectionSpecificRow-1; testRow >= 0; --testRow) {
- cell = tableSection->cellAt(testRow, column).cell;
+ cell = tableSection->primaryCellAt(testRow, column);
// cell overlapped. use this one
if (cell && ((cell->row() + (cell->rowSpan()-1)) >= (int)sectionSpecificRow))
break;
@@ -459,7 +459,7 @@ AccessibilityTableCell* AccessibilityTable::cellForColumnAndRow(unsigned column,
if (!cell) {
// try cols
for (int testCol = column-1; testCol >= 0; --testCol) {
- cell = tableSection->cellAt(sectionSpecificRow, testCol).cell;
+ cell = tableSection->primaryCellAt(sectionSpecificRow, testCol);
// cell overlapped. use this one
if (cell && ((cell->col() + (cell->colSpan()-1)) >= (int)column))
break;
diff --git a/WebCore/accessibility/AccessibilityTableCell.cpp b/WebCore/accessibility/AccessibilityTableCell.cpp
index 28e66ad..e2efb5e 100644
--- a/WebCore/accessibility/AccessibilityTableCell.cpp
+++ b/WebCore/accessibility/AccessibilityTableCell.cpp
@@ -165,7 +165,7 @@ AccessibilityObject* AccessibilityTableCell::titleUIElement() const
if (!section)
return 0;
- RenderTableCell* headerCell = section->cellAt(row, 0).cell;
+ RenderTableCell* headerCell = section->primaryCellAt(row, 0);
if (!headerCell || headerCell == renderCell)
return 0;
diff --git a/WebCore/accessibility/AccessibilityTableColumn.cpp b/WebCore/accessibility/AccessibilityTableColumn.cpp
index 45137ff..f776e40 100644
--- a/WebCore/accessibility/AccessibilityTableColumn.cpp
+++ b/WebCore/accessibility/AccessibilityTableColumn.cpp
@@ -136,7 +136,7 @@ AccessibilityObject* AccessibilityTableColumn::headerObjectForSection(RenderTabl
RenderTableCell* cell = 0;
// also account for cells that have a span
for (int testCol = m_columnIndex; testCol >= 0; --testCol) {
- RenderTableCell* testCell = section->cellAt(0, testCol).cell;
+ RenderTableCell* testCell = section->primaryCellAt(0, testCol);
if (!testCell)
continue;
diff --git a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
index a711116..94d2be3 100644
--- a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
+++ b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
@@ -41,6 +41,7 @@
#import "AccessibilityTableRow.h"
#import "AccessibilityTableColumn.h"
#import "ColorMac.h"
+#import "EditorClient.h"
#import "Frame.h"
#import "HTMLAnchorElement.h"
#import "HTMLAreaElement.h"
@@ -390,32 +391,24 @@ static void AXAttributeStringSetBlockquoteLevel(NSMutableAttributedString* attrS
[attrString removeAttribute:NSAccessibilityBlockQuoteLevelAttribute range:range];
}
-static void AXAttributeStringSetSpelling(NSMutableAttributedString* attrString, Node* node, int offset, NSRange range)
+static void AXAttributeStringSetSpelling(NSMutableAttributedString* attrString, Node* node, const UChar* chars, int charLength, NSRange range)
{
- Vector<DocumentMarker> markers = node->renderer()->document()->markersForNode(node);
- Vector<DocumentMarker>::iterator markerIt = markers.begin();
-
- unsigned endOffset = (unsigned)offset + range.length;
- for ( ; markerIt != markers.end(); markerIt++) {
- DocumentMarker marker = *markerIt;
-
- if (marker.type != DocumentMarker::Spelling)
- continue;
-
- if (marker.endOffset <= (unsigned)offset)
- continue;
-
- if (marker.startOffset > endOffset)
+ // Check the spelling directly since document->markersForNode() does not store the misspelled marking when the cursor is in a word.
+ EditorClient* client = node->document()->page()->editorClient();
+ int currentPosition = 0;
+ while (charLength > 0) {
+ const UChar* charData = chars + currentPosition;
+
+ int misspellingLocation = -1;
+ int misspellingLength = 0;
+ client->checkSpellingOfString(charData, charLength, &misspellingLocation, &misspellingLength);
+ if (misspellingLocation == -1 || !misspellingLength)
break;
- // add misspelling attribute for the intersection of the marker and the range
- int rStart = range.location + (marker.startOffset - offset);
- int rLength = min(marker.endOffset, endOffset) - marker.startOffset;
- NSRange spellRange = NSMakeRange(rStart, rLength);
+ NSRange spellRange = NSMakeRange(range.location + currentPosition + misspellingLocation, misspellingLength);
AXAttributeStringSetNumber(attrString, NSAccessibilityMisspelledTextAttribute, [NSNumber numberWithBool:YES], spellRange);
-
- if (marker.endOffset > endOffset + 1)
- break;
+ charLength -= (misspellingLocation + misspellingLength);
+ currentPosition += (misspellingLocation + misspellingLength);
}
}
@@ -459,7 +452,7 @@ static void AXAttributeStringSetElement(NSMutableAttributedString* attrString, N
[attrString removeAttribute:attribute range:range];
}
-static void AXAttributedStringAppendText(NSMutableAttributedString* attrString, Node* node, int offset, const UChar* chars, int length)
+static void AXAttributedStringAppendText(NSMutableAttributedString* attrString, Node* node, const UChar* chars, int length)
{
// skip invisible text
if (!node->renderer())
@@ -478,6 +471,7 @@ static void AXAttributedStringAppendText(NSMutableAttributedString* attrString,
// remove inherited attachment from prior AXAttributedStringAppendReplaced
[attrString removeAttribute:NSAccessibilityAttachmentTextAttribute range:attrStringRange];
+ [attrString removeAttribute:NSAccessibilityMisspelledTextAttribute range:attrStringRange];
// set new attributes
AXAttributeStringSetStyle(attrString, node->renderer(), attrStringRange);
@@ -486,7 +480,7 @@ static void AXAttributedStringAppendText(NSMutableAttributedString* attrString,
AXAttributeStringSetElement(attrString, NSAccessibilityLinkTextAttribute, AccessibilityObject::anchorElementForNode(node), attrStringRange);
// do spelling last because it tends to break up the range
- AXAttributeStringSetSpelling(attrString, node, offset, attrStringRange);
+ AXAttributeStringSetSpelling(attrString, node, chars, length, attrStringRange);
}
static NSString* nsStringForReplacedNode(Node* replacedNode)
@@ -538,9 +532,9 @@ static NSString* nsStringForReplacedNode(Node* replacedNode)
// Add the text of the list marker item if necessary.
String listMarkerText = m_object->listMarkerTextForNodeAndPosition(node, VisiblePosition(it.range()->startPosition()));
if (!listMarkerText.isEmpty())
- AXAttributedStringAppendText(attrString, node, offset, listMarkerText.characters(), listMarkerText.length());
+ AXAttributedStringAppendText(attrString, node, listMarkerText.characters(), listMarkerText.length());
- AXAttributedStringAppendText(attrString, node, offset, it.characters(), it.length());
+ AXAttributedStringAppendText(attrString, node, it.characters(), it.length());
} else {
Node* replacedNode = node->childNode(offset);
NSString *attachmentString = nsStringForReplacedNode(replacedNode);
@@ -1515,8 +1509,19 @@ static NSString* roleValueToNSString(AccessibilityRole value)
}
if (m_object->isProgressIndicator() || m_object->isSlider() || m_object->isScrollbar())
return [NSNumber numberWithFloat:m_object->valueForRange()];
- if (m_object->hasIntValue())
- return [NSNumber numberWithInt:m_object->intValue()];
+ if (m_object->isHeading())
+ return [NSNumber numberWithInt:m_object->headingLevel()];
+
+ if (m_object->isCheckboxOrRadio()) {
+ switch (m_object->checkboxOrRadioValue()) {
+ case ButtonStateOff:
+ return [NSNumber numberWithInt:0];
+ case ButtonStateOn:
+ return [NSNumber numberWithInt:1];
+ case ButtonStateMixed:
+ return [NSNumber numberWithInt:2];
+ }
+ }
// radio groups return the selected radio button as the AXValue
if (m_object->isRadioGroup()) {
diff --git a/WebCore/bindings/generic/RuntimeEnabledFeatures.h b/WebCore/bindings/generic/RuntimeEnabledFeatures.h
index d8eae23..b059d6e 100644
--- a/WebCore/bindings/generic/RuntimeEnabledFeatures.h
+++ b/WebCore/bindings/generic/RuntimeEnabledFeatures.h
@@ -56,6 +56,7 @@ public:
static void setIndexedDBEnabled(bool isEnabled) { isIndexedDBEnabled = isEnabled; }
static bool indexedDBEnabled() { return isIndexedDBEnabled; }
+ static bool iDBKeyRangeEnabled() { return indexedDBEnabled(); }
#if ENABLE(VIDEO)
static bool audioEnabled();
diff --git a/WebCore/bindings/js/JSDatabaseCustom.cpp b/WebCore/bindings/js/JSDatabaseCustom.cpp
index 26f9db7..6733320 100644
--- a/WebCore/bindings/js/JSDatabaseCustom.cpp
+++ b/WebCore/bindings/js/JSDatabaseCustom.cpp
@@ -57,17 +57,20 @@ JSValue JSDatabase::changeVersion(ExecState* exec)
if (exec->hadException())
return jsUndefined();
- JSObject* object = exec->argument(2).getObject();
- if (!object) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
+ RefPtr<SQLTransactionCallback> callback;
+ if (exec->argumentCount() > 2 && !exec->argument(2).isNull()) {
+ JSObject* object = exec->argument(2).getObject();
+ if (!object) {
+ setDOMException(exec, TYPE_MISMATCH_ERR);
+ return jsUndefined();
+ }
- RefPtr<SQLTransactionCallback> callback(JSSQLTransactionCallback::create(object, static_cast<JSDOMGlobalObject*>(globalObject())));
+ callback = JSSQLTransactionCallback::create(object, static_cast<JSDOMGlobalObject*>(globalObject()));
+ }
RefPtr<SQLTransactionErrorCallback> errorCallback;
- if (!exec->argument(3).isNull()) {
- object = exec->argument(3).getObject();
+ if (exec->argumentCount() > 3 && !exec->argument(3).isNull()) {
+ JSObject* object = exec->argument(3).getObject();
if (!object) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
@@ -77,8 +80,8 @@ JSValue JSDatabase::changeVersion(ExecState* exec)
}
RefPtr<VoidCallback> successCallback;
- if (!exec->argument(4).isNull()) {
- object = exec->argument(4).getObject();
+ if (exec->argumentCount() > 4 && !exec->argument(4).isNull()) {
+ JSObject* object = exec->argument(4).getObject();
if (!object) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
diff --git a/WebCore/bindings/js/JSDatabaseSyncCustom.cpp b/WebCore/bindings/js/JSDatabaseSyncCustom.cpp
index 79eb376..f929658 100644
--- a/WebCore/bindings/js/JSDatabaseSyncCustom.cpp
+++ b/WebCore/bindings/js/JSDatabaseSyncCustom.cpp
@@ -52,14 +52,17 @@ JSValue JSDatabaseSync::changeVersion(ExecState* exec)
if (exec->hadException())
return jsUndefined();
- JSObject* object = exec->argument(2).getObject();
- if (!object) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
+ RefPtr<SQLTransactionSyncCallback> callback;
+ if (exec->argumentCount() > 2 && !exec->argument(2).isNull()) {
+ JSObject* object = exec->argument(2).getObject();
+ if (!object) {
+ setDOMException(exec, TYPE_MISMATCH_ERR);
+ return jsUndefined();
+ }
+
+ callback = JSSQLTransactionSyncCallback::create(object, static_cast<JSDOMGlobalObject*>(globalObject()));
}
- RefPtr<SQLTransactionSyncCallback> callback(JSSQLTransactionSyncCallback::create(object, static_cast<JSDOMGlobalObject*>(globalObject())));
-
ExceptionCode ec = 0;
m_impl->changeVersion(oldVersion, newVersion, callback.release(), ec);
setDOMException(exec, ec);
diff --git a/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp b/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp
index 40d20cf..2bff01a 100644
--- a/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp
@@ -45,12 +45,12 @@ bool JSHTMLAppletElement::getOwnPropertyDescriptorDelegate(ExecState* exec, cons
bool JSHTMLAppletElement::putDelegate(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
- return runtimeObjectCustomPut(exec, propertyName, value, impl(), slot);
+ return runtimeObjectCustomPut(exec, propertyName, value, this, slot);
}
CallType JSHTMLAppletElement::getCallData(CallData& callData)
{
- return runtimeObjectGetCallData(impl(), callData);
+ return runtimeObjectGetCallData(this, callData);
}
} // namespace WebCore
diff --git a/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp b/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp
index b9f8c12..72e695b 100644
--- a/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp
@@ -45,12 +45,12 @@ bool JSHTMLEmbedElement::getOwnPropertyDescriptorDelegate(ExecState* exec, const
bool JSHTMLEmbedElement::putDelegate(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
- return runtimeObjectCustomPut(exec, propertyName, value, impl(), slot);
+ return runtimeObjectCustomPut(exec, propertyName, value, this, slot);
}
CallType JSHTMLEmbedElement::getCallData(CallData& callData)
{
- return runtimeObjectGetCallData(impl(), callData);
+ return runtimeObjectGetCallData(this, callData);
}
} // namespace WebCore
diff --git a/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp b/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp
index 68c9e59..c87b932 100644
--- a/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp
@@ -45,12 +45,12 @@ bool JSHTMLObjectElement::getOwnPropertyDescriptorDelegate(ExecState* exec, cons
bool JSHTMLObjectElement::putDelegate(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
- return runtimeObjectCustomPut(exec, propertyName, value, impl(), slot);
+ return runtimeObjectCustomPut(exec, propertyName, value, this, slot);
}
CallType JSHTMLObjectElement::getCallData(CallData& callData)
{
- return runtimeObjectGetCallData(impl(), callData);
+ return runtimeObjectGetCallData(this, callData);
}
} // namespace WebCore
diff --git a/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp b/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
index c119adf..b724f50 100644
--- a/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
+++ b/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
@@ -92,7 +92,9 @@ JSValue JSInspectorFrontendHost::showContextMenu(ExecState* exec)
JSValue label = item->get(exec, Identifier(exec, "label"));
JSValue id = item->get(exec, Identifier(exec, "id"));
if (label.isUndefined() || id.isUndefined())
- items.append(new ContextMenuItem(SeparatorType, ContextMenuItemTagNoAction, String()));
+ items.append(new ContextMenuItem(SeparatorType,
+ ContextMenuItemCustomTagNoAction,
+ String()));
else {
ContextMenuAction typedId = static_cast<ContextMenuAction>(ContextMenuItemBaseCustomTag + id.toInt32(exec));
items.append(new ContextMenuItem(ActionType, typedId, ustringToString(label.toString(exec))));
diff --git a/WebCore/bindings/js/JSPluginElementFunctions.cpp b/WebCore/bindings/js/JSPluginElementFunctions.cpp
index 7cc2e65..cf43e91 100644
--- a/WebCore/bindings/js/JSPluginElementFunctions.cpp
+++ b/WebCore/bindings/js/JSPluginElementFunctions.cpp
@@ -24,7 +24,7 @@
#include "HTMLNames.h"
#include "HTMLPlugInElement.h"
#include "JSHTMLElement.h"
-#include "runtime_object.h"
+#include "PluginViewBase.h"
using namespace JSC;
@@ -49,30 +49,50 @@ Instance* pluginInstance(Node* node)
return instance;
}
-static RuntimeObject* getRuntimeObject(ExecState* exec, Node* node)
+JSObject* pluginScriptObject(ExecState* exec, JSHTMLElement* jsHTMLElement)
{
- Instance* instance = pluginInstance(node);
- if (!instance)
+ HTMLElement* element = jsHTMLElement->impl();
+ if (!(element->hasTagName(objectTag) || element->hasTagName(embedTag) || element->hasTagName(appletTag)))
return 0;
+
+ HTMLPlugInElement* pluginElement = static_cast<HTMLPlugInElement*>(element);
+
+ // First, see if we can ask the plug-in view for its script object.
+ if (Widget* pluginWidget = pluginElement->pluginWidget()) {
+ if (pluginWidget->isPluginViewBase()) {
+ PluginViewBase* pluginViewBase = static_cast<PluginViewBase*>(pluginWidget);
+ if (JSObject* scriptObject = pluginViewBase->scriptObject(exec, jsHTMLElement->globalObject()))
+ return scriptObject;
+ }
+ }
+
+ // Otherwise, fall back to getting the object from the instance.
+
+ // The plugin element holds an owning reference, so we don't have to.
+ Instance* instance = pluginElement->getInstance().get();
+ if (!instance || !instance->rootObject())
+ return 0;
+
return instance->createRuntimeObject(exec);
}
-
+
JSValue runtimeObjectPropertyGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
{
- JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(asObject(slotBase));
- HTMLElement* element = static_cast<HTMLElement*>(thisObj->impl());
- RuntimeObject* runtimeObject = getRuntimeObject(exec, element);
- if (!runtimeObject)
+ JSHTMLElement* element = static_cast<JSHTMLElement*>(asObject(slotBase));
+ JSObject* scriptObject = pluginScriptObject(exec, element);
+ if (!scriptObject)
return jsUndefined();
- return runtimeObject->get(exec, propertyName);
+
+ return scriptObject->get(exec, propertyName);
}
bool runtimeObjectCustomGetOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot, JSHTMLElement* element)
{
- RuntimeObject* runtimeObject = getRuntimeObject(exec, element->impl());
- if (!runtimeObject)
+ JSObject* scriptObject = pluginScriptObject(exec, element);
+ if (!scriptObject)
return false;
- if (!runtimeObject->hasProperty(exec, propertyName))
+
+ if (!scriptObject->hasProperty(exec, propertyName))
return false;
slot.setCustom(element, runtimeObjectPropertyGetter);
return true;
@@ -80,10 +100,10 @@ bool runtimeObjectCustomGetOwnPropertySlot(ExecState* exec, const Identifier& pr
bool runtimeObjectCustomGetOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor, JSHTMLElement* element)
{
- RuntimeObject* runtimeObject = getRuntimeObject(exec, element->impl());
- if (!runtimeObject)
+ JSObject* scriptObject = pluginScriptObject(exec, element);
+ if (!scriptObject)
return false;
- if (!runtimeObject->hasProperty(exec, propertyName))
+ if (!scriptObject->hasProperty(exec, propertyName))
return false;
PropertySlot slot;
slot.setCustom(element, runtimeObjectPropertyGetter);
@@ -94,14 +114,14 @@ bool runtimeObjectCustomGetOwnPropertyDescriptor(ExecState* exec, const Identifi
return true;
}
-bool runtimeObjectCustomPut(ExecState* exec, const Identifier& propertyName, JSValue value, HTMLElement* element, PutPropertySlot& slot)
+bool runtimeObjectCustomPut(ExecState* exec, const Identifier& propertyName, JSValue value, JSHTMLElement* element, PutPropertySlot& slot)
{
- RuntimeObject* runtimeObject = getRuntimeObject(exec, element);
- if (!runtimeObject)
+ JSObject* scriptObject = pluginScriptObject(exec, element);
+ if (!scriptObject)
return 0;
- if (!runtimeObject->hasProperty(exec, propertyName))
+ if (!scriptObject->hasProperty(exec, propertyName))
return false;
- runtimeObject->put(exec, propertyName, value, slot);
+ scriptObject->put(exec, propertyName, value, slot);
return true;
}
@@ -114,9 +134,9 @@ static EncodedJSValue JSC_HOST_CALL callPlugin(ExecState* exec)
return JSValue::encode(result);
}
-CallType runtimeObjectGetCallData(HTMLElement* element, CallData& callData)
+CallType runtimeObjectGetCallData(JSHTMLElement* element, CallData& callData)
{
- Instance* instance = pluginInstance(element);
+ Instance* instance = pluginInstance(element->impl());
if (!instance || !instance->supportsInvokeDefaultMethod())
return CallTypeNone;
callData.native.function = callPlugin;
diff --git a/WebCore/bindings/js/JSPluginElementFunctions.h b/WebCore/bindings/js/JSPluginElementFunctions.h
index 736ace9..15af59a 100644
--- a/WebCore/bindings/js/JSPluginElementFunctions.h
+++ b/WebCore/bindings/js/JSPluginElementFunctions.h
@@ -36,12 +36,13 @@ namespace WebCore {
// Runtime object support code for JSHTMLAppletElement, JSHTMLEmbedElement and JSHTMLObjectElement.
JSC::Bindings::Instance* pluginInstance(Node*);
+ JSC::JSObject* pluginScriptObject(JSC::ExecState* exec, JSHTMLElement* jsHTMLElement);
JSC::JSValue runtimeObjectPropertyGetter(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
bool runtimeObjectCustomGetOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&, JSHTMLElement*);
bool runtimeObjectCustomGetOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&, JSHTMLElement*);
- bool runtimeObjectCustomPut(JSC::ExecState*, const JSC::Identifier&, JSC::JSValue, HTMLElement*, JSC::PutPropertySlot&);
- JSC::CallType runtimeObjectGetCallData(HTMLElement*, JSC::CallData&);
+ bool runtimeObjectCustomPut(JSC::ExecState*, const JSC::Identifier&, JSC::JSValue, JSHTMLElement*, JSC::PutPropertySlot&);
+ JSC::CallType runtimeObjectGetCallData(JSHTMLElement*, JSC::CallData&);
} // namespace WebCore
diff --git a/WebCore/bindings/js/ScriptObject.cpp b/WebCore/bindings/js/ScriptObject.cpp
index 16b9f01..de397f7 100644
--- a/WebCore/bindings/js/ScriptObject.cpp
+++ b/WebCore/bindings/js/ScriptObject.cpp
@@ -37,7 +37,6 @@
#if ENABLE(INSPECTOR)
#include "JSInjectedScriptHost.h"
-#include "JSInspectorBackend.h"
#include "JSInspectorFrontendHost.h"
#endif
@@ -158,14 +157,6 @@ bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, const S
}
#if ENABLE(INSPECTOR)
-bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorBackend* value)
-{
- JSLock lock(SilenceAssertionsOnly);
- JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
- globalObject->putDirect(Identifier(scriptState, name), toJS(scriptState, globalObject, value));
- return handleException(scriptState);
-}
-
bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorFrontendHost* value)
{
JSLock lock(SilenceAssertionsOnly);
diff --git a/WebCore/bindings/js/ScriptObject.h b/WebCore/bindings/js/ScriptObject.h
index 0c993e1..9880976 100644
--- a/WebCore/bindings/js/ScriptObject.h
+++ b/WebCore/bindings/js/ScriptObject.h
@@ -39,7 +39,6 @@
namespace WebCore {
class InjectedScriptHost;
- class InspectorBackend;
class InspectorFrontendHost;
class ScriptObject : public ScriptValue {
@@ -70,7 +69,6 @@ namespace WebCore {
public:
static bool set(ScriptState*, const char* name, const ScriptObject&);
#if ENABLE(INSPECTOR)
- static bool set(ScriptState*, const char* name, InspectorBackend*);
static bool set(ScriptState*, const char* name, InspectorFrontendHost*);
static bool set(ScriptState*, const char* name, InjectedScriptHost*);
#endif
diff --git a/WebCore/bindings/js/ScriptValue.cpp b/WebCore/bindings/js/ScriptValue.cpp
index a52024d..abc31e2 100644
--- a/WebCore/bindings/js/ScriptValue.cpp
+++ b/WebCore/bindings/js/ScriptValue.cpp
@@ -29,6 +29,7 @@
#include "config.h"
#include "ScriptValue.h"
+#include "InspectorValues.h"
#include "SerializedScriptValue.h"
#include <JavaScriptCore/APICast.h>
@@ -93,4 +94,62 @@ ScriptValue ScriptValue::deserialize(ScriptState* scriptState, SerializedScriptV
return ScriptValue(value->deserialize(scriptState, scriptState->lexicalGlobalObject()));
}
+#if ENABLE(INSPECTOR)
+static PassRefPtr<InspectorValue> jsToInspectorValue(ScriptState* scriptState, JSValue value)
+{
+ if (!value) {
+ ASSERT_NOT_REACHED();
+ return 0;
+ }
+ if (value.isNull() || value.isUndefined())
+ return InspectorValue::null();
+ if (value.isBoolean())
+ return InspectorBasicValue::create(value.getBoolean());
+ if (value.isNumber())
+ return InspectorBasicValue::create(value.uncheckedGetNumber());
+ if (value.isString()) {
+ UString s = value.getString(scriptState);
+ return InspectorString::create(String(s.data(), s.size()));
+ }
+ if (value.isObject()) {
+ if (isJSArray(&scriptState->globalData(), value)) {
+ RefPtr<InspectorArray> inspectorArray = InspectorArray::create();
+ JSArray* array = asArray(value);
+ unsigned length = array->length();
+ for (unsigned i = 0; i < length; i++) {
+ JSValue element = array->getIndex(i);
+ RefPtr<InspectorValue> elementValue = jsToInspectorValue(scriptState, element);
+ if (!elementValue) {
+ ASSERT_NOT_REACHED();
+ elementValue = InspectorValue::null();
+ }
+ inspectorArray->push(elementValue);
+ }
+ return inspectorArray;
+ }
+ RefPtr<InspectorObject> inspectorObject = InspectorObject::create();
+ JSObject* object = value.getObject();
+ PropertyNameArray propertyNames(scriptState);
+ object->getOwnPropertyNames(scriptState, propertyNames);
+ for (size_t i = 0; i < propertyNames.size(); i++) {
+ const Identifier& name = propertyNames[i];
+ JSValue propertyValue = object->get(scriptState, name);
+ RefPtr<InspectorValue> inspectorValue = jsToInspectorValue(scriptState, propertyValue);
+ if (!inspectorValue) {
+ ASSERT_NOT_REACHED();
+ inspectorValue = InspectorValue::null();
+ }
+ inspectorObject->set(String(name.data(), name.size()), inspectorValue);
+ }
+ return inspectorObject;
+ }
+ return 0;
+}
+
+PassRefPtr<InspectorValue> ScriptValue::toInspectorValue(ScriptState* scriptState) const
+{
+ return jsToInspectorValue(scriptState, m_value.get());
+}
+#endif // ENABLE(INSPECTOR)
+
} // namespace WebCore
diff --git a/WebCore/bindings/js/ScriptValue.h b/WebCore/bindings/js/ScriptValue.h
index f4f9c68..b170fcf 100644
--- a/WebCore/bindings/js/ScriptValue.h
+++ b/WebCore/bindings/js/ScriptValue.h
@@ -40,6 +40,7 @@
namespace WebCore {
+class InspectorValue;
class SerializedScriptValue;
class ScriptValue {
@@ -61,6 +62,10 @@ public:
static ScriptValue undefined() { return ScriptValue(JSC::jsUndefined()); }
+#if ENABLE(INSPECTOR)
+ PassRefPtr<InspectorValue> toInspectorValue(ScriptState*) const;
+#endif
+
private:
JSC::ProtectedJSValue m_value;
};
diff --git a/WebCore/bindings/js/SerializedScriptValue.cpp b/WebCore/bindings/js/SerializedScriptValue.cpp
index 90f8d7c..6d6fa21 100644
--- a/WebCore/bindings/js/SerializedScriptValue.cpp
+++ b/WebCore/bindings/js/SerializedScriptValue.cpp
@@ -736,18 +736,23 @@ struct DeserializingTreeWalker : public BaseWalker {
return jsNumber(m_exec, value.asDouble());
case SerializedScriptValueData::DateType:
return new (m_exec) DateInstance(m_exec, m_globalObject->dateStructure(), value.asDouble());
- case SerializedScriptValueData::FileType:
+ case SerializedScriptValueData::FileType: {
if (!m_isDOMGlobalObject)
return jsNull();
- return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), File::create(value.asString().crossThreadString()));
+ ScriptExecutionContext* scriptExecutionContext = static_cast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject())->scriptExecutionContext();
+ ASSERT(scriptExecutionContext);
+ return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), File::create(scriptExecutionContext, value.asString().crossThreadString()));
+ }
case SerializedScriptValueData::FileListType: {
if (!m_isDOMGlobalObject)
return jsNull();
RefPtr<FileList> result = FileList::create();
SerializedFileList* serializedFileList = value.asFileList();
unsigned length = serializedFileList->length();
+ ScriptExecutionContext* scriptExecutionContext = static_cast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject())->scriptExecutionContext();
+ ASSERT(scriptExecutionContext);
for (unsigned i = 0; i < length; i++)
- result->append(File::create(serializedFileList->item(i)));
+ result->append(File::create(scriptExecutionContext, serializedFileList->item(i)));
return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), result.get());
}
case SerializedScriptValueData::ImageDataType: {
diff --git a/WebCore/bindings/scripts/CodeGeneratorCPP.pm b/WebCore/bindings/scripts/CodeGeneratorCPP.pm
index 9e254af..27cf854 100644
--- a/WebCore/bindings/scripts/CodeGeneratorCPP.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorCPP.pm
@@ -281,7 +281,7 @@ sub AddIncludesForType
my $type = $codeGenerator->StripModule(shift);
return if $codeGenerator->IsNonPointerType($type);
- return if $type =~ /cconstructor/;
+ return if $type =~ /Constructor/;
if ($codeGenerator->IsStringType($type)) {
$implIncludes{"AtomicString.h"} = 1;
diff --git a/WebCore/bindings/scripts/CodeGeneratorJS.pm b/WebCore/bindings/scripts/CodeGeneratorJS.pm
index d992d89..05f532c 100644
--- a/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -1977,7 +1977,11 @@ sub GenerateImplementation
# FIXME: this casts into int to match our previous behavior which turned 0xFFFFFFFF in -1 for NodeFilter.SHOW_ALL
push(@implContent, "JSValue ${getter}(ExecState* exec, JSValue, const Identifier&)\n");
push(@implContent, "{\n");
- push(@implContent, " return jsNumber(exec, static_cast<int>(" . $constant->value . "));\n");
+ if ($constant->type eq "DOMString") {
+ push(@implContent, " return jsStringOrNull(exec, String(" . $constant->value . "));\n");
+ } else {
+ push(@implContent, " return jsNumber(exec, static_cast<int>(" . $constant->value . "));\n");
+ }
push(@implContent, "}\n\n");
}
}
diff --git a/WebCore/bindings/scripts/IDLStructure.pm b/WebCore/bindings/scripts/IDLStructure.pm
index 2eda696..f9dd4ab 100644
--- a/WebCore/bindings/scripts/IDLStructure.pm
+++ b/WebCore/bindings/scripts/IDLStructure.pm
@@ -78,6 +78,10 @@ our $idlIdNs = '[a-zA-Z0-9:]'; # Generic identifier including namespace
our $idlIdNsList = '[a-zA-Z0-9:,\ ]'; # List of Generic identifiers including namespace
our $idlType = '[a-zA-Z0-9_]'; # Generic type/"value string" identifier
+# Match a string value, a hexadecimal number, or an integral number.
+# Note: some of the characters that are allowed in the string value may not be allowed by
+# interfaceSelector.
+our $constValue = '("[^"\r\n]*")|(0[xX][a-fA-F0-9]+)|(-?[0-9]*)';
our $idlDataType = '[a-zA-Z0-9\ ]'; # Generic data type identifier
# Magic IDL parsing regular expressions
@@ -89,7 +93,7 @@ our $extendedAttributeSyntax = '\[[^]]*\]'; # Used for extended attributes
# Regular expression based IDL 'syntactical tokenizer' used in the IDLParser
our $moduleSelector = 'module\s*(' . $idlId . '*)\s*{';
our $moduleNSSelector = 'module\s*(' . $idlId . '*)\s*\[ns\s*(' . $idlIdNs . '*)\s*(' . $idlIdNs . '*)\]\s*;';
-our $constantSelector = 'const\s*' . $supportedTypes . '\s*(' . $idlType . '*)\s*=\s*(' . $idlType . '*)';
+our $constantSelector = 'const\s*' . $supportedTypes . '\s*(' . $idlType . '*)\s*=\s*(' . $constValue . ')';
our $raisesSelector = 'raises\s*\((' . $idlIdNsList . '*)\s*\)';
our $getterRaisesSelector = '\bgetter\s+raises\s*\((' . $idlIdNsList . '*)\s*\)';
our $setterRaisesSelector = '\bsetter\s+raises\s*\((' . $idlIdNsList . '*)\s*\)';
@@ -99,7 +103,7 @@ our $typeNamespaceSelector = '((?:' . $idlId . '*::)*)\s*(' . $idlDataType . '*)
our $exceptionSelector = 'exception\s*(' . $idlIdNs . '*)\s*([a-zA-Z\s{;]*};)';
our $exceptionSubSelector = '{\s*' . $supportedTypes . '\s*(' . $idlType . '*)\s*;\s*}';
-our $interfaceSelector = 'interface\s*((?:' . $extendedAttributeSyntax . ' )?)(' . $idlIdNs . '*)\s*(?::(\s*[^{]*))?{([a-zA-Z0-9_=\s(),;:\[\]&\|]*)';
+our $interfaceSelector = 'interface\s*((?:' . $extendedAttributeSyntax . ' )?)(' . $idlIdNs . '*)\s*(?::(\s*[^{]*))?{([-a-zA-Z0-9_"=\s(),;:\[\]&\|]*)';
our $interfaceMethodSelector = '\s*((?:' . $extendedAttributeSyntax . ' )?)' . $supportedTypes . '\s*(' . $idlIdNs . '*)\s*\(\s*([a-zA-Z0-9:\s,=\[\]]*)';
our $interfaceParameterSelector = '(in|out)\s*((?:' . $extendedAttributeSyntax . ' )?)' . $supportedTypes . '\s*(' . $idlIdNs . '*)';
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
index 86c7169..09c77db 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
@@ -47,7 +47,13 @@ public:
WEBDOM_CONST_VALUE_1 = 1,
WEBDOM_CONST_VALUE_2 = 2,
WEBDOM_CONST_VALUE_4 = 4,
- WEBDOM_CONST_VALUE_8 = 8
+ WEBDOM_CONST_VALUE_8 = 8,
+ WEBDOM_CONST_VALUE_9 = -1,
+ WEBDOM_CONST_VALUE_10 = "my constant string",
+ WEBDOM_CONST_VALUE_11 = 0xffffffff,
+ WEBDOM_CONST_VALUE_12 = 0x01,
+ WEBDOM_CONST_VALUE_13 = 0X20,
+ WEBDOM_CONST_VALUE_14 = 0x1abc
};
int readOnlyIntAttr() const;
diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
index 6e667f7..5aa54da 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
+++ b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
@@ -100,24 +100,36 @@ static JSC_CONST_HASHTABLE HashTable JSTestObjTable = { 68, 63, JSTestObjTableVa
#define THUNK_GENERATOR(generator)
#endif
-static const HashTableValue JSTestObjConstructorTableValues[6] =
+static const HashTableValue JSTestObjConstructorTableValues[12] =
{
{ "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) },
{ "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0 THUNK_GENERATOR(0) },
{ "CONST_VALUE_2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t)0 THUNK_GENERATOR(0) },
{ "CONST_VALUE_4", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t)0 THUNK_GENERATOR(0) },
{ "CONST_VALUE_8", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_9", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_9), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_10", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_10), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_11", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_11), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_12", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_13", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_14", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t)0 THUNK_GENERATOR(0) },
{ 0, 0, 0, 0 THUNK_GENERATOR(0) }
};
#undef THUNK_GENERATOR
-static JSC_CONST_HASHTABLE HashTable JSTestObjConstructorTable = { 16, 15, JSTestObjConstructorTableValues, 0 };
+static JSC_CONST_HASHTABLE HashTable JSTestObjConstructorTable = { 33, 31, JSTestObjConstructorTableValues, 0 };
COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDontCheckEnums);
COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDontCheckEnums);
COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDontCheckEnums);
COMPILE_ASSERT(4 == TestObj::CONST_VALUE_4, TestObjEnumCONST_VALUE_4IsWrongUseDontCheckEnums);
COMPILE_ASSERT(8 == TestObj::CONST_VALUE_8, TestObjEnumCONST_VALUE_8IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(-1 == TestObj::CONST_VALUE_9, TestObjEnumCONST_VALUE_9IsWrongUseDontCheckEnums);
+COMPILE_ASSERT("my constant string" == TestObj::CONST_VALUE_10, TestObjEnumCONST_VALUE_10IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(0xffffffff == TestObj::CONST_VALUE_11, TestObjEnumCONST_VALUE_11IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(0x01 == TestObj::CONST_VALUE_12, TestObjEnumCONST_VALUE_12IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(0X20 == TestObj::CONST_VALUE_13, TestObjEnumCONST_VALUE_13IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWrongUseDontCheckEnums);
class JSTestObjConstructor : public DOMConstructorObject {
public:
@@ -160,13 +172,19 @@ bool JSTestObjConstructor::getOwnPropertyDescriptor(ExecState* exec, const Ident
#define THUNK_GENERATOR(generator)
#endif
-static const HashTableValue JSTestObjPrototypeTableValues[36] =
+static const HashTableValue JSTestObjPrototypeTableValues[42] =
{
{ "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) },
{ "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0 THUNK_GENERATOR(0) },
{ "CONST_VALUE_2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t)0 THUNK_GENERATOR(0) },
{ "CONST_VALUE_4", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t)0 THUNK_GENERATOR(0) },
{ "CONST_VALUE_8", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_9", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_9), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_10", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_10), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_11", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_11), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_12", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_13", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_14", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t)0 THUNK_GENERATOR(0) },
{ "voidMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethod), (intptr_t)0 THUNK_GENERATOR(0) },
{ "voidMethodWithArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) },
{ "intMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIntMethod), (intptr_t)0 THUNK_GENERATOR(0) },
@@ -201,7 +219,7 @@ static const HashTableValue JSTestObjPrototypeTableValues[36] =
};
#undef THUNK_GENERATOR
-static JSC_CONST_HASHTABLE HashTable JSTestObjPrototypeTable = { 132, 127, JSTestObjPrototypeTableValues, 0 };
+static JSC_CONST_HASHTABLE HashTable JSTestObjPrototypeTable = { 134, 127, JSTestObjPrototypeTableValues, 0 };
const ClassInfo JSTestObjPrototype::s_info = { "TestObjPrototype", 0, &JSTestObjPrototypeTable, 0 };
JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
@@ -1272,6 +1290,36 @@ JSValue jsTestObjCONST_VALUE_8(ExecState* exec, JSValue, const Identifier&)
return jsNumber(exec, static_cast<int>(8));
}
+JSValue jsTestObjCONST_VALUE_9(ExecState* exec, JSValue, const Identifier&)
+{
+ return jsNumber(exec, static_cast<int>(-1));
+}
+
+JSValue jsTestObjCONST_VALUE_10(ExecState* exec, JSValue, const Identifier&)
+{
+ return jsStringOrNull(exec, String("my constant string"));
+}
+
+JSValue jsTestObjCONST_VALUE_11(ExecState* exec, JSValue, const Identifier&)
+{
+ return jsNumber(exec, static_cast<int>(0xffffffff));
+}
+
+JSValue jsTestObjCONST_VALUE_12(ExecState* exec, JSValue, const Identifier&)
+{
+ return jsNumber(exec, static_cast<int>(0x01));
+}
+
+JSValue jsTestObjCONST_VALUE_13(ExecState* exec, JSValue, const Identifier&)
+{
+ return jsNumber(exec, static_cast<int>(0X20));
+}
+
+JSValue jsTestObjCONST_VALUE_14(ExecState* exec, JSValue, const Identifier&)
+{
+ return jsNumber(exec, static_cast<int>(0x1abc));
+}
+
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestObj* object)
{
return getDOMObjectWrapper<JSTestObj>(exec, globalObject, object);
diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.h b/WebCore/bindings/scripts/test/JS/JSTestObj.h
index 84122b7..0648526 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestObj.h
+++ b/WebCore/bindings/scripts/test/JS/JSTestObj.h
@@ -180,6 +180,12 @@ JSC::JSValue jsTestObjCONST_VALUE_1(JSC::ExecState*, JSC::JSValue, const JSC::Id
JSC::JSValue jsTestObjCONST_VALUE_2(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
JSC::JSValue jsTestObjCONST_VALUE_4(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
JSC::JSValue jsTestObjCONST_VALUE_8(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsTestObjCONST_VALUE_9(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsTestObjCONST_VALUE_10(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsTestObjCONST_VALUE_11(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsTestObjCONST_VALUE_12(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsTestObjCONST_VALUE_13(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsTestObjCONST_VALUE_14(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
} // namespace WebCore
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
index 33c3a2d..a96b499 100644
--- a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
@@ -39,7 +39,13 @@ enum {
DOM_CONST_VALUE_1 = 1,
DOM_CONST_VALUE_2 = 2,
DOM_CONST_VALUE_4 = 4,
- DOM_CONST_VALUE_8 = 8
+ DOM_CONST_VALUE_8 = 8,
+ DOM_CONST_VALUE_9 = -1,
+ DOM_CONST_VALUE_10 = "my constant string",
+ DOM_CONST_VALUE_11 = 0xffffffff,
+ DOM_CONST_VALUE_12 = 0x01,
+ DOM_CONST_VALUE_13 = 0X20,
+ DOM_CONST_VALUE_14 = 0x1abc
};
@interface DOMTestObj : DOMObject
diff --git a/WebCore/bindings/scripts/test/TestObj.idl b/WebCore/bindings/scripts/test/TestObj.idl
index f9d41d7..a5daa24 100644
--- a/WebCore/bindings/scripts/test/TestObj.idl
+++ b/WebCore/bindings/scripts/test/TestObj.idl
@@ -136,5 +136,11 @@ module test {
const unsigned short CONST_VALUE_2 = 2;
const unsigned short CONST_VALUE_4 = 4;
const unsigned short CONST_VALUE_8 = 8;
+ const short CONST_VALUE_9 = -1;
+ const DOMString CONST_VALUE_10 = "my constant string";
+ const unsigned short CONST_VALUE_11 = 0xffffffff;
+ const unsigned short CONST_VALUE_12 = 0x01;
+ const unsigned short CONST_VALUE_13 = 0X20;
+ const unsigned short CONST_VALUE_14 = 0x1abc;
};
}
diff --git a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
index c348726..09d99f8 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
@@ -1021,6 +1021,12 @@ static const BatchedConstant TestObjConsts[] = {
{"CONST_VALUE_2", static_cast<signed int>(2)},
{"CONST_VALUE_4", static_cast<signed int>(4)},
{"CONST_VALUE_8", static_cast<signed int>(8)},
+ {"CONST_VALUE_9", static_cast<signed int>(-1)},
+ {"CONST_VALUE_10", static_cast<signed int>("my constant string")},
+ {"CONST_VALUE_11", static_cast<signed int>(0xffffffff)},
+ {"CONST_VALUE_12", static_cast<signed int>(0x01)},
+ {"CONST_VALUE_13", static_cast<signed int>(0X20)},
+ {"CONST_VALUE_14", static_cast<signed int>(0x1abc)},
};
COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDontCheckEnums);
@@ -1028,6 +1034,12 @@ COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDo
COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDontCheckEnums);
COMPILE_ASSERT(4 == TestObj::CONST_VALUE_4, TestObjEnumCONST_VALUE_4IsWrongUseDontCheckEnums);
COMPILE_ASSERT(8 == TestObj::CONST_VALUE_8, TestObjEnumCONST_VALUE_8IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(-1 == TestObj::CONST_VALUE_9, TestObjEnumCONST_VALUE_9IsWrongUseDontCheckEnums);
+COMPILE_ASSERT("my constant string" == TestObj::CONST_VALUE_10, TestObjEnumCONST_VALUE_10IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(0xffffffff == TestObj::CONST_VALUE_11, TestObjEnumCONST_VALUE_11IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(0x01 == TestObj::CONST_VALUE_12, TestObjEnumCONST_VALUE_12IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(0X20 == TestObj::CONST_VALUE_13, TestObjEnumCONST_VALUE_13IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWrongUseDontCheckEnums);
static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
diff --git a/WebCore/bindings/v8/ScriptObject.cpp b/WebCore/bindings/v8/ScriptObject.cpp
index 520c57b..8f81537 100644
--- a/WebCore/bindings/v8/ScriptObject.cpp
+++ b/WebCore/bindings/v8/ScriptObject.cpp
@@ -38,7 +38,6 @@
#include "Frame.h"
#include "V8Binding.h"
#include "V8InjectedScriptHost.h"
-#include "V8InspectorBackend.h"
#include "V8InspectorFrontendHost.h"
#include "V8Proxy.h"
@@ -146,13 +145,6 @@ bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, const S
}
#if ENABLE(INSPECTOR)
-bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorBackend* value)
-{
- ScriptScope scope(scriptState);
- scope.global()->Set(v8::String::New(name), toV8(value));
- return scope.success();
-}
-
bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorFrontendHost* value)
{
ScriptScope scope(scriptState);
diff --git a/WebCore/bindings/v8/ScriptObject.h b/WebCore/bindings/v8/ScriptObject.h
index a60f2a8..bee079c 100644
--- a/WebCore/bindings/v8/ScriptObject.h
+++ b/WebCore/bindings/v8/ScriptObject.h
@@ -37,7 +37,6 @@
namespace WebCore {
class InjectedScriptHost;
- class InspectorBackend;
class InspectorFrontendHost;
class ScriptState;
@@ -69,7 +68,6 @@ namespace WebCore {
class ScriptGlobalObject {
public:
static bool set(ScriptState*, const char* name, const ScriptObject&);
- static bool set(ScriptState*, const char* name, InspectorBackend*);
static bool set(ScriptState*, const char* name, InspectorFrontendHost*);
static bool set(ScriptState*, const char* name, InjectedScriptHost*);
static bool get(ScriptState*, const char* name, ScriptObject&);
diff --git a/WebCore/bindings/v8/ScriptProfile.cpp b/WebCore/bindings/v8/ScriptProfile.cpp
index beafea1..3b71d5f 100644
--- a/WebCore/bindings/v8/ScriptProfile.cpp
+++ b/WebCore/bindings/v8/ScriptProfile.cpp
@@ -40,6 +40,7 @@ namespace WebCore {
String ScriptProfile::title() const
{
+ v8::HandleScope scope;
return toWebCoreString(m_profile->GetTitle());
}
diff --git a/WebCore/bindings/v8/ScriptValue.cpp b/WebCore/bindings/v8/ScriptValue.cpp
index 3aca3c1..4ae532d 100755
--- a/WebCore/bindings/v8/ScriptValue.cpp
+++ b/WebCore/bindings/v8/ScriptValue.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "ScriptValue.h"
+#include "InspectorValues.h"
#include "ScriptScope.h"
#include "SerializedScriptValue.h"
#include "V8Binding.h"
@@ -66,4 +67,60 @@ String ScriptValue::toString(ScriptState*) const
return toWebCoreString(m_value);
}
+static PassRefPtr<InspectorValue> v8ToInspectorValue(v8::Handle<v8::Value> value)
+{
+ if (value.IsEmpty()) {
+ ASSERT_NOT_REACHED();
+ return 0;
+ }
+ if (value->IsNull() || value->IsUndefined())
+ return InspectorValue::null();
+ if (value->IsBoolean())
+ return InspectorBasicValue::create(value->BooleanValue());
+ if (value->IsNumber())
+ return InspectorBasicValue::create(value->NumberValue());
+ if (value->IsString())
+ return InspectorString::create(toWebCoreString(value));
+ if (value->IsArray()) {
+ v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(value);
+ RefPtr<InspectorArray> inspectorArray = InspectorArray::create();
+ uint32_t length = array->Length();
+ for (uint32_t i = 0; i < length; i++) {
+ v8::Local<v8::Value> value = array->Get(v8::Int32::New(i));
+ RefPtr<InspectorValue> element = v8ToInspectorValue(value);
+ if (!element) {
+ ASSERT_NOT_REACHED();
+ element = InspectorValue::null();
+ }
+ inspectorArray->push(element);
+ }
+ return inspectorArray;
+ }
+ if (value->IsObject()) {
+ RefPtr<InspectorObject> inspectorObject = InspectorObject::create();
+ v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value);
+ v8::Local<v8::Array> propertyNames = object->GetPropertyNames();
+ uint32_t length = propertyNames->Length();
+ for (uint32_t i = 0; i < length; i++) {
+ v8::Local<v8::Value> name = propertyNames->Get(v8::Int32::New(i));
+ RefPtr<InspectorValue> propertyValue = v8ToInspectorValue(object->Get(name));
+ if (!propertyValue) {
+ ASSERT_NOT_REACHED();
+ continue;
+ }
+ inspectorObject->set(toWebCoreStringWithNullCheck(name), propertyValue);
+ }
+ return inspectorObject;
+ }
+ return 0;
+}
+
+PassRefPtr<InspectorValue> ScriptValue::toInspectorValue(ScriptState* scriptState) const
+{
+ v8::HandleScope handleScope;
+ // v8::Object::GetPropertyNames() expects current context to be not null.
+ v8::Context::Scope contextScope(scriptState->context());
+ return v8ToInspectorValue(m_value);
+}
+
} // namespace WebCore
diff --git a/WebCore/bindings/v8/ScriptValue.h b/WebCore/bindings/v8/ScriptValue.h
index 8241205..1743da0 100644
--- a/WebCore/bindings/v8/ScriptValue.h
+++ b/WebCore/bindings/v8/ScriptValue.h
@@ -43,6 +43,7 @@
namespace WebCore {
+class InspectorValue;
class SerializedScriptValue;
class ScriptValue {
@@ -151,6 +152,8 @@ public:
bool getString(String& result) const;
String toString(ScriptState*) const;
+ PassRefPtr<InspectorValue> toInspectorValue(ScriptState*) const;
+
private:
mutable v8::Persistent<v8::Value> m_value;
};
diff --git a/WebCore/bindings/v8/SerializedScriptValue.cpp b/WebCore/bindings/v8/SerializedScriptValue.cpp
index 47c4c2e..9dc4d0f 100644
--- a/WebCore/bindings/v8/SerializedScriptValue.cpp
+++ b/WebCore/bindings/v8/SerializedScriptValue.cpp
@@ -45,6 +45,7 @@
#include "V8FileList.h"
#include "V8ImageData.h"
#include "V8Proxy.h"
+#include "V8Utilities.h"
#include <wtf/Assertions.h>
#include <wtf/RefCounted.h>
@@ -854,7 +855,7 @@ private:
String path;
if (!readWebCoreString(&path))
return false;
- PassRefPtr<Blob> blob = Blob::create(path);
+ PassRefPtr<Blob> blob = Blob::create(getScriptExecutionContext(), path);
*value = toV8(blob);
return true;
}
@@ -864,7 +865,7 @@ private:
String path;
if (!readWebCoreString(&path))
return false;
- PassRefPtr<File> file = File::create(path);
+ PassRefPtr<File> file = File::create(getScriptExecutionContext(), path);
*value = toV8(file);
return true;
}
@@ -879,7 +880,7 @@ private:
String path;
if (!readWebCoreString(&path))
return false;
- fileList->append(File::create(path));
+ fileList->append(File::create(getScriptExecutionContext(), path));
}
*value = toV8(fileList);
return true;
diff --git a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index 210e974..d1e0701 100644
--- a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -790,6 +790,7 @@ v8::Handle<v8::Value> V8DOMWindow::setIntervalCallback(const v8::Arguments& args
return WindowSetTimeoutImpl(args, false);
}
+#if ENABLE(DATABASE)
v8::Handle<v8::Value> V8DOMWindow::openDatabaseCallback(const v8::Arguments& args)
{
INC_STATS("DOM.DOMWindow.openDatabase");
@@ -819,6 +820,7 @@ v8::Handle<v8::Value> V8DOMWindow::openDatabaseCallback(const v8::Arguments& arg
V8Proxy::setDOMException(ec);
return result;
}
+#endif // ENABLE(DATABASE)
bool V8DOMWindow::namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value>)
{
diff --git a/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp b/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp
index 44a6eeb..31406fb 100644
--- a/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp
@@ -61,7 +61,7 @@ v8::Handle<v8::Value> V8Database::changeVersionCallback(const v8::Arguments& arg
return v8::Undefined();
RefPtr<V8SQLTransactionCallback> callback;
- if (args.Length() > 2) {
+ if (args.Length() > 2 && !isUndefinedOrNull(args[2])) {
if (!args[2]->IsObject())
return throwError(TYPE_MISMATCH_ERR);
@@ -69,7 +69,7 @@ v8::Handle<v8::Value> V8Database::changeVersionCallback(const v8::Arguments& arg
}
RefPtr<V8SQLTransactionErrorCallback> errorCallback;
- if (args.Length() > 3) {
+ if (args.Length() > 3 && !isUndefinedOrNull(args[3])) {
if (!args[3]->IsObject())
return throwError(TYPE_MISMATCH_ERR);
@@ -77,7 +77,7 @@ v8::Handle<v8::Value> V8Database::changeVersionCallback(const v8::Arguments& arg
}
RefPtr<V8CustomVoidCallback> successCallback;
- if (args.Length() > 4) {
+ if (args.Length() > 4 && !isUndefinedOrNull(args[4])) {
if (!args[4]->IsObject())
return throwError(TYPE_MISMATCH_ERR);
diff --git a/WebCore/bindings/v8/custom/V8DatabaseSyncCustom.cpp b/WebCore/bindings/v8/custom/V8DatabaseSyncCustom.cpp
index 8a317d7..079f6e9 100644
--- a/WebCore/bindings/v8/custom/V8DatabaseSyncCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DatabaseSyncCustom.cpp
@@ -55,7 +55,7 @@ v8::Handle<v8::Value> V8DatabaseSync::changeVersionCallback(const v8::Arguments&
DatabaseSync* database = V8DatabaseSync::toNative(args.Holder());
RefPtr<V8SQLTransactionSyncCallback> callback;
- if (args.Length() > 2) {
+ if (args.Length() > 2 && !isUndefinedOrNull(args[2])) {
if (!args[2]->IsObject())
return throwError(TYPE_MISMATCH_ERR);
diff --git a/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp b/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp
index 7f4ccf7..7733a70 100644
--- a/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp
@@ -80,7 +80,7 @@ v8::Handle<v8::Value> V8InspectorFrontendHost::showContextMenuCallback(const v8:
v8::Local<v8::Value> id = item->Get(v8::String::New("id"));
if (label->IsUndefined() || id->IsUndefined()) {
items.append(new ContextMenuItem(SeparatorType,
- ContextMenuItemTagNoAction,
+ ContextMenuItemCustomTagNoAction,
String()));
} else {
ContextMenuAction typedId = static_cast<ContextMenuAction>(
diff --git a/WebCore/bridge/jsc/BridgeJSC.cpp b/WebCore/bridge/jsc/BridgeJSC.cpp
index d44cdb5..9b3af25 100644
--- a/WebCore/bridge/jsc/BridgeJSC.cpp
+++ b/WebCore/bridge/jsc/BridgeJSC.cpp
@@ -83,7 +83,7 @@ void Instance::end()
virtualEnd();
}
-RuntimeObject* Instance::createRuntimeObject(ExecState* exec)
+JSObject* Instance::createRuntimeObject(ExecState* exec)
{
ASSERT(m_rootObject);
ASSERT(m_rootObject->isValid());
diff --git a/WebCore/bridge/jsc/BridgeJSC.h b/WebCore/bridge/jsc/BridgeJSC.h
index ee7deb6..44ce4d1 100644
--- a/WebCore/bridge/jsc/BridgeJSC.h
+++ b/WebCore/bridge/jsc/BridgeJSC.h
@@ -84,7 +84,7 @@ public:
void end();
virtual Class* getClass() const = 0;
- RuntimeObject* createRuntimeObject(ExecState*);
+ JSObject* createRuntimeObject(ExecState*);
void willInvalidateRuntimeObject();
void willDestroyRuntimeObject();
diff --git a/WebCore/bridge/qt/qt_runtime.cpp b/WebCore/bridge/qt/qt_runtime.cpp
index cfab3a2..b9cf4b0 100644
--- a/WebCore/bridge/qt/qt_runtime.cpp
+++ b/WebCore/bridge/qt/qt_runtime.cpp
@@ -338,8 +338,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
if (type == Object || type == Array || type == RTArray) {
// Enumerate the contents of the object
PropertyNameArray properties(exec);
- if (properties.size() > 0)
- object->getPropertyNames(exec, properties);
+ object->getPropertyNames(exec, properties);
PropertyNameArray::const_iterator it = properties.begin();
QVariantMap result;
diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp
index 6bf7751..645e354 100644
--- a/WebCore/css/CSSParser.cpp
+++ b/WebCore/css/CSSParser.cpp
@@ -5677,27 +5677,31 @@ static int cssPropertyID(const UChar* propertyName, unsigned length)
const char* name = buffer;
if (buffer[0] == '-') {
- if (!strcmp(buffer, "-apple-dashboard-region") || !strcmp(buffer, "-apple-line-clamp")) {
- // Support two Apple-specific CSS properties previously used for
- // the Dashboard and Safari RSS line clamping.
+ // If the prefix is -apple- or -khtml-, change it to -webkit-.
+ // This makes the string one character longer.
+ if (hasPrefix(buffer, length, "-apple-") || hasPrefix(buffer, length, "-khtml-")) {
memmove(buffer + 7, buffer + 6, length + 1 - 6);
memcpy(buffer, "-webkit", 7);
++length;
- } else if (!strcmp(buffer, "-webkit-opacity")) {
- // Honor -webkit-opacity as a synonym for opacity. This was the only
- // syntax that worked in Safari 1.1, and may be in use on some websites and widgets.
- const char* const opacity = "opacity";
- name = opacity;
- length = 7;
- } else if (hasPrefix(buffer, length, "-webkit-border-")) {
- // -webkit-border-*-*-radius worked in Safari 4 and earlier. -webkit-border-radius syntax
- // differs from border-radius, so it remains as a distinct property.
- if (!strcmp(buffer + 15, "top-left-radius")
- || !strcmp(buffer + 15, "top-right-radius")
- || !strcmp(buffer + 15, "bottom-right-radius")
- || !strcmp(buffer + 15, "bottom-left-radius")) {
- name = buffer + 8;
- length -= 8;
+ }
+
+ if (hasPrefix(buffer, length, "-webkit")) {
+ if (strcmp(buffer, "-webkit-opacity") == 0) {
+ // Honor -webkit-opacity as a synonym for opacity.
+ // This was the only syntax that worked in Safari 1.1, and may be in use on some websites and widgets.
+ const char* const opacity = "opacity";
+ name = opacity;
+ length = strlen(opacity);
+ } else if (hasPrefix(buffer + 7, length - 7, "-border-")) {
+ // -webkit-border-*-*-radius worked in Safari 4 and earlier. -webkit-border-radius syntax
+ // differs from border-radius, so it is remains as a distinct property.
+ if (!strcmp(buffer + 15, "top-left-radius")
+ || !strcmp(buffer + 15, "top-right-radius")
+ || !strcmp(buffer + 15, "bottom-right-radius")
+ || !strcmp(buffer + 15, "bottom-left-radius")) {
+ name = buffer + 8;
+ length -= 8;
+ }
}
}
}
diff --git a/WebCore/css/CSSPrimitiveValueMappings.h b/WebCore/css/CSSPrimitiveValueMappings.h
index 9533f68..b1d2d3d 100644
--- a/WebCore/css/CSSPrimitiveValueMappings.h
+++ b/WebCore/css/CSSPrimitiveValueMappings.h
@@ -36,6 +36,7 @@
#include "FontSmoothingMode.h"
#include "GraphicsTypes.h"
#include "Path.h"
+#include "RenderStyleConstants.h"
#include "SVGRenderStyleDefs.h"
#include "TextDirection.h"
#include "TextRenderingMode.h"
diff --git a/WebCore/css/CSSSelector.cpp b/WebCore/css/CSSSelector.cpp
index b1de4ec..facce83 100644
--- a/WebCore/css/CSSSelector.cpp
+++ b/WebCore/css/CSSSelector.cpp
@@ -37,12 +37,11 @@ namespace WebCore {
using namespace HTMLNames;
-// A helper class to hold CSSSelectors.
class CSSSelectorBag : public Noncopyable {
public:
~CSSSelectorBag()
{
- deleteAllValues(m_stack);
+ ASSERT(isEmpty());
}
bool isEmpty() const
@@ -50,7 +49,7 @@ public:
return m_stack.isEmpty();
}
- void append(PassOwnPtr<CSSSelector> selector)
+ void add(PassOwnPtr<CSSSelector> selector)
{
if (selector)
m_stack.append(selector.leakPtr());
@@ -68,46 +67,6 @@ private:
Vector<CSSSelector*, 16> m_stack;
};
-CSSSelector::~CSSSelector()
-{
- // We should avoid a recursive destructor call, which causes stack overflow
- // if CSS Selectors are deeply nested.
-
- // Early exit if we have already processed the children of this selector.
- if (m_hasRareData) {
- if (!m_data.m_rareData)
- return;
- } else if (!m_data.m_tagHistory)
- return;
-
- CSSSelectorBag selectorsToBeDeleted;
- if (m_hasRareData) {
- selectorsToBeDeleted.append(m_data.m_rareData->m_tagHistory.release());
- selectorsToBeDeleted.append(m_data.m_rareData->m_simpleSelector.release());
- delete m_data.m_rareData;
- } else
- selectorsToBeDeleted.append(adoptPtr(m_data.m_tagHistory));
-
- // Traverse the tree of CSSSelector and delete each CSSSelector iteratively.
- while (!selectorsToBeDeleted.isEmpty()) {
- OwnPtr<CSSSelector> selector(selectorsToBeDeleted.takeAny());
- ASSERT(selector);
- if (selector->m_hasRareData) {
- ASSERT(selector->m_data.m_rareData);
- selectorsToBeDeleted.append(selector->m_data.m_rareData->m_tagHistory.release());
- selectorsToBeDeleted.append(selector->m_data.m_rareData->m_simpleSelector.release());
- delete selector->m_data.m_rareData;
- // Clear the pointer so that a destructor of the selector, which is
- // about to be called, can know the children are already processed.
- selector->m_data.m_rareData = 0;
- } else {
- selectorsToBeDeleted.append(adoptPtr(selector->m_data.m_tagHistory));
- // Clear the pointer for the same reason.
- selector->m_data.m_tagHistory = 0;
- }
- }
-}
-
unsigned int CSSSelector::specificity()
{
if (m_isForPage)
@@ -980,4 +939,33 @@ bool CSSSelector::RareData::matchNth(int count)
}
}
+inline void CSSSelector::releaseOwnedSelectorsToBag(CSSSelectorBag& bag)
+{
+ if (m_hasRareData) {
+ ASSERT(m_data.m_rareData);
+ bag.add(m_data.m_rareData->m_tagHistory.release());
+ bag.add(m_data.m_rareData->m_simpleSelector.release());
+ delete m_data.m_rareData;
+ // Clear the pointer so that a destructor of this selector will not
+ // traverse this chain.
+ m_data.m_rareData = 0;
+ } else {
+ bag.add(adoptPtr(m_data.m_tagHistory));
+ // Clear the pointer for the same reason.
+ m_data.m_tagHistory = 0;
+ }
+}
+
+void CSSSelector::deleteReachableSelectors()
+{
+ // Traverse the chain of selectors and delete each iteratively.
+ CSSSelectorBag selectorsToBeDeleted;
+ releaseOwnedSelectorsToBag(selectorsToBeDeleted);
+ while (!selectorsToBeDeleted.isEmpty()) {
+ OwnPtr<CSSSelector> selector(selectorsToBeDeleted.takeAny());
+ ASSERT(selector);
+ selector->releaseOwnedSelectorsToBag(selectorsToBeDeleted);
+ }
+}
+
} // namespace WebCore
diff --git a/WebCore/css/CSSSelector.h b/WebCore/css/CSSSelector.h
index 518ff2c..34e4af0 100644
--- a/WebCore/css/CSSSelector.h
+++ b/WebCore/css/CSSSelector.h
@@ -30,6 +30,8 @@
namespace WebCore {
+ class CSSSelectorBag;
+
// this class represents a selector for a StyleRule
class CSSSelector : public Noncopyable {
public:
@@ -57,7 +59,21 @@ namespace WebCore {
{
}
- ~CSSSelector();
+ ~CSSSelector()
+ {
+ // Exit if this selector does not own any objects to be deleted.
+ if (m_hasRareData) {
+ if (!m_data.m_rareData)
+ return;
+ } else if (!m_data.m_tagHistory)
+ return;
+
+ // We can not delete the owned object(s) by simply calling delete
+ // directly on them. That would lead to recursive destructor calls
+ // which might cause stack overflow. We have to delete them
+ // iteratively.
+ deleteReachableSelectors();
+ }
/**
* Re-create selector text from selector's data
@@ -275,6 +291,9 @@ namespace WebCore {
bool m_hasRareData : 1;
bool m_isForPage : 1;
+ void releaseOwnedSelectorsToBag(CSSSelectorBag&);
+ void deleteReachableSelectors();
+
unsigned specificityForPage();
void extractPseudoType() const;
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index 516e0e2..89d4f3e 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -4304,6 +4304,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
FontDescription fontDescription = m_style->fontDescription();
fontDescription.setGenericFamily(parentFontDescription.genericFamily());
fontDescription.setFamily(parentFontDescription.firstFamily());
+ fontDescription.setIsSpecifiedFont(parentFontDescription.isSpecifiedFont());
if (m_style->setFontDescription(fontDescription))
m_fontDirty = true;
return;
@@ -4377,6 +4378,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
firstFamily.setFamily(face);
firstFamily.appendFamily(0); // Remove any inherited family-fallback list.
currFamily = &firstFamily;
+ fontDescription.setIsSpecifiedFont(fontDescription.genericFamily() == FontDescription::NoFamily);
} else {
RefPtr<SharedFontFamily> newFamily = SharedFontFamily::create();
newFamily->setFamily(face);
@@ -4621,7 +4623,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
FontDescription fontDescription;
RenderTheme::defaultTheme()->systemFont(primitiveValue->getIdent(), fontDescription);
-
+
// Double-check and see if the theme did anything. If not, don't bother updating the font.
if (fontDescription.isAbsoluteSize()) {
// Make sure the rendering mode and printer font settings are updated.
diff --git a/WebCore/dom/Clipboard.h b/WebCore/dom/Clipboard.h
index 4018e4f..0562280 100644
--- a/WebCore/dom/Clipboard.h
+++ b/WebCore/dom/Clipboard.h
@@ -33,11 +33,15 @@
namespace WebCore {
+ class DragData;
class FileList;
+ class Frame;
// State available during IE's events for drag and drop and copy/paste
class Clipboard : public RefCounted<Clipboard> {
public:
+ static PassRefPtr<Clipboard> create(ClipboardAccessPolicy, DragData*, Frame*);
+
virtual ~Clipboard() { }
// Is this operation a drag-drop or a copy-paste?
diff --git a/WebCore/dom/ContainerNode.cpp b/WebCore/dom/ContainerNode.cpp
index 23b68ba..e559ba7 100644
--- a/WebCore/dom/ContainerNode.cpp
+++ b/WebCore/dom/ContainerNode.cpp
@@ -694,12 +694,13 @@ void ContainerNode::childrenChanged(bool changedByParser, Node* beforeChange, No
void ContainerNode::cloneChildNodes(ContainerNode *clone)
{
// disable the delete button so it's elements are not serialized into the markup
- if (document()->frame())
+ bool isEditorEnabled = document()->frame() && document()->frame()->editor()->canEdit();
+ if (isEditorEnabled)
document()->frame()->editor()->deleteButtonController()->disable();
ExceptionCode ec = 0;
for (Node* n = firstChild(); n && !ec; n = n->nextSibling())
clone->appendChild(n->cloneNode(true), ec);
- if (document()->frame())
+ if (isEditorEnabled && document()->frame())
document()->frame()->editor()->deleteButtonController()->enable();
}
diff --git a/WebCore/dom/DeviceOrientationController.cpp b/WebCore/dom/DeviceOrientationController.cpp
index f6867ec..a6a33f5 100644
--- a/WebCore/dom/DeviceOrientationController.cpp
+++ b/WebCore/dom/DeviceOrientationController.cpp
@@ -37,21 +37,38 @@ namespace WebCore {
DeviceOrientationController::DeviceOrientationController(Page* page, DeviceOrientationClient* client)
: m_page(page)
, m_client(client)
+ , m_timer(this, &DeviceOrientationController::timerFired)
{
}
+void DeviceOrientationController::timerFired(Timer<DeviceOrientationController>* timer)
+{
+ ASSERT_UNUSED(timer, timer == &m_timer);
+ ASSERT(!m_client || m_client->lastOrientation());
+
+ RefPtr<DeviceOrientation> orientation = m_client ? m_client->lastOrientation() : DeviceOrientation::create();
+ RefPtr<DeviceOrientationEvent> event = DeviceOrientationEvent::create(eventNames().deviceorientationEvent, orientation.get());
+
+ Vector<DOMWindow*> listenersVector;
+ copyToVector(m_newListeners, listenersVector);
+ m_newListeners.clear();
+ for (size_t i = 0; i < listenersVector.size(); ++i)
+ listenersVector[i]->dispatchEvent(event);
+}
+
void DeviceOrientationController::addListener(DOMWindow* window)
{
- // If no client is present, signal that no orientation data is available.
- // If the client already has an orientation, call back to this new listener
- // immediately.
- if (!m_client) {
- RefPtr<DeviceOrientation> emptyOrientation = DeviceOrientation::create();
- window->dispatchEvent(DeviceOrientationEvent::create(eventNames().deviceorientationEvent, emptyOrientation.get()));
- } else if (m_client && m_client->lastOrientation())
- window->dispatchEvent(DeviceOrientationEvent::create(eventNames().deviceorientationEvent, m_client->lastOrientation()));
-
- // The client may call back synchronously.
+ // If no client is present, we should fire an event with all parameters null. If
+ // the client already has an orientation, we should fire an event with that
+ // orientation. In both cases, the event is fired asynchronously, but without
+ // waiting for the client to get a new orientation.
+ if (!m_client || m_client->lastOrientation()) {
+ m_newListeners.add(window);
+ if (!m_timer.isActive())
+ m_timer.startOneShot(0);
+ }
+
+ // The client must not call back synchronously.
bool wasEmpty = m_listeners.isEmpty();
m_listeners.add(window);
if (wasEmpty && m_client)
@@ -61,6 +78,7 @@ void DeviceOrientationController::addListener(DOMWindow* window)
void DeviceOrientationController::removeListener(DOMWindow* window)
{
m_listeners.remove(window);
+ m_newListeners.remove(window);
if (m_listeners.isEmpty() && m_client)
m_client->stopUpdating();
}
@@ -72,6 +90,7 @@ void DeviceOrientationController::removeAllListeners(DOMWindow* window)
return;
m_listeners.removeAll(window);
+ m_newListeners.remove(window);
if (m_listeners.isEmpty() && m_client)
m_client->stopUpdating();
}
diff --git a/WebCore/dom/DeviceOrientationController.h b/WebCore/dom/DeviceOrientationController.h
index 376e14c..9517791 100644
--- a/WebCore/dom/DeviceOrientationController.h
+++ b/WebCore/dom/DeviceOrientationController.h
@@ -27,6 +27,8 @@
#define DeviceOrientationController_h
#include "DOMWindow.h"
+#include "Timer.h"
+
#include <wtf/HashCountedSet.h>
namespace WebCore {
@@ -46,10 +48,15 @@ public:
void didChangeDeviceOrientation(DeviceOrientation*);
private:
+ void timerFired(Timer<DeviceOrientationController>*);
+
Page* m_page;
DeviceOrientationClient* m_client;
- typedef HashCountedSet<DOMWindow*> ListenersSet;
- ListenersSet m_listeners;
+ typedef HashCountedSet<DOMWindow*> ListenersCountedSet;
+ ListenersCountedSet m_listeners;
+ typedef HashSet<DOMWindow*> ListenersSet;
+ ListenersSet m_newListeners;
+ Timer<DeviceOrientationController> m_timer;
};
} // namespace WebCore
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index 6f91738..f1571cd 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -381,6 +381,7 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML)
, m_frameElementsShouldIgnoreScrolling(false)
, m_containsValidityStyleRules(false)
, m_updateFocusAppearanceRestoresSelection(false)
+ , m_writeDisabled(false)
, m_title("")
, m_rawTitle("")
, m_titleSetExplicitly(false)
@@ -2062,7 +2063,13 @@ void Document::write(const SegmentedString& text, Document* ownerDocument)
printf("Beginning a document.write at %d\n", elapsedTime());
#endif
- if (!m_parser)
+ // If the insertion point is undefined and the Document has the
+ // "write-neutralised" flag set, then abort these steps.
+ bool hasInsertionPoint = m_parser && m_parser->hasInsertionPoint();
+ if (!hasInsertionPoint && writeDisabled())
+ return;
+
+ if (!hasInsertionPoint)
open(ownerDocument);
ASSERT(m_parser);
diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h
index 63a8d12..5bc3fa3 100644
--- a/WebCore/dom/Document.h
+++ b/WebCore/dom/Document.h
@@ -1010,6 +1010,9 @@ public:
const QualifiedName& idAttributeName() const { return m_idAttributeName; }
+ bool writeDisabled() const { return m_writeDisabled; }
+ void setWriteDisabled(bool flag) { m_writeDisabled = flag; }
+
protected:
Document(Frame*, const KURL&, bool isXHTML, bool isHTML);
@@ -1164,6 +1167,9 @@ private:
bool m_containsValidityStyleRules;
bool m_updateFocusAppearanceRestoresSelection;
+ // http://www.whatwg.org/specs/web-apps/current-work/#write-neutralised
+ bool m_writeDisabled;
+
String m_title;
String m_rawTitle;
bool m_titleSetExplicitly;
diff --git a/WebCore/dom/DocumentParser.h b/WebCore/dom/DocumentParser.h
index 7e47a87..a3545b6 100644
--- a/WebCore/dom/DocumentParser.h
+++ b/WebCore/dom/DocumentParser.h
@@ -40,6 +40,9 @@ public:
virtual ScriptableDocumentParser* asScriptableDocumentParser() { return 0; }
+ // http://www.whatwg.org/specs/web-apps/current-work/#insertion-point
+ virtual bool hasInsertionPoint() { return true; }
+
// insert is used by document.write
virtual void insert(const SegmentedString&) = 0;
diff --git a/WebCore/dom/InputElement.cpp b/WebCore/dom/InputElement.cpp
index 079dd56..2a53b77 100644
--- a/WebCore/dom/InputElement.cpp
+++ b/WebCore/dom/InputElement.cpp
@@ -145,20 +145,7 @@ void InputElement::setValueFromRenderer(InputElementData& data, InputElement* in
notifyFormStateChanged(element);
}
-String InputElement::sanitizeValue(const InputElement* inputElement, const String& proposedValue)
-{
-#if ENABLE(WCSS)
- InputElementData data = const_cast<InputElement*>(inputElement)->data();
- if (!isConformToInputMask(data, proposedValue)) {
- if (isConformToInputMask(data, data.value()))
- return data.value();
- return String();
- }
-#endif
- return InputElement::sanitizeUserInputValue(inputElement, proposedValue, s_maximumLength);
-}
-
-String InputElement::sanitizeUserInputValue(const InputElement* inputElement, const String& proposedValue, int maxLength)
+static String replaceEOLAndLimitLength(const InputElement* inputElement, const String& proposedValue, int maxLength)
{
if (!inputElement->isTextField())
return proposedValue;
@@ -179,6 +166,24 @@ String InputElement::sanitizeUserInputValue(const InputElement* inputElement, co
return string.left(newLength);
}
+String InputElement::sanitizeValueForTextField(const InputElement* inputElement, const String& proposedValue)
+{
+#if ENABLE(WCSS)
+ InputElementData data = const_cast<InputElement*>(inputElement)->data();
+ if (!isConformToInputMask(data, proposedValue)) {
+ if (isConformToInputMask(data, data.value()))
+ return data.value();
+ return String();
+ }
+#endif
+ return replaceEOLAndLimitLength(inputElement, proposedValue, s_maximumLength);
+}
+
+String InputElement::sanitizeUserInputValue(const InputElement* inputElement, const String& proposedValue, int maxLength)
+{
+ return replaceEOLAndLimitLength(inputElement, proposedValue, maxLength);
+}
+
void InputElement::handleBeforeTextInsertedEvent(InputElementData& data, InputElement* inputElement, Element* element, Event* event)
{
ASSERT(event->isBeforeTextInsertedEvent());
@@ -199,7 +204,7 @@ void InputElement::handleBeforeTextInsertedEvent(InputElementData& data, InputEl
// Selected characters will be removed by the next text event.
unsigned baseLength = oldLength - selectionLength;
- unsigned maxLength = static_cast<unsigned>(data.maxLength()); // maxLength() can never be negative.
+ unsigned maxLength = static_cast<unsigned>(inputElement->supportsMaxLength() ? data.maxLength() : s_maximumLength); // maxLength() can never be negative.
unsigned appendableLength = maxLength > baseLength ? maxLength - baseLength : 0;
// Truncate the inserted text to avoid violating the maxLength and other constraints.
@@ -245,7 +250,7 @@ void InputElement::parseMaxLengthAttribute(InputElementData& data, InputElement*
void InputElement::updateValueIfNeeded(InputElementData& data, InputElement* inputElement)
{
String oldValue = data.value();
- String newValue = sanitizeValue(inputElement, oldValue);
+ String newValue = inputElement->sanitizeValue(oldValue);
if (newValue != oldValue)
inputElement->setValue(newValue);
}
diff --git a/WebCore/dom/InputElement.h b/WebCore/dom/InputElement.h
index 1d6c356..dc87b3d 100644
--- a/WebCore/dom/InputElement.h
+++ b/WebCore/dom/InputElement.h
@@ -43,6 +43,7 @@ public:
virtual bool isPasswordField() const = 0;
virtual bool isSearchField() const = 0;
virtual bool isTextField() const = 0;
+ virtual bool supportsMaxLength() const = 0;
virtual bool hasSpinButton() const { return false; }
#if ENABLE(INPUT_SPEECH)
virtual bool isSpeechEnabled() const = 0;
@@ -78,9 +79,11 @@ protected:
static void setValueFromRenderer(InputElementData&, InputElement*, Element*, const String&);
// Replaces CRs and LFs, shrinks the value for s_maximumLength.
// This should be applied to values from the HTML value attribute and the DOM value property.
- static String sanitizeValue(const InputElement*, const String&);
+ // This function should be called only by sanitizeValue() implementations.
+ static String sanitizeValueForTextField(const InputElement*, const String&);
// Replaces CRs and LFs, shrinks the value for the specified maximum length.
// This should be applied to values specified by users.
+ // The input string may be a fragment of the whole value.
static String sanitizeUserInputValue(const InputElement*, const String&, int);
static void handleBeforeTextInsertedEvent(InputElementData&, InputElement*, Element*, Event*);
static void parseSizeAttribute(InputElementData&, Element*, Attribute*);
diff --git a/WebCore/dom/ScriptElement.cpp b/WebCore/dom/ScriptElement.cpp
index 518aead..dab8f8c 100644
--- a/WebCore/dom/ScriptElement.cpp
+++ b/WebCore/dom/ScriptElement.cpp
@@ -27,6 +27,7 @@
#include "CachedScript.h"
#include "DocLoader.h"
#include "Document.h"
+#include "DocumentParser.h"
#include "Frame.h"
#include "FrameLoader.h"
#include "HTMLNames.h"
@@ -53,6 +54,16 @@ void ScriptElement::insertedIntoDocument(ScriptElementData& data, const String&
if (data.createdByParser())
return;
+ // http://www.whatwg.org/specs/web-apps/current-work/#script
+
+ // If the element's Document has an active parser, and the parser's script
+ // nesting level is non-zero, but this script element does not have the
+ // "parser-inserted" flag set, the user agent must set the element's
+ // "write-neutralised" flag.
+ DocumentParser* parser = data.element()->document()->parser();
+ if (parser && parser->hasInsertionPoint())
+ data.setWriteDisabled(true);
+
if (!sourceUrl.isEmpty()) {
data.requestScript(sourceUrl);
return;
@@ -84,13 +95,6 @@ void ScriptElement::childrenChanged(ScriptElementData& data)
data.evaluateScript(ScriptSourceCode(data.scriptContent(), element->document()->url())); // FIXME: Provide a real starting line number here
}
-static inline bool useHTML5Parser(Document* document)
-{
- ASSERT(document);
- Settings* settings = document->page() ? document->page()->settings() : 0;
- return settings && settings->html5ParserEnabled();
-}
-
void ScriptElement::finishParsingChildren(ScriptElementData& data, const String& sourceUrl)
{
// The parser just reached </script>. If we have no src and no text,
@@ -137,6 +141,7 @@ ScriptElementData::ScriptElementData(ScriptElement* scriptElement, Element* elem
, m_element(element)
, m_cachedScript(0)
, m_createdByParser(false)
+ , m_writeDisabled(false)
, m_requested(false)
, m_evaluated(false)
, m_firedLoad(false)
@@ -191,7 +196,29 @@ void ScriptElementData::evaluateScript(const ScriptSourceCode& sourceCode)
m_evaluated = true;
+ // http://www.whatwg.org/specs/web-apps/current-work/#script
+
+ // If the script element's "write-neutralised" flag is set, then flag
+ // the Document the script element was in when the "write-neutralised"
+ // flag was set as being itself "write-neutralised". Let neutralised doc
+ // be that Document.
+ if (m_writeDisabled) {
+ ASSERT(!m_element->document()->writeDisabled());
+ m_element->document()->setWriteDisabled(true);
+ }
+
+ // Create a script from the script element node, using the script
+ // block's source and the script block's type.
+ // Note: This is where the script is compiled and actually executed.
frame->script()->evaluate(sourceCode);
+
+ // Remove the "write-neutralised" flag from neutralised doc, if it was
+ // set in the earlier step.
+ if (m_writeDisabled) {
+ ASSERT(m_element->document()->writeDisabled());
+ m_element->document()->setWriteDisabled(false);
+ }
+
Document::updateStyleForAllDocuments();
}
}
diff --git a/WebCore/dom/ScriptElement.h b/WebCore/dom/ScriptElement.h
index c663e43..698ffbc 100644
--- a/WebCore/dom/ScriptElement.h
+++ b/WebCore/dom/ScriptElement.h
@@ -82,6 +82,8 @@ public:
Element* element() const { return m_element; }
bool createdByParser() const { return m_createdByParser; }
void setCreatedByParser(bool value) { m_createdByParser = value; }
+ bool writeDisabled() const { return m_writeDisabled; }
+ void setWriteDisabled(bool value) { m_writeDisabled = value; }
bool haveFiredLoadEvent() const { return m_firedLoad; }
void setHaveFiredLoadEvent(bool firedLoad) { m_firedLoad = firedLoad; }
@@ -99,6 +101,7 @@ private:
Element* m_element;
CachedResourceHandle<CachedScript> m_cachedScript;
bool m_createdByParser; // HTML5: "parser-inserted"
+ bool m_writeDisabled; // http://www.whatwg.org/specs/web-apps/current-work/#write-neutralised
bool m_requested;
bool m_evaluated; // HTML5: "already started"
bool m_firedLoad;
diff --git a/WebCore/dom/UserTypingGestureIndicator.cpp b/WebCore/dom/UserTypingGestureIndicator.cpp
new file mode 100644
index 0000000..5120843
--- /dev/null
+++ b/WebCore/dom/UserTypingGestureIndicator.cpp
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2010 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "UserTypingGestureIndicator.h"
+
+#include "Frame.h"
+#include "Node.h"
+#include <wtf/StdLibExtras.h>
+
+namespace WebCore {
+
+static bool s_processingUserTypingGesture;
+bool UserTypingGestureIndicator::processingUserTypingGesture()
+{
+ return s_processingUserTypingGesture;
+}
+
+static RefPtr<Node>& focusedNode()
+{
+ DEFINE_STATIC_LOCAL(RefPtr<Node>, node, ());
+ return node;
+}
+
+Node* UserTypingGestureIndicator::focusedElementAtGestureStart()
+{
+ return focusedNode().get();
+}
+
+UserTypingGestureIndicator::UserTypingGestureIndicator(Frame* frame)
+ : m_previousProcessingUserTypingGesture(s_processingUserTypingGesture)
+ , m_previousFocusedNode(focusedNode())
+{
+ s_processingUserTypingGesture = true;
+ focusedNode() = frame->document() ? frame->document()->focusedNode() : 0;
+}
+
+UserTypingGestureIndicator::~UserTypingGestureIndicator()
+{
+ s_processingUserTypingGesture = m_previousProcessingUserTypingGesture;
+ focusedNode() = m_previousFocusedNode;
+}
+
+} // namespace WebCore
diff --git a/WebCore/dom/UserTypingGestureIndicator.h b/WebCore/dom/UserTypingGestureIndicator.h
new file mode 100644
index 0000000..6c71079
--- /dev/null
+++ b/WebCore/dom/UserTypingGestureIndicator.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#ifndef UserTypingGestureIndicator_h
+#define UserTypingGestureIndicator_h
+
+#include <wtf/Noncopyable.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class Frame;
+class Node;
+
+class UserTypingGestureIndicator : public Noncopyable {
+public:
+ static bool processingUserTypingGesture();
+ static Node* focusedElementAtGestureStart();
+
+ explicit UserTypingGestureIndicator(Frame*);
+ ~UserTypingGestureIndicator();
+
+private:
+ bool m_previousProcessingUserTypingGesture;
+ RefPtr<Node> m_previousFocusedNode;
+};
+
+} // namespace WebCore
+
+#endif // UserTypingGestureIndicator_h
diff --git a/WebCore/editing/ApplyStyleCommand.cpp b/WebCore/editing/ApplyStyleCommand.cpp
index c50c988..8847714 100644
--- a/WebCore/editing/ApplyStyleCommand.cpp
+++ b/WebCore/editing/ApplyStyleCommand.cpp
@@ -684,13 +684,14 @@ void ApplyStyleCommand::applyRelativeFontStyleChange(CSSMutableStyleDeclaration
}
// Split the start text nodes if needed to apply style.
- bool splitStart = splitTextAtStartIfNeeded(start, end);
- if (splitStart) {
+ if (isValidCaretPositionInTextNode(start)) {
+ splitTextAtStart(start, end);
start = startPosition();
end = endPosition();
}
- bool splitEnd = splitTextAtEndIfNeeded(start, end);
- if (splitEnd) {
+
+ if (isValidCaretPositionInTextNode(end)) {
+ splitTextAtEnd(start, end);
start = startPosition();
end = endPosition();
}
@@ -907,16 +908,18 @@ void ApplyStyleCommand::applyInlineStyle(CSSMutableStyleDeclaration *style)
}
// split the start node and containing element if the selection starts inside of it
- bool splitStart = splitTextElementAtStartIfNeeded(start, end);
+ bool splitStart = isValidCaretPositionInTextNode(start);
if (splitStart) {
+ splitTextElementAtStart(start, end);
start = startPosition();
end = endPosition();
startDummySpanAncestor = dummySpanAncestorForNode(start.node());
}
// split the end node and containing element if the selection ends inside of it
- bool splitEnd = splitTextElementAtEndIfNeeded(start, end);
+ bool splitEnd = isValidCaretPositionInTextNode(end);
if (splitEnd) {
+ splitTextElementAtEnd(start, end);
start = startPosition();
end = endPosition();
endDummySpanAncestor = dummySpanAncestorForNode(end.node());
@@ -1529,62 +1532,61 @@ bool ApplyStyleCommand::nodeFullyUnselected(Node *node, const Position &start, c
return isFullyBeforeStart || isFullyAfterEnd;
}
-
-bool ApplyStyleCommand::splitTextAtStartIfNeeded(const Position &start, const Position &end)
+void ApplyStyleCommand::splitTextAtStart(const Position& start, const Position& end)
{
- if (start.node()->isTextNode() && start.deprecatedEditingOffset() > caretMinOffset(start.node()) && start.deprecatedEditingOffset() < caretMaxOffset(start.node())) {
- int endOffsetAdjustment = start.node() == end.node() ? start.deprecatedEditingOffset() : 0;
- Text *text = static_cast<Text *>(start.node());
- splitTextNode(text, start.deprecatedEditingOffset());
- updateStartEnd(Position(start.node(), 0), Position(end.node(), end.deprecatedEditingOffset() - endOffsetAdjustment));
- return true;
- }
- return false;
+ int endOffsetAdjustment = start.node() == end.node() ? start.deprecatedEditingOffset() : 0;
+ Text* text = static_cast<Text*>(start.node());
+ splitTextNode(text, start.deprecatedEditingOffset());
+ updateStartEnd(Position(start.node(), 0), Position(end.node(), end.deprecatedEditingOffset() - endOffsetAdjustment));
}
-bool ApplyStyleCommand::splitTextAtEndIfNeeded(const Position &start, const Position &end)
+void ApplyStyleCommand::splitTextAtEnd(const Position& start, const Position& end)
{
- if (end.node()->isTextNode() && end.deprecatedEditingOffset() > caretMinOffset(end.node()) && end.deprecatedEditingOffset() < caretMaxOffset(end.node())) {
- Text *text = static_cast<Text *>(end.node());
- splitTextNode(text, end.deprecatedEditingOffset());
-
- Node *prevNode = text->previousSibling();
- ASSERT(prevNode);
- Node *startNode = start.node() == end.node() ? prevNode : start.node();
- ASSERT(startNode);
- updateStartEnd(Position(startNode, start.deprecatedEditingOffset()), Position(prevNode, caretMaxOffset(prevNode)));
- return true;
- }
- return false;
+ Text* text = static_cast<Text *>(end.node());
+ splitTextNode(text, end.deprecatedEditingOffset());
+
+ Node* prevNode = text->previousSibling();
+ ASSERT(prevNode);
+ Node* startNode = start.node() == end.node() ? prevNode : start.node();
+ ASSERT(startNode);
+ updateStartEnd(Position(startNode, start.deprecatedEditingOffset()), Position(prevNode, caretMaxOffset(prevNode)));
}
-bool ApplyStyleCommand::splitTextElementAtStartIfNeeded(const Position &start, const Position &end)
+void ApplyStyleCommand::splitTextElementAtStart(const Position& start, const Position& end)
{
- if (start.node()->isTextNode() && start.deprecatedEditingOffset() > caretMinOffset(start.node()) && start.deprecatedEditingOffset() < caretMaxOffset(start.node())) {
- int endOffsetAdjustment = start.node() == end.node() ? start.deprecatedEditingOffset() : 0;
- Text *text = static_cast<Text *>(start.node());
- splitTextNodeContainingElement(text, start.deprecatedEditingOffset());
+ Node* parent = start.node()->parentNode();
+ if (!parent || !parent->parentElement() || !parent->parentElement()->isContentEditable())
+ return splitTextAtStart(start, end);
- updateStartEnd(Position(start.node()->parentNode(), start.node()->nodeIndex()), Position(end.node(), end.deprecatedEditingOffset() - endOffsetAdjustment));
- return true;
- }
- return false;
+ int endOffsetAdjustment = start.node() == end.node() ? start.deprecatedEditingOffset() : 0;
+ Text* text = static_cast<Text*>(start.node());
+ splitTextNodeContainingElement(text, start.deprecatedEditingOffset());
+ updateStartEnd(Position(start.node()->parentNode(), start.node()->nodeIndex()), Position(end.node(), end.deprecatedEditingOffset() - endOffsetAdjustment));
}
-bool ApplyStyleCommand::splitTextElementAtEndIfNeeded(const Position &start, const Position &end)
+void ApplyStyleCommand::splitTextElementAtEnd(const Position& start, const Position& end)
{
- if (end.node()->isTextNode() && end.deprecatedEditingOffset() > caretMinOffset(end.node()) && end.deprecatedEditingOffset() < caretMaxOffset(end.node())) {
- Text *text = static_cast<Text *>(end.node());
- splitTextNodeContainingElement(text, end.deprecatedEditingOffset());
+ Node* parent = end.node()->parentNode();
+ if (!parent || !parent->parentElement() || !parent->parentElement()->isContentEditable())
+ return splitTextAtEnd(start, end);
- Node *prevNode = text->parent()->previousSibling()->lastChild();
- ASSERT(prevNode);
- Node *startNode = start.node() == end.node() ? prevNode : start.node();
- ASSERT(startNode);
- updateStartEnd(Position(startNode, start.deprecatedEditingOffset()), Position(prevNode->parent(), prevNode->nodeIndex() + 1));
- return true;
- }
- return false;
+ Text* text = static_cast<Text*>(end.node());
+ splitTextNodeContainingElement(text, end.deprecatedEditingOffset());
+
+ Node* prevNode = text->parent()->previousSibling()->lastChild();
+ ASSERT(prevNode);
+ Node* startNode = start.node() == end.node() ? prevNode : start.node();
+ ASSERT(startNode);
+ updateStartEnd(Position(startNode, start.deprecatedEditingOffset()), Position(prevNode->parent(), prevNode->nodeIndex() + 1));
+}
+
+bool ApplyStyleCommand::isValidCaretPositionInTextNode(const Position& position)
+{
+ Node* node = position.node();
+ if (!node->isTextNode())
+ return false;
+ int offsetInText = position.deprecatedEditingOffset();
+ return (offsetInText > caretMinOffset(node) && offsetInText < caretMaxOffset(node));
}
static bool areIdenticalElements(Node *first, Node *second)
diff --git a/WebCore/editing/ApplyStyleCommand.h b/WebCore/editing/ApplyStyleCommand.h
index 8326329..199b9db 100644
--- a/WebCore/editing/ApplyStyleCommand.h
+++ b/WebCore/editing/ApplyStyleCommand.h
@@ -91,10 +91,11 @@ private:
void applyInlineStyleToRange(CSSMutableStyleDeclaration*, const Position& start, const Position& end);
void addBlockStyle(const StyleChange&, HTMLElement*);
void addInlineStyleIfNeeded(CSSMutableStyleDeclaration*, Node* start, Node* end);
- bool splitTextAtStartIfNeeded(const Position& start, const Position& end);
- bool splitTextAtEndIfNeeded(const Position& start, const Position& end);
- bool splitTextElementAtStartIfNeeded(const Position& start, const Position& end);
- bool splitTextElementAtEndIfNeeded(const Position& start, const Position& end);
+ void splitTextAtStart(const Position& start, const Position& end);
+ void splitTextAtEnd(const Position& start, const Position& end);
+ void splitTextElementAtStart(const Position& start, const Position& end);
+ void splitTextElementAtEnd(const Position& start, const Position& end);
+ bool isValidCaretPositionInTextNode(const Position& position);
bool mergeStartWithPreviousIfIdentical(const Position& start, const Position& end);
bool mergeEndWithNextIfIdentical(const Position& start, const Position& end);
void cleanupUnstyledAppleStyleSpans(Node* dummySpanAncestor);
diff --git a/WebCore/editing/CompositeEditCommand.cpp b/WebCore/editing/CompositeEditCommand.cpp
index 41d6758..c5a8959 100644
--- a/WebCore/editing/CompositeEditCommand.cpp
+++ b/WebCore/editing/CompositeEditCommand.cpp
@@ -1009,7 +1009,8 @@ bool CompositeEditCommand::breakOutOfEmptyListItem()
// FIXME: Can't we do something better when the immediate parent wasn't a list node?
if (!listNode
|| (!listNode->hasTagName(ulTag) && !listNode->hasTagName(olTag))
- || !listNode->isContentEditable())
+ || !listNode->isContentEditable()
+ || listNode == emptyListItem->rootEditableElement())
return false;
RefPtr<Element> newBlock = 0;
diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
index 773ed90..44d8d5f 100644
--- a/WebCore/editing/Editor.cpp
+++ b/WebCore/editing/Editor.cpp
@@ -68,6 +68,7 @@
#include "Text.h"
#include "TextIterator.h"
#include "TypingCommand.h"
+#include "UserTypingGestureIndicator.h"
#include "htmlediting.h"
#include "markup.h"
#include "visible_units.h"
@@ -712,7 +713,7 @@ bool Editor::dispatchCPPEvent(const AtomicString &eventType, ClipboardAccessPoli
return true;
target = target->shadowAncestorNode();
- RefPtr<Clipboard> clipboard = newGeneralClipboard(policy);
+ RefPtr<Clipboard> clipboard = newGeneralClipboard(policy, m_frame);
ExceptionCode ec = 0;
RefPtr<Event> evt = ClipboardEvent::create(eventType, true, true, clipboard);
@@ -1370,6 +1371,8 @@ void Editor::confirmComposition(const String& text)
void Editor::confirmComposition(const String& text, bool preserveSelection)
{
+ UserTypingGestureIndicator typingGestureIndicator(m_frame);
+
setIgnoreCompositionSelectionChange(true);
VisibleSelection oldSelection = m_frame->selection()->selection();
@@ -1412,6 +1415,8 @@ void Editor::confirmComposition(const String& text, bool preserveSelection)
void Editor::setComposition(const String& text, const Vector<CompositionUnderline>& underlines, unsigned selectionStart, unsigned selectionEnd)
{
+ UserTypingGestureIndicator typingGestureIndicator(m_frame);
+
setIgnoreCompositionSelectionChange(true);
selectComposition();
diff --git a/WebCore/editing/Editor.h b/WebCore/editing/Editor.h
index cd1b204..db249e7 100644
--- a/WebCore/editing/Editor.h
+++ b/WebCore/editing/Editor.h
@@ -42,6 +42,7 @@ class DeleteButtonController;
class EditCommand;
class EditorClient;
class EditorInternalCommand;
+class Frame;
class HTMLElement;
class HitTestResult;
class KillRing;
@@ -309,7 +310,7 @@ private:
bool canDeleteRange(Range*) const;
bool canSmartReplaceWithPasteboard(Pasteboard*);
- PassRefPtr<Clipboard> newGeneralClipboard(ClipboardAccessPolicy);
+ PassRefPtr<Clipboard> newGeneralClipboard(ClipboardAccessPolicy, Frame*);
void pasteAsPlainTextWithPasteboard(Pasteboard*);
void pasteWithPasteboard(Pasteboard*, bool allowPlainText);
void replaceSelectionWithFragment(PassRefPtr<DocumentFragment>, bool selectReplacement, bool smartReplace, bool matchStyle);
diff --git a/WebCore/editing/InsertListCommand.cpp b/WebCore/editing/InsertListCommand.cpp
index 06162c9..8f9c0de 100644
--- a/WebCore/editing/InsertListCommand.cpp
+++ b/WebCore/editing/InsertListCommand.cpp
@@ -150,6 +150,14 @@ void InsertListCommand::doApplyForSingleParagraph(bool forceCreateList)
m_listElement = listifyParagraph(endingSelection().visibleStart(), listTag);
}
+static Node* enclosingListChild(Node* node, Node* listNode)
+{
+ Node* listChild = enclosingListChild(node);
+ if (enclosingList(listChild) != listNode)
+ return 0;
+ return listChild;
+}
+
void InsertListCommand::unlistifyParagraph(const VisiblePosition& originalStart, HTMLElement* listNode, Node* listChildNode)
{
Node* nextListChild;
@@ -165,14 +173,10 @@ void InsertListCommand::unlistifyParagraph(const VisiblePosition& originalStart,
// A paragraph is visually a list item minus a list marker. The paragraph will be moved.
start = startOfParagraph(originalStart);
end = endOfParagraph(start);
- nextListChild = enclosingListChild(end.next().deepEquivalent().node());
+ nextListChild = enclosingListChild(end.next().deepEquivalent().node(), listNode);
ASSERT(nextListChild != listChildNode);
- if (enclosingList(nextListChild) != listNode)
- nextListChild = 0;
- previousListChild = enclosingListChild(start.previous().deepEquivalent().node());
+ previousListChild = enclosingListChild(start.previous().deepEquivalent().node(), listNode);
ASSERT(previousListChild != listChildNode);
- if (enclosingList(previousListChild) != listNode)
- previousListChild = 0;
}
// When removing a list, we must always create a placeholder to act as a point of insertion
// for the list content being removed.
@@ -210,28 +214,37 @@ void InsertListCommand::unlistifyParagraph(const VisiblePosition& originalStart,
moveParagraphs(start, end, insertionPoint, true);
}
+static Element* adjacentEnclosingList(const VisiblePosition& pos, const VisiblePosition& adjacentPos, const QualifiedName& listTag)
+{
+ Element* listNode = outermostEnclosingList(adjacentPos.deepEquivalent().node());
+
+ if (!listNode)
+ return 0;
+
+ Node* previousCell = enclosingTableCell(pos.deepEquivalent());
+ Node* currentCell = enclosingTableCell(adjacentPos.deepEquivalent());
+
+ if (!listNode->hasTagName(listTag)
+ || listNode->contains(pos.deepEquivalent().node())
+ || previousCell != currentCell)
+ return 0;
+
+ return listNode;
+}
+
PassRefPtr<HTMLElement> InsertListCommand::listifyParagraph(const VisiblePosition& originalStart, const QualifiedName& listTag)
{
VisiblePosition start = startOfParagraph(originalStart);
VisiblePosition end = endOfParagraph(start);
// Check for adjoining lists.
- VisiblePosition previousPosition = start.previous(true);
- VisiblePosition nextPosition = end.next(true);
RefPtr<HTMLElement> listItemElement = createListItemElement(document());
RefPtr<HTMLElement> placeholder = createBreakElement(document());
appendNode(placeholder, listItemElement);
- Element* previousList = outermostEnclosingList(previousPosition.deepEquivalent().node());
- Element* nextList = outermostEnclosingList(nextPosition.deepEquivalent().node());
- Node* startNode = start.deepEquivalent().node();
- Node* previousCell = enclosingTableCell(previousPosition.deepEquivalent());
- Node* nextCell = enclosingTableCell(nextPosition.deepEquivalent());
- Node* currentCell = enclosingTableCell(start.deepEquivalent());
- if (previousList && (!previousList->hasTagName(listTag) || startNode->isDescendantOf(previousList) || previousCell != currentCell))
- previousList = 0;
- if (nextList && (!nextList->hasTagName(listTag) || startNode->isDescendantOf(nextList) || nextCell != currentCell))
- nextList = 0;
+
// Place list item into adjoining lists.
+ Element* previousList = adjacentEnclosingList(start.deepEquivalent(), start.previous(true), listTag);
+ Element* nextList = adjacentEnclosingList(start.deepEquivalent(), end.next(true), listTag);
RefPtr<HTMLElement> listElement;
if (previousList)
appendNode(listItemElement, previousList);
@@ -268,8 +281,6 @@ PassRefPtr<HTMLElement> InsertListCommand::listifyParagraph(const VisiblePositio
// Update the start of content, so we don't try to move the list into itself. bug 19066
if (insertionPos == start.deepEquivalent())
start = startOfParagraph(originalStart);
- previousList = outermostEnclosingList(previousPosition.deepEquivalent().node(), enclosingList(listElement.get()));
- nextList = outermostEnclosingList(nextPosition.deepEquivalent().node(), enclosingList(listElement.get()));
}
moveParagraph(start, end, VisiblePosition(Position(placeholder.get(), 0)), true);
@@ -281,6 +292,8 @@ PassRefPtr<HTMLElement> InsertListCommand::listifyParagraph(const VisiblePositio
listElement = m_listElement;
if (listElement) {
+ previousList = listElement->previousElementSibling();
+ nextList = listElement->nextElementSibling();
if (canMergeLists(previousList, listElement.get()))
mergeIdenticalElements(previousList, listElement.get());
if (canMergeLists(listElement.get(), nextList))
diff --git a/WebCore/editing/SplitTextNodeCommand.cpp b/WebCore/editing/SplitTextNodeCommand.cpp
index 15daa49..9a7e3b3 100644
--- a/WebCore/editing/SplitTextNodeCommand.cpp
+++ b/WebCore/editing/SplitTextNodeCommand.cpp
@@ -54,21 +54,15 @@ void SplitTextNodeCommand::doApply()
return;
ExceptionCode ec = 0;
-
String prefixText = m_text2->substringData(0, m_offset, ec);
if (prefixText.isEmpty())
return;
- RefPtr<Text> prefixTextNode = Text::create(document(), prefixText);
- ASSERT(prefixTextNode);
- document()->copyMarkers(m_text2.get(), 0, m_offset, prefixTextNode.get(), 0);
+ m_text1 = Text::create(document(), prefixText);
+ ASSERT(m_text1);
+ document()->copyMarkers(m_text2.get(), 0, m_offset, m_text1.get(), 0);
- parent->insertBefore(prefixTextNode.get(), m_text2.get(), ec);
- if (ec)
- return;
-
- m_text2->deleteData(0, m_offset, ec);
- m_text1 = prefixTextNode.release();
+ insertText1AndTrimText2();
}
void SplitTextNodeCommand::doUnapply()
@@ -78,16 +72,35 @@ void SplitTextNodeCommand::doUnapply()
ASSERT(m_text1->document() == document());
- RefPtr<Text> prefixTextNode = m_text1.release();
- String prefixText = prefixTextNode->data();
+ String prefixText = m_text1->data();
ExceptionCode ec = 0;
m_text2->insertData(0, prefixText, ec);
- if (ec)
+ ASSERT(!ec);
+
+ document()->copyMarkers(m_text1.get(), 0, prefixText.length(), m_text2.get(), 0);
+ m_text1->remove(ec);
+}
+
+void SplitTextNodeCommand::doReapply()
+{
+ if (!m_text1 || !m_text2)
return;
- document()->copyMarkers(prefixTextNode.get(), 0, prefixText.length(), m_text2.get(), 0);
- prefixTextNode->remove(ec);
+ Node* parent = m_text2->parentNode();
+ if (!parent || !parent->isContentEditable())
+ return;
+
+ insertText1AndTrimText2();
}
+void SplitTextNodeCommand::insertText1AndTrimText2()
+{
+ ExceptionCode ec = 0;
+ m_text2->parentNode()->insertBefore(m_text1.get(), m_text2.get(), ec);
+ if (ec)
+ return;
+ m_text2->deleteData(0, m_offset, ec);
+}
+
} // namespace WebCore
diff --git a/WebCore/editing/SplitTextNodeCommand.h b/WebCore/editing/SplitTextNodeCommand.h
index 48d444c..8d67d82 100644
--- a/WebCore/editing/SplitTextNodeCommand.h
+++ b/WebCore/editing/SplitTextNodeCommand.h
@@ -44,6 +44,8 @@ private:
virtual void doApply();
virtual void doUnapply();
+ virtual void doReapply();
+ void insertText1AndTrimText2();
RefPtr<Text> m_text1;
RefPtr<Text> m_text2;
diff --git a/WebCore/editing/SplitTextNodeContainingElementCommand.cpp b/WebCore/editing/SplitTextNodeContainingElementCommand.cpp
index e716c72..8c90fb0 100644
--- a/WebCore/editing/SplitTextNodeContainingElementCommand.cpp
+++ b/WebCore/editing/SplitTextNodeContainingElementCommand.cpp
@@ -48,7 +48,7 @@ void SplitTextNodeContainingElementCommand::doApply()
splitTextNode(m_text.get(), m_offset);
Element* parent = m_text->parentElement();
- if (!parent)
+ if (!parent || !parent->parentElement() || !parent->parentElement()->isContentEditable())
return;
RenderObject* parentRenderer = parent->renderer();
diff --git a/WebCore/editing/android/EditorAndroid.cpp b/WebCore/editing/android/EditorAndroid.cpp
index 8e00326..61cce01 100644
--- a/WebCore/editing/android/EditorAndroid.cpp
+++ b/WebCore/editing/android/EditorAndroid.cpp
@@ -31,7 +31,7 @@
namespace WebCore {
-PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy)
+PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
{
return new ClipboardAndroid(policy, false);
}
diff --git a/WebCore/editing/brew/EditorBrew.cpp b/WebCore/editing/brew/EditorBrew.cpp
index b610b62..4a1f4d7 100644
--- a/WebCore/editing/brew/EditorBrew.cpp
+++ b/WebCore/editing/brew/EditorBrew.cpp
@@ -31,7 +31,7 @@
namespace WebCore {
-PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy)
+PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
{
return new ClipboardBrew(policy, false);
}
diff --git a/WebCore/editing/chromium/EditorChromium.cpp b/WebCore/editing/chromium/EditorChromium.cpp
index 1ea085b..7a13b12 100644
--- a/WebCore/editing/chromium/EditorChromium.cpp
+++ b/WebCore/editing/chromium/EditorChromium.cpp
@@ -33,12 +33,13 @@
#include "ChromiumDataObject.h"
#include "ClipboardChromium.h"
+#include "Frame.h"
namespace WebCore {
-PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy)
+PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame* frame)
{
- return ClipboardChromium::create(false, ChromiumDataObject::create(), policy);
+ return ClipboardChromium::create(false, ChromiumDataObject::create(), policy, frame);
}
} // namespace WebCore
diff --git a/WebCore/editing/haiku/EditorHaiku.cpp b/WebCore/editing/haiku/EditorHaiku.cpp
index 723d4ff..4596c9e 100644
--- a/WebCore/editing/haiku/EditorHaiku.cpp
+++ b/WebCore/editing/haiku/EditorHaiku.cpp
@@ -35,7 +35,7 @@
namespace WebCore {
-PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy)
+PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
{
return ClipboardHaiku::create(policy, false);
}
diff --git a/WebCore/editing/mac/EditorMac.mm b/WebCore/editing/mac/EditorMac.mm
index ca001a2..2c5a602 100644
--- a/WebCore/editing/mac/EditorMac.mm
+++ b/WebCore/editing/mac/EditorMac.mm
@@ -33,9 +33,9 @@
namespace WebCore {
-PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy)
+PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame* frame)
{
- return ClipboardMac::create(false, [NSPasteboard generalPasteboard], policy, 0);
+ return ClipboardMac::create(false, [NSPasteboard generalPasteboard], policy, frame);
}
void Editor::showFontPanel()
diff --git a/WebCore/editing/qt/EditorQt.cpp b/WebCore/editing/qt/EditorQt.cpp
index e74e2f3..7fb3634 100644
--- a/WebCore/editing/qt/EditorQt.cpp
+++ b/WebCore/editing/qt/EditorQt.cpp
@@ -39,7 +39,7 @@
namespace WebCore {
-PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy)
+PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
{
return ClipboardQt::create(policy);
}
diff --git a/WebCore/editing/visible_units.cpp b/WebCore/editing/visible_units.cpp
index c094aac..dd48406 100644
--- a/WebCore/editing/visible_units.cpp
+++ b/WebCore/editing/visible_units.cpp
@@ -377,9 +377,9 @@ static VisiblePosition positionAvoidingFirstPositionInTable(const VisiblePositio
{
// return table offset 0 instead of the first VisiblePosition inside the table
VisiblePosition previous = c.previous();
- if (isLastPositionBeforeTable(previous))
+ if (isLastPositionBeforeTable(previous) && isEditablePosition(previous.deepEquivalent()))
return previous;
-
+
return c;
}
diff --git a/WebCore/editing/wx/EditorWx.cpp b/WebCore/editing/wx/EditorWx.cpp
index cb9e836..a2ec654 100644
--- a/WebCore/editing/wx/EditorWx.cpp
+++ b/WebCore/editing/wx/EditorWx.cpp
@@ -31,7 +31,7 @@
namespace WebCore {
-PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy)
+PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
{
return ClipboardWx::create(policy, true);
}
diff --git a/WebCore/history/PageCache.cpp b/WebCore/history/PageCache.cpp
index 7719187..228f7ea 100644
--- a/WebCore/history/PageCache.cpp
+++ b/WebCore/history/PageCache.cpp
@@ -269,7 +269,7 @@ bool PageCache::canCachePageContainingThisFrame(Frame* frame)
#endif
#if ENABLE(WML)
&& !frame->document()->containsWMLContent()
- && !frame->document()->isWMLDocument();
+ && !frame->document()->isWMLDocument()
#endif
&& frame->loader()->client()->canCachePage();
}
diff --git a/WebCore/html/Blob.cpp b/WebCore/html/Blob.cpp
index 0680d82..a41fb2e 100644
--- a/WebCore/html/Blob.cpp
+++ b/WebCore/html/Blob.cpp
@@ -36,19 +36,19 @@
namespace WebCore {
-Blob::Blob(const String& type, const BlobItemList& items)
+Blob::Blob(ScriptExecutionContext*, const String& type, const BlobItemList& items)
: m_type(type)
{
for (size_t i = 0; i < items.size(); ++i)
m_items.append(items[i]);
}
-Blob::Blob(const PassRefPtr<BlobItem>& item)
+Blob::Blob(ScriptExecutionContext*, const PassRefPtr<BlobItem>& item)
{
m_items.append(item);
}
-Blob::Blob(const String& path)
+Blob::Blob(ScriptExecutionContext*, const String& path)
{
// Note: this doesn't initialize the type unlike File(path).
m_items.append(FileBlobItem::create(path));
@@ -71,7 +71,7 @@ const String& Blob::path() const
}
#if ENABLE(BLOB_SLICE)
-PassRefPtr<Blob> Blob::slice(long long start, long long length, const String& contentType) const
+PassRefPtr<Blob> Blob::slice(ScriptExecutionContext* scriptExecutionContext, long long start, long long length, const String& contentType) const
{
if (start < 0)
start = 0;
@@ -95,7 +95,7 @@ PassRefPtr<Blob> Blob::slice(long long start, long long length, const String& co
length -= items.last()->size();
start = 0;
}
- return Blob::create(contentType, items);
+ return Blob::create(scriptExecutionContext, contentType, items);
}
#endif // ENABLE(BLOB_SLICE)
diff --git a/WebCore/html/Blob.h b/WebCore/html/Blob.h
index f5526c7..12ccca7 100644
--- a/WebCore/html/Blob.h
+++ b/WebCore/html/Blob.h
@@ -39,19 +39,21 @@
namespace WebCore {
+class ScriptExecutionContext;
+
class Blob : public RefCounted<Blob> {
public:
- static PassRefPtr<Blob> create(const String& type, const BlobItemList& items)
+ static PassRefPtr<Blob> create(ScriptExecutionContext* scriptExecutionContext, const String& type, const BlobItemList& items)
{
- return adoptRef(new Blob(type, items));
+ return adoptRef(new Blob(scriptExecutionContext, type, items));
}
// FIXME: Deprecated method. This is called only from
// bindings/v8/SerializedScriptValue.cpp and the usage in it will become invalid once
// BlobBuilder is introduced.
- static PassRefPtr<Blob> create(const String& path)
+ static PassRefPtr<Blob> create(ScriptExecutionContext* scriptExecutionContext, const String& path)
{
- return adoptRef(new Blob(path));
+ return adoptRef(new Blob(scriptExecutionContext, path));
}
virtual ~Blob() { }
@@ -66,15 +68,15 @@ public:
const BlobItemList& items() const { return m_items; }
#if ENABLE(BLOB_SLICE)
- PassRefPtr<Blob> slice(long long start, long long length, const String& contentType = String()) const;
+ PassRefPtr<Blob> slice(ScriptExecutionContext*, long long start, long long length, const String& contentType = String()) const;
#endif
protected:
- Blob(const String& type, const BlobItemList&);
- Blob(const PassRefPtr<BlobItem>&);
+ Blob(ScriptExecutionContext*, const String& type, const BlobItemList&);
+ Blob(ScriptExecutionContext*, const PassRefPtr<BlobItem>&);
// FIXME: Deprecated constructor. See also the comment for Blob::create(path).
- Blob(const String& path);
+ Blob(ScriptExecutionContext*, const String& path);
BlobItemList m_items;
String m_type;
diff --git a/WebCore/html/Blob.idl b/WebCore/html/Blob.idl
index 0ae2759..626bb73 100644
--- a/WebCore/html/Blob.idl
+++ b/WebCore/html/Blob.idl
@@ -34,8 +34,10 @@ module html {
readonly attribute unsigned long long size;
readonly attribute DOMString type;
+#if !defined(LANGUAGE_OBJECTIVE_C)
#if defined(ENABLE_BLOB_SLICE) && ENABLE_BLOB_SLICE
- Blob slice(in long long start, in long long length, in [Optional, ConvertUndefinedOrNullToNullString] DOMString contentType);
+ [CallWith=ScriptExecutionContext] Blob slice(in long long start, in long long length, in [Optional, ConvertUndefinedOrNullToNullString] DOMString contentType);
+#endif
#endif
};
diff --git a/WebCore/html/BlobBuilder.cpp b/WebCore/html/BlobBuilder.cpp
index b2684fc..0592ff0 100644
--- a/WebCore/html/BlobBuilder.cpp
+++ b/WebCore/html/BlobBuilder.cpp
@@ -81,9 +81,9 @@ bool BlobBuilder::append(PassRefPtr<Blob> blob)
return false;
}
-PassRefPtr<Blob> BlobBuilder::getBlob(const String& contentType) const
+PassRefPtr<Blob> BlobBuilder::getBlob(ScriptExecutionContext* scriptExecutionContext, const String& contentType) const
{
- return Blob::create(contentType, m_items);
+ return Blob::create(scriptExecutionContext, contentType, m_items);
}
} // namespace WebCore
diff --git a/WebCore/html/BlobBuilder.h b/WebCore/html/BlobBuilder.h
index 1173c04..5d1700f 100644
--- a/WebCore/html/BlobBuilder.h
+++ b/WebCore/html/BlobBuilder.h
@@ -38,6 +38,7 @@
namespace WebCore {
class Blob;
+class ScriptExecutionContext;
typedef int ExceptionCode;
@@ -49,7 +50,7 @@ public:
bool append(const String& text, ExceptionCode&);
bool append(const String& text, const String& ending, ExceptionCode&);
- PassRefPtr<Blob> getBlob(const String& contentType = String()) const;
+ PassRefPtr<Blob> getBlob(ScriptExecutionContext*, const String& contentType = String()) const;
private:
BlobItemList m_items;
diff --git a/WebCore/html/BlobBuilder.idl b/WebCore/html/BlobBuilder.idl
index 93cb87f..53c7add 100644
--- a/WebCore/html/BlobBuilder.idl
+++ b/WebCore/html/BlobBuilder.idl
@@ -34,7 +34,9 @@ module html {
GenerateNativeConverter,
NoStaticTables
] BlobBuilder {
- Blob getBlob(in [Optional, ConvertUndefinedOrNullToNullString] DOMString contentType);
+#if !defined(LANGUAGE_OBJECTIVE_C)
+ [CallWith=ScriptExecutionContext] Blob getBlob(in [Optional, ConvertUndefinedOrNullToNullString] DOMString contentType);
+#endif
void append(in Blob blob);
void append(in DOMString value, in [Optional, ConvertUndefinedOrNullToNullString] DOMString endings) raises (DOMException);
};
diff --git a/WebCore/html/File.cpp b/WebCore/html/File.cpp
index 4000dcb..109e0d3 100644
--- a/WebCore/html/File.cpp
+++ b/WebCore/html/File.cpp
@@ -31,15 +31,15 @@
namespace WebCore {
-File::File(const String& path)
- : Blob(path)
+File::File(ScriptExecutionContext* scriptExecutionContext, const String& path)
+ : Blob(scriptExecutionContext, path)
{
Init();
}
#if ENABLE(DIRECTORY_UPLOAD)
-File::File(const String& relativePath, const String& filePath)
- : Blob(FileBlobItem::create(filePath, relativePath))
+File::File(ScriptExecutionContext* scriptExecutionContext, const String& relativePath, const String& filePath)
+ : Blob(scriptExecutionContext, FileBlobItem::create(filePath, relativePath))
{
Init();
}
diff --git a/WebCore/html/File.h b/WebCore/html/File.h
index d685472..c0aecc8 100644
--- a/WebCore/html/File.h
+++ b/WebCore/html/File.h
@@ -34,15 +34,15 @@ namespace WebCore {
class File : public Blob {
public:
- static PassRefPtr<File> create(const String& path)
+ static PassRefPtr<File> create(ScriptExecutionContext* scriptExecutionContext, const String& path)
{
- return adoptRef(new File(path));
+ return adoptRef(new File(scriptExecutionContext, path));
}
#if ENABLE(DIRECTORY_UPLOAD)
- static PassRefPtr<File> create(const String& relativePath, const String& path)
+ static PassRefPtr<File> create(ScriptExecutionContext* scriptExecutionContext, const String& relativePath, const String& path)
{
- return adoptRef(new File(relativePath, path));
+ return adoptRef(new File(scriptExecutionContext, relativePath, path));
}
#endif
@@ -59,11 +59,11 @@ public:
unsigned long long fileSize() const { return size(); }
private:
- File(const String& path);
+ File(ScriptExecutionContext*, const String& path);
void Init();
#if ENABLE(DIRECTORY_UPLOAD)
- File(const String& relativePath, const String& path);
+ File(ScriptExecutionContext*, const String& relativePath, const String& path);
#endif
};
diff --git a/WebCore/html/FileThreadTask.h b/WebCore/html/FileThreadTask.h
index baf0888..de11798 100644
--- a/WebCore/html/FileThreadTask.h
+++ b/WebCore/html/FileThreadTask.h
@@ -57,10 +57,11 @@ template<typename T> struct FileThreadTaskTraits<PassOwnPtr<T> > {
typedef PassOwnPtr<T> ParamType;
};
+template<typename R>
class FileThreadTask0 : public FileThread::Task {
public:
- typedef void (FileStream::*Method)();
- typedef FileThreadTask0 FileThreadTask;
+ typedef R (FileStream::*Method)();
+ typedef FileThreadTask0<R> FileThreadTask;
static PassOwnPtr<FileThreadTask> create(FileStream* stream, Method method)
{
@@ -83,11 +84,11 @@ private:
Method m_method;
};
-template<typename P1, typename MP1>
+template<typename R, typename P1, typename MP1>
class FileThreadTask1 : public FileThread::Task {
public:
- typedef void (FileStream::*Method)(MP1);
- typedef FileThreadTask1<P1, MP1> FileThreadTask;
+ typedef R (FileStream::*Method)(MP1);
+ typedef FileThreadTask1<R, P1, MP1> FileThreadTask;
typedef typename FileThreadTaskTraits<P1>::ParamType Param1;
static PassOwnPtr<FileThreadTask> create(FileStream* stream, Method method, Param1 parameter1)
@@ -113,11 +114,11 @@ private:
P1 m_parameter1;
};
-template<typename P1, typename MP1, typename P2, typename MP2>
+template<typename R, typename P1, typename MP1, typename P2, typename MP2>
class FileThreadTask2 : public FileThread::Task {
public:
- typedef void (FileStream::*Method)(MP1, MP2);
- typedef FileThreadTask2<P1, MP1, P2, MP2> FileThreadTask;
+ typedef R (FileStream::*Method)(MP1, MP2);
+ typedef FileThreadTask2<R, P1, MP1, P2, MP2> FileThreadTask;
typedef typename FileThreadTaskTraits<P1>::ParamType Param1;
typedef typename FileThreadTaskTraits<P2>::ParamType Param2;
@@ -146,11 +147,11 @@ private:
P2 m_parameter2;
};
-template<typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3>
+template<typename R, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3>
class FileThreadTask3 : public FileThread::Task {
public:
- typedef void (FileStream::*Method)(MP1, MP2, MP3);
- typedef FileThreadTask3<P1, MP1, P2, MP2, P3, MP3> FileThreadTask;
+ typedef R (FileStream::*Method)(MP1, MP2, MP3);
+ typedef FileThreadTask3<R, P1, MP1, P2, MP2, P3, MP3> FileThreadTask;
typedef typename FileThreadTaskTraits<P1>::ParamType Param1;
typedef typename FileThreadTaskTraits<P2>::ParamType Param2;
typedef typename FileThreadTaskTraits<P3>::ParamType Param3;
@@ -182,54 +183,56 @@ private:
P3 m_parameter3;
};
+template<typename R>
PassOwnPtr<FileThread::Task> createFileThreadTask(
FileStream* const callee,
- void (FileStream::*method)());
+ R (FileStream::*method)());
+template<typename R>
PassOwnPtr<FileThread::Task> createFileThreadTask(
FileStream* const callee,
- void (FileStream::*method)())
+ R (FileStream::*method)())
{
- return FileThreadTask0::create(
+ return FileThreadTask0<R>::create(
callee,
method);
}
-template<typename P1, typename MP1>
+template<typename R, typename P1, typename MP1>
PassOwnPtr<FileThread::Task> createFileThreadTask(
FileStream* const callee,
- void (FileStream::*method)(MP1),
+ R (FileStream::*method)(MP1),
const P1& parameter1)
{
- return FileThreadTask1<typename CrossThreadCopier<P1>::Type, MP1>::create(
+ return FileThreadTask1<R, typename CrossThreadCopier<P1>::Type, MP1>::create(
callee,
method,
CrossThreadCopier<P1>::copy(parameter1));
}
-template<typename P1, typename MP1, typename P2, typename MP2>
+template<typename R, typename P1, typename MP1, typename P2, typename MP2>
PassOwnPtr<FileThread::Task> createFileThreadTask(
FileStream* const callee,
- void (FileStream::*method)(MP1, MP2),
+ R (FileStream::*method)(MP1, MP2),
const P1& parameter1,
const P2& parameter2)
{
- return FileThreadTask2<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2>::create(
+ return FileThreadTask2<R, typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2>::create(
callee,
method,
CrossThreadCopier<P1>::copy(parameter1),
CrossThreadCopier<P2>::copy(parameter2));
}
-template<typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3>
+template<typename R, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3>
PassOwnPtr<FileThread::Task> createFileThreadTask(
FileStream* const callee,
- void (FileStream::*method)(MP1, MP2, MP3),
+ R (FileStream::*method)(MP1, MP2, MP3),
const P1& parameter1,
const P2& parameter2,
const P3& parameter3)
{
- return FileThreadTask3<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3>::create(
+ return FileThreadTask3<R, typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3>::create(
callee,
method,
CrossThreadCopier<P1>::copy(parameter1),
diff --git a/WebCore/html/HTMLConstructionSite.cpp b/WebCore/html/HTMLConstructionSite.cpp
index e9bb762..0b17086 100644
--- a/WebCore/html/HTMLConstructionSite.cpp
+++ b/WebCore/html/HTMLConstructionSite.cpp
@@ -103,10 +103,8 @@ PassRefPtr<ChildType> HTMLConstructionSite::attach(Node* parent, PassRefPtr<Chil
// |parent| to hold a ref at this point. In the common case (at least
// for elements), however, we'll get to use this ref in the stack of
// open elements.
- if (parent->attached()) {
- ASSERT(!child->attached());
+ if (parent->attached() && !child->attached())
child->attach();
- }
return child.release();
}
diff --git a/WebCore/html/HTMLDocumentParser.cpp b/WebCore/html/HTMLDocumentParser.cpp
index 0c9f676..4c5c273 100644
--- a/WebCore/html/HTMLDocumentParser.cpp
+++ b/WebCore/html/HTMLDocumentParser.cpp
@@ -217,11 +217,17 @@ void HTMLDocumentParser::didPumpLexer()
#endif
}
+bool HTMLDocumentParser::hasInsertionPoint()
+{
+ return m_input.hasInsertionPoint();
+}
+
void HTMLDocumentParser::insert(const SegmentedString& source)
{
if (m_parserStopped)
return;
+<<<<<<< HEAD
if (m_scriptRunner && !m_scriptRunner->inScriptExecution() && m_input.haveSeenEndOfFile()) {
// document.write was called without a current insertion point.
// According to the spec, we're supposed to implicitly open the
@@ -236,6 +242,8 @@ void HTMLDocumentParser::insert(const SegmentedString& source)
android::TimeCounter::start(android::TimeCounter::ParsingTimeCounter);
#endif
+=======
+>>>>>>> webkit.org at r64264
{
NestingLevelIncrementer nestingLevelIncrementer(m_writeNestingLevel);
@@ -337,7 +345,7 @@ bool HTMLDocumentParser::inScriptExecution() const
{
if (!m_scriptRunner)
return false;
- return m_scriptRunner->inScriptExecution();
+ return m_scriptRunner->isExecutingScript();
}
int HTMLDocumentParser::lineNumber() const
@@ -415,7 +423,7 @@ void HTMLDocumentParser::executeScriptsWaitingForStylesheets()
// is a re-entrant call from encountering a </ style> tag.
if (!m_scriptRunner->hasScriptsWaitingForStylesheets())
return;
- ASSERT(!m_scriptRunner->inScriptExecution());
+ ASSERT(!m_scriptRunner->isExecutingScript());
ASSERT(m_treeBuilder->isPaused());
// Note: We only ever wait on one script at a time, so we always know this
// is the one we were waiting on and can un-pause the tree builder.
diff --git a/WebCore/html/HTMLDocumentParser.h b/WebCore/html/HTMLDocumentParser.h
index b2a65ca..cc46d31 100644
--- a/WebCore/html/HTMLDocumentParser.h
+++ b/WebCore/html/HTMLDocumentParser.h
@@ -64,6 +64,7 @@ public:
private:
// DocumentParser
+ virtual bool hasInsertionPoint();
virtual void insert(const SegmentedString&);
virtual void append(const SegmentedString&);
virtual void finish();
diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp
index 8985407..fb1bcc2 100644
--- a/WebCore/html/HTMLElement.cpp
+++ b/WebCore/html/HTMLElement.cpp
@@ -788,8 +788,21 @@ bool HTMLElement::isRecognizedTagName(const QualifiedName& tagName)
if (tagList.isEmpty()) {
size_t tagCount = 0;
WebCore::QualifiedName** tags = HTMLNames::getHTMLTags(&tagCount);
- for (size_t i = 0; i < tagCount; i++)
+ for (size_t i = 0; i < tagCount; i++) {
+ if (*tags[i] == bgsoundTag
+ || *tags[i] == commandTag
+ || *tags[i] == detailsTag
+ || *tags[i] == figcaptionTag
+ || *tags[i] == figureTag
+ || *tags[i] == summaryTag
+ || *tags[i] == trackTag) {
+ // Even though we have atoms for these tags, we don't want to
+ // treat them as "recognized tags" for the purpose of parsing
+ // because that changes how we parse documents.
+ continue;
+ }
tagList.add(tags[i]->localName().impl());
+ }
}
return tagList.contains(tagName.localName().impl());
}
diff --git a/WebCore/html/HTMLElementStack.cpp b/WebCore/html/HTMLElementStack.cpp
index 5c325e5..531a3b4 100644
--- a/WebCore/html/HTMLElementStack.cpp
+++ b/WebCore/html/HTMLElementStack.cpp
@@ -40,10 +40,19 @@ using namespace HTMLNames;
namespace {
+inline bool isNumberedHeaderElement(Element* element)
+{
+ return element->hasTagName(h1Tag)
+ || element->hasTagName(h2Tag)
+ || element->hasTagName(h3Tag)
+ || element->hasTagName(h4Tag)
+ || element->hasTagName(h5Tag)
+ || element->hasTagName(h6Tag);
+}
+
inline bool isScopeMarker(Element* element)
{
return element->hasTagName(appletTag)
- || element->hasTagName(buttonTag)
|| element->hasTagName(captionTag)
#if ENABLE(SVG_FOREIGN_OBJECT)
|| element->hasTagName(SVGNames::foreignObjectTag)
@@ -83,6 +92,12 @@ inline bool isTableRowScopeMarker(Element* element)
|| element->hasTagName(htmlTag);
}
+inline bool isButtonScopeMarker(Element* element)
+{
+ return isScopeMarker(element)
+ || element->hasTagName(buttonTag);
+}
+
}
HTMLElementStack::ElementRecord::ElementRecord(PassRefPtr<Element> element, PassOwnPtr<ElementRecord> next)
@@ -175,6 +190,13 @@ void HTMLElementStack::popUntilPopped(const AtomicString& tagName)
pop();
}
+void HTMLElementStack::popUntilNumberedHeaderElementPopped()
+{
+ while (!isNumberedHeaderElement(top()))
+ pop();
+ pop();
+}
+
void HTMLElementStack::popUntil(Element* element)
{
while (top() != element)
@@ -273,12 +295,6 @@ HTMLElementStack::ElementRecord* HTMLElementStack::topRecord() const
return m_top.get();
}
-Element* HTMLElementStack::top() const
-{
- ASSERT(m_top->element());
- return m_top->element();
-}
-
Element* HTMLElementStack::oneBelowTop() const
{
// We should never be calling this if it could be 0.
@@ -368,6 +384,19 @@ bool HTMLElementStack::hasOnlyHTMLElementsInScope() const
return true;
}
+bool HTMLElementStack::hasNumberedHeaderElementInScope() const
+{
+ for (ElementRecord* record = m_top.get(); record; record = record->next()) {
+ Element* element = record->element();
+ if (isNumberedHeaderElement(element))
+ return true;
+ if (isScopeMarker(element))
+ return false;
+ }
+ ASSERT_NOT_REACHED(); // <html> is always on the stack and is a scope marker.
+ return false;
+}
+
bool HTMLElementStack::inScope(Element* targetElement) const
{
for (ElementRecord* pos = m_top.get(); pos; pos = pos->next()) {
@@ -414,6 +443,17 @@ bool HTMLElementStack::inTableScope(const QualifiedName& tagName) const
return inTableScope(tagName.localName());
}
+bool HTMLElementStack::inButtonScope(const AtomicString& targetTag) const
+{
+ return inScopeCommon<isButtonScopeMarker>(m_top.get(), targetTag);
+}
+
+bool HTMLElementStack::inButtonScope(const QualifiedName& tagName) const
+{
+ // FIXME: Is localName() right for non-html elements?
+ return inButtonScope(tagName.localName());
+}
+
Element* HTMLElementStack::htmlElement() const
{
ASSERT(m_htmlElement);
diff --git a/WebCore/html/HTMLElementStack.h b/WebCore/html/HTMLElementStack.h
index 830faf0..62d031f 100644
--- a/WebCore/html/HTMLElementStack.h
+++ b/WebCore/html/HTMLElementStack.h
@@ -66,8 +66,15 @@ public:
RefPtr<Element> m_element;
OwnPtr<ElementRecord> m_next;
};
-
- Element* top() const;
+
+ // Inlining this function is a (small) performance win on the parsing
+ // benchmark.
+ Element* top() const
+ {
+ ASSERT(m_top->element());
+ return m_top->element();
+ }
+
Element* oneBelowTop() const;
ElementRecord* topRecord() const;
Element* bottom() const;
@@ -87,6 +94,7 @@ public:
void popUntil(Element*);
void popUntilPopped(const AtomicString& tagName);
void popUntilPopped(Element*);
+ void popUntilNumberedHeaderElementPopped();
void popUntilTableScopeMarker(); // "clear the stack back to a table context" in the spec.
void popUntilTableBodyScopeMarker(); // "clear the stack back to a table body context" in the spec.
void popUntilTableRowScopeMarker(); // "clear the stack back to a table row context" in the spec.
@@ -107,8 +115,11 @@ public:
bool inListItemScope(const QualifiedName&) const;
bool inTableScope(const AtomicString& tagName) const;
bool inTableScope(const QualifiedName&) const;
+ bool inButtonScope(const AtomicString& tagName) const;
+ bool inButtonScope(const QualifiedName&) const;
bool hasOnlyHTMLElementsInScope() const;
+ bool hasNumberedHeaderElementInScope() const;
Element* htmlElement() const;
Element* headElement() const;
diff --git a/WebCore/html/HTMLFormElement.cpp b/WebCore/html/HTMLFormElement.cpp
index 4d6b603..d75de01 100644
--- a/WebCore/html/HTMLFormElement.cpp
+++ b/WebCore/html/HTMLFormElement.cpp
@@ -36,7 +36,6 @@
#include "FormData.h"
#include "FormDataList.h"
#include "FormState.h"
-#include "FormSubmission.h"
#include "Frame.h"
#include "FrameLoader.h"
#include "FrameLoaderClient.h"
@@ -46,12 +45,12 @@
#include "HTMLInputElement.h"
#include "HTMLNames.h"
#include "MIMETypeRegistry.h"
+#include "Page.h"
#include "RenderTextControl.h"
#include "ScriptEventListener.h"
+#include "Settings.h"
#include "ValidityState.h"
#include <limits>
-#include <wtf/CurrentTime.h>
-#include <wtf/RandomNumber.h>
#if PLATFORM(WX)
#include <wx/defs.h>
@@ -64,14 +63,6 @@ namespace WebCore {
using namespace HTMLNames;
-static int64_t generateFormDataIdentifier()
-{
- // Initialize to the current time to reduce the likelihood of generating
- // identifiers that overlap with those from past/future browser sessions.
- static int64_t nextIdentifier = static_cast<int64_t>(currentTime() * 1000000.0);
- return ++nextIdentifier;
-}
-
HTMLFormElement::HTMLFormElement(const QualifiedName& tagName, Document* document)
: HTMLElement(tagName, document)
, m_submissionTrigger(NotSubmittedByJavaScript)
@@ -193,79 +184,6 @@ void HTMLFormElement::submitImplicitly(Event* event, bool fromImplicitSubmission
prepareSubmit(event);
}
-static void appendMailtoPostFormDataToURL(KURL& url, const FormData& data, const String& encodingType)
-{
- String body = data.flattenToString();
-
- if (equalIgnoringCase(encodingType, "text/plain")) {
- // Convention seems to be to decode, and s/&/\r\n/. Also, spaces are encoded as %20.
- body = decodeURLEscapeSequences(body.replace('&', "\r\n").replace('+', ' ') + "\r\n");
- }
-
- Vector<char> bodyData;
- bodyData.append("body=", 5);
- FormDataBuilder::encodeStringAsFormData(bodyData, body.utf8());
- body = String(bodyData.data(), bodyData.size()).replace('+', "%20");
-
- String query = url.query();
- if (!query.isEmpty())
- query.append('&');
- query.append(body);
- url.setQuery(query);
-}
-
-PassRefPtr<FormSubmission> HTMLFormElement::prepareFormSubmission(Event* event, bool lockHistory, FormSubmissionTrigger trigger)
-{
- KURL actionURL = document()->completeURL(m_formDataBuilder.action().isEmpty() ? document()->url().string() : m_formDataBuilder.action());
- bool isMailtoForm = actionURL.protocolIs("mailto");
-
- if (m_formDataBuilder.isPostMethod()) {
- if (m_formDataBuilder.isMultiPartForm() && isMailtoForm) {
- m_formDataBuilder.parseEncodingType("application/x-www-form-urlencoded");
- ASSERT(!m_formDataBuilder.isMultiPartForm());
- }
- } else
- m_formDataBuilder.setIsMultiPartForm(false);
-
- TextEncoding dataEncoding = isMailtoForm ? UTF8Encoding() : m_formDataBuilder.dataEncoding(document());
- RefPtr<DOMFormData> domFormData = DOMFormData::create(dataEncoding.encodingForFormSubmission());
- Vector<pair<String, String> > formValues;
-
- for (unsigned i = 0; i < m_associatedElements.size(); ++i) {
- HTMLFormControlElement* control = m_associatedElements[i];
- if (!control->disabled())
- control->appendFormData(*domFormData, m_formDataBuilder.isMultiPartForm());
- if (control->hasLocalName(inputTag)) {
- HTMLInputElement* input = static_cast<HTMLInputElement*>(control);
- if (input->isTextField()) {
- formValues.append(pair<String, String>(input->name(), input->value()));
- if (input->isSearchField())
- input->addSearchResult();
- }
- }
- }
-
- RefPtr<FormData> formData;
- String boundary;
-
- if (m_formDataBuilder.isMultiPartForm()) {
- formData = FormData::createMultiPart(domFormData->items(), domFormData->encoding(), document());
- boundary = formData->boundary().data();
- } else {
- formData = FormData::create(domFormData->items(), domFormData->encoding());
- if (m_formDataBuilder.isPostMethod() && isMailtoForm) {
- // Convert the form data into a string that we put into the URL.
- appendMailtoPostFormDataToURL(actionURL, *formData, m_formDataBuilder.encodingType());
- formData = FormData::create();
- }
- }
-
- formData->setIdentifier(generateFormDataIdentifier());
- FormSubmission::Method method = m_formDataBuilder.isPostMethod() ? FormSubmission::PostMethod : FormSubmission::GetMethod;
- String targetOrBaseTarget = m_formDataBuilder.target().isEmpty() ? document()->baseTarget() : m_formDataBuilder.target();
- return FormSubmission::create(method, actionURL, targetOrBaseTarget, m_formDataBuilder.encodingType(), FormState::create(this, formValues, document()->frame(), trigger), formData.release(), boundary, lockHistory, event);
-}
-
static inline HTMLFormControlElement* submitElementFromEvent(const Event* event)
{
Node* targetNode = event->target()->toNode();
@@ -280,7 +198,7 @@ static inline HTMLFormControlElement* submitElementFromEvent(const Event* event)
bool HTMLFormElement::validateInteractively(Event* event)
{
ASSERT(event);
- if (!document()->inStrictMode() || noValidate())
+ if (!document()->page() || !document()->page()->settings()->interactiveFormValidationEnabled() || noValidate())
return true;
HTMLFormControlElement* submitElement = submitElementFromEvent(event);
@@ -389,7 +307,7 @@ void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool lockH
if (needButtonActivation && firstSuccessfulSubmitButton)
firstSuccessfulSubmitButton->setActivatedSubmit(true);
- frame->loader()->submitForm(prepareFormSubmission(event, lockHistory, formSubmissionTrigger));
+ frame->loader()->submitForm(FormSubmission::create(this, m_attributes, event, lockHistory, formSubmissionTrigger));
if (needButtonActivation && firstSuccessfulSubmitButton)
firstSuccessfulSubmitButton->setActivatedSubmit(false);
@@ -421,17 +339,17 @@ void HTMLFormElement::reset()
void HTMLFormElement::parseMappedAttribute(Attribute* attr)
{
if (attr->name() == actionAttr)
- m_formDataBuilder.parseAction(attr->value());
+ m_attributes.parseAction(attr->value());
else if (attr->name() == targetAttr)
- m_formDataBuilder.setTarget(attr->value());
+ m_attributes.setTarget(attr->value());
else if (attr->name() == methodAttr)
- m_formDataBuilder.parseMethodType(attr->value());
+ m_attributes.parseMethodType(attr->value());
else if (attr->name() == enctypeAttr)
- m_formDataBuilder.parseEncodingType(attr->value());
+ m_attributes.parseEncodingType(attr->value());
else if (attr->name() == accept_charsetAttr)
// space separated list of charsets the server
// accepts - see rfc2045
- m_formDataBuilder.setAcceptCharset(attr->value());
+ m_attributes.setAcceptCharset(attr->value());
else if (attr->name() == acceptAttr) {
// ignore this one for the moment...
} else if (attr->name() == autocompleteAttr) {
diff --git a/WebCore/html/HTMLFormElement.h b/WebCore/html/HTMLFormElement.h
index 5aa9a5c..c9fb9ac 100644
--- a/WebCore/html/HTMLFormElement.h
+++ b/WebCore/html/HTMLFormElement.h
@@ -25,8 +25,8 @@
#define HTMLFormElement_h
#include "CheckedRadioButtons.h"
-#include "FormDataBuilder.h"
#include "FormState.h"
+#include "FormSubmission.h"
#include "HTMLElement.h"
#include <wtf/OwnPtr.h>
@@ -34,7 +34,6 @@ namespace WebCore {
class Event;
class FormData;
-class FormSubmission;
class HTMLFormControlElement;
class HTMLImageElement;
class HTMLInputElement;
@@ -55,10 +54,10 @@ public:
unsigned length() const;
Node* item(unsigned index);
- String enctype() const { return m_formDataBuilder.encodingType(); }
+ String enctype() const { return m_attributes.encodingType(); }
void setEnctype(const String&);
- String encoding() const { return m_formDataBuilder.encodingType(); }
+ String encoding() const { return m_attributes.encodingType(); }
void setEncoding(const String& value) { setEnctype(value); }
bool autoComplete() const { return m_autocomplete; }
@@ -88,7 +87,8 @@ public:
bool noValidate() const;
- String acceptCharset() const { return m_formDataBuilder.acceptCharset(); }
+ String acceptCharset() const { return m_attributes.acceptCharset(); }
+ void setAcceptCharset(const String&);
String action() const;
void setAction(const String&);
@@ -134,7 +134,6 @@ private:
void submit(Event*, bool activateSubmitButton, bool lockHistory, FormSubmissionTrigger);
- PassRefPtr<FormSubmission> prepareFormSubmission(Event*, bool lockHistory, FormSubmissionTrigger);
unsigned formElementIndex(HTMLFormControlElement*);
// Returns true if the submission should be proceeded.
bool validateInteractively(Event*);
@@ -146,7 +145,7 @@ private:
typedef HashMap<RefPtr<AtomicStringImpl>, RefPtr<HTMLFormControlElement> > AliasMap;
- FormDataBuilder m_formDataBuilder;
+ FormSubmission::Attributes m_attributes;
OwnPtr<AliasMap> m_elementAliases;
OwnPtr<CollectionCache> m_collectionCache;
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 49b6f01..f4528c2 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -113,7 +113,7 @@ static const double msecPerSecond = 1000;
static bool isNumberCharacter(UChar ch)
{
return ch == '+' || ch == '-' || ch == '.' || ch == 'e' || ch == 'E'
- || ch >= '0' && ch <= '9';
+ || (ch >= '0' && ch <= '9');
}
HTMLInputElement::HTMLInputElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
@@ -250,87 +250,34 @@ bool HTMLInputElement::valueMissing() const
bool HTMLInputElement::patternMismatch() const
{
- switch (inputType()) {
- case BUTTON:
- case CHECKBOX:
- case COLOR:
- case DATE:
- case DATETIME:
- case DATETIMELOCAL:
- case FILE:
- case HIDDEN:
- case IMAGE:
- case ISINDEX:
- case MONTH:
- case NUMBER:
- case RADIO:
- case RANGE:
- case RESET:
- case SUBMIT:
- case TIME:
- case WEEK:
+ if (!isTextType())
return false;
- case EMAIL:
- case PASSWORD:
- case SEARCH:
- case TELEPHONE:
- case TEXT:
- case URL:
- const AtomicString& pattern = getAttribute(patternAttr);
- String value = this->value();
- // Empty values can't be mismatched
- if (pattern.isEmpty() || value.isEmpty())
- return false;
- RegularExpression patternRegExp(pattern, TextCaseSensitive);
- int matchLength = 0;
- int valueLength = value.length();
- int matchOffset = patternRegExp.match(value, 0, &matchLength);
- return matchOffset || matchLength != valueLength;
- }
- ASSERT_NOT_REACHED();
- return false;
+ const AtomicString& pattern = getAttribute(patternAttr);
+ String value = this->value();
+ // Empty values can't be mismatched
+ if (pattern.isEmpty() || value.isEmpty())
+ return false;
+ RegularExpression patternRegExp(pattern, TextCaseSensitive);
+ int matchLength = 0;
+ int valueLength = value.length();
+ int matchOffset = patternRegExp.match(value, 0, &matchLength);
+ return matchOffset || matchLength != valueLength;
}
bool HTMLInputElement::tooLong() const
{
- switch (inputType()) {
- case EMAIL:
- case PASSWORD:
- case SEARCH:
- case TELEPHONE:
- case TEXT:
- case URL: {
- int max = maxLength();
- if (max < 0)
- return false;
- // Return false for the default value even if it is longer than maxLength.
- bool userEdited = !m_data.value().isNull();
- if (!userEdited)
- return false;
- return numGraphemeClusters(value()) > static_cast<unsigned>(max);
- }
- case BUTTON:
- case CHECKBOX:
- case COLOR:
- case DATE:
- case DATETIME:
- case DATETIMELOCAL:
- case FILE:
- case HIDDEN:
- case IMAGE:
- case ISINDEX:
- case MONTH:
- case NUMBER:
- case RADIO:
- case RANGE:
- case RESET:
- case SUBMIT:
- case TIME:
- case WEEK:
+ // We use isTextType() instead of supportsMaxLength() because of the
+ // 'virtual' overhead.
+ if (!isTextType())
return false;
- }
- ASSERT_NOT_REACHED();
- return false;
+ int max = maxLength();
+ if (max < 0)
+ return false;
+ // Return false for the default value even if it is longer than maxLength.
+ bool userEdited = !m_data.value().isNull();
+ if (!userEdited)
+ return false;
+ return numGraphemeClusters(value()) > static_cast<unsigned>(max);
}
bool HTMLInputElement::rangeUnderflow() const
@@ -1402,7 +1349,7 @@ bool HTMLInputElement::appendFormData(FormDataList& encoding, bool multipart)
// If no filename at all is entered, return successful but empty.
// Null would be more logical, but Netscape posts an empty file. Argh.
if (!numFiles) {
- encoding.appendBlob(name(), File::create(""));
+ encoding.appendBlob(name(), File::create(document()->scriptExecutionContext(), ""));
return true;
}
@@ -1457,6 +1404,40 @@ bool HTMLInputElement::isTextField() const
return false;
}
+bool HTMLInputElement::isTextType() const
+{
+ switch (inputType()) {
+ case EMAIL:
+ case PASSWORD:
+ case SEARCH:
+ case TELEPHONE:
+ case TEXT:
+ case URL:
+ return true;
+ case BUTTON:
+ case CHECKBOX:
+ case COLOR:
+ case DATE:
+ case DATETIME:
+ case DATETIMELOCAL:
+ case FILE:
+ case HIDDEN:
+ case IMAGE:
+ case ISINDEX:
+ case MONTH:
+ case NUMBER:
+ case RADIO:
+ case RANGE:
+ case RESET:
+ case SUBMIT:
+ case TIME:
+ case WEEK:
+ return false;
+ }
+ ASSERT_NOT_REACHED();
+ return false;
+}
+
void HTMLInputElement::setChecked(bool nowChecked, bool sendChangeEvent)
{
if (checked() == nowChecked)
@@ -2007,15 +1988,18 @@ void HTMLInputElement::setFileListFromRenderer(const Vector<String>& paths)
}
rootPath = directoryName(rootPath);
ASSERT(rootPath.length());
- for (int i = 0; i < size; i++)
- m_fileList->append(File::create(paths[i].substring(1 + rootPath.length()), paths[i]));
+ for (int i = 0; i < size; i++) {
+ // Normalize backslashes to slashes before exposing the relative path to script.
+ String relativePath = paths[i].substring(1 + rootPath.length()).replace('\\','/');
+ m_fileList->append(File::create(document()->scriptExecutionContext(), relativePath, paths[i]));
+ }
} else {
for (int i = 0; i < size; i++)
- m_fileList->append(File::create(paths[i]));
+ m_fileList->append(File::create(document()->scriptExecutionContext(), paths[i]));
}
#else
for (int i = 0; i < size; i++)
- m_fileList->append(File::create(paths[i]));
+ m_fileList->append(File::create(document()->scriptExecutionContext(), paths[i]));
#endif
setFormControlValueMatchesRenderer(true);
@@ -2574,7 +2558,7 @@ FileList* HTMLInputElement::files()
String HTMLInputElement::sanitizeValue(const String& proposedValue) const
{
if (isTextField())
- return InputElement::sanitizeValue(this, proposedValue);
+ return InputElement::sanitizeValueForTextField(this, proposedValue);
// If the proposedValue is null than this is a reset scenario and we
// want the range input's value attribute to take priority over the
@@ -2843,13 +2827,20 @@ void HTMLInputElement::stepUpFromRenderer(int n)
return;
const double nan = numeric_limits<double>::quiet_NaN();
- double current = parseToDouble(value(), nan);
- if (!isfinite(current)) {
+ String currentStringValue = value();
+ double current = parseToDouble(currentStringValue, nan);
+ if (!isfinite(current))
setValue(serialize(n > 0 ? minimum() : maximum()));
- return;
+ else {
+ ExceptionCode ec;
+ stepUp(n, ec);
+ }
+
+ if (currentStringValue != value()) {
+ if (renderer() && renderer()->isTextField())
+ toRenderTextControl(renderer())->setChangedSinceLastChangeEvent(true);
+ dispatchEvent(Event::create(eventNames().inputEvent, true, false));
}
- ExceptionCode ec;
- stepUp(n, ec);
}
#if ENABLE(WCSS)
diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h
index 3b9ba88..72ac589 100644
--- a/WebCore/html/HTMLInputElement.h
+++ b/WebCore/html/HTMLInputElement.h
@@ -290,7 +290,10 @@ private:
void registerForActivationCallbackIfNeeded();
void unregisterForActivationCallbackIfNeeded();
- virtual bool supportsPlaceholder() const { return isTextField(); }
+ virtual bool supportsMaxLength() const { return isTextType(); }
+ bool isTextType() const;
+
+ virtual bool supportsPlaceholder() const { return isTextType() || inputType() == ISINDEX; }
virtual bool isEmptyValue() const { return value().isEmpty(); }
virtual void handleFocusEvent();
virtual void handleBlurEvent();
diff --git a/WebCore/html/HTMLInputStream.h b/WebCore/html/HTMLInputStream.h
index d7c1c9c..a709bd9 100644
--- a/WebCore/html/HTMLInputStream.h
+++ b/WebCore/html/HTMLInputStream.h
@@ -64,6 +64,21 @@ public:
m_first.append(string);
}
+ bool hasInsertionPoint() const
+ {
+ if (&m_first != m_last)
+ return true;
+ if (!haveSeenEndOfFile()) {
+ // FIXME: Somehow we need to understand the difference between
+ // input streams that are coming off the network and streams that
+ // were created with document.open(). In the later case, we always
+ // have an isertion point at the end of the stream until someone
+ // calls document.close().
+ return true;
+ }
+ return false;
+ }
+
void markEndOfFile()
{
// FIXME: This should use InputStreamPreprocessor::endOfFileMarker
@@ -73,7 +88,7 @@ public:
m_last->close();
}
- bool haveSeenEndOfFile()
+ bool haveSeenEndOfFile() const
{
return m_last->isClosed();
}
diff --git a/WebCore/html/HTMLLinkElement.cpp b/WebCore/html/HTMLLinkElement.cpp
index c1623ec..a638572 100644
--- a/WebCore/html/HTMLLinkElement.cpp
+++ b/WebCore/html/HTMLLinkElement.cpp
@@ -276,8 +276,13 @@ void HTMLLinkElement::insertedIntoDocument()
// to fire, it is possible for JavaScript to remove the element in the midst
// of it being inserted into the DOM, which can lead to assertion failures
// and crashes. Avoid this by postponing the beforeload/load until after
- // attach.
- m_shouldProcessAfterAttach = true;
+ // attach if there are beforeload listeners.
+ if (document()->hasListenerType(Document::BEFORELOAD_LISTENER)) {
+ m_shouldProcessAfterAttach = true;
+ return;
+ }
+
+ process();
}
void HTMLLinkElement::removedFromDocument()
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index bf24cf9..ad465bb 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -304,7 +304,7 @@ RenderObject* HTMLMediaElement::createRenderer(RenderArena* arena, RenderStyle*)
void HTMLMediaElement::insertedIntoDocument()
{
HTMLElement::insertedIntoDocument();
- if (!src().isEmpty() && m_networkState == NETWORK_EMPTY)
+ if (!getAttribute(srcAttr).isEmpty() && m_networkState == NETWORK_EMPTY)
scheduleLoad();
}
@@ -438,11 +438,6 @@ PassRefPtr<MediaError> HTMLMediaElement::error() const
return m_error;
}
-KURL HTMLMediaElement::src() const
-{
- return getNonEmptyURLAttribute(srcAttr);
-}
-
void HTMLMediaElement::setSrc(const String& url)
{
setAttribute(srcAttr, url);
@@ -677,9 +672,9 @@ void HTMLMediaElement::loadResource(const KURL& initialURL, ContentType& content
m_player->load(m_currentSrc, contentType);
if (isVideo() && m_player->canLoadPoster()) {
- KURL posterUrl = poster();
- if (!posterUrl.isEmpty())
- m_player->setPoster(posterUrl);
+ KURL posterURL = getNonEmptyURLAttribute(posterAttr);
+ if (!posterURL.isEmpty())
+ m_player->setPoster(posterURL);
}
if (renderer())
@@ -1968,13 +1963,10 @@ void HTMLMediaElement::getPluginProxyParams(KURL& url, Vector<String>& names, Ve
FrameLoader* loader = frame ? frame->loader() : 0;
if (isVideo()) {
- String poster = poster();
- if (!poster.isEmpty() && loader) {
- KURL posterURL = loader->completeURL(poster);
- if (posterURL.isValid() && loader->willLoadMediaElementURL(posterURL)) {
- names.append("_media_element_poster_");
- values.append(posterURL.string());
- }
+ KURL posterURL = getNonEmptyURLAttribute(posterAttr);
+ if (!posterURL.isEmpty() && loader && loader->willLoadMediaElementURL(posterURL)) {
+ names.append("_media_element_poster_");
+ values.append(posterURL.string());
}
}
diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h
index 051629e..eede363 100644
--- a/WebCore/html/HTMLMediaElement.h
+++ b/WebCore/html/HTMLMediaElement.h
@@ -64,7 +64,6 @@ public:
// Eventually overloaded in HTMLVideoElement
virtual bool supportsFullscreen() const { return false; };
- virtual const KURL poster() const { return KURL(); }
virtual bool supportsSave() const;
@@ -84,7 +83,6 @@ public:
PassRefPtr<MediaError> error() const;
// network state
- KURL src() const;
void setSrc(const String&);
String currentSrc() const;
diff --git a/WebCore/html/HTMLMediaElement.idl b/WebCore/html/HTMLMediaElement.idl
index 28a0fbe..12a1464 100644
--- a/WebCore/html/HTMLMediaElement.idl
+++ b/WebCore/html/HTMLMediaElement.idl
@@ -30,7 +30,7 @@ interface [Conditional=VIDEO] HTMLMediaElement : HTMLElement {
readonly attribute MediaError error;
// network state
- attribute [Reflect,NonEmpty,URL] DOMString src;
+ attribute [Reflect,URL] DOMString src;
readonly attribute DOMString currentSrc;
const unsigned short NETWORK_EMPTY = 0;
diff --git a/WebCore/html/HTMLPlugInElement.cpp b/WebCore/html/HTMLPlugInElement.cpp
index 7737dc4..2ce44a6 100644
--- a/WebCore/html/HTMLPlugInElement.cpp
+++ b/WebCore/html/HTMLPlugInElement.cpp
@@ -92,13 +92,21 @@ PassScriptInstance HTMLPlugInElement::getInstance() const
if (m_instance)
return m_instance;
- RenderWidget* renderWidget = renderWidgetForJSBindings();
- if (renderWidget && renderWidget->widget())
- m_instance = frame->script()->createScriptInstanceForWidget(renderWidget->widget());
+ if (Widget* widget = pluginWidget())
+ m_instance = frame->script()->createScriptInstanceForWidget(widget);
return m_instance;
}
+Widget* HTMLPlugInElement::pluginWidget() const
+{
+ RenderWidget* renderWidget = renderWidgetForJSBindings();
+ if (!renderWidget)
+ return 0;
+
+ return renderWidget->widget();
+}
+
bool HTMLPlugInElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
{
if (attrName == widthAttr ||
diff --git a/WebCore/html/HTMLPlugInElement.h b/WebCore/html/HTMLPlugInElement.h
index e4f3474..6288e74 100644
--- a/WebCore/html/HTMLPlugInElement.h
+++ b/WebCore/html/HTMLPlugInElement.h
@@ -33,6 +33,7 @@ struct NPObject;
namespace WebCore {
class RenderWidget;
+class Widget;
class HTMLPlugInElement : public HTMLFrameOwnerElement {
public:
@@ -40,6 +41,8 @@ public:
PassScriptInstance getInstance() const;
+ Widget* pluginWidget() const;
+
#if ENABLE(NETSCAPE_PLUGIN_API)
NPObject* getNPObject();
#endif
diff --git a/WebCore/html/HTMLScriptRunner.cpp b/WebCore/html/HTMLScriptRunner.cpp
index 29790c0..f4b7013 100644
--- a/WebCore/html/HTMLScriptRunner.cpp
+++ b/WebCore/html/HTMLScriptRunner.cpp
@@ -154,7 +154,7 @@ void HTMLScriptRunner::executeScript(Element* element, const ScriptSourceCode& s
ASSERT(scriptElement);
if (!scriptElement->shouldExecuteAsJavaScript())
return;
- ASSERT(inScriptExecution());
+ ASSERT(isExecutingScript());
if (!m_document->frame())
return;
m_document->frame()->script()->executeScript(sourceCode);
diff --git a/WebCore/html/HTMLScriptRunner.h b/WebCore/html/HTMLScriptRunner.h
index f93ae10..cc69443 100644
--- a/WebCore/html/HTMLScriptRunner.h
+++ b/WebCore/html/HTMLScriptRunner.h
@@ -53,7 +53,7 @@ public:
bool hasScriptsWaitingForStylesheets() const { return m_hasScriptsWaitingForStylesheets; }
bool executeScriptsWaitingForStylesheets();
- bool inScriptExecution() { return !!m_scriptNestingLevel; }
+ bool isExecutingScript() { return !!m_scriptNestingLevel; }
private:
// A container for an external script which may be loaded and executed.
diff --git a/WebCore/html/HTMLSourceElement.cpp b/WebCore/html/HTMLSourceElement.cpp
index 2c83fed..6c26610 100644
--- a/WebCore/html/HTMLSourceElement.cpp
+++ b/WebCore/html/HTMLSourceElement.cpp
@@ -62,11 +62,6 @@ void HTMLSourceElement::insertedIntoDocument()
}
}
-KURL HTMLSourceElement::src() const
-{
- return getNonEmptyURLAttribute(srcAttr);
-}
-
void HTMLSourceElement::setSrc(const String& url)
{
setAttribute(srcAttr, url);
diff --git a/WebCore/html/HTMLSourceElement.h b/WebCore/html/HTMLSourceElement.h
index 6cca64e..20049cc 100644
--- a/WebCore/html/HTMLSourceElement.h
+++ b/WebCore/html/HTMLSourceElement.h
@@ -37,7 +37,6 @@ class HTMLSourceElement : public HTMLElement {
public:
static PassRefPtr<HTMLSourceElement> create(const QualifiedName&, Document*);
- KURL src() const;
String media() const;
String type() const;
void setSrc(const String&);
diff --git a/WebCore/html/HTMLSourceElement.idl b/WebCore/html/HTMLSourceElement.idl
index f7229f1..61dc4d0 100644
--- a/WebCore/html/HTMLSourceElement.idl
+++ b/WebCore/html/HTMLSourceElement.idl
@@ -25,7 +25,7 @@
module html {
interface [Conditional=VIDEO] HTMLSourceElement : HTMLElement {
- attribute [Reflect,NonEmpty,URL] DOMString src;
+ attribute [Reflect,URL] DOMString src;
attribute DOMString type;
attribute DOMString media;
};
diff --git a/WebCore/html/HTMLTagNames.in b/WebCore/html/HTMLTagNames.in
index 9c66a95..f844fa8 100644
--- a/WebCore/html/HTMLTagNames.in
+++ b/WebCore/html/HTMLTagNames.in
@@ -15,6 +15,7 @@ b interfaceName=HTMLElement
base
basefont interfaceName=HTMLBaseFontElement
bdo interfaceName=HTMLElement
+bgsound interfaceName=HTMLElement
big interfaceName=HTMLElement
blockquote
body
@@ -27,6 +28,7 @@ cite interfaceName=HTMLElement
code interfaceName=HTMLElement
col interfaceName=HTMLTableColElement
colgroup interfaceName=HTMLTableColElement
+command interfaceName=HTMLElement
datagrid interfaceName=HTMLDataGridElement, conditional=DATAGRID
datalist interfaceName=HTMLDataListElement, conditional=DATALIST
dcell interfaceName=HTMLDataGridCellElement, conditional=DATAGRID
@@ -34,6 +36,7 @@ dcol interfaceName=HTMLDataGridColElement, conditional=DATAGRID
drow interfaceName=HTMLDataGridRowElement, conditional=DATAGRID
dd interfaceName=HTMLElement
del interfaceName=HTMLModElement
+details interfaceName=HTMLElement
dfn interfaceName=HTMLElement
dir interfaceName=HTMLDirectoryElement
div
@@ -42,6 +45,8 @@ dt interfaceName=HTMLElement
em interfaceName=HTMLElement
embed
fieldset interfaceName=HTMLFieldSetElement, constructorNeedsFormElement
+figcaption interfaceName=HTMLElement
+figure interfaceName=HTMLElement
font
footer interfaceName=HTMLElement
form
@@ -109,6 +114,7 @@ strike interfaceName=HTMLElement
strong interfaceName=HTMLElement
style constructorNeedsCreatedByParser
sub interfaceName=HTMLElement
+summary interfaceName=HTMLElement
sup interfaceName=HTMLElement
table
tbody interfaceName=HTMLTableSectionElement
@@ -119,6 +125,7 @@ th interfaceName=HTMLTableCellElement
thead interfaceName=HTMLTableSectionElement
title
tr interfaceName=HTMLTableRowElement
+track interfaceName=HTMLElement
tt interfaceName=HTMLElement
u interfaceName=HTMLElement
ul interfaceName=HTMLUListElement
diff --git a/WebCore/html/HTMLToken.h b/WebCore/html/HTMLToken.h
index d2987f4..8465a35 100644
--- a/WebCore/html/HTMLToken.h
+++ b/WebCore/html/HTMLToken.h
@@ -59,6 +59,7 @@ public:
void clear()
{
m_type = Uninitialized;
+ m_data.clear();
}
void makeEndOfFile()
@@ -72,7 +73,6 @@ public:
ASSERT(character);
ASSERT(m_type == Uninitialized);
m_type = StartTag;
- m_data.clear();
m_selfClosing = false;
m_currentAttribute = 0;
m_attributes.clear();
@@ -85,7 +85,6 @@ public:
{
ASSERT(m_type == Uninitialized);
m_type = EndTag;
- m_data.clear();
m_selfClosing = false;
m_currentAttribute = 0;
m_attributes.clear();
@@ -93,27 +92,24 @@ public:
m_data.append(characters);
}
- void beginCharacter(UChar character)
+ // Starting a character token works slightly differently than starting
+ // other types of tokens because we want to save a per-character branch.
+ void ensureIsCharacterToken()
{
- ASSERT(character);
- ASSERT(m_type == Uninitialized);
+ ASSERT(m_type == Uninitialized || m_type == Character);
m_type = Character;
- m_data.clear();
- m_data.append(character);
}
void beginComment()
{
ASSERT(m_type == Uninitialized);
m_type = Comment;
- m_data.clear();
}
void beginDOCTYPE()
{
ASSERT(m_type == Uninitialized);
m_type = DOCTYPE;
- m_data.clear();
m_doctypeData.set(new DoctypeData());
}
@@ -294,7 +290,7 @@ private:
// For StartTag and EndTag
bool m_selfClosing;
- AttributeList m_attributes; // Old tokenizer reserves 10.
+ AttributeList m_attributes;
// A pointer into m_attributes used during lexing.
Attribute* m_currentAttribute;
@@ -328,8 +324,13 @@ public:
String name(iter->m_name.data(), iter->m_name.size());
String value(iter->m_value.data(), iter->m_value.size());
RefPtr<Attribute> mappedAttribute = Attribute::createMapped(name, value);
- if (!m_attributes)
+ if (!m_attributes) {
m_attributes = NamedNodeMap::create();
+ // Reserving capacity here improves the parser
+ // benchmark. It might be worth experimenting with
+ // the constant to see where the optimal point is.
+ m_attributes->reserveInitialCapacity(10);
+ }
m_attributes->insertAttribute(mappedAttribute.release(), false);
}
}
diff --git a/WebCore/html/HTMLTokenizer.cpp b/WebCore/html/HTMLTokenizer.cpp
index 55fd1ca..c8234e4 100644
--- a/WebCore/html/HTMLTokenizer.cpp
+++ b/WebCore/html/HTMLTokenizer.cpp
@@ -58,7 +58,7 @@ inline UChar toLowerCase(UChar cc)
inline bool isTokenizerWhitespace(UChar cc)
{
- return cc == '\x09' || cc == '\x0A' || cc == '\x0C' || cc == ' ';
+ return cc == ' ' || cc == '\x0A' || cc == '\x09' || cc == '\x0C';
}
inline void advanceStringAndASSERTIgnoringCase(SegmentedString& source, const char* expectedCharacters)
@@ -1608,10 +1608,7 @@ inline bool HTMLTokenizer::isAppropriateEndTag()
inline void HTMLTokenizer::bufferCharacter(UChar character)
{
ASSERT(character != InputStreamPreprocessor::endOfFileMarker);
- if (m_token->type() != HTMLToken::Character) {
- m_token->beginCharacter(character);
- return;
- }
+ m_token->ensureIsCharacterToken();
m_token->appendToCharacter(character);
}
diff --git a/WebCore/html/HTMLTokenizer.h b/WebCore/html/HTMLTokenizer.h
index 96c2d7c..7ee9d41 100644
--- a/WebCore/html/HTMLTokenizer.h
+++ b/WebCore/html/HTMLTokenizer.h
@@ -149,9 +149,20 @@ private:
// Returns whether we succeeded in peeking at the next character.
// The only way we can fail to peek is if there are no more
// characters in |source| (after collapsing \r\n, etc).
- bool peek(SegmentedString& source, int& lineNumber)
+ ALWAYS_INLINE bool peek(SegmentedString& source, int& lineNumber)
{
m_nextInputCharacter = *source;
+
+ // Every branch in this function is expensive, so we have a
+ // fast-reject branch for characters that don't require special
+ // handling. Please run the parser benchmark whenever you touch
+ // this function. It's very hot.
+ static const UChar specialCharacterMask = '\n' | '\r' | '\0';
+ if (m_nextInputCharacter & ~specialCharacterMask) {
+ m_skipNextNewLine = false;
+ return true;
+ }
+
if (m_nextInputCharacter == '\n' && m_skipNextNewLine) {
m_skipNextNewLine = false;
source.advancePastNewline(lineNumber);
diff --git a/WebCore/html/HTMLTreeBuilder.cpp b/WebCore/html/HTMLTreeBuilder.cpp
index 93da3f7..ec15f9f 100644
--- a/WebCore/html/HTMLTreeBuilder.cpp
+++ b/WebCore/html/HTMLTreeBuilder.cpp
@@ -119,7 +119,7 @@ bool isSpecialTag(const AtomicString& tagName)
|| tagName == asideTag
|| tagName == baseTag
|| tagName == basefontTag
- || tagName == "bgsound"
+ || tagName == bgsoundTag
|| tagName == blockquoteTag
|| tagName == bodyTag
|| tagName == brTag
@@ -127,16 +127,16 @@ bool isSpecialTag(const AtomicString& tagName)
|| tagName == centerTag
|| tagName == colTag
|| tagName == colgroupTag
- || tagName == "command"
+ || tagName == commandTag
|| tagName == ddTag
- || tagName == "details"
+ || tagName == detailsTag
|| tagName == dirTag
|| tagName == divTag
|| tagName == dlTag
|| tagName == dtTag
|| tagName == embedTag
|| tagName == fieldsetTag
- || tagName == "figure"
+ || tagName == figureTag
|| tagName == footerTag
|| tagName == formTag
|| tagName == frameTag
@@ -183,7 +183,6 @@ bool isSpecialTag(const AtomicString& tagName)
bool isScopingTag(const AtomicString& tagName)
{
return tagName == appletTag
- || tagName == buttonTag
|| tagName == captionTag
|| tagName == SVGNames::foreignObjectTag
|| tagName == htmlTag
@@ -393,27 +392,6 @@ static void convertToOldStyle(AtomicHTMLToken& token, Token& oldStyleToken)
}
}
-void HTMLTreeBuilder::handleScriptStartTag()
-{
- notImplemented(); // The HTML frgment case?
- m_tokenizer->setState(HTMLTokenizer::ScriptDataState);
- notImplemented(); // Save insertion mode.
-}
-
-void HTMLTreeBuilder::handleScriptEndTag(Element* scriptElement, int scriptStartLine)
-{
- ASSERT(!m_scriptToProcess); // Caller never called takeScriptToProcess!
- ASSERT(m_scriptToProcessStartLine == uninitializedLineNumberValue); // Caller never called takeScriptToProcess!
- notImplemented(); // Save insertion mode and insertion point?
-
- // Pause ourselves so that parsing stops until the script can be processed by the caller.
- m_isPaused = true;
- m_scriptToProcess = scriptElement;
- // Lexer line numbers are 0-based, ScriptSourceCode expects 1-based lines,
- // so we convert here before passing the line number off to HTMLScriptRunner.
- m_scriptToProcessStartLine = scriptStartLine + 1;
-}
-
PassRefPtr<Element> HTMLTreeBuilder::takeScriptToProcess(int& scriptStartLine)
{
// Unpause ourselves, callers may pause us again when processing the script.
@@ -471,7 +449,7 @@ void HTMLTreeBuilder::passTokenToLegacyParser(HTMLToken& token)
// This work is supposed to be done by the parser, but
// when using the old parser for we have to do this manually.
if (oldStyleToken.tagName == scriptTag) {
- handleScriptStartTag();
+ m_tokenizer->setState(HTMLTokenizer::ScriptDataState);
m_lastScriptElement = static_pointer_cast<Element>(result);
m_lastScriptElementStartLine = m_tokenizer->lineNumber();
} else if (oldStyleToken.tagName == preTag || oldStyleToken.tagName == listingTag)
@@ -488,8 +466,16 @@ void HTMLTreeBuilder::passTokenToLegacyParser(HTMLToken& token)
// a DocumentFragment for pasting so that javascript content
// does not show up in pasted HTML.
m_lastScriptElement->removeChildren();
- } else if (insertionMode() != AfterFramesetMode)
- handleScriptEndTag(m_lastScriptElement.get(), m_lastScriptElementStartLine);
+ } else if (insertionMode() != AfterFramesetMode) {
+ ASSERT(!m_scriptToProcess); // Caller never called takeScriptToProcess!
+ ASSERT(m_scriptToProcessStartLine == uninitializedLineNumberValue); // Caller never called takeScriptToProcess!
+ // Pause ourselves so that parsing stops until the script can be processed by the caller.
+ m_isPaused = true;
+ m_scriptToProcess = m_lastScriptElement.get();
+ // Lexer line numbers are 0-based, ScriptSourceCode expects 1-based lines,
+ // so we convert here before passing the line number off to HTMLScriptRunner.
+ m_scriptToProcessStartLine = m_lastScriptElementStartLine + 1;
+ }
m_lastScriptElement = 0;
m_lastScriptElementStartLine = uninitializedLineNumberValue;
}
@@ -572,9 +558,9 @@ void HTMLTreeBuilder::processFakeCharacters(const String& characters)
processCharacterBuffer(buffer);
}
-void HTMLTreeBuilder::processFakePEndTagIfPInScope()
+void HTMLTreeBuilder::processFakePEndTagIfPInButtonScope()
{
- if (!m_tree.openElements()->inScope(pTag.localName()))
+ if (!m_tree.openElements()->inButtonScope(pTag.localName()))
return;
AtomicHTMLToken endP(HTMLToken::EndTag, pTag.localName());
processEndTag(endP);
@@ -654,7 +640,7 @@ void HTMLTreeBuilder::processCloseWhenNestedTag(AtomicHTMLToken& token)
break;
nodeRecord = nodeRecord->next();
}
- processFakePEndTagIfPInScope();
+ processFakePEndTagIfPInButtonScope();
m_tree.insertHTMLElement(token);
}
@@ -694,14 +680,15 @@ void adjustSVGTagNameCase(AtomicHTMLToken& token)
token.setName(casedName.localName());
}
-void adjustSVGAttributes(AtomicHTMLToken& token)
+template<QualifiedName** getAttrs(size_t* length)>
+void adjustAttributes(AtomicHTMLToken& token)
{
static PrefixedNameToQualifiedNameMap* caseMap = 0;
if (!caseMap) {
caseMap = new PrefixedNameToQualifiedNameMap;
size_t length = 0;
- QualifiedName** svgAttrs = SVGNames::getSVGAttrs(&length);
- mapLoweredLocalNameToName(caseMap, svgAttrs, length);
+ QualifiedName** attrs = getAttrs(&length);
+ mapLoweredLocalNameToName(caseMap, attrs, length);
}
NamedNodeMap* attributes = token.attributes();
@@ -716,9 +703,14 @@ void adjustSVGAttributes(AtomicHTMLToken& token)
}
}
-void adjustMathMLAttributes(AtomicHTMLToken&)
+void adjustSVGAttributes(AtomicHTMLToken& token)
{
- notImplemented();
+ adjustAttributes<SVGNames::getSVGAttrs>(token);
+}
+
+void adjustMathMLAttributes(AtomicHTMLToken& token)
+{
+ adjustAttributes<MathMLNames::getMathMLAttrs>(token);
}
void addNamesWithPrefix(PrefixedNameToQualifiedNameMap* map, const AtomicString& prefix, QualifiedName** names, size_t length)
@@ -770,7 +762,9 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
return;
}
if (token.name() == baseTag
- || token.name() == "command"
+ || token.name() == basefontTag
+ || token.name() == bgsoundTag
+ || token.name() == commandTag
|| token.name() == linkTag
|| token.name() == metaTag
|| token.name() == noframesTag
@@ -805,12 +799,13 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
|| token.name() == asideTag
|| token.name() == blockquoteTag
|| token.name() == centerTag
- || token.name() == "details"
+ || token.name() == detailsTag
|| token.name() == dirTag
|| token.name() == divTag
|| token.name() == dlTag
|| token.name() == fieldsetTag
- || token.name() == "figure"
+ || token.name() == figcaptionTag
+ || token.name() == figureTag
|| token.name() == footerTag
|| token.name() == headerTag
|| token.name() == hgroupTag
@@ -819,13 +814,14 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
|| token.name() == olTag
|| token.name() == pTag
|| token.name() == sectionTag
+ || token.name() == summaryTag
|| token.name() == ulTag) {
- processFakePEndTagIfPInScope();
+ processFakePEndTagIfPInButtonScope();
m_tree.insertHTMLElement(token);
return;
}
if (isNumberedHeaderTag(token.name())) {
- processFakePEndTagIfPInScope();
+ processFakePEndTagIfPInButtonScope();
if (isNumberedHeaderTag(m_tree.currentElement()->localName())) {
parseError(token);
m_tree.openElements()->pop();
@@ -834,7 +830,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
return;
}
if (token.name() == preTag || token.name() == listingTag) {
- processFakePEndTagIfPInScope();
+ processFakePEndTagIfPInButtonScope();
m_tree.insertHTMLElement(token);
m_tokenizer->skipLeadingNewLineForListing();
m_framesetOk = false;
@@ -845,7 +841,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
parseError(token);
return;
}
- processFakePEndTagIfPInScope();
+ processFakePEndTagIfPInButtonScope();
m_tree.insertHTMLFormElement(token);
return;
}
@@ -858,7 +854,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
return;
}
if (token.name() == plaintextTag) {
- processFakePEndTagIfPInScope();
+ processFakePEndTagIfPInButtonScope();
m_tree.insertHTMLElement(token);
m_tokenizer->setState(HTMLTokenizer::PLAINTEXTState);
return;
@@ -927,8 +923,6 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
// Note the fall through to the imgTag handling below!
}
if (token.name() == areaTag
- || token.name() == basefontTag
- || token.name() == "bgsound"
|| token.name() == brTag
|| token.name() == embedTag
|| token.name() == imgTag
@@ -942,12 +936,12 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
}
if (token.name() == paramTag
|| token.name() == sourceTag
- || token.name() == "track") {
+ || token.name() == trackTag) {
m_tree.insertSelfClosingHTMLElement(token);
return;
}
if (token.name() == hrTag) {
- processFakePEndTagIfPInScope();
+ processFakePEndTagIfPInButtonScope();
m_tree.insertSelfClosingHTMLElement(token);
m_framesetOk = false;
return;
@@ -966,7 +960,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
return;
}
if (token.name() == xmpTag) {
- processFakePEndTagIfPInScope();
+ processFakePEndTagIfPInButtonScope();
m_tree.reconstructTheActiveFormattingElements();
m_framesetOk = false;
processGenericRawTextStartTag(token);
@@ -1231,6 +1225,8 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
return;
}
if (token.name() == baseTag
+ || token.name() == basefontTag
+ || token.name() == bgsoundTag
|| token.name() == linkTag
|| token.name() == metaTag
|| token.name() == noframesTag
@@ -1376,7 +1372,9 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
m_tree.insertHTMLHtmlStartTagInBody(token);
return;
}
- if (token.name() == linkTag
+ if (token.name() == basefontTag
+ || token.name() == bgsoundTag
+ || token.name() == linkTag
|| token.name() == metaTag
|| token.name() == noframesTag
|| token.name() == styleTag) {
@@ -1935,12 +1933,12 @@ void HTMLTreeBuilder::processEndTagForInBody(AtomicHTMLToken& token)
|| token.name() == blockquoteTag
|| token.name() == buttonTag
|| token.name() == centerTag
- || token.name() == "details"
+ || token.name() == detailsTag
|| token.name() == dirTag
|| token.name() == divTag
|| token.name() == dlTag
|| token.name() == fieldsetTag
- || token.name() == "figure"
+ || token.name() == figureTag
|| token.name() == footerTag
|| token.name() == headerTag
|| token.name() == hgroupTag
@@ -1973,7 +1971,7 @@ void HTMLTreeBuilder::processEndTagForInBody(AtomicHTMLToken& token)
m_tree.openElements()->remove(node.get());
}
if (token.name() == pTag) {
- if (!m_tree.openElements()->inScope(token.name())) {
+ if (!m_tree.openElements()->inButtonScope(token.name())) {
parseError(token);
processFakeStartTag(pTag);
ASSERT(m_tree.openElements()->inScope(token.name()));
@@ -2010,14 +2008,14 @@ void HTMLTreeBuilder::processEndTagForInBody(AtomicHTMLToken& token)
return;
}
if (isNumberedHeaderTag(token.name())) {
- if (!m_tree.openElements()->inScope(token.name())) {
+ if (!m_tree.openElements()->hasNumberedHeaderElementInScope()) {
parseError(token);
return;
}
m_tree.generateImpliedEndTags();
if (!m_tree.currentElement()->hasLocalName(token.name()))
parseError(token);
- m_tree.openElements()->popUntilPopped(token.name());
+ m_tree.openElements()->popUntilNumberedHeaderElementPopped();
return;
}
if (token.name() == "sarcasm") {
@@ -2434,10 +2432,6 @@ void HTMLTreeBuilder::processComment(AtomicHTMLToken& token)
void HTMLTreeBuilder::processCharacter(AtomicHTMLToken& token)
{
ASSERT(token.type() == HTMLToken::Character);
- // FIXME: Currently this design has an extra memcpy because we copy the
- // characters out of the HTMLTokenizer's buffer into the AtomicHTMLToken
- // and then into the text node. What we'd really like is to copy directly
- // from the HTMLTokenizer's buffer into the text node.
ExternalCharacterTokenBuffer buffer(token);
processCharacterBuffer(buffer);
}
@@ -2735,9 +2729,10 @@ bool HTMLTreeBuilder::processStartTagForInHead(AtomicHTMLToken& token)
m_tree.insertHTMLHtmlStartTagInBody(token);
return true;
}
- // FIXME: Atomize "command".
if (token.name() == baseTag
- || token.name() == "command"
+ || token.name() == basefontTag
+ || token.name() == bgsoundTag
+ || token.name() == commandTag
|| token.name() == linkTag
|| token.name() == metaTag) {
m_tree.insertSelfClosingHTMLElement(token);
diff --git a/WebCore/html/HTMLTreeBuilder.h b/WebCore/html/HTMLTreeBuilder.h
index 0f87cb0..d723384 100644
--- a/WebCore/html/HTMLTreeBuilder.h
+++ b/WebCore/html/HTMLTreeBuilder.h
@@ -140,7 +140,7 @@ private:
void processFakeStartTag(const QualifiedName&, PassRefPtr<NamedNodeMap> attributes = 0);
void processFakeEndTag(const QualifiedName&);
void processFakeCharacters(const String&);
- void processFakePEndTagIfPInScope();
+ void processFakePEndTagIfPInButtonScope();
void processGenericRCDATAStartTag(AtomicHTMLToken&);
void processGenericRawTextStartTag(AtomicHTMLToken&);
@@ -173,9 +173,6 @@ private:
// FIXME: Implement error reporting.
void parseError(AtomicHTMLToken&) { }
- void handleScriptStartTag();
- void handleScriptEndTag(Element*, int scriptStartLine);
-
InsertionMode insertionMode() const { return m_insertionMode; }
void setInsertionMode(InsertionMode mode)
{
diff --git a/WebCore/html/HTMLVideoElement.cpp b/WebCore/html/HTMLVideoElement.cpp
index a6fdb5f..bfdf241 100644
--- a/WebCore/html/HTMLVideoElement.cpp
+++ b/WebCore/html/HTMLVideoElement.cpp
@@ -101,7 +101,6 @@ void HTMLVideoElement::parseMappedAttribute(Attribute* attr)
const QualifiedName& attrName = attr->name();
if (attrName == posterAttr) {
- m_posterURL = getNonEmptyURLAttribute(posterAttr);
updatePosterImage();
if (m_shouldDisplayPosterImage) {
#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
@@ -110,7 +109,7 @@ void HTMLVideoElement::parseMappedAttribute(Attribute* attr)
m_imageLoader->updateFromElementIgnoringPreviousError();
#else
if (player())
- player()->setPoster(poster());
+ player()->setPoster(getNonEmptyURLAttribute(posterAttr));
#endif
}
} else if (attrName == widthAttr)
@@ -179,7 +178,7 @@ void HTMLVideoElement::updatePosterImage()
bool oldShouldShowPosterImage = m_shouldDisplayPosterImage;
#endif
- m_shouldDisplayPosterImage = !poster().isEmpty() && !hasAvailableVideoFrame();
+ m_shouldDisplayPosterImage = !getAttribute(posterAttr).isEmpty() && !hasAvailableVideoFrame();
#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
if (renderer() && oldShouldShowPosterImage != m_shouldDisplayPosterImage)
diff --git a/WebCore/html/HTMLVideoElement.h b/WebCore/html/HTMLVideoElement.h
index c27962f..e7c3f34 100644
--- a/WebCore/html/HTMLVideoElement.h
+++ b/WebCore/html/HTMLVideoElement.h
@@ -44,8 +44,6 @@ public:
unsigned videoWidth() const;
unsigned videoHeight() const;
- virtual const KURL poster() const { return m_posterURL; }
-
// Fullscreen
void webkitEnterFullscreen(bool isUserGesture, ExceptionCode&);
void webkitExitFullscreen();
@@ -84,7 +82,6 @@ private:
virtual void willMoveToNewOwnerDocument();
OwnPtr<HTMLImageLoader> m_imageLoader;
- KURL m_posterURL;
bool m_shouldDisplayPosterImage;
};
diff --git a/WebCore/html/HTMLVideoElement.idl b/WebCore/html/HTMLVideoElement.idl
index 248d0f4..ca5db5e 100644
--- a/WebCore/html/HTMLVideoElement.idl
+++ b/WebCore/html/HTMLVideoElement.idl
@@ -32,7 +32,7 @@ module html {
attribute [Reflect] unsigned long height;
readonly attribute unsigned long videoWidth;
readonly attribute unsigned long videoHeight;
- attribute [Reflect,NonEmpty,URL] DOMString poster;
+ attribute [Reflect,URL] DOMString poster;
readonly attribute boolean webkitSupportsFullscreen;
readonly attribute boolean webkitDisplayingFullscreen;
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index acd15d2..6c3d372 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -32,14 +32,14 @@
#include "CanvasRenderingContext2D.h"
#include "AffineTransform.h"
+#include "CSSMutableStyleDeclaration.h"
#include "CSSParser.h"
+#include "CSSPropertyNames.h"
+#include "CSSStyleSelector.h"
#include "CachedImage.h"
#include "CanvasGradient.h"
#include "CanvasPattern.h"
#include "CanvasStyle.h"
-#include "CSSMutableStyleDeclaration.h"
-#include "CSSPropertyNames.h"
-#include "CSSStyleSelector.h"
#include "ExceptionCode.h"
#include "FloatConversion.h"
#include "GraphicsContext.h"
@@ -47,6 +47,7 @@
#include "HTMLImageElement.h"
#include "HTMLMediaElement.h"
#include "HTMLNames.h"
+#include "HTMLVideoElement.h"
#include "ImageBuffer.h"
#include "ImageData.h"
#include "KURL.h"
@@ -56,8 +57,9 @@
#include "Settings.h"
#include "StrokeStyleApplier.h"
#include "TextMetrics.h"
-#include "HTMLVideoElement.h"
+
#include <stdio.h>
+
#include <wtf/ByteArray.h>
#include <wtf/MathExtras.h>
#include <wtf/OwnPtr.h>
@@ -78,7 +80,7 @@ public:
: m_canvasContext(canvasContext)
{
}
-
+
virtual void strokeStyle(GraphicsContext* c)
{
c->setStrokeThickness(m_canvasContext->lineWidth());
@@ -100,7 +102,7 @@ CanvasRenderingContext2D::CanvasRenderingContext2D(HTMLCanvasElement* canvas, bo
#endif
{
#if !ENABLE(DASHBOARD_SUPPORT)
- ASSERT_UNUSED(usesDashboardCompatibilityMode, !usesDashboardCompatibilityMode);
+ ASSERT_UNUSED(usesDashboardCompatibilityMode, !usesDashboardCompatibilityMode);
#endif
// Make sure that even if the drawingContext() has a different default
@@ -202,7 +204,7 @@ void CanvasRenderingContext2D::setFillStyle(PassRefPtr<CanvasStyle> style)
if (state().m_fillStyle && state().m_fillStyle->isEquivalentColor(*style))
return;
-
+
if (canvas()->originClean()) {
if (CanvasPattern* pattern = style->canvasPattern()) {
if (!pattern->originClean())
@@ -446,8 +448,7 @@ void CanvasRenderingContext2D::transform(float m11, float m12, float m21, float
if (!state().m_invertibleCTM)
return;
- if (!isfinite(m11) | !isfinite(m21) | !isfinite(dx) |
- !isfinite(m12) | !isfinite(m22) | !isfinite(dy))
+ if (!isfinite(m11) | !isfinite(m21) | !isfinite(dx) | !isfinite(m12) | !isfinite(m22) | !isfinite(dy))
return;
AffineTransform transform(m11, m12, m21, m22, dx, dy);
@@ -467,9 +468,8 @@ void CanvasRenderingContext2D::setTransform(float m11, float m12, float m21, flo
GraphicsContext* c = drawingContext();
if (!c)
return;
-
- if (!isfinite(m11) | !isfinite(m21) | !isfinite(dx) |
- !isfinite(m12) | !isfinite(m22) | !isfinite(dy))
+
+ if (!isfinite(m11) | !isfinite(m21) | !isfinite(dx) | !isfinite(m12) | !isfinite(m22) | !isfinite(dy))
return;
AffineTransform ctm = state().m_transform;
@@ -621,15 +621,15 @@ void CanvasRenderingContext2D::arcTo(float x1, float y1, float x2, float y2, flo
ec = 0;
if (!isfinite(x1) | !isfinite(y1) | !isfinite(x2) | !isfinite(y2) | !isfinite(r))
return;
-
+
if (r < 0) {
ec = INDEX_SIZE_ERR;
return;
}
-
+
if (!state().m_invertibleCTM)
return;
-
+
FloatPoint p1 = FloatPoint(x1, y1);
FloatPoint p2 = FloatPoint(x2, y2);
@@ -646,7 +646,7 @@ void CanvasRenderingContext2D::arc(float x, float y, float r, float sa, float ea
ec = 0;
if (!isfinite(x) | !isfinite(y) | !isfinite(r) | !isfinite(sa) | !isfinite(ea))
return;
-
+
if (r < 0) {
ec = INDEX_SIZE_ERR;
return;
@@ -659,7 +659,7 @@ void CanvasRenderingContext2D::arc(float x, float y, float r, float sa, float ea
return;
m_path.addArc(FloatPoint(x, y), r, sa, ea, anticlockwise);
}
-
+
static bool validateRectForCanvas(float& x, float& y, float& width, float& height)
{
if (!isfinite(x) | !isfinite(y) | !isfinite(width) | !isfinite(height))
@@ -672,12 +672,12 @@ static bool validateRectForCanvas(float& x, float& y, float& width, float& heigh
width = -width;
x -= width;
}
-
+
if (height < 0) {
height = -height;
y -= height;
}
-
+
return true;
}
@@ -835,7 +835,7 @@ void CanvasRenderingContext2D::strokeRect(float x, float y, float width, float h
{
if (!validateRectForCanvas(x, y, width, height))
return;
-
+
if (!(lineWidth >= 0))
return;
@@ -1082,7 +1082,7 @@ void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRec
return;
FloatRect imageRect = FloatRect(FloatPoint(), size(image));
- if (!imageRect.contains(normalizeRect(srcRect)) || srcRect.width() == 0 || srcRect.height() == 0) {
+ if (!imageRect.contains(normalizeRect(srcRect)) || !srcRect.width() || !srcRect.height()) {
ec = INDEX_SIZE_ERR;
return;
}
@@ -1153,7 +1153,7 @@ void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const
return;
}
- if (!srcCanvasRect.contains(normalizeRect(srcRect)) || srcRect.width() == 0 || srcRect.height() == 0) {
+ if (!srcCanvasRect.contains(normalizeRect(srcRect)) || !srcRect.width() || !srcRect.height()) {
ec = INDEX_SIZE_ERR;
return;
}
@@ -1168,10 +1168,10 @@ void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const
return;
if (!state().m_invertibleCTM)
return;
-
+
FloatRect sourceRect = c->roundToDevicePixels(srcRect);
FloatRect destRect = c->roundToDevicePixels(dstRect);
-
+
// FIXME: Do this through platform-independent GraphicsContext API.
ImageBuffer* buffer = sourceCanvas->buffer();
if (!buffer)
@@ -1223,21 +1223,21 @@ void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, const FloatRec
ec = TYPE_MISMATCH_ERR;
return;
}
-
+
ec = 0;
if (video->readyState() == HTMLMediaElement::HAVE_NOTHING || video->readyState() == HTMLMediaElement::HAVE_METADATA)
return;
FloatRect videoRect = FloatRect(FloatPoint(), size(video));
- if (!videoRect.contains(normalizeRect(srcRect)) || srcRect.width() == 0 || srcRect.height() == 0) {
+ if (!videoRect.contains(normalizeRect(srcRect)) || !srcRect.width() || !srcRect.height()) {
ec = INDEX_SIZE_ERR;
return;
}
-
+
if (!dstRect.width() || !dstRect.height())
return;
-
+
GraphicsContext* c = drawingContext();
if (!c)
return;
@@ -1257,7 +1257,7 @@ void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, const FloatRec
c->save();
c->clip(destRect);
c->translate(destRect.x(), destRect.y());
- c->scale(FloatSize(destRect.width()/sourceRect.width(), destRect.height()/sourceRect.height()));
+ c->scale(FloatSize(destRect.width() / sourceRect.width(), destRect.height() / sourceRect.height()));
c->translate(-sourceRect.x(), -sourceRect.y());
video->paintCurrentFrameInContext(c, IntRect(IntPoint(), size(video)));
c->restore();
@@ -1332,8 +1332,7 @@ PassRefPtr<CanvasGradient> CanvasRenderingContext2D::createLinearGradient(float
PassRefPtr<CanvasGradient> CanvasRenderingContext2D::createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, ExceptionCode& ec)
{
- if (!isfinite(x0) || !isfinite(y0) || !isfinite(r0) ||
- !isfinite(x1) || !isfinite(y1) || !isfinite(r1)) {
+ if (!isfinite(x0) || !isfinite(y0) || !isfinite(r0) || !isfinite(x1) || !isfinite(y1) || !isfinite(r1)) {
ec = NOT_SUPPORTED_ERR;
return 0;
}
@@ -1377,7 +1376,7 @@ PassRefPtr<CanvasPattern> CanvasRenderingContext2D::createPattern(HTMLCanvasElem
ec = INVALID_STATE_ERR;
return 0;
}
-
+
bool repeatX, repeatY;
ec = 0;
CanvasPattern::parseRepetitionType(repetitionType, repeatX, repeatY, ec);
@@ -1399,7 +1398,7 @@ void CanvasRenderingContext2D::willDraw(const FloatRect& r, unsigned options)
AffineTransform ctm = state().m_transform;
dirtyRect = ctm.mapRect(r);
}
-
+
if (options & CanvasWillDrawApplyShadow && alphaChannel(state().m_shadowColor)) {
// The shadow gets applied after transformation
FloatRect shadowRect(dirtyRect);
@@ -1407,13 +1406,13 @@ void CanvasRenderingContext2D::willDraw(const FloatRect& r, unsigned options)
shadowRect.inflate(state().m_shadowBlur);
dirtyRect.unite(shadowRect);
}
-
+
if (options & CanvasWillDrawApplyClip) {
// FIXME: apply the current clip to the rectangle. Unfortunately we can't get the clip
// back out of the GraphicsContext, so to take clip into account for incremental painting,
// we'd have to keep the clip path around.
}
-
+
canvas()->willDraw(dirtyRect);
}
@@ -1458,7 +1457,7 @@ PassRefPtr<ImageData> CanvasRenderingContext2D::createImageData(float sw, float
scaledSize.setWidth(1);
if (scaledSize.height() < 1)
scaledSize.setHeight(1);
-
+
return createEmptyImageData(scaledSize);
}
@@ -1498,15 +1497,14 @@ void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy,
putImageData(data, dx, dy, 0, 0, data->width(), data->height(), ec);
}
-void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, float dirtyX, float dirtyY,
+void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, float dirtyX, float dirtyY,
float dirtyWidth, float dirtyHeight, ExceptionCode& ec)
{
if (!data) {
ec = TYPE_MISMATCH_ERR;
return;
}
- if (!isfinite(dx) || !isfinite(dy) || !isfinite(dirtyX) ||
- !isfinite(dirtyY) || !isfinite(dirtyWidth) || !isfinite(dirtyHeight)) {
+ if (!isfinite(dx) || !isfinite(dy) || !isfinite(dirtyX) || !isfinite(dirtyY) || !isfinite(dirtyWidth) || !isfinite(dirtyHeight)) {
ec = NOT_SUPPORTED_ERR;
return;
}
@@ -1533,10 +1531,10 @@ void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy,
sourceRect.intersect(IntRect(IntPoint(), buffer->size()));
if (sourceRect.isEmpty())
return;
- willDraw(sourceRect, 0); // ignore transform, shadow and clip
+ willDraw(sourceRect, 0); // ignore transform, shadow and clip
sourceRect.move(-destOffset);
IntPoint destPoint(destOffset.width(), destOffset.height());
-
+
buffer->putUnmultipliedImageData(data, sourceRect, destPoint);
}
@@ -1549,16 +1547,16 @@ void CanvasRenderingContext2D::setFont(const String& newFont)
{
RefPtr<CSSMutableStyleDeclaration> tempDecl = CSSMutableStyleDeclaration::create();
CSSParser parser(!m_usesCSSCompatibilityParseMode);
-
+
String declarationText("font: ");
declarationText += newFont;
parser.parseDeclaration(tempDecl.get(), declarationText);
if (!tempDecl->length())
return;
-
+
// The parse succeeded.
state().m_unparsedFont = newFont;
-
+
// Map the <canvas> font into the text style. If the font uses keywords like larger/smaller, these will work
// relative to the canvas.
RefPtr<RenderStyle> newStyle = RenderStyle::create();
@@ -1568,7 +1566,7 @@ void CanvasRenderingContext2D::setFont(const String& newFont)
// Now map the font property into the style.
CSSStyleSelector* styleSelector = canvas()->styleSelector();
styleSelector->applyPropertyToStyle(CSSPropertyFont, tempDecl->getPropertyCSSValue(CSSPropertyFont).get(), newStyle.get());
-
+
state().m_font = newStyle->font();
state().m_font.update(styleSelector->fontSelector());
state().m_realizedFont = true;
@@ -1595,7 +1593,7 @@ void CanvasRenderingContext2D::setTextAlign(const String& s)
return;
state().m_textAlign = align;
}
-
+
String CanvasRenderingContext2D::textBaseline() const
{
return textBaselineName(state().m_textBaseline);
@@ -1643,7 +1641,7 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
return;
if (!state().m_invertibleCTM)
return;
-
+
const Font& font = accessFont();
// FIXME: Handle maxWidth.
@@ -1660,23 +1658,23 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
// Draw the item text at the correct point.
FloatPoint location(x, y);
switch (state().m_textBaseline) {
- case TopTextBaseline:
- case HangingTextBaseline:
- location.setY(y + font.ascent());
- break;
- case BottomTextBaseline:
- case IdeographicTextBaseline:
- location.setY(y - font.descent());
- break;
- case MiddleTextBaseline:
- location.setY(y - font.descent() + font.height() / 2);
- break;
- case AlphabeticTextBaseline:
- default:
- // Do nothing.
- break;
+ case TopTextBaseline:
+ case HangingTextBaseline:
+ location.setY(y + font.ascent());
+ break;
+ case BottomTextBaseline:
+ case IdeographicTextBaseline:
+ location.setY(y - font.descent());
+ break;
+ case MiddleTextBaseline:
+ location.setY(y - font.descent() + font.height() / 2);
+ break;
+ case AlphabeticTextBaseline:
+ default:
+ // Do nothing.
+ break;
}
-
+
float width = font.width(TextRun(text, false, 0, 0, rtl, override));
TextAlign align = state().m_textAlign;
@@ -1684,18 +1682,18 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
align = rtl ? RightTextAlign : LeftTextAlign;
else if (align == EndTextAlign)
align = rtl ? LeftTextAlign : RightTextAlign;
-
+
switch (align) {
- case CenterTextAlign:
- location.setX(location.x() - width / 2);
- break;
- case RightTextAlign:
- location.setX(location.x() - width);
- break;
- default:
- break;
+ case CenterTextAlign:
+ location.setX(location.x() - width / 2);
+ break;
+ case RightTextAlign:
+ location.setX(location.x() - width);
+ break;
+ default:
+ break;
}
-
+
// The slop built in to this mask rect matches the heuristic used in FontCGWin.cpp for GDI text.
FloatRect textRect = FloatRect(location.x() - font.height() / 2, location.y() - font.ascent() - font.lineGap(),
width + font.height(), font.lineSpacing());
@@ -1709,7 +1707,7 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
// punt and dirty the whole canvas.
canvas()->willDraw(FloatRect(0, 0, canvas()->width(), canvas()->height()));
}
-
+
#if PLATFORM(CG)
CanvasStyle* drawStyle = fill ? state().m_fillStyle.get() : state().m_strokeStyle.get();
if (drawStyle->canvasGradient() || drawStyle->canvasPattern()) {
@@ -1729,9 +1727,9 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
maskImageContext->setTextDrawingMode(fill ? cTextFill : cTextStroke);
maskImageContext->translate(-maskRect.x(), -maskRect.y());
-
+
maskImageContext->drawBidiText(font, textRun, location);
-
+
c->save();
c->clipToImageBuffer(maskRect, maskImage.get());
drawStyle->applyFillColor(c);
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.h b/WebCore/html/canvas/CanvasRenderingContext2D.h
index 2eac88d..fb5f27a 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.h
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.h
@@ -34,8 +34,9 @@
#include "GraphicsTypes.h"
#include "Path.h"
#include "PlatformString.h"
-#include <wtf/text/StringHash.h>
+
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
#if PLATFORM(CG)
#include <ApplicationServices/ApplicationServices.h>
@@ -43,243 +44,243 @@
namespace WebCore {
- class CanvasGradient;
- class CanvasPattern;
- class CanvasStyle;
- class FloatRect;
- class GraphicsContext;
- class HTMLCanvasElement;
- class HTMLImageElement;
- class HTMLVideoElement;
- class ImageData;
- class KURL;
- class TextMetrics;
-
- typedef int ExceptionCode;
+class CanvasGradient;
+class CanvasPattern;
+class CanvasStyle;
+class FloatRect;
+class GraphicsContext;
+class HTMLCanvasElement;
+class HTMLImageElement;
+class HTMLVideoElement;
+class ImageData;
+class KURL;
+class TextMetrics;
+
+typedef int ExceptionCode;
+
+class CanvasRenderingContext2D : public CanvasRenderingContext {
+public:
+ CanvasRenderingContext2D(HTMLCanvasElement*, bool usesCSSCompatibilityParseMode, bool usesDashboardCompatibilityMode);
- class CanvasRenderingContext2D : public CanvasRenderingContext {
- public:
- CanvasRenderingContext2D(HTMLCanvasElement*, bool usesCSSCompatibilityParseMode, bool usesDashboardCompatibilityMode);
-
- virtual ~CanvasRenderingContext2D();
-
- virtual bool is2d() const { return true; }
-
- CanvasStyle* strokeStyle() const;
- void setStrokeStyle(PassRefPtr<CanvasStyle>);
-
- CanvasStyle* fillStyle() const;
- void setFillStyle(PassRefPtr<CanvasStyle>);
-
- float lineWidth() const;
- void setLineWidth(float);
-
- String lineCap() const;
- void setLineCap(const String&);
-
- String lineJoin() const;
- void setLineJoin(const String&);
-
- float miterLimit() const;
- void setMiterLimit(float);
-
- float shadowOffsetX() const;
- void setShadowOffsetX(float);
-
- float shadowOffsetY() const;
- void setShadowOffsetY(float);
-
- float shadowBlur() const;
- void setShadowBlur(float);
-
- String shadowColor() const;
- void setShadowColor(const String&);
-
- float globalAlpha() const;
- void setGlobalAlpha(float);
-
- String globalCompositeOperation() const;
- void setGlobalCompositeOperation(const String&);
-
- void save();
- void restore();
-
- void scale(float sx, float sy);
- void rotate(float angleInRadians);
- void translate(float tx, float ty);
- void transform(float m11, float m12, float m21, float m22, float dx, float dy);
- void setTransform(float m11, float m12, float m21, float m22, float dx, float dy);
-
- void setStrokeColor(const String& color);
- void setStrokeColor(float grayLevel);
- void setStrokeColor(const String& color, float alpha);
- void setStrokeColor(float grayLevel, float alpha);
- void setStrokeColor(float r, float g, float b, float a);
- void setStrokeColor(float c, float m, float y, float k, float a);
-
- void setFillColor(const String& color);
- void setFillColor(float grayLevel);
- void setFillColor(const String& color, float alpha);
- void setFillColor(float grayLevel, float alpha);
- void setFillColor(float r, float g, float b, float a);
- void setFillColor(float c, float m, float y, float k, float a);
-
- void beginPath();
- void closePath();
-
- void moveTo(float x, float y);
- void lineTo(float x, float y);
- void quadraticCurveTo(float cpx, float cpy, float x, float y);
- void bezierCurveTo(float cp1x, float cp1y, float cp2x, float cp2y, float x, float y);
- void arcTo(float x0, float y0, float x1, float y1, float radius, ExceptionCode&);
- void arc(float x, float y, float r, float sa, float ea, bool clockwise, ExceptionCode&);
- void rect(float x, float y, float width, float height);
-
- void fill();
- void stroke();
- void clip();
-
- bool isPointInPath(const float x, const float y);
-
- void clearRect(float x, float y, float width, float height);
- void fillRect(float x, float y, float width, float height);
- void strokeRect(float x, float y, float width, float height);
- void strokeRect(float x, float y, float width, float height, float lineWidth);
-
- void setShadow(float width, float height, float blur);
- void setShadow(float width, float height, float blur, const String& color);
- void setShadow(float width, float height, float blur, float grayLevel);
- void setShadow(float width, float height, float blur, const String& color, float alpha);
- void setShadow(float width, float height, float blur, float grayLevel, float alpha);
- void setShadow(float width, float height, float blur, float r, float g, float b, float a);
- void setShadow(float width, float height, float blur, float c, float m, float y, float k, float a);
+ virtual ~CanvasRenderingContext2D();
+
+ virtual bool is2d() const { return true; }
+
+ CanvasStyle* strokeStyle() const;
+ void setStrokeStyle(PassRefPtr<CanvasStyle>);
+
+ CanvasStyle* fillStyle() const;
+ void setFillStyle(PassRefPtr<CanvasStyle>);
+
+ float lineWidth() const;
+ void setLineWidth(float);
+
+ String lineCap() const;
+ void setLineCap(const String&);
+
+ String lineJoin() const;
+ void setLineJoin(const String&);
+
+ float miterLimit() const;
+ void setMiterLimit(float);
+
+ float shadowOffsetX() const;
+ void setShadowOffsetX(float);
+
+ float shadowOffsetY() const;
+ void setShadowOffsetY(float);
+
+ float shadowBlur() const;
+ void setShadowBlur(float);
+
+ String shadowColor() const;
+ void setShadowColor(const String&);
+
+ float globalAlpha() const;
+ void setGlobalAlpha(float);
+
+ String globalCompositeOperation() const;
+ void setGlobalCompositeOperation(const String&);
+
+ void save();
+ void restore();
+
+ void scale(float sx, float sy);
+ void rotate(float angleInRadians);
+ void translate(float tx, float ty);
+ void transform(float m11, float m12, float m21, float m22, float dx, float dy);
+ void setTransform(float m11, float m12, float m21, float m22, float dx, float dy);
+
+ void setStrokeColor(const String& color);
+ void setStrokeColor(float grayLevel);
+ void setStrokeColor(const String& color, float alpha);
+ void setStrokeColor(float grayLevel, float alpha);
+ void setStrokeColor(float r, float g, float b, float a);
+ void setStrokeColor(float c, float m, float y, float k, float a);
+
+ void setFillColor(const String& color);
+ void setFillColor(float grayLevel);
+ void setFillColor(const String& color, float alpha);
+ void setFillColor(float grayLevel, float alpha);
+ void setFillColor(float r, float g, float b, float a);
+ void setFillColor(float c, float m, float y, float k, float a);
+
+ void beginPath();
+ void closePath();
+
+ void moveTo(float x, float y);
+ void lineTo(float x, float y);
+ void quadraticCurveTo(float cpx, float cpy, float x, float y);
+ void bezierCurveTo(float cp1x, float cp1y, float cp2x, float cp2y, float x, float y);
+ void arcTo(float x0, float y0, float x1, float y1, float radius, ExceptionCode&);
+ void arc(float x, float y, float r, float sa, float ea, bool clockwise, ExceptionCode&);
+ void rect(float x, float y, float width, float height);
+
+ void fill();
+ void stroke();
+ void clip();
+
+ bool isPointInPath(const float x, const float y);
+
+ void clearRect(float x, float y, float width, float height);
+ void fillRect(float x, float y, float width, float height);
+ void strokeRect(float x, float y, float width, float height);
+ void strokeRect(float x, float y, float width, float height, float lineWidth);
+
+ void setShadow(float width, float height, float blur);
+ void setShadow(float width, float height, float blur, const String& color);
+ void setShadow(float width, float height, float blur, float grayLevel);
+ void setShadow(float width, float height, float blur, const String& color, float alpha);
+ void setShadow(float width, float height, float blur, float grayLevel, float alpha);
+ void setShadow(float width, float height, float blur, float r, float g, float b, float a);
+ void setShadow(float width, float height, float blur, float c, float m, float y, float k, float a);
- void clearShadow();
-
- void drawImage(HTMLImageElement*, float x, float y, ExceptionCode&);
- void drawImage(HTMLImageElement*, float x, float y, float width, float height, ExceptionCode&);
- void drawImage(HTMLImageElement*, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&);
- void drawImage(HTMLImageElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode&);
- void drawImage(HTMLCanvasElement*, float x, float y, ExceptionCode&);
- void drawImage(HTMLCanvasElement*, float x, float y, float width, float height, ExceptionCode&);
- void drawImage(HTMLCanvasElement*, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&);
- void drawImage(HTMLCanvasElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode&);
+ void clearShadow();
+
+ void drawImage(HTMLImageElement*, float x, float y, ExceptionCode&);
+ void drawImage(HTMLImageElement*, float x, float y, float width, float height, ExceptionCode&);
+ void drawImage(HTMLImageElement*, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&);
+ void drawImage(HTMLImageElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode&);
+ void drawImage(HTMLCanvasElement*, float x, float y, ExceptionCode&);
+ void drawImage(HTMLCanvasElement*, float x, float y, float width, float height, ExceptionCode&);
+ void drawImage(HTMLCanvasElement*, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&);
+ void drawImage(HTMLCanvasElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode&);
#if ENABLE(VIDEO)
- void drawImage(HTMLVideoElement*, float x, float y, ExceptionCode&);
- void drawImage(HTMLVideoElement*, float x, float y, float width, float height, ExceptionCode&);
- void drawImage(HTMLVideoElement*, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&);
- void drawImage(HTMLVideoElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode&);
+ void drawImage(HTMLVideoElement*, float x, float y, ExceptionCode&);
+ void drawImage(HTMLVideoElement*, float x, float y, float width, float height, ExceptionCode&);
+ void drawImage(HTMLVideoElement*, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&);
+ void drawImage(HTMLVideoElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode&);
#endif
- void drawImageFromRect(HTMLImageElement*, float sx, float sy, float sw, float sh,
- float dx, float dy, float dw, float dh, const String& compositeOperation);
-
- void setAlpha(float);
-
- void setCompositeOperation(const String&);
-
- PassRefPtr<CanvasGradient> createLinearGradient(float x0, float y0, float x1, float y1, ExceptionCode&);
- PassRefPtr<CanvasGradient> createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, ExceptionCode&);
- PassRefPtr<CanvasPattern> createPattern(HTMLImageElement*, const String& repetitionType, ExceptionCode&);
- PassRefPtr<CanvasPattern> createPattern(HTMLCanvasElement*, const String& repetitionType, ExceptionCode&);
-
- PassRefPtr<ImageData> createImageData(PassRefPtr<ImageData> imageData, ExceptionCode&) const;
- PassRefPtr<ImageData> createImageData(float width, float height, ExceptionCode&) const;
- PassRefPtr<ImageData> getImageData(float sx, float sy, float sw, float sh, ExceptionCode&) const;
- void putImageData(ImageData*, float dx, float dy, ExceptionCode&);
- void putImageData(ImageData*, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&);
-
- void reset();
-
- String font() const;
- void setFont(const String&);
- void updateFont();
-
- String textAlign() const;
- void setTextAlign(const String&);
-
- String textBaseline() const;
- void setTextBaseline(const String&);
-
- void fillText(const String& text, float x, float y);
- void fillText(const String& text, float x, float y, float maxWidth);
- void strokeText(const String& text, float x, float y);
- void strokeText(const String& text, float x, float y, float maxWidth);
- PassRefPtr<TextMetrics> measureText(const String& text);
-
- LineCap getLineCap() const { return state().m_lineCap; }
- LineJoin getLineJoin() const { return state().m_lineJoin; }
-
- private:
- struct State {
- State();
-
- String m_unparsedStrokeColor;
- String m_unparsedFillColor;
- RefPtr<CanvasStyle> m_strokeStyle;
- RefPtr<CanvasStyle> m_fillStyle;
- float m_lineWidth;
- LineCap m_lineCap;
- LineJoin m_lineJoin;
- float m_miterLimit;
- FloatSize m_shadowOffset;
- float m_shadowBlur;
- RGBA32 m_shadowColor;
- float m_globalAlpha;
- CompositeOperator m_globalComposite;
- AffineTransform m_transform;
- bool m_invertibleCTM;
-
- // Text state.
- TextAlign m_textAlign;
- TextBaseline m_textBaseline;
-
- String m_unparsedFont;
- Font m_font;
- bool m_realizedFont;
- };
- Path m_path;
-
- State& state() { return m_stateStack.last(); }
- const State& state() const { return m_stateStack.last(); }
-
- void applyShadow();
-
- enum CanvasWillDrawOption {
- CanvasWillDrawApplyTransform = 1,
- CanvasWillDrawApplyShadow = 1 << 1,
- CanvasWillDrawApplyClip = 1 << 2,
- CanvasWillDrawApplyAll = 0xffffffff
- };
-
- void willDraw(const FloatRect&, unsigned options = CanvasWillDrawApplyAll);
-
- GraphicsContext* drawingContext() const;
-
- void applyStrokePattern();
- void applyFillPattern();
-
- void drawTextInternal(const String& text, float x, float y, bool fill, float maxWidth = 0, bool useMaxWidth = false);
-
- const Font& accessFont();
+ void drawImageFromRect(HTMLImageElement*, float sx, float sy, float sw, float sh,
+ float dx, float dy, float dw, float dh, const String& compositeOperation);
+
+ void setAlpha(float);
+
+ void setCompositeOperation(const String&);
+
+ PassRefPtr<CanvasGradient> createLinearGradient(float x0, float y0, float x1, float y1, ExceptionCode&);
+ PassRefPtr<CanvasGradient> createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, ExceptionCode&);
+ PassRefPtr<CanvasPattern> createPattern(HTMLImageElement*, const String& repetitionType, ExceptionCode&);
+ PassRefPtr<CanvasPattern> createPattern(HTMLCanvasElement*, const String& repetitionType, ExceptionCode&);
+
+ PassRefPtr<ImageData> createImageData(PassRefPtr<ImageData> imageData, ExceptionCode&) const;
+ PassRefPtr<ImageData> createImageData(float width, float height, ExceptionCode&) const;
+ PassRefPtr<ImageData> getImageData(float sx, float sy, float sw, float sh, ExceptionCode&) const;
+ void putImageData(ImageData*, float dx, float dy, ExceptionCode&);
+ void putImageData(ImageData*, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&);
+
+ void reset();
+
+ String font() const;
+ void setFont(const String&);
+ void updateFont();
+
+ String textAlign() const;
+ void setTextAlign(const String&);
+
+ String textBaseline() const;
+ void setTextBaseline(const String&);
+
+ void fillText(const String& text, float x, float y);
+ void fillText(const String& text, float x, float y, float maxWidth);
+ void strokeText(const String& text, float x, float y);
+ void strokeText(const String& text, float x, float y, float maxWidth);
+ PassRefPtr<TextMetrics> measureText(const String& text);
+
+ LineCap getLineCap() const { return state().m_lineCap; }
+ LineJoin getLineJoin() const { return state().m_lineJoin; }
+
+private:
+ struct State {
+ State();
+
+ String m_unparsedStrokeColor;
+ String m_unparsedFillColor;
+ RefPtr<CanvasStyle> m_strokeStyle;
+ RefPtr<CanvasStyle> m_fillStyle;
+ float m_lineWidth;
+ LineCap m_lineCap;
+ LineJoin m_lineJoin;
+ float m_miterLimit;
+ FloatSize m_shadowOffset;
+ float m_shadowBlur;
+ RGBA32 m_shadowColor;
+ float m_globalAlpha;
+ CompositeOperator m_globalComposite;
+ AffineTransform m_transform;
+ bool m_invertibleCTM;
+
+ // Text state.
+ TextAlign m_textAlign;
+ TextBaseline m_textBaseline;
+
+ String m_unparsedFont;
+ Font m_font;
+ bool m_realizedFont;
+ };
+ Path m_path;
+
+ State& state() { return m_stateStack.last(); }
+ const State& state() const { return m_stateStack.last(); }
+
+ void applyShadow();
+
+ enum CanvasWillDrawOption {
+ CanvasWillDrawApplyTransform = 1,
+ CanvasWillDrawApplyShadow = 1 << 1,
+ CanvasWillDrawApplyClip = 1 << 2,
+ CanvasWillDrawApplyAll = 0xffffffff
+ };
+
+ void willDraw(const FloatRect&, unsigned options = CanvasWillDrawApplyAll);
+
+ GraphicsContext* drawingContext() const;
+
+ void applyStrokePattern();
+ void applyFillPattern();
+
+ void drawTextInternal(const String& text, float x, float y, bool fill, float maxWidth = 0, bool useMaxWidth = false);
+
+ const Font& accessFont();
#if ENABLE(DASHBOARD_SUPPORT)
- void clearPathForDashboardBackwardCompatibilityMode();
+ void clearPathForDashboardBackwardCompatibilityMode();
#endif
-
- void prepareGradientForDashboard(CanvasGradient* gradient) const;
- HashSet<String> m_cleanOrigins;
+ void prepareGradientForDashboard(CanvasGradient* gradient) const;
- void checkOrigin(const KURL&);
- void checkOrigin(const String&);
+ HashSet<String> m_cleanOrigins;
- Vector<State, 1> m_stateStack;
- bool m_usesCSSCompatibilityParseMode;
+ void checkOrigin(const KURL&);
+ void checkOrigin(const String&);
+
+ Vector<State, 1> m_stateStack;
+ bool m_usesCSSCompatibilityParseMode;
#if ENABLE(DASHBOARD_SUPPORT)
- bool m_usesDashboardCompatibilityMode;
+ bool m_usesDashboardCompatibilityMode;
#endif
- };
+};
} // namespace WebCore
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index f567ac8..fb17db9 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -141,18 +141,22 @@ void WebGLRenderingContext::markContextChanged()
RenderBox* renderBox = canvas()->renderBox();
if (renderBox && renderBox->hasLayer() && renderBox->layer()->hasAcceleratedCompositing())
renderBox->layer()->rendererContentChanged();
+ else {
#endif
- if (!m_markedCanvasDirty) {
- // Make sure the canvas's image buffer is allocated.
- canvas()->buffer();
- canvas()->willDraw(FloatRect(0, 0, canvas()->width(), canvas()->height()));
- m_markedCanvasDirty = true;
+ if (!m_markedCanvasDirty)
+ canvas()->willDraw(FloatRect(0, 0, canvas()->width(), canvas()->height()));
+#if USE(ACCELERATED_COMPOSITING)
}
+#endif
+ m_markedCanvasDirty = true;
}
bool WebGLRenderingContext::paintRenderingResultsToCanvas()
{
if (m_markedCanvasDirty) {
+ // FIXME: It should not be necessary to clear the image before doing a readback.
+ // Investigate why this is needed and remove if possible.
+ canvas()->buffer()->clearImage();
m_markedCanvasDirty = false;
m_context->paintRenderingResultsToCanvas(this);
return true;
diff --git a/WebCore/inspector/CodeGeneratorInspector.pm b/WebCore/inspector/CodeGeneratorInspector.pm
index afaddec..5488dbd 100644
--- a/WebCore/inspector/CodeGeneratorInspector.pm
+++ b/WebCore/inspector/CodeGeneratorInspector.pm
@@ -14,6 +14,10 @@ $typeTransform{"InspectorClient"} = {
"forward" => "InspectorClient",
"header" => "InspectorClient.h",
};
+$typeTransform{"InspectorBackend"} = {
+ "forward" => "InspectorBackend",
+ "header" => "InspectorBackend.h",
+};
$typeTransform{"PassRefPtr"} = {
"forwardHeader" => "wtf/PassRefPtr.h",
};
@@ -95,6 +99,13 @@ my $verbose;
my $namespace;
+my $backendClassName;
+my %backendTypes;
+my %backendMethods;
+my @backendMethodsImpl;
+my $backendConstructor;
+my $backendFooter;
+
my $frontendClassName;
my %frontendTypes;
my %frontendMethods;
@@ -150,6 +161,18 @@ sub GenerateInterface
$frontendTypes{"InspectorClient"} = 1;
$frontendTypes{"PassRefPtr"} = 1;
+ $backendClassName = $className . "BackendDispatcher";
+ my @backendHead;
+ push(@backendHead, " ${backendClassName}(InspectorBackend* inspectorBackend) : m_inspectorBackend(inspectorBackend) { }");
+ push(@backendHead, " void dispatch(const String& message);");
+ push(@backendHead, "private:");
+ $backendConstructor = join("\n", @backendHead);
+ $backendFooter = " InspectorBackend* m_inspectorBackend;";
+ $backendTypes{"InspectorBackend"} = 1;
+ $backendTypes{"PassRefPtr"} = 1;
+ $backendTypes{"Array"} = 1;
+
+ generateBackendPrivateFunctions();
generateFunctions($interface);
}
@@ -159,7 +182,9 @@ sub generateFunctions
foreach my $function (@{$interface->functions}) {
generateFrontendFunction($function);
+ generateBackendFunction($function);
}
+ push(@backendMethodsImpl, generateBackendDispatcher());
}
sub generateFrontendFunction
@@ -198,6 +223,120 @@ sub generateFrontendFunction
}
}
+sub generateBackendPrivateFunctions
+{
+ my $privateFunctions = << "EOF";
+static String formatWrongArgumentsCountMessage(unsigned expected, unsigned actual)
+{
+ return String::format(\"Wrong number of parameters: %d (expected: %d)\", actual, expected);
+}
+
+static String formatWrongArgumentTypeMessage(unsigned position, const char* name, const char* expectedType)
+{
+ return String::format(\"Failed to convert parameter %d (%s) to %s\", position, name, expectedType);
+}
+EOF
+ push(@backendMethodsImpl, $privateFunctions);
+}
+
+sub generateBackendFunction
+{
+ my $function = shift;
+ return if $function->signature->extendedAttributes->{"notify"};
+
+ my $functionName = $function->signature->name;
+
+ my @argsFiltered = grep($_->direction eq "in", @{$function->parameters});
+ map($backendTypes{$_->type} = 1, @argsFiltered); # register required types
+ my $arguments = join(", ", map($typeTransform{$_->type}->{"param"} . " " . $_->name, @argsFiltered));
+
+ my $signature = " void ${functionName}(PassRefPtr<InspectorArray> args, String* exception);";
+ !$backendMethods{${signature}} || die "Duplicate function was detected for signature '$signature'.";
+ $backendMethods{${signature}} = $functionName;
+
+ my @function;
+ push(@function, "void ${backendClassName}::${functionName}(PassRefPtr<InspectorArray> args, String* exception)");
+ push(@function, "{");
+ my $i = 1; # zero element is the method name.
+ my $expectedParametersCount = scalar(@argsFiltered);
+ my $expectedParametersCountWithMethodName = scalar(@argsFiltered) + 1;
+ push(@function, " if (args->length() != $expectedParametersCountWithMethodName) {");
+ push(@function, " *exception = formatWrongArgumentsCountMessage(args->length() - 1, $expectedParametersCount);");
+ push(@function, " ASSERT_NOT_REACHED();");
+ push(@function, " return;");
+ push(@function, " }");
+
+ foreach my $parameter (@argsFiltered) {
+ my $parameterType = $parameter->type;
+ push(@function, " " . $typeTransform{$parameterType}->{"retVal"} . " " . $parameter->name . ";");
+ push(@function, " if (!args->get(" . $i . ")->as" . $typeTransform{$parameterType}->{"accessorSuffix"} . "(&" . $parameter->name . ")) {");
+ push(@function, " *exception = formatWrongArgumentTypeMessage($i, \"" . $parameter->name . "\", \"$parameterType\");");
+ push(@function, " ASSERT_NOT_REACHED();");
+ push(@function, " return;");
+ push(@function, " }");
+ ++$i;
+ }
+ push(@function, " m_inspectorBackend->$functionName(" . join(", ", map($_->name, @argsFiltered)) . ");");
+ push(@function, "}");
+ push(@function, "");
+ push(@backendMethodsImpl, @function);
+}
+
+sub generateBackendDispatcher
+{
+ my @body;
+ my @methods = map($backendMethods{$_}, keys %backendMethods);
+ my @mapEntries = map("dispatchMap.add(\"$_\", &${backendClassName}::$_);", @methods);
+
+ push(@body, "void ${backendClassName}::dispatch(const String& message)");
+ push(@body, "{");
+ push(@body, " String exception;");
+ push(@body, " typedef void (${backendClassName}::*CallHandler)(PassRefPtr<InspectorArray> args, String* exception);");
+ push(@body, " typedef HashMap<String, CallHandler> DispatchMap;");
+ push(@body, " DEFINE_STATIC_LOCAL(DispatchMap, dispatchMap, );");
+ push(@body, " if (dispatchMap.isEmpty()) {");
+ push(@body, map(" $_", @mapEntries));
+ push(@body, " }");
+ push(@body, "");
+ push(@body, " RefPtr<InspectorValue> parsedMessage = InspectorValue::parseJSON(message);");
+ push(@body, " if (!parsedMessage) {");
+ push(@body, " ASSERT_NOT_REACHED();");
+ push(@body, " exception = \"Error: Invalid message format. Message should be in JSON format.\";");
+ push(@body, " return;");
+ push(@body, " }");
+ push(@body, "");
+ push(@body, " RefPtr<InspectorArray> messageArray = parsedMessage->asArray();");
+ push(@body, " if (!messageArray) {");
+ push(@body, " ASSERT_NOT_REACHED();");
+ push(@body, " exception = \"Error: Invalid message format. The message should be a JSONified array of arguments.\";");
+ push(@body, " return;");
+ push(@body, " }");
+ push(@body, "");
+ push(@body, " if (!messageArray->length()) {");
+ push(@body, " ASSERT_NOT_REACHED();");
+ push(@body, " exception = \"Error: Invalid message format. Empty message was received.\";");
+ push(@body, " return;");
+ push(@body, " }");
+ push(@body, "");
+ push(@body, " String methodName;");
+ push(@body, " if (!messageArray->get(0)->asString(&methodName)) {");
+ push(@body, " ASSERT_NOT_REACHED();");
+ push(@body, " exception = \"Error: Invalid message format. The first element of the message should be method name.\";");
+ push(@body, " return;");
+ push(@body, " }");
+ push(@body, "");
+ push(@body, " HashMap<String, CallHandler>::iterator it = dispatchMap.find(methodName);");
+ push(@body, " if (it == dispatchMap.end()) {");
+ push(@body, " ASSERT_NOT_REACHED();");
+ push(@body, " exception = String::format(\"Error: Invalid method name. '%s' wasn't found.\", methodName.utf8().data());");
+ push(@body, " return;");
+ push(@body, " }");
+ push(@body, "");
+ push(@body, " ((*this).*it->second)(messageArray, &exception);");
+ push(@body, "}");
+ return @body;
+}
+
sub generateHeader
{
my $className = shift;
@@ -284,6 +423,15 @@ sub finish
close($HEADER);
undef($HEADER);
+ open($SOURCE, ">$outputDir/$backendClassName.cpp") || die "Couldn't open file $outputDir/$backendClassName.cpp";
+ print $SOURCE join("\n", generateSource($backendClassName, \%backendTypes, \@backendMethodsImpl));
+ close($SOURCE);
+ undef($SOURCE);
+
+ open($HEADER, ">$outputHeadersDir/$backendClassName.h") || die "Couldn't open file $outputHeadersDir/$backendClassName.h";
+ print $HEADER join("\n", generateHeader($backendClassName, \%backendTypes, $backendConstructor, \%backendMethods, $backendFooter));
+ close($HEADER);
+ undef($HEADER);
}
1;
diff --git a/WebCore/inspector/ConsoleMessage.cpp b/WebCore/inspector/ConsoleMessage.cpp
index 79b5115..9c0b783 100644
--- a/WebCore/inspector/ConsoleMessage.cpp
+++ b/WebCore/inspector/ConsoleMessage.cpp
@@ -34,9 +34,13 @@
#include "InjectedScript.h"
#include "InjectedScriptHost.h"
#include "InspectorFrontend.h"
+#include "InspectorValues.h"
#include "ScriptCallStack.h"
#include "ScriptObject.h"
-#include "SerializedScriptValue.h"
+
+#if ENABLE(INSPECTOR)
+#include "RemoteInspectorFrontend.h"
+#endif
namespace WebCore {
@@ -59,14 +63,16 @@ bool ConsoleMessage::CallFrame::isEqual(const ConsoleMessage::CallFrame& o) cons
&& m_lineNumber == o.m_lineNumber;
}
-ScriptObject ConsoleMessage::CallFrame::buildObject(InspectorFrontend* frontend) const
+#if ENABLE(INSPECTOR)
+PassRefPtr<InspectorObject> ConsoleMessage::CallFrame::buildInspectorObject() const
{
- ScriptObject frame = frontend->newScriptObject();
- frame.set("functionName", m_functionName);
- frame.set("sourceURL", m_sourceURL.string());
- frame.set("lineNumber", m_lineNumber);
+ RefPtr<InspectorObject> frame = InspectorObject::create();
+ frame->setString("functionName", m_functionName);
+ frame->setString("sourceURL", m_sourceURL.string());
+ frame->setNumber("lineNumber", m_lineNumber);
return frame;
}
+#endif
ConsoleMessage::ConsoleMessage(MessageSource s, MessageType t, MessageLevel l, const String& m, unsigned li, const String& u, unsigned g)
: m_source(s)
@@ -109,39 +115,40 @@ ConsoleMessage::ConsoleMessage(MessageSource s, MessageType t, MessageLevel l, c
}
#if ENABLE(INSPECTOR)
-void ConsoleMessage::addToFrontend(InspectorFrontend* frontend, InjectedScriptHost* injectedScriptHost)
+void ConsoleMessage::addToFrontend(RemoteInspectorFrontend* frontend, InjectedScriptHost* injectedScriptHost)
{
- ScriptObject jsonObj = frontend->newScriptObject();
- jsonObj.set("source", static_cast<int>(m_source));
- jsonObj.set("type", static_cast<int>(m_type));
- jsonObj.set("level", static_cast<int>(m_level));
- jsonObj.set("line", static_cast<int>(m_line));
- jsonObj.set("url", m_url);
- jsonObj.set("groupLevel", static_cast<int>(m_groupLevel));
- jsonObj.set("repeatCount", static_cast<int>(m_repeatCount));
- jsonObj.set("message", m_message);
+ RefPtr<InspectorObject> jsonObj = InspectorObject::create();
+ jsonObj->setNumber("source", static_cast<int>(m_source));
+ jsonObj->setNumber("type", static_cast<int>(m_type));
+ jsonObj->setNumber("level", static_cast<int>(m_level));
+ jsonObj->setNumber("line", static_cast<int>(m_line));
+ jsonObj->setString("url", m_url);
+ jsonObj->setNumber("groupLevel", static_cast<int>(m_groupLevel));
+ jsonObj->setNumber("repeatCount", static_cast<int>(m_repeatCount));
+ jsonObj->setString("message", m_message);
if (!m_arguments.isEmpty()) {
- ScriptArray jsonArgs = frontend->newScriptArray();
+ RefPtr<InspectorArray> jsonArgs = InspectorArray::create();
InjectedScript injectedScript = injectedScriptHost->injectedScriptFor(m_scriptState.get());
for (unsigned i = 0; i < m_arguments.size(); ++i) {
- RefPtr<SerializedScriptValue> serializedValue = injectedScript.wrapForConsole(m_arguments[i]);
- if (!jsonArgs.set(i, serializedValue.get())) {
+ RefPtr<InspectorValue> inspectorValue = injectedScript.wrapForConsole(m_arguments[i]);
+ if (!inspectorValue) {
ASSERT_NOT_REACHED();
return;
}
+ jsonArgs->push(inspectorValue);
}
- jsonObj.set("parameters", jsonArgs);
+ jsonObj->set("parameters", jsonArgs);
}
if (!m_frames.isEmpty()) {
- ScriptArray frames = frontend->newScriptArray();
+ RefPtr<InspectorArray> frames = InspectorArray::create();
for (unsigned i = 0; i < m_frames.size(); i++)
- frames.set(i, m_frames.at(i).buildObject(frontend));
- jsonObj.set("stackTrace", frames);
+ frames->push(m_frames.at(i).buildInspectorObject());
+ jsonObj->set("stackTrace", frames);
}
frontend->addConsoleMessage(jsonObj);
}
-void ConsoleMessage::updateRepeatCountInConsole(InspectorFrontend* frontend)
+void ConsoleMessage::updateRepeatCountInConsole(RemoteInspectorFrontend* frontend)
{
frontend->updateConsoleMessageRepeatCount(m_repeatCount);
}
diff --git a/WebCore/inspector/ConsoleMessage.h b/WebCore/inspector/ConsoleMessage.h
index 3848dbf..cb5e6f0 100644
--- a/WebCore/inspector/ConsoleMessage.h
+++ b/WebCore/inspector/ConsoleMessage.h
@@ -40,7 +40,8 @@
namespace WebCore {
class InjectedScriptHost;
-class InspectorFrontend;
+class InspectorObject;
+class RemoteInspectorFrontend;
class ScriptCallFrame;
class ScriptCallStack;
class ScriptString;
@@ -51,8 +52,8 @@ public:
ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& m, ScriptCallStack*, unsigned g, bool storeTrace = false);
#if ENABLE(INSPECTOR)
- void addToFrontend(InspectorFrontend*, InjectedScriptHost*);
- void updateRepeatCountInConsole(InspectorFrontend* frontend);
+ void addToFrontend(RemoteInspectorFrontend*, InjectedScriptHost*);
+ void updateRepeatCountInConsole(RemoteInspectorFrontend* frontend);
#endif
void incrementCount() { ++m_repeatCount; }
bool isEqual(ScriptState*, ConsoleMessage* msg) const;
@@ -66,7 +67,9 @@ private:
explicit CallFrame(const ScriptCallFrame& frame);
CallFrame();
bool isEqual(const CallFrame& o) const;
- ScriptObject buildObject(InspectorFrontend* frontend) const;
+#if ENABLE(INSPECTOR)
+ PassRefPtr<InspectorObject> buildInspectorObject() const;
+#endif
private:
String m_functionName;
diff --git a/WebCore/inspector/InjectedScript.cpp b/WebCore/inspector/InjectedScript.cpp
index 2e35e4b..5f2fb74 100644
--- a/WebCore/inspector/InjectedScript.cpp
+++ b/WebCore/inspector/InjectedScript.cpp
@@ -33,6 +33,7 @@
#if ENABLE(INSPECTOR)
+#include "InspectorValues.h"
#include "PlatformString.h"
#include "SerializedScriptValue.h"
#include "ScriptFunctionCall.h"
@@ -73,7 +74,7 @@ PassRefPtr<SerializedScriptValue> InjectedScript::callFrames()
}
#endif
-PassRefPtr<SerializedScriptValue> InjectedScript::wrapForConsole(ScriptValue value)
+PassRefPtr<InspectorValue> InjectedScript::wrapForConsole(ScriptValue value)
{
ASSERT(!hasNoValue());
ScriptFunctionCall wrapFunction(m_injectedScriptObject, "wrapObjectForConsole");
@@ -82,8 +83,8 @@ PassRefPtr<SerializedScriptValue> InjectedScript::wrapForConsole(ScriptValue val
bool hadException = false;
ScriptValue r = wrapFunction.call(hadException);
if (hadException)
- return SerializedScriptValue::create("<exception>");
- return r.serialize(m_injectedScriptObject.scriptState());
+ return InspectorString::create("<exception>");
+ return r.toInspectorValue(m_injectedScriptObject.scriptState());
}
void InjectedScript::releaseWrapperObjectGroup(const String& objectGroup)
diff --git a/WebCore/inspector/InjectedScript.h b/WebCore/inspector/InjectedScript.h
index 1e9b787..f6b6e19 100644
--- a/WebCore/inspector/InjectedScript.h
+++ b/WebCore/inspector/InjectedScript.h
@@ -38,6 +38,7 @@
namespace WebCore {
+class InspectorValue;
class SerializedScriptValue;
class String;
@@ -52,7 +53,7 @@ public:
#if ENABLE(JAVASCRIPT_DEBUGGER)
PassRefPtr<SerializedScriptValue> callFrames();
#endif
- PassRefPtr<SerializedScriptValue> wrapForConsole(ScriptValue);
+ PassRefPtr<InspectorValue> wrapForConsole(ScriptValue);
void releaseWrapperObjectGroup(const String&);
private:
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index 3c96db1..155bfcd 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -32,6 +32,7 @@
module core {
interface [Conditional=INSPECTOR] Inspector {
+ [notify] void addConsoleMessage(out Object messageObj);
[notify] void addRecordToTimeline(out Object record);
[notify] void addNodesToSearchResult(out Array nodeIds);
[notify] void attributesUpdated(out long id, out Array attributes);
@@ -41,6 +42,8 @@ module core {
[notify] void setChildNodes(out long parentId, out Array nodes);
[notify] void setDetachedRoot(out Object root);
[notify] void setDocument(out Value root);
+ [notify] void updateConsoleMessageExpiredCount(out unsigned long count);
+ [notify] void updateConsoleMessageRepeatCount(out unsigned long count);
void storeLastActivePanel(in String panelName);
@@ -117,7 +120,7 @@ module core {
void searchCanceled();
void pushNodeByPathToFrontend(in long callId, in String path, out long nodeId);
- void clearConsoleMessages();
+ void clearConsoleMessages(in long callId);
void highlightDOMNode(in long nodeId);
void hideDOMNodeHighlight();
@@ -127,7 +130,7 @@ module core {
void getInlineStyle(in long callId, in long nodeId, out Value style);
void getComputedStyle(in long callId, in long nodeId, out Value style);
void getStyleSheet(in long callId, in long styleSheetId, out Value styleSheet);
- void getRuleRangesForStyleSheetId(in long callId, in long styleSheetId);
+ void getRuleRanges(in long callId, in long styleSheetId, out Value ranges);
void applyStyleText(in long callId, in long styleId, in String styleText, in String propertyName, out boolean success, out Value style, out Array changedProperties);
void setStyleText(in long callId, in long styleId, in String styleText, out boolean success);
void setStyleProperty(in long callId, in long styleId, in String name, in String value, out boolean success);
diff --git a/WebCore/inspector/InspectorApplicationCacheAgent.cpp b/WebCore/inspector/InspectorApplicationCacheAgent.cpp
index 88238be..1ea7556 100644
--- a/WebCore/inspector/InspectorApplicationCacheAgent.cpp
+++ b/WebCore/inspector/InspectorApplicationCacheAgent.cpp
@@ -28,8 +28,7 @@
#if ENABLE(INSPECTOR) && ENABLE(OFFLINE_WEB_APPLICATIONS)
-#include "ApplicationCache.h"
-#include "ApplicationCacheResource.h"
+#include "ApplicationCacheHost.h"
#include "DocumentLoader.h"
#include "Frame.h"
#include "FrameLoader.h"
@@ -63,29 +62,6 @@ void InspectorApplicationCacheAgent::updateNetworkState(bool isNowOnline)
m_frontend->updateNetworkState(isNowOnline);
}
-void InspectorApplicationCacheAgent::fillResourceList(ApplicationCache* cache, ResourceInfoList* resources)
-{
-#if !PLATFORM(CHROMIUM)
- ASSERT(cache && cache->isComplete());
-#endif
- ApplicationCache::ResourceMap::const_iterator end = cache->end();
- for (ApplicationCache::ResourceMap::const_iterator it = cache->begin(); it != end; ++it) {
- RefPtr<ApplicationCacheResource> resource = it->second;
- unsigned type = resource->type();
- bool isMaster = type & ApplicationCacheResource::Master;
- bool isManifest = type & ApplicationCacheResource::Manifest;
- bool isExplicit = type & ApplicationCacheResource::Explicit;
- bool isForeign = type & ApplicationCacheResource::Foreign;
- bool isFallback = type & ApplicationCacheResource::Fallback;
-#if PLATFORM(CHROMIUM)
- int64_t estimatedSizeInStorage = 0;
-#else
- int64_t estimatedSizeInStorage = resource->estimatedSizeInStorage();
-#endif
- resources->append(InspectorApplicationCacheAgent::ResourceInfo(resource->url(), isMaster, isManifest, isFallback, isForeign, isExplicit, estimatedSizeInStorage));
- }
-}
-
void InspectorApplicationCacheAgent::getApplicationCaches(long callId)
{
DocumentLoader* documentLoader = m_inspectorController->inspectedPage()->mainFrame()->loader()->documentLoader();
@@ -95,25 +71,15 @@ void InspectorApplicationCacheAgent::getApplicationCaches(long callId)
}
ApplicationCacheHost* host = documentLoader->applicationCacheHost();
- ApplicationCache* cache = host->applicationCacheForInspector();
- if (!cache
-#if !PLATFORM(CHROMIUM)
- || !cache->isComplete()
-#endif
- ) {
- m_frontend->didGetApplicationCaches(callId, ScriptValue::undefined());
- return;
- }
-
- // FIXME: Add "Creation Time" and "Update Time" to Application Caches.
- ApplicationCacheInfo info(cache->manifestResource()->url(), String(), String(), cache->estimatedSizeInStorage());
- ResourceInfoList resources;
- fillResourceList(cache, &resources);
+ ApplicationCacheHost::CacheInfo info = host->applicationCacheInfo();
+
+ ApplicationCacheHost::ResourceInfoList resources;
+ host->fillResourceList(&resources);
m_frontend->didGetApplicationCaches(callId, buildObjectForApplicationCache(resources, info));
}
-ScriptObject InspectorApplicationCacheAgent::buildObjectForApplicationCache(const ResourceInfoList& applicationCacheResources, const ApplicationCacheInfo& applicationCacheInfo)
+ScriptObject InspectorApplicationCacheAgent::buildObjectForApplicationCache(const ApplicationCacheHost::ResourceInfoList& applicationCacheResources, const ApplicationCacheHost::CacheInfo& applicationCacheInfo)
{
ScriptObject value = m_frontend->newScriptObject();
value.set("size", applicationCacheInfo.m_size);
@@ -125,19 +91,19 @@ ScriptObject InspectorApplicationCacheAgent::buildObjectForApplicationCache(cons
return value;
}
-ScriptArray InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources(const ResourceInfoList& applicationCacheResources)
+ScriptArray InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources(const ApplicationCacheHost::ResourceInfoList& applicationCacheResources)
{
ScriptArray resources = m_frontend->newScriptArray();
- ResourceInfoList::const_iterator end = applicationCacheResources.end();
- ResourceInfoList::const_iterator it = applicationCacheResources.begin();
+ ApplicationCacheHost::ResourceInfoList::const_iterator end = applicationCacheResources.end();
+ ApplicationCacheHost::ResourceInfoList::const_iterator it = applicationCacheResources.begin();
for (int i = 0; it != end; ++it, i++)
resources.set(i, buildObjectForApplicationCacheResource(*it));
return resources;
}
-ScriptObject InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource(const ResourceInfo& resourceInfo)
+ScriptObject InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo& resourceInfo)
{
ScriptObject value = m_frontend->newScriptObject();
value.set("name", resourceInfo.m_resource.string());
diff --git a/WebCore/inspector/InspectorApplicationCacheAgent.h b/WebCore/inspector/InspectorApplicationCacheAgent.h
index 79763f4..33cc2ed 100644
--- a/WebCore/inspector/InspectorApplicationCacheAgent.h
+++ b/WebCore/inspector/InspectorApplicationCacheAgent.h
@@ -28,13 +28,10 @@
#if ENABLE(INSPECTOR) && ENABLE(OFFLINE_WEB_APPLICATIONS)
#include "ApplicationCacheHost.h"
-#include "KURL.h"
-#include "PlatformString.h"
#include <wtf/Noncopyable.h>
namespace WebCore {
-class ApplicationCache;
class InspectorController;
class InspectorFrontend;
class ResourceResponse;
@@ -43,44 +40,6 @@ class ScriptObject;
class InspectorApplicationCacheAgent : public Noncopyable {
public:
- struct ApplicationCacheInfo {
- ApplicationCacheInfo(const KURL& manifest, const String& creationTime, const String& updateTime, long long size)
- : m_manifest(manifest)
- , m_creationTime(creationTime)
- , m_updateTime(updateTime)
- , m_size(size)
- {
- }
-
- KURL m_manifest;
- String m_creationTime;
- String m_updateTime;
- long long m_size;
- };
-
- struct ResourceInfo {
- ResourceInfo(const KURL& resource, bool isMaster, bool isManifest, bool isFallback, bool isForeign, bool isExplicit, long long size)
- : m_resource(resource)
- , m_isMaster(isMaster)
- , m_isManifest(isManifest)
- , m_isFallback(isFallback)
- , m_isForeign(isForeign)
- , m_isExplicit(isExplicit)
- , m_size(size)
- {
- }
-
- KURL m_resource;
- bool m_isMaster;
- bool m_isManifest;
- bool m_isFallback;
- bool m_isForeign;
- bool m_isExplicit;
- long long m_size;
- };
-
- typedef Vector<ResourceInfo> ResourceInfoList;
-
InspectorApplicationCacheAgent(InspectorController* inspectorController, InspectorFrontend* frontend);
~InspectorApplicationCacheAgent() { }
@@ -93,11 +52,9 @@ public:
void getApplicationCaches(long callId);
private:
- ScriptObject buildObjectForApplicationCache(const ResourceInfoList&, const ApplicationCacheInfo&);
- ScriptArray buildArrayForApplicationCacheResources(const ResourceInfoList&);
- ScriptObject buildObjectForApplicationCacheResource(const ResourceInfo&);
-
- void fillResourceList(ApplicationCache*, ResourceInfoList*);
+ ScriptObject buildObjectForApplicationCache(const ApplicationCacheHost::ResourceInfoList&, const ApplicationCacheHost::CacheInfo&);
+ ScriptArray buildArrayForApplicationCacheResources(const ApplicationCacheHost::ResourceInfoList&);
+ ScriptObject buildObjectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo&);
InspectorController* m_inspectorController;
InspectorFrontend* m_frontend;
diff --git a/WebCore/inspector/InspectorBackend.cpp b/WebCore/inspector/InspectorBackend.cpp
index 9f71307..f27b812 100644
--- a/WebCore/inspector/InspectorBackend.cpp
+++ b/WebCore/inspector/InspectorBackend.cpp
@@ -49,6 +49,7 @@
#include "InspectorResource.h"
#include "Page.h"
#include "Pasteboard.h"
+#include "RemoteInspectorFrontend.h"
#include "ScriptArray.h"
#include "ScriptBreakpoint.h"
#include "SerializedScriptValue.h"
@@ -412,10 +413,13 @@ void InspectorBackend::pushNodeByPathToFrontend(long callId, const String& path)
domAgent->pushNodeByPathToFrontend(callId, path);
}
-void InspectorBackend::clearConsoleMessages()
+void InspectorBackend::clearConsoleMessages(long callId)
{
- if (m_inspectorController)
+ if (m_inspectorController) {
m_inspectorController->clearConsoleMessages();
+ if (RemoteInspectorFrontend* frontend = remoteFrontend())
+ frontend->didClearConsoleMessages(callId);
+ }
}
void InspectorBackend::getStyles(long callId, long nodeId, bool authorOnly)
@@ -448,10 +452,10 @@ void InspectorBackend::getStyleSheet(long callId, long styleSheetId)
domAgent->getStyleSheet(callId, styleSheetId);
}
-void InspectorBackend::getRuleRangesForStyleSheetId(long callId, long styleSheetId)
+void InspectorBackend::getRuleRanges(long callId, long styleSheetId)
{
if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
- domAgent->getRuleRangesForStyleSheetId(callId, styleSheetId);
+ domAgent->getRuleRanges(callId, styleSheetId);
}
void InspectorBackend::applyStyleText(long callId, long styleId, const String& styleText, const String& propertyName)
@@ -597,6 +601,13 @@ InspectorFrontend* InspectorBackend::inspectorFrontend()
return m_inspectorController->m_frontend.get();
}
+RemoteInspectorFrontend* InspectorBackend::remoteFrontend()
+{
+ if (!m_inspectorController)
+ return 0;
+ return m_inspectorController->m_remoteFrontend.get();
+}
+
void InspectorBackend::addScriptToEvaluateOnLoad(const String& source)
{
if (m_inspectorController)
diff --git a/WebCore/inspector/InspectorBackend.h b/WebCore/inspector/InspectorBackend.h
index 78d34b6..16d53c0 100644
--- a/WebCore/inspector/InspectorBackend.h
+++ b/WebCore/inspector/InspectorBackend.h
@@ -43,6 +43,7 @@ class InspectorApplicationCacheAgent;
class InspectorDOMAgent;
class InspectorFrontend;
class Node;
+class RemoteInspectorFrontend;
class Storage;
class InspectorBackend : public RefCounted<InspectorBackend>
@@ -133,14 +134,14 @@ public:
void searchCanceled();
void pushNodeByPathToFrontend(long callId, const String& path);
- void clearConsoleMessages();
+ void clearConsoleMessages(long callId);
void getStyles(long callId, long nodeId, bool authOnly);
void getAllStyles(long callId);
void getInlineStyle(long callId, long nodeId);
void getComputedStyle(long callId, long nodeId);
void getStyleSheet(long callId, long styleSheetId);
- void getRuleRangesForStyleSheetId(long callId, long styleSheetId);
+ void getRuleRanges(long callId, long styleSheetId);
void applyStyleText(long callId, long styleId, const String& styleText, const String& propertyName);
void setStyleText(long callId, long styleId, const String& cssText);
void setStyleProperty(long callId, long styleId, const String& name, const String& value);
@@ -179,6 +180,7 @@ private:
InspectorApplicationCacheAgent* inspectorApplicationCacheAgent();
#endif
InspectorFrontend* inspectorFrontend();
+ RemoteInspectorFrontend* remoteFrontend();
Node* nodeForId(long nodeId);
InspectorController* m_inspectorController;
diff --git a/WebCore/inspector/InspectorBackend.idl b/WebCore/inspector/InspectorBackend.idl
deleted file mode 100644
index 3c460a1..0000000
--- a/WebCore/inspector/InspectorBackend.idl
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
- * Copyright (C) 2009 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.
- */
-
-module core {
- interface [Conditional=INSPECTOR] InspectorBackend {
- void storeLastActivePanel(in DOMString panelName);
-
- void saveApplicationSettings(in DOMString settings);
- void saveSessionSettings(in DOMString settings);
-
- void enableSearchingForNode();
- void disableSearchingForNode();
-
- void enableMonitoringXHR();
- void disableMonitoringXHR();
-
- void enableResourceTracking(in boolean always);
- void disableResourceTracking(in boolean always);
- void getResourceContent(in long callId, in unsigned long identifier);
- void reloadPage();
-
- void startTimelineProfiler();
- void stopTimelineProfiler();
-
-#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
- void enableDebugger(in boolean always);
- void disableDebugger(in boolean always);
-
- void setBreakpoint(in long callId, in DOMString sourceID, in unsigned long lineNumber, in boolean enabled, in DOMString condition);
- void removeBreakpoint(in DOMString sourceID, in unsigned long lineNumber);
- void activateBreakpoints();
- void deactivateBreakpoints();
-
- void pause();
- void resume();
-
- void stepOverStatement();
- void stepIntoStatement();
- void stepOutOfFunction();
-
- void setPauseOnExceptionsState(in long pauseOnExceptionsState);
-
- void editScriptSource(in long callId, in DOMString sourceID, in DOMString newContent);
- void getScriptSource(in long callId, in DOMString sourceID);
-
- void enableProfiler(in boolean always);
- void disableProfiler(in boolean always);
-
- void startProfiling();
- void stopProfiling();
-
- void getProfileHeaders(in long callId);
- void getProfile(in long callId, in unsigned long uid);
-
- void removeProfile(in unsigned long uid);
- void clearProfiles();
-
- void takeHeapSnapshot();
-#endif
- void setInjectedScriptSource(in DOMString scriptSource);
- void dispatchOnInjectedScript(in long callId, in long injectedScriptId, in DOMString methodName, in DOMString arguments, in boolean async);
-
- void addScriptToEvaluateOnLoad(in DOMString scriptSource);
- void removeAllScriptsToEvaluateOnLoad();
-
- void getChildNodes(in long callId, in long nodeId);
- void setAttribute(in long callId, in long elementId, in DOMString name, in DOMString value);
- void removeAttribute(in long callId, in long elementId, in DOMString name);
- void setTextNodeValue(in long callId, in long nodeId, in DOMString value);
- void getEventListenersForNode(in long callId, in long nodeId);
- void copyNode(in long nodeId);
- void removeNode(in long callId, in long nodeId);
- void changeTagName(in long callId, in long nodeId, in DOMString newTagName);
- void getOuterHTML(in long callId, in long nodeId);
- void setOuterHTML(in long callId, in long nodeId, in DOMString outerHTML);
- void addInspectedNode(in long nodeId);
- void performSearch(in DOMString query, in boolean runSynchronously);
- void searchCanceled();
- void pushNodeByPathToFrontend(in long callId, in DOMString path);
-
- void clearConsoleMessages();
-
- void highlightDOMNode(in long nodeId);
- void hideDOMNodeHighlight();
-
- void getStyles(in long callId, in long nodeId, in boolean authOnly);
- void getAllStyles(in long callId);
- void getInlineStyle(in long callId, in long nodeId);
- void getComputedStyle(in long callId, in long nodeId);
- void getStyleSheet(in long callId, in long styleSheetId);
- void getRuleRangesForStyleSheetId(in long callId, in long styleSheetId);
- void applyStyleText(in long callId, in long styleId, in DOMString styleText, in DOMString propertyName);
- void setStyleText(in long callId, in long styleId, in DOMString styleText);
- void setStyleProperty(in long callId, in long styleId, in DOMString name, in DOMString value);
- void toggleStyleEnabled(in long callId, in long styleId, in DOMString propertyName, in boolean disabled);
- void setRuleSelector(in long callId, in long ruleId, in DOMString selector, in long selectedNodeId);
- void addRule(in long callId, in DOMString selector, in long selectedNodeId);
-
- void getCookies(in long callId);
- void deleteCookie(in DOMString cookieName, in DOMString domain);
-
-#if defined(ENABLE_OFFLINE_WEB_APPLICATIONS)
- void getApplicationCaches(in long callId);
-#endif
-
- void releaseWrapperObjectGroup(in long injectedScriptId, in DOMString objectGroup);
- void didEvaluateForTestInFrontend(in long callId, in DOMString jsonResult);
-
-#if defined(ENABLE_DATABASE) && ENABLE_DATABASE
- void getDatabaseTableNames(in long callId, in long databaseId);
-#endif
-
-#if defined(ENABLE_DOM_STORAGE) && ENABLE_DOM_STORAGE
- void getDOMStorageEntries(in long callId, in long storageId);
- void setDOMStorageItem(in long callId, in long storageId, in DOMString key, in DOMString value);
- void removeDOMStorageItem(in long callId, in long storageId, in DOMString key);
-#endif
- };
-}
diff --git a/WebCore/inspector/InspectorCSSStore.cpp b/WebCore/inspector/InspectorCSSStore.cpp
index 9dffef9..d098230 100644
--- a/WebCore/inspector/InspectorCSSStore.cpp
+++ b/WebCore/inspector/InspectorCSSStore.cpp
@@ -109,13 +109,12 @@ CSSStyleSheet* InspectorCSSStore::inspectorStyleSheet(Document* ownerDocument, b
return inspectorStyleSheet;
}
-HashMap<long, SourceRange> InspectorCSSStore::getRuleRangesForStyleSheet(CSSStyleSheet* styleSheet)
+HashMap<long, SourceRange> InspectorCSSStore::getRuleRanges(CSSStyleSheet* styleSheet)
{
if (!styleSheet)
return HashMap<long, SourceRange>();
RefPtr<CSSRuleList> originalRuleList = CSSRuleList::create(styleSheet, false);
StyleSheetToOffsetsMap::iterator it = m_styleSheetToOffsets.find(styleSheet);
- HashMap<long, SourceRange> result;
Vector<SourceRange>* offsetVector = 0;
if (it == m_styleSheetToOffsets.end()) {
InspectorResource* resource = m_inspectorController->resourceForURL(styleSheet->finalURL().string());
@@ -139,13 +138,16 @@ HashMap<long, SourceRange> InspectorCSSStore::getRuleRangesForStyleSheet(CSSStyl
offsetVector = it->second;
if (!offsetVector)
return HashMap<long, SourceRange>();
+
unsigned ruleIndex = 0;
+ HashMap<long, SourceRange> result;
for (unsigned i = 0, length = styleSheet->length(); i < length; ++i) {
ASSERT(ruleIndex < offsetVector->size());
CSSStyleRule* rule = asCSSStyleRule(styleSheet->item(i));
if (!rule)
continue;
- result.set(bindRule(rule), offsetVector->at(ruleIndex));
+ // This maps the style id to the rule body range.
+ result.set(bindStyle(rule->style()), offsetVector->at(ruleIndex));
ruleIndex++;
}
return result;
diff --git a/WebCore/inspector/InspectorCSSStore.h b/WebCore/inspector/InspectorCSSStore.h
index 4b7ef51..4f7df00 100644
--- a/WebCore/inspector/InspectorCSSStore.h
+++ b/WebCore/inspector/InspectorCSSStore.h
@@ -66,7 +66,7 @@ public:
InspectorCSSStore(InspectorController* inspectorController);
~InspectorCSSStore();
void reset();
- HashMap<long, SourceRange> getRuleRangesForStyleSheet(CSSStyleSheet*);
+ HashMap<long, SourceRange> getRuleRanges(CSSStyleSheet*);
CSSStyleDeclaration* styleForId(long styleId);
CSSStyleSheet* styleSheetForId(long styleSheetId);
CSSStyleRule* ruleForId(long styleRuleId);
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 8879b8e..e29c7ae 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -55,6 +55,7 @@
#include "InjectedScript.h"
#include "InjectedScriptHost.h"
#include "InspectorBackend.h"
+#include "InspectorBackendDispatcher.h"
#include "InspectorCSSStore.h"
#include "InspectorClient.h"
#include "InspectorFrontendClient.h"
@@ -112,6 +113,7 @@
#include <runtime/UString.h>
#include "JSScriptProfile.h"
#else
+#include "ScriptScope.h"
#include "V8ScriptProfile.h"
#endif
#endif
@@ -192,6 +194,7 @@ InspectorController::InspectorController(Page* page, InspectorClient* client)
, m_resourceTrackingEnabled(false)
, m_settingsLoaded(false)
, m_inspectorBackend(InspectorBackend::create(this))
+ , m_inspectorBackendDispatcher(new InspectorBackendDispatcher(m_inspectorBackend.get()))
, m_injectedScriptHost(InjectedScriptHost::create(this))
#if ENABLE(JAVASCRIPT_DEBUGGER)
, m_debuggerEnabled(false)
@@ -363,12 +366,12 @@ void InspectorController::addConsoleMessage(ScriptState* scriptState, PassOwnPtr
if (m_previousMessage && m_previousMessage->isEqual(scriptState, consoleMessage.get())) {
m_previousMessage->incrementCount();
if (m_frontend)
- m_previousMessage->updateRepeatCountInConsole(m_frontend.get());
+ m_previousMessage->updateRepeatCountInConsole(m_remoteFrontend.get());
} else {
m_previousMessage = consoleMessage.get();
m_consoleMessages.append(consoleMessage);
if (m_frontend)
- m_previousMessage->addToFrontend(m_frontend.get(), m_injectedScriptHost.get());
+ m_previousMessage->addToFrontend(m_remoteFrontend.get(), m_injectedScriptHost.get());
}
if (!m_frontend && m_consoleMessages.size() >= maximumConsoleMessages) {
@@ -386,8 +389,6 @@ void InspectorController::clearConsoleMessages()
m_injectedScriptHost->releaseWrapperObjectGroup(0 /* release the group in all scripts */, "console");
if (m_domAgent)
m_domAgent->releaseDanglingNodes();
- if (m_frontend)
- m_frontend->clearConsoleMessages();
}
void InspectorController::startGroup(MessageSource source, ScriptCallStack* callStack, bool collapsed)
@@ -656,10 +657,10 @@ void InspectorController::populateScriptObjects()
m_domAgent->setDocument(m_inspectedPage->mainFrame()->document());
if (m_expiredConsoleMessageCount)
- m_frontend->updateConsoleMessageExpiredCount(m_expiredConsoleMessageCount);
+ m_remoteFrontend->updateConsoleMessageExpiredCount(m_expiredConsoleMessageCount);
unsigned messageCount = m_consoleMessages.size();
for (unsigned i = 0; i < messageCount; ++i)
- m_consoleMessages[i]->addToFrontend(m_frontend.get(), m_injectedScriptHost.get());
+ m_consoleMessages[i]->addToFrontend(m_remoteFrontend.get(), m_injectedScriptHost.get());
#if ENABLE(JAVASCRIPT_DEBUGGER)
if (m_debuggerEnabled)
@@ -1560,12 +1561,14 @@ void InspectorController::getProfile(long callId, unsigned uid)
if (!m_frontend)
return;
ProfilesMap::iterator it = m_profiles.find(uid);
- if (it != m_profiles.end())
+ if (it != m_profiles.end()) {
#if USE(JSC)
m_frontend->didGetProfile(callId, toJS(m_frontend->scriptState(), it->second.get()));
#else
+ ScriptScope scope(m_frontend->scriptState());
m_frontend->didGetProfile(callId, toV8(it->second.get()));
#endif
+ }
}
ScriptObject InspectorController::createProfileHeader(const ScriptProfile& profile)
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 76b88f1..176dd11 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -64,6 +64,7 @@ class HitTestResult;
class InjectedScript;
class InjectedScriptHost;
class InspectorBackend;
+class InspectorBackendDispatcher;
class InspectorClient;
class InspectorCSSStore;
class InspectorDOMStorageResource;
@@ -120,6 +121,7 @@ public:
~InspectorController();
InspectorBackend* inspectorBackend() { return m_inspectorBackend.get(); }
+ InspectorBackendDispatcher* inspectorBackendDispatcher() { return m_inspectorBackendDispatcher.get(); }
InjectedScriptHost* injectedScriptHost() { return m_injectedScriptHost.get(); }
void inspectedPageDestroyed();
@@ -395,6 +397,7 @@ private:
bool m_resourceTrackingEnabled;
bool m_settingsLoaded;
RefPtr<InspectorBackend> m_inspectorBackend;
+ OwnPtr<InspectorBackendDispatcher> m_inspectorBackendDispatcher;
RefPtr<InjectedScriptHost> m_injectedScriptHost;
typedef HashMap<String, String> Settings;
diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp
index e3d1bf5..3a14830 100644
--- a/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/WebCore/inspector/InspectorDOMAgent.cpp
@@ -1075,11 +1075,11 @@ void InspectorDOMAgent::getStyleSheet(long callId, long styleSheetId)
m_frontend->didGetStyleSheet(callId, InspectorObject::create());
}
-void InspectorDOMAgent::getRuleRangesForStyleSheetId(long callId, long styleSheetId)
+void InspectorDOMAgent::getRuleRanges(long callId, long styleSheetId)
{
CSSStyleSheet* styleSheet = cssStore()->styleSheetForId(styleSheetId);
if (styleSheet && styleSheet->doc()) {
- HashMap<long, SourceRange> ruleRanges = cssStore()->getRuleRangesForStyleSheet(styleSheet);
+ HashMap<long, SourceRange> ruleRanges = cssStore()->getRuleRanges(styleSheet);
if (!ruleRanges.size()) {
m_frontend->didGetStyleSheet(callId, InspectorObject::create());
return;
@@ -1095,9 +1095,9 @@ void InspectorDOMAgent::getRuleRangesForStyleSheetId(long callId, long styleShee
bodyRange->setNumber("end", it->second.second);
}
}
- m_frontend->didGetStyleSheet(callId, result);
+ m_frontend->didGetRuleRanges(callId, result);
} else
- m_frontend->didGetStyleSheet(callId, InspectorValue::null());
+ m_frontend->didGetRuleRanges(callId, InspectorValue::null());
}
void InspectorDOMAgent::getInlineStyle(long callId, long nodeId)
diff --git a/WebCore/inspector/InspectorDOMAgent.h b/WebCore/inspector/InspectorDOMAgent.h
index 5db837b..38b7034 100644
--- a/WebCore/inspector/InspectorDOMAgent.h
+++ b/WebCore/inspector/InspectorDOMAgent.h
@@ -119,7 +119,7 @@ namespace WebCore {
void getInlineStyle(long callId, long nodeId);
void getComputedStyle(long callId, long nodeId);
void getStyleSheet(long callId, long styleSheetId);
- void getRuleRangesForStyleSheetId(long callId, long styleSheetId);
+ void getRuleRanges(long callId, long styleSheetId);
void applyStyleText(long callId, long styleId, const String& styleText, const String& propertyName);
void setStyleText(long callId, long styleId, const String& cssText);
void setStyleProperty(long callId, long styleId, const String& name, const String& value);
diff --git a/WebCore/inspector/InspectorFrontendClient.h b/WebCore/inspector/InspectorFrontendClient.h
index 515388c..c20eb10 100644
--- a/WebCore/inspector/InspectorFrontendClient.h
+++ b/WebCore/inspector/InspectorFrontendClient.h
@@ -59,6 +59,8 @@ public:
virtual void changeAttachedWindowHeight(unsigned) = 0;
virtual void inspectedURLChanged(const String&) = 0;
+
+ virtual void sendMessageToBackend(const String&) = 0;
};
} // namespace WebCore
diff --git a/WebCore/inspector/InspectorFrontendClientLocal.cpp b/WebCore/inspector/InspectorFrontendClientLocal.cpp
index 16a6a8b..f6f7811 100644
--- a/WebCore/inspector/InspectorFrontendClientLocal.cpp
+++ b/WebCore/inspector/InspectorFrontendClientLocal.cpp
@@ -37,6 +37,7 @@
#include "FloatRect.h"
#include "Frame.h"
#include "FrameView.h"
+#include "InspectorBackendDispatcher.h"
#include "InspectorController.h"
#include "InspectorFrontend.h"
#include "InspectorFrontendHost.h"
@@ -70,11 +71,8 @@ InspectorFrontendClientLocal::~InspectorFrontendClientLocal()
void InspectorFrontendClientLocal::windowObjectCleared()
{
- // Grant the inspector the ability to script the inspected page.
- m_frontendPage->mainFrame()->document()->securityOrigin()->grantUniversalAccess();
// FIXME: don't keep reference to the script state
m_frontendScriptState = scriptStateFromPage(debuggerWorld(), m_frontendPage);
- ScriptGlobalObject::set(m_frontendScriptState, "InspectorBackend", m_inspectorController->inspectorBackend());
m_frontendHost = InspectorFrontendHost::create(this, m_frontendPage);
ScriptGlobalObject::set(m_frontendScriptState, "InspectorFrontendHost", m_frontendHost.get());
}
@@ -161,7 +159,12 @@ unsigned InspectorFrontendClientLocal::constrainedAttachedWindowHeight(unsigned
using namespace std;
return roundf(max(minimumAttachedHeight, min<float>(preferredHeight, totalWindowHeight * maximumAttachedHeightRatio)));
}
-
+
+void InspectorFrontendClientLocal::sendMessageToBackend(const String& message)
+{
+ m_inspectorController->inspectorBackendDispatcher()->dispatch(message);
+}
+
} // namespace WebCore
#endif
diff --git a/WebCore/inspector/InspectorFrontendClientLocal.h b/WebCore/inspector/InspectorFrontendClientLocal.h
index ce661fe..9dcaa5a 100644
--- a/WebCore/inspector/InspectorFrontendClientLocal.h
+++ b/WebCore/inspector/InspectorFrontendClientLocal.h
@@ -59,6 +59,8 @@ public:
virtual void detachWindow() = 0;
bool canAttachWindow();
+ virtual void sendMessageToBackend(const String& message);
+
protected:
virtual void setAttachedWindowHeight(unsigned) = 0;
void setAttachedWindow(bool);
diff --git a/WebCore/inspector/InspectorFrontendHost.cpp b/WebCore/inspector/InspectorFrontendHost.cpp
index 70fc3ad..6957dd1 100644
--- a/WebCore/inspector/InspectorFrontendHost.cpp
+++ b/WebCore/inspector/InspectorFrontendHost.cpp
@@ -207,6 +207,11 @@ void InspectorFrontendHost::copyText(const String& text)
Pasteboard::generalPasteboard()->writePlainText(text);
}
+void InspectorFrontendHost::sendMessageToBackend(const String& message)
+{
+ m_client->sendMessageToBackend(message);
+}
+
#if ENABLE(CONTEXT_MENUS)
void InspectorFrontendHost::showContextMenu(Event* event, const Vector<ContextMenuItem*>& items)
{
diff --git a/WebCore/inspector/InspectorFrontendHost.h b/WebCore/inspector/InspectorFrontendHost.h
index 4d3e0d1..7fb4a1e 100644
--- a/WebCore/inspector/InspectorFrontendHost.h
+++ b/WebCore/inspector/InspectorFrontendHost.h
@@ -75,6 +75,7 @@ public:
// Called from [Custom] implementations.
void showContextMenu(Event*, const Vector<ContextMenuItem*>& items);
+ void sendMessageToBackend(const String& message);
private:
#if ENABLE(CONTEXT_MENUS)
diff --git a/WebCore/inspector/InspectorFrontendHost.idl b/WebCore/inspector/InspectorFrontendHost.idl
index 1139a1c..d1b3604 100644
--- a/WebCore/inspector/InspectorFrontendHost.idl
+++ b/WebCore/inspector/InspectorFrontendHost.idl
@@ -50,5 +50,6 @@ module core {
[Custom] DOMString platform();
[Custom] DOMString port();
[Custom] void showContextMenu(in MouseEvent event, in DOMObject items);
+ void sendMessageToBackend(in DOMString message);
};
}
diff --git a/WebCore/inspector/InspectorResource.cpp b/WebCore/inspector/InspectorResource.cpp
index 6a5919c..69618c3 100644
--- a/WebCore/inspector/InspectorResource.cpp
+++ b/WebCore/inspector/InspectorResource.cpp
@@ -283,7 +283,7 @@ InspectorResource::Type InspectorResource::type() const
if (!m_overrideContent.isNull())
return m_overrideContentType;
- if (m_requestURL == m_loader->requestURL()) {
+ if (equalIgnoringFragmentIdentifier(m_requestURL, m_loader->requestURL())) {
InspectorResource::Type resourceType = cachedResourceType();
if (resourceType == Other)
return Doc;
@@ -291,7 +291,7 @@ InspectorResource::Type InspectorResource::type() const
return resourceType;
}
- if (m_loader->frameLoader() && m_requestURL == m_loader->frameLoader()->iconURL())
+ if (m_loader->frameLoader() && equalIgnoringFragmentIdentifier(m_requestURL, m_loader->frameLoader()->iconURL()))
return Image;
return cachedResourceType();
@@ -322,7 +322,7 @@ String InspectorResource::sourceString() const
PassRefPtr<SharedBuffer> InspectorResource::resourceData(String* textEncodingName) const
{
- if (m_requestURL == m_loader->requestURL()) {
+ if (equalIgnoringFragmentIdentifier(m_requestURL, m_loader->requestURL())) {
*textEncodingName = m_frame->document()->inputEncoding();
return m_loader->mainResourceData();
}
@@ -394,12 +394,17 @@ ScriptObject InspectorResource::buildObjectForTiming(InspectorFrontend* frontend
{
ScriptObject jsonObject = frontend->newScriptObject();
jsonObject.set("requestTime", timing->requestTime);
- jsonObject.set("proxyDuration", timing->proxyStart == -1 ? -1 : (timing->proxyEnd - timing->proxyStart) / 1000.0);
- jsonObject.set("dnsDuration", timing->dnsStart == -1 ? -1 : (timing->dnsEnd - timing->dnsStart) / 1000.0);
- jsonObject.set("connectDuration", timing->connectStart == -1 ? -1 : (timing->connectEnd - timing->connectStart) / 1000.0);
- jsonObject.set("sslDuration", timing->sslStart == -1 ? -1 : (timing->sslEnd - timing->sslStart) / 1000.0);
- jsonObject.set("sendDuration", (timing->sendEnd - timing->sendStart) / 1000.0);
- jsonObject.set("waitDuration", (timing->receiveHeadersEnd - timing->sendEnd) / 1000.0);
+ jsonObject.set("proxyStart", timing->proxyStart);
+ jsonObject.set("proxyEnd", timing->proxyEnd);
+ jsonObject.set("dnsStart", timing->dnsStart);
+ jsonObject.set("dnsEnd", timing->dnsEnd);
+ jsonObject.set("connectStart", timing->connectStart);
+ jsonObject.set("connectEnd", timing->connectEnd);
+ jsonObject.set("sslStart", timing->sslStart);
+ jsonObject.set("sslEnd", timing->sslEnd);
+ jsonObject.set("sendStart", timing->sendStart);
+ jsonObject.set("sendEnd", timing->sendEnd);
+ jsonObject.set("receiveHeadersEnd", timing->receiveHeadersEnd);
return jsonObject;
}
diff --git a/WebCore/inspector/InspectorValues.cpp b/WebCore/inspector/InspectorValues.cpp
index 90a40f9..d488b50 100644
--- a/WebCore/inspector/InspectorValues.cpp
+++ b/WebCore/inspector/InspectorValues.cpp
@@ -484,6 +484,16 @@ bool InspectorValue::asNumber(double*) const
return false;
}
+bool InspectorValue::asNumber(long*) const
+{
+ return false;
+}
+
+bool InspectorValue::asNumber(unsigned long*) const
+{
+ return false;
+}
+
bool InspectorValue::asString(String*) const
{
return false;
@@ -540,6 +550,23 @@ bool InspectorBasicValue::asNumber(double* output) const
return true;
}
+bool InspectorBasicValue::asNumber(long* output) const
+{
+ if (type() != TypeDouble)
+ return false;
+ *output = static_cast<long>(m_doubleValue);
+ return true;
+}
+
+bool InspectorBasicValue::asNumber(unsigned long* output) const
+{
+ if (type() != TypeDouble)
+ return false;
+ *output = static_cast<unsigned long>(m_doubleValue);
+ return true;
+}
+
+
void InspectorBasicValue::writeJSON(Vector<UChar>* output) const
{
ASSERT(type() == TypeBoolean || type() == TypeDouble);
diff --git a/WebCore/inspector/InspectorValues.h b/WebCore/inspector/InspectorValues.h
index a0c0c2d..940bab9 100644
--- a/WebCore/inspector/InspectorValues.h
+++ b/WebCore/inspector/InspectorValues.h
@@ -69,6 +69,8 @@ public:
virtual bool asBool(bool* output) const;
virtual bool asNumber(double* output) const;
+ virtual bool asNumber(long* output) const;
+ virtual bool asNumber(unsigned long* output) const;
virtual bool asString(String* output) const;
virtual PassRefPtr<InspectorObject> asObject();
virtual PassRefPtr<InspectorArray> asArray();
@@ -105,6 +107,8 @@ public:
virtual bool asBool(bool* output) const;
virtual bool asNumber(double* output) const;
+ virtual bool asNumber(long* output) const;
+ virtual bool asNumber(unsigned long* output) const;
virtual void writeJSON(Vector<UChar>* output) const;
diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js
index d4119a1..e16c89e 100644
--- a/WebCore/inspector/front-end/ConsoleView.js
+++ b/WebCore/inspector/front-end/ConsoleView.js
@@ -296,7 +296,7 @@ WebInspector.ConsoleView.prototype = {
requestClearMessages: function()
{
- InspectorBackend.clearConsoleMessages();
+ InspectorBackend.clearConsoleMessages(WebInspector.Callback.wrap(this.clearMessages.bind(this)));
},
clearMessages: function()
@@ -1127,3 +1127,5 @@ WebInspector.ConsoleGroup.prototype = {
event.preventDefault();
}
}
+
+WebInspector.didClearConsoleMessages = WebInspector.Callback.processCallback;
diff --git a/WebCore/inspector/front-end/DOMAgent.js b/WebCore/inspector/front-end/DOMAgent.js
index 07b16b1..bcbe91e 100644
--- a/WebCore/inspector/front-end/DOMAgent.js
+++ b/WebCore/inspector/front-end/DOMAgent.js
@@ -698,6 +698,7 @@ WebInspector.didGetEventListenersForNode = WebInspector.Callback.processCallback
WebInspector.didGetStyles = WebInspector.Callback.processCallback;
WebInspector.didGetAllStyles = WebInspector.Callback.processCallback;
WebInspector.didGetStyleSheet = WebInspector.Callback.processCallback;
+WebInspector.didGetRuleRanges = WebInspector.Callback.processCallback;
WebInspector.didGetInlineStyle = WebInspector.Callback.processCallback;
WebInspector.didGetComputedStyle = WebInspector.Callback.processCallback;
WebInspector.didApplyStyleText = WebInspector.Callback.processCallback;
diff --git a/WebCore/inspector/front-end/ElementsPanel.js b/WebCore/inspector/front-end/ElementsPanel.js
index 48eb4c0..ec9559f 100644
--- a/WebCore/inspector/front-end/ElementsPanel.js
+++ b/WebCore/inspector/front-end/ElementsPanel.js
@@ -222,7 +222,7 @@ WebInspector.ElementsPanel.prototype = {
if (this._selectedPathOnReset) {
var callId = WebInspector.Callback.wrap(selectLastSelectedNode.bind(this));
- InspectorBackend.pushNodeByPathToFrontend(callId, this._selectedPathOnReset);
+ InspectorBackend.pushNodeByPathToFrontend(callId, this._selectedPathOnReset.join(","));
} else
selectNode.call(this);
delete this._selectedPathOnReset;
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index 9e16dad..ce187d2 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -388,7 +388,7 @@ InjectedScript.createProxyObject = function(object, objectId, abbreviate)
var type = typeof object;
- result.hasChildren = (type === "object" && object !== null && (Object.getOwnPropertyNames(object).length || object.__proto__)) || type === "function";
+ result.hasChildren = (type === "object" && object !== null && (Object.getOwnPropertyNames(object).length || !!object.__proto__)) || type === "function";
try {
result.description = InjectedScript._describe(object, abbreviate);
} catch (e) {
@@ -411,6 +411,7 @@ InjectedScript.CallFrameProxy = function(id, callFrame)
this.sourceID = callFrame.sourceID;
this.line = callFrame.line;
this.scopeChain = this._wrapScopeChain(callFrame);
+ this.injectedScriptId = injectedScriptId;
}
InjectedScript.CallFrameProxy.prototype = {
@@ -544,7 +545,7 @@ InjectedScript._type = function(obj)
return "array";
if (obj instanceof inspectedWindow.HTMLCollection)
return "array";
- if (inspectedWindow.jQuery && obj instanceof inspectedWindow.jQuery)
+ if (typeof inspectedWindow.jQuery === "function" && obj instanceof inspectedWindow.jQuery)
return "array";
if (obj instanceof inspectedWindow.Error)
return "error";
diff --git a/WebCore/inspector/front-end/InjectedScriptAccess.js b/WebCore/inspector/front-end/InjectedScriptAccess.js
index 0e4cc2e..5950421 100644
--- a/WebCore/inspector/front-end/InjectedScriptAccess.js
+++ b/WebCore/inspector/front-end/InjectedScriptAccess.js
@@ -35,7 +35,11 @@ function InjectedScriptAccess(injectedScriptId) {
InjectedScriptAccess.get = function(injectedScriptId)
{
- return new InjectedScriptAccess(injectedScriptId);
+ if (typeof injectedScriptId === "number")
+ return new InjectedScriptAccess(injectedScriptId);
+
+ console.error("Access to injected script with no id");
+ console.trace();
}
InjectedScriptAccess.getDefault = function()
diff --git a/WebCore/inspector/front-end/InspectorBackendStub.js b/WebCore/inspector/front-end/InspectorBackendStub.js
index 857e026..7cfc8a1 100644
--- a/WebCore/inspector/front-end/InspectorBackendStub.js
+++ b/WebCore/inspector/front-end/InspectorBackendStub.js
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2009, 2010 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
@@ -28,270 +28,102 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-if (!window.InspectorBackend) {
-
WebInspector.InspectorBackendStub = function()
{
- this._attachedWindowHeight = 0;
- this._timelineEnabled = false;
+ this._registerDelegate("addInspectedNode");
+ this._registerDelegate("addScriptToEvaluateOnLoad");
+ this._registerDelegate("changeTagName");
+ this._registerDelegate("clearConsoleMessages");
+ this._registerDelegate("copyNode");
+ this._registerDelegate("deleteCookie");
+ this._registerDelegate("didEvaluateForTestInFrontend");
+ this._registerDelegate("disableMonitoringXHR");
+ this._registerDelegate("disableResourceTracking");
+ this._registerDelegate("disableSearchingForNode");
+ this._registerDelegate("disableTimeline");
+ this._registerDelegate("dispatchOnInjectedScript");
+ this._registerDelegate("enableMonitoringXHR");
+ this._registerDelegate("enableResourceTracking");
+ this._registerDelegate("enableSearchingForNode");
+ this._registerDelegate("enableTimeline");
+ this._registerDelegate("getChildNodes");
+ this._registerDelegate("getCookies");
+ this._registerDelegate("getDatabaseTableNames");
+ this._registerDelegate("getDOMStorageEntries");
+ this._registerDelegate("getEventListenersForNode");
+ this._registerDelegate("getOuterHTML");
+ this._registerDelegate("getProfile");
+ this._registerDelegate("getProfileHeaders");
+ this._registerDelegate("removeProfile");
+ this._registerDelegate("clearProfiles");
+ this._registerDelegate("getResourceContent");
+ this._registerDelegate("highlightDOMNode");
+ this._registerDelegate("hideDOMNodeHighlight");
+ this._registerDelegate("performSearch");
+ this._registerDelegate("pushNodeByPathToFrontend");
+ this._registerDelegate("releaseWrapperObjectGroup");
+ this._registerDelegate("removeAllScriptsToEvaluateOnLoad");
+ this._registerDelegate("reloadPage");
+ this._registerDelegate("removeAttribute");
+ this._registerDelegate("removeDOMStorageItem");
+ this._registerDelegate("removeNode");
+ this._registerDelegate("saveApplicationSettings");
+ this._registerDelegate("saveSessionSettings");
+ this._registerDelegate("searchCanceled");
+ this._registerDelegate("setAttribute");
+ this._registerDelegate("setDOMStorageItem");
+ this._registerDelegate("setInjectedScriptSource");
+ this._registerDelegate("setOuterHTML");
+ this._registerDelegate("setTextNodeValue");
+ this._registerDelegate("startProfiling");
+ this._registerDelegate("startTimelineProfiler");
+ this._registerDelegate("stopProfiling");
+ this._registerDelegate("stopTimelineProfiler");
+ this._registerDelegate("storeLastActivePanel");
+ this._registerDelegate("takeHeapSnapshot");
+
+ this._registerDelegate("getAllStyles");
+ this._registerDelegate("getStyles");
+ this._registerDelegate("getComputedStyle");
+ this._registerDelegate("getInlineStyle");
+ this._registerDelegate("getStyleSheet");
+ this._registerDelegate("getRuleRanges");
+ this._registerDelegate("applyStyleText");
+ this._registerDelegate("setStyleText");
+ this._registerDelegate("setStyleProperty");
+ this._registerDelegate("toggleStyleEnabled");
+ this._registerDelegate("setRuleSelector");
+ this._registerDelegate("addRule");
+
+ this._registerDelegate("disableDebugger");
+ this._registerDelegate("editScriptSource");
+ this._registerDelegate("getScriptSource");
+ this._registerDelegate("enableDebugger");
+ this._registerDelegate("setBreakpoint");
+ this._registerDelegate("removeBreakpoint");
+ this._registerDelegate("activateBreakpoints");
+ this._registerDelegate("deactivateBreakpoints");
+ this._registerDelegate("resume");
+ this._registerDelegate("stepIntoStatement");
+ this._registerDelegate("stepOutOfFunction");
+ this._registerDelegate("stepOverStatement");
+ this._registerDelegate("setPauseOnExceptionsState");
}
WebInspector.InspectorBackendStub.prototype = {
- wrapCallback: function(func)
- {
- return func;
- },
-
- closeWindow: function()
- {
- this._windowVisible = false;
- },
-
- attach: function()
- {
- },
-
- detach: function()
- {
- },
-
- storeLastActivePanel: function(panel)
- {
- },
-
- clearConsoleMessages: function()
- {
- },
-
- getOuterHTML: function()
- {
- },
-
- setOuterHTML: function()
- {
- },
-
- addInspectedNode: function()
- {
- },
-
- search: function(sourceRow, query)
- {
- },
-
- moveByUnrestricted: function(x, y)
- {
- },
-
- getResourceContent: function(callId, identifier)
- {
- WebInspector.didGetResourceContent(callId, "");
- },
-
- highlightDOMNode: function(node)
- {
- },
-
- hideDOMNodeHighlight: function()
- {
- },
-
- inspectedWindow: function()
- {
- return window;
- },
-
- loaded: function()
- {
- },
-
- localizedStringsURL: function()
- {
- return undefined;
- },
-
- windowUnloading: function()
- {
- return false;
- },
-
- hiddenPanels: function()
- {
- return "";
- },
-
- enableResourceTracking: function()
- {
- WebInspector.resourceTrackingWasEnabled();
- },
-
- disableResourceTracking: function()
- {
- WebInspector.resourceTrackingWasDisabled();
- },
-
-
- enableSearchingForNode: function()
- {
- WebInspector.searchingForNodeWasEnabled();
- },
-
- disableSearchingForNode: function()
- {
- WebInspector.searchingForNodeWasDisabled();
- },
-
- enableMonitoringXHR: function()
- {
- WebInspector.monitoringXHRWasEnabled();
- },
-
- disableMonitoringXHR: function()
- {
- WebInspector.monitoringXHRWasDisabled();
- },
-
- reloadPage: function()
- {
- },
-
- enableDebugger: function()
- {
- WebInspector.debuggerWasEnabled();
- },
-
- disableDebugger: function()
- {
- WebInspector.debuggerWasDisabled();
- },
-
- setBreakpoint: function(callId, sourceID, line, enabled, condition)
- {
- WebInspector.didSetBreakpoint(callId, true, line);
- },
-
- removeBreakpoint: function(sourceID, line)
- {
- },
-
- activateBreakpoints: function()
- {
- this._breakpointsActivated = true;
- },
-
- deactivateBreakpoints: function()
- {
- this._breakpointsActivated = false;
- },
-
- pause: function()
- {
- },
-
- setPauseOnExceptionsState: function(value)
- {
- WebInspector.updatePauseOnExceptionsState(value);
- },
-
- editScriptSource: function()
- {
- WebInspector.didEditScriptSource(callId, false);
- },
-
- getScriptSource: function(callId, sourceID)
- {
- WebInspector.didGetScriptSource(callId, null);
- },
-
- resume: function()
- {
- },
-
- enableProfiler: function()
- {
- WebInspector.profilerWasEnabled();
- },
-
- disableProfiler: function()
- {
- WebInspector.profilerWasDisabled();
- },
-
- startProfiling: function()
- {
- },
-
- stopProfiling: function()
- {
- },
-
- getProfileHeaders: function(callId)
- {
- WebInspector.didGetProfileHeaders(callId, []);
- },
-
- getProfile: function(callId, uid)
- {
- },
-
- takeHeapSnapshot: function()
- {
- },
-
- databaseTableNames: function(database)
- {
- return [];
- },
-
- stepIntoStatement: function()
- {
- },
-
- stepOutOfFunction: function()
- {
- },
-
- stepOverStatement: function()
- {
- },
-
- saveApplicationSettings: function()
- {
- },
-
- saveSessionSettings: function()
- {
- },
-
- dispatchOnInjectedScript: function()
+ _registerDelegate: function(methodName)
{
+ this[methodName] = this.sendMessageToBackend.bind(this, methodName);
},
- releaseWrapperObjectGroup: function()
- {
- },
-
- setInjectedScriptSource: function()
- {
- },
-
- addScriptToEvaluateOnLoad: function()
- {
- },
-
- removeAllScriptsToEvaluateOnLoad: function()
- {
- },
-
- performSearch: function()
- {
- },
-
- searchCanceled: function()
+ sendMessageToBackend: function()
{
+ var message = JSON.stringify(Array.prototype.slice.call(arguments));
+ if (WebInspector._paramsObject && "page" in WebInspector._paramsObject)
+ WebInspector.socket.send(message);
+ else
+ InspectorFrontendHost.sendMessageToBackend(message);
}
}
InspectorBackend = new WebInspector.InspectorBackendStub();
-
-}
diff --git a/WebCore/inspector/front-end/ResourceView.js b/WebCore/inspector/front-end/ResourceView.js
index bfd1576..7ce09b6 100644
--- a/WebCore/inspector/front-end/ResourceView.js
+++ b/WebCore/inspector/front-end/ResourceView.js
@@ -176,7 +176,8 @@ WebInspector.ResourceView.prototype = {
this.tabbedPane.selectTabById("content");
if ("resize" in this)
this.resize();
- this.contentTabSelected();
+ if (this.hasContentTab())
+ this.contentTabSelected();
},
_refreshURL: function()
diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js
index b02a277..4fda07b 100644
--- a/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/WebCore/inspector/front-end/ResourcesPanel.js
@@ -82,30 +82,30 @@ WebInspector.ResourcesPanel.prototype = {
populateSidebar: function()
{
- var timeGraphItem = new WebInspector.SidebarTreeElement("resources-time-graph-sidebar-item", WebInspector.UIString("Time"));
- timeGraphItem.onselect = this._graphSelected.bind(this);
+ this.timeGraphItem = new WebInspector.SidebarTreeElement("resources-time-graph-sidebar-item", WebInspector.UIString("Time"));
+ this.timeGraphItem.onselect = this._graphSelected.bind(this);
var transferTimeCalculator = new WebInspector.ResourceTransferTimeCalculator();
var transferDurationCalculator = new WebInspector.ResourceTransferDurationCalculator();
- timeGraphItem.sortingOptions = [
- { name: WebInspector.UIString("Sort by Start Time"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByAscendingStartTime, calculator: transferTimeCalculator },
- { name: WebInspector.UIString("Sort by Response Time"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByAscendingResponseReceivedTime, calculator: transferTimeCalculator },
- { name: WebInspector.UIString("Sort by End Time"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByAscendingEndTime, calculator: transferTimeCalculator },
- { name: WebInspector.UIString("Sort by Duration"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingDuration, calculator: transferDurationCalculator },
- { name: WebInspector.UIString("Sort by Latency"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingLatency, calculator: transferDurationCalculator },
+ this.timeGraphItem.sortingOptions = [
+ { name: WebInspector.UIString("Sort by Start Time"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByAscendingStartTime, calculator: transferTimeCalculator, optionName: "startTime" },
+ { name: WebInspector.UIString("Sort by Response Time"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByAscendingResponseReceivedTime, calculator: transferTimeCalculator, optionName: "responseTime" },
+ { name: WebInspector.UIString("Sort by End Time"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByAscendingEndTime, calculator: transferTimeCalculator, optionName: "endTime" },
+ { name: WebInspector.UIString("Sort by Duration"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingDuration, calculator: transferDurationCalculator, optionName: "duration" },
+ { name: WebInspector.UIString("Sort by Latency"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingLatency, calculator: transferDurationCalculator, optionName: "latency" },
];
- timeGraphItem.isBarOpaqueAtLeft = false;
- timeGraphItem.selectedSortingOptionIndex = 1;
+ this.timeGraphItem.isBarOpaqueAtLeft = false;
+ this.timeGraphItem.selectedSortingOptionIndex = 1;
this.sizeGraphItem = new WebInspector.SidebarTreeElement("resources-size-graph-sidebar-item", WebInspector.UIString("Size"));
this.sizeGraphItem.onselect = this._graphSelected.bind(this);
var transferSizeCalculator = new WebInspector.ResourceTransferSizeCalculator();
this.sizeGraphItem.sortingOptions = [
- { name: WebInspector.UIString("Sort by Transfer Size"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingTransferSize, calculator: transferSizeCalculator },
- { name: WebInspector.UIString("Sort by Size"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingSize, calculator: transferSizeCalculator },
+ { name: WebInspector.UIString("Sort by Transfer Size"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingTransferSize, calculator: transferSizeCalculator, optionName: "transferSize" },
+ { name: WebInspector.UIString("Sort by Size"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingSize, calculator: transferSizeCalculator, optionName: "size" },
];
this.sizeGraphItem.isBarOpaqueAtLeft = true;
@@ -114,7 +114,7 @@ WebInspector.ResourcesPanel.prototype = {
this.graphsTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("GRAPHS"), {}, true);
this.sidebarTree.appendChild(this.graphsTreeElement);
- this.graphsTreeElement.appendChild(timeGraphItem);
+ this.graphsTreeElement.appendChild(this.timeGraphItem);
this.graphsTreeElement.appendChild(this.sizeGraphItem);
this.graphsTreeElement.expand();
@@ -160,6 +160,32 @@ WebInspector.ResourcesPanel.prototype = {
this.largerResourcesButton.toggled = WebInspector.applicationSettings.resourcesLargeRows;
if (!WebInspector.applicationSettings.resourcesLargeRows)
this._setLargerResources(WebInspector.applicationSettings.resourcesLargeRows);
+ this._loadSortOptions();
+ },
+
+ _loadSortOptions: function()
+ {
+ var newOptions = WebInspector.applicationSettings.resourcesSortOptions;
+ if (!newOptions)
+ return;
+
+ this._loadSortOptionForGraph(this.timeGraphItem, newOptions.timeOption || "responseTime");
+ this._loadSortOptionForGraph(this.sizeGraphItem, newOptions.sizeOption || "transferSize");
+ },
+
+ _loadSortOptionForGraph: function(graphItem, newOptionName)
+ {
+ var sortingOptions = graphItem.sortingOptions;
+ for (var i = 0; i < sortingOptions.length; ++i) {
+ if (sortingOptions[i].optionName === newOptionName) {
+ graphItem.selectedSortingOptionIndex = i;
+ // Propagate the option change down to the currently selected option.
+ if (this._lastSelectedGraphTreeElement === graphItem) {
+ this._lastSelectedGraphTreeElement = null;
+ this._graphSelected(graphItem);
+ }
+ }
+ }
},
get mainResourceLoadTime()
@@ -618,11 +644,12 @@ WebInspector.ResourcesPanel.prototype = {
option.label = sortingOption.name;
option.sortingFunction = sortingOption.sortingFunction;
option.calculator = sortingOption.calculator;
+ option.optionName = sortingOption.optionName;
this.sortingSelectElement.appendChild(option);
}
this.sortingSelectElement.selectedIndex = treeElement.selectedSortingOptionIndex;
- this._changeSortingFunction();
+ this._doChangeSortingFunction();
this.closeVisibleResource();
this.containerElement.scrollTop = 0;
@@ -658,7 +685,21 @@ WebInspector.ResourcesPanel.prototype = {
_changeSortingFunction: function()
{
- var selectedOption = this.sortingSelectElement[this.sortingSelectElement.selectedIndex];
+ this._doChangeSortingFunction();
+ WebInspector.applicationSettings.resourcesSortOptions = {timeOption: this._selectedOptionNameForGraph(this.timeGraphItem), sizeOption: this._selectedOptionNameForGraph(this.sizeGraphItem)};
+ },
+
+ _selectedOptionNameForGraph: function(graphItem)
+ {
+ return graphItem.sortingOptions[graphItem.selectedSortingOptionIndex].optionName;
+ },
+
+ _doChangeSortingFunction: function()
+ {
+ var selectedIndex = this.sortingSelectElement.selectedIndex;
+ if (this._lastSelectedGraphTreeElement)
+ this._lastSelectedGraphTreeElement.selectedSortingOptionIndex = selectedIndex;
+ var selectedOption = this.sortingSelectElement[selectedIndex];
this.sortingFunction = selectedOption.sortingFunction;
this.calculator = this.summaryBar.calculator = selectedOption.calculator;
},
@@ -751,61 +792,83 @@ WebInspector.ResourcesPanel.prototype = {
{
var tableElement = document.createElement("table");
var resource = anchor.parentElement.resource;
- var data = [];
+ var rows = [];
- if (resource.timing.proxyDuration !== -1) {
- data.push(WebInspector.UIString("Proxy"));
- data.push(Number.secondsToString(resource.timing.proxyDuration));
+ function addRow(title, start, end, color)
+ {
+ var row = {};
+ row.title = title;
+ row.start = start;
+ row.end = end;
+ rows.push(row);
}
- if (resource.timing.dnsDuration !== -1) {
- data.push(WebInspector.UIString("DNS Lookup"));
- data.push(Number.secondsToString(resource.timing.dnsDuration));
+ if (resource.timing.proxyStart !== -1)
+ addRow(WebInspector.UIString("Proxy"), resource.timing.proxyStart, resource.timing.proxyEnd);
+
+ if (resource.timing.dnsStart !== -1) {
+ addRow(WebInspector.UIString("DNS Lookup"), resource.timing.dnsStart, resource.timing.dnsEnd);
}
- if (resource.timing.connectDuration !== -1) {
- if (resource.connectionReused) {
- data.push(WebInspector.UIString("Blocking"));
- data.push(Number.secondsToString(resource.timing.connectDuration));
- } else {
- data.push(WebInspector.UIString("Connecting"));
+ if (resource.timing.connectStart !== -1) {
+ if (resource.connectionReused)
+ addRow(WebInspector.UIString("Blocking"), resource.timing.connectStart, resource.timing.connectEnd);
+ else {
+ var connectStart = resource.timing.connectStart;
// Connection includes DNS, subtract it here.
- var connectDuration = resource.timing.connectDuration;
- if (resource.timing.dnsDuration !== -1)
- connectDuration -= resource.timing.dnsDuration;
- data.push(Number.secondsToString(connectDuration));
+ if (resource.timing.dnsStart !== -1)
+ connectStart += resource.timing.dnsEnd - resource.timing.dnsStart;
+ addRow(WebInspector.UIString("Connecting"), connectStart, resource.timing.connectEnd);
}
}
- if (resource.timing.sslDuration !== -1) {
- data.push(WebInspector.UIString("SSL"));
- data.push(Number.secondsToString(resource.timing.sslDuration));
- }
-
- data.push(WebInspector.UIString("Sending"));
- data.push(Number.secondsToString(resource.timing.sendDuration));
+ if (resource.timing.sslStart !== -1)
+ addRow(WebInspector.UIString("SSL"), resource.timing.sslStart, resource.timing.sslEnd);
- data.push(WebInspector.UIString("Waiting"));
- // Waiting includes SSL, subtract it here.
- var waitDuration = resource.timing.waitDuration;
- if (resource.timing.sslDuration !== -1)
- waitDuration -= resource.timing.sslDuration;
- data.push(Number.secondsToString(waitDuration));
+ var sendStart = resource.timing.sendStart;
+ if (resource.timing.sslStart !== -1)
+ sendStart += resource.timing.sslEnd - resource.timing.sslStart;
+
+ addRow(WebInspector.UIString("Sending"), resource.timing.sendStart, resource.timing.sendEnd);
+ addRow(WebInspector.UIString("Waiting"), resource.timing.sendEnd, resource.timing.receiveHeadersEnd);
+ addRow(WebInspector.UIString("Receiving"), (resource.responseReceivedTime - resource.timing.requestTime) * 1000, (resource.endTime - resource.timing.requestTime) * 1000);
- data.push(WebInspector.UIString("Receiving"));
- data.push(Number.secondsToString(resource.endTime - resource.responseReceivedTime));
+ const chartWidth = 200;
+ var total = (resource.endTime - resource.timing.requestTime) * 1000;
+ var scale = chartWidth / total;
- for (var i = 0; i < data.length; i += 2) {
+ for (var i = 0; i < rows.length; ++i) {
var tr = document.createElement("tr");
tableElement.appendChild(tr);
var td = document.createElement("td");
- td.textContent = data[i];
+ td.textContent = rows[i].title;
tr.appendChild(td);
td = document.createElement("td");
- td.align = "right";
- td.textContent = data[i + 1];
+ td.width = chartWidth + "px";
+
+ var row = document.createElement("div");
+ row.className = "resource-timing-row";
+ td.appendChild(row);
+
+ var bar = document.createElement("span");
+ bar.className = "resource-timing-bar";
+ bar.style.left = scale * rows[i].start + "px";
+ bar.style.right = scale * (total - rows[i].end) + "px";
+ bar.style.backgroundColor = rows[i].color;
+ bar.textContent = "\u200B"; // Important for 0-time items to have 0 width.
+ row.appendChild(bar);
+
+ var title = document.createElement("span");
+ title.className = "resource-timing-bar-title";
+ if (i >= rows.length - 2)
+ title.style.right = (scale * (total - rows[i].end) + 3) + "px";
+ else
+ title.style.left = (scale * rows[i].start + 3) + "px";
+ title.textContent = Number.millisToString(rows[i].end - rows[i].start);
+ row.appendChild(title);
+
tr.appendChild(td);
}
diff --git a/WebCore/inspector/front-end/ScriptView.js b/WebCore/inspector/front-end/ScriptView.js
index c576510..597fd28 100644
--- a/WebCore/inspector/front-end/ScriptView.js
+++ b/WebCore/inspector/front-end/ScriptView.js
@@ -97,6 +97,8 @@ WebInspector.ScriptView.prototype = {
_addBreakpoint: function(line)
{
WebInspector.breakpointManager.setBreakpoint(this.script.sourceID, this.script.sourceURL, line, true, "");
+ if (!WebInspector.panels.scripts.breakpointsActivated)
+ WebInspector.panels.scripts.toggleBreakpointsClicked();
},
_editLineComplete: function(newBody)
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index 7a1a4d5..dff4853 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -104,10 +104,10 @@ WebInspector.ScriptsPanel = function()
this.sidebarButtonsElement.appendChild(this.stepOutButton);
this.toggleBreakpointsButton = new WebInspector.StatusBarButton("", "toggle-breakpoints");
- this.toggleBreakpointsButton.addEventListener("click", this._toggleBreakpointsClicked.bind(this), false);
+ this.toggleBreakpointsButton.addEventListener("click", this.toggleBreakpointsClicked.bind(this), false);
this.sidebarButtonsElement.appendChild(this.toggleBreakpointsButton.element);
// Breakpoints should be activated by default, so emulate a click to toggle on.
- this._toggleBreakpointsClicked();
+ this.toggleBreakpointsClicked();
this.debuggerStatusElement = document.createElement("div");
this.debuggerStatusElement.id = "scripts-debugger-status";
@@ -164,7 +164,7 @@ WebInspector.ScriptsPanel = function()
this._pauseOnExceptionButton = new WebInspector.StatusBarButton("", "scripts-pause-on-exceptions-status-bar-item", 3);
this._pauseOnExceptionButton.addEventListener("click", this._togglePauseOnExceptions.bind(this), false);
this._pauseOnExceptionButton.state = WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions;
- this._pauseOnExceptionButton.title = WebInspector.UIString("Don't pause on exceptions.\nClick to Pause on all exceptions.");
+ this._pauseOnExceptionButton.title = WebInspector.UIString("Don't pause on exceptions.\nClick to Pause on all exceptions.");
this._registerShortcuts();
@@ -219,7 +219,7 @@ WebInspector.ScriptsPanel.prototype = {
delete this._attachDebuggerWhenShown;
}
},
-
+
hide: function()
{
if (this.visibleView)
@@ -278,7 +278,7 @@ WebInspector.ScriptsPanel.prototype = {
// Remove script from the files list.
script.filesSelectOption.parentElement.removeChild(script.filesSelectOption);
-
+
// Move breakpoints to the resource's frame.
if (script._scriptView) {
var sourceFrame = script._scriptView.sourceFrame;
@@ -296,9 +296,6 @@ WebInspector.ScriptsPanel.prototype = {
{
var breakpoint = event.data;
- if (!this.breakpointsActivated)
- this._toggleBreakpointsClicked();
-
var sourceFrame;
if (breakpoint.url) {
var resource = WebInspector.resourceURLMap[breakpoint.url];
@@ -540,7 +537,7 @@ WebInspector.ScriptsPanel.prototype = {
this._showScriptOrResource(scriptOrResource, {line: line, shouldHighlightLine: true});
},
- _scriptOrResourceForURLAndLine: function(url, line)
+ _scriptOrResourceForURLAndLine: function(url, line)
{
var scriptWithMatchingUrl = null;
for (var sourceID in this._sourceIDMap) {
@@ -612,8 +609,7 @@ WebInspector.ScriptsPanel.prototype = {
_showScriptOrResource: function(scriptOrResource, options)
{
// options = {line:, shouldHighlightLine:, fromBackForwardAction:, initialLoad:}
- if (!options)
- options = {};
+ options = options || {};
if (!scriptOrResource)
return;
@@ -695,7 +691,7 @@ WebInspector.ScriptsPanel.prototype = {
return;
this._resourceForURLInFilesSelect[script.resource.url] = script.resource;
}
-
+
var displayName = script.sourceURL ? WebInspector.displayNameForURL(script.sourceURL) : WebInspector.UIString("(program)");
var select = this.filesSelectElement;
@@ -814,7 +810,7 @@ WebInspector.ScriptsPanel.prototype = {
this.resize();
},
-
+
updatePauseOnExceptionsState: function(pauseOnExceptionsState)
{
if (pauseOnExceptionsState == WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions)
@@ -973,7 +969,7 @@ WebInspector.ScriptsPanel.prototype = {
InspectorBackend.stepOutOfFunction();
},
- _toggleBreakpointsClicked: function()
+ toggleBreakpointsClicked: function()
{
this.toggleBreakpointsButton.toggled = !this.toggleBreakpointsButton.toggled;
if (this.toggleBreakpointsButton.toggled) {
diff --git a/WebCore/inspector/front-end/Settings.js b/WebCore/inspector/front-end/Settings.js
index 39c1e1e..22db491 100644
--- a/WebCore/inspector/front-end/Settings.js
+++ b/WebCore/inspector/front-end/Settings.js
@@ -58,6 +58,7 @@ WebInspector.populateApplicationSettings = function(settingsString)
WebInspector.applicationSettings.installSetting("showUserAgentStyles", "show-user-agent-styles", true);
WebInspector.applicationSettings.installSetting("resourceViewTab", "resource-view-tab", "content");
WebInspector.applicationSettings.installSetting("consoleHistory", "console-history", []);
+ WebInspector.applicationSettings.installSetting("resourcesSortOptions", "resources-sort-options", {timeOption: "responseTime", sizeOption: "transferSize"});
WebInspector.applicationSettings.dispatchEventToListeners("loaded");
}
@@ -71,38 +72,42 @@ WebInspector.populateSessionSettings = function(settingsString)
WebInspector.Settings = function(sessionScope)
{
this._sessionScope = sessionScope;
- this._defaultValues = {};
+ this._store = {};
}
WebInspector.Settings.prototype = {
reset: function()
{
this._store = {};
+ // FIXME: restore default values (bug 42820)
this.dispatchEventToListeners("loaded");
},
_load: function(settingsString)
{
try {
- this._store = JSON.parse(settingsString);
+ var loadedStore = JSON.parse(settingsString);
} catch (e) {
// May fail;
- this._store = {};
+ loadedStore = {};
}
+ if (!loadedStore)
+ return;
+ for (var propertyName in loadedStore)
+ this._store[propertyName] = loadedStore[propertyName];
},
installSetting: function(name, propertyName, defaultValue)
{
this.__defineGetter__(name, this._get.bind(this, propertyName));
this.__defineSetter__(name, this._set.bind(this, propertyName));
- this._defaultValues[propertyName] = defaultValue;
+ if (!(propertyName in this._store))
+ this._store[propertyName] = defaultValue;
},
_get: function(propertyName)
{
- if (propertyName in this._store)
- return this._store[propertyName];
- return this._defaultValues[propertyName];
+ return this._store[propertyName];
},
_set: function(propertyName, newValue)
diff --git a/WebCore/inspector/front-end/SourceView.js b/WebCore/inspector/front-end/SourceView.js
index 1bf8194..4d03ecd 100644
--- a/WebCore/inspector/front-end/SourceView.js
+++ b/WebCore/inspector/front-end/SourceView.js
@@ -128,6 +128,8 @@ WebInspector.SourceView.prototype = {
{
var sourceID = this._sourceIDForLine(line);
WebInspector.breakpointManager.setBreakpoint(sourceID, this.resource.url, line, true, "");
+ if (!WebInspector.panels.scripts.breakpointsActivated)
+ WebInspector.panels.scripts.toggleBreakpointsClicked();
},
_removeBreakpoint: function(breakpoint)
diff --git a/WebCore/inspector/front-end/inspector.css b/WebCore/inspector/front-end/inspector.css
index f1ee49f..8c4a2ea 100644
--- a/WebCore/inspector/front-end/inspector.css
+++ b/WebCore/inspector/front-end/inspector.css
@@ -977,6 +977,22 @@ body.platform-linux .monospace, body.platform-linux .source-code {
content: "\A";
}
+.resource-timing-row {
+ position: relative;
+ height: 12px;
+}
+
+.resource-timing-bar {
+ position: absolute;
+ background-color: red;
+ border-left: 1px solid red;
+ opacity: 0.4;
+}
+
+.resource-timing-bar-title {
+ position: absolute;
+}
+
#elements-content {
display: block;
overflow: auto;
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 5ec7081..0adf057 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -1129,11 +1129,6 @@ WebInspector.showAuditsPanel = function()
this.currentPanel = this.panels.audits;
}
-WebInspector.clearConsoleMessages = function()
-{
- WebInspector.console.clearMessages();
-}
-
WebInspector.selectDatabase = function(o)
{
WebInspector.showStoragePanel();
diff --git a/WebCore/inspector/front-end/utilities.js b/WebCore/inspector/front-end/utilities.js
index 6e7c725..d248071 100644
--- a/WebCore/inspector/front-end/utilities.js
+++ b/WebCore/inspector/front-end/utilities.js
@@ -639,6 +639,11 @@ function parentNode(node)
return node.parentNode;
}
+Number.millisToString = function(ms, formatterFunction, higherResolution)
+{
+ return Number.secondsToString(ms / 1000, formatterFunction, higherResolution);
+}
+
Number.secondsToString = function(seconds, formatterFunction, higherResolution)
{
if (!formatterFunction)
diff --git a/JavaScriptCore/jit/ExecutableAllocatorPosix.cpp b/WebCore/loader/DocumentLoadTiming.h
index a841d32..71a1dc4 100644
--- a/JavaScriptCore/jit/ExecutableAllocatorPosix.cpp
+++ b/WebCore/loader/DocumentLoadTiming.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Google, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -10,10 +10,10 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``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 APPLE INC. OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC. 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
@@ -23,42 +23,37 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
-
-#include "ExecutableAllocator.h"
-
-#if ENABLE(EXECUTABLE_ALLOCATOR_DEMAND) && !OS(WINDOWS) && !OS(SYMBIAN)
-
-#include <sys/mman.h>
-#include <unistd.h>
-#include <wtf/VMTags.h>
-
-namespace JSC {
-
-void ExecutableAllocator::intializePageSize()
-{
- ExecutableAllocator::pageSize = getpagesize();
-}
-
-ExecutablePool::Allocation ExecutablePool::systemAlloc(size_t n)
-{
- void* allocation = mmap(NULL, n, INITIAL_PROTECTION_FLAGS, MAP_PRIVATE | MAP_ANON, VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY, 0);
- if (allocation == MAP_FAILED)
- CRASH();
- ExecutablePool::Allocation alloc = { reinterpret_cast<char*>(allocation), n };
- return alloc;
-}
-
-void ExecutablePool::systemRelease(const ExecutablePool::Allocation& alloc)
-{
- int result = munmap(alloc.pages, alloc.size);
- ASSERT_UNUSED(result, !result);
-}
-
-bool ExecutableAllocator::isValid() const
-{
- return true;
-}
+#ifndef DocumentLoadTiming_h
+#define DocumentLoadTiming_h
+
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+struct DocumentLoadTiming : public Noncopyable {
+ DocumentLoadTiming()
+ : navigationStart(0.0)
+ , unloadEventEnd(0.0)
+ , redirectStart(0.0)
+ , redirectEnd(0.0)
+ , redirectCount(0)
+ , fetchStart(0.0)
+ , responseEnd(0.0)
+ , loadEventStart(0.0)
+ , loadEventEnd(0.0)
+ {
+ }
+
+ double navigationStart;
+ double unloadEventEnd;
+ double redirectStart;
+ double redirectEnd;
+ short redirectCount;
+ double fetchStart;
+ double responseEnd;
+ double loadEventStart;
+ double loadEventEnd;
+};
}
diff --git a/WebCore/loader/DocumentLoader.h b/WebCore/loader/DocumentLoader.h
index f5935c9..2bd0761 100644
--- a/WebCore/loader/DocumentLoader.h
+++ b/WebCore/loader/DocumentLoader.h
@@ -29,6 +29,7 @@
#ifndef DocumentLoader_h
#define DocumentLoader_h
+#include "DocumentLoadTiming.h"
#include "NavigationAction.h"
#include "ResourceError.h"
#include "ResourceRequest.h"
diff --git a/WebCore/loader/FormSubmission.cpp b/WebCore/loader/FormSubmission.cpp
index 4d44174..f661273 100644
--- a/WebCore/loader/FormSubmission.cpp
+++ b/WebCore/loader/FormSubmission.cpp
@@ -31,18 +31,86 @@
#include "config.h"
#include "FormSubmission.h"
+#include "CSSHelper.h"
+#include "DOMFormData.h"
+#include "Document.h"
#include "Event.h"
#include "FormData.h"
+#include "FormDataBuilder.h"
#include "FormState.h"
#include "Frame.h"
#include "FrameLoadRequest.h"
#include "FrameLoader.h"
+#include "HTMLFormControlElement.h"
#include "HTMLFormElement.h"
-#include <wtf/PassRefPtr.h>
+#include "HTMLInputElement.h"
+#include "HTMLNames.h"
+#include "TextEncoding.h"
+#include <wtf/CurrentTime.h>
+#include <wtf/RandomNumber.h>
namespace WebCore {
-FormSubmission::FormSubmission(Method method, const KURL& action, const String& target, const String& contentType, PassRefPtr<FormState> state, PassRefPtr<FormData> data, const String& boundary, bool lockHistory, PassRefPtr<Event> event)
+using namespace HTMLNames;
+
+static int64_t generateFormDataIdentifier()
+{
+ // Initialize to the current time to reduce the likelihood of generating
+ // identifiers that overlap with those from past/future browser sessions.
+ static int64_t nextIdentifier = static_cast<int64_t>(currentTime() * 1000000.0);
+ return ++nextIdentifier;
+}
+
+static void appendMailtoPostFormDataToURL(KURL& url, const FormData& data, const String& encodingType)
+{
+ String body = data.flattenToString();
+
+ if (equalIgnoringCase(encodingType, "text/plain")) {
+ // Convention seems to be to decode, and s/&/\r\n/. Also, spaces are encoded as %20.
+ body = decodeURLEscapeSequences(body.replace('&', "\r\n").replace('+', ' ') + "\r\n");
+ }
+
+ Vector<char> bodyData;
+ bodyData.append("body=", 5);
+ FormDataBuilder::encodeStringAsFormData(bodyData, body.utf8());
+ body = String(bodyData.data(), bodyData.size()).replace('+', "%20");
+
+ String query = url.query();
+ if (!query.isEmpty())
+ query.append('&');
+ query.append(body);
+ url.setQuery(query);
+}
+
+void FormSubmission::Attributes::parseAction(const String& action)
+{
+ // FIXME: Can we parse into a KURL?
+ m_action = deprecatedParseURL(action);
+}
+
+void FormSubmission::Attributes::parseEncodingType(const String& type)
+{
+ if (type.contains("multipart", false) || type.contains("form-data", false)) {
+ m_encodingType = "multipart/form-data";
+ m_isMultiPartForm = true;
+ } else if (type.contains("text", false) || type.contains("plain", false)) {
+ m_encodingType = "text/plain";
+ m_isMultiPartForm = false;
+ } else {
+ m_encodingType = "application/x-www-form-urlencoded";
+ m_isMultiPartForm = false;
+ }
+}
+
+void FormSubmission::Attributes::parseMethodType(const String& type)
+{
+ if (equalIgnoringCase(type, "post"))
+ m_method = FormSubmission::PostMethod;
+ else if (equalIgnoringCase(type, "get"))
+ m_method = FormSubmission::GetMethod;
+}
+
+inline FormSubmission::FormSubmission(Method method, const KURL& action, const String& target, const String& contentType, PassRefPtr<FormState> state, PassRefPtr<FormData> data, const String& boundary, bool lockHistory, PassRefPtr<Event> event)
: m_method(method)
, m_action(action)
, m_target(target)
@@ -55,9 +123,60 @@ FormSubmission::FormSubmission(Method method, const KURL& action, const String&
{
}
-PassRefPtr<FormSubmission> FormSubmission::create(Method method, const KURL& action, const String& target, const String& contentType, PassRefPtr<FormState> state, PassRefPtr<FormData> data, const String& boundary, bool lockHistory, PassRefPtr<Event> event)
+PassRefPtr<FormSubmission> FormSubmission::create(HTMLFormElement* form, const Attributes& attributes, PassRefPtr<Event> event, bool lockHistory, FormSubmissionTrigger trigger)
{
- return adoptRef(new FormSubmission(method, action, target, contentType, state, data, boundary, lockHistory, event));
+ ASSERT(form);
+ Document* document = form->document();
+ KURL actionURL = document->completeURL(attributes.action().isEmpty() ? document->url().string() : attributes.action());
+ bool isMailtoForm = actionURL.protocolIs("mailto");
+ bool isMultiPartForm = false;
+ String encodingType = attributes.encodingType();
+
+ if (attributes.method() == PostMethod) {
+ isMultiPartForm = attributes.isMultiPartForm();
+ if (isMultiPartForm && isMailtoForm) {
+ encodingType = "application/x-www-form-urlencoded";
+ isMultiPartForm = false;
+ }
+ }
+
+ TextEncoding dataEncoding = isMailtoForm ? UTF8Encoding() : FormDataBuilder::encodingFromAcceptCharset(attributes.acceptCharset(), document);
+ RefPtr<DOMFormData> domFormData = DOMFormData::create(dataEncoding.encodingForFormSubmission());
+ Vector<pair<String, String> > formValues;
+
+ for (unsigned i = 0; i < form->associatedElements().size(); ++i) {
+ HTMLFormControlElement* control = form->associatedElements()[i];
+ if (!control->disabled())
+ control->appendFormData(*domFormData, isMultiPartForm);
+ if (control->hasLocalName(inputTag)) {
+ HTMLInputElement* input = static_cast<HTMLInputElement*>(control);
+ if (input->isTextField()) {
+ formValues.append(pair<String, String>(input->name(), input->value()));
+ if (input->isSearchField())
+ input->addSearchResult();
+ }
+ }
+ }
+
+ RefPtr<FormData> formData;
+ String boundary;
+
+ if (isMultiPartForm) {
+ formData = FormData::createMultiPart(domFormData->items(), domFormData->encoding(), document);
+ boundary = formData->boundary().data();
+ } else {
+ formData = FormData::create(domFormData->items(), domFormData->encoding());
+ if (attributes.method() == PostMethod && isMailtoForm) {
+ // Convert the form data into a string that we put into the URL.
+ appendMailtoPostFormDataToURL(actionURL, *formData, encodingType);
+ formData = FormData::create();
+ }
+ }
+
+ formData->setIdentifier(generateFormDataIdentifier());
+ String targetOrBaseTarget = attributes.target().isEmpty() ? document->baseTarget() : attributes.target();
+ RefPtr<FormState> formState = FormState::create(form, formValues, document->frame(), trigger);
+ return adoptRef(new FormSubmission(attributes.method(), actionURL, targetOrBaseTarget, encodingType, formState.release(), formData.release(), boundary, lockHistory, event));
}
void FormSubmission::populateFrameLoadRequest(FrameLoadRequest& frameRequest)
diff --git a/WebCore/loader/FormSubmission.h b/WebCore/loader/FormSubmission.h
index 647c6c6..bee4e71 100644
--- a/WebCore/loader/FormSubmission.h
+++ b/WebCore/loader/FormSubmission.h
@@ -31,34 +31,69 @@
#ifndef FormSubmission_h
#define FormSubmission_h
+#include "FormState.h"
#include "KURL.h"
namespace WebCore {
+class Document;
class Event;
class FormData;
-class FormState;
struct FrameLoadRequest;
+class HTMLFormElement;
+class TextEncoding;
class FormSubmission : public RefCounted<FormSubmission> {
public:
- enum Method {
- GetMethod,
- PostMethod
+ enum Method { GetMethod, PostMethod };
+
+ class Attributes : public Noncopyable {
+ public:
+ Attributes()
+ : m_method(GetMethod)
+ , m_isMultiPartForm(false)
+ , m_encodingType("application/x-www-form-urlencoded")
+ {
+ }
+
+ Method method() const { return m_method; }
+ void parseMethodType(const String&);
+
+ const String& action() const { return m_action; }
+ void parseAction(const String&);
+
+ const String& target() const { return m_target; }
+ void setTarget(const String& target) { m_target = target; }
+
+ const String& encodingType() const { return m_encodingType; }
+ void parseEncodingType(const String&);
+ bool isMultiPartForm() const { return m_isMultiPartForm; }
+
+ const String& acceptCharset() const { return m_acceptCharset; }
+ void setAcceptCharset(const String& value) { m_acceptCharset = value; }
+
+ private:
+ Method m_method;
+ bool m_isMultiPartForm;
+
+ String m_action;
+ String m_target;
+ String m_encodingType;
+ String m_acceptCharset;
};
- static PassRefPtr<FormSubmission> create(Method, const KURL& action, const String& target, const String& contentType, PassRefPtr<FormState>, PassRefPtr<FormData>, const String& boundary, bool lockHistory, PassRefPtr<Event>);
+ static PassRefPtr<FormSubmission> create(HTMLFormElement*, const Attributes&, PassRefPtr<Event> event, bool lockHistory, FormSubmissionTrigger);
void populateFrameLoadRequest(FrameLoadRequest&);
Method method() const { return m_method; }
const KURL& action() const { return m_action; }
- String target() const { return m_target; }
+ const String& target() const { return m_target; }
void clearTarget() { m_target = String(); }
- String contentType() const { return m_contentType; }
+ const String& contentType() const { return m_contentType; }
FormState* state() const { return m_formState.get(); }
FormData* data() const { return m_formData.get(); }
- String boundary() const { return m_boundary; }
+ const String boundary() const { return m_boundary; }
bool lockHistory() const { return m_lockHistory; }
Event* event() const { return m_event.get(); }
@@ -70,6 +105,7 @@ public:
private:
FormSubmission(Method, const KURL& action, const String& target, const String& contentType, PassRefPtr<FormState>, PassRefPtr<FormData>, const String& boundary, bool lockHistory, PassRefPtr<Event>);
+ // FIXME: Hold an instance of Attributes instead of individual members.
Method m_method;
KURL m_action;
String m_target;
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 0ec4c98..f36aa60 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -47,6 +47,7 @@
#include "DOMWindow.h"
#include "DocLoader.h"
#include "Document.h"
+#include "DocumentLoadTiming.h"
#include "DocumentLoader.h"
#include "Editor.h"
#include "EditorClient.h"
@@ -93,6 +94,7 @@
#include "ProgressTracker.h"
#include "ResourceHandle.h"
#include "ResourceRequest.h"
+#include "SchemeRegistry.h"
#include "ScriptController.h"
#include "ScriptSourceCode.h"
#include "ScriptString.h"
@@ -1085,7 +1087,7 @@ bool FrameLoader::isMixedContent(SecurityOrigin* context, const KURL& url)
if (context->protocol() != "https")
return false; // We only care about HTTPS security origins.
- if (!url.isValid() || SecurityOrigin::shouldTreatURLSchemeAsSecure(url.protocol()))
+ if (!url.isValid() || SchemeRegistry::shouldTreatURLSchemeAsSecure(url.protocol()))
return false; // Loading these protocols is secure.
return true;
@@ -1351,7 +1353,7 @@ void FrameLoader::loadFrameRequest(const FrameLoadRequest& request, bool lockHis
referrer = m_outgoingReferrer;
ASSERT(frame()->document());
- if (SecurityOrigin::shouldTreatURLAsLocal(url.string()) && !isFeedWithNestedProtocolInHTTPFamily(url)) {
+ if (SchemeRegistry::shouldTreatURLAsLocal(url.string()) && !isFeedWithNestedProtocolInHTTPFamily(url)) {
if (!SecurityOrigin::canLoad(url, String(), frame()->document()) && !SecurityOrigin::canLoad(url, referrer, 0)) {
FrameLoader::reportLocalLoadFailed(m_frame, url.string());
return;
@@ -2253,8 +2255,6 @@ void FrameLoader::finishedLoading()
RefPtr<Frame> protect(m_frame);
RefPtr<DocumentLoader> dl = activeDocumentLoader();
- ASSERT(!dl->timing()->responseEnd);
- dl->timing()->responseEnd = currentTime();
dl->finishedLoading();
if (!dl->mainDocumentError().isNull() || !dl->frameLoader())
return;
diff --git a/WebCore/loader/FrameLoaderTypes.h b/WebCore/loader/FrameLoaderTypes.h
index 387b067..016de19 100644
--- a/WebCore/loader/FrameLoaderTypes.h
+++ b/WebCore/loader/FrameLoaderTypes.h
@@ -60,32 +60,6 @@ namespace WebCore {
FrameLoadTypeBackWMLDeckNotAccessible
};
- // FIXME: Move to DocumentLoadTiming.h.
- struct DocumentLoadTiming {
- DocumentLoadTiming()
- : navigationStart(0.0)
- , unloadEventEnd(0.0)
- , redirectStart(0.0)
- , redirectEnd(0.0)
- , redirectCount(0)
- , fetchStart(0.0)
- , responseEnd(0.0)
- , loadEventStart(0.0)
- , loadEventEnd(0.0)
- {
- }
-
- double navigationStart;
- double unloadEventEnd;
- double redirectStart;
- double redirectEnd;
- short redirectCount;
- double fetchStart;
- double responseEnd;
- double loadEventStart;
- double loadEventEnd;
- };
-
enum NavigationType {
NavigationTypeLinkClicked,
NavigationTypeFormSubmitted,
diff --git a/WebCore/loader/MainResourceLoader.cpp b/WebCore/loader/MainResourceLoader.cpp
index 504a5ea..c03f9ca 100644
--- a/WebCore/loader/MainResourceLoader.cpp
+++ b/WebCore/loader/MainResourceLoader.cpp
@@ -31,6 +31,7 @@
#include "MainResourceLoader.h"
#include "ApplicationCacheHost.h"
+#include "DocumentLoadTiming.h"
#include "DocumentLoader.h"
#include "FormState.h"
#include "Frame.h"
@@ -43,6 +44,7 @@
#endif
#include "ResourceError.h"
#include "ResourceHandle.h"
+#include "SchemeRegistry.h"
#include "Settings.h"
#include <wtf/CurrentTime.h>
@@ -205,7 +207,7 @@ static bool shouldLoadAsEmptyDocument(const KURL& url)
#if PLATFORM(TORCHMOBILE)
return url.isEmpty() || (url.protocolIs("about") && equalIgnoringRef(url, blankURL()));
#else
- return url.isEmpty() || url.protocolIs("about");
+ return url.isEmpty() || SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(url.protocol());
#endif
}
@@ -413,6 +415,8 @@ void MainResourceLoader::didReceiveData(const char* data, int length, long long
// reference to this object; one example of this is 3266216.
RefPtr<MainResourceLoader> protect(this);
+ m_timeOfLastDataReceived = currentTime();
+
ResourceLoader::didReceiveData(data, length, lengthReceived, allAtOnce);
}
@@ -432,6 +436,8 @@ void MainResourceLoader::didFinishLoading()
RefPtr<DocumentLoader> dl = documentLoader();
#endif
+ ASSERT(!documentLoader()->timing()->responseEnd);
+ documentLoader()->timing()->responseEnd = m_timeOfLastDataReceived;
frameLoader()->finishedLoading();
ResourceLoader::didFinishLoading();
diff --git a/WebCore/loader/MainResourceLoader.h b/WebCore/loader/MainResourceLoader.h
index 5ed0cc8..e2d075c 100644
--- a/WebCore/loader/MainResourceLoader.h
+++ b/WebCore/loader/MainResourceLoader.h
@@ -107,6 +107,7 @@ namespace WebCore {
bool m_loadingMultipartContent;
bool m_waitingForContentPolicy;
+ double m_timeOfLastDataReceived;
};
}
diff --git a/WebCore/loader/SubframeLoader.cpp b/WebCore/loader/SubframeLoader.cpp
index 2206b4e..2821a50 100644
--- a/WebCore/loader/SubframeLoader.cpp
+++ b/WebCore/loader/SubframeLoader.cpp
@@ -146,7 +146,7 @@ bool SubframeLoader::requestObject(RenderEmbeddedObject* renderer, const String&
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-PassRefPtr<Widget> FrameLoader::loadMediaPlayerProxyPlugin(Node* node, const KURL& url,
+PassRefPtr<Widget> SubframeLoader::loadMediaPlayerProxyPlugin(Node* node, const KURL& url,
const Vector<String>& paramNames, const Vector<String>& paramValues)
{
ASSERT(node->hasTagName(videoTag) || node->hasTagName(audioTag));
@@ -158,7 +158,7 @@ PassRefPtr<Widget> FrameLoader::loadMediaPlayerProxyPlugin(Node* node, const KUR
if (!url.isEmpty())
completedURL = completeURL(url);
- if (!SecurityOrigin::canLoad(completedURL, String(), frame()->document())) {
+ if (!SecurityOrigin::canLoad(completedURL, String(), m_frame->document())) {
FrameLoader::reportLocalLoadFailed(m_frame, completedURL.string());
return 0;
}
@@ -181,7 +181,7 @@ PassRefPtr<Widget> FrameLoader::loadMediaPlayerProxyPlugin(Node* node, const KUR
renderer->setWidget(widget);
renderer->node()->setNeedsStyleRecalc(SyntheticStyleChange);
}
- m_containsPlugIns = true;
+ m_containsPlugins = true;
return widget ? widget.release() : 0;
}
diff --git a/WebCore/loader/appcache/ApplicationCacheHost.cpp b/WebCore/loader/appcache/ApplicationCacheHost.cpp
index f63de55..eca6861 100644
--- a/WebCore/loader/appcache/ApplicationCacheHost.cpp
+++ b/WebCore/loader/appcache/ApplicationCacheHost.cpp
@@ -250,6 +250,37 @@ void ApplicationCacheHost::stopDeferringEvents()
m_defersEvents = false;
}
+#if ENABLE(INSPECTOR)
+void ApplicationCacheHost::fillResourceList(ResourceInfoList* resources)
+{
+ ApplicationCache* cache = applicationCache();
+ if (!cache || !cache->isComplete())
+ return;
+
+ ApplicationCache::ResourceMap::const_iterator end = cache->end();
+ for (ApplicationCache::ResourceMap::const_iterator it = cache->begin(); it != end; ++it) {
+ RefPtr<ApplicationCacheResource> resource = it->second;
+ unsigned type = resource->type();
+ bool isMaster = type & ApplicationCacheResource::Master;
+ bool isManifest = type & ApplicationCacheResource::Manifest;
+ bool isExplicit = type & ApplicationCacheResource::Explicit;
+ bool isForeign = type & ApplicationCacheResource::Foreign;
+ bool isFallback = type & ApplicationCacheResource::Fallback;
+ resources->append(ResourceInfo(resource->url(), isMaster, isManifest, isFallback, isForeign, isExplicit, resource->estimatedSizeInStorage()));
+ }
+}
+
+ApplicationCacheHost::CacheInfo ApplicationCacheHost::applicationCacheInfo()
+{
+ ApplicationCache* cache = applicationCache();
+ if (!cache || !cache->isComplete())
+ return CacheInfo(KURL(), 0, 0, 0);
+
+ // FIXME: Add "Creation Time" and "Update Time" to Application Caches.
+ return CacheInfo(cache->manifestResource()->url(), 0, 0, cache->estimatedSizeInStorage());
+}
+#endif
+
void ApplicationCacheHost::dispatchDOMEvent(EventID id, int total, int done)
{
if (m_domApplicationCache) {
diff --git a/WebCore/loader/appcache/ApplicationCacheHost.h b/WebCore/loader/appcache/ApplicationCacheHost.h
index a5b55e9..c224172 100644
--- a/WebCore/loader/appcache/ApplicationCacheHost.h
+++ b/WebCore/loader/appcache/ApplicationCacheHost.h
@@ -33,6 +33,7 @@
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+#include "KURL.h"
#include <wtf/Deque.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
@@ -40,10 +41,8 @@
#include <wtf/Vector.h>
namespace WebCore {
- class ApplicationCache;
class DOMApplicationCache;
class DocumentLoader;
- class KURL;
class ResourceLoader;
class ResourceError;
class ResourceRequest;
@@ -52,6 +51,7 @@ namespace WebCore {
#if PLATFORM(CHROMIUM)
class ApplicationCacheHostInternal;
#else
+ class ApplicationCache;
class ApplicationCacheGroup;
class ApplicationCacheResource;
class ApplicationCacheStorage;
@@ -80,6 +80,40 @@ namespace WebCore {
OBSOLETE_EVENT // Must remain the last value, this is used to size arrays.
};
+#if ENABLE(INSPECTOR)
+ struct CacheInfo {
+ CacheInfo(const KURL& manifest, double creationTime, double updateTime, long long size)
+ : m_manifest(manifest)
+ , m_creationTime(creationTime)
+ , m_updateTime(updateTime)
+ , m_size(size) { }
+ KURL m_manifest;
+ double m_creationTime;
+ double m_updateTime;
+ long long m_size;
+ };
+
+ struct ResourceInfo {
+ ResourceInfo(const KURL& resource, bool isMaster, bool isManifest, bool isFallback, bool isForeign, bool isExplicit, long long size)
+ : m_resource(resource)
+ , m_isMaster(isMaster)
+ , m_isManifest(isManifest)
+ , m_isFallback(isFallback)
+ , m_isForeign(isForeign)
+ , m_isExplicit(isExplicit)
+ , m_size(size) { }
+ KURL m_resource;
+ bool m_isMaster;
+ bool m_isManifest;
+ bool m_isFallback;
+ bool m_isForeign;
+ bool m_isExplicit;
+ long long m_size;
+ };
+
+ typedef Vector<ResourceInfo> ResourceInfoList;
+#endif
+
ApplicationCacheHost(DocumentLoader*);
~ApplicationCacheHost();
@@ -112,7 +146,10 @@ namespace WebCore {
void stopDeferringEvents(); // Also raises the events that have been queued up.
- ApplicationCache* applicationCacheForInspector() const { return applicationCache(); }
+#if ENABLE(INSPECTOR)
+ void fillResourceList(ResourceInfoList*);
+ CacheInfo applicationCacheInfo();
+#endif
private:
bool isApplicationCacheEnabled();
@@ -135,7 +172,6 @@ namespace WebCore {
#if PLATFORM(CHROMIUM)
friend class ApplicationCacheHostInternal;
OwnPtr<ApplicationCacheHostInternal> m_internal;
- ApplicationCache* applicationCache() const { return 0; } // FIXME: Implement for Chromium Web Inspector Support.
#else
friend class ApplicationCacheGroup;
friend class ApplicationCacheStorage;
diff --git a/WebCore/manual-tests/autoscroll-over-scrollbar.html b/WebCore/manual-tests/autoscroll-over-scrollbar.html
new file mode 100644
index 0000000..2330ed1
--- /dev/null
+++ b/WebCore/manual-tests/autoscroll-over-scrollbar.html
@@ -0,0 +1,8 @@
+<html>
+ <body>
+ <h1><a href="https://bugs.webkit.org/show_bug.cgi?id=40403">Bug 40403</a></h1>
+ <p>Click down somewhere in this text, then move the pointer over the scrollbar at the bottom of the window, stop there, holding the mouse button down.</p>
+ <div style="height:3000px; width:3000px;"></div>
+ <p>If the bug occurs, then this text won't be selected until you move the mouse slightly. If the bug does not occur, this text should be selected.</p>
+ </body>
+</html>
diff --git a/WebCore/mathml/mathattrs.in b/WebCore/mathml/mathattrs.in
index 55a25ed..5431453 100644
--- a/WebCore/mathml/mathattrs.in
+++ b/WebCore/mathml/mathattrs.in
@@ -4,6 +4,7 @@ guardFactoryWith="ENABLE(MATHML)"
attrsNullNamespace
close
+definitionURL
denomalign
linethickness
mathbackground
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp
index 6498042..a369a32 100644
--- a/WebCore/page/DOMWindow.cpp
+++ b/WebCore/page/DOMWindow.cpp
@@ -56,6 +56,7 @@
#include "FrameView.h"
#include "HTMLFrameOwnerElement.h"
#include "History.h"
+#include "IDBKeyRange.h"
#include "IndexedDatabase.h"
#include "IndexedDatabaseRequest.h"
#include "InspectorController.h"
@@ -483,6 +484,7 @@ void DOMWindow::clear()
#endif
#if ENABLE(INDEXED_DATABASE)
+ m_idb_key_range = 0;
m_indexedDatabaseRequest = 0;
#endif
}
@@ -705,6 +707,14 @@ IndexedDatabaseRequest* DOMWindow::indexedDB() const
m_indexedDatabaseRequest = IndexedDatabaseRequest::create(page->group().indexedDatabase());
return m_indexedDatabaseRequest.get();
}
+
+IDBKeyRange* DOMWindow::iDBKeyRange() const
+{
+ if (!m_idb_key_range)
+ m_idb_key_range = IDBKeyRange::create(0, 0, 0);
+
+ return m_idb_key_range.get();
+}
#endif
void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, MessagePort* port, const String& targetOrigin, DOMWindow* source, ExceptionCode& ec)
diff --git a/WebCore/page/DOMWindow.h b/WebCore/page/DOMWindow.h
index 69d7428..7a13651 100644
--- a/WebCore/page/DOMWindow.h
+++ b/WebCore/page/DOMWindow.h
@@ -53,6 +53,7 @@ namespace WebCore {
class FloatRect;
class Frame;
class History;
+ class IDBKeyRange;
class IndexedDatabaseRequest;
class InspectorTimelineAgent;
class Location;
@@ -231,6 +232,7 @@ namespace WebCore {
void pageDestroyed();
#if ENABLE(INDEXED_DATABASE)
+ IDBKeyRange* iDBKeyRange() const;
IndexedDatabaseRequest* indexedDB() const;
#endif
@@ -422,6 +424,7 @@ namespace WebCore {
mutable RefPtr<NotificationCenter> m_notifications;
#endif
#if ENABLE(INDEXED_DATABASE)
+ mutable RefPtr<IDBKeyRange> m_idb_key_range;
mutable RefPtr<IndexedDatabaseRequest> m_indexedDatabaseRequest;
#endif
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index f6b9feb..74e7504 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -174,6 +174,7 @@ module window {
#endif
#if defined(ENABLE_INDEXED_DATABASE) && ENABLE_INDEXED_DATABASE
readonly attribute [EnabledAtRuntime] IndexedDatabaseRequest indexedDB;
+ readonly attribute [EnabledAtRuntime] IDBKeyRange IDBKeyRange;
#endif
#if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
@@ -741,9 +742,7 @@ module window {
#endif
#endif
-#if defined(ENABLE_DATABASE)
- attribute SQLExceptionConstructor SQLException;
-#endif
+ attribute [Conditional=DATABASE] SQLExceptionConstructor SQLException;
attribute [Conditional=TOUCH_EVENTS] TouchEventConstructor TouchEvent;
diff --git a/WebCore/page/DragController.cpp b/WebCore/page/DragController.cpp
index 716772b..d93a256 100644
--- a/WebCore/page/DragController.cpp
+++ b/WebCore/page/DragController.cpp
@@ -170,7 +170,7 @@ void DragController::dragExited(DragData* dragData)
if (RefPtr<FrameView> v = mainFrame->view()) {
ClipboardAccessPolicy policy = (!m_documentUnderMouse || m_documentUnderMouse->securityOrigin()->isLocal()) ? ClipboardReadable : ClipboardTypesReadable;
- RefPtr<Clipboard> clipboard = dragData->createClipboard(policy);
+ RefPtr<Clipboard> clipboard = Clipboard::create(policy, dragData, mainFrame);
clipboard->setSourceOperation(dragData->draggingSourceOperationMask());
mainFrame->eventHandler()->cancelDragAndDrop(createMouseEvent(dragData), clipboard.get());
clipboard->setAccessPolicy(ClipboardNumb); // invalidate clipboard here for security
@@ -193,7 +193,7 @@ bool DragController::performDrag(DragData* dragData)
RefPtr<Frame> mainFrame = m_page->mainFrame();
if (mainFrame->view()) {
// Sending an event can result in the destruction of the view and part.
- RefPtr<Clipboard> clipboard = dragData->createClipboard(ClipboardReadable);
+ RefPtr<Clipboard> clipboard = Clipboard::create(ClipboardReadable, dragData, mainFrame.get());
clipboard->setSourceOperation(dragData->draggingSourceOperationMask());
mainFrame->eventHandler()->performDragAndDrop(createMouseEvent(dragData), clipboard.get());
clipboard->setAccessPolicy(ClipboardNumb); // invalidate clipboard here for security
@@ -524,7 +524,7 @@ bool DragController::tryDHTMLDrag(DragData* dragData, DragOperation& operation)
return false;
ClipboardAccessPolicy policy = m_documentUnderMouse->securityOrigin()->isLocal() ? ClipboardReadable : ClipboardTypesReadable;
- RefPtr<Clipboard> clipboard = dragData->createClipboard(policy);
+ RefPtr<Clipboard> clipboard = Clipboard::create(policy, dragData, mainFrame.get());
DragOperation srcOpMask = dragData->draggingSourceOperationMask();
clipboard->setSourceOperation(srcOpMask);
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index e2fab6e..466ddf5 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -72,6 +72,7 @@
#include "TextEvent.h"
#include "TextIterator.h"
#include "UserGestureIndicator.h"
+#include "UserTypingGestureIndicator.h"
#include "WheelEvent.h"
#include "htmlediting.h" // for comparePositions()
#include <wtf/CurrentTime.h>
@@ -869,11 +870,15 @@ void EventHandler::allowDHTMLDrag(bool& flagDHTML, bool& flagUA) const
}
#endif // ENABLE(DRAG_SUPPORT)
+<<<<<<< HEAD
#ifdef ANDROID_HITTEST_WITHSIZE
HitTestResult EventHandler::hitTestResultAtPoint(const IntPoint& point, bool allowShadowContent, bool ignoreClipping, HitTestScrollbars testScrollbars, int hitType, const IntSize& pointPadding)
#else
HitTestResult EventHandler::hitTestResultAtPoint(const IntPoint& point, bool allowShadowContent, bool ignoreClipping, HitTestScrollbars testScrollbars, int hitType)
#endif
+=======
+HitTestResult EventHandler::hitTestResultAtPoint(const IntPoint& point, bool allowShadowContent, bool ignoreClipping, HitTestScrollbars testScrollbars, HitTestRequest::HitTestRequestType hitType)
+>>>>>>> webkit.org at r64264
{
#ifdef ANDROID_HITTEST_WITHSIZE
HitTestResult result(point, pointPadding);
@@ -1464,7 +1469,7 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi
// if we are allowed to select.
// This means that :hover and :active freeze in the state they were in when the mouse
// was pressed, rather than updating for nodes the mouse moves over as you hold the mouse down.
- int hitType = HitTestRequest::MouseMove;
+ HitTestRequest::HitTestRequestType hitType = HitTestRequest::MouseMove;
if (m_mousePressed && m_mouseDownMayStartSelect)
hitType |= HitTestRequest::ReadOnly;
if (m_mousePressed)
@@ -2305,6 +2310,7 @@ bool EventHandler::keyEvent(const PlatformKeyboardEvent& initialKeyEvent)
return false;
UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
+ UserTypingGestureIndicator typingGestureIndicator(m_frame);
if (FrameView* view = m_frame->view())
view->resetDeferredRepaintDelay();
@@ -2886,7 +2892,7 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
const PlatformTouchPoint& point = points[i];
IntPoint pagePoint = documentPointForWindowPoint(m_frame, point.pos());
- int hitType = HitTestRequest::Active | HitTestRequest::ReadOnly;
+ HitTestRequest::HitTestRequestType hitType = HitTestRequest::Active | HitTestRequest::ReadOnly;
// The HitTestRequest types used for mouse events map quite adequately
// to touch events. Note that in addition to meaning that the hit test
// should affect the active state of the current node if necessary,
diff --git a/WebCore/page/EventHandler.h b/WebCore/page/EventHandler.h
index 5348502..16dadc6 100644
--- a/WebCore/page/EventHandler.h
+++ b/WebCore/page/EventHandler.h
@@ -106,11 +106,15 @@ public:
void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&);
+<<<<<<< HEAD
#ifdef ANDROID_HITTEST_WITHSIZE
HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent, bool ignoreClipping = false, HitTestScrollbars scrollbars = DontHitTestScrollbars, int hitType = HitTestRequest::ReadOnly | HitTestRequest::Active, const IntSize& pointPadding = IntSize());
#else
HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent, bool ignoreClipping = false, HitTestScrollbars scrollbars = DontHitTestScrollbars, int hitType = HitTestRequest::ReadOnly | HitTestRequest::Active);
#endif
+=======
+ HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent, bool ignoreClipping = false, HitTestScrollbars scrollbars = DontHitTestScrollbars, HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active);
+>>>>>>> webkit.org at r64264
bool mousePressed() const { return m_mousePressed; }
void setMousePressed(bool pressed) { m_mousePressed = pressed; }
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
index a8d0f15..77bf071 100644
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -77,6 +77,7 @@
#include "TextIterator.h"
#include "TextResourceDecoder.h"
#include "UserContentURLPattern.h"
+#include "UserTypingGestureIndicator.h"
#include "XMLNSNames.h"
#include "XMLNames.h"
#include "htmlediting.h"
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp
index 31f9910..d460da3 100644
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@ -337,6 +337,22 @@ void FrameView::invalidateRect(const IntRect& rect)
renderer->repaintRectangle(repaintRect);
}
+void FrameView::setFrameRect(const IntRect& newRect)
+{
+ IntRect oldRect = frameRect();
+ if (newRect == oldRect)
+ return;
+
+ ScrollView::setFrameRect(newRect);
+
+#if USE(ACCELERATED_COMPOSITING)
+ if (RenderView* root = m_frame->contentRenderer()) {
+ if (root->usesCompositing())
+ root->compositor()->frameViewDidChangeSize();
+ }
+#endif
+}
+
void FrameView::setMarginWidth(int w)
{
// make it update the rendering area when set
@@ -534,10 +550,10 @@ bool FrameView::syncCompositingStateRecursive()
if (!contentRenderer)
return true; // We don't want to keep trying to update layers if we have no renderer.
- if (m_layoutTimer.isActive()) {
- // Don't sync layers if there's a layout pending.
+ // If we sync compositing layers when a layout is pending, we may cause painting of compositing
+ // layer content to occur before layout has happened, which will cause paintContents() to bail.
+ if (needsLayout())
return false;
- }
if (GraphicsLayer* rootLayer = contentRenderer->compositor()->rootPlatformLayer())
rootLayer->syncCompositingState();
@@ -1131,8 +1147,20 @@ void FrameView::setScrollPosition(const IntPoint& scrollPoint)
void FrameView::scrollPositionChangedViaPlatformWidget()
{
+ scrollPositionChanged();
+}
+
+void FrameView::scrollPositionChanged()
+{
frame()->eventHandler()->sendScrollEvent();
repaintFixedElementsAfterScrolling();
+
+#if USE(ACCELERATED_COMPOSITING)
+ if (RenderView* root = m_frame->contentRenderer()) {
+ if (root->usesCompositing())
+ root->compositor()->frameViewDidScroll(scrollPosition());
+ }
+#endif
}
void FrameView::repaintFixedElementsAfterScrolling()
@@ -1148,13 +1176,6 @@ void FrameView::repaintFixedElementsAfterScrolling()
#endif
}
}
-
-#if USE(ACCELERATED_COMPOSITING)
- if (RenderView* root = m_frame->contentRenderer()) {
- if (root->usesCompositing())
- root->compositor()->updateContentLayerScrollPosition(scrollPosition());
- }
-#endif
}
HostWindow* FrameView::hostWindow() const
@@ -1745,7 +1766,7 @@ void FrameView::valueChanged(Scrollbar* bar)
IntSize offset = scrollOffset();
ScrollView::valueChanged(bar);
if (offset != scrollOffset())
- frame()->eventHandler()->sendScrollEvent();
+ scrollPositionChanged();
frame()->loader()->client()->didChangeScrollOffset();
}
diff --git a/WebCore/page/FrameView.h b/WebCore/page/FrameView.h
index 868a15f..718b793 100644
--- a/WebCore/page/FrameView.h
+++ b/WebCore/page/FrameView.h
@@ -63,6 +63,7 @@ public:
virtual HostWindow* hostWindow() const;
virtual void invalidateRect(const IntRect&);
+ virtual void setFrameRect(const IntRect&);
Frame* frame() const { return m_frame.get(); }
void clearFrame();
@@ -279,6 +280,7 @@ private:
bool updateWidgets();
void scrollToAnchor();
+ void scrollPositionChanged();
#if ENABLE(INSPECTOR)
InspectorTimelineAgent* inspectorTimelineAgent() const;
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp
index abdb8bf..523c21d 100644
--- a/WebCore/page/Geolocation.cpp
+++ b/WebCore/page/Geolocation.cpp
@@ -421,6 +421,8 @@ void Geolocation::setIsAllowed(bool allowed)
if (isAllowed()) {
// Permission request was made during the startUpdating process
m_startRequestPermissionNotifier->startTimerIfNeeded();
+ // The notifier is always ref'ed by m_oneShots or m_watchers.
+ GeoNotifier* notifier = m_startRequestPermissionNotifier.get();
m_startRequestPermissionNotifier = 0;
#if ENABLE(CLIENT_BASED_GEOLOCATION)
if (!m_frame)
@@ -428,7 +430,7 @@ void Geolocation::setIsAllowed(bool allowed)
Page* page = m_frame->page();
if (!page)
return;
- page->geolocationController()->addObserver(this);
+ page->geolocationController()->addObserver(this, notifier->m_options->enableHighAccuracy());
#else
// TODO: Handle startUpdate() for non-client based implementations using pre-emptive policy
#endif
@@ -648,8 +650,7 @@ bool Geolocation::startUpdating(GeoNotifier* notifier)
if (!page)
return false;
- // FIXME: Pass options to client.
- page->geolocationController()->addObserver(this);
+ page->geolocationController()->addObserver(this, notifier->m_options->enableHighAccuracy());
return true;
#else
#if PLATFORM(ANDROID)
diff --git a/WebCore/page/GeolocationController.cpp b/WebCore/page/GeolocationController.cpp
index 40f01ba..08932a9 100644
--- a/WebCore/page/GeolocationController.cpp
+++ b/WebCore/page/GeolocationController.cpp
@@ -45,17 +45,21 @@ GeolocationController::~GeolocationController()
m_client->geolocationDestroyed();
}
-void GeolocationController::addObserver(Geolocation* observer)
+void GeolocationController::addObserver(Geolocation* observer, bool enableHighAccuracy)
{
// This may be called multiple times with the same observer, though removeObserver()
// is called only once with each.
- if (m_observers.contains(observer))
- return;
-
bool wasEmpty = m_observers.isEmpty();
m_observers.add(observer);
- if (wasEmpty && m_client)
- m_client->startUpdating();
+ if (enableHighAccuracy)
+ m_highAccuracyObservers.add(observer);
+
+ if (m_client) {
+ if (enableHighAccuracy)
+ m_client->setEnableHighAccuracy(true);
+ if (wasEmpty)
+ m_client->startUpdating();
+ }
}
void GeolocationController::removeObserver(Geolocation* observer)
@@ -64,8 +68,14 @@ void GeolocationController::removeObserver(Geolocation* observer)
return;
m_observers.remove(observer);
- if (m_observers.isEmpty() && m_client)
- m_client->stopUpdating();
+ m_highAccuracyObservers.remove(observer);
+
+ if (m_client) {
+ if (m_observers.isEmpty())
+ m_client->stopUpdating();
+ else if (m_highAccuracyObservers.isEmpty())
+ m_client->setEnableHighAccuracy(false);
+ }
}
void GeolocationController::positionChanged(GeolocationPosition* position)
diff --git a/WebCore/page/GeolocationController.h b/WebCore/page/GeolocationController.h
index bb36101..57f6e32 100644
--- a/WebCore/page/GeolocationController.h
+++ b/WebCore/page/GeolocationController.h
@@ -45,7 +45,7 @@ public:
GeolocationController(Page*, GeolocationControllerClient*);
~GeolocationController();
- void addObserver(Geolocation*);
+ void addObserver(Geolocation*, bool enableHighAccuracy);
void removeObserver(Geolocation*);
void positionChanged(GeolocationPosition*);
@@ -58,7 +58,10 @@ private:
GeolocationControllerClient* m_client;
RefPtr<GeolocationPosition> m_lastPosition;
- HashSet<RefPtr<Geolocation> > m_observers;
+ typedef HashSet<RefPtr<Geolocation> > ObserversSet;
+ // All observers; both those requesting high accuracy and those not.
+ ObserversSet m_observers;
+ ObserversSet m_highAccuracyObservers;
};
} // namespace WebCore
diff --git a/WebCore/page/GeolocationControllerClient.h b/WebCore/page/GeolocationControllerClient.h
index cc0e1e4..4648cf8 100644
--- a/WebCore/page/GeolocationControllerClient.h
+++ b/WebCore/page/GeolocationControllerClient.h
@@ -36,6 +36,11 @@ public:
virtual void startUpdating() = 0;
virtual void stopUpdating() = 0;
+ // FIXME: The V2 Geolocation specification proposes that this property is
+ // renamed. See http://www.w3.org/2008/geolocation/track/issues/6
+ // We should update WebKit to reflect this if and when the V2 specification
+ // is published.
+ virtual void setEnableHighAccuracy(bool) = 0;
virtual GeolocationPosition* lastPosition() = 0;
protected:
diff --git a/WebCore/page/History.cpp b/WebCore/page/History.cpp
index 78e8ea6..337f5b2 100644
--- a/WebCore/page/History.cpp
+++ b/WebCore/page/History.cpp
@@ -86,14 +86,7 @@ KURL History::urlForState(const String& urlString)
if (urlString.isEmpty())
return baseURL;
- KURL absoluteURL(baseURL, urlString);
- if (!absoluteURL.isValid())
- return KURL();
-
- if (absoluteURL.string().left(absoluteURL.pathStart()) != baseURL.string().left(baseURL.pathStart()))
- return KURL();
-
- return absoluteURL;
+ return KURL(baseURL, urlString);
}
void History::stateObjectAdded(PassRefPtr<SerializedScriptValue> data, const String& title, const String& urlString, StateObjectType stateObjectType, ExceptionCode& ec)
@@ -102,7 +95,8 @@ void History::stateObjectAdded(PassRefPtr<SerializedScriptValue> data, const Str
return;
KURL fullURL = urlForState(urlString);
- if (!fullURL.isValid()) {
+ RefPtr<SecurityOrigin> origin = SecurityOrigin::create(fullURL);
+ if (!fullURL.isValid() || !m_frame->document()->securityOrigin()->isSameSchemeHostPort(origin.get())) {
ec = SECURITY_ERR;
return;
}
diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp
index 8e471fc..c997645 100644
--- a/WebCore/page/Page.cpp
+++ b/WebCore/page/Page.cpp
@@ -62,6 +62,7 @@
#include "SelectionController.h"
#include "Settings.h"
#include "SharedBuffer.h"
+#include "SpeechInput.h"
#include "SpeechInputClient.h"
#include "StringHash.h"
#include "TextResourceDecoder.h"
@@ -127,6 +128,7 @@ static void networkStateChanged()
frames[i]->document()->dispatchWindowEvent(Event::create(eventName, false, false));
}
+<<<<<<< HEAD
#if PLATFORM(ANDROID) && ENABLE(APPLICATION_INSTALLED)
static void onPackageResultAvailable()
{
@@ -140,31 +142,35 @@ static void onPackageResultAvailable()
Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, EditorClient* editorClient, DragClient* dragClient, InspectorClient* inspectorClient, PluginHalterClient* pluginHalterClient, GeolocationControllerClient* geolocationControllerClient, DeviceOrientationClient* deviceOrientationClient, BackForwardControllerClient* backForwardControllerClient)
: m_chrome(new Chrome(this, chromeClient))
+=======
+Page::Page(const PageClients& pageClients)
+ : m_chrome(new Chrome(this, pageClients.chromeClient))
+>>>>>>> webkit.org at r64264
, m_dragCaretController(new SelectionController(0, true))
#if ENABLE(DRAG_SUPPORT)
- , m_dragController(new DragController(this, dragClient))
+ , m_dragController(new DragController(this, pageClients.dragClient))
#endif
, m_focusController(new FocusController(this))
#if ENABLE(CONTEXT_MENUS)
- , m_contextMenuController(new ContextMenuController(this, contextMenuClient))
+ , m_contextMenuController(new ContextMenuController(this, pageClients.contextMenuClient))
#endif
#if ENABLE(INSPECTOR)
- , m_inspectorController(new InspectorController(this, inspectorClient))
+ , m_inspectorController(new InspectorController(this, pageClients.inspectorClient))
#endif
#if ENABLE(CLIENT_BASED_GEOLOCATION)
- , m_geolocationController(new GeolocationController(this, geolocationControllerClient))
+ , m_geolocationController(new GeolocationController(this, pageClients.geolocationControllerClient))
#endif
#if ENABLE(DEVICE_ORIENTATION)
- , m_deviceOrientationController(RuntimeEnabledFeatures::deviceOrientationEnabled() ? new DeviceOrientationController(this, deviceOrientationClient) : 0)
+ , m_deviceOrientationController(RuntimeEnabledFeatures::deviceOrientationEnabled() ? new DeviceOrientationController(this, pageClients.deviceOrientationClient) : 0)
#endif
#if ENABLE(INPUT_SPEECH)
- , m_speechInputClient(0)
+ , m_speechInputClient(pageClients.speechInputClient)
#endif
, m_settings(new Settings(this))
, m_progress(new ProgressTracker)
- , m_backForwardController(new BackForwardController(this, backForwardControllerClient))
+ , m_backForwardController(new BackForwardController(this, pageClients.backForwardControllerClient))
, m_theme(RenderTheme::themeForPage(this))
- , m_editorClient(editorClient)
+ , m_editorClient(pageClients.editorClient)
, m_frameCount(0)
, m_openedByDOM(false)
, m_tabKeyCyclesThroughElements(true)
@@ -182,22 +188,6 @@ Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, Edi
, m_customHTMLTokenizerChunkSize(-1)
, m_canStartMedia(true)
{
-#if !ENABLE(CONTEXT_MENUS)
- UNUSED_PARAM(contextMenuClient);
-#endif
-#if !ENABLE(DRAG_SUPPORT)
- UNUSED_PARAM(dragClient);
-#endif
-#if !ENABLE(INSPECTOR)
- UNUSED_PARAM(inspectorClient);
-#endif
-#if !ENABLE(CLIENT_BASED_GEOLOCATION)
- UNUSED_PARAM(geolocationControllerClient);
-#endif
-#if !ENABLE(CLIENT_DEVICE_ORIENTATION)
- UNUSED_PARAM(deviceOrientationClient);
-#endif
-
if (!allPages) {
allPages = new HashSet<Page*>;
@@ -210,8 +200,8 @@ Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, Edi
ASSERT(!allPages->contains(this));
allPages->add(this);
- if (pluginHalterClient) {
- m_pluginHalter.set(new PluginHalter(pluginHalterClient));
+ if (pageClients.pluginHalterClient) {
+ m_pluginHalter.set(new PluginHalter(pageClients.pluginHalterClient));
m_pluginHalter->setPluginAllowedRunTime(m_settings->pluginAllowedRunTime());
}
@@ -809,6 +799,16 @@ InspectorTimelineAgent* Page::inspectorTimelineAgent() const
}
#endif
+#if ENABLE(INPUT_SPEECH)
+SpeechInput* Page::speechInput()
+{
+ ASSERT(m_speechInputClient);
+ if (!m_speechInput.get())
+ m_speechInput.set(new SpeechInput(m_speechInputClient));
+ return m_speechInput.get();
+}
+#endif
+
void Page::privateBrowsingStateChanged()
{
bool privateBrowsingEnabled = m_settings->privateBrowsingEnabled();
diff --git a/WebCore/page/Page.h b/WebCore/page/Page.h
index 8599a83..aab95f3 100644
--- a/WebCore/page/Page.h
+++ b/WebCore/page/Page.h
@@ -70,6 +70,7 @@ namespace WebCore {
class VisibleSelection;
class SelectionController;
class Settings;
+ class SpeechInput;
class SpeechInputClient;
#if ENABLE(DOM_STORAGE)
@@ -90,7 +91,34 @@ namespace WebCore {
public:
static void setNeedsReapplyStyles();
- Page(ChromeClient*, ContextMenuClient*, EditorClient*, DragClient*, InspectorClient*, PluginHalterClient*, GeolocationControllerClient*, DeviceOrientationClient*, BackForwardControllerClient*);
+ // It is up to the platform to ensure that non-null clients are provided where required.
+ struct PageClients {
+ PageClients()
+ : chromeClient(0)
+ , contextMenuClient(0)
+ , editorClient(0)
+ , dragClient(0)
+ , inspectorClient(0)
+ , pluginHalterClient(0)
+ , geolocationControllerClient(0)
+ , deviceOrientationClient(0)
+ , backForwardControllerClient(0)
+ , speechInputClient(0)
+ { }
+
+ ChromeClient* chromeClient;
+ ContextMenuClient* contextMenuClient;
+ EditorClient* editorClient;
+ DragClient* dragClient;
+ InspectorClient* inspectorClient;
+ PluginHalterClient* pluginHalterClient;
+ GeolocationControllerClient* geolocationControllerClient;
+ DeviceOrientationClient* deviceOrientationClient;
+ BackForwardControllerClient* backForwardControllerClient;
+ SpeechInputClient* speechInputClient;
+ };
+
+ Page(const PageClients&);
~Page();
RenderTheme* theme() const { return m_theme.get(); };
@@ -154,8 +182,7 @@ namespace WebCore {
DeviceOrientationController* deviceOrientationController() const { return m_deviceOrientationController.get(); }
#endif
#if ENABLE(INPUT_SPEECH)
- void setSpeechInputClient(SpeechInputClient* client) { m_speechInputClient = client; }
- SpeechInputClient* speechInputClient() const { return m_speechInputClient; }
+ SpeechInput* speechInput();
#endif
Settings* settings() const { return m_settings.get(); }
ProgressTracker* progress() const { return m_progress.get(); }
@@ -276,6 +303,7 @@ namespace WebCore {
#endif
#if ENABLE(INPUT_SPEECH)
SpeechInputClient* m_speechInputClient;
+ OwnPtr<SpeechInput> m_speechInput;
#endif
OwnPtr<Settings> m_settings;
OwnPtr<ProgressTracker> m_progress;
diff --git a/WebCore/page/PrintContext.cpp b/WebCore/page/PrintContext.cpp
index 2bbc63a..74af4b1 100644
--- a/WebCore/page/PrintContext.cpp
+++ b/WebCore/page/PrintContext.cpp
@@ -203,6 +203,8 @@ int PrintContext::pageNumberForElement(Element* element, const FloatSize& pageSi
String PrintContext::pageProperty(Frame* frame, const char* propertyName, int pageNumber)
{
Document* document = frame->document();
+ PrintContext printContext(frame);
+ printContext.begin(800); // Any width is OK here.
document->updateLayout();
RefPtr<RenderStyle> style = document->styleForPage(pageNumber);
@@ -218,6 +220,8 @@ String PrintContext::pageProperty(Frame* frame, const char* propertyName, int pa
return String::format("%d", style->fontDescription().computedPixelSize());
if (!strcmp(propertyName, "font-family"))
return String::format("%s", style->fontDescription().family().family().string().utf8().data());
+ if (!strcmp(propertyName, "size"))
+ return String::format("%d %d", style->pageSize().width().rawValue(), style->pageSize().height().rawValue());
return String::format("pageProperty() unimplemented for: %s", propertyName);
}
diff --git a/WebCore/page/SecurityOrigin.cpp b/WebCore/page/SecurityOrigin.cpp
index aab8866..87b3ed2 100644
--- a/WebCore/page/SecurityOrigin.cpp
+++ b/WebCore/page/SecurityOrigin.cpp
@@ -32,6 +32,7 @@
#include "Document.h"
#include "KURL.h"
#include "OriginAccessEntry.h"
+#include "SchemeRegistry.h"
#include <wtf/StdLibExtras.h>
namespace WebCore {
@@ -47,48 +48,6 @@ static OriginAccessMap& originAccessMap()
return originAccessMap;
}
-static URLSchemesMap& localSchemes()
-{
- DEFINE_STATIC_LOCAL(URLSchemesMap, localSchemes, ());
-
- if (localSchemes.isEmpty()) {
- localSchemes.add("file");
-#if PLATFORM(MAC)
- localSchemes.add("applewebdata");
-#endif
-#if PLATFORM(QT)
- localSchemes.add("qrc");
-#endif
- }
-
- return localSchemes;
-}
-
-static URLSchemesMap& secureSchemes()
-{
- DEFINE_STATIC_LOCAL(URLSchemesMap, secureSchemes, ());
-
- if (secureSchemes.isEmpty()) {
- secureSchemes.add("https");
- secureSchemes.add("about");
- secureSchemes.add("data");
- }
-
- return secureSchemes;
-}
-
-static URLSchemesMap& schemesWithUniqueOrigins()
-{
- DEFINE_STATIC_LOCAL(URLSchemesMap, schemesWithUniqueOrigins, ());
-
- // This is a willful violation of HTML5.
- // See https://bugs.webkit.org/show_bug.cgi?id=11885
- if (schemesWithUniqueOrigins.isEmpty())
- schemesWithUniqueOrigins.add("data");
-
- return schemesWithUniqueOrigins;
-}
-
static bool schemeRequiresAuthority(const String& scheme)
{
DEFINE_STATIC_LOCAL(URLSchemesMap, schemes, ());
@@ -108,7 +67,7 @@ SecurityOrigin::SecurityOrigin(const KURL& url, SandboxFlags sandboxFlags)
, m_protocol(url.protocol().isNull() ? "" : url.protocol().lower())
, m_host(url.host().isNull() ? "" : url.host().lower())
, m_port(url.port())
- , m_isUnique(isSandboxed(SandboxOrigin) || shouldTreatURLSchemeAsNoAccess(m_protocol))
+ , m_isUnique(isSandboxed(SandboxOrigin) || SchemeRegistry::shouldTreatURLSchemeAsNoAccess(m_protocol))
, m_universalAccess(false)
, m_domainWasSetInDOM(false)
, m_enforceFilePathSeparation(false)
@@ -315,7 +274,7 @@ bool SecurityOrigin::isAccessWhiteListed(const SecurityOrigin* targetOrigin) con
bool SecurityOrigin::canLoad(const KURL& url, const String& referrer, Document* document)
{
- if (!shouldTreatURLAsLocal(url.string()))
+ if (!SchemeRegistry::shouldTreatURLAsLocal(url.string()))
return true;
// If we were provided a document, we first check if the access has been white listed.
@@ -329,7 +288,7 @@ bool SecurityOrigin::canLoad(const KURL& url, const String& referrer, Document*
return documentOrigin->canLoadLocalResources();
}
if (!referrer.isEmpty())
- return shouldTreatURLAsLocal(referrer);
+ return SchemeRegistry::shouldTreatURLAsLocal(referrer);
return false;
}
@@ -357,7 +316,7 @@ void SecurityOrigin::enforceFilePathSeparation()
bool SecurityOrigin::isLocal() const
{
- return shouldTreatURLSchemeAsLocal(m_protocol);
+ return SchemeRegistry::shouldTreatURLSchemeAsLocal(m_protocol);
}
bool SecurityOrigin::isSecureTransitionTo(const KURL& url) const
@@ -557,85 +516,6 @@ bool SecurityOrigin::isSameSchemeHostPort(const SecurityOrigin* other) const
return true;
}
-void SecurityOrigin::registerURLSchemeAsLocal(const String& scheme)
-{
- localSchemes().add(scheme);
-}
-
-void SecurityOrigin::removeURLSchemeRegisteredAsLocal(const String& scheme)
-{
- if (scheme == "file")
- return;
-#if PLATFORM(MAC)
- if (scheme == "applewebdata")
- return;
-#endif
- localSchemes().remove(scheme);
-}
-
-const URLSchemesMap& SecurityOrigin::localURLSchemes()
-{
- return localSchemes();
-}
-
-bool SecurityOrigin::shouldTreatURLAsLocal(const String& url)
-{
- // This avoids an allocation of another String and the HashSet contains()
- // call for the file: and http: schemes.
- if (url.length() >= 5) {
- const UChar* s = url.characters();
- if (s[0] == 'h' && s[1] == 't' && s[2] == 't' && s[3] == 'p' && s[4] == ':')
- return false;
- if (s[0] == 'f' && s[1] == 'i' && s[2] == 'l' && s[3] == 'e' && s[4] == ':')
- return true;
- }
-
- int loc = url.find(':');
- if (loc == -1)
- return false;
-
- String scheme = url.left(loc);
- return localSchemes().contains(scheme);
-}
-
-bool SecurityOrigin::shouldTreatURLSchemeAsLocal(const String& scheme)
-{
- // This avoids an allocation of another String and the HashSet contains()
- // call for the file: and http: schemes.
- if (scheme.length() == 4) {
- const UChar* s = scheme.characters();
- if (s[0] == 'h' && s[1] == 't' && s[2] == 't' && s[3] == 'p')
- return false;
- if (s[0] == 'f' && s[1] == 'i' && s[2] == 'l' && s[3] == 'e')
- return true;
- }
-
- if (scheme.isEmpty())
- return false;
-
- return localSchemes().contains(scheme);
-}
-
-void SecurityOrigin::registerURLSchemeAsNoAccess(const String& scheme)
-{
- schemesWithUniqueOrigins().add(scheme);
-}
-
-bool SecurityOrigin::shouldTreatURLSchemeAsNoAccess(const String& scheme)
-{
- return schemesWithUniqueOrigins().contains(scheme);
-}
-
-void SecurityOrigin::registerURLSchemeAsSecure(const String& scheme)
-{
- secureSchemes().add(scheme);
-}
-
-bool SecurityOrigin::shouldTreatURLSchemeAsSecure(const String& scheme)
-{
- return secureSchemes().contains(scheme);
-}
-
bool SecurityOrigin::shouldHideReferrer(const KURL& url, const String& referrer)
{
bool referrerIsSecureURL = protocolIs(referrer, "https");
diff --git a/WebCore/page/SecurityOrigin.h b/WebCore/page/SecurityOrigin.h
index 2254096..fa5b1e4 100644
--- a/WebCore/page/SecurityOrigin.h
+++ b/WebCore/page/SecurityOrigin.h
@@ -40,8 +40,6 @@
namespace WebCore {
-typedef HashSet<String, CaseFoldingHash> URLSchemesMap;
-
class Document;
class KURL;
@@ -174,18 +172,6 @@ public:
// (and whether it was set) but considering the host. It is used for postMessage.
bool isSameSchemeHostPort(const SecurityOrigin*) const;
- static void registerURLSchemeAsLocal(const String&);
- static void removeURLSchemeRegisteredAsLocal(const String&);
- static const URLSchemesMap& localURLSchemes();
- static bool shouldTreatURLAsLocal(const String&);
- static bool shouldTreatURLSchemeAsLocal(const String&);
-
- // Secure schemes do not trigger mixed content warnings. For example,
- // https and data are secure schemes because they cannot be corrupted by
- // active network attackers.
- static void registerURLSchemeAsSecure(const String&);
- static bool shouldTreatURLSchemeAsSecure(const String&);
-
static bool shouldHideReferrer(const KURL&, const String& referrer);
enum LocalLoadPolicy {
@@ -197,9 +183,6 @@ public:
static bool restrictAccessToLocal();
static bool allowSubstituteDataAccessToLocal();
- static void registerURLSchemeAsNoAccess(const String&);
- static bool shouldTreatURLSchemeAsNoAccess(const String&);
-
static void addOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomains, bool allowDestinationSubdomains);
static void removeOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomains, bool allowDestinationSubdomains);
static void resetOriginAccessWhitelists();
diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp
index 95c4d21..88bf484 100644
--- a/WebCore/page/Settings.cpp
+++ b/WebCore/page/Settings.cpp
@@ -142,6 +142,7 @@ Settings::Settings(Page* page)
, m_showRepaintCounter(false)
, m_experimentalNotificationsEnabled(false)
, m_webGLEnabled(false)
+ , m_acceleratedCanvas2dEnabled(false)
, m_loadDeferringEnabled(true)
, m_tiledBackingStoreEnabled(false)
, m_html5ParserEnabled(true)
@@ -149,9 +150,13 @@ Settings::Settings(Page* page)
, m_paginateDuringLayoutEnabled(false)
, m_dnsPrefetchingEnabled(true)
, m_memoryInfoEnabled(false)
+<<<<<<< HEAD
#ifdef ANDROID_PLUGINS
, m_pluginsOnDemand(false)
#endif
+=======
+ , m_interactiveFormValidation(false)
+>>>>>>> webkit.org at r64264
{
// A Frame may not have been created yet, so we initialize the AtomicString
// hash before trying to use it.
@@ -800,6 +805,11 @@ void Settings::setWebGLEnabled(bool enabled)
m_webGLEnabled = enabled;
}
+void Settings::setAccelerated2dCanvasEnabled(bool enabled)
+{
+ m_acceleratedCanvas2dEnabled = enabled;
+}
+
void Settings::setLoadDeferringEnabled(bool enabled)
{
m_loadDeferringEnabled = enabled;
diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h
index 8d02d7c..bae035f 100644
--- a/WebCore/page/Settings.h
+++ b/WebCore/page/Settings.h
@@ -357,6 +357,9 @@ namespace WebCore {
void setWebGLEnabled(bool);
bool webGLEnabled() const { return m_webGLEnabled; }
+ void setAccelerated2dCanvasEnabled(bool);
+ bool accelerated2dCanvasEnabled() const { return m_acceleratedCanvas2dEnabled; }
+
void setLoadDeferringEnabled(bool);
bool loadDeferringEnabled() const { return m_loadDeferringEnabled; }
@@ -379,6 +382,13 @@ namespace WebCore {
void setMemoryInfoEnabled(bool flag) { m_memoryInfoEnabled = flag; }
bool memoryInfoEnabled() const { return m_memoryInfoEnabled; }
+ // This setting will be removed when an HTML5 compatibility issue is
+ // resolved and WebKit implementation of interactive validation is
+ // completed. See http://webkit.org/b/40520, http://webkit.org/b/40747,
+ // and http://webkit.org/b/40908
+ void setInteractiveFormValidationEnabled(bool flag) { m_interactiveFormValidation = flag; }
+ bool interactiveFormValidationEnabled() const { return m_interactiveFormValidation; }
+
private:
Page* m_page;
@@ -493,6 +503,7 @@ namespace WebCore {
bool m_showRepaintCounter : 1;
bool m_experimentalNotificationsEnabled : 1;
bool m_webGLEnabled : 1;
+ bool m_acceleratedCanvas2dEnabled : 1;
bool m_loadDeferringEnabled : 1;
bool m_tiledBackingStoreEnabled : 1;
bool m_html5ParserEnabled: 1;
@@ -500,9 +511,13 @@ namespace WebCore {
bool m_paginateDuringLayoutEnabled : 1;
bool m_dnsPrefetchingEnabled : 1;
bool m_memoryInfoEnabled: 1;
+<<<<<<< HEAD
#ifdef ANDROID_PLUGINS
bool m_pluginsOnDemand : 1;
#endif
+=======
+ bool m_interactiveFormValidation: 1;
+>>>>>>> webkit.org at r64264
#if USE(SAFARI_THEME)
static bool gShouldPaintNativeControls;
diff --git a/WebCore/page/SpeechInput.cpp b/WebCore/page/SpeechInput.cpp
index 92df70e..4f37988 100644
--- a/WebCore/page/SpeechInput.cpp
+++ b/WebCore/page/SpeechInput.cpp
@@ -39,27 +39,48 @@
namespace WebCore {
-SpeechInput::SpeechInput(SpeechInputClient* client, SpeechInputListener* listener)
+SpeechInput::SpeechInput(SpeechInputClient* client)
: m_client(client)
- , m_listener(listener)
+ , m_listener(0)
{
}
-void SpeechInput::recordingComplete()
+void SpeechInput::didCompleteRecording()
{
- m_listener->recordingComplete();
+ ASSERT(m_listener);
+ m_listener->didCompleteRecording();
+}
+
+void SpeechInput::didCompleteRecognition()
+{
+ ASSERT(m_listener);
+ m_listener->didCompleteRecognition();
+ m_listener = 0;
}
void SpeechInput::setRecognitionResult(const String& result)
{
+ ASSERT(m_listener);
m_listener->setRecognitionResult(result);
}
-bool SpeechInput::startRecognition()
+bool SpeechInput::startRecognition(SpeechInputListener* listener)
+{
+ // Cancel any ongoing recognition first.
+ if (m_listener) {
+ m_listener->didCompleteRecognition();
+ m_listener = 0;
+ m_client->cancelRecognition();
+ }
+
+ m_listener = listener;
+ return m_client->startRecognition(this);
+}
+
+void SpeechInput::stopRecording()
{
- if (m_client)
- return m_client->startRecognition(this);
- return false;
+ ASSERT(m_listener);
+ m_client->stopRecording();
}
} // namespace WebCore
diff --git a/WebCore/page/SpeechInput.h b/WebCore/page/SpeechInput.h
index 201be99..2ce0eea 100644
--- a/WebCore/page/SpeechInput.h
+++ b/WebCore/page/SpeechInput.h
@@ -33,7 +33,7 @@
#if ENABLE(INPUT_SPEECH)
-#include "SpeechInputClientListener.h"
+#include "SpeechInputListener.h"
#include <wtf/Noncopyable.h>
namespace WebCore {
@@ -45,21 +45,20 @@ class String;
// This class connects the input elements requiring speech input with the platform specific
// speech recognition engine. It provides methods for the input elements to activate speech
// recognition and methods for the speech recognition engine to return back the results.
-class SpeechInput : public Noncopyable, public SpeechInputClientListener {
+class SpeechInput : public Noncopyable, public SpeechInputListener {
public:
- SpeechInput(SpeechInputClient*, SpeechInputListener*);
+ SpeechInput(SpeechInputClient*);
virtual ~SpeechInput() { }
// Methods invoked by the input elements.
- virtual bool startRecognition();
+ bool startRecognition(SpeechInputListener* listener);
+ void stopRecording();
- // SpeechInputClient::Listener methods.
- virtual void recordingComplete();
+ // SpeechInputListener methods.
+ virtual void didCompleteRecording();
+ virtual void didCompleteRecognition();
virtual void setRecognitionResult(const String&);
-protected:
- SpeechInputClient* client() const { return m_client; }
-
private:
SpeechInputClient* m_client;
SpeechInputListener* m_listener;
diff --git a/WebCore/page/SpeechInputClient.h b/WebCore/page/SpeechInputClient.h
index be68f46..f6c61cf 100644
--- a/WebCore/page/SpeechInputClient.h
+++ b/WebCore/page/SpeechInputClient.h
@@ -35,12 +35,20 @@
namespace WebCore {
-class SpeechInputClientListener;
+class SpeechInputListener;
// Provides an interface for SpeechInput to call into the embedder.
class SpeechInputClient {
public:
- virtual bool startRecognition(SpeechInputClientListener* listener) = 0;
+ virtual bool startRecognition(SpeechInputListener* listener) = 0;
+
+ // Stops audio recording and performs recognition with the audio recorded until now
+ // (does not discard audio).
+ virtual void stopRecording() = 0;
+
+ // Cancels an ongoing recognition and discards any audio recorded so far. No partial
+ // recognition results are returned to the listener.
+ virtual void cancelRecognition() = 0;
protected:
virtual ~SpeechInputClient() { }
diff --git a/WebCore/page/SpeechInputListener.h b/WebCore/page/SpeechInputListener.h
index d087d36..1b21a11 100644
--- a/WebCore/page/SpeechInputListener.h
+++ b/WebCore/page/SpeechInputListener.h
@@ -40,7 +40,19 @@ class String;
// Interface to be implemented by the element which invokes SpeechInput.
class SpeechInputListener {
public:
- virtual void recordingComplete() = 0;
+ // Informs that audio recording has completed and recognition is underway.
+ virtual void didCompleteRecording() = 0;
+
+ // Informs that speech recognition has completed. This gets invoked irrespective of whether
+ // recognition was succesful or not, whether setRecognitionResult() was invoked or not. The
+ // handler typically frees up any temporary resources allocated and waits for the next speech
+ // recognition request.
+ virtual void didCompleteRecognition() = 0;
+
+ // Gives results from speech recognition, either partial or the final results.
+ // This method can potentially get called multiple times if there are partial results
+ // available as the user keeps speaking. If the speech could not be recognized properly
+ // or if there was any other errors in the process, this method may never be called.
virtual void setRecognitionResult(const String& result) = 0;
protected:
diff --git a/WebCore/page/Timing.cpp b/WebCore/page/Timing.cpp
index 527390a..f65322b 100644
--- a/WebCore/page/Timing.cpp
+++ b/WebCore/page/Timing.cpp
@@ -33,6 +33,7 @@
#if ENABLE(WEB_TIMING)
+#include "DocumentLoadTiming.h"
#include "DocumentLoader.h"
#include "Frame.h"
#include "ResourceLoadTiming.h"
@@ -159,31 +160,49 @@ unsigned long long Timing::domainLookupEnd() const
unsigned long long Timing::connectStart() const
{
- ResourceLoadTiming* timing = resourceLoadTiming();
+ DocumentLoader* loader = documentLoader();
+ if (!loader)
+ return 0;
+
+ ResourceLoadTiming* timing = loader->response().resourceLoadTiming();
if (!timing)
return 0;
- // This will be -1 when a new connection is not established.
+ // connectStart will be -1 when a network request is not made.
// Rather than exposing a special value that indicates no new connection, we "backfill" with domainLookupEnd.
int connectStart = timing->connectStart;
- if (connectStart < 0)
+ if (connectStart < 0 || loader->response().connectionReused())
return domainLookupEnd();
+ // ResourceLoadTiming's connect phase includes DNS and SSL, however Web Timing's
+ // connect phase should not. So if there is DNS time, trim it from the start.
+ if (timing->dnsEnd >= 0 && timing->dnsEnd > connectStart)
+ connectStart = timing->dnsEnd;
+
return resourceLoadTimeRelativeToAbsolute(connectStart);
}
unsigned long long Timing::connectEnd() const
{
- ResourceLoadTiming* timing = resourceLoadTiming();
+ DocumentLoader* loader = documentLoader();
+ if (!loader)
+ return 0;
+
+ ResourceLoadTiming* timing = loader->response().resourceLoadTiming();
if (!timing)
return 0;
- // This will be -1 when a new connection is not established.
+ // connectEnd will be -1 when a network request is not made.
// Rather than exposing a special value that indicates no new connection, we "backfill" with connectStart.
int connectEnd = timing->connectEnd;
- if (connectEnd < 0)
+ if (connectEnd < 0 || loader->response().connectionReused())
return connectStart();
+ // ResourceLoadTiming's connect phase includes DNS and SSL, however Web Timing's
+ // connect phase should not. So if there is SSL time, trim it from the end.
+ if (timing->sslStart >= 0 && timing->sslStart < connectEnd)
+ connectEnd = timing->sslStart;
+
return resourceLoadTimeRelativeToAbsolute(connectEnd);
}
@@ -290,7 +309,7 @@ unsigned long long Timing::resourceLoadTimeRelativeToAbsolute(int relativeSecond
//
// Since ResourceLoadTimings came from the network platform layer, we must
// check them for skew because they may be from another thread/process.
- double baseTime = getPossiblySkewedTimeInKnownRange(resourceTiming->requestTime, documentTiming->fetchStart, documentTiming->responseEnd);
+ double baseTime = getPossiblySkewedTimeInKnownRange(resourceTiming->requestTime, documentTiming->fetchStart, documentTiming->responseEnd - (resourceTiming->receiveHeadersEnd / 1000.0));
return toIntegerMilliseconds(baseTime) + relativeSeconds;
}
diff --git a/WebCore/page/animation/AnimationBase.cpp b/WebCore/page/animation/AnimationBase.cpp
index 83fd039..4f304e2 100644
--- a/WebCore/page/animation/AnimationBase.cpp
+++ b/WebCore/page/animation/AnimationBase.cpp
@@ -964,28 +964,33 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param)
case AnimationStateStartWaitStyleAvailable:
ASSERT(input == AnimationStateInputStyleAvailable || input == AnimationStateInputPlayStatePaused);
- // Start timer has fired, tell the animation to start and wait for it to respond with start time
- m_animState = AnimationStateStartWaitResponse;
+ if (input == AnimationStateInputStyleAvailable) {
+ // Start timer has fired, tell the animation to start and wait for it to respond with start time
+ m_animState = AnimationStateStartWaitResponse;
- overrideAnimations();
+ overrideAnimations();
+
+ // Start the animation
+ if (overridden()) {
+ // We won't try to start accelerated animations if we are overridden and
+ // just move on to the next state.
+ m_animState = AnimationStateStartWaitResponse;
+ m_isAccelerated = false;
+ updateStateMachine(AnimationStateInputStartTimeSet, beginAnimationUpdateTime());
+ } else {
+ double timeOffset = 0;
+ // If the value for 'animation-delay' is negative then the animation appears to have started in the past.
+ if (m_animation->delay() < 0)
+ timeOffset = -m_animation->delay();
+ bool started = startAnimation(timeOffset);
- // Start the animation
- if (overridden()) {
- // We won't try to start accelerated animations if we are overridden and
- // just move on to the next state.
- m_animState = AnimationStateStartWaitResponse;
- m_isAccelerated = false;
- updateStateMachine(AnimationStateInputStartTimeSet, beginAnimationUpdateTime());
- }
- else {
- double timeOffset = 0;
- // If the value for 'animation-delay' is negative then the animation appears to have started in the past.
- if (m_animation->delay() < 0)
- timeOffset = -m_animation->delay();
- bool started = startAnimation(timeOffset);
-
- m_compAnim->animationController()->addToStartTimeResponseWaitList(this, started);
- m_isAccelerated = started;
+ m_compAnim->animationController()->addToStartTimeResponseWaitList(this, started);
+ m_isAccelerated = started;
+ }
+ } else {
+ // We're waiting for the style to be available and we got a pause. Pause and wait
+ m_pauseTime = beginAnimationUpdateTime();
+ m_animState = AnimationStatePausedWaitStyleAvailable;
}
break;
case AnimationStateStartWaitResponse:
@@ -1075,17 +1080,51 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param)
updateStateMachine(AnimationStateInputStartAnimation, 0);
break;
case AnimationStatePausedWaitResponse:
+ case AnimationStatePausedWaitStyleAvailable:
case AnimationStatePausedRun:
// We treat these two cases the same. The only difference is that, when we are in
// AnimationStatePausedWaitResponse, we don't yet have a valid startTime, so we send 0 to startAnimation.
// When the AnimationStateInputStartTimeSet comes in and we were in AnimationStatePausedRun, we will notice
// that we have already set the startTime and will ignore it.
- ASSERT(input == AnimationStateInputPlayStateRunning || input == AnimationStateInputStartTimeSet);
+ ASSERT(input == AnimationStateInputPlayStateRunning || input == AnimationStateInputStartTimeSet || input == AnimationStateInputStyleAvailable);
ASSERT(paused());
- // If we are paused, but we get the callback that notifies us that an accelerated animation started,
- // then we ignore the start time and just move into the paused-run state.
- if (m_animState == AnimationStatePausedWaitResponse && input == AnimationStateInputStartTimeSet) {
+ if (input == AnimationStateInputPlayStateRunning) {
+ // Update the times
+ if (m_animState == AnimationStatePausedRun)
+ m_startTime += beginAnimationUpdateTime() - m_pauseTime;
+ else
+ m_startTime = 0;
+ m_pauseTime = -1;
+
+ if (m_animState == AnimationStatePausedWaitStyleAvailable)
+ m_animState = AnimationStateStartWaitStyleAvailable;
+ else {
+ // We were either running or waiting for a begin time response from the animation.
+ // Either way we need to restart the animation (possibly with an offset if we
+ // had already been running) and wait for it to start.
+ m_animState = AnimationStateStartWaitResponse;
+
+ // Start the animation
+ if (overridden()) {
+ // We won't try to start accelerated animations if we are overridden and
+ // just move on to the next state.
+ updateStateMachine(AnimationStateInputStartTimeSet, beginAnimationUpdateTime());
+ m_isAccelerated = true;
+ } else {
+ bool started = startAnimation(beginAnimationUpdateTime() - m_startTime);
+ m_compAnim->animationController()->addToStartTimeResponseWaitList(this, started);
+ m_isAccelerated = !started;
+ }
+ }
+ break;
+ }
+
+ if (input == AnimationStateInputStartTimeSet) {
+ ASSERT(m_animState == AnimationStatePausedWaitResponse);
+
+ // We are paused but we got the callback that notifies us that an accelerated animation started.
+ // We ignore the start time and just move into the paused-run state.
m_animState = AnimationStatePausedRun;
ASSERT(m_startTime == 0);
m_startTime = param;
@@ -1093,27 +1132,11 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param)
break;
}
- // Update the times
- if (m_animState == AnimationStatePausedRun)
- m_startTime += beginAnimationUpdateTime() - m_pauseTime;
- else
- m_startTime = 0;
- m_pauseTime = -1;
-
- // We were waiting for a begin time response from the animation, go back and wait again
- m_animState = AnimationStateStartWaitResponse;
-
- // Start the animation
- if (overridden()) {
- // We won't try to start accelerated animations if we are overridden and
- // just move on to the next state.
- updateStateMachine(AnimationStateInputStartTimeSet, beginAnimationUpdateTime());
- m_isAccelerated = false;
- } else {
- bool started = startAnimation(beginAnimationUpdateTime() - m_startTime);
- m_compAnim->animationController()->addToStartTimeResponseWaitList(this, started);
- m_isAccelerated = started;
- }
+ ASSERT(m_animState == AnimationStatePausedWaitStyleAvailable);
+ // We are paused but we got the callback that notifies us that style has been updated.
+ // We move to the AnimationStatePausedWaitResponse state
+ m_animState = AnimationStatePausedWaitResponse;
+ overrideAnimations();
break;
case AnimationStateFillingForwards:
case AnimationStateDone:
diff --git a/WebCore/page/animation/AnimationBase.h b/WebCore/page/animation/AnimationBase.h
index 9bdca3a..33a0b1d 100644
--- a/WebCore/page/animation/AnimationBase.h
+++ b/WebCore/page/animation/AnimationBase.h
@@ -69,6 +69,7 @@ public:
AnimationStateLooping, // response received, animation running, loop timer running, waiting for fire
AnimationStateEnding, // received, animation running, end timer running, waiting for fire
AnimationStatePausedWaitTimer, // in pause mode when animation started
+ AnimationStatePausedWaitStyleAvailable, // in pause mode when waiting for style setup
AnimationStatePausedWaitResponse, // animation paused when in STARTING state
AnimationStatePausedRun, // animation paused when in LOOPING or ENDING state
AnimationStateDone, // end timer fired, animation finished and removed
diff --git a/WebCore/page/chromium/EventHandlerChromium.cpp b/WebCore/page/chromium/EventHandlerChromium.cpp
index ff161af..719163f 100644
--- a/WebCore/page/chromium/EventHandlerChromium.cpp
+++ b/WebCore/page/chromium/EventHandlerChromium.cpp
@@ -129,7 +129,7 @@ bool EventHandler::eventActivatedView(const PlatformMouseEvent& event) const
PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
{
RefPtr<ChromiumDataObject> dataObject = ChromiumDataObject::create();
- return ClipboardChromium::create(true, dataObject.get(), ClipboardWritable);
+ return ClipboardChromium::create(true, dataObject.get(), ClipboardWritable, m_frame);
}
void EventHandler::focusDocumentView()
diff --git a/WebCore/page/gtk/EventHandlerGtk.cpp b/WebCore/page/gtk/EventHandlerGtk.cpp
index 0ff67d2..429aea6 100644
--- a/WebCore/page/gtk/EventHandlerGtk.cpp
+++ b/WebCore/page/gtk/EventHandlerGtk.cpp
@@ -96,7 +96,7 @@ bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* wid
PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
{
- return ClipboardGtk::create(ClipboardWritable, DataObjectGtk::create(), true);
+ return ClipboardGtk::create(ClipboardWritable, DataObjectGtk::create(), true, m_frame);
}
bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
diff --git a/WebCore/page/mac/WebCoreViewFactory.h b/WebCore/page/mac/WebCoreViewFactory.h
index 2ca0d17..9191abe 100644
--- a/WebCore/page/mac/WebCoreViewFactory.h
+++ b/WebCore/page/mac/WebCoreViewFactory.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003, 2005, 2009 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2003, 2005, 2009, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,83 +28,8 @@
@protocol WebCoreViewFactory
-- (NSString *)inputElementAltText;
-- (NSString *)resetButtonDefaultLabel;
-- (NSString *)searchableIndexIntroduction;
-- (NSString *)submitButtonDefaultLabel;
-- (NSString *)fileButtonChooseFileLabel;
-- (NSString *)fileButtonNoFileSelectedLabel;
-- (NSString *)copyImageUnknownFileLabel;
-
-#if ENABLE(CONTEXT_MENUS)
-// Context menu item titles
-- (NSString *)contextMenuItemTagOpenLinkInNewWindow;
-- (NSString *)contextMenuItemTagDownloadLinkToDisk;
-- (NSString *)contextMenuItemTagCopyLinkToClipboard;
-- (NSString *)contextMenuItemTagOpenImageInNewWindow;
-- (NSString *)contextMenuItemTagDownloadImageToDisk;
-- (NSString *)contextMenuItemTagCopyImageToClipboard;
-- (NSString *)contextMenuItemTagOpenFrameInNewWindow;
-- (NSString *)contextMenuItemTagCopy;
-- (NSString *)contextMenuItemTagGoBack;
-- (NSString *)contextMenuItemTagGoForward;
-- (NSString *)contextMenuItemTagStop;
-- (NSString *)contextMenuItemTagReload;
-- (NSString *)contextMenuItemTagCut;
-- (NSString *)contextMenuItemTagPaste;
-- (NSString *)contextMenuItemTagNoGuessesFound;
-- (NSString *)contextMenuItemTagIgnoreSpelling;
-- (NSString *)contextMenuItemTagLearnSpelling;
-- (NSString *)contextMenuItemTagSearchInSpotlight;
-- (NSString *)contextMenuItemTagSearchWeb;
-- (NSString *)contextMenuItemTagLookUpInDictionary;
-- (NSString *)contextMenuItemTagOpenLink;
-- (NSString *)contextMenuItemTagIgnoreGrammar;
-- (NSString *)contextMenuItemTagSpellingMenu;
-- (NSString *)contextMenuItemTagShowSpellingPanel:(bool)show;
-- (NSString *)contextMenuItemTagCheckSpelling;
-- (NSString *)contextMenuItemTagCheckSpellingWhileTyping;
-- (NSString *)contextMenuItemTagCheckGrammarWithSpelling;
-- (NSString *)contextMenuItemTagFontMenu;
-- (NSString *)contextMenuItemTagShowFonts;
-- (NSString *)contextMenuItemTagBold;
-- (NSString *)contextMenuItemTagItalic;
-- (NSString *)contextMenuItemTagUnderline;
-- (NSString *)contextMenuItemTagOutline;
-- (NSString *)contextMenuItemTagStyles;
-- (NSString *)contextMenuItemTagShowColors;
-- (NSString *)contextMenuItemTagSpeechMenu;
-- (NSString *)contextMenuItemTagStartSpeaking;
-- (NSString *)contextMenuItemTagStopSpeaking;
-- (NSString *)contextMenuItemTagWritingDirectionMenu;
-- (NSString *)contextMenuItemTagTextDirectionMenu;
-- (NSString *)contextMenuItemTagDefaultDirection;
-- (NSString *)contextMenuItemTagLeftToRight;
-- (NSString *)contextMenuItemTagRightToLeft;
-- (NSString *)contextMenuItemTagCorrectSpellingAutomatically;
-- (NSString *)contextMenuItemTagSubstitutionsMenu;
-- (NSString *)contextMenuItemTagShowSubstitutions:(bool)show;
-- (NSString *)contextMenuItemTagSmartCopyPaste;
-- (NSString *)contextMenuItemTagSmartQuotes;
-- (NSString *)contextMenuItemTagSmartDashes;
-- (NSString *)contextMenuItemTagSmartLinks;
-- (NSString *)contextMenuItemTagTextReplacement;
-- (NSString *)contextMenuItemTagTransformationsMenu;
-- (NSString *)contextMenuItemTagMakeUpperCase;
-- (NSString *)contextMenuItemTagMakeLowerCase;
-- (NSString *)contextMenuItemTagCapitalize;
-- (NSString *)contextMenuItemTagChangeBack:(NSString *)replacedString;
-- (NSString *)contextMenuItemTagInspectElement;
-#endif // ENABLE(CONTEXT_MENUS)
-
-- (NSString *)searchMenuNoRecentSearchesText;
-- (NSString *)searchMenuRecentSearchesText;
-- (NSString *)searchMenuClearRecentSearchesText;
-
- (NSString *)defaultLanguageCode;
-- (NSString *)imageTitleForFilename:(NSString *)filename width:(int)width height:(int)height;
-
- (BOOL)objectIsTextMarker:(id)object;
- (BOOL)objectIsTextMarkerRange:(id)object;
@@ -121,45 +46,6 @@
- (AXUIElementRef)AXUIElementForElement:(id)element;
- (void)unregisterUniqueIdForUIElement:(id)element;
-- (NSString *)AXWebAreaText;
-- (NSString *)AXLinkText;
-- (NSString *)AXListMarkerText;
-- (NSString *)AXImageMapText;
-- (NSString *)AXHeadingText;
-- (NSString *)AXDefinitionListTermText;
-- (NSString *)AXDefinitionListDefinitionText;
-- (NSString *)AXARIAContentGroupText:(NSString *)ariaType;
-
-- (NSString *)AXButtonActionVerb;
-- (NSString *)AXRadioButtonActionVerb;
-- (NSString *)AXTextFieldActionVerb;
-- (NSString *)AXCheckedCheckBoxActionVerb;
-- (NSString *)AXUncheckedCheckBoxActionVerb;
-- (NSString *)AXLinkActionVerb;
-- (NSString *)AXMenuListPopupActionVerb;
-- (NSString *)AXMenuListActionVerb;
-
-- (NSString *)missingPluginText;
-- (NSString *)crashedPluginText;
-
-- (NSString *)multipleFileUploadTextForNumberOfFiles:(unsigned)numberOfFiles;
-// FTP Directory Related
-- (NSString *)unknownFileSizeText;
-
-- (NSString *)mediaElementLoadingStateText;
-- (NSString *)mediaElementLiveBroadcastStateText;
-- (NSString*)localizedMediaControlElementString:(NSString*)name;
-- (NSString*)localizedMediaControlElementHelpText:(NSString*)name;
-- (NSString*)localizedMediaTimeDescription:(float)time;
-
-- (NSString *)validationMessageValueMissingText;
-- (NSString *)validationMessageTypeMismatchText;
-- (NSString *)validationMessagePatternMismatchText;
-- (NSString *)validationMessageTooLongText;
-- (NSString *)validationMessageRangeUnderflowText;
-- (NSString *)validationMessageRangeOverflowText;
-- (NSString *)validationMessageStepMismatchText;
-
@end
@interface WebCoreViewFactory : NSObject
diff --git a/WebCore/page/win/EventHandlerWin.cpp b/WebCore/page/win/EventHandlerWin.cpp
index e1d5be9..ee4b360 100644
--- a/WebCore/page/win/EventHandlerWin.cpp
+++ b/WebCore/page/win/EventHandlerWin.cpp
@@ -98,7 +98,7 @@ PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
#else
COMPtr<WCDataObject> dataObject;
WCDataObject::createInstance(&dataObject);
- return ClipboardWin::create(true, dataObject.get(), ClipboardWritable);
+ return ClipboardWin::create(true, dataObject.get(), ClipboardWritable, m_frame);
#endif
}
diff --git a/WebCore/platform/ContextMenu.cpp b/WebCore/platform/ContextMenu.cpp
index 00bb253..84a2ffc 100644
--- a/WebCore/platform/ContextMenu.cpp
+++ b/WebCore/platform/ContextMenu.cpp
@@ -815,6 +815,8 @@ void ContextMenu::checkOrEnableIfNeeded(ContextMenuItem& item) const
case ContextMenuItemTagInspectElement:
#endif
case ContextMenuItemBaseCustomTag:
+ case ContextMenuItemCustomTagNoAction:
+ case ContextMenuItemLastCustomTag:
case ContextMenuItemBaseApplicationTag:
break;
}
diff --git a/WebCore/platform/ContextMenuItem.h b/WebCore/platform/ContextMenuItem.h
index 8c46e10..3731e24 100644
--- a/WebCore/platform/ContextMenuItem.h
+++ b/WebCore/platform/ContextMenuItem.h
@@ -144,6 +144,8 @@ namespace WebCore {
ContextMenuItemTagChangeBack,
#endif
ContextMenuItemBaseCustomTag = 5000,
+ ContextMenuItemCustomTagNoAction = 5998,
+ ContextMenuItemLastCustomTag = 5999,
ContextMenuItemBaseApplicationTag = 10000
};
diff --git a/WebCore/platform/DragData.h b/WebCore/platform/DragData.h
index 230e344..d90a424 100644
--- a/WebCore/platform/DragData.h
+++ b/WebCore/platform/DragData.h
@@ -26,7 +26,6 @@
#ifndef DragData_h
#define DragData_h
-#include "ClipboardAccessPolicy.h"
#include "Color.h"
#include "DragActions.h"
#include "IntPoint.h"
@@ -70,7 +69,6 @@ typedef void* DragDataRef;
namespace WebCore {
- class Clipboard;
class Document;
class DocumentFragment;
class KURL;
@@ -97,7 +95,6 @@ namespace WebCore {
const IntPoint& globalPosition() const { return m_globalPosition; }
DragDataRef platformData() const { return m_platformDragData; }
DragOperation draggingSourceOperationMask() const { return m_draggingSourceOperationMask; }
- PassRefPtr<Clipboard> createClipboard(ClipboardAccessPolicy) const;
bool containsURL(FilenameConversionPolicy filenamePolicy = ConvertFilenames) const;
bool containsPlainText() const;
bool containsCompatibleContent() const;
diff --git a/WebCore/platform/LocalizationStrategy.h b/WebCore/platform/LocalizationStrategy.h
new file mode 100644
index 0000000..9bde316
--- /dev/null
+++ b/WebCore/platform/LocalizationStrategy.h
@@ -0,0 +1,172 @@
+/*
+ * Copyright (C) 2010 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#ifndef LocalizationStrategy_h
+#define LocalizationStrategy_h
+
+#if USE(PLATFORM_STRATEGIES)
+
+namespace WebCore {
+
+class String;
+class IntSize;
+
+class LocalizationStrategy {
+public:
+ virtual String inputElementAltText() = 0;
+ virtual String resetButtonDefaultLabel() = 0;
+ virtual String searchableIndexIntroduction() = 0;
+ virtual String submitButtonDefaultLabel() = 0;
+ virtual String fileButtonChooseFileLabel() = 0;
+ virtual String fileButtonNoFileSelectedLabel() = 0;
+ virtual String copyImageUnknownFileLabel() = 0;
+
+#if ENABLE(CONTEXT_MENUS)
+ virtual String contextMenuItemTagOpenLinkInNewWindow() = 0;
+ virtual String contextMenuItemTagDownloadLinkToDisk() = 0;
+ virtual String contextMenuItemTagCopyLinkToClipboard() = 0;
+ virtual String contextMenuItemTagOpenImageInNewWindow() = 0;
+ virtual String contextMenuItemTagDownloadImageToDisk() = 0;
+ virtual String contextMenuItemTagCopyImageToClipboard() = 0;
+ virtual String contextMenuItemTagOpenFrameInNewWindow() = 0;
+ virtual String contextMenuItemTagCopy() = 0;
+ virtual String contextMenuItemTagGoBack() = 0;
+ virtual String contextMenuItemTagGoForward() = 0;
+ virtual String contextMenuItemTagStop() = 0;
+ virtual String contextMenuItemTagReload() = 0;
+ virtual String contextMenuItemTagCut() = 0;
+ virtual String contextMenuItemTagPaste() = 0;
+#if PLATFORM(GTK)
+ virtual String contextMenuItemTagDelete() = 0;
+ virtual String contextMenuItemTagSelectAll() = 0;
+ virtual String contextMenuItemTagInputMethods() = 0;
+ virtual String contextMenuItemTagUnicode() = 0;
+#endif
+ virtual String contextMenuItemTagNoGuessesFound() = 0;
+ virtual String contextMenuItemTagIgnoreSpelling() = 0;
+ virtual String contextMenuItemTagLearnSpelling() = 0;
+ virtual String contextMenuItemTagSearchWeb() = 0;
+ virtual String contextMenuItemTagLookUpInDictionary() = 0;
+ virtual String contextMenuItemTagOpenLink() = 0;
+ virtual String contextMenuItemTagIgnoreGrammar() = 0;
+ virtual String contextMenuItemTagSpellingMenu() = 0;
+ virtual String contextMenuItemTagShowSpellingPanel(bool show) = 0;
+ virtual String contextMenuItemTagCheckSpelling() = 0;
+ virtual String contextMenuItemTagCheckSpellingWhileTyping() = 0;
+ virtual String contextMenuItemTagCheckGrammarWithSpelling() = 0;
+ virtual String contextMenuItemTagFontMenu() = 0;
+ virtual String contextMenuItemTagBold() = 0;
+ virtual String contextMenuItemTagItalic() = 0;
+ virtual String contextMenuItemTagUnderline() = 0;
+ virtual String contextMenuItemTagOutline() = 0;
+ virtual String contextMenuItemTagWritingDirectionMenu() = 0;
+ virtual String contextMenuItemTagTextDirectionMenu() = 0;
+ virtual String contextMenuItemTagDefaultDirection() = 0;
+ virtual String contextMenuItemTagLeftToRight() = 0;
+ virtual String contextMenuItemTagRightToLeft() = 0;
+#if PLATFORM(MAC)
+ virtual String contextMenuItemTagSearchInSpotlight() = 0;
+ virtual String contextMenuItemTagShowFonts() = 0;
+ virtual String contextMenuItemTagStyles() = 0;
+ virtual String contextMenuItemTagShowColors() = 0;
+ virtual String contextMenuItemTagSpeechMenu() = 0;
+ virtual String contextMenuItemTagStartSpeaking() = 0;
+ virtual String contextMenuItemTagStopSpeaking() = 0;
+ virtual String contextMenuItemTagCorrectSpellingAutomatically() = 0;
+ virtual String contextMenuItemTagSubstitutionsMenu() = 0;
+ virtual String contextMenuItemTagShowSubstitutions(bool show) = 0;
+ virtual String contextMenuItemTagSmartCopyPaste() = 0;
+ virtual String contextMenuItemTagSmartQuotes() = 0;
+ virtual String contextMenuItemTagSmartDashes() = 0;
+ virtual String contextMenuItemTagSmartLinks() = 0;
+ virtual String contextMenuItemTagTextReplacement() = 0;
+ virtual String contextMenuItemTagTransformationsMenu() = 0;
+ virtual String contextMenuItemTagMakeUpperCase() = 0;
+ virtual String contextMenuItemTagMakeLowerCase() = 0;
+ virtual String contextMenuItemTagCapitalize() = 0;
+ virtual String contextMenuItemTagChangeBack(const String& replacedString) = 0;
+#endif
+ virtual String contextMenuItemTagInspectElement() = 0;
+#endif // ENABLE(CONTEXT_MENUS)
+
+ virtual String searchMenuNoRecentSearchesText() = 0;
+ virtual String searchMenuRecentSearchesText() = 0;
+ virtual String searchMenuClearRecentSearchesText() = 0;
+
+ virtual String AXWebAreaText() = 0;
+ virtual String AXLinkText() = 0;
+ virtual String AXListMarkerText() = 0;
+ virtual String AXImageMapText() = 0;
+ virtual String AXHeadingText() = 0;
+ virtual String AXDefinitionListTermText() = 0;
+ virtual String AXDefinitionListDefinitionText() = 0;
+ virtual String AXARIAContentGroupText(const String& ariaType) = 0;
+
+ virtual String AXButtonActionVerb() = 0;
+ virtual String AXRadioButtonActionVerb() = 0;
+ virtual String AXTextFieldActionVerb() = 0;
+ virtual String AXCheckedCheckBoxActionVerb() = 0;
+ virtual String AXUncheckedCheckBoxActionVerb() = 0;
+ virtual String AXMenuListActionVerb() = 0;
+ virtual String AXMenuListPopupActionVerb() = 0;
+ virtual String AXLinkActionVerb() = 0;
+
+ virtual String missingPluginText() = 0;
+ virtual String crashedPluginText() = 0;
+ virtual String multipleFileUploadText(unsigned numberOfFiles) = 0;
+ virtual String unknownFileSizeText() = 0;
+
+#if PLATFORM(WIN)
+ virtual String uploadFileText() = 0;
+ virtual String allFilesText() = 0;
+#endif
+
+ virtual String imageTitle(const String& filename, const IntSize& size) = 0;
+
+ virtual String mediaElementLoadingStateText() = 0;
+ virtual String mediaElementLiveBroadcastStateText() = 0;
+ virtual String localizedMediaControlElementString(const String&) = 0;
+ virtual String localizedMediaControlElementHelpText(const String&) = 0;
+ virtual String localizedMediaTimeDescription(float) = 0;
+
+ virtual String validationMessageValueMissingText() = 0;
+ virtual String validationMessageTypeMismatchText() = 0;
+ virtual String validationMessagePatternMismatchText() = 0;
+ virtual String validationMessageTooLongText() = 0;
+ virtual String validationMessageRangeUnderflowText() = 0;
+ virtual String validationMessageRangeOverflowText() = 0;
+ virtual String validationMessageStepMismatchText() = 0;
+
+protected:
+ virtual ~LocalizationStrategy()
+ {
+ }
+};
+
+} // namespace WebCore
+
+#endif // USE(PLATFORM_STRATEGIES)
+
+#endif // LocalizationStrategy_h
diff --git a/WebCore/platform/PlatformStrategies.h b/WebCore/platform/PlatformStrategies.h
index 22da3ac..f585202 100644
--- a/WebCore/platform/PlatformStrategies.h
+++ b/WebCore/platform/PlatformStrategies.h
@@ -31,6 +31,7 @@
namespace WebCore {
class PluginStrategy;
+class LocalizationStrategy;
class PlatformStrategies {
public:
@@ -38,21 +39,33 @@ public:
{
if (!m_pluginStrategy)
m_pluginStrategy = createPluginStrategy();
-
return m_pluginStrategy;
}
+ LocalizationStrategy* localizationStrategy()
+ {
+ if (!m_localizationStrategy)
+ m_localizationStrategy = createLocalizationStrategy();
+ return m_localizationStrategy;
+ }
+
protected:
PlatformStrategies()
- : m_pluginStrategy(0)
+ : m_pluginStrategy(0),
+ m_localizationStrategy(0)
+ {
+ }
+
+ virtual ~PlatformStrategies()
{
}
- virtual ~PlatformStrategies() { }
-private:
+private:
virtual PluginStrategy* createPluginStrategy() = 0;
+ virtual LocalizationStrategy* createLocalizationStrategy() = 0;
PluginStrategy* m_pluginStrategy;
+ LocalizationStrategy* m_localizationStrategy;
};
PlatformStrategies* platformStrategies();
diff --git a/WebCore/platform/PopupMenuClient.h b/WebCore/platform/PopupMenuClient.h
index a1396e8..976f28c 100644
--- a/WebCore/platform/PopupMenuClient.h
+++ b/WebCore/platform/PopupMenuClient.h
@@ -43,6 +43,7 @@ public:
virtual String itemText(unsigned listIndex) const = 0;
virtual String itemLabel(unsigned listIndex) const = 0;
+ virtual String itemIcon(unsigned listIndex) const = 0;
virtual String itemToolTip(unsigned listIndex) const = 0;
virtual String itemAccessibilityText(unsigned listIndex) const = 0;
virtual bool itemIsEnabled(unsigned listIndex) const = 0;
diff --git a/WebCore/platform/SchemeRegistry.cpp b/WebCore/platform/SchemeRegistry.cpp
new file mode 100644
index 0000000..0423236
--- /dev/null
+++ b/WebCore/platform/SchemeRegistry.cpp
@@ -0,0 +1,172 @@
+/*
+ * Copyright (C) 2010 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``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 APPLE COMPUTER, INC. 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 "SchemeRegistry.h"
+
+namespace WebCore {
+
+static URLSchemesMap& localURLSchemes()
+{
+ DEFINE_STATIC_LOCAL(URLSchemesMap, localSchemes, ());
+
+ if (localSchemes.isEmpty()) {
+ localSchemes.add("file");
+#if PLATFORM(MAC)
+ localSchemes.add("applewebdata");
+#endif
+#if PLATFORM(QT)
+ localSchemes.add("qrc");
+#endif
+ }
+
+ return localSchemes;
+}
+
+static URLSchemesMap& secureSchemes()
+{
+ DEFINE_STATIC_LOCAL(URLSchemesMap, secureSchemes, ());
+
+ if (secureSchemes.isEmpty()) {
+ secureSchemes.add("https");
+ secureSchemes.add("about");
+ secureSchemes.add("data");
+ }
+
+ return secureSchemes;
+}
+
+static URLSchemesMap& schemesWithUniqueOrigins()
+{
+ DEFINE_STATIC_LOCAL(URLSchemesMap, schemesWithUniqueOrigins, ());
+
+ // This is a willful violation of HTML5.
+ // See https://bugs.webkit.org/show_bug.cgi?id=11885
+ if (schemesWithUniqueOrigins.isEmpty())
+ schemesWithUniqueOrigins.add("data");
+
+ return schemesWithUniqueOrigins;
+}
+
+static URLSchemesMap& emptyDocumentSchemes()
+{
+ DEFINE_STATIC_LOCAL(URLSchemesMap, emptyDocumentSchemes, ());
+
+ if (emptyDocumentSchemes.isEmpty())
+ emptyDocumentSchemes.add("about");
+
+ return emptyDocumentSchemes;
+}
+
+void SchemeRegistry::registerURLSchemeAsLocal(const String& scheme)
+{
+ WebCore::localURLSchemes().add(scheme);
+}
+
+void SchemeRegistry::removeURLSchemeRegisteredAsLocal(const String& scheme)
+{
+ if (scheme == "file")
+ return;
+#if PLATFORM(MAC)
+ if (scheme == "applewebdata")
+ return;
+#endif
+ WebCore::localURLSchemes().remove(scheme);
+}
+
+const URLSchemesMap& SchemeRegistry::localURLSchemes()
+{
+ return WebCore::localURLSchemes();
+}
+
+bool SchemeRegistry::shouldTreatURLAsLocal(const String& url)
+{
+ // This avoids an allocation of another String and the HashSet contains()
+ // call for the file: and http: schemes.
+ if (url.length() >= 5) {
+ const UChar* s = url.characters();
+ if (s[0] == 'h' && s[1] == 't' && s[2] == 't' && s[3] == 'p' && s[4] == ':')
+ return false;
+ if (s[0] == 'f' && s[1] == 'i' && s[2] == 'l' && s[3] == 'e' && s[4] == ':')
+ return true;
+ }
+
+ int loc = url.find(':');
+ if (loc == -1)
+ return false;
+
+ String scheme = url.left(loc);
+ return WebCore::localURLSchemes().contains(scheme);
+}
+
+bool SchemeRegistry::shouldTreatURLSchemeAsLocal(const String& scheme)
+{
+ // This avoids an allocation of another String and the HashSet contains()
+ // call for the file: and http: schemes.
+ if (scheme.length() == 4) {
+ const UChar* s = scheme.characters();
+ if (s[0] == 'h' && s[1] == 't' && s[2] == 't' && s[3] == 'p')
+ return false;
+ if (s[0] == 'f' && s[1] == 'i' && s[2] == 'l' && s[3] == 'e')
+ return true;
+ }
+
+ if (scheme.isEmpty())
+ return false;
+
+ return WebCore::localURLSchemes().contains(scheme);
+}
+
+void SchemeRegistry::registerURLSchemeAsNoAccess(const String& scheme)
+{
+ schemesWithUniqueOrigins().add(scheme);
+}
+
+bool SchemeRegistry::shouldTreatURLSchemeAsNoAccess(const String& scheme)
+{
+ return schemesWithUniqueOrigins().contains(scheme);
+}
+
+void SchemeRegistry::registerURLSchemeAsSecure(const String& scheme)
+{
+ secureSchemes().add(scheme);
+}
+
+bool SchemeRegistry::shouldTreatURLSchemeAsSecure(const String& scheme)
+{
+ return secureSchemes().contains(scheme);
+}
+
+void SchemeRegistry::registerURLSchemeAsEmptyDocument(const String& scheme)
+{
+ emptyDocumentSchemes().add(scheme);
+}
+
+bool SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(const String& scheme)
+{
+ return emptyDocumentSchemes().contains(scheme);
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/SchemeRegistry.h b/WebCore/platform/SchemeRegistry.h
new file mode 100644
index 0000000..d92ec4e
--- /dev/null
+++ b/WebCore/platform/SchemeRegistry.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2010 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``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 APPLE COMPUTER, INC. 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.
+ *
+ */
+#ifndef SchemeRegistry_h
+#define SchemeRegistry_h
+
+#include "PlatformString.h"
+#include "StringHash.h"
+#include <wtf/HashSet.h>
+
+namespace WebCore {
+
+typedef HashSet<String, CaseFoldingHash> URLSchemesMap;
+
+class SchemeRegistry {
+public:
+ static void registerURLSchemeAsLocal(const String&);
+ static void removeURLSchemeRegisteredAsLocal(const String&);
+ static const URLSchemesMap& localURLSchemes();
+
+ static bool shouldTreatURLAsLocal(const String&);
+ static bool shouldTreatURLSchemeAsLocal(const String&);
+
+ // Secure schemes do not trigger mixed content warnings. For example,
+ // https and data are secure schemes because they cannot be corrupted by
+ // active network attackers.
+ static void registerURLSchemeAsSecure(const String&);
+ static bool shouldTreatURLSchemeAsSecure(const String&);
+
+ static void registerURLSchemeAsNoAccess(const String&);
+ static bool shouldTreatURLSchemeAsNoAccess(const String&);
+
+ static void registerURLSchemeAsEmptyDocument(const String&);
+ static bool shouldLoadURLSchemeAsEmptyDocument(const String&);
+};
+
+} // namespace WebCore
+
+#endif // SchemeRegistry_h
diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cpp
index 615ae5d..ddecf1e 100644
--- a/WebCore/platform/ScrollView.cpp
+++ b/WebCore/platform/ScrollView.cpp
@@ -322,7 +322,6 @@ void ScrollView::valueChanged(Scrollbar* scrollbar)
if (scrollbarsSuppressed())
return;
- repaintFixedElementsAfterScrolling();
scrollContents(scrollDelta);
}
diff --git a/WebCore/platform/android/ClipboardAndroid.cpp b/WebCore/platform/android/ClipboardAndroid.cpp
index 375f980..d9b2d68 100644
--- a/WebCore/platform/android/ClipboardAndroid.cpp
+++ b/WebCore/platform/android/ClipboardAndroid.cpp
@@ -35,6 +35,11 @@
namespace WebCore {
+PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy, DragData*, Frame*)
+{
+ return 0;
+}
+
ClipboardAndroid::ClipboardAndroid(ClipboardAccessPolicy policy, bool isForDragging)
: Clipboard(policy, isForDragging)
{
diff --git a/WebCore/platform/android/DragDataAndroid.cpp b/WebCore/platform/android/DragDataAndroid.cpp
index 756d007..4e99b2c 100644
--- a/WebCore/platform/android/DragDataAndroid.cpp
+++ b/WebCore/platform/android/DragDataAndroid.cpp
@@ -27,7 +27,6 @@
#include "config.h"
#include "DragData.h"
-#include "Clipboard.h"
#include "Document.h"
#include "DocumentFragment.h"
@@ -58,11 +57,6 @@ Color DragData::asColor() const
return Color();
}
-PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy) const
-{
- return 0;
-}
-
bool DragData::containsCompatibleContent() const
{
return false;
diff --git a/WebCore/platform/brew/ClipboardBrew.cpp b/WebCore/platform/brew/ClipboardBrew.cpp
index 3fd085a..720d6a6 100644
--- a/WebCore/platform/brew/ClipboardBrew.cpp
+++ b/WebCore/platform/brew/ClipboardBrew.cpp
@@ -36,6 +36,11 @@
namespace WebCore {
+PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy, DragData*, Frame*)
+{
+ return 0;
+}
+
ClipboardBrew::ClipboardBrew(ClipboardAccessPolicy policy, bool isForDragging)
: Clipboard(policy, isForDragging)
{
diff --git a/WebCore/platform/brew/DragDataBrew.cpp b/WebCore/platform/brew/DragDataBrew.cpp
index eec8bc4..d114fd6 100644
--- a/WebCore/platform/brew/DragDataBrew.cpp
+++ b/WebCore/platform/brew/DragDataBrew.cpp
@@ -27,7 +27,6 @@
#include "config.h"
#include "DragData.h"
-#include "Clipboard.h"
#include "Document.h"
#include "DocumentFragment.h"
@@ -58,11 +57,6 @@ Color DragData::asColor() const
return Color();
}
-PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy) const
-{
- return 0;
-}
-
bool DragData::containsCompatibleContent() const
{
return false;
diff --git a/WebCore/platform/chromium/ChromiumBridge.h b/WebCore/platform/chromium/ChromiumBridge.h
index 2d9695e..711c728 100644
--- a/WebCore/platform/chromium/ChromiumBridge.h
+++ b/WebCore/platform/chromium/ChromiumBridge.h
@@ -155,8 +155,7 @@ namespace WebCore {
// Geolocation --------------------------------------------------------
static GeolocationServiceBridge* createGeolocationServiceBridge(GeolocationServiceChromium*);
- // HTML5 DB -----------------------------------------------------------
-#if ENABLE(DATABASE)
+ // Databases ----------------------------------------------------------
// Returns a handle to the DB file and ooptionally a handle to its containing directory
static PlatformFileHandle databaseOpenFile(const String& vfsFleName, int desiredFlags);
// Returns a SQLite code (SQLITE_OK = 0, on success)
@@ -165,7 +164,6 @@ namespace WebCore {
static long databaseGetFileAttributes(const String& vfsFileName);
// Returns the size of the DB file
static long long databaseGetFileSize(const String& vfsFileName);
-#endif
// IndexedDB ----------------------------------------------------------
static PassRefPtr<IndexedDatabase> indexedDatabase();
diff --git a/WebCore/platform/chromium/ClipboardChromium.cpp b/WebCore/platform/chromium/ClipboardChromium.cpp
index 8aad8aa..06244a2 100644
--- a/WebCore/platform/chromium/ClipboardChromium.cpp
+++ b/WebCore/platform/chromium/ClipboardChromium.cpp
@@ -32,6 +32,7 @@
#include "ChromiumDataObject.h"
#include "ClipboardUtilitiesChromium.h"
#include "Document.h"
+#include "DragData.h"
#include "Element.h"
#include "FileList.h"
#include "Frame.h"
@@ -43,6 +44,7 @@
#include "PlatformString.h"
#include "Range.h"
#include "RenderImage.h"
+#include "ScriptExecutionContext.h"
#include "StringBuilder.h"
#include "markup.h"
@@ -89,18 +91,25 @@ static ClipboardDataType clipboardTypeFromMIMEType(const String& type)
return ClipboardDataTypeOther;
}
+PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData* dragData, Frame* frame)
+{
+ return ClipboardChromium::create(true, dragData->platformData(), policy, frame);
+}
+
ClipboardChromium::ClipboardChromium(bool isForDragging,
PassRefPtr<ChromiumDataObject> dataObject,
- ClipboardAccessPolicy policy)
+ ClipboardAccessPolicy policy,
+ Frame* frame)
: Clipboard(policy, isForDragging)
, m_dataObject(dataObject)
+ , m_frame(frame)
{
}
PassRefPtr<ClipboardChromium> ClipboardChromium::create(bool isForDragging,
- PassRefPtr<ChromiumDataObject> dataObject, ClipboardAccessPolicy policy)
+ PassRefPtr<ChromiumDataObject> dataObject, ClipboardAccessPolicy policy, Frame* frame)
{
- return adoptRef(new ClipboardChromium(isForDragging, dataObject, policy));
+ return adoptRef(new ClipboardChromium(isForDragging, dataObject, policy, frame));
}
void ClipboardChromium::clearData(const String& type)
@@ -355,9 +364,10 @@ PassRefPtr<FileList> ClipboardChromium::files() const
if (!m_dataObject || m_dataObject->filenames.isEmpty())
return FileList::create();
+ ScriptExecutionContext* scriptExecutionContext = m_frame->document()->scriptExecutionContext();
RefPtr<FileList> fileList = FileList::create();
for (size_t i = 0; i < m_dataObject->filenames.size(); ++i)
- fileList->append(File::create(m_dataObject->filenames.at(i)));
+ fileList->append(File::create(scriptExecutionContext, m_dataObject->filenames.at(i)));
return fileList.release();
}
diff --git a/WebCore/platform/chromium/ClipboardChromium.h b/WebCore/platform/chromium/ClipboardChromium.h
index fbebde2..a4150d0 100644
--- a/WebCore/platform/chromium/ClipboardChromium.h
+++ b/WebCore/platform/chromium/ClipboardChromium.h
@@ -38,6 +38,7 @@ namespace WebCore {
class CachedImage;
class ChromiumDataObject;
+ class Frame;
class IntPoint;
class ClipboardChromium : public Clipboard, public CachedResourceClient {
@@ -45,7 +46,7 @@ namespace WebCore {
~ClipboardChromium() {}
static PassRefPtr<ClipboardChromium> create(
- bool isForDragging, PassRefPtr<ChromiumDataObject>, ClipboardAccessPolicy);
+ bool isForDragging, PassRefPtr<ChromiumDataObject>, ClipboardAccessPolicy, Frame*);
// Returns the file name (not including the extension). This removes any
// invalid file system characters as well as making sure the
@@ -79,11 +80,12 @@ namespace WebCore {
virtual bool hasData();
private:
- ClipboardChromium(bool, PassRefPtr<ChromiumDataObject>, ClipboardAccessPolicy);
+ ClipboardChromium(bool, PassRefPtr<ChromiumDataObject>, ClipboardAccessPolicy, Frame*);
void resetFromClipboard();
void setDragImage(CachedImage*, Node*, const IntPoint&);
RefPtr<ChromiumDataObject> m_dataObject;
+ Frame* m_frame;
};
} // namespace WebCore
diff --git a/WebCore/platform/chromium/DragDataChromium.cpp b/WebCore/platform/chromium/DragDataChromium.cpp
index 2c2151a..674d34d 100644
--- a/WebCore/platform/chromium/DragDataChromium.cpp
+++ b/WebCore/platform/chromium/DragDataChromium.cpp
@@ -32,8 +32,6 @@
#include "ChromiumBridge.h"
#include "ChromiumDataObject.h"
-#include "Clipboard.h"
-#include "ClipboardChromium.h"
#include "DocumentFragment.h"
#include "FileSystem.h"
#include "KURL.h"
@@ -48,14 +46,6 @@ static bool containsHTML(const ChromiumDataObject* dropData)
return dropData->textHtml.length() > 0;
}
-PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const
-{
- RefPtr<ClipboardChromium> clipboard = ClipboardChromium::create(true,
- m_platformDragData, policy);
-
- return clipboard.release();
-}
-
bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const
{
return !asURL(filenamePolicy).isEmpty();
diff --git a/WebCore/platform/chromium/PlatformThemeChromiumGtk.cpp b/WebCore/platform/chromium/PlatformThemeChromiumGtk.cpp
index 1f74840..6529482 100644
--- a/WebCore/platform/chromium/PlatformThemeChromiumGtk.cpp
+++ b/WebCore/platform/chromium/PlatformThemeChromiumGtk.cpp
@@ -180,8 +180,8 @@ void PlatformThemeChromiumGtk::paintArrowButton(GraphicsContext* gc, const IntRe
paint.setColor(outlineColor(trackHSV, thumbHSV));
canvas->drawPath(outline, paint);
- // If the button is disabled, the arrow is drawn with the outline color.
- if (states & EnabledState)
+ // If the button is disabled or read-only, the arrow is drawn with the outline color.
+ if (states & EnabledState && !(states & ReadOnlyState))
paint.setColor(SK_ColorBLACK);
paint.setAntiAlias(false);
diff --git a/WebCore/platform/chromium/PopupMenuChromium.cpp b/WebCore/platform/chromium/PopupMenuChromium.cpp
index 4701a75..d07ba2e 100644
--- a/WebCore/platform/chromium/PopupMenuChromium.cpp
+++ b/WebCore/platform/chromium/PopupMenuChromium.cpp
@@ -71,6 +71,7 @@ static const int kMaxVisibleRows = 20;
static const int kMaxHeight = 500;
static const int kBorderSize = 1;
static const int kTextToLabelPadding = 10;
+static const int kLabelToIconPadding = 5;
static const TimeStamp kTypeAheadTimeoutMs = 1000;
// The settings used for the drop down menu.
@@ -959,18 +960,30 @@ void PopupListBox::paintRow(GraphicsContext* gc, const IntRect& rect, int rowInd
int textY = rowRect.y() + itemFont.ascent() + (rowRect.height() - itemFont.height()) / 2;
gc->drawBidiText(itemFont, textRun, IntPoint(textX, textY));
+ // We are using the left padding as the right padding includes room for the scroll-bar which
+ // does not show in this case.
+ int rightPadding = max(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft());
+ int remainingWidth = rowRect.width() - rightPadding;
+
+ // Draw the icon if applicable.
+ String itemIcon = m_popupClient->itemIcon(rowIndex);
+ RefPtr<Image> image(Image::loadPlatformResource(itemIcon.utf8().data()));
+ if (image && !image->isNull()) {
+ IntRect imageRect = image->rect();
+ remainingWidth -= (imageRect.width() + kLabelToIconPadding);
+ imageRect.setX(rowRect.width() - rightPadding - imageRect.width());
+ imageRect.setY(rowRect.y() + (rowRect.height() - imageRect.height()) / 2);
+ gc->drawImage(image.get(), DeviceColorSpace, imageRect);
+ }
+
// Draw the the label if applicable.
if (itemLabel.isEmpty())
return;
TextRun labelTextRun(itemLabel.characters(), itemLabel.length(), false, 0, 0, rtl);
if (rightAligned)
textX = max(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft());
- else {
- // We are using the left padding as the right padding includes room for the scroll-bar which
- // does not show in this case.
- int rightPadding = max(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft());
- textX = rowRect.width() - rightPadding - itemFont.width(labelTextRun);
- }
+ else
+ textX = remainingWidth - itemFont.width(labelTextRun);
gc->setFillColor(labelColor, DeviceColorSpace);
gc->drawBidiText(itemFont, labelTextRun, IntPoint(textX, textY));
@@ -1243,10 +1256,16 @@ void PopupListBox::layout()
// Ensure the popup is wide enough to fit this item.
String text = m_popupClient->itemText(i);
- if (!text.isEmpty()) {
- int width = itemFont.width(TextRun(text));
- baseWidth = max(baseWidth, width);
+ String label = m_popupClient->itemLabel(i);
+ int width = 0;
+ if (!text.isEmpty())
+ width = itemFont.width(TextRun(text));
+ if (!label.isEmpty()) {
+ if (width > 0)
+ width += kTextToLabelPadding;
+ width += itemFont.width(TextRun(label));
}
+ baseWidth = max(baseWidth, width);
// FIXME: http://b/1210481 We should get the padding of individual option elements.
paddingWidth = max(paddingWidth,
m_popupClient->clientPaddingLeft() + m_popupClient->clientPaddingRight());
diff --git a/WebCore/platform/efl/ClipboardEfl.cpp b/WebCore/platform/efl/ClipboardEfl.cpp
index 6ef51cf..1633ccb 100644
--- a/WebCore/platform/efl/ClipboardEfl.cpp
+++ b/WebCore/platform/efl/ClipboardEfl.cpp
@@ -27,11 +27,16 @@
#include "StringHash.h"
namespace WebCore {
-PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy)
+PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
{
return new ClipboardEfl(policy, false);
}
+PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy, DragData*, Frame*)
+{
+ return 0;
+}
+
ClipboardEfl::ClipboardEfl(ClipboardAccessPolicy policy, bool forDragging)
: Clipboard(policy, forDragging)
{
diff --git a/WebCore/platform/efl/DragDataEfl.cpp b/WebCore/platform/efl/DragDataEfl.cpp
index f6b446c..a8458d6 100644
--- a/WebCore/platform/efl/DragDataEfl.cpp
+++ b/WebCore/platform/efl/DragDataEfl.cpp
@@ -21,7 +21,6 @@
#include "config.h"
#include "DragData.h"
-#include "Clipboard.h"
#include "Document.h"
#include "DocumentFragment.h"
@@ -61,11 +60,6 @@ Color DragData::asColor() const
return Color();
}
-PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy) const
-{
- return 0;
-}
-
bool DragData::containsCompatibleContent() const
{
return false;
diff --git a/WebCore/platform/efl/FileSystemEfl.cpp b/WebCore/platform/efl/FileSystemEfl.cpp
index 31b2e22..cb117bc 100644
--- a/WebCore/platform/efl/FileSystemEfl.cpp
+++ b/WebCore/platform/efl/FileSystemEfl.cpp
@@ -42,7 +42,9 @@
#include <dlfcn.h>
#include <errno.h>
#include <fnmatch.h>
+#if ENABLE(GLIB_SUPPORT)
#include <glib.h> // TODO: remove me after following TODO is solved.
+#endif
#include <limits.h>
#include <stdio.h>
#include <sys/stat.h>
@@ -55,13 +57,13 @@ CString fileSystemRepresentation(const String& path)
{
// WARNING: this is just used by platform/network/soup, thus must be GLIB!!!
// TODO: move this to CString and use it instead in both, being more standard
-#if PLATFORM(WIN_OS)
- return path.utf8();
-#else
+#if !PLATFORM(WIN_OS) && defined(WTF_USE_SOUP)
char* filename = g_uri_unescape_string(path.utf8().data(), 0);
CString cfilename(filename);
g_free(filename);
return cfilename;
+#else
+ return path.utf8();
#endif
}
diff --git a/WebCore/platform/efl/LoggingEfl.cpp b/WebCore/platform/efl/LoggingEfl.cpp
index 1829c80..55de765 100644
--- a/WebCore/platform/efl/LoggingEfl.cpp
+++ b/WebCore/platform/efl/LoggingEfl.cpp
@@ -23,10 +23,41 @@
#include "config.h"
#include "Logging.h"
+#include "PlatformString.h"
+#include <Eina.h>
+
namespace WebCore {
void InitializeLoggingChannelsIfNecessary()
{
+ static bool didInitializeLoggingChannels = false;
+ if (didInitializeLoggingChannels)
+ return;
+
+ didInitializeLoggingChannels = true;
+
+ char* logEnv = getenv("WEBKIT_DEBUG");
+ if (!logEnv)
+ return;
+
+#if defined(NDEBUG)
+ EINA_LOG_WARN("WEBKIT_DEBUG is not empty, but this is a release build. Notice that many log messages will only appear in a debug build.");
+#endif
+
+ char** logv = eina_str_split(logEnv, ",", -1);
+
+ EINA_SAFETY_ON_NULL_RETURN(logv);
+
+ for (int i = 0; logv[i]; i++) {
+ if (WTFLogChannel* channel = getChannelFromName(logv[i]))
+ channel->state = WTFLogChannelOn;
+ }
+
+ free(*logv);
+ free(logv);
+
+ // To disable logging notImplemented set the DISABLE_NI_WARNING
+ // environment variable to 1.
LogNotYetImplemented.state = WTFLogChannelOn;
}
diff --git a/WebCore/platform/efl/WidgetEfl.cpp b/WebCore/platform/efl/WidgetEfl.cpp
index 6dbf2c2..d82e99e 100644
--- a/WebCore/platform/efl/WidgetEfl.cpp
+++ b/WebCore/platform/efl/WidgetEfl.cpp
@@ -222,8 +222,8 @@ void Widget::applyFallbackCursor()
return;
}
#endif
- LOG("Ooops, no fallback to set cursor %s!\n",
- m_data->m_cursorGroup.utf8().data());
+ LOG_ERROR("Ooops, no fallback to set cursor %s!\n",
+ m_data->m_cursorGroup.utf8().data());
}
void Widget::applyCursor()
diff --git a/WebCore/platform/graphics/BitmapImage.h b/WebCore/platform/graphics/BitmapImage.h
index 2cf30d3..72f3092 100644
--- a/WebCore/platform/graphics/BitmapImage.h
+++ b/WebCore/platform/graphics/BitmapImage.h
@@ -175,7 +175,7 @@ protected:
virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator);
#if (OS(WINCE) && !PLATFORM(QT))
- virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const TransformationMatrix& patternTransform,
+ virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect);
#endif
diff --git a/WebCore/platform/graphics/Font.cpp b/WebCore/platform/graphics/Font.cpp
index 61f5707..0e93d4f 100644
--- a/WebCore/platform/graphics/Font.cpp
+++ b/WebCore/platform/graphics/Font.cpp
@@ -68,7 +68,7 @@ Font::Font(const FontDescription& fd, short letterSpacing, short wordSpacing)
, m_letterSpacing(letterSpacing)
, m_wordSpacing(wordSpacing)
, m_isPlatformFont(false)
- , m_needsTranscoding(fontTranscoder().needsTranscoding(family().family().string()))
+ , m_needsTranscoding(fontTranscoder().needsTranscoding(fd))
{
}
@@ -77,10 +77,10 @@ Font::Font(const FontPlatformData& fontData, bool isPrinterFont, FontSmoothingMo
, m_letterSpacing(0)
, m_wordSpacing(0)
, m_isPlatformFont(true)
- , m_needsTranscoding(fontTranscoder().needsTranscoding(family().family().string()))
{
m_fontDescription.setUsePrinterFont(isPrinterFont);
m_fontDescription.setFontSmoothing(fontSmoothingMode);
+ m_needsTranscoding = fontTranscoder().needsTranscoding(fontDescription());
m_fontList->setPlatformFont(fontData);
}
@@ -90,7 +90,7 @@ Font::Font(const Font& other)
, m_letterSpacing(other.m_letterSpacing)
, m_wordSpacing(other.m_wordSpacing)
, m_isPlatformFont(other.m_isPlatformFont)
- , m_needsTranscoding(fontTranscoder().needsTranscoding(family().family().string()))
+ , m_needsTranscoding(fontTranscoder().needsTranscoding(other.m_fontDescription))
{
}
diff --git a/WebCore/platform/graphics/FontDescription.h b/WebCore/platform/graphics/FontDescription.h
index fc63db9..86a4349 100644
--- a/WebCore/platform/graphics/FontDescription.h
+++ b/WebCore/platform/graphics/FontDescription.h
@@ -65,6 +65,7 @@ public:
, m_keywordSize(0)
, m_fontSmoothing(AutoSmoothing)
, m_textRendering(AutoTextRendering)
+ , m_isSpecifiedFont(false)
{
}
@@ -92,6 +93,7 @@ public:
TextRenderingMode textRenderingMode() const { return static_cast<TextRenderingMode>(m_textRendering); }
FontTraitsMask traitsMask() const;
+ bool isSpecifiedFont() const { return m_isSpecifiedFont; }
void setFamily(const FontFamily& family) { m_familyList = family; }
void setComputedSize(float s) { m_computedSize = s; }
@@ -106,6 +108,7 @@ public:
void setKeywordSize(unsigned s) { m_keywordSize = s; }
void setFontSmoothing(FontSmoothingMode smoothing) { m_fontSmoothing = smoothing; }
void setTextRenderingMode(TextRenderingMode rendering) { m_textRendering = rendering; }
+ void setIsSpecifiedFont(bool isSpecifiedFont) { m_isSpecifiedFont = isSpecifiedFont; }
private:
FontFamily m_familyList; // The list of font families to be used.
@@ -130,6 +133,7 @@ private:
unsigned m_fontSmoothing : 2; // FontSmoothingMode
unsigned m_textRendering : 2; // TextRenderingMode
+ bool m_isSpecifiedFont : 1; // True if a web page specifies a non-generic font family as the first font family.
};
inline bool FontDescription::operator==(const FontDescription& other) const
@@ -146,7 +150,8 @@ inline bool FontDescription::operator==(const FontDescription& other) const
&& m_renderingMode == other.m_renderingMode
&& m_keywordSize == other.m_keywordSize
&& m_fontSmoothing == other.m_fontSmoothing
- && m_textRendering == other.m_textRendering;
+ && m_textRendering == other.m_textRendering
+ && m_isSpecifiedFont == other.m_isSpecifiedFont;
}
}
diff --git a/WebCore/platform/graphics/GraphicsContext.h b/WebCore/platform/graphics/GraphicsContext.h
index 457368b..d5df153 100644
--- a/WebCore/platform/graphics/GraphicsContext.h
+++ b/WebCore/platform/graphics/GraphicsContext.h
@@ -274,7 +274,7 @@ namespace WebCore {
void clipOutRoundedRect(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight);
void clipPath(WindRule);
void clipToImageBuffer(const FloatRect&, const ImageBuffer*);
- void clipConvexPolygon(size_t numPoints, const FloatPoint*);
+ void clipConvexPolygon(size_t numPoints, const FloatPoint*, bool antialias = true);
int textDrawingMode();
void setTextDrawingMode(int);
@@ -342,16 +342,16 @@ namespace WebCore {
#if OS(WINCE) && !PLATFORM(QT)
void setBitmap(PassRefPtr<SharedBitmap>);
- const TransformationMatrix& affineTransform() const;
- TransformationMatrix& affineTransform();
+ const AffineTransform& affineTransform() const;
+ AffineTransform& affineTransform();
void resetAffineTransform();
void fillRect(const FloatRect&, const Gradient*);
void drawText(const SimpleFontData* fontData, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& point);
void drawFrameControl(const IntRect& rect, unsigned type, unsigned state);
void drawFocusRect(const IntRect& rect);
void paintTextField(const IntRect& rect, unsigned state);
- void drawBitmap(SharedBitmap*, const IntRect& dstRect, const IntRect& srcRect, CompositeOperator compositeOp);
- void drawBitmapPattern(SharedBitmap*, const FloatRect& tileRectIn, const AffineTransform& patternTransform, const FloatPoint& phase, CompositeOperator op, const FloatRect& destRect, const IntSize& origSourceSize);
+ void drawBitmap(SharedBitmap*, const IntRect& dstRect, const IntRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp);
+ void drawBitmapPattern(SharedBitmap*, const FloatRect& tileRectIn, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, const IntSize& origSourceSize);
void drawIcon(HICON icon, const IntRect& dstRect, UINT flags);
HDC getWindowsContext(const IntRect&, bool supportAlphaBlend = false, bool mayCreateBitmap = true); // The passed in rect is used to create a bitmap for compositing inside transparency layers.
void releaseWindowsContext(HDC, const IntRect&, bool supportAlphaBlend = false, bool mayCreateBitmap = true); // The passed in HDC should be the one handed back by getWindowsContext.
diff --git a/WebCore/platform/graphics/Path.h b/WebCore/platform/graphics/Path.h
index f2ae2df..86b77f8 100644
--- a/WebCore/platform/graphics/Path.h
+++ b/WebCore/platform/graphics/Path.h
@@ -59,6 +59,7 @@ typedef BRegion PlatformPath;
namespace WebCore {
class PlatformPath;
}
+typedef WebCore::PlatformPath PlatformPath;
#else
typedef void PlatformPath;
#endif
diff --git a/WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp b/WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp
index 974c195..1f94f5a 100644
--- a/WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp
+++ b/WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp
@@ -32,7 +32,9 @@
#include <cairo-ft.h>
#include <cairo.h>
#include <fontconfig/fcfreetype.h>
+#if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT)
#include <gdk/gdk.h>
+#endif
namespace WebCore {
@@ -109,8 +111,10 @@ FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const
cairo_matrix_init_scale(&fontMatrix, fontDescription.computedPixelSize(), fontDescription.computedPixelSize());
cairo_matrix_init_identity(&ctm);
+#if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT)
if (GdkScreen* screen = gdk_screen_get_default())
options = gdk_screen_get_font_options(screen);
+#endif
// gdk_screen_get_font_options() returns NULL if no default options are
// set, so we always have to check.
@@ -149,8 +153,10 @@ FontPlatformData::FontPlatformData(cairo_font_face_t* fontFace, float size, bool
static const cairo_font_options_t* defaultOptions = cairo_font_options_create();
const cairo_font_options_t* options = NULL;
+#if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT)
if (GdkScreen* screen = gdk_screen_get_default())
options = gdk_screen_get_font_options(screen);
+#endif
// gdk_screen_get_font_options() returns NULL if no default options are
// set, so we always have to check.
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
index 6ed8905..96cd4ee 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
@@ -504,7 +504,7 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points
cairo_restore(cr);
}
-void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points)
+void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points, bool antialiased)
{
if (paintingDisabled())
return;
diff --git a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
index a65874c..2de4d14 100644
--- a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
+++ b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
@@ -469,16 +469,24 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points
CGContextSetShouldAntialias(context, shouldAntialias());
}
-void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points)
+void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points, bool antialias)
{
if (paintingDisabled())
return;
if (numPoints <= 1)
return;
+
+ CGContextRef context = platformContext();
+
+ if (antialias != shouldAntialias())
+ CGContextSetShouldAntialias(context, antialias);
- addConvexPolygonToContext(platformContext(), numPoints, points);
+ addConvexPolygonToContext(context, numPoints, points);
clipPath(RULE_NONZERO);
+
+ if (antialias != shouldAntialias())
+ CGContextSetShouldAntialias(context, shouldAntialias());
}
void GraphicsContext::applyStrokePattern()
diff --git a/WebCore/platform/graphics/cg/ImageBufferCG.cpp b/WebCore/platform/graphics/cg/ImageBufferCG.cpp
index fe7f83a..feb8cec 100644
--- a/WebCore/platform/graphics/cg/ImageBufferCG.cpp
+++ b/WebCore/platform/graphics/cg/ImageBufferCG.cpp
@@ -80,7 +80,7 @@ ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace imageColorSpace, b
case GrayScale:
colorSpace.adoptCF(CGColorSpaceCreateDeviceGray());
break;
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER)
+#if ((PLATFORM(MAC) || PLATFORM(CHROMIUM)) && !defined(BUILDING_ON_TIGER))
case LinearRGB:
colorSpace.adoptCF(CGColorSpaceCreateWithName(kCGColorSpaceGenericRGBLinear));
break;
diff --git a/WebCore/platform/graphics/chromium/GLES2Canvas.cpp b/WebCore/platform/graphics/chromium/GLES2Canvas.cpp
new file mode 100644
index 0000000..ec188c8
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/GLES2Canvas.cpp
@@ -0,0 +1,523 @@
+/*
+ * Copyright (c) 2010, 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"
+
+#if USE(GLES2_RENDERING)
+
+#include "GLES2Canvas.h"
+
+#include "FloatRect.h"
+#include "GLES2Context.h"
+#include "GLES2Texture.h"
+
+#include <GLES2/gl2.h>
+
+#define _USE_MATH_DEFINES
+#include <math.h>
+
+#include <wtf/OwnArrayPtr.h>
+
+namespace WebCore {
+
+static inline void affineTo3x3(const AffineTransform& transform, GLfloat mat[9])
+{
+ mat[0] = transform.a();
+ mat[1] = transform.b();
+ mat[2] = 0.0f;
+ mat[3] = transform.c();
+ mat[4] = transform.d();
+ mat[5] = 0.0f;
+ mat[6] = transform.e();
+ mat[7] = transform.f();
+ mat[8] = 1.0f;
+}
+
+struct GLES2Canvas::State {
+ State()
+ : m_fillColor(0, 0, 0, 255)
+ , m_alpha(1.0f)
+ , m_compositeOp(CompositeSourceOver)
+ {
+ }
+ Color m_fillColor;
+ float m_alpha;
+ CompositeOperator m_compositeOp;
+ AffineTransform m_ctm;
+};
+
+GLES2Canvas::GLES2Canvas(GLES2Context* context, const IntSize& size)
+ : m_gles2Context(context)
+ , m_quadVertices(0)
+ , m_quadIndices(0)
+ , m_simpleProgram(0)
+ , m_texProgram(0)
+ , m_simpleMatrixLocation(-1)
+ , m_simpleColorLocation(-1)
+ , m_simplePositionLocation(-1)
+ , m_texMatrixLocation(-1)
+ , m_texTexMatrixLocation(-1)
+ , m_texSamplerLocation(-1)
+ , m_texAlphaLocation(-1)
+ , m_texPositionLocation(-1)
+ , m_state(0)
+{
+ m_flipMatrix.translate(-1.0f, 1.0f);
+ m_flipMatrix.scale(2.0f / size.width(), -2.0f / size.height());
+
+ m_gles2Context->makeCurrent();
+ m_gles2Context->resizeOffscreenContent(size);
+ m_gles2Context->swapBuffers();
+ glViewport(0, 0, size.width(), size.height());
+
+ m_stateStack.append(State());
+ m_state = &m_stateStack.last();
+}
+
+GLES2Canvas::~GLES2Canvas()
+{
+ m_gles2Context->makeCurrent();
+ if (m_simpleProgram)
+ glDeleteProgram(m_simpleProgram);
+ if (m_texProgram)
+ glDeleteProgram(m_texProgram);
+ if (m_quadVertices)
+ glDeleteBuffers(1, &m_quadVertices);
+ if (m_quadIndices)
+ glDeleteBuffers(1, &m_quadVertices);
+}
+
+void GLES2Canvas::clearRect(const FloatRect& rect)
+{
+ m_gles2Context->makeCurrent();
+
+ glScissor(rect.x(), rect.y(), rect.width(), rect.height());
+ glEnable(GL_SCISSOR_TEST);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glDisable(GL_SCISSOR_TEST);
+}
+
+void GLES2Canvas::fillRect(const FloatRect& rect, const Color& color, ColorSpace colorSpace)
+{
+ m_gles2Context->makeCurrent();
+
+ glBindBuffer(GL_ARRAY_BUFFER, getQuadVertices());
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, getQuadIndices());
+
+ float rgba[4];
+ color.getRGBA(rgba[0], rgba[1], rgba[2], rgba[3]);
+ glUniform4f(m_simpleColorLocation, rgba[0] * rgba[3], rgba[1] * rgba[3], rgba[2] * rgba[3], rgba[3]);
+
+ glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);
+}
+
+void GLES2Canvas::fillRect(const FloatRect& rect)
+{
+ m_gles2Context->makeCurrent();
+
+ applyCompositeOperator(m_state->m_compositeOp);
+
+ glBindBuffer(GL_ARRAY_BUFFER, getQuadVertices());
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, getQuadIndices());
+
+ glUseProgram(getSimpleProgram());
+
+ float rgba[4];
+ m_state->m_fillColor.getRGBA(rgba[0], rgba[1], rgba[2], rgba[3]);
+ glUniform4f(m_simpleColorLocation, rgba[0] * rgba[3], rgba[1] * rgba[3], rgba[2] * rgba[3], rgba[3]);
+
+ AffineTransform matrix(m_flipMatrix);
+ matrix.multLeft(m_state->m_ctm);
+ matrix.translate(rect.x(), rect.y());
+ matrix.scale(rect.width(), rect.height());
+ GLfloat mat[9];
+ affineTo3x3(matrix, mat);
+ glUniformMatrix3fv(m_simpleMatrixLocation, 1, GL_FALSE, mat);
+
+ glVertexAttribPointer(m_simplePositionLocation, 3, GL_FLOAT, GL_FALSE, 0, (GLvoid*)(0));
+
+ glEnableVertexAttribArray(m_simplePositionLocation);
+
+ glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);
+}
+
+void GLES2Canvas::setFillColor(const Color& color, ColorSpace colorSpace)
+{
+ m_state->m_fillColor = color;
+}
+
+void GLES2Canvas::setAlpha(float alpha)
+{
+ m_state->m_alpha = alpha;
+}
+
+void GLES2Canvas::translate(float x, float y)
+{
+ m_state->m_ctm.translate(x, y);
+}
+
+void GLES2Canvas::rotate(float angleInRadians)
+{
+ m_state->m_ctm.rotate(angleInRadians * (180.0f / M_PI));
+}
+
+void GLES2Canvas::scale(const FloatSize& size)
+{
+ m_state->m_ctm.scale(size.width(), size.height());
+}
+
+void GLES2Canvas::concatCTM(const AffineTransform& affine)
+{
+ m_state->m_ctm.multLeft(affine);
+}
+
+void GLES2Canvas::save()
+{
+ m_stateStack.append(State(m_stateStack.last()));
+ m_state = &m_stateStack.last();
+}
+
+void GLES2Canvas::restore()
+{
+ ASSERT(!m_stateStack.isEmpty());
+ m_stateStack.removeLast();
+ m_state = &m_stateStack.last();
+}
+
+void GLES2Canvas::drawTexturedRect(GLES2Texture* texture, const FloatRect& srcRect, const FloatRect& dstRect, ColorSpace colorSpace, CompositeOperator compositeOp)
+{
+ drawTexturedRect(texture, srcRect, dstRect, m_state->m_ctm, m_state->m_alpha, colorSpace, compositeOp);
+}
+
+void GLES2Canvas::drawTexturedRect(GLES2Texture* texture, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform& transform, float alpha, ColorSpace colorSpace, CompositeOperator compositeOp)
+{
+ m_gles2Context->makeCurrent();
+
+ applyCompositeOperator(compositeOp);
+
+ glBindBuffer(GL_ARRAY_BUFFER, getQuadVertices());
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, getQuadIndices());
+ checkGLError("glBindBuffer");
+
+ glUseProgram(getTexProgram());
+ checkGLError("glUseProgram");
+
+ glActiveTexture(GL_TEXTURE0);
+ texture->bind();
+
+ glUniform1i(m_texSamplerLocation, 0);
+ checkGLError("glUniform1i");
+
+ glUniform1f(m_texAlphaLocation, alpha);
+ checkGLError("glUniform1f for alpha");
+
+ AffineTransform matrix(m_flipMatrix);
+ matrix.multLeft(transform);
+ matrix.translate(dstRect.x(), dstRect.y());
+ matrix.scale(dstRect.width(), dstRect.height());
+ GLfloat mat[9];
+ affineTo3x3(matrix, mat);
+ glUniformMatrix3fv(m_texMatrixLocation, 1, GL_FALSE, mat);
+ checkGLError("glUniformMatrix3fv");
+
+ AffineTransform texMatrix;
+ texMatrix.scale(1.0f / texture->width(), 1.0f / texture->height());
+ texMatrix.translate(srcRect.x(), srcRect.y());
+ texMatrix.scale(srcRect.width(), srcRect.height());
+ GLfloat texMat[9];
+ affineTo3x3(texMatrix, texMat);
+ glUniformMatrix3fv(m_texTexMatrixLocation, 1, GL_FALSE, texMat);
+ checkGLError("glUniformMatrix3fv");
+
+ glVertexAttribPointer(m_texPositionLocation, 3, GL_FLOAT, GL_FALSE, 0, (GLvoid*)(0));
+
+ glEnableVertexAttribArray(m_texPositionLocation);
+
+ glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);
+ checkGLError("glDrawElements");
+}
+
+void GLES2Canvas::setCompositeOperation(CompositeOperator op)
+{
+ m_state->m_compositeOp = op;
+}
+
+void GLES2Canvas::applyCompositeOperator(CompositeOperator op)
+{
+ if (op == m_lastCompositeOp)
+ return;
+
+ switch (op) {
+ case CompositeClear:
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_ZERO, GL_ZERO);
+ break;
+ case CompositeCopy:
+ glDisable(GL_BLEND);
+ break;
+ case CompositeSourceOver:
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ break;
+ case CompositeSourceIn:
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_DST_ALPHA, GL_ZERO);
+ break;
+ case CompositeSourceOut:
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_ZERO);
+ break;
+ case CompositeSourceAtop:
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ break;
+ case CompositeDestinationOver:
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_ONE);
+ break;
+ case CompositeDestinationIn:
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_ZERO, GL_SRC_ALPHA);
+ break;
+ case CompositeDestinationOut:
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);
+ break;
+ case CompositeDestinationAtop:
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_SRC_ALPHA);
+ break;
+ case CompositeXOR:
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ break;
+ case CompositePlusDarker:
+ case CompositeHighlight:
+ // unsupported
+ glDisable(GL_BLEND);
+ break;
+ case CompositePlusLighter:
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_ONE, GL_ONE);
+ break;
+ }
+ m_lastCompositeOp = op;
+}
+
+unsigned GLES2Canvas::getQuadVertices()
+{
+ if (!m_quadVertices) {
+ GLfloat vertices[] = { 0.0f, 0.0f, 1.0f,
+ 1.0f, 0.0f, 1.0f,
+ 1.0f, 1.0f, 1.0f,
+ 0.0f, 1.0f, 1.0f };
+ glGenBuffers(1, &m_quadVertices);
+ glBindBuffer(GL_ARRAY_BUFFER, m_quadVertices);
+ glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
+ }
+ return m_quadVertices;
+}
+
+
+unsigned GLES2Canvas::getQuadIndices()
+{
+ if (!m_quadIndices) {
+ GLushort indices[] = { 0, 1, 2, 0, 2, 3};
+
+ glGenBuffers(1, &m_quadIndices);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_quadIndices);
+ glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GL_STATIC_DRAW);
+ }
+ return m_quadIndices;
+}
+
+static GLuint loadShader(GLenum type, const char* shaderSource)
+{
+ GLuint shader = glCreateShader(type);
+ if (!shader)
+ return 0;
+
+ glShaderSource(shader, 1, &shaderSource, 0);
+ glCompileShader(shader);
+ GLint compileStatus;
+ glGetShaderiv(shader, GL_COMPILE_STATUS, &compileStatus);
+ if (!compileStatus) {
+ int length;
+ glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length);
+ OwnArrayPtr<char> log(new char[length]);
+ glGetShaderInfoLog(shader, length, 0, log.get());
+ LOG_ERROR(log.get());
+ glDeleteShader(shader);
+ return 0;
+ }
+ return shader;
+}
+
+unsigned GLES2Canvas::getSimpleProgram()
+{
+ if (!m_simpleProgram) {
+ GLuint vertexShader = loadShader(GL_VERTEX_SHADER,
+ "uniform mat3 matrix;\n"
+ "uniform vec4 color;\n"
+ "attribute vec3 position;\n"
+ "void main() {\n"
+ " gl_Position = vec4(matrix * position, 1.0);\n"
+ "}\n");
+ if (!vertexShader)
+ return 0;
+ GLuint fragmentShader = loadShader(GL_FRAGMENT_SHADER,
+ "precision mediump float;\n"
+ "uniform mat3 matrix;\n"
+ "uniform vec4 color;\n"
+ "void main() {\n"
+ " gl_FragColor = color;\n"
+ "}\n");
+ if (!fragmentShader)
+ return 0;
+ m_simpleProgram = glCreateProgram();
+ if (!m_simpleProgram)
+ return 0;
+ glAttachShader(m_simpleProgram, vertexShader);
+ glAttachShader(m_simpleProgram, fragmentShader);
+ glLinkProgram(m_simpleProgram);
+ GLint linkStatus;
+ glGetProgramiv(m_simpleProgram, GL_LINK_STATUS, &linkStatus);
+ if (!linkStatus) {
+ glDeleteProgram(m_simpleProgram);
+ m_simpleProgram = 0;
+ }
+ glDeleteShader(vertexShader);
+ glDeleteShader(fragmentShader);
+ m_simplePositionLocation = glGetAttribLocation(m_simpleProgram, "position");
+ m_simpleMatrixLocation = glGetUniformLocation(m_simpleProgram, "matrix");
+ m_simpleColorLocation = glGetUniformLocation(m_simpleProgram, "color");
+ }
+ return m_simpleProgram;
+}
+
+unsigned GLES2Canvas::getTexProgram()
+{
+ if (!m_texProgram) {
+ GLuint vertexShader = loadShader(GL_VERTEX_SHADER,
+ "uniform mat3 matrix;\n"
+ "uniform mat3 texMatrix;\n"
+ "attribute vec3 position;\n"
+ "varying vec3 texCoord;\n"
+ "void main() {\n"
+ " texCoord = texMatrix * position;\n"
+ " gl_Position = vec4(matrix * position, 1.0);\n"
+ "}\n");
+ if (!vertexShader)
+ return 0;
+ GLuint fragmentShader = loadShader(GL_FRAGMENT_SHADER,
+ "precision mediump float;\n"
+ "uniform sampler2D sampler;\n"
+ "uniform float alpha;\n"
+ "varying vec3 texCoord;\n"
+ "void main() {\n"
+ " gl_FragColor = texture2D(sampler, texCoord.xy)* vec4(alpha);\n"
+ "}\n");
+ if (!fragmentShader)
+ return 0;
+ m_texProgram = glCreateProgram();
+ if (!m_texProgram)
+ return 0;
+ glAttachShader(m_texProgram, vertexShader);
+ glAttachShader(m_texProgram, fragmentShader);
+ glLinkProgram(m_texProgram);
+ GLint linkStatus;
+ glGetProgramiv(m_texProgram, GL_LINK_STATUS, &linkStatus);
+ if (!linkStatus) {
+ glDeleteProgram(m_texProgram);
+ m_texProgram = 0;
+ }
+ glDeleteShader(vertexShader);
+ glDeleteShader(fragmentShader);
+ m_texMatrixLocation = glGetUniformLocation(m_texProgram, "matrix");
+ m_texSamplerLocation = glGetUniformLocation(m_texProgram, "sampler");
+ m_texTexMatrixLocation = glGetUniformLocation(m_texProgram, "texMatrix");
+ m_texPositionLocation = glGetAttribLocation(m_texProgram, "position");
+ m_texAlphaLocation = glGetUniformLocation(m_texProgram, "alpha");
+ }
+ return m_texProgram;
+}
+
+GLES2Texture* GLES2Canvas::createTexture(NativeImagePtr ptr, GLES2Texture::Format format, int width, int height)
+{
+ PassRefPtr<GLES2Texture> texture = m_textures.get(ptr);
+ if (texture)
+ return texture.get();
+
+ texture = GLES2Texture::create(format, width, height);
+ GLES2Texture* t = texture.get();
+ m_textures.set(ptr, texture);
+ return t;
+}
+
+GLES2Texture* GLES2Canvas::getTexture(NativeImagePtr ptr)
+{
+ PassRefPtr<GLES2Texture> texture = m_textures.get(ptr);
+ return texture ? texture.get() : 0;
+}
+
+void GLES2Canvas::checkGLError(const char* header)
+{
+#ifndef NDEBUG
+ GLenum err;
+ while ((err = glGetError()) != GL_NO_ERROR) {
+ const char* errorStr = "*** UNKNOWN ERROR ***";
+ switch (err) {
+ case GL_INVALID_ENUM:
+ errorStr = "GL_INVALID_ENUM";
+ break;
+ case GL_INVALID_VALUE:
+ errorStr = "GL_INVALID_VALUE";
+ break;
+ case GL_INVALID_OPERATION:
+ errorStr = "GL_INVALID_OPERATION";
+ break;
+ case GL_INVALID_FRAMEBUFFER_OPERATION:
+ errorStr = "GL_INVALID_FRAMEBUFFER_OPERATION";
+ break;
+ case GL_OUT_OF_MEMORY:
+ errorStr = "GL_OUT_OF_MEMORY";
+ break;
+ }
+ if (header)
+ LOG_ERROR("%s: %s", header, errorStr);
+ else
+ LOG_ERROR("%s", errorStr);
+ }
+#endif
+}
+
+}
+
+#endif
diff --git a/WebCore/platform/graphics/chromium/GLES2Canvas.h b/WebCore/platform/graphics/chromium/GLES2Canvas.h
new file mode 100644
index 0000000..e3a7a3b
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/GLES2Canvas.h
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2010, 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.
+ */
+
+#ifndef GLES2Canvas_h
+#define GLES2Canvas_h
+
+#if USE(GLES2_RENDERING)
+
+#include "AffineTransform.h"
+#include "Color.h"
+#include "ColorSpace.h"
+#include "GLES2Texture.h"
+#include "GraphicsTypes.h"
+#include "ImageSource.h"
+
+#include <wtf/HashMap.h>
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+class FloatRect;
+class Color;
+class GLES2Context;
+
+typedef HashMap<NativeImagePtr, RefPtr<GLES2Texture> > TextureHashMap;
+
+class GLES2Canvas : public Noncopyable {
+public:
+ GLES2Canvas(GLES2Context*, const IntSize&);
+ ~GLES2Canvas();
+
+ void fillRect(const FloatRect&, const Color&, ColorSpace);
+ void fillRect(const FloatRect&);
+ void clearRect(const FloatRect&);
+ void setFillColor(const Color&, ColorSpace);
+ void setAlpha(float alpha);
+ void setCompositeOperation(CompositeOperator);
+ void translate(float x, float y);
+ void rotate(float angleInRadians);
+ void scale(const FloatSize&);
+ void concatCTM(const AffineTransform&);
+
+ void save();
+ void restore();
+
+ // non-standard functions
+ // These are not standard GraphicsContext functions, and should be pushed
+ // down into a PlatformContextGLES2 at some point.
+ void drawTexturedRect(GLES2Texture*, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform&, float alpha, ColorSpace, CompositeOperator);
+ void drawTexturedRect(GLES2Texture*, const FloatRect& srcRect, const FloatRect& dstRect, ColorSpace, CompositeOperator);
+ GLES2Context* gles2Context() { return m_gles2Context; }
+ GLES2Texture* createTexture(NativeImagePtr, GLES2Texture::Format, int width, int height);
+ GLES2Texture* getTexture(NativeImagePtr);
+
+private:
+ void applyCompositeOperator(CompositeOperator);
+ void checkGLError(const char* header);
+ unsigned getQuadVertices();
+ unsigned getQuadIndices();
+ unsigned getSimpleProgram();
+ unsigned getTexProgram();
+
+ GLES2Context* m_gles2Context;
+ struct State;
+ WTF::Vector<State> m_stateStack;
+ State* m_state;
+ unsigned m_quadVertices;
+ unsigned m_quadIndices;
+ unsigned m_simpleProgram;
+ unsigned m_texProgram;
+ int m_simpleMatrixLocation;
+ int m_simpleColorLocation;
+ int m_simplePositionLocation;
+ int m_texMatrixLocation;
+ int m_texTexMatrixLocation;
+ int m_texSamplerLocation;
+ int m_texAlphaLocation;
+ int m_texPositionLocation;
+ AffineTransform m_flipMatrix;
+ TextureHashMap m_textures;
+ CompositeOperator m_lastCompositeOp; // This is the one last set, not necessarily the one in the state stack.
+};
+
+}
+
+#endif
+
+#endif // GLES2Canvas_h
diff --git a/WebCore/platform/graphics/chromium/GLES2Texture.cpp b/WebCore/platform/graphics/chromium/GLES2Texture.cpp
new file mode 100644
index 0000000..26c8bf7
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/GLES2Texture.cpp
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2010, 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"
+
+#if USE(GLES2_RENDERING)
+
+#include "GLES2Texture.h"
+
+#include <GLES2/gl2.h>
+
+#include <wtf/OwnArrayPtr.h>
+
+namespace WebCore {
+
+GLES2Texture::GLES2Texture(unsigned int textureId, Format format, int width, int height)
+ : m_textureId(textureId)
+ , m_format(format)
+ , m_width(width)
+ , m_height(height)
+{
+}
+
+GLES2Texture::~GLES2Texture()
+{
+ glDeleteTextures(1, &m_textureId);
+}
+
+PassRefPtr<GLES2Texture> GLES2Texture::create(Format format, int width, int height)
+{
+ GLuint textureId;
+ glGenTextures(1, &textureId);
+ if (!textureId)
+ return 0;
+
+ glBindTexture(GL_TEXTURE_2D, textureId);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
+
+ int max;
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max);
+ if (width > max || height > max)
+ ASSERT(!"texture too big");
+
+ return adoptRef(new GLES2Texture(textureId, format, width, height));
+}
+
+static void convertFormat(GLES2Texture::Format format, unsigned int* glFormat, unsigned int* glType, bool* swizzle)
+{
+ *swizzle = false;
+ switch (format) {
+ case GLES2Texture::RGBA8:
+ *glFormat = GL_RGBA;
+ *glType = GL_UNSIGNED_BYTE;
+ break;
+ case GLES2Texture::BGRA8:
+// FIXME: Once we have support for extensions, we should check for EXT_texture_format_BGRA8888,
+// and use that if present.
+ *glFormat = GL_RGBA;
+ *glType = GL_UNSIGNED_BYTE;
+ *swizzle = true;
+ break;
+ default:
+ ASSERT(!"bad format");
+ break;
+ }
+}
+
+void GLES2Texture::load(void* pixels)
+{
+ unsigned int glFormat, glType;
+ bool swizzle;
+ convertFormat(m_format, &glFormat, &glType, &swizzle);
+ glBindTexture(GL_TEXTURE_2D, m_textureId);
+ if (swizzle) {
+ ASSERT(glFormat == GL_RGBA && glType == GL_UNSIGNED_BYTE);
+ // FIXME: This could use PBO's to save doing an extra copy here.
+ int size = m_width * m_height;
+ unsigned* pixels32 = static_cast<unsigned*>(pixels);
+ OwnArrayPtr<unsigned> buf(new unsigned[size]);
+ unsigned* bufptr = buf.get();
+ for (int i = 0; i < size; ++i) {
+ unsigned pixel = pixels32[i];
+ bufptr[i] = pixel & 0xFF00FF00 | ((pixel & 0x00FF0000) >> 16) | ((pixel & 0x000000FF) << 16);
+ }
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_width, m_height, glFormat, glType, buf.get());
+ } else
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_width, m_height, glFormat, glType, pixels);
+}
+
+void GLES2Texture::bind()
+{
+ glBindTexture(GL_TEXTURE_2D, m_textureId);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+}
+
+}
+
+#endif
diff --git a/WebCore/platform/graphics/chromium/GLES2Texture.h b/WebCore/platform/graphics/chromium/GLES2Texture.h
new file mode 100644
index 0000000..346365a
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/GLES2Texture.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2010, 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.
+ */
+
+#ifndef GLES2Texture_h
+#define GLES2Texture_h
+
+#if USE(GLES2_RENDERING)
+
+#include "RefCounted.h"
+#include "RefPtr.h"
+
+namespace WebCore {
+
+class GLES2Texture : public RefCounted<GLES2Texture> {
+public:
+ ~GLES2Texture();
+ enum Format { RGBA8, BGRA8 };
+ static PassRefPtr<GLES2Texture> create(Format, int width, int height);
+ void bind();
+ void load(void* pixels);
+ Format format() const { return m_format; }
+ int width() const { return m_width; }
+ int height() const { return m_height; }
+private:
+ GLES2Texture(unsigned int textureId, Format format, int width, int height);
+ unsigned int m_textureId;
+ Format m_format;
+ int m_width;
+ int m_height;
+};
+
+}
+
+#endif
+
+#endif // GLES2Texture_h
diff --git a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
index 7869c45..7184439 100644
--- a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
+++ b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
@@ -1255,6 +1255,7 @@ static HashSet<String> mimeTypeCache()
|| g_str_equal(name, "audio/x-m4a")) {
cache.add(String("video/mp4"));
cache.add(String("audio/aac"));
+ cache.add(String("audio/mp4"));
cached = true;
}
@@ -1270,11 +1271,13 @@ static HashSet<String> mimeTypeCache()
if (g_str_equal(name, "audio/x-wav")) {
cache.add(String("audio/wav"));
+ cache.add(String("audio/x-wav"));
cached = true;
}
if (g_str_equal(name, "audio/mpeg")) {
cache.add(String(name));
+ cache.add(String("audio/x-mpeg"));
cached = true;
// This is what we are handling:
@@ -1289,8 +1292,10 @@ static HashSet<String> mimeTypeCache()
cache.add(String("audio/mp1"));
if (minLayer <= 2 && 2 <= maxLayer)
cache.add(String("audio/mp2"));
- if (minLayer <= 3 && 3 <= maxLayer)
+ if (minLayer <= 3 && 3 <= maxLayer) {
+ cache.add(String("audio/x-mp3"));
cache.add(String("audio/mp3"));
+ }
}
}
}
diff --git a/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp b/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
index f9e1980..6561c11 100644
--- a/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
+++ b/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
@@ -152,7 +152,7 @@ void GraphicsContext::drawConvexPolygon(size_t pointsLength, const FloatPoint* p
m_data->m_view->StrokePolygon(bPoints, pointsLength, true, getHaikuStrokeStyle());
}
-void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points)
+void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points, bool antialiased)
{
if (paintingDisabled())
return;
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index a828070..e560e15 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -529,7 +529,7 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points
p->restore();
}
-void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points)
+void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points, bool antialiased)
{
if (paintingDisabled())
return;
@@ -793,9 +793,11 @@ void GraphicsContext::beginPath()
void GraphicsContext::addPath(const Path& path)
{
- QPainterPath newPath = m_data->currentPath;
- newPath.addPath(path.platformPath());
- m_data->currentPath = newPath;
+ if (!m_data->currentPath.elementCount()) {
+ m_data->currentPath = path.platformPath();
+ return;
+ }
+ m_data->currentPath.addPath(path.platformPath());
}
bool GraphicsContext::inTransparencyLayer() const
diff --git a/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
index b4ca617..bc25003 100644
--- a/WebCore/platform/graphics/qt/ImageBufferQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
@@ -175,32 +175,53 @@ PassRefPtr<ImageData> getImageData(const IntRect& rect, const ImageBufferData& i
endy = size.height();
int numRows = endy - originy;
- QImage image = imageData.m_pixmap.toImage();
- if (multiplied == Unmultiplied)
- image = image.convertToFormat(QImage::Format_ARGB32);
- else
- image = image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ // NOTE: For unmultiplied data, we undo the premultiplication below.
+ QImage image = imageData.m_pixmap.toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied);
ASSERT(!image.isNull());
- unsigned destBytesPerRow = 4 * rect.width();
- unsigned char* destRows = data + desty * destBytesPerRow + destx * 4;
- for (int y = 0; y < numRows; ++y) {
+ const int bytesPerLine = image.bytesPerLine();
#if QT_VERSION >= 0x040700
- const quint32* scanLine = reinterpret_cast<const quint32*>(image.constScanLine(y + originy));
+ const uchar* bits = image.constBits();
#else
- quint32* scanLine = reinterpret_cast<quint32*>(image.scanLine(y + originy));
+ const uchar* bits = image.bits();
#endif
- for (int x = 0; x < numColumns; x++) {
- QRgb value = scanLine[x + originx];
- int basex = x * 4;
-
- destRows[basex] = qRed(value);
- destRows[basex + 1] = qGreen(value);
- destRows[basex + 2] = qBlue(value);
- destRows[basex + 3] = qAlpha(value);
+
+ quint32* destRows = reinterpret_cast<quint32*>(&data[desty * rect.width() + destx]);
+
+ if (multiplied == Unmultiplied) {
+ for (int y = 0; y < numRows; ++y) {
+ const quint32* scanLine = reinterpret_cast<const quint32*>(bits + (y + originy) * bytesPerLine);
+ for (int x = 0; x < numColumns; x++) {
+ QRgb pixel = scanLine[x + originx];
+ int alpha = qAlpha(pixel);
+ // Un-premultiply and convert RGB to BGR.
+ if (alpha == 255)
+ destRows[x] = (0xFF000000
+ | (qBlue(pixel) << 16)
+ | (qGreen(pixel) << 8)
+ | (qRed(pixel)));
+ else if (alpha > 0)
+ destRows[x] = ((alpha << 24)
+ | (((255 * qBlue(pixel)) / alpha)) << 16)
+ | (((255 * qGreen(pixel)) / alpha) << 8)
+ | ((255 * qRed(pixel)) / alpha);
+ else
+ destRows[x] = 0;
+ }
+ destRows += rect.width();
+ }
+ } else {
+ for (int y = 0; y < numRows; ++y) {
+ const quint32* scanLine = reinterpret_cast<const quint32*>(bits + (y + originy) * bytesPerLine);
+ for (int x = 0; x < numColumns; x++) {
+ QRgb pixel = scanLine[x + originx];
+ // Convert RGB to BGR.
+ destRows[x] = ((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff) | (pixel & 0xff00ff00);
+
+ }
+ destRows += rect.width();
}
- destRows += destBytesPerRow;
}
return result;
@@ -216,6 +237,22 @@ PassRefPtr<ImageData> ImageBuffer::getPremultipliedImageData(const IntRect& rect
return getImageData<Premultiplied>(rect, m_data, m_size);
}
+static inline unsigned int premultiplyABGRtoARGB(unsigned int x)
+{
+ unsigned int a = x >> 24;
+ if (a == 255)
+ return (x << 16) | ((x >> 16) & 0xff) | (x & 0xff00ff00);
+ unsigned int t = (x & 0xff00ff) * a;
+ t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8;
+ t = ((t << 16) | (t >> 16)) & 0xff00ff;
+
+ x = ((x >> 8) & 0xff) * a;
+ x = (x + ((x >> 8) & 0xff) + 0x80);
+ x &= 0xff00;
+ x |= t | (a << 24);
+ return x;
+}
+
template <Multiply multiplied>
void putImageData(ImageData*& source, const IntRect& sourceRect, const IntPoint& destPoint, ImageBufferData& data, const IntSize& size)
{
@@ -247,22 +284,33 @@ void putImageData(ImageData*& source, const IntRect& sourceRect, const IntPoint&
unsigned srcBytesPerRow = 4 * source->width();
- QRect destRect(destx, desty, endx - destx, endy - desty);
-
- QImage::Format format = multiplied == Unmultiplied ? QImage::Format_ARGB32 : QImage::Format_ARGB32_Premultiplied;
- QImage image(destRect.size(), format);
-
- unsigned char* srcRows = source->data()->data()->data() + originy * srcBytesPerRow + originx * 4;
- for (int y = 0; y < numRows; ++y) {
- quint32* scanLine = reinterpret_cast<quint32*>(image.scanLine(y));
- for (int x = 0; x < numColumns; x++) {
- // ImageData stores the pixels in RGBA while QImage is ARGB
- quint32 pixel = reinterpret_cast<quint32*>(srcRows + 4 * x)[0];
- pixel = ((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff) | (pixel & 0xff00ff00);
- scanLine[x] = pixel;
+ // NOTE: For unmultiplied input data, we do the premultiplication below.
+ QImage image(numColumns, numRows, QImage::Format_ARGB32_Premultiplied);
+ uchar* bits = image.bits();
+ const int bytesPerLine = image.bytesPerLine();
+
+ const quint32* srcScanLine = reinterpret_cast<const quint32*>(source->data()->data()->data() + originy * srcBytesPerRow + originx * 4);
+
+ if (multiplied == Unmultiplied) {
+ for (int y = 0; y < numRows; ++y) {
+ quint32* destScanLine = reinterpret_cast<quint32*>(bits + y * bytesPerLine);
+ for (int x = 0; x < numColumns; x++) {
+ // Premultiply and convert BGR to RGB.
+ quint32 pixel = srcScanLine[x];
+ destScanLine[x] = premultiplyABGRtoARGB(pixel);
+ }
+ srcScanLine += source->width();
+ }
+ } else {
+ for (int y = 0; y < numRows; ++y) {
+ quint32* destScanLine = reinterpret_cast<quint32*>(bits + y * bytesPerLine);
+ for (int x = 0; x < numColumns; x++) {
+ // Convert BGR to RGB.
+ quint32 pixel = srcScanLine[x];
+ destScanLine[x] = ((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff) | (pixel & 0xff00ff00);
+ }
+ srcScanLine += source->width();
}
-
- srcRows += srcBytesPerRow;
}
bool isPainting = data.m_painter->isActive();
@@ -278,7 +326,7 @@ void putImageData(ImageData*& source, const IntRect& sourceRect, const IntPoint&
}
data.m_painter->setCompositionMode(QPainter::CompositionMode_Source);
- data.m_painter->drawImage(destRect, image);
+ data.m_painter->drawImage(destx, desty, image);
if (!isPainting)
data.m_painter->end();
diff --git a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
index 0c1898b..7994244 100644
--- a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
@@ -54,6 +54,10 @@
#include <wtf/Assertions.h>
#include <wtf/MathExtras.h>
+#if USE(GLES2_RENDERING)
+#include "GLES2Canvas.h"
+#endif
+
using namespace std;
namespace WebCore {
@@ -243,6 +247,11 @@ void GraphicsContext::savePlatformState()
if (paintingDisabled())
return;
+#if USE(GLES2_RENDERING)
+ if (platformContext()->useGPU())
+ platformContext()->gpuCanvas()->save();
+#endif
+
// Save our private State.
platformContext()->save();
}
@@ -252,6 +261,11 @@ void GraphicsContext::restorePlatformState()
if (paintingDisabled())
return;
+#if USE(GLES2_RENDERING)
+ if (platformContext()->useGPU())
+ platformContext()->gpuCanvas()->restore();
+#endif
+
// Restore our private State.
platformContext()->restore();
}
@@ -290,6 +304,7 @@ void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect, int thickness
if (!isRectSkiaSafe(getCTM(), r))
return;
+ platformContext()->prepareForSoftwareDraw();
SkPath path;
path.addOval(r, SkPath::kCW_Direction);
// only perform the inset if we won't invert r
@@ -307,6 +322,7 @@ void GraphicsContext::addPath(const Path& path)
{
if (paintingDisabled())
return;
+ platformContext()->prepareForSoftwareDraw();
platformContext()->addPath(*path.platformPath());
}
@@ -314,6 +330,7 @@ void GraphicsContext::beginPath()
{
if (paintingDisabled())
return;
+ platformContext()->prepareForSoftwareDraw();
platformContext()->beginPath();
}
@@ -329,6 +346,16 @@ void GraphicsContext::clearRect(const FloatRect& rect)
if (paintingDisabled())
return;
+#if USE(GLES2_RENDERING)
+ if (platformContext()->useGPU()) {
+ platformContext()->prepareForHardwareDraw();
+ platformContext()->gpuCanvas()->clearRect(rect);
+ return;
+ }
+#endif
+
+ platformContext()->prepareForSoftwareDraw();
+
SkRect r = rect;
if (!isRectSkiaSafe(getCTM(), r))
ClipRectToCanvas(*platformContext()->canvas(), r, &r);
@@ -348,6 +375,7 @@ void GraphicsContext::clip(const FloatRect& rect)
if (!isRectSkiaSafe(getCTM(), r))
return;
+ platformContext()->prepareForSoftwareDraw();
platformContext()->canvas()->clipRect(r);
}
@@ -360,6 +388,7 @@ void GraphicsContext::clip(const Path& path)
if (!isPathSkiaSafe(getCTM(), p))
return;
+ platformContext()->prepareForSoftwareDraw();
platformContext()->clipPathAntiAliased(p);
}
@@ -441,6 +470,12 @@ void GraphicsContext::concatCTM(const AffineTransform& affine)
{
if (paintingDisabled())
return;
+
+#if USE(GLES2_RENDERING)
+ if (platformContext()->useGPU())
+ platformContext()->gpuCanvas()->concatCTM(affine);
+#endif
+
platformContext()->canvas()->concat(affine);
}
@@ -454,6 +489,8 @@ void GraphicsContext::drawConvexPolygon(size_t numPoints,
if (numPoints <= 1)
return;
+ platformContext()->prepareForSoftwareDraw();
+
SkPath path;
path.incReserve(numPoints);
@@ -478,7 +515,7 @@ void GraphicsContext::drawConvexPolygon(size_t numPoints,
}
}
-void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points)
+void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points, bool antialiased)
{
if (paintingDisabled())
return;
@@ -499,6 +536,7 @@ void GraphicsContext::drawEllipse(const IntRect& elipseRect)
if (!isRectSkiaSafe(getCTM(), rect))
return;
+ platformContext()->prepareForSoftwareDraw();
SkPaint paint;
platformContext()->setupPaintForFilling(&paint);
platformContext()->canvas()->drawOval(rect, paint);
@@ -524,6 +562,7 @@ void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int /* width *
if (!rectCount)
return;
+ platformContext()->prepareForSoftwareDraw();
SkRegion focusRingRegion;
const SkScalar focusRingOutset = WebCoreFloatToSkScalar(0.5);
for (unsigned i = 0; i < rectCount; i++) {
@@ -558,6 +597,8 @@ void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2)
if (!isPointSkiaSafe(getCTM(), point1) || !isPointSkiaSafe(getCTM(), point2))
return;
+ platformContext()->prepareForSoftwareDraw();
+
FloatPoint p1 = point1;
FloatPoint p2 = point2;
bool isVerticalLine = (p1.x() == p2.x());
@@ -604,6 +645,8 @@ void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint& pt,
if (paintingDisabled())
return;
+ platformContext()->prepareForSoftwareDraw();
+
// Create the pattern we'll use to draw the underline.
static SkBitmap* misspellBitmap = 0;
if (!misspellBitmap) {
@@ -684,6 +727,8 @@ void GraphicsContext::drawLineForText(const IntPoint& pt,
if (width <= 0)
return;
+ platformContext()->prepareForSoftwareDraw();
+
int thickness = SkMax32(static_cast<int>(strokeThickness()), 1);
SkRect r;
r.fLeft = SkIntToScalar(pt.x());
@@ -704,6 +749,8 @@ void GraphicsContext::drawRect(const IntRect& rect)
if (paintingDisabled())
return;
+ platformContext()->prepareForSoftwareDraw();
+
SkRect r = rect;
if (!isRectSkiaSafe(getCTM(), r)) {
// See the fillRect below.
@@ -722,6 +769,8 @@ void GraphicsContext::fillPath()
if (!isPathSkiaSafe(getCTM(), path))
return;
+ platformContext()->prepareForSoftwareDraw();
+
const GraphicsContextState& state = m_common->state;
path.setFillType(state.fillRule == RULE_EVENODD ?
SkPath::kEvenOdd_FillType : SkPath::kWinding_FillType);
@@ -745,6 +794,16 @@ void GraphicsContext::fillRect(const FloatRect& rect)
ClipRectToCanvas(*platformContext()->canvas(), r, &r);
}
+#if USE(GLES2_RENDERING)
+ if (platformContext()->useGPU() && !m_common->state.fillPattern && !m_common->state.fillGradient) {
+ platformContext()->prepareForHardwareDraw();
+ platformContext()->gpuCanvas()->fillRect(rect);
+ return;
+ }
+#endif
+
+ platformContext()->prepareForSoftwareDraw();
+
SkPaint paint;
platformContext()->setupPaintForFilling(&paint);
platformContext()->canvas()->drawRect(r, paint);
@@ -757,6 +816,16 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorS
if (paintingDisabled())
return;
+#if USE(GLES2_RENDERING)
+ if (platformContext()->useGPU() && !m_common->state.fillPattern && !m_common->state.fillGradient) {
+ platformContext()->prepareForHardwareDraw();
+ platformContext()->gpuCanvas()->fillRect(rect, color, colorSpace);
+ return;
+ }
+#endif
+
+ platformContext()->prepareForSoftwareDraw();
+
SkRect r = rect;
if (!isRectSkiaSafe(getCTM(), r)) {
// Special case when the rectangle overflows fixed point. This is a
@@ -789,6 +858,8 @@ void GraphicsContext::fillRoundedRect(const IntRect& rect,
if (paintingDisabled())
return;
+ platformContext()->prepareForSoftwareDraw();
+
SkRect r = rect;
if (!isRectSkiaSafe(getCTM(), r))
// See fillRect().
@@ -872,6 +943,12 @@ void GraphicsContext::scale(const FloatSize& size)
{
if (paintingDisabled())
return;
+
+#if USE(GLES2_RENDERING)
+ if (platformContext()->useGPU())
+ platformContext()->gpuCanvas()->scale(size);
+#endif
+
platformContext()->canvas()->scale(WebCoreFloatToSkScalar(size.width()),
WebCoreFloatToSkScalar(size.height()));
}
@@ -880,6 +957,10 @@ void GraphicsContext::setAlpha(float alpha)
{
if (paintingDisabled())
return;
+#if USE(GLES2_RENDERING)
+ if (platformContext()->useGPU())
+ platformContext()->gpuCanvas()->setAlpha(alpha);
+#endif
platformContext()->setAlpha(alpha);
}
@@ -887,6 +968,10 @@ void GraphicsContext::setCompositeOperation(CompositeOperator op)
{
if (paintingDisabled())
return;
+#if USE(GLES2_RENDERING)
+ if (platformContext()->useGPU())
+ platformContext()->gpuCanvas()->setCompositeOperation(op);
+#endif
platformContext()->setXfermodeMode(WebCoreCompositeToSkiaComposite(op));
}
@@ -973,6 +1058,11 @@ void GraphicsContext::setPlatformFillColor(const Color& color, ColorSpace colorS
{
if (paintingDisabled())
return;
+#if USE(GLES2_RENDERING)
+ if (platformContext()->useGPU())
+ platformContext()->gpuCanvas()->setFillColor(color, colorSpace);
+#endif
+
platformContext()->setFillColor(color.rgb());
}
@@ -1102,6 +1192,8 @@ void GraphicsContext::strokeArc(const IntRect& r, int startAngle, int angleSpan)
if (paintingDisabled())
return;
+ platformContext()->prepareForSoftwareDraw();
+
SkPaint paint;
SkRect oval = r;
if (strokeStyle() == NoStroke) {
@@ -1133,6 +1225,8 @@ void GraphicsContext::strokePath()
if (!isPathSkiaSafe(getCTM(), path))
return;
+ platformContext()->prepareForSoftwareDraw();
+
SkPaint paint;
platformContext()->setupPaintForStroking(&paint, 0, 0);
platformContext()->canvas()->drawPath(path, paint);
@@ -1146,6 +1240,8 @@ void GraphicsContext::strokeRect(const FloatRect& rect, float lineWidth)
if (!isRectSkiaSafe(getCTM(), rect))
return;
+ platformContext()->prepareForSoftwareDraw();
+
SkPaint paint;
platformContext()->setupPaintForStroking(&paint, 0, 0);
paint.setStrokeWidth(WebCoreFloatToSkScalar(lineWidth));
@@ -1157,6 +1253,11 @@ void GraphicsContext::rotate(float angleInRadians)
if (paintingDisabled())
return;
+#if USE(GLES2_RENDERING)
+ if (platformContext()->useGPU())
+ platformContext()->gpuCanvas()->rotate(angleInRadians);
+#endif
+
platformContext()->canvas()->rotate(WebCoreFloatToSkScalar(
angleInRadians * (180.0f / 3.14159265f)));
}
@@ -1166,6 +1267,11 @@ void GraphicsContext::translate(float w, float h)
if (paintingDisabled())
return;
+#if USE(GLES2_RENDERING)
+ if (platformContext()->useGPU())
+ platformContext()->gpuCanvas()->translate(w, h);
+#endif
+
platformContext()->canvas()->translate(WebCoreFloatToSkScalar(w),
WebCoreFloatToSkScalar(h));
}
diff --git a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
index f8192fe..26c44f2 100644
--- a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
+++ b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
@@ -74,10 +74,7 @@ ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace imageColorSpace, b
// Make the background transparent. It would be nice if this wasn't
// required, but the canvas is currently filled with the magic transparency
// color. Can we have another way to manage this?
- //
- // Avoid drawing on a zero-sized canvas. Skia can't handle it.
- if (!size.isZero())
- m_data.m_canvas.drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode);
+ m_data.m_canvas.drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode);
success = true;
}
@@ -131,6 +128,13 @@ PassRefPtr<ImageData> getImageData(const IntRect& rect, const SkBitmap& bitmap,
const IntSize& size)
{
RefPtr<ImageData> result = ImageData::create(rect.width(), rect.height());
+
+ if (bitmap.config() == SkBitmap::kNo_Config) {
+ // This is an empty SkBitmap that could not be configured.
+ ASSERT(size.width() == 0 || size.height() == 0);
+ return result;
+ }
+
unsigned char* data = result->data()->data()->data();
if (rect.x() < 0 || rect.y() < 0 ||
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index 15bd9b4..65c6e95 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -44,7 +44,15 @@
#include "SkShader.h"
#include "SkDashPathEffect.h"
+#if USE(GLES2_RENDERING)
+#include "GLES2Canvas.h"
+#include "GLES2Context.h"
+#include "GLES2Texture.h"
+#include <GLES2/gl2.h>
+#endif
+
#include <wtf/MathExtras.h>
+#include <wtf/OwnArrayPtr.h>
#include <wtf/Vector.h>
namespace WebCore
@@ -199,6 +207,11 @@ PlatformContextSkia::PlatformContextSkia(skia::PlatformCanvas* canvas)
#if OS(WINDOWS)
, m_drawingToImageBuffer(false)
#endif
+#if USE(GLES2_RENDERING)
+ , m_useGPU(false)
+ , m_gpuCanvas(0)
+ , m_backingStoreState(None)
+#endif
{
m_stateStack.append(State());
m_state = &m_stateStack.last();
@@ -661,3 +674,117 @@ void PlatformContextSkia::applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths)
m_canvas->restore();
}
+
+#if USE(GLES2_RENDERING)
+void PlatformContextSkia::setGLES2Context(WebCore::GLES2Context* context, const WebCore::IntSize& size)
+{
+ m_useGPU = true;
+ m_gpuCanvas = new WebCore::GLES2Canvas(context, size);
+}
+
+void PlatformContextSkia::prepareForSoftwareDraw() const
+{
+ if (!m_useGPU)
+ return;
+
+ if (m_backingStoreState == Hardware) {
+ // Depending on the blend mode we need to do one of a few things:
+
+ // * For associative blend modes, we can draw into an initially empty
+ // canvas and then composite the results on top of the hardware drawn
+ // results before the next hardware draw or swapBuffers().
+
+ // * For non-associative blend modes we have to do a readback and then
+ // software draw. When we re-upload in this mode we have to blow
+ // away whatever is in the hardware backing store (do a copy instead
+ // of a compositing operation).
+
+ if (m_state->m_xferMode == SkXfermode::kSrcOver_Mode) {
+ // Last drawn on hardware; clear out the canvas.
+ m_canvas->save();
+ SkRect bounds = {0, 0, m_canvas->getDevice()->width(), m_canvas->getDevice()->height()};
+ m_canvas->clipRect(bounds, SkRegion::kReplace_Op);
+ m_canvas->drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode);
+ m_canvas->restore();
+ // Start compositing into the empty canvas.
+ m_backingStoreState = Mixed;
+ } else {
+ readbackHardwareToSoftware();
+ // When we switch back to hardware copy the results, don't composite.
+ m_backingStoreState = Software;
+ }
+ } else if (m_backingStoreState == Mixed) {
+ if (m_state->m_xferMode != SkXfermode::kSrcOver_Mode) {
+ // Have to composite our currently software drawn data...
+ uploadSoftwareToHardware(WebCore::CompositeSourceOver);
+ // then do a readback so we can hardware draw stuff.
+ readbackHardwareToSoftware();
+ m_backingStoreState = Software;
+ }
+ }
+}
+
+void PlatformContextSkia::prepareForHardwareDraw() const
+{
+ if (!m_useGPU)
+ return;
+
+ if (m_backingStoreState == Software) {
+ // Last drawn in software; upload everything we've drawn.
+ uploadSoftwareToHardware(WebCore::CompositeCopy);
+ } else if (m_backingStoreState == Mixed) {
+ // Stuff in software/hardware, composite the software stuff on top of
+ // the hardware stuff.
+ uploadSoftwareToHardware(WebCore::CompositeSourceOver);
+ }
+ m_backingStoreState = Hardware;
+}
+
+void PlatformContextSkia::syncSoftwareCanvas() const
+{
+ if (!m_useGPU)
+ return;
+
+ if (m_backingStoreState == Hardware)
+ readbackHardwareToSoftware();
+ else if (m_backingStoreState == Mixed) {
+ // Have to composite our currently software drawn data..
+ uploadSoftwareToHardware(WebCore::CompositeSourceOver);
+ // then do a readback.
+ readbackHardwareToSoftware();
+ m_backingStoreState = Software;
+ }
+ m_backingStoreState = Software;
+}
+
+void PlatformContextSkia::uploadSoftwareToHardware(WebCore::CompositeOperator op) const
+{
+ const SkBitmap& bitmap = m_canvas->getDevice()->accessBitmap(false);
+ SkAutoLockPixels lock(bitmap);
+ m_gpuCanvas->gles2Context()->makeCurrent();
+ // FIXME: Keep a texture around for this rather than constantly creating/destroying one.
+ RefPtr<WebCore::GLES2Texture> texture = WebCore::GLES2Texture::create(WebCore::GLES2Texture::BGRA8, bitmap.width(), bitmap.height());
+ texture->load(bitmap.getPixels());
+ WebCore::IntRect rect(0, 0, bitmap.width(), bitmap.height());
+ gpuCanvas()->drawTexturedRect(texture.get(), rect, rect, WebCore::DeviceColorSpace, op);
+}
+
+void PlatformContextSkia::readbackHardwareToSoftware() const
+{
+ const SkBitmap& bitmap = m_canvas->getDevice()->accessBitmap(true);
+ SkAutoLockPixels lock(bitmap);
+ m_gpuCanvas->gles2Context()->makeCurrent();
+ int width = bitmap.width(), height = bitmap.height();
+ OwnArrayPtr<uint32_t> buf(new uint32_t[width]);
+ // Flips the image vertically.
+ for (int y = 0; y < height; ++y) {
+ uint32_t* pixels = bitmap.getAddr32(0, y);
+ glReadPixels(0, height - 1 - y, width, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
+ for (int i = 0; i < width; ++i) {
+ uint32_t pixel = pixels[i];
+ // Swizzles from RGBA -> BGRA.
+ pixels[i] = pixel & 0xFF00FF00 | ((pixel & 0x00FF0000) >> 16) | ((pixel & 0x000000FF) << 16);
+ }
+ }
+}
+#endif
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.h b/WebCore/platform/graphics/skia/PlatformContextSkia.h
index 88a8ec7..2099dd0 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.h
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.h
@@ -41,6 +41,14 @@
#include "SkPaint.h"
#include "SkPath.h"
+#if USE(GLES2_RENDERING)
+namespace WebCore {
+enum CompositeOperator;
+class GLES2Canvas;
+class GLES2Context;
+}
+#endif
+
#include <wtf/Vector.h>
// This class holds the platform-specific state for GraphicsContext. We put
@@ -174,6 +182,24 @@ public:
void setImageResamplingHint(const WebCore::IntSize& srcSize, const WebCore::FloatSize& dstSize);
void clearImageResamplingHint();
bool hasImageResamplingHint() const;
+#if USE(GLES2_RENDERING)
+ bool useGPU() { return m_useGPU; }
+ void setGLES2Context(WebCore::GLES2Context*, const WebCore::IntSize&);
+ WebCore::GLES2Canvas* gpuCanvas() const { return m_gpuCanvas.get(); }
+#endif
+
+#if USE(GLES2_RENDERING)
+ // Call these before making a call that manipulates the underlying
+ // skia::PlatformCanvas or WebCore::GLES2Canvas
+ void prepareForSoftwareDraw() const;
+ void prepareForHardwareDraw() const;
+ // Call to force the skia::PlatformCanvas to contain all rendering results.
+ void syncSoftwareCanvas() const;
+#else
+ void prepareForSoftwareDraw() const {}
+ void prepareForHardwareDraw() const {}
+ void syncSoftwareCanvas() const {}
+#endif
private:
#if OS(LINUX) || OS(WINDOWS)
@@ -183,6 +209,11 @@ private:
#endif
void applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths);
+#if USE(GLES2_RENDERING)
+ void uploadSoftwareToHardware(WebCore::CompositeOperator) const;
+ void readbackHardwareToSoftware() const;
+#endif
+
// Defines drawing style.
struct State;
@@ -206,6 +237,11 @@ private:
#if OS(WINDOWS)
bool m_drawingToImageBuffer;
#endif
+#if USE(GLES2_RENDERING)
+ bool m_useGPU;
+ OwnPtr<WebCore::GLES2Canvas> m_gpuCanvas;
+ mutable enum { None, Software, Mixed, Hardware } m_backingStoreState;
+#endif
};
-#endif // PlatformContextSkia_h
+#endif // PlatformContextSkia_h
diff --git a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp b/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
index 5292b82..e4466c8 100644
--- a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
+++ b/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
@@ -948,7 +948,7 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points
}
}
-void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points)
+void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points, bool antialiased)
{
if (paintingDisabled())
return;
@@ -1160,12 +1160,12 @@ void GraphicsContext::concatCTM(const AffineTransform& transform)
m_data->concatCTM(transform);
}
-TransformationMatrix& GraphicsContext::affineTransform()
+AffineTransform& GraphicsContext::affineTransform()
{
return m_data->m_transform;
}
-const TransformationMatrix& GraphicsContext::affineTransform() const
+const AffineTransform& GraphicsContext::affineTransform() const
{
return m_data->m_transform;
}
@@ -1268,8 +1268,8 @@ void GraphicsContext::fillRoundedRect(const IntRect& fillRect, const IntSize& to
IntRect dstRect = fillRect;
- dstRect.move(shadowSize);
- dstRect.inflate(shadowBlur);
+ dstRect.move(stableRound(shadowSize.width()), stableRound(shadowSize.height()));
+ dstRect.inflate(stableRound(shadowBlur));
dstRect = m_data->mapRect(dstRect);
FloatSize newTopLeft(m_data->mapSize(topLeft));
@@ -1513,7 +1513,7 @@ void GraphicsContext::fillRect(const FloatRect& r, const Gradient* gradient)
int width = rect.width();
int height = rect.height();
FloatSize d = gradient->p1() - gradient->p0();
- bool vertical = abs(d.height()) > abs(d.width());
+ bool vertical = fabs(d.height()) > fabs(d.width());
for (size_t i = 0; i < numStops; ++i) {
const Gradient::ColorStop& stop = stops[i];
int iTv = i ? 2 * i - 1 : 0;
@@ -1868,7 +1868,7 @@ void GraphicsContext::paintTextField(const IntRect& rect, unsigned state)
FillRect(dc, &rectWin, reinterpret_cast<HBRUSH>(((state & DFCS_INACTIVE) ? COLOR_BTNFACE : COLOR_WINDOW) + 1));
}
-void GraphicsContext::drawBitmap(SharedBitmap* bmp, const IntRect& dstRectIn, const IntRect& srcRect, CompositeOperator compositeOp)
+void GraphicsContext::drawBitmap(SharedBitmap* bmp, const IntRect& dstRectIn, const IntRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp)
{
if (!m_data->m_opacity)
return;
@@ -1891,7 +1891,7 @@ void GraphicsContext::drawBitmap(SharedBitmap* bmp, const IntRect& dstRectIn, co
}
void GraphicsContext::drawBitmapPattern(SharedBitmap* bmp, const FloatRect& tileRectIn, const AffineTransform& patternTransform,
- const FloatPoint& phase, CompositeOperator op, const FloatRect& destRectIn, const IntSize& origSourceSize)
+ const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRectIn, const IntSize& origSourceSize)
{
if (!m_data->m_opacity)
return;
@@ -1912,7 +1912,7 @@ void GraphicsContext::drawBitmapPattern(SharedBitmap* bmp, const FloatRect& tile
AffineTransform transform = m_data->m_transform;
transform.translate(moved.width(), moved.height());
- bmp->drawPattern(dc, transform, tileRectIn, patternTransform, phase, op, destRectIn, origSourceSize);
+ bmp->drawPattern(dc, transform, tileRectIn, patternTransform, phase, styleColorSpace, op, destRectIn, origSourceSize);
if (!bmp->hasAlpha())
transparentDC.fillAlphaChannel();
diff --git a/WebCore/platform/graphics/wince/ImageBufferWince.cpp b/WebCore/platform/graphics/wince/ImageBufferWince.cpp
index 4b739c8..1a25f4f 100644
--- a/WebCore/platform/graphics/wince/ImageBufferWince.cpp
+++ b/WebCore/platform/graphics/wince/ImageBufferWince.cpp
@@ -26,8 +26,10 @@
#include "Image.h"
#include "ImageData.h"
#include "JPEGEncoder.h"
+#include "NotImplemented.h"
#include "PNGEncoder.h"
#include "SharedBitmap.h"
+#include "UnusedParam.h"
#include <wtf/UnusedParam.h>
namespace WebCore {
@@ -43,24 +45,24 @@ public:
virtual IntSize size() const { return IntSize(m_data->m_bitmap->width(), m_data->m_bitmap->height()); }
virtual void destroyDecodedData(bool destroyAll = true) {}
virtual unsigned decodedSize() const { return 0; }
- virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator);
+ virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator);
virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
- const FloatPoint& phase, CompositeOperator, const FloatRect& destRect);
+ const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect);
const ImageBufferData* m_data;
};
-void BufferedImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp)
+void BufferedImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp)
{
IntRect intDstRect = enclosingIntRect(dstRect);
IntRect intSrcRect(srcRect);
- m_data->m_bitmap->draw(ctxt, intDstRect, intSrcRect, compositeOp);
+ m_data->m_bitmap->draw(ctxt, intDstRect, intSrcRect, styleColorSpace, compositeOp);
}
void BufferedImage::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRectIn, const AffineTransform& patternTransform,
- const FloatPoint& phase, CompositeOperator op, const FloatRect& destRect)
+ const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
{
- m_data->m_bitmap->drawPattern(ctxt, tileRectIn, patternTransform, phase, op, destRect, size());
+ m_data->m_bitmap->drawPattern(ctxt, tileRectIn, patternTransform, phase, styleColorSpace, op, destRect, size());
}
ImageBufferData::ImageBufferData(const IntSize& size)
@@ -216,6 +218,12 @@ void ImageBuffer::putPremultipliedImageData(ImageData* source, const IntRect& so
putImageData<true>(source, sourceRect, destPoint, m_data.m_bitmap.get());
}
+void ImageBuffer::platformTransformColorSpace(const Vector<int>& lookUpTable)
+{
+ UNUSED_PARAM(lookUpTable);
+ notImplemented();
+}
+
String ImageBuffer::toDataURL(const String& mimeType, const double*) const
{
if (!m_data.m_bitmap->bytes())
diff --git a/WebCore/platform/graphics/wince/PlatformPathWince.cpp b/WebCore/platform/graphics/wince/PlatformPathWince.cpp
index cde5461..b42b52c 100644
--- a/WebCore/platform/graphics/wince/PlatformPathWince.cpp
+++ b/WebCore/platform/graphics/wince/PlatformPathWince.cpp
@@ -671,7 +671,7 @@ void PlatformPath::addArcTo(const FloatPoint& fp1, const FloatPoint& fp2, float
double d01 = v01.length();
double d21 = v21.length();
- double angle = (piDouble - abs(asin(cross / (d01 * d21)))) * 0.5;
+ double angle = (piDouble - fabs(asin(cross / (d01 * d21)))) * 0.5;
double span = radius * tan(angle);
double rate = span / d01;
PathPoint startPoint;
diff --git a/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp b/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp
index 2951223..b77a03b 100644
--- a/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp
+++ b/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp
@@ -81,23 +81,23 @@ FontPlatformData::FontPlatformData(const FontDescription& desc, const AtomicStri
// this is a moot issue on Linux and Mac as they only accept the point argument. So,
// we use the pixel size constructor on Windows, but we use point size on Linux and Mac.
#if __WXMSW__
- m_font = new FontHolder(new wxFont( wxSize(0, -desc.computedPixelSize()),
+ m_font = adoptRef(new FontHolder(new wxFont( wxSize(0, -desc.computedPixelSize()),
fontFamilyToWxFontFamily(desc.genericFamily()),
italicToWxFontStyle(desc.italic()),
fontWeightToWxFontWeight(desc.weight()),
false,
family.string()
)
- );
+ ));
#else
- m_font = new FontHolder(new wxFont( desc.computedPixelSize(),
+ m_font = adoptRef(new FontHolder(new wxFont( desc.computedPixelSize(),
fontFamilyToWxFontFamily(desc.genericFamily()),
italicToWxFontStyle(desc.italic()),
fontWeightToWxFontWeight(desc.weight()),
false,
family.string()
)
- );
+ ));
#endif
#if OS(DARWIN) && !defined(wxOSX_USE_CORE_TEXT)
#if wxCHECK_VERSION(2,9,0)
diff --git a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
index 01dce9e..4d5afd7 100644
--- a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
+++ b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
@@ -256,7 +256,7 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points
delete [] polygon;
}
-void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points)
+void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points, bool antialiased)
{
if (paintingDisabled())
return;
diff --git a/WebCore/platform/gtk/ClipboardGtk.cpp b/WebCore/platform/gtk/ClipboardGtk.cpp
index 924fabc..c08b03f 100644
--- a/WebCore/platform/gtk/ClipboardGtk.cpp
+++ b/WebCore/platform/gtk/ClipboardGtk.cpp
@@ -18,6 +18,7 @@
#include "ClipboardGtk.h"
#include "CachedImage.h"
+#include "DragData.h"
#include "Editor.h"
#include "Element.h"
#include "FileList.h"
@@ -27,6 +28,7 @@
#include "Pasteboard.h"
#include "PasteboardHelper.h"
#include "RenderImage.h"
+#include "ScriptExecutionContext.h"
#include "StringHash.h"
#include "markup.h"
#include <wtf/text/CString.h>
@@ -43,24 +45,31 @@ enum ClipboardType {
ClipboardTypeUnknown
};
-PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy)
+PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame* frame)
{
- return ClipboardGtk::create(policy, gtk_clipboard_get_for_display(gdk_display_get_default(), GDK_SELECTION_CLIPBOARD), false);
+ return ClipboardGtk::create(policy, gtk_clipboard_get_for_display(gdk_display_get_default(), GDK_SELECTION_CLIPBOARD), false, frame);
}
-ClipboardGtk::ClipboardGtk(ClipboardAccessPolicy policy, GtkClipboard* clipboard)
+PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData* dragData, Frame* frame)
+{
+ return ClipboardGtk::create(policy, dragData->platformData(), true, frame);
+}
+
+ClipboardGtk::ClipboardGtk(ClipboardAccessPolicy policy, GtkClipboard* clipboard, Frame* frame)
: Clipboard(policy, false)
, m_dataObject(DataObjectGtk::forClipboard(clipboard))
, m_clipboard(clipboard)
, m_helper(Pasteboard::generalPasteboard()->helper())
+ , m_frame(frame)
{
}
-ClipboardGtk::ClipboardGtk(ClipboardAccessPolicy policy, PassRefPtr<DataObjectGtk> dataObject, bool forDragging)
+ClipboardGtk::ClipboardGtk(ClipboardAccessPolicy policy, PassRefPtr<DataObjectGtk> dataObject, bool forDragging, Frame* frame)
: Clipboard(policy, forDragging)
, m_dataObject(dataObject)
, m_clipboard(0)
, m_helper(Pasteboard::generalPasteboard()->helper())
+ , m_frame(frame)
{
}
@@ -255,8 +264,9 @@ PassRefPtr<FileList> ClipboardGtk::files() const
RefPtr<FileList> fileList = FileList::create();
Vector<String> fileVector(m_dataObject->files());
+ ScriptExecutionContext* scriptExecutionContext = m_frame->document()->scriptExecutionContext();
for (size_t i = 0; i < fileVector.size(); i++)
- fileList->append(File::create(fileVector[i]));
+ fileList->append(File::create(scriptExecutionContext, fileVector[i]));
return fileList.release();
}
diff --git a/WebCore/platform/gtk/ClipboardGtk.h b/WebCore/platform/gtk/ClipboardGtk.h
index c3438c4..5b42ac6 100644
--- a/WebCore/platform/gtk/ClipboardGtk.h
+++ b/WebCore/platform/gtk/ClipboardGtk.h
@@ -34,20 +34,21 @@ typedef struct _GtkClipboard GtkClipboard;
namespace WebCore {
class CachedImage;
+ class Frame;
class PasteboardHelper;
// State available during IE's events for drag and drop and copy/paste
// Created from the EventHandlerGtk to be used by the dom
class ClipboardGtk : public Clipboard {
public:
- static PassRefPtr<ClipboardGtk> create(ClipboardAccessPolicy policy, GtkClipboard* clipboard, bool isForDragging)
+ static PassRefPtr<ClipboardGtk> create(ClipboardAccessPolicy policy, GtkClipboard* clipboard, bool isForDragging, Frame* frame)
{
- return adoptRef(new ClipboardGtk(policy, clipboard));
+ return adoptRef(new ClipboardGtk(policy, clipboard, frame));
}
- static PassRefPtr<ClipboardGtk> create(ClipboardAccessPolicy policy, PassRefPtr<DataObjectGtk> dataObject, bool isForDragging)
+ static PassRefPtr<ClipboardGtk> create(ClipboardAccessPolicy policy, PassRefPtr<DataObjectGtk> dataObject, bool isForDragging, Frame* frame)
{
- return adoptRef(new ClipboardGtk(policy, dataObject, isForDragging));
+ return adoptRef(new ClipboardGtk(policy, dataObject, isForDragging, frame));
}
virtual ~ClipboardGtk();
@@ -77,12 +78,13 @@ namespace WebCore {
PassRefPtr<DataObjectGtk> dataObject() { return m_dataObject; }
private:
- ClipboardGtk(ClipboardAccessPolicy, GtkClipboard*);
- ClipboardGtk(ClipboardAccessPolicy, PassRefPtr<DataObjectGtk>, bool);
+ ClipboardGtk(ClipboardAccessPolicy, GtkClipboard*, Frame*);
+ ClipboardGtk(ClipboardAccessPolicy, PassRefPtr<DataObjectGtk>, bool, Frame*);
RefPtr<DataObjectGtk> m_dataObject;
GtkClipboard* m_clipboard;
PasteboardHelper* m_helper;
+ Frame* m_frame;
};
}
diff --git a/WebCore/platform/gtk/DragDataGtk.cpp b/WebCore/platform/gtk/DragDataGtk.cpp
index 68f7ffc..69966aa 100644
--- a/WebCore/platform/gtk/DragDataGtk.cpp
+++ b/WebCore/platform/gtk/DragDataGtk.cpp
@@ -62,11 +62,6 @@ Color DragData::asColor() const
return Color();
}
-PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const
-{
- return ClipboardGtk::create(policy, m_platformDragData, true);
-}
-
bool DragData::containsCompatibleContent() const
{
return containsPlainText() || containsURL() || m_platformDragData->hasMarkup() || containsColor() || containsFiles();
diff --git a/WebCore/platform/haiku/ClipboardHaiku.cpp b/WebCore/platform/haiku/ClipboardHaiku.cpp
index f73be01..9931131 100644
--- a/WebCore/platform/haiku/ClipboardHaiku.cpp
+++ b/WebCore/platform/haiku/ClipboardHaiku.cpp
@@ -42,6 +42,11 @@
namespace WebCore {
+PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData*, Frame*)
+{
+ return ClipboardHaiku::create(policy, true);
+}
+
ClipboardHaiku::ClipboardHaiku(ClipboardAccessPolicy policy, bool forDragging)
: Clipboard(policy, forDragging)
{
diff --git a/WebCore/platform/haiku/DragDataHaiku.cpp b/WebCore/platform/haiku/DragDataHaiku.cpp
index 7f40b8a..7c2dc9c 100644
--- a/WebCore/platform/haiku/DragDataHaiku.cpp
+++ b/WebCore/platform/haiku/DragDataHaiku.cpp
@@ -27,7 +27,6 @@
#include "config.h"
#include "DragData.h"
-#include "ClipboardHaiku.h"
#include "Document.h"
#include "DocumentFragment.h"
#include "NotImplemented.h"
@@ -76,11 +75,6 @@ Color DragData::asColor() const
return Color();
}
-WTF::PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const
-{
- return ClipboardHaiku::create(policy, true);
-}
-
bool DragData::containsCompatibleContent() const
{
return containsColor() || containsURL() || containsPlainText();
diff --git a/WebCore/platform/mac/ClipboardMac.mm b/WebCore/platform/mac/ClipboardMac.mm
index ddfa0d5..0cbb3f6 100644
--- a/WebCore/platform/mac/ClipboardMac.mm
+++ b/WebCore/platform/mac/ClipboardMac.mm
@@ -29,6 +29,7 @@
#import "DOMElementInternal.h"
#import "DragClient.h"
#import "DragController.h"
+#import "DragData.h"
#import "Editor.h"
#import "FoundationExtras.h"
#import "FileList.h"
@@ -37,6 +38,7 @@
#import "Page.h"
#import "Pasteboard.h"
#import "RenderImage.h"
+#import "ScriptExecutionContext.h"
#import "SecurityOrigin.h"
#import "WebCoreSystemInterface.h"
@@ -46,6 +48,11 @@ typedef unsigned NSUInteger;
namespace WebCore {
+PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData* dragData, Frame* frame)
+{
+ return ClipboardMac::create(true, [dragData->platformData() draggingPasteboard], policy, frame);
+}
+
ClipboardMac::ClipboardMac(bool forDragging, NSPasteboard *pasteboard, ClipboardAccessPolicy policy, Frame *frame)
: Clipboard(policy, forDragging)
, m_pasteboard(pasteboard)
@@ -306,11 +313,12 @@ PassRefPtr<FileList> ClipboardMac::files() const
NSArray *absoluteURLs = absoluteURLsFromPasteboardFilenames(m_pasteboard.get());
NSUInteger count = [absoluteURLs count];
+ ScriptExecutionContext* scriptExecutionContext = m_frame->document()->scriptExecutionContext();
RefPtr<FileList> fileList = FileList::create();
for (NSUInteger x = 0; x < count; x++) {
NSURL *absoluteURL = [NSURL URLWithString:[absoluteURLs objectAtIndex:x]];
ASSERT([absoluteURL isFileURL]);
- fileList->append(File::create([absoluteURL path]));
+ fileList->append(File::create(scriptExecutionContext, [absoluteURL path]));
}
return fileList.release(); // We will always return a FileList, sometimes empty
}
diff --git a/WebCore/platform/mac/DragDataMac.mm b/WebCore/platform/mac/DragDataMac.mm
index fa416ed..9cb4836 100644
--- a/WebCore/platform/mac/DragDataMac.mm
+++ b/WebCore/platform/mac/DragDataMac.mm
@@ -27,8 +27,6 @@
#import "DragData.h"
#if ENABLE(DRAG_SUPPORT)
-#import "ClipboardMac.h"
-#import "ClipboardAccessPolicy.h"
#import "Document.h"
#import "DocumentFragment.h"
#import "DOMDocumentFragment.h"
@@ -100,11 +98,6 @@ Color DragData::asColor() const
(int)([color blueComponent] * 255.0 + 0.5), (int)([color alphaComponent] * 255.0 + 0.5));
}
-PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const
-{
- return ClipboardMac::create(true, [m_platformDragData draggingPasteboard], policy, 0);
-}
-
bool DragData::containsCompatibleContent() const
{
NSPasteboard *pasteboard = [m_platformDragData draggingPasteboard];
diff --git a/WebCore/platform/mac/LocalizedStringsMac.mm b/WebCore/platform/mac/LocalizedStringsMac.mm
index 510249a..8b7df04 100644
--- a/WebCore/platform/mac/LocalizedStringsMac.mm
+++ b/WebCore/platform/mac/LocalizedStringsMac.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003, 2006, 2009 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2003, 2006, 2009, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,813 +26,514 @@
#import "config.h"
#import "LocalizedStrings.h"
-#import "BlockExceptions.h"
#import "IntSize.h"
+#import "LocalizationStrategy.h"
+#import "PlatformStrategies.h"
#import "PlatformString.h"
-#import "WebCoreViewFactory.h"
namespace WebCore {
String inputElementAltText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] inputElementAltText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->inputElementAltText();
}
String resetButtonDefaultLabel()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] resetButtonDefaultLabel];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->resetButtonDefaultLabel();
}
String searchableIndexIntroduction()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] searchableIndexIntroduction];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->searchableIndexIntroduction();
}
String submitButtonDefaultLabel()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] submitButtonDefaultLabel];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->submitButtonDefaultLabel();
}
String fileButtonChooseFileLabel()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] fileButtonChooseFileLabel];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->fileButtonChooseFileLabel();
}
String fileButtonNoFileSelectedLabel()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] fileButtonNoFileSelectedLabel];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->fileButtonNoFileSelectedLabel();
}
String copyImageUnknownFileLabel()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] copyImageUnknownFileLabel];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->copyImageUnknownFileLabel();
}
#if ENABLE(CONTEXT_MENUS)
String contextMenuItemTagOpenLinkInNewWindow()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOpenLinkInNewWindow];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagOpenLinkInNewWindow();
}
String contextMenuItemTagDownloadLinkToDisk()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagDownloadLinkToDisk];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagDownloadLinkToDisk();
}
String contextMenuItemTagCopyLinkToClipboard()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCopyLinkToClipboard];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagCopyLinkToClipboard();
}
String contextMenuItemTagOpenImageInNewWindow()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOpenImageInNewWindow];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagOpenImageInNewWindow();
}
String contextMenuItemTagDownloadImageToDisk()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagDownloadImageToDisk];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagDownloadImageToDisk();
}
String contextMenuItemTagCopyImageToClipboard()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCopyImageToClipboard];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagCopyImageToClipboard();
}
String contextMenuItemTagOpenFrameInNewWindow()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOpenFrameInNewWindow];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagOpenFrameInNewWindow();
}
String contextMenuItemTagCopy()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCopy];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagCopy();
}
String contextMenuItemTagGoBack()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagGoBack];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagGoBack();
}
String contextMenuItemTagGoForward()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagGoForward];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagGoForward();
}
String contextMenuItemTagStop()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagStop];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagStop();
}
String contextMenuItemTagReload()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagReload];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagReload();
}
String contextMenuItemTagCut()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCut];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagCut();
}
String contextMenuItemTagPaste()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagPaste];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagPaste();
}
String contextMenuItemTagNoGuessesFound()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagNoGuessesFound];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagNoGuessesFound();
}
String contextMenuItemTagIgnoreSpelling()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagIgnoreSpelling];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagIgnoreSpelling();
}
String contextMenuItemTagLearnSpelling()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagLearnSpelling];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagLearnSpelling();
}
String contextMenuItemTagSearchInSpotlight()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSearchInSpotlight];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagSearchInSpotlight();
}
String contextMenuItemTagSearchWeb()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSearchWeb];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagSearchWeb();
}
String contextMenuItemTagLookUpInDictionary()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagLookUpInDictionary];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagLookUpInDictionary();
}
String contextMenuItemTagOpenLink()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOpenLink];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagOpenLink();
}
String contextMenuItemTagIgnoreGrammar()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagIgnoreGrammar];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagIgnoreGrammar();
}
String contextMenuItemTagSpellingMenu()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSpellingMenu];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagSpellingMenu();
}
String contextMenuItemTagShowSpellingPanel(bool show)
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagShowSpellingPanel:show];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagShowSpellingPanel(show);
}
String contextMenuItemTagCheckSpelling()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCheckSpelling];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagCheckSpelling();
}
String contextMenuItemTagCheckSpellingWhileTyping()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCheckSpellingWhileTyping];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagCheckSpellingWhileTyping();
}
String contextMenuItemTagCheckGrammarWithSpelling()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCheckGrammarWithSpelling];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagCheckGrammarWithSpelling();
}
String contextMenuItemTagFontMenu()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagFontMenu];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagFontMenu();
}
String contextMenuItemTagShowFonts()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagShowFonts];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagShowFonts();
}
String contextMenuItemTagBold()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagBold];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagBold();
}
String contextMenuItemTagItalic()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagItalic];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagItalic();
}
String contextMenuItemTagUnderline()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagUnderline];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagUnderline();
}
String contextMenuItemTagOutline()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOutline];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagOutline();
}
String contextMenuItemTagStyles()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagStyles];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagStyles();
}
String contextMenuItemTagShowColors()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagShowColors];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagShowColors();
}
String contextMenuItemTagSpeechMenu()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSpeechMenu];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagSpeechMenu();
}
String contextMenuItemTagStartSpeaking()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagStartSpeaking];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagStartSpeaking();
}
String contextMenuItemTagStopSpeaking()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagStopSpeaking];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagStopSpeaking();
}
String contextMenuItemTagWritingDirectionMenu()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagWritingDirectionMenu];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagWritingDirectionMenu();
}
String contextMenuItemTagTextDirectionMenu()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagTextDirectionMenu];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagTextDirectionMenu();
}
String contextMenuItemTagDefaultDirection()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagDefaultDirection];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagDefaultDirection();
}
String contextMenuItemTagLeftToRight()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagLeftToRight];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagLeftToRight();
}
String contextMenuItemTagRightToLeft()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagRightToLeft];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagRightToLeft();
}
String contextMenuItemTagCorrectSpellingAutomatically()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCorrectSpellingAutomatically];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagCorrectSpellingAutomatically();
}
String contextMenuItemTagSubstitutionsMenu()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSubstitutionsMenu];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagSubstitutionsMenu();
}
String contextMenuItemTagShowSubstitutions(bool show)
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagShowSubstitutions:show];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagShowSubstitutions(show);
}
String contextMenuItemTagSmartCopyPaste()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSmartCopyPaste];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagSmartCopyPaste();
}
String contextMenuItemTagSmartQuotes()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSmartQuotes];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagSmartQuotes();
}
String contextMenuItemTagSmartDashes()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSmartDashes];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagSmartDashes();
}
String contextMenuItemTagSmartLinks()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSmartLinks];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagSmartLinks();
}
String contextMenuItemTagTextReplacement()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagTextReplacement];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagTextReplacement();
}
String contextMenuItemTagTransformationsMenu()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagTransformationsMenu];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagTransformationsMenu();
}
String contextMenuItemTagMakeUpperCase()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagMakeUpperCase];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagMakeUpperCase();
}
String contextMenuItemTagMakeLowerCase()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagMakeLowerCase];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagMakeLowerCase();
}
String contextMenuItemTagCapitalize()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCapitalize];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagCapitalize();
}
String contextMenuItemTagChangeBack(const String& replacedString)
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagChangeBack:replacedString];
- END_BLOCK_OBJC_EXCEPTIONS;
- return replacedString;
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagChangeBack(replacedString);
}
String contextMenuItemTagInspectElement()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] contextMenuItemTagInspectElement];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagInspectElement();
}
+
#endif // ENABLE(CONTEXT_MENUS)
String searchMenuNoRecentSearchesText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] searchMenuNoRecentSearchesText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->searchMenuNoRecentSearchesText();
}
String searchMenuRecentSearchesText ()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] searchMenuRecentSearchesText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->searchMenuRecentSearchesText ();
}
String searchMenuClearRecentSearchesText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] searchMenuClearRecentSearchesText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->searchMenuClearRecentSearchesText();
}
String AXWebAreaText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] AXWebAreaText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->AXWebAreaText();
}
String AXLinkText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] AXLinkText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->AXLinkText();
}
String AXListMarkerText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] AXListMarkerText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->AXListMarkerText();
}
String AXImageMapText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] AXImageMapText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->AXImageMapText();
}
String AXHeadingText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] AXHeadingText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->AXHeadingText();
}
String AXDefinitionListTermText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] AXDefinitionListTermText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->AXDefinitionListTermText();
}
-
+
String AXDefinitionListDefinitionText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] AXDefinitionListDefinitionText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->AXDefinitionListDefinitionText();
}
-
+
String AXARIAContentGroupText(const String& ariaType)
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] AXARIAContentGroupText:ariaType];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->AXARIAContentGroupText(ariaType);
}
String AXButtonActionVerb()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] AXButtonActionVerb];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->AXButtonActionVerb();
}
String AXRadioButtonActionVerb()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] AXRadioButtonActionVerb];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->AXRadioButtonActionVerb();
}
String AXTextFieldActionVerb()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] AXTextFieldActionVerb];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->AXTextFieldActionVerb();
}
String AXCheckedCheckBoxActionVerb()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] AXCheckedCheckBoxActionVerb];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->AXCheckedCheckBoxActionVerb();
}
String AXUncheckedCheckBoxActionVerb()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] AXUncheckedCheckBoxActionVerb];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->AXUncheckedCheckBoxActionVerb();
}
String AXLinkActionVerb()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] AXLinkActionVerb];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->AXLinkActionVerb();
}
String AXMenuListPopupActionVerb()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] AXMenuListPopupActionVerb];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->AXMenuListPopupActionVerb();
}
String AXMenuListActionVerb()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] AXMenuListActionVerb];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->AXMenuListActionVerb();
}
String missingPluginText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] missingPluginText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->missingPluginText();
}
String crashedPluginText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] crashedPluginText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->crashedPluginText();
}
String multipleFileUploadText(unsigned numberOfFiles)
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] multipleFileUploadTextForNumberOfFiles:numberOfFiles];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->multipleFileUploadText(numberOfFiles);
}
String unknownFileSizeText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] unknownFileSizeText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->unknownFileSizeText();
}
String imageTitle(const String& filename, const IntSize& size)
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] imageTitleForFilename:filename width:size.width() height:size.height()];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->imageTitle(filename, size);
}
String mediaElementLoadingStateText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] mediaElementLoadingStateText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->mediaElementLoadingStateText();
}
String mediaElementLiveBroadcastStateText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] mediaElementLiveBroadcastStateText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->mediaElementLiveBroadcastStateText();
}
String localizedMediaControlElementString(const String& controlName)
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] localizedMediaControlElementString:controlName];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->localizedMediaControlElementString(controlName);
}
String localizedMediaControlElementHelpText(const String& controlName)
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] localizedMediaControlElementHelpText:controlName];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->localizedMediaControlElementHelpText(controlName);
}
String localizedMediaTimeDescription(float time)
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] localizedMediaTimeDescription:time];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->localizedMediaTimeDescription(time);
}
String validationMessageValueMissingText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] validationMessageValueMissingText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->validationMessageValueMissingText();
}
String validationMessageTypeMismatchText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] validationMessageTypeMismatchText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->validationMessageTypeMismatchText();
}
String validationMessagePatternMismatchText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] validationMessagePatternMismatchText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->validationMessagePatternMismatchText();
}
String validationMessageTooLongText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] validationMessageTooLongText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->validationMessageTooLongText();
}
String validationMessageRangeUnderflowText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] validationMessageRangeUnderflowText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->validationMessageRangeUnderflowText();
}
String validationMessageRangeOverflowText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] validationMessageRangeOverflowText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->validationMessageRangeOverflowText();
}
String validationMessageStepMismatchText()
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[WebCoreViewFactory sharedFactory] validationMessageStepMismatchText];
- END_BLOCK_OBJC_EXCEPTIONS;
- return String();
+ return platformStrategies()->localizationStrategy()->validationMessageStepMismatchText();
}
-}
+} // namespace WebCore
diff --git a/WebCore/platform/network/FormDataBuilder.cpp b/WebCore/platform/network/FormDataBuilder.cpp
index fb78b08..da28fc2 100644
--- a/WebCore/platform/network/FormDataBuilder.cpp
+++ b/WebCore/platform/network/FormDataBuilder.cpp
@@ -25,7 +25,6 @@
#include "config.h"
#include "FormDataBuilder.h"
-#include "CSSHelper.h"
#include "Document.h"
#include "Frame.h"
#include "FrameLoader.h"
@@ -38,67 +37,6 @@
namespace WebCore {
-FormDataBuilder::FormDataBuilder()
- : m_isPostMethod(false)
- , m_isMultiPartForm(false)
- , m_encodingType("application/x-www-form-urlencoded")
-{
-}
-
-FormDataBuilder::~FormDataBuilder()
-{
-}
-
-void FormDataBuilder::parseAction(const String& action)
-{
- // FIXME: Can we parse into a KURL?
- m_action = deprecatedParseURL(action);
-}
-
-void FormDataBuilder::parseEncodingType(const String& type)
-{
- if (type.contains("multipart", false) || type.contains("form-data", false)) {
- m_encodingType = "multipart/form-data";
- m_isMultiPartForm = true;
- } else if (type.contains("text", false) || type.contains("plain", false)) {
- m_encodingType = "text/plain";
- m_isMultiPartForm = false;
- } else {
- m_encodingType = "application/x-www-form-urlencoded";
- m_isMultiPartForm = false;
- }
-}
-
-void FormDataBuilder::parseMethodType(const String& type)
-{
- if (equalIgnoringCase(type, "post"))
- m_isPostMethod = true;
- else if (equalIgnoringCase(type, "get"))
- m_isPostMethod = false;
-}
-
-TextEncoding FormDataBuilder::dataEncoding(Document* document) const
-{
- String acceptCharset = m_acceptCharset;
- acceptCharset.replace(',', ' ');
-
- Vector<String> charsets;
- acceptCharset.split(' ', charsets);
-
- TextEncoding encoding;
-
- Vector<String>::const_iterator end = charsets.end();
- for (Vector<String>::const_iterator it = charsets.begin(); it != end; ++it) {
- if ((encoding = TextEncoding(*it)).isValid())
- return encoding;
- }
-
- if (Frame* frame = document->frame())
- return frame->loader()->writer()->encoding();
-
- return Latin1Encoding();
-}
-
// Helper functions
static inline void append(Vector<char>& buffer, char string)
{
@@ -140,6 +78,28 @@ static void appendQuotedString(Vector<char>& buffer, const CString& string)
}
}
+TextEncoding FormDataBuilder::encodingFromAcceptCharset(const String& acceptCharset, Document* document)
+{
+ String normalizedAcceptCharset = acceptCharset;
+ normalizedAcceptCharset.replace(',', ' ');
+
+ Vector<String> charsets;
+ normalizedAcceptCharset.split(' ', charsets);
+
+ TextEncoding encoding;
+
+ Vector<String>::const_iterator end = charsets.end();
+ for (Vector<String>::const_iterator it = charsets.begin(); it != end; ++it) {
+ if ((encoding = TextEncoding(*it)).isValid())
+ return encoding;
+ }
+
+ if (Frame* frame = document->frame())
+ return frame->loader()->writer()->encoding();
+
+ return Latin1Encoding();
+}
+
Vector<char> FormDataBuilder::generateUniqueBoundaryString()
{
Vector<char> boundary;
diff --git a/WebCore/platform/network/FormDataBuilder.h b/WebCore/platform/network/FormDataBuilder.h
index 559906e..26b90af 100644
--- a/WebCore/platform/network/FormDataBuilder.h
+++ b/WebCore/platform/network/FormDataBuilder.h
@@ -36,31 +36,7 @@ class TextEncoding;
class FormDataBuilder : public Noncopyable {
public:
- FormDataBuilder();
- ~FormDataBuilder();
-
- bool isPostMethod() const { return m_isPostMethod; }
- void setIsPostMethod(bool value) { m_isPostMethod = value; }
-
- bool isMultiPartForm() const { return m_isMultiPartForm; }
- void setIsMultiPartForm(bool value) { m_isMultiPartForm = value; }
-
- const String& action() const { return m_action; }
-
- const String& target() const { return m_target; }
- void setTarget(const String& target) { m_target = target; }
-
- String encodingType() const { return m_encodingType; }
- void setEncodingType(const String& value) { m_encodingType = value; }
-
- String acceptCharset() const { return m_acceptCharset; }
- void setAcceptCharset(const String& value) { m_acceptCharset = value; }
-
- void parseAction(const String&);
- void parseEncodingType(const String&);
- void parseMethodType(const String&);
-
- TextEncoding dataEncoding(Document*) const;
+ static TextEncoding encodingFromAcceptCharset(const String& acceptCharset, Document* document);
// Helper functions used by HTMLFormElement/WMLGoElement for multi-part form data
static Vector<char> generateUniqueBoundaryString();
@@ -75,13 +51,7 @@ public:
static void encodeStringAsFormData(Vector<char>&, const WTF::CString&);
private:
- bool m_isPostMethod;
- bool m_isMultiPartForm;
-
- String m_action;
- String m_target;
- String m_encodingType;
- String m_acceptCharset;
+ FormDataBuilder() {}
};
}
diff --git a/WebCore/platform/qt/ClipboardQt.cpp b/WebCore/platform/qt/ClipboardQt.cpp
index 7d22349..6ca4830 100644
--- a/WebCore/platform/qt/ClipboardQt.cpp
+++ b/WebCore/platform/qt/ClipboardQt.cpp
@@ -31,6 +31,7 @@
#include "CSSHelper.h"
#include "CachedImage.h"
#include "Document.h"
+#include "DragData.h"
#include "Element.h"
#include "FileList.h"
#include "Frame.h"
@@ -68,6 +69,11 @@ static bool isHtmlMimeType(const String& type)
return type == "text/html" || type.startsWith("text/html;");
}
+PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData* dragData, Frame*)
+{
+ return ClipboardQt::create(policy, dragData->platformData());
+}
+
ClipboardQt::ClipboardQt(ClipboardAccessPolicy policy, const QMimeData* readableClipboard)
: Clipboard(policy, true)
, m_readableData(readableClipboard)
diff --git a/WebCore/platform/qt/DragDataQt.cpp b/WebCore/platform/qt/DragDataQt.cpp
index 808606d..4033123 100644
--- a/WebCore/platform/qt/DragDataQt.cpp
+++ b/WebCore/platform/qt/DragDataQt.cpp
@@ -26,7 +26,6 @@
#include "config.h"
#include "DragData.h"
-#include "ClipboardQt.h"
#include "Document.h"
#include "DocumentFragment.h"
#include "markup.h"
@@ -100,11 +99,6 @@ Color DragData::asColor() const
return qvariant_cast<QColor>(m_platformDragData->colorData());
}
-PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const
-{
- return ClipboardQt::create(policy, m_platformDragData);
-}
-
bool DragData::containsCompatibleContent() const
{
if (!m_platformDragData)
diff --git a/WebCore/platform/text/transcoder/FontTranscoder.cpp b/WebCore/platform/text/transcoder/FontTranscoder.cpp
index 12678e8..8e2f33f 100644
--- a/WebCore/platform/text/transcoder/FontTranscoder.cpp
+++ b/WebCore/platform/text/transcoder/FontTranscoder.cpp
@@ -32,6 +32,7 @@
#include "FontTranscoder.h"
#include "CharacterNames.h"
+#include "FontDescription.h"
#include "TextEncoding.h"
namespace WebCore {
@@ -59,8 +60,9 @@ FontTranscoder::FontTranscoder()
m_converterTypes.add(AtomicString(unicodeNameMeiryo, sizeof(unicodeNameMeiryo) / sizeof(UChar)), BackslashToYenSign);
}
-FontTranscoder::ConverterType FontTranscoder::converterType(const AtomicString& fontFamily, const TextEncoding* encoding) const
+FontTranscoder::ConverterType FontTranscoder::converterType(const FontDescription& fontDescription, const TextEncoding* encoding) const
{
+ const AtomicString& fontFamily = fontDescription.family().family().string();
if (!fontFamily.isNull()) {
HashMap<AtomicString, ConverterType>::const_iterator found = m_converterTypes.find(fontFamily);
if (found != m_converterTypes.end())
@@ -68,17 +70,16 @@ FontTranscoder::ConverterType FontTranscoder::converterType(const AtomicString&
}
// IE's default fonts for Japanese encodings change backslashes into yen signs.
- // FIXME: We don't need transcoding when the document explicitly
- // specifies a font which doesn't change backslashes into yen signs.
- if (encoding && encoding->backslashAsCurrencySymbol() != '\\')
+ // We emulate this behavior only when no font is explicitly specified.
+ if (encoding && encoding->backslashAsCurrencySymbol() != '\\' && !fontDescription.isSpecifiedFont())
return BackslashToYenSign;
return NoConversion;
}
-void FontTranscoder::convert(String& text, const AtomicString& fontFamily, const TextEncoding* encoding) const
+void FontTranscoder::convert(String& text, const FontDescription& fontDescription, const TextEncoding* encoding) const
{
- switch (converterType(fontFamily, encoding)) {
+ switch (converterType(fontDescription, encoding)) {
case BackslashToYenSign: {
// FIXME: TextEncoding.h has similar code. We need to factor them out.
text.replace('\\', yenSign);
@@ -90,9 +91,9 @@ void FontTranscoder::convert(String& text, const AtomicString& fontFamily, const
}
}
-bool FontTranscoder::needsTranscoding(const AtomicString& fontFamily, const TextEncoding* encoding) const
+bool FontTranscoder::needsTranscoding(const FontDescription& fontDescription, const TextEncoding* encoding) const
{
- ConverterType type = converterType(fontFamily, encoding);
+ ConverterType type = converterType(fontDescription, encoding);
return type != NoConversion;
}
diff --git a/WebCore/platform/text/transcoder/FontTranscoder.h b/WebCore/platform/text/transcoder/FontTranscoder.h
index f013453..1fdc936 100644
--- a/WebCore/platform/text/transcoder/FontTranscoder.h
+++ b/WebCore/platform/text/transcoder/FontTranscoder.h
@@ -37,12 +37,13 @@
namespace WebCore {
+class FontDescription;
class TextEncoding;
class FontTranscoder : public Noncopyable {
public:
- void convert(String& text, const AtomicString& fontFamily, const TextEncoding* = 0) const;
- bool needsTranscoding(const AtomicString& fontFamily, const TextEncoding* = 0) const;
+ void convert(String& text, const FontDescription&, const TextEncoding* = 0) const;
+ bool needsTranscoding(const FontDescription&, const TextEncoding* = 0) const;
private:
FontTranscoder();
@@ -52,7 +53,7 @@ private:
NoConversion, BackslashToYenSign,
};
- ConverterType converterType(const AtomicString& fontFamily, const TextEncoding*) const;
+ ConverterType converterType(const FontDescription&, const TextEncoding*) const;
HashMap<AtomicString, ConverterType> m_converterTypes;
diff --git a/WebCore/platform/win/BitmapInfo.cpp b/WebCore/platform/win/BitmapInfo.cpp
index 9a2312c..514f722 100644
--- a/WebCore/platform/win/BitmapInfo.cpp
+++ b/WebCore/platform/win/BitmapInfo.cpp
@@ -1,6 +1,8 @@
/*
* Copyright (C) 2009 Apple Inc. All Rights Reserved.
* Copyright (C) 2009 Brent Fulgham
+ * Copyright (C) 2007-2009 Torch Mobile, Inc. All Rights Reserved.
+ * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,16 +29,19 @@
#include "config.h"
#include "BitmapInfo.h"
+#include <wtf/Assertions.h>
+
namespace WebCore {
-BitmapInfo bitmapInfoForSize(int width, int height)
+BitmapInfo bitmapInfoForSize(int width, int height, WORD bitCount)
{
+ ASSERT_ARG(bitCount, bitCount == 16 || bitCount == 32);
+
BitmapInfo bitmapInfo;
- bitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- bitmapInfo.bmiHeader.biWidth = width;
+ bitmapInfo.bmiHeader.biWidth = width;
bitmapInfo.bmiHeader.biHeight = height;
bitmapInfo.bmiHeader.biPlanes = 1;
- bitmapInfo.bmiHeader.biBitCount = 32;
+ bitmapInfo.bmiHeader.biBitCount = bitCount;
bitmapInfo.bmiHeader.biCompression = BI_RGB;
bitmapInfo.bmiHeader.biSizeImage = 0;
bitmapInfo.bmiHeader.biXPelsPerMeter = 0;
@@ -53,14 +58,14 @@ BitmapInfo::BitmapInfo()
bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
}
-BitmapInfo BitmapInfo::create(const IntSize& size)
+BitmapInfo BitmapInfo::create(const IntSize& size, WORD bitCount)
{
- return bitmapInfoForSize(size.width(), size.height());
+ return bitmapInfoForSize(size.width(), size.height(), bitCount);
}
-BitmapInfo BitmapInfo::createBottomUp(const IntSize& size)
+BitmapInfo BitmapInfo::createBottomUp(const IntSize& size, WORD bitCount)
{
- return bitmapInfoForSize(size.width(), -size.height());
+ return bitmapInfoForSize(size.width(), -size.height(), bitCount);
}
} // namespace WebCore
diff --git a/WebCore/platform/win/BitmapInfo.h b/WebCore/platform/win/BitmapInfo.h
index 0127fdb..d1c3319 100644
--- a/WebCore/platform/win/BitmapInfo.h
+++ b/WebCore/platform/win/BitmapInfo.h
@@ -1,6 +1,8 @@
/*
* Copyright (C) 2009 Apple Inc. All Rights Reserved.
* Copyright (C) 2009 Brent Fulgham
+ * Copyright (C) 2007-2009 Torch Mobile, Inc. All Rights Reserved.
+ * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,17 +29,25 @@
#ifndef BitmapInfo_h
#define BitmapInfo_h
-#include <windows.h>
#include "IntSize.h"
+#include <windows.h>
namespace WebCore {
struct BitmapInfo : public BITMAPINFO {
- BitmapInfo ();
- static BitmapInfo create(const IntSize&);
- static BitmapInfo createBottomUp(const IntSize&);
-};
+ BitmapInfo();
+ static BitmapInfo create(const IntSize&, WORD bitCount = 32);
+ static BitmapInfo createBottomUp(const IntSize&, WORD bitCount = 32);
+ bool is16bit() const { return bmiHeader.biBitCount == 16; }
+ bool is32bit() const { return bmiHeader.biBitCount == 32; }
+ unsigned width() const { return abs(bmiHeader.biWidth); }
+ unsigned height() const { return abs(bmiHeader.biHeight); }
+ IntSize size() const { return IntSize(width(), height()); }
+ unsigned paddedWidth() const { return is16bit() ? (width() + 1) & ~0x1 : width(); }
+ unsigned numPixels() const { return paddedWidth() * height(); }
+ unsigned paddedBytesPerLine() const { return is16bit() ? paddedWidth() * 2 : width() * 4; }
+ unsigned bytesPerLine() const { return width() * bmiHeader.biBitCount / 8; }};
} // namespace WebCore
#endif // BitmapInfo_h
diff --git a/WebCore/platform/win/ClipboardUtilitiesWin.cpp b/WebCore/platform/win/ClipboardUtilitiesWin.cpp
index e6af7ef..0130a70 100644
--- a/WebCore/platform/win/ClipboardUtilitiesWin.cpp
+++ b/WebCore/platform/win/ClipboardUtilitiesWin.cpp
@@ -31,23 +31,47 @@
#include "PlatformString.h"
#include "TextEncoding.h"
#include "markup.h"
-#include <CoreFoundation/CoreFoundation.h>
#include <shlwapi.h>
#include <wininet.h> // for INTERNET_MAX_URL_LENGTH
-#include <wtf/RetainPtr.h>
#include <wtf/text/CString.h>
+#if PLATFORM(CF)
+#include <CoreFoundation/CoreFoundation.h>
+#include <wtf/RetainPtr.h>
+#endif
+
namespace WebCore {
+#if PLATFORM(CF)
FORMATETC* cfHDropFormat()
{
static FORMATETC urlFormat = {CF_HDROP, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
return &urlFormat;
}
+static bool urlFromPath(CFStringRef path, String& url)
+{
+ if (!path)
+ return false;
+
+ RetainPtr<CFURLRef> cfURL(AdoptCF, CFURLCreateWithFileSystemPath(0, path, kCFURLWindowsPathStyle, false));
+ if (!cfURL)
+ return false;
+
+ url = CFURLGetString(cfURL.get());
+
+ // Work around <rdar://problem/6708300>, where CFURLCreateWithFileSystemPath makes URLs with "localhost".
+ if (url.startsWith("file://localhost/"))
+ url.remove(7, 9);
+
+ return true;
+}
+#endif
+
static bool getWebLocData(IDataObject* dataObject, String& url, String* title)
{
bool succeeded = false;
+#if PLATFORM(CF)
WCHAR filename[MAX_PATH];
WCHAR urlBuffer[INTERNET_MAX_URL_LENGTH];
@@ -55,8 +79,8 @@ static bool getWebLocData(IDataObject* dataObject, String& url, String* title)
if (FAILED(dataObject->GetData(cfHDropFormat(), &medium)))
return false;
- HDROP hdrop = (HDROP)GlobalLock(medium.hGlobal);
-
+ HDROP hdrop = static_cast<HDROP>(GlobalLock(medium.hGlobal));
+
if (!hdrop)
return false;
@@ -81,6 +105,7 @@ exit:
// Free up memory.
DragFinish(hdrop);
GlobalUnlock(medium.hGlobal);
+#endif
return succeeded;
}
@@ -113,9 +138,9 @@ HGLOBAL createGlobalData(const KURL& url, const String& title)
HGLOBAL cbData = ::GlobalAlloc(GPTR, size * sizeof(UChar));
if (cbData) {
- PWSTR buffer = (PWSTR)::GlobalLock(cbData);
- swprintf_s(buffer, size, L"%s\n%s", mutableURL.charactersWithNullTermination(), mutableTitle.charactersWithNullTermination());
- ::GlobalUnlock(cbData);
+ PWSTR buffer = static_cast<PWSTR>(GlobalLock(cbData));
+ _snwprintf(buffer, size, L"%s\n%s", mutableURL.charactersWithNullTermination(), mutableTitle.charactersWithNullTermination());
+ GlobalUnlock(cbData);
}
return cbData;
}
@@ -125,10 +150,10 @@ HGLOBAL createGlobalData(const String& str)
HGLOBAL globalData = ::GlobalAlloc(GPTR, (str.length() + 1) * sizeof(UChar));
if (!globalData)
return 0;
- UChar* buffer = static_cast<UChar*>(::GlobalLock(globalData));
+ UChar* buffer = static_cast<UChar*>(GlobalLock(globalData));
memcpy(buffer, str.characters(), str.length() * sizeof(UChar));
buffer[str.length()] = 0;
- ::GlobalUnlock(globalData);
+ GlobalUnlock(globalData);
return globalData;
}
@@ -137,13 +162,30 @@ HGLOBAL createGlobalData(const Vector<char>& vector)
HGLOBAL globalData = ::GlobalAlloc(GPTR, vector.size() + 1);
if (!globalData)
return 0;
- char* buffer = static_cast<char*>(::GlobalLock(globalData));
+ char* buffer = static_cast<char*>(GlobalLock(globalData));
memcpy(buffer, vector.data(), vector.size());
buffer[vector.size()] = 0;
- ::GlobalUnlock(globalData);
+ GlobalUnlock(globalData);
return globalData;
}
+static String getFullCFHTML(IDataObject* data, bool& success)
+{
+ STGMEDIUM store;
+ if (SUCCEEDED(data->GetData(htmlFormat(), &store))) {
+ // MS HTML Format parsing
+ char* data = static_cast<char*>(GlobalLock(store.hGlobal));
+ SIZE_T dataSize = ::GlobalSize(store.hGlobal);
+ String cfhtml(UTF8Encoding().decode(data, dataSize));
+ GlobalUnlock(store.hGlobal);
+ ReleaseStgMedium(&store);
+ success = true;
+ return cfhtml;
+ }
+ success = false;
+ return String();
+}
+
static void append(Vector<char>& vector, const char* string)
{
vector.append(string, strlen(string));
@@ -154,6 +196,17 @@ static void append(Vector<char>& vector, const CString& string)
vector.append(string.data(), string.length());
}
+// Find the markup between "<!--StartFragment -->" and "<!--EndFragment -->", accounting for browser quirks.
+static String extractMarkupFromCFHTML(const String& cfhtml)
+{
+ unsigned markupStart = cfhtml.find("<html", 0, false);
+ unsigned tagStart = cfhtml.find("startfragment", markupStart, false);
+ unsigned fragmentStart = cfhtml.find('>', tagStart) + 1;
+ unsigned tagEnd = cfhtml.find("endfragment", fragmentStart, false);
+ unsigned fragmentEnd = cfhtml.reverseFind('<', tagEnd);
+ return cfhtml.substring(fragmentStart, fragmentEnd - fragmentStart).stripWhiteSpace();
+}
+
// Documentation for the CF_HTML format is available at http://msdn.microsoft.com/workshop/networking/clipboard/htmlclipboard.asp
void markupToCFHTML(const String& markup, const String& srcURL, Vector<char>& result)
{
@@ -271,24 +324,6 @@ FORMATETC* smartPasteFormat()
return &htmlFormat;
}
-static bool urlFromPath(CFStringRef path, String& url)
-{
- if (!path)
- return false;
-
- RetainPtr<CFURLRef> cfURL(AdoptCF, CFURLCreateWithFileSystemPath(0, path, kCFURLWindowsPathStyle, false));
- if (!cfURL)
- return false;
-
- url = CFURLGetString(cfURL.get());
-
- // Work around <rdar://problem/6708300>, where CFURLCreateWithFileSystemPath makes URLs with "localhost".
- if (url.startsWith("file://localhost/"))
- url.remove(7, 9);
-
- return true;
-}
-
String getURL(IDataObject* dataObject, DragData::FilenameConversionPolicy filenamePolicy, bool& success, String* title)
{
STGMEDIUM store;
@@ -298,22 +333,24 @@ String getURL(IDataObject* dataObject, DragData::FilenameConversionPolicy filena
success = true;
else if (SUCCEEDED(dataObject->GetData(urlWFormat(), &store))) {
// URL using Unicode
- UChar* data = (UChar*)GlobalLock(store.hGlobal);
+ UChar* data = static_cast<UChar*>(GlobalLock(store.hGlobal));
url = extractURL(String(data), title);
- GlobalUnlock(store.hGlobal);
+ GlobalUnlock(store.hGlobal);
ReleaseStgMedium(&store);
success = true;
} else if (SUCCEEDED(dataObject->GetData(urlFormat(), &store))) {
// URL using ASCII
- char* data = (char*)GlobalLock(store.hGlobal);
+ char* data = static_cast<char*>(GlobalLock(store.hGlobal));
url = extractURL(String(data), title);
- GlobalUnlock(store.hGlobal);
+ GlobalUnlock(store.hGlobal);
ReleaseStgMedium(&store);
success = true;
- } else if (filenamePolicy == DragData::ConvertFilenames) {
+ }
+#if PLATFORM(CF)
+ else if (filenamePolicy == DragData::ConvertFilenames) {
if (SUCCEEDED(dataObject->GetData(filenameWFormat(), &store))) {
// file using unicode
- wchar_t* data = (wchar_t*)GlobalLock(store.hGlobal);
+ wchar_t* data = static_cast<wchar_t*>(GlobalLock(store.hGlobal));
if (data && data[0] && (PathFileExists(data) || PathIsUNC(data))) {
RetainPtr<CFStringRef> pathAsCFString(AdoptCF, CFStringCreateWithCharacters(kCFAllocatorDefault, (const UniChar*)data, wcslen(data)));
if (urlFromPath(pathAsCFString.get(), url)) {
@@ -326,7 +363,7 @@ String getURL(IDataObject* dataObject, DragData::FilenameConversionPolicy filena
ReleaseStgMedium(&store);
} else if (SUCCEEDED(dataObject->GetData(filenameFormat(), &store))) {
// filename using ascii
- char* data = (char*)GlobalLock(store.hGlobal);
+ char* data = static_cast<char*>(GlobalLock(store.hGlobal));
if (data && data[0] && (PathFileExistsA(data) || PathIsUNCA(data))) {
RetainPtr<CFStringRef> pathAsCFString(AdoptCF, CFStringCreateWithCString(kCFAllocatorDefault, data, kCFStringEncodingASCII));
if (urlFromPath(pathAsCFString.get(), url)) {
@@ -339,6 +376,7 @@ String getURL(IDataObject* dataObject, DragData::FilenameConversionPolicy filena
ReleaseStgMedium(&store);
}
}
+#endif
return url;
}
@@ -349,14 +387,14 @@ String getPlainText(IDataObject* dataObject, bool& success)
success = false;
if (SUCCEEDED(dataObject->GetData(plainTextWFormat(), &store))) {
// Unicode text
- UChar* data = (UChar*)GlobalLock(store.hGlobal);
+ UChar* data = static_cast<UChar*>(GlobalLock(store.hGlobal));
text = String(data);
GlobalUnlock(store.hGlobal);
ReleaseStgMedium(&store);
success = true;
} else if (SUCCEEDED(dataObject->GetData(plainTextFormat(), &store))) {
// ASCII text
- char* data = (char*)GlobalLock(store.hGlobal);
+ char* data = static_cast<char*>(GlobalLock(store.hGlobal));
text = String(data);
GlobalUnlock(store.hGlobal);
ReleaseStgMedium(&store);
@@ -386,6 +424,14 @@ String getTextHTML(IDataObject* data, bool& success)
return html;
}
+String getCFHTML(IDataObject* data, bool& success)
+{
+ String cfhtml = getFullCFHTML(data, success);
+ if (success)
+ return extractMarkupFromCFHTML(cfhtml);
+ return String();
+}
+
PassRefPtr<DocumentFragment> fragmentFromFilenames(Document*, const IDataObject*)
{
// FIXME: We should be able to create fragments from files
@@ -400,7 +446,7 @@ bool containsFilenames(const IDataObject*)
// Convert a String containing CF_HTML formatted text to a DocumentFragment
PassRefPtr<DocumentFragment> fragmentFromCFHTML(Document* doc, const String& cfhtml)
-{
+{
// obtain baseURL if present
String srcURLStr("sourceURL:");
String srcURL;
@@ -413,38 +459,24 @@ PassRefPtr<DocumentFragment> fragmentFromCFHTML(Document* doc, const String& cfh
srcURL = rawSrcURL.stripWhiteSpace();
}
- // find the markup between "<!--StartFragment -->" and "<!--EndFragment -->", accounting for browser quirks
- unsigned markupStart = cfhtml.find("<html", 0, false);
- unsigned tagStart = cfhtml.find("startfragment", markupStart, false);
- unsigned fragmentStart = cfhtml.find('>', tagStart) + 1;
- unsigned tagEnd = cfhtml.find("endfragment", fragmentStart, false);
- unsigned fragmentEnd = cfhtml.reverseFind('<', tagEnd);
- String markup = cfhtml.substring(fragmentStart, fragmentEnd - fragmentStart).stripWhiteSpace();
-
+ String markup = extractMarkupFromCFHTML(cfhtml);
return createFragmentFromMarkup(doc, markup, srcURL, FragmentScriptingNotAllowed);
}
-
PassRefPtr<DocumentFragment> fragmentFromHTML(Document* doc, IDataObject* data)
{
if (!doc || !data)
return 0;
- STGMEDIUM store;
- String html;
- String srcURL;
- if (SUCCEEDED(data->GetData(htmlFormat(), &store))) {
- // MS HTML Format parsing
- char* data = (char*)GlobalLock(store.hGlobal);
- SIZE_T dataSize = ::GlobalSize(store.hGlobal);
- String cfhtml(UTF8Encoding().decode(data, dataSize));
- GlobalUnlock(store.hGlobal);
- ReleaseStgMedium(&store);
+ bool success = false;
+ String cfhtml = getFullCFHTML(data, success);
+ if (success) {
if (PassRefPtr<DocumentFragment> fragment = fragmentFromCFHTML(doc, cfhtml))
return fragment;
- }
- bool success = false;
- html = getTextHTML(data, success);
+ }
+
+ String html = getTextHTML(data, success);
+ String srcURL;
if (success)
return createFragmentFromMarkup(doc, html, srcURL, FragmentScriptingNotAllowed);
diff --git a/WebCore/platform/win/ClipboardUtilitiesWin.h b/WebCore/platform/win/ClipboardUtilitiesWin.h
index 4ca46f9..fe01499 100644
--- a/WebCore/platform/win/ClipboardUtilitiesWin.h
+++ b/WebCore/platform/win/ClipboardUtilitiesWin.h
@@ -64,6 +64,7 @@ PassRefPtr<DocumentFragment> fragmentFromCFHTML(Document*, const String& cfhtml)
String getURL(IDataObject*, DragData::FilenameConversionPolicy, bool& success, String* title = 0);
String getPlainText(IDataObject*, bool& success);
String getTextHTML(IDataObject*, bool& success);
+String getCFHTML(IDataObject*, bool& success);
} // namespace WebCore
diff --git a/WebCore/platform/win/ClipboardWin.cpp b/WebCore/platform/win/ClipboardWin.cpp
index 2cd6feb..6e026d6 100644
--- a/WebCore/platform/win/ClipboardWin.cpp
+++ b/WebCore/platform/win/ClipboardWin.cpp
@@ -70,7 +70,7 @@ static const char szShellDotUrlTemplate[] = "[InternetShortcut]\r\nURL=%s\r\n";
// We provide the IE clipboard types (URL and Text), and the clipboard types specified in the WHATWG Web Applications 1.0 draft
// see http://www.whatwg.org/specs/web-apps/current-work/ Section 6.3.5.3
-enum ClipboardDataType { ClipboardDataTypeNone, ClipboardDataTypeURL, ClipboardDataTypeText };
+enum ClipboardDataType { ClipboardDataTypeNone, ClipboardDataTypeURL, ClipboardDataTypeText, ClipboardDataTypeTextHTML };
static ClipboardDataType clipboardTypeFromMIMEType(const String& type)
{
@@ -81,6 +81,8 @@ static ClipboardDataType clipboardTypeFromMIMEType(const String& type)
return ClipboardDataTypeText;
if (qType == "url" || qType == "text/uri-list")
return ClipboardDataTypeURL;
+ if (qType == "text/html")
+ return ClipboardDataTypeTextHTML;
return ClipboardDataTypeNone;
}
@@ -393,17 +395,24 @@ exit:
return hr;
}
-ClipboardWin::ClipboardWin(bool isForDragging, IDataObject* dataObject, ClipboardAccessPolicy policy)
+PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData* dragData, Frame* frame)
+{
+ return ClipboardWin::create(true, dragData->platformData(), policy, frame);
+}
+
+ClipboardWin::ClipboardWin(bool isForDragging, IDataObject* dataObject, ClipboardAccessPolicy policy, Frame* frame)
: Clipboard(policy, isForDragging)
, m_dataObject(dataObject)
, m_writableDataObject(0)
+ , m_frame(frame)
{
}
-ClipboardWin::ClipboardWin(bool isForDragging, WCDataObject* dataObject, ClipboardAccessPolicy policy)
+ClipboardWin::ClipboardWin(bool isForDragging, WCDataObject* dataObject, ClipboardAccessPolicy policy, Frame* frame)
: Clipboard(policy, isForDragging)
, m_dataObject(dataObject)
, m_writableDataObject(dataObject)
+ , m_frame(frame)
{
}
@@ -498,6 +507,12 @@ String ClipboardWin::getData(const String& type, bool& success) const
return getPlainText(m_dataObject.get(), success);
if (dataType == ClipboardDataTypeURL)
return getURL(m_dataObject.get(), DragData::DoNotConvertFilenames, success);
+ else if (dataType == ClipboardDataTypeTextHTML) {
+ String data = getTextHTML(m_dataObject.get(), success);
+ if (success)
+ return data;
+ return getCFHTML(m_dataObject.get(), success);
+ }
return "";
}
@@ -589,12 +604,13 @@ PassRefPtr<FileList> ClipboardWin::files() const
if (!hdrop)
return files.release();
+ ScriptExecutionContext* scriptExecutionContext = m_frame->document()->scriptExecutionContext();
WCHAR filename[MAX_PATH];
UINT fileCount = DragQueryFileW(hdrop, 0xFFFFFFFF, 0, 0);
for (UINT i = 0; i < fileCount; i++) {
if (!DragQueryFileW(hdrop, i, filename, ARRAYSIZE(filename)))
continue;
- files->append(File::create(reinterpret_cast<UChar*>(filename)));
+ files->append(File::create(scriptExecutionContext, reinterpret_cast<UChar*>(filename)));
}
GlobalUnlock(medium.hGlobal);
diff --git a/WebCore/platform/win/ClipboardWin.h b/WebCore/platform/win/ClipboardWin.h
index 1b139ed..6a08087 100644
--- a/WebCore/platform/win/ClipboardWin.h
+++ b/WebCore/platform/win/ClipboardWin.h
@@ -35,19 +35,20 @@ struct IDataObject;
namespace WebCore {
class CachedImage;
+class Frame;
class IntPoint;
class WCDataObject;
// State available during IE's events for drag and drop and copy/paste
class ClipboardWin : public Clipboard, public CachedResourceClient {
public:
- static PassRefPtr<ClipboardWin> create(bool isForDragging, IDataObject* dataObject, ClipboardAccessPolicy policy)
+ static PassRefPtr<ClipboardWin> create(bool isForDragging, IDataObject* dataObject, ClipboardAccessPolicy policy, Frame* frame)
{
- return adoptRef(new ClipboardWin(isForDragging, dataObject, policy));
+ return adoptRef(new ClipboardWin(isForDragging, dataObject, policy, frame));
}
- static PassRefPtr<ClipboardWin> create(bool isForDragging, WCDataObject* dataObject, ClipboardAccessPolicy policy)
+ static PassRefPtr<ClipboardWin> create(bool isForDragging, WCDataObject* dataObject, ClipboardAccessPolicy policy, Frame* frame)
{
- return adoptRef(new ClipboardWin(isForDragging, dataObject, policy));
+ return adoptRef(new ClipboardWin(isForDragging, dataObject, policy, frame));
}
~ClipboardWin();
@@ -76,8 +77,8 @@ public:
void setExternalDataObject(IDataObject *dataObject);
private:
- ClipboardWin(bool isForDragging, IDataObject*, ClipboardAccessPolicy);
- ClipboardWin(bool isForDragging, WCDataObject*, ClipboardAccessPolicy);
+ ClipboardWin(bool isForDragging, IDataObject*, ClipboardAccessPolicy, Frame*);
+ ClipboardWin(bool isForDragging, WCDataObject*, ClipboardAccessPolicy, Frame*);
void resetFromClipboard();
void setDragImage(CachedImage*, Node*, const IntPoint&);
diff --git a/WebCore/platform/win/DragDataWin.cpp b/WebCore/platform/win/DragDataWin.cpp
index 82e537e..05f9103 100644
--- a/WebCore/platform/win/DragDataWin.cpp
+++ b/WebCore/platform/win/DragDataWin.cpp
@@ -26,9 +26,7 @@
#include "config.h"
#include "DragData.h"
-#include "ClipboardWin.h"
#include "ClipboardUtilitiesWin.h"
-#include "ClipboardAccessPolicy.h"
#include "DocumentFragment.h"
#include "PlatformString.h"
#include "Markup.h"
@@ -39,11 +37,6 @@
namespace WebCore {
-PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const
-{
- return ClipboardWin::create(true, m_platformDragData, policy);
-}
-
bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const
{
return SUCCEEDED(m_platformDragData->QueryGetData(urlWFormat()))
diff --git a/WebCore/platform/win/EditorWin.cpp b/WebCore/platform/win/EditorWin.cpp
index 09abdbd..075827d 100644
--- a/WebCore/platform/win/EditorWin.cpp
+++ b/WebCore/platform/win/EditorWin.cpp
@@ -30,6 +30,7 @@
#include "ClipboardWin.h"
#include "Document.h"
#include "Element.h"
+#include "Frame.h"
#include "htmlediting.h"
#include "TextIterator.h"
#include "visible_units.h"
@@ -38,13 +39,13 @@
namespace WebCore {
-PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy)
+PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame* frame)
{
COMPtr<IDataObject> clipboardData;
if (!SUCCEEDED(OleGetClipboard(&clipboardData)))
clipboardData = 0;
- return ClipboardWin::create(false, clipboardData.get(), policy);
+ return ClipboardWin::create(false, clipboardData.get(), policy, frame);
}
} // namespace WebCore
diff --git a/WebCore/platform/win/PasteboardWin.cpp b/WebCore/platform/win/PasteboardWin.cpp
index 808c863..03ecd36 100644
--- a/WebCore/platform/win/PasteboardWin.cpp
+++ b/WebCore/platform/win/PasteboardWin.cpp
@@ -52,7 +52,6 @@ static UINT WebSmartPasteFormat = 0;
static LRESULT CALLBACK PasteboardOwnerWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
LRESULT lresult = 0;
- LONG_PTR longPtr = GetWindowLongPtr(hWnd, 0);
switch (message) {
case WM_RENDERFORMAT:
@@ -64,12 +63,14 @@ static LRESULT CALLBACK PasteboardOwnerWndProc(HWND hWnd, UINT message, WPARAM w
// and now this application is about to quit, so it must put data on
// the clipboard before it exits.
break;
- case WM_DRAWCLIPBOARD:
- break;
case WM_DESTROY:
break;
+#if !OS(WINCE)
+ case WM_DRAWCLIPBOARD:
+ break;
case WM_CHANGECBCHAIN:
break;
+#endif
default:
lresult = DefWindowProc(hWnd, message, wParam, lParam);
break;
@@ -84,17 +85,21 @@ Pasteboard* Pasteboard::generalPasteboard()
}
Pasteboard::Pasteboard()
-{
- // make a dummy HWND to be the Windows clipboard's owner
- WNDCLASSEX wcex = {0};
- wcex.cbSize = sizeof(WNDCLASSEX);
- wcex.lpfnWndProc = PasteboardOwnerWndProc;
- wcex.hInstance = WebCore::instanceHandle();
- wcex.lpszClassName = L"PasteboardOwnerWindowClass";
- ::RegisterClassEx(&wcex);
+{
+ HWND hWndParent = 0;
+#if !OS(WINCE)
+ hWndParent = HWND_MESSAGE;
+#endif
+
+ WNDCLASS wc;
+ memset(&wc, 0, sizeof(WNDCLASS));
+ wc.lpfnWndProc = PasteboardOwnerWndProc;
+ wc.hInstance = WebCore::instanceHandle();
+ wc.lpszClassName = L"PasteboardOwnerWindowClass";
+ RegisterClass(&wc);
m_owner = ::CreateWindow(L"PasteboardOwnerWindowClass", L"PasteboardOwnerWindow", 0, 0, 0, 0, 0,
- HWND_MESSAGE, 0, 0, 0);
+ hWndParent, 0, 0, 0);
HTMLClipboardFormat = ::RegisterClipboardFormat(L"HTML Format");
BookmarkClipboardFormat = ::RegisterClipboardFormat(L"UniformResourceLocatorW");
@@ -216,31 +221,34 @@ void Pasteboard::writeImage(Node* node, const KURL&, const String&)
HDC dc = GetDC(0);
HDC compatibleDC = CreateCompatibleDC(0);
HDC sourceDC = CreateCompatibleDC(0);
- HBITMAP resultBitmap = CreateCompatibleBitmap(dc, image->width(), image->height());
- HBITMAP oldBitmap = (HBITMAP)SelectObject(compatibleDC, resultBitmap);
+ OwnPtr<HBITMAP> resultBitmap(CreateCompatibleBitmap(dc, image->width(), image->height()));
+ HGDIOBJ oldBitmap = SelectObject(compatibleDC, resultBitmap.get());
BitmapInfo bmInfo = BitmapInfo::create(image->size());
HBITMAP coreBitmap = CreateDIBSection(dc, &bmInfo, DIB_RGB_COLORS, 0, 0, 0);
- HBITMAP oldSource = (HBITMAP)SelectObject(sourceDC, coreBitmap);
+ HGDIOBJ oldSource = SelectObject(sourceDC, coreBitmap);
image->getHBITMAP(coreBitmap);
+#if !defined(NO_ALPHABLEND)
BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA};
AlphaBlend(compatibleDC, 0, 0, image->width(), image->height(),
sourceDC, 0, 0, image->width(), image->height(), bf);
+#else
+ StretchBlt(compatibleDC, 0, 0, image->width(), image->height(),
+ sourceDC, 0, 0, image->width(), image->height(), SRCCOPY);
+#endif
- SelectObject(compatibleDC, oldBitmap);
SelectObject(sourceDC, oldSource);
-
- DeleteObject(oldBitmap);
- DeleteObject(oldSource);
DeleteObject(coreBitmap);
- ReleaseDC(0, dc);
- DeleteDC(compatibleDC);
+
+ SelectObject(compatibleDC, oldBitmap);
DeleteDC(sourceDC);
+ DeleteDC(compatibleDC);
+ ReleaseDC(0, dc);
if (::OpenClipboard(m_owner)) {
- ::SetClipboardData(CF_BITMAP, resultBitmap);
+ ::SetClipboardData(CF_BITMAP, resultBitmap.leakPtr());
::CloseClipboard();
}
}
@@ -255,9 +263,9 @@ String Pasteboard::plainText(Frame* frame)
if (::IsClipboardFormatAvailable(CF_UNICODETEXT) && ::OpenClipboard(m_owner)) {
HANDLE cbData = ::GetClipboardData(CF_UNICODETEXT);
if (cbData) {
- UChar* buffer = (UChar*)::GlobalLock(cbData);
+ UChar* buffer = static_cast<UChar*>(GlobalLock(cbData));
String fromClipboard(buffer);
- ::GlobalUnlock(cbData);
+ GlobalUnlock(cbData);
::CloseClipboard();
return fromClipboard;
}
@@ -267,9 +275,9 @@ String Pasteboard::plainText(Frame* frame)
if (::IsClipboardFormatAvailable(CF_TEXT) && ::OpenClipboard(m_owner)) {
HANDLE cbData = ::GetClipboardData(CF_TEXT);
if (cbData) {
- char* buffer = (char*)::GlobalLock(cbData);
+ char* buffer = static_cast<char*>(GlobalLock(cbData));
String fromClipboard(buffer);
- ::GlobalUnlock(cbData);
+ GlobalUnlock(cbData);
::CloseClipboard();
return fromClipboard;
}
@@ -288,8 +296,8 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP
HANDLE cbData = ::GetClipboardData(HTMLClipboardFormat);
if (cbData) {
SIZE_T dataSize = ::GlobalSize(cbData);
- String cfhtml(UTF8Encoding().decode((char*)::GlobalLock(cbData), dataSize));
- ::GlobalUnlock(cbData);
+ String cfhtml(UTF8Encoding().decode(static_cast<char*>(GlobalLock(cbData)), dataSize));
+ GlobalUnlock(cbData);
::CloseClipboard();
PassRefPtr<DocumentFragment> fragment = fragmentFromCFHTML(frame->document(), cfhtml);
@@ -304,9 +312,9 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP
if (::OpenClipboard(m_owner)) {
HANDLE cbData = ::GetClipboardData(CF_UNICODETEXT);
if (cbData) {
- UChar* buffer = (UChar*)GlobalLock(cbData);
+ UChar* buffer = static_cast<UChar*>(GlobalLock(cbData));
String str(buffer);
- ::GlobalUnlock(cbData);
+ GlobalUnlock(cbData);
::CloseClipboard();
RefPtr<DocumentFragment> fragment = createFragmentFromText(context.get(), str);
if (fragment)
@@ -321,9 +329,9 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP
if (::OpenClipboard(m_owner)) {
HANDLE cbData = ::GetClipboardData(CF_TEXT);
if (cbData) {
- char* buffer = (char*)GlobalLock(cbData);
+ char* buffer = static_cast<char*>(GlobalLock(cbData));
String str(buffer);
- ::GlobalUnlock(cbData);
+ GlobalUnlock(cbData);
::CloseClipboard();
RefPtr<DocumentFragment> fragment = createFragmentFromText(context.get(), str);
if (fragment)
diff --git a/WebCore/platform/win/PopupMenuWin.cpp b/WebCore/platform/win/PopupMenuWin.cpp
index 44141f2..4bc6dc7 100644
--- a/WebCore/platform/win/PopupMenuWin.cpp
+++ b/WebCore/platform/win/PopupMenuWin.cpp
@@ -199,6 +199,7 @@ void PopupMenu::show(const IntRect& r, FrameView* view, int index)
break;
// Steal mouse messages.
+#if !OS(WINCE)
case WM_NCMOUSEMOVE:
case WM_NCLBUTTONDOWN:
case WM_NCLBUTTONUP:
@@ -209,6 +210,7 @@ void PopupMenu::show(const IntRect& r, FrameView* view, int index)
case WM_NCMBUTTONDOWN:
case WM_NCMBUTTONUP:
case WM_NCMBUTTONDBLCLK:
+#endif
case WM_MOUSEWHEEL:
msg.hwnd = m_popup;
break;
@@ -578,7 +580,7 @@ void PopupMenu::paint(const IntRect& damageRect, HDC hdc)
}
if (!m_bmp) {
#if OS(WINCE)
- BitmapInfo bitmapInfo(true, clientRect().width(), clientRect().height());
+ BitmapInfo bitmapInfo = BitmapInfo::createBottomUp(clientRect().size(), 16);
#else
BitmapInfo bitmapInfo = BitmapInfo::createBottomUp(clientRect().size());
#endif
@@ -774,9 +776,10 @@ LRESULT PopupMenu::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
LRESULT lResult = 0;
switch (message) {
+#if !OS(WINCE)
case WM_MOUSEACTIVATE:
return MA_NOACTIVATE;
-
+#endif
case WM_SIZE: {
if (!scrollbar())
break;
diff --git a/WebCore/platform/wince/DragDataWince.cpp b/WebCore/platform/wince/DragDataWince.cpp
index 5f2a7ba..73dd8a2 100644
--- a/WebCore/platform/wince/DragDataWince.cpp
+++ b/WebCore/platform/wince/DragDataWince.cpp
@@ -21,17 +21,11 @@
#include "config.h"
#include "DragData.h"
-#include "Clipboard.h"
#include "DocumentFragment.h"
#include "PlatformString.h"
namespace WebCore {
-PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const
-{
- return 0;
-}
-
bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const
{
return false;
diff --git a/WebCore/platform/wince/EditorWince.cpp b/WebCore/platform/wince/EditorWince.cpp
index 02af780..71f4db9 100644
--- a/WebCore/platform/wince/EditorWince.cpp
+++ b/WebCore/platform/wince/EditorWince.cpp
@@ -35,7 +35,7 @@
namespace WebCore {
-PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy)
+PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
{
return adoptRef(new ClipboardWince(policy, false));
}
diff --git a/WebCore/platform/wx/ClipboardWx.cpp b/WebCore/platform/wx/ClipboardWx.cpp
index 6100831..25bef55 100644
--- a/WebCore/platform/wx/ClipboardWx.cpp
+++ b/WebCore/platform/wx/ClipboardWx.cpp
@@ -37,6 +37,11 @@
namespace WebCore {
+PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy, DragData*, Frame*)
+{
+ return 0;
+}
+
ClipboardWx::ClipboardWx(ClipboardAccessPolicy policy, bool forDragging)
: Clipboard(policy, forDragging)
{
diff --git a/WebCore/platform/wx/DragDataWx.cpp b/WebCore/platform/wx/DragDataWx.cpp
index 278f123..35e3753 100644
--- a/WebCore/platform/wx/DragDataWx.cpp
+++ b/WebCore/platform/wx/DragDataWx.cpp
@@ -26,7 +26,6 @@
#include "config.h"
#include "DragData.h"
-#include "Clipboard.h"
#include "Document.h"
#include "DocumentFragment.h"
@@ -66,11 +65,6 @@ Color DragData::asColor() const
return Color();
}
-PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy) const
-{
- return 0;
-}
-
bool DragData::containsCompatibleContent() const
{
return false;
diff --git a/WebCore/platform/wx/MouseEventWx.cpp b/WebCore/platform/wx/MouseEventWx.cpp
index 4f39598..8591ef5 100644
--- a/WebCore/platform/wx/MouseEventWx.cpp
+++ b/WebCore/platform/wx/MouseEventWx.cpp
@@ -37,7 +37,7 @@ PlatformMouseEvent::PlatformMouseEvent(const wxMouseEvent& event, const wxPoint&
: m_position(event.GetPosition())
, m_globalPosition(globalPoint)
, m_shiftKey(event.ShiftDown())
- , m_ctrlKey(event.CmdDown())
+ , m_ctrlKey(event.CmdDown() || event.ControlDown())
, m_altKey(event.AltDown())
, m_metaKey(event.MetaDown()) // FIXME: We'll have to test other browsers
{
diff --git a/WebCore/plugins/PluginViewBase.h b/WebCore/plugins/PluginViewBase.h
index 9d3f463..3c43c00 100644
--- a/WebCore/plugins/PluginViewBase.h
+++ b/WebCore/plugins/PluginViewBase.h
@@ -28,6 +28,12 @@
#include "Widget.h"
#include "GraphicsLayer.h"
+namespace JSC {
+ class ExecState;
+ class JSGlobalObject;
+ class JSObject;
+}
+
namespace WebCore {
// PluginViewBase is a widget that all plug-in views inherit from, both in Webkit and WebKit2.
@@ -38,6 +44,8 @@ public:
virtual PlatformLayer* platformLayer() const { return 0; }
#endif
+ virtual JSC::JSObject* scriptObject(JSC::ExecState*, JSC::JSGlobalObject*) { return 0; }
+
protected:
PluginViewBase(PlatformWidget widget) : Widget(widget) { }
diff --git a/WebCore/plugins/win/PluginDatabaseWin.cpp b/WebCore/plugins/win/PluginDatabaseWin.cpp
index 71bcdb5..5d86117 100644
--- a/WebCore/plugins/win/PluginDatabaseWin.cpp
+++ b/WebCore/plugins/win/PluginDatabaseWin.cpp
@@ -40,7 +40,9 @@
#if OS(WINCE)
// WINCE doesn't support Registry Key Access Rights. The parameter should always be 0
+#ifndef KEY_ENUMERATE_SUB_KEYS
#define KEY_ENUMERATE_SUB_KEYS 0
+#endif
DWORD SHGetValue(HKEY hkey, LPCWSTR pszSubKey, LPCWSTR pszValue, LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData)
{
diff --git a/WebCore/rendering/AutoTableLayout.cpp b/WebCore/rendering/AutoTableLayout.cpp
index 1633d88..ea8b416 100644
--- a/WebCore/rendering/AutoTableLayout.cpp
+++ b/WebCore/rendering/AutoTableLayout.cpp
@@ -66,9 +66,9 @@ void AutoTableLayout::recalcColumn(int effCol)
int numRows = section->numRows();
for (int i = 0; i < numRows; i++) {
RenderTableSection::CellStruct current = section->cellAt(i, effCol);
- RenderTableCell* cell = current.cell;
+ RenderTableCell* cell = current.primaryCell();
- bool cellHasContent = cell && (cell->firstChild() || cell->style()->hasBorder() || cell->style()->hasPadding());
+ bool cellHasContent = cell && !current.inColSpan && (cell->firstChild() || cell->style()->hasBorder() || cell->style()->hasPadding());
if (cellHasContent)
l.emptyCellsOnly = false;
@@ -125,7 +125,7 @@ void AutoTableLayout::recalcColumn(int effCol)
break;
}
} else {
- if (cell && (!effCol || section->cellAt(i, effCol-1).cell != cell)) {
+ if (cell && (!effCol || section->primaryCellAt(i, effCol-1) != cell)) {
// This spanning cell originates in this column. Ensure we have
// a min/max width of at least 1px for this column now.
l.minWidth = max(l.minWidth, cellHasContent ? 1 : 0);
diff --git a/WebCore/rendering/HitTestRequest.h b/WebCore/rendering/HitTestRequest.h
index 97d8680..745791a 100644
--- a/WebCore/rendering/HitTestRequest.h
+++ b/WebCore/rendering/HitTestRequest.h
@@ -35,7 +35,9 @@ public:
SVGClipContent = 1 << 6
};
- HitTestRequest(int requestType)
+ typedef unsigned HitTestRequestType;
+
+ HitTestRequest(HitTestRequestType requestType)
: m_requestType(requestType)
{
}
@@ -48,7 +50,7 @@ public:
bool svgClipContent() const { return m_requestType & SVGClipContent; }
private:
- int m_requestType;
+ HitTestRequestType m_requestType;
};
} // namespace WebCore
diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp
index 077baeb..4ddd66b 100644
--- a/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/WebCore/rendering/RenderBoxModelObject.cpp
@@ -1008,13 +1008,18 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
graphicsContext->addPath(roundedPath);
}
+ bool upperLeftBorderStylesMatch = renderLeft && (topStyle == leftStyle) && (topColor == leftColor);
+ bool upperRightBorderStylesMatch = renderRight && (topStyle == rightStyle) && (topColor == rightColor) && (topStyle != OUTSET) && (topStyle != RIDGE) && (topStyle != INSET) && (topStyle != GROOVE);
+ bool lowerLeftBorderStylesMatch = renderLeft && (bottomStyle == leftStyle) && (bottomColor == leftColor) && (bottomStyle != OUTSET) && (bottomStyle != RIDGE) && (bottomStyle != INSET) && (bottomStyle != GROOVE);
+ bool lowerRightBorderStylesMatch = renderRight && (bottomStyle == rightStyle) && (bottomColor == rightColor);
+
if (renderTop) {
int x = tx;
int x2 = tx + w;
if (renderRadii && borderWillArcInnerEdge(topLeft, topRight, style->borderLeftWidth(), style->borderRightWidth(), style->borderTopWidth())) {
graphicsContext->save();
- clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSTop, style);
+ clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSTop, upperLeftBorderStylesMatch, upperRightBorderStylesMatch, style);
float thickness = max(max(style->borderTopWidth(), style->borderLeftWidth()), style->borderRightWidth());
drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderTopWidth(), thickness, BSTop, style, topColor, topStyle);
graphicsContext->restore();
@@ -1035,7 +1040,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
if (renderRadii && borderWillArcInnerEdge(bottomLeft, bottomRight, style->borderLeftWidth(), style->borderRightWidth(), style->borderBottomWidth())) {
graphicsContext->save();
- clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSBottom, style);
+ clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSBottom, lowerLeftBorderStylesMatch, lowerRightBorderStylesMatch, style);
float thickness = max(max(style->borderBottomWidth(), style->borderLeftWidth()), style->borderRightWidth());
drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderBottomWidth(), thickness, BSBottom, style, bottomColor, bottomStyle);
graphicsContext->restore();
@@ -1058,7 +1063,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
if (renderRadii && borderWillArcInnerEdge(bottomLeft, topLeft, style->borderBottomWidth(), style->borderTopWidth(), style->borderLeftWidth())) {
graphicsContext->save();
- clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSLeft, style);
+ clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSLeft, upperLeftBorderStylesMatch, lowerLeftBorderStylesMatch, style);
float thickness = max(max(style->borderLeftWidth(), style->borderTopWidth()), style->borderBottomWidth());
drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderLeftWidth(), thickness, BSLeft, style, leftColor, leftStyle);
graphicsContext->restore();
@@ -1077,7 +1082,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
if (renderRight) {
if (renderRadii && borderWillArcInnerEdge(bottomRight, topRight, style->borderBottomWidth(), style->borderTopWidth(), style->borderRightWidth())) {
graphicsContext->save();
- clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSRight, style);
+ clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSRight, upperRightBorderStylesMatch, lowerRightBorderStylesMatch, style);
float thickness = max(max(style->borderRightWidth(), style->borderTopWidth()), style->borderBottomWidth());
drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderRightWidth(), thickness, BSRight, style, rightColor, rightStyle);
graphicsContext->restore();
@@ -1455,7 +1460,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
}
#endif
-void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContext, const IntRect& box, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const BoxSide side, const RenderStyle* style)
+void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContext, const IntRect& box, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const BoxSide side, bool firstEdgeMatches, bool secondEdgeMatches, const RenderStyle* style)
{
FloatPoint quad[4];
int tx = box.x();
@@ -1510,7 +1515,28 @@ void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContex
break;
}
- graphicsContext->clipConvexPolygon(4, quad);
+ // If the border matches both of its adjacent sides, don't anti-alias the clip, and
+ // if neither side matches, anti-alias the clip.
+ if (firstEdgeMatches == secondEdgeMatches) {
+ graphicsContext->clipConvexPolygon(4, quad, !firstEdgeMatches);
+ return;
+ }
+
+ FloatPoint firstQuad[4];
+ firstQuad[0] = quad[0];
+ firstQuad[1] = quad[1];
+ firstQuad[2] = side == BSTop || side == BSBottom ? FloatPoint(quad[3].x(), quad[2].y())
+ : firstQuad[2] = FloatPoint(quad[2].x(), quad[3].y());
+ firstQuad[3] = quad[3];
+ graphicsContext->clipConvexPolygon(4, firstQuad, !firstEdgeMatches);
+
+ FloatPoint secondQuad[4];
+ secondQuad[0] = quad[0];
+ secondQuad[1] = side == BSTop || side == BSBottom ? FloatPoint(quad[0].x(), quad[1].y())
+ : FloatPoint(quad[1].x(), quad[0].y());
+ secondQuad[2] = quad[2];
+ secondQuad[3] = quad[3];
+ graphicsContext->clipConvexPolygon(4, secondQuad, !secondEdgeMatches);
}
void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int ty, int w, int h, const RenderStyle* s, ShadowStyle shadowStyle, bool begin, bool end)
diff --git a/WebCore/rendering/RenderBoxModelObject.h b/WebCore/rendering/RenderBoxModelObject.h
index 45602f0..49d5f3d 100644
--- a/WebCore/rendering/RenderBoxModelObject.h
+++ b/WebCore/rendering/RenderBoxModelObject.h
@@ -115,7 +115,7 @@ private:
IntSize calculateFillTileSize(const FillLayer*, IntSize scaledSize) const;
- void clipBorderSidePolygon(GraphicsContext*, const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const BoxSide side, const RenderStyle* style);
+ void clipBorderSidePolygon(GraphicsContext*, const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const BoxSide side, bool firstEdgeMatches, bool secondEdgeMatches, const RenderStyle* style);
friend class RenderView;
diff --git a/WebCore/rendering/RenderInline.h b/WebCore/rendering/RenderInline.h
index a719a50..71a8a89 100644
--- a/WebCore/rendering/RenderInline.h
+++ b/WebCore/rendering/RenderInline.h
@@ -74,6 +74,9 @@ public:
int verticalPositionFromCache(bool firstLine) const;
void invalidateVerticalPosition() { m_verticalPosition = PositionUndefined; }
+protected:
+ virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
+
private:
virtual RenderObjectChildList* virtualChildren() { return children(); }
virtual const RenderObjectChildList* virtualChildren() const { return children(); }
@@ -139,7 +142,6 @@ private:
virtual void addDashboardRegions(Vector<DashboardRegionValue>&);
#endif
- virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
virtual void updateBoxModelInfoFromStyle();
static RenderInline* cloneInline(RenderInline* src);
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp
index 368a1a7..756a9b3 100644
--- a/WebCore/rendering/RenderLayer.cpp
+++ b/WebCore/rendering/RenderLayer.cpp
@@ -1447,7 +1447,7 @@ void RenderLayer::scrollRectToVisible(const IntRect& rect, bool scrollToAnchor,
newRect.setX(rect.x() - frameView->scrollX() + frameView->x());
newRect.setY(rect.y() - frameView->scrollY() + frameView->y());
} else {
- IntRect viewRect = frameView->visibleContentRect(true);
+ IntRect viewRect = frameView->visibleContentRect();
IntRect r = getRectToExpose(viewRect, rect, alignX, alignY);
frameView->setScrollPosition(r.location());
diff --git a/WebCore/rendering/RenderLayerBacking.cpp b/WebCore/rendering/RenderLayerBacking.cpp
index 2bc6a88..d66dfc2 100644
--- a/WebCore/rendering/RenderLayerBacking.cpp
+++ b/WebCore/rendering/RenderLayerBacking.cpp
@@ -144,19 +144,14 @@ static bool hasNonZeroTransformOrigin(const RenderObject* renderer)
|| (style->transformOriginY().type() == Fixed && style->transformOriginY().value());
}
-static RenderLayer* enclosingOverflowClipAncestor(RenderLayer* layer, bool& crossesTransform)
+static bool layerOrAncestorIsTransformed(RenderLayer* layer)
{
- crossesTransform = false;
-
- for (RenderLayer* curr = layer->parent(); curr; curr = curr->parent()) {
- if (curr->renderer()->hasOverflowClip())
- return curr;
-
+ for (RenderLayer* curr = layer; curr; curr = curr->parent()) {
if (curr->hasTransform())
- crossesTransform = true;
+ return true;
}
- return 0;
+ return false;
}
void RenderLayerBacking::updateCompositedBounds()
@@ -164,38 +159,24 @@ void RenderLayerBacking::updateCompositedBounds()
IntRect layerBounds = compositor()->calculateCompositedBounds(m_owningLayer, m_owningLayer);
// Clip to the size of the document or enclosing overflow-scroll layer.
- if (compositor()->compositingConsultsOverlap() && !m_owningLayer->hasTransform()) {
- bool crossesTransform;
- RenderLayer* overflowAncestor = enclosingOverflowClipAncestor(m_owningLayer, crossesTransform);
- // If an ancestor is transformed, we can't currently compute the correct rect to intersect with.
- // We'd need RenderObject::convertContainerToLocalQuad(), which doesn't yet exist.
- if (!crossesTransform) {
- IntRect clippingBounds;
- RenderLayer* boundsRelativeLayer;
-
- if (overflowAncestor) {
- RenderBox* overflowBox = toRenderBox(overflowAncestor->renderer());
- // If scrollbars are visible, then constrain the layer to the scrollable area, so we can avoid redraws
- // on scrolling. Otherwise just clip to the visible area (it can still be scrolled via JS, but we'll come
- // back through this code when the scroll offset changes).
- if (overflowBox->scrollsOverflow())
- clippingBounds = IntRect(-overflowAncestor->scrollXOffset(), -overflowAncestor->scrollYOffset(), overflowBox->scrollWidth(), overflowBox->scrollHeight());
- else
- clippingBounds = clipBox(overflowBox);
-
- boundsRelativeLayer = overflowAncestor;
- } else {
- RenderView* view = m_owningLayer->renderer()->view();
- clippingBounds = view->layoutOverflowRect();
- boundsRelativeLayer = view->layer();
- }
-
- int deltaX = 0;
- int deltaY = 0;
- m_owningLayer->convertToLayerCoords(boundsRelativeLayer, deltaX, deltaY);
- clippingBounds.move(-deltaX, -deltaY);
- layerBounds.intersect(clippingBounds);
- }
+ // If this or an ancestor is transformed, we can't currently compute the correct rect to intersect with.
+ // We'd need RenderObject::convertContainerToLocalQuad(), which doesn't yet exist.
+ if (compositor()->compositingConsultsOverlap() && !layerOrAncestorIsTransformed(m_owningLayer)) {
+ RenderView* view = m_owningLayer->renderer()->view();
+ RenderLayer* rootLayer = view->layer();
+
+ // Start by clipping to the view's bounds.
+ IntRect clippingBounds = view->layoutOverflowRect();
+
+ if (m_owningLayer != rootLayer)
+ clippingBounds.intersect(m_owningLayer->backgroundClipRect(rootLayer, true));
+
+ int deltaX = 0;
+ int deltaY = 0;
+ m_owningLayer->convertToLayerCoords(rootLayer, deltaX, deltaY);
+ clippingBounds.move(-deltaX, -deltaY);
+
+ layerBounds.intersect(clippingBounds);
}
// If the element has a transform-origin that has fixed lengths, and the renderer has zero size,
@@ -215,7 +196,7 @@ void RenderLayerBacking::updateAfterWidgetResize()
{
if (renderer()->isRenderIFrame()) {
if (RenderLayerCompositor* innerCompositor = RenderLayerCompositor::iframeContentsCompositor(toRenderIFrame(renderer())))
- innerCompositor->updateContentLayerOffset(contentsBox().location());
+ innerCompositor->frameViewDidChangeSize(contentsBox().location());
}
}
diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp
index f6e1442..3d16864 100644
--- a/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/WebCore/rendering/RenderLayerCompositor.cpp
@@ -826,7 +826,7 @@ void RenderLayerCompositor::rebuildCompositingLayerTree(RenderLayer* layer, cons
}
}
-void RenderLayerCompositor::updateContentLayerOffset(const IntPoint& contentsOffset)
+void RenderLayerCompositor::frameViewDidChangeSize(const IntPoint& contentsOffset)
{
if (m_clipLayer) {
FrameView* frameView = m_renderView->frameView();
@@ -838,7 +838,7 @@ void RenderLayerCompositor::updateContentLayerOffset(const IntPoint& contentsOff
}
}
-void RenderLayerCompositor::updateContentLayerScrollPosition(const IntPoint& scrollPosition)
+void RenderLayerCompositor::frameViewDidScroll(const IntPoint& scrollPosition)
{
if (m_scrollLayer)
m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y()));
@@ -1082,6 +1082,10 @@ bool RenderLayerCompositor::shouldPropagateCompositingToEnclosingIFrame() const
// On non-Mac platforms, let compositing propagate for all iframes.
return true;
#else
+ // If we're viewless (i.e. WebKit2), we always propagate compositing.
+ if (!m_renderView->frameView()->platformWidget())
+ return true;
+
// On Mac, only propagate compositing if the iframe is overlapped in the parent
// document, or the parent is already compositing.
RenderIFrame* iframeRenderer = toRenderIFrame(renderer);
@@ -1345,6 +1349,20 @@ bool RenderLayerCompositor::needsContentsCompositingLayer(const RenderLayer* lay
return (layer->m_negZOrderList && layer->m_negZOrderList->size() > 0);
}
+bool RenderLayerCompositor::requiresScrollLayer(RootLayerAttachment attachment) const
+{
+ if (attachment == RootLayerAttachedViaEnclosingIframe)
+ return true;
+
+#if PLATFORM(MAC)
+ // If we're viewless (i.e. WebKit2), we need to scroll ourselves.
+ // FIXME: eventually we should do this on other platforms too.
+ if (!m_renderView->frameView()->platformWidget())
+ return true;
+#endif
+ return false;
+}
+
void RenderLayerCompositor::ensureRootPlatformLayer()
{
RootLayerAttachment expectedAttachment = shouldPropagateCompositingToEnclosingIFrame() ? RootLayerAttachedViaEnclosingIframe : RootLayerAttachedViaChromeClient;
@@ -1363,10 +1381,7 @@ void RenderLayerCompositor::ensureRootPlatformLayer()
m_rootPlatformLayer->setMasksToBounds(true);
}
- // The root layer does flipping if we need it on this platform.
- m_rootPlatformLayer->setGeometryOrientation(expectedAttachment == RootLayerAttachedViaEnclosingIframe ? GraphicsLayer::CompositingCoordinatesTopDown : GraphicsLayer::compositingCoordinatesOrientation());
-
- if (expectedAttachment == RootLayerAttachedViaEnclosingIframe) {
+ if (requiresScrollLayer(expectedAttachment)) {
if (!m_clipLayer) {
ASSERT(!m_scrollLayer);
// Create a clipping layer if this is an iframe
@@ -1384,17 +1399,24 @@ void RenderLayerCompositor::ensureRootPlatformLayer()
m_clipLayer->addChild(m_scrollLayer.get());
m_scrollLayer->addChild(m_rootPlatformLayer.get());
- updateContentLayerScrollPosition(m_renderView->frameView()->scrollPosition());
+ frameViewDidChangeSize();
+ frameViewDidScroll(m_renderView->frameView()->scrollPosition());
+ }
+ } else {
+ if (m_clipLayer) {
+ m_clipLayer->removeAllChildren();
+ m_clipLayer->removeFromParent();
+ m_clipLayer = 0;
+
+ m_scrollLayer->removeAllChildren();
+ m_scrollLayer = 0;
}
- } else if (m_clipLayer) {
- m_clipLayer->removeAllChildren();
- m_clipLayer->removeFromParent();
- m_clipLayer = 0;
-
- m_scrollLayer->removeAllChildren();
- m_scrollLayer = 0;
}
+ // The root layer does geometry flipping if we need it.
+ m_rootPlatformLayer->setGeometryOrientation(expectedAttachment == RootLayerAttachedViaEnclosingIframe
+ ? GraphicsLayer::CompositingCoordinatesTopDown : GraphicsLayer::compositingCoordinatesOrientation());
+
// Check to see if we have to change the attachment
if (m_rootLayerAttachment != RootLayerUnattached)
detachRootPlatformLayer();
@@ -1434,7 +1456,7 @@ void RenderLayerCompositor::attachRootPlatformLayer(RootLayerAttachment attachme
if (!page)
return;
- page->chrome()->client()->attachRootGraphicsLayer(frame, m_rootPlatformLayer.get());
+ page->chrome()->client()->attachRootGraphicsLayer(frame, rootPlatformLayer());
break;
}
case RootLayerAttachedViaEnclosingIframe: {
diff --git a/WebCore/rendering/RenderLayerCompositor.h b/WebCore/rendering/RenderLayerCompositor.h
index 10516ad..aa27003 100644
--- a/WebCore/rendering/RenderLayerCompositor.h
+++ b/WebCore/rendering/RenderLayerCompositor.h
@@ -158,8 +158,8 @@ public:
static bool parentIFrameContentLayers(RenderIFrame*);
// Update the geometry of the layers used for clipping and scrolling in frames.
- void updateContentLayerOffset(const IntPoint& contentsOffset);
- void updateContentLayerScrollPosition(const IntPoint&);
+ void frameViewDidChangeSize(const IntPoint& contentsOffset = IntPoint());
+ void frameViewDidScroll(const IntPoint& = IntPoint());
private:
// Whether the given RL needs a compositing layer.
@@ -214,11 +214,16 @@ private:
bool requiresCompositingForIFrame(RenderObject*) const;
bool requiresCompositingWhenDescendantsAreCompositing(RenderObject*) const;
+<<<<<<< HEAD
#if PLATFORM(ANDROID)
// Whether we are on a mobile site
bool requiresCompositingForMobileSites(const RenderLayer* layer) const;
#endif
+=======
+ bool requiresScrollLayer(RootLayerAttachment) const;
+
+>>>>>>> webkit.org at r64264
private:
RenderView* m_renderView;
OwnPtr<GraphicsLayer> m_rootPlatformLayer;
diff --git a/WebCore/rendering/RenderMediaControlsChromium.cpp b/WebCore/rendering/RenderMediaControlsChromium.cpp
index 98fdc7b..ab650da 100644
--- a/WebCore/rendering/RenderMediaControlsChromium.cpp
+++ b/WebCore/rendering/RenderMediaControlsChromium.cpp
@@ -96,7 +96,7 @@ static bool paintMediaPlayButton(RenderObject* object, const PaintInfo& paintInf
if (!hasSource(mediaElement))
return paintMediaButton(paintInfo.context, rect, mediaPlayDisabled);
- return paintMediaButton(paintInfo.context, rect, mediaElement->paused() ? mediaPlay : mediaPause);
+ return paintMediaButton(paintInfo.context, rect, mediaElement->canPlay() ? mediaPlay : mediaPause);
}
static Image* getMediaSliderThumb()
diff --git a/WebCore/rendering/RenderMenuList.cpp b/WebCore/rendering/RenderMenuList.cpp
index 177921c..ff16e7e 100644
--- a/WebCore/rendering/RenderMenuList.cpp
+++ b/WebCore/rendering/RenderMenuList.cpp
@@ -354,6 +354,11 @@ String RenderMenuList::itemLabel(unsigned) const
return String();
}
+String RenderMenuList::itemIcon(unsigned) const
+{
+ return String();
+}
+
String RenderMenuList::itemAccessibilityText(unsigned listIndex) const
{
// Allow the accessible name be changed if necessary.
diff --git a/WebCore/rendering/RenderMenuList.h b/WebCore/rendering/RenderMenuList.h
index d72e1a9..aef8d4f 100644
--- a/WebCore/rendering/RenderMenuList.h
+++ b/WebCore/rendering/RenderMenuList.h
@@ -83,6 +83,7 @@ private:
// PopupMenuClient methods
virtual String itemText(unsigned listIndex) const;
virtual String itemLabel(unsigned listIndex) const;
+ virtual String itemIcon(unsigned listIndex) const;
virtual String itemToolTip(unsigned listIndex) const;
virtual String itemAccessibilityText(unsigned listIndex) const;
virtual bool itemIsEnabled(unsigned listIndex) const;
diff --git a/WebCore/rendering/RenderSVGAllInOne.cpp b/WebCore/rendering/RenderSVGAllInOne.cpp
index da86f84..fa5709e 100644
--- a/WebCore/rendering/RenderSVGAllInOne.cpp
+++ b/WebCore/rendering/RenderSVGAllInOne.cpp
@@ -35,6 +35,7 @@
#include "RenderSVGModelObject.cpp"
#include "RenderSVGResource.cpp"
#include "RenderSVGResourceClipper.cpp"
+#include "RenderSVGResourceContainer.cpp"
#include "RenderSVGResourceFilter.cpp"
#include "RenderSVGResourceGradient.cpp"
#include "RenderSVGResourceLinearGradient.cpp"
@@ -57,6 +58,9 @@
#include "SVGMarkerLayoutInfo.cpp"
#include "SVGRenderSupport.cpp"
#include "SVGRenderTreeAsText.cpp"
+#include "SVGResources.cpp"
+#include "SVGResourcesCache.cpp"
+#include "SVGResourcesCycleSolver.cpp"
#include "SVGRootInlineBox.cpp"
#include "SVGShadowTreeElements.cpp"
#include "SVGTextChunkLayoutInfo.cpp"
diff --git a/WebCore/rendering/RenderSVGHiddenContainer.h b/WebCore/rendering/RenderSVGHiddenContainer.h
index c446f11..297a738 100644
--- a/WebCore/rendering/RenderSVGHiddenContainer.h
+++ b/WebCore/rendering/RenderSVGHiddenContainer.h
@@ -37,11 +37,10 @@ namespace WebCore {
public:
RenderSVGHiddenContainer(SVGStyledElement*);
- private:
- virtual bool isSVGHiddenContainer() const { return true; }
-
virtual const char* renderName() const { return "RenderSVGHiddenContainer"; }
+ private:
+ virtual bool isSVGHiddenContainer() const { return true; }
virtual bool requiresLayer() const { return false; }
virtual void layout();
diff --git a/WebCore/rendering/RenderSVGResourceContainer.cpp b/WebCore/rendering/RenderSVGResourceContainer.cpp
new file mode 100644
index 0000000..3707797
--- /dev/null
+++ b/WebCore/rendering/RenderSVGResourceContainer.cpp
@@ -0,0 +1,131 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * 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.
+ *
+ */
+
+#include "config.h"
+
+#if ENABLE(SVG)
+#include "RenderSVGResourceContainer.h"
+
+#include "RenderSVGShadowTreeRootContainer.h"
+#include "SVGStyledTransformableElement.h"
+
+namespace WebCore {
+
+RenderSVGResourceContainer::RenderSVGResourceContainer(SVGStyledElement* node)
+ : RenderSVGHiddenContainer(node)
+ , RenderSVGResource()
+ , m_id(node->hasID() ? node->getIdAttribute() : nullAtom)
+{
+ ASSERT(node->document());
+ node->document()->accessSVGExtensions()->addResource(m_id, this);
+}
+
+RenderSVGResourceContainer::~RenderSVGResourceContainer()
+{
+ ASSERT(node());
+ ASSERT(node()->document());
+ node()->document()->accessSVGExtensions()->removeResource(m_id);
+}
+
+void RenderSVGResourceContainer::idChanged()
+{
+ ASSERT(node());
+ ASSERT(node()->document());
+ SVGDocumentExtensions* extensions = node()->document()->accessSVGExtensions();
+
+ // Remove old id, that is guaranteed to be present in cache
+ extensions->removeResource(m_id);
+ m_id = static_cast<Element*>(node())->getIdAttribute();
+
+ // It's possible that an element is referencing us with the new id, and has to be notified that we're existing now
+ if (extensions->isPendingResource(m_id)) {
+ OwnPtr<HashSet<SVGStyledElement*> > clients(extensions->removePendingResource(m_id));
+ if (clients->isEmpty())
+ return;
+
+ HashSet<SVGStyledElement*>::const_iterator it = clients->begin();
+ const HashSet<SVGStyledElement*>::const_iterator end = clients->end();
+
+ for (; it != end; ++it) {
+ if (RenderObject* renderer = (*it)->renderer())
+ renderer->setNeedsLayout(true);
+ }
+ }
+
+ // Recache us with the new id
+ extensions->addResource(m_id, this);
+}
+
+AffineTransform RenderSVGResourceContainer::transformOnNonScalingStroke(RenderObject* object, const AffineTransform& resourceTransform)
+{
+ if (!object->isRenderPath())
+ return resourceTransform;
+
+ SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(object->node());
+ AffineTransform transform = resourceTransform;
+ transform.multiply(element->getScreenCTM());
+ return transform;
+}
+
+bool RenderSVGResourceContainer::containsCyclicReference(const Node* startNode) const
+{
+ ASSERT(startNode->document());
+
+ for (Node* node = startNode->firstChild(); node; node = node->nextSibling()) {
+ if (!node->isSVGElement())
+ continue;
+
+ RenderObject* renderer = node->renderer();
+ if (!renderer)
+ continue;
+
+ RenderStyle* style = renderer->style();
+ if (!style)
+ continue;
+
+ const SVGRenderStyle* svgStyle = style->svgStyle();
+ ASSERT(svgStyle);
+
+ // Let the class inheriting from us decide whether the child element references ourselves.
+ if (childElementReferencesResource(svgStyle, m_id))
+ return true;
+
+ // Dive into shadow tree to check for cycles there.
+ if (node->hasTagName(SVGNames::useTag)) {
+ ASSERT(renderer->isSVGShadowTreeRootContainer());
+ if (Node* shadowRoot = static_cast<RenderSVGShadowTreeRootContainer*>(renderer)->rootElement()) {
+ if (containsCyclicReference(shadowRoot))
+ return true;
+ }
+
+ }
+
+ if (node->hasChildNodes()) {
+ if (containsCyclicReference(node))
+ return true;
+ }
+ }
+
+ return false;
+}
+
+}
+
+#endif
diff --git a/WebCore/rendering/RenderSVGResourceContainer.h b/WebCore/rendering/RenderSVGResourceContainer.h
index 5f1c828..d57b1db 100644
--- a/WebCore/rendering/RenderSVGResourceContainer.h
+++ b/WebCore/rendering/RenderSVGResourceContainer.h
@@ -33,50 +33,10 @@ namespace WebCore {
class RenderSVGResourceContainer : public RenderSVGHiddenContainer,
public RenderSVGResource {
public:
- RenderSVGResourceContainer(SVGStyledElement* node)
- : RenderSVGHiddenContainer(node)
- , RenderSVGResource()
- , m_id(node->hasID() ? node->getIdAttribute() : nullAtom)
- {
- ASSERT(node->document());
- node->document()->accessSVGExtensions()->addResource(m_id, this);
- }
-
- virtual ~RenderSVGResourceContainer()
- {
- ASSERT(node());
- ASSERT(node()->document());
- node()->document()->accessSVGExtensions()->removeResource(m_id);
- }
-
- void idChanged()
- {
- ASSERT(node());
- ASSERT(node()->document());
- SVGDocumentExtensions* extensions = node()->document()->accessSVGExtensions();
-
- // Remove old id, that is guaranteed to be present in cache
- extensions->removeResource(m_id);
- m_id = static_cast<Element*>(node())->getIdAttribute();
-
- // It's possible that an element is referencing us with the new id, and has to be notified that we're existing now
- if (extensions->isPendingResource(m_id)) {
- OwnPtr<HashSet<SVGStyledElement*> > clients(extensions->removePendingResource(m_id));
- if (clients->isEmpty())
- return;
-
- HashSet<SVGStyledElement*>::const_iterator it = clients->begin();
- const HashSet<SVGStyledElement*>::const_iterator end = clients->end();
-
- for (; it != end; ++it) {
- if (RenderObject* renderer = (*it)->renderer())
- renderer->setNeedsLayout(true);
- }
- }
-
- // Recache us with the new id
- extensions->addResource(m_id, this);
- }
+ RenderSVGResourceContainer(SVGStyledElement*);
+ virtual ~RenderSVGResourceContainer();
+
+ void idChanged();
virtual bool isSVGResourceContainer() const { return true; }
virtual bool drawsContents() { return false; }
@@ -84,58 +44,16 @@ public:
virtual RenderSVGResourceContainer* toRenderSVGResourceContainer() { return this; }
virtual bool childElementReferencesResource(const SVGRenderStyle*, const String&) const { return false; }
- static AffineTransform transformOnNonScalingStroke(RenderObject* object, const AffineTransform resourceTransform)
- {
- if (!object->isRenderPath())
- return resourceTransform;
-
- SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(object->node());
- AffineTransform transform = resourceTransform;
- transform.multiply(element->getScreenCTM());
- return transform;
- }
-
- bool containsCyclicReference(const Node* startNode) const
- {
- ASSERT(startNode->document());
-
- for (Node* node = startNode->firstChild(); node; node = node->nextSibling()) {
- if (!node->isSVGElement())
- continue;
-
- RenderObject* renderer = node->renderer();
- if (!renderer)
- continue;
-
- RenderStyle* style = renderer->style();
- if (!style)
- continue;
-
- const SVGRenderStyle* svgStyle = style->svgStyle();
- ASSERT(svgStyle);
-
- // Let the class inheriting from us decide whether the child element references ourselves.
- if (childElementReferencesResource(svgStyle, m_id))
- return true;
-
- // Dive into shadow tree to check for cycles there.
- if (node->hasTagName(SVGNames::useTag)) {
- ASSERT(renderer->isSVGShadowTreeRootContainer());
- if (Node* shadowRoot = static_cast<RenderSVGShadowTreeRootContainer*>(renderer)->rootElement()) {
- if (containsCyclicReference(shadowRoot))
- return true;
- }
-
- }
-
- if (node->hasChildNodes()) {
- if (containsCyclicReference(node))
- return true;
- }
- }
-
- return false;
- }
+ static AffineTransform transformOnNonScalingStroke(RenderObject*, const AffineTransform& resourceTransform);
+
+ bool containsCyclicReference(const Node* startNode) const;
+
+private:
+ friend class SVGResourcesCache;
+
+ // FIXME: No-ops for now, until follow-up patch on bug 43031 lands.
+ void addClient(RenderObject*) { }
+ void removeClient(RenderObject*) { }
private:
AtomicString m_id;
diff --git a/WebCore/rendering/RenderTable.cpp b/WebCore/rendering/RenderTable.cpp
index 52fc326..6359c09 100644
--- a/WebCore/rendering/RenderTable.cpp
+++ b/WebCore/rendering/RenderTable.cpp
@@ -618,7 +618,7 @@ void RenderTable::splitColumn(int pos, int firstSpan)
// change width of all rows.
for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
if (child->isTableSection())
- toRenderTableSection(child)->splitColumn(pos, oldSize + 1);
+ toRenderTableSection(child)->splitColumn(pos, firstSpan);
}
m_columnPos.grow(numEffCols() + 1);
@@ -812,12 +812,12 @@ int RenderTable::calcBorderLeft() const
const RenderTableSection::CellStruct& cs = firstNonEmptySection->cellAt(0, leftmostColumn);
- if (cs.cell) {
- const BorderValue& cb = cs.cell->style()->borderLeft();
+ if (cs.hasCells()) {
+ const BorderValue& cb = cs.primaryCell()->style()->borderLeft();
if (cb.style() == BHIDDEN)
return 0;
- const BorderValue& rb = cs.cell->parent()->style()->borderLeft();
+ const BorderValue& rb = cs.primaryCell()->parent()->style()->borderLeft();
if (rb.style() == BHIDDEN)
return 0;
@@ -871,12 +871,12 @@ int RenderTable::calcBorderRight() const
const RenderTableSection::CellStruct& cs = firstNonEmptySection->cellAt(0, rightmostColumn);
- if (cs.cell) {
- const BorderValue& cb = cs.cell->style()->borderRight();
+ if (cs.hasCells()) {
+ const BorderValue& cb = cs.primaryCell()->style()->borderRight();
if (cb.style() == BHIDDEN)
return 0;
- const BorderValue& rb = cs.cell->parent()->style()->borderRight();
+ const BorderValue& rb = cs.primaryCell()->parent()->style()->borderRight();
if (rb.style() == BHIDDEN)
return 0;
@@ -1081,13 +1081,8 @@ RenderTableCell* RenderTable::cellAbove(const RenderTableCell* cell) const
// Look up the cell in the section's grid, which requires effective col index
if (section) {
int effCol = colToEffCol(cell->col());
- RenderTableSection::CellStruct aboveCell;
- // If we hit a span back up to a real cell.
- do {
- aboveCell = section->cellAt(rAbove, effCol);
- effCol--;
- } while (!aboveCell.cell && aboveCell.inColSpan && effCol >= 0);
- return aboveCell.cell;
+ RenderTableSection::CellStruct& aboveCell = section->cellAt(rAbove, effCol);
+ return aboveCell.primaryCell();
} else
return 0;
}
@@ -1113,13 +1108,8 @@ RenderTableCell* RenderTable::cellBelow(const RenderTableCell* cell) const
// Look up the cell in the section's grid, which requires effective col index
if (section) {
int effCol = colToEffCol(cell->col());
- RenderTableSection::CellStruct belowCell;
- // If we hit a colspan back up to a real cell.
- do {
- belowCell = section->cellAt(rBelow, effCol);
- effCol--;
- } while (!belowCell.cell && belowCell.inColSpan && effCol >= 0);
- return belowCell.cell;
+ RenderTableSection::CellStruct& belowCell = section->cellAt(rBelow, effCol);
+ return belowCell.primaryCell();
} else
return 0;
}
@@ -1134,12 +1124,8 @@ RenderTableCell* RenderTable::cellBefore(const RenderTableCell* cell) const
return 0;
// If we hit a colspan back up to a real cell.
- RenderTableSection::CellStruct prevCell;
- do {
- prevCell = section->cellAt(cell->row(), effCol - 1);
- effCol--;
- } while (!prevCell.cell && prevCell.inColSpan && effCol >= 0);
- return prevCell.cell;
+ RenderTableSection::CellStruct& prevCell = section->cellAt(cell->row(), effCol - 1);
+ return prevCell.primaryCell();
}
RenderTableCell* RenderTable::cellAfter(const RenderTableCell* cell) const
@@ -1149,7 +1135,7 @@ RenderTableCell* RenderTable::cellAfter(const RenderTableCell* cell) const
int effCol = colToEffCol(cell->col() + cell->colSpan());
if (effCol >= numEffCols())
return 0;
- return cell->section()->cellAt(cell->row(), effCol).cell;
+ return cell->section()->primaryCellAt(cell->row(), effCol);
}
RenderBlock* RenderTable::firstLineBlock() const
diff --git a/WebCore/rendering/RenderTableSection.cpp b/WebCore/rendering/RenderTableSection.cpp
index fcb6c59..dcaa2f5 100644
--- a/WebCore/rendering/RenderTableSection.cpp
+++ b/WebCore/rendering/RenderTableSection.cpp
@@ -37,6 +37,7 @@
#include "RenderTableRow.h"
#include "RenderView.h"
#include <limits>
+#include <wtf/HashSet.h>
#include <wtf/Vector.h>
#ifdef ANDROID_LAYOUT
#include "Frame.h"
@@ -68,9 +69,10 @@ RenderTableSection::RenderTableSection(Node* node)
, m_outerBorderBottom(0)
, m_needsCellRecalc(false)
, m_hasOverflowingCell(false)
+ , m_hasMultipleCellLevels(false)
{
// init RenderObject attributes
- setInline(false); // our object is not Inline
+ setInline(false); // our object is not Inline
}
RenderTableSection::~RenderTableSection()
@@ -166,12 +168,8 @@ bool RenderTableSection::ensureRows(int numRows)
}
m_gridRows = numRows;
int nCols = max(1, table()->numEffCols());
- CellStruct emptyCellStruct;
- emptyCellStruct.cell = 0;
- emptyCellStruct.inColSpan = false;
for (int r = nRows; r < numRows; r++) {
m_grid[r].row = new Row(nCols);
- m_grid[r].row->fill(emptyCellStruct);
m_grid[r].rowRenderer = 0;
m_grid[r].baseline = 0;
m_grid[r].height = Length();
@@ -194,8 +192,7 @@ void RenderTableSection::addCell(RenderTableCell* cell, RenderTableRow* row)
// <TR><TD>1 <TD rowspan="2">2 <TD>3 <TD>4
// <TR><TD colspan="2">5
// </TABLE>
-
- while (m_cCol < nCols && (cellAt(m_cRow, m_cCol).cell || cellAt(m_cRow, m_cCol).inColSpan))
+ while (m_cCol < nCols && (cellAt(m_cRow, m_cCol).hasCells() || cellAt(m_cRow, m_cCol).inColSpan))
m_cCol++;
if (rSpan == 1) {
@@ -229,31 +226,30 @@ void RenderTableSection::addCell(RenderTableCell* cell, RenderTableRow* row)
int col = m_cCol;
// tell the cell where it is
- CellStruct currentCell;
- currentCell.cell = cell;
- currentCell.inColSpan = false;
+ bool inColSpan = false;
while (cSpan) {
int currentSpan;
if (m_cCol >= nCols) {
table()->appendColumn(cSpan);
currentSpan = cSpan;
} else {
- if (cSpan < static_cast<int>(columns[m_cCol].span))
+ if (cSpan < (int)columns[m_cCol].span)
table()->splitColumn(m_cCol, cSpan);
currentSpan = columns[m_cCol].span;
}
-
for (int r = 0; r < rSpan; r++) {
CellStruct& c = cellAt(m_cRow + r, m_cCol);
- if (!c.cell)
- c.cell = currentCell.cell;
- if (currentCell.inColSpan)
+ ASSERT(cell);
+ c.cells.append(cell);
+ // If cells overlap then we take the slow path for painting.
+ if (c.cells.size() > 1)
+ m_hasMultipleCellLevels = true;
+ if (inColSpan)
c.inColSpan = true;
}
m_cCol++;
cSpan -= currentSpan;
- currentCell.cell = 0;
- currentCell.inColSpan = true;
+ inColSpan = true;
}
cell->setRow(m_cRow);
cell->setCol(table()->effColToCol(col));
@@ -279,14 +275,14 @@ void RenderTableSection::setCellWidths()
Row& row = *m_grid[i].row;
int cols = row.size();
for (int j = 0; j < cols; j++) {
- CellStruct current = row[j];
- RenderTableCell* cell = current.cell;
-
- if (!cell)
- continue;
+ CellStruct& current = row[j];
+ RenderTableCell* cell = current.primaryCell();
+ if (!cell || current.inColSpan)
+ continue;
int endCol = j;
int cspan = cell->colSpan();
while (cspan && endCol < cols) {
+ ASSERT(endCol < (int)table()->columns().size());
cspan -= table()->columns()[endCol].span;
endCol++;
}
@@ -321,7 +317,7 @@ void RenderTableSection::setCellWidths()
}
}
- statePusher.pop(); // only pops if we pushed
+ statePusher.pop(); // only pops if we pushed
}
int RenderTableSection::calcRowHeight()
@@ -364,11 +360,13 @@ int RenderTableSection::calcRowHeight()
int totalCols = row->size();
for (int c = 0; c < totalCols; c++) {
- CellStruct current = cellAt(r, c);
- cell = current.cell;
+ CellStruct& current = cellAt(r, c);
+ cell = current.primaryCell();
+
if (!cell || current.inColSpan)
continue;
- if (r < m_gridRows - 1 && cellAt(r + 1, c).cell == cell)
+
+ if ((cell->row() + cell->rowSpan() - 1) > r)
continue;
int indx = max(r - cell->rowSpan() + 1, 0);
@@ -410,7 +408,7 @@ int RenderTableSection::calcRowHeight()
}
}
- //do we have baseline aligned elements?
+ // do we have baseline aligned elements?
if (baseline) {
// increase rowheight if baseline requires
m_rowPos[r + 1] = max(m_rowPos[r + 1], baseline + bdesc + (m_grid[r].rowRenderer ? spacing : 0));
@@ -564,7 +562,7 @@ int RenderTableSection::layoutRows(int toAdd)
int add = 0;
int prev = m_rowPos[0];
for (int r = 0; r < totalRows; r++) {
- //weight with the original height
+ // weight with the original height
add += dh * (m_rowPos[r + 1] - prev) / tot;
prev = m_rowPos[r + 1];
m_rowPos[r + 1] += add;
@@ -587,16 +585,14 @@ int RenderTableSection::layoutRows(int toAdd)
}
for (int c = 0; c < nEffCols; c++) {
- RenderTableCell* cell = cellAt(r, c).cell;
-
- if (!cell)
- continue;
- if (r < totalRows - 1 && cell == cellAt(r + 1, c).cell)
- continue;
+ CellStruct& cs = cellAt(r, c);
+ RenderTableCell* cell = cs.primaryCell();
- rindx = max(0, r - cell->rowSpan() + 1);
+ if (!cell || cs.inColSpan)
+ continue;
- rHeight = m_rowPos[r + 1] - m_rowPos[rindx] - vspacing;
+ rindx = cell->row();
+ rHeight = m_rowPos[rindx + cell->rowSpan()] - m_rowPos[rindx] - vspacing;
// Force percent height children to lay themselves out again.
// This will cause these children to grow to fill the cell.
@@ -612,8 +608,8 @@ int RenderTableSection::layoutRows(int toAdd)
// match the behavior perfectly, but we'll continue to refine it as we discover new
// bugs. :)
bool cellChildrenFlex = false;
- bool flexAllChildren = cell->style()->height().isFixed() ||
- (!table()->style()->height().isAuto() && rHeight != cell->height());
+ bool flexAllChildren = cell->style()->height().isFixed()
+ || (!table()->style()->height().isAuto() && rHeight != cell->height());
for (RenderObject* o = cell->firstChild(); o; o = o->nextSibling()) {
if (!o->isText() && o->style()->height().isPercent() && (flexAllChildren || o->isReplaced() || (o->isBox() && toRenderBox(o)->scrollsOverflow()))) {
@@ -706,9 +702,9 @@ int RenderTableSection::layoutRows(int toAdd)
IntRect oldCellRect(cell->x(), cell->y() , cell->width(), cell->height());
- if (style()->direction() == RTL) {
+ if (style()->direction() == RTL)
cell->setLocation(table()->columnPositions()[nEffCols] - table()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + hspacing, m_rowPos[rindx]);
- } else
+ else
cell->setLocation(table()->columnPositions()[c] + hspacing, m_rowPos[rindx]);
// If the cell moved, we have to repaint it as well as any floating/positioned
@@ -730,10 +726,11 @@ int RenderTableSection::layoutRows(int toAdd)
// Now that our height has been determined, add in overflow from cells.
for (int r = 0; r < totalRows; r++) {
for (int c = 0; c < nEffCols; c++) {
- RenderTableCell* cell = cellAt(r, c).cell;
- if (!cell)
+ CellStruct& cs = cellAt(r, c);
+ RenderTableCell* cell = cs.primaryCell();
+ if (!cell || cs.inColSpan)
continue;
- if (r < totalRows - 1 && cell == cellAt(r + 1, c).cell)
+ if (r < totalRows - 1 && cell == primaryCellAt(r + 1, c))
continue;
addOverflowFromChild(cell);
m_hasOverflowingCell |= cell->hasVisibleOverflow();
@@ -821,17 +818,16 @@ int RenderTableSection::calcOuterBorderTop() const
bool allHidden = true;
for (int c = 0; c < totalCols; c++) {
const CellStruct& current = cellAt(0, c);
- if (current.inColSpan || !current.cell)
+ if (current.inColSpan || !current.hasCells())
continue;
- const BorderValue& cb = current.cell->style()->borderTop();
+ const BorderValue& cb = current.primaryCell()->style()->borderTop();
// FIXME: Don't repeat for the same col group
RenderTableCol* colGroup = table()->colElement(c);
if (colGroup) {
const BorderValue& gb = colGroup->style()->borderTop();
if (gb.style() == BHIDDEN || cb.style() == BHIDDEN)
continue;
- else
- allHidden = false;
+ allHidden = false;
if (gb.style() > BHIDDEN && gb.width() > borderWidth)
borderWidth = gb.width();
if (cb.style() > BHIDDEN && cb.width() > borderWidth)
@@ -839,8 +835,7 @@ int RenderTableSection::calcOuterBorderTop() const
} else {
if (cb.style() == BHIDDEN)
continue;
- else
- allHidden = false;
+ allHidden = false;
if (cb.style() > BHIDDEN && cb.width() > borderWidth)
borderWidth = cb.width();
}
@@ -874,17 +869,16 @@ int RenderTableSection::calcOuterBorderBottom() const
bool allHidden = true;
for (int c = 0; c < totalCols; c++) {
const CellStruct& current = cellAt(m_gridRows - 1, c);
- if (current.inColSpan || !current.cell)
+ if (current.inColSpan || !current.hasCells())
continue;
- const BorderValue& cb = current.cell->style()->borderBottom();
+ const BorderValue& cb = current.primaryCell()->style()->borderBottom();
// FIXME: Don't repeat for the same col group
RenderTableCol* colGroup = table()->colElement(c);
if (colGroup) {
const BorderValue& gb = colGroup->style()->borderBottom();
if (gb.style() == BHIDDEN || cb.style() == BHIDDEN)
continue;
- else
- allHidden = false;
+ allHidden = false;
if (gb.style() > BHIDDEN && gb.width() > borderWidth)
borderWidth = gb.width();
if (cb.style() > BHIDDEN && cb.width() > borderWidth)
@@ -892,8 +886,7 @@ int RenderTableSection::calcOuterBorderBottom() const
} else {
if (cb.style() == BHIDDEN)
continue;
- else
- allHidden = false;
+ allHidden = false;
if (cb.style() > BHIDDEN && cb.width() > borderWidth)
borderWidth = cb.width();
}
@@ -931,15 +924,14 @@ int RenderTableSection::calcOuterBorderLeft(bool rtl) const
bool allHidden = true;
for (int r = 0; r < m_gridRows; r++) {
const CellStruct& current = cellAt(r, leftmostColumn);
- if (!current.cell)
+ if (!current.hasCells())
continue;
// FIXME: Don't repeat for the same cell
- const BorderValue& cb = current.cell->style()->borderLeft();
- const BorderValue& rb = current.cell->parent()->style()->borderLeft();
+ const BorderValue& cb = current.primaryCell()->style()->borderLeft();
+ const BorderValue& rb = current.primaryCell()->parent()->style()->borderLeft();
if (cb.style() == BHIDDEN || rb.style() == BHIDDEN)
continue;
- else
- allHidden = false;
+ allHidden = false;
if (cb.style() > BHIDDEN && cb.width() > borderWidth)
borderWidth = cb.width();
if (rb.style() > BHIDDEN && rb.width() > borderWidth)
@@ -978,15 +970,14 @@ int RenderTableSection::calcOuterBorderRight(bool rtl) const
bool allHidden = true;
for (int r = 0; r < m_gridRows; r++) {
const CellStruct& current = cellAt(r, rightmostColumn);
- if (!current.cell)
+ if (!current.hasCells())
continue;
// FIXME: Don't repeat for the same cell
- const BorderValue& cb = current.cell->style()->borderRight();
- const BorderValue& rb = current.cell->parent()->style()->borderRight();
+ const BorderValue& cb = current.primaryCell()->style()->borderRight();
+ const BorderValue& rb = current.primaryCell()->parent()->style()->borderRight();
if (cb.style() == BHIDDEN || rb.style() == BHIDDEN)
continue;
- else
- allHidden = false;
+ allHidden = false;
if (cb.style() > BHIDDEN && cb.width() > borderWidth)
borderWidth = cb.width();
if (rb.style() > BHIDDEN && rb.width() > borderWidth)
@@ -1019,7 +1010,8 @@ int RenderTableSection::firstLineBoxBaseline() const
firstLineBaseline = -1;
Row* firstRow = m_grid[0].row;
for (size_t i = 0; i < firstRow->size(); ++i) {
- RenderTableCell* cell = firstRow->at(i).cell;
+ CellStruct& cs = firstRow->at(i);
+ RenderTableCell* cell = cs.primaryCell();
if (cell)
firstLineBaseline = max(firstLineBaseline, cell->y() + cell->paddingTop() + cell->borderTop() + cell->contentHeight());
}
@@ -1051,6 +1043,45 @@ void RenderTableSection::paint(PaintInfo& paintInfo, int tx, int ty)
popContentsClip(paintInfo, phase, tx, ty);
}
+static inline bool compareCellPositions(RenderTableCell* elem1, RenderTableCell* elem2)
+{
+ return elem1->row() < elem2->row();
+}
+
+void RenderTableSection::paintCell(RenderTableCell* cell, PaintInfo& paintInfo, int tx, int ty)
+{
+ PaintPhase paintPhase = paintInfo.phase;
+ RenderTableRow* row = toRenderTableRow(cell->parent());
+
+ if (paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) {
+ // We need to handle painting a stack of backgrounds. This stack (from bottom to top) consists of
+ // the column group, column, row group, row, and then the cell.
+ RenderObject* col = table()->colElement(cell->col());
+ RenderObject* colGroup = 0;
+ if (col && col->parent()->style()->display() == TABLE_COLUMN_GROUP)
+ colGroup = col->parent();
+
+ // Column groups and columns first.
+ // FIXME: Columns and column groups do not currently support opacity, and they are being painted "too late" in
+ // the stack, since we have already opened a transparency layer (potentially) for the table row group.
+ // Note that we deliberately ignore whether or not the cell has a layer, since these backgrounds paint "behind" the
+ // cell.
+ cell->paintBackgroundsBehindCell(paintInfo, tx, ty, colGroup);
+ cell->paintBackgroundsBehindCell(paintInfo, tx, ty, col);
+
+ // Paint the row group next.
+ cell->paintBackgroundsBehindCell(paintInfo, tx, ty, this);
+
+ // Paint the row next, but only if it doesn't have a layer. If a row has a layer, it will be responsible for
+ // painting the row background for the cell.
+ if (!row->hasSelfPaintingLayer())
+ cell->paintBackgroundsBehindCell(paintInfo, tx, ty, row);
+ }
+ if ((!cell->hasSelfPaintingLayer() && !row->hasSelfPaintingLayer()) || paintInfo.phase == PaintPhaseCollapsedTableBorders)
+ cell->paint(paintInfo, tx, ty);
+
+}
+
void RenderTableSection::paintObject(PaintInfo& paintInfo, int tx, int ty)
{
// Check which rows and cols are visible and only paint these.
@@ -1120,57 +1151,50 @@ void RenderTableSection::paintObject(PaintInfo& paintInfo, int tx, int ty)
if (!endcol && tx + table()->columnPositions()[0] - table()->outerBorderLeft() <= y + w + os)
endcol++;
}
+<<<<<<< HEAD
#ifdef ANDROID_LAYOUT
}
#endif
+=======
+>>>>>>> webkit.org at r64264
if (startcol < endcol) {
- // draw the cells
- for (unsigned r = startrow; r < endrow; r++) {
- unsigned c = startcol;
- // since a cell can be -1 (indicating a colspan) we might have to search backwards to include it
- while (c && cellAt(r, c).inColSpan)
- c--;
- for (; c < endcol; c++) {
- CellStruct current = cellAt(r, c);
- RenderTableCell* cell = current.cell;
-
- // Cells must always paint in the order in which they appear taking into account
- // their upper left originating row/column. For cells with rowspans, avoid repainting
- // if we've already seen the cell.
- if (!cell || (r > startrow && (cellAt(r - 1, c).cell == cell)))
- continue;
-
- RenderTableRow* row = toRenderTableRow(cell->parent());
-
- if (paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) {
- // We need to handle painting a stack of backgrounds. This stack (from bottom to top) consists of
- // the column group, column, row group, row, and then the cell.
- RenderObject* col = table()->colElement(c);
- RenderObject* colGroup = 0;
- if (col && col->parent()->style()->display() == TABLE_COLUMN_GROUP)
- colGroup = col->parent();
-
- // Column groups and columns first.
- // FIXME: Columns and column groups do not currently support opacity, and they are being painted "too late" in
- // the stack, since we have already opened a transparency layer (potentially) for the table row group.
- // Note that we deliberately ignore whether or not the cell has a layer, since these backgrounds paint "behind" the
- // cell.
- cell->paintBackgroundsBehindCell(paintInfo, tx, ty, colGroup);
- cell->paintBackgroundsBehindCell(paintInfo, tx, ty, col);
-
- // Paint the row group next.
- cell->paintBackgroundsBehindCell(paintInfo, tx, ty, this);
-
- // Paint the row next, but only if it doesn't have a layer. If a row has a layer, it will be responsible for
- // painting the row background for the cell.
- if (!row->hasSelfPaintingLayer())
- cell->paintBackgroundsBehindCell(paintInfo, tx, ty, row);
+ if (!m_hasMultipleCellLevels) {
+ // Draw the dirty cells in the order that they appear.
+ for (unsigned r = startrow; r < endrow; r++) {
+ for (unsigned c = startcol; c < endcol; c++) {
+ CellStruct& current = cellAt(r, c);
+ RenderTableCell* cell = current.primaryCell();
+ if (!cell || (r > startrow && primaryCellAt(r - 1, c) == cell) || (c > startcol && primaryCellAt(r, c - 1) == cell))
+ continue;
+ paintCell(cell, paintInfo, tx, ty);
+ }
+ }
+ } else {
+ // Draw the cells in the correct paint order.
+ Vector<RenderTableCell*> cells;
+ HashSet<RenderTableCell*> spanningCells;
+ for (unsigned r = startrow; r < endrow; r++) {
+ for (unsigned c = startcol; c < endcol; c++) {
+ CellStruct& current = cellAt(r, c);
+ if (!current.hasCells())
+ continue;
+ for (unsigned i = 0; i < current.cells.size(); ++i) {
+ if (current.cells[i]->rowSpan() > 1 || current.cells[i]->colSpan() > 1) {
+ if (spanningCells.contains(current.cells[i]))
+ continue;
+ spanningCells.add(current.cells[i]);
+ }
+ cells.append(current.cells[i]);
+ }
}
-
- if ((!cell->hasSelfPaintingLayer() && !row->hasSelfPaintingLayer()) || paintInfo.phase == PaintPhaseCollapsedTableBorders)
- cell->paint(paintInfo, tx, ty);
}
+ // Sort the dirty cells by paint order.
+ std::stable_sort(cells.begin(), cells.end(), compareCellPositions);
+ int size = cells.size();
+ // Paint the cells.
+ for (int i = 0; i < size; ++i)
+ paintCell(cells[i], paintInfo, tx, ty);
}
}
}
@@ -1223,7 +1247,7 @@ int RenderTableSection::numColumns() const
for (int r = 0; r < m_gridRows; ++r) {
for (int c = result; c < table()->numEffCols(); ++c) {
const CellStruct& cell = cellAt(r, c);
- if (cell.cell || cell.inColSpan)
+ if (cell.hasCells() || cell.inColSpan)
result = c;
}
}
@@ -1233,24 +1257,29 @@ int RenderTableSection::numColumns() const
void RenderTableSection::appendColumn(int pos)
{
- for (int row = 0; row < m_gridRows; ++row) {
+ for (int row = 0; row < m_gridRows; ++row)
m_grid[row].row->resize(pos + 1);
- CellStruct& c = cellAt(row, pos);
- c.cell = 0;
- c.inColSpan = false;
- }
}
-void RenderTableSection::splitColumn(int pos, int newSize)
+void RenderTableSection::splitColumn(int pos, int first)
{
if (m_cCol > pos)
m_cCol++;
for (int row = 0; row < m_gridRows; ++row) {
- m_grid[row].row->resize(newSize);
Row& r = *m_grid[row].row;
- memmove(r.data() + pos + 1, r.data() + pos, (newSize - 1 - pos) * sizeof(CellStruct));
- r[pos + 1].cell = 0;
- r[pos + 1].inColSpan = r[pos].inColSpan || r[pos].cell;
+ r.insert(pos + 1, CellStruct());
+ if (r[pos].hasCells()) {
+ r[pos + 1].cells.append(r[pos].cells);
+ RenderTableCell* cell = r[pos].primaryCell();
+ ASSERT(cell);
+ int colleft = cell->colSpan() - r[pos].inColSpan;
+ if (first > colleft)
+ r[pos + 1].inColSpan = 0;
+ else
+ r[pos + 1].inColSpan = first + r[pos].inColSpan;
+ } else {
+ r[pos + 1].inColSpan = 0;
+ }
}
}
@@ -1279,7 +1308,6 @@ bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResul
return true;
}
}
-
return false;
}
diff --git a/WebCore/rendering/RenderTableSection.h b/WebCore/rendering/RenderTableSection.h
index 9f6d5ea..6d2f752 100644
--- a/WebCore/rendering/RenderTableSection.h
+++ b/WebCore/rendering/RenderTableSection.h
@@ -54,8 +54,23 @@ public:
RenderTable* table() const { return toRenderTable(parent()); }
struct CellStruct {
- RenderTableCell* cell;
+ Vector<RenderTableCell*, 1> cells;
bool inColSpan; // true for columns after the first in a colspan
+
+ CellStruct():
+ inColSpan(false) {}
+
+ RenderTableCell* primaryCell()
+ {
+ return hasCells() ? cells[cells.size() - 1] : 0;
+ }
+
+ const RenderTableCell* primaryCell() const
+ {
+ return hasCells() ? cells[cells.size() - 1] : 0;
+ }
+
+ bool hasCells() const { return cells.size() > 0; }
};
typedef Vector<CellStruct> Row;
@@ -69,9 +84,14 @@ public:
CellStruct& cellAt(int row, int col) { return (*m_grid[row].row)[col]; }
const CellStruct& cellAt(int row, int col) const { return (*m_grid[row].row)[col]; }
+ RenderTableCell* primaryCellAt(int row, int col)
+ {
+ CellStruct& c = (*m_grid[row].row)[col];
+ return c.primaryCell();
+ }
void appendColumn(int pos);
- void splitColumn(int pos, int newSize);
+ void splitColumn(int pos, int first);
int calcOuterBorderTop() const;
int calcOuterBorderBottom() const;
@@ -121,6 +141,7 @@ private:
virtual int leftmostPosition(bool includeOverflowInterior, bool includeSelf) const;
virtual void paint(PaintInfo&, int tx, int ty);
+ virtual void paintCell(RenderTableCell*, PaintInfo&, int tx, int ty);
virtual void paintObject(PaintInfo&, int tx, int ty);
virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
@@ -150,6 +171,8 @@ private:
bool m_needsCellRecalc;
bool m_hasOverflowingCell;
+
+ bool m_hasMultipleCellLevels;
};
inline RenderTableSection* toRenderTableSection(RenderObject* object)
diff --git a/WebCore/rendering/RenderText.cpp b/WebCore/rendering/RenderText.cpp
index c70ac58..bd050d8 100644
--- a/WebCore/rendering/RenderText.cpp
+++ b/WebCore/rendering/RenderText.cpp
@@ -140,9 +140,8 @@ bool RenderText::isWordBreak() const
void RenderText::updateNeedsTranscoding()
{
- const AtomicString& fontFamily = style()->font().family().family();
const TextEncoding* encoding = document()->decoder() ? &document()->decoder()->encoding() : 0;
- m_needsTranscoding = fontTranscoder().needsTranscoding(fontFamily, encoding);
+ m_needsTranscoding = fontTranscoder().needsTranscoding(style()->font().fontDescription(), encoding);
}
void RenderText::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
@@ -1044,9 +1043,8 @@ void RenderText::setTextInternal(PassRefPtr<StringImpl> text)
ASSERT(text);
m_text = text;
if (m_needsTranscoding) {
- const AtomicString& fontFamily = style()->font().family().family();
const TextEncoding* encoding = document()->decoder() ? &document()->decoder()->encoding() : 0;
- fontTranscoder().convert(m_text, fontFamily, encoding);
+ fontTranscoder().convert(m_text, style()->font().fontDescription(), encoding);
}
ASSERT(m_text);
diff --git a/WebCore/rendering/RenderTextControlSingleLine.cpp b/WebCore/rendering/RenderTextControlSingleLine.cpp
index 71d5a86..5b57513 100644
--- a/WebCore/rendering/RenderTextControlSingleLine.cpp
+++ b/WebCore/rendering/RenderTextControlSingleLine.cpp
@@ -920,6 +920,11 @@ String RenderTextControlSingleLine::itemLabel(unsigned) const
return String();
}
+String RenderTextControlSingleLine::itemIcon(unsigned) const
+{
+ return String();
+}
+
bool RenderTextControlSingleLine::itemIsEnabled(unsigned listIndex) const
{
if (!listIndex || itemIsSeparator(listIndex))
diff --git a/WebCore/rendering/RenderTextControlSingleLine.h b/WebCore/rendering/RenderTextControlSingleLine.h
index 92ecadd..8c7e844 100644
--- a/WebCore/rendering/RenderTextControlSingleLine.h
+++ b/WebCore/rendering/RenderTextControlSingleLine.h
@@ -117,6 +117,7 @@ private:
virtual void selectionCleared() {}
virtual String itemText(unsigned listIndex) const;
virtual String itemLabel(unsigned listIndex) const;
+ virtual String itemIcon(unsigned listIndex) const;
virtual String itemToolTip(unsigned) const { return String(); }
virtual String itemAccessibilityText(unsigned) const { return String(); }
virtual bool itemIsEnabled(unsigned listIndex) const;
diff --git a/WebCore/rendering/SVGResources.cpp b/WebCore/rendering/SVGResources.cpp
new file mode 100644
index 0000000..de23ce1
--- /dev/null
+++ b/WebCore/rendering/SVGResources.cpp
@@ -0,0 +1,360 @@
+/*
+ Copyright (C) Research In Motion Limited 2010. All rights reserved.
+
+ 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
+ aint 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 "SVGResources.h"
+
+#if ENABLE(SVG)
+#include "RenderSVGResourceClipper.h"
+#include "RenderSVGResourceFilter.h"
+#include "RenderSVGResourceMarker.h"
+#include "RenderSVGResourceMasker.h"
+#include "SVGPaint.h"
+#include "SVGRenderStyle.h"
+#include "SVGURIReference.h"
+
+namespace WebCore {
+
+SVGResources::SVGResources()
+ : m_clipper(0)
+#if ENABLE(FILTERS)
+ , m_filter(0)
+#endif
+ , m_markerStart(0)
+ , m_markerMid(0)
+ , m_markerEnd(0)
+ , m_masker(0)
+ , m_fill(0)
+ , m_stroke(0)
+{
+}
+
+static inline RenderSVGResourceContainer* paintingResourceFromSVGPaint(Document* document, SVGPaint* paint, AtomicString& id, bool& hasPendingResource)
+{
+ ASSERT(paint);
+
+ SVGPaint::SVGPaintType paintType = paint->paintType();
+ if (paintType != SVGPaint::SVG_PAINTTYPE_URI && paintType != SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR)
+ return 0;
+
+ id = SVGURIReference::getTarget(paint->uri());
+ if (RenderSVGResourceContainer* container = getRenderSVGResourceContainerById(document, id))
+ return container;
+
+ hasPendingResource = true;
+ return 0;
+}
+
+static inline void registerPendingResource(SVGDocumentExtensions* extensions, const AtomicString& id, Node* node)
+{
+ ASSERT(node);
+ if (!node->isSVGElement())
+ return;
+
+ SVGElement* svgElement = static_cast<SVGElement*>(node);
+ if (!svgElement->isStyled())
+ return;
+
+ extensions->addPendingResource(id, static_cast<SVGStyledElement*>(svgElement));
+}
+
+bool SVGResources::buildCachedResources(const RenderObject* object, const SVGRenderStyle* style)
+{
+ ASSERT(object);
+ ASSERT(style);
+
+ Node* node = object->node();
+ ASSERT(node);
+
+ Document* document = object->document();
+ ASSERT(document);
+
+ SVGDocumentExtensions* extensions = document->accessSVGExtensions();
+ ASSERT(extensions);
+
+ bool foundResources = false;
+ if (style->hasClipper()) {
+ AtomicString id(style->clipperResource());
+ m_clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(document, id);
+ if (m_clipper)
+ foundResources = true;
+ else
+ registerPendingResource(extensions, id, node);
+ }
+
+ if (style->hasMasker()) {
+ AtomicString id(style->maskerResource());
+ m_masker = getRenderSVGResourceById<RenderSVGResourceMasker>(document, id);
+ if (m_masker)
+ foundResources = true;
+ else
+ registerPendingResource(extensions, id, node);
+ }
+
+#if ENABLE(FILTERS)
+ if (style->hasFilter()) {
+ AtomicString id(style->filterResource());
+ m_filter = getRenderSVGResourceById<RenderSVGResourceFilter>(document, id);
+ if (m_filter)
+ foundResources = true;
+ else
+ registerPendingResource(extensions, id, node);
+ }
+#endif
+
+ if (style->hasMarkers()) {
+ AtomicString markerStartId(style->markerStartResource());
+ m_markerStart = getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerStartId);
+ if (m_markerStart)
+ foundResources = true;
+ else
+ registerPendingResource(extensions, markerStartId, node);
+
+ AtomicString markerMidId(style->markerMidResource());
+ m_markerMid = getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerMidId);
+ if (m_markerMid)
+ foundResources = true;
+ else
+ registerPendingResource(extensions, markerMidId, node);
+
+ AtomicString markerEndId(style->markerEndResource());
+ m_markerEnd = getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerEndId);
+ if (m_markerEnd)
+ foundResources = true;
+ else
+ registerPendingResource(extensions, markerEndId, node);
+ }
+
+ if (style->hasFill()) {
+ bool hasPendingResource = false;
+ AtomicString id;
+ m_fill = paintingResourceFromSVGPaint(document, style->fillPaint(), id, hasPendingResource);
+ if (m_fill)
+ foundResources = true;
+ else if (hasPendingResource)
+ registerPendingResource(extensions, id, node);
+ }
+
+ if (style->hasStroke()) {
+ bool hasPendingResource = false;
+ AtomicString id;
+ m_stroke = paintingResourceFromSVGPaint(document, style->strokePaint(), id, hasPendingResource);
+ if (m_stroke)
+ foundResources = true;
+ else if (hasPendingResource)
+ registerPendingResource(extensions, id, node);
+ }
+
+ return foundResources;
+}
+
+void SVGResources::invalidateClient(RenderObject* object) const
+{
+ // Ordinary resources
+ if (m_clipper)
+ m_clipper->invalidateClient(object);
+#if ENABLE(FILTERS)
+ if (m_filter)
+ m_filter->invalidateClient(object);
+#endif
+ if (m_masker)
+ m_masker->invalidateClient(object);
+ if (m_markerStart)
+ m_markerStart->invalidateClient(object);
+ if (m_markerMid)
+ m_markerMid->invalidateClient(object);
+ if (m_markerEnd)
+ m_markerEnd->invalidateClient(object);
+
+ // Paint servers
+ if (m_fill)
+ m_fill->invalidateClient(object);
+ if (m_stroke)
+ m_stroke->invalidateClient(object);
+}
+
+void SVGResources::resourceDestroyed(RenderSVGResourceContainer* resource)
+{
+ ASSERT(resource);
+
+ switch (resource->resourceType()) {
+ case MaskerResourceType:
+ if (m_masker == resource) {
+ m_masker->invalidateClients();
+ m_masker = 0;
+ }
+ break;
+ case MarkerResourceType:
+ if (m_markerStart == resource) {
+ m_markerStart->invalidateClients();
+ m_markerStart = 0;
+ }
+
+ if (m_markerMid == resource) {
+ m_markerMid->invalidateClients();
+ m_markerMid = 0;
+ }
+
+ if (m_markerEnd == resource) {
+ m_markerEnd->invalidateClients();
+ m_markerEnd = 0;
+ }
+ break;
+ case PatternResourceType:
+ case LinearGradientResourceType:
+ case RadialGradientResourceType:
+ if (m_fill == resource) {
+ m_fill->invalidateClients();
+ m_fill = 0;
+ }
+
+ if (m_stroke == resource) {
+ m_stroke->invalidateClients();
+ m_stroke = 0;
+ }
+ break;
+#if ENABLE(FILTERS)
+ case FilterResourceType:
+ if (m_filter == resource) {
+ m_filter->invalidateClients();
+ m_filter = 0;
+ }
+ break;
+#endif
+ case ClipperResourceType:
+ if (m_clipper == resource) {
+ m_clipper->invalidateClients();
+ m_clipper = 0;
+ }
+ break;
+ case SolidColorResourceType:
+ ASSERT_NOT_REACHED();
+ }
+}
+
+void SVGResources::buildSetOfResources(HashSet<RenderSVGResourceContainer*>& set)
+{
+ // Ordinary resources
+ if (m_clipper)
+ set.add(m_clipper);
+#if ENABLE(FILTERS)
+ if (m_filter)
+ set.add(m_filter);
+#endif
+ if (m_markerStart)
+ set.add(m_markerStart);
+ if (m_markerMid)
+ set.add(m_markerMid);
+ if (m_markerEnd)
+ set.add(m_markerEnd);
+ if (m_masker)
+ set.add(m_masker);
+
+ // Paint servers
+ if (m_fill)
+ set.add(m_fill);
+ if (m_stroke)
+ set.add(m_stroke);
+}
+
+void SVGResources::resetClipper()
+{
+ ASSERT(m_clipper);
+ m_clipper = 0;
+}
+
+#if ENABLE(FILTERS)
+void SVGResources::resetFilter()
+{
+ ASSERT(m_filter);
+ m_filter = 0;
+}
+#endif
+
+void SVGResources::resetMarkerStart()
+{
+ ASSERT(m_markerStart);
+ m_markerStart = 0;
+}
+
+void SVGResources::resetMarkerMid()
+{
+ ASSERT(m_markerMid);
+ m_markerMid = 0;
+}
+
+void SVGResources::resetMarkerEnd()
+{
+ ASSERT(m_markerEnd);
+ m_markerEnd = 0;
+}
+
+void SVGResources::resetMasker()
+{
+ ASSERT(m_masker);
+ m_masker = 0;
+}
+
+void SVGResources::resetFill()
+{
+ ASSERT(m_fill);
+ m_fill = 0;
+}
+
+void SVGResources::resetStroke()
+{
+ ASSERT(m_stroke);
+ m_stroke = 0;
+}
+
+#ifndef NDEBUG
+void SVGResources::dump(const RenderObject* object)
+{
+ ASSERT(object);
+ ASSERT(object->node());
+
+ fprintf(stderr, "-> this=%p, SVGResources(renderer=%p, node=%p)\n", this, object, object->node());
+ fprintf(stderr, " | DOM Tree:\n");
+ object->node()->showTreeForThis();
+
+ fprintf(stderr, "\n | List of resources:\n");
+ if (m_clipper)
+ fprintf(stderr, " |-> Clipper : %p (node=%p)\n", m_clipper, m_clipper->node());
+#if ENABLE(FILTERS)
+ if (m_filter)
+ fprintf(stderr, " |-> Filter : %p (node=%p)\n", m_filter, m_filter->node());
+#endif
+ if (m_markerStart)
+ fprintf(stderr, " |-> MarkerStart: %p (node=%p)\n", m_markerStart, m_markerStart->node());
+ if (m_markerMid)
+ fprintf(stderr, " |-> MarkerMid : %p (node=%p)\n", m_markerMid, m_markerMid->node());
+ if (m_markerEnd)
+ fprintf(stderr, " |-> MarkerEnd : %p (node=%p)\n", m_markerEnd, m_markerEnd->node());
+ if (m_masker)
+ fprintf(stderr, " |-> Masker : %p (node=%p)\n", m_masker, m_masker->node());
+ if (m_fill)
+ fprintf(stderr, " |-> Fill : %p (node=%p)\n", m_fill, m_fill->node());
+ if (m_stroke)
+ fprintf(stderr, " |-> Stroke : %p (node=%p)\n", m_stroke, m_stroke->node());
+}
+#endif
+
+}
+
+#endif
diff --git a/WebCore/rendering/SVGResources.h b/WebCore/rendering/SVGResources.h
new file mode 100644
index 0000000..57a4140
--- /dev/null
+++ b/WebCore/rendering/SVGResources.h
@@ -0,0 +1,103 @@
+/*
+ Copyright (C) Research In Motion Limited 2010. All rights reserved.
+
+ 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
+ aint 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 SVGResources_h
+#define SVGResources_h
+
+#if ENABLE(SVG)
+#include <wtf/HashSet.h>
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+class Document;
+class RenderObject;
+class RenderSVGResourceClipper;
+class RenderSVGResourceContainer;
+class RenderSVGResourceFilter;
+class RenderSVGResourceMarker;
+class RenderSVGResourceMasker;
+class SVGRenderStyle;
+
+// Holds a set of resources associated with a RenderObject
+class SVGResources {
+public:
+ SVGResources();
+
+ bool buildCachedResources(const RenderObject*, const SVGRenderStyle*);
+
+ // Ordinary resources
+ RenderSVGResourceClipper* clipper() const { return m_clipper; }
+#if ENABLE(FILTERS)
+ RenderSVGResourceFilter* filter() const { return m_filter; }
+#endif
+ RenderSVGResourceMarker* markerStart() const { return m_markerStart; }
+ RenderSVGResourceMarker* markerMid() const { return m_markerMid; }
+ RenderSVGResourceMarker* markerEnd() const { return m_markerEnd; }
+ RenderSVGResourceMasker* masker() const { return m_masker; }
+
+ // Paint servers
+ RenderSVGResourceContainer* fill() const { return m_fill; }
+ RenderSVGResourceContainer* stroke() const { return m_stroke; }
+
+ void buildSetOfResources(HashSet<RenderSVGResourceContainer*>&);
+
+ // Methods operating on all cached resources
+ void invalidateClient(RenderObject*) const;
+ void resourceDestroyed(RenderSVGResourceContainer*);
+
+#ifndef NDEBUG
+ void dump(const RenderObject*);
+#endif
+
+private:
+ friend class SVGResourcesCycleSolver;
+
+ // Only used by SVGResourcesCache cycle detection logic
+ void resetClipper();
+#if ENABLE(FILTERS)
+ void resetFilter();
+#endif
+ void resetMarkerStart();
+ void resetMarkerMid();
+ void resetMarkerEnd();
+ void resetMasker();
+ void resetFill();
+ void resetStroke();
+
+private:
+ // Ordinary resources
+ RenderSVGResourceClipper* m_clipper;
+#if ENABLE(FILTERS)
+ RenderSVGResourceFilter* m_filter;
+#endif
+ RenderSVGResourceMarker* m_markerStart;
+ RenderSVGResourceMarker* m_markerMid;
+ RenderSVGResourceMarker* m_markerEnd;
+ RenderSVGResourceMasker* m_masker;
+
+ // Paint servers
+ RenderSVGResourceContainer* m_fill;
+ RenderSVGResourceContainer* m_stroke;
+};
+
+}
+
+#endif
+#endif
diff --git a/WebCore/rendering/SVGResourcesCache.cpp b/WebCore/rendering/SVGResourcesCache.cpp
new file mode 100644
index 0000000..46586cc
--- /dev/null
+++ b/WebCore/rendering/SVGResourcesCache.cpp
@@ -0,0 +1,179 @@
+/*
+ Copyright (C) Research In Motion Limited 2010. All rights reserved.
+
+ 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
+ aint 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 "SVGResourcesCache.h"
+
+#if ENABLE(SVG)
+#include "RenderSVGResourceContainer.h"
+#include "SVGDocumentExtensions.h"
+#include "SVGResources.h"
+#include "SVGResourcesCycleSolver.h"
+
+namespace WebCore {
+
+SVGResourcesCache::SVGResourcesCache()
+{
+}
+
+SVGResourcesCache::~SVGResourcesCache()
+{
+ if (m_cache.isEmpty())
+ return;
+
+ deleteAllValues(m_cache);
+ m_cache.clear();
+}
+
+void SVGResourcesCache::addResourcesFromRenderObject(RenderObject* object, const RenderStyle* style)
+{
+ ASSERT(object);
+ ASSERT(style);
+ ASSERT(!m_cache.contains(object));
+
+ const SVGRenderStyle* svgStyle = style->svgStyle();
+ ASSERT(svgStyle);
+
+ // Build a list of all resources associated with the passed RenderObject
+ SVGResources* resources = new SVGResources;
+ if (!resources->buildCachedResources(object, svgStyle)) {
+ delete resources;
+ return;
+ }
+
+ // Put object in cache.
+ m_cache.set(object, resources);
+
+ // Run cycle-detection _afterwards_, so self-references can be caught as well.
+ SVGResourcesCycleSolver solver(object, resources);
+ solver.resolveCycles();
+
+ // Walk resources and register the render object at each resources.
+ HashSet<RenderSVGResourceContainer*> resourceSet;
+ resources->buildSetOfResources(resourceSet);
+
+ HashSet<RenderSVGResourceContainer*>::iterator end = resourceSet.end();
+ for (HashSet<RenderSVGResourceContainer*>::iterator it = resourceSet.begin(); it != end; ++it)
+ (*it)->addClient(object);
+}
+
+void SVGResourcesCache::removeResourcesFromRenderObject(RenderObject* object)
+{
+ if (!m_cache.contains(object))
+ return;
+
+ SVGResources* resources = m_cache.get(object);
+
+ // Walk resources and register the render object at each resources.
+ HashSet<RenderSVGResourceContainer*> resourceSet;
+ resources->buildSetOfResources(resourceSet);
+
+ HashSet<RenderSVGResourceContainer*>::iterator end = resourceSet.end();
+ for (HashSet<RenderSVGResourceContainer*>::iterator it = resourceSet.begin(); it != end; ++it)
+ (*it)->removeClient(object);
+
+ delete m_cache.take(object);
+}
+
+static inline SVGResourcesCache* resourcesCacheFromRenderObject(RenderObject* renderer)
+{
+ Document* document = renderer->document();
+ ASSERT(document);
+
+ SVGDocumentExtensions* extensions = document->accessSVGExtensions();
+ ASSERT(extensions);
+
+ SVGResourcesCache* cache = extensions->resourcesCache();
+ ASSERT(cache);
+
+ return cache;
+}
+
+SVGResources* SVGResourcesCache::cachedResourcesForRenderObject(RenderObject* renderer)
+{
+ ASSERT(renderer);
+ SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer);
+ if (!cache->m_cache.contains(renderer))
+ return 0;
+
+ return cache->m_cache.get(renderer);
+}
+
+void SVGResourcesCache::clientLayoutChanged(RenderObject* object)
+{
+ SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(object);
+ if (!resources)
+ return;
+
+ resources->invalidateClient(object);
+}
+
+void SVGResourcesCache::clientStyleChanged(RenderObject* renderer, StyleDifference diff, const RenderStyle* newStyle)
+{
+ ASSERT(renderer);
+ if (diff == StyleDifferenceEqual)
+ return;
+
+ clientUpdatedFromElement(renderer, newStyle);
+
+ // Invalidate resources in ancestor chain, if needed.
+ RenderObject* parent = renderer->parent();
+ while (parent) {
+ if (parent->isSVGResourceContainer()) {
+ parent->toRenderSVGResourceContainer()->invalidateClients();
+ break;
+ }
+
+ parent = parent->parent();
+ }
+}
+
+void SVGResourcesCache::clientUpdatedFromElement(RenderObject* renderer, const RenderStyle* newStyle)
+{
+ ASSERT(renderer);
+ ASSERT(renderer->parent());
+
+ SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer);
+ cache->removeResourcesFromRenderObject(renderer);
+ cache->addResourcesFromRenderObject(renderer, newStyle);
+}
+
+void SVGResourcesCache::clientDestroyed(RenderObject* renderer)
+{
+ ASSERT(renderer);
+ SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer);
+ cache->removeResourcesFromRenderObject(renderer);
+}
+
+void SVGResourcesCache::resourceDestroyed(RenderSVGResourceContainer* resource)
+{
+ ASSERT(resource);
+ SVGResourcesCache* cache = resourcesCacheFromRenderObject(resource);
+
+ // The resource itself may have clients, that need to be notified.
+ cache->removeResourcesFromRenderObject(resource);
+
+ HashMap<RenderObject*, SVGResources*>::iterator end = cache->m_cache.end();
+ for (HashMap<RenderObject*, SVGResources*>::iterator it = cache->m_cache.begin(); it != end; ++it)
+ it->second->resourceDestroyed(resource);
+}
+
+}
+
+#endif
diff --git a/WebCore/rendering/SVGResourcesCache.h b/WebCore/rendering/SVGResourcesCache.h
new file mode 100644
index 0000000..4a61570
--- /dev/null
+++ b/WebCore/rendering/SVGResourcesCache.h
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) Research In Motion Limited 2010. All rights reserved.
+
+ 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
+ aint 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 SVGResourcesCache_h
+#define SVGResourcesCache_h
+
+#if ENABLE(SVG)
+#include "RenderStyleConstants.h"
+#include <wtf/HashMap.h>
+
+namespace WebCore {
+
+class RenderObject;
+class RenderStyle;
+class RenderSVGResourceContainer;
+class SVGResources;
+
+class SVGResourcesCache : public Noncopyable {
+public:
+ SVGResourcesCache();
+ ~SVGResourcesCache();
+
+ void addResourcesFromRenderObject(RenderObject*, const RenderStyle*);
+ void removeResourcesFromRenderObject(RenderObject*);
+ static SVGResources* cachedResourcesForRenderObject(RenderObject*);
+
+ // Called from all SVG renderers destroy() methods - except for RenderSVGResourceContainer.
+ static void clientDestroyed(RenderObject*);
+
+ // Called from all SVG renderers layout() methods.
+ static void clientLayoutChanged(RenderObject*);
+
+ // Called from all SVG renderers styleDidChange() methods.
+ static void clientStyleChanged(RenderObject*, StyleDifference, const RenderStyle* newStyle);
+
+ // Called from all SVG renderers updateFromElement() methods.
+ static void clientUpdatedFromElement(RenderObject*, const RenderStyle* newStyle);
+
+ // Called from RenderSVGResourceContainer::destroy().
+ static void resourceDestroyed(RenderSVGResourceContainer*);
+
+private:
+ HashMap<RenderObject*, SVGResources*> m_cache;
+};
+
+}
+
+#endif
+#endif
diff --git a/WebCore/rendering/SVGResourcesCycleSolver.cpp b/WebCore/rendering/SVGResourcesCycleSolver.cpp
new file mode 100644
index 0000000..838758b
--- /dev/null
+++ b/WebCore/rendering/SVGResourcesCycleSolver.cpp
@@ -0,0 +1,296 @@
+/*
+ Copyright (C) Research In Motion Limited 2010. All rights reserved.
+
+ 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
+ aint 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 "SVGResourcesCycleSolver.h"
+
+// Set to a value > 0, to debug the resource cache.
+#define DEBUG_CYCLE_DETECTION 0
+
+#if ENABLE(SVG)
+#include "RenderSVGResourceClipper.h"
+#include "RenderSVGResourceFilter.h"
+#include "RenderSVGResourceMarker.h"
+#include "RenderSVGResourceMasker.h"
+#include "SVGFilterElement.h"
+#include "SVGGradientElement.h"
+#include "SVGPatternElement.h"
+#include "SVGResources.h"
+#include "SVGResourcesCache.h"
+
+namespace WebCore {
+
+SVGResourcesCycleSolver::SVGResourcesCycleSolver(RenderObject* renderer, SVGResources* resources)
+ : m_renderer(renderer)
+ , m_resources(resources)
+{
+ ASSERT(m_renderer);
+ ASSERT(m_resources);
+}
+
+SVGResourcesCycleSolver::~SVGResourcesCycleSolver()
+{
+}
+
+bool SVGResourcesCycleSolver::resourceContainsCycles(RenderObject* renderer) const
+{
+ ASSERT(renderer);
+
+ // First operate on the resources of the given renderer.
+ // <marker id="a"> <path marker-start="url(#b)"/> ...
+ // <marker id="b" marker-start="url(#a)"/>
+ if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(renderer)) {
+ HashSet<RenderSVGResourceContainer*> resourceSet;
+ resources->buildSetOfResources(resourceSet);
+
+ // Walk all resources and check wheter they reference any resource contained in the resources set.
+ HashSet<RenderSVGResourceContainer*>::iterator end = resourceSet.end();
+ for (HashSet<RenderSVGResourceContainer*>::iterator it = resourceSet.begin(); it != end; ++it) {
+ if (m_allResources.contains(*it))
+ return true;
+ }
+ }
+
+ // Then operate on the child resources of the given renderer.
+ // <marker id="a"> <path marker-start="url(#b)"/> ...
+ // <marker id="b"> <path marker-start="url(#a)"/> ...
+ for (RenderObject* child = renderer->firstChild(); child; child = child->nextSibling()) {
+ SVGResources* childResources = SVGResourcesCache::cachedResourcesForRenderObject(child);
+ if (!childResources)
+ continue;
+
+ // A child of the given 'resource' contains resources.
+ HashSet<RenderSVGResourceContainer*> childSet;
+ childResources->buildSetOfResources(childSet);
+
+ // Walk all child resources and check wheter they reference any resource contained in the resources set.
+ HashSet<RenderSVGResourceContainer*>::iterator end = childSet.end();
+ for (HashSet<RenderSVGResourceContainer*>::iterator it = childSet.begin(); it != end; ++it) {
+ if (m_allResources.contains(*it))
+ return true;
+ }
+
+ // Walk children recursively, stop immediately if we found a cycle
+ if (resourceContainsCycles(child))
+ return true;
+ }
+
+ return false;
+}
+
+static inline String targetReferenceFromResource(SVGElement* element, bool& isValid)
+{
+ String target;
+ if (element->hasTagName(SVGNames::patternTag))
+ target = static_cast<SVGPatternElement*>(element)->href();
+ else if (element->hasTagName(SVGNames::linearGradientTag) || element->hasTagName(SVGNames::radialGradientTag))
+ target = static_cast<SVGGradientElement*>(element)->href();
+ else if (element->hasTagName(SVGNames::filterTag))
+ target = static_cast<SVGFilterElement*>(element)->href();
+ else {
+ isValid = false;
+ return target;
+ }
+
+ return SVGURIReference::getTarget(target);
+}
+
+static inline void setFollowLinkForChainableResource(SVGElement*, bool)
+{
+ // FIXME: Enable once the follow-up patch for bug 43031 lands
+}
+
+bool SVGResourcesCycleSolver::chainableResourceContainsCycles(RenderSVGResourceContainer* container) const
+{
+ ASSERT(container);
+ ASSERT(container->node());
+ ASSERT(container->node()->isSVGElement());
+
+ // Chainable resources cycle detection is performed in the DOM tree.
+ SVGElement* element = static_cast<SVGElement*>(container->node());
+ ASSERT(element);
+
+ HashSet<SVGElement*> processedObjects;
+
+ bool isValid = true;
+ String target = targetReferenceFromResource(element, isValid);
+ ASSERT(isValid);
+
+ SVGElement* previousElement = element;
+ while (!target.isEmpty()) {
+ Node* targetNode = element->document()->getElementById(target);
+ if (!targetNode || !targetNode->isSVGElement())
+ break;
+
+ // Catch cylic chaining, otherwhise we'll run into an infinite loop here.
+ // <pattern id="foo" xlink:href="#bar"/> <pattern id="bar xlink:href="#foo"/>
+ SVGElement* targetElement = static_cast<SVGElement*>(targetNode);
+
+ bool followLink = true;
+ if (processedObjects.contains(targetElement) || targetElement == element)
+ followLink = false;
+
+ setFollowLinkForChainableResource(previousElement, followLink);
+ if (!followLink)
+ return false;
+
+ previousElement = targetElement;
+ processedObjects.add(targetElement);
+ target = targetReferenceFromResource(targetElement, isValid);
+ if (!isValid)
+ break;
+ }
+
+ // Couldn't find any direct cycle in the xlink:href chain, maybe there's an indirect one.
+ // <pattern id="foo" xlink:href="#bar"/> <pattern id="bar"> <rect fill="url(#foo)"...
+ HashSet<SVGElement*>::iterator end = processedObjects.end();
+ for (HashSet<SVGElement*>::iterator it = processedObjects.begin(); it != end; ++it) {
+ RenderObject* renderer = (*it)->renderer();
+ if (!renderer)
+ continue;
+ ASSERT(renderer->isSVGResourceContainer());
+ if (m_allResources.contains(renderer->toRenderSVGResourceContainer()))
+ return true;
+ }
+
+ return false;
+}
+
+void SVGResourcesCycleSolver::resolveCycles()
+{
+ ASSERT(m_allResources.isEmpty());
+
+#if DEBUG_CYCLE_DETECTION > 0
+ fprintf(stderr, "\nBefore cycle detection:\n");
+ m_resources->dump(m_renderer);
+#endif
+
+ // Stash all resources into a HashSet for the ease of traversing.
+ HashSet<RenderSVGResourceContainer*> localResources;
+ m_resources->buildSetOfResources(localResources);
+ ASSERT(!localResources.isEmpty());
+
+ // Add all parent resource containers to the HashSet.
+ HashSet<RenderSVGResourceContainer*> parentResources;
+ RenderObject* parent = m_renderer->parent();
+ while (parent) {
+ if (parent->isSVGResourceContainer())
+ parentResources.add(parent->toRenderSVGResourceContainer());
+ parent = parent->parent();
+ }
+
+#if DEBUG_CYCLE_DETECTION > 0
+ fprintf(stderr, "\nDetecting wheter any resources references any of following objects:\n");
+ {
+ fprintf(stderr, "Local resources:\n");
+ HashSet<RenderSVGResourceContainer*>::iterator end = localResources.end();
+ for (HashSet<RenderSVGResourceContainer*>::iterator it = localResources.begin(); it != end; ++it)
+ fprintf(stderr, "|> %s: object=%p (node=%p)\n", (*it)->renderName(), *it, (*it)->node());
+
+ fprintf(stderr, "Parent resources:\n");
+ end = parentResources.end();
+ for (HashSet<RenderSVGResourceContainer*>::iterator it = parentResources.begin(); it != end; ++it)
+ fprintf(stderr, "|> %s: object=%p (node=%p)\n", (*it)->renderName(), *it, (*it)->node());
+ }
+#endif
+
+ // Build combined set of local and parent resources.
+ m_allResources = localResources;
+ HashSet<RenderSVGResourceContainer*>::iterator end = parentResources.end();
+ for (HashSet<RenderSVGResourceContainer*>::iterator it = parentResources.begin(); it != end; ++it)
+ m_allResources.add(*it);
+
+ ASSERT(!m_allResources.isEmpty());
+
+ // The job of this function is to determine wheter any of the 'resources' associated with the given 'renderer'
+ // references us (or wheter any of its kids references us) -> that's a cycle, we need to find and break it.
+ end = localResources.end();
+ for (HashSet<RenderSVGResourceContainer*>::iterator it = localResources.begin(); it != end; ++it) {
+ RenderSVGResourceContainer* resource = *it;
+
+ // Special handling for resources that can be chained using xlink:href - need to detect cycles as well!
+ switch (resource->resourceType()) {
+ case PatternResourceType:
+ case LinearGradientResourceType:
+ case RadialGradientResourceType:
+ case FilterResourceType:
+ if (chainableResourceContainsCycles(resource)) {
+ breakCycle(resource);
+ continue;
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (parentResources.contains(resource) || resourceContainsCycles(resource))
+ breakCycle(resource);
+ }
+
+#if DEBUG_CYCLE_DETECTION > 0
+ fprintf(stderr, "\nAfter cycle detection:\n");
+ m_resources->dump(m_renderer);
+#endif
+
+ m_allResources.clear();
+}
+
+void SVGResourcesCycleSolver::breakCycle(RenderSVGResourceContainer* resourceLeadingToCycle)
+{
+ ASSERT(resourceLeadingToCycle);
+ switch (resourceLeadingToCycle->resourceType()) {
+ case MaskerResourceType:
+ ASSERT(resourceLeadingToCycle == m_resources->masker());
+ m_resources->resetMasker();
+ break;
+ case MarkerResourceType:
+ ASSERT(resourceLeadingToCycle == m_resources->markerStart() || resourceLeadingToCycle == m_resources->markerMid() || resourceLeadingToCycle == m_resources->markerEnd());
+ if (m_resources->markerStart() == resourceLeadingToCycle)
+ m_resources->resetMarkerStart();
+ if (m_resources->markerMid() == resourceLeadingToCycle)
+ m_resources->resetMarkerMid();
+ if (m_resources->markerEnd() == resourceLeadingToCycle)
+ m_resources->resetMarkerEnd();
+ break;
+ case PatternResourceType:
+ case LinearGradientResourceType:
+ case RadialGradientResourceType:
+ ASSERT(resourceLeadingToCycle == m_resources->fill() || resourceLeadingToCycle == m_resources->stroke());
+ if (m_resources->fill() == resourceLeadingToCycle)
+ m_resources->resetFill();
+ if (m_resources->stroke() == resourceLeadingToCycle)
+ m_resources->resetStroke();
+ break;
+ case FilterResourceType:
+ ASSERT(resourceLeadingToCycle == m_resources->filter());
+ m_resources->resetFilter();
+ break;
+ case ClipperResourceType:
+ ASSERT(resourceLeadingToCycle == m_resources->clipper());
+ m_resources->resetClipper();
+ break;
+ case SolidColorResourceType:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+}
+
+}
+
+#endif
diff --git a/WebCore/rendering/SVGResourcesCycleSolver.h b/WebCore/rendering/SVGResourcesCycleSolver.h
new file mode 100644
index 0000000..1f49354
--- /dev/null
+++ b/WebCore/rendering/SVGResourcesCycleSolver.h
@@ -0,0 +1,52 @@
+/*
+ Copyright (C) Research In Motion Limited 2010. All rights reserved.
+
+ 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
+ aint 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 SVGResourcesCycleSolver_h
+#define SVGResourcesCycleSolver_h
+
+#if ENABLE(SVG)
+#include <wtf/HashSet.h>
+
+namespace WebCore {
+
+class RenderObject;
+class RenderSVGResourceContainer;
+class SVGResources;
+
+class SVGResourcesCycleSolver : public Noncopyable {
+public:
+ SVGResourcesCycleSolver(RenderObject*, SVGResources*);
+ ~SVGResourcesCycleSolver();
+
+ void resolveCycles();
+
+private:
+ bool resourceContainsCycles(RenderObject*) const;
+ bool chainableResourceContainsCycles(RenderSVGResourceContainer*) const;
+ void breakCycle(RenderSVGResourceContainer*);
+
+ RenderObject* m_renderer;
+ SVGResources* m_resources;
+ HashSet<RenderSVGResourceContainer*> m_allResources;
+};
+
+}
+
+#endif
+#endif
diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp
index 24e1d74..b29876a 100644
--- a/WebCore/rendering/TextControlInnerElements.cpp
+++ b/WebCore/rendering/TextControlInnerElements.cpp
@@ -232,7 +232,13 @@ void SearchFieldCancelButtonElement::defaultEventHandler(Event* event)
m_capturing = false;
}
if (hovered()) {
+ RefPtr<HTMLInputElement> protector(input);
+ String oldValue = input->value();
input->setValue("");
+ if (!oldValue.isEmpty()) {
+ toRenderTextControl(input->renderer())->setChangedSinceLastChangeEvent(true);
+ input->dispatchEvent(Event::create(eventNames().inputEvent, true, false));
+ }
input->onSearch();
event->setDefaultHandled();
}
@@ -374,7 +380,7 @@ void InputFieldSpeechButtonElement::defaultEventHandler(Event* event)
m_capturing = false;
}
if (hovered()) {
- speechInput()->startRecognition();
+ speechInput()->startRecognition(this);
event->setDefaultHandled();
}
}
@@ -386,17 +392,20 @@ void InputFieldSpeechButtonElement::defaultEventHandler(Event* event)
SpeechInput* InputFieldSpeechButtonElement::speechInput()
{
- if (!m_speechInput)
- m_speechInput.set(new SpeechInput(document()->page()->speechInputClient(), this));
- return m_speechInput.get();
+ return document()->page()->speechInput();
}
-void InputFieldSpeechButtonElement::recordingComplete()
+void InputFieldSpeechButtonElement::didCompleteRecording()
{
// FIXME: Add UI feedback here to indicate that audio recording stopped and recognition is
// in progress.
}
+void InputFieldSpeechButtonElement::didCompleteRecognition()
+{
+ // FIXME: Add UI feedback here to indicate that audio recognition has ended.
+}
+
void InputFieldSpeechButtonElement::setRecognitionResult(const String& result)
{
HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
diff --git a/WebCore/rendering/TextControlInnerElements.h b/WebCore/rendering/TextControlInnerElements.h
index 68d6ff4..ed38221 100644
--- a/WebCore/rendering/TextControlInnerElements.h
+++ b/WebCore/rendering/TextControlInnerElements.h
@@ -124,7 +124,8 @@ public:
virtual void defaultEventHandler(Event*);
// SpeechInputListener methods.
- void recordingComplete();
+ void didCompleteRecording();
+ void didCompleteRecognition();
void setRecognitionResult(const String& result);
private:
@@ -133,7 +134,6 @@ private:
SpeechInput* speechInput();
bool m_capturing;
- OwnPtr<SpeechInput> m_speechInput;
};
#endif // ENABLE(INPUT_SPEECH)
diff --git a/WebCore/rendering/break_lines.cpp b/WebCore/rendering/break_lines.cpp
index 4b6c0aa..307fb6f 100644
--- a/WebCore/rendering/break_lines.cpp
+++ b/WebCore/rendering/break_lines.cpp
@@ -38,45 +38,94 @@ namespace WebCore {
static inline bool isBreakableSpace(UChar ch, bool treatNoBreakSpaceAsBreak)
{
switch (ch) {
- case ' ':
- case '\n':
- case '\t':
- return true;
- case noBreakSpace:
- return treatNoBreakSpaceAsBreak;
- default:
- return false;
+ case ' ':
+ case '\n':
+ case '\t':
+ return true;
+ case noBreakSpace:
+ return treatNoBreakSpaceAsBreak;
+ default:
+ return false;
}
}
-// This differs from the Unicode algorithm only in that Unicode does not break
-// between a question mark and a vertical line (U+007C).
-static const unsigned char internetExplorerLineBreaksAfterQuestionMarkTable[0x80] = {
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, // \t
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, // ! " ' ) , . /
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, // : ; ?
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, // ]
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1 // }
+static const UChar asciiLineBreakTableFirstChar = '!';
+static const UChar asciiLineBreakTableLastChar = 127;
+
+// Pack 8 bits into one byte
+#define B(a, b, c, d, e, f, g, h) \
+ ((a) | ((b) << 1) | ((c) << 2) | ((d) << 3) | ((e) << 4) | ((f) << 5) | ((g) << 6) | ((h) << 7))
+
+// Line breaking table row for each digit (0-9)
+#define DI { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+
+// Line breaking table row for ascii letters (a-z A-Z)
+#define AL { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+
+#define F 0xFF
+
+// Line breaking table for printable ASCII characters. Line breaking opportunities in this table are as below:
+// - before openning punctuations such as '(', '<', '[', '{' after certain characters (compatible with Firefox 3.6);
+// - after '-' and '?' (backward-compatible, and compatible with Internet Explorer).
+// Please refer to <https://bugs.webkit.org/show_bug.cgi?id=37698> for line breaking matrixes of different browsers
+// and the ICU standard.
+static const unsigned char asciiLineBreakTable[][(asciiLineBreakTableLastChar - asciiLineBreakTableFirstChar) / 8 + 1] = {
+ // ! " # $ % & ' ( ) * + , - . / 0 1-8 9 : ; < = > ? @ A-X Y Z [ \ ] ^ _ ` a-x y z { | } ~ DEL
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // !
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // "
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // #
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // $
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // %
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // &
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // '
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // (
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // )
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // *
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // +
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // ,
+ { B(1, 1, 1, 1, 1, 1, 1, 1), B(1, 1, 1, 1, 1, 1, 1, 1), F, B(1, 1, 1, 1, 1, 1, 1, 1), F, F, F, B(1, 1, 1, 1, 1, 1, 1, 1), F, F, F, B(1, 1, 1, 1, 1, 1, 1, 1) }, // -
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // .
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // /
+ DI, DI, DI, DI, DI, DI, DI, DI, DI, DI, // 0-9
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // :
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // ;
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // <
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // =
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // >
+ { B(0, 0, 1, 1, 1, 1, 0, 1), B(0, 1, 1, 0, 1, 0, 0, 1), F, B(1, 0, 0, 1, 1, 1, 0, 1), F, F, F, B(1, 1, 1, 1, 0, 1, 1, 1), F, F, F, B(1, 1, 1, 1, 0, 1, 1, 0) }, // ?
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // @
+ AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, // A-Z
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // [
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // '\'
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // ]
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // ^
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // _
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // `
+ AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, // a-z
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // {
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // |
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // }
+ { B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0) }, // ~
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // DEL
};
-static const size_t internetExplorerLineBreaksAfterQuestionMarkTableSize = sizeof(internetExplorerLineBreaksAfterQuestionMarkTable) / sizeof(*internetExplorerLineBreaksAfterQuestionMarkTable);
+#undef B
+#undef F
+#undef DI
+#undef AL
+
+COMPILE_ASSERT(sizeof(asciiLineBreakTable) / sizeof(asciiLineBreakTable[0]) == asciiLineBreakTableLastChar - asciiLineBreakTableFirstChar + 1,
+ TestLineBreakTableConsistency);
static inline bool shouldBreakAfter(UChar ch, UChar nextCh)
{
switch (ch) {
- // For a question mark preceding a non-ASCII characters, defer to the Unicode algorithm by returning false.
- // For ASCII characters, use a lookup table for enhanced speed and for compatibility with Internet Explorer.
- case '?':
- return nextCh < internetExplorerLineBreaksAfterQuestionMarkTableSize && internetExplorerLineBreaksAfterQuestionMarkTable[nextCh];
- // Internet Explorer always allows breaking after a hyphen.
- case '-':
- case softHyphen:
+ case ideographicComma:
+ case ideographicFullStop:
// FIXME: cases for ideographicComma and ideographicFullStop are a workaround for an issue in Unicode 5.0
// which is likely to be resolved in Unicode 5.1 <http://bugs.webkit.org/show_bug.cgi?id=17411>.
// We may want to remove or conditionalize this workaround at some point.
+<<<<<<< HEAD
case ideographicComma:
case ideographicFullStop:
#ifdef ANDROID_LAYOUT
@@ -86,12 +135,26 @@ static inline bool shouldBreakAfter(UChar ch, UChar nextCh)
return true;
default:
return false;
+=======
+ return true;
+ default:
+ // If both ch and nextCh are ASCII characters, use a lookup table for enhanced speed and for compatibility
+ // with other browsers (see comments for asciiLineBreakTable for details).
+ if (ch >= asciiLineBreakTableFirstChar && ch <= asciiLineBreakTableLastChar
+ && nextCh >= asciiLineBreakTableFirstChar && nextCh <= asciiLineBreakTableLastChar) {
+ const unsigned char* tableRow = asciiLineBreakTable[ch - asciiLineBreakTableFirstChar];
+ int nextChIndex = nextCh - asciiLineBreakTableFirstChar;
+ return tableRow[nextChIndex / 8] & (1 << (nextChIndex % 8));
+ }
+ // Otherwise defer to the Unicode algorithm by returning false.
+ return false;
+>>>>>>> webkit.org at r64264
}
}
static inline bool needsLineBreakIterator(UChar ch)
{
- return ch > 0x7F && ch != noBreakSpace;
+ return ch > asciiLineBreakTableLastChar && ch != noBreakSpace;
}
#if PLATFORM(MAC) && defined(BUILDING_ON_TIGER)
diff --git a/WebCore/storage/DatabaseAuthorizer.cpp b/WebCore/storage/DatabaseAuthorizer.cpp
index 17abebd..79e47d4 100644
--- a/WebCore/storage/DatabaseAuthorizer.cpp
+++ b/WebCore/storage/DatabaseAuthorizer.cpp
@@ -29,7 +29,6 @@
#include "config.h"
#include "DatabaseAuthorizer.h"
-#if ENABLE(DATABASE)
#include "PlatformString.h"
#include <wtf/PassRefPtr.h>
@@ -420,5 +419,3 @@ int DatabaseAuthorizer::updateDeletesBasedOnTableName(const String& tableName)
}
} // namespace WebCore
-
-#endif // ENABLE(DATABASE)
diff --git a/WebCore/storage/IDBDatabaseImpl.cpp b/WebCore/storage/IDBDatabaseImpl.cpp
index 712830a..162efab 100644
--- a/WebCore/storage/IDBDatabaseImpl.cpp
+++ b/WebCore/storage/IDBDatabaseImpl.cpp
@@ -68,7 +68,7 @@ void IDBDatabaseImpl::createObjectStore(const String& name, const String& keyPat
PassRefPtr<IDBObjectStore> IDBDatabaseImpl::objectStore(const String& name, unsigned short mode)
{
// FIXME: If no transaction is running, this should implicitly start one.
- ASSERT(!mode); // FIXME: Handle non-standard modes.
+ ASSERT_UNUSED(mode, !mode); // FIXME: Handle non-standard modes.
return m_objectStores.get(name);
}
diff --git a/WebCore/storage/IDBKeyRange.cpp b/WebCore/storage/IDBKeyRange.cpp
index 9f22fc8..dfcae19 100644
--- a/WebCore/storage/IDBKeyRange.cpp
+++ b/WebCore/storage/IDBKeyRange.cpp
@@ -26,20 +26,42 @@
#include "config.h"
#include "IDBKeyRange.h"
-#include "IDBAny.h"
-#include "SerializedScriptValue.h"
+#include "IDBKey.h"
#if ENABLE(INDEXED_DATABASE)
namespace WebCore {
-IDBKeyRange::IDBKeyRange(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, unsigned short flags)
+IDBKeyRange::IDBKeyRange(PassRefPtr<IDBKey> left, PassRefPtr<IDBKey> right, unsigned short flags)
: m_left(left)
, m_right(right)
, m_flags(flags)
{
}
+PassRefPtr<IDBKeyRange> IDBKeyRange::only(PassRefPtr<IDBKey> prpValue)
+{
+ RefPtr<IDBKey> value = prpValue;
+ return IDBKeyRange::create(value, value, IDBKeyRange::SINGLE);
+}
+
+PassRefPtr<IDBKeyRange> IDBKeyRange::leftBound(PassRefPtr<IDBKey> bound, bool open)
+{
+ return IDBKeyRange::create(bound, IDBKey::create(), open ? IDBKeyRange::LEFT_OPEN : IDBKeyRange::LEFT_BOUND);
+}
+
+PassRefPtr<IDBKeyRange> IDBKeyRange::rightBound(PassRefPtr<IDBKey> bound, bool open)
+{
+ return IDBKeyRange::create(IDBKey::create(), bound, open ? IDBKeyRange::RIGHT_OPEN : IDBKeyRange::RIGHT_BOUND);
+}
+
+PassRefPtr<IDBKeyRange> IDBKeyRange::bound(PassRefPtr<IDBKey> left, PassRefPtr<IDBKey> right, bool openLeft, bool openRight)
+{
+ unsigned short flags = openLeft ? IDBKeyRange::LEFT_OPEN : IDBKeyRange::LEFT_BOUND;
+ flags |= openRight ? IDBKeyRange::RIGHT_OPEN : IDBKeyRange::RIGHT_BOUND;
+ return IDBKeyRange::create(left, right, flags);
+}
+
} // namespace WebCore
#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebCore/storage/IDBKeyRange.h b/WebCore/storage/IDBKeyRange.h
index 52239e4..9ce07af 100644
--- a/WebCore/storage/IDBKeyRange.h
+++ b/WebCore/storage/IDBKeyRange.h
@@ -28,8 +28,7 @@
#if ENABLE(INDEXED_DATABASE)
-#include "IDBAny.h"
-#include "SerializedScriptValue.h"
+#include "IDBKey.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -46,22 +45,26 @@ public:
RIGHT_BOUND = 8,
};
- static PassRefPtr<IDBKeyRange> create(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, unsigned short flags)
+ static PassRefPtr<IDBKeyRange> create(PassRefPtr<IDBKey> left, PassRefPtr<IDBKey> right, unsigned short flags)
{
return adoptRef(new IDBKeyRange(left, right, flags));
}
~IDBKeyRange() { }
- PassRefPtr<IDBAny> left() const { return IDBAny::create(m_left.get()); }
- PassRefPtr<IDBAny> right() const { return IDBAny::create(m_right.get()); }
+ PassRefPtr<IDBKey> left() const { return m_left; }
+ PassRefPtr<IDBKey> right() const { return m_right; }
unsigned short flags() const { return m_flags; }
+ static PassRefPtr<IDBKeyRange> only(PassRefPtr<IDBKey> value);
+ static PassRefPtr<IDBKeyRange> leftBound(PassRefPtr<IDBKey> bound, bool open = false);
+ static PassRefPtr<IDBKeyRange> rightBound(PassRefPtr<IDBKey> bound, bool open = false);
+ static PassRefPtr<IDBKeyRange> bound(PassRefPtr<IDBKey> left, PassRefPtr<IDBKey> right, bool openLeft = false, bool openRight = false);
private:
- IDBKeyRange(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, unsigned short flags);
+ IDBKeyRange(PassRefPtr<IDBKey> left, PassRefPtr<IDBKey> right, unsigned short flags);
- RefPtr<SerializedScriptValue> m_left;
- RefPtr<SerializedScriptValue> m_right;
+ RefPtr<IDBKey> m_left;
+ RefPtr<IDBKey> m_right;
unsigned short m_flags;
};
diff --git a/WebCore/storage/IDBKeyRange.idl b/WebCore/storage/IDBKeyRange.idl
index 05f6505..6daaec1 100644
--- a/WebCore/storage/IDBKeyRange.idl
+++ b/WebCore/storage/IDBKeyRange.idl
@@ -35,9 +35,14 @@ module storage {
const unsigned short LEFT_BOUND = 4;
const unsigned short RIGHT_BOUND = 8;
- readonly attribute IDBAny left;
- readonly attribute IDBAny right;
+ readonly attribute IDBKey left;
+ readonly attribute IDBKey right;
readonly attribute unsigned short flags;
+
+ IDBKeyRange only(in IDBKey value);
+ IDBKeyRange leftBound(in IDBKey bound, in [Optional] boolean open);
+ IDBKeyRange rightBound(in IDBKey bound, in [Optional] boolean open);
+ IDBKeyRange bound(in IDBKey left, in IDBKey right, in [Optional] boolean openLeft, in [Optional] boolean openRight);
};
}
diff --git a/WebCore/storage/IndexedDatabaseRequest.cpp b/WebCore/storage/IndexedDatabaseRequest.cpp
index 45ae1bd..c1c5515 100644
--- a/WebCore/storage/IndexedDatabaseRequest.cpp
+++ b/WebCore/storage/IndexedDatabaseRequest.cpp
@@ -68,29 +68,6 @@ PassRefPtr<IDBRequest> IndexedDatabaseRequest::open(ScriptExecutionContext* cont
return request;
}
-PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeSingleKeyRange(PassRefPtr<SerializedScriptValue> prpValue)
-{
- RefPtr<SerializedScriptValue> value = prpValue;
- return IDBKeyRange::create(value, value, IDBKeyRange::SINGLE);
-}
-
-PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeLeftBoundKeyRange(PassRefPtr<SerializedScriptValue> bound, bool open)
-{
- return IDBKeyRange::create(bound, SerializedScriptValue::create(), open ? IDBKeyRange::LEFT_OPEN : IDBKeyRange::LEFT_BOUND);
-}
-
-PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeRightBoundKeyRange(PassRefPtr<SerializedScriptValue> bound, bool open)
-{
- return IDBKeyRange::create(SerializedScriptValue::create(), bound, open ? IDBKeyRange::RIGHT_OPEN : IDBKeyRange::RIGHT_BOUND);
-}
-
-PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeBoundKeyRange(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, bool openLeft, bool openRight)
-{
- unsigned short flags = openLeft ? IDBKeyRange::LEFT_OPEN : IDBKeyRange::LEFT_BOUND;
- flags |= openRight ? IDBKeyRange::RIGHT_OPEN : IDBKeyRange::RIGHT_BOUND;
- return IDBKeyRange::create(left, right, flags);
-}
-
} // namespace WebCore
#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebCore/storage/IndexedDatabaseRequest.h b/WebCore/storage/IndexedDatabaseRequest.h
index f505d9d..57f8a78 100644
--- a/WebCore/storage/IndexedDatabaseRequest.h
+++ b/WebCore/storage/IndexedDatabaseRequest.h
@@ -39,12 +39,11 @@
namespace WebCore {
-class IDBAny;
+class IDBKey;
class IDBKeyRange;
class IDBRequest;
class IndexedDatabase;
class ScriptExecutionContext;
-class SerializedScriptValue;
class IndexedDatabaseRequest : public RefCounted<IndexedDatabaseRequest> {
public:
@@ -55,10 +54,6 @@ public:
~IndexedDatabaseRequest();
PassRefPtr<IDBRequest> open(ScriptExecutionContext*, const String& name, const String& description);
- PassRefPtr<IDBKeyRange> makeSingleKeyRange(PassRefPtr<SerializedScriptValue> value);
- PassRefPtr<IDBKeyRange> makeLeftBoundKeyRange(PassRefPtr<SerializedScriptValue> bound, bool open = false);
- PassRefPtr<IDBKeyRange> makeRightBoundKeyRange(PassRefPtr<SerializedScriptValue> bound, bool open = false);
- PassRefPtr<IDBKeyRange> makeBoundKeyRange(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, bool openLeft = false, bool openRight = false);
private:
IndexedDatabaseRequest(IndexedDatabase*);
diff --git a/WebCore/storage/IndexedDatabaseRequest.idl b/WebCore/storage/IndexedDatabaseRequest.idl
index 502e804..e6ee446 100644
--- a/WebCore/storage/IndexedDatabaseRequest.idl
+++ b/WebCore/storage/IndexedDatabaseRequest.idl
@@ -29,10 +29,6 @@ module storage {
Conditional=INDEXED_DATABASE
] IndexedDatabaseRequest {
[CallWith=ScriptExecutionContext] IDBRequest open(in DOMString name, in DOMString description);
- IDBKeyRange makeSingleKeyRange(in SerializedScriptValue value);
- IDBKeyRange makeLeftBoundKeyRange(in SerializedScriptValue bound, in [Optional] boolean open);
- IDBKeyRange makeRightBoundKeyRange(in SerializedScriptValue bound, in [Optional] boolean open);
- IDBKeyRange makeBoundKeyRange(in SerializedScriptValue left, in SerializedScriptValue right, in [Optional] boolean openLeft, in [Optional] boolean openRight);
};
}
diff --git a/WebCore/storage/SQLTransaction.cpp b/WebCore/storage/SQLTransaction.cpp
index decdf24..e43d844 100644
--- a/WebCore/storage/SQLTransaction.cpp
+++ b/WebCore/storage/SQLTransaction.cpp
@@ -292,8 +292,7 @@ void SQLTransaction::deliverTransactionCallback()
m_executeSqlAllowed = true;
shouldDeliverErrorCallback = !m_callback->handleEvent(m_database->scriptExecutionContext(), this);
m_executeSqlAllowed = false;
- } else
- shouldDeliverErrorCallback = true;
+ }
// Transaction Step 5 - If the transaction callback was null or raised an exception, jump to the error callback
if (shouldDeliverErrorCallback) {
diff --git a/WebCore/storage/SQLTransactionSync.cpp b/WebCore/storage/SQLTransactionSync.cpp
index af98f8f..883721c 100644
--- a/WebCore/storage/SQLTransactionSync.cpp
+++ b/WebCore/storage/SQLTransactionSync.cpp
@@ -150,7 +150,7 @@ ExceptionCode SQLTransactionSync::begin()
ExceptionCode SQLTransactionSync::execute()
{
ASSERT(m_database->scriptExecutionContext()->isContextThread());
- if (!m_database->opened() || !m_callback || !m_callback->handleEvent(m_database->scriptExecutionContext(), this)) {
+ if (!m_database->opened() || (m_callback && !m_callback->handleEvent(m_database->scriptExecutionContext(), this))) {
m_callback = 0;
return SQLException::UNKNOWN_ERR;
}
diff --git a/WebCore/storage/chromium/DatabaseObserver.h b/WebCore/storage/chromium/DatabaseObserver.h
index e2e5184..96b5972 100644
--- a/WebCore/storage/chromium/DatabaseObserver.h
+++ b/WebCore/storage/chromium/DatabaseObserver.h
@@ -31,6 +31,8 @@
#ifndef DatabaseObserver_h
#define DatabaseObserver_h
+#if ENABLE(DATABASE)
+
namespace WebCore {
class AbstractDatabase;
@@ -49,4 +51,6 @@ public:
}
+#endif // ENABLE(DATABASE)
+
#endif // DatabaseObserver_h
diff --git a/WebCore/storage/chromium/DatabaseTrackerChromium.cpp b/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
index 7d9c4de..aad4ed9 100644
--- a/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
+++ b/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
@@ -31,6 +31,8 @@
#include "config.h"
#include "DatabaseTracker.h"
+#if ENABLE(DATABASE)
+
#include "AbstractDatabase.h"
#include "DatabaseObserver.h"
#include "QuotaTracker.h"
@@ -173,3 +175,5 @@ unsigned long long DatabaseTracker::getMaxSizeForDatabase(const AbstractDatabase
}
}
+
+#endif // ENABLE(DATABASE)
diff --git a/WebCore/storage/chromium/QuotaTracker.cpp b/WebCore/storage/chromium/QuotaTracker.cpp
index 9e64942..3f48682 100644
--- a/WebCore/storage/chromium/QuotaTracker.cpp
+++ b/WebCore/storage/chromium/QuotaTracker.cpp
@@ -31,8 +31,9 @@
#include "config.h"
#include "QuotaTracker.h"
+#if ENABLE(DATABASE)
+
#include <wtf/StdLibExtras.h>
-#include <wtf/text/CString.h>
namespace WebCore {
@@ -67,3 +68,5 @@ void QuotaTracker::updateDatabaseSizeAndSpaceAvailableToOrigin(
}
}
+
+#endif // ENABLE(DATABASE)
diff --git a/WebCore/storage/chromium/QuotaTracker.h b/WebCore/storage/chromium/QuotaTracker.h
index 41c27fe..b913563 100644
--- a/WebCore/storage/chromium/QuotaTracker.h
+++ b/WebCore/storage/chromium/QuotaTracker.h
@@ -31,10 +31,12 @@
#ifndef QuotaTracker_h
#define QuotaTracker_h
+#if ENABLE(DATABASE)
+
+#include "PlatformString.h"
#include "SecurityOrigin.h"
#include "StringHash.h"
#include <wtf/HashMap.h>
-#include <wtf/text/CString.h>
namespace WebCore {
@@ -60,4 +62,6 @@ private:
}
+#endif // ENABLE(DATABASE)
+
#endif // QuotaTracker_h
diff --git a/WebCore/storage/chromium/SQLTransactionClientChromium.cpp b/WebCore/storage/chromium/SQLTransactionClientChromium.cpp
index 22d95e6..6a10821 100644
--- a/WebCore/storage/chromium/SQLTransactionClientChromium.cpp
+++ b/WebCore/storage/chromium/SQLTransactionClientChromium.cpp
@@ -31,6 +31,8 @@
#include "config.h"
#include "SQLTransactionClient.h"
+#if ENABLE(DATABASE)
+
#include "AbstractDatabase.h"
#include "DatabaseObserver.h"
#include "ScriptExecutionContext.h"
@@ -83,3 +85,5 @@ bool SQLTransactionClient::didExceedQuota(AbstractDatabase* database)
}
}
+
+#endif // ENABLE(DATABASE)
diff --git a/WebCore/svg/SVGDocumentExtensions.cpp b/WebCore/svg/SVGDocumentExtensions.cpp
index bc4d6e8..325bcc7 100644
--- a/WebCore/svg/SVGDocumentExtensions.cpp
+++ b/WebCore/svg/SVGDocumentExtensions.cpp
@@ -34,16 +34,17 @@
#include "Frame.h"
#include "FrameLoader.h"
#include "Page.h"
+#include "SMILTimeContainer.h"
#include "SVGSMILElement.h"
#include "SVGSVGElement.h"
-#include "SMILTimeContainer.h"
-#include "ScriptableDocumentParser.h"
#include "ScriptController.h"
+#include "ScriptableDocumentParser.h"
namespace WebCore {
SVGDocumentExtensions::SVGDocumentExtensions(Document* doc)
: m_doc(doc)
+ , m_resourcesCache(new SVGResourcesCache)
{
}
diff --git a/WebCore/svg/SVGDocumentExtensions.h b/WebCore/svg/SVGDocumentExtensions.h
index d31536c..bfe48d1 100644
--- a/WebCore/svg/SVGDocumentExtensions.h
+++ b/WebCore/svg/SVGDocumentExtensions.h
@@ -25,6 +25,7 @@
#if ENABLE(SVG)
#include "AtomicStringHash.h"
+#include "SVGResourcesCache.h"
#include "StringImpl.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
@@ -59,11 +60,14 @@ public:
void reportWarning(const String&);
void reportError(const String&);
+ SVGResourcesCache* resourcesCache() const { return m_resourcesCache.get(); }
+
private:
Document* m_doc; // weak reference
HashSet<SVGSVGElement*> m_timeContainers; // For SVG 1.2 support this will need to be made more general.
HashMap<AtomicString, RenderSVGResourceContainer*> m_resources;
HashMap<AtomicString, HashSet<SVGStyledElement*>*> m_pendingResources;
+ OwnPtr<SVGResourcesCache> m_resourcesCache;
SVGDocumentExtensions(const SVGDocumentExtensions&);
SVGDocumentExtensions& operator=(const SVGDocumentExtensions&);
diff --git a/WebCore/svg/SVGFEDiffuseLightingElement.cpp b/WebCore/svg/SVGFEDiffuseLightingElement.cpp
index fdb3b52..1bb274d 100644
--- a/WebCore/svg/SVGFEDiffuseLightingElement.cpp
+++ b/WebCore/svg/SVGFEDiffuseLightingElement.cpp
@@ -66,6 +66,18 @@ void SVGFEDiffuseLightingElement::parseMappedAttribute(Attribute* attr)
SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
}
+void SVGFEDiffuseLightingElement::svgAttributeChanged(const QualifiedName& attrName)
+{
+ SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
+
+ if (attrName == SVGNames::inAttr
+ || attrName == SVGNames::surfaceScaleAttr
+ || attrName == SVGNames::diffuseConstantAttr
+ || attrName == SVGNames::kernelUnitLengthAttr
+ || attrName == SVGNames::lighting_colorAttr)
+ invalidateFilter();
+}
+
void SVGFEDiffuseLightingElement::synchronizeProperty(const QualifiedName& attrName)
{
SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
diff --git a/WebCore/svg/SVGFEDiffuseLightingElement.h b/WebCore/svg/SVGFEDiffuseLightingElement.h
index 5815cfe..ec9002e 100644
--- a/WebCore/svg/SVGFEDiffuseLightingElement.h
+++ b/WebCore/svg/SVGFEDiffuseLightingElement.h
@@ -40,6 +40,7 @@ public:
virtual ~SVGFEDiffuseLightingElement();
virtual void parseMappedAttribute(Attribute*);
+ virtual void svgAttributeChanged(const QualifiedName&);
virtual void synchronizeProperty(const QualifiedName&);
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
diff --git a/WebCore/svg/SVGFEOffsetElement.cpp b/WebCore/svg/SVGFEOffsetElement.cpp
index db96fce..ce26599 100644
--- a/WebCore/svg/SVGFEOffsetElement.cpp
+++ b/WebCore/svg/SVGFEOffsetElement.cpp
@@ -49,6 +49,16 @@ void SVGFEOffsetElement::parseMappedAttribute(Attribute* attr)
SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
}
+void SVGFEOffsetElement::svgAttributeChanged(const QualifiedName& attrName)
+{
+ SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
+
+ if (attrName == SVGNames::inAttr
+ || attrName == SVGNames::dxAttr
+ || attrName == SVGNames::dyAttr)
+ invalidateFilter();
+}
+
void SVGFEOffsetElement::synchronizeProperty(const QualifiedName& attrName)
{
SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
diff --git a/WebCore/svg/SVGFEOffsetElement.h b/WebCore/svg/SVGFEOffsetElement.h
index 4fbb698..6bf0d43 100644
--- a/WebCore/svg/SVGFEOffsetElement.h
+++ b/WebCore/svg/SVGFEOffsetElement.h
@@ -33,6 +33,7 @@ public:
virtual ~SVGFEOffsetElement();
virtual void parseMappedAttribute(Attribute*);
+ virtual void svgAttributeChanged(const QualifiedName&);
virtual void synchronizeProperty(const QualifiedName&);
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
diff --git a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp
index 9b6b747..8e284e6 100644
--- a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp
+++ b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp
@@ -65,6 +65,18 @@ void SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(Attribute* attr)
return SVGStyledElement::parseMappedAttribute(attr);
}
+void SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(const QualifiedName& attrName)
+{
+ SVGStyledElement::svgAttributeChanged(attrName);
+
+ if (attrName == SVGNames::xAttr
+ || attrName == SVGNames::yAttr
+ || attrName == SVGNames::widthAttr
+ || attrName == SVGNames::heightAttr
+ || attrName == SVGNames::resultAttr)
+ invalidateFilter();
+}
+
void SVGFilterPrimitiveStandardAttributes::synchronizeProperty(const QualifiedName& attrName)
{
SVGStyledElement::synchronizeProperty(attrName);
@@ -90,6 +102,14 @@ void SVGFilterPrimitiveStandardAttributes::synchronizeProperty(const QualifiedNa
synchronizeResult();
}
+void SVGFilterPrimitiveStandardAttributes::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
+{
+ SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
+
+ if (!changedByParser)
+ invalidateResourceClients();
+}
+
void SVGFilterPrimitiveStandardAttributes::setStandardAttributes(bool primitiveBoundingBoxMode, FilterEffect* filterEffect) const
{
ASSERT(filterEffect);
diff --git a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
index 6d1adad..14784a5 100644
--- a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
+++ b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
@@ -24,6 +24,7 @@
#if ENABLE(SVG) && ENABLE(FILTERS)
#include "FilterEffect.h"
#include "SVGFilterBuilder.h"
+#include "SVGFilterElement.h"
#include "SVGNames.h"
#include "SVGStyledElement.h"
@@ -40,13 +41,23 @@ public:
virtual bool isFilterEffect() const { return true; }
virtual void parseMappedAttribute(Attribute*);
+ virtual void svgAttributeChanged(const QualifiedName&);
virtual void synchronizeProperty(const QualifiedName&);
+ virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*) = 0;
virtual bool rendererIsNeeded(RenderStyle*) { return false; }
void setStandardAttributes(bool, FilterEffect*) const;
+protected:
+ void invalidateFilter()
+ {
+ if (!inDocument() || !parentNode()->hasTagName(SVGNames::filterTag))
+ return;
+ static_cast<SVGFilterElement*>(parentNode())->invalidateResourceClients();
+ }
+
private:
DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::xAttr, SVGLength, X, x)
DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::yAttr, SVGLength, Y, y)
diff --git a/WebCore/svg/SVGForeignObjectElement.cpp b/WebCore/svg/SVGForeignObjectElement.cpp
index 7ffe1c6..2157c5e 100644
--- a/WebCore/svg/SVGForeignObjectElement.cpp
+++ b/WebCore/svg/SVGForeignObjectElement.cpp
@@ -126,8 +126,6 @@ void SVGForeignObjectElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeHeight();
else if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
synchronizeExternalResourcesRequired();
- else if (SVGURIReference::isKnownAttribute(attrName))
- synchronizeHref();
}
RenderObject* SVGForeignObjectElement::createRenderer(RenderArena* arena, RenderStyle*)
diff --git a/WebCore/svg/SVGForeignObjectElement.h b/WebCore/svg/SVGForeignObjectElement.h
index 86edc08..737addb 100644
--- a/WebCore/svg/SVGForeignObjectElement.h
+++ b/WebCore/svg/SVGForeignObjectElement.h
@@ -33,8 +33,7 @@ namespace WebCore {
class SVGForeignObjectElement : public SVGStyledTransformableElement,
public SVGTests,
public SVGLangSpace,
- public SVGExternalResourcesRequired,
- public SVGURIReference {
+ public SVGExternalResourcesRequired {
public:
SVGForeignObjectElement(const QualifiedName&, Document*);
virtual ~SVGForeignObjectElement();
diff --git a/WebCore/svg/SVGMaskElement.cpp b/WebCore/svg/SVGMaskElement.cpp
index 1376480..5013e5c 100644
--- a/WebCore/svg/SVGMaskElement.cpp
+++ b/WebCore/svg/SVGMaskElement.cpp
@@ -40,7 +40,6 @@ namespace WebCore {
SVGMaskElement::SVGMaskElement(const QualifiedName& tagName, Document* doc)
: SVGStyledLocatableElement(tagName, doc)
- , SVGURIReference()
, SVGTests()
, SVGLangSpace()
, SVGExternalResourcesRequired()
@@ -80,8 +79,6 @@ void SVGMaskElement::parseMappedAttribute(Attribute* attr)
else if (attr->name() == SVGNames::heightAttr)
setHeightBaseValue(SVGLength(LengthModeHeight, attr->value()));
else {
- if (SVGURIReference::parseMappedAttribute(attr))
- return;
if (SVGTests::parseMappedAttribute(attr))
return;
if (SVGLangSpace::parseMappedAttribute(attr))
@@ -108,7 +105,6 @@ void SVGMaskElement::svgAttributeChanged(const QualifiedName& attrName)
if (invalidateClients
|| attrName == SVGNames::maskUnitsAttr
|| attrName == SVGNames::maskContentUnitsAttr
- || SVGURIReference::isKnownAttribute(attrName)
|| SVGTests::isKnownAttribute(attrName)
|| SVGLangSpace::isKnownAttribute(attrName)
|| SVGExternalResourcesRequired::isKnownAttribute(attrName)
@@ -126,7 +122,6 @@ void SVGMaskElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeX();
synchronizeY();
synchronizeExternalResourcesRequired();
- synchronizeHref();
return;
}
@@ -140,8 +135,6 @@ void SVGMaskElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeY();
else if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
synchronizeExternalResourcesRequired();
- else if (SVGURIReference::isKnownAttribute(attrName))
- synchronizeHref();
}
void SVGMaskElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
diff --git a/WebCore/svg/SVGMaskElement.h b/WebCore/svg/SVGMaskElement.h
index 467128d..e941667 100644
--- a/WebCore/svg/SVGMaskElement.h
+++ b/WebCore/svg/SVGMaskElement.h
@@ -26,20 +26,19 @@
#include "SVGLangSpace.h"
#include "SVGStyledLocatableElement.h"
#include "SVGTests.h"
-#include "SVGURIReference.h"
namespace WebCore {
class SVGLength;
class SVGMaskElement : public SVGStyledLocatableElement,
- public SVGURIReference,
public SVGTests,
public SVGLangSpace,
public SVGExternalResourcesRequired {
public:
SVGMaskElement(const QualifiedName&, Document*);
virtual ~SVGMaskElement();
+
virtual bool isValid() const { return SVGTests::isValid(); }
FloatRect maskBoundingBox(const FloatRect&) const;
@@ -60,9 +59,6 @@ namespace WebCore {
DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::widthAttr, SVGLength, Width, width)
DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::heightAttr, SVGLength, Height, height)
- // SVGURIReference
- DECLARE_ANIMATED_PROPERTY(SVGMaskElement, XLinkNames::hrefAttr, String, Href, href)
-
// SVGExternalResourcesRequired
DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
diff --git a/WebCore/svg/graphics/SVGImage.cpp b/WebCore/svg/graphics/SVGImage.cpp
index ebd7703..fead316 100644
--- a/WebCore/svg/graphics/SVGImage.cpp
+++ b/WebCore/svg/graphics/SVGImage.cpp
@@ -237,25 +237,27 @@ bool SVGImage::dataChanged(bool allDataReceived)
if (allDataReceived) {
static FrameLoaderClient* dummyFrameLoaderClient = new EmptyFrameLoaderClient;
- static EditorClient* dummyEditorClient = new EmptyEditorClient;
+
+ Page::PageClients pageClients;
+ m_chromeClient.set(new SVGImageChromeClient(this));
+ pageClients.chromeClient = m_chromeClient.get();
#if ENABLE(CONTEXT_MENUS)
static ContextMenuClient* dummyContextMenuClient = new EmptyContextMenuClient;
-#else
- static ContextMenuClient* dummyContextMenuClient = 0;
+ pageClients.contextMenuClient = dummyContextMenuClient;
#endif
+ static EditorClient* dummyEditorClient = new EmptyEditorClient;
+ pageClients.editorClient = dummyEditorClient;
#if ENABLE(DRAG_SUPPORT)
static DragClient* dummyDragClient = new EmptyDragClient;
-#else
- static DragClient* dummyDragClient = 0;
+ pageClients.dragClient = dummyDragClient;
#endif
static InspectorClient* dummyInspectorClient = new EmptyInspectorClient;
-
- m_chromeClient.set(new SVGImageChromeClient(this));
+ pageClients.inspectorClient = dummyInspectorClient;
// FIXME: If this SVG ends up loading itself, we might leak the world.
// The comment said that the Cache code does not know about CachedImages
// holding Frames and won't know to break the cycle. But
- m_page.set(new Page(m_chromeClient.get(), dummyContextMenuClient, dummyEditorClient, dummyDragClient, dummyInspectorClient, 0, 0, 0, 0));
+ m_page.set(new Page(pageClients));
m_page->settings()->setMediaEnabled(false);
m_page->settings()->setJavaScriptEnabled(false);
m_page->settings()->setPluginsEnabled(false);
diff --git a/WebCore/wml/WMLGoElement.cpp b/WebCore/wml/WMLGoElement.cpp
index db4880c..9b329d7 100644
--- a/WebCore/wml/WMLGoElement.cpp
+++ b/WebCore/wml/WMLGoElement.cpp
@@ -25,6 +25,7 @@
#include "Attribute.h"
#include "FormData.h"
+#include "FormSubmission.h"
#include "Frame.h"
#include "FrameLoader.h"
#include "HTMLNames.h"
@@ -64,11 +65,11 @@ void WMLGoElement::deregisterPostfieldElement(WMLPostfieldElement* postfield)
void WMLGoElement::parseMappedAttribute(Attribute* attr)
{
if (attr->name() == HTMLNames::methodAttr)
- m_formDataBuilder.parseMethodType(attr->value());
+ m_formAttributes.parseMethodType(attr->value());
else if (attr->name() == HTMLNames::enctypeAttr)
- m_formDataBuilder.parseEncodingType(parseValueSubstitutingVariableReferences(attr->value()));
+ m_formAttributes.parseEncodingType(parseValueSubstitutingVariableReferences(attr->value()));
else if (attr->name() == HTMLNames::accept_charsetAttr)
- m_formDataBuilder.setAcceptCharset(parseValueForbiddingVariableReferences(attr->value()));
+ m_formAttributes.setAcceptCharset(parseValueForbiddingVariableReferences(attr->value()));
else
WMLTaskElement::parseMappedAttribute(attr);
}
@@ -126,7 +127,7 @@ void WMLGoElement::executeTask()
String cacheControl = getAttribute(cache_controlAttr);
- if (m_formDataBuilder.isPostMethod())
+ if (m_formAttributes.method() == FormSubmission::PostMethod)
preparePOSTRequest(request, inSameDeck, cacheControl);
else
prepareGETRequest(request, url);
@@ -153,14 +154,14 @@ void WMLGoElement::preparePOSTRequest(ResourceRequest& request, bool inSameDeck,
RefPtr<FormData> data;
- if (m_formDataBuilder.isMultiPartForm()) { // multipart/form-data
- Vector<char> boundary = m_formDataBuilder.generateUniqueBoundaryString();
+ if (m_formAttributes.isMultiPartForm()) { // multipart/form-data
+ Vector<char> boundary = FormDataBuilder::generateUniqueBoundaryString();
data = createFormData(boundary.data());
- request.setHTTPContentType(m_formDataBuilder.encodingType() + "; boundary=" + boundary.data());
+ request.setHTTPContentType(m_formAttributes.encodingType() + "; boundary=" + boundary.data());
} else {
// text/plain or application/x-www-form-urlencoded
data = createFormData(CString());
- request.setHTTPContentType(m_formDataBuilder.encodingType());
+ request.setHTTPContentType(m_formAttributes.encodingType());
}
request.setHTTPBody(data.get());
@@ -171,7 +172,7 @@ void WMLGoElement::prepareGETRequest(ResourceRequest& request, const KURL& url)
request.setHTTPMethod("GET");
// Eventually display error message?
- if (m_formDataBuilder.isMultiPartForm())
+ if (m_formAttributes.isMultiPartForm())
return;
RefPtr<FormData> data = createFormData(CString());
@@ -187,7 +188,7 @@ PassRefPtr<FormData> WMLGoElement::createFormData(const CString& boundary)
CString value;
Vector<char> encodedData;
- TextEncoding encoding = m_formDataBuilder.dataEncoding(document()).encodingForFormSubmission();
+ TextEncoding encoding = FormDataBuilder::encodingFromAcceptCharset(m_formAttributes.acceptCharset(), document()).encodingForFormSubmission();
Vector<WMLPostfieldElement*>::iterator it = m_postfieldElements.begin();
Vector<WMLPostfieldElement*>::iterator end = m_postfieldElements.end();
@@ -196,10 +197,10 @@ PassRefPtr<FormData> WMLGoElement::createFormData(const CString& boundary)
for (; it != end; ++it) {
(*it)->encodeData(encoding, key, value);
- if (m_formDataBuilder.isMultiPartForm()) {
+ if (m_formAttributes.isMultiPartForm()) {
Vector<char> header;
- m_formDataBuilder.beginMultiPartHeader(header, boundary, key);
- m_formDataBuilder.finishMultiPartHeader(header);
+ FormDataBuilder::beginMultiPartHeader(header, boundary, key);
+ FormDataBuilder::finishMultiPartHeader(header);
result->appendData(header.data(), header.size());
if (size_t dataSize = value.length())
@@ -207,11 +208,11 @@ PassRefPtr<FormData> WMLGoElement::createFormData(const CString& boundary)
result->appendData("\r\n", 2);
} else
- m_formDataBuilder.addKeyValuePairAsFormData(encodedData, key, value);
+ FormDataBuilder::addKeyValuePairAsFormData(encodedData, key, value);
}
- if (m_formDataBuilder.isMultiPartForm())
- m_formDataBuilder.addBoundaryToMultiPartHeader(encodedData, boundary, true);
+ if (m_formAttributes.isMultiPartForm())
+ FormDataBuilder::addBoundaryToMultiPartHeader(encodedData, boundary, true);
result->appendData(encodedData.data(), encodedData.size());
return result;
diff --git a/WebCore/wml/WMLGoElement.h b/WebCore/wml/WMLGoElement.h
index f602a39..d7f8991 100644
--- a/WebCore/wml/WMLGoElement.h
+++ b/WebCore/wml/WMLGoElement.h
@@ -22,7 +22,7 @@
#define WMLGoElement_h
#if ENABLE(WML)
-#include "FormDataBuilder.h"
+#include "FormSubmission.h"
#include "WMLTaskElement.h"
namespace WebCore {
@@ -48,7 +48,7 @@ private:
PassRefPtr<FormData> createFormData(const CString& boundary);
Vector<WMLPostfieldElement*> m_postfieldElements;
- FormDataBuilder m_formDataBuilder;
+ FormSubmission::Attributes m_formAttributes;
};
}
diff --git a/WebCore/wml/WMLInputElement.h b/WebCore/wml/WMLInputElement.h
index b8748fd..fe1ae89 100644
--- a/WebCore/wml/WMLInputElement.h
+++ b/WebCore/wml/WMLInputElement.h
@@ -96,6 +96,7 @@ private:
friend class WMLCardElement;
void initialize();
+ virtual bool supportsMaxLength() const { return true; }
String validateInputMask(const String&);
unsigned cursorPositionToMaskIndex(unsigned);
String constrainValue(const String&) const;
diff --git a/WebCore/wscript b/WebCore/wscript
index f923e87..bd058e4 100644
--- a/WebCore/wscript
+++ b/WebCore/wscript
@@ -30,7 +30,8 @@ from settings import *
webcore_sources = {}
if build_port == "wx":
- webcore_sources['wx'] = ['platform/KillRingNone.cpp']
+ webcore_sources['wx'] = ['platform/KillRingNone.cpp']
+
if building_on_win32:
# make sure platform/wx comes after this so we get the right
# FontPlatformData.h
@@ -125,7 +126,9 @@ def build(bld):
wk_includes = ['.', '..', 'DerivedSources',
wk_root,
os.path.join(wk_root, 'JavaScriptCore'),
+ os.path.join(wk_root, 'JavaScriptCore', 'wtf', 'text'),
os.path.join(wk_root, 'WebCore'),
+ os.path.join(wk_root, 'WebKit/wx'),
'platform/image-decoders',
'platform/win',
'platform/wx/wxcode',
@@ -135,7 +138,7 @@ def build(bld):
features = [build_port]
exclude_patterns = ['*AllInOne.cpp', '*Brew.cpp', '*CFNet.cpp', '*Chromium*.cpp',
'*Gtk.cpp', '*Mac.cpp', '*None.cpp', '*Qt.cpp', '*Safari.cpp',
- 'test*bindings.*', '*Wince.cpp']
+ 'test*bindings.*', '*Wince.cpp', "WebDOMSVG*.cpp"]
if build_port == 'wx':
features.append('curl')
if not building_on_win32:
@@ -172,6 +175,7 @@ def build(bld):
includes = ' '.join(wk_includes),
source = ' '.join(flattenSources(webcore_sources.values())),
cxxflags = cxxflags,
+ defines = ['WXMAKINGDLL_WEBKIT'],
target = 'webcore',
uselib = 'WX ICU XML XSLT CURL SQLITE3 ' + get_config(),
uselib_local = '',
@@ -218,6 +222,15 @@ def build(bld):
excludes.append('JSSVGTransformable.cpp')
excludes.append('JSSVGURIReference.cpp')
+ excludes.append('WebDOMAbstractView.cpp')
+ excludes.append('WebDOMBlobBuilder.cpp')
+ excludes.append('WebDOMEventListenerCustom.cpp')
+ excludes.append('WebDOMElementTimeControl.cpp')
+ excludes.append('WebDOMImageData.cpp')
+ excludes.append('WebDOMScriptProfile.cpp')
+ excludes.append('WebDOMScriptProfileNode.cpp')
+ excludes.append('WebNativeEventListener.cpp')
+
if building_on_win32:
excludes.append('SharedTimerWx.cpp')
excludes.append('RenderThemeWin.cpp')
diff --git a/WebKit/CMakeLists.txt b/WebKit/CMakeLists.txt
index 6e0996c..3ed3e9c 100644
--- a/WebKit/CMakeLists.txt
+++ b/WebKit/CMakeLists.txt
@@ -21,7 +21,6 @@ SET(WebKit_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/platform/graphics/cairo"
"${WEBCORE_DIR}/platform/graphics/transforms"
"${WEBCORE_DIR}/platform/network"
- "${WEBCORE_DIR}/platform/network/soup"
"${WEBCORE_DIR}/platform/sql"
"${WEBCORE_DIR}/platform/text"
"${WEBCORE_DIR}/plugins"
@@ -47,12 +46,21 @@ SET(WebKit_INCLUDE_DIRECTORIES
"${CMAKE_BINARY_DIR}"
)
+IF (WTF_USE_SOUP)
+ LIST(APPEND WebKit_INCLUDE_DIRECTORIES "${WEBCORE_DIR}/platform/network/soup")
+ENDIF ()
+
+IF (WTF_USE_CURL)
+ LIST(APPEND WebKit_INCLUDE_DIRECTORIES "${WEBCORE_DIR}/platform/network/curl")
+ENDIF ()
+
SET(WebKit_LIBRARIES
${JavaScriptCore_LIBRARY_NAME}
${WebCore_LIBRARY_NAME}
)
-INCLUDE_IF_EXISTS(${WEBKIT_DIR}/CMakeLists${PORT}.txt)
+STRING(TOLOWER ${PORT} WEBKIT_PORT_DIR)
+INCLUDE_IF_EXISTS(${WEBKIT_DIR}/${WEBKIT_PORT_DIR}/CMakeLists${PORT}.txt)
ADD_DEFINITIONS(-DBUILDING_WebKit)
INCLUDE_DIRECTORIES(${WebKit_INCLUDE_DIRECTORIES})
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index d4d2431..76b6fb4 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,68 @@
+2010-07-26 Rafael Antognolli <antognolli@profusion.mobi>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Move CMakeListsEfl.txt to WebKit/efl/
+ https://bugs.webkit.org/show_bug.cgi?id=43002
+
+ This should reduce the noise in WebKit/ChangeLog that comes from EFL
+ port. Most of the changes on EFL port should be logged in
+ WebKit/efl/ChangeLog.
+
+ * CMakeLists.txt: Just change the path from where to include the file.
+
+2010-07-23 Rafael Antognolli <antognolli@profusion.mobi>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Cleanup glib support (make it optional)
+ https://bugs.webkit.org/show_bug.cgi?id=42480
+
+ Just add glib flags and directories if necessary.
+
+ * CMakeListsEfl.txt:
+
+2010-07-23 Rafael Antognolli <antognolli@profusion.mobi>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Add support for using libcurl network backend.
+ https://bugs.webkit.org/show_bug.cgi?id=42286
+
+ Just add soup/curl directories and flags for the specific
+ backend being used.
+
+ * CMakeLists.txt:
+ * CMakeListsEfl.txt:
+
+2010-07-22 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Implement input method notification
+ https://bugs.webkit.org/show_bug.cgi?id=42640
+
+ Notify browser when keyboard should be shown/hidden. Input method
+ hints are updated before sending the signal. Client should be able to
+ determine the input type by calling ewk_view_imh_get().
+
+ * efl/EWebLauncher/main.c:
+ (on_inputmethod_changed): example implementation that just prints to
+ stdout if keyboard should be shown or hidden and the imh flags.
+ (browserCreate): listen to signal about input method changing its
+ state.
+ * efl/WebCoreSupport/EditorClientEfl.cpp:
+ (WebCore::EditorClientEfl::setInputMethodState): call new function
+ responsible for implementing this notification.
+ * efl/ewk/ewk_private.h: ewk_view_input_method_state_set() is called
+ only from inside WebKit.
+ * efl/ewk/ewk_view.cpp: implement setters and getters
+ (ewk_view_imh_get):
+ (ewk_view_input_method_state_set):
+ * efl/ewk/ewk_view.h: introduce Ewk_Imh enum which contains the
+ possible input types.
+ (_Ewk_View_Smart_Class::):
+
2010-07-20 Lucas De Marchi <lucas.demarchi@profusion.mobi>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 009dc60..2c720e1 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,561 @@
+2010-07-28 Dominic Mazzoni <dmazzoni@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ Add access to the computed style display to WebAccessibilityObject.
+ https://bugs.webkit.org/show_bug.cgi?id=43044
+
+ * public/WebAccessibilityObject.h:
+ * src/WebAccessibilityObject.cpp:
+ (WebKit::WebAccessibilityObject::hasComputedStyle):
+ (WebKit::WebAccessibilityObject::computedStyleDisplay):
+
+2010-07-28 Hans Wennborg <hans@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Set ENABLE_DEVICE_ORIENTATION=1 in features.gypi for chromium
+ https://bugs.webkit.org/show_bug.cgi?id=43122
+
+ Enable the compile-time switch for device orientation.
+ The switch was already enabled in features_override.gypi in the Chromium
+ repository (in revision 53317), and should be set here as well.
+
+ The feature is being implemented behind a run-time flag which
+ defaults to off in Chromium.
+
+ * features.gypi: Set ENABLE_DEVICE_ORIENTATION=1.
+
+2010-07-28 Gene Gutnik <gene@google.com>
+
+ Reviewed by Darin Fisher.
+
+ Fix mouse coordinate conversion. WindowX,Y is an absolute
+ mouse coordinates within browser window, x,y - are coordinates
+ relative to the plugin.
+ https://bugs.webkit.org/show_bug.cgi?id=42987
+
+ * src/WebInputEventConversion.cpp:
+ (WebKit::WebMouseEventBuilder::WebMouseEventBuilder):
+ (WebKit::WebMouseWheelEventBuilder::WebMouseWheelEventBuilder):
+ * src/WebInputEventConversion.h:
+ * src/WebPluginContainerImpl.cpp:
+ (WebKit::WebPluginContainerImpl::handleMouseEvent):
+ (WebKit::WebPluginContainerImpl::handleWheelEvent):
+
+2010-07-28 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [chromium] Add a bool to Settings to control accelerated 2d canvas
+ https://bugs.webkit.org/show_bug.cgi?id=43094
+
+ * public/WebSettings.h:
+ * src/WebSettingsImpl.cpp:
+ (WebKit::WebSettingsImpl::setAccelerated2dCanvasEnabled):
+ * src/WebSettingsImpl.h:
+
+2010-07-28 Brett Wilson <brettw@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Fix forward declares to be struct instead of class.
+ https://bugs.webkit.org/show_bug.cgi?id=43127
+
+ * public/WebFont.h:
+
+2010-07-28 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Chromium DevTools: [REGRESSION] sourceURL is not respected.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43124
+
+ * src/js/DebuggerScript.js:
+
+2010-07-28 Andrei Popescu <andreip@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ [IndexedDB] WebDOMStringList default ctor does not initialize its m_private member
+ variable so any attempt to append strings to a WebDOMStringList instance results in a crash.
+ https://bugs.webkit.org/show_bug.cgi?id=43120
+
+ Makes the default WebKit::WebDOMStringList ctor actually create its wrapped
+ WebCore::DOMStringList instance.
+
+ * public/WebDOMStringList.h:
+ * src/WebDOMStringList.cpp:
+ (WebKit::WebDOMStringList::WebDOMStringList):
+
+2010-07-26 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Page clients should be passed to Page constructor via structure of pointers
+ https://bugs.webkit.org/show_bug.cgi?id=42834
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+
+2010-07-28 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed: chromium tests fix.
+ Chromium Dev Tools: [REGRESSION] Pause is not working.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43118
+
+ * src/js/DevTools.js:
+ (InspectorBackend.pause):
+
+2010-07-27 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ Add FILE_SYSTEM build flag for FileSystem API
+ https://bugs.webkit.org/show_bug.cgi?id=42915
+
+ * features.gypi:
+
+2010-07-27 James Hawkins <jhawkins@chromium.org>
+
+ Unreviewed Build Fix.
+
+ Add a missing itemIcon() method to TestPopupMenuClient.
+
+ * tests/PopupMenuTest.cpp:
+ (WebKit::TestPopupMenuClient::itemIcon):
+
+2010-07-27 James Hawkins <jhawkins@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] Add the ability to show right-aligned icons in the AutoFill popup.
+ https://bugs.webkit.org/show_bug.cgi?id=43076
+
+ * public/WebView.h:
+ * src/AutoFillPopupMenuClient.cpp:
+ (WebKit::AutoFillPopupMenuClient::getIcon):
+ (WebKit::AutoFillPopupMenuClient::removeSuggestionAtIndex):
+ (WebKit::AutoFillPopupMenuClient::itemIcon):
+ (WebKit::AutoFillPopupMenuClient::initialize):
+ (WebKit::AutoFillPopupMenuClient::setSuggestions):
+ * src/AutoFillPopupMenuClient.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::applyAutoFillSuggestions):
+ (WebKit::WebViewImpl::applyAutocompleteSuggestions):
+ * src/WebViewImpl.h:
+
+2010-07-27 Brett Wilson <brettw@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Add the ability to select fonts and do basic text drawing to the
+ Chromium WebKit API.
+ https://bugs.webkit.org/show_bug.cgi?id=42999
+
+ * WebKit.gyp:
+ * public/WebFloatPoint.h: Added.
+ (WebKit::WebFloatPoint::WebFloatPoint):
+ (WebKit::WebFloatPoint::operator=):
+ (WebKit::WebFloatPoint::operator WebCore::FloatPoint):
+ (WebKit::operator==):
+ (WebKit::operator!=):
+ * public/WebFloatRect.h: Added.
+ (WebKit::WebFloatRect::isEmpty):
+ (WebKit::WebFloatRect::WebFloatRect):
+ (WebKit::WebFloatRect::operator=):
+ (WebKit::WebFloatRect::operator WebCore::FloatRect):
+ (WebKit::operator==):
+ (WebKit::operator!=):
+ * public/WebFont.h: Added.
+ * public/WebFontDescription.h: Added.
+ (WebKit::WebFontDescription::):
+ (WebKit::WebFontDescription::WebFontDescription):
+ * public/WebTextRun.h: Added.
+ (WebKit::WebTextRun::WebTextRun):
+ * src/AssertMatchingEnums.cpp:
+ * src/WebFontDescription.cpp: Added.
+ (WebKit::WebFontDescription::WebFontDescription):
+ (WebKit::WebFontDescription::operator WebCore::FontDescription):
+ * src/WebFontImpl.cpp: Added.
+ (WebKit::WebFont::Create):
+ (WebKit::WebFontImpl::WebFontImpl):
+ (WebKit::WebFontImpl::fontDescription):
+ (WebKit::WebFontImpl::ascent):
+ (WebKit::WebFontImpl::descent):
+ (WebKit::WebFontImpl::height):
+ (WebKit::WebFontImpl::lineSpacing):
+ (WebKit::WebFontImpl::xHeight):
+ (WebKit::WebFontImpl::drawText):
+ (WebKit::WebFontImpl::width):
+ (WebKit::WebFontImpl::offsetForPosition):
+ (WebKit::WebFontImpl::selectionRectForText):
+ * src/WebFontImpl.h: Added.
+ * src/WebTextRun.cpp: Added.
+ (WebKit::WebTextRun::operator WebCore::TextRun):
+
+2010-07-27 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by David Levin.
+
+ Move all WebSQLDatabases-specific code behind #if ENABLE(DATABASE).
+ https://bugs.webkit.org/show_bug.cgi?id=43035
+
+ Make Chromium compile with ENABLE_DATABASE=0.
+
+ * src/ChromiumBridge.cpp:
+ (WebCore::ChromiumBridge::databaseGetFileSize):
+ * src/DatabaseObserver.cpp:
+ * src/WebDatabase.cpp:
+ (WebCore::AbstractDatabase::stringIdentifier):
+ (WebCore::AbstractDatabase::displayName):
+ (WebCore::AbstractDatabase::estimatedSize):
+ (WebCore::AbstractDatabase::securityOrigin):
+ (WebKit::WebDatabase::updateDatabaseSize):
+ (WebKit::WebDatabase::closeDatabaseImmediately):
+
+2010-07-27 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: if breakpoints were deactivated, add new breakpoints as disabled.
+ https://bugs.webkit.org/show_bug.cgi?id=41461
+
+ * src/js/DebuggerScript.js:
+ ():
+
+2010-07-27 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ WebInspector: Current implementation of message based inspector
+ transport generated by CodeGeneratorInspector should be upstreamed
+ from WebKit/chromium to WebCore.
+ https://bugs.webkit.org/show_bug.cgi?id=42983
+
+ * WebKit.gypi:
+ * src/InspectorFrontendClientImpl.cpp:
+ (WebKit::InspectorFrontendClientImpl::sendMessageToBackend):
+ * src/InspectorFrontendClientImpl.h:
+ * src/ToolsAgent.h:
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::WebDevToolsAgentImpl::dispatchOnInspectorController):
+ (WebKit::WebDevToolsAgentImpl::initDevToolsAgentHost):
+ * src/WebDevToolsAgentImpl.h:
+ * src/js/InspectorControllerImpl.js: Removed.
+
+2010-07-27 Dominic Mazzoni <dmazzoni@google.com>
+
+ Reviewed by Chris Fleizach.
+
+ Add accessors for node and document to WebAccessibilityObject,
+ needed to support some Windows screenreader functionality.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43001
+
+ * public/WebAccessibilityObject.h:
+ * src/WebAccessibilityObject.cpp:
+ (WebKit::WebAccessibilityObject::node):
+ (WebKit::WebAccessibilityObject::document):
+
+2010-07-27 Dominic Mazzoni <dmazzoni@google.com>
+
+ Reviewed by Chris Fleizach.
+
+ For Windows accessibility, have WebElement provide access
+ to its attributes.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43004
+
+ * WebKit.gyp:
+ * public/WebAttribute.h: Added.
+ (WebKit::WebAttribute::~WebAttribute):
+ (WebKit::WebAttribute::WebAttribute):
+ (WebKit::WebAttribute::operator=):
+ * public/WebElement.h:
+ * public/WebNamedNodeMap.h: Added.
+ (WebKit::WebNamedNodeMap::~WebNamedNodeMap):
+ (WebKit::WebNamedNodeMap::WebNamedNodeMap):
+ (WebKit::WebNamedNodeMap::operator=):
+ * src/WebAttribute.cpp: Added.
+ (WebKit::WebAttribute::reset):
+ (WebKit::WebAttribute::assign):
+ (WebKit::WebAttribute::WebAttribute):
+ (WebKit::WebAttribute::localName):
+ (WebKit::WebAttribute::value):
+ * src/WebElement.cpp:
+ (WebKit::WebElement::attributes):
+ * src/WebNamedNodeMap.cpp: Added.
+ (WebKit::WebNamedNodeMap::reset):
+ (WebKit::WebNamedNodeMap::assign):
+ (WebKit::WebNamedNodeMap::WebNamedNodeMap):
+ (WebKit::WebNamedNodeMap::length):
+ (WebKit::WebNamedNodeMap::attributeItem):
+
+2010-07-27 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ Simplify speech input plumbing in webcore and webkit
+ https://bugs.webkit.org/show_bug.cgi?id=43008
+
+ * src/SpeechInputClientImpl.cpp: Move functionality to WebCore::SpeechInput and make this a dummy proxy.
+ (WebKit::SpeechInputClientImpl::startRecognition):
+ (WebKit::SpeechInputClientImpl::cancelRecognition):
+ (WebKit::SpeechInputClientImpl::didCompleteRecording):
+ (WebKit::SpeechInputClientImpl::didCompleteRecognition):
+ (WebKit::SpeechInputClientImpl::setRecognitionResult):
+ * src/SpeechInputClientImpl.h:
+
+2010-07-26 Dominic Mazzoni <dmazzoni@google.com>
+
+ Reviewed by Chris Fleizach.
+
+ Add accessor to get the doctype of a WebDocument, needed to
+ implement Windows accessibility.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43003
+
+ * WebKit.gyp:
+ * public/WebDocument.h:
+ * public/WebDocumentType.h: Added.
+ (WebKit::WebDocumentType::WebDocumentType):
+ (WebKit::WebDocumentType::operator=):
+ (WebKit::WebDocumentType::assign):
+ * src/WebDocument.cpp:
+ (WebKit::WebDocument::doctype):
+ * src/WebDocumentType.cpp: Added.
+ (WebKit::WebDocumentType::name):
+ (WebKit::WebDocumentType::WebDocumentType):
+ (WebKit::WebDocumentType::operator=):
+ (WebKit::WebDocumentType::operator PassRefPtr<DocumentType>):
+
+2010-07-26 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Add WebKit plumbing to connect speech requests and callbacks between WebCore and the embedder.
+ https://bugs.webkit.org/show_bug.cgi?id=42367
+
+ No new tests, the relevant LayoutTestController bindings and tests will be added in the next patch.
+
+ * public/WebSpeechInputController.h: Added new interface, implemented by embedder and called by WebKit
+ (WebKit::WebSpeechInputController::~WebSpeechInputController):
+ * public/WebSpeechInputListener.h: Added new interface, implemented by WebKit and called by embedder.
+ (WebKit::WebSpeechInputListener::~WebSpeechInputListener):
+ * public/WebViewClient.h:
+ (WebKit::WebViewClient::createSpeechInputClient): New method to get the embedder's speech input client interface.
+ * src/SpeechInputClientImpl.cpp: Added new class, implementation of a two way connector between WebCore
+ and the embedder for requests and responses.
+ (WebKit::SpeechInputClientImpl::SpeechInputClientImpl):
+ (WebKit::SpeechInputClientImpl::~SpeechInputClientImpl):
+ (WebKit::SpeechInputClientImpl::startRecognition):
+ (WebKit::SpeechInputClientImpl::stopRecording):
+ (WebKit::SpeechInputClientImpl::didCompleteRecording):
+ (WebKit::SpeechInputClientImpl::setRecognitionResult):
+ (WebKit::SpeechInputClientImpl::didCompleteRecognition):
+ * src/SpeechInputClientImpl.h: Added.
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl): Pass on the above mentioned speech input connector to WebCore.
+ * src/WebViewImpl.h:
+
+2010-07-26 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Chromium DevTools: refactor query params, add basic
+ support for WebSocket-based backend.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42893
+
+ * src/js/DevTools.js:
+ (devtools.ToolsAgent.prototype.dispatchOnClient_):
+ (WebInspector.loaded):
+ (WebInspector.doLoadedDone):
+ (devtools.domContentLoaded):
+ * src/js/InspectorControllerImpl.js:
+
+2010-07-24 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed: chromium build fix.
+
+ * src/ApplicationCacheHost.cpp:
+ (WebCore::ApplicationCacheHost::fillResourceList):
+
+2010-07-23 Kavita Kanetkar <kkanetkar@chromium.org>
+
+ Reviewed by Joseph Pecoraro.
+
+ Implement remaining Inspector support for chrome's appcache
+ https://bugs.webkit.org/show_bug.cgi?id=42426
+
+ * src/ApplicationCacheHost.cpp: Plugging in chrome's appcache info.
+ (WebCore::ApplicationCacheHost::applicationCacheInfo):
+ (WebCore::ApplicationCacheHost::fillResourceList):
+ * src/js/InspectorControllerImpl.js:
+ (devtools.InspectorBackendImpl):
+
+2010-07-23 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Reviewed by Yury Semikhatsky.
+
+ Chromium DevTools: migrate from utility context-based injected
+ script dispatch to upstream schema.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42883
+
+ * src/ToolsAgent.h:
+ * src/WebDevToolsAgentImpl.cpp:
+ * src/WebDevToolsAgentImpl.h:
+ * src/js/DevToolsHostStub.js:
+ * src/js/InspectorControllerImpl.js:
+ (devtools.InspectorBackendImpl):
+
+2010-07-23 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed: rolling out r63963.
+
+ * src/ToolsAgent.h:
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::WebDevToolsAgentImpl::dispatchOnInjectedScript):
+ * src/WebDevToolsAgentImpl.h:
+ * src/js/DevToolsHostStub.js:
+ (.window.dispatchOnInjectedScript):
+ * src/js/InspectorControllerImpl.js:
+ (devtools.InspectorBackendImpl):
+ (devtools.InspectorBackendImpl.prototype.dispatchOnInjectedScript):
+
+2010-07-23 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Reviewed by Yury Semikhatsky.
+
+ Chromium DevTools: migrate from utility context-based injected
+ script dispatch to upstream schema.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42883
+
+ * src/ToolsAgent.h:
+ * src/WebDevToolsAgentImpl.cpp:
+ * src/WebDevToolsAgentImpl.h:
+ * src/js/DevToolsHostStub.js:
+ * src/js/InspectorControllerImpl.js:
+ (devtools.InspectorBackendImpl):
+
+2010-07-23 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Roll Chromium revision
+ https://bugs.webkit.org/show_bug.cgi?id=42876
+
+ * DEPS: Roll Chromium revision to r53434 in order to have the
+ logger initialization change (r53303)
+
+2010-07-22 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ WebInspector: CodeGeneratorInspector was extended and now it can
+ generate InspectorBackedDispatcher's code. This dispatcher will
+ validate and dispatch incoming inspector commands only by native
+ code without using javaScript. That is necessary step for
+ RemoteDebugging support.
+ https://bugs.webkit.org/show_bug.cgi?id=42588
+
+ * src/ToolsAgent.h:
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::WebDevToolsAgentImpl::dispatchOnInspectorController):
+ * src/WebDevToolsAgentImpl.h:
+ * src/js/InspectorControllerImpl.js:
+ (devtools.InspectorBackendImpl.prototype.callInspectorController_):
+
+2010-07-22 Darin Fisher <darin@chromium.org>
+
+ Reviewed by David Levin.
+
+ [Chromium] Propagate return value of EventHandler::handleMouseWheelEvent
+ to caller of WebViewImpl::handleInputEvent.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42835
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::mouseWheel):
+ (WebKit::WebViewImpl::handleInputEvent):
+ * src/WebViewImpl.h:
+
+2010-07-22 Darin Fisher <darin@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42808
+ Pass context menu events through WebInputEvent to WebPlugin::handleInputEvent.
+
+ The DOM treats a context menu event as a type of mouse event. We therefore
+ do the same here, and reuse the WebMouseEvent subclass. This makes sense
+ since a context menu event has (x,y)-coordinates.
+
+ * public/WebInputEvent.h:
+ (WebKit::WebInputEvent::):
+ (WebKit::WebInputEvent::isMouseEventType):
+ * src/WebInputEventConversion.cpp:
+ (WebKit::WebMouseEventBuilder::WebMouseEventBuilder):
+
+2010-07-22 Andrey Kosyakov <caseq@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Stop granting universal access to inspector front-end page.
+ https://bugs.webkit.org/show_bug.cgi?id=42817
+
+ * src/WebDevToolsFrontendImpl.cpp:
+ (WebKit::WebDevToolsFrontendImpl::frontendLoaded):
+
+2010-07-22 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Rename method for CSS rule source range retrieval and fix return object format
+ https://bugs.webkit.org/show_bug.cgi?id=42379
+
+ * src/js/InspectorControllerImpl.js:
+ (devtools.InspectorBackendImpl):
+
+2010-07-21 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Chromium Dev Tools: Separators are missing in the context menu.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42761
+
+ * src/ContextMenuClientImpl.cpp:
+ (WebKit::ContextMenuClientImpl::populateCustomMenuItems):
+
+2010-07-21 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Copy the test plugin into DumpRenderTree.app/
+ https://bugs.webkit.org/show_bug.cgi?id=42733
+
+ This was dropped in plugin copy refactoring.
+
+ * WebKit.gyp:
+
+2010-07-21 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ Break out "scheme registration" functionality from SecurityOrigin to a SchemeRegistry
+ https://bugs.webkit.org/show_bug.cgi?id=42783
+
+ * src/WebSecurityPolicy.cpp:
+ (WebKit::WebSecurityPolicy::registerURLSchemeAsLocal):
+ (WebKit::WebSecurityPolicy::registerURLSchemeAsNoAccess):
+ (WebKit::WebSecurityPolicy::registerURLSchemeAsSecure):
+
2010-07-21 Bo Liu <boliu@chromium.org>
Reviewed by Darin Fisher.
diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS
index 24bf389..7c7d7e7 100644
--- a/WebKit/chromium/DEPS
+++ b/WebKit/chromium/DEPS
@@ -32,7 +32,7 @@
vars = {
'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
- 'chromium_rev': '52869',
+ 'chromium_rev': '53434',
}
deps = {
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index 8abc159..97efddc 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -116,6 +116,7 @@
'public/WebAnimationController.h',
'public/WebApplicationCacheHost.h',
'public/WebApplicationCacheHostClient.h',
+ 'public/WebAttribute.h',
'public/WebBindings.h',
'public/WebCache.h',
'public/WebCanvas.h',
@@ -144,6 +145,7 @@
'public/WebDevToolsMessageData.h',
'public/WebDevToolsMessageTransport.h',
'public/WebDocument.h',
+ 'public/WebDocumentType.h',
'public/WebDragData.h',
'public/WebEditingAction.h',
'public/WebElement.h',
@@ -154,6 +156,10 @@
'public/WebFileInfo.h',
'public/WebFileSystem.h',
'public/WebFindOptions.h',
+ 'public/WebFloatPoint.h',
+ 'public/WebFloatRect.h',
+ 'public/WebFont.h',
+ 'public/WebFontDescription.h',
'public/WebFrame.h',
'public/WebFrameClient.h',
'public/WebFontCache.h',
@@ -191,6 +197,7 @@
'public/WebMessagePortChannelClient.h',
'public/WebMimeRegistry.h',
'public/WebMutationEvent.h',
+ 'public/WebNamedNodeMap.h',
'public/WebNavigationType.h',
'public/WebNode.h',
'public/WebNodeCollection.h',
@@ -234,6 +241,8 @@
'public/WebSocketStreamError.h',
'public/WebSocketStreamHandle.h',
'public/WebSocketStreamHandleClient.h',
+ 'public/WebSpeechInputController.h',
+ 'public/WebSpeechInputListener.h',
'public/WebStorageArea.h',
'public/WebStorageEventDispatcher.h',
'public/WebStorageNamespace.h',
@@ -242,6 +251,7 @@
'public/WebTextCaseSensitivity.h',
'public/WebTextDirection.h',
'public/WebTextInputType.h',
+ 'public/WebTextRun.h',
'public/WebThemeEngine.h',
'public/WebURL.h',
'public/WebURLError.h',
@@ -339,6 +349,8 @@
'src/ResourceHandle.cpp',
'src/SharedWorkerRepository.cpp',
'src/SocketStreamHandle.cpp',
+ 'src/SpeechInputClientImpl.cpp',
+ 'src/SpeechInputClientImpl.h',
'src/StorageAreaProxy.cpp',
'src/StorageAreaProxy.h',
'src/StorageEventDispatcherChromium.cpp',
@@ -354,6 +366,7 @@
'src/WebAccessibilityObject.cpp',
'src/WebAnimationControllerImpl.cpp',
'src/WebAnimationControllerImpl.h',
+ 'src/WebAttribute.cpp',
'src/WebBindings.cpp',
'src/WebCache.cpp',
'src/WebColor.cpp',
@@ -371,6 +384,7 @@
'src/WebDevToolsFrontendImpl.cpp',
'src/WebDevToolsFrontendImpl.h',
'src/WebDocument.cpp',
+ 'src/WebDocumentType.cpp',
'src/WebDragData.cpp',
'src/WebElement.cpp',
'src/WebEntities.cpp',
@@ -382,6 +396,9 @@
'src/WebFileChooserCompletionImpl.cpp',
'src/WebFileChooserCompletionImpl.h',
'src/WebFontCache.cpp',
+ 'src/WebFontDescription.cpp',
+ 'src/WebFontImpl.cpp',
+ 'src/WebFontImpl.h',
'src/WebFormControlElement.cpp',
'src/WebFormElement.cpp',
'src/WebFrameImpl.cpp',
@@ -420,6 +437,7 @@
'src/WebMediaPlayerClientImpl.cpp',
'src/WebMediaPlayerClientImpl.h',
'src/WebMutationEvent.cpp',
+ 'src/WebNamedNodeMap.cpp',
'src/WebNode.cpp',
'src/WebNodeCollection.cpp',
'src/WebNodeList.cpp',
@@ -462,6 +480,7 @@
'src/WebStorageNamespaceImpl.cpp',
'src/WebStorageNamespaceImpl.h',
'src/WebString.cpp',
+ 'src/WebTextRun.cpp',
'src/WebURL.cpp',
'src/WebURLLoadTiming.cpp',
'src/WebURLRequest.cpp',
@@ -823,6 +842,11 @@
'../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher900.ttf',
'<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
],
+ # Workaround for http://code.google.com/p/gyp/issues/detail?id=160
+ 'copies': [{
+ 'destination': '<(PRODUCT_DIR)/DumpRenderTree.app/Contents/PlugIns/',
+ 'files': ['<(PRODUCT_DIR)/TestNetscapePlugIn.plugin/'],
+ }],
},{ # OS!="mac"
'sources/': [
# .mm is already excluded by common.gypi
diff --git a/WebKit/chromium/WebKit.gypi b/WebKit/chromium/WebKit.gypi
index 7d7b19c..b45e3e7 100644
--- a/WebKit/chromium/WebKit.gypi
+++ b/WebKit/chromium/WebKit.gypi
@@ -33,7 +33,6 @@
# List of DevTools source files, ordered by dependencies. It is used both
# for copying them to resource dir, and for generating 'devtools.html' file.
'devtools_js_files': [
- 'src/js/InspectorControllerImpl.js',
'src/js/ProfilerAgent.js',
'src/js/ProfilerProcessor.js',
'src/js/HeapProfilerPanel.js',
diff --git a/WebKit/chromium/features.gypi b/WebKit/chromium/features.gypi
index eadce7e..559ebd8 100644
--- a/WebKit/chromium/features.gypi
+++ b/WebKit/chromium/features.gypi
@@ -45,11 +45,13 @@
'ENABLE_DASHBOARD_SUPPORT=0',
'ENABLE_DATABASE=1',
'ENABLE_DATAGRID=0',
+ 'ENABLE_DEVICE_ORIENTATION=1',
'ENABLE_DIRECTORY_UPLOAD=1',
'ENABLE_DOM_STORAGE=1',
'ENABLE_EVENTSOURCE=1',
'ENABLE_FILE_READER=1',
'ENABLE_FILE_WRITER=1',
+ 'ENABLE_FILE_SYSTEM=1',
'ENABLE_FILTERS=1',
'ENABLE_GEOLOCATION=1',
'ENABLE_ICONDATABASE=0',
diff --git a/WebKit/chromium/public/WebAccessibilityObject.h b/WebKit/chromium/public/WebAccessibilityObject.h
index f1b2474..ddb9bda 100644
--- a/WebKit/chromium/public/WebAccessibilityObject.h
+++ b/WebKit/chromium/public/WebAccessibilityObject.h
@@ -42,6 +42,8 @@ namespace WTF { template <typename T> class PassRefPtr; }
namespace WebKit {
class WebAccessibilityObjectPrivate;
+class WebNode;
+class WebDocument;
class WebString;
struct WebPoint;
struct WebRect;
@@ -103,6 +105,11 @@ public:
WEBKIT_API WebString stringValue() const;
WEBKIT_API WebString title() const;
+ WEBKIT_API WebNode node() const;
+ WEBKIT_API WebDocument document() const;
+ WEBKIT_API bool hasComputedStyle() const;
+ WEBKIT_API WebString computedStyleDisplay() const;
+
#if WEBKIT_IMPLEMENTATION
WebAccessibilityObject(const WTF::PassRefPtr<WebCore::AccessibilityObject>&);
WebAccessibilityObject& operator=(const WTF::PassRefPtr<WebCore::AccessibilityObject>&);
diff --git a/WebKit/chromium/public/WebAttribute.h b/WebKit/chromium/public/WebAttribute.h
new file mode 100644
index 0000000..56e140b
--- /dev/null
+++ b/WebKit/chromium/public/WebAttribute.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+#ifndef WebAttribute_h
+#define WebAttribute_h
+
+#include "WebCommon.h"
+#include "WebPrivatePtr.h"
+
+namespace WebCore { class Attribute; }
+#if WEBKIT_IMPLEMENTATION
+namespace WTF { template <typename T> class PassRefPtr; }
+#endif
+
+namespace WebKit {
+class WebString;
+
+// Provides readonly access to some properties of a DOM attribute.
+class WebAttribute {
+public:
+ ~WebAttribute() { reset(); }
+
+ WebAttribute() { }
+ WebAttribute(const WebAttribute& n) { assign(n); }
+ WebAttribute& operator=(const WebAttribute& n)
+ {
+ assign(n);
+ return *this;
+ }
+
+ WEBKIT_API void reset();
+ WEBKIT_API void assign(const WebAttribute&);
+
+ WEBKIT_API WebString localName() const;
+ WEBKIT_API WebString value() const;
+
+#if WEBKIT_IMPLEMENTATION
+ WebAttribute(const WTF::PassRefPtr<WebCore::Attribute>&);
+#endif
+
+private:
+ WebPrivatePtr<WebCore::Attribute> m_private;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebDOMStringList.h b/WebKit/chromium/public/WebDOMStringList.h
index b3fb533..d88fcee 100644
--- a/WebKit/chromium/public/WebDOMStringList.h
+++ b/WebKit/chromium/public/WebDOMStringList.h
@@ -46,7 +46,7 @@ class WebDOMStringList {
public:
~WebDOMStringList() { reset(); }
- WebDOMStringList() { }
+ WebDOMStringList();
WebDOMStringList(const WebDOMStringList& l) { assign(l); }
WebDOMStringList& operator=(const WebDOMStringList& l)
{
diff --git a/WebKit/chromium/public/WebDocument.h b/WebKit/chromium/public/WebDocument.h
index c093c58..d9f7386 100644
--- a/WebKit/chromium/public/WebDocument.h
+++ b/WebKit/chromium/public/WebDocument.h
@@ -34,11 +34,15 @@
#include "WebNode.h"
#if WEBKIT_IMPLEMENTATION
-namespace WebCore { class Document; }
+namespace WebCore {
+class Document;
+class DocumentType;
+}
namespace WTF { template <typename T> class PassRefPtr; }
#endif
namespace WebKit {
+class WebDocumentType;
class WebElement;
class WebFrame;
class WebNodeCollection;
@@ -74,6 +78,7 @@ public:
WEBKIT_API WebURL completeURL(const WebString&) const;
WEBKIT_API WebElement getElementById(const WebString&) const;
WEBKIT_API WebNode focusedNode() const;
+ WEBKIT_API WebDocumentType doctype() const;
#if WEBKIT_IMPLEMENTATION
WebDocument(const WTF::PassRefPtr<WebCore::Document>&);
diff --git a/WebKit/chromium/public/WebDocumentType.h b/WebKit/chromium/public/WebDocumentType.h
new file mode 100644
index 0000000..b339320
--- /dev/null
+++ b/WebKit/chromium/public/WebDocumentType.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+#ifndef WebDocumentType_h
+#define WebDocumentType_h
+
+#include "WebNode.h"
+
+#if WEBKIT_IMPLEMENTATION
+namespace WebCore { class DocumentType; }
+namespace WTF { template <typename T> class PassRefPtr; }
+#endif
+
+namespace WebKit {
+class WebString;
+
+// Provides readonly access to some properties of a DOM document type.
+class WebDocumentType : public WebNode {
+public:
+ WebDocumentType() { }
+ WebDocumentType(const WebDocumentType& e) : WebNode(e) { }
+
+ WebDocumentType& operator=(const WebDocumentType& e)
+ {
+ WebNode::assign(e);
+ return *this;
+ }
+ void assign(const WebDocumentType& e) { WebNode::assign(e); }
+
+ WEBKIT_API WebString name() const;
+
+#if WEBKIT_IMPLEMENTATION
+ WebDocumentType(const WTF::PassRefPtr<WebCore::DocumentType>&);
+ WebDocumentType& operator=(const WTF::PassRefPtr<WebCore::DocumentType>&);
+ operator WTF::PassRefPtr<WebCore::DocumentType>() const;
+#endif
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebElement.h b/WebKit/chromium/public/WebElement.h
index 1be40bc..16a82d8 100644
--- a/WebKit/chromium/public/WebElement.h
+++ b/WebKit/chromium/public/WebElement.h
@@ -38,6 +38,8 @@ namespace WebCore { class Element; }
#endif
namespace WebKit {
+class WebNamedNodeMap;
+
// Provides access to some properties of a DOM element node.
class WebElement : public WebNode {
public:
@@ -53,6 +55,7 @@ namespace WebKit {
WEBKIT_API bool hasAttribute(const WebString&) const;
WEBKIT_API WebString getAttribute(const WebString&) const;
WEBKIT_API bool setAttribute(const WebString& name, const WebString& value);
+ WEBKIT_API WebNamedNodeMap attributes() const;
WEBKIT_API WebString innerText() const;
#if WEBKIT_IMPLEMENTATION
diff --git a/WebKit/chromium/public/WebFloatPoint.h b/WebKit/chromium/public/WebFloatPoint.h
new file mode 100644
index 0000000..c053ed6
--- /dev/null
+++ b/WebKit/chromium/public/WebFloatPoint.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+#ifndef WebFloatPoint_h
+#define WebFloatPoint_h
+
+#include "WebCommon.h"
+
+#if WEBKIT_IMPLEMENTATION
+#include "IntPoint.h"
+#endif
+
+namespace WebKit {
+
+struct WebFloatPoint {
+ float x;
+ float y;
+
+ WebFloatPoint()
+ : x(0.0f)
+ , y(0.0f)
+ {
+ }
+
+ WebFloatPoint(float x, float y)
+ : x(x)
+ , y(y)
+ {
+ }
+
+#if WEBKIT_IMPLEMENTATION
+ WebFloatPoint(const WebCore::FloatPoint& p)
+ : x(p.x())
+ , y(p.y())
+ {
+ }
+
+ WebFloatPoint& operator=(const WebCore::FloatPoint& p)
+ {
+ x = p.x();
+ y = p.y();
+ return *this;
+ }
+
+ operator WebCore::FloatPoint() const
+ {
+ return WebCore::FloatPoint(x, y);
+ }
+#endif
+};
+
+inline bool operator==(const WebFloatPoint& a, const WebFloatPoint& b)
+{
+ return a.x == b.x && a.y == b.y;
+}
+
+inline bool operator!=(const WebFloatPoint& a, const WebFloatPoint& b)
+{
+ return !(a == b);
+}
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebFloatRect.h b/WebKit/chromium/public/WebFloatRect.h
new file mode 100644
index 0000000..a883513
--- /dev/null
+++ b/WebKit/chromium/public/WebFloatRect.h
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+#ifndef WebFloatRect_h
+#define WebFloatRect_h
+
+#include "WebCommon.h"
+
+#if WEBKIT_IMPLEMENTATION
+#include "FloatRect.h"
+#endif
+
+namespace WebKit {
+
+struct WebFloatRect {
+ float x;
+ float y;
+ float width;
+ float height;
+
+ bool isEmpty() const { return width <= 0 || height <= 0; }
+
+ WebFloatRect()
+ : x(0.0f)
+ , y(0.0f)
+ , width(0.0f)
+ , height(0.0f)
+ {
+ }
+
+ WebFloatRect(float x, float y, float width, float height)
+ : x(x)
+ , y(y)
+ , width(width)
+ , height(height)
+ {
+ }
+
+#if WEBKIT_IMPLEMENTATION
+ WebFloatRect(const WebCore::FloatRect& r)
+ : x(r.x())
+ , y(r.y())
+ , width(r.width())
+ , height(r.height())
+ {
+ }
+
+ WebFloatRect& operator=(const WebCore::FloatRect& r)
+ {
+ x = r.x();
+ y = r.y();
+ width = r.width();
+ height = r.height();
+ return *this;
+ }
+
+ operator WebCore::FloatRect() const
+ {
+ return WebCore::FloatRect(x, y, width, height);
+ }
+#endif
+};
+
+inline bool operator==(const WebFloatRect& a, const WebFloatRect& b)
+{
+ return a.x == b.x && a.y == b.y && a.width == b.width && a.height == b.height;
+}
+
+inline bool operator!=(const WebFloatRect& a, const WebFloatRect& b)
+{
+ return !(a == b);
+}
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebFont.h b/WebKit/chromium/public/WebFont.h
new file mode 100644
index 0000000..a20d52f
--- /dev/null
+++ b/WebKit/chromium/public/WebFont.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+#ifndef WebFont_h
+#define WebFont_h
+
+#include "WebCanvas.h"
+#include "WebColor.h"
+#include "WebCommon.h"
+
+namespace WebKit {
+
+struct WebFontDescription;
+struct WebFloatPoint;
+struct WebFloatRect;
+struct WebPoint;
+struct WebRect;
+struct WebTextRun;
+
+class WebFont {
+public:
+ virtual ~WebFont() { }
+
+ WEBKIT_API static WebFont* create(const WebFontDescription&);
+
+ virtual WebFontDescription fontDescription() const = 0;
+
+ virtual int ascent() const = 0;
+ virtual int descent() const = 0;
+ virtual int height() const = 0;
+ virtual int lineSpacing() const = 0;
+ virtual float xHeight() const = 0;
+
+ // Draws the text run to the given canvas. The text is positioned at the
+ // given left-hand point at the baseline.
+ //
+ // The text will be clipped to the given clip rect. |canvasIsOpaque| is
+ // used to control whether subpixel antialiasing is possible. If there is a
+ // possibility the area drawn could be semi-transparent, subpixel
+ // antialiasing will be disabled.
+ //
+ // |from| and |to| allow the caller to specify a subrange of the given text
+ // run to draw. If |to| is -1, the entire run will be drawn.
+ virtual void drawText(WebCanvas*, const WebTextRun&, const WebFloatPoint& leftBaseline, WebColor,
+ const WebRect& clip, bool canvasIsOpaque,
+ int from = 0, int to = -1) const = 0;
+
+ // Measures the width in pixels of the given text run.
+ virtual int calculateWidth(const WebTextRun&) const = 0;
+
+ // Returns the character offset corresponding to the given horizontal pixel
+ // position as measured from from the left of the run.
+ virtual int offsetForPosition(const WebTextRun&, float position) const = 0;
+
+ // Returns the rectangle representing the selection rect for the subrange
+ // |from| -> |to| of the given text run. You can use -1 for |to| to specify
+ // the entire run (this will do something similar to calling width()).
+ //
+ // The rect will be positioned as if the text was drawn at the given
+ // |leftBaseline| position. |height| indicates the height of the selection
+ // rect you want, typically this will just be the height() of this font.
+ //
+ // To get the pixel offset of some character (the opposite of
+ // offsetForPosition()), pass in a |leftBaseline| = (0, 0), |from| = 0, and
+ // |to| = the character you want. The right edge of the resulting selection
+ // rect will tell you the right side of the character.
+ virtual WebFloatRect selectionRectForText(const WebTextRun&, const WebFloatPoint& leftBaseline,
+ int height, int from = 0, int to = -1) const = 0;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebFontDescription.h b/WebKit/chromium/public/WebFontDescription.h
new file mode 100644
index 0000000..d4bb07e
--- /dev/null
+++ b/WebKit/chromium/public/WebFontDescription.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+#ifndef WebFontDescription_h
+#define WebFontDescription_h
+
+#include "WebString.h"
+
+#if WEBKIT_IMPLEMENTATION
+namespace WebCore { class FontDescription; }
+#endif
+
+namespace WebKit {
+
+struct WebFontDescription {
+ enum GenericFamily {
+ GenericFamilyNone,
+ GenericFamilyStandard,
+ GenericFamilySerif,
+ GenericFamilySansSerif,
+ GenericFamilyMonospace,
+ GenericFamilyCursive,
+ GenericFamilyFantasy
+ };
+
+ enum Smoothing {
+ SmoothingAuto,
+ SmoothingNone,
+ SmoothingGrayscale,
+ SmoothingSubpixel
+ };
+
+ enum Weight {
+ Weight100,
+ Weight200,
+ Weight300,
+ Weight400,
+ Weight500,
+ Weight600,
+ Weight700,
+ Weight800,
+ Weight900,
+ WeightNormal = Weight400,
+ WeightBold = Weight700
+ };
+
+ WebFontDescription()
+ : genericFamily(GenericFamilyNone)
+ , size(0)
+ , italic(false)
+ , smallCaps(false)
+ , weight(WeightNormal)
+ , smoothing(SmoothingAuto)
+ , letterSpacing(0)
+ , wordSpacing(0)
+ {
+ }
+
+ WebString family;
+ GenericFamily genericFamily;
+ float size;
+ bool italic;
+ bool smallCaps;
+ Weight weight;
+ Smoothing smoothing;
+
+ short letterSpacing;
+ short wordSpacing;
+
+#if WEBKIT_IMPLEMENTATION
+ WebFontDescription(const WebCore::FontDescription&, short fontLetterSpacing, short fontWordSpacing);
+
+ operator WebCore::FontDescription() const;
+#endif
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebInputEvent.h b/WebKit/chromium/public/WebInputEvent.h
index 2ac7475..f8b057b 100644
--- a/WebKit/chromium/public/WebInputEvent.h
+++ b/WebKit/chromium/public/WebInputEvent.h
@@ -89,6 +89,7 @@ public:
MouseMove,
MouseEnter,
MouseLeave,
+ ContextMenu,
// WebMouseWheelEvent
MouseWheel,
@@ -135,7 +136,8 @@ public:
|| type == MouseUp
|| type == MouseMove
|| type == MouseEnter
- || type == MouseLeave;
+ || type == MouseLeave
+ || type == ContextMenu;
}
// Returns true if the WebInputEvent |type| is a keyboard event.
diff --git a/WebKit/chromium/public/WebNamedNodeMap.h b/WebKit/chromium/public/WebNamedNodeMap.h
new file mode 100644
index 0000000..0b7e296
--- /dev/null
+++ b/WebKit/chromium/public/WebNamedNodeMap.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+#ifndef WebNamedNodeMap_h
+#define WebNamedNodeMap_h
+
+#include "WebCommon.h"
+#include "WebPrivatePtr.h"
+
+namespace WebCore { class NamedNodeMap; }
+#if WEBKIT_IMPLEMENTATION
+namespace WTF { template <typename T> class PassRefPtr; }
+#endif
+
+namespace WebKit {
+class WebAttribute;
+
+// Provides readonly access to some properties of a DOM attribute map.
+class WebNamedNodeMap {
+public:
+ ~WebNamedNodeMap() { reset(); }
+
+ WebNamedNodeMap() { }
+ WebNamedNodeMap(const WebNamedNodeMap& n) { assign(n); }
+ WebNamedNodeMap& operator=(const WebNamedNodeMap& n)
+ {
+ assign(n);
+ return *this;
+ }
+
+ WEBKIT_API void reset();
+ WEBKIT_API void assign(const WebNamedNodeMap&);
+
+ WEBKIT_API unsigned length() const;
+ WEBKIT_API WebAttribute attributeItem(unsigned) const;
+
+#if WEBKIT_IMPLEMENTATION
+ WebNamedNodeMap(const WTF::PassRefPtr<WebCore::NamedNodeMap>&);
+#endif
+
+private:
+ WebPrivatePtr<WebCore::NamedNodeMap> m_private;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebSettings.h b/WebKit/chromium/public/WebSettings.h
index 32cefa1..90b8553 100644
--- a/WebKit/chromium/public/WebSettings.h
+++ b/WebKit/chromium/public/WebSettings.h
@@ -91,6 +91,7 @@ public:
virtual void setShowDebugBorders(bool) = 0;
virtual void setEditingBehavior(EditingBehavior) = 0;
virtual void setAcceleratedCompositingEnabled(bool) = 0;
+ virtual void setAccelerated2dCanvasEnabled(bool) = 0;
virtual void setHTML5ParserEnabled(bool) = 0;
virtual void setMemoryInfoEnabled(bool) = 0;
diff --git a/WebKit/chromium/public/WebSpeechInputController.h b/WebKit/chromium/public/WebSpeechInputController.h
new file mode 100644
index 0000000..3dba5fb
--- /dev/null
+++ b/WebKit/chromium/public/WebSpeechInputController.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+#ifndef WebSpeechInputController_h
+#define WebSpeechInputController_h
+
+#include "WebCommon.h"
+
+namespace WebKit {
+
+// Provides an embedder API called by WebKit.
+class WebSpeechInputController {
+public:
+ // Starts speech recognition. Speech will get recorded until the endpointer detects silence,
+ // runs to the limit or stopRecording is called. Progress indications and the recognized
+ // text are returned via the listener interface.
+ virtual bool startRecognition()
+ {
+ WEBKIT_ASSERT_NOT_REACHED();
+ return false;
+ }
+
+ // Cancels an ongoing recognition and discards any audio recorded so far. No partial
+ // recognition results are returned to the listener.
+ virtual void cancelRecognition() { WEBKIT_ASSERT_NOT_REACHED(); }
+
+ // Stops audio recording and performs recognition with the audio recorded until now
+ // (does not discard audio). This is an optional call and is typically invoked if the user
+ // wants to stop recording audio as soon as they finished speaking. Otherwise, the speech
+ // recording 'endpointer' should detect silence in the input and stop recording automatically.
+ // Call startRecognition() to record audio and recognize speech again.
+ virtual void stopRecording() { WEBKIT_ASSERT_NOT_REACHED(); }
+
+protected:
+ virtual ~WebSpeechInputController() { }
+};
+
+} // namespace WebKit
+
+#endif // WebSpeechInputController_h
diff --git a/WebKit/chromium/public/WebSpeechInputListener.h b/WebKit/chromium/public/WebSpeechInputListener.h
new file mode 100644
index 0000000..f1756af
--- /dev/null
+++ b/WebKit/chromium/public/WebSpeechInputListener.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+#ifndef WebSpeechInputListener_h
+#define WebSpeechInputListener_h
+
+namespace WebKit {
+
+class WebString;
+
+// Provides a WebKit API called by the embedder.
+// A typical sequence of calls to the listener would be
+// 1 call to didCompleteRecording
+// 0 or more calls to setRecognitionResult
+// 1 call to didCompleteRecognition
+class WebSpeechInputListener {
+public:
+ // Informs that audio recording has completed and recognition is underway. This gets invoked
+ // irrespective of whether recording was stopped automatically by the 'endpointer' or if
+ // WebSpeechInputController::stopRecording() was called.
+ // Typically after this call the listener would update the UI to reflect that recognition is
+ // in progress.
+ virtual void didCompleteRecording() = 0;
+
+ // Gives results from speech recognition, either partial or the final results.
+ // This method can potentially get called multiple times if there are partial results
+ // available as the user keeps speaking. If the speech could not be recognized properly
+ // or if there was any other errors in the process, this method may never be called.
+ virtual void setRecognitionResult(const WebString&) = 0;
+
+ // Informs that speech recognition has completed. This gets invoked irrespective of whether
+ // recognition was succesful or not, whether setRecognitionResult() was invoked or not. The
+ // handler typically frees up any temporary resources allocated and waits for the next speech
+ // recognition request.
+ virtual void didCompleteRecognition() = 0;
+
+protected:
+ ~WebSpeechInputListener() { }
+};
+
+} // namespace WebKit
+
+#endif // WebSpeechInputListener_h
diff --git a/WebKit/chromium/public/WebTextRun.h b/WebKit/chromium/public/WebTextRun.h
new file mode 100644
index 0000000..cb1373a
--- /dev/null
+++ b/WebKit/chromium/public/WebTextRun.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+#ifndef WebTextRun_h
+#define WebTextRun_h
+
+#include "WebString.h"
+
+#ifdef WEBKIT_IMPLEMENTATION
+namespace WebCore { class TextRun; }
+#endif
+
+namespace WebKit {
+
+struct WebTextRun {
+ WebTextRun(const WebString& t, bool isRTL, bool hasDirectionalOverride)
+ : text(t)
+ , rtl(isRTL)
+ , directionalOverride(hasDirectionalOverride)
+ {
+ }
+ WebTextRun()
+ : rtl(false)
+ , directionalOverride(false)
+ {
+ }
+
+ WebString text;
+ bool rtl;
+ bool directionalOverride;
+
+#ifdef WEBKIT_IMPLEMENTATION
+ // The resulting WebCore::TextRun will refer to the text in this
+ // struct, so "this" must outlive the WebCore text run.
+ operator WebCore::TextRun() const;
+#endif
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h
index 26d7269..1b94da2 100644
--- a/WebKit/chromium/public/WebView.h
+++ b/WebKit/chromium/public/WebView.h
@@ -253,6 +253,7 @@ public:
const WebNode&,
const WebVector<WebString>& names,
const WebVector<WebString>& labels,
+ const WebVector<int>& uniqueIDs,
int separatorIndex) = 0;
// Notifies the WebView that AutoFill suggestions are available for a node.
@@ -262,6 +263,7 @@ public:
const WebNode&,
const WebVector<WebString>& names,
const WebVector<WebString>& labels,
+ const WebVector<WebString>& icons,
const WebVector<int>& uniqueIDs,
int separatorIndex) = 0;
diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h
index 11fb233..4628c2f 100644
--- a/WebKit/chromium/public/WebViewClient.h
+++ b/WebKit/chromium/public/WebViewClient.h
@@ -55,6 +55,8 @@ class WebKeyboardEvent;
class WebNode;
class WebNotificationPresenter;
class WebRange;
+class WebSpeechInputController;
+class WebSpeechInputListener;
class WebStorageNamespace;
class WebURL;
class WebView;
@@ -331,7 +333,13 @@ public:
// Geolocation ---------------------------------------------------------
// Access the embedder API for geolocation services.
- virtual WebKit::WebGeolocationService* geolocationService() { return 0; }
+ virtual WebGeolocationService* geolocationService() { return 0; }
+
+ // Speech --------------------------------------------------------------
+
+ // Access the embedder API for speech input services.
+ virtual WebSpeechInputController* speechInputController(
+ WebSpeechInputListener*) { return 0; }
protected:
~WebViewClient() { }
diff --git a/WebKit/chromium/src/ApplicationCacheHost.cpp b/WebKit/chromium/src/ApplicationCacheHost.cpp
index b90126f..dfd4754 100644
--- a/WebKit/chromium/src/ApplicationCacheHost.cpp
+++ b/WebKit/chromium/src/ApplicationCacheHost.cpp
@@ -37,11 +37,15 @@
#include "DocumentLoader.h"
#include "DOMApplicationCache.h"
#include "Frame.h"
+#include "InspectorApplicationCacheAgent.h"
+#include "InspectorController.h"
+#include "Page.h"
#include "ProgressEvent.h"
#include "Settings.h"
#include "WebURL.h"
#include "WebURLError.h"
#include "WebURLResponse.h"
+#include "WebVector.h"
#include "WrappedResourceRequest.h"
#include "WrappedResourceResponse.h"
@@ -206,6 +210,32 @@ void ApplicationCacheHost::notifyDOMApplicationCache(EventID id, int total, int
dispatchDOMEvent(id, total, done);
}
+#if ENABLE(INSPECTOR)
+ApplicationCacheHost::CacheInfo ApplicationCacheHost::applicationCacheInfo()
+{
+ if (!m_internal)
+ return CacheInfo(KURL(), 0, 0, 0);
+
+ WebKit::WebApplicationCacheHost::CacheInfo webInfo;
+ m_internal->m_outerHost->getAssociatedCacheInfo(&webInfo);
+ return CacheInfo(webInfo.manifestURL, webInfo.creationTime, webInfo.updateTime, webInfo.totalSize);
+}
+
+void ApplicationCacheHost::fillResourceList(ResourceInfoList* resources)
+{
+ if (!m_internal)
+ return;
+
+ WebKit::WebVector<WebKit::WebApplicationCacheHost::ResourceInfo> webResources;
+ m_internal->m_outerHost->getResourceList(&webResources);
+ for (size_t i = 0; i < webResources.size(); ++i) {
+ resources->append(ResourceInfo(
+ webResources[i].url, webResources[i].isMaster, webResources[i].isManifest, webResources[i].isFallback,
+ webResources[i].isForeign, webResources[i].isExplicit, webResources[i].size));
+ }
+}
+#endif
+
void ApplicationCacheHost::stopDeferringEvents()
{
RefPtr<DocumentLoader> protect(documentLoader());
diff --git a/WebKit/chromium/src/AssertMatchingEnums.cpp b/WebKit/chromium/src/AssertMatchingEnums.cpp
index 1f946f3..093ac11 100644
--- a/WebKit/chromium/src/AssertMatchingEnums.cpp
+++ b/WebKit/chromium/src/AssertMatchingEnums.cpp
@@ -36,6 +36,8 @@
#include "AccessibilityObject.h"
#include "ApplicationCacheHost.h"
#include "EditorInsertAction.h"
+#include "FontDescription.h"
+#include "FontSmoothingMode.h"
#include "HTMLInputElement.h"
#include "IDBKey.h"
#include "MediaPlayer.h"
@@ -52,6 +54,7 @@
#include "WebClipboard.h"
#include "WebCursorInfo.h"
#include "WebEditingAction.h"
+#include "WebFontDescription.h"
#include "WebIDBKey.h"
#include "WebInputElement.h"
#include "WebMediaPlayer.h"
@@ -235,6 +238,31 @@ COMPILE_ASSERT_MATCHING_ENUM(WebEditingActionTyped, EditorInsertActionTyped);
COMPILE_ASSERT_MATCHING_ENUM(WebEditingActionPasted, EditorInsertActionPasted);
COMPILE_ASSERT_MATCHING_ENUM(WebEditingActionDropped, EditorInsertActionDropped);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::GenericFamilyNone, FontDescription::NoFamily);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::GenericFamilyStandard, FontDescription::StandardFamily);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::GenericFamilySerif, FontDescription::SerifFamily);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::GenericFamilySansSerif, FontDescription::SansSerifFamily);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::GenericFamilyMonospace, FontDescription::MonospaceFamily);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::GenericFamilyCursive, FontDescription::CursiveFamily);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::GenericFamilyFantasy, FontDescription::FantasyFamily);
+
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::SmoothingAuto, AutoSmoothing);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::SmoothingNone, NoSmoothing);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::SmoothingGrayscale, Antialiased);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::SmoothingSubpixel, SubpixelAntialiased);
+
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight100, FontWeight100);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight200, FontWeight200);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight300, FontWeight300);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight400, FontWeight400);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight500, FontWeight500);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight600, FontWeight600);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight700, FontWeight700);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight800, FontWeight800);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight900, FontWeight900);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::WeightNormal, FontWeightNormal);
+COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::WeightBold, FontWeightBold);
+
COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Text, HTMLInputElement::TEXT);
COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Password, HTMLInputElement::PASSWORD);
COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::IsIndex, HTMLInputElement::ISINDEX);
@@ -326,3 +354,5 @@ COMPILE_ASSERT_MATCHING_ENUM(WebView::UserContentInjectInTopFrameOnly, InjectInT
COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::NullType, IDBKey::NullType);
COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::StringType, IDBKey::StringType);
COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::NumberType, IDBKey::NumberType);
+
+
diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
index 6b74f60..b14840c 100644
--- a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
+++ b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
@@ -84,6 +84,16 @@ WebString AutoFillPopupMenuClient::getLabel(unsigned listIndex) const
return m_labels[index];
}
+WebString AutoFillPopupMenuClient::getIcon(unsigned listIndex) const
+{
+ int index = convertListIndexToInternalIndex(listIndex);
+ if (index == -1)
+ return WebString();
+
+ ASSERT(index >= 0 && static_cast<size_t>(index) < m_icons.size());
+ return m_icons[index];
+}
+
void AutoFillPopupMenuClient::removeSuggestionAtIndex(unsigned listIndex)
{
if (!canRemoveSuggestionAtIndex(listIndex))
@@ -95,6 +105,8 @@ void AutoFillPopupMenuClient::removeSuggestionAtIndex(unsigned listIndex)
m_names.remove(index);
m_labels.remove(index);
+ m_icons.remove(index);
+ m_uniqueIDs.remove(index);
// Shift the separator index if necessary.
if (m_separatorIndex != -1)
@@ -177,6 +189,11 @@ String AutoFillPopupMenuClient::itemLabel(unsigned listIndex) const
return getLabel(listIndex);
}
+String AutoFillPopupMenuClient::itemIcon(unsigned listIndex) const
+{
+ return getIcon(listIndex);
+}
+
PopupMenuStyle AutoFillPopupMenuClient::itemStyle(unsigned listIndex) const
{
return *m_style;
@@ -249,10 +266,12 @@ void AutoFillPopupMenuClient::initialize(
HTMLInputElement* textField,
const WebVector<WebString>& names,
const WebVector<WebString>& labels,
+ const WebVector<WebString>& icons,
const WebVector<int>& uniqueIDs,
int separatorIndex)
{
ASSERT(names.size() == labels.size());
+ ASSERT(names.size() == icons.size());
ASSERT(names.size() == uniqueIDs.size());
ASSERT(separatorIndex < static_cast<int>(names.size()));
@@ -261,7 +280,7 @@ void AutoFillPopupMenuClient::initialize(
// The suggestions must be set before initializing the
// AutoFillPopupMenuClient.
- setSuggestions(names, labels, uniqueIDs, separatorIndex);
+ setSuggestions(names, labels, icons, uniqueIDs, separatorIndex);
FontDescription fontDescription;
RenderTheme::defaultTheme()->systemFont(CSSValueWebkitControl,
@@ -280,19 +299,23 @@ void AutoFillPopupMenuClient::initialize(
void AutoFillPopupMenuClient::setSuggestions(const WebVector<WebString>& names,
const WebVector<WebString>& labels,
+ const WebVector<WebString>& icons,
const WebVector<int>& uniqueIDs,
int separatorIndex)
{
ASSERT(names.size() == labels.size());
+ ASSERT(names.size() == icons.size());
ASSERT(names.size() == uniqueIDs.size());
ASSERT(separatorIndex < static_cast<int>(names.size()));
m_names.clear();
m_labels.clear();
+ m_icons.clear();
m_uniqueIDs.clear();
for (size_t i = 0; i < names.size(); ++i) {
m_names.append(names[i]);
m_labels.append(labels[i]);
+ m_icons.append(icons[i]);
m_uniqueIDs.append(uniqueIDs[i]);
}
diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.h b/WebKit/chromium/src/AutoFillPopupMenuClient.h
index 289c8d0..223cf16 100644
--- a/WebKit/chromium/src/AutoFillPopupMenuClient.h
+++ b/WebKit/chromium/src/AutoFillPopupMenuClient.h
@@ -60,6 +60,9 @@ public:
// Returns the label at |listIndex|.
virtual WebString getLabel(unsigned listIndex) const;
+ // Returns the icon at |listIndex|.
+ virtual WebString getIcon(unsigned listIndex) const;
+
// Removes the suggestion at |listIndex| from the list of suggestions.
virtual void removeSuggestionAtIndex(unsigned listIndex);
@@ -72,6 +75,7 @@ public:
virtual void selectionCleared();
virtual WebCore::String itemText(unsigned listIndex) const;
virtual WebCore::String itemLabel(unsigned listIndex) const;
+ virtual WebCore::String itemIcon(unsigned listIndex) const;
virtual WebCore::String itemToolTip(unsigned lastIndex) const { return WebCore::String(); }
virtual WebCore::String itemAccessibilityText(unsigned lastIndex) const { return WebCore::String(); }
virtual bool itemIsEnabled(unsigned listIndex) const { return true; }
@@ -100,11 +104,13 @@ public:
void initialize(WebCore::HTMLInputElement*,
const WebVector<WebString>& names,
const WebVector<WebString>& labels,
+ const WebVector<WebString>& icons,
const WebVector<int>& uniqueIDs,
int separatorIndex);
void setSuggestions(const WebVector<WebString>& names,
const WebVector<WebString>& labels,
+ const WebVector<WebString>& icons,
const WebVector<int>& uniqueIDs,
int separatorIndex);
@@ -124,9 +130,10 @@ private:
int getSelectedIndex() const { return m_selectedIndex; }
void setSelectedIndex(int index) { m_selectedIndex = index; }
- // The names and labels that make up the text of the menu items.
+ // The names, labels and icons that make up the contents of the menu items.
Vector<WebCore::String> m_names;
Vector<WebCore::String> m_labels;
+ Vector<WebCore::String> m_icons;
Vector<int> m_uniqueIDs;
// The index of the separator. -1 if there is no separator.
diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp
index 333020f..78e0693 100644
--- a/WebKit/chromium/src/ChromiumBridge.cpp
+++ b/WebKit/chromium/src/ChromiumBridge.cpp
@@ -469,9 +469,8 @@ GeolocationServiceBridge* ChromiumBridge::createGeolocationServiceBridge(Geoloca
return createGeolocationServiceBridgeImpl(geolocationServiceChromium);
}
-// HTML5 DB -------------------------------------------------------------------
+// Databases ------------------------------------------------------------------
-#if ENABLE(DATABASE)
PlatformFileHandle ChromiumBridge::databaseOpenFile(const String& vfsFileName, int desiredFlags)
{
return webKitClient()->databaseOpenFile(WebString(vfsFileName), desiredFlags);
@@ -491,7 +490,6 @@ long long ChromiumBridge::databaseGetFileSize(const String& vfsFileName)
{
return webKitClient()->databaseGetFileSize(WebString(vfsFileName));
}
-#endif
// Indexed Database -----------------------------------------------------------
diff --git a/WebKit/chromium/src/ContextMenuClientImpl.cpp b/WebKit/chromium/src/ContextMenuClientImpl.cpp
index d0d09bf..1dc2ee7 100644
--- a/WebKit/chromium/src/ContextMenuClientImpl.cpp
+++ b/WebKit/chromium/src/ContextMenuClientImpl.cpp
@@ -277,7 +277,7 @@ void ContextMenuClientImpl::populateCustomMenuItems(WebCore::ContextMenu* defaul
Vector<WebMenuItemInfo> customItems;
for (size_t i = 0; i < defaultMenu->itemCount(); ++i) {
ContextMenuItem* inputItem = defaultMenu->itemAtIndex(i, defaultMenu->platformDescription());
- if (inputItem->action() < ContextMenuItemBaseCustomTag || inputItem->action() >= ContextMenuItemBaseApplicationTag)
+ if (inputItem->action() < ContextMenuItemBaseCustomTag || inputItem->action() > ContextMenuItemLastCustomTag)
continue;
WebMenuItemInfo outputItem;
diff --git a/WebKit/chromium/src/DatabaseObserver.cpp b/WebKit/chromium/src/DatabaseObserver.cpp
index e1b7cbe..f43c9bd 100644
--- a/WebKit/chromium/src/DatabaseObserver.cpp
+++ b/WebKit/chromium/src/DatabaseObserver.cpp
@@ -31,6 +31,8 @@
#include "config.h"
#include "DatabaseObserver.h"
+#if ENABLE(DATABASE)
+
#include "AbstractDatabase.h"
#include "Document.h"
#include "ScriptExecutionContext.h"
@@ -84,3 +86,5 @@ void DatabaseObserver::databaseClosed(AbstractDatabase* database)
}
} // namespace WebCore
+
+#endif // ENABLE(DATABASE)
diff --git a/WebKit/chromium/src/InspectorFrontendClientImpl.cpp b/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
index 73cedfa..870bdee 100644
--- a/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
+++ b/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
@@ -124,4 +124,15 @@ void InspectorFrontendClientImpl::inspectedURLChanged(const String& url)
m_frontendPage->mainFrame()->document()->setTitle("Developer Tools - " + url);
}
+void InspectorFrontendClientImpl::sendMessageToBackend(const String& message)
+{
+ WebDevToolsMessageData messageData;
+ messageData.className = "ToolsAgent";
+ messageData.methodName = "dispatchOnInspectorController";
+ WebVector<WebString> args(static_cast<size_t>(1));
+ args[0] = message;
+ messageData.arguments.swap(args);
+ m_client->sendMessageToAgent(messageData);
+}
+
} // namespace WebKit
diff --git a/WebKit/chromium/src/InspectorFrontendClientImpl.h b/WebKit/chromium/src/InspectorFrontendClientImpl.h
index f869ac3..f7174ce 100644
--- a/WebKit/chromium/src/InspectorFrontendClientImpl.h
+++ b/WebKit/chromium/src/InspectorFrontendClientImpl.h
@@ -68,6 +68,7 @@ public:
virtual void inspectedURLChanged(const WebCore::String&);
+ virtual void sendMessageToBackend(const WebCore::String&);
private:
WebCore::Page* m_frontendPage;
WebDevToolsFrontendClient* m_client;
diff --git a/WebKit/chromium/src/SpeechInputClientImpl.cpp b/WebKit/chromium/src/SpeechInputClientImpl.cpp
new file mode 100644
index 0000000..8bccacf
--- /dev/null
+++ b/WebKit/chromium/src/SpeechInputClientImpl.cpp
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2010 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 "SpeechInputClientImpl.h"
+
+#include "PlatformString.h"
+#include "WebSpeechInputController.h"
+#include "WebString.h"
+#include "WebViewClient.h"
+#include "page/SpeechInputListener.h"
+
+#if ENABLE(INPUT_SPEECH)
+
+namespace WebKit {
+
+SpeechInputClientImpl::SpeechInputClientImpl(WebViewClient* web_view_client)
+ : m_controller(web_view_client->speechInputController(this))
+ , m_listener(0)
+{
+ ASSERT(m_controller);
+}
+
+SpeechInputClientImpl::~SpeechInputClientImpl()
+{
+}
+
+bool SpeechInputClientImpl::startRecognition(WebCore::SpeechInputListener* listener)
+{
+ m_listener = listener;
+ return m_controller->startRecognition();
+}
+
+void SpeechInputClientImpl::stopRecording()
+{
+ ASSERT(m_listener);
+ m_controller->stopRecording();
+}
+
+void SpeechInputClientImpl::cancelRecognition()
+{
+ ASSERT(m_listener);
+ m_controller->cancelRecognition();
+}
+
+void SpeechInputClientImpl::didCompleteRecording()
+{
+ ASSERT(m_listener);
+ m_listener->didCompleteRecording();
+}
+
+void SpeechInputClientImpl::didCompleteRecognition()
+{
+ ASSERT(m_listener);
+ m_listener->didCompleteRecognition();
+ m_listener = 0;
+}
+
+void SpeechInputClientImpl::setRecognitionResult(const WebString& result)
+{
+ ASSERT(m_listener);
+ m_listener->setRecognitionResult(result);
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(INPUT_SPEECH)
diff --git a/WebKit/chromium/src/SpeechInputClientImpl.h b/WebKit/chromium/src/SpeechInputClientImpl.h
new file mode 100644
index 0000000..5762da8
--- /dev/null
+++ b/WebKit/chromium/src/SpeechInputClientImpl.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+#ifndef SpeechInputClientImpl_h
+#define SpeechInputClientImpl_h
+
+#if ENABLE(INPUT_SPEECH)
+
+#include "WebSpeechInputListener.h"
+#include "page/SpeechInputClient.h"
+
+namespace WebCore {
+class SpeechInputListener;
+}
+
+namespace WebKit {
+
+class WebSpeechInputController;
+class WebViewClient;
+
+class SpeechInputClientImpl
+ : public WebCore::SpeechInputClient,
+ public WebSpeechInputListener {
+public:
+ SpeechInputClientImpl(WebViewClient*);
+ virtual ~SpeechInputClientImpl();
+
+ // SpeechInputClient methods.
+ bool startRecognition(WebCore::SpeechInputListener*);
+ void stopRecording();
+ void cancelRecognition();
+
+ // WebSpeechInputListener methods.
+ void didCompleteRecording();
+ void setRecognitionResult(const WebString&);
+ void didCompleteRecognition();
+
+private:
+ WebSpeechInputController* m_controller; // To call into the embedder.
+ WebCore::SpeechInputListener* m_listener; // Valid when recognition is in progress.
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(INPUT_SPEECH)
+
+#endif // SpeechInputClientImpl_h
diff --git a/WebKit/chromium/src/ToolsAgent.h b/WebKit/chromium/src/ToolsAgent.h
index c748c8a..937fcf0 100644
--- a/WebKit/chromium/src/ToolsAgent.h
+++ b/WebKit/chromium/src/ToolsAgent.h
@@ -39,13 +39,7 @@ namespace WebKit {
// API for auxiliary UI functions such as dom elements highlighting.
#define TOOLS_AGENT_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, METHOD4, METHOD5) \
/* Dispatches given function on the InspectorController object */ \
- METHOD3(dispatchOnInspectorController, int /* call_id */, \
- String /* function_name */, String /* json_args */) \
- \
- /* Dispatches given function on the InjectedScript object */ \
- METHOD5(dispatchOnInjectedScript, int /* call_id */, \
- int /* injected_script_id */, String /* function_name */, \
- String /* json_args */, bool /* async */)
+ METHOD1(dispatchOnInspectorController, String /* message */) \
DEFINE_RPC_CLASS(ToolsAgent, TOOLS_AGENT_STRUCT)
diff --git a/WebKit/chromium/src/WebAccessibilityObject.cpp b/WebKit/chromium/src/WebAccessibilityObject.cpp
index e59a1a2..4263e8b 100644
--- a/WebKit/chromium/src/WebAccessibilityObject.cpp
+++ b/WebKit/chromium/src/WebAccessibilityObject.cpp
@@ -32,9 +32,15 @@
#include "WebAccessibilityObject.h"
#include "AccessibilityObject.h"
+#include "CSSPrimitiveValueMappings.h"
+#include "Document.h"
#include "EventHandler.h"
#include "FrameView.h"
+#include "Node.h"
#include "PlatformKeyboardEvent.h"
+#include "RenderStyle.h"
+#include "WebDocument.h"
+#include "WebNode.h"
#include "WebPoint.h"
#include "WebRect.h"
#include "WebString.h"
@@ -401,6 +407,65 @@ WebString WebAccessibilityObject::title() const
return m_private->title();
}
+
+WebNode WebAccessibilityObject::node() const
+{
+ if (!m_private)
+ return WebNode();
+
+ m_private->updateBackingStore();
+
+ Node* node = m_private->node();
+ if (!node)
+ return WebNode();
+
+ return WebNode(node);
+}
+
+WebDocument WebAccessibilityObject::document() const
+{
+ if (!m_private)
+ return WebDocument();
+
+ m_private->updateBackingStore();
+
+ Document* document = m_private->document();
+ if (!document)
+ return WebDocument();
+
+ return WebDocument(document);
+}
+
+bool WebAccessibilityObject::hasComputedStyle() const
+{
+ Document* document = m_private->document();
+ if (document)
+ document->updateStyleIfNeeded();
+
+ Node* node = m_private->node();
+ if (!node)
+ return false;
+
+ return node->computedStyle();
+}
+
+WebString WebAccessibilityObject::computedStyleDisplay() const
+{
+ Document* document = m_private->document();
+ if (document)
+ document->updateStyleIfNeeded();
+
+ Node* node = m_private->node();
+ if (!node)
+ return WebString();
+
+ RenderStyle* renderStyle = node->computedStyle();
+ if (!renderStyle)
+ return WebString();
+
+ return WebString(CSSPrimitiveValue::create(renderStyle->display())->getStringValue());
+}
+
WebAccessibilityObject::WebAccessibilityObject(const WTF::PassRefPtr<WebCore::AccessibilityObject>& object)
: m_private(static_cast<WebAccessibilityObjectPrivate*>(object.releaseRef()))
{
diff --git a/WebKit/chromium/src/WebAttribute.cpp b/WebKit/chromium/src/WebAttribute.cpp
new file mode 100644
index 0000000..0bc3b91
--- /dev/null
+++ b/WebKit/chromium/src/WebAttribute.cpp
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2010 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 "WebAttribute.h"
+
+#include "Attribute.h"
+#include <wtf/PassRefPtr.h>
+
+#include "WebString.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+void WebAttribute::reset()
+{
+ m_private.reset();
+}
+
+void WebAttribute::assign(const WebAttribute& other)
+{
+ m_private = other.m_private;
+}
+
+WebAttribute::WebAttribute(const PassRefPtr<Attribute>& other)
+ : m_private(other)
+{
+}
+
+WebString WebAttribute::localName() const
+{
+ return WebString(m_private->localName());
+}
+
+WebString WebAttribute::value() const
+{
+ return WebString(m_private->value());
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebDOMStringList.cpp b/WebKit/chromium/src/WebDOMStringList.cpp
index cd145bf..4be7fab 100644
--- a/WebKit/chromium/src/WebDOMStringList.cpp
+++ b/WebKit/chromium/src/WebDOMStringList.cpp
@@ -38,6 +38,11 @@ using namespace WebCore;
namespace WebKit {
+WebDOMStringList::WebDOMStringList()
+{
+ m_private = WebCore::DOMStringList::create();
+}
+
void WebDOMStringList::reset()
{
m_private.reset();
diff --git a/WebKit/chromium/src/WebDatabase.cpp b/WebKit/chromium/src/WebDatabase.cpp
index 89522f1..561d7c4 100644
--- a/WebKit/chromium/src/WebDatabase.cpp
+++ b/WebKit/chromium/src/WebDatabase.cpp
@@ -40,6 +40,18 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
+#if !ENABLE(DATABASE)
+namespace WebCore {
+class AbstractDatabase {
+public:
+ String stringIdentifier() const { return String(); }
+ String displayName() const { return String(); }
+ unsigned long long estimatedSize() const { return 0; }
+ SecurityOrigin* securityOrigin() const { return 0; }
+};
+}
+#endif // !ENABLE(DATABASE)
+
using namespace WebCore;
namespace WebKit {
@@ -84,17 +96,21 @@ void WebDatabase::updateDatabaseSize(
const WebString& originIdentifier, const WebString& databaseName,
unsigned long long databaseSize, unsigned long long spaceAvailable)
{
+#if ENABLE(DATABASE)
WebCore::QuotaTracker::instance().updateDatabaseSizeAndSpaceAvailableToOrigin(
originIdentifier, databaseName, databaseSize, spaceAvailable);
+#endif // ENABLE(DATABASE)
}
void WebDatabase::closeDatabaseImmediately(const WebString& originIdentifier, const WebString& databaseName)
{
+#if ENABLE(DATABASE)
HashSet<RefPtr<AbstractDatabase> > databaseHandles;
RefPtr<SecurityOrigin> origin = SecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
DatabaseTracker::tracker().getOpenDatabases(origin.get(), databaseName, &databaseHandles);
for (HashSet<RefPtr<AbstractDatabase> >::iterator it = databaseHandles.begin(); it != databaseHandles.end(); ++it)
it->get()->closeImmediately();
+#endif // ENABLE(DATABASE)
}
WebDatabase::WebDatabase(const AbstractDatabase* database)
diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
index 0d8cbad..1a65bfe 100644
--- a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
+++ b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
@@ -38,6 +38,7 @@
#include "EventListener.h"
#include "InjectedScriptHost.h"
#include "InspectorBackend.h"
+#include "InspectorBackendDispatcher.h"
#include "InspectorController.h"
#include "InspectorFrontend.h"
#include "InspectorResource.h"
@@ -54,7 +55,6 @@
#include "ScriptState.h"
#include "ScriptValue.h"
#include "V8Binding.h"
-#include "V8InspectorBackend.h"
#include "V8Proxy.h"
#include "V8Utilities.h"
#include "WebDataSource.h"
@@ -92,7 +92,6 @@ using WebCore::ScriptState;
using WebCore::ScriptValue;
using WebCore::String;
using WebCore::V8DOMWrapper;
-using WebCore::V8InspectorBackend;
using WebCore::V8Proxy;
namespace WebKit {
@@ -308,23 +307,9 @@ void WebDevToolsAgentImpl::forceRepaint()
m_client->forceRepaint();
}
-void WebDevToolsAgentImpl::dispatchOnInspectorController(int callId, const String& functionName, const String& jsonArgs)
+void WebDevToolsAgentImpl::dispatchOnInspectorController(const String& message)
{
- String result;
- String exception;
- result = m_debuggerAgentImpl->executeUtilityFunction(m_utilityContext, callId,
- "InspectorControllerDispatcher", functionName, jsonArgs, false /* is sync */, &exception);
- m_toolsAgentDelegateStub->didDispatchOn(callId, result, exception);
-}
-
-void WebDevToolsAgentImpl::dispatchOnInjectedScript(int callId, int injectedScriptId, const String& functionName, const String& jsonArgs, bool async)
-{
- inspectorController()->inspectorBackend()->dispatchOnInjectedScript(
- callId,
- injectedScriptId,
- functionName,
- jsonArgs,
- async);
+ inspectorController()->inspectorBackendDispatcher()->dispatch(message);
}
void WebDevToolsAgentImpl::dispatchMessageFromFrontend(const WebDevToolsMessageData& data)
@@ -386,38 +371,6 @@ void WebDevToolsAgentImpl::initDevToolsAgentHost()
"dispatch",
WebDevToolsAgentImpl::jsDispatchOnClient);
devtoolsAgentHost.build();
-
- v8::HandleScope scope;
- v8::Context::Scope utilityScope(m_utilityContext);
- // Call custom code to create inspector backend wrapper in the utility context
- // instead of calling V8DOMWrapper::convertToV8Object that would create the
- // wrapper in the Page main frame context.
- v8::Handle<v8::Object> backendWrapper = createInspectorBackendV8Wrapper();
- if (backendWrapper.IsEmpty())
- return;
- m_utilityContext->Global()->Set(v8::String::New("InspectorBackend"), backendWrapper);
-}
-
-v8::Local<v8::Object> WebDevToolsAgentImpl::createInspectorBackendV8Wrapper()
-{
- v8::Handle<v8::Function> function = V8InspectorBackend::GetTemplate()->GetFunction();
- if (function.IsEmpty()) {
- // Return if allocation failed.
- return v8::Local<v8::Object>();
- }
- v8::Local<v8::Object> instance = SafeAllocation::newInstance(function);
- if (instance.IsEmpty()) {
- // Avoid setting the wrapper if allocation failed.
- return v8::Local<v8::Object>();
- }
- InspectorBackend* backend = m_webViewImpl->page()->inspectorController()->inspectorBackend();
- V8DOMWrapper::setDOMWrapper(instance, &V8InspectorBackend::info, backend);
- // Create a weak reference to the v8 wrapper of InspectorBackend to deref
- // InspectorBackend when the wrapper is garbage collected.
- backend->ref();
- v8::Persistent<v8::Object> weakHandle = v8::Persistent<v8::Object>::New(instance);
- weakHandle.MakeWeak(backend, &InspectorBackendWeakReferenceCallback);
- return instance;
}
void WebDevToolsAgentImpl::createInspectorFrontendProxy()
diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.h b/WebKit/chromium/src/WebDevToolsAgentImpl.h
index 12f51f9..c8e22b0 100644
--- a/WebKit/chromium/src/WebDevToolsAgentImpl.h
+++ b/WebKit/chromium/src/WebDevToolsAgentImpl.h
@@ -72,8 +72,7 @@ public:
virtual ~WebDevToolsAgentImpl();
// ToolsAgent implementation.
- virtual void dispatchOnInspectorController(int callId, const WebCore::String& functionName, const WebCore::String& jsonArgs);
- virtual void dispatchOnInjectedScript(int callId, int injectedScriptId, const WebCore::String& functionName, const WebCore::String& jsonArgs, bool async);
+ virtual void dispatchOnInspectorController(const WebCore::String& message);
// WebDevToolsAgentPrivate implementation.
virtual void didClearWindowObject(WebFrameImpl* frame);
@@ -128,12 +127,6 @@ private:
WebCore::InspectorController* inspectorController();
- // Creates InspectorBackend v8 wrapper in the utility context so that it's
- // methods prototype is Function.protoype object from the utility context.
- // Otherwise some useful methods defined on Function.prototype(such as bind)
- // are missing for InspectorController native methods.
- v8::Local<v8::Object> createInspectorBackendV8Wrapper();
-
int m_hostId;
WebDevToolsAgentClient* m_client;
WebViewImpl* m_webViewImpl;
diff --git a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
index 3e83f18..592a532 100644
--- a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
+++ b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
@@ -150,10 +150,6 @@ void WebDevToolsFrontendImpl::frontendLoaded()
{
m_loaded = true;
- // Grant the devtools page the ability to have source view iframes.
- SecurityOrigin* origin = m_webViewImpl->page()->mainFrame()->domWindow()->securityOrigin();
- origin->grantUniversalAccess();
-
for (Vector<Vector<String> >::iterator it = m_pendingIncomingMessages.begin();
it != m_pendingIncomingMessages.end();
++it) {
diff --git a/WebKit/chromium/src/WebDocument.cpp b/WebKit/chromium/src/WebDocument.cpp
index 017716d..a983bf7 100644
--- a/WebKit/chromium/src/WebDocument.cpp
+++ b/WebKit/chromium/src/WebDocument.cpp
@@ -32,6 +32,7 @@
#include "WebDocument.h"
#include "Document.h"
+#include "DocumentType.h"
#include "Element.h"
#include "HTMLAllCollection.h"
#include "HTMLBodyElement.h"
@@ -40,6 +41,7 @@
#include "HTMLHeadElement.h"
#include "NodeList.h"
+#include "WebDocumentType.h"
#include "WebElement.h"
#include "WebFrameImpl.h"
#include "WebNodeCollection.h"
@@ -122,6 +124,11 @@ WebNode WebDocument::focusedNode() const
return WebNode(constUnwrap<Document>()->focusedNode());
}
+WebDocumentType WebDocument::doctype() const
+{
+ return WebDocumentType(constUnwrap<Document>()->doctype());
+}
+
WebDocument::WebDocument(const PassRefPtr<Document>& elem)
: WebNode(elem)
{
diff --git a/WebKit/chromium/src/WebDocumentType.cpp b/WebKit/chromium/src/WebDocumentType.cpp
new file mode 100644
index 0000000..bbf28e7
--- /dev/null
+++ b/WebKit/chromium/src/WebDocumentType.cpp
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2010 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 "WebDocumentType.h"
+
+#include "DocumentType.h"
+#include "WebString.h"
+
+#include <wtf/PassRefPtr.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebString WebDocumentType::name() const
+{
+ return WebString(constUnwrap<DocumentType>()->name());
+}
+
+WebDocumentType::WebDocumentType(const PassRefPtr<DocumentType>& elem)
+ : WebNode(elem)
+{
+}
+
+WebDocumentType& WebDocumentType::operator=(const PassRefPtr<DocumentType>& elem)
+{
+ m_private = elem;
+ return *this;
+}
+
+WebDocumentType::operator PassRefPtr<DocumentType>() const
+{
+ return static_cast<DocumentType*>(m_private.get());
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebElement.cpp b/WebKit/chromium/src/WebElement.cpp
index 25a396e..f45cba9 100644
--- a/WebKit/chromium/src/WebElement.cpp
+++ b/WebKit/chromium/src/WebElement.cpp
@@ -36,6 +36,8 @@
#include "RenderObject.h"
#include <wtf/PassRefPtr.h>
+#include "WebNamedNodeMap.h"
+
using namespace WebCore;
namespace WebKit {
@@ -73,6 +75,11 @@ bool WebElement::setAttribute(const WebString& attrName, const WebString& attrVa
return !exceptionCode;
}
+WebNamedNodeMap WebElement::attributes() const
+{
+ return WebNamedNodeMap(m_private->attributes());
+}
+
WebString WebElement::innerText() const
{
return constUnwrap<Element>()->innerText();
diff --git a/WebKit/chromium/src/WebFontDescription.cpp b/WebKit/chromium/src/WebFontDescription.cpp
new file mode 100644
index 0000000..18f6830
--- /dev/null
+++ b/WebKit/chromium/src/WebFontDescription.cpp
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2010 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 "WebFontDescription.h"
+
+#include "FontDescription.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebFontDescription::WebFontDescription(const FontDescription& desc,
+ short fontLetterSpacing, short fontWordSpacing)
+{
+ family = desc.family().family();
+ genericFamily = static_cast<GenericFamily>(desc.genericFamily());
+ size = desc.specifiedSize();
+ italic = desc.italic();
+ smallCaps = desc.smallCaps();
+ weight = static_cast<Weight>(desc.weight());
+ smoothing = static_cast<Smoothing>(desc.fontSmoothing());
+ letterSpacing = fontLetterSpacing;
+ wordSpacing = fontWordSpacing;
+}
+
+WebFontDescription::operator WebCore::FontDescription() const
+{
+ FontFamily fontFamily;
+ fontFamily.setFamily(family);
+
+ FontDescription desc;
+ desc.setFamily(fontFamily);
+ desc.setGenericFamily(static_cast<FontDescription::GenericFamilyType>(genericFamily));
+ desc.setSpecifiedSize(size);
+ desc.setComputedSize(size);
+ desc.setItalic(italic);
+ desc.setSmallCaps(smallCaps);
+ desc.setWeight(static_cast<FontWeight>(weight));
+ desc.setFontSmoothing(static_cast<FontSmoothingMode>(smoothing));
+ return desc;
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebFontImpl.cpp b/WebKit/chromium/src/WebFontImpl.cpp
new file mode 100644
index 0000000..6fa5494
--- /dev/null
+++ b/WebKit/chromium/src/WebFontImpl.cpp
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2010 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 "WebFontImpl.h"
+
+#include "Font.h"
+#include "FontDescription.h"
+#include "GraphicsContext.h"
+#include "PlatformContextSkia.h"
+#include "WebFloatPoint.h"
+#include "WebFloatRect.h"
+#include "WebFontDescription.h"
+#include "WebRect.h"
+#include "WebTextRun.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebFont* WebFont::create(const WebFontDescription& desc)
+{
+ return new WebFontImpl(desc, desc.letterSpacing, desc.wordSpacing);
+}
+
+WebFontImpl::WebFontImpl(const FontDescription& desc, short letterSpacing, short wordSpacing)
+ : m_font(desc, letterSpacing, wordSpacing)
+{
+ m_font.update(0);
+}
+
+WebFontDescription WebFontImpl::fontDescription() const
+{
+ return WebFontDescription(m_font.fontDescription(), m_font.letterSpacing(), m_font.wordSpacing());
+}
+
+int WebFontImpl::ascent() const
+{
+ return m_font.ascent();
+}
+
+int WebFontImpl::descent() const
+{
+ return m_font.descent();
+}
+
+int WebFontImpl::height() const
+{
+ return m_font.height();
+}
+
+int WebFontImpl::lineSpacing() const
+{
+ return m_font.lineSpacing();
+}
+
+float WebFontImpl::xHeight() const
+{
+ return m_font.xHeight();
+}
+
+void WebFontImpl::drawText(WebCanvas* canvas, const WebTextRun& run, const WebFloatPoint& leftBaseline,
+ WebColor color, const WebRect& clip, bool canvasIsOpaque,
+ int from, int to) const
+{
+ // FIXME hook canvasIsOpaque up to the platform-specific indicators for
+ // whether subpixel AA can be used for this draw. On Windows, this is
+ // PlatformContextSkia::setDrawingToImageBuffer.
+#if WEBKIT_USING_CG
+ GraphicsContext gc(canvas);
+#elif WEBKIT_USING_SKIA
+ PlatformContextSkia context(canvas);
+ // PlatformGraphicsContext is actually a pointer to PlatformContextSkia.
+ GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context));
+#else
+ notImplemented();
+#endif
+
+ gc.setFillColor(color, DeviceColorSpace);
+ gc.clip(WebCore::FloatRect(clip));
+ m_font.drawText(&gc, run, leftBaseline, from, to);
+}
+
+int WebFontImpl::calculateWidth(const WebTextRun& run) const
+{
+ return m_font.width(run, 0);
+}
+
+int WebFontImpl::offsetForPosition(const WebTextRun& run, float position) const
+{
+ return m_font.offsetForPosition(run, position, true);
+}
+
+WebFloatRect WebFontImpl::selectionRectForText(const WebTextRun& run, const WebFloatPoint& leftBaseline, int height, int from, int to) const
+{
+ return m_font.selectionRectForText(run, leftBaseline, height, from, to);
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebFontImpl.h b/WebKit/chromium/src/WebFontImpl.h
new file mode 100644
index 0000000..3ac9031
--- /dev/null
+++ b/WebKit/chromium/src/WebFontImpl.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+#ifndef WebFontImpl_h
+#define WebFontImpl_h
+
+#include "Font.h"
+#include "WebFont.h"
+
+namespace WebCore { class FontDescription; }
+
+namespace WebKit {
+
+class WebFontImpl : public WebFont {
+public:
+ WebFontImpl(const WebCore::FontDescription&, short letterSpacing, short wordSpacing);
+
+ virtual WebFontDescription fontDescription() const;
+
+ virtual int ascent() const;
+ virtual int descent() const;
+ virtual int height() const;
+ virtual int lineSpacing() const;
+ virtual float xHeight() const;
+
+ virtual void drawText(WebCanvas*, const WebTextRun&, const WebFloatPoint& leftBaseline, WebColor,
+ const WebRect& clip, bool canvasIsOpaque, int from = 0, int to = -1) const;
+ virtual int calculateWidth(const WebTextRun&) const;
+ virtual int offsetForPosition(const WebTextRun&, float position) const;
+ virtual WebFloatRect selectionRectForText(const WebTextRun&, const WebFloatPoint& leftBaseline,
+ int height, int from = 0, int to = -1) const;
+
+private:
+ WebCore::Font m_font;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/src/WebInputEventConversion.cpp b/WebKit/chromium/src/WebInputEventConversion.cpp
index f68e3ab..1c6d59c 100644
--- a/WebKit/chromium/src/WebInputEventConversion.cpp
+++ b/WebKit/chromium/src/WebInputEventConversion.cpp
@@ -241,7 +241,7 @@ static int getWebInputModifiers(const UIEventWithKeyState& event)
return modifiers;
}
-WebMouseEventBuilder::WebMouseEventBuilder(const ScrollView* view, const MouseEvent& event)
+WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const MouseEvent& event)
{
if (event.type() == eventNames().mousemoveEvent)
type = WebInputEvent::MouseMove;
@@ -253,6 +253,8 @@ WebMouseEventBuilder::WebMouseEventBuilder(const ScrollView* view, const MouseEv
type = WebInputEvent::MouseDown;
else if (event.type() == eventNames().mouseupEvent)
type = WebInputEvent::MouseUp;
+ else if (event.type() == eventNames().contextmenuEvent)
+ type = WebInputEvent::ContextMenu;
else
return; // Skip all other mouse events.
timeStampSeconds = event.timeStamp() * 1.0e-3;
@@ -281,30 +283,34 @@ WebMouseEventBuilder::WebMouseEventBuilder(const ScrollView* view, const MouseEv
break;
}
}
- IntPoint p = view->contentsToWindow(IntPoint(event.pageX(), event.pageY()));
+ ScrollView* view = widget->parent();
+ IntPoint p = view->contentsToWindow(
+ IntPoint(event.absoluteLocation().x(), event.absoluteLocation().y()));
globalX = event.screenX();
globalY = event.screenY();
windowX = p.x();
windowY = p.y();
- x = event.offsetX();
- y = event.offsetY();
+ x = event.absoluteLocation().x() - widget->pos().x();
+ y = event.absoluteLocation().y() - widget->pos().y();
clickCount = event.detail();
}
-WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(const ScrollView* view, const WheelEvent& event)
+WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(const Widget* widget, const WheelEvent& event)
{
if (event.type() != eventNames().mousewheelEvent)
return;
type = WebInputEvent::MouseWheel;
timeStampSeconds = event.timeStamp() * 1.0e-3;
modifiers = getWebInputModifiers(event);
- IntPoint p = view->contentsToWindow(IntPoint(event.pageX(), event.pageY()));
+ ScrollView* view = widget->parent();
+ IntPoint p = view->contentsToWindow(
+ IntPoint(event.absoluteLocation().x(), event.absoluteLocation().y()));
globalX = event.screenX();
globalY = event.screenY();
windowX = p.x();
windowY = p.y();
- x = event.offsetX();
- y = event.offsetY();
+ x = event.absoluteLocation().x() - widget->pos().x();
+ y = event.absoluteLocation().y() - widget->pos().y();
deltaX = static_cast<float>(event.rawDeltaX());
deltaY = static_cast<float>(event.rawDeltaY());
// The 120 is from WheelEvent::initWheelEvent().
diff --git a/WebKit/chromium/src/WebInputEventConversion.h b/WebKit/chromium/src/WebInputEventConversion.h
index dc5db35..63991a9 100644
--- a/WebKit/chromium/src/WebInputEventConversion.h
+++ b/WebKit/chromium/src/WebInputEventConversion.h
@@ -91,14 +91,14 @@ public:
// be set to Undefined.
class WebMouseEventBuilder : public WebMouseEvent {
public:
- WebMouseEventBuilder(const WebCore::ScrollView*, const WebCore::MouseEvent&);
+ WebMouseEventBuilder(const WebCore::Widget*, const WebCore::MouseEvent&);
};
// Converts a WebCore::WheelEvent to a corresponding WebMouseWheelEvent.
// If the event mapping fails, the event type will be set to Undefined.
class WebMouseWheelEventBuilder : public WebMouseWheelEvent {
public:
- WebMouseWheelEventBuilder(const WebCore::ScrollView*, const WebCore::WheelEvent&);
+ WebMouseWheelEventBuilder(const WebCore::Widget*, const WebCore::WheelEvent&);
};
// Converts a WebCore::KeyboardEvent to a corresponding WebKeyboardEvent.
diff --git a/WebKit/chromium/src/WebNamedNodeMap.cpp b/WebKit/chromium/src/WebNamedNodeMap.cpp
new file mode 100644
index 0000000..e2455e6
--- /dev/null
+++ b/WebKit/chromium/src/WebNamedNodeMap.cpp
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2010 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 "WebNamedNodeMap.h"
+
+#include "NamedNodeMap.h"
+#include "Node.h"
+#include "WebAttribute.h"
+#include "WebNode.h"
+#include <wtf/PassRefPtr.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+void WebNamedNodeMap::reset()
+{
+ m_private.reset();
+}
+
+void WebNamedNodeMap::assign(const WebNamedNodeMap& other)
+{
+ m_private = other.m_private;
+}
+
+WebNamedNodeMap::WebNamedNodeMap(const PassRefPtr<NamedNodeMap>& other)
+ : m_private(other)
+{
+}
+
+unsigned WebNamedNodeMap::length() const
+{
+ return m_private->length();
+}
+
+WebAttribute WebNamedNodeMap::attributeItem(unsigned index) const
+{
+ return WebAttribute(m_private->attributeItem(index));
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebPluginContainerImpl.cpp b/WebKit/chromium/src/WebPluginContainerImpl.cpp
index e24e372..7f74db2 100644
--- a/WebKit/chromium/src/WebPluginContainerImpl.cpp
+++ b/WebKit/chromium/src/WebPluginContainerImpl.cpp
@@ -403,7 +403,7 @@ void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event)
// in the call to HandleEvent. See http://b/issue?id=1362948
FrameView* parentView = static_cast<FrameView*>(parent());
- WebMouseEventBuilder webEvent(parentView, *event);
+ WebMouseEventBuilder webEvent(this, *event);
if (webEvent.type == WebInputEvent::Undefined)
return;
@@ -433,8 +433,7 @@ void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event)
void WebPluginContainerImpl::handleWheelEvent(WheelEvent* event)
{
- FrameView* parentView = static_cast<FrameView*>(parent());
- WebMouseWheelEventBuilder webEvent(parentView, *event);
+ WebMouseWheelEventBuilder webEvent(this, *event);
if (webEvent.type == WebInputEvent::Undefined)
return;
diff --git a/WebKit/chromium/src/WebSecurityPolicy.cpp b/WebKit/chromium/src/WebSecurityPolicy.cpp
index 4b2b557..58d0893 100644
--- a/WebKit/chromium/src/WebSecurityPolicy.cpp
+++ b/WebKit/chromium/src/WebSecurityPolicy.cpp
@@ -32,6 +32,7 @@
#include "WebSecurityPolicy.h"
#include "FrameLoader.h"
+#include "SchemeRegistry.h"
#include "SecurityOrigin.h"
#include "WebString.h"
@@ -43,17 +44,17 @@ namespace WebKit {
void WebSecurityPolicy::registerURLSchemeAsLocal(const WebString& scheme)
{
- SecurityOrigin::registerURLSchemeAsLocal(scheme);
+ SchemeRegistry::registerURLSchemeAsLocal(scheme);
}
void WebSecurityPolicy::registerURLSchemeAsNoAccess(const WebString& scheme)
{
- SecurityOrigin::registerURLSchemeAsNoAccess(scheme);
+ SchemeRegistry::registerURLSchemeAsNoAccess(scheme);
}
void WebSecurityPolicy::registerURLSchemeAsSecure(const WebString& scheme)
{
- SecurityOrigin::registerURLSchemeAsSecure(scheme);
+ SchemeRegistry::registerURLSchemeAsSecure(scheme);
}
void WebSecurityPolicy::addOriginAccessWhitelistEntry(
diff --git a/WebKit/chromium/src/WebSettingsImpl.cpp b/WebKit/chromium/src/WebSettingsImpl.cpp
index 6a02ed6..6569e2e 100644
--- a/WebKit/chromium/src/WebSettingsImpl.cpp
+++ b/WebKit/chromium/src/WebSettingsImpl.cpp
@@ -279,6 +279,11 @@ void WebSettingsImpl::setAcceleratedCompositingEnabled(bool enabled)
m_settings->setAcceleratedCompositingEnabled(enabled);
}
+void WebSettingsImpl::setAccelerated2dCanvasEnabled(bool enabled)
+{
+ m_settings->setAccelerated2dCanvasEnabled(enabled);
+}
+
void WebSettingsImpl::setHTML5ParserEnabled(bool enabled)
{
m_settings->setHTML5ParserEnabled(enabled);
diff --git a/WebKit/chromium/src/WebSettingsImpl.h b/WebKit/chromium/src/WebSettingsImpl.h
index fe5db51..9eedba8 100644
--- a/WebKit/chromium/src/WebSettingsImpl.h
+++ b/WebKit/chromium/src/WebSettingsImpl.h
@@ -87,6 +87,7 @@ public:
virtual void setShowDebugBorders(bool);
virtual void setEditingBehavior(EditingBehavior);
virtual void setAcceleratedCompositingEnabled(bool);
+ virtual void setAccelerated2dCanvasEnabled(bool);
virtual void setHTML5ParserEnabled(bool);
virtual void setMemoryInfoEnabled(bool);
diff --git a/WebCore/page/SpeechInputClientListener.h b/WebKit/chromium/src/WebTextRun.cpp
index a9a897e..58d9fac 100644
--- a/WebCore/page/SpeechInputClientListener.h
+++ b/WebKit/chromium/src/WebTextRun.cpp
@@ -28,27 +28,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SpeechInputClientListener_h
-#define SpeechInputClientListener_h
+#include "config.h"
+#include "WebTextRun.h"
-#if ENABLE(INPUT_SPEECH)
+#include "TextRun.h"
-namespace WebCore {
+using namespace WebCore;
-class String;
+namespace WebKit {
-// Provides an interface for the embedder to call into WebCore.
-class SpeechInputClientListener {
-public:
- virtual void recordingComplete() = 0;
- virtual void setRecognitionResult(const String& result) = 0;
+WebTextRun::operator WebCore::TextRun() const
+{
+ return TextRun(text, false, 0, 0, rtl, directionalOverride);
+}
-protected:
- virtual ~SpeechInputClientListener() { }
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INPUT_SPEECH)
-
-#endif // SpeechInputClientListener_h
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index 83c8822..bb6d07c 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -258,6 +258,9 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools
, m_layerRenderer(0)
, m_isAcceleratedCompositingActive(false)
#endif
+#if ENABLE(INPUT_SPEECH)
+ , m_speechInputClient(client)
+#endif
, m_gles2Context(0)
{
// WebKit/win/WebView.cpp does the same thing, except they call the
@@ -272,7 +275,16 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools
if (devToolsClient)
m_devToolsAgent = new WebDevToolsAgentImpl(this, devToolsClient);
- m_page.set(new Page(&m_chromeClientImpl, &m_contextMenuClientImpl, &m_editorClientImpl, &m_dragClientImpl, &m_inspectorClientImpl, 0, 0, 0, 0));
+ Page::PageClients pageClients;
+ pageClients.chromeClient = &m_chromeClientImpl;
+ pageClients.contextMenuClient = &m_contextMenuClientImpl;
+ pageClients.editorClient = &m_editorClientImpl;
+ pageClients.dragClient = &m_dragClientImpl;
+ pageClients.inspectorClient = &m_inspectorClientImpl;
+#if ENABLE(INPUT_SPEECH)
+ pageClients.speechInputClient = &m_speechInputClient;
+#endif
+ m_page.set(new Page(pageClients));
// the page will take ownership of the various clients
@@ -489,10 +501,10 @@ void WebViewImpl::mouseUp(const WebMouseEvent& event)
#endif
}
-void WebViewImpl::mouseWheel(const WebMouseWheelEvent& event)
+bool WebViewImpl::mouseWheel(const WebMouseWheelEvent& event)
{
PlatformWheelEventBuilder platformEvent(mainFrameImpl()->frameView(), event);
- mainFrameImpl()->frame()->eventHandler()->handleWheelEvent(platformEvent);
+ return mainFrameImpl()->frame()->eventHandler()->handleWheelEvent(platformEvent);
}
bool WebViewImpl::keyEvent(const WebKeyboardEvent& event)
@@ -1018,7 +1030,7 @@ bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent)
break;
case WebInputEvent::MouseWheel:
- mouseWheel(*static_cast<const WebMouseWheelEvent*>(&inputEvent));
+ handled = mouseWheel(*static_cast<const WebMouseWheelEvent*>(&inputEvent));
break;
case WebInputEvent::MouseDown:
@@ -1731,16 +1743,18 @@ void WebViewImpl::applyAutoFillSuggestions(
const WebNode& node,
const WebVector<WebString>& names,
const WebVector<WebString>& labels,
+ const WebVector<int>& uniqueIDs,
int separatorIndex)
{
- WebVector<int> uniqueIDs(names.size());
- applyAutoFillSuggestions(node, names, labels, uniqueIDs, separatorIndex);
+ WebVector<WebString> icons(names.size());
+ applyAutoFillSuggestions(node, names, labels, icons, uniqueIDs, separatorIndex);
}
void WebViewImpl::applyAutoFillSuggestions(
const WebNode& node,
const WebVector<WebString>& names,
const WebVector<WebString>& labels,
+ const WebVector<WebString>& icons,
const WebVector<int>& uniqueIDs,
int separatorIndex)
{
@@ -1771,7 +1785,7 @@ void WebViewImpl::applyAutoFillSuggestions(
m_autoFillPopupClient.set(new AutoFillPopupMenuClient);
m_autoFillPopupClient->initialize(
- inputElem, names, labels, uniqueIDs, separatorIndex);
+ inputElem, names, labels, icons, uniqueIDs, separatorIndex);
if (!m_autoFillPopup.get()) {
m_autoFillPopup = PopupContainer::create(m_autoFillPopupClient.get(),
@@ -1781,7 +1795,7 @@ void WebViewImpl::applyAutoFillSuggestions(
if (m_autoFillPopupShowing) {
m_autoFillPopupClient->setSuggestions(
- names, labels, uniqueIDs, separatorIndex);
+ names, labels, icons, uniqueIDs, separatorIndex);
refreshAutoFillPopup();
} else {
m_autoFillPopup->show(focusedNode->getRect(),
@@ -1803,12 +1817,13 @@ void WebViewImpl::applyAutocompleteSuggestions(
{
WebVector<WebString> names(suggestions.size());
WebVector<WebString> labels(suggestions.size());
+ WebVector<WebString> icons(suggestions.size());
WebVector<int> uniqueIDs(suggestions.size());
for (size_t i = 0; i < suggestions.size(); ++i)
names[i] = suggestions[i];
- applyAutoFillSuggestions(node, names, labels, uniqueIDs, -1);
+ applyAutoFillSuggestions(node, names, labels, icons, uniqueIDs, -1);
if (m_autoFillPopupClient)
m_autoFillPopupClient->setAutocompleteMode(true);
}
diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h
index 312f20f..530fbf5 100644
--- a/WebKit/chromium/src/WebViewImpl.h
+++ b/WebKit/chromium/src/WebViewImpl.h
@@ -47,6 +47,7 @@
#include "InspectorClientImpl.h"
#include "LayerRendererChromium.h"
#include "NotificationPresenterImpl.h"
+#include "SpeechInputClientImpl.h"
#include <wtf/OwnPtr.h>
#include <wtf/RefCounted.h>
@@ -170,11 +171,13 @@ public:
const WebNode&,
const WebVector<WebString>& names,
const WebVector<WebString>& labels,
+ const WebVector<int>& uniqueIDs,
int separatorIndex);
virtual void applyAutoFillSuggestions(
const WebNode&,
const WebVector<WebString>& names,
const WebVector<WebString>& labels,
+ const WebVector<WebString>& icons,
const WebVector<int>& uniqueIDs,
int separatorIndex);
// DEPRECATED: replacing with applyAutoFillSuggestions.
@@ -239,7 +242,7 @@ public:
void mouseUp(const WebMouseEvent&);
void mouseContextMenu(const WebMouseEvent&);
void mouseDoubleClick(const WebMouseEvent&);
- void mouseWheel(const WebMouseWheelEvent&);
+ bool mouseWheel(const WebMouseWheelEvent&);
bool keyEvent(const WebKeyboardEvent&);
bool charEvent(const WebKeyboardEvent&);
bool touchEvent(const WebTouchEvent&);
@@ -511,6 +514,10 @@ private:
#endif
static const WebInputEvent* m_currentInputEvent;
+#if ENABLE(INPUT_SPEECH)
+ SpeechInputClientImpl m_speechInputClient;
+#endif
+
OwnPtr<WebGLES2Context> m_gles2Context;
};
diff --git a/WebKit/chromium/src/js/DebuggerScript.js b/WebKit/chromium/src/js/DebuggerScript.js
index 7181d74..51787f6 100644
--- a/WebKit/chromium/src/js/DebuggerScript.js
+++ b/WebKit/chromium/src/js/DebuggerScript.js
@@ -32,6 +32,7 @@
var DebuggerScript = {};
DebuggerScript._breakpoints = {};
+DebuggerScript._breakpointsActivated = true;
DebuggerScript.PauseOnExceptionsState = {
DontPauseOnExceptions : 0,
@@ -82,7 +83,7 @@ DebuggerScript._formatScript = function(script)
scriptWorldType = DebuggerScript.ScriptWorldType.ExtensionsWorld;
return {
id: script.id,
- name: script.name,
+ name: script.nameOrSourceURL(),
source: script.source,
lineOffset: DebuggerScript._v8ToWebkitLineNumber(script.line_offset),
lineCount: script.lineCount(),
@@ -94,7 +95,7 @@ DebuggerScript.setBreakpoint = function(execState, args)
{
args.lineNumber = DebuggerScript._webkitToV8LineNumber(args.lineNumber);
var breakId = Debug.setScriptBreakPointById(args.scriptId, args.lineNumber, 0 /* column */, args.condition);
- if (!args.enabled)
+ if (!args.enabled || !DebuggerScript._breakpointsActivated)
Debug.disableScriptBreakPoint(breakId);
var locations = Debug.findBreakPointActualLocations(breakId);
@@ -204,6 +205,7 @@ DebuggerScript.setBreakpointsActivated = function(execState, args)
else
Debug.disableScriptBreakPoint(breakId);
}
+ DebuggerScript._breakpointsActivated = args.enabled;
}
DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame)
diff --git a/WebKit/chromium/src/js/DevTools.js b/WebKit/chromium/src/js/DevTools.js
index 35cca2f..640474b 100644
--- a/WebKit/chromium/src/js/DevTools.js
+++ b/WebKit/chromium/src/js/DevTools.js
@@ -93,7 +93,7 @@ devtools.ToolsAgent.prototype.getProfilerAgent = function()
*/
devtools.ToolsAgent.prototype.dispatchOnClient_ = function(message)
{
- var args = JSON.parse(message);
+ var args = typeof message === "string" ? JSON.parse(message) : message;
var methodName = args[0];
var parameters = args.slice(1);
WebInspector[methodName].apply(WebInspector, parameters);
@@ -129,6 +129,28 @@ devtools.tools = null;
var context = {}; // Used by WebCore's inspector routines.
+(function() {
+ WebInspector._paramsObject = {};
+
+ var queryParams = window.location.search;
+ if (queryParams) {
+ var params = queryParams.substring(1).split("&");
+ for (var i = 0; i < params.length; ++i) {
+ var pair = params[i].split("=");
+ WebInspector._paramsObject[pair[0]] = pair[1];
+ }
+ }
+ if ("page" in WebInspector._paramsObject) {
+ WebInspector.socket = new WebSocket("ws://" + window.location.host + "/devtools/page/" + WebInspector._paramsObject.page);
+ WebInspector.socket.onmessage = function(message) { eval(message.data); }
+ WebInspector.socket.onerror = function(error) { console.err(error); }
+ WebInspector.socket.onopen = function() {
+ WebInspector.socketOpened = true;
+ if (WebInspector.loadedDone)
+ WebInspector.doLoadedDone();
+ };
+ }
+})();
///////////////////////////////////////////////////////////////////////////////
// Here and below are overrides to existing WebInspector methods only.
// TODO(pfeldman): Patch WebCore and upstream changes.
@@ -145,25 +167,25 @@ WebInspector.loaded = function()
Preferences.canEditScriptSource = true;
Preferences.appCacheEnabled = false;
- oldLoaded.call(this);
+ if ("page" in WebInspector._paramsObject) {
+ WebInspector.loadedDone = true;
+ if (WebInspector.socketOpened)
+ WebInspector.doLoadedDone();
+ return;
+ }
+ WebInspector.doLoadedDone();
+}
+WebInspector.doLoadedDone = function() {
+ oldLoaded.call(this);
InspectorFrontendHost.loaded();
-};
+}
devtools.domContentLoaded = function()
{
- var queryParams = window.location.search;
- if (queryParams) {
- var params = queryParams.substring(1).split("&");
- var paramsObject = {};
- for (var i = 0; i < params.length; ++i) {
- var pair = params[i].split("=");
- paramsObject[pair[0]] = pair[1];
- }
- WebInspector.setAttachedWindow(paramsObject.docked === "true");
- if (paramsObject.toolbar_color && paramsObject.text_color)
- WebInspector.setToolbarColors(paramsObject.toolbar_color, paramsObject.text_color);
- }
+ WebInspector.setAttachedWindow(WebInspector._paramsObject.docked === "true");
+ if (WebInspector._paramsObject.toolbar_color && WebInspector._paramsObject.text_color)
+ WebInspector.setToolbarColors(WebInspector._paramsObject.toolbar_color, WebInspector._paramsObject.text_color);
}
document.addEventListener("DOMContentLoaded", devtools.domContentLoaded, false);
@@ -275,3 +297,10 @@ WebInspector.resetToolbarColors = function()
if (window.RemoteDebuggerAgent) {
RemoteDebuggerAgent.setContextId = function() {};
}
+
+
+// Support for pause while renderer is busy (is dispatched on IO thread).
+InspectorBackend.pause = function()
+{
+ RemoteDebuggerCommandExecutor.DebuggerPauseScript();
+};
diff --git a/WebKit/chromium/src/js/DevToolsHostStub.js b/WebKit/chromium/src/js/DevToolsHostStub.js
index a2f356f..52b28bb 100644
--- a/WebKit/chromium/src/js/DevToolsHostStub.js
+++ b/WebKit/chromium/src/js/DevToolsHostStub.js
@@ -37,7 +37,6 @@ if (!window["RemoteDebuggerCommandExecutor"]) {
window["RemoteDebuggerCommandExecutor"] = {};
window["RemoteProfilerAgent"] = {};
window["RemoteToolsAgent"] = {
- dispatchOnInjectedScript: function() {},
dispatchOnInspectorController: function() {}
};
}
diff --git a/WebKit/chromium/src/js/InspectorControllerImpl.js b/WebKit/chromium/src/js/InspectorControllerImpl.js
deleted file mode 100644
index 5ed506a..0000000
--- a/WebKit/chromium/src/js/InspectorControllerImpl.js
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-/**
- * @fileoverview DevTools' implementation of the InspectorController API.
- */
-
-if (!this.devtools)
- devtools = {};
-
-devtools.InspectorBackendImpl = function()
-{
- WebInspector.InspectorBackendStub.call(this);
- this.installInspectorControllerDelegate_("addInspectedNode");
- this.installInspectorControllerDelegate_("addScriptToEvaluateOnLoad");
- this.installInspectorControllerDelegate_("changeTagName");
- this.installInspectorControllerDelegate_("clearConsoleMessages");
- this.installInspectorControllerDelegate_("copyNode");
- this.installInspectorControllerDelegate_("deleteCookie");
- this.installInspectorControllerDelegate_("didEvaluateForTestInFrontend");
- this.installInspectorControllerDelegate_("disableMonitoringXHR");
- this.installInspectorControllerDelegate_("disableResourceTracking");
- this.installInspectorControllerDelegate_("disableSearchingForNode");
- this.installInspectorControllerDelegate_("disableTimeline");
- this.installInspectorControllerDelegate_("enableMonitoringXHR");
- this.installInspectorControllerDelegate_("enableResourceTracking");
- this.installInspectorControllerDelegate_("enableSearchingForNode");
- this.installInspectorControllerDelegate_("enableTimeline");
- this.installInspectorControllerDelegate_("getChildNodes");
- this.installInspectorControllerDelegate_("getCookies");
- this.installInspectorControllerDelegate_("getDatabaseTableNames");
- this.installInspectorControllerDelegate_("getDOMStorageEntries");
- this.installInspectorControllerDelegate_("getEventListenersForNode");
- this.installInspectorControllerDelegate_("getOuterHTML");
- this.installInspectorControllerDelegate_("getProfile");
- this.installInspectorControllerDelegate_("getProfileHeaders");
- this.installInspectorControllerDelegate_("removeProfile");
- this.installInspectorControllerDelegate_("clearProfiles");
- this.installInspectorControllerDelegate_("getResourceContent");
- this.installInspectorControllerDelegate_("highlightDOMNode");
- this.installInspectorControllerDelegate_("hideDOMNodeHighlight");
- this.installInspectorControllerDelegate_("performSearch");
- this.installInspectorControllerDelegate_("pushNodeByPathToFrontend");
- this.installInspectorControllerDelegate_("releaseWrapperObjectGroup");
- this.installInspectorControllerDelegate_("removeAllScriptsToEvaluateOnLoad");
- this.installInspectorControllerDelegate_("reloadPage");
- this.installInspectorControllerDelegate_("removeAttribute");
- this.installInspectorControllerDelegate_("removeDOMStorageItem");
- this.installInspectorControllerDelegate_("removeNode");
- this.installInspectorControllerDelegate_("saveApplicationSettings");
- this.installInspectorControllerDelegate_("saveSessionSettings");
- this.installInspectorControllerDelegate_("searchCanceled");
- this.installInspectorControllerDelegate_("setAttribute");
- this.installInspectorControllerDelegate_("setDOMStorageItem");
- this.installInspectorControllerDelegate_("setInjectedScriptSource");
- this.installInspectorControllerDelegate_("setOuterHTML");
- this.installInspectorControllerDelegate_("setTextNodeValue");
- this.installInspectorControllerDelegate_("startProfiling");
- this.installInspectorControllerDelegate_("startTimelineProfiler");
- this.installInspectorControllerDelegate_("stopProfiling");
- this.installInspectorControllerDelegate_("stopTimelineProfiler");
- this.installInspectorControllerDelegate_("storeLastActivePanel");
- this.installInspectorControllerDelegate_("takeHeapSnapshot");
-
- this.installInspectorControllerDelegate_("getAllStyles");
- this.installInspectorControllerDelegate_("getStyles");
- this.installInspectorControllerDelegate_("getComputedStyle");
- this.installInspectorControllerDelegate_("getInlineStyle");
- this.installInspectorControllerDelegate_("getStyleSheet");
- this.installInspectorControllerDelegate_("getRuleRangesForStyleSheetId");
- this.installInspectorControllerDelegate_("applyStyleText");
- this.installInspectorControllerDelegate_("setStyleText");
- this.installInspectorControllerDelegate_("setStyleProperty");
- this.installInspectorControllerDelegate_("toggleStyleEnabled");
- this.installInspectorControllerDelegate_("setRuleSelector");
- this.installInspectorControllerDelegate_("addRule");
-
- this.installInspectorControllerDelegate_("disableDebugger");
- this.installInspectorControllerDelegate_("editScriptSource");
- this.installInspectorControllerDelegate_("getScriptSource");
- this.installInspectorControllerDelegate_("enableDebugger");
- this.installInspectorControllerDelegate_("setBreakpoint");
- this.installInspectorControllerDelegate_("removeBreakpoint");
- this.installInspectorControllerDelegate_("activateBreakpoints");
- this.installInspectorControllerDelegate_("deactivateBreakpoints");
- this.installInspectorControllerDelegate_("resume");
- this.installInspectorControllerDelegate_("stepIntoStatement");
- this.installInspectorControllerDelegate_("stepOutOfFunction");
- this.installInspectorControllerDelegate_("stepOverStatement");
- this.installInspectorControllerDelegate_("setPauseOnExceptionsState");
-};
-devtools.InspectorBackendImpl.prototype.__proto__ = WebInspector.InspectorBackendStub.prototype;
-
-
-devtools.InspectorBackendImpl.prototype.pause = function()
-{
- RemoteDebuggerCommandExecutor.DebuggerPauseScript();
-};
-
-
-/**
- * @override
- */
-devtools.InspectorBackendImpl.prototype.dispatchOnInjectedScript = function(callId, injectedScriptId, methodName, argsString, async)
-{
- // Encode injectedScriptId into callId
- if (typeof injectedScriptId !== "number")
- injectedScriptId = 0;
- RemoteToolsAgent.dispatchOnInjectedScript(callId, injectedScriptId, methodName, argsString, async);
-};
-
-
-/**
- * Installs delegating handler into the inspector controller.
- * @param {string} methodName Method to install delegating handler for.
- */
-devtools.InspectorBackendImpl.prototype.installInspectorControllerDelegate_ = function(methodName)
-{
- this[methodName] = this.callInspectorController_.bind(this, methodName);
-};
-
-
-/**
- * Bound function with the installInjectedScriptDelegate_ actual
- * implementation.
- */
-devtools.InspectorBackendImpl.prototype.callInspectorController_ = function(methodName, var_arg)
-{
- var args = Array.prototype.slice.call(arguments, 1);
- RemoteToolsAgent.dispatchOnInspectorController(WebInspector.Callback.wrap(function(){}), methodName, JSON.stringify(args));
-};
-
-
-InspectorBackend = new devtools.InspectorBackendImpl();
diff --git a/WebKit/chromium/tests/PopupMenuTest.cpp b/WebKit/chromium/tests/PopupMenuTest.cpp
index 9aad6bb..44b262d 100644
--- a/WebKit/chromium/tests/PopupMenuTest.cpp
+++ b/WebKit/chromium/tests/PopupMenuTest.cpp
@@ -69,6 +69,7 @@ public:
return str;
}
virtual String itemLabel(unsigned) const { return String(); }
+ virtual String itemIcon(unsigned) const { return String(); }
virtual String itemToolTip(unsigned listIndex) const { return itemText(listIndex); }
virtual String itemAccessibilityText(unsigned listIndex) const { return itemText(listIndex); }
virtual bool itemIsEnabled(unsigned listIndex) const { return true; }
diff --git a/WebKit/CMakeListsEfl.txt b/WebKit/efl/CMakeListsEfl.txt
index ee67d71..0701d22 100644
--- a/WebKit/CMakeListsEfl.txt
+++ b/WebKit/efl/CMakeListsEfl.txt
@@ -15,9 +15,6 @@ LIST(APPEND WebKit_INCLUDE_DIRECTORIES
${EDJE_INCLUDE_DIRS}
${EFLDEPS_INCLUDE_DIRS}
${EVAS_INCLUDE_DIRS}
- ${Gdk_INCLUDE_DIRS}
- ${Glib_INCLUDE_DIRS}
- ${LIBSOUP24_INCLUDE_DIRS}
${LIBXML2_INCLUDE_DIRS}
${LIBXSLT_INCLUDE_DIRS}
${SQLITE_INCLUDE_DIRS}
@@ -48,15 +45,32 @@ LIST(APPEND WebKit_LIBRARIES
${ECORE_X_LIBRARIES}
${EFLDEPS_LIBRARIES}
${Freetype_LIBRARIES}
- ${Gdk_LIBRARIES}
- ${Glib_LIBRARIES}
- ${Gtk_LIBRARIES}
- ${LIBSOUP24_LIBRARIES}
${LIBXML2_LIBRARIES}
${Pango_LIBRARIES}
${SQLITE_LIBRARIES}
)
+IF (ENABLE_GLIB_SUPPORT)
+ LIST(APPEND WebKit_INCLUDE_DIRECTORIES
+ ${Gdk_INCLUDE_DIRS}
+ ${Glib_INCLUDE_DIRS}
+ )
+ LIST(APPEND WebKit_LIBRARIES
+ ${Glib_LIBRARIES}
+ ${Gdk_LIBRARIES}
+ )
+ENDIF ()
+
+IF (WTF_USE_SOUP)
+ LIST(APPEND WebKit_INCLUDE_DIRECTORIES ${LIBSOUP24_INCLUDE_DIRS})
+ LIST(APPEND WebKit_LIBRARIES ${LIBSOUP24_LIBRARIES})
+ENDIF ()
+
+IF (WTF_USE_CURL)
+ LIST(APPEND WebKit_INCLUDE_DIRECTORIES ${CURL_INCLUDE_DIRS})
+ LIST(APPEND WebKit_LIBRARIES ${CURL_LIBRARIES})
+ENDIF ()
+
FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/WebKit/efl/DefaultTheme)
GENERATE_EDJ(
${WEBKIT_DIR}/efl/DefaultTheme/default.edc
@@ -78,9 +92,6 @@ SET(EWebLauncher_LIBRARIES
${EDJE_LIBRARIES}
${EFLDEPS_LIBRARIES}
${EVAS_LIBRARIES}
- ${Gdk_LIBRARIES}
- ${Glib_LIBRARIES}
- ${LIBSOUP24_LIBRARIES}
${LIBXML2_LIBRARIES}
${LIBXSLT_LIBRARIES}
${SQLITE_LIBRARIES}
@@ -91,9 +102,26 @@ SET(EWebLauncher_LINK_FLAGS
${EDJE_LDFLAGS}
${EFLDEPS_LDFLAGS}
${EVAS_LDFLAGS}
- ${LIBSOUP24_LDFLAGS}
)
+IF (ENABLE_GLIB_SUPPORT)
+ LIST(APPEND EWebLauncher_LIBRARIES
+ ${Gdk_LIBRARIES}
+ ${Glib_LIBRARIES}
+ ${GTHREAD_LIBRARIES}
+ )
+ENDIF ()
+
+IF (WTF_USE_SOUP)
+ LIST(APPEND EWebLauncher_LIBRARIES ${LIBSOUP24_LIBRARIES})
+ LIST(APPEND EWebLauncher_LINK_FLAGS ${LIBSOUP24_LDFLAGS})
+ENDIF ()
+
+IF (WTF_USE_CURL)
+ LIST(APPEND EWebLauncher_LIBRARIES ${CURL_LIBRARIES})
+ LIST(APPEND EWebLauncher_LINK_FLAGS ${CURL_LDFLAGS})
+ENDIF ()
+
ADD_EXECUTABLE(../Programs/EWebLauncher ${EWebLauncher_SOURCES})
TARGET_LINK_LIBRARIES(../Programs/EWebLauncher ${EWebLauncher_LIBRARIES})
ADD_TARGET_PROPERTIES(../Programs/EWebLauncher LINK_FLAGS "${EWebLauncher_LINK_FLAGS}")
diff --git a/WebKit/efl/ChangeLog b/WebKit/efl/ChangeLog
index b5ad1d7..ad44392 100644
--- a/WebKit/efl/ChangeLog
+++ b/WebKit/efl/ChangeLog
@@ -1,3 +1,95 @@
+2010-07-26 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Page clients should be passed to Page constructor via structure of pointers
+ https://bugs.webkit.org/show_bug.cgi?id=42834
+
+ * ewk/ewk_view.cpp:
+ (_ewk_view_priv_new):
+
+2010-07-26 Rafael Antognolli <antognolli@profusion.mobi>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Move CMakeListsEfl.txt to WebKit/efl/
+ https://bugs.webkit.org/show_bug.cgi?id=43002
+
+ This should reduce the noise in WebKit/ChangeLog that comes from EFL
+ port. Most of the changes on EFL port should be logged in
+ WebKit/efl/ChangeLog.
+
+ * CMakeListsEfl.txt: Renamed from WebKit/CMakeListsEfl.txt.
+
+2010-07-23 Rafael Antognolli <antognolli@profusion.mobi>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Cleanup glib support (make it optional)
+ https://bugs.webkit.org/show_bug.cgi?id=42480
+
+ Put some ifdefs on glib calls.
+
+ * ewk/ewk_main.cpp:
+ (ewk_init):
+
+2010-07-23 Rafael Antognolli <antognolli@profusion.mobi>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Add support for using libcurl network backend.
+ https://bugs.webkit.org/show_bug.cgi?id=42286
+
+ Put some ifdefs around soup calls.
+
+ * ewk/ewk_cookies.cpp:
+ (ewk_cookies_file_set):
+ (ewk_cookies_clear):
+ (ewk_cookies_get_all):
+ (ewk_cookies_cookie_del):
+ (ewk_cookies_cookie_free):
+ (ewk_cookies_policy_set):
+ (ewk_cookies_policy_get):
+ * ewk/ewk_main.cpp:
+ (ewk_init):
+
+2010-07-23 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Notify browser when window shall be closed.
+
+ This is used for window.close() events Javascript, though it would be
+ triggered for any event on WebCore that might ask for the window to be
+ closed.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42890
+
+ * WebCoreSupport/ChromeClientEfl.cpp:
+ (WebCore::ChromeClientEfl::closeWindowSoon): call new function and moves its
+ previous functionality there.
+ * ewk/ewk_private.h:
+ * ewk/ewk_view.cpp:
+ (ewk_view_window_close): stop all loaders as was being done previously and
+ notify browser afterwards.
+ * ewk/ewk_view.h: declare new virtual method.
+
+2010-07-23 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [EFL] Set proxy address for Soup
+ https://bugs.webkit.org/show_bug.cgi?id=42721
+
+ Sets the given proxy URI for libsoup network backend. This method will
+ support libcurl network backend later.
+
+ * EWebLauncher/main.c:
+ (main): Invoke proxy set method
+ * ewk/ewk_settings.cpp:
+ (ewk_settings_proxy_uri_set): Sets proxy URI.
+ * ewk/ewk_settings.h:
+
2010-07-16 Leandro Pereira <leandro@profusion.mobi>
Reviewed by Gustavo Noronha Silva.
diff --git a/WebKit/efl/EWebLauncher/main.c b/WebKit/efl/EWebLauncher/main.c
index 6980a58..c1956a2 100644
--- a/WebKit/efl/EWebLauncher/main.c
+++ b/WebKit/efl/EWebLauncher/main.c
@@ -373,6 +373,21 @@ on_tooltip_text_set(void* user_data, Evas_Object* webview, void* event_info)
info("%s\n", text);
}
+static void
+on_inputmethod_changed(void* user_data, Evas_Object* webview, void* event_info)
+{
+ Eina_Bool active = (Eina_Bool)(long)event_info;
+ unsigned int imh;
+ info("Keyboard changed: %d\n", active);
+
+ if (!active)
+ return;
+
+ imh = ewk_view_imh_get(webview);
+ info(" Keyboard flags: %#.2x\n", imh);
+
+}
+
/**
* "viewport,changed" signal will be always emitted regardless of the viewport existence.
*
@@ -661,6 +676,7 @@ browserCreate(const char *url, const char *theme, const char *userAgent, Eina_Re
evas_object_smart_callback_add(app->browser, "menubar,visible,set", on_menubar_visible_set, app);
evas_object_smart_callback_add(app->browser, "menubar,visible,get", on_menubar_visible_get, app);
evas_object_smart_callback_add(app->browser, "tooltip,text,set", on_tooltip_text_set, app);
+ evas_object_smart_callback_add(app->browser, "inputmethod,changed", on_inputmethod_changed, app);
/* ewk_callback_resize_requested_add(app->browser, on_resize_requested, app->ee); */
@@ -756,6 +772,7 @@ main(int argc, char *argv[])
char *url = NULL;
char *userAgent = NULL;
const char *tmp;
+ const char *proxyUri;
char path[PATH_MAX];
char *engine = NULL;
@@ -818,6 +835,10 @@ main(int argc, char *argv[])
ewk_settings_icon_database_path_set(path);
ewk_settings_web_database_path_set(path);
+ proxyUri = getenv("http_proxy");
+ if (proxyUri)
+ ewk_settings_proxy_uri_set(proxyUri);
+
browserCreate(url, theme, userAgent, geometry, engine, isFullscreen);
ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, main_signal_exit, &windows);
diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
index 4b01b75..ffbd642 100644
--- a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
+++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
@@ -231,7 +231,7 @@ void ChromeClientEfl::setResizable(bool)
void ChromeClientEfl::closeWindowSoon()
{
- ewk_view_stop(m_view);
+ ewk_view_window_close(m_view);
}
bool ChromeClientEfl::canTakeFocus(FocusDirection)
diff --git a/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp b/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
index cf672eb..a63b712 100644
--- a/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
+++ b/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
@@ -47,7 +47,7 @@ void EditorClientEfl::willSetInputMethodState()
void EditorClientEfl::setInputMethodState(bool active)
{
- notImplemented();
+ ewk_view_input_method_state_set(m_view, active);
}
bool EditorClientEfl::shouldDeleteRange(Range*)
diff --git a/WebKit/efl/ewk/ewk_cookies.cpp b/WebKit/efl/ewk/ewk_cookies.cpp
index 3b4949e..421f8dc 100644
--- a/WebKit/efl/ewk/ewk_cookies.cpp
+++ b/WebKit/efl/ewk/ewk_cookies.cpp
@@ -21,14 +21,18 @@
#include "config.h"
#include "ewk_cookies.h"
+#ifdef WTF_USE_SOUP
#include "CookieJarSoup.h"
+#endif
#include "EWebKit.h"
#include "ResourceHandle.h"
#include <Eina.h>
#include <eina_safety_checks.h>
+#ifdef WTF_USE_SOUP
#include <glib.h>
#include <libsoup/soup.h>
+#endif
#include <wtf/text/CString.h>
@@ -43,6 +47,7 @@
*/
EAPI Eina_Bool ewk_cookies_file_set(const char *filename)
{
+#ifdef WTF_USE_SOUP
SoupCookieJar* cookieJar = 0;
if (filename)
cookieJar = soup_cookie_jar_text_new(filename, FALSE);
@@ -65,6 +70,9 @@ EAPI Eina_Bool ewk_cookies_file_set(const char *filename)
soup_session_add_feature(session, SOUP_SESSION_FEATURE(cookieJar));
return EINA_TRUE;
+#else
+ return EINA_FALSE;
+#endif
}
/**
@@ -72,6 +80,7 @@ EAPI Eina_Bool ewk_cookies_file_set(const char *filename)
*/
EAPI void ewk_cookies_clear()
{
+#ifdef WTF_USE_SOUP
GSList* l;
GSList* p;
SoupCookieJar* cookieJar = WebCore::defaultCookieJar();
@@ -81,6 +90,7 @@ EAPI void ewk_cookies_clear()
soup_cookie_jar_delete_cookie(cookieJar, (SoupCookie*)p->data);
soup_cookies_free(l);
+#endif
}
/**
@@ -90,9 +100,10 @@ EAPI void ewk_cookies_clear()
*/
EAPI Eina_List* ewk_cookies_get_all(void)
{
+ Eina_List* el = 0;
+#ifdef WTF_USE_SOUP
GSList* l;
GSList* p;
- Eina_List* el = 0;
SoupCookieJar* cookieJar = WebCore::defaultCookieJar();
l = soup_cookie_jar_all_cookies(cookieJar);
@@ -110,6 +121,7 @@ EAPI Eina_List* ewk_cookies_get_all(void)
}
soup_cookies_free(l);
+#endif
return el;
}
@@ -123,6 +135,7 @@ EAPI Eina_List* ewk_cookies_get_all(void)
*/
EAPI void ewk_cookies_cookie_del(Ewk_Cookie *cookie)
{
+#ifdef WTF_USE_SOUP
EINA_SAFETY_ON_NULL_RETURN(cookie);
GSList* l;
GSList* p;
@@ -141,6 +154,7 @@ EAPI void ewk_cookies_cookie_del(Ewk_Cookie *cookie)
soup_cookie_free(c1);
soup_cookies_free(l);
+#endif
}
/*
@@ -150,12 +164,14 @@ EAPI void ewk_cookies_cookie_del(Ewk_Cookie *cookie)
*/
EAPI void ewk_cookies_cookie_free(Ewk_Cookie *cookie)
{
+#ifdef WTF_USE_SOUP
EINA_SAFETY_ON_NULL_RETURN(cookie);
free(cookie->name);
free(cookie->value);
free(cookie->domain);
free(cookie->path);
free(cookie);
+#endif
}
/*
@@ -170,6 +186,7 @@ EAPI void ewk_cookies_cookie_free(Ewk_Cookie *cookie)
*/
EAPI void ewk_cookies_policy_set(Ewk_Cookie_Policy p)
{
+#ifdef WTF_USE_SOUP
#ifdef HAVE_LIBSOUP_2_29_90
SoupCookieJar* cookieJar = WebCore::defaultCookieJar();
SoupCookieJarAcceptPolicy policy;
@@ -189,6 +206,7 @@ EAPI void ewk_cookies_policy_set(Ewk_Cookie_Policy p)
soup_cookie_jar_set_accept_policy(cookieJar, policy);
#endif
+#endif
}
/*
@@ -199,6 +217,7 @@ EAPI void ewk_cookies_policy_set(Ewk_Cookie_Policy p)
EAPI Ewk_Cookie_Policy ewk_cookies_policy_get()
{
Ewk_Cookie_Policy ewk_policy = EWK_COOKIE_JAR_ACCEPT_ALWAYS;
+#ifdef WTF_USE_SOUP
#ifdef HAVE_LIBSOUP_2_29_90
SoupCookieJar* cookieJar = WebCore::defaultCookieJar();
SoupCookieJarAcceptPolicy policy;
@@ -216,6 +235,7 @@ EAPI Ewk_Cookie_Policy ewk_cookies_policy_get()
break;
}
#endif
+#endif
return ewk_policy;
}
diff --git a/WebKit/efl/ewk/ewk_main.cpp b/WebKit/efl/ewk/ewk_main.cpp
index 92346e7..5742766 100644
--- a/WebKit/efl/ewk/ewk_main.cpp
+++ b/WebKit/efl/ewk/ewk_main.cpp
@@ -37,7 +37,7 @@
#include <Evas.h>
#include <stdlib.h>
-#ifdef ENABLE_GLIB_SUPPORT
+#if ENABLE(GLIB_SUPPORT)
#include <glib-object.h>
#include <glib.h>
@@ -47,9 +47,11 @@
#endif
+#ifdef WTF_USE_SOUP
// REMOVE-ME: see todo below
#include "ResourceHandle.h"
#include <libsoup/soup.h>
+#endif
static int _ewk_init_count = 0;
int _ewk_log_dom = -1;
@@ -88,7 +90,7 @@ int ewk_init(void)
goto error_edje;
}
-#ifdef ENABLE_GLIB_SUPPORT
+#if ENABLE(GLIB_SUPPORT)
g_type_init();
if (!g_thread_supported())
@@ -119,10 +121,12 @@ int ewk_init(void)
ewk_settings_web_database_path_set(getenv("HOME"));
// TODO: this should move to WebCore, already reported to webkit-gtk folks:
+#ifdef WTF_USE_SOUP
if (1) {
SoupSession* session = WebCore::ResourceHandle::defaultSession();
soup_session_add_feature_by_type(session, SOUP_TYPE_CONTENT_SNIFFER);
}
+#endif
return ++_ewk_init_count;
diff --git a/WebKit/efl/ewk/ewk_private.h b/WebKit/efl/ewk/ewk_private.h
index c549ad7..2096e76 100644
--- a/WebKit/efl/ewk/ewk_private.h
+++ b/WebKit/efl/ewk/ewk_private.h
@@ -49,6 +49,7 @@ struct ContextMenuItem;
}
void ewk_view_ready(Evas_Object *o);
+void ewk_view_input_method_state_set(Evas_Object* o, Eina_Bool active);
void ewk_view_title_set(Evas_Object *o, const char *title);
void ewk_view_uri_changed(Evas_Object *o);
void ewk_view_load_started(Evas_Object *o);
@@ -62,6 +63,7 @@ void ewk_view_load_progress_changed(Evas_Object *o);
void ewk_view_load_show(Evas_Object* o);
void ewk_view_restore_state(Evas_Object *o, Evas_Object *frame);
Evas_Object *ewk_view_window_create(Evas_Object *o, Eina_Bool javascript, const WebCore::WindowFeatures* coreFeatures);
+void ewk_view_window_close(Evas_Object *o);
void ewk_view_mouse_link_hover_in(Evas_Object *o, void *data);
void ewk_view_mouse_link_hover_out(Evas_Object *o);
diff --git a/WebKit/efl/ewk/ewk_settings.cpp b/WebKit/efl/ewk/ewk_settings.cpp
index b50cd75..e775ac9 100644
--- a/WebKit/efl/ewk/ewk_settings.cpp
+++ b/WebKit/efl/ewk/ewk_settings.cpp
@@ -39,6 +39,11 @@
#include <sys/types.h>
#include <unistd.h>
+#if USE(SOUP)
+#include "ResourceHandle.h"
+#include <libsoup/soup.h>
+#endif
+
static uint64_t _ewk_default_web_database_quota = 1 * 1024 * 1024;
/**
@@ -223,3 +228,22 @@ Evas_Object* ewk_settings_icon_database_icon_object_add(const char* url, Evas* c
surface = icon->nativeImageForCurrentFrame();
return ewk_util_image_from_cairo_surface_add(canvas, surface);
}
+
+/**
+ * Sets the given proxy URI to network backend.
+ *
+ * @param proxy URI.
+ */
+void ewk_settings_proxy_uri_set(const char* proxy)
+{
+#if USE(SOUP)
+ SoupURI* uri = soup_uri_new(proxy);
+ EINA_SAFETY_ON_NULL_RETURN(uri);
+
+ SoupSession* session = WebCore::ResourceHandle::defaultSession();
+ g_object_set(session, SOUP_SESSION_PROXY_URI, uri, NULL);
+ soup_uri_free(uri);
+#elif USE(CURL)
+ EINA_SAFETY_ON_TRUE_RETURN(1);
+#endif
+}
diff --git a/WebKit/efl/ewk/ewk_settings.h b/WebKit/efl/ewk/ewk_settings.h
index 87d015c..f2d77f7 100644
--- a/WebKit/efl/ewk/ewk_settings.h
+++ b/WebKit/efl/ewk/ewk_settings.h
@@ -48,6 +48,7 @@ EAPI Eina_Bool ewk_settings_icon_database_clear(void);
EAPI cairo_surface_t *ewk_settings_icon_database_icon_surface_get(const char *url);
EAPI Evas_Object *ewk_settings_icon_database_icon_object_add(const char *url, Evas *canvas);
+EAPI void ewk_settings_proxy_uri_set(const char* proxy);
#ifdef __cplusplus
}
diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cpp
index 1707a7d..ed6fb4d 100644
--- a/WebKit/efl/ewk/ewk_view.cpp
+++ b/WebKit/efl/ewk/ewk_view.cpp
@@ -34,6 +34,9 @@
#include "FrameLoaderClientEfl.h"
#include "FrameView.h"
#include "GraphicsContext.h"
+#include "HTMLElement.h"
+#include "HTMLInputElement.h"
+#include "HTMLNames.h"
#include "InspectorClientEfl.h"
#include "PlatformMouseEvent.h"
#include "PopupMenuClient.h"
@@ -79,6 +82,7 @@ struct _Ewk_View_Private_Data {
size_t count;
size_t allocated;
} scrolls;
+ unsigned int imh; /**< input method hints */
struct {
const char* user_agent;
const char* user_stylesheet;
@@ -525,16 +529,14 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd)
CRITICAL("could not allocate Ewk_View_Private_Data");
return 0;
}
- priv->page = new WebCore::Page(
- static_cast<WebCore::ChromeClient*>(new WebCore::ChromeClientEfl(sd->self)),
- static_cast<WebCore::ContextMenuClient*>(new WebCore::ContextMenuClientEfl(sd->self)),
- static_cast<WebCore::EditorClient*>(new WebCore::EditorClientEfl(sd->self)),
- static_cast<WebCore::DragClient*>(new WebCore::DragClientEfl),
- static_cast<WebCore::InspectorClient*>(new WebCore::InspectorClientEfl),
- 0,
- 0,
- 0,
- 0);
+
+ WebCore::Page::PageClients pageClients;
+ pageClients.chromeClient = static_cast<WebCore::ChromeClient*>(new WebCore::ChromeClientEfl(sd->self));
+ pageClients.contextMenuClient = static_cast<WebCore::ContextMenuClient*>(new WebCore::ContextMenuClientEfl(sd->self));
+ pageClients.editorClient = static_cast<WebCore::EditorClient*>(new WebCore::EditorClientEfl(sd->self));
+ pageClients.dragClient = static_cast<WebCore::DragClient*>(new WebCore::DragClientEfl);
+ pageClients.inspectorClient = static_cast<WebCore::InspectorClient*>(new WebCore::InspectorClientEfl);
+ priv->page = new WebCore::Page(pageClients);
if (!priv->page) {
CRITICAL("Could not create WebKit Page");
goto error_page;
@@ -2150,6 +2152,20 @@ Eina_Bool ewk_view_pre_render_region(Evas_Object* o, Evas_Coord x, Evas_Coord y,
}
/**
+ * Get input method hints
+ *
+ * @param o View.
+ *
+ * @return input method hints
+ */
+unsigned int ewk_view_imh_get(Evas_Object *o)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+ EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+ return priv->imh;
+}
+
+/**
* Cancel (clear) previous pre-render requests.
*
* @param o view to clear pre-render requests.
@@ -3026,6 +3042,46 @@ void ewk_view_ready(Evas_Object* o)
/**
* @internal
+ * Reports the state of input method changed. This is triggered, for example
+ * when a input field received/lost focus
+ *
+ * Emits signal: "inputmethod,changed" with a boolean indicating whether it's
+ * enabled or not.
+ */
+void ewk_view_input_method_state_set(Evas_Object* o, Eina_Bool active)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+ EWK_VIEW_PRIV_GET(sd, priv);
+ WebCore::Frame* focusedFrame = priv->page->focusController()->focusedOrMainFrame();
+
+ if (focusedFrame
+ && focusedFrame->document()
+ && focusedFrame->document()->focusedNode()
+ && focusedFrame->document()->focusedNode()->hasTagName(WebCore::HTMLNames::inputTag)) {
+ WebCore::HTMLInputElement* inputElement;
+
+ inputElement = static_cast<WebCore::HTMLInputElement*>(focusedFrame->document()->focusedNode());
+ if (inputElement) {
+ priv->imh = 0;
+ // for password fields, active == false
+ if (!active) {
+ active = inputElement->isPasswordField();
+ priv->imh = inputElement->isPasswordField() * EWK_IMH_PASSWORD;
+ } else {
+ // Set input method hints for "number", "tel", "email", and "url" input elements.
+ priv->imh |= inputElement->isTelephoneField() * EWK_IMH_TELEPHONE;
+ priv->imh |= inputElement->isNumberField() * EWK_IMH_NUMBER;
+ priv->imh |= inputElement->isEmailField() * EWK_IMH_EMAIL;
+ priv->imh |= inputElement->isUrlField() * EWK_IMH_URL;
+ }
+ }
+ }
+
+ evas_object_smart_callback_call(o, "inputmethod,changed", (void*)active);
+}
+
+/**
+ * @internal
* The view title was changed by the frame loader.
*
* Emits signal: "title,changed" with pointer to new title string.
@@ -3234,6 +3290,27 @@ Evas_Object* ewk_view_window_create(Evas_Object* o, Eina_Bool javascript, const
/**
* @internal
+ * Reports a window should be closed. It's client responsibility to decide if
+ * the window should in fact be closed. So, if only windows created by javascript
+ * are allowed to be closed by this call, browser needs to save the javascript
+ * flag when the window is created. Since a window can close itself (for example
+ * with a 'self.close()' in Javascript) browser must postpone the deletion to an
+ * idler.
+ *
+ * @param o View to be closed.
+ */
+void ewk_view_window_close(Evas_Object* o)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+
+ ewk_view_stop(o);
+ if (!sd->api->window_close)
+ return;
+ sd->api->window_close(sd);
+}
+
+/**
+ * @internal
* Reports mouse has moved over a link.
*
* Emits signal: "link,hover,in"
diff --git a/WebKit/efl/ewk/ewk_view.h b/WebKit/efl/ewk/ewk_view.h
index 209beff..19a3588 100644
--- a/WebKit/efl/ewk/ewk_view.h
+++ b/WebKit/efl/ewk/ewk_view.h
@@ -86,6 +86,7 @@ extern "C" {
* and as arguments gives its details.
* - "icon,received", void: main frame received an icon.
* - "viewport,changed", void: Report that viewport has changed.
+ * - "inputmethods,changed" with a boolean indicating whether it's enabled or not.
*/
typedef struct _Ewk_View_Smart_Data Ewk_View_Smart_Data;
@@ -99,6 +100,7 @@ struct _Ewk_View_Smart_Class {
unsigned long version;
Evas_Object *(*window_create)(Ewk_View_Smart_Data *sd, Eina_Bool javascript, const Ewk_Window_Features *window_features); /**< creates a new window, requested by webkit */
+ void (*window_close)(Ewk_View_Smart_Data *sd); /**< creates a new window, requested by webkit */
// hooks to allow different backing stores
Evas_Object *(*backing_store_add)(Ewk_View_Smart_Data *sd); /**< must be defined */
Eina_Bool (*scrolls_process)(Ewk_View_Smart_Data *sd); /**< must be defined */
@@ -145,7 +147,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, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
/**
* Initializer to zero a whole Ewk_View_Smart_Class structure.
@@ -186,6 +188,15 @@ struct _Ewk_View_Smart_Class {
*/
#define EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION(name) EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
+enum _Ewk_Imh {
+ EWK_IMH_TELEPHONE = (1 << 0),
+ EWK_IMH_NUMBER = (1 << 1),
+ EWK_IMH_EMAIL = (1 << 2),
+ EWK_IMH_URL = (1 << 3),
+ EWK_IMH_PASSWORD = (1 << 4)
+};
+typedef enum _Ewk_Imh Ewk_Imh;
+
/**
* @internal
*
@@ -357,6 +368,8 @@ EAPI Eina_Bool ewk_view_zoom_text_only_set(Evas_Object *o, Eina_Bool setting)
EAPI Eina_Bool ewk_view_pre_render_region(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom);
EAPI void ewk_view_pre_render_cancel(Evas_Object *o);
+EAPI unsigned int ewk_view_imh_get(Evas_Object *o);
+
/* settings */
EAPI const char *ewk_view_setting_user_agent_get(const Evas_Object *o);
EAPI Eina_Bool ewk_view_setting_user_agent_set(Evas_Object *o, const char *user_agent);
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 803bf12..bf1777d 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,13 @@
+2010-07-26 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Page clients should be passed to Page constructor via structure of pointers
+ https://bugs.webkit.org/show_bug.cgi?id=42834
+
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_init):
+
2010-07-16 Zhe Su <suzhe@chromium.org>
Reviewed by Darin Adler.
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index 0010a77..cde9148 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -3041,8 +3041,13 @@ static void webkit_web_view_init(WebKitWebView* webView)
priv->imContext = gtk_im_multicontext_new();
- WebKit::InspectorClient* inspectorClient = new WebKit::InspectorClient(webView);
- priv->corePage = new Page(new WebKit::ChromeClient(webView), new WebKit::ContextMenuClient(webView), new WebKit::EditorClient(webView), new WebKit::DragClient(webView), inspectorClient, 0, 0, 0, 0);
+ Page::PageClients pageClients;
+ pageClients.chromeClient = new WebKit::ChromeClient(webView);
+ pageClients.contextMenuClient = new WebKit::ContextMenuClient(webView);
+ pageClients.editorClient = new WebKit::EditorClient(webView);
+ pageClients.dragClient = new WebKit::DragClient(webView);
+ pageClients.inspectorClient = new WebKit::InspectorClient(webView);
+ priv->corePage = new Page(pageClients);
// We also add a simple wrapper class to provide the public
// interface for the Web Inspector.
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 95c460b..013780d 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,76 @@
+2010-07-26 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Page clients should be passed to Page constructor via structure of pointers
+ https://bugs.webkit.org/show_bug.cgi?id=42834
+
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]):
+
+2010-07-27 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ Add FILE_SYSTEM build flag for FileSystem API
+ https://bugs.webkit.org/show_bug.cgi?id=42915
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2010-07-27 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Client-based Geolocation does not pass enableHighAccuracy option to controller and client
+ https://bugs.webkit.org/show_bug.cgi?id=40374
+
+ Stub out setEnableHighAccuracy method for the Mac port.
+
+ * WebCoreSupport/WebGeolocationControllerClient.h:
+ (WebGeolocationControllerClient::setEnableHighAccuracy):
+
+2010-07-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ Fix for <rdar://problem/8222626>
+ Send textDidChangeInTextField delegate callback only in response to typing or other forms of user text input.
+
+ The function name no longer perfectly matches the behavior, but I didn't want to break any existing clients. Maybe we
+ should migrate to a new function name eventually
+
+ * WebCoreSupport/WebEditorClient.mm:
+ (WebEditorClient::textDidChangeInTextField):
+
+2010-07-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=42836
+ Add localized strings stubs for WebKit2.
+
+ - Convert WebKit (mac) to use a LocalizationStrategy rather than the WebCoreViewFactory
+ for localized strings.
+
+ Gets us below 200 tests failing in WebKitTestRunner.
+
+ * WebCoreSupport/WebContextMenuClient.mm:
+ (fixMenusReceivedFromOldClients): Use LocalizedStrings rather than the factory.
+ * WebCoreSupport/WebPlatformStrategies.h:
+ * WebCoreSupport/WebPlatformStrategies.mm:
+ * WebCoreSupport/WebViewFactory.mm:
+
+2010-07-21 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ Break out "scheme registration" functionality from SecurityOrigin to a SchemeRegistry
+ https://bugs.webkit.org/show_bug.cgi?id=42783
+
+ * WebView/WebView.mm:
+ (+[WebView _registerURLSchemeAsSecure:]):
+ (+[WebView registerURLSchemeAsLocal:]):
+
2010-07-21 Simon Fraser <simon.fraser@apple.com>
Reviewed by Anders Carlsson.
diff --git a/WebKit/mac/Configurations/FeatureDefines.xcconfig b/WebKit/mac/Configurations/FeatureDefines.xcconfig
index 4b363aa..8e33a91 100644
--- a/WebKit/mac/Configurations/FeatureDefines.xcconfig
+++ b/WebKit/mac/Configurations/FeatureDefines.xcconfig
@@ -55,6 +55,7 @@ ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE;
ENABLE_FILTERS = ENABLE_FILTERS;
ENABLE_FILE_READER = ENABLE_FILE_READER;
ENABLE_FILE_WRITER = ;
+ENABLE_FILE_SYSTEM = ;
ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
ENABLE_ICONDATABASE = ENABLE_ICONDATABASE;
ENABLE_IMAGE_RESIZER = ;
@@ -85,4 +86,4 @@ ENABLE_XHTMLMP = ;
ENABLE_XPATH = ENABLE_XPATH;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_FILE_SYSTEM) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
diff --git a/WebKit/mac/Configurations/Version.xcconfig b/WebKit/mac/Configurations/Version.xcconfig
index 2749545..c1b6b32 100644
--- a/WebKit/mac/Configurations/Version.xcconfig
+++ b/WebKit/mac/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 534;
-MINOR_VERSION = 3;
+MINOR_VERSION = 4;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm b/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm
index e4e069a..f3a85f0 100644
--- a/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm
@@ -43,6 +43,7 @@
#import "WebViewInternal.h"
#import <WebCore/ContextMenu.h>
#import <WebCore/KURL.h>
+#import <WebCore/LocalizedStrings.h>
#import <WebCore/RuntimeApplicationChecks.h>
#import <WebKit/DOMPrivate.h>
@@ -168,77 +169,77 @@ static void fixMenusReceivedFromOldClients(NSMutableArray *newMenuItems, NSMutab
if (tag == WebMenuItemTagOther) {
// Restore the specific tag for items on which we temporarily set WebMenuItemTagOther to match old behavior.
NSString *title = [item title];
- if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagOpenLink]])
+ if ([title isEqualToString:contextMenuItemTagOpenLink()])
modernTag = WebMenuItemTagOpenLink;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagIgnoreGrammar]])
+ else if ([title isEqualToString:contextMenuItemTagIgnoreGrammar()])
modernTag = WebMenuItemTagIgnoreGrammar;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSpellingMenu]])
+ else if ([title isEqualToString:contextMenuItemTagSpellingMenu()])
modernTag = WebMenuItemTagSpellingMenu;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowSpellingPanel:true]]
- || [title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowSpellingPanel:false]])
+ else if ([title isEqualToString:contextMenuItemTagShowSpellingPanel(true)]
+ || [title isEqualToString:contextMenuItemTagShowSpellingPanel(false)])
modernTag = WebMenuItemTagShowSpellingPanel;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCheckSpelling]])
+ else if ([title isEqualToString:contextMenuItemTagCheckSpelling()])
modernTag = WebMenuItemTagCheckSpelling;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCheckSpellingWhileTyping]])
+ else if ([title isEqualToString:contextMenuItemTagCheckSpellingWhileTyping()])
modernTag = WebMenuItemTagCheckSpellingWhileTyping;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCheckGrammarWithSpelling]])
+ else if ([title isEqualToString:contextMenuItemTagCheckGrammarWithSpelling()])
modernTag = WebMenuItemTagCheckGrammarWithSpelling;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagFontMenu]])
+ else if ([title isEqualToString:contextMenuItemTagFontMenu()])
modernTag = WebMenuItemTagFontMenu;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowFonts]])
+ else if ([title isEqualToString:contextMenuItemTagShowFonts()])
modernTag = WebMenuItemTagShowFonts;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagBold]])
+ else if ([title isEqualToString:contextMenuItemTagBold()])
modernTag = WebMenuItemTagBold;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagItalic]])
+ else if ([title isEqualToString:contextMenuItemTagItalic()])
modernTag = WebMenuItemTagItalic;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagUnderline]])
+ else if ([title isEqualToString:contextMenuItemTagUnderline()])
modernTag = WebMenuItemTagUnderline;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagOutline]])
+ else if ([title isEqualToString:contextMenuItemTagOutline()])
modernTag = WebMenuItemTagOutline;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagStyles]])
+ else if ([title isEqualToString:contextMenuItemTagStyles()])
modernTag = WebMenuItemTagStyles;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowColors]])
+ else if ([title isEqualToString:contextMenuItemTagShowColors()])
modernTag = WebMenuItemTagShowColors;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSpeechMenu]])
+ else if ([title isEqualToString:contextMenuItemTagSpeechMenu()])
modernTag = WebMenuItemTagSpeechMenu;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagStartSpeaking]])
+ else if ([title isEqualToString:contextMenuItemTagStartSpeaking()])
modernTag = WebMenuItemTagStartSpeaking;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagStopSpeaking]])
+ else if ([title isEqualToString:contextMenuItemTagStopSpeaking()])
modernTag = WebMenuItemTagStopSpeaking;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagWritingDirectionMenu]])
+ else if ([title isEqualToString:contextMenuItemTagWritingDirectionMenu()])
modernTag = WebMenuItemTagWritingDirectionMenu;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagDefaultDirection]])
+ else if ([title isEqualToString:contextMenuItemTagDefaultDirection()])
modernTag = WebMenuItemTagDefaultDirection;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagLeftToRight]])
+ else if ([title isEqualToString:contextMenuItemTagLeftToRight()])
modernTag = WebMenuItemTagLeftToRight;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagRightToLeft]])
+ else if ([title isEqualToString:contextMenuItemTagRightToLeft()])
modernTag = WebMenuItemTagRightToLeft;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagInspectElement]])
+ else if ([title isEqualToString:contextMenuItemTagInspectElement()])
modernTag = WebMenuItemTagInspectElement;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCorrectSpellingAutomatically]])
+ else if ([title isEqualToString:contextMenuItemTagCorrectSpellingAutomatically()])
modernTag = WebMenuItemTagCorrectSpellingAutomatically;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSubstitutionsMenu]])
+ else if ([title isEqualToString:contextMenuItemTagSubstitutionsMenu()])
modernTag = WebMenuItemTagSubstitutionsMenu;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowSubstitutions:true]]
- || [title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowSubstitutions:false]])
+ else if ([title isEqualToString:contextMenuItemTagShowSubstitutions(true)]
+ || [title isEqualToString:contextMenuItemTagShowSubstitutions(false)])
modernTag = WebMenuItemTagShowSubstitutions;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSmartCopyPaste]])
+ else if ([title isEqualToString:contextMenuItemTagSmartCopyPaste()])
modernTag = WebMenuItemTagSmartCopyPaste;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSmartQuotes]])
+ else if ([title isEqualToString:contextMenuItemTagSmartQuotes()])
modernTag = WebMenuItemTagSmartQuotes;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSmartDashes]])
+ else if ([title isEqualToString:contextMenuItemTagSmartDashes()])
modernTag = WebMenuItemTagSmartDashes;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSmartLinks]])
+ else if ([title isEqualToString:contextMenuItemTagSmartLinks()])
modernTag = WebMenuItemTagSmartLinks;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagTextReplacement]])
+ else if ([title isEqualToString:contextMenuItemTagTextReplacement()])
modernTag = WebMenuItemTagTextReplacement;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagTransformationsMenu]])
+ else if ([title isEqualToString:contextMenuItemTagTransformationsMenu()])
modernTag = WebMenuItemTagTransformationsMenu;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagMakeUpperCase]])
+ else if ([title isEqualToString:contextMenuItemTagMakeUpperCase()])
modernTag = WebMenuItemTagMakeUpperCase;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagMakeLowerCase]])
+ else if ([title isEqualToString:contextMenuItemTagMakeLowerCase()])
modernTag = WebMenuItemTagMakeLowerCase;
- else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCapitalize]])
+ else if ([title isEqualToString:contextMenuItemTagCapitalize()])
modernTag = WebMenuItemTagCapitalize;
else {
// We don't expect WebMenuItemTagOther for any items other than the ones we explicitly handle.
diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.mm b/WebKit/mac/WebCoreSupport/WebEditorClient.mm
index d2f2706..2c89919 100644
--- a/WebKit/mac/WebCoreSupport/WebEditorClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebEditorClient.mm
@@ -59,6 +59,7 @@
#import <WebCore/LegacyWebArchive.h>
#import <WebCore/PlatformKeyboardEvent.h>
#import <WebCore/PlatformString.h>
+#import <WebCore/UserTypingGestureIndicator.h>
#import <WebCore/WebCoreObjCExtras.h>
#import <runtime/InitializeThreading.h>
#import <wtf/PassRefPtr.h>
@@ -557,12 +558,15 @@ void WebEditorClient::textFieldDidEndEditing(Element* element)
FormDelegateLog(inputElement);
CallFormDelegate(m_webView, @selector(textFieldDidEndEditing:inFrame:), inputElement, kit(element->document()->frame()));
}
-
+
void WebEditorClient::textDidChangeInTextField(Element* element)
{
if (!element->hasTagName(inputTag))
return;
+ if (!UserTypingGestureIndicator::processingUserTypingGesture() || UserTypingGestureIndicator::focusedElementAtGestureStart() != element)
+ return;
+
DOMHTMLInputElement* inputElement = kit(static_cast<HTMLInputElement*>(element));
FormDelegateLog(inputElement);
CallFormDelegate(m_webView, @selector(textDidChangeInTextField:inFrame:), inputElement, kit(element->document()->frame()));
diff --git a/WebKit/mac/WebCoreSupport/WebGeolocationControllerClient.h b/WebKit/mac/WebCoreSupport/WebGeolocationControllerClient.h
index 3965210..34d6a29 100644
--- a/WebKit/mac/WebCoreSupport/WebGeolocationControllerClient.h
+++ b/WebKit/mac/WebCoreSupport/WebGeolocationControllerClient.h
@@ -39,6 +39,7 @@ public:
void geolocationDestroyed();
void startUpdating();
void stopUpdating();
+ void setEnableHighAccuracy(bool) { }
WebCore::GeolocationPosition* lastPosition();
diff --git a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h
index ce8bf9d..0ac4f16 100644
--- a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h
+++ b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h
@@ -28,8 +28,9 @@
#include <WebCore/PlatformStrategies.h>
#include <WebCore/PluginStrategy.h>
+#include <WebCore/LocalizationStrategy.h>
-class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy {
+class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy {
public:
static void initialize();
@@ -38,10 +39,115 @@ private:
// WebCore::PlatformStrategies
virtual WebCore::PluginStrategy* createPluginStrategy();
+ virtual WebCore::LocalizationStrategy* createLocalizationStrategy();
// WebCore::PluginStrategy
virtual void refreshPlugins();
virtual void getPluginInfo(Vector<WebCore::PluginInfo>&);
+
+ // WebCore::LocalizationStrategy
+ virtual WebCore::String inputElementAltText();
+ virtual WebCore::String resetButtonDefaultLabel();
+ virtual WebCore::String searchableIndexIntroduction();
+ virtual WebCore::String submitButtonDefaultLabel();
+ virtual WebCore::String fileButtonChooseFileLabel();
+ virtual WebCore::String fileButtonNoFileSelectedLabel();
+ virtual WebCore::String copyImageUnknownFileLabel();
+#if ENABLE(CONTEXT_MENUS)
+ virtual WebCore::String contextMenuItemTagOpenLinkInNewWindow();
+ virtual WebCore::String contextMenuItemTagDownloadLinkToDisk();
+ virtual WebCore::String contextMenuItemTagCopyLinkToClipboard();
+ virtual WebCore::String contextMenuItemTagOpenImageInNewWindow();
+ virtual WebCore::String contextMenuItemTagDownloadImageToDisk();
+ virtual WebCore::String contextMenuItemTagCopyImageToClipboard();
+ virtual WebCore::String contextMenuItemTagOpenFrameInNewWindow();
+ virtual WebCore::String contextMenuItemTagCopy();
+ virtual WebCore::String contextMenuItemTagGoBack();
+ virtual WebCore::String contextMenuItemTagGoForward();
+ virtual WebCore::String contextMenuItemTagStop();
+ virtual WebCore::String contextMenuItemTagReload();
+ virtual WebCore::String contextMenuItemTagCut();
+ virtual WebCore::String contextMenuItemTagPaste();
+ virtual WebCore::String contextMenuItemTagNoGuessesFound();
+ virtual WebCore::String contextMenuItemTagIgnoreSpelling();
+ virtual WebCore::String contextMenuItemTagLearnSpelling();
+ virtual WebCore::String contextMenuItemTagSearchWeb();
+ virtual WebCore::String contextMenuItemTagLookUpInDictionary();
+ virtual WebCore::String contextMenuItemTagOpenLink();
+ virtual WebCore::String contextMenuItemTagIgnoreGrammar();
+ virtual WebCore::String contextMenuItemTagSpellingMenu();
+ virtual WebCore::String contextMenuItemTagShowSpellingPanel(bool show);
+ virtual WebCore::String contextMenuItemTagCheckSpelling();
+ virtual WebCore::String contextMenuItemTagCheckSpellingWhileTyping();
+ virtual WebCore::String contextMenuItemTagCheckGrammarWithSpelling();
+ virtual WebCore::String contextMenuItemTagFontMenu();
+ virtual WebCore::String contextMenuItemTagBold();
+ virtual WebCore::String contextMenuItemTagItalic();
+ virtual WebCore::String contextMenuItemTagUnderline();
+ virtual WebCore::String contextMenuItemTagOutline();
+ virtual WebCore::String contextMenuItemTagWritingDirectionMenu();
+ virtual WebCore::String contextMenuItemTagTextDirectionMenu();
+ virtual WebCore::String contextMenuItemTagDefaultDirection();
+ virtual WebCore::String contextMenuItemTagLeftToRight();
+ virtual WebCore::String contextMenuItemTagRightToLeft();
+ virtual WebCore::String contextMenuItemTagSearchInSpotlight();
+ virtual WebCore::String contextMenuItemTagShowFonts();
+ virtual WebCore::String contextMenuItemTagStyles();
+ virtual WebCore::String contextMenuItemTagShowColors();
+ virtual WebCore::String contextMenuItemTagSpeechMenu();
+ virtual WebCore::String contextMenuItemTagStartSpeaking();
+ virtual WebCore::String contextMenuItemTagStopSpeaking();
+ virtual WebCore::String contextMenuItemTagCorrectSpellingAutomatically();
+ virtual WebCore::String contextMenuItemTagSubstitutionsMenu();
+ virtual WebCore::String contextMenuItemTagShowSubstitutions(bool show);
+ virtual WebCore::String contextMenuItemTagSmartCopyPaste();
+ virtual WebCore::String contextMenuItemTagSmartQuotes();
+ virtual WebCore::String contextMenuItemTagSmartDashes();
+ virtual WebCore::String contextMenuItemTagSmartLinks();
+ virtual WebCore::String contextMenuItemTagTextReplacement();
+ virtual WebCore::String contextMenuItemTagTransformationsMenu();
+ virtual WebCore::String contextMenuItemTagMakeUpperCase();
+ virtual WebCore::String contextMenuItemTagMakeLowerCase();
+ virtual WebCore::String contextMenuItemTagCapitalize();
+ virtual WebCore::String contextMenuItemTagChangeBack(const WebCore::String& replacedString);
+ virtual WebCore::String contextMenuItemTagInspectElement();
+#endif // ENABLE(CONTEXT_MENUS)
+ virtual WebCore::String searchMenuNoRecentSearchesText();
+ virtual WebCore::String searchMenuRecentSearchesText();
+ virtual WebCore::String searchMenuClearRecentSearchesText();
+ virtual WebCore::String AXWebAreaText();
+ virtual WebCore::String AXLinkText();
+ virtual WebCore::String AXListMarkerText();
+ virtual WebCore::String AXImageMapText();
+ virtual WebCore::String AXHeadingText();
+ virtual WebCore::String AXDefinitionListTermText();
+ virtual WebCore::String AXDefinitionListDefinitionText();
+ virtual WebCore::String AXARIAContentGroupText(const WebCore::String& ariaType);
+ virtual WebCore::String AXButtonActionVerb();
+ virtual WebCore::String AXRadioButtonActionVerb();
+ virtual WebCore::String AXTextFieldActionVerb();
+ virtual WebCore::String AXCheckedCheckBoxActionVerb();
+ virtual WebCore::String AXUncheckedCheckBoxActionVerb();
+ virtual WebCore::String AXMenuListActionVerb();
+ virtual WebCore::String AXMenuListPopupActionVerb();
+ virtual WebCore::String AXLinkActionVerb();
+ virtual WebCore::String missingPluginText();
+ virtual WebCore::String crashedPluginText();
+ virtual WebCore::String multipleFileUploadText(unsigned numberOfFiles);
+ virtual WebCore::String unknownFileSizeText();
+ virtual WebCore::String imageTitle(const WebCore::String& filename, const WebCore::IntSize& size);
+ virtual WebCore::String mediaElementLoadingStateText();
+ virtual WebCore::String mediaElementLiveBroadcastStateText();
+ virtual WebCore::String localizedMediaControlElementString(const WebCore::String&);
+ virtual WebCore::String localizedMediaControlElementHelpText(const WebCore::String&);
+ virtual WebCore::String localizedMediaTimeDescription(float);
+ virtual WebCore::String validationMessageValueMissingText();
+ virtual WebCore::String validationMessageTypeMismatchText();
+ virtual WebCore::String validationMessagePatternMismatchText();
+ virtual WebCore::String validationMessageTooLongText();
+ virtual WebCore::String validationMessageRangeUnderflowText();
+ virtual WebCore::String validationMessageRangeOverflowText();
+ virtual WebCore::String validationMessageStepMismatchText();
};
#endif // WebPlatformStrategies_h
diff --git a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
index d4bb684..6805f5e 100644
--- a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
+++ b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
@@ -25,9 +25,11 @@
#import "WebPlatformStrategies.h"
+#import "WebLocalizableStrings.h"
#import "WebPluginDatabase.h"
#import "WebPluginPackage.h"
#import <WebCore/BlockExceptions.h>
+#import <WebCore/IntSize.h>
#import <wtf/StdLibExtras.h>
#ifdef BUILDING_ON_TIGER
@@ -53,6 +55,11 @@ PluginStrategy* WebPlatformStrategies::createPluginStrategy()
return this;
}
+LocalizationStrategy* WebPlatformStrategies::createLocalizationStrategy()
+{
+ return this;
+}
+
void WebPlatformStrategies::refreshPlugins()
{
[[WebPluginDatabase sharedDatabase] refresh];
@@ -72,4 +79,686 @@ void WebPlatformStrategies::getPluginInfo(Vector<WebCore::PluginInfo>& plugins)
END_BLOCK_OBJC_EXCEPTIONS;
}
+// LocalizationStrategy
+
+String WebPlatformStrategies::inputElementAltText()
+{
+ return UI_STRING_KEY("Submit", "Submit (input element)", "alt text for <input> elements with no alt, title, or value");
+}
+
+String WebPlatformStrategies::resetButtonDefaultLabel()
+{
+ return UI_STRING("Reset", "default label for Reset buttons in forms on web pages");
+}
+
+String WebPlatformStrategies::searchableIndexIntroduction()
+{
+ return UI_STRING("This is a searchable index. Enter search keywords: ",
+ "text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'");
+}
+
+String WebPlatformStrategies::submitButtonDefaultLabel()
+{
+ return UI_STRING("Submit", "default label for Submit buttons in forms on web pages");
+}
+
+String WebPlatformStrategies::fileButtonChooseFileLabel()
+{
+ return UI_STRING("Choose File", "title for file button used in HTML forms");
+}
+
+String WebPlatformStrategies::fileButtonNoFileSelectedLabel()
+{
+ return UI_STRING("no file selected", "text to display in file button used in HTML forms when no file is selected");
+}
+
+String WebPlatformStrategies::copyImageUnknownFileLabel()
+{
+ return UI_STRING("unknown", "Unknown filename");
+}
+
+#if ENABLE(CONTEXT_MENUS)
+
+String WebPlatformStrategies::contextMenuItemTagOpenLinkInNewWindow()
+{
+ return UI_STRING("Open Link in New Window", "Open in New Window context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagDownloadLinkToDisk()
+{
+ return UI_STRING("Download Linked File", "Download Linked File context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCopyLinkToClipboard()
+{
+ return UI_STRING("Copy Link", "Copy Link context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagOpenImageInNewWindow()
+{
+ return UI_STRING("Open Image in New Window", "Open Image in New Window context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagDownloadImageToDisk()
+{
+ return UI_STRING("Download Image", "Download Image context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard()
+{
+ return UI_STRING("Copy Image", "Copy Image context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow()
+{
+ return UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCopy()
+{
+ return UI_STRING("Copy", "Copy context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagGoBack()
+{
+ return UI_STRING("Back", "Back context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagGoForward()
+{
+ return UI_STRING("Forward", "Forward context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagStop()
+{
+ return UI_STRING("Stop", "Stop context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagReload()
+{
+ return UI_STRING("Reload", "Reload context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCut()
+{
+ return UI_STRING("Cut", "Cut context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagPaste()
+{
+ return UI_STRING("Paste", "Paste context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagNoGuessesFound()
+{
+ return UI_STRING("No Guesses Found", "No Guesses Found context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagIgnoreSpelling()
+{
+ return UI_STRING("Ignore Spelling", "Ignore Spelling context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagLearnSpelling()
+{
+ return UI_STRING("Learn Spelling", "Learn Spelling context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagSearchWeb()
+{
+ return UI_STRING("Search in Google", "Search in Google context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagLookUpInDictionary()
+{
+ return UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagOpenLink()
+{
+ return UI_STRING("Open Link", "Open Link context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagIgnoreGrammar()
+{
+ return UI_STRING("Ignore Grammar", "Ignore Grammar context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagSpellingMenu()
+{
+#ifndef BUILDING_ON_TIGER
+ return UI_STRING("Spelling and Grammar", "Spelling and Grammar context sub-menu item");
+#else
+ return UI_STRING("Spelling", "Spelling context sub-menu item");
+#endif
+}
+
+String WebPlatformStrategies::contextMenuItemTagShowSpellingPanel(bool show)
+{
+#ifndef BUILDING_ON_TIGER
+ if (show)
+ return UI_STRING("Show Spelling and Grammar", "menu item title");
+ return UI_STRING("Hide Spelling and Grammar", "menu item title");
+#else
+ return UI_STRING("Spelling...", "menu item title");
+#endif
+}
+
+String WebPlatformStrategies::contextMenuItemTagCheckSpelling()
+{
+#ifndef BUILDING_ON_TIGER
+ return UI_STRING("Check Document Now", "Check spelling context menu item");
+#else
+ return UI_STRING("Check Spelling", "Check spelling context menu item");
+#endif
+}
+
+String WebPlatformStrategies::contextMenuItemTagCheckSpellingWhileTyping()
+{
+#ifndef BUILDING_ON_TIGER
+ return UI_STRING("Check Spelling While Typing", "Check spelling while typing context menu item");
+#else
+ return UI_STRING("Check Spelling as You Type", "Check spelling while typing context menu item");
+#endif
+}
+
+String WebPlatformStrategies::contextMenuItemTagCheckGrammarWithSpelling()
+{
+ return UI_STRING("Check Grammar With Spelling", "Check grammar with spelling context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagFontMenu()
+{
+ return UI_STRING("Font", "Font context sub-menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagBold()
+{
+ return UI_STRING("Bold", "Bold context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagItalic()
+{
+ return UI_STRING("Italic", "Italic context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagUnderline()
+{
+ return UI_STRING("Underline", "Underline context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagOutline()
+{
+ return UI_STRING("Outline", "Outline context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagWritingDirectionMenu()
+{
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ return UI_STRING("Paragraph Direction", "Paragraph direction context sub-menu item");
+#else
+ return UI_STRING("Writing Direction", "Writing direction context sub-menu item");
+#endif
+}
+
+String WebPlatformStrategies::contextMenuItemTagTextDirectionMenu()
+{
+ return UI_STRING("Selection Direction", "Selection direction context sub-menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagDefaultDirection()
+{
+ return UI_STRING("Default", "Default writing direction context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagLeftToRight()
+{
+ return UI_STRING("Left to Right", "Left to Right context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagRightToLeft()
+{
+ return UI_STRING("Right to Left", "Right to Left context menu item");
+}
+
+#if PLATFORM(MAC)
+
+String WebPlatformStrategies::contextMenuItemTagSearchInSpotlight()
+{
+ return UI_STRING("Search in Spotlight", "Search in Spotlight context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagShowFonts()
+{
+ return UI_STRING("Show Fonts", "Show fonts context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagStyles()
+{
+ return UI_STRING("Styles...", "Styles context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagShowColors()
+{
+ return UI_STRING("Show Colors", "Show colors context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagSpeechMenu()
+{
+ return UI_STRING("Speech", "Speech context sub-menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagStartSpeaking()
+{
+ return UI_STRING("Start Speaking", "Start speaking context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagStopSpeaking()
+{
+ return UI_STRING("Stop Speaking", "Stop speaking context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCorrectSpellingAutomatically()
+{
+ return UI_STRING("Correct Spelling Automatically", "Correct Spelling Automatically context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagSubstitutionsMenu()
+{
+ return UI_STRING("Substitutions", "Substitutions context sub-menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagShowSubstitutions(bool show)
+{
+ if (show)
+ return UI_STRING("Show Substitutions", "menu item title");
+ return UI_STRING("Hide Substitutions", "menu item title");
+}
+
+String WebPlatformStrategies::contextMenuItemTagSmartCopyPaste()
+{
+ return UI_STRING("Smart Copy/Paste", "Smart Copy/Paste context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagSmartQuotes()
+{
+ return UI_STRING("Smart Quotes", "Smart Quotes context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagSmartDashes()
+{
+ return UI_STRING("Smart Dashes", "Smart Dashes context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagSmartLinks()
+{
+ return UI_STRING("Smart Links", "Smart Links context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagTextReplacement()
+{
+ return UI_STRING("Text Replacement", "Text Replacement context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagTransformationsMenu()
+{
+ return UI_STRING("Transformations", "Transformations context sub-menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagMakeUpperCase()
+{
+ return UI_STRING("Make Upper Case", "Make Upper Case context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagMakeLowerCase()
+{
+ return UI_STRING("Make Lower Case", "Make Lower Case context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCapitalize()
+{
+ return UI_STRING("Capitalize", "Capitalize context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagChangeBack(const String& replacedString)
+{
+ static NSString *formatString = nil;
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ static bool lookedUpString = false;
+ if (!lookedUpString) {
+ formatString = [[[NSBundle bundleForClass:[NSSpellChecker class]] localizedStringForKey:@"Change Back to \\U201C%@\\U201D" value:nil table:@"MenuCommands"] retain];
+ lookedUpString = true;
+ }
+#endif
+ if (!formatString)
+ return replacedString;
+ return [NSString stringWithFormat:formatString, (NSString *)replacedString];
+}
+
+#endif
+
+String WebPlatformStrategies::contextMenuItemTagInspectElement()
+{
+ return UI_STRING("Inspect Element", "Inspect Element context menu item");
+}
+
+#endif // ENABLE(CONTEXT_MENUS)
+
+String WebPlatformStrategies::searchMenuNoRecentSearchesText()
+{
+ return UI_STRING("No recent searches", "Label for only item in menu that appears when clicking on the search field image, when no searches have been performed");
+}
+
+String WebPlatformStrategies::searchMenuRecentSearchesText()
+{
+ return UI_STRING("Recent Searches", "label for first item in the menu that appears when clicking on the search field image, used as embedded menu title");
+}
+
+String WebPlatformStrategies::searchMenuClearRecentSearchesText()
+{
+ return UI_STRING("Clear Recent Searches", "menu item in Recent Searches menu that empties menu's contents");
+}
+
+String WebPlatformStrategies::AXWebAreaText()
+{
+ return UI_STRING("HTML content", "accessibility role description for web area");
+}
+
+String WebPlatformStrategies::AXLinkText()
+{
+ return UI_STRING("link", "accessibility role description for link");
+}
+
+String WebPlatformStrategies::AXListMarkerText()
+{
+ return UI_STRING("list marker", "accessibility role description for list marker");
+}
+
+String WebPlatformStrategies::AXImageMapText()
+{
+ return UI_STRING("image map", "accessibility role description for image map");
+}
+
+String WebPlatformStrategies::AXHeadingText()
+{
+ return UI_STRING("heading", "accessibility role description for headings");
+}
+
+String WebPlatformStrategies::AXDefinitionListTermText()
+{
+ return UI_STRING("term", "term word of a definition");
+}
+
+String WebPlatformStrategies::AXDefinitionListDefinitionText()
+{
+ return UI_STRING("definition", "definition phrase");
+}
+
+String WebPlatformStrategies::AXARIAContentGroupText(const String& ariaType)
+{
+ if (ariaType == "ARIAApplicationAlert")
+ return UI_STRING("alert", "An ARIA accessibility group that acts as an alert.");
+ if (ariaType == "ARIAApplicationAlertDialog")
+ return UI_STRING("alert dialog", "An ARIA accessibility group that acts as an alert dialog.");
+ if (ariaType == "ARIAApplicationDialog")
+ return UI_STRING("dialog", "An ARIA accessibility group that acts as an dialog.");
+ if (ariaType == "ARIAApplicationLog")
+ return UI_STRING("log", "An ARIA accessibility group that acts as a console log.");
+ if (ariaType == "ARIAApplicationMarquee")
+ return UI_STRING("marquee", "An ARIA accessibility group that acts as a marquee.");
+ if (ariaType == "ARIAApplicationStatus")
+ return UI_STRING("application status", "An ARIA accessibility group that acts as a status update.");
+ if (ariaType == "ARIAApplicationTimer")
+ return UI_STRING("timer", "An ARIA accessibility group that acts as an updating timer.");
+ if (ariaType == "ARIADocument")
+ return UI_STRING("document", "An ARIA accessibility group that acts as a document.");
+ if (ariaType == "ARIADocumentArticle")
+ return UI_STRING("article", "An ARIA accessibility group that acts as an article.");
+ if (ariaType == "ARIADocumentNote")
+ return UI_STRING("note", "An ARIA accessibility group that acts as a note in a document.");
+ if (ariaType == "ARIADocumentRegion")
+ return UI_STRING("region", "An ARIA accessibility group that acts as a distinct region in a document.");
+ if (ariaType == "ARIALandmarkApplication")
+ return UI_STRING("application", "An ARIA accessibility group that acts as an application.");
+ if (ariaType == "ARIALandmarkBanner")
+ return UI_STRING("banner", "An ARIA accessibility group that acts as a banner.");
+ if (ariaType == "ARIALandmarkComplementary")
+ return UI_STRING("complementary", "An ARIA accessibility group that acts as a region of complementary information.");
+ if (ariaType == "ARIALandmarkContentInfo")
+ return UI_STRING("content", "An ARIA accessibility group that contains content.");
+ if (ariaType == "ARIALandmarkMain")
+ return UI_STRING("main", "An ARIA accessibility group that is the main portion of the website.");
+ if (ariaType == "ARIALandmarkNavigation")
+ return UI_STRING("navigation", "An ARIA accessibility group that contains the main navigation elements of a website.");
+ if (ariaType == "ARIALandmarkSearch")
+ return UI_STRING("search", "An ARIA accessibility group that contains a search feature of a website.");
+ if (ariaType == "ARIAUserInterfaceTooltip")
+ return UI_STRING("tooltip", "An ARIA accessibility group that acts as a tooltip.");
+ if (ariaType == "ARIATabPanel")
+ return UI_STRING("tab panel", "An ARIA accessibility group that contains the content of a tab.");
+ if (ariaType == "ARIADocumentMath")
+ return UI_STRING("math", "An ARIA accessibility group that contains mathematical symbols.");
+ return String();
+}
+
+String WebPlatformStrategies::AXButtonActionVerb()
+{
+ return UI_STRING("press", "Verb stating the action that will occur when a button is pressed, as used by accessibility");
+}
+
+String WebPlatformStrategies::AXRadioButtonActionVerb()
+{
+ return UI_STRING("select", "Verb stating the action that will occur when a radio button is clicked, as used by accessibility");
+}
+
+String WebPlatformStrategies::AXTextFieldActionVerb()
+{
+ return UI_STRING("activate", "Verb stating the action that will occur when a text field is selected, as used by accessibility");
+}
+
+String WebPlatformStrategies::AXCheckedCheckBoxActionVerb()
+{
+ return UI_STRING("uncheck", "Verb stating the action that will occur when a checked checkbox is clicked, as used by accessibility");
+}
+
+String WebPlatformStrategies::AXUncheckedCheckBoxActionVerb()
+{
+ return UI_STRING("check", "Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility");
+}
+
+String WebPlatformStrategies::AXMenuListActionVerb()
+{
+ return String();
+}
+
+String WebPlatformStrategies::AXMenuListPopupActionVerb()
+{
+ return String();
+}
+
+String WebPlatformStrategies::AXLinkActionVerb()
+{
+ return UI_STRING("jump", "Verb stating the action that will occur when a link is clicked, as used by accessibility");
+}
+
+String WebPlatformStrategies::missingPluginText()
+{
+ return UI_STRING("Missing Plug-in", "Label text to be used when a plugin is missing");
+}
+
+String WebPlatformStrategies::crashedPluginText()
+{
+ return UI_STRING("Plug-in Failure", "Label text to be used if plugin host process has crashed");
+}
+
+String WebPlatformStrategies::multipleFileUploadText(unsigned numberOfFiles)
+{
+ return [NSString stringWithFormat:UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"), numberOfFiles];
+}
+
+String WebPlatformStrategies::unknownFileSizeText()
+{
+ return UI_STRING("Unknown", "Unknown filesize FTP directory listing item");
+}
+
+String WebPlatformStrategies::imageTitle(const String& filename, const IntSize& size)
+{
+ return [NSString stringWithFormat:UI_STRING("%@ %d×%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"), (NSString *)filename, size.width(), size.height()];
+}
+
+String WebPlatformStrategies::mediaElementLoadingStateText()
+{
+ return UI_STRING("Loading...", "Media controller status message when the media is loading");
+}
+
+String WebPlatformStrategies::mediaElementLiveBroadcastStateText()
+{
+ return UI_STRING("Live Broadcast", "Media controller status message when watching a live broadcast");
+}
+
+String WebPlatformStrategies::localizedMediaControlElementString(const String& name)
+{
+ if (name == "AudioElement")
+ return UI_STRING("audio element controller", "accessibility role description for audio element controller");
+ if (name == "VideoElement")
+ return UI_STRING("video element controller", "accessibility role description for video element controller");
+ if (name == "MuteButton")
+ return UI_STRING("mute", "accessibility role description for mute button");
+ if (name == "UnMuteButton")
+ return UI_STRING("unmute", "accessibility role description for turn mute off button");
+ if (name == "PlayButton")
+ return UI_STRING("play", "accessibility role description for play button");
+ if (name == "PauseButton")
+ return UI_STRING("pause", "accessibility role description for pause button");
+ if (name == "Slider")
+ return UI_STRING("movie time", "accessibility role description for timeline slider");
+ if (name == "SliderThumb")
+ return UI_STRING("timeline slider thumb", "accessibility role description for timeline thumb");
+ if (name == "RewindButton")
+ return UI_STRING("back 30 seconds", "accessibility role description for seek back 30 seconds button");
+ if (name == "ReturnToRealtimeButton")
+ return UI_STRING("return to realtime", "accessibility role description for return to real time button");
+ if (name == "CurrentTimeDisplay")
+ return UI_STRING("elapsed time", "accessibility role description for elapsed time display");
+ if (name == "TimeRemainingDisplay")
+ return UI_STRING("remaining time", "accessibility role description for time remaining display");
+ if (name == "StatusDisplay")
+ return UI_STRING("status", "accessibility role description for movie status");
+ if (name == "FullscreenButton")
+ return UI_STRING("fullscreen", "accessibility role description for enter fullscreen button");
+ if (name == "SeekForwardButton")
+ return UI_STRING("fast forward", "accessibility role description for fast forward button");
+ if (name == "SeekBackButton")
+ return UI_STRING("fast reverse", "accessibility role description for fast reverse button");
+ if (name == "ShowClosedCaptionsButton")
+ return UI_STRING("show closed captions", "accessibility role description for show closed captions button");
+ if (name == "HideClosedCaptionsButton")
+ return UI_STRING("hide closed captions", "accessibility role description for hide closed captions button");
+
+ // FIXME: the ControlsPanel container should never be visible in the accessibility hierarchy.
+ if (name == "ControlsPanel")
+ return String();
+
+ ASSERT_NOT_REACHED();
+ return String();
+}
+
+String WebPlatformStrategies::localizedMediaControlElementHelpText(const String& name)
+{
+ if (name == "AudioElement")
+ return UI_STRING("audio element playback controls and status display", "accessibility role description for audio element controller");
+ if (name == "VideoElement")
+ return UI_STRING("video element playback controls and status display", "accessibility role description for video element controller");
+ if (name == "MuteButton")
+ return UI_STRING("mute audio tracks", "accessibility help text for mute button");
+ if (name == "UnMuteButton")
+ return UI_STRING("unmute audio tracks", "accessibility help text for un mute button");
+ if (name == "PlayButton")
+ return UI_STRING("begin playback", "accessibility help text for play button");
+ if (name == "PauseButton")
+ return UI_STRING("pause playback", "accessibility help text for pause button");
+ if (name == "Slider")
+ return UI_STRING("movie time scrubber", "accessibility help text for timeline slider");
+ if (name == "SliderThumb")
+ return UI_STRING("movie time scrubber thumb", "accessibility help text for timeline slider thumb");
+ if (name == "RewindButton")
+ return UI_STRING("seek movie back 30 seconds", "accessibility help text for jump back 30 seconds button");
+ if (name == "ReturnToRealtimeButton")
+ return UI_STRING("return streaming movie to real time", "accessibility help text for return streaming movie to real time button");
+ if (name == "CurrentTimeDisplay")
+ return UI_STRING("current movie time in seconds", "accessibility help text for elapsed time display");
+ if (name == "TimeRemainingDisplay")
+ return UI_STRING("number of seconds of movie remaining", "accessibility help text for remaining time display");
+ if (name == "StatusDisplay")
+ return UI_STRING("current movie status", "accessibility help text for movie status display");
+ if (name == "SeekBackButton")
+ return UI_STRING("seek quickly back", "accessibility help text for fast rewind button");
+ if (name == "SeekForwardButton")
+ return UI_STRING("seek quickly forward", "accessibility help text for fast forward button");
+ if (name == "FullscreenButton")
+ return UI_STRING("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button");
+ if (name == "ShowClosedCaptionsButton")
+ return UI_STRING("start displaying closed captions", "accessibility help text for show closed captions button");
+ if (name == "HideClosedCaptionsButton")
+ return UI_STRING("stop displaying closed captions", "accessibility help text for hide closed captions button");
+
+ ASSERT_NOT_REACHED();
+ return String();
+}
+
+String WebPlatformStrategies::localizedMediaTimeDescription(float time)
+{
+ if (!isfinite(time))
+ return UI_STRING("indefinite time", "accessibility help text for an indefinite media controller time value");
+
+ int seconds = (int)fabsf(time);
+ int days = seconds / (60 * 60 * 24);
+ int hours = seconds / (60 * 60);
+ int minutes = (seconds / 60) % 60;
+ seconds %= 60;
+
+ if (days)
+ return [NSString stringWithFormat:UI_STRING("%1$d days %2$d hours %3$d minutes %4$d seconds", "accessibility help text for media controller time value >= 1 day"), days, hours, minutes, seconds];
+ else if (hours)
+ return [NSString stringWithFormat:UI_STRING("%1$d hours %2$d minutes %3$d seconds", "accessibility help text for media controller time value >= 60 minutes"), hours, minutes, seconds];
+ else if (minutes)
+ return [NSString stringWithFormat:UI_STRING("%1$d minutes %2$d seconds", "accessibility help text for media controller time value >= 60 seconds"), minutes, seconds];
+
+ return [NSString stringWithFormat:UI_STRING("%1$d seconds", "accessibility help text for media controller time value < 60 seconds"), seconds];
+}
+
+String WebPlatformStrategies::validationMessageValueMissingText()
+{
+ return UI_STRING("value missing", "Validation message for required form control elements that have no value");
+}
+
+String WebPlatformStrategies::validationMessageTypeMismatchText()
+{
+ return UI_STRING("type mismatch", "Validation message for input form controls with a value not matching type");
+}
+
+String WebPlatformStrategies::validationMessagePatternMismatchText()
+{
+ return UI_STRING("pattern mismatch", "Validation message for input form controls requiring a constrained value according to pattern");
+}
+
+String WebPlatformStrategies::validationMessageTooLongText()
+{
+ return UI_STRING("too long", "Validation message for form control elements with a value longer than maximum allowed length");
+}
+
+String WebPlatformStrategies::validationMessageRangeUnderflowText()
+{
+ return UI_STRING("range underflow", "Validation message for input form controls with value lower than allowed minimum");
+}
+
+String WebPlatformStrategies::validationMessageRangeOverflowText()
+{
+ return UI_STRING("range overflow", "Validation message for input form controls with value higher than allowed maximum");
+}
+
+String WebPlatformStrategies::validationMessageStepMismatchText()
+{
+ return UI_STRING("step mismatch", "Validation message for input form controls with value not respecting the step attribute");
+}
diff --git a/WebKit/mac/WebCoreSupport/WebViewFactory.mm b/WebKit/mac/WebCoreSupport/WebViewFactory.mm
index a97d5a5..6c7347f 100644
--- a/WebKit/mac/WebCoreSupport/WebViewFactory.mm
+++ b/WebKit/mac/WebCoreSupport/WebViewFactory.mm
@@ -31,7 +31,6 @@
#import <WebKit/WebFrameInternal.h>
#import <WebKit/WebViewInternal.h>
#import <WebKit/WebHTMLViewInternal.h>
-#import <WebKit/WebLocalizableStrings.h>
#import <WebKit/WebNSUserDefaultsExtras.h>
#import <WebKit/WebNSObjectExtras.h>
#import <WebKit/WebNSViewExtras.h>
@@ -64,379 +63,11 @@
ASSERT([[self sharedFactory] isKindOfClass:self]);
}
-- (NSString *)inputElementAltText
-{
- return UI_STRING_KEY("Submit", "Submit (input element)", "alt text for <input> elements with no alt, title, or value");
-}
-
-- (NSString *)resetButtonDefaultLabel
-{
- return UI_STRING("Reset", "default label for Reset buttons in forms on web pages");
-}
-
-- (NSString *)searchableIndexIntroduction
-{
- return UI_STRING("This is a searchable index. Enter search keywords: ",
- "text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'");
-}
-
-- (NSString *)submitButtonDefaultLabel
-{
- return UI_STRING("Submit", "default label for Submit buttons in forms on web pages");
-}
-
-- (NSString *)fileButtonChooseFileLabel
-{
- return UI_STRING("Choose File", "title for file button used in HTML forms");
-}
-
-- (NSString *)fileButtonNoFileSelectedLabel
-{
- return UI_STRING("no file selected", "text to display in file button used in HTML forms when no file is selected");
-}
-
-- (NSString *)copyImageUnknownFileLabel
-{
- return UI_STRING("unknown", "Unknown filename");
-}
-
-- (NSString *)searchMenuNoRecentSearchesText
-{
- return UI_STRING("No recent searches", "Label for only item in menu that appears when clicking on the search field image, when no searches have been performed");
-}
-
-- (NSString *)searchMenuRecentSearchesText
-{
- return UI_STRING("Recent Searches", "label for first item in the menu that appears when clicking on the search field image, used as embedded menu title");
-}
-
-- (NSString *)searchMenuClearRecentSearchesText
-{
- return UI_STRING("Clear Recent Searches", "menu item in Recent Searches menu that empties menu's contents");
-}
-
- (NSString *)defaultLanguageCode
{
return [NSUserDefaults _webkit_preferredLanguageCode];
}
-- (NSString *)contextMenuItemTagOpenLinkInNewWindow
-{
- return UI_STRING("Open Link in New Window", "Open in New Window context menu item");
-}
-
-- (NSString *)contextMenuItemTagDownloadLinkToDisk
-{
- return UI_STRING("Download Linked File", "Download Linked File context menu item");
-}
-
-- (NSString *)contextMenuItemTagCopyLinkToClipboard
-{
- return UI_STRING("Copy Link", "Copy Link context menu item");
-}
-
-- (NSString *)contextMenuItemTagOpenImageInNewWindow
-{
- return UI_STRING("Open Image in New Window", "Open Image in New Window context menu item");
-}
-
-- (NSString *)contextMenuItemTagDownloadImageToDisk
-{
- return UI_STRING("Download Image", "Download Image context menu item");
-}
-
-- (NSString *)contextMenuItemTagCopyImageToClipboard
-{
- return UI_STRING("Copy Image", "Copy Image context menu item");
-}
-
-- (NSString *)contextMenuItemTagOpenFrameInNewWindow
-{
- return UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item");
-}
-
-- (NSString *)contextMenuItemTagCopy
-{
- return UI_STRING("Copy", "Copy context menu item");
-}
-
-- (NSString *)contextMenuItemTagGoBack
-{
- return UI_STRING("Back", "Back context menu item");
-}
-
-- (NSString *)contextMenuItemTagGoForward
-{
- return UI_STRING("Forward", "Forward context menu item");
-}
-
-- (NSString *)contextMenuItemTagStop
-{
- return UI_STRING("Stop", "Stop context menu item");
-}
-
-- (NSString *)contextMenuItemTagReload
-{
- return UI_STRING("Reload", "Reload context menu item");
-}
-
-- (NSString *)contextMenuItemTagCut
-{
- return UI_STRING("Cut", "Cut context menu item");
-}
-
-- (NSString *)contextMenuItemTagPaste
-{
- return UI_STRING("Paste", "Paste context menu item");
-}
-
-- (NSString *)contextMenuItemTagNoGuessesFound
-{
- return UI_STRING("No Guesses Found", "No Guesses Found context menu item");
-}
-
-- (NSString *)contextMenuItemTagIgnoreSpelling
-{
- return UI_STRING("Ignore Spelling", "Ignore Spelling context menu item");
-}
-
-- (NSString *)contextMenuItemTagLearnSpelling
-{
- return UI_STRING("Learn Spelling", "Learn Spelling context menu item");
-}
-
-- (NSString *)contextMenuItemTagSearchInSpotlight
-{
- return UI_STRING("Search in Spotlight", "Search in Spotlight context menu item");
-}
-
-- (NSString *)contextMenuItemTagSearchWeb
-{
- return UI_STRING("Search in Google", "Search in Google context menu item");
-}
-
-- (NSString *)contextMenuItemTagLookUpInDictionary
-{
- return UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item");
-}
-
-- (NSString *)contextMenuItemTagOpenLink
-{
- return UI_STRING("Open Link", "Open Link context menu item");
-}
-
-- (NSString *)contextMenuItemTagIgnoreGrammar
-{
- return UI_STRING("Ignore Grammar", "Ignore Grammar context menu item");
-}
-
-- (NSString *)contextMenuItemTagSpellingMenu
-{
-#ifndef BUILDING_ON_TIGER
- return UI_STRING("Spelling and Grammar", "Spelling and Grammar context sub-menu item");
-#else
- return UI_STRING("Spelling", "Spelling context sub-menu item");
-#endif
-}
-
-- (NSString *)contextMenuItemTagShowSpellingPanel:(bool)show
-{
-#ifndef BUILDING_ON_TIGER
- if (show)
- return UI_STRING("Show Spelling and Grammar", "menu item title");
- return UI_STRING("Hide Spelling and Grammar", "menu item title");
-#else
- return UI_STRING("Spelling...", "menu item title");
-#endif
-}
-
-- (NSString *)contextMenuItemTagCheckSpelling
-{
-#ifndef BUILDING_ON_TIGER
- return UI_STRING("Check Document Now", "Check spelling context menu item");
-#else
- return UI_STRING("Check Spelling", "Check spelling context menu item");
-#endif
-}
-
-- (NSString *)contextMenuItemTagCheckSpellingWhileTyping
-{
-#ifndef BUILDING_ON_TIGER
- return UI_STRING("Check Spelling While Typing", "Check spelling while typing context menu item");
-#else
- return UI_STRING("Check Spelling as You Type", "Check spelling while typing context menu item");
-#endif
-}
-
-- (NSString *)contextMenuItemTagCheckGrammarWithSpelling
-{
- return UI_STRING("Check Grammar With Spelling", "Check grammar with spelling context menu item");
-}
-
-- (NSString *)contextMenuItemTagFontMenu
-{
- return UI_STRING("Font", "Font context sub-menu item");
-}
-
-- (NSString *)contextMenuItemTagShowFonts
-{
- return UI_STRING("Show Fonts", "Show fonts context menu item");
-}
-
-- (NSString *)contextMenuItemTagBold
-{
- return UI_STRING("Bold", "Bold context menu item");
-}
-
-- (NSString *)contextMenuItemTagItalic
-{
- return UI_STRING("Italic", "Italic context menu item");
-}
-
-- (NSString *)contextMenuItemTagUnderline
-{
- return UI_STRING("Underline", "Underline context menu item");
-}
-
-- (NSString *)contextMenuItemTagOutline
-{
- return UI_STRING("Outline", "Outline context menu item");
-}
-
-- (NSString *)contextMenuItemTagStyles
-{
- return UI_STRING("Styles...", "Styles context menu item");
-}
-
-- (NSString *)contextMenuItemTagShowColors
-{
- return UI_STRING("Show Colors", "Show colors context menu item");
-}
-
-- (NSString *)contextMenuItemTagSpeechMenu
-{
- return UI_STRING("Speech", "Speech context sub-menu item");
-}
-
-- (NSString *)contextMenuItemTagStartSpeaking
-{
- return UI_STRING("Start Speaking", "Start speaking context menu item");
-}
-
-- (NSString *)contextMenuItemTagStopSpeaking
-{
- return UI_STRING("Stop Speaking", "Stop speaking context menu item");
-}
-
-- (NSString *)contextMenuItemTagWritingDirectionMenu
-{
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
- return UI_STRING("Paragraph Direction", "Paragraph direction context sub-menu item");
-#else
- return UI_STRING("Writing Direction", "Writing direction context sub-menu item");
-#endif
-}
-
-- (NSString *)contextMenuItemTagTextDirectionMenu
-{
- return UI_STRING("Selection Direction", "Selection direction context sub-menu item");
-}
-
-- (NSString *)contextMenuItemTagDefaultDirection
-{
- return UI_STRING("Default", "Default writing direction context menu item");
-}
-
-- (NSString *)contextMenuItemTagLeftToRight
-{
- return UI_STRING("Left to Right", "Left to Right context menu item");
-}
-
-- (NSString *)contextMenuItemTagRightToLeft
-{
- return UI_STRING("Right to Left", "Right to Left context menu item");
-}
-
-- (NSString *)contextMenuItemTagCorrectSpellingAutomatically
-{
- return UI_STRING("Correct Spelling Automatically", "Correct Spelling Automatically context menu item");
-}
-
-- (NSString *)contextMenuItemTagSubstitutionsMenu
-{
- return UI_STRING("Substitutions", "Substitutions context sub-menu item");
-}
-
-- (NSString *)contextMenuItemTagShowSubstitutions:(bool)show
-{
- if (show)
- return UI_STRING("Show Substitutions", "menu item title");
- return UI_STRING("Hide Substitutions", "menu item title");
-}
-
-- (NSString *)contextMenuItemTagSmartCopyPaste
-{
- return UI_STRING("Smart Copy/Paste", "Smart Copy/Paste context menu item");
-}
-
-- (NSString *)contextMenuItemTagSmartQuotes
-{
- return UI_STRING("Smart Quotes", "Smart Quotes context menu item");
-}
-
-- (NSString *)contextMenuItemTagSmartDashes
-{
- return UI_STRING("Smart Dashes", "Smart Dashes context menu item");
-}
-
-- (NSString *)contextMenuItemTagSmartLinks
-{
- return UI_STRING("Smart Links", "Smart Links context menu item");
-}
-
-- (NSString *)contextMenuItemTagTextReplacement
-{
- return UI_STRING("Text Replacement", "Text Replacement context menu item");
-}
-
-- (NSString *)contextMenuItemTagTransformationsMenu
-{
- return UI_STRING("Transformations", "Transformations context sub-menu item");
-}
-
-- (NSString *)contextMenuItemTagMakeUpperCase
-{
- return UI_STRING("Make Upper Case", "Make Upper Case context menu item");
-}
-
-- (NSString *)contextMenuItemTagMakeLowerCase
-{
- return UI_STRING("Make Lower Case", "Make Lower Case context menu item");
-}
-
-- (NSString *)contextMenuItemTagCapitalize
-{
- return UI_STRING("Capitalize", "Capitalize context menu item");
-}
-
-- (NSString *)contextMenuItemTagChangeBack:(NSString *)replacedString
-{
- static NSString *formatString = nil;
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
- static bool lookedUpString = false;
- if (!lookedUpString) {
- formatString = [[[NSBundle bundleForClass:[NSSpellChecker class]] localizedStringForKey:@"Change Back to \\U201C%@\\U201D" value:nil table:@"MenuCommands"] retain];
- lookedUpString = true;
- }
-#endif
- return formatString ? [NSString stringWithFormat:formatString, replacedString] : replacedString;
-}
-
-- (NSString *)contextMenuItemTagInspectElement
-{
- return UI_STRING("Inspect Element", "Inspect Element context menu item");
-}
-
- (BOOL)objectIsTextMarker:(id)object
{
return object != nil && CFGetTypeID(object) == WKGetAXTextMarkerTypeID();
@@ -507,308 +138,4 @@
WKUnregisterUniqueIdForElement(element);
}
-- (NSString *)AXWebAreaText
-{
- return UI_STRING("HTML content", "accessibility role description for web area");
-}
-
-- (NSString *)AXLinkText
-{
- return UI_STRING("link", "accessibility role description for link");
-}
-
-- (NSString *)AXListMarkerText
-{
- return UI_STRING("list marker", "accessibility role description for list marker");
-}
-
-- (NSString *)AXImageMapText
-{
- return UI_STRING("image map", "accessibility role description for image map");
-}
-
-- (NSString *)AXHeadingText
-{
- return UI_STRING("heading", "accessibility role description for headings");
-}
-
-- (NSString *)AXDefinitionListTermText
-{
- return UI_STRING("term", "term word of a definition");
-}
-
-- (NSString *)AXDefinitionListDefinitionText
-{
- return UI_STRING("definition", "definition phrase");
-}
-
-- (NSString *)AXARIAContentGroupText:(NSString *)ariaType
-{
- if ([ariaType isEqualToString:@"ARIAApplicationAlert"])
- return UI_STRING("alert", "An ARIA accessibility group that acts as an alert.");
- if ([ariaType isEqualToString:@"ARIAApplicationAlertDialog"])
- return UI_STRING("alert dialog", "An ARIA accessibility group that acts as an alert dialog.");
- if ([ariaType isEqualToString:@"ARIAApplicationDialog"])
- return UI_STRING("dialog", "An ARIA accessibility group that acts as an dialog.");
- if ([ariaType isEqualToString:@"ARIAApplicationLog"])
- return UI_STRING("log", "An ARIA accessibility group that acts as a console log.");
- if ([ariaType isEqualToString:@"ARIAApplicationMarquee"])
- return UI_STRING("marquee", "An ARIA accessibility group that acts as a marquee.");
- if ([ariaType isEqualToString:@"ARIAApplicationStatus"])
- return UI_STRING("application status", "An ARIA accessibility group that acts as a status update.");
- if ([ariaType isEqualToString:@"ARIAApplicationTimer"])
- return UI_STRING("timer", "An ARIA accessibility group that acts as an updating timer.");
- if ([ariaType isEqualToString:@"ARIADocument"])
- return UI_STRING("document", "An ARIA accessibility group that acts as a document.");
- if ([ariaType isEqualToString:@"ARIADocumentArticle"])
- return UI_STRING("article", "An ARIA accessibility group that acts as an article.");
- if ([ariaType isEqualToString:@"ARIADocumentNote"])
- return UI_STRING("note", "An ARIA accessibility group that acts as a note in a document.");
- if ([ariaType isEqualToString:@"ARIADocumentRegion"])
- return UI_STRING("region", "An ARIA accessibility group that acts as a distinct region in a document.");
- if ([ariaType isEqualToString:@"ARIALandmarkApplication"])
- return UI_STRING("application", "An ARIA accessibility group that acts as an application.");
- if ([ariaType isEqualToString:@"ARIALandmarkBanner"])
- return UI_STRING("banner", "An ARIA accessibility group that acts as a banner.");
- if ([ariaType isEqualToString:@"ARIALandmarkComplementary"])
- return UI_STRING("complementary", "An ARIA accessibility group that acts as a region of complementary information.");
- if ([ariaType isEqualToString:@"ARIALandmarkContentInfo"])
- return UI_STRING("content", "An ARIA accessibility group that contains content.");
- if ([ariaType isEqualToString:@"ARIALandmarkMain"])
- return UI_STRING("main", "An ARIA accessibility group that is the main portion of the website.");
- if ([ariaType isEqualToString:@"ARIALandmarkNavigation"])
- return UI_STRING("navigation", "An ARIA accessibility group that contains the main navigation elements of a website.");
- if ([ariaType isEqualToString:@"ARIALandmarkSearch"])
- return UI_STRING("search", "An ARIA accessibility group that contains a search feature of a website.");
- if ([ariaType isEqualToString:@"ARIAUserInterfaceTooltip"])
- return UI_STRING("tooltip", "An ARIA accessibility group that acts as a tooltip.");
- if ([ariaType isEqualToString:@"ARIATabPanel"])
- return UI_STRING("tab panel", "An ARIA accessibility group that contains the content of a tab.");
- if ([ariaType isEqualToString:@"ARIADocumentMath"])
- return UI_STRING("math", "An ARIA accessibility group that contains mathematical symbols.");
- return nil;
-}
-
-- (NSString *)AXButtonActionVerb
-{
- return UI_STRING("press", "Verb stating the action that will occur when a button is pressed, as used by accessibility");
-}
-
-- (NSString *)AXRadioButtonActionVerb
-{
- return UI_STRING("select", "Verb stating the action that will occur when a radio button is clicked, as used by accessibility");
-}
-
-- (NSString *)AXTextFieldActionVerb
-{
- return UI_STRING("activate", "Verb stating the action that will occur when a text field is selected, as used by accessibility");
-}
-
-- (NSString *)AXCheckedCheckBoxActionVerb
-{
- return UI_STRING("uncheck", "Verb stating the action that will occur when a checked checkbox is clicked, as used by accessibility");
-}
-
-- (NSString *)AXUncheckedCheckBoxActionVerb
-{
- return UI_STRING("check", "Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility");
-}
-
-- (NSString *)AXLinkActionVerb
-{
- return UI_STRING("jump", "Verb stating the action that will occur when a link is clicked, as used by accessibility");
-}
-
-- (NSString *)AXMenuListPopupActionVerb
-{
- return nil;
-}
-
-- (NSString *)AXMenuListActionVerb
-{
- return nil;
-}
-
-- (NSString *)missingPluginText
-{
- return UI_STRING("Missing Plug-in", "Label text to be used when a plugin is missing");
-}
-
-- (NSString *)crashedPluginText
-{
- return UI_STRING("Plug-in Failure", "Label text to be used if plugin host process has crashed");
-}
-
-- (NSString *)multipleFileUploadTextForNumberOfFiles:(unsigned)numberOfFiles
-{
- return [NSString stringWithFormat:UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"), numberOfFiles];
-}
-
-- (NSString *)unknownFileSizeText
-{
- return UI_STRING("Unknown", "Unknown filesize FTP directory listing item");
-}
-
-- (NSString*)imageTitleForFilename:(NSString*)filename width:(int)width height:(int)height
-{
- return [NSString stringWithFormat:UI_STRING("%@ %d×%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"), filename, width, height];
-}
-
-- (NSString*)mediaElementLoadingStateText
-{
- return UI_STRING("Loading...", "Media controller status message when the media is loading");
-}
-
-- (NSString*)mediaElementLiveBroadcastStateText
-{
- return UI_STRING("Live Broadcast", "Media controller status message when watching a live broadcast");
-}
-
-- (NSString*)localizedMediaControlElementString:(NSString*)name
-{
- if ([name isEqualToString:@"AudioElement"])
- return UI_STRING("audio element controller", "accessibility role description for audio element controller");
- if ([name isEqualToString:@"VideoElement"])
- return UI_STRING("video element controller", "accessibility role description for video element controller");
-
- // FIXME: the ControlsPanel container should never be visible in the accessibility hierarchy.
- if ([name isEqualToString:@"ControlsPanel"])
- return @"";
-
- if ([name isEqualToString:@"MuteButton"])
- return UI_STRING("mute", "accessibility role description for mute button");
- if ([name isEqualToString:@"UnMuteButton"])
- return UI_STRING("unmute", "accessibility role description for turn mute off button");
- if ([name isEqualToString:@"PlayButton"])
- return UI_STRING("play", "accessibility role description for play button");
- if ([name isEqualToString:@"PauseButton"])
- return UI_STRING("pause", "accessibility role description for pause button");
- if ([name isEqualToString:@"Slider"])
- return UI_STRING("movie time", "accessibility role description for timeline slider");
- if ([name isEqualToString:@"SliderThumb"])
- return UI_STRING("timeline slider thumb", "accessibility role description for timeline thumb");
- if ([name isEqualToString:@"RewindButton"])
- return UI_STRING("back 30 seconds", "accessibility role description for seek back 30 seconds button");
- if ([name isEqualToString:@"ReturnToRealtimeButton"])
- return UI_STRING("return to realtime", "accessibility role description for return to real time button");
- if ([name isEqualToString:@"CurrentTimeDisplay"])
- return UI_STRING("elapsed time", "accessibility role description for elapsed time display");
- if ([name isEqualToString:@"TimeRemainingDisplay"])
- return UI_STRING("remaining time", "accessibility role description for time remaining display");
- if ([name isEqualToString:@"StatusDisplay"])
- return UI_STRING("status", "accessibility role description for movie status");
- if ([name isEqualToString:@"FullscreenButton"])
- return UI_STRING("fullscreen", "accessibility role description for enter fullscreen button");
- if ([name isEqualToString:@"SeekForwardButton"])
- return UI_STRING("fast forward", "accessibility role description for fast forward button");
- if ([name isEqualToString:@"SeekBackButton"])
- return UI_STRING("fast reverse", "accessibility role description for fast reverse button");
- if ([name isEqualToString:@"ShowClosedCaptionsButton"])
- return UI_STRING("show closed captions", "accessibility role description for show closed captions button");
- if ([name isEqualToString:@"HideClosedCaptionsButton"])
- return UI_STRING("hide closed captions", "accessibility role description for hide closed captions button");
-
- ASSERT_NOT_REACHED();
- return @"";
-}
-
-- (NSString*)localizedMediaControlElementHelpText:(NSString*)name
-{
- if ([name isEqualToString:@"AudioElement"])
- return UI_STRING("audio element playback controls and status display", "accessibility role description for audio element controller");
- if ([name isEqualToString:@"VideoElement"])
- return UI_STRING("video element playback controls and status display", "accessibility role description for video element controller");
-
- if ([name isEqualToString:@"MuteButton"])
- return UI_STRING("mute audio tracks", "accessibility help text for mute button");
- if ([name isEqualToString:@"UnMuteButton"])
- return UI_STRING("unmute audio tracks", "accessibility help text for un mute button");
- if ([name isEqualToString:@"PlayButton"])
- return UI_STRING("begin playback", "accessibility help text for play button");
- if ([name isEqualToString:@"PauseButton"])
- return UI_STRING("pause playback", "accessibility help text for pause button");
- if ([name isEqualToString:@"Slider"])
- return UI_STRING("movie time scrubber", "accessibility help text for timeline slider");
- if ([name isEqualToString:@"SliderThumb"])
- return UI_STRING("movie time scrubber thumb", "accessibility help text for timeline slider thumb");
- if ([name isEqualToString:@"RewindButton"])
- return UI_STRING("seek movie back 30 seconds", "accessibility help text for jump back 30 seconds button");
- if ([name isEqualToString:@"ReturnToRealtimeButton"])
- return UI_STRING("return streaming movie to real time", "accessibility help text for return streaming movie to real time button");
- if ([name isEqualToString:@"CurrentTimeDisplay"])
- return UI_STRING("current movie time in seconds", "accessibility help text for elapsed time display");
- if ([name isEqualToString:@"TimeRemainingDisplay"])
- return UI_STRING("number of seconds of movie remaining", "accessibility help text for remaining time display");
- if ([name isEqualToString:@"StatusDisplay"])
- return UI_STRING("current movie status", "accessibility help text for movie status display");
- if ([name isEqualToString:@"SeekBackButton"])
- return UI_STRING("seek quickly back", "accessibility help text for fast rewind button");
- if ([name isEqualToString:@"SeekForwardButton"])
- return UI_STRING("seek quickly forward", "accessibility help text for fast forward button");
- if ([name isEqualToString:@"FullscreenButton"])
- return UI_STRING("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button");
- if ([name isEqualToString:@"ShowClosedCaptionsButton"])
- return UI_STRING("start displaying closed captions", "accessibility help text for show closed captions button");
- if ([name isEqualToString:@"HideClosedCaptionsButton"])
- return UI_STRING("stop displaying closed captions", "accessibility help text for hide closed captions button");
- ASSERT_NOT_REACHED();
- return @"";
-}
-
-- (NSString*)localizedMediaTimeDescription:(float)time
-{
- if (!isfinite(time))
- return UI_STRING("indefinite time", "accessibility help text for an indefinite media controller time value");
-
- int seconds = (int)fabsf(time);
- int days = seconds / (60 * 60 * 24);
- int hours = seconds / (60 * 60);
- int minutes = (seconds / 60) % 60;
- seconds %= 60;
-
- if (days)
- return [NSString stringWithFormat:UI_STRING("%1$d days %2$d hours %3$d minutes %4$d seconds", "accessibility help text for media controller time value >= 1 day"), days, hours, minutes, seconds];
- else if (hours)
- return [NSString stringWithFormat:UI_STRING("%1$d hours %2$d minutes %3$d seconds", "accessibility help text for media controller time value >= 60 minutes"), hours, minutes, seconds];
- else if (minutes)
- return [NSString stringWithFormat:UI_STRING("%1$d minutes %2$d seconds", "accessibility help text for media controller time value >= 60 seconds"), minutes, seconds];
-
- return [NSString stringWithFormat:UI_STRING("%1$d seconds", "accessibility help text for media controller time value < 60 seconds"), seconds];
-}
-
-- (NSString *)validationMessageValueMissingText
-{
- return UI_STRING("value missing", "Validation message for required form control elements that have no value");
-}
-
-- (NSString *)validationMessageTypeMismatchText
-{
- return UI_STRING("type mismatch", "Validation message for input form controls with a value not matching type");
-}
-
-- (NSString *)validationMessagePatternMismatchText
-{
- return UI_STRING("pattern mismatch", "Validation message for input form controls requiring a constrained value according to pattern");
-}
-
-- (NSString *)validationMessageTooLongText
-{
- return UI_STRING("too long", "Validation message for form control elements with a value longer than maximum allowed length");
-}
-
-- (NSString *)validationMessageRangeUnderflowText
-{
- return UI_STRING("range underflow", "Validation message for input form controls with value lower than allowed minimum");
-}
-
-- (NSString *)validationMessageRangeOverflowText
-{
- return UI_STRING("range overflow", "Validation message for input form controls with value higher than allowed maximum");
-}
-
-- (NSString *)validationMessageStepMismatchText
-{
- return UI_STRING("step mismatch", "Validation message for input form controls with value not respecting the step attribute");
-}
-
@end
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index f7b83ea..3d878bc 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -141,6 +141,7 @@
#import <WebCore/RenderWidget.h>
#import <WebCore/ResourceHandle.h>
#import <WebCore/RuntimeApplicationChecks.h>
+#import <WebCore/SchemeRegistry.h>
#import <WebCore/ScriptController.h>
#import <WebCore/ScriptValue.h>
#import <WebCore/SecurityOrigin.h>
@@ -671,12 +672,17 @@ static bool shouldEnableLoadDeferring()
didOneTimeInitialization = true;
}
+ Page::PageClients pageClients;
+ pageClients.chromeClient = new WebChromeClient(self);
+ pageClients.contextMenuClient = new WebContextMenuClient(self);
+ pageClients.editorClient = new WebEditorClient(self);
+ pageClients.dragClient = new WebDragClient(self);
+ pageClients.inspectorClient = new WebInspectorClient(self);
+ pageClients.pluginHalterClient = new WebPluginHalterClient(self);
#if ENABLE(CLIENT_BASED_GEOLOCATION)
- WebGeolocationControllerClient* geolocationControllerClient = new WebGeolocationControllerClient(self);
-#else
- WebGeolocationControllerClient* geolocationControllerClient = 0;
+ pageClients.geolocationControllerClient = new WebGeolocationControllerClient(self);
#endif
- _private->page = new Page(new WebChromeClient(self), new WebContextMenuClient(self), new WebEditorClient(self), new WebDragClient(self), new WebInspectorClient(self), new WebPluginHalterClient(self), geolocationControllerClient, 0, 0);
+ _private->page = new Page(pageClients);
_private->page->setCanStartMedia([self window]);
_private->page->settings()->setLocalStorageDatabasePath([[self preferences] _localStorageDatabasePath]);
@@ -2500,7 +2506,7 @@ static PassOwnPtr<Vector<String> > toStringVector(NSArray* patterns)
+ (void)_registerURLSchemeAsSecure:(NSString *)scheme
{
- SecurityOrigin::registerURLSchemeAsSecure(scheme);
+ SchemeRegistry::registerURLSchemeAsSecure(scheme);
}
@end
@@ -2734,7 +2740,7 @@ static PassOwnPtr<Vector<String> > toStringVector(NSArray* patterns)
+ (void)registerURLSchemeAsLocal:(NSString *)protocol
{
- SecurityOrigin::registerURLSchemeAsLocal(protocol);
+ SchemeRegistry::registerURLSchemeAsLocal(protocol);
}
- (id)_initWithArguments:(NSDictionary *) arguments
diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp
index 8fbb8e2..8a94c9b 100644
--- a/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/WebKit/qt/Api/qgraphicswebview.cpp
@@ -319,8 +319,9 @@ bool QGraphicsWebView::sceneEvent(QEvent* event)
|| event->type() == QEvent::TouchEnd
|| event->type() == QEvent::TouchUpdate)) {
d->page->event(event);
- if (event->isAccepted())
- return true;
+
+ // Always return true so that we'll receive also TouchUpdate and TouchEnd events
+ return true;
}
#endif
diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp
index d1741ca..f10d5b4 100644
--- a/WebKit/qt/Api/qwebframe.cpp
+++ b/WebKit/qt/Api/qwebframe.cpp
@@ -784,6 +784,10 @@ void QWebFrame::load(const QNetworkRequest &req,
The \a html is loaded immediately; external objects are loaded asynchronously.
+ If a script in the \a html runs longer than the default script timeout (currently 10 seconds),
+ for example due to being blocked by a modal JavaScript alert dialog, this method will return
+ as soon as possible after the timeout and any subsequent \a html will be loaded asynchronously.
+
When using this method WebKit assumes that external resources such as JavaScript programs or style
sheets are encoded in UTF-8 unless otherwise specified. For example, the encoding of an external
script can be specified through the charset attribute of the HTML script tag. It is also possible
diff --git a/WebKit/qt/Api/qwebkitglobal.h b/WebKit/qt/Api/qwebkitglobal.h
index d83d569..a6be571 100644
--- a/WebKit/qt/Api/qwebkitglobal.h
+++ b/WebKit/qt/Api/qwebkitglobal.h
@@ -22,9 +22,9 @@
#include <QtCore/qglobal.h>
-#define QTWEBKIT_VERSION_STR "2.1.0"
+#define QTWEBKIT_VERSION_STR "2.2.0"
// QTWEBKIT_VERSION is (major << 16) + (minor << 8) + patch. Similar to Qt.
-#define QTWEBKIT_VERSION 0x020100
+#define QTWEBKIT_VERSION 0x020200
// Use: #if (QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 0, 0)). Similar to Qt.
#define QTWEBKIT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index 35219a9..fa49293 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -49,6 +49,7 @@
#include "DragController.h"
#include "DragData.h"
#include "EditorClientQt.h"
+#include "SchemeRegistry.h"
#include "SecurityOrigin.h"
#include "Settings.h"
#include "Page.h"
@@ -268,11 +269,13 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
WebCore::Font::setCodePath(WebCore::Font::Complex);
#endif
- chromeClient = new ChromeClientQt(q);
- contextMenuClient = new ContextMenuClientQt();
- editorClient = new EditorClientQt(q);
- page = new Page(chromeClient, contextMenuClient, editorClient,
- new DragClientQt(q), new InspectorClientQt(q), 0, 0, 0, 0);
+ Page::PageClients pageClients;
+ pageClients.chromeClient = new ChromeClientQt(q);
+ pageClients.contextMenuClient = new ContextMenuClientQt();
+ pageClients.editorClient = new EditorClientQt(q);
+ pageClients.dragClient = new DragClientQt(q);
+ pageClients.inspectorClient = new InspectorClientQt(q);
+ page = new Page(pageClients);
settings = new QWebSettings(page->settings());
@@ -1390,14 +1393,17 @@ bool QWebPagePrivate::handleScrolling(QKeyEvent *ev, Frame *frame)
}
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
-void QWebPagePrivate::touchEvent(QTouchEvent* event)
+bool QWebPagePrivate::touchEvent(QTouchEvent* event)
{
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
if (!frame->view())
- return;
+ return false;
- bool accepted = frame->eventHandler()->handleTouchEvent(PlatformTouchEvent(event));
- event->setAccepted(accepted);
+ // Always accept the QTouchEvent so that we'll receive also TouchUpdate and TouchEnd events
+ event->setAccepted(true);
+
+ // Return whether the default action was cancelled in the JS event handler
+ return frame->eventHandler()->handleTouchEvent(PlatformTouchEvent(event));
}
#endif
@@ -2107,6 +2113,20 @@ bool QWebPage::allowGeolocationRequest(QWebFrame *frame)
#endif
}
+void QWebPage::setUserPermission(QWebFrame* frame, PermissionDomain domain, PermissionPolicy policy)
+{
+ switch (domain) {
+ case NotificationsPermissionDomain:
+#if ENABLE(NOTIFICATIONS)
+ if (policy == PermissionGranted)
+ NotificationPresenterClientQt::notificationPresenter()->allowNotificationForFrame(frame);
+#endif
+ break;
+ default:
+ break;
+ }
+}
+
/*!
This function is called whenever WebKit wants to create a new window of the given \a type, for
example when a JavaScript program requests to open a document in a new window.
@@ -2393,7 +2413,7 @@ bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &
return true;
case DelegateExternalLinks:
- if (WebCore::SecurityOrigin::shouldTreatURLSchemeAsLocal(request.url().scheme()))
+ if (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal(request.url().scheme()))
return true;
emit linkClicked(request.url());
return false;
@@ -2827,8 +2847,8 @@ bool QWebPage::event(QEvent *ev)
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
- d->touchEvent(static_cast<QTouchEvent*>(ev));
- break;
+ // Return whether the default action was cancelled in the JS event handler
+ return d->touchEvent(static_cast<QTouchEvent*>(ev));
#endif
#ifndef QT_NO_PROPERTIES
case QEvent::DynamicPropertyChange:
diff --git a/WebKit/qt/Api/qwebpage.h b/WebKit/qt/Api/qwebpage.h
index fcaa302..f0d2438 100644
--- a/WebKit/qt/Api/qwebpage.h
+++ b/WebKit/qt/Api/qwebpage.h
@@ -195,6 +195,16 @@ public:
WebModalDialog
};
+ enum PermissionPolicy {
+ PermissionGranted,
+ PermissionUnknown,
+ PermissionDenied
+ };
+
+ enum PermissionDomain {
+ NotificationsPermissionDomain
+ };
+
class ViewportHints {
public:
ViewportHints();
@@ -290,6 +300,8 @@ public:
QMenu *createStandardContextMenu();
+ void setUserPermission(QWebFrame* frame, PermissionDomain domain, PermissionPolicy policy);
+
enum Extension {
ChooseMultipleFilesExtension,
ErrorPageExtension
@@ -371,6 +383,10 @@ Q_SIGNALS:
void viewportChangeRequested(const QWebPage::ViewportHints& hints);
+ void requestPermissionFromUser(QWebFrame* frame, QWebPage::PermissionDomain domain);
+ void checkPermissionFromUser(QWebFrame* frame, QWebPage::PermissionDomain domain, QWebPage::PermissionPolicy& policy);
+ void cancelRequestsForPermission(QWebFrame* frame, QWebPage::PermissionDomain domain);
+
protected:
virtual QWebPage *createWindow(WebWindowType type);
virtual QObject *createPlugin(const QString &classid, const QUrl &url, const QStringList &paramNames, const QStringList &paramValues);
diff --git a/WebKit/qt/Api/qwebpage_p.h b/WebKit/qt/Api/qwebpage_p.h
index 54a1523..44ceb87 100644
--- a/WebKit/qt/Api/qwebpage_p.h
+++ b/WebKit/qt/Api/qwebpage_p.h
@@ -132,7 +132,8 @@ public:
bool handleScrolling(QKeyEvent*, WebCore::Frame*);
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- void touchEvent(QTouchEvent*);
+ // Returns whether the default action was cancelled in the JS event handler
+ bool touchEvent(QTouchEvent*);
#endif
void setInspector(QWebInspector*);
diff --git a/WebKit/qt/Api/qwebsecurityorigin.cpp b/WebKit/qt/Api/qwebsecurityorigin.cpp
index fe25d2d..e8c8f33 100644
--- a/WebKit/qt/Api/qwebsecurityorigin.cpp
+++ b/WebKit/qt/Api/qwebsecurityorigin.cpp
@@ -25,6 +25,7 @@
#include "DatabaseTracker.h"
#include "KURL.h"
+#include "SchemeRegistry.h"
#include "SecurityOrigin.h"
#include <QStringList>
@@ -222,7 +223,7 @@ QList<QWebDatabase> QWebSecurityOrigin::databases() const
*/
void QWebSecurityOrigin::addLocalScheme(const QString& scheme)
{
- SecurityOrigin::registerURLSchemeAsLocal(scheme);
+ SchemeRegistry::registerURLSchemeAsLocal(scheme);
}
/*!
@@ -237,7 +238,7 @@ void QWebSecurityOrigin::addLocalScheme(const QString& scheme)
*/
void QWebSecurityOrigin::removeLocalScheme(const QString& scheme)
{
- SecurityOrigin::removeURLSchemeRegisteredAsLocal(scheme);
+ SchemeRegistry::removeURLSchemeRegisteredAsLocal(scheme);
}
/*!
@@ -251,7 +252,7 @@ void QWebSecurityOrigin::removeLocalScheme(const QString& scheme)
QStringList QWebSecurityOrigin::localSchemes()
{
QStringList list;
- const URLSchemesMap& map = SecurityOrigin::localURLSchemes();
+ const URLSchemesMap& map = SchemeRegistry::localURLSchemes();
URLSchemesMap::const_iterator end = map.end();
for (URLSchemesMap::const_iterator i = map.begin(); i != end; ++i) {
const QString scheme = *i;
diff --git a/WebKit/qt/Api/qwebsettings.cpp b/WebKit/qt/Api/qwebsettings.cpp
index 4ba6943..edd07da 100644
--- a/WebKit/qt/Api/qwebsettings.cpp
+++ b/WebKit/qt/Api/qwebsettings.cpp
@@ -457,12 +457,32 @@ QWebSettings::QWebSettings()
d->fontSizes.insert(QWebSettings::MinimumLogicalFontSize, 0);
d->fontSizes.insert(QWebSettings::DefaultFontSize, 16);
d->fontSizes.insert(QWebSettings::DefaultFixedFontSize, 13);
- d->fontFamilies.insert(QWebSettings::StandardFont, QLatin1String("Arial"));
- d->fontFamilies.insert(QWebSettings::FixedFont, QLatin1String("Courier New"));
- d->fontFamilies.insert(QWebSettings::SerifFont, QLatin1String("Times New Roman"));
- d->fontFamilies.insert(QWebSettings::SansSerifFont, QLatin1String("Arial"));
- d->fontFamilies.insert(QWebSettings::CursiveFont, QLatin1String("Arial"));
- d->fontFamilies.insert(QWebSettings::FantasyFont, QLatin1String("Arial"));
+
+ QFont defaultFont;
+ defaultFont.setStyleHint(QFont::Serif);
+ d->fontFamilies.insert(QWebSettings::StandardFont, defaultFont.defaultFamily());
+ d->fontFamilies.insert(QWebSettings::SerifFont, defaultFont.defaultFamily());
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
+ defaultFont.setStyleHint(QFont::Fantasy);
+ d->fontFamilies.insert(QWebSettings::FantasyFont, defaultFont.defaultFamily());
+
+ defaultFont.setStyleHint(QFont::Cursive);
+ d->fontFamilies.insert(QWebSettings::CursiveFont, defaultFont.defaultFamily());
+#else
+ d->fontFamilies.insert(QWebSettings::FantasyFont, defaultFont.defaultFamily());
+ d->fontFamilies.insert(QWebSettings::CursiveFont, defaultFont.defaultFamily());
+#endif
+
+ defaultFont.setStyleHint(QFont::SansSerif);
+ d->fontFamilies.insert(QWebSettings::SansSerifFont, defaultFont.defaultFamily());
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
+ defaultFont.setStyleHint(QFont::Monospace);
+#else
+ defaultFont.setStyleHint(QFont::TypeWriter);
+#endif
+ d->fontFamilies.insert(QWebSettings::FixedFont, defaultFont.defaultFamily());
d->attributes.insert(QWebSettings::AutoLoadImages, true);
d->attributes.insert(QWebSettings::DnsPrefetchEnabled, false);
diff --git a/WebKit/qt/Api/qwebview.cpp b/WebKit/qt/Api/qwebview.cpp
index 2defdbb..3daa045 100644
--- a/WebKit/qt/Api/qwebview.cpp
+++ b/WebKit/qt/Api/qwebview.cpp
@@ -826,8 +826,9 @@ bool QWebView::event(QEvent *e)
|| e->type() == QEvent::TouchEnd
|| e->type() == QEvent::TouchUpdate) {
d->page->event(e);
- if (e->isAccepted())
- return true;
+
+ // Always return true so that we'll receive also TouchUpdate and TouchEnd events
+ return true;
#endif
} else if (e->type() == QEvent::Leave)
d->page->event(e);
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index edc8f52..455fd89 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,188 @@
+2010-07-28 Kim Grönholm <kim.1.gronholm@nokia.com>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] Decouple QTouchEvent's accepted flag from JS prevent default
+ https://bugs.webkit.org/show_bug.cgi?id=42892
+
+ Added comments to the touch event handling code.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::sceneEvent):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::touchEvent):
+ (QWebPage::event):
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ (QWebView::event):
+
+2010-07-26 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Page clients should be passed to Page constructor via structure of pointers
+ https://bugs.webkit.org/show_bug.cgi?id=42834
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+
+2010-07-27 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Incorrect input method hints
+ https://bugs.webkit.org/show_bug.cgi?id=43037
+
+ Properly set or reset all input method hints when
+ activating input fields.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::setInputMethodState):
+ * tests/qwebview/tst_qwebview.cpp:
+ (tst_QWebView::focusInputTypes): Extended unit test to verify that we
+ reset hints.
+
+2010-07-27 Kim Grönholm <kim.1.gronholm@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Decouple QTouchEvent's accepted flag from JS prevent default
+ https://bugs.webkit.org/show_bug.cgi?id=42892
+
+ We need to always accept the QTouchEvents in order to get TouchUpdate and
+ TouchEnd events. QWebPage::event() return value is used to indicate
+ whether the default action was prevented for the touch events.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::sceneEvent):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::touchEvent):
+ (QWebPage::event):
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ (QWebView::event):
+
+2010-07-26 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Change default font from sans-serif to serif
+
+ This matches what other ports and browser engines do.
+
+ We now also use QFont's defaultFontFamily() to resolve the
+ correct fonts for each platform. For Qt >= 4.7 we can take
+ advantage of the new enums for generic font families.
+
+ * Api/qwebsettings.cpp:
+
+2009-10-30 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Use the default timeout interval for JS as the HTML tokenizer delay for setHtml()
+
+ This ensures that long-running JavaScript (for example due to a modal alert() dialog),
+ will not trigger a deferred load after only 500ms (the default tokenizer delay) while
+ still giving a reasonable timeout (10 seconds) to prevent deadlock.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29381
+
+ * Api/qwebframe.cpp: Document the behaviour
+ * WebCoreSupport/FrameLoaderClientQt.cpp: set the custom tokenizer delay for substitute loads
+ * tests/qwebframe/tst_qwebframe.cpp: Add test
+
+2010-07-23 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc: Fixed incorrect QML property type.
+
+ * declarative/qdeclarativewebview.cpp:
+
+2010-07-23 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Build fix for Qt apps
+
+ Add webkit to QT_CONFIG. qconfig.pri will read qt_webkit_version.pri and
+ that's how it will pick up webkit in QT_CONFIG.
+
+ * qt_webkit_version.pri:
+
+2010-07-22 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] QtWebKit needs public API for Notifications.
+ https://bugs.webkit.org/show_bug.cgi?id=41413
+
+ Remove DumpRenderTree private API and introduce new API.
+ Also add support for informing the UI when a notification request is cancelled.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::setUserPermission):
+ * Api/qwebpage.h:
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+ * WebCoreSupport/NotificationPresenterClientQt.cpp:
+ (WebCore::NotificationPresenterClientQt::requestPermission):
+ (WebCore::NotificationPresenterClientQt::checkPermission):
+ (WebCore::NotificationPresenterClientQt::cancelRequestsForPermission):
+ (WebCore::NotificationPresenterClientQt::allowNotificationForFrame):
+ (WebCore::NotificationPresenterClientQt::toPage):
+ (WebCore::NotificationPresenterClientQt::toFrame):
+ * WebCoreSupport/NotificationPresenterClientQt.h:
+
+2010-07-22 Jamey Hicks <jamey.hicks@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Enable binding of QObjects to JavaScript environment for inspector frontend
+
+ This patch enables QObjects to be bound to global variables in the
+ javascript environment of the inspector frontend. This is useful
+ for writing alternate inspector frontends in javascript which need
+ additional native functionality. It's a lighter-weight alternative
+ than using an NPAPI plugin.
+
+ The code which instantiates QWebInspector uses this by setting the
+ dynamic property "q_inspectorJavaScriptWindowObjects" on the
+ QWebInspector. The value of this property should be a
+ QMap<QString,QVariant> mapping global variable name to QObject.
+
+ I have used this to add support for eclipse/chrome remote
+ debugging in QtTestBrowser.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41995
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientWebPage::InspectorClientWebPage):
+ (WebCore::InspectorClientWebPage::javaScriptWindowObjectCleared):
+ (WebCore::InspectorClientQt::openInspectorFrontend):
+
+2010-07-22 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Library versioning.
+
+ 2.1 is branched, trunk will become 2.2.
+
+ * Api/qwebkitglobal.h:
+ * qt_webkit_version.pri:
+
+2010-07-21 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ Break out "scheme registration" functionality from SecurityOrigin to a SchemeRegistry
+ https://bugs.webkit.org/show_bug.cgi?id=42783
+
+ * Api/qwebpage.cpp:
+ (QWebPage::acceptNavigationRequest):
+ * Api/qwebsecurityorigin.cpp:
+ (QWebSecurityOrigin::addLocalScheme):
+ (QWebSecurityOrigin::removeLocalScheme):
+ (QWebSecurityOrigin::localSchemes):
+
2010-07-20 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
[Qt] Add API to define device-width and height for use with the viewport meta tag
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
index a83e1a5..ddc9d7a 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -70,8 +70,6 @@
using namespace WebCore;
-CheckPermissionFunctionType* checkPermissionFunction = 0;
-RequestPermissionFunctionType* requestPermissionFunction = 0;
QMap<int, QWebScriptWorld*> m_worldMap;
DumpRenderTreeSupportQt::DumpRenderTreeSupportQt()
@@ -575,20 +573,6 @@ void DumpRenderTreeSupportQt::dumpNotification(bool b)
#endif
}
-void DumpRenderTreeSupportQt::setNotificationsReceiver(QObject* receiver)
-{
-#if ENABLE(NOTIFICATIONS)
- NotificationPresenterClientQt::notificationPresenter()->setReceiver(receiver);
-#endif
-}
-
-void DumpRenderTreeSupportQt::allowNotificationForOrigin(const QString& origin)
-{
-#if ENABLE(NOTIFICATIONS)
- NotificationPresenterClientQt::notificationPresenter()->allowNotificationForOrigin(origin);
-#endif
-}
-
void DumpRenderTreeSupportQt::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
{
#if ENABLE(GEOLOCATION)
@@ -605,16 +589,6 @@ void DumpRenderTreeSupportQt::setMockGeolocationError(int errorCode, const QStri
#endif
}
-void DumpRenderTreeSupportQt::setCheckPermissionFunction(CheckPermissionFunctionType* f)
-{
- checkPermissionFunction = f;
-}
-
-void DumpRenderTreeSupportQt::setRequestPermissionFunction(RequestPermissionFunctionType* f)
-{
- requestPermissionFunction = f;
-}
-
bool DumpRenderTreeSupportQt::isTargetItem(const QWebHistoryItem& historyItem)
{
QWebHistoryItem it = historyItem;
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
index 188c405..3a92158 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
@@ -32,17 +32,6 @@ class QWebPage;
class QWebHistoryItem;
class QWebScriptWorld;
-enum NotificationPermission {
- NotificationAllowed,
- NotificationNotAllowed,
- NotificationDenied
-};
-
-typedef void (CheckPermissionFunctionType) (QObject* receiver, const QUrl&, NotificationPermission&);
-typedef void (RequestPermissionFunctionType) (QObject* receiver, const QString&);
-
-extern CheckPermissionFunctionType* checkPermissionFunction;
-extern RequestPermissionFunctionType* requestPermissionFunction;
extern QMap<int, QWebScriptWorld*> m_worldMap;
class QWEBKIT_EXPORT DumpRenderTreeSupportQt {
@@ -123,13 +112,6 @@ public:
static void dumpNotification(bool b);
- // These functions should eventually turn into public API
- // and the "receiver" concept would go away
- static void setNotificationsReceiver(QObject* receiver);
- static void allowNotificationForOrigin(const QString& origin);
- static void setCheckPermissionFunction(CheckPermissionFunctionType*);
- static void setRequestPermissionFunction(RequestPermissionFunctionType*);
-
static QMap<QString, QWebHistoryItem> getChildHistoryItems(const QWebHistoryItem& historyItem);
static bool isTargetItem(const QWebHistoryItem& historyItem);
static QString historyItemTarget(const QWebHistoryItem& historyItem);
diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
index 74c8438..54993b1 100644
--- a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -603,20 +603,18 @@ void EditorClientQt::setInputMethodState(bool active)
inputElement = static_cast<HTMLInputElement*>(frame->document()->focusedNode());
if (inputElement) {
- if (!active) {
- // Setting the Qt::WA_InputMethodEnabled attribute true and Qt::ImhHiddenText flag
- // for password fields. The Qt platform is responsible for determining which widget
- // will receive input method events for password fields.
- active = inputElement->isPasswordField();
- webPageClient->setInputMethodHint(Qt::ImhHiddenText, active);
- } else {
- // Set input method hints for "number", "tel", "email", and "url" input elements.
- webPageClient->setInputMethodHint(Qt::ImhDialableCharactersOnly, inputElement->isTelephoneField());
- webPageClient->setInputMethodHint(Qt::ImhDigitsOnly, inputElement->isNumberField());
- webPageClient->setInputMethodHint(Qt::ImhEmailCharactersOnly, inputElement->isEmailField());
- webPageClient->setInputMethodHint(Qt::ImhUrlCharactersOnly, inputElement->isUrlField());
- webPageClient->setInputMethodHint(Qt::ImhHiddenText, inputElement->isPasswordField());
- }
+ // Set input method hints for "number", "tel", "email", "url" and "password" input elements.
+ webPageClient->setInputMethodHint(Qt::ImhDialableCharactersOnly, inputElement->isTelephoneField());
+ webPageClient->setInputMethodHint(Qt::ImhDigitsOnly, inputElement->isNumberField());
+ webPageClient->setInputMethodHint(Qt::ImhEmailCharactersOnly, inputElement->isEmailField());
+ webPageClient->setInputMethodHint(Qt::ImhUrlCharactersOnly, inputElement->isUrlField());
+ // Setting the Qt::WA_InputMethodEnabled attribute true and Qt::ImhHiddenText flag
+ // for password fields. The Qt platform is responsible for determining which widget
+ // will receive input method events for password fields.
+ bool isPasswordField = inputElement->isPasswordField();
+ webPageClient->setInputMethodHint(Qt::ImhHiddenText, isPasswordField);
+ if (isPasswordField)
+ active = true;
}
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(Q_OS_SYMBIAN)
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index fc0f6c3..9fe66d9 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -39,6 +39,7 @@
#include "FrameView.h"
#include "DocumentLoader.h"
#include "HitTestResult.h"
+#include "JSDOMWindowBase.h"
#include "MIMETypeRegistry.h"
#include "MouseEvent.h"
#include "ResourceResponse.h"
@@ -879,8 +880,15 @@ bool FrameLoaderClientQt::shouldFallBack(const WebCore::ResourceError&)
WTF::PassRefPtr<WebCore::DocumentLoader> FrameLoaderClientQt::createDocumentLoader(const WebCore::ResourceRequest& request, const SubstituteData& substituteData)
{
RefPtr<DocumentLoader> loader = DocumentLoader::create(request, substituteData);
- if (!deferMainResourceDataLoad || substituteData.isValid())
+ if (!deferMainResourceDataLoad || substituteData.isValid()) {
loader->setDeferMainResourceDataLoad(false);
+ // Use the default timeout interval for JS as the HTML tokenizer delay. This ensures
+ // that long-running JavaScript will still allow setHtml() to be synchronous, while
+ // still giving a reasonable timeout to prevent deadlock.
+ double delay = JSDOMWindowBase::commonJSGlobalData()->timeoutChecker.timeoutInterval() / 1000.0f;
+ m_frame->page()->setCustomHTMLTokenizerTimeDelay(delay);
+ } else
+ m_frame->page()->setCustomHTMLTokenizerTimeDelay(-1);
return loader.release();
}
diff --git a/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
index 2cc7e50..e13f6c3 100644
--- a/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -44,6 +44,7 @@
#include "qwebview.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QSettings>
+#include <QtCore/QVariant>
namespace WebCore {
@@ -60,6 +61,7 @@ public:
InspectorClientWebPage(QObject* parent = 0)
: QWebPage(parent)
{
+ connect(mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), SLOT(javaScriptWindowObjectCleared()));
}
QWebPage* createWindow(QWebPage::WebWindowType)
@@ -70,6 +72,25 @@ public:
view->setAttribute(Qt::WA_DeleteOnClose);
return page;
}
+
+public slots:
+ void javaScriptWindowObjectCleared()
+ {
+#ifndef QT_NO_PROPERTIES
+ QVariant inspectorJavaScriptWindowObjects = property("_q_inspectorJavaScriptWindowObjects");
+ if (!inspectorJavaScriptWindowObjects.isValid())
+ return;
+ QMap<QString, QVariant> javaScriptNameObjectMap = inspectorJavaScriptWindowObjects.toMap();
+ QWebFrame* frame = mainFrame();
+ QMap<QString, QVariant>::const_iterator it = javaScriptNameObjectMap.constBegin();
+ for ( ; it != javaScriptNameObjectMap.constEnd(); ++it) {
+ QString name = it.key();
+ QVariant value = it.value();
+ QObject* obj = value.value<QObject*>();
+ frame->addToJavaScriptWindowObject(name, obj);
+ }
+#endif
+ }
};
InspectorClientQt::InspectorClientQt(QWebPage* page)
@@ -100,6 +121,12 @@ void InspectorClientQt::openInspectorFrontend(WebCore::InspectorController*)
#endif
if (!inspectorUrl.isValid())
inspectorUrl = QUrl("qrc:/webkit/inspector/inspector.html");
+
+#ifndef QT_NO_PROPERTIES
+ QVariant inspectorJavaScriptWindowObjects = inspector->property("_q_inspectorJavaScriptWindowObjects");
+ if (inspectorJavaScriptWindowObjects.isValid())
+ inspectorPage->setProperty("_q_inspectorJavaScriptWindowObjects", inspectorJavaScriptWindowObjects);
+#endif
inspectorView->page()->mainFrame()->load(inspectorUrl);
m_inspectedWebPage->d->inspectorFrontend = inspectorView;
inspector->d->setFrontend(inspectorView);
diff --git a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
index ee69103..477e205 100644
--- a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
@@ -36,11 +36,14 @@
#include "DumpRenderTreeSupportQt.h"
#include "EventNames.h"
#include "KURL.h"
+#include "Page.h"
#include "QtPlatformPlugin.h"
#include "ScriptExecutionContext.h"
#include "SecurityOrigin.h"
+#include "qwebframe_p.h"
#include "qwebkitglobal.h"
+#include "qwebpage.h"
#include <QtGui>
namespace WebCore {
@@ -259,53 +262,77 @@ void NotificationPresenterClientQt::requestPermission(ScriptExecutionContext* co
if (dumpNotification)
printf("DESKTOP NOTIFICATION PERMISSION REQUESTED: %s\n", QString(context->securityOrigin()->toString()).toUtf8().constData());
- QString originString = context->securityOrigin()->toString();
- QHash<QString, QList<RefPtr<VoidCallback> > >::iterator iter = m_pendingPermissionRequests.find(originString);
+ QHash<ScriptExecutionContext*, CallbacksInfo >::iterator iter = m_pendingPermissionRequests.find(context);
if (iter != m_pendingPermissionRequests.end())
- iter.value().append(callback);
+ iter.value().m_callbacks.append(callback);
else {
- QList<RefPtr<VoidCallback> > callbacks;
RefPtr<VoidCallback> cb = callback;
- callbacks.append(cb);
- m_pendingPermissionRequests.insert(originString, callbacks);
- if (requestPermissionFunction)
- requestPermissionFunction(m_receiver, originString);
+ CallbacksInfo info;
+ info.m_frame = toFrame(context);
+ info.m_callbacks.append(cb);
+ m_pendingPermissionRequests.insert(context, info);
+
+ if (toPage(context) && toFrame(context)) {
+ m_pendingPermissionRequests.insert(context, info);
+ emit toPage(context)->requestPermissionFromUser(toFrame(context), QWebPage::NotificationsPermissionDomain);
+ }
}
}
NotificationPresenter::Permission NotificationPresenterClientQt::checkPermission(ScriptExecutionContext* context)
{
- NotificationPermission permission = NotificationNotAllowed;
- QString origin = context->url().string();
- if (checkPermissionFunction)
- checkPermissionFunction(m_receiver, origin, permission);
- switch (permission) {
- case NotificationAllowed:
+ QWebPage::PermissionPolicy policy = QWebPage::PermissionUnknown;
+ if (toPage(context) && toFrame(context))
+ emit toPage(context)->checkPermissionFromUser(toFrame(context), QWebPage::NotificationsPermissionDomain, policy);
+
+ switch (policy) {
+ case QWebPage::PermissionGranted:
return NotificationPresenter::PermissionAllowed;
- case NotificationNotAllowed:
+ case QWebPage::PermissionUnknown:
return NotificationPresenter::PermissionNotAllowed;
- case NotificationDenied:
+ case QWebPage::PermissionDenied:
return NotificationPresenter::PermissionDenied;
}
ASSERT_NOT_REACHED();
return NotificationPresenter::PermissionNotAllowed;
}
-void NotificationPresenterClientQt::cancelRequestsForPermission(ScriptExecutionContext*)
+void NotificationPresenterClientQt::cancelRequestsForPermission(ScriptExecutionContext* context)
{
- // FIXME: This will be implemented for https://bugs.webkit.org/show_bug.cgi?id=41413
- // to avoid adding and removing new private API
+ QHash<ScriptExecutionContext*, CallbacksInfo >::iterator iter = m_pendingPermissionRequests.find(context);
+ if (iter == m_pendingPermissionRequests.end())
+ return;
+
+ QWebFrame* frame = iter.value().m_frame;
+ if (!frame)
+ return;
+ QWebPage* page = frame->page();
+ m_pendingPermissionRequests.erase(iter);
+
+ if (!page)
+ return;
+
+ if (dumpNotification)
+ printf("DESKTOP NOTIFICATION PERMISSION REQUEST CANCELLED: %s\n", QString(context->securityOrigin()->toString()).toUtf8().constData());
+
+ emit page->cancelRequestsForPermission(frame, QWebPage::NotificationsPermissionDomain);
}
-void NotificationPresenterClientQt::allowNotificationForOrigin(const QString& origin)
+void NotificationPresenterClientQt::allowNotificationForFrame(QWebFrame* frame)
{
- QHash<QString, QList<RefPtr<VoidCallback> > >::iterator iter = m_pendingPermissionRequests.find(origin);
- if (iter != m_pendingPermissionRequests.end()) {
- QList<RefPtr<VoidCallback> >& callbacks = iter.value();
- for (int i = 0; i < callbacks.size(); i++)
- callbacks.at(i)->handleEvent();
- m_pendingPermissionRequests.remove(origin);
+ QHash<ScriptExecutionContext*, CallbacksInfo>::iterator iter = m_pendingPermissionRequests.begin();
+ while (iter != m_pendingPermissionRequests.end()) {
+ if (toFrame(iter.key()) == frame)
+ break;
}
+
+ if (iter == m_pendingPermissionRequests.end())
+ return;
+
+ QList<RefPtr<VoidCallback> >& callbacks = iter.value().m_callbacks;
+ for (int i = 0; i < callbacks.size(); i++)
+ callbacks.at(i)->handleEvent();
+ m_pendingPermissionRequests.remove(iter.key());
}
void NotificationPresenterClientQt::sendEvent(Notification* notification, const AtomicString& eventName)
@@ -362,6 +389,34 @@ void NotificationPresenterClientQt::dumpShowText(Notification* notification)
}
}
+QWebPage* NotificationPresenterClientQt::toPage(ScriptExecutionContext* context)
+{
+ if (!context || context->isWorkerContext())
+ return 0;
+
+ Document* document = static_cast<Document*>(context);
+ if (!document)
+ return 0;
+
+ Page* page = document->page();
+ if (!page || !page->mainFrame())
+ return 0;
+
+ return QWebFramePrivate::kit(page->mainFrame())->page();
+}
+
+QWebFrame* NotificationPresenterClientQt::toFrame(ScriptExecutionContext* context)
+{
+ if (!context || context->isWorkerContext())
+ return 0;
+
+ Document* document = static_cast<Document*>(context);
+ if (!document || !document->frame())
+ return 0;
+
+ return QWebFramePrivate::kit(document->frame());
+}
+
#endif // ENABLE(NOTIFICATIONS)
}
diff --git a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
index b99393b..e8481d4 100644
--- a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
+++ b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
@@ -42,6 +42,9 @@
#include <QMultiHash>
#include <QSystemTrayIcon>
+class QWebFrame;
+class QWebPage;
+
namespace WebCore {
class Document;
@@ -90,12 +93,10 @@ public:
void cancel(NotificationWrapper*);
- void allowNotificationForOrigin(const QString& origin);
+ void allowNotificationForFrame(QWebFrame*);
static bool dumpNotification;
- void setReceiver(QObject* receiver) { m_receiver = receiver; }
-
void addClient() { m_clientCount++; }
void removeClient();
static NotificationPresenterClientQt* notificationPresenter();
@@ -109,11 +110,17 @@ private:
void detachNotification(Notification*);
void dumpReplacedIdText(Notification*);
void dumpShowText(Notification*);
+ QWebPage* toPage(ScriptExecutionContext*);
+ QWebFrame* toFrame(ScriptExecutionContext*);
int m_clientCount;
- QHash<QString, QList<RefPtr<VoidCallback> > > m_pendingPermissionRequests;
+ struct CallbacksInfo {
+ QWebFrame* m_frame;
+ QList<RefPtr<VoidCallback> > m_callbacks;
+ };
+ QHash<ScriptExecutionContext*, CallbacksInfo > m_pendingPermissionRequests;
+
NotificationsQueue m_notifications;
- QObject* m_receiver;
QtPlatformPlugin m_platformPlugin;
};
diff --git a/WebKit/qt/declarative/qdeclarativewebview.cpp b/WebKit/qt/declarative/qdeclarativewebview.cpp
index 0342c9f..9dcba60 100644
--- a/WebKit/qt/declarative/qdeclarativewebview.cpp
+++ b/WebKit/qt/declarative/qdeclarativewebview.cpp
@@ -612,7 +612,7 @@ QAction* QDeclarativeWebView::stopAction() const
#endif // QT_NO_ACTION
/*!
- \qmlproperty real WebView::title
+ \qmlproperty string WebView::title
This property holds the title of the web page currently viewed
By default, this property contains an empty string.
diff --git a/WebKit/qt/qt_webkit_version.pri b/WebKit/qt/qt_webkit_version.pri
index 1656f2d..ca6299a 100644
--- a/WebKit/qt/qt_webkit_version.pri
+++ b/WebKit/qt/qt_webkit_version.pri
@@ -1,4 +1,5 @@
-QT_WEBKIT_VERSION = 4.8.0
+QT_WEBKIT_VERSION = 4.9.0
QT_WEBKIT_MAJOR_VERSION = 4
-QT_WEBKIT_MINOR_VERSION = 8
+QT_WEBKIT_MINOR_VERSION = 9
QT_WEBKIT_PATCH_VERSION = 0
+QT_CONFIG *= webkit
diff --git a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index 3d03157..b208447 100644
--- a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -601,6 +601,7 @@ private slots:
void setHtml();
void setHtmlWithResource();
void setHtmlWithBaseURL();
+ void setHtmlWithJSAlert();
void ipv6HostEncoding();
void metaData();
#if !defined(Q_WS_MAEMO_5)
@@ -2555,6 +2556,33 @@ void tst_QWebFrame::setHtmlWithBaseURL()
QCOMPARE(m_view->page()->history()->count(), 0);
}
+class MyPage : public QWebPage
+{
+public:
+ MyPage() : QWebPage(), alerts(0) {}
+ int alerts;
+
+protected:
+ virtual void javaScriptAlert(QWebFrame*, const QString& msg)
+ {
+ alerts++;
+ QCOMPARE(msg, QString("foo"));
+ // Should not be enough to trigger deferred loading, since we've upped the HTML
+ // tokenizer delay in the Qt frameloader. See HTMLTokenizer::continueProcessing()
+ QTest::qWait(1000);
+ }
+};
+
+void tst_QWebFrame::setHtmlWithJSAlert()
+{
+ QString html("<html><head></head><body><script>alert('foo');</script><p>hello world</p></body></html>");
+ MyPage page;
+ m_view->setPage(&page);
+ page.mainFrame()->setHtml(html);
+ QCOMPARE(page.alerts, 1);
+ QCOMPARE(m_view->page()->mainFrame()->toHtml(), html);
+}
+
class TestNetworkManager : public QNetworkAccessManager
{
public:
diff --git a/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/WebKit/qt/tests/qwebview/tst_qwebview.cpp
index 835ad82..5dc5e41 100644
--- a/WebKit/qt/tests/qwebview/tst_qwebview.cpp
+++ b/WebKit/qt/tests/qwebview/tst_qwebview.cpp
@@ -267,23 +267,36 @@ void tst_QWebView::focusInputTypes()
// 'password' field
webView->fireMouseClick(QPoint(20, 60));
- QVERIFY(webView->inputMethodHints() & Qt::ImhHiddenText);
+ QVERIFY(webView->inputMethodHints() == Qt::ImhHiddenText);
// 'tel' field
webView->fireMouseClick(QPoint(20, 110));
- QVERIFY(webView->inputMethodHints() & Qt::ImhDialableCharactersOnly);
+ QVERIFY(webView->inputMethodHints() == Qt::ImhDialableCharactersOnly);
// 'number' field
webView->fireMouseClick(QPoint(20, 160));
- QVERIFY(webView->inputMethodHints() & Qt::ImhDigitsOnly);
+ QVERIFY(webView->inputMethodHints() == Qt::ImhDigitsOnly);
// 'email' field
webView->fireMouseClick(QPoint(20, 210));
- QVERIFY(webView->inputMethodHints() & Qt::ImhEmailCharactersOnly);
+ QVERIFY(webView->inputMethodHints() == Qt::ImhEmailCharactersOnly);
// 'url' field
webView->fireMouseClick(QPoint(20, 260));
- QVERIFY(webView->inputMethodHints() & Qt::ImhUrlCharactersOnly);
+ QVERIFY(webView->inputMethodHints() == Qt::ImhUrlCharactersOnly);
+
+ // 'password' field
+ webView->fireMouseClick(QPoint(20, 60));
+ QVERIFY(webView->inputMethodHints() == Qt::ImhHiddenText);
+
+ // 'text' type
+ webView->fireMouseClick(QPoint(20, 10));
+#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(Q_OS_SYMBIAN)
+ QVERIFY(webView->inputMethodHints() & Qt::ImhNoAutoUppercase);
+ QVERIFY(webView->inputMethodHints() & Qt::ImhNoPredictiveText);
+#else
+ QVERIFY(webView->inputMethodHints() == Qt::ImhNone);
+#endif
delete webView;
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 44869dc..6b81bcc 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,49 @@
+2010-07-26 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Page clients should be passed to Page constructor via structure of pointers
+ https://bugs.webkit.org/show_bug.cgi?id=42834
+
+ * WebView.cpp:
+ (WebView::initWithFrame):
+
+2010-07-27 Steve Block <steveblock@google.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Client-based Geolocation does not pass enableHighAccuracy option to controller and client
+ https://bugs.webkit.org/show_bug.cgi?id=40374
+
+ Stub out setEnableHighAccuracy method for the Win port.
+
+ * WebCoreSupport/WebGeolocationControllerClient.h:
+ (WebGeolocationControllerClient::setEnableHighAccuracy):
+
+2010-07-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ Fix for <rdar://problem/8222626>
+ Send textDidChangeInTextField delegate callback only in response to typing or other forms of user text input.
+
+ The function name no longer perfectly matches the behavior, but I didn't want to break any existing clients. Maybe we
+ should migrate to a new function name eventually
+
+ * WebCoreSupport/WebEditorClient.cpp:
+ (WebEditorClient::textDidChangeInTextField):
+
+2010-07-21 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ Break out "scheme registration" functionality from SecurityOrigin to a SchemeRegistry
+ https://bugs.webkit.org/show_bug.cgi?id=42783
+
+ * WebView.cpp:
+ (WebView::registerURLSchemeAsLocal):
+ (WebView::registerURLSchemeAsSecure):
+
2010-07-20 Steve Falkenburg <sfalken@apple.com>
Reviewed by Adam Roben.
diff --git a/WebKit/win/WebCoreSupport/WebEditorClient.cpp b/WebKit/win/WebCoreSupport/WebEditorClient.cpp
index e05951c..f03ffd6 100644
--- a/WebKit/win/WebCoreSupport/WebEditorClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebEditorClient.cpp
@@ -41,9 +41,10 @@
#include <WebCore/HTMLInputElement.h>
#include <WebCore/HTMLNames.h>
#include <WebCore/KeyboardEvent.h>
-#include <WebCore/PlatformKeyboardEvent.h>
#include <WebCore/NotImplemented.h>
+#include <WebCore/PlatformKeyboardEvent.h>
#include <WebCore/Range.h>
+#include <WebCore/UserTypingGestureIndicator.h>
#pragma warning(pop)
using namespace WebCore;
@@ -347,6 +348,9 @@ void WebEditorClient::textFieldDidEndEditing(Element* e)
void WebEditorClient::textDidChangeInTextField(Element* e)
{
+ if (!UserTypingGestureIndicator::processingUserTypingGesture() || UserTypingGestureIndicator::focusedElementAtGestureStart() != e)
+ return;
+
IWebFormDelegate* formDelegate;
if (SUCCEEDED(m_webView->formDelegate(&formDelegate)) && formDelegate) {
IDOMElement* domElement = DOMElement::createInstance(e);
diff --git a/WebKit/win/WebCoreSupport/WebGeolocationControllerClient.h b/WebKit/win/WebCoreSupport/WebGeolocationControllerClient.h
index ec0bef7..ed73454 100644
--- a/WebKit/win/WebCoreSupport/WebGeolocationControllerClient.h
+++ b/WebKit/win/WebCoreSupport/WebGeolocationControllerClient.h
@@ -42,6 +42,7 @@ public:
virtual void geolocationDestroyed();
virtual void startUpdating();
virtual void stopUpdating();
+ virtual void setEnableHighAccuracy(bool) { }
virtual WebCore::GeolocationPosition* lastPosition();
private:
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
index fb0aad5..41ae079 100644
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -118,6 +118,7 @@
#include <WebCore/RenderWidget.h>
#include <WebCore/ResourceHandle.h>
#include <WebCore/ResourceHandleClient.h>
+#include <WebCore/SchemeRegistry.h>
#include <WebCore/ScriptValue.h>
#include <WebCore/Scrollbar.h>
#include <WebCore/ScrollbarTheme.h>
@@ -2562,17 +2563,21 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame(
Settings::setShouldPaintNativeControls(shouldPaintNativeControls);
#endif
-#if ENABLE(CLIENT_BASED_GEOLOCATION)
- WebGeolocationControllerClient* geolocationControllerClient = new WebGeolocationControllerClient(this);
-#else
- WebGeolocationControllerClient* geolocationControllerClient = 0;
-#endif
-
BOOL useHighResolutionTimer;
if (SUCCEEDED(m_preferences->shouldUseHighResolutionTimers(&useHighResolutionTimer)))
Settings::setShouldUseHighResolutionTimers(useHighResolutionTimer);
- m_page = new Page(new WebChromeClient(this), new WebContextMenuClient(this), new WebEditorClient(this), new WebDragClient(this), new WebInspectorClient(this), new WebPluginHalterClient(this), geolocationControllerClient, 0, 0);
+ Page::PageClients pageClients;
+ pageClients.chromeClient = new WebChromeClient(this);
+ pageClients.contextMenuClient = new WebContextMenuClient(this);
+ pageClients.editorClient = new WebEditorClient(this);
+ pageClients.dragClient = new WebDragClient(this);
+ pageClients.inspectorClient = new WebInspectorClient(this);
+ pageClients.pluginHalterClient = new WebPluginHalterClient(this);
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
+ pageClients.geolocationControllerClient = new WebGeolocationControllerClient(this);
+#endif
+ m_page = new Page(pageClients);
BSTR localStoragePath;
if (SUCCEEDED(m_preferences->localStorageDatabasePath(&localStoragePath))) {
@@ -3652,7 +3657,7 @@ HRESULT STDMETHODCALLTYPE WebView::registerURLSchemeAsLocal(
if (!scheme)
return E_POINTER;
- SecurityOrigin::registerURLSchemeAsLocal(String(scheme, ::SysStringLen(scheme)));
+ SchemeRegistry::registerURLSchemeAsLocal(String(scheme, ::SysStringLen(scheme)));
return S_OK;
}
@@ -6412,7 +6417,7 @@ HRESULT WebView::setDomainRelaxationForbiddenForURLScheme(BOOL forbidden, BSTR s
HRESULT WebView::registerURLSchemeAsSecure(BSTR scheme)
{
- SecurityOrigin::registerURLSchemeAsSecure(toString(scheme));
+ SchemeRegistry::registerURLSchemeAsSecure(toString(scheme));
return S_OK;
}
diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog
index 32ff6fe..2195112 100644
--- a/WebKit/wx/ChangeLog
+++ b/WebKit/wx/ChangeLog
@@ -1,3 +1,76 @@
+2010-07-28 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] wxPython build fix that was missed in last commit.
+
+ * bindings/python/webview.i:
+
+2010-07-28 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix after recent changes.
+
+ * WebEdit.h: Added.
+ * bindings/python/webview.i:
+
+2010-07-28 Robin Dunn <robin@alldunn.com>
+
+ Reviewed by Kevin Ollivier.
+
+ Add DOM bindings support for wx port.
+
+ * WebBrowserShell.cpp:
+ (wxWebBrowserShell::wxWebBrowserShell):
+ (wxWebBrowserShell::OnEditCommand):
+ (wxWebBrowserShell::OnGetEditCommandState):
+ * WebBrowserShell.h:
+ * WebDOMSelection.cpp: Added.
+ (wxWebKitSelection::wxWebKitSelection):
+ (wxWebKitSelection::GetRootEditableElement):
+ (wxWebKitSelection::GetAsRange):
+ * WebDOMSelection.h: Added.
+ * WebFrame.cpp:
+ (wxWebFrame::GetSelectionAsHTML):
+ (wxWebFrame::GetSelectionAsText):
+ (wxWebFrame::GetSelection):
+ (wxWebFrame::ExecuteEditCommand):
+ (wxWebFrame::GetEditCommandState):
+ (wxWebFrame::GetEditCommandValue):
+ (wxWebFrame::HitTest):
+ * WebFrame.h:
+ * WebKitDefines.h:
+ * WebKitSupport/EditorClientWx.cpp:
+ (WebCore::):
+ (WebCore::EditorClientWx::redo):
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::finishedLoading):
+ (WebCore::FrameLoaderClientWx::setMainDocumentError):
+ (WebCore::FrameLoaderClientWx::dispatchDidFailLoading):
+ * WebView.cpp:
+ (wxWebViewDOMElementInfo::wxWebViewDOMElementInfo):
+ (wxWebViewDOMElementInfo::~wxWebViewDOMElementInfo):
+ (wxWebView::Create):
+ (wxWebView::GetSelection):
+ (wxWebView::GetSelectionAsHTML):
+ (wxWebView::GetSelectionAsText):
+ (wxWebView::ExecuteEditCommand):
+ (wxWebView::GetEditCommandState):
+ (wxWebView::GetEditCommandValue):
+ (wxWebView::MakeEditable):
+ (wxWebView::IsEditable):
+ * WebView.h:
+ * bindings/python/webview.i:
+ * bindings/python/wscript:
+ * wscript:
+
+2010-07-26 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Page clients should be passed to Page constructor via structure of pointers
+ https://bugs.webkit.org/show_bug.cgi?id=42834
+
+ * WebView.cpp:
+ (wxWebView::Create):
+
2010-07-16 Zhe Su <suzhe@chromium.org>
Reviewed by Darin Adler.
diff --git a/WebKit/wx/WebBrowserShell.cpp b/WebKit/wx/WebBrowserShell.cpp
index 8853051..b1ff578 100644
--- a/WebKit/wx/WebBrowserShell.cpp
+++ b/WebKit/wx/WebBrowserShell.cpp
@@ -35,8 +35,9 @@
#include "wx/artprov.h"
-#include "WebView.h"
#include "WebBrowserShell.h"
+#include "WebFrame.h"
+#include "WebView.h"
#include "WebViewPrivate.h"
wxPageSourceViewFrame::wxPageSourceViewFrame(const wxString& source)
@@ -63,7 +64,9 @@ enum {
ID_BROWSE = wxID_HIGHEST + 15,
ID_EDIT = wxID_HIGHEST + 16,
ID_RUN_SCRIPT = wxID_HIGHEST + 17,
- ID_WEBVIEW = wxID_HIGHEST + 18
+ ID_WEBVIEW = wxID_HIGHEST + 18,
+ ID_EDIT_COMMAND = wxID_HIGHEST + 19,
+ ID_GET_EDIT_COMMAND_STATE = wxID_HIGHEST + 20
};
BEGIN_EVENT_TABLE(wxWebBrowserShell, wxFrame)
@@ -88,6 +91,8 @@ BEGIN_EVENT_TABLE(wxWebBrowserShell, wxFrame)
EVT_MENU(ID_BROWSE, wxWebBrowserShell::OnBrowse)
EVT_MENU(ID_EDIT, wxWebBrowserShell::OnEdit)
EVT_MENU(ID_RUN_SCRIPT, wxWebBrowserShell::OnRunScript)
+ EVT_MENU(ID_EDIT_COMMAND, wxWebBrowserShell::OnEditCommand)
+ EVT_MENU(ID_GET_EDIT_COMMAND_STATE, wxWebBrowserShell::OnGetEditCommandState)
END_EVENT_TABLE()
@@ -123,6 +128,8 @@ wxWebBrowserShell::wxWebBrowserShell(const wxString& title) :
m_debugMenu = new wxMenu;
m_debugMenu->Append(ID_SET_SOURCE, _("Test SetPageSource"));
m_debugMenu->Append(ID_RUN_SCRIPT, _("Test RunScript"));
+ m_debugMenu->Append(ID_EDIT_COMMAND, _("Test EditCommand::Execute"));
+ m_debugMenu->Append(ID_GET_EDIT_COMMAND_STATE, _("Test EditCommand::GetState"));
// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
@@ -339,7 +346,8 @@ void wxWebBrowserShell::OnEdit(wxCommandEvent& event)
webview->MakeEditable(event.IsChecked());
}
-void wxWebBrowserShell::OnRunScript(wxCommandEvent& myEvent){
+void wxWebBrowserShell::OnRunScript(wxCommandEvent& myEvent)
+{
if (webview) {
wxTextEntryDialog* dialog = new wxTextEntryDialog(this, _("Type in a JavaScript to exectute."));
if (dialog->ShowModal() == wxID_OK)
@@ -348,3 +356,43 @@ void wxWebBrowserShell::OnRunScript(wxCommandEvent& myEvent){
dialog->Destroy();
}
}
+
+void wxWebBrowserShell::OnEditCommand(wxCommandEvent& myEvent)
+{
+ if (webview) {
+ if (!webview->IsEditable()) {
+ wxMessageBox(wxT("Please enable editing before running editing commands."));
+ return;
+ }
+
+ wxTextEntryDialog* dialog = new wxTextEntryDialog(this, _("Type in a editing command to exectute."));
+ if (dialog->ShowModal() == wxID_OK) {
+ bool result = webview->ExecuteEditCommand(dialog->GetValue());
+ if (!result)
+ wxMessageBox(wxT("Editing command failed."));
+ }
+ dialog->Destroy();
+ }
+}
+
+void wxWebBrowserShell::OnGetEditCommandState(wxCommandEvent& myEvent)
+{
+ if (webview) {
+ if (!webview->IsEditable()) {
+ wxMessageBox(wxT("Please enable editing before running editing commands."));
+ return;
+ }
+
+ wxTextEntryDialog* dialog = new wxTextEntryDialog(this, _("Type in a editing command whose state you want to get."));
+ if (dialog->ShowModal() == wxID_OK) {
+ EditState result = webview->GetEditCommandState(dialog->GetValue());
+ if (result == EditStateTrue)
+ wxMessageBox(wxT("State is true."));
+ else if (result == EditStateFalse)
+ wxMessageBox(wxT("State is false."));
+ else if (result == EditStateMixed)
+ wxMessageBox(wxT("State is mixed."));
+ }
+ dialog->Destroy();
+ }
+}
diff --git a/WebKit/wx/WebBrowserShell.h b/WebKit/wx/WebBrowserShell.h
index 2f43ffb..4fe9c03 100644
--- a/WebKit/wx/WebBrowserShell.h
+++ b/WebKit/wx/WebBrowserShell.h
@@ -80,6 +80,8 @@ protected:
// debug menu items
void OnSetSource(wxCommandEvent& event);
void OnRunScript(wxCommandEvent& myEvent);
+ void OnEditCommand(wxCommandEvent& myEvent);
+ void OnGetEditCommandState(wxCommandEvent& myEvent);
private:
wxTextCtrl* addressBar;
diff --git a/JavaScriptCore/jit/ExecutableAllocatorWin.cpp b/WebKit/wx/WebDOMSelection.cpp
index 2b13529..ce35ea4 100644
--- a/JavaScriptCore/jit/ExecutableAllocatorWin.cpp
+++ b/WebKit/wx/WebDOMSelection.cpp
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Kevin Ollivier <kevino@theolliviers.com>
+ *
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -10,59 +12,60 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE INC. OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. 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.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
+
#include "config.h"
+#include "WebDOMSelection.h"
-#include "ExecutableAllocator.h"
+#include "Element.h"
+#include "SelectionController.h"
+#include "WebDOMElement.h"
+#include "WebDOMRange.h"
-#if ENABLE(EXECUTABLE_ALLOCATOR_DEMAND) && OS(WINDOWS)
+#include <wtf/RefPtr.h>
-#include "windows.h"
+#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
-namespace JSC {
+IMPLEMENT_DYNAMIC_CLASS(wxWebKitSelection, wxObject)
-void ExecutableAllocator::intializePageSize()
+wxWebKitSelection::wxWebKitSelection(const wxWebKitSelection& other)
{
- SYSTEM_INFO system_info;
- GetSystemInfo(&system_info);
- ExecutableAllocator::pageSize = system_info.dwPageSize;
+ m_selection = other.m_selection;
}
-ExecutablePool::Allocation ExecutablePool::systemAlloc(size_t n)
+WebDOMElement* wxWebKitSelection::GetRootEditableElement() const
{
- void* allocation = VirtualAlloc(0, n, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
- if (!allocation)
- CRASH();
- ExecutablePool::Allocation alloc = {reinterpret_cast<char*>(allocation), n};
- return alloc;
-}
-
-void ExecutablePool::systemRelease(const ExecutablePool::Allocation& alloc)
-{
- VirtualFree(alloc.pages, 0, MEM_RELEASE);
+ if (m_selection)
+ return new WebDOMElement(m_selection->rootEditableElement());
+
+ return 0;
}
-bool ExecutableAllocator::isValid() const
+WebDOMRange* wxWebKitSelection::GetAsRange()
{
- return true;
+ if (m_selection) {
+ WTF::RefPtr<WebCore::Range> range = m_selection->toNormalizedRange();
+ // keep it alive until it reaches wxWebKitDOMRange, which takes ownership
+
+ if (range) {
+ range->ref();
+ return new WebDOMRange(range.get());
+ }
+ }
+
+ return 0;
}
-
-#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
-#error "ASSEMBLER_WX_EXCLUSIVE not yet suported on this platform."
-#endif
-
-}
-
-#endif // HAVE(ASSEMBLER)
diff --git a/WebCore/platform/win/PlatformScrollBarWin.cpp b/WebKit/wx/WebDOMSelection.h
index aa5333b..f9a2aa5 100644
--- a/WebCore/platform/win/PlatformScrollBarWin.cpp
+++ b/WebKit/wx/WebDOMSelection.h
@@ -1,6 +1,7 @@
/*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Brent Fulgham
+ * Copyright (C) 2008 Kevin Ollivier <kevino@theolliviers.com>
+ *
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,21 +24,46 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
+#ifndef WebDOMSelection_h
+#define WebDOMSelection_h
+
+#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
-#include "config.h"
-#include "PlatformScrollBar.h"
+#include "WebKitDefines.h"
-#include "FrameView.h"
-#include "ScrollbarClient.h"
-#include "ScrollbarTheme.h"
+class WebDOMElement;
+class WebDOMRange;
namespace WebCore {
-PlatformScrollbar::PlatformScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size,
- ScrollbarTheme* theme)
- : Scrollbar(client, orientation, size, theme)
-{
-}
+class SelectionController;
}
+class WXDLLIMPEXP_WEBKIT wxWebKitSelection : public wxObject {
+#ifndef SWIG
+DECLARE_DYNAMIC_CLASS(wxWebKitDOMSelection)
+#endif
+
+public:
+ wxWebKitSelection() {}
+ wxWebKitSelection(WebCore::SelectionController* selection)
+ : m_selection(selection)
+ { }
+
+ wxWebKitSelection(const wxWebKitSelection&);
+ ~wxWebKitSelection() { m_selection = 0; }
+
+ WebDOMElement* GetRootEditableElement() const;
+ WebDOMRange* GetAsRange();
+
+private:
+ WebCore::SelectionController* m_selection;
+
+};
+
+#endif
diff --git a/WebCore/platform/win/PlatformScrollBar.h b/WebKit/wx/WebEdit.h
index 89c6e4a..7099088 100644
--- a/WebCore/platform/win/PlatformScrollBar.h
+++ b/WebKit/wx/WebEdit.h
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Kevin Ollivier <kevino@theolliviers.com>
+ *
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -20,31 +22,41 @@
* 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.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
+#ifndef WXWEBEDIT_H
+#define WXWEBEDIT_H
-#ifndef PlatformScrollBar_h
-#define PlatformScrollBar_h
-
-#include "Scrollbar.h"
-#include "Timer.h"
-#include <wtf/PassRefPtr.h>
+#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
-typedef struct HDC__* HDC;
+#include "WebKitDefines.h"
namespace WebCore {
+ class CompositeEditCommand;
+ class WebCoreEditCommand;
+}
+
+class WebDOMElement;
+class wxWebFrame;
+
+class WXDLLIMPEXP_WEBKIT wxWebEditCommand
+{
+ friend class WebCore::CompositeEditCommand;
+ friend class WebCore::WebCoreEditCommand;
-class PlatformScrollbar : public Scrollbar {
public:
- static PassRefPtr<PlatformScrollbar> create(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size)
- {
- return adoptRef(new PlatformScrollbar(client, orientation, size));
- }
+ wxWebEditCommand(wxWebFrame*);
+ ~wxWebEditCommand();
- PlatformScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = 0);
+ void SetNodeAttribute(WebDOMElement*, const wxString&, const wxString&);
+ void Apply();
+
+private:
+ WebCore::WebCoreEditCommand* m_impl;
};
-}
-
-#endif // PlatformScrollBar_h
-
+#endif
diff --git a/WebKit/wx/WebFrame.cpp b/WebKit/wx/WebFrame.cpp
index e1f7ecc..b8d2ac2 100644
--- a/WebKit/wx/WebFrame.cpp
+++ b/WebKit/wx/WebFrame.cpp
@@ -59,6 +59,9 @@
#include "wx/wx.h"
#endif
+#include "WebDOMNode.h"
+
+#include "WebDOMSelection.h"
#include "WebFrame.h"
#include "WebView.h"
#include "WebFramePrivate.h"
@@ -193,6 +196,30 @@ wxString wxWebFrame::GetExternalRepresentation()
return externalRepresentation(m_impl->frame);
}
+wxString wxWebFrame::GetSelectionAsHTML()
+{
+ if (m_impl->frame)
+ return m_impl->frame->selection()->toNormalizedRange()->toHTML();
+
+ return wxEmptyString;
+}
+
+wxString wxWebFrame::GetSelectionAsText()
+{
+ if (m_impl->frame)
+ return m_impl->frame->selection()->toNormalizedRange()->text();
+
+ return wxEmptyString;
+}
+
+wxWebKitSelection wxWebFrame::GetSelection()
+{
+ if (m_impl->frame)
+ return wxWebKitSelection(m_impl->frame->selection());
+
+ return 0;
+}
+
wxString wxWebFrame::RunScript(const wxString& javascript)
{
wxString returnValue = wxEmptyString;
@@ -213,6 +240,36 @@ wxString wxWebFrame::RunScript(const wxString& javascript)
return returnValue;
}
+bool wxWebFrame::ExecuteEditCommand(const wxString& command, const wxString& parameter)
+{
+ if (m_impl->frame && IsEditable())
+ return m_impl->frame->editor()->command(command).execute(parameter);
+}
+
+EditState wxWebFrame::GetEditCommandState(const wxString& command) const
+{
+ if (m_impl->frame && IsEditable()) {
+ WebCore::TriState state = m_impl->frame->editor()->command(command).state();
+ if (state == WebCore::TrueTriState)
+ return EditStateTrue;
+ if (state == WebCore::FalseTriState)
+ return EditStateFalse;
+
+ return EditStateMixed;
+ }
+
+ return EditStateFalse;
+}
+
+wxString wxWebFrame::GetEditCommandValue(const wxString& command) const
+{
+ if (m_impl->frame && IsEditable())
+ return m_impl->frame->editor()->command(command).value();
+
+ return wxEmptyString;
+}
+
+
bool wxWebFrame::FindString(const wxString& string, bool forward, bool caseSensitive, bool wrapSelection, bool startInSelection)
{
if (m_impl->frame)
@@ -401,6 +458,7 @@ wxWebViewDOMElementInfo wxWebFrame::HitTest(const wxPoint& pos) const
if (m_impl->frame->view()) {
WebCore::HitTestResult result = m_impl->frame->eventHandler()->hitTestResultAtPoint(m_impl->frame->view()->windowToContents(pos), false);
if (result.innerNode()) {
+ domInfo.SetInnerNode(new WebDOMNode(result.innerNode()));
domInfo.SetLink(result.absoluteLinkURL().string());
domInfo.SetText(result.textContent());
domInfo.SetImageSrc(result.absoluteImageURL().string());
diff --git a/WebKit/wx/WebFrame.h b/WebKit/wx/WebFrame.h
index fec6257..f09c884 100644
--- a/WebKit/wx/WebFrame.h
+++ b/WebKit/wx/WebFrame.h
@@ -35,23 +35,31 @@
#include "WebKitDefines.h"
+class WebDOMElement;
+class WebDOMNode;
+
+#include "WebDOMSelection.h"
+
+class Element;
+
class WebFramePrivate;
class WebViewFrameData;
class wxWebView;
namespace WebCore {
class ChromeClientWx;
- class FrameLoaderClientWx;
class EditorClientWx;
- class Frame;
+ class FrameLoaderClientWx;
+ class Frame;
}
class WXDLLIMPEXP_WEBKIT wxWebViewDOMElementInfo
{
public:
wxWebViewDOMElementInfo();
+ wxWebViewDOMElementInfo(const wxWebViewDOMElementInfo& other);
- ~wxWebViewDOMElementInfo() { }
+ ~wxWebViewDOMElementInfo();
wxString GetTagName() const { return m_tagName; }
void SetTagName(const wxString& name) { m_tagName = name; }
@@ -67,9 +75,16 @@ public:
wxString GetLink() const { return m_link; }
void SetLink(const wxString& link) { m_link = link; }
+
+ WebDOMNode* GetInnerNode() { return m_innerNode; }
+ void SetInnerNode(WebDOMNode* node) { m_innerNode = node; }
+
+ WebDOMElement* GetURLElement() { return m_urlElement; }
+ void SetURLElement(WebDOMElement* url) { m_urlElement = url; }
private:
- void* m_domElement;
+ WebDOMNode* m_innerNode;
+ WebDOMElement* m_urlElement;
bool m_isSelected;
wxString m_tagName;
wxString m_text;
@@ -82,6 +97,7 @@ enum wxWebKitParseMode { Compat, AlmostStrict, Strict, NoDocument };
class WXDLLIMPEXP_WEBKIT wxWebFrame
{
+public:
// ChromeClientWx needs to get the Page* stored by the wxWebView
// for the createWindow function.
friend class WebCore::ChromeClientWx;
@@ -124,7 +140,14 @@ public:
wxString GetAsMarkup();
wxString GetExternalRepresentation();
+ wxWebKitSelection GetSelection();
+ wxString GetSelectionAsHTML();
+ wxString GetSelectionAsText();
+
wxString RunScript(const wxString& javascript);
+ bool ExecuteEditCommand(const wxString& command, const wxString& parameter = wxEmptyString);
+ EditState GetEditCommandState(const wxString& command) const;
+ wxString GetEditCommandValue(const wxString& command) const;
bool FindString(const wxString& string, bool forward = true,
bool caseSensitive = false, bool wrapSelection = true,
diff --git a/WebKit/wx/WebKitDefines.h b/WebKit/wx/WebKitDefines.h
index d973063..67ad868 100644
--- a/WebKit/wx/WebKitDefines.h
+++ b/WebKit/wx/WebKitDefines.h
@@ -42,4 +42,7 @@
#define WXDLLIMPEXP_WEBKIT
#endif // SWIG
+// enums
+enum EditState { EditStateTrue, EditStateFalse, EditStateMixed };
+
#endif // WebKitDefines_h
diff --git a/WebKit/wx/WebKitSupport/EditorClientWx.cpp b/WebKit/wx/WebKitSupport/EditorClientWx.cpp
index 2355141..64bfd06 100644
--- a/WebKit/wx/WebKitSupport/EditorClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/EditorClientWx.cpp
@@ -109,7 +109,7 @@ static const KeyDownEntry keyDownEntries[] = {
{ VK_RETURN, 0, "InsertNewline" },
{ VK_RETURN, CtrlKey, "InsertNewline" },
{ VK_RETURN, AltKey, "InsertNewline" },
- { VK_RETURN, AltKey | ShiftKey, "InsertNewline" },
+ { VK_RETURN, ShiftKey, "InsertLineBreak" },
{ 'A', CtrlKey, "SelectAll" },
{ 'Z', CtrlKey, "Undo" },
{ 'Z', CtrlKey | ShiftKey, "Redo" },
@@ -363,8 +363,8 @@ void EditorClientWx::redo()
if (frame) {
wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->hostWindow()->platformPageClient());
if (webKitWin) {
- webKitWin->m_impl->redoStack.first().editCommand()->reapply();
- webKitWin->m_impl->redoStack.remove(0);
+ webKitWin->m_impl->redoStack.last().editCommand()->reapply();
+ webKitWin->m_impl->redoStack.removeLast();
}
}
}
diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
index a163727..5b708c2 100644
--- a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
@@ -430,9 +430,15 @@ void FrameLoaderClientWx::didChangeTitle(DocumentLoader *l)
}
-void FrameLoaderClientWx::finishedLoading(DocumentLoader*)
+void FrameLoaderClientWx::finishedLoading(DocumentLoader* loader)
{
- if (m_pluginView) {
+ if (!m_pluginView) {
+ if (m_firstData) {
+ FrameLoader* fl = loader->frameLoader();
+ fl->writer()->setEncoding(m_response.textEncodingName(), false);
+ m_firstData = false;
+ }
+ } else {
m_pluginView->didFinishLoading();
m_pluginView = 0;
m_hasSentResponseToPlugin = false;
@@ -598,9 +604,12 @@ bool FrameLoaderClientWx::canCachePage() const
return false;
}
-void FrameLoaderClientWx::setMainDocumentError(WebCore::DocumentLoader*, const WebCore::ResourceError&)
+void FrameLoaderClientWx::setMainDocumentError(WebCore::DocumentLoader* loader, const WebCore::ResourceError&)
{
- notImplemented();
+ if (m_firstData) {
+ loader->frameLoader()->writer()->setEncoding(m_response.textEncodingName(), false);
+ m_firstData = false;
+ }
}
void FrameLoaderClientWx::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length)
@@ -722,8 +731,13 @@ void FrameLoaderClientWx::dispatchDidFinishLoading(DocumentLoader*, unsigned lon
notImplemented();
}
-void FrameLoaderClientWx::dispatchDidFailLoading(DocumentLoader*, unsigned long, const ResourceError&)
+void FrameLoaderClientWx::dispatchDidFailLoading(DocumentLoader* loader, unsigned long, const ResourceError&)
{
+ if (m_firstData) {
+ FrameLoader* fl = loader->frameLoader();
+ fl->writer()->setEncoding(m_response.textEncodingName(), false);
+ m_firstData = false;
+ }
if (m_webView) {
wxWebViewLoadEvent wkEvent(m_webView);
wkEvent.SetState(wxWEBVIEW_LOAD_FAILED);
diff --git a/WebKit/wx/WebView.cpp b/WebKit/wx/WebView.cpp
index 59fba2f..88d0ad9 100644
--- a/WebKit/wx/WebView.cpp
+++ b/WebKit/wx/WebView.cpp
@@ -83,6 +83,9 @@
#include "wx/wx.h"
#endif
+#include "WebDOMElement.h"
+#include "WebDOMNode.h"
+
#include "WebFrame.h"
#include "WebView.h"
#include "WebViewPrivate.h"
@@ -229,7 +232,6 @@ wxWebViewWindowObjectClearedEvent::wxWebViewWindowObjectClearedEvent(wxWindow* w
//---------------------------------------------------------
wxWebViewDOMElementInfo::wxWebViewDOMElementInfo() :
- m_domElement(NULL),
m_isSelected(false),
m_text(wxEmptyString),
m_imageSrc(wxEmptyString),
@@ -257,6 +259,25 @@ wxWebViewCachePolicy wxWebView::GetCachePolicy()
return gs_cachePolicy;
}
+wxWebViewDOMElementInfo::wxWebViewDOMElementInfo(const wxWebViewDOMElementInfo& other)
+{
+ m_isSelected = other.m_isSelected;
+ m_text = other.m_text;
+ m_imageSrc = other.m_imageSrc;
+ m_link = other.m_link;
+ m_innerNode = other.m_innerNode;
+ m_urlElement = other.m_urlElement;
+}
+
+wxWebViewDOMElementInfo::~wxWebViewDOMElementInfo()
+{
+ if (m_innerNode)
+ delete m_innerNode;
+
+ if (m_urlElement)
+ delete m_urlElement;
+}
+
#if OS(DARWIN)
// prototype - function is in WebSystemInterface.mm
void InitWebCoreSystemInterface(void);
@@ -332,11 +353,14 @@ bool wxWebView::Create(wxWindow* parent, int id, const wxPoint& position,
WebCore::HTMLFrameOwnerElement* parentFrame = 0;
WebCore::EditorClientWx* editorClient = new WebCore::EditorClientWx();
- m_impl->page = new WebCore::Page(new WebCore::ChromeClientWx(this),
- new WebCore::ContextMenuClientWx(),
- editorClient,
- new WebCore::DragClientWx(),
- new WebCore::InspectorClientWx(), 0, 0, 0, 0);
+
+ WebCore::Page::PageClients pageClients;
+ pageClients.chromeClient = new WebCore::ChromeClientWx(this);
+ pageClients.contextMenuClient = new WebCore::ContextMenuClientWx();
+ pageClients.editorClient = editorClient;
+ pageClients.dragClient = new WebCore::DragClientWx();
+ pageClients.inspectorClient = new WebCore::InspectorClientWx();
+ m_impl->page = new WebCore::Page(pageClients);
editorClient->setPage(m_impl->page);
m_mainFrame = new wxWebFrame(this);
@@ -361,9 +385,6 @@ bool wxWebView::Create(wxWindow* parent, int id, const wxPoint& position,
// initialized so that the activate handler is run properly.
LoadURL(wxT("about:blank"));
- wxWindow* tlw = wxGetTopLevelParent(this);
- tlw->Connect(-1, wxEVT_ACTIVATE, wxActivateEventHandler(wxWebView::OnTLWActivated));
-
m_isInitialized = true;
return true;
@@ -383,6 +404,9 @@ wxWebView::~wxWebView()
m_impl->page = 0;
}
+// NOTE: binding to this event in the wxWebView constructor is too early in
+// some cases, but leave the event handler here so that users can bind to it
+// at a later time if they have activation state problems.
void wxWebView::OnTLWActivated(wxActivateEvent& event)
{
if (m_impl && m_impl->page && m_impl->page->focusController())
@@ -442,6 +466,30 @@ wxString wxWebView::GetExternalRepresentation()
return wxEmptyString;
}
+wxWebKitSelection wxWebView::GetSelection()
+{
+ if (m_mainFrame)
+ return m_mainFrame->GetSelection();
+
+ return 0;
+}
+
+wxString wxWebView::GetSelectionAsHTML()
+{
+ if (m_mainFrame)
+ return m_mainFrame->GetSelectionAsHTML();
+
+ return wxEmptyString;
+}
+
+wxString wxWebView::GetSelectionAsText()
+{
+ if (m_mainFrame)
+ return m_mainFrame->GetSelectionAsText();
+
+ return wxEmptyString;
+}
+
void wxWebView::SetTransparent(bool transparent)
{
WebCore::Frame* frame = 0;
@@ -474,6 +522,26 @@ wxString wxWebView::RunScript(const wxString& javascript)
return wxEmptyString;
}
+bool wxWebView::ExecuteEditCommand(const wxString& command, const wxString& parameter)
+{
+ if (m_mainFrame)
+ return m_mainFrame->ExecuteEditCommand(command, parameter);
+}
+
+EditState wxWebView::GetEditCommandState(const wxString& command) const
+{
+ if (m_mainFrame)
+ return m_mainFrame->GetEditCommandState(command);
+}
+
+wxString wxWebView::GetEditCommandValue(const wxString& command) const
+{
+ if (m_mainFrame)
+ return m_mainFrame->GetEditCommandValue(command);
+
+ return wxEmptyString;
+}
+
void wxWebView::LoadURL(const wxString& url)
{
if (m_mainFrame)
@@ -548,10 +616,20 @@ void wxWebView::ResetTextSize()
void wxWebView::MakeEditable(bool enable)
{
- m_isEditable = enable;
+ if (m_mainFrame)
+ m_mainFrame->MakeEditable(enable);
+}
+
+bool wxWebView::IsEditable() const
+{
+ if (m_mainFrame)
+ return m_mainFrame->IsEditable();
+
+ return false;
}
+
/*
* Event forwarding functions to send events down to WebCore.
*/
diff --git a/WebKit/wx/WebView.h b/WebKit/wx/WebView.h
index 075deaf..d7f23b6 100644
--- a/WebKit/wx/WebView.h
+++ b/WebKit/wx/WebView.h
@@ -33,8 +33,9 @@
#include "wx/wx.h"
#endif
-#include "WebFrame.h"
#include "WebKitDefines.h"
+#include "WebDOMSelection.h"
+#include "WebFrame.h"
#include "WebSettings.h"
class WebViewPrivate;
@@ -161,10 +162,17 @@ public:
wxString GetAsMarkup();
wxString GetExternalRepresentation();
+ wxWebKitSelection GetSelection();
+ wxString GetSelectionAsHTML();
+ wxString GetSelectionAsText();
+
void SetTransparent(bool transparent);
bool IsTransparent() const;
wxString RunScript(const wxString& javascript);
+ bool ExecuteEditCommand(const wxString& command, const wxString& parameter = wxEmptyString);
+ EditState GetEditCommandState(const wxString& command) const;
+ wxString GetEditCommandValue(const wxString& command) const;
bool FindString(const wxString& string, bool forward = true,
bool caseSensitive = false, bool wrapSelection = true,
@@ -176,7 +184,7 @@ public:
void DecreaseTextSize();
void ResetTextSize();
void MakeEditable(bool enable);
- bool IsEditable() const { return m_isEditable; }
+ bool IsEditable() const;
wxString GetPageTitle() const { return m_title; }
void SetPageTitle(const wxString& title) { m_title = title; }
diff --git a/WebKit/wx/bindings/python/webview.i b/WebKit/wx/bindings/python/webview.i
index bdc5561..15b1d93 100644
--- a/WebKit/wx/bindings/python/webview.i
+++ b/WebKit/wx/bindings/python/webview.i
@@ -22,24 +22,78 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
+
%module webview
%{
#include "wx/wxPython/wxPython.h"
#include "wx/wxPython/pyclasses.h"
-
#include "WebBrowserShell.h"
+#include "WebDOMSelection.h"
+#include "WebEdit.h"
#include "WebFrame.h"
-#include "WebKitDefines.h"
#include "WebSettings.h"
#include "WebView.h"
+
+#include "WebDOMAttr.h"
+#include "WebDOMCSSStyleDeclaration.h"
+#include "WebDOMDocument.h"
+#include "WebDOMDocumentFragment.h"
+#include "WebDOMDOMSelection.h"
+#include "WebDOMElement.h"
+#include "WebDOMEventListener.h"
+#include "WebDOMNamedNodeMap.h"
+#include "WebDOMNode.h"
+#include "WebDOMNodeList.h"
+#include "WebDOMObject.h"
+#include "WebDOMRange.h"
+
+PyObject* createDOMNodeSubtype(WebDOMNode* ptr, bool setThisOwn)
+{
+ //static wxPyTypeInfoHashMap* typeInfoCache = NULL;
+
+ //if (typeInfoCache == NULL)
+ // typeInfoCache = new wxPyTypeInfoHashMap;
+
+ swig_type_info* swigType = 0; //(*typeInfoCache)[name];
+ char* name = 0;
+ if (ptr) {
+ // it wasn't in the cache, so look it up from SWIG
+ switch (ptr->nodeType()) {
+ case WebDOMNode::WEBDOM_ELEMENT_NODE:
+ name = "WebDOMElement*";
+ break;
+ case WebDOMNode::WEBDOM_ATTRIBUTE_NODE:
+ name = "WebDOMAttr*";
+ break;
+ default:
+ name = "WebDOMNode*";
+ }
+ swigType = SWIG_TypeQuery(name);
+ if (swigType)
+ return SWIG_Python_NewPointerObj(ptr, swigType, setThisOwn);
+
+ // if it still wasn't found, try looking for a mapped name
+ //if (swigType) {
+ // and add it to the map if found
+ // (*typeInfoCache)[className] = swigType;
+ //}
+ }
+
+ Py_INCREF(Py_None);
+
+ return Py_None;
+}
+
%}
//---------------------------------------------------------------------------
%import core.i
%import windows.i
+%typemap(out) WebDOMNode* { $result = createDOMNodeSubtype($1, (bool)$owner); }
+%typemap(out) WebDOMElement* { $result = createDOMNodeSubtype($1, (bool)$owner); }
+
MAKE_CONST_WXSTRING(WebViewNameStr);
MustHaveApp(wxWebBrowserShell);
@@ -48,7 +102,18 @@ MustHaveApp(wxWebView);
%include WebKitDefines.h
+%include WebDOMObject.h
+%include WebDOMNode.h
+
+%include WebDOMAttr.h
+%include WebDOMDOMSelection.h
+%include WebDOMElement.h
+%include WebDOMNodeList.h
+%include WebDOMRange.h
+
%include WebBrowserShell.h
+%include WebDOMSelection.h
+%include WebEdit.h
%include WebFrame.h
%include WebSettings.h
%include WebView.h
diff --git a/WebKit/wx/bindings/python/wscript b/WebKit/wx/bindings/python/wscript
index 41e5d41..617a839 100644
--- a/WebKit/wx/bindings/python/wscript
+++ b/WebKit/wx/bindings/python/wscript
@@ -30,6 +30,9 @@ import Logs
import Options
include_paths = [
+ os.path.join(wk_root, 'JavaScriptCore'),
+ os.path.join(wk_root, 'WebCore', 'bindings', 'cpp'),
+ os.path.join(wk_root, 'WebCore', 'DerivedSources'),
os.path.join(wk_root, 'WebKit', 'wx'),
os.path.join(wx_root, 'wxPython', 'include'),
os.path.join(wx_root, '..', 'wxPython', 'include'),
@@ -95,4 +98,5 @@ def build(bld):
libpath = [output_dir],
uselib_local = '',
- install_path = output_dir)
+ install_path = output_dir
+ )
diff --git a/WebKit/wx/wscript b/WebKit/wx/wscript
index d0594b3..fa3e06f 100644
--- a/WebKit/wx/wscript
+++ b/WebKit/wx/wscript
@@ -32,6 +32,8 @@ include_paths = webkit_dirs + common_includes + ['.', '..',
wk_root,
os.path.join(wk_root, 'JavaScriptCore'),
os.path.join(wk_root, 'WebCore'),
+ os.path.join(wk_root, 'WebCore', 'bindings', 'wx'),
+ os.path.join(wk_root, 'WebCore', 'DerivedSources'),
os.path.join(output_dir),
os.path.join(wk_root, 'WebCore', 'page', 'wx'),
os.path.join(wk_root, 'WebCore', 'platform', 'network', 'curl'),
diff --git a/WebKitLibraries/ChangeLog b/WebKitLibraries/ChangeLog
index 0939954..0cd5a9e 100644
--- a/WebKitLibraries/ChangeLog
+++ b/WebKitLibraries/ChangeLog
@@ -1,3 +1,13 @@
+2010-07-27 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ Add FILE_SYSTEM build flag for FileSystem API
+ https://bugs.webkit.org/show_bug.cgi?id=42915
+
+ * win/tools/vsprops/FeatureDefines.vsprops:
+ * win/tools/vsprops/FeatureDefinesCairo.vsprops:
+
2010-07-12 Mark Rowe <mrowe@apple.com>
Rubber-stamped by Sam Weinig.
diff --git a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops b/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
index 71bdc14..104b479 100644
--- a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
+++ b/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
@@ -9,7 +9,7 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB_SLICE);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_READER);$(ENABLE_FILE_WRITER);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_SPEECH);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_RUBY);$(ENABLE_SANDBOX);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
+ PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB_SLICE);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_READER);$(ENABLE_FILE_WRITER);$(ENABLE_FILE_SYSTEM);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_SPEECH);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_RUBY);$(ENABLE_SANDBOX);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
/>
<UserMacro
Name="ENABLE_3D_CANVAS"
@@ -87,6 +87,11 @@
PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_FILE_SYSTEM"
+ Value=""
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
Name="ENABLE_GEOLOCATION"
Value="ENABLE_GEOLOCATION"
PerformEnvironmentSet="true"
diff --git a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops b/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
index 1e5e107..4fda17c 100644
--- a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
+++ b/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
@@ -9,7 +9,7 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB_SLICE);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_READER);$(ENABLE_FILE_WRITER);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_SPEECH);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
+ PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB_SLICE);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_READER);$(ENABLE_FILE_WRITER);$(ENABLE_FILE_SYSTEM);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_SPEECH);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
/>
<UserMacro
Name="ENABLE_3D_CANVAS"
@@ -87,6 +87,11 @@
PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_FILE_SYSTEM"
+ Value=""
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
Name="ENABLE_GEOLOCATION"
Value=""
PerformEnvironmentSet="true"
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
index 93f1c11..f4b0822 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
@@ -35,12 +35,12 @@
{ "name": "szeged-windows-1", "platform": "qt"},
{ "name": "szeged-windows-2", "platform": "qt"},
- { "name": "google-windows-1", "platform": "chromium" },
- { "name": "google-mac-1", "platform": "chromium" },
- { "name": "google-linux-1", "platform": "chromium" },
- { "name": "google-windows-2", "platform": "chromium" },
- { "name": "google-mac-2", "platform": "chromium" },
- { "name": "google-linux-2", "platform": "chromium" },
+ { "name": "google-windows-1", "platform": "chromium-win" },
+ { "name": "google-mac-1", "platform": "chromium-mac" },
+ { "name": "google-linux-1", "platform": "chromium-linux" },
+ { "name": "google-windows-2", "platform": "chromium-win" },
+ { "name": "google-mac-2", "platform": "chromium-mac" },
+ { "name": "google-linux-2", "platform": "chromium-linux" },
{ "name": "google-new-tests", "platform": "mac-leopard" }
],
@@ -150,32 +150,32 @@
},
{
"name": "Chromium Win Release", "type": "Build", "builddir": "chromium-win-release",
- "platform": "chromium", "configuration": "release", "architectures": ["i386"],
+ "platform": "chromium-win", "configuration": "release", "architectures": ["i386"],
"slavenames": ["google-windows-1"]
},
{
"name": "Chromium Mac Release", "type": "Build", "builddir": "chromium-mac-release",
- "platform": "chromium", "configuration": "release", "architectures": ["i386"],
+ "platform": "chromium-mac", "configuration": "release", "architectures": ["i386"],
"slavenames": ["google-mac-1"]
},
{
"name": "Chromium Linux Release", "type": "Build", "builddir": "chromium-linux-release",
- "platform": "chromium", "configuration": "release", "architectures": ["i386"],
+ "platform": "chromium-linux", "configuration": "release", "architectures": ["i386"],
"slavenames": ["google-linux-1"]
},
{
"name": "Chromium Win Release (Tests)", "type": "NewBuildAndTest", "builddir": "chromium-win-release-tests",
- "platform": "chromium", "configuration": "release", "architectures": ["i386"],
+ "platform": "chromium-win", "configuration": "release", "architectures": ["i386"],
"slavenames": ["google-windows-2"]
},
{
"name": "Chromium Mac Release (Tests)", "type": "NewBuildAndTest", "builddir": "chromium-mac-release-tests",
- "platform": "chromium", "configuration": "release", "architectures": ["i386"],
+ "platform": "chromium-mac", "configuration": "release", "architectures": ["i386"],
"slavenames": ["google-mac-2"]
},
{
"name": "Chromium Linux Release (Tests)", "type": "NewBuildAndTest", "builddir": "chromium-linux-release-tests",
- "platform": "chromium", "configuration": "release", "architectures": ["i386"],
+ "platform": "chromium-linux", "configuration": "release", "architectures": ["i386"],
"slavenames": ["google-linux-2"]
},
{
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
index e1eaa71..5ff4681 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
@@ -68,6 +68,13 @@ class InstallChromiumDependencies(shell.ShellCommand):
command = ["perl", "./WebKitTools/Scripts/update-webkit-chromium", "--force"]
haltOnFailure = True
+class CleanupChromiumLinuxCrashLogs(shell.ShellCommand):
+ name = "cleanup crash logs"
+ description = ["removing crash logs"]
+ descriptionDone = ["removed crash logs"]
+ command = ["sh", "-c", "rm -rf /tmp/.org.chromium.*"]
+ haltOnFailure = False
+
def appendCustomBuildFlags(step, platform):
if platform in ('gtk', 'wx', 'qt', 'chromium'):
@@ -343,7 +350,7 @@ class Factory(factory.BuildFactory):
if platform == "win":
self.addStep(KillOldProcesses)
self.addStep(InstallWin32Dependencies)
- if platform == "chromium":
+ if platform.startswith("chromium"):
self.addStep(InstallChromiumDependencies)
class BuildFactory(Factory):
@@ -375,8 +382,10 @@ class BuildAndTestFactory(Factory):
TestClass = RunWebKitTests
def __init__(self, platform, configuration, architectures):
Factory.__init__(self, platform, configuration, architectures, False)
+ if platform == "chromium-linux":
+ self.addStep(CleanupChromiumLinuxCrashLogs)
self.addStep(CompileWebKit)
- if platform != "chromium":
+ if not platform.startswith("chromium"):
self.addStep(RunJavaScriptCoreTests)
self.addStep(self.TestClass)
# Tiger's Python 2.3 is too old. WebKit Python requires 2.5+.
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 1423d88..7aa3128 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,705 @@
+2010-07-28 Kenichi Ishibashi <bashi@google.com>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Fixed <https://bugs.webkit.org/show_bug.cgi?id=33814>
+ check-webkit-style gives false positives in single-line functions.
+
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+
+2010-07-28 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ WebKitTestRunner needs to support layoutTestController.execCommand
+ <https://bugs.webkit.org/show_bug.cgi?id=42538>
+
+ WebKitTestRunner needs layoutTestController.isCommandEnabled
+ <https://bugs.webkit.org/show_bug.cgi?id=42671>
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ Added execCommand and isCommandEnabled.
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::execCommand): Added.
+ (WTR::LayoutTestController::isCommandEnabled): Added.
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Ditto.
+
+2010-07-28 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Introduce drt_expectations.txt for NRWT
+ https://bugs.webkit.org/show_bug.cgi?id=43123
+
+ Introduce LayoutTests/platform/chromium/drt_expectations.txt,
+ which overrides test expectations only for DumpRenderTree, in
+ order to manage what problems are investigated.
+ This change will be reverted when we switch to DRT completely.
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ Add drt_expectations.txt content to the result of
+ test_expectations_overrides() if --use-drt is specified.
+
+2010-07-28 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin Adler.
+
+ First pass at visited link support for WK2
+ https://bugs.webkit.org/show_bug.cgi?id=43157
+
+ * MiniBrowser/mac/AppDelegate.m:
+ (didNavigateWithNavigationData):
+ (didPerformClientRedirect):
+ (didPerformServerRedirect):
+ (didUpdateHistoryTitle):
+ (populateVisitedLinks): Added for the new version of the HistoryClient.
+ (-[BrowserAppDelegate init]): Set the HistoryClient right after creating the context(s)
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]):
+
+2010-07-28 Robin Dunn <robin@alldunn.com>
+
+ Reviewed by Kevin Ollivier.
+
+ Add DOM bindings support for wx port.
+
+ * DumpRenderTree/wscript:
+ * wx/browser/wscript:
+ * wx/build/settings.py:
+
+2010-07-28 Tony Chang <tony@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ [chromium] cleanup temp files left by Linux DRT
+ https://bugs.webkit.org/show_bug.cgi?id=43062
+
+ * BuildSlaveSupport/build.webkit.org-config/config.json: Rename the chromium bots to include the OS
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg: add a step on chromium-linux to delete temp files left
+ by crashed DRTs
+
+2010-07-28 Antonio Gomes <tonikitoo@webkit.org>
+
+ Rubber-stamped by Kenneth Christiansen.
+
+ More Developer menu items reordering.
+
+ Grouping related menu items together, visually and logically (in the code).
+
+ No behavior change.
+
+ * QtTestBrowser/main.cpp:
+ (LauncherWindow::createChrome):
+
+2010-07-27 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ Add FILE_SYSTEM build flag for FileSystem API
+ https://bugs.webkit.org/show_bug.cgi?id=42915
+
+ * Scripts/build-webkit:
+
+2010-07-27 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by David Levin.
+
+ Stylebot should not complain about NULL usage in calls to gdk_pixbuf_save_to
+ https://bugs.webkit.org/show_bug.cgi?id=43090
+
+ * Scripts/webkitpy/style/checkers/cpp.py: Add exemption for some GdkPixbuf methods.
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py: Added some tests for this behavior.
+
+2010-07-27 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed, trivial typo fix.
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ Fix a wrong method name committed by r64109.
+
+2010-07-27 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=43087
+ Clean up handling of strings at the WebKit2 API layer.
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (runJavaScriptAlert):
+ (runJavaScriptConfirm):
+ (runJavaScriptPrompt):
+ (didNavigateWithNavigationData):
+ (-[BrowserWindowController updateProvisionalURLForFrame:]):
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (_didClearWindowForFrame):
+
+2010-07-27 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ webkit-patch post-commits is broken: AttributeError: Values instance has no attribute 'no_squash'
+ https://bugs.webkit.org/show_bug.cgi?id=42984
+
+ squash and no_squash have been intentionally erroring for a couple weeks now.
+ But post-commits was just broken. Just remove squash/no_squash.
+
+ * Scripts/webkitpy/tool/steps/abstractstep.py:
+ * Scripts/webkitpy/tool/steps/options.py:
+
+2010-07-27 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix after introduction of EXECUTABLE_ALLOCATOR_DEMAND.
+
+ * wx/build/settings.py:
+
+2010-07-27 Adam Roben <aroben@apple.com>
+
+ Mac build fix
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (processDidExit):
+ (-[BrowserWindowController awakeFromNib]):
+ Added processDidExit support.
+
+2010-07-26 Antonio Gomes <tonikitoo@webkit.org>
+
+ Rubber-stamped by Simon Hausmann.
+
+ [Qt] Reorder some items in Developers' menu so QGraphicsView one is easier accessible.
+
+ Move some less useful menu items on Developers menu from the top to the bottom, so
+ QGraphicsView menu goes to the top, and becomes more quickly accessible.
+
+ * QtTestBrowser/main.cpp:
+ (LauncherWindow::createChrome):
+
+2010-07-26 Adam Roben <aroben@apple.com>
+
+ Fix the path to InjectedBundle.dll in Debug_Internal builds
+
+ Fixes <http://webkit.org/b/42994> WebKitTestRunner fails to load
+ InjectedBundle.dll in the Debug_Internal configuration
+
+ Reviewed by Anders Carlsson.
+
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::TestController::initializeInjectedBundlePath): Add the _debug
+ suffix only in Debug_All builds.
+
+2010-07-25 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42947
+ Check for WEBKIT_TESTFONTS for qt, gtk and windows port and throw
+ error. Without which dumpRenderTree crashes.
+
+ * Scripts/old-run-webkit-tests:
+
+2010-07-27 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42956
+ [DRT/Chromium] Fix "out of sync" assertion error
+
+ Fix an assertion error on Windows like the following:
+ 100721 20:16:46 chromium.py:386 CRITICAL Test got out of sync:
+ |file:///c:/WebKitBuildSlave2/chromium-win-release-tests/build/LayoutTests/http/tests/local/blob/send-data-blob.html|
+ |file:///C:/WebKitBuildSlave2/chromium-win-release-tests/build/LayoutTests/http/tests/local/blob/send-data-blob.html|
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ If the url matches with "file:///[a-z]:", does case-ignore comparison.
+ GURL capitalize the driver letter of a file: URL.
+
+2010-07-26 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ WebKitTestRunner needs to support layoutTestController.counterValueForElementById
+ https://bugs.webkit.org/show_bug.cgi?id=42537
+
+ WebKitTestRunner needs layoutTestController.markerTextForListItem
+ https://bugs.webkit.org/show_bug.cgi?id=42549
+
+ * WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
+ Fixed _paramterExpression typo. Improved support for string type as a
+ return value, so we don't try to include DOMString.h and we can convert
+ the string to a JSValue by calling JSValueMakeStringOrNull.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h:
+ Added JSValueMakeStringOrNull, used by the code generator.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ Added counterValueForElementById and markerTextForListItem.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ Moved constant to the top of the file.
+ (WTR::toCF): Added. Converts strings to CFStringRef.
+ (WTR::toWK): Added. Converts strings to WKStringRef.
+ (WTR::toJS): Added. Converts strings to JSStringRef.
+ (WTR::setProperty): Moved this function to the top of the file
+ rather than having it down where it's used inside the class. Also
+ renamed it so it's a separate function rather than an overload of
+ JSObjectSetProperty.
+ (WTR::propertyValue): Copied this here from InjectedBundlePage.cpp.
+ Should move it somewhere we can share it.
+ (WTR::propertyObject): Ditto.
+ (WTR::getElementById): Added. Calls getElementById through the magic
+ of JavaScript.
+ (WTR::LayoutTestController::pauseAnimationAtTimeOnElementWithId):
+ Chagned to use toWK instead of four local variables.
+ (WTR::LayoutTestController::counterValueForElementById): Added.
+ Calls WKBundleFrameCopyCounterValue.
+ (WTR::LayoutTestController::markerTextForListItem): Added.
+ Calls WKBundleFrameCopyMarkerText.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ Added counterValueForElementById and markerTextForListItem.
+
+2010-07-26 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] The EventSender should support simulating drop events
+ https://bugs.webkit.org/show_bug.cgi?id=39844
+
+ Add initial dropping support to the GTK+ EventSender.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (createWebView): Listen for some new drag-and-drop signals.
+ * DumpRenderTree/gtk/EventSender.cpp: Add currentDragSourceContext.
+ (dispatchEvent):
+ Detect situations where a drag is either starting or ending and massage
+ GTK+ into sending the appropriate signals to the WebView.
+ (replaySavedEvents): Remove comment.
+ (makeEventSender): Clear the currentDragSourceContext when creating a new EventSender.
+ (dragBeginCallback): Capture the new currentDragSourceContext when a drag begins.
+ (dragEndCallback): Clear the currentDragSourceContext when a drag ends.
+ (dragFailedCallback): Disable the GTK+ drag failed animation.
+ * DumpRenderTree/gtk/EventSender.h: Add declarations for new signal callbacks.
+
+2010-07-26 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Darin Adler.
+
+ svn-unapply warns of uninitialized variable when unapplying
+ a patch that describes an svn move operation
+ https://bugs.webkit.org/show_bug.cgi?id=42036
+
+ Fixes Perl uninitialized variable warnings when un-applying
+ a patch that moves a file.
+
+ * Scripts/svn-unapply:
+ - Modified patch() so that it initializes $patch to the empty
+ string when we don't have svnConvertedText (such as when
+ reversing a diff that represents a svn copy/move operation).
+
+2010-07-26 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Move some non-APIish functions into private headers.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+
+2010-07-26 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=42986
+ Add prompt and confirm client functions to WebKit2
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]):
+
+2010-07-26 Adam Roben <aroben@apple.com>
+
+ Windows build fix
+
+ * MiniBrowser/MiniBrowser.vcproj:
+ * WebKitTestRunner/InjectedBundle/win/InjectedBundle.vcproj:
+ Removed empty attributes so the values will be picked up from the
+ vsprops files. (Also removed a couple of attributes that accidentally
+ duplicated values from the vsprops files.)
+
+2010-07-26 Brian Weinstein <bweinstein@apple.com>
+
+ Rubber-stamped by Adam Roben.
+
+ Touch MiniBrowser's stdafx to fix the build.
+
+ * MiniBrowser/win/stdafx.h:
+
+2010-07-26 Hayato Ito <hayato@chromium.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Add pretty printer of WTF::Vector for GDB 7.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40909
+
+ * gdb/wtf.py: Added.
+
+2010-07-26 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix feature detection regexp
+
+ We were missing the last feature
+
+ * Scripts/webkitdirs.pm:
+
+2010-07-25 Darin Adler <darin@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ WebKitTestRunner needs to support layoutTestController.dumpSelectionRect
+ https://bugs.webkit.org/show_bug.cgi?id=42326
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ Added dumpSelectionRect.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ (WTR::LayoutTestController::dumpSelectionRect): Added. For now, this
+ does nothing because its purpose is to change pixel test output and
+ we do not have pixel tests implemented yet.
+
+2010-07-25 Darin Adler <darin@apple.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ WebKitTestRunner needs to support layoutTestController.keepWebHistory
+ https://bugs.webkit.org/show_bug.cgi?id=42323
+
+ Added keepWebHistory and computedStyleIncludingVisitedInfo.
+
+ Also fixed misspellings of the word "receive".
+
+ Also tweaked the names of some of the LayoutTestController members.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
+ Added support for a type named "object" that is passed and returns as
+ a JSValueRef.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ Added keepWebHistory and computedStyleIncludingVisitedInfo. Also
+ put setAcceptsEditing up nearer the top.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::_didReceiveMessage): Fixed mispellings of receive.
+ (WTR::InjectedBundle::initialize): Ditto.
+ (WTR::InjectedBundle::didReceiveMessage): Ditto.
+ (WTR::InjectedBundle::reset): Reset the state of visited links between
+ tests. Also eliminated the unused argument to the LayoutTestController
+ create function.
+ (WTR::InjectedBundle::setShouldTrackVisitedLinks): Added.
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h: Ditto.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::shouldBeginEditing): Call shouldAllowEditing
+ instead of acceptsEditing.
+ (WTR::InjectedBundlePage::shouldEndEditing): Ditto.
+ (WTR::InjectedBundlePage::shouldInsertNode): Ditto.
+ (WTR::InjectedBundlePage::shouldInsertText): Ditto.
+ (WTR::InjectedBundlePage::shouldDeleteRange): Ditto.
+ (WTR::InjectedBundlePage::shouldChangeSelectedRange): Ditto.
+ (WTR::InjectedBundlePage::shouldApplyStyle): Ditto.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::create): Removed uneeded argument.
+ (WTR::LayoutTestController::LayoutTestController): Removed unneeded
+ argument. Updated for rename of m_acceptsEditing to m_shouldAllowEditing.
+ (WTR::LayoutTestController::numberOfActiveAnimations): Added some FIXMEs
+ about the fact that this works on the main frame.
+ (WTR::LayoutTestController::pauseAnimationAtTimeOnElementWithId): Ditto.
+ (WTR::LayoutTestController::keepWebHistory): Added.
+ (WTR::LayoutTestController::computedStyleIncludingVisitedInfo): Added.
+ (WTR::JSObjectSetProperty): Added. Helper to make the function below
+ cleaner.
+ (WTR::LayoutTestController::makeWindowObject): Changed to use the
+ overload of JSObjectSetProperty above.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Changes to
+ match above.
+
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize): Fixed mispellings of receive.
+ (WTR::TestController::_didReceiveMessageFromInjectedBundle): Ditto.
+ (WTR::TestController::didReceiveMessageFromInjectedBundle): Ditto.
+ * WebKitTestRunner/TestController.h: Ditto.
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): Ditto.
+ * WebKitTestRunner/TestInvocation.h: Ditto.
+
+2010-07-25 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42193
+ Support layoutTestController.dumpEditingDelegates in WebKitTestRunner
+
+ Step 2 - add the rest of editing delegates.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::operator<<): Fixed to not crash when range is null.
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ (WTR::InjectedBundlePage::_shouldEndEditing):
+ (WTR::InjectedBundlePage::_shouldInsertNode):
+ (WTR::InjectedBundlePage::_shouldInsertText):
+ (WTR::InjectedBundlePage::_shouldDeleteRange):
+ (WTR::InjectedBundlePage::_shouldChangeSelectedRange):
+ (WTR::InjectedBundlePage::_shouldApplyStyle):
+ (WTR::InjectedBundlePage::_didBeginEditing):
+ (WTR::InjectedBundlePage::_didEndEditing):
+ (WTR::InjectedBundlePage::_didChange):
+ (WTR::InjectedBundlePage::_didChangeSelection):
+ (WTR::InjectedBundlePage::shouldEndEditing):
+ (WTR::InjectedBundlePage::shouldInsertNode):
+ (WTR::InjectedBundlePage::shouldInsertText):
+ (WTR::InjectedBundlePage::shouldDeleteRange):
+ (WTR::InjectedBundlePage::shouldChangeSelectedRange):
+ (WTR::InjectedBundlePage::shouldApplyStyle):
+ (WTR::InjectedBundlePage::didBeginEditing):
+ (WTR::InjectedBundlePage::didEndEditing):
+ (WTR::InjectedBundlePage::didChange):
+ (WTR::InjectedBundlePage::didChangeSelection):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+
+2010-07-24 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by David Kilzer.
+
+ AX: need a layout test testing misspelled words in attributed strings
+ https://bugs.webkit.org/show_bug.cgi?id=42899
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (attributedStringForRangeCallback):
+ (attributedStringRangeIsMisspelledCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::attributedStringForRange):
+ (AccessibilityUIElement::attributedStringRangeIsMisspelled):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::attributedStringForRange):
+ (AccessibilityUIElement::attributedStringRangeIsMisspelled):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::attributedStringForRange):
+ (AccessibilityUIElement::attributedStringRangeIsMisspelled):
+
+2010-07-23 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/42911> Update ruby tools to work with shallow framework bundles
+
+ Reviewed by Mark Rowe.
+
+ * Scripts/check-for-inappropriate-files-in-framework: Added
+ check for the SHALLOW_BUNDLE environment variable so that the
+ script will work with iOS WebKit builds.
+ * Scripts/check-for-webkit-framework-include-consistency: Ditto.
+
+2010-07-22 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Eliminate unneeded WKBundleFrameCopyInnerText function from WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=42847
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::operator<<): Replaced the WKStringToUTF8 function with
+ a set of overloaded stream operators.
+ (WTR::dumpPath): Changed to use ostringstream and return a string.
+ (WTR::propertyValue): Added.
+ (WTR::propertyObject): Added.
+ (WTR::propertyString): Added.
+ (WTR::numericWindowPropertyValue): Changed to call propertyValue.
+ (WTR::dumpFrameScrollPosition): Removed now unneeded WKStringToUTF8 sequence
+ since we now have suitable streaming functions.
+ (WTR::dumpFrameText): Use propertyObject and propertyString instead of
+ WKBundleFrameCopyInnerText.
+ (WTR::dumpDescendantFramesText): Removed now unneeded WKStringToUTF8 sequence
+ since we now have suitable streaming functions.
+ (WTR::InjectedBundlePage::dump): Ditto.
+ (WTR::InjectedBundlePage::willAddMessageToConsole): Ditto.
+ (WTR::InjectedBundlePage::willSetStatusbarText): Ditto.
+ (WTR::InjectedBundlePage::willRunJavaScriptAlert): Ditto.
+ (WTR::InjectedBundlePage::willRunJavaScriptConfirm): Ditto.
+ (WTR::InjectedBundlePage::willRunJavaScriptPrompt): Ditto.
+
+2010-07-22 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Sam Weinig and Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42193
+ Support layoutTestController.dumpEditingDelegates in WebKitTestRunner
+
+ Step 1: Add the method, and implement one actual delegate call as proof of concept. No tests
+ fixed, but this makes difference one line smaller on many editing tests.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ Added dumpEditingCallbacks() and setAcceptsEditing().
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::dumpPath): Dump path to a node in a format that's compatible with DumpRenderTree.
+ (WTR::operator<<): Print a range.
+ (WTR::InjectedBundlePage::InjectedBundlePage): Set editor client in addition to existing
+ clients.
+ (WTR::InjectedBundlePage::_shouldBeginEditing): The only client method implemented so far.
+ (WTR::InjectedBundlePage::shouldBeginEditing): Ditto.
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Added a section for editor client
+ calls.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::LayoutTestController):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ (WTR::LayoutTestController::dumpEditingCallbacks):
+ (WTR::LayoutTestController::setAcceptsEditing):
+ (WTR::LayoutTestController::acceptsEditing):
+ (WTR::LayoutTestController::shouldDumpEditingCallbacks):
+ Store m_acceptsEditing and m_dumpEditingCallbacks.
+
+2010-07-22 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] QtWebKit needs public API for Notifications.
+ https://bugs.webkit.org/show_bug.cgi?id=41413
+
+ Update DumpRenderTree and QtTestBrowser to use the new API.
+ Add new DRT API to flag that notifications permission requests should be ignored.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::WebPage::requestPermission):
+ (WebCore::WebPage::checkPermission):
+ (WebCore::WebPage::cancelRequestsForPermission):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::ignoreDesktopNotificationPermissionRequests):
+ (LayoutTestController::checkDesktopNotificationPermission):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ (LayoutTestController::ignoreReqestForPermission):
+ * QtTestBrowser/main.cpp:
+ (LauncherWindow::LauncherWindow):
+ * QtTestBrowser/webpage.cpp:
+ (WebPage::WebPage):
+ (WebPage::requestPermission):
+ (WebPage::checkPermission):
+ (WebPage::cancelRequestsForPermission):
+ * QtTestBrowser/webpage.h:
+
+2010-07-22 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ WebKitTestRunner needs to support layoutTestController.dumpChildFramesAsText
+ https://bugs.webkit.org/show_bug.cgi?id=42325
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ Added dumpChildFramesAsText.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::dumpFrameText): Added.
+ (WTR::dumpDescendantFramesText): Added.
+ (WTR::InjectedBundlePage::dumpAllFramesText): Added.
+ (WTR::InjectedBundlePage::dump): Changed to use the new whatToDump function
+ instead of the shouldDumpAsText function, and added a case for AllFramesText.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Added dumpAllFramesText.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::LayoutTestController): Replaced m_dumpAsText with
+ m_whatToDump.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Added
+ dumpChildFramesAsText. Removed shouldDumpAsText, shouldDumpDOMAsWebArchive,
+ and shouldDumpSourceAsWebArchive. Added whatToDump.
+
+2010-07-22 Adam Roben <aroben@apple.com>
+
+ Windows build fix
+
+ Inspired by r63881.
+
+ * MiniBrowser/MiniBrowser.vcproj:
+ * WebKitTestRunner/InjectedBundle/win/InjectedBundle.vcproj:
+ Removed pre- and post-build events so they will be inherited from the
+ vsprops files.
+
+2010-07-21 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ WebKitTestRunner needs layoutTestController.dumpChildFrameScrollPositions
+ https://bugs.webkit.org/show_bug.cgi?id=42548
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::numericWindowPropertyValue): Renamed this and moved it up higher in the file.
+ (WTR::dumpFrameScrollPosition): Added argument telling whether to dump the frame name.
+ Changed to a file-internal function instead of a member function.
+ (WTR::dumpDescendantFrameScrollPositions): Added.
+ (WTR::InjectedBundlePage::dumpAllFrameScrollPositions): Added.
+ (WTR::InjectedBundlePage::dump): Changed to call dumpAllFrameScrollPositions when
+ appropriate. Also streamlined all the WKStringToUTF8 call sites.
+ (WTR::InjectedBundlePage::willAddMessageToConsole): Streamlined use of WKStringToUTF8.
+ (WTR::InjectedBundlePage::willSetStatusbarText): Ditto.
+ (WTR::InjectedBundlePage::willRunJavaScriptAlert): Ditto.
+ (WTR::InjectedBundlePage::willRunJavaScriptConfirm): Ditto.
+ (WTR::InjectedBundlePage::willRunJavaScriptPrompt): Ditto.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Updated for above changes.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::LayoutTestController): Initialize
+ m_shouldDumpAllFrameScrollPositions.
+ (WTR::LayoutTestController::shouldDumpMainFrameScrollPosition): Renamed from
+ shouldDumpFrameScrollPositions.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Reorganized the file a
+ bit, added dumpChildFrameScrollPositions and shouldDumpAllFrameScrollPositions,
+ and renamed shouldDumpFrameScrollPositions to shouldDumpMainFrameScrollPosition.
+
+2010-07-21 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ WebKitTestRunner needs to support dumping of scroll position
+ https://bugs.webkit.org/show_bug.cgi?id=42514
+
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (_didClearWindowForFrame): Use JSGlobalContextRef instead of JSContextRef.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::_didClearWindowForFrame): Use JSGlobalContextRef
+ instead of JSContextRef.
+ (WTR::InjectedBundlePage::dump): Call dumpFrameScrollPosition when appropriate.
+ (WTR::numericWindowProperty): Added. Helper for dumpFrameScrollPosition.
+ (WTR::InjectedBundlePage::dumpFrameScrollPosition): Added.
+ (WTR::InjectedBundlePage::didClearWindowForFrame): Use JSGlobalContextRef
+ instead of JSContextRef.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Removed names from
+ arguments that simply repeat the argument type. Added dumpFrameScrollPosition.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::shouldDumpDOMAsWebArchive): Added. Currently
+ returns false.
+ (WTR::LayoutTestController::shouldDumpSourceAsWebArchive): Added. Currently
+ returns false.
+ (WTR::LayoutTestController::shouldDumpFrameScrollPositions): Added. Matches
+ the logic in DumpRenderTree.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Updated for above changes.
+
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj: Added property svn:ignore.
+
2010-07-21 Kevin Ollivier <kevino@theolliviers.com>
[wx] Build fix, adding the WebCore/bindings/generic dir to the list of build dirs.
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
index c4d5e6f..e09eb35 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
@@ -152,6 +152,29 @@ static JSValueRef stringForRangeCallback(JSContextRef context, JSObjectRef funct
return JSValueMakeString(context, stringDescription.get());
}
+static JSValueRef attributedStringForRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ unsigned location = UINT_MAX, length = 0;
+ if (argumentCount == 2) {
+ location = JSValueToNumber(context, arguments[0], exception);
+ length = JSValueToNumber(context, arguments[1], exception);
+ }
+
+ JSRetainPtr<JSStringRef> stringDescription(Adopt, toAXElement(thisObject)->attributedStringForRange(location, length));
+ return JSValueMakeString(context, stringDescription.get());
+}
+
+static JSValueRef attributedStringRangeIsMisspelledCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ unsigned location = UINT_MAX, length = 0;
+ if (argumentCount == 2) {
+ location = JSValueToNumber(context, arguments[0], exception);
+ length = JSValueToNumber(context, arguments[1], exception);
+ }
+
+ return JSValueMakeBoolean(context, toAXElement(thisObject)->attributedStringRangeIsMisspelled(location, length));
+}
+
static JSValueRef indexOfChildCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
if (argumentCount != 1)
@@ -711,6 +734,8 @@ JSClassRef AccessibilityUIElement::getJSClass()
{ "lineForIndex", lineForIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "boundsForRange", boundsForRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "stringForRange", stringForRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "attributedStringForRange", attributedStringForRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "attributedStringRangeIsMisspelled", attributedStringRangeIsMisspelledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "childAtIndex", childAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "linkedUIElementAtIndex", linkedUIElementAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "indexOfChild", indexOfChildCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
index 2a06962..13415cd 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
@@ -177,6 +177,8 @@ public:
JSStringRef boundsForRange(unsigned location, unsigned length);
void setSelectedTextRange(unsigned location, unsigned length);
JSStringRef stringForRange(unsigned location, unsigned length);
+ JSStringRef attributedStringForRange(unsigned location, unsigned length);
+ bool attributedStringRangeIsMisspelled(unsigned location, unsigned length);
// Table-specific
AccessibilityUIElement cellForColumnAndRow(unsigned column, unsigned row);
diff --git a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
index fbdbd23..a09ad2a 100644
--- a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
@@ -499,6 +499,18 @@ JSStringRef AccessibilityUIElement::stringForRange(unsigned, unsigned)
return JSStringCreateWithCharacters(0, 0);
}
+JSStringRef AccessibilityUIElement::attributedStringForRange(unsigned, unsigned)
+{
+ // FIXME: implement
+ return JSStringCreateWithCharacters(0, 0);
+}
+
+bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned location, unsigned length)
+{
+ // FIXME: implement
+ return false;
+}
+
AccessibilityUIElement AccessibilityUIElement::cellForColumnAndRow(unsigned column, unsigned row)
{
// FIXME: implement
diff --git a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
index 2812224..bd9c0c9 100644
--- a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
@@ -886,6 +886,10 @@ static WebKitWebView* createWebView()
"signal::document-load-finished", webViewDocumentLoadFinished, 0,
"signal::geolocation-policy-decision-requested", geolocationPolicyDecisionRequested, 0,
"signal::onload-event", webViewOnloadEvent, 0,
+ "signal::drag-begin", dragBeginCallback, 0,
+ "signal::drag-end", dragEndCallback, 0,
+ "signal::drag-failed", dragFailedCallback, 0,
+
NULL);
g_signal_connect(view,
diff --git a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
index 4936fe5..b95fec2 100644
--- a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
@@ -45,8 +45,6 @@
#include <gdk/gdkkeysyms.h>
#include <string.h>
-// FIXME: Implement support for synthesizing drop events.
-
extern "C" {
extern void webkit_web_frame_layout(WebKitWebFrame* frame);
}
@@ -62,6 +60,7 @@ static int lastClickTimeOffset;
static int lastClickButton;
static int buttonCurrentlyDown;
static int clickCount;
+GdkDragContext* currentDragSourceContext;
struct DelayedMessage {
GdkEvent event;
@@ -359,13 +358,36 @@ static void dispatchEvent(GdkEvent event)
return;
gtk_main_do_event(&event);
+
+ if (!currentDragSourceContext)
+ return;
+
+ if (event.type == GDK_MOTION_NOTIFY) {
+ // WebKit has called gtk_drag_start(), but because the main loop isn't
+ // running GDK internals don't know that the drag has started yet. Pump
+ // the main loop a little bit so that GDK is in the correct state.
+ while (gtk_events_pending())
+ gtk_main_iteration();
+
+ // Simulate a drag motion on the top-level GDK window.
+ GtkWidget* parentWidget = gtk_widget_get_parent(GTK_WIDGET(view));
+ GdkWindow* parentWidgetWindow = parentWidget->window;
+ gdk_drag_motion(currentDragSourceContext, parentWidgetWindow, GDK_DRAG_PROTO_XDND,
+ event.motion.x_root, event.motion.y_root,
+ currentDragSourceContext->action, currentDragSourceContext->actions, GDK_CURRENT_TIME);
+
+ } else if (currentDragSourceContext && event.type == GDK_BUTTON_RELEASE) {
+ // We've released the mouse button, we should just be able to spin the
+ // event loop here and have GTK+ send the appropriate notifications for
+ // the end of the drag.
+ while (gtk_events_pending())
+ gtk_main_iteration();
+ }
+
}
void replaySavedEvents()
{
- // FIXME: Eventually we may need to have more sophisticated logic to
- // track drag-and-drop operations.
-
// First send all the events that are ready to be sent
while (startOfQueue < endOfQueue) {
if (msgQueue[startOfQueue].delay) {
@@ -631,7 +653,26 @@ JSObjectRef makeEventSender(JSContextRef context, bool isTopFrame)
endOfQueue = 0;
startOfQueue = 0;
+
+ currentDragSourceContext = 0;
}
return JSObjectMake(context, getClass(context), 0);
}
+
+void dragBeginCallback(GtkWidget*, GdkDragContext* context, gpointer)
+{
+ currentDragSourceContext = context;
+}
+
+void dragEndCallback(GtkWidget*, GdkDragContext* context, gpointer)
+{
+ currentDragSourceContext = 0;
+}
+
+gboolean dragFailedCallback(GtkWidget*, GdkDragContext* context, gpointer)
+{
+ // Return TRUE here to disable the stupid GTK+ drag failed animation,
+ // which introduces asynchronous behavior into our drags.
+ return TRUE;
+}
diff --git a/WebKitTools/DumpRenderTree/gtk/EventSender.h b/WebKitTools/DumpRenderTree/gtk/EventSender.h
index ce33ccc..e9b758d 100644
--- a/WebKitTools/DumpRenderTree/gtk/EventSender.h
+++ b/WebKitTools/DumpRenderTree/gtk/EventSender.h
@@ -32,8 +32,15 @@
typedef const struct OpaqueJSContext* JSContextRef;
typedef struct OpaqueJSValue* JSObjectRef;
+typedef struct _GtkWidget GtkWidget;
+typedef struct _GdkDragContext GdkDragContext;
+typedef void* gpointer;
+typedef int gboolean;
JSObjectRef makeEventSender(JSContextRef context, bool isTopFrame);
void replaySavedEvents();
+void dragBeginCallback(GtkWidget*, GdkDragContext*, gpointer);
+void dragEndCallback(GtkWidget*, GdkDragContext*, gpointer);
+gboolean dragFailedCallback(GtkWidget*, GdkDragContext*, gpointer);
#endif
diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
index ba0631d..d1592b2 100644
--- a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
@@ -855,6 +855,37 @@ JSStringRef AccessibilityUIElement::stringForRange(unsigned location, unsigned l
return 0;
}
+JSStringRef AccessibilityUIElement::attributedStringForRange(unsigned location, unsigned length)
+{
+ NSRange range = NSMakeRange(location, length);
+ BEGIN_AX_OBJC_EXCEPTIONS
+ NSAttributedString* string = [m_element accessibilityAttributeValue:NSAccessibilityAttributedStringForRangeParameterizedAttribute forParameter:[NSValue valueWithRange:range]];
+ if (![string isKindOfClass:[NSAttributedString class]])
+ return 0;
+
+ NSString* stringWithAttrs = [string description];
+ return [stringWithAttrs createJSStringRef];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned location, unsigned length)
+{
+ NSRange range = NSMakeRange(location, length);
+ BEGIN_AX_OBJC_EXCEPTIONS
+ NSAttributedString* string = [m_element accessibilityAttributeValue:NSAccessibilityAttributedStringForRangeParameterizedAttribute forParameter:[NSValue valueWithRange:range]];
+ if (![string isKindOfClass:[NSAttributedString class]])
+ return false;
+
+ NSDictionary* attrs = [string attributesAtIndex:0 effectiveRange:nil];
+ if([[attrs objectForKey:NSAccessibilityMisspelledTextAttribute] boolValue])
+ return true;
+ END_AX_OBJC_EXCEPTIONS
+
+ return false;
+}
+
JSStringRef AccessibilityUIElement::attributesOfColumnHeaders()
{
// not yet defined in AppKit... odd
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
index 022a867..c6c39b5 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
@@ -130,16 +130,6 @@ public:
};
#endif
-void checkPermissionCallback(QObject* receiver, const QUrl& url, NotificationPermission& permission)
-{
- qobject_cast<DumpRenderTree*>(receiver)->checkPermission(url, permission);
-}
-
-void requestPermissionCallback(QObject* receiver, const QString& origin)
-{
- qobject_cast<DumpRenderTree*>(receiver)->requestPermission(origin);
-}
-
WebPage::WebPage(QObject* parent, DumpRenderTree* drt)
: QWebPage(parent)
, m_webInspector(0)
@@ -167,10 +157,9 @@ WebPage::WebPage(QObject* parent, DumpRenderTree* drt)
setNetworkAccessManager(m_drt->networkAccessManager());
setPluginFactory(new TestPlugin(this));
- DumpRenderTreeSupportQt::setNotificationsReceiver(m_drt);
- DumpRenderTreeSupportQt::setCheckPermissionFunction(checkPermissionCallback);
- DumpRenderTreeSupportQt::setRequestPermissionFunction(requestPermissionCallback);
-
+ connect(this, SIGNAL(requestPermissionFromUser(QWebFrame*, QWebPage::PermissionDomain)), this, SLOT(requestPermission(QWebFrame*, QWebPage::PermissionDomain)));
+ connect(this, SIGNAL(checkPermissionFromUser(QWebFrame*, QWebPage::PermissionDomain, QWebPage::PermissionPolicy&)), this, SLOT(checkPermission(QWebFrame*, QWebPage::PermissionDomain, QWebPage::PermissionPolicy&)));
+ connect(this, SIGNAL(cancelRequestsForPermissionFromUser(QWebFrame*, QWebPage::PermissionDomain)), this, SLOT(cancelRequestsForPermissionFromUser(QWebFrame*, QWebPage::PermissionDomain)));
}
WebPage::~WebPage()
@@ -228,6 +217,36 @@ void WebPage::javaScriptAlert(QWebFrame*, const QString& message)
fprintf(stdout, "ALERT: %s\n", message.toUtf8().constData());
}
+void WebPage::requestPermission(QWebFrame* frame, QWebPage::PermissionDomain domain)
+{
+ switch (domain) {
+ case NotificationsPermissionDomain:
+ if (!m_drt->layoutTestController()->ignoreReqestForPermission())
+ setUserPermission(frame, domain, PermissionGranted);
+ break;
+ default:
+ break;
+ }
+}
+
+void WebPage::checkPermission(QWebFrame* frame, QWebPage::PermissionDomain domain, QWebPage::PermissionPolicy& policy)
+{
+ switch (domain) {
+ case NotificationsPermissionDomain:
+ {
+ QUrl url = frame->url();
+ policy = m_drt->layoutTestController()->checkDesktopNotificationPermission(url.scheme() + "://" + url.host()) ? PermissionGranted : PermissionDenied;
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+void WebPage::cancelRequestsForPermission(QWebFrame*, QWebPage::PermissionDomain)
+{
+}
+
static QString urlSuitableForTestResult(const QString& url)
{
if (url.isEmpty() || !url.startsWith(QLatin1String("file://")))
@@ -992,16 +1011,6 @@ void DumpRenderTree::switchFocus(bool focused)
}
-void DumpRenderTree::checkPermission(const QUrl& url, NotificationPermission& permission)
-{
- permission = m_controller->checkDesktopNotificationPermission(url.scheme() + "://" + url.host()) ? NotificationAllowed : NotificationDenied;
-}
-
-void DumpRenderTree::requestPermission(const QString& origin)
-{
- DumpRenderTreeSupportQt::allowNotificationForOrigin(origin);
-}
-
#if defined(Q_WS_X11)
void DumpRenderTree::initializeFonts()
{
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h
index f258189..de0c6c5 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h
@@ -119,8 +119,6 @@ public Q_SLOTS:
void dumpDatabaseQuota(QWebFrame* frame, const QString& dbName);
void statusBarMessage(const QString& message);
void windowCloseRequested();
- void checkPermission(const QUrl&, NotificationPermission&);
- void requestPermission(const QString&);
Q_SIGNALS:
void quit();
@@ -193,6 +191,9 @@ public:
public slots:
bool shouldInterruptJavaScript() { return false; }
bool allowGeolocationRequest(QWebFrame *frame);
+ void requestPermission(QWebFrame* frame, QWebPage::PermissionDomain domain);
+ void checkPermission(QWebFrame* frame, QWebPage::PermissionDomain domain, QWebPage::PermissionPolicy& policy);
+ void cancelRequestsForPermission(QWebFrame* frame, QWebPage::PermissionDomain domain);
protected:
bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, NavigationType type);
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
index 3a6229f..8ebdbae 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
@@ -67,6 +67,7 @@ void LayoutTestController::reset()
m_globalFlag = false;
m_userStyleSheetEnabled = false;
m_desktopNotificationAllowedOrigins.clear();
+ m_ignoreDesktopNotification = false;
DumpRenderTreeSupportQt::dumpEditingCallbacks(false);
DumpRenderTreeSupportQt::dumpFrameLoader(false);
@@ -193,9 +194,14 @@ void LayoutTestController::grantDesktopNotificationPermission(const QString& ori
m_desktopNotificationAllowedOrigins.append(origin);
}
+void LayoutTestController::ignoreDesktopNotificationPermissionRequests()
+{
+ m_ignoreDesktopNotification = true;
+}
+
bool LayoutTestController::checkDesktopNotificationPermission(const QString& origin)
{
- return m_desktopNotificationAllowedOrigins.contains(origin);
+ return !m_ignoreDesktopNotification && m_desktopNotificationAllowedOrigins.contains(origin);
}
void LayoutTestController::display()
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
index 4e95381..4ebf99d 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
@@ -70,6 +70,7 @@ public:
bool canOpenWindows() const { return m_canOpenWindows; }
bool shouldDumpTitleChanges() const { return m_dumpTitleChanges; }
bool waitForPolicy() const { return m_waitForPolicy; }
+ bool ignoreReqestForPermission() const { return m_ignoreDesktopNotification; }
void reset();
@@ -120,6 +121,7 @@ public slots:
void setCloseRemainingWindowsWhenComplete(bool = false) {}
int windowCount();
void grantDesktopNotificationPermission(const QString& origin);
+ void ignoreDesktopNotificationPermissionRequests();
bool checkDesktopNotificationPermission(const QString& origin);
void display();
void clearBackForwardList();
@@ -252,6 +254,7 @@ private:
WebCore::DumpRenderTree* m_drt;
QWebHistory* m_webHistory;
QStringList m_desktopNotificationAllowedOrigins;
+ bool m_ignoreDesktopNotification;
};
#endif // LayoutTestControllerQt_h
diff --git a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
index 6aef32e..8c2fea2 100644
--- a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
@@ -450,6 +450,16 @@ JSStringRef AccessibilityUIElement::stringForRange(unsigned, unsigned)
return JSStringCreateWithCharacters(0, 0);
}
+JSStringRef AccessibilityUIElement::attributedStringForRange(unsigned, unsigned)
+{
+ return JSStringCreateWithCharacters(0, 0);
+}
+
+bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned, unsigned)
+{
+ return false;
+}
+
AccessibilityUIElement AccessibilityUIElement::cellForColumnAndRow(unsigned column, unsigned row)
{
return 0;
diff --git a/WebKitTools/DumpRenderTree/wscript b/WebKitTools/DumpRenderTree/wscript
index 5e6c597..75d208f 100644
--- a/WebKitTools/DumpRenderTree/wscript
+++ b/WebKitTools/DumpRenderTree/wscript
@@ -33,6 +33,7 @@ include_paths = [
os.path.join(output_dir),
os.path.join(wk_root, 'JavaScriptCore'),
os.path.join(wk_root, 'WebCore'),
+ os.path.join(wk_root, 'WebCore', 'bindings', 'wx'),
os.path.join(wk_root, 'WebKit', 'wx'),
'.',
'wx'
diff --git a/WebKitTools/Makefile b/WebKitTools/Makefile
index c1f1991..57ea097 100644
--- a/WebKitTools/Makefile
+++ b/WebKitTools/Makefile
@@ -1,4 +1,4 @@
-MODULES = DumpRenderTree MiniBrowser
+MODULES = DumpRenderTree WebKitTestRunner MiniBrowser
all:
@for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
diff --git a/WebKitTools/MiniBrowser/MiniBrowser.vcproj b/WebKitTools/MiniBrowser/MiniBrowser.vcproj
index 43fc34f..3ae3f60 100644
--- a/WebKitTools/MiniBrowser/MiniBrowser.vcproj
+++ b/WebKitTools/MiniBrowser/MiniBrowser.vcproj
@@ -24,7 +24,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
@@ -40,14 +39,12 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories=""
/>
<Tool
Name="VCPreLinkEventTool"
@@ -60,8 +57,6 @@
/>
<Tool
Name="VCManifestTool"
- TypeLibraryFile=""
- ComponentFileName=""
/>
<Tool
Name="VCXDCMakeTool"
@@ -80,7 +75,6 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine=""
/>
</Configuration>
<Configuration
@@ -93,7 +87,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
@@ -109,14 +102,12 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories=""
/>
<Tool
Name="VCPreLinkEventTool"
@@ -147,7 +138,6 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine=""
/>
</Configuration>
<Configuration
@@ -159,7 +149,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
@@ -175,14 +164,12 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories=""
/>
<Tool
Name="VCPreLinkEventTool"
@@ -195,8 +182,6 @@
/>
<Tool
Name="VCManifestTool"
- TypeLibraryFile=""
- ComponentFileName=""
/>
<Tool
Name="VCXDCMakeTool"
@@ -215,7 +200,6 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine=""
/>
</Configuration>
<Configuration
@@ -227,7 +211,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
@@ -243,14 +226,12 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories=""
/>
<Tool
Name="VCPreLinkEventTool"
@@ -263,8 +244,6 @@
/>
<Tool
Name="VCManifestTool"
- TypeLibraryFile=""
- ComponentFileName=""
/>
<Tool
Name="VCXDCMakeTool"
@@ -283,7 +262,6 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine=""
/>
</Configuration>
</Configurations>
diff --git a/WebKitTools/MiniBrowser/mac/AppDelegate.m b/WebKitTools/MiniBrowser/mac/AppDelegate.m
index 2805157..ccbf176 100644
--- a/WebKitTools/MiniBrowser/mac/AppDelegate.m
+++ b/WebKitTools/MiniBrowser/mac/AppDelegate.m
@@ -28,8 +28,9 @@
#import "BrowserWindowController.h"
#import "BrowserStatisticsWindowController.h"
-#import <WebKit2/WKStringCF.h>
#import <WebKit2/WKContextPrivate.h>
+#import <WebKit2/WKStringCF.h>
+#import <WebKit2/WKURLCF.h>
static NSString *defaultURL = @"http://www.webkit.org/";
@@ -46,6 +47,55 @@ void _didRecieveMessageFromInjectedBundle(WKContextRef context, WKStringRef mess
WKStringRelease(newMessage);
}
+#pragma mark History Client Callbacks
+
+static void didNavigateWithNavigationData(WKContextRef context, WKPageRef page, WKNavigationDataRef navigationData, WKFrameRef frame, const void *clientInfo)
+{
+ WKStringRef wkTitle = WKNavigationDataCopyTitle(navigationData);
+ CFStringRef title = WKStringCopyCFString(0, wkTitle);
+ WKStringRelease(wkTitle);
+
+ WKURLRef wkURL = WKNavigationDataCopyURL(navigationData);
+ CFURLRef url = WKURLCopyCFURL(0, wkURL);
+ WKURLRelease(wkURL);
+
+ LOG(@"HistoryClient - didNavigateWithNavigationData - title: %@ - url: %@", title, url);
+ CFRelease(title);
+ CFRelease(url);
+}
+
+static void didPerformClientRedirect(WKContextRef context, WKPageRef page, WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef frame, const void *clientInfo)
+{
+ CFURLRef cfSourceURL = WKURLCopyCFURL(0, sourceURL);
+ CFURLRef cfDestinationURL = WKURLCopyCFURL(0, destinationURL);
+ LOG(@"HistoryClient - didPerformClientRedirect - sourceURL: %@ - destinationURL: %@", cfSourceURL, cfDestinationURL);
+ CFRelease(cfSourceURL);
+ CFRelease(cfDestinationURL);
+}
+
+static void didPerformServerRedirect(WKContextRef context, WKPageRef page, WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef frame, const void *clientInfo)
+{
+ CFURLRef cfSourceURL = WKURLCopyCFURL(0, sourceURL);
+ CFURLRef cfDestinationURL = WKURLCopyCFURL(0, destinationURL);
+ LOG(@"HistoryClient - didPerformServerRedirect - sourceURL: %@ - destinationURL: %@", cfSourceURL, cfDestinationURL);
+ CFRelease(cfSourceURL);
+ CFRelease(cfDestinationURL);
+}
+
+static void didUpdateHistoryTitle(WKContextRef context, WKPageRef page, WKStringRef title, WKURLRef URL, WKFrameRef frame, const void *clientInfo)
+{
+ CFStringRef cfTitle = WKStringCopyCFString(0, title);
+ CFURLRef cfURL = WKURLCopyCFURL(0, URL);
+ LOG(@"HistoryClient - didUpdateHistoryTitle - title: %@ - URL: %@", cfTitle, cfURL);
+ CFRelease(cfTitle);
+ CFRelease(cfURL);
+}
+
+static void populateVisitedLinks(WKContextRef context, const void *clientInfo)
+{
+ LOG(@"HistoryClient - populateVisitedLinks");
+}
+
- (id)init
{
self = [super init];
@@ -56,6 +106,17 @@ void _didRecieveMessageFromInjectedBundle(WKContextRef context, WKStringRef mess
currentProcessModel = kProcessModelSharedSecondaryProcess;
WKContextRef threadContext = WKContextGetSharedThreadContext();
+ WKContextHistoryClient historyClient = {
+ 0,
+ self,
+ didNavigateWithNavigationData,
+ didPerformClientRedirect,
+ didPerformServerRedirect,
+ didUpdateHistoryTitle,
+ populateVisitedLinks
+ };
+ WKContextSetHistoryClient(threadContext, &historyClient);
+
threadPageNamespace = WKPageNamespaceCreate(threadContext);
WKContextRelease(threadContext);
@@ -70,6 +131,7 @@ void _didRecieveMessageFromInjectedBundle(WKContextRef context, WKStringRef mess
_didRecieveMessageFromInjectedBundle
};
WKContextSetInjectedBundleClient(processContext, &bundleClient);
+ WKContextSetHistoryClient(processContext, &historyClient);
processPageNamespace = WKPageNamespaceCreate(processContext);
WKContextRelease(processContext);
diff --git a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
index 234c04c..9a987d2 100644
--- a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
+++ b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
@@ -152,105 +152,110 @@
#pragma mark Loader Client Callbacks
-static void _didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
{
[(BrowserWindowController *)clientInfo didStartProvisionalLoadForFrame:frame];
}
-static void _didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+static void didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
{
[(BrowserWindowController *)clientInfo didReceiveServerRedirectForProvisionalLoadForFrame:frame];
}
-static void _didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+static void didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
{
[(BrowserWindowController *)clientInfo didFailProvisionalLoadWithErrorForFrame:frame];
}
-static void _didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+static void didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
{
[(BrowserWindowController *)clientInfo didCommitLoadForFrame:frame];
}
-static void _didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
{
LOG(@"didFinishLoadForFrame");
}
-static void _didFailLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+static void didFailLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
{
[(BrowserWindowController *)clientInfo didFailLoadWithErrorForFrame:frame];
}
-static void _didReceiveTitleForFrame(WKPageRef page, WKStringRef title, WKFrameRef frame, const void *clientInfo)
+static void didReceiveTitleForFrame(WKPageRef page, WKStringRef title, WKFrameRef frame, const void *clientInfo)
{
CFStringRef cfTitle = WKStringCopyCFString(0, title);
LOG(@"didReceiveTitleForFrame \"%@\"", (NSString *)cfTitle);
CFRelease(cfTitle);
}
-static void _didFirstLayoutForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+static void didFirstLayoutForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
{
LOG(@"didFirstLayoutForFrame");
}
-static void _didFirstVisuallyNonEmptyLayoutForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+static void didFirstVisuallyNonEmptyLayoutForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
{
LOG(@"didFirstVisuallyNonEmptyLayoutForFrame");
}
-static void _didStartProgress(WKPageRef page, const void *clientInfo)
+static void didStartProgress(WKPageRef page, const void *clientInfo)
{
[(BrowserWindowController *)clientInfo didStartProgress];
}
-static void _didChangeProgress(WKPageRef page, const void *clientInfo)
+static void didChangeProgress(WKPageRef page, const void *clientInfo)
{
[(BrowserWindowController *)clientInfo didChangeProgress:WKPageGetEstimatedProgress(page)];
}
-static void _didFinishProgress(WKPageRef page, const void *clientInfo)
+static void didFinishProgress(WKPageRef page, const void *clientInfo)
{
[(BrowserWindowController *)clientInfo didFinishProgress];
}
-static void _didBecomeUnresponsive(WKPageRef page, const void *clientInfo)
+static void didBecomeUnresponsive(WKPageRef page, const void *clientInfo)
{
LOG(@"didBecomeUnresponsive");
}
-static void _didBecomeResponsive(WKPageRef page, const void *clientInfo)
+static void didBecomeResponsive(WKPageRef page, const void *clientInfo)
{
LOG(@"didBecomeResponsive");
}
-static void _didChangeBackForwardList(WKPageRef page, const void *clientInfo)
+static void processDidExit(WKPageRef page, const void *clientInfo)
+{
+ LOG(@"processDidExit");
+}
+
+static void didChangeBackForwardList(WKPageRef page, const void *clientInfo)
{
[(BrowserWindowController *)clientInfo validateToolbar];
}
#pragma mark Policy Client Callbacks
-static void _decidePolicyForNavigationAction(WKPageRef page, WKFrameNavigationType navigationType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo)
+static void decidePolicyForNavigationAction(WKPageRef page, WKFrameNavigationType navigationType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo)
{
LOG(@"decidePolicyForNavigationAction");
WKFramePolicyListenerUse(listener);
}
-static void _decidePolicyForNewWindowAction(WKPageRef page, WKFrameNavigationType navigationType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo)
+static void decidePolicyForNewWindowAction(WKPageRef page, WKFrameNavigationType navigationType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo)
{
LOG(@"decidePolicyForNewWindowAction");
WKFramePolicyListenerUse(listener);
}
-static void _decidePolicyForMIMEType(WKPageRef page, WKStringRef MIMEType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo)
+static void decidePolicyForMIMEType(WKPageRef page, WKStringRef MIMEType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo)
{
WKFramePolicyListenerUse(listener);
}
#pragma mark UI Client Callbacks
-static WKPageRef _createNewPage(WKPageRef page, const void* clientInfo)
+static WKPageRef createNewPage(WKPageRef page, const void* clientInfo)
{
LOG(@"createNewPage");
BrowserWindowController *controller = [[BrowserWindowController alloc] initWithPageNamespace:WKPageGetPageNamespace(page)];
@@ -259,13 +264,13 @@ static WKPageRef _createNewPage(WKPageRef page, const void* clientInfo)
return controller->_webView.pageRef;
}
-static void _showPage(WKPageRef page, const void *clientInfo)
+static void showPage(WKPageRef page, const void *clientInfo)
{
LOG(@"showPage");
[[(BrowserWindowController *)clientInfo window] orderFront:nil];
}
-static void _closePage(WKPageRef page, const void *clientInfo)
+static void closePage(WKPageRef page, const void *clientInfo)
{
LOG(@"closePage");
WKPageClose(page);
@@ -273,17 +278,20 @@ static void _closePage(WKPageRef page, const void *clientInfo)
WKPageRelease(page);
}
-static void _runJavaScriptAlert(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void* clientInfo)
+static void runJavaScriptAlert(WKPageRef page, WKStringRef message, WKFrameRef frame, const void* clientInfo)
{
NSAlert* alert = [[NSAlert alloc] init];
- CFURLRef cfURL = WKURLCopyCFURL(0, WKFrameGetURL(frame));
- [alert setMessageText:[NSString stringWithFormat:@"JavaScript Alert from %@.", [(NSURL *)cfURL absoluteString]]];
+ WKURLRef wkURL = WKFrameCopyURL(frame);
+ CFURLRef cfURL = WKURLCopyCFURL(0, wkURL);
+ WKURLRelease(wkURL);
+
+ [alert setMessageText:[NSString stringWithFormat:@"JavaScript alert dialog from %@.", [(NSURL *)cfURL absoluteString]]];
CFRelease(cfURL);
- CFStringRef cfAlertText = WKStringCopyCFString(0, alertText);
- [alert setInformativeText:(NSString *)alertText];
- CFRelease(cfAlertText);
+ CFStringRef cfMessage = WKStringCopyCFString(0, message);
+ [alert setInformativeText:(NSString *)cfMessage];
+ CFRelease(cfMessage);
[alert addButtonWithTitle:@"OK"];
@@ -291,43 +299,68 @@ static void _runJavaScriptAlert(WKPageRef page, WKStringRef alertText, WKFrameRe
[alert release];
}
+static bool runJavaScriptConfirm(WKPageRef page, WKStringRef message, WKFrameRef frame, const void* clientInfo)
+{
+ NSAlert* alert = [[NSAlert alloc] init];
-#pragma mark History Client Callbacks
+ WKURLRef wkURL = WKFrameCopyURL(frame);
+ CFURLRef cfURL = WKURLCopyCFURL(0, wkURL);
+ WKURLRelease(wkURL);
-static void _didNavigateWithNavigationData(WKPageRef page, WKNavigationDataRef navigationData, WKFrameRef frame, const void *clientInfo)
-{
- CFStringRef title = WKStringCopyCFString(0, WKNavigationDataGetTitle(navigationData));
- CFURLRef url = WKURLCopyCFURL(0, WKNavigationDataGetURL(navigationData));
- LOG(@"HistoryClient - didNavigateWithNavigationData - title: %@ - url: %@", title, url);
- CFRelease(title);
- CFRelease(url);
-}
+ [alert setMessageText:[NSString stringWithFormat:@"JavaScript confirm dialog from %@.", [(NSURL *)cfURL absoluteString]]];
+ CFRelease(cfURL);
-static void _didPerformClientRedirect(WKPageRef page, WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef frame, const void *clientInfo)
-{
- CFURLRef cfSourceURL = WKURLCopyCFURL(0, sourceURL);
- CFURLRef cfDestinationURL = WKURLCopyCFURL(0, destinationURL);
- LOG(@"HistoryClient - didPerformClientRedirect - sourceURL: %@ - destinationURL: %@", cfSourceURL, cfDestinationURL);
- CFRelease(cfSourceURL);
- CFRelease(cfDestinationURL);
-}
+ CFStringRef cfMessage = WKStringCopyCFString(0, message);
+ [alert setInformativeText:(NSString *)cfMessage];
+ CFRelease(cfMessage);
-static void _didPerformServerRedirect(WKPageRef page, WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef frame, const void *clientInfo)
-{
- CFURLRef cfSourceURL = WKURLCopyCFURL(0, sourceURL);
- CFURLRef cfDestinationURL = WKURLCopyCFURL(0, destinationURL);
- LOG(@"HistoryClient - didPerformServerRedirect - sourceURL: %@ - destinationURL: %@", cfSourceURL, cfDestinationURL);
- CFRelease(cfSourceURL);
- CFRelease(cfDestinationURL);
+ [alert addButtonWithTitle:@"OK"];
+ [alert addButtonWithTitle:@"Cancel"];
+
+ NSInteger button = [alert runModal];
+ [alert release];
+
+ return button == NSAlertFirstButtonReturn;
}
-static void _didUpdateHistoryTitle(WKPageRef page, WKStringRef title, WKURLRef URL, WKFrameRef frame, const void *clientInfo)
+static WKStringRef runJavaScriptPrompt(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, const void* clientInfo)
{
- CFStringRef cfTitle = WKStringCopyCFString(0, title);
- CFURLRef cfURL = WKURLCopyCFURL(0, URL);
- LOG(@"HistoryClient - didUpdateHistoryTitle - title: %@ - URL: %@", cfTitle, cfURL);
- CFRelease(cfTitle);
+ NSAlert* alert = [[NSAlert alloc] init];
+
+ WKURLRef wkURL = WKFrameCopyURL(frame);
+ CFURLRef cfURL = WKURLCopyCFURL(0, wkURL);
+ WKURLRelease(wkURL);
+
+ [alert setMessageText:[NSString stringWithFormat:@"JavaScript prompt dialog from %@.", [(NSURL *)cfURL absoluteString]]];
CFRelease(cfURL);
+
+ CFStringRef cfMessage = WKStringCopyCFString(0, message);
+ [alert setInformativeText:(NSString *)cfMessage];
+ CFRelease(cfMessage);
+
+ [alert addButtonWithTitle:@"OK"];
+ [alert addButtonWithTitle:@"Cancel"];
+
+ NSTextField* input = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 200, 24)];
+ CFStringRef cfDefaultValue = WKStringCopyCFString(0, defaultValue);
+ [input setStringValue:(NSString *)cfDefaultValue];
+ CFRelease(cfDefaultValue);
+
+ [alert setAccessoryView:input];
+
+ NSInteger button = [alert runModal];
+
+ NSString* result = nil;
+ if (button == NSAlertFirstButtonReturn) {
+ [input validateEditing];
+ result = [input stringValue];
+ }
+
+ [alert release];
+
+ if (!result)
+ return 0;
+ return WKStringCreateWithCFString((CFStringRef)result);
}
- (void)awakeFromNib
@@ -342,53 +375,45 @@ static void _didUpdateHistoryTitle(WKPageRef page, WKStringRef title, WKURLRef U
WKPageLoaderClient loadClient = {
0, /* version */
self, /* clientInfo */
- _didStartProvisionalLoadForFrame,
- _didReceiveServerRedirectForProvisionalLoadForFrame,
- _didFailProvisionalLoadWithErrorForFrame,
- _didCommitLoadForFrame,
- _didFinishLoadForFrame,
- _didFailLoadWithErrorForFrame,
- _didReceiveTitleForFrame,
- _didFirstLayoutForFrame,
- _didFirstVisuallyNonEmptyLayoutForFrame,
- _didStartProgress,
- _didChangeProgress,
- _didFinishProgress,
- _didBecomeUnresponsive,
- _didBecomeResponsive,
- _didChangeBackForwardList
+ didStartProvisionalLoadForFrame,
+ didReceiveServerRedirectForProvisionalLoadForFrame,
+ didFailProvisionalLoadWithErrorForFrame,
+ didCommitLoadForFrame,
+ didFinishLoadForFrame,
+ didFailLoadWithErrorForFrame,
+ didReceiveTitleForFrame,
+ didFirstLayoutForFrame,
+ didFirstVisuallyNonEmptyLayoutForFrame,
+ didStartProgress,
+ didChangeProgress,
+ didFinishProgress,
+ didBecomeUnresponsive,
+ didBecomeResponsive,
+ processDidExit,
+ didChangeBackForwardList
};
WKPageSetPageLoaderClient(_webView.pageRef, &loadClient);
WKPagePolicyClient policyClient = {
0, /* version */
self, /* clientInfo */
- _decidePolicyForNavigationAction,
- _decidePolicyForNewWindowAction,
- _decidePolicyForMIMEType
+ decidePolicyForNavigationAction,
+ decidePolicyForNewWindowAction,
+ decidePolicyForMIMEType
};
WKPageSetPagePolicyClient(_webView.pageRef, &policyClient);
WKPageUIClient uiClient = {
0, /* version */
self, /* clientInfo */
- _createNewPage,
- _showPage,
- _closePage,
- _runJavaScriptAlert
+ createNewPage,
+ showPage,
+ closePage,
+ runJavaScriptAlert,
+ runJavaScriptConfirm,
+ runJavaScriptPrompt
};
WKPageSetPageUIClient(_webView.pageRef, &uiClient);
-
- WKPageHistoryClient historyClient = {
- 0,
- self,
- _didNavigateWithNavigationData,
- _didPerformClientRedirect,
- _didPerformServerRedirect,
- _didUpdateHistoryTitle,
- };
-
- WKPageSetPageHistoryClient(_webView.pageRef, &historyClient);
}
- (void)didStartProgress
@@ -410,11 +435,13 @@ static void _didUpdateHistoryTitle(WKPageRef page, WKStringRef title, WKURLRef U
- (void)updateProvisionalURLForFrame:(WKFrameRef)frame
{
- WKURLRef url = WKFrameGetProvisionalURL(frame);
+ WKURLRef url = WKFrameCopyProvisionalURL(frame);
if (!url)
return;
CFURLRef cfSourceURL = WKURLCopyCFURL(0, url);
+ WKURLRelease(url);
+
[urlText setStringValue:(NSString*)CFURLGetString(cfSourceURL)];
CFRelease(cfSourceURL);
}
diff --git a/WebKitTools/MiniBrowser/mac/WebBundle/WebBundleMain.m b/WebKitTools/MiniBrowser/mac/WebBundle/WebBundleMain.m
index f36aaae..cd5ee00 100644
--- a/WebKitTools/MiniBrowser/mac/WebBundle/WebBundleMain.m
+++ b/WebKitTools/MiniBrowser/mac/WebBundle/WebBundleMain.m
@@ -65,9 +65,12 @@ void _didReceiveTitleForFrame(WKBundlePageRef page, WKStringRef title, WKBundleF
{
}
-void _didClearWindowForFrame(WKBundlePageRef page, WKBundleFrameRef frame, JSContextRef ctx, JSObjectRef window, const void *clientInfo)
+void _didClearWindowForFrame(WKBundlePageRef page, WKBundleFrameRef frame, JSGlobalContextRef context, JSObjectRef window, const void *clientInfo)
{
- CFURLRef cfURL = WKURLCopyCFURL(0, WKBundleFrameGetURL(WKBundlePageGetMainFrame(page)));
+ WKURLRef wkURL = WKBundleFrameCopyURL(WKBundlePageGetMainFrame(page));
+ CFURLRef cfURL = WKURLCopyCFURL(0, wkURL);
+ WKURLRelease(wkURL);
+
LOG(@"WKBundlePageClient - _didClearWindowForFrame %@", [(NSURL *)cfURL absoluteString]);
CFRelease(cfURL);
diff --git a/WebKitTools/MiniBrowser/win/stdafx.h b/WebKitTools/MiniBrowser/win/stdafx.h
index c5a35f9..0522a17 100644
--- a/WebKitTools/MiniBrowser/win/stdafx.h
+++ b/WebKitTools/MiniBrowser/win/stdafx.h
@@ -28,3 +28,4 @@
#include <tchar.h>
#include <windows.h>
+
diff --git a/WebKitTools/QtTestBrowser/main.cpp b/WebKitTools/QtTestBrowser/main.cpp
index 25765be..288472c 100644
--- a/WebKitTools/QtTestBrowser/main.cpp
+++ b/WebKitTools/QtTestBrowser/main.cpp
@@ -92,29 +92,6 @@ static bool gUseFrameFlattening = false;
static bool gUseQGLWidgetViewport = false;
#endif
-class NotificationsPermissionController : public QObject {
- Q_OBJECT
-public:
- NotificationsPermissionController(QObject* parent) : QObject(parent)
- {
- DumpRenderTreeSupportQt::setNotificationsReceiver(this);
- DumpRenderTreeSupportQt::setCheckPermissionFunction(checkPermission);
- DumpRenderTreeSupportQt::setRequestPermissionFunction(requestPermission);
- }
-
- static void checkPermission(QObject*, const QUrl&, NotificationPermission& permission)
- {
- permission = NotificationAllowed;
- }
-
- static void requestPermission(QObject*, const QString& origin)
- {
- DumpRenderTreeSupportQt::allowNotificationForOrigin(origin);
- }
-};
-
-NotificationsPermissionController* notificationsPermissionController = 0;
-
class LauncherWindow : public MainWindow {
Q_OBJECT
@@ -233,8 +210,6 @@ LauncherWindow::LauncherWindow(LauncherWindow* other, bool shareScene)
}
createChrome();
- if (!notificationsPermissionController)
- notificationsPermissionController = new NotificationsPermissionController(QCoreApplication::instance());
}
LauncherWindow::~LauncherWindow()
@@ -885,16 +860,6 @@ void LauncherWindow::createChrome()
toggleFullScreen->connect(this, SIGNAL(enteredFullScreenMode(bool)), SLOT(setChecked(bool)));
QMenu* toolsMenu = menuBar()->addMenu("&Develop");
- toolsMenu->addAction("Select Elements...", this, SLOT(selectElements()));
- QAction* showInspectorAction = toolsMenu->addAction("Show Web Inspector", m_inspector, SLOT(setVisible(bool)), QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_I));
- showInspectorAction->setCheckable(true);
- showInspectorAction->connect(m_inspector, SIGNAL(visibleChanged(bool)), SLOT(setChecked(bool)));
-
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- QAction* touchMockAction = toolsMenu->addAction("Toggle multitouch mocking", this, SLOT(setTouchMocking(bool)));
- touchMockAction->setCheckable(true);
- touchMockAction->setShortcut(QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_T));
-#endif
QWebSettings* settings = page()->settings();
@@ -907,24 +872,6 @@ void LauncherWindow::createChrome()
toggleWebGL->setCheckable(true);
toggleWebGL->setChecked(settings->testAttribute(QWebSettings::WebGLEnabled));
- QAction* toggleAcceleratedCompositing = graphicsViewMenu->addAction("Toggle Accelerated Compositing", this, SLOT(toggleAcceleratedCompositing(bool)));
- toggleAcceleratedCompositing->setCheckable(true);
- toggleAcceleratedCompositing->setChecked(settings->testAttribute(QWebSettings::AcceleratedCompositingEnabled));
- toggleAcceleratedCompositing->setEnabled(isGraphicsBased());
- toggleAcceleratedCompositing->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
-
- QAction* toggleResizesToContents = graphicsViewMenu->addAction("Toggle Resizes To Contents Mode", this, SLOT(toggleResizesToContents(bool)));
- toggleResizesToContents->setCheckable(true);
- toggleResizesToContents->setChecked(false);
- toggleResizesToContents->setEnabled(isGraphicsBased());
- toggleResizesToContents->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
-
- QAction* toggleTiledBackingStore = graphicsViewMenu->addAction("Toggle Tiled Backing Store", this, SLOT(toggleTiledBackingStore(bool)));
- toggleTiledBackingStore->setCheckable(true);
- toggleTiledBackingStore->setChecked(false);
- toggleTiledBackingStore->setEnabled(isGraphicsBased());
- toggleTiledBackingStore->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
-
QAction* spatialNavigationAction = toolsMenu->addAction("Toggle Spatial Navigation", this, SLOT(toggleSpatialNavigation(bool)));
spatialNavigationAction->setCheckable(true);
spatialNavigationAction->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_S));
@@ -933,6 +880,14 @@ void LauncherWindow::createChrome()
toggleFrameFlattening->setCheckable(true);
toggleFrameFlattening->setChecked(settings->testAttribute(QWebSettings::FrameFlatteningEnabled));
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ QAction* touchMockAction = toolsMenu->addAction("Toggle multitouch mocking", this, SLOT(setTouchMocking(bool)));
+ touchMockAction->setCheckable(true);
+ touchMockAction->setShortcut(QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_T));
+#endif
+
+ toolsMenu->addSeparator();
+
QAction* toggleInterruptingJavaScripteEnabled = toolsMenu->addAction("Enable interrupting js scripts", this, SLOT(toggleInterruptingJavaScriptEnabled(bool)));
toggleInterruptingJavaScripteEnabled->setCheckable(true);
toggleInterruptingJavaScripteEnabled->setChecked(false);
@@ -941,44 +896,43 @@ void LauncherWindow::createChrome()
toggleJavascriptCanOpenWindows->setCheckable(true);
toggleJavascriptCanOpenWindows->setChecked(false);
-#if defined(QT_CONFIGURED_WITH_OPENGL)
- QAction* toggleQGLWidgetViewport = graphicsViewMenu->addAction("Toggle use of QGLWidget Viewport", this, SLOT(toggleQGLWidgetViewport(bool)));
- toggleQGLWidgetViewport->setCheckable(true);
- toggleQGLWidgetViewport->setChecked(gUseQGLWidgetViewport);
- toggleQGLWidgetViewport->setEnabled(isGraphicsBased());
- toggleQGLWidgetViewport->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
-#endif
+ toolsMenu->addSeparator();
QAction* userAgentAction = toolsMenu->addAction("Change User Agent", this, SLOT(showUserAgentDialog()));
userAgentAction->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_U));
- graphicsViewMenu->addSeparator();
-
- m_flipAnimated = graphicsViewMenu->addAction("Animated Flip");
- m_flipAnimated->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
- m_flipAnimated->setEnabled(isGraphicsBased());
+ toolsMenu->addAction("Select Elements...", this, SLOT(selectElements()));
- m_flipYAnimated = graphicsViewMenu->addAction("Animated Y-Flip");
- m_flipYAnimated->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
- m_flipYAnimated->setEnabled(isGraphicsBased());
+ QAction* showInspectorAction = toolsMenu->addAction("Show Web Inspector", m_inspector, SLOT(setVisible(bool)), QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_I));
+ showInspectorAction->setCheckable(true);
+ showInspectorAction->connect(m_inspector, SIGNAL(visibleChanged(bool)), SLOT(setChecked(bool)));
- if (isGraphicsBased()) {
- WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
- connect(m_flipAnimated, SIGNAL(triggered()), view, SLOT(animatedFlip()));
- connect(m_flipYAnimated, SIGNAL(triggered()), view, SLOT(animatedYFlip()));
- }
+ // GraphicsView sub menu.
+ QAction* toggleAcceleratedCompositing = graphicsViewMenu->addAction("Toggle Accelerated Compositing", this, SLOT(toggleAcceleratedCompositing(bool)));
+ toggleAcceleratedCompositing->setCheckable(true);
+ toggleAcceleratedCompositing->setChecked(settings->testAttribute(QWebSettings::AcceleratedCompositingEnabled));
+ toggleAcceleratedCompositing->setEnabled(isGraphicsBased());
+ toggleAcceleratedCompositing->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
- graphicsViewMenu->addSeparator();
+ QAction* toggleResizesToContents = graphicsViewMenu->addAction("Toggle Resizes To Contents Mode", this, SLOT(toggleResizesToContents(bool)));
+ toggleResizesToContents->setCheckable(true);
+ toggleResizesToContents->setChecked(false);
+ toggleResizesToContents->setEnabled(isGraphicsBased());
+ toggleResizesToContents->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
- QAction* cloneWindow = graphicsViewMenu->addAction("Clone Window", this, SLOT(cloneWindow()));
- cloneWindow->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
- cloneWindow->setEnabled(isGraphicsBased());
+ QAction* toggleTiledBackingStore = graphicsViewMenu->addAction("Toggle Tiled Backing Store", this, SLOT(toggleTiledBackingStore(bool)));
+ toggleTiledBackingStore->setCheckable(true);
+ toggleTiledBackingStore->setChecked(false);
+ toggleTiledBackingStore->setEnabled(isGraphicsBased());
+ toggleTiledBackingStore->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
- QAction* showFPS = graphicsViewMenu->addAction("Show FPS", this, SLOT(showFPS(bool)));
- showFPS->setCheckable(true);
- showFPS->setEnabled(isGraphicsBased());
- showFPS->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
- showFPS->setChecked(gShowFrameRate);
+#if defined(QT_CONFIGURED_WITH_OPENGL)
+ QAction* toggleQGLWidgetViewport = graphicsViewMenu->addAction("Toggle use of QGLWidget Viewport", this, SLOT(toggleQGLWidgetViewport(bool)));
+ toggleQGLWidgetViewport->setCheckable(true);
+ toggleQGLWidgetViewport->setChecked(gUseQGLWidgetViewport);
+ toggleQGLWidgetViewport->setEnabled(isGraphicsBased());
+ toggleQGLWidgetViewport->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+#endif
QMenu* viewportUpdateMenu = graphicsViewMenu->addMenu("Change Viewport Update Mode");
viewportUpdateMenu->setEnabled(isGraphicsBased());
@@ -1025,6 +979,34 @@ void LauncherWindow::createChrome()
viewportUpdateModeActions->addAction(smartUpdate);
viewportUpdateModeActions->addAction(boundingRectUpdate);
viewportUpdateModeActions->addAction(noUpdate);
+
+ graphicsViewMenu->addSeparator();
+
+ m_flipAnimated = graphicsViewMenu->addAction("Animated Flip");
+ m_flipAnimated->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+ m_flipAnimated->setEnabled(isGraphicsBased());
+
+ m_flipYAnimated = graphicsViewMenu->addAction("Animated Y-Flip");
+ m_flipYAnimated->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+ m_flipYAnimated->setEnabled(isGraphicsBased());
+
+ if (isGraphicsBased()) {
+ WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
+ connect(m_flipAnimated, SIGNAL(triggered()), view, SLOT(animatedFlip()));
+ connect(m_flipYAnimated, SIGNAL(triggered()), view, SLOT(animatedYFlip()));
+ }
+
+ QAction* cloneWindow = graphicsViewMenu->addAction("Clone Window", this, SLOT(cloneWindow()));
+ cloneWindow->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+ cloneWindow->setEnabled(isGraphicsBased());
+
+ graphicsViewMenu->addSeparator();
+
+ QAction* showFPS = graphicsViewMenu->addAction("Show FPS", this, SLOT(showFPS(bool)));
+ showFPS->setCheckable(true);
+ showFPS->setEnabled(isGraphicsBased());
+ showFPS->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+ showFPS->setChecked(gShowFrameRate);
}
QWebPage* WebPage::createWindow(QWebPage::WebWindowType type)
diff --git a/WebKitTools/QtTestBrowser/webpage.cpp b/WebKitTools/QtTestBrowser/webpage.cpp
index 2a3aae6..ee0232b 100644
--- a/WebKitTools/QtTestBrowser/webpage.cpp
+++ b/WebKitTools/QtTestBrowser/webpage.cpp
@@ -48,6 +48,9 @@ WebPage::WebPage(QObject* parent)
connect(networkAccessManager(), SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)),
this, SLOT(authenticationRequired(QNetworkReply*, QAuthenticator*)));
+ connect(this, SIGNAL(requestPermissionFromUser(QWebFrame*, QWebPage::PermissionDomain)), this, SLOT(requestPermission(QWebFrame*, QWebPage::PermissionDomain)));
+ connect(this, SIGNAL(checkPermissionFromUser(QWebFrame*, QWebPage::PermissionDomain, QWebPage::PermissionPolicy&)), this, SLOT(checkPermission(QWebFrame*, QWebPage::PermissionDomain, QWebPage::PermissionPolicy&)));
+ connect(this, SIGNAL(cancelRequestsForPermission(QWebFrame*, QWebPage::PermissionDomain)), this, SLOT(cancelRequestsForPermission(QWebFrame*, QWebPage::PermissionDomain)));
}
void WebPage::applyProxy()
@@ -162,3 +165,23 @@ void WebPage::authenticationRequired(QNetworkReply* reply, QAuthenticator* authe
delete dialog;
}
+
+void WebPage::requestPermission(QWebFrame* frame, QWebPage::PermissionDomain domain)
+{
+ setUserPermission(frame, domain, PermissionGranted);
+}
+
+void WebPage::checkPermission(QWebFrame* frame, QWebPage::PermissionDomain domain, QWebPage::PermissionPolicy& policy)
+{
+ switch (domain) {
+ case NotificationsPermissionDomain:
+ policy = PermissionGranted;
+ break;
+ default:
+ break;
+ }
+}
+
+void WebPage::cancelRequestsForPermission(QWebFrame*, QWebPage::PermissionDomain)
+{
+}
diff --git a/WebKitTools/QtTestBrowser/webpage.h b/WebKitTools/QtTestBrowser/webpage.h
index 03cde43..15ae369 100644
--- a/WebKitTools/QtTestBrowser/webpage.h
+++ b/WebKitTools/QtTestBrowser/webpage.h
@@ -57,6 +57,9 @@ public slots:
void setUserAgent(const QString& ua) { m_userAgent = ua; }
bool shouldInterruptJavaScript();
void authenticationRequired(QNetworkReply*, QAuthenticator*);
+ void requestPermission(QWebFrame* frame, QWebPage::PermissionDomain domain);
+ void checkPermission(QWebFrame* frame, QWebPage::PermissionDomain domain, QWebPage::PermissionPolicy& policy);
+ void cancelRequestsForPermission(QWebFrame* frame, QWebPage::PermissionDomain domain);
private:
void applyProxy();
diff --git a/WebKitTools/Scripts/build-webkit b/WebKitTools/Scripts/build-webkit
index 57aab45..21214cc 100755
--- a/WebKitTools/Scripts/build-webkit
+++ b/WebKitTools/Scripts/build-webkit
@@ -61,7 +61,7 @@ my ($linkPrefetchSupport, $threeDCanvasSupport, $threeDRenderingSupport, $channe
$svgSupport, $svgAnimationSupport, $svgAsImageSupport, $svgDOMObjCBindingsSupport, $svgFontsSupport,
$svgForeignObjectSupport, $svgUseSupport, $videoSupport, $webSocketsSupport, $webTimingSupport, $wmlSupport, $wcssSupport, $xhtmlmpSupport, $workersSupport,
$xpathSupport, $xsltSupport, $coverageSupport, $notificationsSupport, $blobSliceSupport, $tiledBackingStoreSupport,
- $fileReaderSupport, $fileWriterSupport, $directoryUploadSupport);
+ $fileReaderSupport, $fileWriterSupport, $fileSystemSupport, $directoryUploadSupport);
my @features = (
{ option => "link-prefetch", desc => "Toggle pre fetching support",
@@ -201,6 +201,9 @@ my @features = (
{ option => "file-writer", desc => "Toggle FileWriter support",
define => "ENABLE_FILE_WRITER", default => 0, value => \$fileWriterSupport },
+
+ { option => "file-system", desc => "Toggle FileSystem support",
+ define => "ENABLE_FILE_SYSTEM", default => 0, value => \$fileSystemSupport },
);
# Update defaults from Qt's project file
diff --git a/WebKitTools/Scripts/check-for-inappropriate-files-in-framework b/WebKitTools/Scripts/check-for-inappropriate-files-in-framework
index 2bc65d4..a323bc4 100755
--- a/WebKitTools/Scripts/check-for-inappropriate-files-in-framework
+++ b/WebKitTools/Scripts/check-for-inappropriate-files-in-framework
@@ -25,6 +25,7 @@
base_directory = ENV['TARGET_BUILD_DIR'] or throw "Unable to find TARGET_BUILD_DIR in the environment!"
project_name = ENV['PROJECT_NAME'] or throw "Unable to find PROJECT_NAME in the environment!"
+is_shallow_bundle = (ENV['SHALLOW_BUNDLE'] || "NO").upcase == "YES"
$INAPPROPRIATE_FILES = { "WebCore" => { "Resources" => ["*.css", "*.in", "*.idl"] } }
@@ -41,12 +42,13 @@ def print_inappropriate_file_error framework, relative_path
print_error "#{framework}.framework/#{relative_path} should not be present in the framework."
end
-def check_framework framework
+def check_framework framework, is_shallow_bundle
$INAPPROPRIATE_FILES[framework].each do |directory, patterns|
- Dir.chdir "#{framework}.framework/Versions/A/#{directory}" do
+ framework_bundle_path = is_shallow_bundle ? "#{framework}.framework" : "#{framework}.framework/Versions/A/#{directory}"
+ Dir.chdir framework_bundle_path do
patterns.each do |pattern|
Dir.glob(pattern).each do |inappropriate_file|
- print_inappropriate_file_error framework, "Resources/#{inappropriate_file}"
+ print_inappropriate_file_error framework, is_shallow_bundle ? inappropriate_file : "#{directory}/#{inappropriate_file}"
File.unlink inappropriate_file
end
end
@@ -54,7 +56,7 @@ def check_framework framework
end
end
-check_framework project_name
+check_framework project_name, is_shallow_bundle
if $error_printed
STDERR.puts
diff --git a/WebKitTools/Scripts/check-for-webkit-framework-include-consistency b/WebKitTools/Scripts/check-for-webkit-framework-include-consistency
index 693dd6a..339fa7e 100755
--- a/WebKitTools/Scripts/check-for-webkit-framework-include-consistency
+++ b/WebKitTools/Scripts/check-for-webkit-framework-include-consistency
@@ -24,7 +24,8 @@
# THE POSSIBILITY OF SUCH DAMAGE.
-base_directory = ENV['TARGET_BUILD_DIR']
+base_directory = ENV['TARGET_BUILD_DIR'] or throw "Unable to find TARGET_BUILD_DIR in the environment!"
+is_shallow_bundle = (ENV['SHALLOW_BUNDLE'] || "NO").upcase == "YES"
unless base_directory
throw "Unable to find TARGET_BUILD_DIR in the environment!"
@@ -44,8 +45,9 @@ def print_error msg
STDERR.puts "ERROR: #{msg}"
end
-def build_header_maps
- all_headers = `find WebKit.framework/Versions/A/{,Private}Headers -type f -name '*.h'`.split
+def build_header_maps is_shallow_bundle
+ current_version_path = is_shallow_bundle ? "" : "Versions/A/"
+ all_headers = `find WebKit.framework/#{current_version_path}{,Private}Headers -type f -name '*.h'`.split
all_headers.each do |header|
if /\/Headers\/(.*)/.match(header)
@@ -97,7 +99,7 @@ def verify_includes(header, permitted_types)
end
end
-build_header_maps
+build_header_maps is_shallow_bundle
$HEADERS_BY_TYPE.each do |header_type, headers|
permitted_types = $PERMITTED_INCLUDE_TYPES[header_type]
diff --git a/WebKitTools/Scripts/old-run-webkit-tests b/WebKitTools/Scripts/old-run-webkit-tests
index 88c0a05..af82545 100755
--- a/WebKitTools/Scripts/old-run-webkit-tests
+++ b/WebKitTools/Scripts/old-run-webkit-tests
@@ -214,12 +214,6 @@ if (isAppleMacWebKit()) {
}
} elsif (isGtk()) {
$platform = "gtk";
- if (!$ENV{"WEBKIT_TESTFONTS"}) {
- print "The WEBKIT_TESTFONTS environment variable is not defined.\n";
- print "You must set it before running the tests.\n";
- print "Use git to grab the actual fonts from http://gitorious.org/qtwebkit/testfonts\n";
- exit 1;
- }
} elsif (isWx()) {
$platform = "wx";
} elsif (isCygwin()) {
@@ -234,6 +228,16 @@ if (isAppleMacWebKit()) {
}
}
+if (isQt() || isGtk() || isCygwin()) {
+ my $testfontPath = $ENV{"WEBKIT_TESTFONTS"};
+ if (!$testfontPath || !-d "$testfontPath") {
+ print "The WEBKIT_TESTFONTS environment variable is not defined or not set properly\n";
+ print "You must set it before running the tests.\n";
+ print "Use git to grab the actual fonts from http://gitorious.org/qtwebkit/testfonts\n";
+ exit 1;
+ }
+}
+
if (!defined($platform)) {
print "WARNING: Your platform is not recognized. Any platform-specific results will be generated in platform/undefined.\n";
$platform = "undefined";
diff --git a/WebKitTools/Scripts/svn-unapply b/WebKitTools/Scripts/svn-unapply
index e502560..53ab1b5 100755
--- a/WebKitTools/Scripts/svn-unapply
+++ b/WebKitTools/Scripts/svn-unapply
@@ -139,7 +139,9 @@ sub patch($)
{
my ($diffHashRef) = @_;
- my $patch = $diffHashRef->{svnConvertedText};
+ # Make sure $patch is initialized to some value. There is no
+ # svnConvertedText when reversing an svn copy/move.
+ my $patch = $diffHashRef->{svnConvertedText} || "";
my $fullPath = $diffHashRef->{indexPath};
my $isSvnBinary = $diffHashRef->{isBinary} && $diffHashRef->{isSvn};
@@ -201,7 +203,7 @@ sub patch($)
# FIXME: This should use the same logic as svn-apply's deletion
# code. In particular, svn-apply's scmRemove() subroutine
# should be used here.
- unapplyPatch($patch, $fullPath, ["--force"]);
+ unapplyPatch($patch, $fullPath, ["--force"]) if $patch;
unlink($fullPath) if -z $fullPath;
system "svn", "revert", $fullPath;
}
diff --git a/WebKitTools/Scripts/webkitdirs.pm b/WebKitTools/Scripts/webkitdirs.pm
index d95f2a1..745e808 100644
--- a/WebKitTools/Scripts/webkitdirs.pm
+++ b/WebKitTools/Scripts/webkitdirs.pm
@@ -674,7 +674,7 @@ sub determineQtFeatureDefaults()
my $defaults = `qmake CONFIG+=compute_defaults 2>&1`;
chdir $originalCwd;
- while ($defaults =~ m/(\S*?)=(.*?)( |$)/gi) {
+ while ($defaults =~ m/(\S+?)=(\S+?)/gi) {
$qtFeatureDefaults{$1}=$2;
}
}
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
index e7f9ac8..f8b181c 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
@@ -34,6 +34,7 @@ from __future__ import with_statement
import codecs
import logging
import os
+import re
import shutil
import signal
import subprocess
@@ -212,6 +213,16 @@ class ChromiumPort(base.Port):
return file.read()
def test_expectations_overrides(self):
+ # FIXME: This drt_overrides handling should be removed when we switch
+ # from tes_shell to DRT.
+ drt_overrides = ''
+ if self._options.use_drt:
+ drt_overrides_path = self.path_from_webkit_base('LayoutTests',
+ 'platform', 'chromium', 'drt_expectations.txt')
+ if os.path.exists(drt_overrides_path):
+ with codecs.open(drt_overrides_path, "r", "utf-8") as file:
+ drt_overrides = file.read()
+
try:
overrides_path = self.path_from_chromium_base('webkit', 'tools',
'layout_tests', 'test_expectations.txt')
@@ -220,7 +231,7 @@ class ChromiumPort(base.Port):
if not os.path.exists(overrides_path):
return None
with codecs.open(overrides_path, "r", "utf-8") as file:
- return file.read()
+ return file.read() + drt_overrides
def test_platform_names(self):
return self.test_base_platform_names() + ('win-xp',
@@ -382,9 +393,12 @@ class ChromiumDriver(base.Driver):
if line.startswith("#URL:"):
actual_uri = line.rstrip()[5:]
if uri != actual_uri:
- _log.fatal("Test got out of sync:\n|%s|\n|%s|" %
- (uri, actual_uri))
- raise AssertionError("test out of sync")
+ # GURL capitalizes the drive letter of a file URL.
+ if (not re.search("^file:///[a-z]:", uri) or
+ uri.lower() != actual_uri.lower()):
+ _log.fatal("Test got out of sync:\n|%s|\n|%s|" %
+ (uri, actual_uri))
+ raise AssertionError("test out of sync")
elif line.startswith("#MD5:"):
actual_checksum = line.rstrip()[5:]
elif line.startswith("#TEST_TIMED_OUT"):
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
index 611afdc..770ab40 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
@@ -1884,6 +1884,10 @@ def check_for_null(file_extension, clean_lines, line_number, error):
if search(r'\bg_str(join|concat)\b', line):
return
+ # Don't warn about NULL usage in gdk_pixbuf_save_to_*{join,concat}(). See Bug 43090.
+ if search(r'\bgdk_pixbuf_save_to\w+\b', line):
+ return
+
if search(r'\bNULL\b', line):
error(line_number, 'readability/null', 5, 'Use 0 instead of NULL.')
return
@@ -1916,7 +1920,7 @@ def get_line_width(line):
return len(line)
-def check_style(clean_lines, line_number, file_extension, file_state, error):
+def check_style(clean_lines, line_number, file_extension, class_state, file_state, error):
"""Checks rules from the 'C++ style rules' section of cppguide.html.
Most of these rules are hard to test (naming, comment style), but we
@@ -1927,6 +1931,8 @@ def check_style(clean_lines, line_number, file_extension, file_state, error):
clean_lines: A CleansedLines instance containing the file.
line_number: The number of the line to check.
file_extension: The extension (without the dot) of the filename.
+ class_state: A _ClassState instance which maintains information about
+ the current stack of nested class declarations being parsed.
file_state: A _FileState instance which maintains information about
the state of things in the file.
error: The function to call with any errors found.
@@ -1987,6 +1993,10 @@ def check_style(clean_lines, line_number, file_extension, file_state, error):
and not ((cleansed_line.find('case ') != -1
or cleansed_line.find('default:') != -1)
and cleansed_line.find('break;') != -1)
+ # Also it's ok to have many commands in trivial single-line accessors in class definitions.
+ and not (match(r'.*\(.*\).*{.*.}', line)
+ and class_state.classinfo_stack
+ and line.count('{') == line.count('}'))
and not cleansed_line.startswith('#define ')):
error(line_number, 'whitespace/newline', 4,
'More than one command on the same line')
@@ -2841,7 +2851,7 @@ def process_line(filename, file_extension,
if search(r'\bNOLINT\b', raw_lines[line]): # ignore nolint lines
return
check_for_multiline_comments_and_strings(clean_lines, line, error)
- check_style(clean_lines, line, file_extension, file_state, error)
+ check_style(clean_lines, line, file_extension, class_state, file_state, error)
check_language(filename, clean_lines, line, file_extension, include_state,
error)
check_for_non_standard_constructs(clean_lines, line, class_state, error)
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
index 2dde549..ee829aa 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
@@ -164,7 +164,7 @@ class CppStyleTestBase(unittest.TestCase):
class_state = cpp_style._ClassState()
file_state = cpp_style._FileState()
for i in xrange(lines.num_lines()):
- cpp_style.check_style(lines, i, file_extension, file_state, error_collector)
+ cpp_style.check_style(lines, i, file_extension, class_state, file_state, error_collector)
cpp_style.check_for_non_standard_constructs(lines, i, class_state,
error_collector)
class_state.check_finished(error_collector)
@@ -2594,6 +2594,19 @@ class NoNonVirtualDestructorsTest(CppStyleTestBase):
self.assert_multi_line_lint(
'class Foo { void foo(); };',
'More than one command on the same line [whitespace/newline] [4]')
+ self.assert_multi_line_lint(
+ 'class MyClass {\n'
+ ' int getIntValue() { ASSERT(m_ptr); return *m_ptr; }\n'
+ '};\n',
+ '')
+ self.assert_multi_line_lint(
+ 'class MyClass {\n'
+ ' int getIntValue()\n'
+ ' {\n'
+ ' ASSERT(m_ptr); return *m_ptr;\n'
+ ' }\n'
+ '};\n',
+ 'More than one command on the same line [whitespace/newline] [4]')
self.assert_multi_line_lint(
'''class Qualified::Goo : public Foo {
@@ -3472,6 +3485,15 @@ class WebKitStyleTest(CppStyleTestBase):
self.assert_lint(
'gchar* result = g_strjoin(",", "part1", NULL);',
'')
+ self.assert_lint(
+ 'gchar* result = gdk_pixbuf_save_to_callback(pixbuf, function, data, type, error, NULL);',
+ '')
+ self.assert_lint(
+ 'gchar* result = gdk_pixbuf_save_to_buffer(pixbuf, function, data, type, error, NULL);',
+ '')
+ self.assert_lint(
+ 'gchar* result = gdk_pixbuf_save_to_stream(pixbuf, function, data, type, error, NULL);',
+ '')
# 2. C++ and C bool values should be written as true and
# false. Objective-C BOOL values should be written as YES and NO.
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/abstractstep.py b/WebKitTools/Scripts/webkitpy/tool/steps/abstractstep.py
index 8f0d153..9ceb2cb 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/abstractstep.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/abstractstep.py
@@ -35,10 +35,6 @@ from webkitpy.tool.steps.options import Options
class AbstractStep(object):
def __init__(self, tool, options):
self._tool = tool
- if options.no_squash:
- raise ScriptError('--no-squash has been removed. Use "--git-commit=HEAD.." or "-g HEAD.." to operate on the working copy.')
- if options.squash:
- raise ScriptError('--squash has been removed. It is now the default behavior if --git-commit is omitted.')
self._options = options
self._port = None
@@ -76,9 +72,6 @@ class AbstractStep(object):
return [
# We need this option here because cached_lookup uses it. :(
Options.git_commit,
- # FIXME: Get rid of these.
- Options.no_squash,
- Options.squash,
]
def run(self, state):
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/options.py b/WebKitTools/Scripts/webkitpy/tool/steps/options.py
index 9c73f5a..e7e3855 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/options.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/options.py
@@ -46,8 +46,6 @@ class Options(object):
git_commit = make_option("-g", "--git-commit", action="store", dest="git_commit", help="Operate on a local commit. If a range, the commits are squashed into one. HEAD.. operates on working copy changes only.")
local_commit = make_option("--local-commit", action="store_true", dest="local_commit", default=False, help="Make a local commit for each applied patch")
non_interactive = make_option("--non-interactive", action="store_true", dest="non_interactive", default=False, help="Never prompt the user, fail as fast as possible.")
- # FIXME: Remove --no-squash, once people have adjusted to using --git-commit.
- no_squash = make_option("--no-squash", action="store_true", dest="no_squash", default=False, help="Obsolete. Use --git-commit=HEAD.. instead.")
obsolete_patches = make_option("--no-obsolete", action="store_false", dest="obsolete_patches", default=True, help="Do not obsolete old patches before posting this one.")
open_bug = make_option("--open-bug", action="store_true", dest="open_bug", default=False, help="Opens the associated bug in a browser.")
parent_command = make_option("--parent-command", action="store", dest="parent_command", default=None, help="(Internal) The command that spawned this instance.")
@@ -56,7 +54,5 @@ class Options(object):
request_commit = make_option("--request-commit", action="store_true", dest="request_commit", default=False, help="Mark the patch as needing auto-commit after review.")
review = make_option("--no-review", action="store_false", dest="review", default=True, help="Do not mark the patch for review.")
reviewer = make_option("-r", "--reviewer", action="store", type="string", dest="reviewer", help="Update ChangeLogs to say Reviewed by REVIEWER.")
- # FIXME: Remove --squash, once people have adjusted to using --git-commit.
- squash = make_option("-s", "--squash", action="store_true", dest="squash", default=False, help="Obsolete. This is now the default behavior.")
test = make_option("--test", action="store_true", dest="test", default=False, help="Run run-webkit-tests before committing.")
update = make_option("--no-update", action="store_false", dest="update", default=True, help="Don't update the working directory.")
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm
index d72d4fc..fa47143 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm
@@ -260,7 +260,7 @@ EOF
push(@contents, " " . $self->_platformTypeVariableDeclaration($parameter, $parameter->name, "arguments[$i]", "argumentCount > $i") . "\n");
- push(@parameters, $self->_paramterExpression($parameter));
+ push(@parameters, $self->_parameterExpression($parameter));
}
my $isVoidReturn = $function->signature->type eq "void";
@@ -343,7 +343,10 @@ sub _includeHeaders
my ($self, $headers, $idlType, $signature) = @_;
return unless defined $idlType;
- return if $idlType eq "boolean" or $$self{codeGenerator}->IsNonPointerType($idlType);
+ return if $idlType eq "boolean";
+ return if $idlType eq "object";
+ return if $$self{codeGenerator}->IsNonPointerType($idlType);
+ return if $$self{codeGenerator}->IsStringType($idlType);
$$headers{_className($idlType) . ".h"} = 1;
$$headers{_implementationClassName($idlType) . ".h"} = 1;
@@ -385,6 +388,7 @@ sub _platformType
return undef unless defined $idlType;
return "bool" if $idlType eq "boolean";
+ return "JSValueRef" if $idlType eq "object";
return "JSRetainPtr<JSStringRef>" if $$self{codeGenerator}->IsStringType($idlType);
return "double" if $$self{codeGenerator}->IsNonPointerType($idlType);
return _implementationClassName($idlType);
@@ -396,8 +400,9 @@ sub _platformTypeConstructor
my $idlType = $signature->type;
- return "JSRetainPtr<JSStringRef>(Adopt, JSValueToStringCopy(context, $argumentName, 0))" if $$self{codeGenerator}->IsStringType($idlType);
return "JSValueToBoolean(context, $argumentName)" if $idlType eq "boolean";
+ return "$argumentName" if $idlType eq "object";
+ return "JSRetainPtr<JSStringRef>(Adopt, JSValueToStringCopy(context, $argumentName, 0))" if $$self{codeGenerator}->IsStringType($idlType);
return "JSValueToNumber(context, $argumentName, 0)" if $$self{codeGenerator}->IsNonPointerType($idlType);
return "to" . _implementationClassName($idlType) . "(context, $argumentName)";
}
@@ -413,6 +418,7 @@ sub _platformTypeVariableDeclaration
"bool" => 1,
"double" => 1,
"JSRetainPtr<JSStringRef>" => 1,
+ "JSValueRef" => 1,
);
my $nullValue = "0";
@@ -429,19 +435,17 @@ sub _returnExpression
{
my ($self, $signature, $expression) = @_;
- my $convertNullStringAttribute = $signature->extendedAttributes->{"ConvertNullStringTo"};
- my $nullOrEmptyString = "NullStringAsEmptyString";
- $nullOrEmptyString = "NullStringAsNull" if defined $convertNullStringAttribute && $convertNullStringAttribute eq "Null";
-
my $returnIDLType = $signature->type;
return "JSValueMakeUndefined(context)" if $returnIDLType eq "void";
return "JSValueMakeBoolean(context, ${expression})" if $returnIDLType eq "boolean";
+ return "${expression}" if $returnIDLType eq "object";
return "JSValueMakeNumber(context, ${expression})" if $$self{codeGenerator}->IsNonPointerType($returnIDLType);
+ return "JSValueMakeStringOrNull(context, ${expression}.get())" if $$self{codeGenerator}->IsStringType($returnIDLType);
return "toJS(context, WTF::getPtr(${expression}))";
}
-sub _paramterExpression
+sub _parameterExpression
{
my ($self, $parameter) = @_;
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h
index cf56c5d..9cb97af 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h
@@ -37,6 +37,11 @@ public:
virtual JSClassRef wrapperClass() = 0;
};
+inline JSValueRef JSValueMakeStringOrNull(JSContextRef context, JSStringRef stringOrNull)
+{
+ return stringOrNull ? JSValueMakeString(context, stringOrNull) : JSValueMakeNull(context);
+}
+
} // namespace WTR
#endif // JSWrappable_h
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
index 7da2e81..a0fbb85 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
@@ -26,18 +26,35 @@
module WTR {
interface LayoutTestController {
+ // The basics.
void dumpAsText();
- void dumpStatusCallbacks();
-
+ void dumpChildFramesAsText();
void waitUntilDone();
void notifyDone();
- // Repaint testing
+ // Other dumping.
+ void dumpChildFrameScrollPositions();
+ void dumpEditingCallbacks();
+ void dumpSelectionRect();
+ void dumpStatusCallbacks();
+
+ // Special options.
+ void keepWebHistory();
+ void setAcceptsEditing(in boolean value);
+
+ // Special DOM functions.
+ object computedStyleIncludingVisitedInfo(in object element);
+ DOMString counterValueForElementById(in DOMString elementId);
+ DOMString markerTextForListItem(in object element);
+ void execCommand(in DOMString name, in DOMString argument);
+ boolean isCommandEnabled(in DOMString name);
+
+ // Repaint testing.
void testRepaint();
void repaintSweepHorizontally();
void display();
- // Animation testing
+ // Animation testing.
int numberOfActiveAnimations();
boolean pauseAnimationAtTimeOnElementWithId(in DOMString animationName, in double time, in DOMString elementId);
};
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
index d3c66fd..0e99dde 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
@@ -27,11 +27,12 @@
#include "ActivateFonts.h"
#include "InjectedBundlePage.h"
+#include <WebKit2/WebKit2.h>
#include <WebKit2/WKBundle.h>
#include <WebKit2/WKBundlePage.h>
+#include <WebKit2/WKBundlePrivate.h>
#include <WebKit2/WKRetainPtr.h>
#include <WebKit2/WKStringCF.h>
-#include <WebKit2/WebKit2.h>
#include <wtf/RetainPtr.h>
namespace WTR {
@@ -57,9 +58,9 @@ void InjectedBundle::_willDestroyPage(WKBundleRef bundle, WKBundlePageRef page,
static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->willDestroyPage(page);
}
-void InjectedBundle::_didRecieveMessage(WKBundleRef bundle, WKStringRef message, const void *clientInfo)
+void InjectedBundle::_didReceiveMessage(WKBundleRef bundle, WKStringRef message, const void *clientInfo)
{
- static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->didRecieveMessage(message);
+ static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->didReceiveMessage(message);
}
void InjectedBundle::initialize(WKBundleRef bundle)
@@ -71,7 +72,7 @@ void InjectedBundle::initialize(WKBundleRef bundle)
this,
_didCreatePage,
_willDestroyPage,
- _didRecieveMessage
+ _didReceiveMessage
};
WKBundleSetClient(m_bundle, &client);
@@ -98,7 +99,7 @@ void InjectedBundle::willDestroyPage(WKBundlePageRef page)
delete m_pages.take(page);
}
-void InjectedBundle::didRecieveMessage(WKStringRef message)
+void InjectedBundle::didReceiveMessage(WKStringRef message)
{
CFStringRef cfMessage = WKStringCopyCFString(0, message);
if (CFEqual(cfMessage, CFSTR("BeginTest"))) {
@@ -116,7 +117,14 @@ void InjectedBundle::didRecieveMessage(WKStringRef message)
void InjectedBundle::reset()
{
m_outputStream.str("");
- m_layoutTestController = LayoutTestController::create(std::string(""));
+ m_layoutTestController = LayoutTestController::create();
+ WKBundleSetShouldTrackVisitedLinks(m_bundle, false);
+ WKBundleRemoveAllVisitedLinks(m_bundle);
+}
+
+void InjectedBundle::setShouldTrackVisitedLinks()
+{
+ WKBundleSetShouldTrackVisitedLinks(m_bundle, true);
}
} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
index 1581ebc..9bda922 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
@@ -52,17 +52,19 @@ public:
std::ostringstream& os() { return m_outputStream; }
+ void setShouldTrackVisitedLinks();
+
private:
InjectedBundle();
~InjectedBundle();
static void _didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo);
static void _willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo);
- static void _didRecieveMessage(WKBundleRef bundle, WKStringRef message, const void *clientInfo);
+ static void _didReceiveMessage(WKBundleRef bundle, WKStringRef message, const void *clientInfo);
void didCreatePage(WKBundlePageRef page);
void willDestroyPage(WKBundlePageRef page);
- void didRecieveMessage(WKStringRef message);
+ void didReceiveMessage(WKStringRef message);
void reset();
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index cbba470..3632fb9 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -26,28 +26,96 @@
#include "InjectedBundlePage.h"
#include "InjectedBundle.h"
+#include <JavaScriptCore/JSRetainPtr.h>
+#include <WebKit2/WKArray.h>
#include <WebKit2/WKBundleFrame.h>
+#include <WebKit2/WKBundleNode.h>
#include <WebKit2/WKBundlePagePrivate.h>
#include <WebKit2/WKRetainPtr.h>
+#include <WebKit2/WKBundleRange.h>
#include <WebKit2/WKString.h>
#include <WebKit2/WKStringCF.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/RetainPtr.h>
#include <wtf/Vector.h>
+using namespace std;
+
namespace WTR {
-static PassOwnPtr<Vector<char> > WKStringToUTF8(WKStringRef wkStringRef)
+static ostream& operator<<(ostream& out, CFStringRef stringRef)
+{
+ if (!stringRef)
+ return out;
+ CFIndex bufferLength = CFStringGetMaximumSizeForEncoding(CFStringGetLength(stringRef), kCFStringEncodingUTF8) + 1;
+ Vector<char> buffer(bufferLength);
+ if (!CFStringGetCString(stringRef, buffer.data(), bufferLength, kCFStringEncodingUTF8))
+ return out;
+ return out << buffer.data();
+}
+
+static ostream& operator<<(ostream& out, const RetainPtr<CFStringRef>& stringRef)
+{
+ return out << stringRef.get();
+}
+
+static ostream& operator<<(ostream& out, WKStringRef stringRef)
+{
+ if (!stringRef)
+ return out;
+ RetainPtr<CFStringRef> cfString(AdoptCF, WKStringCopyCFString(0, stringRef));
+ return out << cfString;
+}
+
+static ostream& operator<<(ostream& out, const WKRetainPtr<WKStringRef>& stringRef)
+{
+ return out << stringRef.get();
+}
+
+static ostream& operator<<(ostream& out, JSStringRef stringRef)
+{
+ if (!stringRef)
+ return out;
+ CFIndex bufferLength = JSStringGetMaximumUTF8CStringSize(stringRef) + 1;
+ Vector<char> buffer(bufferLength);
+ JSStringGetUTF8CString(stringRef, buffer.data(), bufferLength);
+ return out << buffer.data();
+}
+
+static ostream& operator<<(ostream& out, const JSRetainPtr<JSStringRef>& stringRef)
+{
+ return out << stringRef.get();
+}
+
+static string dumpPath(WKBundleNodeRef node)
{
- RetainPtr<CFStringRef> cfString(AdoptCF, WKStringCopyCFString(0, wkStringRef));
- CFIndex bufferLength = CFStringGetMaximumSizeForEncoding(CFStringGetLength(cfString.get()), kCFStringEncodingUTF8) + 1;
- OwnPtr<Vector<char> > buffer(new Vector<char>(bufferLength));
- if (!CFStringGetCString(cfString.get(), buffer->data(), bufferLength, kCFStringEncodingUTF8)) {
- buffer->shrink(1);
- (*buffer)[0] = 0;
- } else
- buffer->shrink(strlen(buffer->data()) + 1);
- return buffer.release();
+ if (!node)
+ return "(null)";
+ WKRetainPtr<WKStringRef> nodeName(AdoptWK, WKBundleNodeCopyNodeName(node));
+ ostringstream out;
+ out << nodeName;
+ if (WKBundleNodeRef parent = WKBundleNodeGetParent(node))
+ out << " > " << dumpPath(parent);
+ return out.str();
+}
+
+static ostream& operator<<(ostream& out, WKBundleRangeRef rangeRef)
+{
+ if (rangeRef)
+ out << "range from " << WKBundleRangeGetStartOffset(rangeRef) << " of " << dumpPath(WKBundleRangeGetStartContainer(rangeRef)) << " to " << WKBundleRangeGetEndOffset(rangeRef) << " of " << dumpPath(WKBundleRangeGetEndContainer(rangeRef));
+ else
+ out << "(null)";
+
+ return out;
+}
+
+static ostream& operator<<(ostream& out, WKBundleCSSStyleDeclarationRef style)
+{
+ // DumpRenderTree calls -[DOMCSSStyleDeclaration description], which just dumps class name and object address.
+ // No existing tests actually hit this code path at the time of this writing, because WebCore doesn't call
+ // the editing client if the styling operation source is CommandFromDOM or CommandFromDOMWithUserInterface.
+ out << "<DOMCSSStyleDeclaration ADDRESS>";
+ return out;
}
InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
@@ -78,6 +146,23 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
_willRunJavaScriptPrompt
};
WKBundlePageSetUIClient(m_page, &uiClient);
+
+ WKBundlePageEditorClient editorClient = {
+ 0,
+ this,
+ _shouldBeginEditing,
+ _shouldEndEditing,
+ _shouldInsertNode,
+ _shouldInsertText,
+ _shouldDeleteRange,
+ _shouldChangeSelectedRange,
+ _shouldApplyStyle,
+ _didBeginEditing,
+ _didEndEditing,
+ _didChange,
+ _didChangeSelection
+ };
+ WKBundlePageSetEditorClient(m_page, &editorClient);
}
InjectedBundlePage::~InjectedBundlePage()
@@ -121,9 +206,9 @@ void InjectedBundlePage::_didReceiveTitleForFrame(WKBundlePageRef page, WKString
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didReceiveTitleForFrame(title, frame);
}
-void InjectedBundlePage::_didClearWindowForFrame(WKBundlePageRef page, WKBundleFrameRef frame, JSContextRef ctx, JSObjectRef window, const void *clientInfo)
+void InjectedBundlePage::_didClearWindowForFrame(WKBundlePageRef page, WKBundleFrameRef frame, JSGlobalContextRef context, JSObjectRef window, const void *clientInfo)
{
- static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didClearWindowForFrame(frame, ctx, window);
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didClearWindowForFrame(frame, context, window);
}
void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundleFrameRef frame)
@@ -144,20 +229,128 @@ void InjectedBundlePage::didCommitLoadForFrame(WKBundleFrameRef frame)
{
}
+static JSValueRef propertyValue(JSContextRef context, JSObjectRef object, const char* propertyName)
+{
+ if (!object)
+ return 0;
+ JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSStringCreateWithUTF8CString(propertyName));
+ JSValueRef exception;
+ return JSObjectGetProperty(context, object, propertyNameString.get(), &exception);
+}
+
+static JSObjectRef propertyObject(JSContextRef context, JSObjectRef object, const char* propertyName)
+{
+ JSValueRef value = propertyValue(context, object, propertyName);
+ if (!value || !JSValueIsObject(context, value))
+ return 0;
+ return const_cast<JSObjectRef>(value);
+}
+
+static JSRetainPtr<JSStringRef> propertyString(JSContextRef context, JSObjectRef object, const char* propertyName)
+{
+ JSValueRef value = propertyValue(context, object, propertyName);
+ if (!value)
+ return 0;
+ JSValueRef exception;
+ return JSRetainPtr<JSStringRef>(Adopt, JSValueToStringCopy(context, value, &exception));
+}
+
+static double numericWindowPropertyValue(WKBundleFrameRef frame, const char* propertyName)
+{
+ JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame);
+ JSValueRef value = propertyValue(context, JSContextGetGlobalObject(context), propertyName);
+ if (!value)
+ return 0;
+ JSValueRef exception;
+ return JSValueToNumber(context, value, &exception);
+}
+
+enum FrameNamePolicy { ShouldNotIncludeFrameName, ShouldIncludeFrameName };
+
+static void dumpFrameScrollPosition(WKBundleFrameRef frame, FrameNamePolicy shouldIncludeFrameName = ShouldNotIncludeFrameName)
+{
+ double x = numericWindowPropertyValue(frame, "pageXOffset");
+ double y = numericWindowPropertyValue(frame, "pageYOffset");
+ if (fabs(x) > 0.00000001 || fabs(y) > 0.00000001) {
+ if (shouldIncludeFrameName) {
+ WKRetainPtr<WKStringRef> name(AdoptWK, WKBundleFrameCopyName(frame));
+ InjectedBundle::shared().os() << "frame '" << name << "' ";
+ }
+ InjectedBundle::shared().os() << "scrolled to " << x << "," << y << "\n";
+ }
+}
+
+static void dumpDescendantFrameScrollPositions(WKBundleFrameRef frame)
+{
+ WKRetainPtr<WKArrayRef> childFrames(AdoptWK, WKBundleFrameCopyChildFrames(frame));
+ size_t size = WKArrayGetSize(childFrames.get());
+ for (size_t i = 0; i < size; ++i) {
+ // FIXME: I don't like that we have to const_cast here. Can we change WKArray?
+ WKBundleFrameRef subframe = static_cast<WKBundleFrameRef>(const_cast<void*>(WKArrayGetItemAtIndex(childFrames.get(), i)));
+ dumpFrameScrollPosition(subframe, ShouldIncludeFrameName);
+ dumpDescendantFrameScrollPositions(subframe);
+ }
+}
+
+void InjectedBundlePage::dumpAllFrameScrollPositions()
+{
+ WKBundleFrameRef frame = WKBundlePageGetMainFrame(m_page);
+ dumpFrameScrollPosition(frame);
+ dumpDescendantFrameScrollPositions(frame);
+}
+
+static void dumpFrameText(WKBundleFrameRef frame)
+{
+ JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame);
+ JSObjectRef document = propertyObject(context, JSContextGetGlobalObject(context), "document");
+ JSObjectRef documentElement = propertyObject(context, document, "documentElement");
+ InjectedBundle::shared().os() << propertyString(context, documentElement, "innerText") << "\n";
+}
+
+static void dumpDescendantFramesText(WKBundleFrameRef frame)
+{
+ WKRetainPtr<WKArrayRef> childFrames(AdoptWK, WKBundleFrameCopyChildFrames(frame));
+ size_t size = WKArrayGetSize(childFrames.get());
+ for (size_t i = 0; i < size; ++i) {
+ // FIXME: I don't like that we have to const_cast here. Can we change WKArray?
+ WKBundleFrameRef subframe = static_cast<WKBundleFrameRef>(const_cast<void*>(WKArrayGetItemAtIndex(childFrames.get(), i)));
+ WKRetainPtr<WKStringRef> subframeName(AdoptWK, WKBundleFrameCopyName(subframe));
+ InjectedBundle::shared().os() << "\n--------\nFrame: '" << subframeName << "'\n--------\n";
+ dumpFrameText(subframe);
+ dumpDescendantFramesText(subframe);
+ }
+}
+
+void InjectedBundlePage::dumpAllFramesText()
+{
+ WKBundleFrameRef frame = WKBundlePageGetMainFrame(m_page);
+ dumpFrameText(frame);
+ dumpDescendantFramesText(frame);
+}
+
void InjectedBundlePage::dump()
{
InjectedBundle::shared().layoutTestController()->invalidateWaitToDumpWatchdog();
- if (InjectedBundle::shared().layoutTestController()->shouldDumpAsText()) {
- // FIXME: Support dumping subframes when layoutTestController()->dumpChildFramesAsText() is true.
- WKRetainPtr<WKStringRef> innerText(AdoptWK, WKBundleFrameCopyInnerText(WKBundlePageGetMainFrame(m_page)));
- OwnPtr<Vector<char> > utf8InnerText = WKStringToUTF8(innerText.get());
- InjectedBundle::shared().os() << utf8InnerText->data() << "\n";
- } else {
- WKRetainPtr<WKStringRef> externalRepresentation(AdoptWK, WKBundlePageCopyRenderTreeExternalRepresentation(m_page));
- OwnPtr<Vector<char> > utf8externalRepresentation = WKStringToUTF8(externalRepresentation.get());
- InjectedBundle::shared().os() << utf8externalRepresentation->data();
+ switch (InjectedBundle::shared().layoutTestController()->whatToDump()) {
+ case LayoutTestController::RenderTree: {
+ WKRetainPtr<WKStringRef> text(AdoptWK, WKBundlePageCopyRenderTreeExternalRepresentation(m_page));
+ InjectedBundle::shared().os() << text;
+ break;
+ }
+ case LayoutTestController::MainFrameText:
+ dumpFrameText(WKBundlePageGetMainFrame(m_page));
+ break;
+ case LayoutTestController::AllFramesText:
+ dumpAllFramesText();
+ break;
}
+
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpAllFrameScrollPositions())
+ dumpAllFrameScrollPositions();
+ else if (InjectedBundle::shared().layoutTestController()->shouldDumpMainFrameScrollPosition())
+ dumpFrameScrollPosition(WKBundlePageGetMainFrame(m_page));
+
InjectedBundle::shared().done();
}
@@ -188,10 +381,10 @@ void InjectedBundlePage::didReceiveTitleForFrame(WKStringRef title, WKBundleFram
{
}
-void InjectedBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, JSContextRef ctx, JSObjectRef window)
+void InjectedBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, JSGlobalContextRef context, JSObjectRef window)
{
JSValueRef exception = 0;
- InjectedBundle::shared().layoutTestController()->makeWindowObject(ctx, window, &exception);
+ InjectedBundle::shared().layoutTestController()->makeWindowObject(context, window, &exception);
}
// UI Client Callbacks
@@ -224,8 +417,7 @@ void InjectedBundlePage::_willRunJavaScriptPrompt(WKBundlePageRef page, WKString
void InjectedBundlePage::willAddMessageToConsole(WKStringRef message, uint32_t lineNumber)
{
// FIXME: Strip file: urls.
- OwnPtr<Vector<char> > utf8Message = WKStringToUTF8(message);
- InjectedBundle::shared().os() << "CONSOLE MESSAGE: line " << lineNumber << ": " << utf8Message->data() << "\n";
+ InjectedBundle::shared().os() << "CONSOLE MESSAGE: line " << lineNumber << ": " << message << "\n";
}
void InjectedBundlePage::willSetStatusbarText(WKStringRef statusbarText)
@@ -233,27 +425,174 @@ void InjectedBundlePage::willSetStatusbarText(WKStringRef statusbarText)
if (!InjectedBundle::shared().layoutTestController()->shouldDumpStatusCallbacks())
return;
- OwnPtr<Vector<char> > utf8StatusbarText = WKStringToUTF8(statusbarText);
- InjectedBundle::shared().os() << "UI DELEGATE STATUS CALLBACK: setStatusText:" << utf8StatusbarText->data() << "\n";
+ InjectedBundle::shared().os() << "UI DELEGATE STATUS CALLBACK: setStatusText:" << statusbarText << "\n";
}
void InjectedBundlePage::willRunJavaScriptAlert(WKStringRef message, WKBundleFrameRef)
{
- OwnPtr<Vector<char> > utf8Message = WKStringToUTF8(message);
- InjectedBundle::shared().os() << "ALERT: " << utf8Message->data() << "\n";
+ InjectedBundle::shared().os() << "ALERT: " << message << "\n";
}
void InjectedBundlePage::willRunJavaScriptConfirm(WKStringRef message, WKBundleFrameRef)
{
- OwnPtr<Vector<char> > utf8Message = WKStringToUTF8(message);
- InjectedBundle::shared().os() << "CONFIRM: " << utf8Message->data() << "\n";
+ InjectedBundle::shared().os() << "CONFIRM: " << message << "\n";
}
void InjectedBundlePage::willRunJavaScriptPrompt(WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef)
{
- OwnPtr<Vector<char> > utf8Message = WKStringToUTF8(message);
- OwnPtr<Vector<char> > utf8DefaultValue = WKStringToUTF8(defaultValue);
- InjectedBundle::shared().os() << "PROMPT: " << utf8Message->data() << ", default text: " << utf8DefaultValue->data() << "\n";
+ InjectedBundle::shared().os() << "PROMPT: " << message << ", default text: " << defaultValue << "\n";
+}
+
+// Editor Client Callbacks
+
+bool InjectedBundlePage::_shouldBeginEditing(WKBundlePageRef page, WKBundleRangeRef range, const void* clientInfo)
+{
+ return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldBeginEditing(range);
}
+bool InjectedBundlePage::_shouldEndEditing(WKBundlePageRef page, WKBundleRangeRef range, const void* clientInfo)
+{
+ return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldEndEditing(range);
+}
+
+bool InjectedBundlePage::_shouldInsertNode(WKBundlePageRef page, WKBundleNodeRef node, WKBundleRangeRef rangeToReplace, WKInsertActionType action, const void* clientInfo)
+{
+ return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldInsertNode(node, rangeToReplace, action);
+}
+
+bool InjectedBundlePage::_shouldInsertText(WKBundlePageRef page, WKStringRef text, WKBundleRangeRef rangeToReplace, WKInsertActionType action, const void* clientInfo)
+{
+ return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldInsertText(text, rangeToReplace, action);
+}
+
+bool InjectedBundlePage::_shouldDeleteRange(WKBundlePageRef page, WKBundleRangeRef range, const void* clientInfo)
+{
+ return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldDeleteRange(range);
+}
+
+bool InjectedBundlePage::_shouldChangeSelectedRange(WKBundlePageRef page, WKBundleRangeRef fromRange, WKBundleRangeRef toRange, WKAffinityType affinity, bool stillSelecting, const void* clientInfo)
+{
+ return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldChangeSelectedRange(fromRange, toRange, affinity, stillSelecting);
+}
+
+bool InjectedBundlePage::_shouldApplyStyle(WKBundlePageRef page, WKBundleCSSStyleDeclarationRef style, WKBundleRangeRef range, const void* clientInfo)
+{
+ return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldApplyStyle(style, range);
+}
+
+void InjectedBundlePage::_didBeginEditing(WKBundlePageRef page, WKStringRef notificationName, const void* clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didBeginEditing(notificationName);
+}
+
+void InjectedBundlePage::_didEndEditing(WKBundlePageRef page, WKStringRef notificationName, const void* clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didEndEditing(notificationName);
+}
+
+void InjectedBundlePage::_didChange(WKBundlePageRef page, WKStringRef notificationName, const void* clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didChange(notificationName);
+}
+
+void InjectedBundlePage::_didChangeSelection(WKBundlePageRef page, WKStringRef notificationName, const void* clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didChangeSelection(notificationName);
+}
+
+bool InjectedBundlePage::shouldBeginEditing(WKBundleRangeRef range)
+{
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldBeginEditingInDOMRange:" << range << "\n";
+ return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+}
+
+bool InjectedBundlePage::shouldEndEditing(WKBundleRangeRef range)
+{
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldEndEditingInDOMRange:" << range << "\n";
+ return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+}
+
+bool InjectedBundlePage::shouldInsertNode(WKBundleNodeRef node, WKBundleRangeRef rangeToReplace, WKInsertActionType action)
+{
+ static const char *insertactionstring[] = {
+ "WebViewInsertActionTyped",
+ "WebViewInsertActionPasted",
+ "WebViewInsertActionDropped",
+ };
+
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldInsertNode:" << dumpPath(node) << " replacingDOMRange:" << rangeToReplace << " givenAction:" << insertactionstring[action] << "\n";
+ return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+}
+
+bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeRef rangeToReplace, WKInsertActionType action)
+{
+ static const char *insertactionstring[] = {
+ "WebViewInsertActionTyped",
+ "WebViewInsertActionPasted",
+ "WebViewInsertActionDropped",
+ };
+
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldInsertText:" << text << " replacingDOMRange:" << rangeToReplace << " givenAction:" << insertactionstring[action] << "\n";
+ return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+}
+
+bool InjectedBundlePage::shouldDeleteRange(WKBundleRangeRef range)
+{
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldDeleteDOMRange:" << range << "\n";
+ return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+}
+
+bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeRef fromRange, WKBundleRangeRef toRange, WKAffinityType affinity, bool stillSelecting)
+{
+ static const char *affinitystring[] = {
+ "NSSelectionAffinityUpstream",
+ "NSSelectionAffinityDownstream"
+ };
+ static const char *boolstring[] = {
+ "FALSE",
+ "TRUE"
+ };
+
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldChangeSelectedDOMRange:" << fromRange << " toDOMRange:" << toRange << " affinity:" << affinitystring[affinity] << " stillSelecting:" << boolstring[stillSelecting] << "\n";
+ return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+}
+
+bool InjectedBundlePage::shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, WKBundleRangeRef range)
+{
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldApplyStyle:" << style << " toElementsInDOMRange:" << range << "\n";
+ return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+}
+
+void InjectedBundlePage::didBeginEditing(WKStringRef notificationName)
+{
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: webViewDidBeginEditing:" << notificationName << "\n";
+}
+
+void InjectedBundlePage::didEndEditing(WKStringRef notificationName)
+{
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: webViewDidEndEditing:" << notificationName << "\n";
+}
+
+void InjectedBundlePage::didChange(WKStringRef notificationName)
+{
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: webViewDidChange:" << notificationName << "\n";
+}
+
+void InjectedBundlePage::didChangeSelection(WKStringRef notificationName)
+{
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: webViewDidChangeSelection:" << notificationName << "\n";
+}
+
+
} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
index bce9d2c..1b67af0 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
@@ -42,35 +42,62 @@ public:
private:
// Loader Client
- static void _didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo);
- static void _didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo);
- static void _didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo);
- static void _didCommitLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo);
- static void _didFinishLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo);
- static void _didFailLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo);
- static void _didReceiveTitleForFrame(WKBundlePageRef page, WKStringRef title, WKBundleFrameRef frame, const void *clientInfo);
- static void _didClearWindowForFrame(WKBundlePageRef page, WKBundleFrameRef frame, JSContextRef ctx, JSObjectRef window, const void *clientInfo);
- void didStartProvisionalLoadForFrame(WKBundleFrameRef frame);
- void didReceiveServerRedirectForProvisionalLoadForFrame(WKBundleFrameRef frame);
- void didFailProvisionalLoadWithErrorForFrame(WKBundleFrameRef frame);
- void didCommitLoadForFrame(WKBundleFrameRef frame);
- void didFinishLoadForFrame(WKBundleFrameRef frame);
- void didFailLoadWithErrorForFrame(WKBundleFrameRef frame);
- void didReceiveTitleForFrame(WKStringRef title, WKBundleFrameRef frame);
- void didClearWindowForFrame(WKBundleFrameRef frame, JSContextRef ctx, JSObjectRef window);
+ static void _didStartProvisionalLoadForFrame(WKBundlePageRef, WKBundleFrameRef, const void* clientInfo);
+ static void _didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef, WKBundleFrameRef, const void* clientInfo);
+ static void _didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef, WKBundleFrameRef, const void* clientInfo);
+ static void _didCommitLoadForFrame(WKBundlePageRef, WKBundleFrameRef, const void* clientInfo);
+ static void _didFinishLoadForFrame(WKBundlePageRef, WKBundleFrameRef, const void* clientInfo);
+ static void _didFailLoadWithErrorForFrame(WKBundlePageRef, WKBundleFrameRef, const void* clientInfo);
+ static void _didReceiveTitleForFrame(WKBundlePageRef, WKStringRef title, WKBundleFrameRef, const void* clientInfo);
+ static void _didClearWindowForFrame(WKBundlePageRef, WKBundleFrameRef, JSGlobalContextRef, JSObjectRef window, const void* clientInfo);
+ void didStartProvisionalLoadForFrame(WKBundleFrameRef);
+ void didReceiveServerRedirectForProvisionalLoadForFrame(WKBundleFrameRef);
+ void didFailProvisionalLoadWithErrorForFrame(WKBundleFrameRef);
+ void didCommitLoadForFrame(WKBundleFrameRef);
+ void didFinishLoadForFrame(WKBundleFrameRef);
+ void didFailLoadWithErrorForFrame(WKBundleFrameRef);
+ void didReceiveTitleForFrame(WKStringRef title, WKBundleFrameRef);
+ void didClearWindowForFrame(WKBundleFrameRef, JSGlobalContextRef, JSObjectRef window);
// UI Client
- static void _willAddMessageToConsole(WKBundlePageRef page, WKStringRef message, uint32_t lineNumber, const void* clientInfo);
- static void _willSetStatusbarText(WKBundlePageRef page, WKStringRef statusbarText, const void* clientInfo);
- static void _willRunJavaScriptAlert(WKBundlePageRef page, WKStringRef message, WKBundleFrameRef frame, const void* clientInfo);
- static void _willRunJavaScriptConfirm(WKBundlePageRef page, WKStringRef message, WKBundleFrameRef frame, const void* clientInfo);
- static void _willRunJavaScriptPrompt(WKBundlePageRef page, WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef frame, const void* clientInfo);
+ static void _willAddMessageToConsole(WKBundlePageRef, WKStringRef message, uint32_t lineNumber, const void* clientInfo);
+ static void _willSetStatusbarText(WKBundlePageRef, WKStringRef statusbarText, const void* clientInfo);
+ static void _willRunJavaScriptAlert(WKBundlePageRef, WKStringRef message, WKBundleFrameRef frame, const void* clientInfo);
+ static void _willRunJavaScriptConfirm(WKBundlePageRef, WKStringRef message, WKBundleFrameRef frame, const void* clientInfo);
+ static void _willRunJavaScriptPrompt(WKBundlePageRef, WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef frame, const void* clientInfo);
void willAddMessageToConsole(WKStringRef message, uint32_t lineNumber);
void willSetStatusbarText(WKStringRef statusbarText);
void willRunJavaScriptAlert(WKStringRef message, WKBundleFrameRef);
void willRunJavaScriptConfirm(WKStringRef message, WKBundleFrameRef);
void willRunJavaScriptPrompt(WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef);
+ // Editor client
+ static bool _shouldBeginEditing(WKBundlePageRef, WKBundleRangeRef, const void* clientInfo);
+ static bool _shouldEndEditing(WKBundlePageRef, WKBundleRangeRef, const void* clientInfo);
+ static bool _shouldInsertNode(WKBundlePageRef, WKBundleNodeRef, WKBundleRangeRef rangeToReplace, WKInsertActionType, const void* clientInfo);
+ static bool _shouldInsertText(WKBundlePageRef, WKStringRef, WKBundleRangeRef rangeToReplace, WKInsertActionType, const void* clientInfo);
+ static bool _shouldDeleteRange(WKBundlePageRef, WKBundleRangeRef, const void* clientInfo);
+ static bool _shouldChangeSelectedRange(WKBundlePageRef, WKBundleRangeRef fromRange, WKBundleRangeRef toRange, WKAffinityType, bool stillSelecting, const void* clientInfo);
+ static bool _shouldApplyStyle(WKBundlePageRef, WKBundleCSSStyleDeclarationRef style, WKBundleRangeRef range, const void* clientInfo);
+ static void _didBeginEditing(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo);
+ static void _didEndEditing(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo);
+ static void _didChange(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo);
+ static void _didChangeSelection(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo);
+ bool shouldBeginEditing(WKBundleRangeRef);
+ bool shouldEndEditing(WKBundleRangeRef);
+ bool shouldInsertNode(WKBundleNodeRef, WKBundleRangeRef rangeToReplace, WKInsertActionType);
+ bool shouldInsertText(WKStringRef, WKBundleRangeRef rangeToReplace, WKInsertActionType);
+ bool shouldDeleteRange(WKBundleRangeRef);
+ bool shouldChangeSelectedRange(WKBundleRangeRef fromRange, WKBundleRangeRef toRange, WKAffinityType, bool stillSelecting);
+ bool shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, WKBundleRangeRef range);
+ void didBeginEditing(WKStringRef notificationName);
+ void didEndEditing(WKStringRef notificationName);
+ void didChange(WKStringRef notificationName);
+ void didChangeSelection(WKStringRef notificationName);
+
+ void dumpAllFramesText();
+ void dumpAllFrameScrollPositions();
+
WKBundlePageRef m_page;
bool m_isLoading;
};
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
index fafa1e3..2f59eb1 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
@@ -30,24 +30,97 @@
#include "JSLayoutTestController.h"
#include <JavaScriptCore/JSRetainPtr.h>
#include <WebKit2/WKBundleFrame.h>
+#include <WebKit2/WKBundleFramePrivate.h>
+#include <WebKit2/WKBundlePagePrivate.h>
#include <WebKit2/WKRetainPtr.h>
#include <WebKit2/WKStringCF.h>
#include <WebKit2/WebKit2.h>
namespace WTR {
-PassRefPtr<LayoutTestController> LayoutTestController::create(const std::string& testPathOrURL)
+// This is lower than DumpRenderTree's timeout, to make it easier to work through the failures
+// Eventually it should be changed to match.
+static const CFTimeInterval waitToDumpWatchdogInterval = 6.0;
+
+static RetainPtr<CFStringRef> toCF(JSStringRef string)
+{
+ return RetainPtr<CFStringRef>(AdoptCF, JSStringCopyCFString(0, string));
+}
+
+static RetainPtr<CFStringRef> toCF(WKStringRef string)
+{
+ return RetainPtr<CFStringRef>(AdoptCF, WKStringCopyCFString(0, string));
+}
+
+static WKRetainPtr<WKStringRef> toWK(JSStringRef string)
+{
+ return WKRetainPtr<WKStringRef>(AdoptWK, WKStringCreateWithCFString(toCF(string).get()));
+}
+
+static JSRetainPtr<JSStringRef> toJS(WKStringRef string)
+{
+ return JSRetainPtr<JSStringRef>(Adopt, JSStringCreateWithCFString(toCF(string).get()));
+}
+
+static JSRetainPtr<JSStringRef> toJS(const WKRetainPtr<WKStringRef>& string)
+{
+ return toJS(string.get());
+}
+
+static void setProperty(JSContextRef context, JSObjectRef object, const char* propertyName, JSWrappable* value, JSPropertyAttributes attributes, JSValueRef* exception)
+{
+ JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSStringCreateWithUTF8CString(propertyName));
+ JSObjectSetProperty(context, object, propertyNameString.get(), JSWrapper::wrap(context, value), attributes, exception);
+}
+
+static JSValueRef propertyValue(JSContextRef context, JSObjectRef object, const char* propertyName)
+{
+ if (!object)
+ return 0;
+ JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSStringCreateWithUTF8CString(propertyName));
+ JSValueRef exception;
+ return JSObjectGetProperty(context, object, propertyNameString.get(), &exception);
+}
+
+static JSObjectRef propertyObject(JSContextRef context, JSObjectRef object, const char* propertyName)
+{
+ JSValueRef value = propertyValue(context, object, propertyName);
+ if (!value || !JSValueIsObject(context, value))
+ return 0;
+ return const_cast<JSObjectRef>(value);
+}
+
+static JSObjectRef getElementById(WKBundleFrameRef frame, JSStringRef elementId)
{
- return adoptRef(new LayoutTestController(testPathOrURL));
+ JSContextRef context = WKBundleFrameGetJavaScriptContext(frame);
+ JSObjectRef document = propertyObject(context, JSContextGetGlobalObject(context), "document");
+ if (!document)
+ return 0;
+ JSValueRef getElementById = propertyObject(context, document, "getElementById");
+ if (!getElementById || !JSValueIsObject(context, getElementById))
+ return 0;
+ JSValueRef elementIdValue = JSValueMakeString(context, elementId);
+ JSValueRef exception;
+ JSValueRef element = JSObjectCallAsFunction(context, const_cast<JSObjectRef>(getElementById), document, 1, &elementIdValue, &exception);
+ if (!element || !JSValueIsObject(context, element))
+ return 0;
+ return const_cast<JSObjectRef>(element);
}
-LayoutTestController::LayoutTestController(const std::string& testPathOrURL)
- : m_dumpAsText(false)
+PassRefPtr<LayoutTestController> LayoutTestController::create()
+{
+ return adoptRef(new LayoutTestController);
+}
+
+LayoutTestController::LayoutTestController()
+ : m_whatToDump(RenderTree)
+ , m_shouldDumpAllFrameScrollPositions(false)
+ , m_shouldAllowEditing(true)
+ , m_dumpEditingCallbacks(false)
, m_dumpStatusCallbacks(false)
, m_waitToDump(false)
, m_testRepaint(false)
, m_testRepaintSweepHorizontally(false)
- , m_testPathOrURL(testPathOrURL)
{
}
@@ -60,10 +133,6 @@ JSClassRef LayoutTestController::wrapperClass()
return JSLayoutTestController::layoutTestControllerClass();
}
-// This is lower than DumpRenderTree's timeout, to make it easier to work through the failures
-// Eventually it should be changed to match.
-static const CFTimeInterval waitToDumpWatchdogInterval = 6.0;
-
void LayoutTestController::display()
{
// FIXME: actually implement, once we want pixel tests
@@ -109,27 +178,75 @@ void LayoutTestController::notifyDone()
unsigned LayoutTestController::numberOfActiveAnimations() const
{
+ // FIXME: Is it OK this works only for the main frame?
+ // FIXME: If this is needed only for the main frame, then why is the function on WKBundleFrame instead of WKBundlePage?
WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
return WKBundleFrameGetNumberOfActiveAnimations(mainFrame);
}
bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
{
- RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, elementId));
- WKRetainPtr<WKStringRef> idWK(AdoptWK, WKStringCreateWithCFString(idCF.get()));
- RetainPtr<CFStringRef> nameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, animationName));
- WKRetainPtr<WKStringRef> nameWK(AdoptWK, WKStringCreateWithCFString(nameCF.get()));
+ // FIXME: Is it OK this works only for the main frame?
+ // FIXME: If this is needed only for the main frame, then why is the function on WKBundleFrame instead of WKBundlePage?
+ WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
+ return WKBundleFramePauseAnimationOnElementWithId(mainFrame, toWK(animationName).get(), toWK(elementId).get(), time);
+}
+void LayoutTestController::keepWebHistory()
+{
+ InjectedBundle::shared().setShouldTrackVisitedLinks();
+}
+
+JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSValueRef element)
+{
+ // FIXME: Is it OK this works only for the main frame?
WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
- return WKBundleFramePauseAnimationOnElementWithId(mainFrame, nameWK.get(), idWK.get(), time);
+ JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);
+ if (!JSValueIsObject(context, element))
+ return JSValueMakeUndefined(context);
+ JSValueRef value = WKBundleFrameGetComputedStyleIncludingVisitedInfo(mainFrame, const_cast<JSObjectRef>(element));
+ if (!value)
+ return JSValueMakeUndefined(context);
+ return value;
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::counterValueForElementById(JSStringRef elementId)
+{
+ WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
+ JSObjectRef element = getElementById(mainFrame, elementId);
+ if (!element)
+ return 0;
+ WKRetainPtr<WKStringRef> value(AdoptWK, WKBundleFrameCopyCounterValue(mainFrame, const_cast<JSObjectRef>(element)));
+ return toJS(value);
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSValueRef element)
+{
+ WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
+ JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);
+ if (!element || !JSValueIsObject(context, element))
+ return 0;
+ WKRetainPtr<WKStringRef> text(AdoptWK, WKBundleFrameCopyMarkerText(mainFrame, const_cast<JSObjectRef>(element)));
+ if (WKStringIsEmpty(text.get()))
+ return 0;
+ return toJS(text);
+}
+
+void LayoutTestController::execCommand(JSStringRef name, JSStringRef argument)
+{
+ WKBundlePageExecuteEditingCommand(InjectedBundle::shared().page()->page(), toWK(name).get(), toWK(argument).get());
+}
+
+bool LayoutTestController::isCommandEnabled(JSStringRef name)
+{
+ return WKBundlePageIsEditingCommandEnabled(InjectedBundle::shared().page()->page(), toWK(name).get());
}
// Object Creation
void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
{
- JSRetainPtr<JSStringRef> layoutTestContollerStr(Adopt, JSStringCreateWithUTF8CString("layoutTestController"));
- JSObjectSetProperty(context, windowObject, layoutTestContollerStr.get(), JSWrapper::wrap(context, this), kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception);
+ setProperty(context, windowObject, "layoutTestController", this, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception);
}
} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
index f9585a3..9f0641b 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
@@ -28,6 +28,7 @@
#include "JSWrappable.h"
#include <JavaScriptCore/JavaScriptCore.h>
+#include <JavaScriptCore/JSRetainPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RetainPtr.h>
#include <string>
@@ -36,44 +37,73 @@ namespace WTR {
class LayoutTestController : public JSWrappable {
public:
- static PassRefPtr<LayoutTestController> create(const std::string& testPathOrURL);
- ~LayoutTestController();
+ static PassRefPtr<LayoutTestController> create();
+ virtual ~LayoutTestController();
// JSWrappable
- JSClassRef wrapperClass();
+ virtual JSClassRef wrapperClass();
- void makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception);
+ void makeWindowObject(JSContextRef, JSObjectRef windowObject, JSValueRef* exception);
- bool shouldDumpAsText() const { return m_dumpAsText; }
- void dumpAsText() { m_dumpAsText = true; }
+ // The basics.
+ void dumpAsText() { m_whatToDump = MainFrameText; }
+ void dumpChildFramesAsText() { m_whatToDump = AllFramesText; }
+ void waitUntilDone();
+ void notifyDone();
- bool shouldDumpStatusCallbacks() const { return m_dumpStatusCallbacks; }
+ // Other dumping.
+ void dumpChildFrameScrollPositions() { m_shouldDumpAllFrameScrollPositions = true; }
+ void dumpEditingCallbacks() { m_dumpEditingCallbacks = true; }
+ void dumpSelectionRect() { } // Will need to do something when we support pixel tests.
void dumpStatusCallbacks() { m_dumpStatusCallbacks = true; }
- bool waitToDump() const { return m_waitToDump; }
- void waitToDumpWatchdogTimerFired();
- void invalidateWaitToDumpWatchdog();
- void waitUntilDone();
- void notifyDone();
+ // Special options.
+ void keepWebHistory();
+ void setAcceptsEditing(bool value) { m_shouldAllowEditing = value; }
+
+ // Special DOM functions.
+ JSValueRef computedStyleIncludingVisitedInfo(JSValueRef element);
+ JSRetainPtr<JSStringRef> counterValueForElementById(JSStringRef elementId);
+ JSRetainPtr<JSStringRef> markerTextForListItem(JSValueRef element);
+ void execCommand(JSStringRef name, JSStringRef argument);
+ bool isCommandEnabled(JSStringRef name);
+ // Repaint testing.
void testRepaint() { m_testRepaint = true; }
void repaintSweepHorizontally() { m_testRepaintSweepHorizontally = true; }
void display();
+ // Animation testing.
unsigned numberOfActiveAnimations() const;
bool pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId);
+ enum WhatToDump { RenderTree, MainFrameText, AllFramesText };
+ WhatToDump whatToDump() const { return m_whatToDump; }
+
+ bool shouldDumpAllFrameScrollPositions() const { return m_shouldDumpAllFrameScrollPositions; }
+ bool shouldDumpEditingCallbacks() const { return m_dumpEditingCallbacks; }
+ bool shouldDumpMainFrameScrollPosition() const { return m_whatToDump == RenderTree; }
+
+ bool shouldDumpStatusCallbacks() const { return m_dumpStatusCallbacks; }
+
+ bool waitToDump() const { return m_waitToDump; }
+ void waitToDumpWatchdogTimerFired();
+ void invalidateWaitToDumpWatchdog();
+
+ bool shouldAllowEditing() const { return m_shouldAllowEditing; }
+
private:
- LayoutTestController(const std::string& testPathOrURL);
+ LayoutTestController();
- bool m_dumpAsText;
+ WhatToDump m_whatToDump;
+ bool m_shouldDumpAllFrameScrollPositions;
+ bool m_shouldAllowEditing;
+ bool m_dumpEditingCallbacks;
bool m_dumpStatusCallbacks;
bool m_waitToDump; // True if waitUntilDone() has been called, but notifyDone() has not yet been called.
bool m_testRepaint;
bool m_testRepaintSweepHorizontally;
- std::string m_testPathOrURL;
-
RetainPtr<CFRunLoopTimerRef> m_waitToDumpWatchdog;
};
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/win/InjectedBundle.vcproj b/WebKitTools/WebKitTestRunner/InjectedBundle/win/InjectedBundle.vcproj
index 601a4ac..be20bab 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/win/InjectedBundle.vcproj
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/win/InjectedBundle.vcproj
@@ -23,7 +23,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
@@ -39,8 +38,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -53,7 +50,6 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=""
/>
<Tool
Name="VCALinkTool"
@@ -78,7 +74,6 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine=""
/>
</Configuration>
<Configuration
@@ -90,7 +85,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
@@ -106,8 +100,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -120,7 +112,6 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=""
/>
<Tool
Name="VCALinkTool"
@@ -145,7 +136,6 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine=""
/>
</Configuration>
<Configuration
@@ -156,7 +146,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
@@ -172,9 +161,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- RuntimeLibrary="3"
- ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -187,7 +173,6 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=""
/>
<Tool
Name="VCALinkTool"
@@ -212,7 +197,6 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine=""
/>
</Configuration>
<Configuration
@@ -223,7 +207,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
@@ -239,8 +222,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -253,7 +234,6 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=""
/>
<Tool
Name="VCALinkTool"
@@ -278,7 +258,6 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine=""
/>
</Configuration>
</Configurations>
diff --git a/WebKitTools/WebKitTestRunner/TestController.cpp b/WebKitTools/WebKitTestRunner/TestController.cpp
index fec6b56..4f8cd6b 100644
--- a/WebKitTools/WebKitTestRunner/TestController.cpp
+++ b/WebKitTools/WebKitTestRunner/TestController.cpp
@@ -82,7 +82,7 @@ void TestController::initialize(int argc, const char* argv[])
WKContextInjectedBundleClient injectedBundlePathClient = {
0,
this,
- _didRecieveMessageFromInjectedBundle
+ _didReceiveMessageFromInjectedBundle
};
WKContextSetInjectedBundleClient(m_context.get(), &injectedBundlePathClient);
@@ -126,14 +126,14 @@ bool TestController::run()
return true;
}
-void TestController::_didRecieveMessageFromInjectedBundle(WKContextRef context, WKStringRef message, const void *clientInfo)
+void TestController::_didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef message, const void *clientInfo)
{
- static_cast<TestController*>(const_cast<void*>(clientInfo))->didRecieveMessageFromInjectedBundle(message);
+ static_cast<TestController*>(const_cast<void*>(clientInfo))->didReceiveMessageFromInjectedBundle(message);
}
-void TestController::didRecieveMessageFromInjectedBundle(WKStringRef message)
+void TestController::didReceiveMessageFromInjectedBundle(WKStringRef message)
{
- m_currentInvocation->didRecieveMessageFromInjectedBundle(message);
+ m_currentInvocation->didReceiveMessageFromInjectedBundle(message);
}
} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/TestController.h b/WebKitTools/WebKitTestRunner/TestController.h
index 7e829b6..bd073bf 100644
--- a/WebKitTools/WebKitTestRunner/TestController.h
+++ b/WebKitTools/WebKitTestRunner/TestController.h
@@ -67,8 +67,8 @@ private:
void initializeTestPluginPath();
// WKContextInjectedBundleClient
- static void _didRecieveMessageFromInjectedBundle(WKContextRef context, WKStringRef message, const void*);
- void didRecieveMessageFromInjectedBundle(WKStringRef message);
+ static void _didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef message, const void*);
+ void didReceiveMessageFromInjectedBundle(WKStringRef message);
OwnPtr<TestInvocation> m_currentInvocation;
diff --git a/WebKitTools/WebKitTestRunner/TestInvocation.cpp b/WebKitTools/WebKitTestRunner/TestInvocation.cpp
index 1434d50..b6e950f 100644
--- a/WebKitTools/WebKitTestRunner/TestInvocation.cpp
+++ b/WebKitTools/WebKitTestRunner/TestInvocation.cpp
@@ -139,7 +139,7 @@ void TestInvocation::dump(const char* stringToDump)
fflush(stderr);
}
-void TestInvocation::didRecieveMessageFromInjectedBundle(WKStringRef message)
+void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef message)
{
RetainPtr<CFStringRef> cfMessage(AdoptCF, WKStringCopyCFString(0, message));
diff --git a/WebKitTools/WebKitTestRunner/TestInvocation.h b/WebKitTools/WebKitTestRunner/TestInvocation.h
index b5fc041..e064a8f 100644
--- a/WebKitTools/WebKitTestRunner/TestInvocation.h
+++ b/WebKitTools/WebKitTestRunner/TestInvocation.h
@@ -37,7 +37,7 @@ public:
~TestInvocation();
void invoke();
- void didRecieveMessageFromInjectedBundle(WKStringRef message);
+ void didReceiveMessageFromInjectedBundle(WKStringRef message);
private:
void dump(const char*);
diff --git a/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp b/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
index 232c396..987481a 100644
--- a/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
+++ b/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
@@ -41,7 +41,7 @@ void TestController::initializeInjectedBundlePath()
{
CFStringRef exeContainerPath = CFURLCopyFileSystemPath(CFURLCreateCopyDeletingLastPathComponent(0, CFBundleCopyExecutableURL(CFBundleGetMainBundle())), kCFURLWindowsPathStyle);
CFMutableStringRef bundlePath = CFStringCreateMutableCopy(0, 0, exeContainerPath);
-#ifndef NDEBUG
+#ifdef DEBUG_ALL
CFStringAppendCString(bundlePath, "\\InjectedBundle_debug.dll", kCFStringEncodingWindowsLatin1);
#else
CFStringAppendCString(bundlePath, "\\InjectedBundle.dll", kCFStringEncodingWindowsLatin1);
diff --git a/WebKitTools/gdb/wtf.py b/WebKitTools/gdb/wtf.py
new file mode 100644
index 0000000..cf4b59b
--- /dev/null
+++ b/WebKitTools/gdb/wtf.py
@@ -0,0 +1,133 @@
+# Copyright (C) 2010, 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.
+
+"""GDB support for WebKit WTF types.
+
+Add this to your gdb by amending your ~/.gdbinit as follows:
+ python
+ import sys
+ sys.path.insert(0, "/path/to/tools/gdb/")
+ import wtf
+
+See http://sourceware.org/gdb/current/onlinedocs/gdb/Python.html for GDB's
+Python API.
+"""
+
+import gdb
+import re
+
+
+class WTFVectorPrinter:
+ """Pretty Printer for a WTF::Vector.
+
+ The output of this pretty printer is similar to the output of std::vector's
+ pretty printer, which is bundled in gcc.
+
+ Example gdb session should look like:
+ (gdb) p v
+ $3 = WTF::Vector of length 7, capacity 16 = {7, 17, 27, 37, 47, 57, 67}
+ (gdb) set print elements 3
+ (gdb) p v
+ $6 = WTF::Vector of length 7, capacity 16 = {7, 17, 27...}
+ (gdb) set print array
+ (gdb) p v
+ $7 = WTF::Vector of length 7, capacity 16 = {
+ 7,
+ 17,
+ 27
+ ...
+ }
+ (gdb) set print elements 200
+ (gdb) p v
+ $8 = WTF::Vector of length 7, capacity 16 = {
+ 7,
+ 17,
+ 27,
+ 37,
+ 47,
+ 57,
+ 67
+ }
+ """
+
+ class Iterator:
+ def __init__(self, start, finish):
+ self.item = start
+ self.finish = finish
+ self.count = 0
+
+ def __iter__(self):
+ return self
+
+ def next(self):
+ if self.item == self.finish:
+ raise StopIteration
+ count = self.count
+ self.count += 1
+ element = self.item.dereference()
+ self.item += 1
+ return ('[%d]' % count, element)
+
+ def __init__(self, val):
+ self.val = val
+
+ def children(self):
+ start = self.val['m_buffer']['m_buffer']
+ return self.Iterator(start, start + self.val['m_size'])
+
+ def to_string(self):
+ return ('%s of length %d, capacity %d'
+ % ('WTF::Vector', self.val['m_size'], self.val['m_buffer']['m_capacity']))
+
+ def display_hint(self):
+ return 'array'
+
+
+def lookup_function(val):
+ type = val.type
+ if type.code == gdb.TYPE_CODE_REF:
+ type = type.target()
+ type = type.unqualified().strip_typedefs()
+ typename = type.tag
+ if not typename:
+ return None
+ for function, pretty_printer in pretty_printers_dict.items():
+ if function.search(typename):
+ return pretty_printer(val)
+ return None
+
+
+def build_pretty_printers_dict():
+ pretty_printers_dict[re.compile('^WTF::Vector<.*>$')] = WTFVectorPrinter
+
+
+pretty_printers_dict = {}
+
+build_pretty_printers_dict()
+
+gdb.pretty_printers.append(lookup_function)
diff --git a/WebKitTools/wx/browser/wscript b/WebKitTools/wx/browser/wscript
index a2a24e0..bd2640c 100644
--- a/WebKitTools/wx/browser/wscript
+++ b/WebKitTools/wx/browser/wscript
@@ -29,7 +29,8 @@ import sys
from settings import *
-include_paths = [os.path.join(wk_root, 'WebKit', 'wx')]
+include_paths = [os.path.join(wk_root, 'WebCore', 'bindings', 'wx'),
+ os.path.join(wk_root, 'WebKit', 'wx')]
def set_options(opt):
common_set_options(opt)
diff --git a/WebKitTools/wx/build/settings.py b/WebKitTools/wx/build/settings.py
index 122f93a..2d144f6 100644
--- a/WebKitTools/wx/build/settings.py
+++ b/WebKitTools/wx/build/settings.py
@@ -99,6 +99,7 @@ jscore_dirs = [
webcore_dirs = [
'accessibility',
'bindings',
+ 'bindings/cpp',
'bindings/generic',
'bindings/js',
'bridge',
@@ -168,7 +169,7 @@ def get_config():
waf_configname = waf_configname + ' CRT_MULTITHREADED_DLL'
else:
waf_configname = waf_configname + ' CRT_MULTITHREADED_DLL_DBG'
-
+
return waf_configname
create_hash_table = wk_root + "/JavaScriptCore/create_hash_table"
@@ -176,7 +177,10 @@ if building_on_win32:
create_hash_table = get_output('cygpath --unix "%s"' % create_hash_table)
os.environ['CREATE_HASH_TABLE'] = create_hash_table
-feature_defines = ['ENABLE_DATABASE', 'ENABLE_XSLT', 'ENABLE_JAVASCRIPT_DEBUGGER', 'ENABLE_SVG', 'ENABLE_SVG_USE', 'ENABLE_FILTERS', 'ENABLE_SVG_FONTS', 'ENABLE_SVG_ANIMATION', 'ENABLE_SVG_AS_IMAGE', 'ENABLE_SVG_FOREIGN_OBJECT']
+feature_defines = ['ENABLE_DATABASE', 'ENABLE_XSLT', 'ENABLE_JAVASCRIPT_DEBUGGER',
+ 'ENABLE_SVG', 'ENABLE_SVG_USE', 'ENABLE_FILTERS', 'ENABLE_SVG_FONTS',
+ 'ENABLE_SVG_ANIMATION', 'ENABLE_SVG_AS_IMAGE', 'ENABLE_SVG_FOREIGN_OBJECT',
+ 'ENABLE_JIT', 'ENABLE_EXECUTABLE_ALLOCATOR_DEMAND', 'BUILDING_%s' % build_port.upper()]
msvc_version = 'msvc2008'