summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog26
-rw-r--r--Source/JavaScriptCore/API/JSBase.h2
-rw-r--r--Source/JavaScriptCore/ChangeLog232
-rw-r--r--Source/JavaScriptCore/JavaScriptCore.pri6
-rwxr-xr-xSource/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def1
-rw-r--r--Source/JavaScriptCore/PlatformBlackBerry.cmake1
-rw-r--r--Source/JavaScriptCore/bytecode/CodeBlock.cpp71
-rw-r--r--Source/JavaScriptCore/bytecode/CodeBlock.h11
-rw-r--r--Source/JavaScriptCore/bytecode/ExecutionCounter.cpp21
-rw-r--r--Source/JavaScriptCore/bytecode/ExecutionCounter.h2
-rw-r--r--Source/JavaScriptCore/dfg/DFGAbstractState.cpp12
-rw-r--r--Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp12
-rw-r--r--Source/JavaScriptCore/dfg/DFGCCallHelpers.h25
-rw-r--r--Source/JavaScriptCore/dfg/DFGCSEPhase.cpp11
-rw-r--r--Source/JavaScriptCore/dfg/DFGGraph.h31
-rw-r--r--Source/JavaScriptCore/dfg/DFGNodeType.h5
-rw-r--r--Source/JavaScriptCore/dfg/DFGOperations.cpp18
-rw-r--r--Source/JavaScriptCore/dfg/DFGOperations.h7
-rw-r--r--Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp6
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp28
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h30
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp95
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp79
-rw-r--r--Source/JavaScriptCore/heap/IncrementalSweeper.cpp1
-rw-r--r--Source/JavaScriptCore/heap/MachineStackMarker.cpp14
-rw-r--r--Source/JavaScriptCore/heap/MachineStackMarker.h4
-rw-r--r--Source/JavaScriptCore/heap/MarkedBlock.h2
-rw-r--r--Source/JavaScriptCore/jit/JITStubs.cpp6
-rw-r--r--Source/JavaScriptCore/llint/LLIntSlowPaths.cpp11
-rw-r--r--Source/JavaScriptCore/runtime/GCActivityCallback.cpp2
-rw-r--r--Source/JavaScriptCore/runtime/JSArray.h37
-rw-r--r--Source/JavaScriptCore/runtime/JSExportMacros.h4
-rw-r--r--Source/JavaScriptCore/runtime/JSGlobalObject.cpp9
-rw-r--r--Source/JavaScriptCore/runtime/JSGlobalObject.h41
-rw-r--r--Source/JavaScriptCore/runtime/MemoryStatistics.cpp2
-rw-r--r--Source/JavaScriptCore/runtime/Options.cpp12
-rw-r--r--Source/JavaScriptCore/runtime/Options.h6
-rw-r--r--Source/JavaScriptCore/runtime/WeakRandom.h3
-rw-r--r--Source/JavaScriptCore/wscript2
-rw-r--r--Source/Platform/ChangeLog91
-rw-r--r--Source/Platform/Platform.gypi1
-rw-r--r--Source/Platform/chromium/public/WebContentLayer.h6
-rw-r--r--Source/Platform/chromium/public/WebGraphicsContext3D.h11
-rw-r--r--Source/Platform/chromium/public/WebLayer.h8
-rw-r--r--Source/Platform/chromium/public/WebLayerTreeView.h10
-rw-r--r--Source/Platform/chromium/public/WebRenderingStats.h44
-rw-r--r--Source/Platform/chromium/public/WebScrollableLayer.h58
-rw-r--r--Source/QtWebKit.pro17
-rw-r--r--Source/WTF/ChangeLog37
-rw-r--r--Source/WTF/wtf/ExportMacros.h6
-rw-r--r--Source/WTF/wtf/Platform.h3
-rw-r--r--Source/WTF/wtf/ThreadSpecific.h36
-rw-r--r--Source/WTF/wtf/ThreadSpecificWin.cpp90
-rw-r--r--Source/WTF/wtf/text/StringBuilder.h15
-rw-r--r--Source/WebCore/CMakeLists.txt1
-rwxr-xr-x[-rw-r--r--]Source/WebCore/ChangeLog2107
-rw-r--r--Source/WebCore/GNUmakefile.list.am3
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBCursor.cpp39
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBCursor.h3
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp7
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h3
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabase.cpp17
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp22
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h3
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabaseBackendInterface.h3
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBIndex.cpp20
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.h9
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBIndexBackendInterface.h5
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp122
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBObjectStore.h2
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp87
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h8
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h5
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBTransaction.cpp4
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBTransaction.h4
-rw-r--r--Source/WebCore/Modules/networkinfo/NetworkInfo.cpp2
-rw-r--r--Source/WebCore/Modules/networkinfo/NetworkInfo.h8
-rw-r--r--Source/WebCore/Modules/networkinfo/NetworkInfoClient.h2
-rw-r--r--Source/WebCore/Modules/networkinfo/NetworkInfoConnection.cpp2
-rw-r--r--Source/WebCore/Modules/networkinfo/NetworkInfoConnection.h2
-rw-r--r--Source/WebCore/Modules/webaudio/AudioNode.cpp4
-rw-r--r--Source/WebCore/PlatformEfl.cmake3
-rw-r--r--Source/WebCore/Target.pri7
-rw-r--r--Source/WebCore/WebCore.gypi3
-rw-r--r--Source/WebCore/WebCore.pri4
-rwxr-xr-xSource/WebCore/WebCore.vcproj/WebCore.vcproj8
-rw-r--r--Source/WebCore/WebCore.xcodeproj/project.pbxproj8
-rw-r--r--Source/WebCore/accessibility/AccessibilityRenderObject.cpp6
-rw-r--r--Source/WebCore/bindings/js/JSDOMWindowCustom.cpp4
-rw-r--r--Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp7
-rwxr-xr-x[-rw-r--r--]Source/WebCore/bindings/objc/DOMEvents.mm0
-rw-r--r--Source/WebCore/bindings/objc/PublicDOMInterfaces.h14
-rw-r--r--Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm2
-rw-r--r--Source/WebCore/bindings/scripts/CodeGeneratorV8.pm9
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp10
-rw-r--r--Source/WebCore/bindings/v8/V8DOMWrapper.cpp1
-rw-r--r--Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp6
-rw-r--r--Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp6
-rw-r--r--Source/WebCore/bridge/runtime_object.cpp4
-rw-r--r--Source/WebCore/css/CSSParser.cpp77
-rw-r--r--Source/WebCore/css/CSSParserMode.h1
-rw-r--r--Source/WebCore/css/CSSToStyleMap.cpp659
-rw-r--r--Source/WebCore/css/CSSToStyleMap.h88
-rw-r--r--Source/WebCore/css/CSSValue.h2
-rw-r--r--Source/WebCore/css/CSSVariableValue.h1
-rw-r--r--Source/WebCore/css/StyleBuilder.cpp85
-rw-r--r--Source/WebCore/css/StyleResolver.cpp604
-rw-r--r--Source/WebCore/css/StyleResolver.h31
-rw-r--r--Source/WebCore/css/mediaControlsChromiumAndroid.css177
-rw-r--r--Source/WebCore/dom/Document.cpp11
-rw-r--r--Source/WebCore/dom/EventNames.h16
-rw-r--r--Source/WebCore/dom/MicroDataItemList.cpp13
-rw-r--r--Source/WebCore/dom/MicroDataItemList.h2
-rw-r--r--Source/WebCore/dom/MouseEvent.h3
-rw-r--r--Source/WebCore/dom/Node.cpp15
-rw-r--r--Source/WebCore/dom/TreeScopeAdopter.cpp5
-rw-r--r--Source/WebCore/dom/WebKitMutationObserver.cpp5
-rwxr-xr-x[-rw-r--r--]Source/WebCore/dom/WheelEvent.cpp14
-rwxr-xr-x[-rw-r--r--]Source/WebCore/dom/WheelEvent.h7
-rw-r--r--Source/WebCore/dom/WheelEvent.idl19
-rw-r--r--Source/WebCore/editing/AlternativeTextController.cpp5
-rw-r--r--Source/WebCore/editing/DeleteFromTextNodeCommand.cpp2
-rw-r--r--Source/WebCore/editing/DeleteSelectionCommand.cpp22
-rw-r--r--Source/WebCore/editing/Editor.cpp9
-rw-r--r--Source/WebCore/editing/htmlediting.cpp12
-rw-r--r--Source/WebCore/html/FormController.cpp94
-rw-r--r--Source/WebCore/html/FormController.h7
-rw-r--r--Source/WebCore/html/HTMLCollection.cpp70
-rw-r--r--Source/WebCore/html/HTMLCollection.h21
-rw-r--r--Source/WebCore/html/HTMLFormControlElementWithState.cpp9
-rw-r--r--Source/WebCore/html/HTMLMapElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLMediaElement.cpp2
-rw-r--r--Source/WebCore/html/shadow/CalendarPickerElement.cpp7
-rw-r--r--Source/WebCore/html/shadow/InsertionPoint.cpp15
-rw-r--r--Source/WebCore/inspector/Inspector.json28
-rw-r--r--Source/WebCore/inspector/InspectorFileSystemAgent.cpp120
-rw-r--r--Source/WebCore/inspector/InspectorFileSystemAgent.h1
-rw-r--r--Source/WebCore/inspector/front-end/FileSystemModel.js49
-rw-r--r--Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js1
-rw-r--r--Source/WebCore/inspector/front-end/HeapSnapshotGridNodes.js10
-rw-r--r--Source/WebCore/inspector/front-end/HeapSnapshotView.js5
-rw-r--r--Source/WebCore/inspector/front-end/StylesSidebarPane.js3
-rw-r--r--Source/WebCore/inspector/front-end/elementsPanel.css3
-rw-r--r--Source/WebCore/loader/archive/Archive.cpp17
-rw-r--r--Source/WebCore/loader/archive/Archive.h6
-rw-r--r--Source/WebCore/loader/archive/mhtml/MHTMLArchive.cpp8
-rw-r--r--Source/WebCore/loader/archive/mhtml/MHTMLArchive.h2
-rwxr-xr-xSource/WebCore/loader/cache/CachedResource.cpp15
-rw-r--r--Source/WebCore/loader/cache/CachedResourceLoader.cpp2
-rw-r--r--Source/WebCore/page/EventHandler.cpp22
-rw-r--r--Source/WebCore/page/EventSource.cpp5
-rw-r--r--Source/WebCore/page/Performance.h1
-rw-r--r--Source/WebCore/page/Settings.h4
-rw-r--r--Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp57
-rw-r--r--Source/WebCore/platform/PlatformExportMacros.h6
-rw-r--r--Source/WebCore/platform/chromium/support/Extensions3DChromium.cpp30
-rw-r--r--Source/WebCore/platform/chromium/support/GraphicsContext3DChromium.cpp4
-rw-r--r--Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.cpp81
-rw-r--r--Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.h14
-rw-r--r--Source/WebCore/platform/efl/EflScreenUtilities.cpp17
-rw-r--r--Source/WebCore/platform/efl/EflScreenUtilities.h1
-rw-r--r--Source/WebCore/platform/efl/FileSystemEfl.cpp49
-rw-r--r--Source/WebCore/platform/efl/PlatformScreenEfl.cpp16
-rw-r--r--Source/WebCore/platform/efl/SharedBufferEfl.cpp20
-rw-r--r--Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp10
-rw-r--r--Source/WebCore/platform/graphics/ANGLEWebKitBridge.h4
-rw-r--r--Source/WebCore/platform/graphics/BitmapImage.h4
-rw-r--r--Source/WebCore/platform/graphics/GraphicsContext3D.h14
-rw-r--r--Source/WebCore/platform/graphics/chromium/Extensions3DChromium.h37
-rw-r--r--Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp29
-rw-r--r--Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/GeometryBinding.cpp4
-rw-r--r--Source/WebCore/platform/graphics/chromium/GeometryBinding.h12
-rw-r--r--Source/WebCore/platform/graphics/chromium/LayerChromium.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp451
-rw-r--r--Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h39
-rw-r--r--Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp9
-rw-r--r--Source/WebCore/platform/graphics/chromium/ManagedTexture.cpp16
-rw-r--r--Source/WebCore/platform/graphics/chromium/ManagedTexture.h1
-rw-r--r--Source/WebCore/platform/graphics/chromium/PlatformColor.h5
-rw-r--r--Source/WebCore/platform/graphics/chromium/ProgramBinding.cpp21
-rw-r--r--Source/WebCore/platform/graphics/chromium/ProgramBinding.h20
-rw-r--r--Source/WebCore/platform/graphics/chromium/ShaderChromium.cpp39
-rw-r--r--Source/WebCore/platform/graphics/chromium/ShaderChromium.h42
-rw-r--r--Source/WebCore/platform/graphics/chromium/TextureCopier.cpp19
-rw-r--r--Source/WebCore/platform/graphics/chromium/TextureCopier.h12
-rw-r--r--Source/WebCore/platform/graphics/chromium/TextureManager.h1
-rw-r--r--Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.cpp26
-rw-r--r--Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.h20
-rw-r--r--Source/WebCore/platform/graphics/chromium/TrackingTextureAllocator.cpp28
-rw-r--r--Source/WebCore/platform/graphics/chromium/TrackingTextureAllocator.h11
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCGraphicsContext.h23
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp8
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp20
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp25
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h23
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp8
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h8
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCOverdrawMetrics.cpp14
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCProxy.h6
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCRenderingStats.h (renamed from Source/WebKit/chromium/tests/CompositorFakeGraphicsContext3D.h)26
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp56
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h12
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp55
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h5
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp10
-rw-r--r--Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp15
-rw-r--r--Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp38
-rw-r--r--Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp7
-rw-r--r--Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp5
-rw-r--r--Source/WebCore/platform/graphics/skia/PlatformContextSkia.h7
-rw-r--r--Source/WebCore/platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp22
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp84
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp8
-rw-r--r--Source/WebCore/platform/image-decoders/ImageDecoder.h2
-rw-r--r--Source/WebCore/platform/text/LocaleICU.cpp57
-rw-r--r--Source/WebCore/platform/text/LocaleICU.h3
-rw-r--r--Source/WebCore/platform/win/DragDataWin.cpp8
-rw-r--r--Source/WebCore/rendering/AutoTableLayout.cpp3
-rw-r--r--Source/WebCore/rendering/FixedTableLayout.cpp9
-rw-r--r--Source/WebCore/rendering/RenderBoxModelObject.cpp2
-rw-r--r--Source/WebCore/rendering/RenderGeometryMap.cpp26
-rw-r--r--Source/WebCore/rendering/RenderImage.cpp8
-rw-r--r--Source/WebCore/rendering/RenderImage.h2
-rw-r--r--Source/WebCore/rendering/RenderTable.cpp8
-rw-r--r--Source/WebCore/rendering/style/RenderStyle.h1
-rw-r--r--Source/WebCore/rendering/style/StyleRareInheritedData.h1
-rw-r--r--Source/WebCore/rendering/style/StyleVariableData.h1
-rw-r--r--Source/WebCore/svg/animation/SMILTimeContainer.cpp13
-rw-r--r--Source/WebCore/testing/Internals.cpp10
-rw-r--r--Source/WebCore/testing/Internals.h3
-rw-r--r--Source/WebCore/testing/Internals.idl3
-rw-r--r--Source/WebCore/xml/XMLHttpRequest.idl2
-rw-r--r--Source/WebKit/ChangeLog37
-rw-r--r--Source/WebKit/PlatformEfl.cmake7
-rw-r--r--Source/WebKit/WebKit1.pri54
-rw-r--r--Source/WebKit/WebKit1.pro152
-rw-r--r--Source/WebKit/blackberry/Api/WebPage.cpp12
-rw-r--r--Source/WebKit/blackberry/Api/WebPage.h1
-rw-r--r--Source/WebKit/blackberry/Api/WebPageClient.h5
-rw-r--r--Source/WebKit/blackberry/Api/WebSettings.cpp12
-rw-r--r--Source/WebKit/blackberry/Api/WebSettings.h2
-rw-r--r--Source/WebKit/blackberry/ChangeLog130
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/AboutData.cpp50
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp7
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/DeviceMotionClientBlackBerry.cpp14
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp4
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.h2
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp2
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp14
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/InputHandler.h2
-rw-r--r--Source/WebKit/chromium/ChangeLog510
-rw-r--r--Source/WebKit/chromium/DEPS2
-rw-r--r--Source/WebKit/chromium/WebKit.gyp3
-rw-r--r--Source/WebKit/chromium/WebKit.gypi3
-rw-r--r--Source/WebKit/chromium/features.gypi21
-rw-r--r--Source/WebKit/chromium/public/WebFrame.h6
-rw-r--r--Source/WebKit/chromium/public/WebIDBCallbacks.h2
-rw-r--r--Source/WebKit/chromium/public/WebNodeCollection.h3
-rw-r--r--Source/WebKit/chromium/public/WebPluginScrollbar.h36
-rw-r--r--Source/WebKit/chromium/public/WebPluginScrollbarClient.h37
-rw-r--r--Source/WebKit/chromium/public/WebTextRun.h4
-rw-r--r--Source/WebKit/chromium/public/WebView.h17
-rw-r--r--Source/WebKit/chromium/public/linux/WebFontRenderStyle.h2
-rw-r--r--Source/WebKit/chromium/src/ChromeClientImpl.cpp5
-rw-r--r--Source/WebKit/chromium/src/IDBCallbacksProxy.cpp4
-rw-r--r--Source/WebKit/chromium/src/IDBCallbacksProxy.h1
-rw-r--r--Source/WebKit/chromium/src/NonCompositedContentHost.cpp44
-rw-r--r--Source/WebKit/chromium/src/NonCompositedContentHost.h5
-rw-r--r--Source/WebKit/chromium/src/WebContentLayer.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebFrameImpl.cpp9
-rw-r--r--Source/WebKit/chromium/src/WebFrameImpl.h3
-rw-r--r--Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp7
-rw-r--r--Source/WebKit/chromium/src/WebIDBCallbacksImpl.h1
-rw-r--r--Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp15
-rw-r--r--Source/WebKit/chromium/src/WebIDBDatabaseImpl.h3
-rw-r--r--Source/WebKit/chromium/src/WebIDBIndexImpl.cpp20
-rw-r--r--Source/WebKit/chromium/src/WebIDBIndexImpl.h5
-rwxr-xr-xSource/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp20
-rw-r--r--Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h5
-rw-r--r--Source/WebKit/chromium/src/WebLayer.cpp15
-rw-r--r--Source/WebKit/chromium/src/WebLayerTreeView.cpp10
-rw-r--r--Source/WebKit/chromium/src/WebLayerTreeViewImpl.cpp7
-rw-r--r--Source/WebKit/chromium/src/WebNodeCollection.cpp8
-rw-r--r--Source/WebKit/chromium/src/WebPageSerializerImpl.cpp3
-rw-r--r--Source/WebKit/chromium/src/WebScrollableLayer.cpp54
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.cpp42
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.h13
-rw-r--r--Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp4
-rw-r--r--Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp201
-rw-r--r--Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp22
-rw-r--r--Source/WebKit/chromium/tests/CCSingleThreadProxyTest.cpp133
-rw-r--r--Source/WebKit/chromium/tests/CCThreadedTest.cpp11
-rw-r--r--Source/WebKit/chromium/tests/CCThreadedTest.h2
-rw-r--r--Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp12
-rw-r--r--Source/WebKit/chromium/tests/DrawingBufferChromiumTest.cpp64
-rwxr-xr-xSource/WebKit/chromium/tests/FakeCCLayerTreeHostClient.h8
-rw-r--r--Source/WebKit/chromium/tests/FakeGraphicsContext3DTest.cpp71
-rw-r--r--Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp8
-rw-r--r--Source/WebKit/chromium/tests/LayerChromiumTest.cpp16
-rw-r--r--Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp52
-rw-r--r--Source/WebKit/chromium/tests/TextureCopierTest.cpp7
-rw-r--r--Source/WebKit/chromium/tests/ThrottledTextureUploaderTest.cpp9
-rw-r--r--Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp3
-rw-r--r--Source/WebKit/chromium/tests/WebFrameTest.cpp22
-rw-r--r--Source/WebKit/chromium/tests/data/no_scale_for_you.html1
-rw-r--r--Source/WebKit/efl/ChangeLog35
-rw-r--r--Source/WebKit/efl/WebCoreSupport/NetworkInfoClientEfl.cpp47
-rw-r--r--Source/WebKit/efl/WebCoreSupport/NetworkInfoClientEfl.h5
-rw-r--r--Source/WebKit/gtk/ChangeLog6
-rw-r--r--Source/WebKit/gtk/NEWS24
-rw-r--r--Source/WebKit/qt/Api/qwebsettings.cpp4
-rw-r--r--Source/WebKit/qt/Api/qwebsettings.h3
-rw-r--r--Source/WebKit/qt/ChangeLog36
-rw-r--r--Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp10
-rw-r--r--Source/WebKit/qt/examples/platformplugin/WebPlugin.h3
-rw-r--r--Source/WebKit/qt/examples/platformplugin/platformplugin.pro3
-rw-r--r--Source/WebKit2/CMakeLists.txt8
-rw-r--r--Source/WebKit2/ChangeLog331
-rw-r--r--Source/WebKit2/DerivedSources.pri4
-rw-r--r--Source/WebKit2/GNUmakefile.list.am4
-rw-r--r--Source/WebKit2/Platform/CoreIPC/MessageID.h4
-rw-r--r--Source/WebKit2/Platform/PlatformProcessIdentifier.h2
-rw-r--r--Source/WebKit2/Target.pri16
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp16
-rw-r--r--Source/WebKit2/UIProcess/DrawingAreaProxy.cpp4
-rw-r--r--Source/WebKit2/UIProcess/DrawingAreaProxy.h8
-rw-r--r--Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp18
-rw-r--r--Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h4
-rw-r--r--Source/WebKit2/UIProcess/LayerTreeCoordinatorProxy.cpp (renamed from Source/WebKit2/UIProcess/LayerTreeHostProxy.cpp)52
-rw-r--r--Source/WebKit2/UIProcess/LayerTreeCoordinatorProxy.h (renamed from Source/WebKit2/UIProcess/LayerTreeHostProxy.h)14
-rw-r--r--Source/WebKit2/UIProcess/LayerTreeCoordinatorProxy.messages.in (renamed from Source/WebKit2/UIProcess/LayerTreeHostProxy.messages.in)2
-rw-r--r--Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp20
-rw-r--r--Source/WebKit2/UIProcess/WebLayerTreeRenderer.h6
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.cpp6
-rw-r--r--Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp2
-rw-r--r--Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp14
-rw-r--r--Source/WebKit2/UIProcess/texmap/LayerBackingStore.cpp (renamed from Source/WebKit2/UIProcess/qt/LayerBackingStore.cpp)0
-rw-r--r--Source/WebKit2/UIProcess/texmap/LayerBackingStore.h (renamed from Source/WebKit2/UIProcess/qt/LayerBackingStore.h)0
-rw-r--r--Source/WebKit2/WebKit2.pri6
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp11
-rw-r--r--Source/WebKit2/WebProcess/WebPage/DrawingArea.h2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp (renamed from Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp)138
-rw-r--r--Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.h (renamed from Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.h)25
-rw-r--r--Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.messages.in (renamed from Source/WebKit2/WebProcess/WebPage/LayerTreeHost.messages.in)4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/WebGraphicsLayer.cpp (renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp)4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/WebGraphicsLayer.h (renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h)3
-rw-r--r--Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.cpp4
-rw-r--r--Source/WebKit2/qt/MainQt.cpp4
-rw-r--r--Source/api.pri145
-rw-r--r--Source/cmake/FindEFL.cmake3
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg15
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders.js10
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders_unittests.js77
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js10
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js15
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui.js4
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js6
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui_unittests.js2
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/onebar.css3
-rw-r--r--Tools/ChangeLog325
-rwxr-xr-xTools/DumpRenderTree/chromium/WebThemeEngineDRTWin.cpp6
-rw-r--r--Tools/DumpRenderTree/chromium/WebThemeEngineDRTWin.h2
-rw-r--r--Tools/DumpRenderTree/qt/DumpRenderTree.pro1
-rwxr-xr-xTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp2
-rw-r--r--Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp2
-rwxr-xr-xTools/Scripts/build-webkit4
-rwxr-xr-xTools/Scripts/generate-win32-export-forwards48
-rwxr-xr-xTools/Scripts/webkit-tools-completion.sh1
-rw-r--r--Tools/Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py4
-rw-r--r--Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py8
-rw-r--r--Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py14
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/builders.py1
-rwxr-xr-xTools/Scripts/webkitpy/layout_tests/port/chromium.py5
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py2
-rwxr-xr-xTools/Scripts/webkitpy/layout_tests/port/chromium_win.py12
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py15
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/queries.py54
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/queries_unittest.py57
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py5
-rw-r--r--Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py6
-rw-r--r--Tools/TestResultServer/static-dashboards/flakiness_dashboard.js10
-rw-r--r--Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js24
-rw-r--r--Tools/Tools.pro13
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl1
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp6
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h1
-rw-r--r--Tools/efl/jhbuild.modules11
-rw-r--r--Tools/qmake/mkspecs/features/default_post.prf8
-rw-r--r--Tools/qmake/mkspecs/features/default_pre.prf3
-rw-r--r--Tools/qmake/mkspecs/features/win32/default_post.prf21
-rw-r--r--Tools/qmake/mkspecs/modules/webkit1.prf9
-rw-r--r--WebKit.pro8
-rw-r--r--configure.ac8
399 files changed, 8485 insertions, 3681 deletions
diff --git a/ChangeLog b/ChangeLog
index 7395ae045..72a7486bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2012-06-25 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Make it possible to build WebKit without QtWidgets
+ https://bugs.webkit.org/show_bug.cgi?id=78109
+
+ Reviewed by Tor Arne Vestbø.
+
+ * Source/QtWebKit.pro: Don't build WK1 tests and examples if WK1 is disabled.
+ * Source/api.pri: Move WK1 sources away from here and use WEBKIT += webkit1 instead
+ * WebKit.pro: Add WK1 to SUBDIRS unless no_webkit1 is set.
+
+2012-06-25 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ [EFL] Implement Network Information API
+ https://bugs.webkit.org/show_bug.cgi?id=87067
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * Source/cmake/FindEFL.cmake: Find eeze library in build system.
+
+2012-06-25 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Unreviewed. Update NEWS and configure.ac for 1.9.4 release
+
+ * configure.ac: Bump version number.
+
2012-06-22 Joshua Netterfield <jnetterfield@rim.com>
[BlackBerry] Sanitize GLSL code using ANGLE.
diff --git a/Source/JavaScriptCore/API/JSBase.h b/Source/JavaScriptCore/API/JSBase.h
index f46a41755..fed54fe23 100644
--- a/Source/JavaScriptCore/API/JSBase.h
+++ b/Source/JavaScriptCore/API/JSBase.h
@@ -71,7 +71,7 @@ typedef struct OpaqueJSValue* JSObjectRef;
#elif defined(__GNUC__) && !defined(__CC_ARM) && !defined(__ARMCC__)
#define JS_EXPORT __attribute__((visibility("default")))
#elif defined(WIN32) || defined(_WIN32) || defined(_WIN32_WCE) || defined(__CC_ARM) || defined(__ARMCC__)
-#if defined(BUILDING_JavaScriptCore) || defined(STATICALLY_LINKED_WITH_JavaScriptCore)
+#if defined(BUILDING_JavaScriptCore) || defined(BUILDING_WTF)
#define JS_EXPORT __declspec(dllexport)
#else
#define JS_EXPORT __declspec(dllimport)
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 9304ce075..686fac171 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,33 +1,223 @@
-2012-06-19 Joel Dillon <joel.dillon@codethink.co.uk> Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+2012-06-26 Geoffrey Garen <ggaren@apple.com>
- [Qt][Win] Fix broken QtWebKit5.lib linking
- https://bugs.webkit.org/show_bug.cgi?id=88321
+ Reduced (but did not eliminate) use of "berzerker GC"
+ https://bugs.webkit.org/show_bug.cgi?id=89237
+
+ Reviewed by Gavin Barraclough.
+
+ (PART 2)
+
+ This part turns off "berzerker GC" and turns on incremental shrinking.
+
+ * heap/IncrementalSweeper.cpp:
+ (JSC::IncrementalSweeper::doSweep): Free or shrink after sweeping to
+ maintain the behavior we used to get from the occasional berzerker GC,
+ which would run all finalizers and then free or shrink all blocks
+ synchronously.
+
+ * heap/MarkedBlock.h:
+ (JSC::MarkedBlock::needsSweeping): Sweep zapped blocks, too. It's always
+ safe to sweep a zapped block (that's the point of zapping), and it's
+ sometimes profitable. For example, consider this case: Block A does some
+ allocation (transitioning Block A from Marked to FreeListed), then GC
+ happens (transitioning Block A to Zapped), then all objects in Block A
+ are free, then the incremental sweeper visits Block A. If we skipped
+ Zapped blocks, we'd skip Block A, even though it would be profitable to
+ run its destructors and free its memory.
+
+ * runtime/GCActivityCallback.cpp:
+ (JSC::DefaultGCActivityCallback::doWork): Don't sweep eagerly; we'll do
+ this incrementally.
+
+2012-06-26 Filip Pizlo <fpizlo@apple.com>
+
+ DFG PutByValAlias is too aggressive
+ https://bugs.webkit.org/show_bug.cgi?id=90026
+ <rdar://problem/11751830>
+
+ Reviewed by Gavin Barraclough.
+
+ For CSE on normal arrays, we now treat PutByVal as impure. This does not appear to affect
+ performance by much.
+
+ For CSE on typed arrays, we fix PutByValAlias by making GetByVal speculate that the access
+ is within bounds. This also has the effect of making our out-of-bounds handling consistent
+ with WebCore.
+
+ * dfg/DFGCSEPhase.cpp:
+ (JSC::DFG::CSEPhase::performNodeCSE):
+ * dfg/DFGGraph.h:
+ (JSC::DFG::Graph::byValIsPure):
+ (JSC::DFG::Graph::clobbersWorld):
+ * dfg/DFGNodeType.h:
+ (DFG):
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
+ (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):
+
+2012-06-26 Yong Li <yoli@rim.com>
+
+ [BlackBerry] Add JSC statistics into about:memory
+ https://bugs.webkit.org/show_bug.cgi?id=89779
+
+ Reviewed by Rob Buis.
+
+ Fix non-JIT build on BlackBerry broken by r121196.
+
+ * runtime/MemoryStatistics.cpp:
+ (JSC::globalMemoryStatistics):
+
+2012-06-25 Filip Pizlo <fpizlo@apple.com>
+
+ DFG::operationNewArray is unnecessarily slow, and may use the wrong array
+ prototype when inlined
+ https://bugs.webkit.org/show_bug.cgi?id=89821
+
+ Reviewed by Geoffrey Garen.
+
+ Fixes all array allocations to use the right structure, and hence the right prototype. Adds
+ inlining of new Array(...) with a non-zero number of arguments. Optimizes allocations of
+ empty arrays.
+
+ * dfg/DFGAbstractState.cpp:
+ (JSC::DFG::AbstractState::execute):
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
+ * dfg/DFGCCallHelpers.h:
+ (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
+ (CCallHelpers):
+ * dfg/DFGNodeType.h:
+ (DFG):
+ * dfg/DFGOperations.cpp:
+ * dfg/DFGOperations.h:
+ * dfg/DFGPredictionPropagationPhase.cpp:
+ (JSC::DFG::PredictionPropagationPhase::propagate):
+ * dfg/DFGSpeculativeJIT.h:
+ (JSC::DFG::SpeculativeJIT::callOperation):
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * runtime/JSArray.h:
+ (JSC):
+ (JSC::constructArray):
+ * runtime/JSGlobalObject.h:
+ (JSC):
+ (JSC::constructArray):
- Reviewed by NOBODY (OOPS!).
+2012-06-26 Filip Pizlo <fpizlo@apple.com>
- Also update the Wx build to use the new define.
+ New fast/js/dfg-store-unexpected-value-into-argument-and-osr-exit.html fails on 32 bit
+ https://bugs.webkit.org/show_bug.cgi?id=89953
- * API/JSBase.h:
- * runtime/JSExportMacros.h:
- * wscript:
+ Reviewed by Zoltan Herczeg.
+
+ DFG 32-bit JIT was confused about the difference between a predicted type and a
+ proven type. This is easy to get confused about, since a local that is predicted int32
+ almost always means that the local must be an int32 since speculations are hoisted to
+ stores to locals. But that is less likely to be the case for arguments, where there is
+ an additional least-upper-bounding step: any store to an argument with a weird type
+ may force the argument to be any type.
+
+ This patch basically duplicates the functionality in DFGSpeculativeJIT64.cpp for
+ GetLocal: the decision of whether to load a local as an int32 (or as an array, or as
+ a boolean) is made based on the AbstractValue::m_type, which is a type proof, rather
+ than the VariableAccessData::prediction(), which is a predicted type.
-2012-06-13 Patrick Gansterer <paroga@webkit.org>
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
- [WIN] Remove dependency on pthread from MachineStackMarker
- https://bugs.webkit.org/show_bug.cgi?id=68429
+2012-06-25 Filip Pizlo <fpizlo@apple.com>
- Reviewed by NOBODY (OOPS!).
+ JSC should try to make profiling deterministic because otherwise reproducing failures is
+ nearly impossible
+ https://bugs.webkit.org/show_bug.cgi?id=89940
- Implement pthread TLS functionality with native windows functions.
+ Rubber stamped by Gavin Barraclough.
+
+ This rolls out the part of http://trac.webkit.org/changeset/121215 that introduced randomness
+ into the system. Now, instead of randomizing the tier-up threshold, we always set it to an
+ artificially low (and statically predetermined!) value. This gives most of the benefit of
+ threshold randomization without actually making the system behave completely differently on
+ each invocation.
- * heap/MachineStackMarker.cpp: Use the new functions instead of pthread directly.
- * heap/MachineStackMarker.h:
- * wtf/ThreadSpecific.h:
- (WTF::ThreadSpecificKeyCreate): Added wrapper around pthread_key_create.
- (WTF::ThreadSpecificKeyDelete): Added wrapper around pthread_key_delete.
- (WTF::ThreadSpecificSet): Added wrapper around pthread_setspecific.
- (WTF::ThreadSpecificGet): Added wrapper around pthread_getspecific.
- * wtf/ThreadSpecificWin.cpp:
+ * bytecode/ExecutionCounter.cpp:
+ (JSC::ExecutionCounter::setThreshold):
+ * runtime/Options.cpp:
+ (Options):
+ (JSC::Options::initializeOptions):
+ * runtime/Options.h:
+ (Options):
+
+2012-06-22 Filip Pizlo <fpizlo@apple.com>
+
+ Value profiling should use tier-up threshold randomization to get more coverage
+ https://bugs.webkit.org/show_bug.cgi?id=89802
+
+ Reviewed by Gavin Barraclough.
+
+ This patch causes both LLInt and Baseline JIT code to take the OSR slow path several
+ times before actually doing OSR. If we take the OSR slow path before the execution
+ count threshold is reached, then we just call CodeBlock::updateAllPredictions() to
+ compute the current latest least-upper-bound SpecType of all values seen in each
+ ValueProfile.
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::stronglyVisitStrongReferences):
+ (JSC::CodeBlock::updateAllPredictionsAndCountLiveness):
+ (JSC):
+ (JSC::CodeBlock::updateAllPredictions):
+ (JSC::CodeBlock::shouldOptimizeNow):
+ * bytecode/CodeBlock.h:
+ (JSC::CodeBlock::llintExecuteCounter):
+ (JSC::CodeBlock::jitExecuteCounter):
+ (CodeBlock):
+ (JSC::CodeBlock::updateAllPredictions):
+ * bytecode/ExecutionCounter.cpp:
+ (JSC::ExecutionCounter::setThreshold):
+ (JSC::ExecutionCounter::status):
+ (JSC):
+ * bytecode/ExecutionCounter.h:
+ (JSC::ExecutionCounter::count):
+ (ExecutionCounter):
+ * dfg/DFGAbstractState.cpp:
+ (JSC::DFG::AbstractState::execute):
+ * dfg/DFGOperations.cpp:
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * jit/JITStubs.cpp:
+ (JSC::DEFINE_STUB_FUNCTION):
+ * llint/LLIntSlowPaths.cpp:
+ (JSC::LLInt::jitCompileAndSetHeuristics):
+ (JSC::LLInt::entryOSR):
+ (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+ * runtime/JSGlobalObject.cpp:
+ (JSC::JSGlobalObject::JSGlobalObject):
+ (JSC):
+ * runtime/JSGlobalObject.h:
+ (JSGlobalObject):
+ (JSC::JSGlobalObject::weakRandomInteger):
+ * runtime/Options.cpp:
+ (Options):
+ (JSC::Options::initializeOptions):
+ * runtime/Options.h:
+ (Options):
+ * runtime/WeakRandom.h:
+ (WeakRandom):
+ (JSC::WeakRandom::seedUnsafe):
+
+2012-06-25 Yong Li <yoli@rim.com>
+
+ [BlackBerry] Add JSC statistics into about:memory
+ https://bugs.webkit.org/show_bug.cgi?id=89779
+
+ Reviewed by Rob Buis.
+
+ Add MemoryStatistics.cpp into build, and fill JITBytes for BlackBerry port.
+
+ * PlatformBlackBerry.cmake:
+ * runtime/MemoryStatistics.cpp:
+ (JSC::globalMemoryStatistics):
2012-06-23 Sheriff Bot <webkit.review.bot@gmail.com>
diff --git a/Source/JavaScriptCore/JavaScriptCore.pri b/Source/JavaScriptCore/JavaScriptCore.pri
index f6580c51f..380bbaf1b 100644
--- a/Source/JavaScriptCore/JavaScriptCore.pri
+++ b/Source/JavaScriptCore/JavaScriptCore.pri
@@ -34,6 +34,12 @@ INCLUDEPATH += \
win32-* {
LIBS += -lwinmm
+
+ win32-g++* {
+ LIBS += -lpthreadGC2
+ } else:win32-msvc* {
+ LIBS += -lpthreadVC2
+ }
}
wince* {
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
index c48ef49c6..6a8a89372 100755
--- a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
+++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
@@ -9,6 +9,7 @@ EXPORTS
??0DropAllLocks@JSLock@JSC@@QAE@W4JSLockBehavior@2@@Z
??0DynamicGlobalObjectScope@JSC@@QAE@AAVJSGlobalData@1@PAVJSGlobalObject@1@@Z
??0InternalFunction@JSC@@IAE@PAVJSGlobalObject@1@PAVStructure@1@@Z
+ ??0JSGlobalObject@JSC@@IAE@AAVJSGlobalData@1@PAVStructure@1@PBUGlobalObjectMethodTable@1@@Z
??0JSLock@JSC@@QAE@PAVExecState@1@@Z
??0MD5@WTF@@QAE@XZ
??0Mutex@WTF@@QAE@XZ
diff --git a/Source/JavaScriptCore/PlatformBlackBerry.cmake b/Source/JavaScriptCore/PlatformBlackBerry.cmake
index cc3cfead3..f9352cd4f 100644
--- a/Source/JavaScriptCore/PlatformBlackBerry.cmake
+++ b/Source/JavaScriptCore/PlatformBlackBerry.cmake
@@ -8,6 +8,7 @@ LIST(REMOVE_ITEM JavaScriptCore_SOURCES
LIST(APPEND JavaScriptCore_SOURCES
runtime/GCActivityCallbackBlackBerry.cpp
+ runtime/MemoryStatistics.cpp
)
INSTALL(FILES "wtf/Forward.h" DESTINATION usr/include/browser/webkit/wtf)
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
index bcbb51f63..e0a4da71d 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -2104,26 +2104,7 @@ void CodeBlock::stronglyVisitStrongReferences(SlotVisitor& visitor)
}
#endif
-#if ENABLE(DFG_JIT)
- if (hasCodeOrigins()) {
- // Make sure that executables that we have inlined don't die.
- // FIXME: If they would have otherwise died, we should probably trigger recompilation.
- for (size_t i = 0; i < inlineCallFrames().size(); ++i) {
- InlineCallFrame& inlineCallFrame = inlineCallFrames()[i];
- visitor.append(&inlineCallFrame.executable);
- visitor.append(&inlineCallFrame.callee);
- }
- }
-
- m_lazyOperandValueProfiles.computeUpdatedPredictions(Collection);
-#endif
-
-#if ENABLE(VALUE_PROFILER)
- for (unsigned profileIndex = 0; profileIndex < numberOfArgumentValueProfiles(); ++profileIndex)
- valueProfileForArgument(profileIndex)->computeUpdatedPrediction(Collection);
- for (unsigned profileIndex = 0; profileIndex < numberOfValueProfiles(); ++profileIndex)
- valueProfile(profileIndex)->computeUpdatedPrediction(Collection);
-#endif
+ updateAllPredictions(Collection);
}
void CodeBlock::stronglyVisitWeakReferences(SlotVisitor& visitor)
@@ -2574,21 +2555,11 @@ bool FunctionCodeBlock::jitCompileImpl(ExecState* exec)
#endif
#if ENABLE(VALUE_PROFILER)
-bool CodeBlock::shouldOptimizeNow()
+void CodeBlock::updateAllPredictionsAndCountLiveness(
+ OperationInProgress operation, unsigned& numberOfLiveNonArgumentValueProfiles, unsigned& numberOfSamplesInProfiles)
{
-#if ENABLE(JIT_VERBOSE_OSR)
- dataLog("Considering optimizing %p...\n", this);
-#endif
-
-#if ENABLE(VERBOSE_VALUE_PROFILE)
- dumpValueProfiles();
-#endif
-
- if (m_optimizationDelayCounter >= Options::maximumOptimizationDelay)
- return true;
-
- unsigned numberOfLiveNonArgumentValueProfiles = 0;
- unsigned numberOfSamplesInProfiles = 0; // If this divided by ValueProfile::numberOfBuckets equals numberOfValueProfiles() then value profiles are full.
+ numberOfLiveNonArgumentValueProfiles = 0;
+ numberOfSamplesInProfiles = 0; // If this divided by ValueProfile::numberOfBuckets equals numberOfValueProfiles() then value profiles are full.
for (unsigned i = 0; i < totalNumberOfValueProfiles(); ++i) {
ValueProfile* profile = getFromAllValueProfiles(i);
unsigned numSamples = profile->totalNumberOfSamples();
@@ -2596,13 +2567,41 @@ bool CodeBlock::shouldOptimizeNow()
numSamples = ValueProfile::numberOfBuckets; // We don't want profiles that are extremely hot to be given more weight.
numberOfSamplesInProfiles += numSamples;
if (profile->m_bytecodeOffset < 0) {
- profile->computeUpdatedPrediction();
+ profile->computeUpdatedPrediction(operation);
continue;
}
if (profile->numberOfSamples() || profile->m_prediction != SpecNone)
numberOfLiveNonArgumentValueProfiles++;
- profile->computeUpdatedPrediction();
+ profile->computeUpdatedPrediction(operation);
}
+
+#if ENABLE(DFG_JIT)
+ m_lazyOperandValueProfiles.computeUpdatedPredictions(operation);
+#endif
+}
+
+void CodeBlock::updateAllPredictions(OperationInProgress operation)
+{
+ unsigned ignoredValue1, ignoredValue2;
+ updateAllPredictionsAndCountLiveness(operation, ignoredValue1, ignoredValue2);
+}
+
+bool CodeBlock::shouldOptimizeNow()
+{
+#if ENABLE(JIT_VERBOSE_OSR)
+ dataLog("Considering optimizing %p...\n", this);
+#endif
+
+#if ENABLE(VERBOSE_VALUE_PROFILE)
+ dumpValueProfiles();
+#endif
+
+ if (m_optimizationDelayCounter >= Options::maximumOptimizationDelay)
+ return true;
+
+ unsigned numberOfLiveNonArgumentValueProfiles;
+ unsigned numberOfSamplesInProfiles;
+ updateAllPredictionsAndCountLiveness(NoOperation, numberOfLiveNonArgumentValueProfiles, numberOfSamplesInProfiles);
#if ENABLE(JIT_VERBOSE_OSR)
dataLog("Profile hotness: %lf, %lf\n", (double)numberOfLiveNonArgumentValueProfiles / numberOfValueProfiles(), (double)numberOfSamplesInProfiles / ValueProfile::numberOfBuckets / numberOfValueProfiles());
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.h b/Source/JavaScriptCore/bytecode/CodeBlock.h
index b73dcb2b6..4e4fee2b7 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.h
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.h
@@ -913,9 +913,9 @@ namespace JSC {
m_llintExecuteCounter.setNewThreshold(Options::thresholdForJITSoon, this);
}
- int32_t llintExecuteCounter() const
+ const ExecutionCounter& llintExecuteCounter() const
{
- return m_llintExecuteCounter.m_counter;
+ return m_llintExecuteCounter;
}
// Functions for controlling when tiered compilation kicks in. This
@@ -971,7 +971,7 @@ namespace JSC {
static ptrdiff_t offsetOfJITExecutionActiveThreshold() { return OBJECT_OFFSETOF(CodeBlock, m_jitExecuteCounter) + OBJECT_OFFSETOF(ExecutionCounter, m_activeThreshold); }
static ptrdiff_t offsetOfJITExecutionTotalCount() { return OBJECT_OFFSETOF(CodeBlock, m_jitExecuteCounter) + OBJECT_OFFSETOF(ExecutionCounter, m_totalCount); }
- int32_t jitExecuteCounter() const { return m_jitExecuteCounter.m_counter; }
+ const ExecutionCounter& jitExecuteCounter() const { return m_jitExecuteCounter; }
unsigned optimizationDelayCounter() const { return m_optimizationDelayCounter; }
@@ -1100,8 +1100,10 @@ namespace JSC {
#if ENABLE(VALUE_PROFILER)
bool shouldOptimizeNow();
+ void updateAllPredictions(OperationInProgress = NoOperation);
#else
bool shouldOptimizeNow() { return false; }
+ void updateAllPredictions(OperationInProgress = NoOperation) { }
#endif
#if ENABLE(JIT)
@@ -1134,6 +1136,9 @@ namespace JSC {
#else
void tallyFrequentExitSites() { }
#endif
+#if ENABLE(VALUE_PROFILER)
+ void updateAllPredictionsAndCountLiveness(OperationInProgress, unsigned& numberOfLiveNonArgumentValueProfiles, unsigned& numberOfSamplesInProfiles);
+#endif
void dump(ExecState*, const Vector<Instruction>::const_iterator& begin, Vector<Instruction>::const_iterator&);
diff --git a/Source/JavaScriptCore/bytecode/ExecutionCounter.cpp b/Source/JavaScriptCore/bytecode/ExecutionCounter.cpp
index ea335005e..1f2e8260a 100644
--- a/Source/JavaScriptCore/bytecode/ExecutionCounter.cpp
+++ b/Source/JavaScriptCore/bytecode/ExecutionCounter.cpp
@@ -28,6 +28,7 @@
#include "CodeBlock.h"
#include "ExecutableAllocator.h"
+#include <wtf/StringExtras.h>
namespace JSC {
@@ -125,7 +126,7 @@ bool ExecutionCounter::setThreshold(CodeBlock* codeBlock)
ASSERT(!hasCrossedThreshold(codeBlock));
// Compute the true total count.
- double trueTotalCount = static_cast<double>(m_totalCount) + m_counter;
+ double trueTotalCount = count();
// Correct the threshold for current memory usage.
double threshold = applyMemoryUsageHeuristics(m_activeThreshold, codeBlock);
@@ -143,9 +144,14 @@ bool ExecutionCounter::setThreshold(CodeBlock* codeBlock)
return true;
}
- if (threshold > std::numeric_limits<int32_t>::max())
- threshold = std::numeric_limits<int32_t>::max();
-
+ int32_t maxThreshold;
+ if (Options::randomizeExecutionCountsBetweenCheckpoints)
+ maxThreshold = codeBlock->globalObject()->weakRandomInteger() % Options::maximumExecutionCountsBetweenCheckpoints;
+ else
+ maxThreshold = Options::maximumExecutionCountsBetweenCheckpoints;
+ if (threshold > maxThreshold)
+ threshold = maxThreshold;
+
m_counter = static_cast<int32_t>(-threshold);
m_totalCount = trueTotalCount + threshold;
@@ -160,5 +166,12 @@ void ExecutionCounter::reset()
m_activeThreshold = 0;
}
+const char* ExecutionCounter::status() const
+{
+ static char result[80];
+ snprintf(result, sizeof(result), "%lf/%lf, %d", count(), static_cast<double>(m_activeThreshold), m_counter);
+ return result;
+}
+
} // namespace JSC
diff --git a/Source/JavaScriptCore/bytecode/ExecutionCounter.h b/Source/JavaScriptCore/bytecode/ExecutionCounter.h
index d2ffbb649..1c0d23f0f 100644
--- a/Source/JavaScriptCore/bytecode/ExecutionCounter.h
+++ b/Source/JavaScriptCore/bytecode/ExecutionCounter.h
@@ -38,6 +38,8 @@ public:
bool checkIfThresholdCrossedAndSet(CodeBlock*);
void setNewThreshold(int32_t threshold, CodeBlock*);
void deferIndefinitely();
+ double count() const { return static_cast<double>(m_totalCount) + m_counter; }
+ const char* status() const;
static double applyMemoryUsageHeuristics(int32_t value, CodeBlock*);
static int32_t applyMemoryUsageHeuristicsAndConvertToInt(int32_t value, CodeBlock*);
diff --git a/Source/JavaScriptCore/dfg/DFGAbstractState.cpp b/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
index 94e96853d..c2d49f7ee 100644
--- a/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
+++ b/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
@@ -1141,13 +1141,19 @@ bool AbstractState::execute(unsigned indexInBlock)
case NewArray:
case NewArrayBuffer:
node.setCanExit(false);
- forNode(nodeIndex).set(m_codeBlock->globalObject()->arrayStructure());
+ forNode(nodeIndex).set(m_graph.globalObjectFor(node.codeOrigin)->arrayStructure());
+ m_haveStructures = true;
+ break;
+
+ case NewArrayWithSize:
+ speculateInt32Unary(node);
+ forNode(nodeIndex).set(m_graph.globalObjectFor(node.codeOrigin)->arrayStructure());
m_haveStructures = true;
break;
case NewRegexp:
node.setCanExit(false);
- forNode(nodeIndex).set(m_codeBlock->globalObject()->regExpStructure());
+ forNode(nodeIndex).set(m_graph.globalObjectFor(node.codeOrigin)->regExpStructure());
m_haveStructures = true;
break;
@@ -1392,7 +1398,7 @@ bool AbstractState::execute(unsigned indexInBlock)
case StructureTransitionWatchpoint: {
// FIXME: Turn CheckStructure into StructureTransitionWatchpoint when possible!
AbstractValue& value = forNode(node.child1());
- ASSERT(isCellSpeculation(value.m_type));
+ ASSERT(value.isClear() || isCellSpeculation(value.m_type)); // Value could be clear if we've proven must-exit due to a speculation statically known to be bad.
value.filter(node.structure());
node.setCanExit(true);
break;
diff --git a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
index 75611972e..cdb0b639a 100644
--- a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
+++ b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
@@ -1606,15 +1606,19 @@ bool ByteCodeParser::handleConstantInternalFunction(
// we know about is small enough, that having just a linear cascade of if statements
// is good enough.
- UNUSED_PARAM(registerOffset); // Remove this once we do more things to the arguments.
UNUSED_PARAM(prediction); // Remove this once we do more things.
UNUSED_PARAM(kind); // Remove this once we do more things.
if (function->classInfo() == &ArrayConstructor::s_info) {
- // We could handle this but don't for now.
- if (argumentCountIncludingThis != 1)
- return false;
+ if (argumentCountIncludingThis == 2) {
+ setIntrinsicResult(
+ usesResult, resultOperand,
+ addToGraph(NewArrayWithSize, get(registerOffset + argumentToOperand(1))));
+ return true;
+ }
+ for (int i = 1; i < argumentCountIncludingThis; ++i)
+ addVarArgChild(get(registerOffset + argumentToOperand(i)));
setIntrinsicResult(
usesResult, resultOperand,
addToGraph(Node::VarArg, NewArray, OpInfo(0), OpInfo(0)));
diff --git a/Source/JavaScriptCore/dfg/DFGCCallHelpers.h b/Source/JavaScriptCore/dfg/DFGCCallHelpers.h
index 4cacd45c1..b60290870 100644
--- a/Source/JavaScriptCore/dfg/DFGCCallHelpers.h
+++ b/Source/JavaScriptCore/dfg/DFGCCallHelpers.h
@@ -160,6 +160,14 @@ public:
addCallArgument(arg2);
}
+ ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImmPtr arg1, GPRReg arg2)
+ {
+ resetCallArguments();
+ addCallArgument(GPRInfo::callFrameRegister);
+ addCallArgument(arg1);
+ addCallArgument(arg2);
+ }
+
ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImm32 arg1, TrustedImm32 arg2)
{
resetCallArguments();
@@ -203,6 +211,15 @@ public:
addCallArgument(arg3);
}
+ ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImmPtr arg1, TrustedImmPtr arg2, TrustedImmPtr arg3)
+ {
+ resetCallArguments();
+ addCallArgument(GPRInfo::callFrameRegister);
+ addCallArgument(arg1);
+ addCallArgument(arg2);
+ addCallArgument(arg3);
+ }
+
ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, TrustedImmPtr arg2, TrustedImmPtr arg3)
{
resetCallArguments();
@@ -597,6 +614,14 @@ public:
move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0);
}
+ ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImmPtr arg1, TrustedImmPtr arg2, TrustedImmPtr arg3)
+ {
+ move(arg1, GPRInfo::argumentGPR1);
+ move(arg2, GPRInfo::argumentGPR2);
+ move(arg3, GPRInfo::argumentGPR3);
+ move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0);
+ }
+
ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImm32 arg1, TrustedImm32 arg2, TrustedImm32 arg3)
{
move(arg1, GPRInfo::argumentGPR1);
diff --git a/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp b/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
index a362e6e97..be0012f56 100644
--- a/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
@@ -1080,10 +1080,15 @@ private:
break;
case PutByVal:
- if (m_graph.byValIsPure(node)
- && !m_graph[node.child1()].shouldSpeculateArguments()
- && getByValLoadElimination(node.child1().index(), node.child2().index()) != NoNode)
+ if (isActionableMutableArraySpeculation(m_graph[node.child1()].prediction())
+ && m_graph[node.child2()].shouldSpeculateInteger()
+ && !m_graph[node.child1()].shouldSpeculateArguments()) {
+ NodeIndex nodeIndex = getByValLoadElimination(
+ node.child1().index(), node.child2().index());
+ if (nodeIndex == NoNode)
+ break;
node.setOp(PutByValAlias);
+ }
break;
case CheckStructure:
diff --git a/Source/JavaScriptCore/dfg/DFGGraph.h b/Source/JavaScriptCore/dfg/DFGGraph.h
index 9e4a28fc3..a9080d117 100644
--- a/Source/JavaScriptCore/dfg/DFGGraph.h
+++ b/Source/JavaScriptCore/dfg/DFGGraph.h
@@ -463,10 +463,31 @@ public:
bool byValIsPure(Node& node)
{
- return at(node.child2()).shouldSpeculateInteger()
- && ((node.op() == PutByVal || node.op() == PutByValAlias)
- ? isActionableMutableArraySpeculation(at(node.child1()).prediction())
- : isActionableArraySpeculation(at(node.child1()).prediction()));
+ if (!at(node.child2()).shouldSpeculateInteger())
+ return false;
+ SpeculatedType prediction = at(node.child1()).prediction();
+ switch (node.op()) {
+ case PutByVal:
+ if (!isActionableMutableArraySpeculation(prediction))
+ return false;
+ if (isArraySpeculation(prediction))
+ return false;
+ return true;
+
+ case PutByValAlias:
+ if (!isActionableMutableArraySpeculation(prediction))
+ return false;
+ return true;
+
+ case GetByVal:
+ if (!isActionableArraySpeculation(prediction))
+ return false;
+ return true;
+
+ default:
+ ASSERT_NOT_REACHED();
+ return false;
+ }
}
bool clobbersWorld(Node& node)
@@ -484,6 +505,8 @@ public:
case CompareEq:
return !isPredictedNumerical(node);
case GetByVal:
+ case PutByVal:
+ case PutByValAlias:
return !byValIsPure(node);
default:
ASSERT_NOT_REACHED();
diff --git a/Source/JavaScriptCore/dfg/DFGNodeType.h b/Source/JavaScriptCore/dfg/DFGNodeType.h
index 4671f6b6c..8c2f96222 100644
--- a/Source/JavaScriptCore/dfg/DFGNodeType.h
+++ b/Source/JavaScriptCore/dfg/DFGNodeType.h
@@ -111,8 +111,8 @@ namespace JSC { namespace DFG {
/* Since a put to 'length' may invalidate optimizations here, */\
/* this must be the directly subsequent property put. */\
macro(GetByVal, NodeResultJS | NodeMustGenerate | NodeMightClobber) \
- macro(PutByVal, NodeMustGenerate | NodeClobbersWorld) \
- macro(PutByValAlias, NodeMustGenerate | NodeClobbersWorld) \
+ macro(PutByVal, NodeMustGenerate | NodeMightClobber) \
+ macro(PutByValAlias, NodeMustGenerate | NodeMightClobber) \
macro(GetById, NodeResultJS | NodeMustGenerate | NodeClobbersWorld) \
macro(GetByIdFlush, NodeResultJS | NodeMustGenerate | NodeClobbersWorld) \
macro(PutById, NodeMustGenerate | NodeClobbersWorld) \
@@ -184,6 +184,7 @@ namespace JSC { namespace DFG {
/* Allocations. */\
macro(NewObject, NodeResultJS) \
macro(NewArray, NodeResultJS | NodeHasVarArgs) \
+ macro(NewArrayWithSize, NodeResultJS) \
macro(NewArrayBuffer, NodeResultJS) \
macro(NewRegexp, NodeResultJS) \
\
diff --git a/Source/JavaScriptCore/dfg/DFGOperations.cpp b/Source/JavaScriptCore/dfg/DFGOperations.cpp
index b056a3c6d..11362f432 100644
--- a/Source/JavaScriptCore/dfg/DFGOperations.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOperations.cpp
@@ -1005,12 +1005,22 @@ EncodedJSValue DFG_OPERATION operationStrCat(ExecState* exec, void* buffer, size
return JSValue::encode(jsString(exec, static_cast<Register*>(buffer), size));
}
-EncodedJSValue DFG_OPERATION operationNewArray(ExecState* exec, void* buffer, size_t size)
+EncodedJSValue DFG_OPERATION operationNewArray(ExecState* exec, Structure* arrayStructure, void* buffer, size_t size)
{
JSGlobalData* globalData = &exec->globalData();
NativeCallFrameTracer tracer(globalData, exec);
- return JSValue::encode(constructArray(exec, static_cast<JSValue*>(buffer), size));
+ return JSValue::encode(constructArray(exec, arrayStructure, static_cast<JSValue*>(buffer), size));
+}
+
+EncodedJSValue DFG_OPERATION operationNewEmptyArray(ExecState* exec, Structure* arrayStructure)
+{
+ return JSValue::encode(JSArray::create(exec->globalData(), arrayStructure));
+}
+
+EncodedJSValue DFG_OPERATION operationNewArrayWithSize(ExecState* exec, Structure* arrayStructure, int32_t size)
+{
+ return JSValue::encode(JSArray::create(exec->globalData(), arrayStructure, size));
}
EncodedJSValue DFG_OPERATION operationNewArrayBuffer(ExecState* exec, size_t start, size_t size)
@@ -1238,12 +1248,12 @@ void DFG_OPERATION debugOperationPrintSpeculationFailure(ExecState* exec, void*
SpeculationFailureDebugInfo* debugInfo = static_cast<SpeculationFailureDebugInfo*>(debugInfoRaw);
CodeBlock* codeBlock = debugInfo->codeBlock;
CodeBlock* alternative = codeBlock->alternative();
- dataLog("Speculation failure in %p at @%u with executeCounter = %d, "
+ dataLog("Speculation failure in %p at @%u with executeCounter = %s, "
"reoptimizationRetryCounter = %u, optimizationDelayCounter = %u, "
"success/fail %u/(%u+%u)\n",
codeBlock,
debugInfo->nodeIndex,
- alternative ? alternative->jitExecuteCounter() : 0,
+ alternative ? alternative->jitExecuteCounter().status() : 0,
alternative ? alternative->reoptimizationRetryCounter() : 0,
alternative ? alternative->optimizationDelayCounter() : 0,
codeBlock->speculativeSuccessCounter(),
diff --git a/Source/JavaScriptCore/dfg/DFGOperations.h b/Source/JavaScriptCore/dfg/DFGOperations.h
index 7477ab2fc..3c85ee761 100644
--- a/Source/JavaScriptCore/dfg/DFGOperations.h
+++ b/Source/JavaScriptCore/dfg/DFGOperations.h
@@ -76,6 +76,9 @@ typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EP)(ExecState*, void*);
typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EPP)(ExecState*, void*, void*);
typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EPS)(ExecState*, void*, size_t);
typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_ESS)(ExecState*, size_t, size_t);
+typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_ESt)(ExecState*, Structure*);
+typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EStI)(ExecState*, Structure*, int32_t);
+typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EStPS)(ExecState*, Structure*, void*, size_t);
typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EZ)(ExecState*, int32_t);
typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EZIcfZ)(ExecState*, int32_t, InlineCallFrame*, int32_t);
typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EZZ)(ExecState*, int32_t, int32_t);
@@ -124,8 +127,10 @@ EncodedJSValue DFG_OPERATION operationResolveBaseStrictPut(ExecState*, Identifie
EncodedJSValue DFG_OPERATION operationResolveGlobal(ExecState*, GlobalResolveInfo*, JSGlobalObject*, Identifier*) WTF_INTERNAL;
EncodedJSValue DFG_OPERATION operationToPrimitive(ExecState*, EncodedJSValue) WTF_INTERNAL;
EncodedJSValue DFG_OPERATION operationStrCat(ExecState*, void*, size_t) WTF_INTERNAL;
-EncodedJSValue DFG_OPERATION operationNewArray(ExecState*, void*, size_t) WTF_INTERNAL;
+EncodedJSValue DFG_OPERATION operationNewArray(ExecState*, Structure*, void*, size_t) WTF_INTERNAL;
EncodedJSValue DFG_OPERATION operationNewArrayBuffer(ExecState*, size_t, size_t) WTF_INTERNAL;
+EncodedJSValue DFG_OPERATION operationNewEmptyArray(ExecState*, Structure*) WTF_INTERNAL;
+EncodedJSValue DFG_OPERATION operationNewArrayWithSize(ExecState*, Structure*, int32_t) WTF_INTERNAL;
EncodedJSValue DFG_OPERATION operationNewRegexp(ExecState*, void*) WTF_INTERNAL;
void DFG_OPERATION operationPutByValStrict(ExecState*, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue) WTF_INTERNAL;
void DFG_OPERATION operationPutByValNonStrict(ExecState*, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue) WTF_INTERNAL;
diff --git a/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp b/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
index bcb79a96a..0bd81ec44 100644
--- a/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
@@ -535,6 +535,12 @@ private:
break;
}
+ case NewArrayWithSize: {
+ changed |= setPrediction(SpecArray);
+ changed |= m_graph[node.child1()].mergeFlags(NodeUsedAsNumber | NodeUsedAsInt);
+ break;
+ }
+
case NewArrayBuffer: {
changed |= setPrediction(SpecArray);
break;
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
index d9a79f13a..0c0f3260f 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
@@ -986,13 +986,8 @@ void SpeculativeJIT::compile(BasicBlock& block)
m_jit.jitAssertHasValidCallFrame();
ASSERT(m_arguments.size() == block.variablesAtHead.numberOfArguments());
- for (size_t i = 0; i < m_arguments.size(); ++i) {
- NodeIndex nodeIndex = block.variablesAtHead.argument(i);
- if (nodeIndex == NoNode || m_jit.codeBlock()->argumentIsCaptured(i))
- m_arguments[i] = ValueSource(ValueInRegisterFile);
- else
- m_arguments[i] = ValueSource::forSpeculation(at(nodeIndex).variableAccessData()->prediction());
- }
+ for (size_t i = 0; i < m_arguments.size(); ++i)
+ m_arguments[i] = ValueSource(ValueInRegisterFile);
m_state.reset();
m_state.beginBasicBlock(&block);
@@ -2005,10 +2000,10 @@ void SpeculativeJIT::compileGetByValOnIntTypedArray(const TypedArrayDescriptor&
return;
}
- MacroAssembler::Jump inBounds = m_jit.branch32(MacroAssembler::Below, propertyReg, MacroAssembler::Address(baseReg, descriptor.m_lengthOffset));
- m_jit.xorPtr(resultReg, resultReg);
- MacroAssembler::Jump outOfBounds = m_jit.jump();
- inBounds.link(&m_jit);
+ speculationCheck(
+ Uncountable, JSValueRegs(), NoNode,
+ m_jit.branch32(
+ MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(baseReg, descriptor.m_lengthOffset)));
switch (elementSize) {
case 1:
if (signedness == SignedTypedArray)
@@ -2028,7 +2023,6 @@ void SpeculativeJIT::compileGetByValOnIntTypedArray(const TypedArrayDescriptor&
default:
ASSERT_NOT_REACHED();
}
- outOfBounds.link(&m_jit);
if (elementSize < 4 || signedness == SignedTypedArray) {
integerResult(resultReg, m_compileIndex);
return;
@@ -2167,11 +2161,10 @@ void SpeculativeJIT::compileGetByValOnFloatTypedArray(const TypedArrayDescriptor
FPRTemporary result(this);
FPRReg resultReg = result.fpr();
ASSERT(speculationRequirements != NoTypedArraySpecCheck);
- MacroAssembler::Jump inBounds = m_jit.branch32(MacroAssembler::Below, propertyReg, MacroAssembler::Address(baseReg, descriptor.m_lengthOffset));
- static const double zero = 0;
- m_jit.loadDouble(&zero, resultReg);
- MacroAssembler::Jump outOfBounds = m_jit.jump();
- inBounds.link(&m_jit);
+ speculationCheck(
+ Uncountable, JSValueRegs(), NoNode,
+ m_jit.branch32(
+ MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(baseReg, descriptor.m_lengthOffset)));
switch (elementSize) {
case 4:
m_jit.loadFloat(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesFour), resultReg);
@@ -2188,7 +2181,6 @@ void SpeculativeJIT::compileGetByValOnFloatTypedArray(const TypedArrayDescriptor
default:
ASSERT_NOT_REACHED();
}
- outOfBounds.link(&m_jit);
doubleResult(resultReg, m_compileIndex);
}
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
index 6c6948b90..67a22b767 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
@@ -1244,6 +1244,21 @@ public:
m_jit.setupArgumentsWithExecState(arg1);
return appendCallWithExceptionCheckSetResult(operation, result);
}
+ JITCompiler::Call callOperation(J_DFGOperation_ESt operation, GPRReg result, Structure* structure)
+ {
+ m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure));
+ return appendCallWithExceptionCheckSetResult(operation, result);
+ }
+ JITCompiler::Call callOperation(J_DFGOperation_EStI operation, GPRReg result, Structure* structure, GPRReg arg2)
+ {
+ m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), arg2);
+ return appendCallWithExceptionCheckSetResult(operation, result);
+ }
+ JITCompiler::Call callOperation(J_DFGOperation_EStPS operation, GPRReg result, Structure* structure, void* pointer, size_t size)
+ {
+ m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), TrustedImmPtr(pointer), TrustedImmPtr(size));
+ return appendCallWithExceptionCheckSetResult(operation, result);
+ }
JITCompiler::Call callOperation(J_DFGOperation_EPS operation, GPRReg result, void* pointer, size_t size)
{
m_jit.setupArgumentsWithExecState(TrustedImmPtr(pointer), TrustedImmPtr(size));
@@ -1502,6 +1517,21 @@ public:
m_jit.setupArgumentsWithExecState(arg1);
return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag);
}
+ JITCompiler::Call callOperation(J_DFGOperation_ESt operation, GPRReg resultTag, GPRReg resultPayload, Structure* structure)
+ {
+ m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure));
+ return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag);
+ }
+ JITCompiler::Call callOperation(J_DFGOperation_EStI operation, GPRReg resultTag, GPRReg resultPayload, Structure* structure, GPRReg arg2)
+ {
+ m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), arg2);
+ return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag);
+ }
+ JITCompiler::Call callOperation(J_DFGOperation_EStPS operation, GPRReg resultTag, GPRReg resultPayload, Structure* structure, void* pointer, size_t size)
+ {
+ m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), TrustedImmPtr(pointer), TrustedImmPtr(size));
+ return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag);
+ }
JITCompiler::Call callOperation(J_DFGOperation_EPS operation, GPRReg resultTag, GPRReg resultPayload, void* pointer, size_t size)
{
m_jit.setupArgumentsWithExecState(TrustedImmPtr(pointer), TrustedImmPtr(size));
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
index 21d94e9e8..05609baa8 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
@@ -1891,7 +1891,7 @@ void SpeculativeJIT::compile(Node& node)
break;
}
- if (isInt32Speculation(prediction)) {
+ if (isInt32Speculation(value.m_type)) {
GPRTemporary result(this);
m_jit.load32(JITCompiler::payloadFor(node.local()), result.gpr());
@@ -1903,7 +1903,7 @@ void SpeculativeJIT::compile(Node& node)
break;
}
- if (isArraySpeculation(prediction)) {
+ if (isArraySpeculation(value.m_type)) {
GPRTemporary result(this);
m_jit.load32(JITCompiler::payloadFor(node.local()), result.gpr());
@@ -1915,7 +1915,7 @@ void SpeculativeJIT::compile(Node& node)
break;
}
- if (isBooleanSpeculation(prediction)) {
+ if (isBooleanSpeculation(value.m_type)) {
GPRTemporary result(this);
m_jit.load32(JITCompiler::payloadFor(node.local()), result.gpr());
@@ -2975,25 +2975,60 @@ void SpeculativeJIT::compile(Node& node)
break;
}
- case StrCat:
- case NewArray: {
- // We really don't want to grow the register file just to do a StrCat or NewArray.
- // Say we have 50 functions on the stack that all have a StrCat in them that has
- // upwards of 10 operands. In the DFG this would mean that each one gets
- // some random virtual register, and then to do the StrCat we'd need a second
- // span of 10 operands just to have somewhere to copy the 10 operands to, where
- // they'd be contiguous and we could easily tell the C code how to find them.
- // Ugly! So instead we use the scratchBuffer infrastructure in JSGlobalData. That
- // way, those 50 functions will share the same scratchBuffer for offloading their
- // StrCat operands. It's about as good as we can do, unless we start doing
- // virtual register coalescing to ensure that operands to StrCat get spilled
- // in exactly the place where StrCat wants them, or else have the StrCat
- // refer to those operands' SetLocal instructions to force them to spill in
- // the right place. Basically, any way you cut it, the current approach
- // probably has the best balance of performance and sensibility in the sense
- // that it does not increase the complexity of the DFG JIT just to make StrCat
- // fast and pretty.
+ case StrCat: {
+ size_t scratchSize = sizeof(EncodedJSValue) * node.numChildren();
+ ScratchBuffer* scratchBuffer = m_jit.globalData()->scratchBufferForSize(scratchSize);
+ EncodedJSValue* buffer = scratchBuffer ? static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer()) : 0;
+
+ for (unsigned operandIdx = 0; operandIdx < node.numChildren(); ++operandIdx) {
+ JSValueOperand operand(this, m_jit.graph().m_varArgChildren[node.firstChild() + operandIdx]);
+ GPRReg opTagGPR = operand.tagGPR();
+ GPRReg opPayloadGPR = operand.payloadGPR();
+ operand.use();
+
+ m_jit.store32(opTagGPR, reinterpret_cast<char*>(buffer + operandIdx) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag));
+ m_jit.store32(opPayloadGPR, reinterpret_cast<char*>(buffer + operandIdx) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload));
+ }
+
+ flushRegisters();
+ if (scratchSize) {
+ GPRTemporary scratch(this);
+
+ // Tell GC mark phase how much of the scratch buffer is active during call.
+ m_jit.move(TrustedImmPtr(scratchBuffer->activeLengthPtr()), scratch.gpr());
+ m_jit.storePtr(TrustedImmPtr(scratchSize), scratch.gpr());
+ }
+
+ GPRResult resultPayload(this);
+ GPRResult2 resultTag(this);
+
+ callOperation(operationStrCat, resultTag.gpr(), resultPayload.gpr(), static_cast<void *>(buffer), node.numChildren());
+
+ if (scratchSize) {
+ GPRTemporary scratch(this);
+
+ m_jit.move(TrustedImmPtr(scratchBuffer->activeLengthPtr()), scratch.gpr());
+ m_jit.storePtr(TrustedImmPtr(0), scratch.gpr());
+ }
+
+ // FIXME: make the callOperation above explicitly return a cell result, or jitAssert the tag is a cell tag.
+ cellResult(resultPayload.gpr(), m_compileIndex, UseChildrenCalledExplicitly);
+ break;
+ }
+
+ case NewArray: {
+ if (!node.numChildren()) {
+ flushRegisters();
+ GPRResult result(this);
+ GPRResult2 resultTagIgnored(this);
+ callOperation(
+ operationNewEmptyArray, resultTagIgnored.gpr(), result.gpr(),
+ m_jit.graph().globalObjectFor(node.codeOrigin)->arrayStructure());
+ cellResult(result.gpr(), m_compileIndex);
+ break;
+ }
+
size_t scratchSize = sizeof(EncodedJSValue) * node.numChildren();
ScratchBuffer* scratchBuffer = m_jit.globalData()->scratchBufferForSize(scratchSize);
EncodedJSValue* buffer = scratchBuffer ? static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer()) : 0;
@@ -3021,7 +3056,10 @@ void SpeculativeJIT::compile(Node& node)
GPRResult resultPayload(this);
GPRResult2 resultTag(this);
- callOperation(op == StrCat ? operationStrCat : operationNewArray, resultTag.gpr(), resultPayload.gpr(), static_cast<void *>(buffer), node.numChildren());
+ callOperation(
+ operationNewArray, resultTag.gpr(), resultPayload.gpr(),
+ m_jit.graph().globalObjectFor(node.codeOrigin)->arrayStructure(),
+ static_cast<void *>(buffer), node.numChildren());
if (scratchSize) {
GPRTemporary scratch(this);
@@ -3035,6 +3073,19 @@ void SpeculativeJIT::compile(Node& node)
break;
}
+ case NewArrayWithSize: {
+ SpeculateStrictInt32Operand size(this, node.child1());
+ GPRReg sizeGPR = size.gpr();
+ flushRegisters();
+ GPRResult result(this);
+ GPRResult2 resultTagIgnored(this);
+ callOperation(
+ operationNewArrayWithSize, resultTagIgnored.gpr(), result.gpr(),
+ m_jit.graph().globalObjectFor(node.codeOrigin)->arrayStructure(), sizeGPR);
+ cellResult(result.gpr(), m_compileIndex);
+ break;
+ }
+
case NewArrayBuffer: {
flushRegisters();
GPRResult resultPayload(this);
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
index a6c283584..215f8013d 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
@@ -3035,25 +3035,68 @@ void SpeculativeJIT::compile(Node& node)
break;
}
- case StrCat:
case NewArray: {
- // We really don't want to grow the register file just to do a StrCat or NewArray.
- // Say we have 50 functions on the stack that all have a StrCat in them that has
- // upwards of 10 operands. In the DFG this would mean that each one gets
- // some random virtual register, and then to do the StrCat we'd need a second
- // span of 10 operands just to have somewhere to copy the 10 operands to, where
- // they'd be contiguous and we could easily tell the C code how to find them.
- // Ugly! So instead we use the scratchBuffer infrastructure in JSGlobalData. That
- // way, those 50 functions will share the same scratchBuffer for offloading their
- // StrCat operands. It's about as good as we can do, unless we start doing
- // virtual register coalescing to ensure that operands to StrCat get spilled
- // in exactly the place where StrCat wants them, or else have the StrCat
- // refer to those operands' SetLocal instructions to force them to spill in
- // the right place. Basically, any way you cut it, the current approach
- // probably has the best balance of performance and sensibility in the sense
- // that it does not increase the complexity of the DFG JIT just to make StrCat
- // fast and pretty.
+ if (!node.numChildren()) {
+ flushRegisters();
+ GPRResult result(this);
+ callOperation(
+ operationNewEmptyArray, result.gpr(),
+ m_jit.graph().globalObjectFor(node.codeOrigin)->arrayStructure());
+ cellResult(result.gpr(), m_compileIndex);
+ break;
+ }
+
+ size_t scratchSize = sizeof(EncodedJSValue) * node.numChildren();
+ ScratchBuffer* scratchBuffer = m_jit.globalData()->scratchBufferForSize(scratchSize);
+ EncodedJSValue* buffer = scratchBuffer ? static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer()) : 0;
+
+ for (unsigned operandIdx = 0; operandIdx < node.numChildren(); ++operandIdx) {
+ JSValueOperand operand(this, m_jit.graph().m_varArgChildren[node.firstChild() + operandIdx]);
+ GPRReg opGPR = operand.gpr();
+ operand.use();
+
+ m_jit.storePtr(opGPR, buffer + operandIdx);
+ }
+
+ flushRegisters();
+
+ if (scratchSize) {
+ GPRTemporary scratch(this);
+ // Tell GC mark phase how much of the scratch buffer is active during call.
+ m_jit.move(TrustedImmPtr(scratchBuffer->activeLengthPtr()), scratch.gpr());
+ m_jit.storePtr(TrustedImmPtr(scratchSize), scratch.gpr());
+ }
+
+ GPRResult result(this);
+
+ callOperation(
+ operationNewArray, result.gpr(),
+ m_jit.graph().globalObjectFor(node.codeOrigin)->arrayStructure(),
+ static_cast<void*>(buffer), node.numChildren());
+
+ if (scratchSize) {
+ GPRTemporary scratch(this);
+
+ m_jit.move(TrustedImmPtr(scratchBuffer->activeLengthPtr()), scratch.gpr());
+ m_jit.storePtr(TrustedImmPtr(0), scratch.gpr());
+ }
+
+ cellResult(result.gpr(), m_compileIndex, UseChildrenCalledExplicitly);
+ break;
+ }
+
+ case NewArrayWithSize: {
+ SpeculateStrictInt32Operand size(this, node.child1());
+ GPRReg sizeGPR = size.gpr();
+ flushRegisters();
+ GPRResult result(this);
+ callOperation(operationNewArrayWithSize, result.gpr(), m_jit.graph().globalObjectFor(node.codeOrigin)->arrayStructure(), sizeGPR);
+ cellResult(result.gpr(), m_compileIndex);
+ break;
+ }
+
+ case StrCat: {
size_t scratchSize = sizeof(EncodedJSValue) * node.numChildren();
ScratchBuffer* scratchBuffer = m_jit.globalData()->scratchBufferForSize(scratchSize);
EncodedJSValue* buffer = scratchBuffer ? static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer()) : 0;
@@ -3078,7 +3121,7 @@ void SpeculativeJIT::compile(Node& node)
GPRResult result(this);
- callOperation(op == StrCat ? operationStrCat : operationNewArray, result.gpr(), static_cast<void *>(buffer), node.numChildren());
+ callOperation(operationStrCat, result.gpr(), static_cast<void *>(buffer), node.numChildren());
if (scratchSize) {
GPRTemporary scratch(this);
diff --git a/Source/JavaScriptCore/heap/IncrementalSweeper.cpp b/Source/JavaScriptCore/heap/IncrementalSweeper.cpp
index 165bfeaff..848377346 100644
--- a/Source/JavaScriptCore/heap/IncrementalSweeper.cpp
+++ b/Source/JavaScriptCore/heap/IncrementalSweeper.cpp
@@ -78,6 +78,7 @@ void IncrementalSweeper::doSweep(double sweepBeginTime)
continue;
block->sweep();
+ m_globalData->heap.objectSpace().freeOrShrinkBlock(block);
CFTimeInterval elapsedTime = WTF::monotonicallyIncreasingTime() - sweepBeginTime;
if (elapsedTime < sweepTimeSlice)
diff --git a/Source/JavaScriptCore/heap/MachineStackMarker.cpp b/Source/JavaScriptCore/heap/MachineStackMarker.cpp
index 8e0c57b6a..7eb57479b 100644
--- a/Source/JavaScriptCore/heap/MachineStackMarker.cpp
+++ b/Source/JavaScriptCore/heap/MachineStackMarker.cpp
@@ -141,8 +141,10 @@ MachineThreads::MachineThreads(Heap* heap)
MachineThreads::~MachineThreads()
{
- if (m_threadSpecific)
- ThreadSpecificKeyDelete(m_threadSpecific);
+ if (m_threadSpecific) {
+ int error = pthread_key_delete(m_threadSpecific);
+ ASSERT_UNUSED(error, !error);
+ }
MutexLocker registeredThreadsLock(m_registeredThreadsMutex);
for (Thread* t = m_registeredThreads; t;) {
@@ -179,17 +181,19 @@ void MachineThreads::makeUsableFromMultipleThreads()
if (m_threadSpecific)
return;
- ThreadSpecificKeyCreate(&m_threadSpecific, removeThread);
+ int error = pthread_key_create(&m_threadSpecific, removeThread);
+ if (error)
+ CRASH();
}
void MachineThreads::addCurrentThread()
{
ASSERT(!m_heap->globalData()->exclusiveThread || m_heap->globalData()->exclusiveThread == currentThread());
- if (!m_threadSpecific || ThreadSpecificGet(m_threadSpecific))
+ if (!m_threadSpecific || pthread_getspecific(m_threadSpecific))
return;
- ThreadSpecificSet(m_threadSpecific, this);
+ pthread_setspecific(m_threadSpecific, this);
Thread* thread = new Thread(getCurrentPlatformThread(), wtfThreadData().stack().origin());
MutexLocker lock(m_registeredThreadsMutex);
diff --git a/Source/JavaScriptCore/heap/MachineStackMarker.h b/Source/JavaScriptCore/heap/MachineStackMarker.h
index 2209f97e9..0f5a4c3aa 100644
--- a/Source/JavaScriptCore/heap/MachineStackMarker.h
+++ b/Source/JavaScriptCore/heap/MachineStackMarker.h
@@ -22,8 +22,8 @@
#ifndef MachineThreads_h
#define MachineThreads_h
+#include <pthread.h>
#include <wtf/Noncopyable.h>
-#include <wtf/ThreadSpecific.h>
#include <wtf/ThreadingPrimitives.h>
namespace JSC {
@@ -55,7 +55,7 @@ namespace JSC {
Heap* m_heap;
Mutex m_registeredThreadsMutex;
Thread* m_registeredThreads;
- WTF::ThreadSpecificKey m_threadSpecific;
+ pthread_key_t m_threadSpecific;
};
} // namespace JSC
diff --git a/Source/JavaScriptCore/heap/MarkedBlock.h b/Source/JavaScriptCore/heap/MarkedBlock.h
index eb1cb681b..c3c43752b 100644
--- a/Source/JavaScriptCore/heap/MarkedBlock.h
+++ b/Source/JavaScriptCore/heap/MarkedBlock.h
@@ -408,7 +408,7 @@ namespace JSC {
inline bool MarkedBlock::needsSweeping()
{
- return m_state == Marked;
+ return m_state == Marked || m_state == Zapped;
}
#if ENABLE(GGC)
diff --git a/Source/JavaScriptCore/jit/JITStubs.cpp b/Source/JavaScriptCore/jit/JITStubs.cpp
index b0ff4a0c7..6b8082886 100644
--- a/Source/JavaScriptCore/jit/JITStubs.cpp
+++ b/Source/JavaScriptCore/jit/JITStubs.cpp
@@ -1928,11 +1928,13 @@ DEFINE_STUB_FUNCTION(void, optimize)
unsigned bytecodeIndex = stackFrame.args[0].int32();
#if ENABLE(JIT_VERBOSE_OSR)
- dataLog("%p: Entered optimize with bytecodeIndex = %u, executeCounter = %d, reoptimizationRetryCounter = %u, optimizationDelayCounter = %u\n", codeBlock, bytecodeIndex, codeBlock->jitExecuteCounter(), codeBlock->reoptimizationRetryCounter(), codeBlock->optimizationDelayCounter());
+ dataLog("%p: Entered optimize with bytecodeIndex = %u, executeCounter = %s, reoptimizationRetryCounter = %u, optimizationDelayCounter = %u\n", codeBlock, bytecodeIndex, codeBlock->jitExecuteCounter().status(), codeBlock->reoptimizationRetryCounter(), codeBlock->optimizationDelayCounter());
#endif
- if (!codeBlock->checkIfOptimizationThresholdReached())
+ if (!codeBlock->checkIfOptimizationThresholdReached()) {
+ codeBlock->updateAllPredictions();
return;
+ }
if (codeBlock->hasOptimizedReplacement()) {
#if ENABLE(JIT_VERBOSE_OSR)
diff --git a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
index ca3eb1eb0..a7698be37 100644
--- a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
+++ b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
@@ -264,6 +264,8 @@ inline bool shouldJIT(ExecState* exec)
// Returns true if we should try to OSR.
inline bool jitCompileAndSetHeuristics(CodeBlock* codeBlock, ExecState* exec)
{
+ codeBlock->updateAllPredictions();
+
if (!codeBlock->checkIfJITThresholdReached()) {
#if ENABLE(JIT_VERBOSE_OSR)
dataLog(" JIT threshold should be lifted.\n");
@@ -300,7 +302,8 @@ enum EntryKind { Prologue, ArityCheck };
static SlowPathReturnType entryOSR(ExecState* exec, Instruction* pc, CodeBlock* codeBlock, const char *name, EntryKind kind)
{
#if ENABLE(JIT_VERBOSE_OSR)
- dataLog("%p: Entered %s with executeCounter = %d\n", codeBlock, name, codeBlock->llintExecuteCounter());
+ dataLog("%p: Entered %s with executeCounter = %s\n", codeBlock, name,
+ codeBlock->llintExecuteCounter().status());
#endif
if (!shouldJIT(exec)) {
@@ -346,7 +349,8 @@ LLINT_SLOW_PATH_DECL(loop_osr)
CodeBlock* codeBlock = exec->codeBlock();
#if ENABLE(JIT_VERBOSE_OSR)
- dataLog("%p: Entered loop_osr with executeCounter = %d\n", codeBlock, codeBlock->llintExecuteCounter());
+ dataLog("%p: Entered loop_osr with executeCounter = %s\n", codeBlock,
+ codeBlock->llintExecuteCounter().status());
#endif
if (!shouldJIT(exec)) {
@@ -376,7 +380,8 @@ LLINT_SLOW_PATH_DECL(replace)
CodeBlock* codeBlock = exec->codeBlock();
#if ENABLE(JIT_VERBOSE_OSR)
- dataLog("%p: Entered replace with executeCounter = %d\n", codeBlock, codeBlock->llintExecuteCounter());
+ dataLog("%p: Entered replace with executeCounter = %s\n", codeBlock,
+ codeBlock->llintExecuteCounter().status());
#endif
if (shouldJIT(exec))
diff --git a/Source/JavaScriptCore/runtime/GCActivityCallback.cpp b/Source/JavaScriptCore/runtime/GCActivityCallback.cpp
index 794d1545e..c2fca8c01 100644
--- a/Source/JavaScriptCore/runtime/GCActivityCallback.cpp
+++ b/Source/JavaScriptCore/runtime/GCActivityCallback.cpp
@@ -75,7 +75,7 @@ void DefaultGCActivityCallback::doWork()
return;
}
#endif
- heap->collectAllGarbage();
+ heap->collect(Heap::DoNotSweep);
}
void DefaultGCActivityCallback::scheduleTimer(double newDelay)
diff --git a/Source/JavaScriptCore/runtime/JSArray.h b/Source/JavaScriptCore/runtime/JSArray.h
index c1a3a632b..52c591324 100644
--- a/Source/JavaScriptCore/runtime/JSArray.h
+++ b/Source/JavaScriptCore/runtime/JSArray.h
@@ -380,7 +380,42 @@ namespace JSC {
return size;
}
+
+ inline JSArray* constructArray(ExecState* exec, Structure* arrayStructure, const ArgList& values)
+ {
+ JSGlobalData& globalData = exec->globalData();
+ unsigned length = values.size();
+ JSArray* array = JSArray::tryCreateUninitialized(globalData, arrayStructure, length);
+
+ // FIXME: we should probably throw an out of memory error here, but
+ // when making this change we should check that all clients of this
+ // function will correctly handle an exception being thrown from here.
+ if (!array)
+ CRASH();
+
+ for (unsigned i = 0; i < length; ++i)
+ array->initializeIndex(globalData, i, values.at(i));
+ array->completeInitialization(length);
+ return array;
+ }
- } // namespace JSC
+ inline JSArray* constructArray(ExecState* exec, Structure* arrayStructure, const JSValue* values, unsigned length)
+ {
+ JSGlobalData& globalData = exec->globalData();
+ JSArray* array = JSArray::tryCreateUninitialized(globalData, arrayStructure, length);
+
+ // FIXME: we should probably throw an out of memory error here, but
+ // when making this change we should check that all clients of this
+ // function will correctly handle an exception being thrown from here.
+ if (!array)
+ CRASH();
+
+ for (unsigned i = 0; i < length; ++i)
+ array->initializeIndex(globalData, i, values[i]);
+ array->completeInitialization(length);
+ return array;
+ }
+
+} // namespace JSC
#endif // JSArray_h
diff --git a/Source/JavaScriptCore/runtime/JSExportMacros.h b/Source/JavaScriptCore/runtime/JSExportMacros.h
index 19e2c286f..884805f86 100644
--- a/Source/JavaScriptCore/runtime/JSExportMacros.h
+++ b/Source/JavaScriptCore/runtime/JSExportMacros.h
@@ -36,7 +36,7 @@
// See note in wtf/Platform.h for more info on EXPORT_MACROS.
#if USE(EXPORT_MACROS)
-#if defined(BUILDING_JavaScriptCore) || defined(STATICALLY_LINKED_WITH_JavaScriptCore)
+#if defined(BUILDING_JavaScriptCore)
#define JS_EXPORT_PRIVATE WTF_EXPORT
#else
#define JS_EXPORT_PRIVATE WTF_IMPORT
@@ -50,7 +50,7 @@
#if !PLATFORM(CHROMIUM) && OS(WINDOWS) && !defined(BUILDING_WX__) && !COMPILER(GCC)
-#if defined(BUILDING_JavaScriptCore) || defined(STATICALLY_LINKED_WITH_JavaScriptCore)
+#if defined(BUILDING_JavaScriptCore)
#define JS_EXPORTDATA __declspec(dllexport)
#else
#define JS_EXPORTDATA __declspec(dllimport)
diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
index d38570dfb..d19db4fd8 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
@@ -112,6 +112,15 @@ template <typename T> static inline void visitIfNeeded(SlotVisitor& visitor, Wri
visitor.append(v);
}
+JSGlobalObject::JSGlobalObject(JSGlobalData& globalData, Structure* structure, const GlobalObjectMethodTable* globalObjectMethodTable)
+ : JSSegmentedVariableObject(globalData, structure, &m_symbolTable)
+ , m_globalScopeChain()
+ , m_weakRandom(Options::forceWeakRandomSeed ? Options::forcedWeakRandomSeed : static_cast<unsigned>(randomNumber() * (std::numeric_limits<unsigned>::max() + 1.0)))
+ , m_evalEnabled(true)
+ , m_globalObjectMethodTable(globalObjectMethodTable ? globalObjectMethodTable : &s_globalObjectMethodTable)
+{
+}
+
JSGlobalObject::~JSGlobalObject()
{
ASSERT(JSLock::currentThreadIsHoldingLock());
diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.h b/Source/JavaScriptCore/runtime/JSGlobalObject.h
index 2396142b1..1dcfc63cc 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalObject.h
+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.h
@@ -175,14 +175,7 @@ namespace JSC {
static JS_EXPORTDATA const ClassInfo s_info;
protected:
- explicit JSGlobalObject(JSGlobalData& globalData, Structure* structure, const GlobalObjectMethodTable* globalObjectMethodTable = 0)
- : JSSegmentedVariableObject(globalData, structure, &m_symbolTable)
- , m_globalScopeChain()
- , m_weakRandom(static_cast<unsigned>(randomNumber() * (std::numeric_limits<unsigned>::max() + 1.0)))
- , m_evalEnabled(true)
- , m_globalObjectMethodTable(globalObjectMethodTable ? globalObjectMethodTable : &s_globalObjectMethodTable)
- {
- }
+ JS_EXPORT_PRIVATE explicit JSGlobalObject(JSGlobalData&, Structure*, const GlobalObjectMethodTable* = 0);
void finishCreation(JSGlobalData& globalData)
{
@@ -328,6 +321,7 @@ namespace JSC {
}
double weakRandomNumber() { return m_weakRandom.get(); }
+ unsigned weakRandomInteger() { return m_weakRandom.getUint32(); }
protected:
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | OverridesGetPropertyNames | JSSegmentedVariableObject::StructureFlags;
@@ -451,23 +445,10 @@ namespace JSC {
{
return constructEmptyArray(exec, exec->lexicalGlobalObject(), initialLength);
}
-
+
inline JSArray* constructArray(ExecState* exec, JSGlobalObject* globalObject, const ArgList& values)
{
- JSGlobalData& globalData = exec->globalData();
- unsigned length = values.size();
- JSArray* array = JSArray::tryCreateUninitialized(globalData, globalObject->arrayStructure(), length);
-
- // FIXME: we should probably throw an out of memory error here, but
- // when making this change we should check that all clients of this
- // function will correctly handle an exception being thrown from here.
- if (!array)
- CRASH();
-
- for (unsigned i = 0; i < length; ++i)
- array->initializeIndex(globalData, i, values.at(i));
- array->completeInitialization(length);
- return array;
+ return constructArray(exec, globalObject->arrayStructure(), values);
}
inline JSArray* constructArray(ExecState* exec, const ArgList& values)
@@ -477,19 +458,7 @@ namespace JSC {
inline JSArray* constructArray(ExecState* exec, JSGlobalObject* globalObject, const JSValue* values, unsigned length)
{
- JSGlobalData& globalData = exec->globalData();
- JSArray* array = JSArray::tryCreateUninitialized(globalData, globalObject->arrayStructure(), length);
-
- // FIXME: we should probably throw an out of memory error here, but
- // when making this change we should check that all clients of this
- // function will correctly handle an exception being thrown from here.
- if (!array)
- CRASH();
-
- for (unsigned i = 0; i < length; ++i)
- array->initializeIndex(globalData, i, values[i]);
- array->completeInitialization(length);
- return array;
+ return constructArray(exec, globalObject->arrayStructure(), values, length);
}
inline JSArray* constructArray(ExecState* exec, const JSValue* values, unsigned length)
diff --git a/Source/JavaScriptCore/runtime/MemoryStatistics.cpp b/Source/JavaScriptCore/runtime/MemoryStatistics.cpp
index 86101f559..14b1c7d06 100644
--- a/Source/JavaScriptCore/runtime/MemoryStatistics.cpp
+++ b/Source/JavaScriptCore/runtime/MemoryStatistics.cpp
@@ -37,7 +37,7 @@ GlobalMemoryStatistics globalMemoryStatistics()
GlobalMemoryStatistics stats;
stats.stackBytes = RegisterFile::committedByteCount();
-#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED)
+#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED) || (PLATFORM(BLACKBERRY) && ENABLE(JIT))
stats.JITBytes = ExecutableAllocator::committedByteCount();
#else
stats.JITBytes = 0;
diff --git a/Source/JavaScriptCore/runtime/Options.cpp b/Source/JavaScriptCore/runtime/Options.cpp
index 7b6da6536..894ca8cc0 100644
--- a/Source/JavaScriptCore/runtime/Options.cpp
+++ b/Source/JavaScriptCore/runtime/Options.cpp
@@ -67,6 +67,9 @@ int32_t thresholdForOptimizeSoon;
int32_t executionCounterIncrementForLoop;
int32_t executionCounterIncrementForReturn;
+bool randomizeExecutionCountsBetweenCheckpoints;
+int32_t maximumExecutionCountsBetweenCheckpoints;
+
unsigned desiredSpeculativeSuccessFailRatio;
double likelyToTakeSlowCaseThreshold;
@@ -95,6 +98,9 @@ unsigned gcMarkStackSegmentSize;
unsigned numberOfGCMarkers;
unsigned opaqueRootMergeThreshold;
+bool forceWeakRandomSeed;
+unsigned forcedWeakRandomSeed;
+
#if ENABLE(RUN_TIME_HEURISTICS)
static bool parse(const char* string, bool& value)
{
@@ -184,6 +190,9 @@ void initializeOptions()
SET(executionCounterIncrementForLoop, 1);
SET(executionCounterIncrementForReturn, 15);
+
+ SET(randomizeExecutionCountsBetweenCheckpoints, false);
+ SET(maximumExecutionCountsBetweenCheckpoints, 1000);
SET(desiredSpeculativeSuccessFailRatio, 6);
@@ -227,6 +236,9 @@ void initializeOptions()
ASSERT((static_cast<int64_t>(thresholdForOptimizeAfterLongWarmUp) << reoptimizationRetryCounterMax) > 0);
ASSERT((static_cast<int64_t>(thresholdForOptimizeAfterLongWarmUp) << reoptimizationRetryCounterMax) <= static_cast<int64_t>(std::numeric_limits<int32_t>::max()));
+
+ SET(forceWeakRandomSeed, false);
+ SET(forcedWeakRandomSeed, 0);
}
} } // namespace JSC::Options
diff --git a/Source/JavaScriptCore/runtime/Options.h b/Source/JavaScriptCore/runtime/Options.h
index 0adb59e9b..1bce5b944 100644
--- a/Source/JavaScriptCore/runtime/Options.h
+++ b/Source/JavaScriptCore/runtime/Options.h
@@ -53,6 +53,9 @@ extern int32_t thresholdForOptimizeNextInvocation;
extern int32_t executionCounterIncrementForLoop;
extern int32_t executionCounterIncrementForReturn;
+extern bool randomizeExecutionCountsBetweenCheckpoints;
+extern int32_t maximumExecutionCountsBetweenCheckpoints;
+
extern unsigned desiredSpeculativeSuccessFailRatio;
extern double likelyToTakeSlowCaseThreshold;
@@ -81,6 +84,9 @@ extern unsigned gcMarkStackSegmentSize;
JS_EXPORTDATA extern unsigned numberOfGCMarkers;
JS_EXPORTDATA extern unsigned opaqueRootMergeThreshold;
+extern bool forceWeakRandomSeed;
+extern unsigned forcedWeakRandomSeed;
+
void initializeOptions();
} } // namespace JSC::Options
diff --git a/Source/JavaScriptCore/runtime/WeakRandom.h b/Source/JavaScriptCore/runtime/WeakRandom.h
index 6083980d2..3cd1016d3 100644
--- a/Source/JavaScriptCore/runtime/WeakRandom.h
+++ b/Source/JavaScriptCore/runtime/WeakRandom.h
@@ -62,6 +62,9 @@ public:
, m_high(seed)
{
}
+
+ // Returns the seed provided that you've never called get() or getUint32().
+ unsigned seedUnsafe() const { return m_high; }
double get()
{
diff --git a/Source/JavaScriptCore/wscript b/Source/JavaScriptCore/wscript
index 58696d9c5..4afb4d26a 100644
--- a/Source/JavaScriptCore/wscript
+++ b/Source/JavaScriptCore/wscript
@@ -66,7 +66,7 @@ def build(bld):
features = 'cc cxx cshlib',
includes = '. .. assembler ../WTF ' + ' '.join(includes),
source = sources,
- defines = ['BUILDING_JavaScriptCore', 'STATICALLY_LINKED_WITH_WTF'],
+ defines = ['BUILDING_JavaScriptCore'],
target = 'jscore',
uselib = 'WX ICU ' + get_config(),
uselib_local = '',
diff --git a/Source/Platform/ChangeLog b/Source/Platform/ChangeLog
index 8ecf10b3e..4c2dcd40f 100644
--- a/Source/Platform/ChangeLog
+++ b/Source/Platform/ChangeLog
@@ -1,3 +1,94 @@
+2012-06-26 James Robinson <jamesr@chromium.org>
+
+ [chromium] Remove WebView::graphicsContext3D getter
+ https://bugs.webkit.org/show_bug.cgi?id=89916
+
+ Reviewed by Adrienne Walker.
+
+ Remove unused getter.
+
+ * chromium/public/WebLayerTreeView.h:
+ (WebLayerTreeView):
+
+2012-06-26 Dave Tu <dtu@chromium.org>
+
+ [chromium] Expose rendering statistics to WebWidget.
+ https://bugs.webkit.org/show_bug.cgi?id=88268
+
+ Reviewed by James Robinson.
+
+ The WebKit side of a basic framework for exposing rendering statistics
+ to Chromium's --enable-benchmarking extension.
+
+ * chromium/public/WebLayerTreeView.h:
+ (WebRenderingStatistics):
+ (WebKit):
+ (WebLayerTreeView):
+
+2012-06-25 James Robinson <jamesr@chromium.org>
+
+ [chromium] Add WebLayer API for scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=89913
+
+ Reviewed by Adrienne Walker.
+
+ Adds WebScrollableLayer type to represent a layer that can be scrolled by the user. Currently WebContentLayers
+ are scrollable and no other layer types are, although this might change in the future.
+
+ * chromium/public/WebContentLayer.h:
+ (WebKit::WebContentLayer::WebContentLayer):
+ * chromium/public/WebLayer.h:
+ (WebLayer):
+ * chromium/public/WebScrollableLayer.h:
+ (WebKit):
+ (WebScrollableLayer):
+ (WebKit::WebScrollableLayer::WebScrollableLayer):
+ (WebKit::WebScrollableLayer::~WebScrollableLayer):
+ (WebKit::WebScrollableLayer::operator=):
+
+2012-06-25 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r121176.
+ http://trac.webkit.org/changeset/121176
+ https://bugs.webkit.org/show_bug.cgi?id=89934
+
+ [chromium] browser_tests assert failed:
+ FATAL:native_theme_win.cc(1541)] Check failed: false. Invalid
+ part: 16 (Requested by ukai on #webkit).
+
+ * chromium/public/win/WebThemeEngine.h:
+ (WebKit::WebThemeEngine::paintProgressBar):
+
+2012-06-25 James Robinson <jamesr@chromium.org>
+
+ [chromium] Use WebGraphicsContext3D in compositor implementation
+ https://bugs.webkit.org/show_bug.cgi?id=89700
+
+ Reviewed by Adrienne Walker.
+
+ Puts all callback destructors in protected section and removes obsolete memory callback signature.
+
+ * chromium/public/WebGraphicsContext3D.h:
+ (WebGraphicsContextLostCallback):
+ (WebGraphicsErrorMessageCallback):
+ (WebGraphicsSwapBuffersCompleteCallbackCHROMIUM):
+ (WebGraphicsMemoryAllocationChangedCallbackCHROMIUM):
+
+2012-06-25 Scott Graham <scottmg@chromium.org>
+
+ Plumb Scrollbar button dimensions through WebThemeEngine
+ https://bugs.webkit.org/show_bug.cgi?id=89264
+
+ Reviewed by James Robinson.
+
+ Rather than making the height of the scrollbar buttons the same as the
+ width of the scrollbar, delegate to the WebThemeEngine. This allows
+ matching the Aura theme rather than the standard Windows theme.
+
+ * chromium/public/win/WebThemeEngine.h:
+ (WebKit):
+ (WebThemeEngine):
+
2012-06-22 Kenneth Russell <kbr@google.com>
Unreviewed, rolling out r121064.
diff --git a/Source/Platform/Platform.gypi b/Source/Platform/Platform.gypi
index d79f853b3..75ad972fb 100644
--- a/Source/Platform/Platform.gypi
+++ b/Source/Platform/Platform.gypi
@@ -94,6 +94,7 @@
'chromium/public/WebPrivatePtr.h',
'chromium/public/WebRect.h',
'chromium/public/WebReferrerPolicy.h',
+ 'chromium/public/WebRenderingStats.h',
'chromium/public/WebSessionDescriptionDescriptor.h',
'chromium/public/WebSize.h',
'chromium/public/WebSocketStreamError.h',
diff --git a/Source/Platform/chromium/public/WebContentLayer.h b/Source/Platform/chromium/public/WebContentLayer.h
index a86a58e1c..3e097f96b 100644
--- a/Source/Platform/chromium/public/WebContentLayer.h
+++ b/Source/Platform/chromium/public/WebContentLayer.h
@@ -27,7 +27,7 @@
#define WebContentLayer_h
#include "WebCommon.h"
-#include "WebLayer.h"
+#include "WebScrollableLayer.h"
namespace WebCore {
class ContentLayerChromium;
@@ -37,12 +37,12 @@ namespace WebKit {
class WebContentLayerClient;
class WebContentLayerImpl;
-class WebContentLayer : public WebLayer {
+class WebContentLayer : public WebScrollableLayer {
public:
WEBKIT_EXPORT static WebContentLayer create(WebContentLayerClient*);
WebContentLayer() { }
- WebContentLayer(const WebContentLayer& layer) : WebLayer(layer) { }
+ WebContentLayer(const WebContentLayer& layer) : WebScrollableLayer(layer) { }
virtual ~WebContentLayer() { }
WebContentLayer& operator=(const WebContentLayer& layer)
{
diff --git a/Source/Platform/chromium/public/WebGraphicsContext3D.h b/Source/Platform/chromium/public/WebGraphicsContext3D.h
index dc035aed1..577d70289 100644
--- a/Source/Platform/chromium/public/WebGraphicsContext3D.h
+++ b/Source/Platform/chromium/public/WebGraphicsContext3D.h
@@ -111,27 +111,30 @@ public:
class WebGraphicsContextLostCallback {
public:
virtual void onContextLost() = 0;
+
+ protected:
virtual ~WebGraphicsContextLostCallback() { }
};
class WebGraphicsErrorMessageCallback {
public:
virtual void onErrorMessage(const WebString&, WGC3Dint) = 0;
+
+ protected:
virtual ~WebGraphicsErrorMessageCallback() { }
};
class WebGraphicsSwapBuffersCompleteCallbackCHROMIUM {
public:
virtual void onSwapBuffersComplete() = 0;
+
+ protected:
virtual ~WebGraphicsSwapBuffersCompleteCallbackCHROMIUM() { }
};
class WebGraphicsMemoryAllocationChangedCallbackCHROMIUM {
public:
- // FIXME: Remove this once we switch to WebGraphicsMemoryAllocation version.
- virtual void onMemoryAllocationChanged(size_t gpuResourceSizeInBytes) = 0;
- // FIXME: Make this pure virtual once we implement everywhere.
- virtual void onMemoryAllocationChanged(WebGraphicsMemoryAllocation) { }
+ virtual void onMemoryAllocationChanged(WebGraphicsMemoryAllocation) = 0;
protected:
virtual ~WebGraphicsMemoryAllocationChangedCallbackCHROMIUM() { }
diff --git a/Source/Platform/chromium/public/WebLayer.h b/Source/Platform/chromium/public/WebLayer.h
index ca529f7fc..507955432 100644
--- a/Source/Platform/chromium/public/WebLayer.h
+++ b/Source/Platform/chromium/public/WebLayer.h
@@ -65,6 +65,9 @@ public:
WEBKIT_EXPORT WebLayer rootLayer() const;
WEBKIT_EXPORT WebLayer parent() const;
+ WEBKIT_EXPORT size_t numberOfChildren() const;
+ WEBKIT_EXPORT WebLayer childAt(size_t) const;
+
WEBKIT_EXPORT void addChild(const WebLayer&);
WEBKIT_EXPORT void insertChild(const WebLayer&, size_t index);
WEBKIT_EXPORT void replaceChild(const WebLayer& reference, const WebLayer& newLayer);
@@ -134,6 +137,11 @@ public:
WEBKIT_EXPORT void setDebugBorderColor(const WebColor&);
WEBKIT_EXPORT void setDebugBorderWidth(float);
+ // DEPRECATED.
+ // This requests that this layer's compositor-managed textures always be reserved
+ // when determining texture limits.
+ WEBKIT_EXPORT void setAlwaysReserveTextures(bool);
+
// Forces this layer to use a render surface. There is no benefit in doing
// so, but this is to facilitate benchmarks and tests.
WEBKIT_EXPORT void setForceRenderSurface(bool);
diff --git a/Source/Platform/chromium/public/WebLayerTreeView.h b/Source/Platform/chromium/public/WebLayerTreeView.h
index d5d99a285..f52511043 100644
--- a/Source/Platform/chromium/public/WebLayerTreeView.h
+++ b/Source/Platform/chromium/public/WebLayerTreeView.h
@@ -44,6 +44,7 @@ class WebLayerTreeViewClient;
class WebLayerTreeViewImpl;
struct WebPoint;
struct WebRect;
+struct WebRenderingStats;
class WebLayerTreeView : public WebNonCopyable {
public:
@@ -166,13 +167,12 @@ public:
// This can have a significant performance impact and should be used with care.
WEBKIT_EXPORT void finishAllRendering();
- // Returns the context being used for rendering this view. In threaded compositing mode, it is
- // not safe to use this context for anything on the main thread, other than passing the pointer to
- // the compositor thread.
- WEBKIT_EXPORT WebGraphicsContext3D* context();
-
// Debugging / dangerous ---------------------------------------------
+ // Fills in a WebRenderingStats struct containing information about the state of the compositor.
+ // This call is relatively expensive in threaded mode as it blocks on the compositor thread.
+ WEBKIT_EXPORT void renderingStats(WebRenderingStats&) const;
+
// Simulates a lost context. For testing only.
WEBKIT_EXPORT void loseCompositorContext(int numTimes);
diff --git a/Source/Platform/chromium/public/WebRenderingStats.h b/Source/Platform/chromium/public/WebRenderingStats.h
new file mode 100644
index 000000000..f1769855b
--- /dev/null
+++ b/Source/Platform/chromium/public/WebRenderingStats.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 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 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 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 WebRenderingStats_h
+#define WebRenderingStats_h
+
+namespace WebKit {
+
+struct WebRenderingStats {
+ int numAnimationFrames;
+ int numFramesSentToScreen;
+
+ WebRenderingStats()
+ : numAnimationFrames(0)
+ , numFramesSentToScreen(0)
+ {
+ }
+};
+
+} // namespace WebKit
+
+#endif // WebRenderingStats_h
diff --git a/Source/Platform/chromium/public/WebScrollableLayer.h b/Source/Platform/chromium/public/WebScrollableLayer.h
new file mode 100644
index 000000000..3dc733681
--- /dev/null
+++ b/Source/Platform/chromium/public/WebScrollableLayer.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 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 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 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 WebScrollableLayer_h
+#define WebScrollableLayer_h
+
+#include "WebCommon.h"
+#include "WebLayer.h"
+#include "WebPoint.h"
+
+namespace WebKit {
+
+class WebScrollableLayer : public WebLayer {
+public:
+ WebScrollableLayer() { }
+ WebScrollableLayer(const WebScrollableLayer& layer) : WebLayer(layer) { }
+ virtual ~WebScrollableLayer() { }
+ WebScrollableLayer& operator=(const WebScrollableLayer& layer)
+ {
+ WebLayer::assign(layer);
+ return *this;
+ }
+
+ WEBKIT_EXPORT void setScrollPosition(WebPoint);
+ WEBKIT_EXPORT void setScrollable(bool);
+ WEBKIT_EXPORT void setHaveWheelEventHandlers(bool);
+ WEBKIT_EXPORT void setShouldScrollOnMainThread(bool);
+
+#if WEBKIT_IMPLEMENTATION
+ WebScrollableLayer(const WTF::PassRefPtr<WebCore::LayerChromium>& layer) : WebLayer(layer) { }
+#endif
+};
+
+} // namespace WebKit
+
+#endif // WebScrollableLayer_h
diff --git a/Source/QtWebKit.pro b/Source/QtWebKit.pro
index bbbfc41e6..9d63fb83a 100644
--- a/Source/QtWebKit.pro
+++ b/Source/QtWebKit.pro
@@ -27,11 +27,12 @@ declarative.file = WebKit/qt/declarative/declarative.pro
declarative.makefile = Makefile.declarative
SUBDIRS += declarative
-tests.file = tests.pri
-SUBDIRS += tests
-
-examples.file = WebKit/qt/examples/examples.pro
-examples.CONFIG += no_default_target
-examples.makefile = Makefile
-SUBDIRS += examples
-
+!no_webkit1 {
+ tests.file = tests.pri
+ SUBDIRS += tests
+
+ examples.file = WebKit/qt/examples/examples.pro
+ examples.CONFIG += no_default_target
+ examples.makefile = Makefile
+ SUBDIRS += examples
+}
diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog
index a7f149bed..49282e263 100644
--- a/Source/WTF/ChangeLog
+++ b/Source/WTF/ChangeLog
@@ -1,17 +1,36 @@
-2012-06-19 Joel Dillon <joel.dillon@codethink.co.uk> Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+2012-06-25 Kent Tamura <tkent@chromium.org>
- [Qt][Win] Fix broken QtWebKit5.lib linking
- https://bugs.webkit.org/show_bug.cgi?id=88321
+ Unreviewed, rolling out r121145.
+ http://trac.webkit.org/changeset/121145
+ https://bugs.webkit.org/show_bug.cgi?id=89847
- Reviewed by NOBODY (OOPS!).
+ Had an objection for the change.
- Instead of letting a module's headers know which other modules depend on them,
- have depending modules define explicitely that they want its symbols exported too.
+ * wtf/text/StringBuilder.h:
- JavaScriptCore should then be compiled with both BUILDING_JavaScriptCore and
- STATICALLY_LINKED_WITH_WTF.
+2012-06-25 Yong Li <yoli@rim.com>
- * wtf/ExportMacros.h:
+ [BlackBerry] Add JSC statistics into about:memory
+ https://bugs.webkit.org/show_bug.cgi?id=89779
+
+ Reviewed by Rob Buis.
+
+ Turn on WTF_USE_EXPORT_MACROS for BlackBerry port.
+ This will make macros like JS_EXPORT_PRIVATE work without
+ extra porting.
+
+ * wtf/Platform.h:
+
+2012-06-25 Adam Barth <abarth@webkit.org>
+
+ Use InterpolationLow on chromium-android
+ https://bugs.webkit.org/show_bug.cgi?id=89849
+
+ Reviewed by Daniel Bates.
+
+ Introduce a USE macro to control image interpolation quality.
+
+ * wtf/Platform.h:
2012-06-25 Kent Tamura <tkent@chromium.org>
diff --git a/Source/WTF/wtf/ExportMacros.h b/Source/WTF/wtf/ExportMacros.h
index d50d6d117..efa0c8f81 100644
--- a/Source/WTF/wtf/ExportMacros.h
+++ b/Source/WTF/wtf/ExportMacros.h
@@ -72,7 +72,7 @@
// FIXME: When all ports are using the export macros, we should replace
// WTF_EXPORTDATA with WTF_EXPORT_PRIVATE macros.
-#if defined(BUILDING_WTF) || defined(STATICALLY_LINKED_WITH_WTF)
+#if defined(BUILDING_WTF) || defined(BUILDING_JavaScriptCore)
#define WTF_EXPORTDATA WTF_EXPORT
#else
#define WTF_EXPORTDATA WTF_IMPORT
@@ -81,7 +81,7 @@
#else // !USE(EXPORT_MACROS)
#if !PLATFORM(CHROMIUM) && OS(WINDOWS) && !COMPILER(GCC)
-#if defined(BUILDING_WTF) || defined(STATICALLY_LINKED_WITH_WTF)
+#if defined(BUILDING_WTF) || defined(BUILDING_JavaScriptCore)
#define WTF_EXPORTDATA __declspec(dllexport)
#else
#define WTF_EXPORTDATA __declspec(dllimport)
@@ -98,7 +98,7 @@
#endif // USE(EXPORT_MACROS)
-#if defined(BUILDING_WTF) || defined(STATICALLY_LINKED_WITH_WTF)
+#if defined(BUILDING_WTF) || defined(BUILDING_JavaScriptCore)
#define WTF_EXPORT_PRIVATE WTF_EXPORT
#else
#define WTF_EXPORT_PRIVATE WTF_IMPORT
diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
index 4a68e49d2..72e66f094 100644
--- a/Source/WTF/wtf/Platform.h
+++ b/Source/WTF/wtf/Platform.h
@@ -474,6 +474,7 @@
#define WTF_USE_QCMSLIB 1
#elif OS(ANDROID)
#define WTF_USE_SKIA 1
+#define WTF_USE_LOW_QUALITY_IMAGE_INTERPOLATION 1
#else
#define WTF_USE_SKIA 1
#define WTF_USE_ICCJPEG 1
@@ -1065,7 +1066,7 @@
since most ports try to support sub-project independence, adding new headers
to WTF causes many ports to break, and so this way we can address the build
breakages one port at a time. */
-#if !defined(WTF_USE_EXPORT_MACROS) && (PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(WX))
+#if !defined(WTF_USE_EXPORT_MACROS) && (PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(WX) || PLATFORM(BLACKBERRY))
#define WTF_USE_EXPORT_MACROS 1
#endif
diff --git a/Source/WTF/wtf/ThreadSpecific.h b/Source/WTF/wtf/ThreadSpecific.h
index 60c9907bd..f51ab4cf2 100644
--- a/Source/WTF/wtf/ThreadSpecific.h
+++ b/Source/WTF/wtf/ThreadSpecific.h
@@ -1,7 +1,6 @@
/*
* Copyright (C) 2008 Apple Inc. All rights reserved.
* Copyright (C) 2009 Jian Li <jianli@chromium.org>
- * Copyright (C) 2012 Patrick Gansterer <paroga@paroga.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -103,33 +102,6 @@ private:
};
#if USE(PTHREADS)
-
-typedef pthread_key_t ThreadSpecificKey;
-
-inline void ThreadSpecificKeyCreate(ThreadSpecificKey* key, void (*destructor)(void *))
-{
- int error = pthread_key_create(key, destructor);
- if (error)
- CRASH();
-}
-
-inline void ThreadSpecificKeyDelete(ThreadSpecificKey key)
-{
- int error = pthread_key_delete(key);
- if (error)
- CRASH();
-}
-
-inline void ThreadSpecificSet(ThreadSpecificKey key, void* value)
-{
- pthread_setspecific(key, value);
-}
-
-inline void* ThreadSpecificGet(ThreadSpecificKey key)
-{
- return pthread_getspecific(key);
-}
-
template<typename T>
inline ThreadSpecific<T>::ThreadSpecific()
{
@@ -167,14 +139,6 @@ const int kMaxTlsKeySize = 256;
WTF_EXPORT_PRIVATE long& tlsKeyCount();
WTF_EXPORT_PRIVATE DWORD* tlsKeys();
-class ThreadSpecificKeyValue;
-typedef ThreadSpecificKeyValue* ThreadSpecificKey;
-
-void ThreadSpecificKeyCreate(ThreadSpecificKey*, void (*)(void *));
-void ThreadSpecificKeyDelete(ThreadSpecificKey);
-void ThreadSpecificSet(ThreadSpecificKey, void*);
-void* ThreadSpecificGet(ThreadSpecificKey);
-
template<typename T>
inline ThreadSpecific<T>::ThreadSpecific()
: m_index(-1)
diff --git a/Source/WTF/wtf/ThreadSpecificWin.cpp b/Source/WTF/wtf/ThreadSpecificWin.cpp
index 61a594251..d72996a7a 100644
--- a/Source/WTF/wtf/ThreadSpecificWin.cpp
+++ b/Source/WTF/wtf/ThreadSpecificWin.cpp
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2009 Jian Li <jianli@chromium.org>
- * Copyright (C) 2012 Patrick Gansterer <paroga@paroga.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,72 +19,15 @@
*/
#include "config.h"
-#include "ThreadSpecific.h"
-#include "StdLibExtras.h"
-#include "ThreadingPrimitives.h"
+#include "ThreadSpecific.h"
-#if !USE(PTHREADS)
+#if USE(PTHREADS)
+#error This file should not be compiled by ports that do not use Windows native ThreadSpecific implementation.
+#endif
namespace WTF {
-static Mutex& destructorsMutex()
-{
- DEFINE_STATIC_LOCAL(Mutex, staticMutex, ());
- return staticMutex;
-}
-
-class ThreadSpecificKeyValue {
-public:
- ThreadSpecificKeyValue(void (*destructor)(void *))
- : m_destructor(destructor)
- {
- m_tlsKey = TlsAlloc();
- if (m_tlsKey == TLS_OUT_OF_INDEXES)
- CRASH();
-
- MutexLocker locker(destructorsMutex());
- m_next = m_first;
- m_first = this;
- }
-
- ~ThreadSpecificKeyValue()
- {
- MutexLocker locker(destructorsMutex());
- ThreadSpecificKeyValue** next = &m_first;
- while (*next != this) {
- ASSERT(*next);
- next = &(*next)->m_next;
- }
- *next = (*next)->m_next;
-
- TlsFree(m_tlsKey);
- }
-
- void setValue(void* data) { TlsSetValue(m_tlsKey, data); }
- void* value() { return TlsGetValue(m_tlsKey); }
-
- static void callDestructors()
- {
- MutexLocker locker(destructorsMutex());
- ThreadSpecificKeyValue* next = m_first;
- while (next) {
- if (void* data = next->value())
- next->m_destructor(data);
- next = next->m_next;
- }
- }
-
-private:
- void (*m_destructor)(void *);
- DWORD m_tlsKey;
- ThreadSpecificKeyValue* m_next;
-
- static ThreadSpecificKeyValue* m_first;
-};
-
-ThreadSpecificKeyValue* ThreadSpecificKeyValue::m_first = 0;
-
long& tlsKeyCount()
{
static long count;
@@ -98,26 +40,6 @@ DWORD* tlsKeys()
return keys;
}
-void ThreadSpecificKeyCreate(ThreadSpecificKey* key, void (*destructor)(void *))
-{
- *key = new ThreadSpecificKeyValue(destructor);
-}
-
-void ThreadSpecificKeyDelete(ThreadSpecificKey key)
-{
- delete key;
-}
-
-void ThreadSpecificSet(ThreadSpecificKey key, void* data)
-{
- key->setValue(data);
-}
-
-void* ThreadSpecificGet(ThreadSpecificKey key)
-{
- return key->value();
-}
-
void ThreadSpecificThreadExit()
{
for (long i = 0; i < tlsKeyCount(); i++) {
@@ -126,10 +48,6 @@ void ThreadSpecificThreadExit()
if (data)
data->destructor(data);
}
-
- ThreadSpecificKeyValue::callDestructors();
}
} // namespace WTF
-
-#endif // !USE(PTHREADS)
diff --git a/Source/WTF/wtf/text/StringBuilder.h b/Source/WTF/wtf/text/StringBuilder.h
index c73d46372..d896d17b1 100644
--- a/Source/WTF/wtf/text/StringBuilder.h
+++ b/Source/WTF/wtf/text/StringBuilder.h
@@ -130,21 +130,6 @@ public:
append(static_cast<LChar>(c));
}
- void appendEscaped(const String& string, UChar escape, UChar special)
- {
- if (string.isEmpty())
- return;
- unsigned requiredSize = length() + string.length();
- if (capacity() < requiredSize)
- reserveCapacity(requiredSize);
- for (unsigned i = 0; i < string.length(); ++i) {
- UChar ch = string[i];
- if (ch == escape || ch == special)
- append(escape);
- append(ch);
- }
- }
-
String toString()
{
shrinkToFit();
diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt
index fcdeaba93..6d3da7f8c 100644
--- a/Source/WebCore/CMakeLists.txt
+++ b/Source/WebCore/CMakeLists.txt
@@ -503,6 +503,7 @@ SET(WebCore_SOURCES
css/CSSStyleRule.cpp
css/CSSStyleSheet.cpp
css/CSSTimingFunctionValue.cpp
+ css/CSSToStyleMap.cpp
css/CSSUnicodeRangeValue.cpp
css/CSSValue.cpp
css/CSSValueList.cpp
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index b4a2c4cfc..6856ca10c 100644..100755
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,11 +1,2108 @@
-2012-06-19 Joel Dillon <joel.dillon@codethink.co.uk> Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+2012-06-26 Yoshifumi Inoue <yosin@chromium.org>
- [Qt][Win] Fix broken QtWebKit5.lib linking
- https://bugs.webkit.org/show_bug.cgi?id=88321
+ [Platform] Change implementation of LocaleICU class to support more UDateFormat.
+ https://bugs.webkit.org/show_bug.cgi?id=89967
- Reviewed by NOBODY (OOPS!).
+ Reviewed by Kent Tamura.
+
+ This patch changes internal functions of LocaleICU class to process
+ multiple ICU date time format handles in addition to short date time
+ format handle.
+
+ This patch is a part of implementing input type time. I'll add time
+ format related ICU date time format handles.
+
+ No new tests. This patch doesn't change behavior.
+
+ * platform/text/LocaleICU.cpp:
+ (WebCore::LocaleICU::initializeShortDateFormat): Changed to use openDateFormat().
+ (WebCore::LocaleICU::openDateFormat): Added for common usage of udt_open().
+ (WebCore::getDateFormatPattern): Added for common usage of udt_toPattern().
+ (WebCore::localizeFormat): Changed to take String parameter.
+ (WebCore::LocaleICU::initializeLocalizedDateFormatText): Changed to use getDateFormatPattern.
+ (WebCore::LocaleICU::createLabelVector): Changed to take UDateFormat parameter.
+ (WebCore::LocaleICU::initializeCalendar): Changed for helper functions.
+ * platform/text/LocaleICU.h:
+ (LocaleICU):
+
+2012-06-26 Luke Macpherson <macpherson@chromium.org>
+
+ Return correct value for css variables enabled runtime flag.
+ https://bugs.webkit.org/show_bug.cgi?id=90040
+
+ Reviewed by Dimitri Glazkov.
+
+ Was always returning true for the runtime flag when the compile time flag was on. That was good for testing,
+ but not so much for production.
+
+ * page/Settings.h:
+ (WebCore::Settings::cssVariablesEnabled):
+
+2012-06-26 Xueqing Huang <huangxueqing@baidu.com>
+
+ DragData::asFilenames should not push same file names to result in Windows.
+ https://bugs.webkit.org/show_bug.cgi?id=79861
+
+ Reviewed by Alexey Proskuryakov.
+
+ Test: platform/win/fast/forms/file/drag-and-drop-files.html
+
+ * platform/win/DragDataWin.cpp:
+ (WebCore::DragData::asFilenames):
+
+2012-06-26 Geoffrey Garen <ggaren@apple.com>
+
+ Reduced (but did not eliminate) use of "berzerker GC"
+ https://bugs.webkit.org/show_bug.cgi?id=89237
+
+ Reviewed by Gavin Barraclough.
+
+ (PART 2)
+
+ Don't ASSERT that RootObject's destructor runs and invalidates all
+ RuntimeObjects before their destructors run.
+
+ We don't guarantee this behavior because some RuntimeObjects may already
+ be garbage by the time RootObject's destructor runs, in which case
+ RootObject's weak pointers will be NULL, and RootObject will not call
+ invalidate() on them.
+
+ It's been theoretically possible for this ASSERT to fire for a while now.
+ This patch makes it fire all the time.
+
+ Luckily, we only needed the behavior guarded by this ASSERT for WebKit1
+ in Safari on Windows (cf. https://bugs.webkit.org/show_bug.cgi?id=61317),
+ to handle the way WebKit1 would unload plugin DLLs. If this ever becomes
+ an issue again, we can fix it by (a) not unloading plugin DLLs,
+ (b) migrating WebKit1 to the WebKit2 JS-plugin binding model, (c) making
+ the Instance pointer in a RuntimeObject an indirect pointer through
+ RootObject, or (c) giving RuntimeObject some sort of special way to
+ access a zombie weak pointer.
+
+ * bridge/runtime_object.cpp:
+ (JSC::Bindings::RuntimeObject::destroy): ASSERT removed. Anders said so.
+
+2012-06-26 Douglas Stockwell <dstockwell@chromium.org>
+
+ REGRESSION(r107836): box shadow not drawn for opaque images with an opaque background
+ https://bugs.webkit.org/show_bug.cgi?id=89958
+
+ Reviewed by Simon Fraser.
+
+ Don't attempt to draw the box shadow as part of the background if the background is
+ obscured.
+
+ Test: fast/box-shadow/image-box-shadow.html
+
+ * rendering/RenderImage.cpp:
+ (WebCore::RenderImage::boxShadowShouldBeAppliedToBackground):
+ (WebCore):
+ * rendering/RenderImage.h:
+ (RenderImage):
+
+2012-06-26 Nico Weber <thakis@chromium.org>
+
+ Fix new Wunused-private-field violations that crept in
+ https://bugs.webkit.org/show_bug.cgi?id=90032
+
+ Reviewed by Adam Barth.
+
+ * page/Performance.h:
+ (Performance):
+
+2012-06-26 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Change return type in bandwidth attribute of network information API
+ https://bugs.webkit.org/show_bug.cgi?id=89959
+
+ Reviewed by Adam Barth.
+
+ According to network information API spec, bandwidth attribute should return double type.
+ But, existing implementation has used *long* and *unsigned int* types.
+
+ No new tests. Covered by existing tests.
+
+ * Modules/networkinfo/NetworkInfo.cpp:
+ (WebCore::NetworkInfo::NetworkInfo):
+ * Modules/networkinfo/NetworkInfo.h:
+ (WebCore::NetworkInfo::create):
+ (WebCore::NetworkInfo::bandwidth):
+ (NetworkInfo):
+ * Modules/networkinfo/NetworkInfoClient.h:
+ (NetworkInfoClient):
+ * Modules/networkinfo/NetworkInfoConnection.cpp:
+ (WebCore::NetworkInfoConnection::bandwidth):
+ * Modules/networkinfo/NetworkInfoConnection.h:
+ (NetworkInfoConnection):
+ * testing/Internals.cpp:
+ (WebCore::Internals::setNetworkInformation):
+ * testing/Internals.h:
+ (Internals):
+ * testing/Internals.idl:
+
+2012-06-26 Luke Macpherson <macpherson@chromium.org>
+
+ Be careful not to read past the end of input in CSSParser::lex() when looking for variable definitions.
+ https://bugs.webkit.org/show_bug.cgi?id=89949
+
+ Reviewed by Abhishek Arya.
+
+ Added repro case as fast/css/short-inline-style.html.
+
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::lex):
+
+2012-06-26 James Robinson <jamesr@chromium.org>
+
+ [chromium] Remove WebView::graphicsContext3D getter
+ https://bugs.webkit.org/show_bug.cgi?id=89916
+
+ Reviewed by Adrienne Walker.
+
+ Deletes code supporting compositor context getter.
+
+ * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+ * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+ (CCLayerTreeHost):
+ * platform/graphics/chromium/cc/CCProxy.h:
+ (CCProxy):
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.h:
+ (CCSingleThreadProxy):
+ * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+ * platform/graphics/chromium/cc/CCThreadProxy.h:
+ (CCThreadProxy):
+
+2012-06-26 Kulanthaivel Palanichamy <kulanthaivel@codeaurora.org>
+
+ Unexpected element sizes when mixing inline-table with box-sizing
+ https://bugs.webkit.org/show_bug.cgi?id=89819
+
+ Reviewed by Julien Chaffraix.
+
+ This change handles box-sizing: border-box property for CSS tables properly.
+
+ Test: fast/box-sizing/css-table-with-box-sizing.html
+
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
+ (WebCore::RenderTable::layout):
+
+2012-06-26 Simon Fraser <simon.fraser@apple.com>
+
+ Optimize mappings of simple transforms in RenderGeometryMap
+ https://bugs.webkit.org/show_bug.cgi?id=90034
+
+ Reviewed by Dean Jackson.
+
+ For transforms that are identity or simple translations, don't
+ fall off the fast path in RenderGeometryMap; we can just
+ treat them as offsets.
+
+ Improves performance on pages with lots of translateZ(0) elements.
+
+ Remove RenderGeometryMapStep::mapPoint() and mapQuad(), which
+ were unused.
+
+ No new tests; optimization only, and tested by assertions.
+
+ * rendering/RenderGeometryMap.cpp:
+ (WebCore::RenderGeometryMap::push):
+
+2012-06-26 Kevin Ellis <kevers@chromium.org>
+
+ Touch adjustment does not target shadow DOM elements
+ https://bugs.webkit.org/show_bug.cgi?id=89556
+
+ The position of internal shadow-DOM nodes were not being considered
+ when determining the snap position when TOUCH_ADJUSTMENT is enabled
+ for fine tuning the position of synthetic mouse events. This
+ restriction results in not being able to select the calendar picker
+ when input type=date, or to clear the search field for input
+ type=search.
+
+ Reviewed by Antonio Gomes.
+
+ Test: touchadjustment/nested-shadow-node.html
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::bestClickableNodeForTouchPoint):
+
+2012-06-26 Ryosuke Niwa <rniwa@webkit.org>
+
+ Stop calling node() and deprecatedEditingOffset() in comparePositions
+ https://bugs.webkit.org/show_bug.cgi?id=54535
+
+ Reviewed by Enrica Casucci.
+
+ Replaced deprecatedNode() and deprecatedEditingOffset() by containerNode() and computeOffsetInContainerNode()
+ in comparePositions().
+
+ In addition, fixed a bunch of bugs in DeleteSelectionCommand::handleSpecialCaseBRDelete revealed by this change:
+ - Use node after position instead of deprecated node in determinig whether start and end positions at a br.
+ - Don't set m_startsAtEmptyLine true when BR is wrapped in a block element. The only reason this code had worked
+ was positions like (div, offset, 0) and (br, before) in <div><br> were treated differently, which we no longer do.
+
+ * editing/DeleteSelectionCommand.cpp:
+ (WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete):
+ * editing/htmlediting.cpp:
+ (WebCore::comparePositions):
+
+2012-06-26 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL] Use eina_file_ls() in EFL implementation of FileSystem listDirectory()
+ https://bugs.webkit.org/show_bug.cgi?id=89976
+
+ Reviewed by Antonio Gomes.
+
+ Rewrite EFL implementation of Filesystem listDirectory() in order to
+ use eina_file_ls() instead of POSIX C functions. This results in
+ shorter code.
+
+ No new tests, behavior has not changed.
+
+ * platform/efl/FileSystemEfl.cpp:
+ (WebCore::listDirectory):
+
+2012-06-26 Alice Cheng <alice_cheng@apple.com>
+
+ Crash at WebCore::TextIterator::handleTextBox
+ https://bugs.webkit.org/show_bug.cgi?id=89526
+ <rdar://problem/10305315>
+
+ Reviewed by Darin Adler.
+
+ The range used for marking becomes invalid after SpellingCorrectionCommand, due to changes in the DOM made by ReplaceSelectionCommand.
+ This invalid range caused marking to be incorrect, and Mail.app to crash when iterating through the invalid range. To fix this,
+ recalculate the range for marking after SpellingCorrectionCommand.
+
+ Test: platform/mac/editing/spelling/autocorrection-blockquote-crash.html
+
+ * editing/AlternativeTextController.cpp:
+ (WebCore::AlternativeTextController::applyAlternativeTextToRange):
+ * editing/Editor.cpp: (WebCore::Editor::markAndReplaceFor):
+ * testing/Internals.cpp:
+ (WebCore):
+ (WebCore::Internals::hasAutocorrectedMarker):
+ * testing/Internals.h: (Internals):
+ * testing/Internals.idl:
+
+2012-06-26 Tom Sepez <tsepez@chromium.org>
+
+ [chromium] HTML5 audio/video tags - loading http content from https page doesn't trigger warning.
+ https://bugs.webkit.org/show_bug.cgi?id=89906
+
+ Reviewed by Nate Chapin.
+
+ This patch treats mixed CachedRawResources as affecting the display of insecure content.
+
+ Tests: http/tests/security/mixedContent/insecure-audio-video-in-main-frame.html
+ http/tests/security/mixedContent/insecure-xhr-in-main-frame.html
+
+ * loader/cache/CachedResourceLoader.cpp:
+ (WebCore::CachedResourceLoader::checkInsecureContent):
+
+2012-06-26 Joe Thomas <joethomas@motorola.com>
+
+ background-size:0 shows as 1px instead of invisible
+ https://bugs.webkit.org/show_bug.cgi?id=86942
+
+ Reviewed by Eric Seidel.
+
+ As per the specification http://www.w3.org/TR/css3-background/#background-size, if the background image's width or height resolves to zero,
+ this causes the image not to be displayed. The effect should be the same as if it had been a transparent image.
+ This is also mentioned in http://www.w3.org/TR/2002/WD-css3-background-20020802/#background-size.
+
+ Test: fast/backgrounds/zero-background-size.html
+
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::calculateFillTileSize):
+
+2012-06-26 Adam Klein <adamk@chromium.org>
+
+ [v8] Clean up generated Dictionary-handling code
+ https://bugs.webkit.org/show_bug.cgi?id=89994
+
+ Reviewed by Adam Barth.
+
+ No change in behavior, so no new tests.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateParametersCheck):
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::TestObjV8Internal::optionsObjectCallback):
+
+2012-06-26 Raymond Toy <rtoy@google.com>
+
+ Include stdio.h when DEBUG_AUDIONODE_REFERENCES is set
+ https://bugs.webkit.org/show_bug.cgi?id=89997
+
+ Reviewed by Eric Seidel.
+
+ No new tests needed for a compile issue
+
+ * Modules/webaudio/AudioNode.cpp: Include stdio.h
+
+2012-06-26 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [Qt] Use premultiplied alpha when extracting image data in WebGL
+ https://bugs.webkit.org/show_bug.cgi?id=89937
+
+ Reviewed by Jocelyn Turcotte.
+
+ Perform conversion in QImage only if the image format is not ARGB32 or
+ ARGB32_Premultiplied. Otherwise, allow packPixels to perform the conversion if the formats
+ don't match, as packPixels already performs pixel-specific operations.
+
+ Covered by tests in LayoutTests/fast/canvas/webgl, e.g. webgl-composite-modes.html.
+
+ * platform/graphics/qt/GraphicsContext3DQt.cpp:
+ (WebCore::GraphicsContext3D::getImageData):
+
+2012-06-26 Joshua Bell <jsbell@chromium.org>
+
+ IndexedDB: Move method precondition checks to front end objects
+ https://bugs.webkit.org/show_bug.cgi?id=89377
+
+ Reviewed by Tony Chang.
+
+ Now that metadata exists on the front end, most of the pre-condition validation checks
+ done on IDB method calls from script can be moved to the front end which simplifies the
+ code significantly in the case of complex methods like IDBObjectStore::put().
+
+ Adds an internal "active" flag for transactions, although the behavior is not accurate
+ to the spec (it should only be true during event callbacks - http://webkit.org/b/89379).
+ The back-end methods can then be simplifed to just adding async tasks to the transaction,
+ and the front end methods can take care of all exception cases except for asynchronous
+ transaction abort which still requires plumbing back to the front end.
+
+ No functional changes - no new tests.
+
+ * Modules/indexeddb/IDBCursor.cpp:
+ (WebCore::IDBCursor::update): Migrate from IDBObjectStoreBackendImpl::put.
+ (WebCore::IDBCursor::advance): Add more explicit transaction-is-active check.
+ (WebCore::IDBCursor::continueFunction): Ditto.
+ (WebCore::IDBCursor::deleteFunction): Ditto.
+ (WebCore::IDBCursor::effectiveObjectStore): Convenience function (source may be store or index).
+ (WebCore):
+ * Modules/indexeddb/IDBCursor.h:
+ (WebCore::IDBCursor::isKeyCursor): Distinguish from IDBCursorWithValue.
+ (IDBCursor):
+ * Modules/indexeddb/IDBCursorBackendImpl.cpp:
+ (WebCore::IDBCursorBackendImpl::update): Remove migrated check.
+ * Modules/indexeddb/IDBCursorWithValue.h:
+ (IDBCursorWithValue):
+ * Modules/indexeddb/IDBDatabase.cpp: Migrate checks.
+ (WebCore::IDBDatabase::createObjectStore):
+ (WebCore::IDBDatabase::deleteObjectStore):
+ * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: Replace checks with assertions.
+ (WebCore::IDBDatabaseBackendImpl::createObjectStore):
+ (WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
+ * Modules/indexeddb/IDBIndex.cpp: Add transaction-is-active checks.
+ (WebCore::IDBIndex::openCursor):
+ (WebCore::IDBIndex::count):
+ (WebCore::IDBIndex::openKeyCursor):
+ (WebCore::IDBIndex::get):
+ (WebCore::IDBIndex::getKey):
+ * Modules/indexeddb/IDBObjectStore.cpp: Migrate cehcks.
+ (WebCore::IDBObjectStore::get):
+ (WebCore::IDBObjectStore::add): Delegates to put(PutMode)
+ (WebCore::IDBObjectStore::put): Delegates to put(PutMode)
+ (WebCore): Adds put(PutMode) which has the unified checks migrated from
+ IDBObjectStoreBackendImpl::put.
+ (WebCore::IDBObjectStore::deleteFunction):
+ (WebCore::IDBObjectStore::clear):
+ (WebCore::IDBObjectStore::createIndex):
+ (WebCore::IDBObjectStore::deleteIndex):
+ (WebCore::IDBObjectStore::openCursor):
+ (WebCore::IDBObjectStore::count):
+ * Modules/indexeddb/IDBObjectStore.h: Adds put(PutMode).
+ (IDBObjectStore):
+ * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
+ (WebCore::IDBObjectStoreBackendImpl::getInternal): Fix trace symbol.
+ (WebCore::IDBObjectStoreBackendImpl::put): Remove migrated checks.
+ (WebCore::IDBObjectStoreBackendImpl::createIndex): Remove migrated checks.
+ (WebCore::IDBObjectStoreBackendImpl::deleteIndex): Remove migrated checks.
+ * Modules/indexeddb/IDBTransaction.cpp: Add active flag tracking.
+ (WebCore::IDBTransaction::IDBTransaction):
+ (WebCore::IDBTransaction::abort):
+ (WebCore::IDBTransaction::onAbort):
+ (WebCore::IDBTransaction::onComplete):
+ * Modules/indexeddb/IDBTransaction.h:
+ (WebCore::IDBTransaction::isActive):
+ (WebCore::IDBTransaction::isReadOnly): Group IDL/non-IDL methods.
+ (IDBTransaction):
+
+2012-06-26 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r121285.
+ http://trac.webkit.org/changeset/121285
+ https://bugs.webkit.org/show_bug.cgi?id=90014
+
+ "We misinterpreted 'size of the initial containing block'"
+ (Requested by tomz on #webkit).
+
+ * css/CSSCalculationValue.cpp:
+ (WebCore::CSSCalcValue::computeLengthPx):
+ (WebCore::CSSCalcPrimitiveValue::toCalcValue):
+ (WebCore::CSSCalcPrimitiveValue::computeLengthPx):
+ (WebCore::CSSCalcBinaryOperation::toCalcValue):
+ (WebCore::CSSCalcBinaryOperation::computeLengthPx):
+ * css/CSSCalculationValue.h:
+ (CSSCalcExpressionNode):
+ (WebCore::CSSCalcValue::toCalcValue):
+ (CSSCalcValue):
+ * css/CSSGradientValue.cpp:
+ (WebCore::CSSGradientValue::addStops):
+ (WebCore::positionFromValue):
+ (WebCore::CSSGradientValue::computeEndPoint):
+ (WebCore::CSSLinearGradientValue::createGradient):
+ (WebCore::CSSRadialGradientValue::resolveRadius):
+ (WebCore::CSSRadialGradientValue::createGradient):
+ * css/CSSGradientValue.h:
+ (CSSGradientValue):
+ (CSSRadialGradientValue):
+ * css/CSSPrimitiveValue.cpp:
+ (WebCore::CSSPrimitiveValue::computeLength):
+ (WebCore::CSSPrimitiveValue::computeLengthDouble):
+ * css/CSSPrimitiveValue.h:
+ (CSSPrimitiveValue):
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::convertToLength):
+ * css/CSSToStyleMap.cpp:
+ (WebCore::CSSToStyleMap::mapFillSize):
+ (WebCore::CSSToStyleMap::mapFillXPosition):
+ (WebCore::CSSToStyleMap::mapFillYPosition):
+ (WebCore::CSSToStyleMap::mapNinePieceImageQuad):
+ * css/CSSToStyleMap.h:
+ (CSSToStyleMap):
+ * css/MediaQueryEvaluator.cpp:
+ (WebCore::computeLength):
+ (WebCore::device_heightMediaFeatureEval):
+ (WebCore::device_widthMediaFeatureEval):
+ (WebCore::heightMediaFeatureEval):
+ (WebCore::widthMediaFeatureEval):
+ * css/SVGCSSStyleSelector.cpp:
+ (WebCore::StyleResolver::applySVGProperty):
+ * css/StyleBuilder.cpp:
+ (WebCore::ApplyPropertyAuto::applyValue):
+ (WebCore::ApplyPropertyClip::convertToLength):
+ (WebCore::ApplyPropertyLength::applyValue):
+ (WebCore::ApplyPropertyBorderRadius::applyValue):
+ (WebCore::ApplyPropertyComputeLength::applyValue):
+ (WebCore::ApplyPropertyFontSize::applyValue):
+ (WebCore::ApplyPropertyLineHeight::applyValue):
+ (WebCore::ApplyPropertyPageSize::mmLength):
+ (WebCore::ApplyPropertyPageSize::inchLength):
+ (WebCore::ApplyPropertyPageSize::applyValue):
+ (WebCore::ApplyPropertyVerticalAlign::applyValue):
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::collectMatchingRulesForList):
+ * css/StyleResolver.h:
+ (StyleResolver):
+ * css/WebKitCSSMatrix.cpp:
+ (WebCore::WebKitCSSMatrix::setMatrixValue):
+
+2012-06-26 Dave Tu <dtu@chromium.org>
+
+ [chromium] Expose rendering statistics to WebWidget.
+ https://bugs.webkit.org/show_bug.cgi?id=88268
+
+ Reviewed by James Robinson.
+
+ The WebKit side of a basic framework for exposing rendering statistics
+ to Chromium's --enable-benchmarking extension.
+
+ * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+ (WebCore::CCLayerTreeHost::implFrameNumber):
+ * platform/graphics/chromium/cc/CCProxy.h:
+ (CCProxy):
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.h:
+ * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+ (WebCore::CCThreadProxy::implFrameNumber):
+ (WebCore):
+ (WebCore::CCThreadProxy::implFrameNumberOnImplThread):
+ * platform/graphics/chromium/cc/CCThreadProxy.h:
+ (CCThreadProxy):
+
+2012-06-26 Dave Tharp <dtharp@codeaurora.org>
+
+ ietestcenter/css3/valuesandunits/units-000.htm asserts
+ https://bugs.webkit.org/show_bug.cgi?id=86176
+
+ Reviewed by Beth Dakin.
+
+ Modified computeLengthDouble() to handle vh, vw, and vmin units. Per the spec
+ (http://dev.w3.org/csswg/css3-values/#viewport-relative-lengths) viewport -percentage
+ lengths are "relative to the size of the initial containing block", which I read to be
+ the size of the parent element. Since parentStyle was not available in computeLengthDouble,
+ most of the changes for this patch involved "pushing down" the parentStyle pointer through
+ the network of computeLength methods and dependencies.
+
+ Tests: css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-border.html
+ css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-border.html
+ css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-border.html
+
+ * css/CSSCalculationValue.cpp:
+ (WebCore::CSSCalcValue::computeLengthPx):
+ (WebCore::CSSCalcPrimitiveValue::toCalcValue):
+ (WebCore::CSSCalcPrimitiveValue::computeLengthPx):
+ (WebCore::CSSCalcBinaryOperation::toCalcValue):
+ (WebCore::CSSCalcBinaryOperation::computeLengthPx):
+ * css/CSSCalculationValue.h:
+ (CSSCalcExpressionNode):
+ (WebCore::CSSCalcValue::toCalcValue):
+ (CSSCalcValue):
+ * css/CSSGradientValue.cpp:
+ (WebCore::CSSGradientValue::addStops):
+ (WebCore::positionFromValue):
+ (WebCore::CSSGradientValue::computeEndPoint):
+ (WebCore::CSSLinearGradientValue::createGradient):
+ (WebCore::CSSRadialGradientValue::resolveRadius):
+ (WebCore::CSSRadialGradientValue::createGradient):
+ * css/CSSGradientValue.h:
+ (CSSGradientValue):
+ (CSSRadialGradientValue):
+ * css/CSSPrimitiveValue.cpp:
+ (WebCore::CSSPrimitiveValue::computeLength):
+ (WebCore::CSSPrimitiveValue::computeLengthDouble):
+ * css/CSSPrimitiveValue.h:
+ (CSSPrimitiveValue):
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::convertToLength):
+ * css/CSSToStyleMap.cpp:
+ (WebCore::CSSToStyleMap::parentStyle):
+ (WebCore):
+ (WebCore::CSSToStyleMap::mapFillSize):
+ (WebCore::CSSToStyleMap::mapFillXPosition):
+ (WebCore::CSSToStyleMap::mapFillYPosition):
+ (WebCore::CSSToStyleMap::mapNinePieceImageQuad):
+ * css/CSSToStyleMap.h:
+ (CSSToStyleMap):
+ * css/MediaQueryEvaluator.cpp:
+ (WebCore::computeLength):
+ (WebCore::device_heightMediaFeatureEval):
+ (WebCore::device_widthMediaFeatureEval):
+ (WebCore::heightMediaFeatureEval):
+ (WebCore::widthMediaFeatureEval):
+ * css/SVGCSSStyleSelector.cpp:
+ (WebCore::StyleResolver::applySVGProperty):
+ * css/StyleBuilder.cpp:
+ (WebCore::ApplyPropertyAuto::applyValue):
+ (WebCore::ApplyPropertyClip::convertToLength):
+ (WebCore::ApplyPropertyLength::applyValue):
+ (WebCore::ApplyPropertyBorderRadius::applyValue):
+ (WebCore::ApplyPropertyComputeLength::applyValue):
+ (WebCore::ApplyPropertyFontSize::applyValue):
+ (WebCore::ApplyPropertyLineHeight::applyValue):
+ (WebCore::ApplyPropertyPageSize::mmLength):
+ (WebCore::ApplyPropertyPageSize::inchLength):
+ (WebCore::ApplyPropertyPageSize::applyValue):
+ (WebCore::ApplyPropertyVerticalAlign::applyValue):
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::collectMatchingRulesForList):
+ * css/StyleResolver.h:
+ (WebCore::StyleResolver::parentNode):
+ (StyleResolver):
+ * css/WebKitCSSMatrix.cpp:
+ (WebCore::WebKitCSSMatrix::setMatrixValue):
+
+2012-06-25 James Robinson <jamesr@chromium.org>
+
+ [chromium] Add WebLayer API for scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=89913
+
+ Reviewed by Adrienne Walker.
+
+ Use new WebScrollableLayer type in ScrollingCoordinatorChromium. This file peeks "under the hood" a fair amount
+ since we don't have WebLayer API for scrollbar layers yet.
+
+ * page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
+ (WebCore::ScrollingCoordinatorPrivate::setScrollLayer):
+ (WebCore::ScrollingCoordinatorPrivate::setHorizontalScrollbarLayer):
+ (WebCore::ScrollingCoordinatorPrivate::setVerticalScrollbarLayer):
+ (WebCore::ScrollingCoordinatorPrivate::hasScrollLayer):
+ (WebCore::ScrollingCoordinatorPrivate::scrollLayer):
+ (ScrollingCoordinatorPrivate):
+ (WebCore::createScrollbarLayer):
+ (WebCore::ScrollingCoordinator::setScrollLayer):
+ (WebCore::ScrollingCoordinator::setNonFastScrollableRegion):
+ (WebCore::ScrollingCoordinator::setWheelEventHandlerCount):
+ (WebCore::ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread):
+
+2012-06-26 James Robinson <jamesr@chromium.org>
+
+ Unreviewed, rolling out r120501.
+ http://trac.webkit.org/changeset/120501
+ https://bugs.webkit.org/show_bug.cgi?id=89126
+
+ [skia] Fix is too heavy-handed
+
+ * platform/graphics/skia/ImageBufferSkia.cpp:
+ (WebCore::drawNeedsCopy):
+ * platform/graphics/skia/PlatformContextSkia.cpp:
+ (WebCore::PlatformContextSkia::PlatformContextSkia):
+ * platform/graphics/skia/PlatformContextSkia.h:
+ (PlatformContextSkia):
+ (WebCore::PlatformContextSkia::isDeferred):
+ (WebCore::PlatformContextSkia::setDeferred):
+
+2012-06-26 Julien Chaffraix <jchaffraix@webkit.org>
+
+ Crash in FixedTableLayout::layout
+ https://bugs.webkit.org/show_bug.cgi?id=88676
+
+ Unreviewed typo fix, pointed out by Darin Adler.
+
+ * rendering/AutoTableLayout.cpp:
+ (WebCore::AutoTableLayout::layout):
+ * rendering/FixedTableLayout.cpp:
+ (WebCore::FixedTableLayout::layout):
+
+2012-06-26 Adam Klein <adamk@chromium.org>
+
+ MutationObserver.observe should treat a null or undefined options argument as empty
+ https://bugs.webkit.org/show_bug.cgi?id=89992
+
+ Reviewed by Ojan Vafai.
+
+ The WebIDL spec was recently updated to treat null or undefined
+ Dictionary arguments the same as the empty dictionary. This patch
+ updates MutationObserver.observe to follow that spec.
+
+ Note that we still throw a SYNTAX_ERR in this case, since it's an
+ error not to pass one of "attributes", "childList", or "characterData"
+ as a key in the dictionary.
+
+ * dom/WebKitMutationObserver.cpp:
+ (WebCore::WebKitMutationObserver::observe):
+
+2012-06-26 Ian Vollick <vollick@chromium.org>
+
+ [chromium] The single thread proxy should not automatically tick new animations.
+ https://bugs.webkit.org/show_bug.cgi?id=89996
+
+ Reviewed by James Robinson.
+
+ No new tests. No change to existing functionality.
+
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+ (WebCore::CCSingleThreadProxy::CCSingleThreadProxy):
+ (WebCore::CCSingleThreadProxy::initializeLayerRenderer):
+ (WebCore::CCSingleThreadProxy::didAddAnimation):
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.h:
+ (WebCore):
+
+2012-06-26 Julien Chaffraix <jchaffraix@webkit.org>
+
+ Crash in FixedTableLayout::layout
+ https://bugs.webkit.org/show_bug.cgi?id=88676
+
+ Reviewed by Abhishek Arya.
+
+ Tests: fast/table/auto-table-layout-colgroup-removal-crash.html
+ fast/table/fixed-table-layout/colgroup-removal-crash.html
+ fast/table/fixed-table-layout/prepend-in-fixed-table.html
+
+ The issue comes from RenderTable not properly dirtying its preferred logical
+ widths. As the table layout codes (both fixed and auto), recomputes their internal
+ structures at computePreferredLogicalWidth, the internal structure doesn't match
+ the table sizing and we crash.
+
+ This fix adds a work-around in FixedTableLayout::layout (which matches AutoTableLayout).
+ The long-term fix would be to properly fix the logic but this is a lot safer, especially
+ since our logic is really not bullet-proof at the moment.
+
+ * rendering/FixedTableLayout.cpp:
+ (WebCore::FixedTableLayout::layout):
+ Added an internal structure recomputation, if we have drifted from our table's structure.
+ Also we need to update nEffCols if we call calcWidthArray.
+
+ * rendering/AutoTableLayout.cpp:
+ (WebCore::AutoTableLayout::layout):
+ Added a comment matching FixedTableLayout. The nEffCols is unneeded but kept for consistency
+ with FixedTableLayout.
+
+2012-06-26 Ian Vollick <vollick@chromium.org>
+
+ [chromium] Layer chromium should need a redraw after getting its first non-empty bounds.
+ https://bugs.webkit.org/show_bug.cgi?id=89784
+
+ Reviewed by James Robinson.
+
+ Previously, we'd only set needs redraw if the old bounds were zero,
+ and the new bounds were non-zero, but we should actually have
+ checked that the old bounds were non-empty.
+
+ Unit test: LayerChromiumTestWithoutFixture.setBoundsTriggersSetNeedsRedrawAfterGettingNonEmptyBounds
+
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::LayerChromium::setBounds):
+
+2012-06-26 Jia Pu <jpu@apple.com>
+
+ On Mac, autocorrection sometimes fails to take place in Safari.
+ https://bugs.webkit.org/show_bug.cgi?id=89982
+
+ Reviewed by Darin Adler.
+
+ Existing test was turned off due to intermittent failure, which is caused by autocorrection result depending on user data
+ that may be altered by previous test runs. Hopefully we can turn the test back on once we have a way to make autocorrection
+ behave consistently.
+
+ Basically we should check the value of shouldCheckForCorrection, not shouldShowCorrectionPanel, to determine if we should
+ early return in markAndReplaceFor().
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::markAndReplaceFor):
+
+2012-06-26 Joe Thomas <joethomas@motorola.com>
+
+ Do early-return when author and user styles are disabled.
+ https://bugs.webkit.org/show_bug.cgi?id=89947
+
+ Reviewed by Andreas Kling.
+
+ * dom/Document.cpp:
+ (WebCore::Document::collectActiveStylesheets):
+
+2012-06-26 James Robinson <jamesr@chromium.org>
+
+ [chromium] Remove dead compositor-related API from GraphicsContext3DPrivate / Extensions3DChromium
+ https://bugs.webkit.org/show_bug.cgi?id=89933
+
+ Reviewed by Kenneth Russell.
+
+ GraphicsContext3DPrivate and Extensions3DChromium had a fair amount of plumbing and boilerplate to support the
+ compositor's use of GraphicsContext3D. A number of extensions, etc, only make sense for a compositor context.
+ Since the compositor doesn't use GC3D any more, these are no longer needed.
+
+ * platform/chromium/support/Extensions3DChromium.cpp:
+ * platform/chromium/support/GraphicsContext3DChromium.cpp:
+ (WebCore::GraphicsContext3D::~GraphicsContext3D):
+ (WebCore::GraphicsContext3D::create):
+ * platform/chromium/support/GraphicsContext3DPrivate.cpp:
+ (WebCore::GraphicsContext3DPrivate::~GraphicsContext3DPrivate):
+ (WebCore::GraphicsContext3DPrivate::createGraphicsContextFromWebContext):
+ (WebCore::GrMemoryAllocationChangedCallbackAdapter::GrMemoryAllocationChangedCallbackAdapter):
+ (WebCore::GraphicsContext3DPrivate::grContext):
+ * platform/chromium/support/GraphicsContext3DPrivate.h:
+ (WebCore):
+ (GraphicsContext3DPrivate):
+ * platform/graphics/chromium/Extensions3DChromium.h:
+
+2012-06-26 Yasuhiro Matsuda <mazda@chromium.org>
+
+ [chromium] Add the workaround of IOSurface-related corruption during readback on Mac OS X.
+ https://bugs.webkit.org/show_bug.cgi?id=89797
+
+ Reviewed by James Robinson.
+
+ No new tests. This patch doesn't change behavior.
+
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::getFramebufferPixels):
+
+2012-06-26 Alexei Filippov <alexeif@chromium.org>
+
+ Web Inspector: Native memory snapshots crash in debug mode.
+ https://bugs.webkit.org/show_bug.cgi?id=89977
+
+ Reviewed by Yury Semikhatsky.
+
+ * bindings/v8/V8DOMWrapper.cpp:
+ (WebCore::V8DOMWrapper::maybeDOMWrapper):
+
+2012-06-26 Huang Dongsung <luxtella@company100.net>
+
+ [Texmap] Bug fix typo about computing bytesPerLine in BitmapTextureGL.
+ https://bugs.webkit.org/show_bug.cgi?id=89924
+
+ "bytesPerLine == targetRect.width() / 4" is invalid.
+ This patch amended it into "bytesPerLine == targetRect.width() * 4".
+ Moreover, changed magic number 4 to bytesPerPixel.
+
+ Reviewed by Noam Rosenthal.
+
+ No new tests. Covered by existing tests.
+
+ * platform/graphics/texmap/TextureMapperGL.cpp:
+ (WebCore::BitmapTextureGL::updateContents):
+
+2012-06-26 Roland Takacs <takacs.roland@stud.u-szeged.hu>
+
+ Shader compiler unprepared to make ESSL output when GLES is used
+ https://bugs.webkit.org/show_bug.cgi?id=87718
+
+ Reviewed by Noam Rosenthal.
+
+ Defined a new member that says what type of output code must be generated
+ (SH_GLSL_OUTPUT, SH_ESSL_OUTPUT). It is set within the constructor.
+
+ * platform/graphics/ANGLEWebKitBridge.cpp:
+ (WebCore::ANGLEWebKitBridge::ANGLEWebKitBridge):
+ (WebCore::ANGLEWebKitBridge::validateShaderSource):
+ * platform/graphics/ANGLEWebKitBridge.h:
+ (ANGLEWebKitBridge):
+ * platform/graphics/qt/GraphicsContext3DQt.cpp:
+ (WebCore::GraphicsContext3D::GraphicsContext3D):
+
+2012-06-26 Philip Rogers <pdr@google.com>
+
+ Fix bug where animations failed to start
+ https://bugs.webkit.org/show_bug.cgi?id=89943
+
+ Reviewed by Nikolas Zimmermann.
+
+ The unpause code previously checked that the animations had not started
+ before un-setting the pause state. This meant that if an animation was
+ paused and unpaused before the animations started, it would remain in the
+ paused state. This patch simply reorders the unpause logic to fix this bug.
+
+ Test: svg/custom/animate-initial-pause-unpause.html
+
+ * svg/animation/SMILTimeContainer.cpp:
+ (WebCore::SMILTimeContainer::resume):
+
+2012-06-26 Yury Semikhatsky <yurys@chromium.org>
+
+ Web Inspector: popover is not shown for detached DOM nodes, not referenced directly from JS
+ https://bugs.webkit.org/show_bug.cgi?id=89955
+
+ Reviewed by Vsevolod Vlasov.
+
+ Show object popover for all heap snapshot nodes event for those whose
+ canBeQueried flag is false. We didn't show popover for such objects before
+ as it could lead to the backend crash. In the meantime the backend shouldn't
+ fail on such DOM wrappers and report an error if it cannot resolve
+ inspected object.
+
+ * inspector/front-end/HeapSnapshotGridNodes.js:
+ (WebInspector.HeapSnapshotGenericObjectNode):
+ (WebInspector.HeapSnapshotGenericObjectNode.prototype.get data):
+ * inspector/front-end/HeapSnapshotView.js:
+ (WebInspector.HeapSnapshotView.prototype._getHoverAnchor):
+
+2012-06-26 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL] Simplify SharedBuffer::createWithContentsOfFile() implementation
+ https://bugs.webkit.org/show_bug.cgi?id=89655
+
+ Reviewed by Csaba Osztrogonác.
+
+ Simplify the implementation of SharedBuffer::createWithContentsOfFile()
+ in EFL port.
+
+ No new test, no behavior change.
+
+ * platform/efl/SharedBufferEfl.cpp:
+ (WebCore::SharedBuffer::createWithContentsOfFile):
+
+2012-06-26 Thiago Marcos P. Santos <thiago.santos@intel.com>
+
+ [EFL] REGRESSION (r121163): fast/frames/iframe-access-screen-of-deleted.html crashes
+ https://bugs.webkit.org/show_bug.cgi?id=89964
+
+ Reviewed by Andreas Kling.
+
+ Added missing null pointer check.
+
+ * platform/efl/PlatformScreenEfl.cpp:
+ (WebCore::screenDepth):
+ (WebCore::screenDepthPerComponent):
+
+2012-06-26 Taiju Tsuiki <tzik@chromium.org>
+
+ Web Inspector: Add requestMetadata command and metadataReceived event to FileSystem
+ https://bugs.webkit.org/show_bug.cgi?id=87856
+
+ Reviewed by Yury Semikhatsky.
+
+ Test: http/tests/inspector/filesystem/get-metadata.html
+
+ * inspector/Inspector.json:
+ * inspector/InspectorFileSystemAgent.cpp:
+ (WebCore):
+ (WebCore::InspectorFileSystemAgent::requestFileSystemRoot):
+ (WebCore::InspectorFileSystemAgent::requestDirectoryContent):
+ (WebCore::InspectorFileSystemAgent::requestMetadata):
+ * inspector/InspectorFileSystemAgent.h:
+ (InspectorFileSystemAgent):
+ * inspector/front-end/FileSystemModel.js:
+ (WebInspector.FileSystemModel.prototype._directoryContentReceived):
+ (WebInspector.FileSystemModel.prototype.requestMetadata):
+ (WebInspector.FileSystemModel.Entry.prototype.get isDirectory):
+ (WebInspector.FileSystemModel.Entry.prototype.requestMetadata):
+ (WebInspector.FileSystemRequestManager):
+ (WebInspector.FileSystemRequestManager.prototype._directoryContentReceived):
+ (WebInspector.FileSystemRequestManager.prototype.requestMetadata.requestAccepted):
+ (WebInspector.FileSystemRequestManager.prototype.requestMetadata):
+ (WebInspector.FileSystemRequestManager.prototype._metadataReceived):
+ (WebInspector.FileSystemDispatcher.prototype.directoryContentReceived):
+ (WebInspector.FileSystemDispatcher.prototype.metadataReceived):
+
+2012-06-25 Jocelyn Turcotte <turcotte.j@gmail.com>
+
+ [Qt] GraphicsSurface: Fix tile update artifacts on Mac
+ https://bugs.webkit.org/show_bug.cgi?id=89887
+
+ Reviewed by Noam Rosenthal.
+
+ * platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp:
+ (WebCore::GraphicsSurface::platformCopyToGLTexture):
+
+2012-06-25 Jocelyn Turcotte <turcotte.j@gmail.com>
+
+ GraphicsSurface: Fix IOSurfaceLock failures on Intel video cards.
+ https://bugs.webkit.org/show_bug.cgi?id=89883
+
+ Reviewed by Noam Rosenthal.
+
+ Follow the documentation which says: "If locking the buffer requires a readback,
+ the lock will fail with an error return of kIOReturnCannotLock."
+ Also make sure that we use the same set of flags when locking and unlocking
+ for simplicity and to follow this requirement on the kIOSurfaceLockReadOnly flag.
+
+ * platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp:
+ (WebCore::GraphicsSurface::platformLock):
+ (WebCore::GraphicsSurface::platformUnlock):
+
+2012-06-26 Philip Rogers <pdr@google.com>
+
+ Fix setCurrentTime for paused animations
+ https://bugs.webkit.org/show_bug.cgi?id=81350
+
+ Reviewed by Nikolas Zimmermann.
+
+ SMILTimeContainer::setElapsed was not resetting the pause time, breaking
+ setCurrentTime if the animation was paused.
+
+ Test: svg/custom/animate-pause-resume.html
+
+ * svg/animation/SMILTimeContainer.cpp:
+ (WebCore::SMILTimeContainer::setElapsed):
+
+2012-06-26 Csaba Osztrogonác <ossy@webkit.org>
+
+ [Qt] Unreviewed typo fix after r121144.
+
+ * Target.pri:
+
+2012-06-26 Yury Semikhatsky <yurys@chromium.org>
+
+ Web Inspector: columns in heap snapshot summary view are not resizable
+ https://bugs.webkit.org/show_bug.cgi?id=89952
+
+ Reviewed by Vsevolod Vlasov.
+
+ * inspector/front-end/HeapSnapshotDataGrids.js:
+ (WebInspector.HeapSnapshotViewportDataGrid.prototype.onResize): overriden method
+ should call overriden one to make sure column resizers are added to the DataGrid.
+
+2012-06-26 Kent Tamura <tkent@chromium.org>
+
+ Refactoring: Simplify FormController interface
+ https://bugs.webkit.org/show_bug.cgi?id=89951
+
+ Reviewed by Kentaro Hara.
+
+ - Remove FormController::hasStateForNewFormElements()
+ takeStateForFormElement() can check the emptiness, and return an empty
+ FormControlState.
+
+ - Change the argument of takeStateForFormElement()
+ Passing just one HTMLFormControlElementWithState object instead of two
+ AtomicStringImpl. This is a preparation to use
+ HTMLFormControlElementWithState::form() in FormController.
+
+ No new tests. Just a refactoring.
+
+ * html/FormController.cpp:
+ (WebCore::FormController::takeStateForFormElement):
+ * html/FormController.h:
+ (FormController):
+ * html/HTMLFormControlElementWithState.cpp:
+ (WebCore::HTMLFormControlElementWithState::finishParsingChildren):
+
+2012-06-26 Dominic Cooney <dominicc@chromium.org>
+
+ WheelEvent should inherit from MouseEvent
+ https://bugs.webkit.org/show_bug.cgi?id=76104
+
+ Reviewed by Kentaro Hara.
+
+ The spec for WheelEvent is
+ <http://www.w3.org/TR/DOM-Level-3-Events/#webidl-events-WheelEvent>
+
+ Tests: fast/events/event-creation.html
+ http://samples.msdn.microsoft.com/ietestcenter/dominheritance/showdominheritancetest.htm?Prototype_WheelEvent
+
+ * bindings/objc/PublicDOMInterfaces.h: Remove redundant MouseEvent API from WheelEvent
+ * bindings/scripts/CodeGeneratorObjC.pm: MouseEvents are Events
+ * dom/MouseEvent.h: Expose no-arg constructor to WheelEvent
+ * dom/WheelEvent.cpp:
+ (WebCore::WheelEvent::WheelEvent): Call MouseEvent superconstructor
+ (WebCore::WheelEvent::isMouseEvent): Existing callers use this just for
+ moves and clicks, ie the type is exactly MouseEvent.
+ * dom/WheelEvent.h: Extend MouseEvent
+ * dom/WheelEvent.idl: "
+
+2012-06-25 Ryosuke Niwa <rniwa@webkit.org>
+
+ Get rid of firstItem and nextItem from HTMLCollection
+ https://bugs.webkit.org/show_bug.cgi?id=89923
+
+ Reviewed by Andreas Kling.
+
+ Removed HTMLCollection::firstItem and HTMLCollection::nextItem.
+ Also added hasAnyItem() and hasExactlyOneItem() to HTMLCollection so that named getter on Document
+ doesn't need to compute the full length before returning a HTMLCollection.
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::getDocumentLinks):
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::namedItemGetter):
+ * bindings/js/JSHTMLDocumentCustom.cpp:
+ (WebCore::JSHTMLDocument::nameGetter):
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ (WebCore::V8DOMWindow::namedPropertyGetter):
+ * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+ (WebCore::V8HTMLDocument::GetNamedProperty):
+ * dom/Document.cpp:
+ (WebCore::Document::openSearchDescriptionURL):
+ * html/HTMLCollection.cpp:
+ (WebCore::shouldIncludeChildren):
+ (WebCore::HTMLCollection::HTMLCollection):
+ (WebCore):
+ (WebCore::HTMLCollection::item):
+ * html/HTMLCollection.h:
+ (HTMLCollection):
+ (WebCore::HTMLCollection::hasAnyItem):
+ (WebCore::HTMLCollection::hasExactlyOneItem):
+ * html/HTMLMapElement.cpp:
+ (WebCore::HTMLMapElement::imageElement):
+
+2012-06-25 Pratik Solanki <psolanki@apple.com>
+
+ JavaScript resources have low priority when SVG is enabled
+ https://bugs.webkit.org/show_bug.cgi?id=89932
+ <rdar://problem/11741325>
+
+ Reviewed by Adele Peterson.
+
+ r108785 inadvertently lowered the priority of JavaScript resources. Fix the code so we set
+ the correct priority for scripts. Also, move the code so that all ifdefs are together at the
+ bottom to make it a bit easier to read..
+
+ * loader/cache/CachedResource.cpp:
+ (WebCore::defaultPriorityForResourceType):
+
+2012-06-25 Luke Macpherson <macpherson@chromium.org>
+
+ Add runtime flag to enable/disable CSS variables (in addition to existing compile-time flag).
+ https://bugs.webkit.org/show_bug.cgi?id=89542
+
+ Reviewed by Dimitri Glazkov.
+
+ Added fast/css/variables/build-supports-variables.html to test runtime flag in test environment.
+ Updated all other css variables tests to enable the runtime flag from JS.
+
+ * css/CSSParser.cpp:
+ (WebCore::CSSParserContext::CSSParserContext):
+ (WebCore::operator==):
+ (WebCore::CSSParser::cssVariablesEnabled):
+ (WebCore):
+ (WebCore::CSSParser::detectDashToken):
+ (WebCore::CSSParser::lex):
+ * css/CSSParser.h:
+ (CSSParser):
+ * css/CSSParserMode.h:
+ (CSSParserContext):
+ * page/Settings.h:
+ (Settings):
+ (WebCore::Settings::setCSSVariablesEnabled):
+ (WebCore::Settings::cssVariablesEnabled):
+
+2012-06-25 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed build fix after r121223.
+
+ Fix the --minimal Qt build, TextureMapperGL now requires WebGL to be enabled.
+
+ * Target.pri:
+ * WebCore.pri:
+
+2012-06-25 Dana Jansens <danakj@chromium.org>
+
+ [chromium] CCOverdrawMetrics should use the deviceViewportSize to count actual pixels
+ https://bugs.webkit.org/show_bug.cgi?id=89922
+
+ Reviewed by Adrienne Walker.
+
+ * platform/graphics/chromium/cc/CCOverdrawMetrics.cpp:
+ (WebCore::CCOverdrawMetrics::recordMetricsInternal):
+
+2012-06-25 Huang Dongsung <luxtella@company100.net>
+
+ [Texmap] Remove platform specific code in BitmapImageGL::updateContents by using
+ GraphicsContext3D::extractImageData.
+ https://bugs.webkit.org/show_bug.cgi?id=89867
+
+ Reviewed by Noam Rosenthal.
+
+ No new tests. Covered by existing tests.
+
+ * platform/graphics/texmap/TextureMapperGL.cpp:
+ (WebCore):
+ (WebCore::BitmapTextureGL::didReset):
+ (WebCore::BitmapTextureGL::updateContents):
+
+2012-06-25 James Robinson <jamesr@chromium.org>
+
+ [chromium] Remove uncalled ManagedTexture::framebufferTexture2D
+ https://bugs.webkit.org/show_bug.cgi?id=89930
+
+ Reviewed by Adrienne Walker.
+
+ Removing dead code.
+
+ * platform/graphics/chromium/ManagedTexture.cpp:
+ * platform/graphics/chromium/ManagedTexture.h:
+ (ManagedTexture):
+
+2012-06-25 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r121206.
+ http://trac.webkit.org/changeset/121206
+ https://bugs.webkit.org/show_bug.cgi?id=89935
+
+ [chromium] webkit_unit_tests
+ WebViewTest.MHTMLWithMissingResourceFinishesLoading crash
+ (Requested by ukai on #webkit).
+
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::scheduleArchiveLoad):
+
+2012-06-25 Anantanarayanan G Iyengar <ananta@chromium.org>
+
+ [chromium] Ensure that the compositor code which is aware of flipped status of video-textures
+ per platform executes on Windows.
+ https://bugs.webkit.org/show_bug.cgi?id=89914
+
+ Reviewed by James Robinson.
+
+ No new tests. (HW video decode is still only being tested manually for orientation)
+
+ * platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
+ (WebCore::CCVideoLayerImpl::appendQuads):
+
+2012-06-25 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r121176.
+ http://trac.webkit.org/changeset/121176
+ https://bugs.webkit.org/show_bug.cgi?id=89934
+
+ [chromium] browser_tests assert failed:
+ FATAL:native_theme_win.cc(1541)] Check failed: false. Invalid
+ part: 16 (Requested by ukai on #webkit).
+
+ * platform/chromium/PlatformSupport.h:
+ (PlatformSupport):
+ * platform/chromium/ScrollbarThemeChromiumWin.cpp:
+ (WebCore::ScrollbarThemeChromiumWin::buttonSize):
+
+2012-06-25 Shinya Kawanaka <shinyak@chromium.org>
+
+ [Shadow] Deleting list distributed to Shadow DOM does not work correctly.
+ https://bugs.webkit.org/show_bug.cgi?id=89170
+
+ Reviewed by Ryosuke Niwa.
+
+ When deleting several elements distributed to Shadow DOM, some renderers might be gone in
+ processing deletion. To fix them, we should call isContentEditable() instead of rendererIsEditable().
+
+ Test: editing/shadow/delete-list-in-shadow.html
+
+ * editing/DeleteFromTextNodeCommand.cpp:
+ (WebCore::DeleteFromTextNodeCommand::doApply):
+
+2012-06-25 Min Qin <qinmin@chromium.org>
+
+ [Chromium] Fix the css stylesheet for android media controls after recent changes
+ https://bugs.webkit.org/show_bug.cgi?id=89910
+
+ Reviewed by Adam Barth.
+
+ After the recent changes on upstream chrome video controls, we need to change the css style sheet for chrome on android.
+ No tests needed, just css changes.
+
+ * css/mediaControlsChromiumAndroid.css:
+ (audio):
+ (audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel):
+ (::-webkit-media-controls):
+ (audio::-webkit-media-controls-enclosure, video::-webkit-media-controls-enclosure):
+ (video::-webkit-media-controls-enclosure):
+ (audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-button):
+ (audio::-webkit-media-controls-play-button, video::-webkit-media-controls-play-button):
+ (audio::-webkit-media-controls-time-remaining-display, video::-webkit-media-controls-time-remaining-display):
+ (audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline):
+ (video::-webkit-media-controls-fullscreen-button):
+ (input[type="range"]::-webkit-media-slider-container):
+ (input[type="range"]::-webkit-media-slider-thumb):
+ (audio::-webkit-media-controls-fullscreen-button):
+
+2012-06-25 Huang Dongsung <luxtella@company100.net>
+
+ [Qt] Avoid a deep copy of QImage in GraphicsContext3D::getImageData.
+ https://bugs.webkit.org/show_bug.cgi?id=89865
+
+ Reviewed by Noam Rosenthal.
+
+ No new tests. Covered by existing tests.
+
+ * platform/graphics/qt/GraphicsContext3DQt.cpp:
+ (WebCore::GraphicsContext3D::getImageData):
+
+2012-06-25 Nick Carter <nick@chromium.org>
+
+ Reduce memory footprint of BitmapImage Vectors.
+ https://bugs.webkit.org/show_bug.cgi?id=86563
+
+ Reviewed by Simon Fraser.
+
+ No new tests, affects template params only.
+
+ * platform/graphics/BitmapImage.h:
+ (BitmapImage): use an inline capacity of 1 for the image frame Vector
+ * platform/image-decoders/ImageDecoder.h:
+ (ImageDecoder): use an inline capacity of 1 for the image frame Vector
+
+2012-06-25 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed, rolling out r121145.
+ http://trac.webkit.org/changeset/121145
+ https://bugs.webkit.org/show_bug.cgi?id=89847
+
+ Had an objection for the change.
+
+ * html/FormController.cpp:
+ (WebCore):
+ (WebCore::FormControlState::serializeTo):
+ (WebCore::FormControlState::deserialize):
+ (WebCore::formStateSignature):
+ (WebCore::FormController::formElementsState):
+ (WebCore::FormController::setStateForNewFormElements):
+ * html/FormController.h:
+ (FormControlState):
+ * html/shadow/CalendarPickerElement.cpp:
+ (WebCore::addJavaScriptString):
+
+2012-06-25 Jay Civelli <jcivelli@chromium.org>
+
+ Fix progress load reporting for MHTML documents.
+
+ MHTML documents containing references to resources they don't include
+ never finish loading.
+ https://bugs.webkit.org/show_bug.cgi?id=71859
+
+ Reviewed by Nate Chapin.
+
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::scheduleArchiveLoad):
+
+2012-06-25 James Robinson <jamesr@chromium.org>
+
+ [chromium] Use WebGraphicsContext3D in compositor implementation
+ https://bugs.webkit.org/show_bug.cgi?id=89700
+
+ Reviewed by Adrienne Walker.
+
+ This converts the compositor implementation from using WebCore::GraphicsContext3D to using the Platform-provided
+ WebGraphicsContext3D. This removes several unnecessary layers of indirection/wrapping and cuts down the
+ compositor's implementation dependencies. GraphicsContext3D.h is still widely used to provide GL enum values.
+ Most of the changes are purely mechanical - changing type names and the like.
+
+ Ownership is changed a bit. Instead of multiple components holding references to the compositor's context, the
+ context is now owned by the CCGraphicsContext, which is now owned directly by CCLayerTreeHostImpl.
+ CCLayerTreeHostImpl also has ownership of its CCRenderer (LayerRendererChromium in 3D mode) and passes a
+ non-owning pointer down to the CCRenderer.
+
+ Extension checking is a bit different. The compositor does not (and never has) used extensions provided by
+ WebGL's request/ensure mechanism. It simply checks for the existence of extensions it needs in the GL_EXTENSIONS
+ string.
+
+ FrameBufferSkPictureCanvasLayerTextureUpdater had to be patched as well, since it was grabbing a GrContext off
+ of the compositor's GraphicsContext3D. This caused many problems. It was inefficient, since it required a full
+ state flush when switching between ganesh and compositor calls. The gpu memory management was completely broken
+ since the compositor clobbered ganesh's onMemoryAllocationChanged callback. This moves FBSkPCLTU over to using
+ the appropriate SharedGraphicsContext3D, like filters.
+
+ * platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp:
+ (WebCore::FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::updateRect):
+ (WebCore::FrameBufferSkPictureCanvasLayerTextureUpdater::updateTextureRect):
+ * platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h:
+ (FrameBufferSkPictureCanvasLayerTextureUpdater):
+ * platform/graphics/chromium/GeometryBinding.cpp:
+ (WebCore::GeometryBinding::GeometryBinding):
+ * platform/graphics/chromium/GeometryBinding.h:
+ (WebKit):
+ (GeometryBinding):
+ (WebCore::GeometryBinding::context):
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::create):
+ (WebCore::LayerRendererChromium::LayerRendererChromium):
+ (WebCore::LayerRendererChromium::initialize):
+ (WebCore::LayerRendererChromium::~LayerRendererChromium):
+ (WebCore::LayerRendererChromium::context):
+ (WebCore::LayerRendererChromium::debugGLCall):
+ (WebCore::LayerRendererChromium::setVisible):
+ (WebCore::LayerRendererChromium::drawStreamVideoQuad):
+ (WebCore::LayerRendererChromium::drawHeadsUpDisplay):
+ (WebCore::LayerRendererChromium::swapBuffers):
+ (WebCore::LayerRendererChromium::onMemoryAllocationChanged):
+ (WebCore):
+ (WebCore::LayerRendererChromium::onMemoryAllocationChangedOnImplThread):
+ (WebCore::LayerRendererChromium::discardFramebuffer):
+ (WebCore::LayerRendererChromium::ensureFramebuffer):
+ (WebCore::LayerRendererChromium::onContextLost):
+ (WebCore::LayerRendererChromium::getFramebufferPixels):
+ (WebCore::LayerRendererChromium::getFramebufferTexture):
+ (WebCore::LayerRendererChromium::bindFramebufferToTexture):
+ (WebCore::LayerRendererChromium::initializeSharedObjects):
+ (WebCore::LayerRendererChromium::tileCheckerboardProgram):
+ (WebCore::LayerRendererChromium::solidColorProgram):
+ (WebCore::LayerRendererChromium::headsUpDisplayProgram):
+ (WebCore::LayerRendererChromium::renderPassProgram):
+ (WebCore::LayerRendererChromium::renderPassProgramAA):
+ (WebCore::LayerRendererChromium::renderPassMaskProgram):
+ (WebCore::LayerRendererChromium::renderPassMaskProgramAA):
+ (WebCore::LayerRendererChromium::tileProgram):
+ (WebCore::LayerRendererChromium::tileProgramOpaque):
+ (WebCore::LayerRendererChromium::tileProgramAA):
+ (WebCore::LayerRendererChromium::tileProgramSwizzle):
+ (WebCore::LayerRendererChromium::tileProgramSwizzleOpaque):
+ (WebCore::LayerRendererChromium::tileProgramSwizzleAA):
+ (WebCore::LayerRendererChromium::textureProgram):
+ (WebCore::LayerRendererChromium::textureProgramFlip):
+ (WebCore::LayerRendererChromium::textureIOSurfaceProgram):
+ (WebCore::LayerRendererChromium::videoYUVProgram):
+ (WebCore::LayerRendererChromium::videoStreamTextureProgram):
+ (WebCore::LayerRendererChromium::cleanupSharedObjects):
+ (WebCore::LayerRendererChromium::isContextLost):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+ (WebKit):
+ (WebCore):
+ (LayerRendererChromium):
+ (WebCore::LayerRendererChromium::isFramebufferDiscarded):
+ * platform/graphics/chromium/LayerTextureSubImage.cpp:
+ (WebCore::LayerTextureSubImage::uploadWithTexSubImage):
+ (WebCore::LayerTextureSubImage::uploadWithMapTexSubImage):
+ * platform/graphics/chromium/ManagedTexture.cpp:
+ (WebCore::ManagedTexture::bindTexture):
+ (WebCore::ManagedTexture::framebufferTexture2D):
+ * platform/graphics/chromium/PlatformColor.h:
+ (WebCore::PlatformColor::bestTextureFormat):
+ * platform/graphics/chromium/ProgramBinding.cpp:
+ (WebCore::contextLost):
+ (WebCore::ProgramBindingBase::init):
+ (WebCore::ProgramBindingBase::cleanup):
+ (WebCore::ProgramBindingBase::loadShader):
+ (WebCore::ProgramBindingBase::createShaderProgram):
+ * platform/graphics/chromium/ProgramBinding.h:
+ (WebKit):
+ (ProgramBindingBase):
+ (WebCore::ProgramBinding::ProgramBinding):
+ (WebCore::ProgramBinding::initialize):
+ * platform/graphics/chromium/ShaderChromium.cpp:
+ (WebCore::VertexShaderPosTex::init):
+ (WebCore::VertexShaderPosTexYUVStretch::init):
+ (WebCore::VertexShaderPos::init):
+ (WebCore::VertexShaderPosTexTransform::init):
+ (WebCore::VertexShaderQuad::init):
+ (WebCore::VertexShaderTile::init):
+ (WebCore::VertexShaderVideoTransform::init):
+ (WebCore::FragmentTexAlphaBinding::init):
+ (WebCore::FragmentTexOpaqueBinding::init):
+ (WebCore::FragmentShaderOESImageExternal::init):
+ (WebCore::FragmentShaderRGBATexAlphaAA::init):
+ (WebCore::FragmentTexClampAlphaAABinding::init):
+ (WebCore::FragmentShaderRGBATexAlphaMask::init):
+ (WebCore::FragmentShaderRGBATexAlphaMaskAA::init):
+ (WebCore::FragmentShaderYUVVideo::init):
+ (WebCore::FragmentShaderColor::init):
+ (WebCore::FragmentShaderCheckerboard::init):
+ * platform/graphics/chromium/ShaderChromium.h:
+ (WebKit):
+ (VertexShaderPosTex):
+ (VertexShaderPosTexYUVStretch):
+ (VertexShaderPos):
+ (WebCore::VertexShaderPosTexIdentity::init):
+ (VertexShaderPosTexTransform):
+ (VertexShaderQuad):
+ (VertexShaderTile):
+ (VertexShaderVideoTransform):
+ (FragmentTexAlphaBinding):
+ (FragmentTexOpaqueBinding):
+ (FragmentShaderOESImageExternal):
+ (FragmentShaderRGBATexAlphaAA):
+ (FragmentTexClampAlphaAABinding):
+ (FragmentShaderRGBATexAlphaMask):
+ (FragmentShaderRGBATexAlphaMaskAA):
+ (FragmentShaderYUVVideo):
+ (FragmentShaderColor):
+ (FragmentShaderCheckerboard):
+ * platform/graphics/chromium/TextureCopier.cpp:
+ (WebCore::AcceleratedTextureCopier::AcceleratedTextureCopier):
+ (WebCore::AcceleratedTextureCopier::~AcceleratedTextureCopier):
+ (WebCore::AcceleratedTextureCopier::copyTexture):
+ * platform/graphics/chromium/TextureCopier.h:
+ (WebKit):
+ (WebCore):
+ (WebCore::AcceleratedTextureCopier::create):
+ (AcceleratedTextureCopier):
+ * platform/graphics/chromium/TextureManager.h:
+ * platform/graphics/chromium/ThrottledTextureUploader.cpp:
+ (WebCore::ThrottledTextureUploader::Query::Query):
+ (WebCore::ThrottledTextureUploader::Query::~Query):
+ (WebCore::ThrottledTextureUploader::Query::begin):
+ (WebCore::ThrottledTextureUploader::Query::end):
+ (WebCore::ThrottledTextureUploader::Query::isPending):
+ (WebCore::ThrottledTextureUploader::Query::wait):
+ (WebCore::ThrottledTextureUploader::ThrottledTextureUploader):
+ * platform/graphics/chromium/ThrottledTextureUploader.h:
+ (WebKit):
+ (WebCore::ThrottledTextureUploader::create):
+ (WebCore::ThrottledTextureUploader::Query::create):
+ (Query):
+ (ThrottledTextureUploader):
+ * platform/graphics/chromium/TrackingTextureAllocator.cpp:
+ (WebCore::TrackingTextureAllocator::TrackingTextureAllocator):
+ (WebCore::TrackingTextureAllocator::createTexture):
+ (WebCore::TrackingTextureAllocator::deleteTexture):
+ (WebCore::TrackingTextureAllocator::deleteAllTextures):
+ * platform/graphics/chromium/TrackingTextureAllocator.h:
+ (WebKit):
+ (WebCore::TrackingTextureAllocator::create):
+ (TrackingTextureAllocator):
+ * platform/graphics/chromium/cc/CCGraphicsContext.h:
+ (CCGraphicsContext):
+ (WebCore::CCGraphicsContext::create2D):
+ (WebCore::CCGraphicsContext::create3D):
+ (WebCore::CCGraphicsContext::context3D):
+ (WebCore::CCGraphicsContext::CCGraphicsContext):
+ * platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp:
+ (WebCore::CCHeadsUpDisplay::draw):
+ * platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp:
+ (WebCore::CCIOSurfaceLayerImpl::~CCIOSurfaceLayerImpl):
+ (WebCore::CCIOSurfaceLayerImpl::willDraw):
+ * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+ (WebCore::CCLayerTreeHost::createContext):
+ * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+ (CCLayerTreeHostClient):
+ (WebCore::LayerRendererCapabilities::LayerRendererCapabilities):
+ (LayerRendererCapabilities):
+ (WebCore::CCLayerTreeHost::needsSharedContext):
+ (CCLayerTreeHost):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+ (WebCore::CCLayerTreeHostImpl::initializeLayerRenderer):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
+ (CCLayerTreeHostImpl):
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+ (WebCore::CCSingleThreadProxy::initializeContext):
+ (WebCore::CCSingleThreadProxy::recreateContext):
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.h:
+ * platform/graphics/chromium/cc/CCTextureUpdater.cpp:
+ (WebCore::CCTextureUpdater::update):
+ * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+ (WebCore::CCThreadProxy::initializeContext):
+ (WebCore::CCThreadProxy::recreateContext):
+ (WebCore::CCThreadProxy::beginFrame):
+ (WebCore::CCThreadProxy::initializeContextOnImplThread):
+ (WebCore::CCThreadProxy::recreateContextOnImplThread):
+ * platform/graphics/chromium/cc/CCThreadProxy.h:
+ (CCThreadProxy):
+ * platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
+ (WebCore::CCVideoLayerImpl::FramePlane::allocateData):
+ (WebCore::CCVideoLayerImpl::FramePlane::freeData):
+ (WebCore::CCVideoLayerImpl::copyPlaneData):
+
+2012-06-25 Adrienne Walker <enne@google.com>
+
+ [chromium] Make CCThreadProxy not draw a frame mid-commit
+ https://bugs.webkit.org/show_bug.cgi?id=89905
+
+ Reviewed by James Robinson.
+
+ If commitComplete is not called before the next frame goes up, then
+ then the max scroll position on the root scroll layer is not updated.
+ This causes the compositor-side scrollbar to have an incorrect
+ visibleSize, causing the thumbRect to become stretched, relative to
+ when it was originally painted.
+
+ CCScheduler::setVisible has the side effect of kicking off a frame, so
+ move it last.
+
+ * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+ (WebCore::CCThreadProxy::scheduledActionCommit):
+
+2012-06-25 Pablo Flouret <pablof@motorola.com>
- * platform/PlatformExportMacros.h:
+ EventSource: Events should not be dispatched after close()
+ https://bugs.webkit.org/show_bug.cgi?id=85346
+
+ Reviewed by Adam Barth.
+
+ Spec changed to make sure that no events are dispatched after close() is
+ called, even if more data was received before the call to close().
+
+ See,
+ https://www.w3.org/Bugs/Public/show_bug.cgi?id=14331#c5
+ http://html5.org/tools/web-apps-tracker?from=6771&to=6772
+
+ Firefox behaves like this already.
+
+ Test: http/tests/eventsource/eventsource-events-after-close.html
+
+ * page/EventSource.cpp:
+ (WebCore::EventSource::parseEventStream):
+
+2012-06-25 Mike West <mkwst@chromium.com>
+
+ Fixing compilation failure in StyleResolver.cpp/CSSParser.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=89892
+
+ Reviewed by Alexis Menard.
+
+ Adding CSSPropertyVariable to switch statements in CSSParser and
+ StyleResolver to fix compilation errors under ninja/clang. I've
+ added both as new cases to the switches, with FIXME comments for
+ implementation.
+
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::collectMatchingRulesForList):
+
+2012-06-25 Jay Civelli <jcivelli@chromium.org>
+
+ Fix for a memory leak with MHTMLArchives.
+
+ MHTML files present a flat list of frames and resources but the WebKit Archive
+ has a tree strcture. So the MHTMLArchive class make sures that every frame
+ knows about any other frames and resources.
+ Because these objects are ref counted, that would introduce circular references
+ preventing the entire Archive from being deleted.
+ This fixes this by:
+ - making sure the top-frame (which appears as the first entry in the MHTML) is
+ not referenced by the other frames.
+ - when the main frame is deleted it traverse the entire subarchive (sub-frames)
+ graph and makes sure they clear all their references to other subarchives.
+
+ https://bugs.webkit.org/show_bug.cgi?id=88470
+
+ Reviewed by Adam Barth.
+
+ * loader/archive/Archive.cpp:
+ (WebCore::Archive::clearAllSubframeArchives):
+ (WebCore):
+ (WebCore::Archive::clearAllSubframeArchivesImpl):
+ * loader/archive/Archive.h:
+ (Archive):
+ * loader/archive/mhtml/MHTMLArchive.cpp:
+ (WebCore::MHTMLArchive::~MHTMLArchive):
+ (WebCore):
+ (WebCore::MHTMLArchive::create):
+ * loader/archive/mhtml/MHTMLArchive.h:
+ (MHTMLArchive):
+
+2012-06-25 Alpha Lam <hclam@chromium.org>
+
+ Unreviewed, rolling out r121178.
+ http://trac.webkit.org/changeset/121178
+ https://bugs.webkit.org/show_bug.cgi?id=89784
+
+ New unit test added is failing on WebKit Linux (dbg)
+
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::LayerChromium::setBounds):
+
+2012-06-25 Alpha Lam <hclam@chromium.org>
+
+ Unreviewed, rolling out r121137.
+ http://trac.webkit.org/changeset/121137
+
+ Chromium build fix, (un)touch files to build on Chromium Win
+ Release
+
+ * css/CSSParserMode.h:
+ * css/CSSValue.h:
+ (WebCore):
+ * css/CSSVariableValue.h:
+ * page/Settings.h:
+ * rendering/style/RenderStyle.h:
+ * rendering/style/StyleRareInheritedData.h:
+ * rendering/style/StyleVariableData.h:
+
+2012-06-25 Alpha Lam <hclam@chromium.org>
+
+ Unreviewed, rolling out r121129.
+ http://trac.webkit.org/changeset/121129
+ https://bugs.webkit.org/show_bug.cgi?id=89542
+
+ Chromium ASan failure: crbug.com/134402
+
+ * css/CSSParser.cpp:
+ (WebCore::CSSParserContext::CSSParserContext):
+ (WebCore::operator==):
+ (WebCore):
+ (WebCore::CSSParser::detectDashToken):
+ (WebCore::CSSParser::lex):
+ * css/CSSParser.h:
+ (CSSParser):
+ * css/CSSParserMode.h:
+ (CSSParserContext):
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::collectMatchingRulesForList):
+ * page/Settings.h:
+ (Settings):
+ * testing/InternalSettings.cpp:
+ * testing/InternalSettings.h:
+ (InternalSettings):
+ * testing/InternalSettings.idl:
+
+2012-06-25 Adam Barth <abarth@webkit.org>
+
+ Use InterpolationLow on chromium-android
+ https://bugs.webkit.org/show_bug.cgi?id=89849
+
+ Reviewed by Daniel Bates.
+
+ Min Qin writes:
+
+ Using InterpolationHigh is very very expensive when resampling
+ images. For example, it took 1400ms to decode an image on
+ http://www.crossfitsunnyvale.com/blog/, but it took 2800 ms to do the
+ resampling Switch to InterpolationLow will result in linear
+ resampling. It is much faster as the time it tooks is almost
+ non-noticable [sic] on the trace.
+
+ * platform/graphics/skia/PlatformContextSkia.cpp:
+ (WebCore::PlatformContextSkia::State::State):
+
+2012-06-25 Joshua Bell <jsbell@chromium.org>
+
+ IndexedDB: Remove unused backend property accessors
+ https://bugs.webkit.org/show_bug.cgi?id=89893
+
+ Reviewed by Darin Fisher.
+
+ Following the "metadata" API addition in trac.webkit.org/changeset/121059
+ the IDBXXXBackendInterface types no longer need per-property accessors.
+
+ No new tests - no functional changes.
+
+ * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: Remove method implementation.
+ * Modules/indexeddb/IDBDatabaseBackendImpl.h: Remove methods.
+ (IDBDatabaseBackendImpl):
+ * Modules/indexeddb/IDBDatabaseBackendInterface.h: Remove methods.
+ (IDBDatabaseBackendInterface):
+ * Modules/indexeddb/IDBIndexBackendImpl.h: Make methods simple accessors.
+ (IDBIndexBackendImpl):
+ (WebCore::IDBIndexBackendImpl::name):
+ (WebCore::IDBIndexBackendImpl::keyPath):
+ (WebCore::IDBIndexBackendImpl::unique):
+ (WebCore::IDBIndexBackendImpl::multiEntry):
+ * Modules/indexeddb/IDBIndexBackendInterface.h: Remove methods.
+ * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: Remove method implementation.
+ * Modules/indexeddb/IDBObjectStoreBackendImpl.h: Make methods simple accessors.
+ (IDBObjectStoreBackendImpl):
+ (WebCore::IDBObjectStoreBackendImpl::name):
+ (WebCore::IDBObjectStoreBackendImpl::keyPath):
+ (WebCore::IDBObjectStoreBackendImpl::autoIncrement):
+ * Modules/indexeddb/IDBObjectStoreBackendInterface.h: Remove methods.
+
+2012-06-25 Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com>
+
+ [EFL] Add support for building with ENABLE_MEDIA_STREAM
+ https://bugs.webkit.org/show_bug.cgi?id=88413
+
+ Reviewed by Dirk Pranke.
+
+ Add files which are needed for supporting the Media Stream
+ feature.
+
+ No change in functionality so no new tests.
+
+ * PlatformEfl.cmake:
+
+2012-06-25 Huang Dongsung <luxtella@company100.net>
+
+ [Texmap] TextureMapperPaintOptions should keep current surface.
+ https://bugs.webkit.org/show_bug.cgi?id=89266
+
+ Before this patch, if a replica layer has a descendant replica child, the child
+ layer does not render the result in the parent layer's surface because
+ TextureMapperPaintOptions does not keep current surface.
+ This patch amends that TextureMapperPaintOptions keeps current surface before
+ calling paintSelfAndChildrenWithReplica recursively, so previous surface could be
+ restored after paintSelfAndChildrenWithReplica.
+
+ Reviewed by Noam Rosenthal.
+
+ Test: compositing/reflections/animation-inside-reflection.html
+
+ * platform/graphics/texmap/TextureMapperLayer.cpp:
+ (WebCore::TextureMapperLayer::paintRecursive):
+
+2012-06-25 Ian Vollick <vollick@chromium.org>
+
+ [chromium] Layer chromium should need a redraw after getting its first non-empty bounds.
+ https://bugs.webkit.org/show_bug.cgi?id=89784
+
+ Reviewed by James Robinson.
+
+ Previously, we'd only set needs redraw if the old bounds were zero,
+ and the new bounds were non-zero, but we should actually have
+ checked that the old bounds were non-empty.
+
+ Unit test: LayerChromiumTestWithoutFixture.setBoundsTriggersSetNeedsRedrawAfterGettingNonEmptyBounds
+
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::LayerChromium::setBounds):
+
+2012-06-25 Scott Graham <scottmg@chromium.org>
+
+ Plumb Scrollbar button dimensions down to WebThemeEngine
+ https://bugs.webkit.org/show_bug.cgi?id=89264
+
+ Reviewed by James Robinson.
+
+ Rather than making the height of the scrollbar buttons the same as the
+ width of the scrollbar, delegate to the WebThemeEngine. This allows
+ matching the Aura theme rather than the standard Windows theme.
+
+ No new tests, as bounds are overridden for DRT.
+
+ * platform/chromium/PlatformSupport.h:
+ (PlatformSupport):
+ * platform/chromium/ScrollbarThemeChromiumWin.cpp:
+ (WebCore::ScrollbarThemeChromiumWin::buttonSize):
+
+2012-06-25 Antti Koivisto <antti@apple.com>
+
+ Fast path for simple transform parsing
+ https://bugs.webkit.org/show_bug.cgi?id=89898
+
+ Reviewed by Anders Carlsson.
+
+ When manipulating transforms using script, the transform value parsing can show up in profiles pretty heavily
+ (up 4% in some cases). We can optimize it easily by implementing a fast path that does not spin up the full CSS
+ parser, like we already do for several other common value types.
+
+ The patch implements a fast path for transform(), transformX/Y/Z() and transform3D(). It speeds up parsing by >5x.
+
+ * css/CSSParser.cpp:
+ (WebCore):
+ (WebCore::parseTransformArguments):
+ (WebCore::parseTransformValue):
+ (WebCore::CSSParser::parseValue):
+
+2012-06-25 Kwang Yul Seo <skyul@company100.net>
+
+ Remove unused static function shadowFor
+ https://bugs.webkit.org/show_bug.cgi?id=89824
+
+ Reviewed by Daniel Bates.
+
+ shadowFor is not used anymore after r117796. No behaviour changes.
+
+ * dom/TreeScopeAdopter.cpp:
+
+2012-06-25 Kwang Yul Seo <skyul@company100.net>
+
+ Remove unused constant timeWithoutMouseMovementBeforeHidingControls
+ https://bugs.webkit.org/show_bug.cgi?id=89823
+
+ Reviewed by Daniel Bates.
+
+ After r87692, timeWithoutMouseMovementBeforeHidingControls is not used anymore.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore):
+
+2012-06-25 Zeev Lieber <zlieber@chromium.org>
+
+ [Chromium] RenderPass textures are evicted at the end of every frame
+ https://bugs.webkit.org/show_bug.cgi?id=89786
+
+ Reviewed by Adrienne Walker.
+
+ Removed calls to TextureManager::reduceMemoryToLimit inside
+ finishDrawingFrame() method.
+
+ Added unit tests to verify new behavior.
+
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::finishDrawingFrame):
+
+2012-06-25 Allan Xavier <allan.xavier@undefinedltd.co.uk>
+
+ [GTK] Add graphviz debug output for the gstreamer video pipeline.
+ https://bugs.webkit.org/show_bug.cgi?id=89660
+
+ Reviewed by Martin Robinson.
+
+ Dump the current video pipeline as a graphviz DOT file when the
+ pipeline state changes or when an error occours.
+
+ No new tests as the change is only useful for debugging.
+
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+ (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
+
+2012-06-25 Adam Barth <abarth@webkit.org>
+
+ ASSERT(m_wheelEventHandlerCount > 0) can fire
+ https://bugs.webkit.org/show_bug.cgi?id=89856
+
+ Reviewed by Eric Seidel.
+
+ When a node with a wheel or a touch event is moved from one document to
+ another, the didAddMumble/didRemoveMumble calls do not balance because
+ they're called on different documents. This patch twiddles the counts
+ appropriately in that case.
+
+ Test: fast/events/move-element-with-wheel-and-touch-event-listeners.html
+
+ * dom/EventNames.h:
+ (WebCore::EventNames::isTouchEventType):
+ (EventNames):
+ (WebCore::EventNames::touchEventNames):
+ * dom/Node.cpp:
+ (WebCore::Node::didMoveToNewDocument):
+
+2012-06-25 Eric Seidel <eric@webkit.org>
+
+ Split map* functions out of StyleResolver into a helper object
+ https://bugs.webkit.org/show_bug.cgi?id=89881
+
+ Reviewed by Daniel Bates.
+
+ These map* functions are completely independent of the rest of StyleResolver
+ and only exist to serve StyleBuilder.
+ CSSToStyleMap doesn't even want to have a StyleResolver pointer, but
+ currently needs one to access the resolve-lifetime caches for the
+ current resolve. Once we split out that per-resolve state into
+ some sort of ResolveState/ResolveInfo object (akin to PaintInfo/LayoutState)
+ then this object will be even simpler.
+
+ No behavioral change, thus no tests.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/CSSToStyleMap.cpp: Added.
+ (WebCore):
+ (WebCore::CSSToStyleMap::style):
+ (WebCore::CSSToStyleMap::rootElementStyle):
+ (WebCore::CSSToStyleMap::useSVGZoomRules):
+ (WebCore::CSSToStyleMap::styleImage):
+ (WebCore::CSSToStyleMap::mapFillAttachment):
+ (WebCore::CSSToStyleMap::mapFillClip):
+ (WebCore::CSSToStyleMap::mapFillComposite):
+ (WebCore::CSSToStyleMap::mapFillOrigin):
+ (WebCore::CSSToStyleMap::mapFillImage):
+ (WebCore::CSSToStyleMap::mapFillRepeatX):
+ (WebCore::CSSToStyleMap::mapFillRepeatY):
+ (WebCore::CSSToStyleMap::mapFillSize):
+ (WebCore::CSSToStyleMap::mapFillXPosition):
+ (WebCore::CSSToStyleMap::mapFillYPosition):
+ (WebCore::CSSToStyleMap::mapAnimationDelay):
+ (WebCore::CSSToStyleMap::mapAnimationDirection):
+ (WebCore::CSSToStyleMap::mapAnimationDuration):
+ (WebCore::CSSToStyleMap::mapAnimationFillMode):
+ (WebCore::CSSToStyleMap::mapAnimationIterationCount):
+ (WebCore::CSSToStyleMap::mapAnimationName):
+ (WebCore::CSSToStyleMap::mapAnimationPlayState):
+ (WebCore::CSSToStyleMap::mapAnimationProperty):
+ (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
+ (WebCore::CSSToStyleMap::mapNinePieceImage):
+ (WebCore::CSSToStyleMap::mapNinePieceImageSlice):
+ (WebCore::CSSToStyleMap::mapNinePieceImageQuad):
+ (WebCore::CSSToStyleMap::mapNinePieceImageRepeat):
+ * css/CSSToStyleMap.h: Added.
+ (WebCore):
+ (CSSToStyleMap):
+ (WebCore::CSSToStyleMap::CSSToStyleMap):
+ * css/StyleBuilder.cpp:
+ (WebCore::ApplyPropertyFillLayer::applyValue):
+ (WebCore::ApplyPropertyBorderImage::applyValue):
+ (WebCore::ApplyPropertyBorderImageModifier::applyValue):
+ (WebCore):
+ (WebCore::ApplyPropertyAnimation::map):
+ (WebCore::StyleBuilder::StyleBuilder):
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::StyleResolver):
+ (WebCore::StyleResolver::collectMatchingRulesForList):
+ * css/StyleResolver.h:
+ (WebCore::StyleResolver::styleMap):
+ (StyleResolver):
+
+2012-06-25 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ [EFL] Support screenDepth() functionality.
+ https://bugs.webkit.org/show_bug.cgi?id=89423
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Support screenDepth() based on ecore_x_window_depth_get(). This functionality may be used by
+ both WebKit1 and WebKit2. So, concrete function is placed into EflScreenUtilities.cpp.
+
+ This patch can't support existing test cases. Because, EFL DumpRenderTree works without X11 window
+ by default.
+
+ * platform/efl/EflScreenUtilities.cpp:
+ (WebCore::getPixelDepth):
+ (WebCore):
+ * platform/efl/EflScreenUtilities.h:
+ (WebCore):
+ * platform/efl/PlatformScreenEfl.cpp:
+ (WebCore::screenDepth):
+ (WebCore::screenDepthPerComponent):
+
+2012-06-25 Shinya Kawanaka <shinyak@chromium.org>
+
+ [Shadow] Executing Italic and InsertUnorderedList in Shadow DOM causes a crash
+ https://bugs.webkit.org/show_bug.cgi?id=88495
+
+ Reviewed by Ryosuke Niwa.
+
+ InsertionPoint::removedFrom(insertionPoint) tries to find its owner ElementShadow from
+ parentNode or insertionPoint. If the parent node exsits but we cannot reach ElementShadow from
+ the parent node, InsertionPoint::removedFrom does not try to find ElementShadow anymore.
+
+ It's OK if the ElementShadow is being destructed, but there is a case ElementShadow is not being
+ destructed in editing. In this case, we should try to find ElementShadow from insertionPoint.
+ Otherwise it will bring inconsistency to Shadow DOM, and causes a crash.
+
+ Actually checking the existence of parentNode() does not make any sense. We should get
+ shadowRoot() directly.
+
+ Test: editing/shadow/insertorderedlist-crash.html
+
+ * html/shadow/InsertionPoint.cpp:
+ (WebCore::InsertionPoint::removedFrom):
+
+2012-06-25 Kinuko Yasuda <kinuko@chromium.org>
+
+ Remove responseBlob field from XMLHttpResponse.idl
+ https://bugs.webkit.org/show_bug.cgi?id=89859
+
+ Reviewed by Eric Seidel.
+
+ Remove XMLHttpResponse.responseBlob from XMLHttpResponse.idl, which
+ has only been exposed for a very limited time (since r120574) but
+ probably should not have been done so since XHR2 spec no longer has
+ the field. A quick search also showed that no one seems to be using the field.
+
+ (More context: the field was added long time ago with a runtime guard
+ which had never been enabled until the guard was removed in r120574
+ to remove XHR_RESPONSE_BLOB on all platforms.)
+
+ No new tests as no tests use this field.
+
+ * xml/XMLHttpRequest.idl: Removed responseBlob field.
+
+2012-06-25 Huang Dongsung <luxtella@company100.net>
+
+ Add static qualifier to GraphicsContext3D::extractImageData.
+ https://bugs.webkit.org/show_bug.cgi?id=89866
+
+ GraphicsContext3D::extractImageData does not use member variables.
+ Each platform Accelerated-compositing implementation can use this method in
+ order to get pixel data of an Image or ImageBuffer object.
+
+ Reviewed by Noam Rosenthal.
+
+ No new tests since there's no change on code behavior.
+
+ * platform/graphics/GraphicsContext3D.h:
+ (GraphicsContext3D):
+
+2012-06-25 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: toggling style should not start property edit first.
+ https://bugs.webkit.org/show_bug.cgi?id=89834
+
+ Reviewed by Yury Semikhatsky.
+
+ Otherwise property flickers upon toggling.
+
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylePropertyTreeElement.prototype):
+
+2012-06-25 Alexander Pavlov <apavlov@chromium.org>
+
+ Web Inspector: "Emulate Touch Events" breaks selecting elements with "touchstart" event listeners for inspection.
+ https://bugs.webkit.org/show_bug.cgi?id=89861
+
+ Reviewed by Vsevolod Vlasov.
+
+ Upon a mousepress, Inspector should be queried for the "Inspect element" mode up-front,
+ before dispatching a synthetic "touchstart" event.
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleMousePressEvent):
+
+2012-06-25 Alexander Pavlov <apavlov@chromium.org>
+
+ Web Inspector: [Styles] Cannot visually set caret before the first CSS property name character
+ https://bugs.webkit.org/show_bug.cgi?id=89869
+
+ Reviewed by Vsevolod Vlasov.
+
+ The issue was due to the "editbox" SPAN having a negative margin, thus the leftmost caret position was getting clipped
+ by a synthetic SPAN container added by the TextPrompt.
+
+ * inspector/front-end/elementsPanel.css:
+ (.styles-section .properties > li.child-editing .webkit-css-property):
+ (.styles-section .properties li.child-editing):
+
+2012-06-25 Arko Saha <arko@motorola.com>
+
+ Microdata: document.getItems(typeNames) is not returning Microdata items when typeNames argument is not specified.
+ https://bugs.webkit.org/show_bug.cgi?id=89757
+
+ Reviewed by Ryosuke Niwa.
+
+ With r120979 change, it creates MicroDataItemList with m_typeNames = "http://webkit.org/microdata/undefinedItemType",
+ when typeNames argument is not specified. Modified the check in nodeMatches() accordingly.
+
+ This fixes the following failing tests :
+ fast/dom/MicroData/002.html
+ fast/dom/MicroData/003.html
+ fast/dom/MicroData/007.html
+ fast/dom/MicroData/009.html
+ fast/dom/MicroData/properties-collection-must-see-the-properties-added-in-itemref.html
+
+ * dom/Document.cpp:
+ (WebCore::Document::getItems): Use undefinedItemType to avoid String conversion.
+ * dom/MicroDataItemList.cpp:
+ (WebCore::MicroDataItemList::undefinedItemType): It defines "http://webkit.org/microdata/undefinedItemType"
+ string using DEFINE_STATIC_LOCAL to avoid String conversion.
+ (WebCore::MicroDataItemList::MicroDataItemList): Use document() method of DynamicNodeList to obtain
+ document of owner element.
+ (WebCore::MicroDataItemList::~MicroDataItemList): Removed originalTypeNames null check.
+ (WebCore::MicroDataItemList::nodeMatches): Return true if originalTypeNames is equal to undefinedItemType.
+ * dom/MicroDataItemList.h:
+
+2012-06-25 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Unreviewed. Fix make distcheck.
+
+ * GNUmakefile.list.am: Add missing header file.
2012-06-25 Simon Hausmann <simon.hausmann@nokia.com>
diff --git a/Source/WebCore/GNUmakefile.list.am b/Source/WebCore/GNUmakefile.list.am
index 9872e002e..2a1431663 100644
--- a/Source/WebCore/GNUmakefile.list.am
+++ b/Source/WebCore/GNUmakefile.list.am
@@ -1115,6 +1115,7 @@ webcore_modules_sources += \
Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h \
Source/WebCore/Modules/indexeddb/IDBLevelDBCoding.cpp \
Source/WebCore/Modules/indexeddb/IDBLevelDBCoding.h \
+ Source/WebCore/Modules/indexeddb/IDBMetadata.h \
Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp \
Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h \
Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h \
@@ -1678,6 +1679,8 @@ webcore_sources += \
Source/WebCore/css/CSSStyleSheet.h \
Source/WebCore/css/CSSTimingFunctionValue.cpp \
Source/WebCore/css/CSSTimingFunctionValue.h \
+ Source/WebCore/css/CSSToStyleMap.cpp \
+ Source/WebCore/css/CSSToStyleMap.h \
Source/WebCore/css/CSSWrapShapes.cpp \
Source/WebCore/css/CSSWrapShapes.h \
Source/WebCore/css/CSSUnicodeRangeValue.cpp \
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursor.cpp b/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
index 2759514ef..af1c50444 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
@@ -29,9 +29,11 @@
#if ENABLE(INDEXED_DATABASE)
#include "IDBAny.h"
+#include "IDBBindingUtilities.h"
#include "IDBCallbacks.h"
#include "IDBCursorBackendInterface.h"
#include "IDBKey.h"
+#include "IDBObjectStore.h"
#include "IDBRequest.h"
#include "IDBTracing.h"
#include "IDBTransaction.h"
@@ -125,24 +127,37 @@ IDBAny* IDBCursor::source() const
PassRefPtr<IDBRequest> IDBCursor::update(ScriptExecutionContext* context, PassRefPtr<SerializedScriptValue> prpValue, ExceptionCode& ec)
{
IDB_TRACE("IDBCursor::update");
+ RefPtr<SerializedScriptValue> value = prpValue;
- if (!m_gotValue) {
+ if (!m_gotValue || isKeyCursor()) {
ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
return 0;
}
-
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
+ return 0;
+ }
if (m_transaction->isReadOnly()) {
ec = IDBDatabaseException::READ_ONLY_ERR;
return 0;
}
-
- RefPtr<SerializedScriptValue> value = prpValue;
if (value->blobURLs().size() > 0) {
// FIXME: Add Blob/File/FileList support
ec = IDBDatabaseException::IDB_DATA_CLONE_ERR;
return 0;
}
+ RefPtr<IDBObjectStore> objectStore = effectiveObjectStore();
+ const IDBKeyPath& keyPath = objectStore->metadata().keyPath;
+ const bool usesInLineKeys = !keyPath.isNull();
+ if (usesInLineKeys) {
+ RefPtr<IDBKey> keyPathKey = createIDBKeyFromSerializedValueAndKeyPath(value, keyPath);
+ if (!keyPathKey || !keyPathKey->isEqual(m_currentPrimaryKey.get())) {
+ ec = IDBDatabaseException::DATA_ERR;
+ return 0;
+ }
+ }
+
RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
m_backend->update(value, request, ec);
if (ec) {
@@ -160,7 +175,7 @@ void IDBCursor::advance(unsigned long count, ExceptionCode& ec)
return;
}
- if (!m_request) {
+ if (!m_transaction->isActive()) {
ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
return;
}
@@ -188,7 +203,7 @@ void IDBCursor::continueFunction(PassRefPtr<IDBKey> key, ExceptionCode& ec)
return;
}
- if (!m_request) {
+ if (!m_transaction->isActive()) {
ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
return;
}
@@ -213,6 +228,10 @@ void IDBCursor::continueFunction(PassRefPtr<IDBKey> key, ExceptionCode& ec)
PassRefPtr<IDBRequest> IDBCursor::deleteFunction(ScriptExecutionContext* context, ExceptionCode& ec)
{
IDB_TRACE("IDBCursor::delete");
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
+ return 0;
+ }
if (m_transaction->isReadOnly()) {
ec = IDBDatabaseException::READ_ONLY_ERR;
return 0;
@@ -252,6 +271,14 @@ void IDBCursor::setValueReady()
m_valueIsDirty = true;
}
+PassRefPtr<IDBObjectStore> IDBCursor::effectiveObjectStore()
+{
+ if (m_source->type() == IDBAny::IDBObjectStoreType)
+ return m_source->idbObjectStore();
+ RefPtr<IDBIndex> index = m_source->idbIndex();
+ return index->objectStore();
+}
+
unsigned short IDBCursor::stringToDirection(const String& directionString, ExceptionCode& ec)
{
if (directionString == IDBCursor::directionNext())
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursor.h b/Source/WebCore/Modules/indexeddb/IDBCursor.h
index 3f9d84f98..4f4564eeb 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursor.h
+++ b/Source/WebCore/Modules/indexeddb/IDBCursor.h
@@ -91,8 +91,11 @@ public:
protected:
IDBCursor(PassRefPtr<IDBCursorBackendInterface>, IDBRequest*, IDBAny* source, IDBTransaction*);
+ virtual bool isKeyCursor() const { return true; }
private:
+ PassRefPtr<IDBObjectStore> effectiveObjectStore();
+
RefPtr<IDBCursorBackendInterface> m_backend;
RefPtr<IDBRequest> m_request;
RefPtr<IDBAny> m_source;
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp
index b6246e919..0a14a6f1a 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp
@@ -93,10 +93,9 @@ void IDBCursorBackendImpl::update(PassRefPtr<SerializedScriptValue> value, PassR
{
IDB_TRACE("IDBCursorBackendImpl::update");
ASSERT(m_transaction->mode() != IDBTransaction::READ_ONLY);
- if (!m_cursor || m_cursorType == IndexKeyCursor) {
- ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
- return;
- }
+
+ ASSERT(m_cursor);
+ ASSERT(m_cursorType != IndexKeyCursor);
m_objectStore->put(value, m_cursor->primaryKey(), IDBObjectStoreBackendInterface::CursorUpdate, callbacks, m_transaction.get(), ec);
}
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h b/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h
index a1ba14f96..9b396ba35 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h
+++ b/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h
@@ -41,6 +41,9 @@ public:
// The value attribute defined in the IDL is simply implemented in IDBCursor (but not exposed via
// its IDL). This is to make the implementation more simple while matching what the spec says.
+protected:
+ virtual bool isKeyCursor() const OVERRIDE { return false; }
+
private:
IDBCursorWithValue(PassRefPtr<IDBCursorBackendInterface>, IDBRequest*, IDBAny* source, IDBTransaction*);
};
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp b/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
index 0a49400bb..ab123c3dc 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
@@ -117,6 +117,10 @@ PassRefPtr<IDBObjectStore> IDBDatabase::createObjectStore(const String& name, co
ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
return 0;
}
+ if (!m_versionChangeTransaction->isActive()) {
+ ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
+ return 0;
+ }
IDBKeyPath keyPath;
if (!options.isUndefinedOrNull()) {
@@ -128,6 +132,11 @@ PassRefPtr<IDBObjectStore> IDBDatabase::createObjectStore(const String& name, co
keyPath = IDBKeyPath(keyPathString);
}
+ if (m_metadata.objectStores.contains(name)) {
+ ec = IDBDatabaseException::CONSTRAINT_ERR;
+ return 0;
+ }
+
if (!keyPath.isNull() && !keyPath.isValid()) {
ec = IDBDatabaseException::IDB_SYNTAX_ERR;
return 0;
@@ -162,6 +171,14 @@ void IDBDatabase::deleteObjectStore(const String& name, ExceptionCode& ec)
ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
return;
}
+ if (!m_versionChangeTransaction->isActive()) {
+ ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
+ return;
+ }
+ if (!m_metadata.objectStores.contains(name)) {
+ ec = IDBDatabaseException::IDB_NOT_FOUND_ERR;
+ return;
+ }
m_backend->deleteObjectStore(name, m_versionChangeTransaction->backend(), ec);
if (!ec) {
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
index b636d80a6..505ba757b 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
@@ -142,22 +142,10 @@ IDBDatabaseMetadata IDBDatabaseBackendImpl::metadata() const
return metadata;
}
-PassRefPtr<DOMStringList> IDBDatabaseBackendImpl::objectStoreNames() const
-{
- RefPtr<DOMStringList> objectStoreNames = DOMStringList::create();
- for (ObjectStoreMap::const_iterator it = m_objectStores.begin(); it != m_objectStores.end(); ++it)
- objectStoreNames->append(it->first);
- objectStoreNames->sort();
- return objectStoreNames.release();
-}
-
PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseBackendImpl::createObjectStore(const String& name, const IDBKeyPath& keyPath, bool autoIncrement, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
{
ASSERT(transactionPtr->mode() == IDBTransaction::VERSION_CHANGE);
- if (m_objectStores.contains(name)) {
- ec = IDBDatabaseException::CONSTRAINT_ERR;
- return 0;
- }
+ ASSERT(!m_objectStores.contains(name));
RefPtr<IDBObjectStoreBackendImpl> objectStore = IDBObjectStoreBackendImpl::create(this, name, keyPath, autoIncrement);
ASSERT(objectStore->name() == name);
@@ -195,12 +183,10 @@ PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseBackendImpl::objectStore(c
void IDBDatabaseBackendImpl::deleteObjectStore(const String& name, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
{
ASSERT(transactionPtr->mode() == IDBTransaction::VERSION_CHANGE);
- RefPtr<IDBObjectStoreBackendImpl> objectStore = m_objectStores.get(name);
- if (!objectStore) {
- ec = IDBDatabaseException::IDB_NOT_FOUND_ERR;
- return;
- }
+ ASSERT(m_objectStores.contains(name));
+
RefPtr<IDBDatabaseBackendImpl> database = this;
+ RefPtr<IDBObjectStoreBackendImpl> objectStore = m_objectStores.get(name);
RefPtr<IDBTransactionBackendInterface> transaction = transactionPtr;
if (!transaction->scheduleTask(createCallbackTask(&IDBDatabaseBackendImpl::deleteObjectStoreInternal, database, objectStore, transaction),
createCallbackTask(&IDBDatabaseBackendImpl::addObjectStoreToMap, database, objectStore))) {
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h
index 36eb241fe..21f4f93c1 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h
@@ -59,9 +59,6 @@ public:
void deleteDatabase(PassRefPtr<IDBCallbacks>);
virtual IDBDatabaseMetadata metadata() const;
- virtual String name() const { return m_name; }
- virtual String version() const { return m_version; }
- virtual PassRefPtr<DOMStringList> objectStoreNames() const;
virtual PassRefPtr<IDBObjectStoreBackendInterface> createObjectStore(const String& name, const IDBKeyPath&, bool autoIncrement, IDBTransactionBackendInterface*, ExceptionCode&);
virtual void deleteObjectStore(const String& name, IDBTransactionBackendInterface*, ExceptionCode&);
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendInterface.h b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendInterface.h
index d581777f9..0f6b35d60 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendInterface.h
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendInterface.h
@@ -54,9 +54,6 @@ public:
virtual ~IDBDatabaseBackendInterface() { }
virtual IDBDatabaseMetadata metadata() const = 0;
- virtual String name() const = 0;
- virtual String version() const = 0;
- virtual PassRefPtr<DOMStringList> objectStoreNames() const = 0;
virtual PassRefPtr<IDBObjectStoreBackendInterface> createObjectStore(const String& name, const IDBKeyPath&, bool autoIncrement, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
virtual void deleteObjectStore(const String& name, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
index 31e7f5d4e..fd9394947 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
@@ -65,6 +65,10 @@ PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, Pas
ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
return 0;
}
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
+ return 0;
+ }
unsigned short direction = IDBCursor::stringToDirection(directionString, ec);
if (ec)
return 0;
@@ -115,6 +119,10 @@ PassRefPtr<IDBRequest> IDBIndex::count(ScriptExecutionContext* context, PassRefP
ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
return 0;
}
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
+ return 0;
+ }
RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
m_backend->count(keyRange, request, m_transaction->backend(), ec);
if (ec) {
@@ -140,6 +148,10 @@ PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context,
ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
return 0;
}
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
+ return 0;
+ }
unsigned short direction = IDBCursor::stringToDirection(directionString, ec);
if (ec)
@@ -200,6 +212,10 @@ PassRefPtr<IDBRequest> IDBIndex::get(ScriptExecutionContext* context, PassRefPtr
ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
return 0;
}
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
+ return 0;
+ }
if (!keyRange) {
ec = IDBDatabaseException::DATA_ERR;
return 0;
@@ -231,6 +247,10 @@ PassRefPtr<IDBRequest> IDBIndex::getKey(ScriptExecutionContext* context, PassRef
ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
return 0;
}
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
+ return 0;
+ }
if (!keyRange) {
ec = IDBDatabaseException::DATA_ERR;
return 0;
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.h b/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.h
index 6410cbac3..98385128f 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.h
+++ b/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.h
@@ -65,10 +65,6 @@ public:
// Implements IDBIndexBackendInterface.
virtual IDBIndexMetadata metadata() const;
- virtual String name() { return m_name; }
- virtual IDBKeyPath keyPath() { return m_keyPath; }
- virtual bool unique() { return m_unique; }
- virtual bool multiEntry() { return m_multiEntry; }
virtual void openCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&);
virtual void count(PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&);
@@ -76,6 +72,11 @@ public:
virtual void get(PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&);
virtual void getKey(PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&);
+ const String& name() { return m_name; }
+ const IDBKeyPath& keyPath() { return m_keyPath; }
+ const bool& unique() { return m_unique; }
+ const bool& multiEntry() { return m_multiEntry; }
+
private:
IDBIndexBackendImpl(const IDBDatabaseBackendImpl*, IDBObjectStoreBackendImpl*, int64_t id, const String& name, const IDBKeyPath&, bool unique, bool multiEntry);
IDBIndexBackendImpl(const IDBDatabaseBackendImpl*, IDBObjectStoreBackendImpl*, const String& name, const IDBKeyPath&, bool unique, bool multiEntry);
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndexBackendInterface.h b/Source/WebCore/Modules/indexeddb/IDBIndexBackendInterface.h
index d35d1177d..5c0a16953 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndexBackendInterface.h
+++ b/Source/WebCore/Modules/indexeddb/IDBIndexBackendInterface.h
@@ -46,11 +46,6 @@ class IDBIndexBackendInterface : public ThreadSafeRefCounted<IDBIndexBackendInte
public:
virtual ~IDBIndexBackendInterface() { }
- virtual String name() = 0;
- virtual IDBKeyPath keyPath() = 0;
- virtual bool unique() = 0;
- virtual bool multiEntry() = 0;
-
virtual void openCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
virtual void count(PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
virtual void openKeyCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
index 68bc17165..6c0641592 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
@@ -30,6 +30,7 @@
#include "DOMStringList.h"
#include "IDBAny.h"
+#include "IDBBindingUtilities.h"
#include "IDBDatabase.h"
#include "IDBDatabaseException.h"
#include "IDBIndex.h"
@@ -78,6 +79,10 @@ PassRefPtr<IDBRequest> IDBObjectStore::get(ScriptExecutionContext* context, Pass
ec = IDBDatabaseException::DATA_ERR;
return 0;
}
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
+ return 0;
+ }
RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
m_backend->get(keyRange, request, m_transaction->backend(), ec);
if (ec) {
@@ -96,65 +101,80 @@ PassRefPtr<IDBRequest> IDBObjectStore::get(ScriptExecutionContext* context, Pass
return get(context, keyRange.release(), ec);
}
-PassRefPtr<IDBRequest> IDBObjectStore::add(ScriptExecutionContext* context, PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBKey> key, ExceptionCode& ec)
+PassRefPtr<IDBRequest> IDBObjectStore::add(ScriptExecutionContext* context, PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, ExceptionCode& ec)
{
IDB_TRACE("IDBObjectStore::add");
+ return put(IDBObjectStoreBackendInterface::AddOnly, context, value, key, ec);
+}
+
+PassRefPtr<IDBRequest> IDBObjectStore::put(ScriptExecutionContext* context, PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, ExceptionCode& ec)
+{
+ IDB_TRACE("IDBObjectStore::put");
+ return put(IDBObjectStoreBackendInterface::AddOrUpdate, context, value, key, ec);
+}
+
+PassRefPtr<IDBRequest> IDBObjectStore::put(IDBObjectStoreBackendInterface::PutMode putMode, ScriptExecutionContext* context, PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBKey> prpKey, ExceptionCode& ec)
+{
+ IDB_TRACE("IDBObjectStore::put");
+ RefPtr<SerializedScriptValue> value = prpValue;
+ RefPtr<IDBKey> key = prpKey;
if (m_deleted) {
ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
return 0;
}
- if (m_transaction->isReadOnly()) {
- ec = IDBDatabaseException::READ_ONLY_ERR;
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
return 0;
}
-
- if (key && !key->isValid()) {
- ec = IDBDatabaseException::DATA_ERR;
+ if (m_transaction->isReadOnly()) {
+ ec = IDBDatabaseException::READ_ONLY_ERR;
return 0;
}
-
- RefPtr<SerializedScriptValue> value = prpValue;
if (value->blobURLs().size() > 0) {
// FIXME: Add Blob/File/FileList support
ec = IDBDatabaseException::IDB_DATA_CLONE_ERR;
return 0;
}
- RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
- m_backend->put(value, key, IDBObjectStoreBackendInterface::AddOnly, request, m_transaction->backend(), ec);
- if (ec) {
- request->markEarlyDeath();
- return 0;
- }
- return request.release();
-}
+ const IDBKeyPath& keyPath = m_metadata.keyPath;
+ const bool usesInLineKeys = !keyPath.isNull();
+ const bool hasKeyGenerator = autoIncrement();
-PassRefPtr<IDBRequest> IDBObjectStore::put(ScriptExecutionContext* context, PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBKey> key, ExceptionCode& ec)
-{
- IDB_TRACE("IDBObjectStore::put");
- if (m_deleted) {
- ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
+ if (usesInLineKeys && key) {
+ ec = IDBDatabaseException::DATA_ERR;
return 0;
}
- if (m_transaction->isReadOnly()) {
- ec = IDBDatabaseException::READ_ONLY_ERR;
+ if (!usesInLineKeys && !hasKeyGenerator && !key) {
+ ec = IDBDatabaseException::DATA_ERR;
return 0;
}
-
+ if (usesInLineKeys) {
+ RefPtr<IDBKey> keyPathKey = createIDBKeyFromSerializedValueAndKeyPath(value, keyPath);
+ if (keyPathKey && !keyPathKey->isValid()) {
+ ec = IDBDatabaseException::DATA_ERR;
+ return 0;
+ }
+ if (!hasKeyGenerator && !keyPathKey) {
+ ec = IDBDatabaseException::DATA_ERR;
+ return 0;
+ }
+ if (hasKeyGenerator && !keyPathKey) {
+ RefPtr<IDBKey> dummyKey = IDBKey::createNumber(-1);
+ RefPtr<SerializedScriptValue> valueAfterInjection = injectIDBKeyIntoSerializedValue(dummyKey, value, keyPath);
+ if (!valueAfterInjection) {
+ ec = IDBDatabaseException::DATA_ERR;
+ return 0;
+ }
+ }
+ }
if (key && !key->isValid()) {
ec = IDBDatabaseException::DATA_ERR;
return 0;
}
- RefPtr<SerializedScriptValue> value = prpValue;
- if (value->blobURLs().size() > 0) {
- // FIXME: Add Blob/File/FileList support
- ec = IDBDatabaseException::IDB_DATA_CLONE_ERR;
- return 0;
- }
-
RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
- m_backend->put(value, key, IDBObjectStoreBackendInterface::AddOrUpdate, request, m_transaction->backend(), ec);
+ // FIXME: Pass through keyPathKey as key to simplify back end implementation.
+ m_backend->put(value.release(), key.release(), putMode, request, m_transaction->backend(), ec);
if (ec) {
request->markEarlyDeath();
return 0;
@@ -169,11 +189,14 @@ PassRefPtr<IDBRequest> IDBObjectStore::deleteFunction(ScriptExecutionContext* co
ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
return 0;
}
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
+ return 0;
+ }
if (m_transaction->isReadOnly()) {
ec = IDBDatabaseException::READ_ONLY_ERR;
return 0;
}
-
if (!keyRange) {
ec = IDBDatabaseException::DATA_ERR;
return 0;
@@ -204,6 +227,10 @@ PassRefPtr<IDBRequest> IDBObjectStore::clear(ScriptExecutionContext* context, Ex
ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
return 0;
}
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
+ return 0;
+ }
if (m_transaction->isReadOnly()) {
ec = IDBDatabaseException::READ_ONLY_ERR;
return 0;
@@ -239,11 +266,22 @@ PassRefPtr<IDBIndex> IDBObjectStore::createIndex(const String& name, const IDBKe
ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
return 0;
}
-
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
+ return 0;
+ }
if (!keyPath.isValid()) {
ec = IDBDatabaseException::IDB_SYNTAX_ERR;
return 0;
}
+ if (name.isNull()) {
+ ec = IDBDatabaseException::IDB_TYPE_ERR;
+ return 0;
+ }
+ if (m_metadata.indexes.contains(name)) {
+ ec = IDBDatabaseException::CONSTRAINT_ERR;
+ return 0;
+ }
bool unique = false;
options.get("unique", unique);
@@ -304,6 +342,14 @@ void IDBObjectStore::deleteIndex(const String& name, ExceptionCode& ec)
ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
return;
}
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
+ return;
+ }
+ if (!m_metadata.indexes.contains(name)) {
+ ec = IDBDatabaseException::IDB_NOT_FOUND_ERR;
+ return;
+ }
m_backend->deleteIndex(name, m_transaction->backend(), ec);
if (!ec) {
@@ -325,6 +371,10 @@ PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* contex
ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
return 0;
}
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
+ return 0;
+ }
unsigned short direction = IDBCursor::stringToDirection(directionString, ec);
if (ec)
return 0;
@@ -375,6 +425,10 @@ PassRefPtr<IDBRequest> IDBObjectStore::count(ScriptExecutionContext* context, Pa
ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
return 0;
}
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
+ return 0;
+ }
RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
m_backend->count(range, request, m_transaction->backend(), ec);
if (ec) {
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
index 8181eb931..67b36f995 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
@@ -95,6 +95,7 @@ public:
PassRefPtr<IDBRequest> count(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
PassRefPtr<IDBRequest> count(ScriptExecutionContext*, PassRefPtr<IDBKey>, ExceptionCode&);
+ PassRefPtr<IDBRequest> put(IDBObjectStoreBackendInterface::PutMode, ScriptExecutionContext*, PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, ExceptionCode&);
void markDeleted() { m_deleted = true; }
void transactionFinished();
@@ -103,7 +104,6 @@ public:
private:
IDBObjectStore(const IDBObjectStoreMetadata&, PassRefPtr<IDBObjectStoreBackendInterface>, IDBTransaction*);
- void removeTransactionFromPendingList();
IDBObjectStoreMetadata m_metadata;
RefPtr<IDBObjectStoreBackendInterface> m_backend;
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp
index a62dda8b4..af30ef371 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp
@@ -42,7 +42,7 @@
#include "IDBKeyPathBackendImpl.h"
#include "IDBKeyRange.h"
#include "IDBTracing.h"
-#include "IDBTransactionBackendInterface.h"
+#include "IDBTransactionBackendImpl.h"
#include "ScriptExecutionContext.h"
namespace WebCore {
@@ -80,15 +80,6 @@ IDBObjectStoreMetadata IDBObjectStoreBackendImpl::metadata() const
return metadata;
}
-PassRefPtr<DOMStringList> IDBObjectStoreBackendImpl::indexNames() const
-{
- RefPtr<DOMStringList> indexNames = DOMStringList::create();
- for (IndexMap::const_iterator it = m_indexes.begin(); it != m_indexes.end(); ++it)
- indexNames->append(it->first);
- indexNames->sort();
- return indexNames.release();
-}
-
void IDBObjectStoreBackendImpl::get(PassRefPtr<IDBKeyRange> prpKeyRange, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
{
IDB_TRACE("IDBObjectStoreBackendImpl::get");
@@ -101,7 +92,7 @@ void IDBObjectStoreBackendImpl::get(PassRefPtr<IDBKeyRange> prpKeyRange, PassRef
void IDBObjectStoreBackendImpl::getInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
{
- IDB_TRACE("IDBObjectStoreBackendImpl::getByRangeInternal");
+ IDB_TRACE("IDBObjectStoreBackendImpl::getInternal");
RefPtr<IDBKey> key;
if (keyRange->isOnlyKey())
key = keyRange->lower();
@@ -157,53 +148,6 @@ void IDBObjectStoreBackendImpl::put(PassRefPtr<SerializedScriptValue> prpValue,
RefPtr<IDBCallbacks> callbacks = prpCallbacks;
RefPtr<IDBTransactionBackendInterface> transaction = transactionPtr;
- if (putMode != CursorUpdate) {
- const bool autoIncrement = objectStore->autoIncrement();
- const bool hasKeyPath = !objectStore->m_keyPath.isNull();
-
- if (hasKeyPath && key) {
- ec = IDBDatabaseException::DATA_ERR;
- return;
- }
- if (!hasKeyPath && !autoIncrement && !key) {
- ec = IDBDatabaseException::DATA_ERR;
- return;
- }
- if (hasKeyPath) {
- RefPtr<IDBKey> keyPathKey = fetchKeyFromKeyPath(value.get(), objectStore->m_keyPath);
- if (keyPathKey && !keyPathKey->isValid()) {
- ec = IDBDatabaseException::DATA_ERR;
- return;
- }
- if (!autoIncrement && !keyPathKey) {
- ec = IDBDatabaseException::DATA_ERR;
- return;
- }
- if (autoIncrement && !keyPathKey) {
- RefPtr<IDBKey> dummyKey = IDBKey::createNumber(-1);
- RefPtr<SerializedScriptValue> valueAfterInjection = injectKeyIntoKeyPath(dummyKey, value, objectStore->m_keyPath);
- if (!valueAfterInjection) {
- ec = IDBDatabaseException::DATA_ERR;
- return;
- }
- }
- }
- if (key && !key->isValid()) {
- ec = IDBDatabaseException::DATA_ERR;
- return;
- }
- } else {
- ASSERT(key);
- const bool hasKeyPath = !objectStore->m_keyPath.isNull();
- if (hasKeyPath) {
- RefPtr<IDBKey> keyPathKey = fetchKeyFromKeyPath(value.get(), objectStore->m_keyPath);
- if (!keyPathKey || !keyPathKey->isEqual(key.get())) {
- ec = IDBDatabaseException::DATA_ERR;
- return;
- }
- }
- }
-
if (!transaction->scheduleTask(
createCallbackTask(&IDBObjectStoreBackendImpl::putInternal, objectStore, value, key, putMode, callbacks, transaction),
// FIXME: One of these per put() is overkill, since it's simply a cache invalidation.
@@ -468,18 +412,8 @@ bool IDBObjectStoreBackendImpl::populateIndex(IDBBackingStore& backingStore, int
PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendImpl::createIndex(const String& name, const IDBKeyPath& keyPath, bool unique, bool multiEntry, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
{
- if (name.isNull()) {
- ec = IDBDatabaseException::IDB_TYPE_ERR;
- return 0;
- }
- if (m_indexes.contains(name)) {
- ec = IDBDatabaseException::CONSTRAINT_ERR;
- return 0;
- }
- if (transaction->mode() != IDBTransaction::VERSION_CHANGE) {
- ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
- return 0;
- }
+ ASSERT(transaction->mode() == IDBTransaction::VERSION_CHANGE);
+ ASSERT(!m_indexes.contains(name));
RefPtr<IDBIndexBackendImpl> index = IDBIndexBackendImpl::create(m_database, this, name, keyPath, unique, multiEntry);
ASSERT(index->name() == name);
@@ -529,18 +463,11 @@ PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendImpl::index(const Stri
void IDBObjectStoreBackendImpl::deleteIndex(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
{
- if (transaction->mode() != IDBTransaction::VERSION_CHANGE) {
- ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
- return;
- }
-
- RefPtr<IDBIndexBackendImpl> index = m_indexes.get(name);
- if (!index) {
- ec = IDBDatabaseException::IDB_NOT_FOUND_ERR;
- return;
- }
+ ASSERT(transaction->mode() == IDBTransaction::VERSION_CHANGE);
+ ASSERT(m_indexes.contains(name));
RefPtr<IDBObjectStoreBackendImpl> objectStore = this;
+ RefPtr<IDBIndexBackendImpl> index = m_indexes.get(name);
RefPtr<IDBTransactionBackendInterface> transactionPtr = transaction;
if (!transaction->scheduleTask(
createCallbackTask(&IDBObjectStoreBackendImpl::deleteIndexInternal,
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h
index 07ab9fce3..1e39ddac3 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h
@@ -64,10 +64,6 @@ public:
void setId(int64_t id) { m_id = id; }
virtual IDBObjectStoreMetadata metadata() const;
- virtual String name() const { return m_name; }
- virtual IDBKeyPath keyPath() const { return m_keyPath; }
- virtual PassRefPtr<DOMStringList> indexNames() const;
- virtual bool autoIncrement() const { return m_autoIncrement; }
virtual void get(PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&);
virtual void put(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, PutMode, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&);
@@ -83,6 +79,10 @@ public:
static bool populateIndex(IDBBackingStore&, int64_t databaseId, int64_t objectStoreId, PassRefPtr<IDBIndexBackendImpl>);
+ const String& name() { return m_name; }
+ const IDBKeyPath& keyPath() const { return m_keyPath; }
+ const bool& autoIncrement() const { return m_autoIncrement; }
+
private:
IDBObjectStoreBackendImpl(const IDBDatabaseBackendImpl*, int64_t databaseId, const String& name, const IDBKeyPath&, bool autoIncrement);
IDBObjectStoreBackendImpl(const IDBDatabaseBackendImpl*, const String& name, const IDBKeyPath&, bool autoIncrement);
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h
index 6002d9e48..07f9f7260 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h
@@ -48,11 +48,6 @@ class IDBObjectStoreBackendInterface : public ThreadSafeRefCounted<IDBObjectStor
public:
virtual ~IDBObjectStoreBackendInterface() { }
- virtual String name() const = 0;
- virtual IDBKeyPath keyPath() const = 0;
- virtual PassRefPtr<DOMStringList> indexNames() const = 0;
- virtual bool autoIncrement() const = 0;
-
virtual void get(PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
enum PutMode {
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
index 7087c657e..6ad300723 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
@@ -84,6 +84,7 @@ IDBTransaction::IDBTransaction(ScriptExecutionContext* context, PassRefPtr<IDBTr
, m_backend(backend)
, m_database(db)
, m_mode(mode)
+ , m_active(true)
, m_transactionFinished(false)
, m_contextStopped(false)
{
@@ -193,6 +194,7 @@ void IDBTransaction::abort()
{
if (m_transactionFinished)
return;
+ m_active = false;
RefPtr<IDBTransaction> selfRef = this;
if (m_backend)
m_backend->abort();
@@ -242,6 +244,7 @@ void IDBTransaction::unregisterRequest(IDBRequest* request)
void IDBTransaction::onAbort()
{
ASSERT(!m_transactionFinished);
+ m_active = false;
while (!m_childRequests.isEmpty()) {
IDBRequest* request = *m_childRequests.begin();
m_childRequests.remove(request);
@@ -265,6 +268,7 @@ void IDBTransaction::onAbort()
void IDBTransaction::onComplete()
{
ASSERT(!m_transactionFinished);
+ m_active = false;
m_objectStoreCleanupMap.clear();
closeOpenCursors();
m_database->transactionFinished(this);
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.h b/Source/WebCore/Modules/indexeddb/IDBTransaction.h
index 0b2dec6ec..2ce82b1cf 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.h
+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.h
@@ -68,12 +68,13 @@ public:
static const AtomicString& modeToString(Mode, ExceptionCode&);
IDBTransactionBackendInterface* backend() const;
+ bool isActive() const { return m_active; }
bool isFinished() const;
+ bool isReadOnly() const { return m_mode == READ_ONLY; }
bool isVersionChange() const { return m_mode == VERSION_CHANGE; }
// Implement the IDBTransaction IDL
const String& mode() const;
- bool isReadOnly() const { return m_mode == READ_ONLY; }
IDBDatabase* db() const;
PassRefPtr<DOMError> error(ExceptionCode&) const;
void setError(PassRefPtr<DOMError>);
@@ -135,6 +136,7 @@ private:
RefPtr<IDBTransactionBackendInterface> m_backend;
RefPtr<IDBDatabase> m_database;
const Mode m_mode;
+ bool m_active;
bool m_transactionFinished; // Is it possible that we'll fire any more events or allow any new requests? If not, we're finished.
bool m_contextStopped;
RefPtr<DOMError> m_error;
diff --git a/Source/WebCore/Modules/networkinfo/NetworkInfo.cpp b/Source/WebCore/Modules/networkinfo/NetworkInfo.cpp
index a627a193b..4838a29e3 100644
--- a/Source/WebCore/Modules/networkinfo/NetworkInfo.cpp
+++ b/Source/WebCore/Modules/networkinfo/NetworkInfo.cpp
@@ -32,7 +32,7 @@
#if ENABLE(NETWORK_INFO)
namespace WebCore {
-NetworkInfo::NetworkInfo(long bandwidth, bool metered)
+NetworkInfo::NetworkInfo(double bandwidth, bool metered)
: m_bandwidth(bandwidth)
, m_metered(metered)
{
diff --git a/Source/WebCore/Modules/networkinfo/NetworkInfo.h b/Source/WebCore/Modules/networkinfo/NetworkInfo.h
index d91b6757c..ee8fb714a 100644
--- a/Source/WebCore/Modules/networkinfo/NetworkInfo.h
+++ b/Source/WebCore/Modules/networkinfo/NetworkInfo.h
@@ -38,15 +38,15 @@ namespace WebCore {
class NetworkInfo : public RefCounted<NetworkInfo> {
public:
- static PassRefPtr<NetworkInfo> create(long bandwidth, bool metered) { return adoptRef(new NetworkInfo(bandwidth, metered)); }
+ static PassRefPtr<NetworkInfo> create(double bandwidth, bool metered) { return adoptRef(new NetworkInfo(bandwidth, metered)); }
- long bandwidth() const { return m_bandwidth; }
+ double bandwidth() const { return m_bandwidth; }
bool metered() const { return m_metered; }
private:
- NetworkInfo(long bandwidth, bool metered);
+ NetworkInfo(double bandwidth, bool metered);
- long m_bandwidth;
+ double m_bandwidth;
bool m_metered;
};
diff --git a/Source/WebCore/Modules/networkinfo/NetworkInfoClient.h b/Source/WebCore/Modules/networkinfo/NetworkInfoClient.h
index a35d1452b..f026e4dca 100644
--- a/Source/WebCore/Modules/networkinfo/NetworkInfoClient.h
+++ b/Source/WebCore/Modules/networkinfo/NetworkInfoClient.h
@@ -40,7 +40,7 @@ class NetworkInfoClient {
public:
virtual ~NetworkInfoClient() { }
- virtual unsigned int bandwidth() const = 0;
+ virtual double bandwidth() const = 0;
virtual bool metered() const = 0;
virtual void startUpdating() = 0;
diff --git a/Source/WebCore/Modules/networkinfo/NetworkInfoConnection.cpp b/Source/WebCore/Modules/networkinfo/NetworkInfoConnection.cpp
index 13f52abbe..159fecc64 100644
--- a/Source/WebCore/Modules/networkinfo/NetworkInfoConnection.cpp
+++ b/Source/WebCore/Modules/networkinfo/NetworkInfoConnection.cpp
@@ -55,7 +55,7 @@ NetworkInfoConnection::~NetworkInfoConnection()
{
}
-unsigned int NetworkInfoConnection::bandwidth() const
+double NetworkInfoConnection::bandwidth() const
{
if (m_networkInfo)
return m_networkInfo->bandwidth();
diff --git a/Source/WebCore/Modules/networkinfo/NetworkInfoConnection.h b/Source/WebCore/Modules/networkinfo/NetworkInfoConnection.h
index ea7ab8ab7..18a6c9c6e 100644
--- a/Source/WebCore/Modules/networkinfo/NetworkInfoConnection.h
+++ b/Source/WebCore/Modules/networkinfo/NetworkInfoConnection.h
@@ -51,7 +51,7 @@ public:
~NetworkInfoConnection();
- unsigned int bandwidth() const;
+ double bandwidth() const;
bool metered() const;
void didChangeNetworkInformation(PassRefPtr<Event>, PassRefPtr<NetworkInfo>);
diff --git a/Source/WebCore/Modules/webaudio/AudioNode.cpp b/Source/WebCore/Modules/webaudio/AudioNode.cpp
index 0e329c2b9..69fd90bb1 100644
--- a/Source/WebCore/Modules/webaudio/AudioNode.cpp
+++ b/Source/WebCore/Modules/webaudio/AudioNode.cpp
@@ -36,6 +36,10 @@
#include <wtf/Atomics.h>
#include <wtf/MainThread.h>
+#if DEBUG_AUDIONODE_REFERENCES
+#include <stdio.h>
+#endif
+
namespace WebCore {
AudioNode::AudioNode(AudioContext* context, float sampleRate)
diff --git a/Source/WebCore/PlatformEfl.cmake b/Source/WebCore/PlatformEfl.cmake
index 0c19dd26c..22af0e6ca 100644
--- a/Source/WebCore/PlatformEfl.cmake
+++ b/Source/WebCore/PlatformEfl.cmake
@@ -8,6 +8,7 @@ LIST(APPEND WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/page/efl"
"${WEBCORE_DIR}/platform/efl"
"${WEBCORE_DIR}/platform/graphics/efl"
+ "${WEBCORE_DIR}/platform/mediastream/gstreamer"
"${WEBCORE_DIR}/platform/network/soup"
"${WEBCORE_DIR}/platform/text/efl"
"${WEBCORE_DIR}/plugins/efl"
@@ -73,6 +74,8 @@ LIST(APPEND WebCore_SOURCES
platform/image-decoders/jpeg/JPEGImageDecoder.cpp
platform/image-decoders/png/PNGImageDecoder.cpp
platform/image-decoders/webp/WEBPImageDecoder.cpp
+ platform/mediastream/gstreamer/DeprecatedPeerConnectionHandler.cpp
+ platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp
platform/network/soup/CookieJarSoup.cpp
platform/network/soup/CredentialStorageSoup.cpp
platform/network/soup/DNSSoup.cpp
diff --git a/Source/WebCore/Target.pri b/Source/WebCore/Target.pri
index 67fedd625..4fa72577e 100644
--- a/Source/WebCore/Target.pri
+++ b/Source/WebCore/Target.pri
@@ -466,6 +466,7 @@ SOURCES += \
css/CSSStyleRule.cpp \
css/CSSStyleSheet.cpp \
css/CSSTimingFunctionValue.cpp \
+ css/CSSToStyleMap.cpp \
css/CSSUnicodeRangeValue.cpp \
css/CSSValue.cpp \
css/CSSValueList.cpp \
@@ -1648,6 +1649,7 @@ HEADERS += \
css/CSSStyleRule.h \
css/CSSStyleSheet.h \
css/CSSTimingFunctionValue.h \
+ css/CSSToStyleMap.h \
css/CSSUnicodeRangeValue.h \
css/CSSValue.cpp \
css/CSSValue.h \
@@ -2035,7 +2037,7 @@ HEADERS += \
html/track/WebVTTParser.h \
html/track/WebVTTToken.h \
html/track/WebVTTTokenizer.h \
- inspector/BindingVisitor.h \
+ inspector/BindingVisitors.h \
inspector/ConsoleMessage.h \
inspector/ContentSearchUtils.h \
inspector/DOMEditor.h \
@@ -4144,7 +4146,7 @@ contains(CONFIG, texmap) {
platform/graphics/texmap/TextureMapperLayer.cpp \
platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
- !win32-*:contains(QT_CONFIG, opengl) {
+ contains(DEFINES, WTF_USE_TEXTURE_MAPPER_GL=1) {
HEADERS += \
platform/graphics/texmap/TextureMapperGL.h \
platform/graphics/texmap/TextureMapperShaderManager.h
@@ -4154,7 +4156,6 @@ contains(CONFIG, texmap) {
platform/graphics/texmap/TextureMapperShaderManager.cpp
CONFIG += opengl-shims
- DEFINES += WTF_USE_TEXTURE_MAPPER_GL
}
} else {
HEADERS += platform/graphics/qt/GraphicsLayerQt.h
diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi
index d73e670ea..1054e0725 100644
--- a/Source/WebCore/WebCore.gypi
+++ b/Source/WebCore/WebCore.gypi
@@ -2505,6 +2505,8 @@
'css/CSSStyleSheet.h',
'css/CSSTimingFunctionValue.cpp',
'css/CSSTimingFunctionValue.h',
+ 'css/CSSToStyleMap.cpp',
+ 'css/CSSToStyleMap.h',
'css/CSSUnicodeRangeValue.cpp',
'css/CSSUnicodeRangeValue.h',
'css/CSSUnknownRule.h',
@@ -3751,6 +3753,7 @@
'platform/graphics/chromium/cc/CCProxy.h',
'platform/graphics/chromium/cc/CCQuadCuller.cpp',
'platform/graphics/chromium/cc/CCQuadCuller.h',
+ 'platform/graphics/chromium/cc/CCRenderingStats.h',
'platform/graphics/chromium/cc/CCRenderPass.cpp',
'platform/graphics/chromium/cc/CCRenderPass.h',
'platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp',
diff --git a/Source/WebCore/WebCore.pri b/Source/WebCore/WebCore.pri
index e2ccc6186..193f5fea3 100644
--- a/Source/WebCore/WebCore.pri
+++ b/Source/WebCore/WebCore.pri
@@ -213,7 +213,9 @@ contains(DEFINES, ENABLE_WEBGL=1) {
contains(CONFIG, texmap) {
DEFINES += WTF_USE_TEXTURE_MAPPER=1
- !win32-*:contains(QT_CONFIG, opengl) {
+ # TextureMapperGL requires stuff from GraphicsContext3D, hence the WebGL
+ # dependency.
+ !win32-*:contains(QT_CONFIG, opengl):contains(DEFINES, ENABLE_WEBGL=1) {
DEFINES += WTF_USE_TEXTURE_MAPPER_GL=1
contains(QT_CONFIG, opengles2): LIBS += -lEGL
}
diff --git a/Source/WebCore/WebCore.vcproj/WebCore.vcproj b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
index a002e29da..d12db566c 100755
--- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -36635,6 +36635,14 @@
>
</File>
<File
+ RelativePath="..\css\CSSToStyleMap.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\css\CSSToStyleMap.h"
+ >
+ </File>
+ <File
RelativePath="..\css\CSSUnicodeRangeValue.cpp"
>
<FileConfiguration
diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
index 07f929236..cc8344134 100644
--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -4187,6 +4187,8 @@
A871DFE40A15376B00B12A68 /* RenderWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DFE00A15376B00B12A68 /* RenderWidget.h */; settings = {ATTRIBUTES = (Private, ); }; };
A871DFE50A15376B00B12A68 /* RenderWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A871DFE10A15376B00B12A68 /* RenderWidget.cpp */; };
A8748BE012CBF2DC001FBA41 /* HashTools.h in Headers */ = {isa = PBXBuildFile; fileRef = A8748BDF12CBF2DC001FBA41 /* HashTools.h */; };
+ A882DA201593846A000115ED /* CSSToStyleMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A882DA1F1593846A000115ED /* CSSToStyleMap.cpp */; };
+ A882DA231593848D000115ED /* CSSToStyleMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A882DA221593848D000115ED /* CSSToStyleMap.h */; };
A883DF270F3D045D00F19BF6 /* VisibleSelection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */; };
A883DF280F3D045D00F19BF6 /* VisibleSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = A883DF260F3D045D00F19BF6 /* VisibleSelection.h */; settings = {ATTRIBUTES = (Private, ); }; };
A88AD52F09524B92001DD196 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A85D7A2F0879EBA9006A9172 /* QuartzCore.framework */; };
@@ -11197,6 +11199,8 @@
A8748BDF12CBF2DC001FBA41 /* HashTools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashTools.h; sourceTree = "<group>"; };
A8748D6612CC3763001FBA41 /* ImageOrientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageOrientation.h; sourceTree = "<group>"; };
A8748D7412CC3F89001FBA41 /* ImageOrientation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageOrientation.cpp; sourceTree = "<group>"; };
+ A882DA1F1593846A000115ED /* CSSToStyleMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSToStyleMap.cpp; sourceTree = "<group>"; };
+ A882DA221593848D000115ED /* CSSToStyleMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSToStyleMap.h; sourceTree = "<group>"; };
A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisibleSelection.cpp; sourceTree = "<group>"; };
A883DF260F3D045D00F19BF6 /* VisibleSelection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisibleSelection.h; sourceTree = "<group>"; };
A886CDC214FBBAA300D279F4 /* WorkerContextWebSocket.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WorkerContextWebSocket.idl; path = Modules/websockets/WorkerContextWebSocket.idl; sourceTree = "<group>"; };
@@ -20997,6 +21001,8 @@
BC9ADD7F0CC4092200098C4C /* WebKitCSSTransformValue.cpp */,
BC9ADD220CC4032600098C4C /* WebKitCSSTransformValue.h */,
31611E540E1C4D4A00F6A579 /* WebKitCSSTransformValue.idl */,
+ A882DA1F1593846A000115ED /* CSSToStyleMap.cpp */,
+ A882DA221593848D000115ED /* CSSToStyleMap.h */,
);
path = css;
sourceTree = "<group>";
@@ -25148,6 +25154,7 @@
CE7B2DB51586ABAD0098B3FA /* TextAlternativeWithRange.h in Headers */,
50987C27157D676D00BDA835 /* CustomFilterGlobalContext.h in Headers */,
4F32BB1B14FA85E800F6C1A3 /* MemoryInstrumentation.h in Headers */,
+ A882DA231593848D000115ED /* CSSToStyleMap.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -28200,6 +28207,7 @@
CE7B2DB41586ABAD0098B3FA /* AlternativeTextUIController.mm in Sources */,
CE7B2DB61586ABAD0098B3FA /* TextAlternativeWithRange.mm in Sources */,
50987C26157D676D00BDA835 /* CustomFilterGlobalContext.cpp in Sources */,
+ A882DA201593846A000115ED /* CSSToStyleMap.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
index ba41d21d5..fdb8d0240 100644
--- a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -2424,9 +2424,8 @@ AccessibilityObject* AccessibilityRenderObject::accessibilityParentForImageMap(H
void AccessibilityRenderObject::getDocumentLinks(AccessibilityChildrenVector& result)
{
Document* document = m_renderer->document();
- HTMLCollection* coll = document->links();
- Node* curr = coll->firstItem();
- while (curr) {
+ HTMLCollection* links = document->links();
+ for (unsigned i = 0; Node* curr = links->item(i); i++) {
RenderObject* obj = curr->renderer();
if (obj) {
RefPtr<AccessibilityObject> axobj = document->axObjectCache()->getOrCreate(obj);
@@ -2444,7 +2443,6 @@ void AccessibilityRenderObject::getDocumentLinks(AccessibilityChildrenVector& re
result.append(areaObject);
}
}
- curr = coll->nextItem();
}
}
diff --git a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp b/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
index 37968471b..2d17465e0 100644
--- a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
+++ b/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
@@ -117,8 +117,8 @@ static JSValue namedItemGetter(ExecState* exec, JSValue slotBase, PropertyName p
ASSERT(document->isHTMLDocument());
HTMLCollection* collection = document->windowNamedItems(propertyNameToAtomicString(propertyName));
- if (collection->length() == 1)
- return toJS(exec, thisObj, collection->firstItem());
+ if (collection->hasExactlyOneItem())
+ return toJS(exec, thisObj, collection->item(0));
return toJS(exec, thisObj, collection);
}
diff --git a/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp b/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
index 14bc0f085..fddc5a5d1 100644
--- a/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
+++ b/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
@@ -64,12 +64,11 @@ JSValue JSHTMLDocument::nameGetter(ExecState* exec, JSValue slotBase, PropertyNa
HTMLCollection* collection = document->documentNamedItems(propertyNameToAtomicString(propertyName));
- unsigned length = collection->length();
- if (!length)
+ if (!collection->hasAnyItem())
return jsUndefined();
- if (length == 1) {
- Node* node = collection->firstItem();
+ if (collection->hasExactlyOneItem()) {
+ Node* node = collection->item(0);
Frame* frame;
if (node->hasTagName(iframeTag) && (frame = static_cast<HTMLIFrameElement*>(node)->contentFrame()))
diff --git a/Source/WebCore/bindings/objc/DOMEvents.mm b/Source/WebCore/bindings/objc/DOMEvents.mm
index d7ba17f4c..d7ba17f4c 100644..100755
--- a/Source/WebCore/bindings/objc/DOMEvents.mm
+++ b/Source/WebCore/bindings/objc/DOMEvents.mm
diff --git a/Source/WebCore/bindings/objc/PublicDOMInterfaces.h b/Source/WebCore/bindings/objc/PublicDOMInterfaces.h
index 287e4eea8..45e167729 100644
--- a/Source/WebCore/bindings/objc/PublicDOMInterfaces.h
+++ b/Source/WebCore/bindings/objc/PublicDOMInterfaces.h
@@ -1082,23 +1082,11 @@
- (void)initOverflowEvent:(unsigned short)orient horizontalOverflow:(BOOL)horizontalOverflow verticalOverflow:(BOOL)verticalOverflow;
@end
-@interface DOMWheelEvent : DOMUIEvent WEBKIT_VERSION_3_0
-@property(readonly) int screenX;
-@property(readonly) int screenY;
-@property(readonly) int clientX;
-@property(readonly) int clientY;
-@property(readonly) BOOL ctrlKey;
-@property(readonly) BOOL shiftKey;
-@property(readonly) BOOL altKey;
-@property(readonly) BOOL metaKey;
+@interface DOMWheelEvent : DOMMouseEvent WEBKIT_VERSION_3_0
@property(readonly) BOOL isHorizontal;
@property(readonly) int wheelDelta;
@property(readonly) int wheelDeltaX AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
@property(readonly) int wheelDeltaY AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
-@property(readonly) int offsetX AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
-@property(readonly) int offsetY AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
-@property(readonly) int x AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
-@property(readonly) int y AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
- (void)initWheelEvent:(int)wheelDeltaX wheelDeltaY:(int)wheelDeltaY view:(DOMAbstractView *)view screenX:(int)screenX screenY:(int)screenY clientX:(int)clientX clientY:(int)clientY ctrlKey:(BOOL)ctrlKey altKey:(BOOL)altKey shiftKey:(BOOL)shiftKey metaKey:(BOOL)metaKey AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
@end
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm b/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm
index 6bfc8898e..269792ff0 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm
@@ -418,7 +418,7 @@ sub GetBaseClass
$parent = shift;
return $parent if $parent eq "Object" or IsBaseType($parent);
- return "Event" if $parent eq "UIEvent";
+ return "Event" if $parent eq "UIEvent" or $parent eq "MouseEvent";
return "CSSValue" if $parent eq "SVGColor" or $parent eq "CSSValueList";
return "Node";
}
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
index a92989a52..254ec9396 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -1724,13 +1724,8 @@ sub GenerateParametersCheck
$parameterCheckString .= " EXCEPTION_BLOCK($nativeType, $parameterName, " .
JSValueToNative($parameter, "MAYBE_MISSING_PARAMETER(args, $paramIndex, $parameterDefaultPolicy)", "args.GetIsolate()") . ");\n";
if ($nativeType eq 'Dictionary') {
- $parameterCheckString .= " if (args.Length() > $paramIndex && !$parameterName.isUndefinedOrNull() && !$parameterName.isObject()) {\n";
- if (@{$function->raisesExceptions}) {
- $parameterCheckString .= " ec = TYPE_MISMATCH_ERR;\n";
- $parameterCheckString .= " V8Proxy::setDOMException(ec, args.GetIsolate());\n";
- }
- $parameterCheckString .= " return V8Proxy::throwTypeError(\"Not an object.\");\n";
- $parameterCheckString .= " }\n";
+ $parameterCheckString .= " if (!$parameterName.isUndefinedOrNull() && !$parameterName.isObject())\n";
+ $parameterCheckString .= " return V8Proxy::throwTypeError(\"Not an object.\", args.GetIsolate());\n";
}
}
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
index dd2e6f489..40b8d9dbd 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
@@ -1150,17 +1150,15 @@ static v8::Handle<v8::Value> optionsObjectCallback(const v8::Arguments& args)
return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(Dictionary, oo, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
- if (args.Length() > 0 && !oo.isUndefinedOrNull() && !oo.isObject()) {
- return V8Proxy::throwTypeError("Not an object.");
- }
+ if (!oo.isUndefinedOrNull() && !oo.isObject())
+ return V8Proxy::throwTypeError("Not an object.", args.GetIsolate());
if (args.Length() <= 1) {
imp->optionsObject(oo);
return v8::Handle<v8::Value>();
}
EXCEPTION_BLOCK(Dictionary, ooo, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
- if (args.Length() > 1 && !ooo.isUndefinedOrNull() && !ooo.isObject()) {
- return V8Proxy::throwTypeError("Not an object.");
- }
+ if (!ooo.isUndefinedOrNull() && !ooo.isObject())
+ return V8Proxy::throwTypeError("Not an object.", args.GetIsolate());
imp->optionsObject(oo, ooo);
return v8::Handle<v8::Value>();
}
diff --git a/Source/WebCore/bindings/v8/V8DOMWrapper.cpp b/Source/WebCore/bindings/v8/V8DOMWrapper.cpp
index 05c17ab03..f595fe4f8 100644
--- a/Source/WebCore/bindings/v8/V8DOMWrapper.cpp
+++ b/Source/WebCore/bindings/v8/V8DOMWrapper.cpp
@@ -224,6 +224,7 @@ bool V8DOMWrapper::maybeDOMWrapper(v8::Handle<v8::Value> value)
ASSERT(object->InternalFieldCount() >= v8DefaultWrapperInternalFieldCount);
+ v8::HandleScope scope;
v8::Handle<v8::Value> wrapper = object->GetInternalField(v8DOMWrapperObjectIndex);
ASSERT(wrapper->IsNumber() || wrapper->IsExternal());
diff --git a/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index 0ea813eb5..c0964ad19 100644
--- a/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -521,9 +521,9 @@ v8::Handle<v8::Value> V8DOMWindow::namedPropertyGetter(v8::Local<v8::String> nam
if (doc && doc->isHTMLDocument()) {
if (static_cast<HTMLDocument*>(doc)->hasNamedItem(propName.impl()) || doc->hasElementWithId(propName.impl())) {
HTMLCollection* items = doc->windowNamedItems(propName);
- if (items->length() >= 1) {
- if (items->length() == 1)
- return toV8(items->firstItem(), info.GetIsolate());
+ if (items->hasAnyItem()) {
+ if (items->hasExactlyOneItem())
+ return toV8(items->item(0), info.GetIsolate());
return toV8(items, info.GetIsolate());
}
}
diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
index 6b9d0b327..df5331727 100644
--- a/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
@@ -85,11 +85,11 @@ v8::Handle<v8::Value> V8HTMLDocument::GetNamedProperty(HTMLDocument* htmlDocumen
return v8::Handle<v8::Value>();
HTMLCollection* items = htmlDocument->documentNamedItems(key);
- if (!items->length())
+ if (!items->hasAnyItem())
return v8::Handle<v8::Value>();
- if (items->length() == 1) {
- Node* node = items->firstItem();
+ if (items->hasExactlyOneItem()) {
+ Node* node = items->item(0);
Frame* frame = 0;
if (node->hasTagName(HTMLNames::iframeTag) && (frame = static_cast<HTMLIFrameElement*>(node)->contentFrame()))
return toV8(frame->domWindow(), isolate);
diff --git a/Source/WebCore/bridge/runtime_object.cpp b/Source/WebCore/bridge/runtime_object.cpp
index 71f72fd4b..a1a30ce01 100644
--- a/Source/WebCore/bridge/runtime_object.cpp
+++ b/Source/WebCore/bridge/runtime_object.cpp
@@ -51,9 +51,7 @@ void RuntimeObject::finishCreation(JSGlobalObject* globalObject)
void RuntimeObject::destroy(JSCell* cell)
{
- RuntimeObject* thisObject = static_cast<RuntimeObject*>(cell);
- ASSERT(!thisObject->m_instance);
- thisObject->RuntimeObject::~RuntimeObject();
+ static_cast<RuntimeObject*>(cell)->RuntimeObject::~RuntimeObject();
}
void RuntimeObject::invalidate()
diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp
index 63658cbfe..cc96a2d1f 100644
--- a/Source/WebCore/css/CSSParser.cpp
+++ b/Source/WebCore/css/CSSParser.cpp
@@ -1013,6 +1013,74 @@ static bool parseKeywordValue(StylePropertySet* declaration, CSSPropertyID prope
return true;
}
+template <typename CharType>
+static bool parseTransformArguments(WebKitCSSTransformValue* transformValue, CharType* characters, unsigned length, unsigned start, unsigned expectedCount)
+{
+ while (expectedCount) {
+ size_t end = WTF::find(characters, length, expectedCount == 1 ? ')' : ',', start);
+ if (end == notFound || (expectedCount == 1 && end != length - 1))
+ return false;
+ unsigned argumentLength = end - start;
+ CSSPrimitiveValue::UnitTypes unit = CSSPrimitiveValue::CSS_NUMBER;
+ double number;
+ if (!parseSimpleLength(characters + start, argumentLength, unit, number))
+ return false;
+ if (unit != CSSPrimitiveValue::CSS_PX && (number || unit != CSSPrimitiveValue::CSS_NUMBER))
+ return false;
+ transformValue->append(cssValuePool().createValue(number, unit));
+ start = end + 1;
+ --expectedCount;
+ }
+ return true;
+}
+
+static bool parseTransformValue(StylePropertySet* properties, CSSPropertyID propertyID, const String& string, bool important)
+{
+ if (propertyID != CSSPropertyWebkitTransform)
+ return false;
+ static const unsigned shortestValidTransformStringLength = 12;
+ static const unsigned likelyMultipartTransformStringLengthCutoff = 32;
+ if (string.length() < shortestValidTransformStringLength || string.length() > likelyMultipartTransformStringLengthCutoff)
+ return false;
+ if (!string.startsWith("translate", false))
+ return false;
+ UChar c9 = toASCIILower(string[9]);
+ UChar c10 = toASCIILower(string[10]);
+
+ WebKitCSSTransformValue::TransformOperationType transformType;
+ unsigned expectedArgumentCount = 1;
+ unsigned argumentStart = 11;
+ if (c9 == 'x' && c10 == '(')
+ transformType = WebKitCSSTransformValue::TranslateXTransformOperation;
+ else if (c9 == 'y' && c10 == '(')
+ transformType = WebKitCSSTransformValue::TranslateYTransformOperation;
+ else if (c9 == 'z' && c10 == '(')
+ transformType = WebKitCSSTransformValue::TranslateZTransformOperation;
+ else if (c9 == '(') {
+ transformType = WebKitCSSTransformValue::TranslateTransformOperation;
+ expectedArgumentCount = 2;
+ argumentStart = 10;
+ } else if (c9 == '3' && c10 == 'd' && string[11] == '(') {
+ transformType = WebKitCSSTransformValue::Translate3DTransformOperation;
+ expectedArgumentCount = 3;
+ argumentStart = 12;
+ } else
+ return false;
+
+ RefPtr<WebKitCSSTransformValue> transformValue = WebKitCSSTransformValue::create(transformType);
+ bool success;
+ if (string.is8Bit())
+ success = parseTransformArguments(transformValue.get(), string.characters8(), string.length(), argumentStart, expectedArgumentCount);
+ else
+ success = parseTransformArguments(transformValue.get(), string.characters16(), string.length(), argumentStart, expectedArgumentCount);
+ if (!success)
+ return false;
+ RefPtr<CSSValueList> result = CSSValueList::createSpaceSeparated();
+ result->append(transformValue.release());
+ properties->addParsedProperty(CSSProperty(CSSPropertyWebkitTransform, result.release(), important));
+ return true;
+}
+
PassRefPtr<CSSValueList> CSSParser::parseFontFaceValue(const AtomicString& string)
{
if (string.isEmpty())
@@ -1051,6 +1119,8 @@ bool CSSParser::parseValue(StylePropertySet* declaration, CSSPropertyID property
return true;
if (parseKeywordValue(declaration, propertyID, string, important, contextStyleSheet->parserContext()))
return true;
+ if (parseTransformValue(declaration, propertyID, string, important))
+ return true;
CSSParserContext context(cssParserMode);
if (contextStyleSheet) {
@@ -2621,6 +2691,11 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
m_valueList->next();
break;
#endif
+#if ENABLE(CSS_VARIABLES)
+ case CSSPropertyVariable:
+ // FIXME: This should have an actual implementation.
+ return false;
+#endif
case CSSPropertyBorderBottomStyle:
case CSSPropertyBorderCollapse:
case CSSPropertyBorderLeftStyle:
@@ -8897,7 +8972,7 @@ restartAfterComment:
case CharacterDash:
#if ENABLE(CSS_VARIABLES)
- if (cssVariablesEnabled() && m_currentCharacter[10] == '-' && isEqualToCSSIdentifier(m_currentCharacter, "webkit-var") && isIdentifierStartAfterDash(m_currentCharacter + 11)) {
+ if (cssVariablesEnabled() && isEqualToCSSIdentifier(m_currentCharacter, "webkit-var") && m_currentCharacter[10] == '-' && isIdentifierStartAfterDash(m_currentCharacter + 11)) {
// handle variable declarations
m_currentCharacter += 11;
parseIdentifier(result, hasEscape);
diff --git a/Source/WebCore/css/CSSParserMode.h b/Source/WebCore/css/CSSParserMode.h
index d6b211522..5228e9812 100644
--- a/Source/WebCore/css/CSSParserMode.h
+++ b/Source/WebCore/css/CSSParserMode.h
@@ -26,7 +26,6 @@
* 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 CSSParserMode_h
diff --git a/Source/WebCore/css/CSSToStyleMap.cpp b/Source/WebCore/css/CSSToStyleMap.cpp
new file mode 100644
index 000000000..e154cecd3
--- /dev/null
+++ b/Source/WebCore/css/CSSToStyleMap.cpp
@@ -0,0 +1,659 @@
+/*
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
+ * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
+ * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
+ * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ * Copyright (C) Research In Motion Limited 2011. 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"
+#include "CSSToStyleMap.h"
+
+#include "Animation.h"
+#include "CSSBorderImageSliceValue.h"
+#include "CSSPrimitiveValue.h"
+#include "CSSPrimitiveValueMappings.h"
+#include "CSSTimingFunctionValue.h"
+#include "CSSValueKeywords.h"
+#include "FillLayer.h"
+#include "Pair.h"
+#include "Rect.h"
+#include "StyleResolver.h"
+
+namespace WebCore {
+
+RenderStyle* CSSToStyleMap::style() const
+{
+ return m_resolver->style();
+}
+
+RenderStyle* CSSToStyleMap::rootElementStyle() const
+{
+ return m_resolver->rootElementStyle();
+}
+
+bool CSSToStyleMap::useSVGZoomRules() const
+{
+ return m_resolver->useSVGZoomRules();
+}
+
+PassRefPtr<StyleImage> CSSToStyleMap::styleImage(CSSPropertyID propertyId, CSSValue* value)
+{
+ return m_resolver->styleImage(propertyId, value);
+}
+
+void CSSToStyleMap::mapFillAttachment(CSSPropertyID, FillLayer* layer, CSSValue* value)
+{
+ if (value->isInitialValue()) {
+ layer->setAttachment(FillLayer::initialFillAttachment(layer->type()));
+ return;
+ }
+
+ if (!value->isPrimitiveValue())
+ return;
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ switch (primitiveValue->getIdent()) {
+ case CSSValueFixed:
+ layer->setAttachment(FixedBackgroundAttachment);
+ break;
+ case CSSValueScroll:
+ layer->setAttachment(ScrollBackgroundAttachment);
+ break;
+ case CSSValueLocal:
+ layer->setAttachment(LocalBackgroundAttachment);
+ break;
+ default:
+ return;
+ }
+}
+
+void CSSToStyleMap::mapFillClip(CSSPropertyID, FillLayer* layer, CSSValue* value)
+{
+ if (value->isInitialValue()) {
+ layer->setClip(FillLayer::initialFillClip(layer->type()));
+ return;
+ }
+
+ if (!value->isPrimitiveValue())
+ return;
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ layer->setClip(*primitiveValue);
+}
+
+void CSSToStyleMap::mapFillComposite(CSSPropertyID, FillLayer* layer, CSSValue* value)
+{
+ if (value->isInitialValue()) {
+ layer->setComposite(FillLayer::initialFillComposite(layer->type()));
+ return;
+ }
+
+ if (!value->isPrimitiveValue())
+ return;
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ layer->setComposite(*primitiveValue);
+}
+
+void CSSToStyleMap::mapFillOrigin(CSSPropertyID, FillLayer* layer, CSSValue* value)
+{
+ if (value->isInitialValue()) {
+ layer->setOrigin(FillLayer::initialFillOrigin(layer->type()));
+ return;
+ }
+
+ if (!value->isPrimitiveValue())
+ return;
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ layer->setOrigin(*primitiveValue);
+}
+
+
+void CSSToStyleMap::mapFillImage(CSSPropertyID property, FillLayer* layer, CSSValue* value)
+{
+ if (value->isInitialValue()) {
+ layer->setImage(FillLayer::initialFillImage(layer->type()));
+ return;
+ }
+
+ layer->setImage(styleImage(property, value));
+}
+
+void CSSToStyleMap::mapFillRepeatX(CSSPropertyID, FillLayer* layer, CSSValue* value)
+{
+ if (value->isInitialValue()) {
+ layer->setRepeatX(FillLayer::initialFillRepeatX(layer->type()));
+ return;
+ }
+
+ if (!value->isPrimitiveValue())
+ return;
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ layer->setRepeatX(*primitiveValue);
+}
+
+void CSSToStyleMap::mapFillRepeatY(CSSPropertyID, FillLayer* layer, CSSValue* value)
+{
+ if (value->isInitialValue()) {
+ layer->setRepeatY(FillLayer::initialFillRepeatY(layer->type()));
+ return;
+ }
+
+ if (!value->isPrimitiveValue())
+ return;
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ layer->setRepeatY(*primitiveValue);
+}
+
+void CSSToStyleMap::mapFillSize(CSSPropertyID, FillLayer* layer, CSSValue* value)
+{
+ if (!value->isPrimitiveValue()) {
+ layer->setSizeType(SizeNone);
+ return;
+ }
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ if (primitiveValue->getIdent() == CSSValueContain)
+ layer->setSizeType(Contain);
+ else if (primitiveValue->getIdent() == CSSValueCover)
+ layer->setSizeType(Cover);
+ else
+ layer->setSizeType(SizeLength);
+
+ LengthSize b = FillLayer::initialFillSizeLength(layer->type());
+
+ if (value->isInitialValue() || primitiveValue->getIdent() == CSSValueContain || primitiveValue->getIdent() == CSSValueCover) {
+ layer->setSizeLength(b);
+ return;
+ }
+
+ float zoomFactor = style()->effectiveZoom();
+
+ Length firstLength;
+ Length secondLength;
+
+ if (Pair* pair = primitiveValue->getPairValue()) {
+ CSSPrimitiveValue* first = static_cast<CSSPrimitiveValue*>(pair->first());
+ CSSPrimitiveValue* second = static_cast<CSSPrimitiveValue*>(pair->second());
+ firstLength = first->convertToLength<AnyConversion>(style(), rootElementStyle(), zoomFactor);
+ secondLength = second->convertToLength<AnyConversion>(style(), rootElementStyle(), zoomFactor);
+ } else {
+ firstLength = primitiveValue->convertToLength<AnyConversion>(style(), rootElementStyle(), zoomFactor);
+ secondLength = Length();
+ }
+
+ if (firstLength.isUndefined() || secondLength.isUndefined())
+ return;
+
+ b.setWidth(firstLength);
+ b.setHeight(secondLength);
+ layer->setSizeLength(b);
+}
+
+void CSSToStyleMap::mapFillXPosition(CSSPropertyID, FillLayer* layer, CSSValue* value)
+{
+ if (value->isInitialValue()) {
+ layer->setXPosition(FillLayer::initialFillXPosition(layer->type()));
+ return;
+ }
+
+ if (!value->isPrimitiveValue())
+ return;
+
+ float zoomFactor = style()->effectiveZoom();
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ Length length;
+ if (primitiveValue->isLength())
+ length = primitiveValue->computeLength<Length>(style(), rootElementStyle(), zoomFactor);
+ else if (primitiveValue->isPercentage())
+ length = Length(primitiveValue->getDoubleValue(), Percent);
+ else if (primitiveValue->isCalculatedPercentageWithLength())
+ length = Length(primitiveValue->cssCalcValue()->toCalcValue(style(), rootElementStyle(), zoomFactor));
+ else if (primitiveValue->isViewportPercentageLength())
+ length = primitiveValue->viewportPercentageLength();
+ else
+ return;
+ layer->setXPosition(length);
+}
+
+void CSSToStyleMap::mapFillYPosition(CSSPropertyID, FillLayer* layer, CSSValue* value)
+{
+ if (value->isInitialValue()) {
+ layer->setYPosition(FillLayer::initialFillYPosition(layer->type()));
+ return;
+ }
+
+ if (!value->isPrimitiveValue())
+ return;
+
+ float zoomFactor = style()->effectiveZoom();
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ Length length;
+ if (primitiveValue->isLength())
+ length = primitiveValue->computeLength<Length>(style(), rootElementStyle(), zoomFactor);
+ else if (primitiveValue->isPercentage())
+ length = Length(primitiveValue->getDoubleValue(), Percent);
+ else if (primitiveValue->isCalculatedPercentageWithLength())
+ length = Length(primitiveValue->cssCalcValue()->toCalcValue(style(), rootElementStyle(), zoomFactor));
+ else if (primitiveValue->isViewportPercentageLength())
+ length = primitiveValue->viewportPercentageLength();
+ else
+ return;
+ layer->setYPosition(length);
+}
+
+void CSSToStyleMap::mapAnimationDelay(Animation* animation, CSSValue* value)
+{
+ if (value->isInitialValue()) {
+ animation->setDelay(Animation::initialAnimationDelay());
+ return;
+ }
+
+ if (!value->isPrimitiveValue())
+ return;
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ animation->setDelay(primitiveValue->computeTime<float, CSSPrimitiveValue::Seconds>());
+}
+
+void CSSToStyleMap::mapAnimationDirection(Animation* layer, CSSValue* value)
+{
+ if (value->isInitialValue()) {
+ layer->setDirection(Animation::initialAnimationDirection());
+ return;
+ }
+
+ if (!value->isPrimitiveValue())
+ return;
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ switch (primitiveValue->getIdent()) {
+ case CSSValueNormal:
+ layer->setDirection(Animation::AnimationDirectionNormal);
+ break;
+ case CSSValueAlternate:
+ layer->setDirection(Animation::AnimationDirectionAlternate);
+ break;
+ case CSSValueReverse:
+ layer->setDirection(Animation::AnimationDirectionReverse);
+ break;
+ case CSSValueAlternateReverse:
+ layer->setDirection(Animation::AnimationDirectionAlternateReverse);
+ break;
+ }
+}
+
+void CSSToStyleMap::mapAnimationDuration(Animation* animation, CSSValue* value)
+{
+ if (value->isInitialValue()) {
+ animation->setDuration(Animation::initialAnimationDuration());
+ return;
+ }
+
+ if (!value->isPrimitiveValue())
+ return;
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ animation->setDuration(primitiveValue->computeTime<float, CSSPrimitiveValue::Seconds>());
+}
+
+void CSSToStyleMap::mapAnimationFillMode(Animation* layer, CSSValue* value)
+{
+ if (value->isInitialValue()) {
+ layer->setFillMode(Animation::initialAnimationFillMode());
+ return;
+ }
+
+ if (!value->isPrimitiveValue())
+ return;
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ switch (primitiveValue->getIdent()) {
+ case CSSValueNone:
+ layer->setFillMode(AnimationFillModeNone);
+ break;
+ case CSSValueForwards:
+ layer->setFillMode(AnimationFillModeForwards);
+ break;
+ case CSSValueBackwards:
+ layer->setFillMode(AnimationFillModeBackwards);
+ break;
+ case CSSValueBoth:
+ layer->setFillMode(AnimationFillModeBoth);
+ break;
+ }
+}
+
+void CSSToStyleMap::mapAnimationIterationCount(Animation* animation, CSSValue* value)
+{
+ if (value->isInitialValue()) {
+ animation->setIterationCount(Animation::initialAnimationIterationCount());
+ return;
+ }
+
+ if (!value->isPrimitiveValue())
+ return;
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ if (primitiveValue->getIdent() == CSSValueInfinite)
+ animation->setIterationCount(-1);
+ else
+ animation->setIterationCount(primitiveValue->getFloatValue());
+}
+
+void CSSToStyleMap::mapAnimationName(Animation* layer, CSSValue* value)
+{
+ if (value->isInitialValue()) {
+ layer->setName(Animation::initialAnimationName());
+ return;
+ }
+
+ if (!value->isPrimitiveValue())
+ return;
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ if (primitiveValue->getIdent() == CSSValueNone)
+ layer->setIsNoneAnimation(true);
+ else
+ layer->setName(primitiveValue->getStringValue());
+}
+
+void CSSToStyleMap::mapAnimationPlayState(Animation* layer, CSSValue* value)
+{
+ if (value->isInitialValue()) {
+ layer->setPlayState(Animation::initialAnimationPlayState());
+ return;
+ }
+
+ if (!value->isPrimitiveValue())
+ return;
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ EAnimPlayState playState = (primitiveValue->getIdent() == CSSValuePaused) ? AnimPlayStatePaused : AnimPlayStatePlaying;
+ layer->setPlayState(playState);
+}
+
+void CSSToStyleMap::mapAnimationProperty(Animation* animation, CSSValue* value)
+{
+ if (value->isInitialValue()) {
+ animation->setAnimationMode(Animation::AnimateAll);
+ animation->setProperty(CSSPropertyInvalid);
+ return;
+ }
+
+ if (!value->isPrimitiveValue())
+ return;
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ if (primitiveValue->getIdent() == CSSValueAll) {
+ animation->setAnimationMode(Animation::AnimateAll);
+ animation->setProperty(CSSPropertyInvalid);
+ } else if (primitiveValue->getIdent() == CSSValueNone) {
+ animation->setAnimationMode(Animation::AnimateNone);
+ animation->setProperty(CSSPropertyInvalid);
+ } else {
+ animation->setAnimationMode(Animation::AnimateSingleProperty);
+ animation->setProperty(static_cast<CSSPropertyID>(primitiveValue->getIdent()));
+ }
+}
+
+void CSSToStyleMap::mapAnimationTimingFunction(Animation* animation, CSSValue* value)
+{
+ if (value->isInitialValue()) {
+ animation->setTimingFunction(Animation::initialAnimationTimingFunction());
+ return;
+ }
+
+ if (value->isPrimitiveValue()) {
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ switch (primitiveValue->getIdent()) {
+ case CSSValueLinear:
+ animation->setTimingFunction(LinearTimingFunction::create());
+ break;
+ case CSSValueEase:
+ animation->setTimingFunction(CubicBezierTimingFunction::create());
+ break;
+ case CSSValueEaseIn:
+ animation->setTimingFunction(CubicBezierTimingFunction::create(0.42, 0.0, 1.0, 1.0));
+ break;
+ case CSSValueEaseOut:
+ animation->setTimingFunction(CubicBezierTimingFunction::create(0.0, 0.0, 0.58, 1.0));
+ break;
+ case CSSValueEaseInOut:
+ animation->setTimingFunction(CubicBezierTimingFunction::create(0.42, 0.0, 0.58, 1.0));
+ break;
+ case CSSValueStepStart:
+ animation->setTimingFunction(StepsTimingFunction::create(1, true));
+ break;
+ case CSSValueStepEnd:
+ animation->setTimingFunction(StepsTimingFunction::create(1, false));
+ break;
+ }
+ return;
+ }
+
+ if (value->isCubicBezierTimingFunctionValue()) {
+ CSSCubicBezierTimingFunctionValue* cubicTimingFunction = static_cast<CSSCubicBezierTimingFunctionValue*>(value);
+ animation->setTimingFunction(CubicBezierTimingFunction::create(cubicTimingFunction->x1(), cubicTimingFunction->y1(), cubicTimingFunction->x2(), cubicTimingFunction->y2()));
+ } else if (value->isStepsTimingFunctionValue()) {
+ CSSStepsTimingFunctionValue* stepsTimingFunction = static_cast<CSSStepsTimingFunctionValue*>(value);
+ animation->setTimingFunction(StepsTimingFunction::create(stepsTimingFunction->numberOfSteps(), stepsTimingFunction->stepAtStart()));
+ } else if (value->isLinearTimingFunctionValue())
+ animation->setTimingFunction(LinearTimingFunction::create());
+}
+
+void CSSToStyleMap::mapNinePieceImage(CSSPropertyID property, CSSValue* value, NinePieceImage& image)
+{
+ // If we're not a value list, then we are "none" and don't need to alter the empty image at all.
+ if (!value || !value->isValueList())
+ return;
+
+ // Retrieve the border image value.
+ CSSValueList* borderImage = static_cast<CSSValueList*>(value);
+
+ // Set the image (this kicks off the load).
+ CSSPropertyID imageProperty;
+ if (property == CSSPropertyWebkitBorderImage)
+ imageProperty = CSSPropertyBorderImageSource;
+ else if (property == CSSPropertyWebkitMaskBoxImage)
+ imageProperty = CSSPropertyWebkitMaskBoxImageSource;
+ else
+ imageProperty = property;
+
+ for (unsigned i = 0 ; i < borderImage->length() ; ++i) {
+ CSSValue* current = borderImage->item(i);
+
+ if (current->isImageValue() || current->isImageGeneratorValue()
+#if ENABLE(CSS_IMAGE_SET)
+ || current->isImageSetValue()
+#endif
+ )
+ image.setImage(styleImage(imageProperty, current));
+ else if (current->isBorderImageSliceValue())
+ mapNinePieceImageSlice(current, image);
+ else if (current->isValueList()) {
+ CSSValueList* slashList = static_cast<CSSValueList*>(current);
+ // Map in the image slices.
+ if (slashList->item(0) && slashList->item(0)->isBorderImageSliceValue())
+ mapNinePieceImageSlice(slashList->item(0), image);
+
+ // Map in the border slices.
+ if (slashList->item(1))
+ image.setBorderSlices(mapNinePieceImageQuad(slashList->item(1)));
+
+ // Map in the outset.
+ if (slashList->item(2))
+ image.setOutset(mapNinePieceImageQuad(slashList->item(2)));
+ } else if (current->isPrimitiveValue()) {
+ // Set the appropriate rules for stretch/round/repeat of the slices.
+ mapNinePieceImageRepeat(current, image);
+ }
+ }
+
+ if (property == CSSPropertyWebkitBorderImage) {
+ // We have to preserve the legacy behavior of -webkit-border-image and make the border slices
+ // also set the border widths. We don't need to worry about percentages, since we don't even support
+ // those on real borders yet.
+ if (image.borderSlices().top().isFixed())
+ style()->setBorderTopWidth(image.borderSlices().top().value());
+ if (image.borderSlices().right().isFixed())
+ style()->setBorderRightWidth(image.borderSlices().right().value());
+ if (image.borderSlices().bottom().isFixed())
+ style()->setBorderBottomWidth(image.borderSlices().bottom().value());
+ if (image.borderSlices().left().isFixed())
+ style()->setBorderLeftWidth(image.borderSlices().left().value());
+ }
+}
+
+void CSSToStyleMap::mapNinePieceImageSlice(CSSValue* value, NinePieceImage& image)
+{
+ if (!value || !value->isBorderImageSliceValue())
+ return;
+
+ // Retrieve the border image value.
+ CSSBorderImageSliceValue* borderImageSlice = static_cast<CSSBorderImageSliceValue*>(value);
+
+ // Set up a length box to represent our image slices.
+ LengthBox box;
+ Quad* slices = borderImageSlice->slices();
+ if (slices->top()->isPercentage())
+ box.m_top = Length(slices->top()->getDoubleValue(), Percent);
+ else
+ box.m_top = Length(slices->top()->getIntValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
+ if (slices->bottom()->isPercentage())
+ box.m_bottom = Length(slices->bottom()->getDoubleValue(), Percent);
+ else
+ box.m_bottom = Length((int)slices->bottom()->getFloatValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
+ if (slices->left()->isPercentage())
+ box.m_left = Length(slices->left()->getDoubleValue(), Percent);
+ else
+ box.m_left = Length(slices->left()->getIntValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
+ if (slices->right()->isPercentage())
+ box.m_right = Length(slices->right()->getDoubleValue(), Percent);
+ else
+ box.m_right = Length(slices->right()->getIntValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
+ image.setImageSlices(box);
+
+ // Set our fill mode.
+ image.setFill(borderImageSlice->m_fill);
+}
+
+LengthBox CSSToStyleMap::mapNinePieceImageQuad(CSSValue* value)
+{
+ if (!value || !value->isPrimitiveValue())
+ return LengthBox();
+
+ // Get our zoom value.
+ float zoom = useSVGZoomRules() ? 1.0f : style()->effectiveZoom();
+
+ // Retrieve the primitive value.
+ CSSPrimitiveValue* borderWidths = static_cast<CSSPrimitiveValue*>(value);
+
+ // Set up a length box to represent our image slices.
+ LengthBox box; // Defaults to 'auto' so we don't have to handle that explicitly below.
+ Quad* slices = borderWidths->getQuadValue();
+ if (slices->top()->isNumber())
+ box.m_top = Length(slices->top()->getIntValue(), Relative);
+ else if (slices->top()->isPercentage())
+ box.m_top = Length(slices->top()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
+ else if (slices->top()->getIdent() != CSSValueAuto)
+ box.m_top = slices->top()->computeLength<Length>(style(), rootElementStyle(), zoom);
+
+ if (slices->right()->isNumber())
+ box.m_right = Length(slices->right()->getIntValue(), Relative);
+ else if (slices->right()->isPercentage())
+ box.m_right = Length(slices->right()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
+ else if (slices->right()->getIdent() != CSSValueAuto)
+ box.m_right = slices->right()->computeLength<Length>(style(), rootElementStyle(), zoom);
+
+ if (slices->bottom()->isNumber())
+ box.m_bottom = Length(slices->bottom()->getIntValue(), Relative);
+ else if (slices->bottom()->isPercentage())
+ box.m_bottom = Length(slices->bottom()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
+ else if (slices->bottom()->getIdent() != CSSValueAuto)
+ box.m_bottom = slices->bottom()->computeLength<Length>(style(), rootElementStyle(), zoom);
+
+ if (slices->left()->isNumber())
+ box.m_left = Length(slices->left()->getIntValue(), Relative);
+ else if (slices->left()->isPercentage())
+ box.m_left = Length(slices->left()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
+ else if (slices->left()->getIdent() != CSSValueAuto)
+ box.m_left = slices->left()->computeLength<Length>(style(), rootElementStyle(), zoom);
+
+ return box;
+}
+
+void CSSToStyleMap::mapNinePieceImageRepeat(CSSValue* value, NinePieceImage& image)
+{
+ if (!value || !value->isPrimitiveValue())
+ return;
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ Pair* pair = primitiveValue->getPairValue();
+ if (!pair || !pair->first() || !pair->second())
+ return;
+
+ int firstIdentifier = pair->first()->getIdent();
+ int secondIdentifier = pair->second()->getIdent();
+
+ ENinePieceImageRule horizontalRule;
+ switch (firstIdentifier) {
+ case CSSValueStretch:
+ horizontalRule = StretchImageRule;
+ break;
+ case CSSValueRound:
+ horizontalRule = RoundImageRule;
+ break;
+ case CSSValueSpace:
+ horizontalRule = SpaceImageRule;
+ break;
+ default: // CSSValueRepeat
+ horizontalRule = RepeatImageRule;
+ break;
+ }
+ image.setHorizontalRule(horizontalRule);
+
+ ENinePieceImageRule verticalRule;
+ switch (secondIdentifier) {
+ case CSSValueStretch:
+ verticalRule = StretchImageRule;
+ break;
+ case CSSValueRound:
+ verticalRule = RoundImageRule;
+ break;
+ case CSSValueSpace:
+ verticalRule = SpaceImageRule;
+ break;
+ default: // CSSValueRepeat
+ verticalRule = RepeatImageRule;
+ break;
+ }
+ image.setVerticalRule(verticalRule);
+}
+
+};
diff --git a/Source/WebCore/css/CSSToStyleMap.h b/Source/WebCore/css/CSSToStyleMap.h
new file mode 100644
index 000000000..8e0fc953d
--- /dev/null
+++ b/Source/WebCore/css/CSSToStyleMap.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Google Inc. 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.
+ */
+
+#ifndef CSSToStyleMap_h
+#define CSSToStyleMap_h
+
+#include "CSSPropertyNames.h"
+#include "LengthBox.h"
+
+namespace WebCore {
+
+class FillLayer;
+class CSSValue;
+class Animation;
+class StyleImage;
+class StyleResolver;
+class NinePieceImage;
+
+class CSSToStyleMap {
+ WTF_MAKE_NONCOPYABLE(CSSToStyleMap);
+ WTF_MAKE_FAST_ALLOCATED;
+
+public:
+ CSSToStyleMap(StyleResolver* resolver) : m_resolver(resolver) { }
+
+ void mapFillAttachment(CSSPropertyID, FillLayer*, CSSValue*);
+ void mapFillClip(CSSPropertyID, FillLayer*, CSSValue*);
+ void mapFillComposite(CSSPropertyID, FillLayer*, CSSValue*);
+ void mapFillOrigin(CSSPropertyID, FillLayer*, CSSValue*);
+ void mapFillImage(CSSPropertyID, FillLayer*, CSSValue*);
+ void mapFillRepeatX(CSSPropertyID, FillLayer*, CSSValue*);
+ void mapFillRepeatY(CSSPropertyID, FillLayer*, CSSValue*);
+ void mapFillSize(CSSPropertyID, FillLayer*, CSSValue*);
+ void mapFillXPosition(CSSPropertyID, FillLayer*, CSSValue*);
+ void mapFillYPosition(CSSPropertyID, FillLayer*, CSSValue*);
+
+ void mapAnimationDelay(Animation*, CSSValue*);
+ void mapAnimationDirection(Animation*, CSSValue*);
+ void mapAnimationDuration(Animation*, CSSValue*);
+ void mapAnimationFillMode(Animation*, CSSValue*);
+ void mapAnimationIterationCount(Animation*, CSSValue*);
+ void mapAnimationName(Animation*, CSSValue*);
+ void mapAnimationPlayState(Animation*, CSSValue*);
+ void mapAnimationProperty(Animation*, CSSValue*);
+ void mapAnimationTimingFunction(Animation*, CSSValue*);
+
+ void mapNinePieceImage(CSSPropertyID, CSSValue*, NinePieceImage&);
+ void mapNinePieceImageSlice(CSSValue*, NinePieceImage&);
+ LengthBox mapNinePieceImageQuad(CSSValue*);
+ void mapNinePieceImageRepeat(CSSValue*, NinePieceImage&);
+
+private:
+ // FIXME: These accessors should be replaced by a ResolveState object
+ // similar to how PaintInfo/LayoutState cache values needed for
+ // the current paint/layout.
+ RenderStyle* style() const;
+ RenderStyle* rootElementStyle() const;
+ bool useSVGZoomRules() const;
+
+ // FIXME: This should be part of some sort of StyleImageCache object which
+ // is held by the StyleResolver, and likely provided to this object
+ // during the resolve.
+ PassRefPtr<StyleImage> styleImage(CSSPropertyID, CSSValue*);
+
+ StyleResolver* m_resolver;
+};
+
+}
+
+#endif
diff --git a/Source/WebCore/css/CSSValue.h b/Source/WebCore/css/CSSValue.h
index b1e262c67..b4e8a89e7 100644
--- a/Source/WebCore/css/CSSValue.h
+++ b/Source/WebCore/css/CSSValue.h
@@ -30,7 +30,7 @@
namespace WebCore {
class StyleSheetContents;
-
+
// FIXME: The current CSSValue and subclasses should be turned into internal types (StyleValue).
// The few subtypes that are actually exposed in CSSOM can be seen in the cloneForCSSOM() function.
// They should be handled by separate wrapper classes.
diff --git a/Source/WebCore/css/CSSVariableValue.h b/Source/WebCore/css/CSSVariableValue.h
index 15dbf9d69..2c5b66a6b 100644
--- a/Source/WebCore/css/CSSVariableValue.h
+++ b/Source/WebCore/css/CSSVariableValue.h
@@ -24,7 +24,6 @@
* 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 CSSVariableValue_h
diff --git a/Source/WebCore/css/StyleBuilder.cpp b/Source/WebCore/css/StyleBuilder.cpp
index 2139996bd..20d02cc15 100644
--- a/Source/WebCore/css/StyleBuilder.cpp
+++ b/Source/WebCore/css/StyleBuilder.cpp
@@ -29,6 +29,7 @@
#include "CSSCalculationValue.h"
#include "CSSCursorImageValue.h"
#include "CSSPrimitiveValueMappings.h"
+#include "CSSToStyleMap.h"
#include "CSSValueList.h"
#include "CursorList.h"
#include "Document.h"
@@ -496,7 +497,7 @@ template <typename T,
void (FillLayer::*setFunction)(typename FillLayerAccessorTypes<T>::Setter),
void (FillLayer::*clearFunction)(),
typename FillLayerAccessorTypes<T>::Getter (*initialFunction)(EFillLayerType),
- void (StyleResolver::*mapFillFunction)(CSSPropertyID, FillLayer*, CSSValue*)>
+ void (CSSToStyleMap::*mapFillFunction)(CSSPropertyID, FillLayer*, CSSValue*)>
class ApplyPropertyFillLayer {
public:
static void applyInheritValue(StyleResolver* styleResolver)
@@ -548,12 +549,12 @@ public:
currChild = new FillLayer(fillLayerType);
prevChild->setNext(currChild);
}
- (styleResolver->*mapFillFunction)(propertyId, currChild, valueList->itemWithoutBoundsCheck(i));
+ (styleResolver->styleMap()->*mapFillFunction)(propertyId, currChild, valueList->itemWithoutBoundsCheck(i));
prevChild = currChild;
currChild = currChild->next();
}
} else {
- (styleResolver->*mapFillFunction)(propertyId, currChild, value);
+ (styleResolver->styleMap()->*mapFillFunction)(propertyId, currChild, value);
currChild = currChild->next();
}
while (currChild) {
@@ -886,7 +887,7 @@ public:
NinePieceImage image;
if (borderImageType == Mask)
image.setMaskDefaults();
- styleResolver->mapNinePieceImage(property, value, image);
+ styleResolver->styleMap()->mapNinePieceImage(property, value, image);
(styleResolver->style()->*setterFunction)(image);
}
@@ -953,16 +954,16 @@ public:
NinePieceImage image(getValue(styleResolver->style()));
switch (modifier) {
case Outset:
- image.setOutset(styleResolver->mapNinePieceImageQuad(value));
+ image.setOutset(styleResolver->styleMap()->mapNinePieceImageQuad(value));
break;
case Repeat:
- styleResolver->mapNinePieceImageRepeat(value, image);
+ styleResolver->styleMap()->mapNinePieceImageRepeat(value, image);
break;
case Slice:
- styleResolver->mapNinePieceImageSlice(value, image);
+ styleResolver->styleMap()->mapNinePieceImageSlice(value, image);
break;
case Width:
- image.setBorderSlices(styleResolver->mapNinePieceImageQuad(value));
+ image.setBorderSlices(styleResolver->styleMap()->mapNinePieceImageQuad(value));
break;
}
setValue(styleResolver->style(), image);
@@ -1437,7 +1438,7 @@ template <typename T,
bool (Animation::*testFunction)() const,
void (Animation::*clearFunction)(),
T (*initialFunction)(),
- void (StyleResolver::*mapFunction)(Animation*, CSSValue*),
+ void (CSSToStyleMap::*mapFunction)(Animation*, CSSValue*),
AnimationList* (RenderStyle::*animationGetterFunction)(),
const AnimationList* (RenderStyle::*immutableAnimationGetterFunction)() const>
class ApplyPropertyAnimation {
@@ -1447,7 +1448,7 @@ public:
static bool test(const Animation* animation) { return (animation->*testFunction)(); }
static void clear(Animation* animation) { (animation->*clearFunction)(); }
static T initial() { return (*initialFunction)(); }
- static void map(StyleResolver* styleResolver, Animation* animation, CSSValue* value) { (styleResolver->*mapFunction)(animation, value); }
+ static void map(StyleResolver* styleResolver, Animation* animation, CSSValue* value) { (styleResolver->styleMap()->*mapFunction)(animation, value); }
static AnimationList* accessAnimations(RenderStyle* style) { return (style->*animationGetterFunction)(); }
static const AnimationList* animations(RenderStyle* style) { return (style->*immutableAnimationGetterFunction)(); }
@@ -1840,18 +1841,18 @@ StyleBuilder::StyleBuilder()
m_propertyMap[i] = PropertyHandler();
// Please keep CSS property list in alphabetical order.
- setPropertyHandler(CSSPropertyBackgroundAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyBackgroundAttachment, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &StyleResolver::mapFillAttachment>::createHandler());
- setPropertyHandler(CSSPropertyBackgroundClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundClip, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &StyleResolver::mapFillClip>::createHandler());
+ setPropertyHandler(CSSPropertyBackgroundAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyBackgroundAttachment, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSToStyleMap::mapFillAttachment>::createHandler());
+ setPropertyHandler(CSSPropertyBackgroundClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundClip, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSToStyleMap::mapFillClip>::createHandler());
setPropertyHandler(CSSPropertyBackgroundColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColor, &RenderStyle::setVisitedLinkBackgroundColor, &RenderStyle::invalidColor>::createHandler());
- setPropertyHandler(CSSPropertyBackgroundImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyBackgroundImage, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &StyleResolver::mapFillImage>::createHandler());
- setPropertyHandler(CSSPropertyBackgroundOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundOrigin, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &StyleResolver::mapFillOrigin>::createHandler());
+ setPropertyHandler(CSSPropertyBackgroundImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyBackgroundImage, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSToStyleMap::mapFillImage>::createHandler());
+ setPropertyHandler(CSSPropertyBackgroundOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundOrigin, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSToStyleMap::mapFillOrigin>::createHandler());
setPropertyHandler(CSSPropertyBackgroundPosition, ApplyPropertyExpanding<SuppressValue, CSSPropertyBackgroundPositionX, CSSPropertyBackgroundPositionY>::createHandler());
- setPropertyHandler(CSSPropertyBackgroundPositionX, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &StyleResolver::mapFillXPosition>::createHandler());
- setPropertyHandler(CSSPropertyBackgroundPositionY, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &StyleResolver::mapFillYPosition>::createHandler());
+ setPropertyHandler(CSSPropertyBackgroundPositionX, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSToStyleMap::mapFillXPosition>::createHandler());
+ setPropertyHandler(CSSPropertyBackgroundPositionY, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSToStyleMap::mapFillYPosition>::createHandler());
setPropertyHandler(CSSPropertyBackgroundRepeat, ApplyPropertyExpanding<SuppressValue, CSSPropertyBackgroundRepeatX, CSSPropertyBackgroundRepeatY>::createHandler());
- setPropertyHandler(CSSPropertyBackgroundRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &StyleResolver::mapFillRepeatX>::createHandler());
- setPropertyHandler(CSSPropertyBackgroundRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &StyleResolver::mapFillRepeatY>::createHandler());
- setPropertyHandler(CSSPropertyBackgroundSize, ApplyPropertyFillLayer<FillSize, CSSPropertyBackgroundSize, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &StyleResolver::mapFillSize>::createHandler());
+ setPropertyHandler(CSSPropertyBackgroundRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSToStyleMap::mapFillRepeatX>::createHandler());
+ setPropertyHandler(CSSPropertyBackgroundRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSToStyleMap::mapFillRepeatY>::createHandler());
+ setPropertyHandler(CSSPropertyBackgroundSize, ApplyPropertyFillLayer<FillSize, CSSPropertyBackgroundSize, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSToStyleMap::mapFillSize>::createHandler());
setPropertyHandler(CSSPropertyBorder, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderStyle, CSSPropertyBorderWidth, CSSPropertyBorderColor>::createHandler());
setPropertyHandler(CSSPropertyBorderBottom, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderBottomColor, CSSPropertyBorderBottomStyle, CSSPropertyBorderBottomWidth>::createHandler());
setPropertyHandler(CSSPropertyBorderBottomColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderBottomColor, &RenderStyle::setBorderBottomColor, &RenderStyle::setVisitedLinkBorderBottomColor, &RenderStyle::color>::createHandler());
@@ -1957,19 +1958,19 @@ StyleBuilder::StyleBuilder()
setPropertyHandler(CSSPropertyUnicodeBidi, ApplyPropertyUnicodeBidi::createHandler());
setPropertyHandler(CSSPropertyVerticalAlign, ApplyPropertyVerticalAlign::createHandler());
setPropertyHandler(CSSPropertyVisibility, ApplyPropertyDefault<EVisibility, &RenderStyle::visibility, EVisibility, &RenderStyle::setVisibility, EVisibility, &RenderStyle::initialVisibility>::createHandler());
- setPropertyHandler(CSSPropertyWebkitAnimationDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &StyleResolver::mapAnimationDelay, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyWebkitAnimationDirection, ApplyPropertyAnimation<Animation::AnimationDirection, &Animation::direction, &Animation::setDirection, &Animation::isDirectionSet, &Animation::clearDirection, &Animation::initialAnimationDirection, &StyleResolver::mapAnimationDirection, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyWebkitAnimationDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &StyleResolver::mapAnimationDuration, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyWebkitAnimationFillMode, ApplyPropertyAnimation<unsigned, &Animation::fillMode, &Animation::setFillMode, &Animation::isFillModeSet, &Animation::clearFillMode, &Animation::initialAnimationFillMode, &StyleResolver::mapAnimationFillMode, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyWebkitAnimationIterationCount, ApplyPropertyAnimation<double, &Animation::iterationCount, &Animation::setIterationCount, &Animation::isIterationCountSet, &Animation::clearIterationCount, &Animation::initialAnimationIterationCount, &StyleResolver::mapAnimationIterationCount, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyWebkitAnimationName, ApplyPropertyAnimation<const String&, &Animation::name, &Animation::setName, &Animation::isNameSet, &Animation::clearName, &Animation::initialAnimationName, &StyleResolver::mapAnimationName, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyWebkitAnimationPlayState, ApplyPropertyAnimation<EAnimPlayState, &Animation::playState, &Animation::setPlayState, &Animation::isPlayStateSet, &Animation::clearPlayState, &Animation::initialAnimationPlayState, &StyleResolver::mapAnimationPlayState, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyWebkitAnimationTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &StyleResolver::mapAnimationTimingFunction, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitAnimationDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSToStyleMap::mapAnimationDelay, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitAnimationDirection, ApplyPropertyAnimation<Animation::AnimationDirection, &Animation::direction, &Animation::setDirection, &Animation::isDirectionSet, &Animation::clearDirection, &Animation::initialAnimationDirection, &CSSToStyleMap::mapAnimationDirection, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitAnimationDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSToStyleMap::mapAnimationDuration, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitAnimationFillMode, ApplyPropertyAnimation<unsigned, &Animation::fillMode, &Animation::setFillMode, &Animation::isFillModeSet, &Animation::clearFillMode, &Animation::initialAnimationFillMode, &CSSToStyleMap::mapAnimationFillMode, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitAnimationIterationCount, ApplyPropertyAnimation<double, &Animation::iterationCount, &Animation::setIterationCount, &Animation::isIterationCountSet, &Animation::clearIterationCount, &Animation::initialAnimationIterationCount, &CSSToStyleMap::mapAnimationIterationCount, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitAnimationName, ApplyPropertyAnimation<const String&, &Animation::name, &Animation::setName, &Animation::isNameSet, &Animation::clearName, &Animation::initialAnimationName, &CSSToStyleMap::mapAnimationName, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitAnimationPlayState, ApplyPropertyAnimation<EAnimPlayState, &Animation::playState, &Animation::setPlayState, &Animation::isPlayStateSet, &Animation::clearPlayState, &Animation::initialAnimationPlayState, &CSSToStyleMap::mapAnimationPlayState, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitAnimationTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSToStyleMap::mapAnimationTimingFunction, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
setPropertyHandler(CSSPropertyWebkitAppearance, ApplyPropertyDefault<ControlPart, &RenderStyle::appearance, ControlPart, &RenderStyle::setAppearance, ControlPart, &RenderStyle::initialAppearance>::createHandler());
setPropertyHandler(CSSPropertyWebkitAspectRatio, ApplyPropertyAspectRatio::createHandler());
setPropertyHandler(CSSPropertyWebkitBackfaceVisibility, ApplyPropertyDefault<EBackfaceVisibility, &RenderStyle::backfaceVisibility, EBackfaceVisibility, &RenderStyle::setBackfaceVisibility, EBackfaceVisibility, &RenderStyle::initialBackfaceVisibility>::createHandler());
setPropertyHandler(CSSPropertyWebkitBackgroundClip, CSSPropertyBackgroundClip);
- setPropertyHandler(CSSPropertyWebkitBackgroundComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitBackgroundComposite, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &StyleResolver::mapFillComposite>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitBackgroundComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitBackgroundComposite, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSToStyleMap::mapFillComposite>::createHandler());
setPropertyHandler(CSSPropertyWebkitBackgroundOrigin, CSSPropertyBackgroundOrigin);
setPropertyHandler(CSSPropertyWebkitBackgroundSize, CSSPropertyBackgroundSize);
setPropertyHandler(CSSPropertyWebkitBorderFit, ApplyPropertyDefault<EBorderFit, &RenderStyle::borderFit, EBorderFit, &RenderStyle::setBorderFit, EBorderFit, &RenderStyle::initialBorderFit>::createHandler());
@@ -2037,24 +2038,24 @@ StyleBuilder::StyleBuilder()
setPropertyHandler(CSSPropertyWebkitMarginTopCollapse, CSSPropertyWebkitMarginBeforeCollapse);
setPropertyHandler(CSSPropertyWebkitMarqueeDirection, ApplyPropertyDefault<EMarqueeDirection, &RenderStyle::marqueeDirection, EMarqueeDirection, &RenderStyle::setMarqueeDirection, EMarqueeDirection, &RenderStyle::initialMarqueeDirection>::createHandler());
setPropertyHandler(CSSPropertyWebkitMarqueeStyle, ApplyPropertyDefault<EMarqueeBehavior, &RenderStyle::marqueeBehavior, EMarqueeBehavior, &RenderStyle::setMarqueeBehavior, EMarqueeBehavior, &RenderStyle::initialMarqueeBehavior>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyWebkitMaskAttachment, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &StyleResolver::mapFillAttachment>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitMaskAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyWebkitMaskAttachment, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSToStyleMap::mapFillAttachment>::createHandler());
setPropertyHandler(CSSPropertyWebkitMaskBoxImage, ApplyPropertyBorderImage<Mask, CSSPropertyWebkitMaskBoxImage, &RenderStyle::maskBoxImage, &RenderStyle::setMaskBoxImage>::createHandler());
setPropertyHandler(CSSPropertyWebkitMaskBoxImageOutset, ApplyPropertyBorderImageModifier<Mask, Outset>::createHandler());
setPropertyHandler(CSSPropertyWebkitMaskBoxImageRepeat, ApplyPropertyBorderImageModifier<Mask, Repeat>::createHandler());
setPropertyHandler(CSSPropertyWebkitMaskBoxImageSlice, ApplyPropertyBorderImageModifier<Mask, Slice>::createHandler());
setPropertyHandler(CSSPropertyWebkitMaskBoxImageSource, ApplyPropertyBorderImageSource<CSSPropertyWebkitMaskBoxImageSource, &RenderStyle::maskBoxImageSource, &RenderStyle::setMaskBoxImageSource, &RenderStyle::initialMaskBoxImageSource>::createHandler());
setPropertyHandler(CSSPropertyWebkitMaskBoxImageWidth, ApplyPropertyBorderImageModifier<Mask, Width>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskClip, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &StyleResolver::mapFillClip>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitMaskComposite, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &StyleResolver::mapFillComposite>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyWebkitMaskImage, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &StyleResolver::mapFillImage>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskOrigin, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &StyleResolver::mapFillOrigin>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitMaskClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskClip, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSToStyleMap::mapFillClip>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitMaskComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitMaskComposite, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSToStyleMap::mapFillComposite>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitMaskImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyWebkitMaskImage, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSToStyleMap::mapFillImage>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitMaskOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskOrigin, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSToStyleMap::mapFillOrigin>::createHandler());
setPropertyHandler(CSSPropertyWebkitMaskPosition, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitMaskPositionX, CSSPropertyWebkitMaskPositionY>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskPositionX, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &StyleResolver::mapFillXPosition>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskPositionY, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &StyleResolver::mapFillYPosition>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitMaskPositionX, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSToStyleMap::mapFillXPosition>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitMaskPositionY, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSToStyleMap::mapFillYPosition>::createHandler());
setPropertyHandler(CSSPropertyWebkitMaskRepeat, ApplyPropertyExpanding<SuppressValue, CSSPropertyBackgroundRepeatX, CSSPropertyBackgroundRepeatY>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &StyleResolver::mapFillRepeatX>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &StyleResolver::mapFillRepeatY>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskSize, ApplyPropertyFillLayer<FillSize, CSSPropertyWebkitMaskSize, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &StyleResolver::mapFillSize>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitMaskRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSToStyleMap::mapFillRepeatX>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitMaskRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSToStyleMap::mapFillRepeatY>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitMaskSize, ApplyPropertyFillLayer<FillSize, CSSPropertyWebkitMaskSize, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSToStyleMap::mapFillSize>::createHandler());
setPropertyHandler(CSSPropertyWebkitNbspMode, ApplyPropertyDefault<ENBSPMode, &RenderStyle::nbspMode, ENBSPMode, &RenderStyle::setNBSPMode, ENBSPMode, &RenderStyle::initialNBSPMode>::createHandler());
setPropertyHandler(CSSPropertyWebkitPerspectiveOrigin, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitPerspectiveOriginX, CSSPropertyWebkitPerspectiveOriginY>::createHandler());
setPropertyHandler(CSSPropertyWebkitPerspectiveOriginX, ApplyPropertyLength<&RenderStyle::perspectiveOriginX, &RenderStyle::setPerspectiveOriginX, &RenderStyle::initialPerspectiveOriginX>::createHandler());
@@ -2080,10 +2081,10 @@ StyleBuilder::StyleBuilder()
setPropertyHandler(CSSPropertyWebkitTransformOriginY, ApplyPropertyLength<&RenderStyle::transformOriginY, &RenderStyle::setTransformOriginY, &RenderStyle::initialTransformOriginY>::createHandler());
setPropertyHandler(CSSPropertyWebkitTransformOriginZ, ApplyPropertyComputeLength<float, &RenderStyle::transformOriginZ, &RenderStyle::setTransformOriginZ, &RenderStyle::initialTransformOriginZ>::createHandler());
setPropertyHandler(CSSPropertyWebkitTransformStyle, ApplyPropertyDefault<ETransformStyle3D, &RenderStyle::transformStyle3D, ETransformStyle3D, &RenderStyle::setTransformStyle3D, ETransformStyle3D, &RenderStyle::initialTransformStyle3D>::createHandler());
- setPropertyHandler(CSSPropertyWebkitTransitionDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &StyleResolver::mapAnimationDelay, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
- setPropertyHandler(CSSPropertyWebkitTransitionDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &StyleResolver::mapAnimationDuration, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
- setPropertyHandler(CSSPropertyWebkitTransitionProperty, ApplyPropertyAnimation<CSSPropertyID, &Animation::property, &Animation::setProperty, &Animation::isPropertySet, &Animation::clearProperty, &Animation::initialAnimationProperty, &StyleResolver::mapAnimationProperty, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
- setPropertyHandler(CSSPropertyWebkitTransitionTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &StyleResolver::mapAnimationTimingFunction, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitTransitionDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSToStyleMap::mapAnimationDelay, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitTransitionDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSToStyleMap::mapAnimationDuration, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitTransitionProperty, ApplyPropertyAnimation<CSSPropertyID, &Animation::property, &Animation::setProperty, &Animation::isPropertySet, &Animation::clearProperty, &Animation::initialAnimationProperty, &CSSToStyleMap::mapAnimationProperty, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitTransitionTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSToStyleMap::mapAnimationTimingFunction, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
setPropertyHandler(CSSPropertyWebkitUserDrag, ApplyPropertyDefault<EUserDrag, &RenderStyle::userDrag, EUserDrag, &RenderStyle::setUserDrag, EUserDrag, &RenderStyle::initialUserDrag>::createHandler());
setPropertyHandler(CSSPropertyWebkitUserModify, ApplyPropertyDefault<EUserModify, &RenderStyle::userModify, EUserModify, &RenderStyle::setUserModify, EUserModify, &RenderStyle::initialUserModify>::createHandler());
setPropertyHandler(CSSPropertyWebkitUserSelect, ApplyPropertyDefault<EUserSelect, &RenderStyle::userSelect, EUserSelect, &RenderStyle::setUserSelect, EUserSelect, &RenderStyle::initialUserSelect>::createHandler());
diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp
index 252298fc5..de3a0a9bd 100644
--- a/Source/WebCore/css/StyleResolver.cpp
+++ b/Source/WebCore/css/StyleResolver.cpp
@@ -8,6 +8,7 @@
* Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
* Copyright (C) Research In Motion Limited 2011. All rights reserved.
+ * Copyright (C) 2012 Google Inc. 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
@@ -374,6 +375,7 @@ StyleResolver::StyleResolver(Document* document, bool matchAuthorAndUserStyles)
, m_scopeStackParent(0)
, m_scopeStackParentBoundsIndex(0)
#endif
+ , m_styleMap(this)
{
Element* root = document->documentElement();
@@ -3740,7 +3742,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
reflection->setOffset(reflectValue->offset()->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion>(style(), m_rootElementStyle, zoomFactor));
NinePieceImage mask;
mask.setMaskDefaults();
- mapNinePieceImage(id, reflectValue->mask(), mask);
+ m_styleMap.mapNinePieceImage(id, reflectValue->mask(), mask);
reflection->setMask(mask);
m_style->setBoxReflect(reflection.release());
@@ -4158,7 +4160,11 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
m_style->setGridItemRow(row);
return;
}
-
+#if ENABLE(CSS_VARIABLES)
+ case CSSPropertyVariable:
+ // FIXME: This should have an actual implementation.
+ return;
+#endif
// These properties are implemented in the StyleBuilder lookup table.
case CSSPropertyBackgroundAttachment:
case CSSPropertyBackgroundClip:
@@ -4428,74 +4434,6 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
}
}
-void StyleResolver::mapFillAttachment(CSSPropertyID, FillLayer* layer, CSSValue* value)
-{
- if (value->isInitialValue()) {
- layer->setAttachment(FillLayer::initialFillAttachment(layer->type()));
- return;
- }
-
- if (!value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- switch (primitiveValue->getIdent()) {
- case CSSValueFixed:
- layer->setAttachment(FixedBackgroundAttachment);
- break;
- case CSSValueScroll:
- layer->setAttachment(ScrollBackgroundAttachment);
- break;
- case CSSValueLocal:
- layer->setAttachment(LocalBackgroundAttachment);
- break;
- default:
- return;
- }
-}
-
-void StyleResolver::mapFillClip(CSSPropertyID, FillLayer* layer, CSSValue* value)
-{
- if (value->isInitialValue()) {
- layer->setClip(FillLayer::initialFillClip(layer->type()));
- return;
- }
-
- if (!value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- layer->setClip(*primitiveValue);
-}
-
-void StyleResolver::mapFillComposite(CSSPropertyID, FillLayer* layer, CSSValue* value)
-{
- if (value->isInitialValue()) {
- layer->setComposite(FillLayer::initialFillComposite(layer->type()));
- return;
- }
-
- if (!value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- layer->setComposite(*primitiveValue);
-}
-
-void StyleResolver::mapFillOrigin(CSSPropertyID, FillLayer* layer, CSSValue* value)
-{
- if (value->isInitialValue()) {
- layer->setOrigin(FillLayer::initialFillOrigin(layer->type()));
- return;
- }
-
- if (!value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- layer->setOrigin(*primitiveValue);
-}
-
PassRefPtr<StyleImage> StyleResolver::styleImage(CSSPropertyID property, CSSValue* value)
{
if (value->isImageValue())
@@ -4539,532 +4477,6 @@ PassRefPtr<StyleImage> StyleResolver::setOrPendingFromValue(CSSPropertyID proper
}
#endif
-void StyleResolver::mapFillImage(CSSPropertyID property, FillLayer* layer, CSSValue* value)
-{
- if (value->isInitialValue()) {
- layer->setImage(FillLayer::initialFillImage(layer->type()));
- return;
- }
-
- layer->setImage(styleImage(property, value));
-}
-
-void StyleResolver::mapFillRepeatX(CSSPropertyID, FillLayer* layer, CSSValue* value)
-{
- if (value->isInitialValue()) {
- layer->setRepeatX(FillLayer::initialFillRepeatX(layer->type()));
- return;
- }
-
- if (!value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- layer->setRepeatX(*primitiveValue);
-}
-
-void StyleResolver::mapFillRepeatY(CSSPropertyID, FillLayer* layer, CSSValue* value)
-{
- if (value->isInitialValue()) {
- layer->setRepeatY(FillLayer::initialFillRepeatY(layer->type()));
- return;
- }
-
- if (!value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- layer->setRepeatY(*primitiveValue);
-}
-
-void StyleResolver::mapFillSize(CSSPropertyID, FillLayer* layer, CSSValue* value)
-{
- if (!value->isPrimitiveValue()) {
- layer->setSizeType(SizeNone);
- return;
- }
-
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- if (primitiveValue->getIdent() == CSSValueContain)
- layer->setSizeType(Contain);
- else if (primitiveValue->getIdent() == CSSValueCover)
- layer->setSizeType(Cover);
- else
- layer->setSizeType(SizeLength);
-
- LengthSize b = FillLayer::initialFillSizeLength(layer->type());
-
- if (value->isInitialValue() || primitiveValue->getIdent() == CSSValueContain || primitiveValue->getIdent() == CSSValueCover) {
- layer->setSizeLength(b);
- return;
- }
-
- float zoomFactor = m_style->effectiveZoom();
-
- Length firstLength;
- Length secondLength;
-
- if (Pair* pair = primitiveValue->getPairValue()) {
- CSSPrimitiveValue* first = static_cast<CSSPrimitiveValue*>(pair->first());
- CSSPrimitiveValue* second = static_cast<CSSPrimitiveValue*>(pair->second());
- firstLength = first->convertToLength<AnyConversion>(style(), m_rootElementStyle, zoomFactor);
- secondLength = second->convertToLength<AnyConversion>(style(), m_rootElementStyle, zoomFactor);
- } else {
- firstLength = primitiveValue->convertToLength<AnyConversion>(style(), m_rootElementStyle, zoomFactor);
- secondLength = Length();
- }
-
- if (firstLength.isUndefined() || secondLength.isUndefined())
- return;
-
- b.setWidth(firstLength);
- b.setHeight(secondLength);
- layer->setSizeLength(b);
-}
-
-void StyleResolver::mapFillXPosition(CSSPropertyID, FillLayer* layer, CSSValue* value)
-{
- if (value->isInitialValue()) {
- layer->setXPosition(FillLayer::initialFillXPosition(layer->type()));
- return;
- }
-
- if (!value->isPrimitiveValue())
- return;
-
- float zoomFactor = m_style->effectiveZoom();
-
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- Length length;
- if (primitiveValue->isLength())
- length = primitiveValue->computeLength<Length>(style(), m_rootElementStyle, zoomFactor);
- else if (primitiveValue->isPercentage())
- length = Length(primitiveValue->getDoubleValue(), Percent);
- else if (primitiveValue->isCalculatedPercentageWithLength())
- length = Length(primitiveValue->cssCalcValue()->toCalcValue(style(), m_rootElementStyle, zoomFactor));
- else if (primitiveValue->isViewportPercentageLength())
- length = primitiveValue->viewportPercentageLength();
- else
- return;
- layer->setXPosition(length);
-}
-
-void StyleResolver::mapFillYPosition(CSSPropertyID, FillLayer* layer, CSSValue* value)
-{
- if (value->isInitialValue()) {
- layer->setYPosition(FillLayer::initialFillYPosition(layer->type()));
- return;
- }
-
- if (!value->isPrimitiveValue())
- return;
-
- float zoomFactor = m_style->effectiveZoom();
-
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- Length length;
- if (primitiveValue->isLength())
- length = primitiveValue->computeLength<Length>(style(), m_rootElementStyle, zoomFactor);
- else if (primitiveValue->isPercentage())
- length = Length(primitiveValue->getDoubleValue(), Percent);
- else if (primitiveValue->isCalculatedPercentageWithLength())
- length = Length(primitiveValue->cssCalcValue()->toCalcValue(style(), m_rootElementStyle, zoomFactor));
- else if (primitiveValue->isViewportPercentageLength())
- length = primitiveValue->viewportPercentageLength();
- else
- return;
- layer->setYPosition(length);
-}
-
-void StyleResolver::mapAnimationDelay(Animation* animation, CSSValue* value)
-{
- if (value->isInitialValue()) {
- animation->setDelay(Animation::initialAnimationDelay());
- return;
- }
-
- if (!value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- animation->setDelay(primitiveValue->computeTime<float, CSSPrimitiveValue::Seconds>());
-}
-
-void StyleResolver::mapAnimationDirection(Animation* layer, CSSValue* value)
-{
- if (value->isInitialValue()) {
- layer->setDirection(Animation::initialAnimationDirection());
- return;
- }
-
- if (!value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- switch (primitiveValue->getIdent()) {
- case CSSValueNormal:
- layer->setDirection(Animation::AnimationDirectionNormal);
- break;
- case CSSValueAlternate:
- layer->setDirection(Animation::AnimationDirectionAlternate);
- break;
- case CSSValueReverse:
- layer->setDirection(Animation::AnimationDirectionReverse);
- break;
- case CSSValueAlternateReverse:
- layer->setDirection(Animation::AnimationDirectionAlternateReverse);
- break;
- }
-}
-
-void StyleResolver::mapAnimationDuration(Animation* animation, CSSValue* value)
-{
- if (value->isInitialValue()) {
- animation->setDuration(Animation::initialAnimationDuration());
- return;
- }
-
- if (!value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- animation->setDuration(primitiveValue->computeTime<float, CSSPrimitiveValue::Seconds>());
-}
-
-void StyleResolver::mapAnimationFillMode(Animation* layer, CSSValue* value)
-{
- if (value->isInitialValue()) {
- layer->setFillMode(Animation::initialAnimationFillMode());
- return;
- }
-
- if (!value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- switch (primitiveValue->getIdent()) {
- case CSSValueNone:
- layer->setFillMode(AnimationFillModeNone);
- break;
- case CSSValueForwards:
- layer->setFillMode(AnimationFillModeForwards);
- break;
- case CSSValueBackwards:
- layer->setFillMode(AnimationFillModeBackwards);
- break;
- case CSSValueBoth:
- layer->setFillMode(AnimationFillModeBoth);
- break;
- }
-}
-
-void StyleResolver::mapAnimationIterationCount(Animation* animation, CSSValue* value)
-{
- if (value->isInitialValue()) {
- animation->setIterationCount(Animation::initialAnimationIterationCount());
- return;
- }
-
- if (!value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- if (primitiveValue->getIdent() == CSSValueInfinite)
- animation->setIterationCount(-1);
- else
- animation->setIterationCount(primitiveValue->getFloatValue());
-}
-
-void StyleResolver::mapAnimationName(Animation* layer, CSSValue* value)
-{
- if (value->isInitialValue()) {
- layer->setName(Animation::initialAnimationName());
- return;
- }
-
- if (!value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- if (primitiveValue->getIdent() == CSSValueNone)
- layer->setIsNoneAnimation(true);
- else
- layer->setName(primitiveValue->getStringValue());
-}
-
-void StyleResolver::mapAnimationPlayState(Animation* layer, CSSValue* value)
-{
- if (value->isInitialValue()) {
- layer->setPlayState(Animation::initialAnimationPlayState());
- return;
- }
-
- if (!value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- EAnimPlayState playState = (primitiveValue->getIdent() == CSSValuePaused) ? AnimPlayStatePaused : AnimPlayStatePlaying;
- layer->setPlayState(playState);
-}
-
-void StyleResolver::mapAnimationProperty(Animation* animation, CSSValue* value)
-{
- if (value->isInitialValue()) {
- animation->setAnimationMode(Animation::AnimateAll);
- animation->setProperty(CSSPropertyInvalid);
- return;
- }
-
- if (!value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- if (primitiveValue->getIdent() == CSSValueAll) {
- animation->setAnimationMode(Animation::AnimateAll);
- animation->setProperty(CSSPropertyInvalid);
- } else if (primitiveValue->getIdent() == CSSValueNone) {
- animation->setAnimationMode(Animation::AnimateNone);
- animation->setProperty(CSSPropertyInvalid);
- } else {
- animation->setAnimationMode(Animation::AnimateSingleProperty);
- animation->setProperty(static_cast<CSSPropertyID>(primitiveValue->getIdent()));
- }
-}
-
-void StyleResolver::mapAnimationTimingFunction(Animation* animation, CSSValue* value)
-{
- if (value->isInitialValue()) {
- animation->setTimingFunction(Animation::initialAnimationTimingFunction());
- return;
- }
-
- if (value->isPrimitiveValue()) {
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- switch (primitiveValue->getIdent()) {
- case CSSValueLinear:
- animation->setTimingFunction(LinearTimingFunction::create());
- break;
- case CSSValueEase:
- animation->setTimingFunction(CubicBezierTimingFunction::create());
- break;
- case CSSValueEaseIn:
- animation->setTimingFunction(CubicBezierTimingFunction::create(0.42, 0.0, 1.0, 1.0));
- break;
- case CSSValueEaseOut:
- animation->setTimingFunction(CubicBezierTimingFunction::create(0.0, 0.0, 0.58, 1.0));
- break;
- case CSSValueEaseInOut:
- animation->setTimingFunction(CubicBezierTimingFunction::create(0.42, 0.0, 0.58, 1.0));
- break;
- case CSSValueStepStart:
- animation->setTimingFunction(StepsTimingFunction::create(1, true));
- break;
- case CSSValueStepEnd:
- animation->setTimingFunction(StepsTimingFunction::create(1, false));
- break;
- }
- return;
- }
-
- if (value->isCubicBezierTimingFunctionValue()) {
- CSSCubicBezierTimingFunctionValue* cubicTimingFunction = static_cast<CSSCubicBezierTimingFunctionValue*>(value);
- animation->setTimingFunction(CubicBezierTimingFunction::create(cubicTimingFunction->x1(), cubicTimingFunction->y1(), cubicTimingFunction->x2(), cubicTimingFunction->y2()));
- } else if (value->isStepsTimingFunctionValue()) {
- CSSStepsTimingFunctionValue* stepsTimingFunction = static_cast<CSSStepsTimingFunctionValue*>(value);
- animation->setTimingFunction(StepsTimingFunction::create(stepsTimingFunction->numberOfSteps(), stepsTimingFunction->stepAtStart()));
- } else if (value->isLinearTimingFunctionValue())
- animation->setTimingFunction(LinearTimingFunction::create());
-}
-
-void StyleResolver::mapNinePieceImage(CSSPropertyID property, CSSValue* value, NinePieceImage& image)
-{
- // If we're not a value list, then we are "none" and don't need to alter the empty image at all.
- if (!value || !value->isValueList())
- return;
-
- // Retrieve the border image value.
- CSSValueList* borderImage = static_cast<CSSValueList*>(value);
-
- // Set the image (this kicks off the load).
- CSSPropertyID imageProperty;
- if (property == CSSPropertyWebkitBorderImage)
- imageProperty = CSSPropertyBorderImageSource;
- else if (property == CSSPropertyWebkitMaskBoxImage)
- imageProperty = CSSPropertyWebkitMaskBoxImageSource;
- else
- imageProperty = property;
-
- for (unsigned i = 0 ; i < borderImage->length() ; ++i) {
- CSSValue* current = borderImage->item(i);
-
- if (current->isImageValue() || current->isImageGeneratorValue()
-#if ENABLE(CSS_IMAGE_SET)
- || current->isImageSetValue()
-#endif
- )
- image.setImage(styleImage(imageProperty, current));
- else if (current->isBorderImageSliceValue())
- mapNinePieceImageSlice(current, image);
- else if (current->isValueList()) {
- CSSValueList* slashList = static_cast<CSSValueList*>(current);
- // Map in the image slices.
- if (slashList->item(0) && slashList->item(0)->isBorderImageSliceValue())
- mapNinePieceImageSlice(slashList->item(0), image);
-
- // Map in the border slices.
- if (slashList->item(1))
- image.setBorderSlices(mapNinePieceImageQuad(slashList->item(1)));
-
- // Map in the outset.
- if (slashList->item(2))
- image.setOutset(mapNinePieceImageQuad(slashList->item(2)));
- } else if (current->isPrimitiveValue()) {
- // Set the appropriate rules for stretch/round/repeat of the slices.
- mapNinePieceImageRepeat(current, image);
- }
- }
-
- if (property == CSSPropertyWebkitBorderImage) {
- // We have to preserve the legacy behavior of -webkit-border-image and make the border slices
- // also set the border widths. We don't need to worry about percentages, since we don't even support
- // those on real borders yet.
- if (image.borderSlices().top().isFixed())
- style()->setBorderTopWidth(image.borderSlices().top().value());
- if (image.borderSlices().right().isFixed())
- style()->setBorderRightWidth(image.borderSlices().right().value());
- if (image.borderSlices().bottom().isFixed())
- style()->setBorderBottomWidth(image.borderSlices().bottom().value());
- if (image.borderSlices().left().isFixed())
- style()->setBorderLeftWidth(image.borderSlices().left().value());
- }
-}
-
-void StyleResolver::mapNinePieceImageSlice(CSSValue* value, NinePieceImage& image)
-{
- if (!value || !value->isBorderImageSliceValue())
- return;
-
- // Retrieve the border image value.
- CSSBorderImageSliceValue* borderImageSlice = static_cast<CSSBorderImageSliceValue*>(value);
-
- // Set up a length box to represent our image slices.
- LengthBox box;
- Quad* slices = borderImageSlice->slices();
- if (slices->top()->isPercentage())
- box.m_top = Length(slices->top()->getDoubleValue(), Percent);
- else
- box.m_top = Length(slices->top()->getIntValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
- if (slices->bottom()->isPercentage())
- box.m_bottom = Length(slices->bottom()->getDoubleValue(), Percent);
- else
- box.m_bottom = Length((int)slices->bottom()->getFloatValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
- if (slices->left()->isPercentage())
- box.m_left = Length(slices->left()->getDoubleValue(), Percent);
- else
- box.m_left = Length(slices->left()->getIntValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
- if (slices->right()->isPercentage())
- box.m_right = Length(slices->right()->getDoubleValue(), Percent);
- else
- box.m_right = Length(slices->right()->getIntValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
- image.setImageSlices(box);
-
- // Set our fill mode.
- image.setFill(borderImageSlice->m_fill);
-}
-
-LengthBox StyleResolver::mapNinePieceImageQuad(CSSValue* value)
-{
- if (!value || !value->isPrimitiveValue())
- return LengthBox();
-
- // Get our zoom value.
- float zoom = useSVGZoomRules() ? 1.0f : style()->effectiveZoom();
-
- // Retrieve the primitive value.
- CSSPrimitiveValue* borderWidths = static_cast<CSSPrimitiveValue*>(value);
-
- // Set up a length box to represent our image slices.
- LengthBox box; // Defaults to 'auto' so we don't have to handle that explicitly below.
- Quad* slices = borderWidths->getQuadValue();
- if (slices->top()->isNumber())
- box.m_top = Length(slices->top()->getIntValue(), Relative);
- else if (slices->top()->isPercentage())
- box.m_top = Length(slices->top()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
- else if (slices->top()->getIdent() != CSSValueAuto)
- box.m_top = slices->top()->computeLength<Length>(style(), rootElementStyle(), zoom);
-
- if (slices->right()->isNumber())
- box.m_right = Length(slices->right()->getIntValue(), Relative);
- else if (slices->right()->isPercentage())
- box.m_right = Length(slices->right()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
- else if (slices->right()->getIdent() != CSSValueAuto)
- box.m_right = slices->right()->computeLength<Length>(style(), rootElementStyle(), zoom);
-
- if (slices->bottom()->isNumber())
- box.m_bottom = Length(slices->bottom()->getIntValue(), Relative);
- else if (slices->bottom()->isPercentage())
- box.m_bottom = Length(slices->bottom()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
- else if (slices->bottom()->getIdent() != CSSValueAuto)
- box.m_bottom = slices->bottom()->computeLength<Length>(style(), rootElementStyle(), zoom);
-
- if (slices->left()->isNumber())
- box.m_left = Length(slices->left()->getIntValue(), Relative);
- else if (slices->left()->isPercentage())
- box.m_left = Length(slices->left()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
- else if (slices->left()->getIdent() != CSSValueAuto)
- box.m_left = slices->left()->computeLength<Length>(style(), rootElementStyle(), zoom);
-
- return box;
-}
-
-void StyleResolver::mapNinePieceImageRepeat(CSSValue* value, NinePieceImage& image)
-{
- if (!value || !value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- Pair* pair = primitiveValue->getPairValue();
- if (!pair || !pair->first() || !pair->second())
- return;
-
- int firstIdentifier = pair->first()->getIdent();
- int secondIdentifier = pair->second()->getIdent();
-
- ENinePieceImageRule horizontalRule;
- switch (firstIdentifier) {
- case CSSValueStretch:
- horizontalRule = StretchImageRule;
- break;
- case CSSValueRound:
- horizontalRule = RoundImageRule;
- break;
- case CSSValueSpace:
- horizontalRule = SpaceImageRule;
- break;
- default: // CSSValueRepeat
- horizontalRule = RepeatImageRule;
- break;
- }
- image.setHorizontalRule(horizontalRule);
-
- ENinePieceImageRule verticalRule;
- switch (secondIdentifier) {
- case CSSValueStretch:
- verticalRule = StretchImageRule;
- break;
- case CSSValueRound:
- verticalRule = RoundImageRule;
- break;
- case CSSValueSpace:
- verticalRule = SpaceImageRule;
- break;
- default: // CSSValueRepeat
- verticalRule = RepeatImageRule;
- break;
- }
- image.setVerticalRule(verticalRule);
-}
-
void StyleResolver::checkForTextSizeAdjust()
{
if (m_style->textSizeAdjust())
diff --git a/Source/WebCore/css/StyleResolver.h b/Source/WebCore/css/StyleResolver.h
index 29f800e0c..4843eb53a 100644
--- a/Source/WebCore/css/StyleResolver.h
+++ b/Source/WebCore/css/StyleResolver.h
@@ -23,6 +23,7 @@
#define StyleResolver_h
#include "CSSRule.h"
+#include "CSSToStyleMap.h"
#include "CSSValueList.h"
#include "LinkHash.h"
#include "MediaQueryExp.h"
@@ -411,6 +412,8 @@ public:
static Length convertToIntLength(CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, double multiplier = 1);
static Length convertToFloatLength(CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, double multiplier = 1);
+ CSSToStyleMap* styleMap() { return &m_styleMap; }
+
private:
static RenderStyle* s_styleNotYetAvailable;
@@ -419,32 +422,6 @@ private:
void cacheBorderAndBackground();
- void mapFillAttachment(CSSPropertyID, FillLayer*, CSSValue*);
- void mapFillClip(CSSPropertyID, FillLayer*, CSSValue*);
- void mapFillComposite(CSSPropertyID, FillLayer*, CSSValue*);
- void mapFillOrigin(CSSPropertyID, FillLayer*, CSSValue*);
- void mapFillImage(CSSPropertyID, FillLayer*, CSSValue*);
- void mapFillRepeatX(CSSPropertyID, FillLayer*, CSSValue*);
- void mapFillRepeatY(CSSPropertyID, FillLayer*, CSSValue*);
- void mapFillSize(CSSPropertyID, FillLayer*, CSSValue*);
- void mapFillXPosition(CSSPropertyID, FillLayer*, CSSValue*);
- void mapFillYPosition(CSSPropertyID, FillLayer*, CSSValue*);
-
- void mapAnimationDelay(Animation*, CSSValue*);
- void mapAnimationDirection(Animation*, CSSValue*);
- void mapAnimationDuration(Animation*, CSSValue*);
- void mapAnimationFillMode(Animation*, CSSValue*);
- void mapAnimationIterationCount(Animation*, CSSValue*);
- void mapAnimationName(Animation*, CSSValue*);
- void mapAnimationPlayState(Animation*, CSSValue*);
- void mapAnimationProperty(Animation*, CSSValue*);
- void mapAnimationTimingFunction(Animation*, CSSValue*);
-
-public:
- void mapNinePieceImage(CSSPropertyID, CSSValue*, NinePieceImage&);
- void mapNinePieceImageSlice(CSSValue*, NinePieceImage&);
- LengthBox mapNinePieceImageQuad(CSSValue*);
- void mapNinePieceImageRepeat(CSSValue*, NinePieceImage&);
private:
bool canShareStyleWithControl(StyledElement*) const;
@@ -546,6 +523,8 @@ private:
int m_scopeStackParentBoundsIndex;
#endif
+ CSSToStyleMap m_styleMap;
+
friend class StyleBuilder;
friend bool operator==(const MatchedProperties&, const MatchedProperties&);
friend bool operator!=(const MatchedProperties&, const MatchedProperties&);
diff --git a/Source/WebCore/css/mediaControlsChromiumAndroid.css b/Source/WebCore/css/mediaControlsChromiumAndroid.css
index 92f347840..21b647c38 100644
--- a/Source/WebCore/css/mediaControlsChromiumAndroid.css
+++ b/Source/WebCore/css/mediaControlsChromiumAndroid.css
@@ -30,7 +30,7 @@ body:-webkit-full-page-media {
audio {
width: 300px;
- height: 32px;
+ height: 35px;
}
audio:-webkit-full-page-media, video:-webkit-full-page-media {
@@ -39,97 +39,74 @@ audio:-webkit-full-page-media, video:-webkit-full-page-media {
}
audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel {
- -webkit-user-select: none;
- position: relative;
- overflow: visible;
- bottom: 0;
- width: 100%;
- height: 32px;
- z-index: 0;
- background-color: rgba(0, 0, 0, 0.6);
+ display: -webkit-box;
+ -webkit-box-orient: horizontal;
+ -webkit-box-align: center;
+ -webkit-box-pack: center;
+ bottom: auto;
+ height: 35px;
+ background-color: rgba(20, 20, 20, 0.8);
}
+audio:-webkit-full-page-media::-webkit-media-controls-panel,
video:-webkit-full-page-media::-webkit-media-controls-panel {
bottom: 0px;
}
-audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-button {
- display: none;
-}
-
-audio::-webkit-media-controls-play-button, video::-webkit-media-controls-play-button {
- -webkit-appearance: media-play-button;
-
- position: absolute;
- top: auto;
- bottom: 7px;
- left: 7px;
- right: 6px;
-
- width: 18px;
- height: 19px;
-}
-
-audio::-webkit-media-controls-timeline-container {
- -webkit-appearance: media-timeline-container;
- -webkit-user-select: none;
- -webkit-box-orient: horizontal;
+::-webkit-media-controls {
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-box-pack: end;
-webkit-box-align: center;
- -webkit-box-pack: center;
- -webkit-box-flex: 1;
+}
- position: absolute;
- top: auto;
+audio::-webkit-media-controls-enclosure, video::-webkit-media-controls-enclosure {
+ width: 100%;
+ max-width: 800px;
+ height: 35px;
bottom: 0;
- left: 30px;
- right: 0;
-
- width: auto;
- height: 32px;
-
- border-left: 1px solid rgba(255, 255, 255, 0.2);
- border-right: 1px solid rgba(255, 255, 255, 0.2);
+ text-indent: 0;
+ padding: 0;
+ box-sizing: border-box;
}
-video::-webkit-media-controls-timeline-container {
- -webkit-appearance: media-timeline-container;
- -webkit-user-select: none;
- -webkit-box-orient: horizontal;
- -webkit-box-align: center;
- -webkit-box-pack: center;
- -webkit-box-flex: 1;
-
- position: absolute;
- top: auto;
- bottom: 0;
- left: 30px;
- right: 34px;
+video::-webkit-media-controls-enclosure {
+ padding: 0px 5px 5px 5px;
+ height: 35px;
+}
- width: auto;
- height: 32px;
+audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-button {
+ display: none;
+}
- border-left: 1px solid rgba(255, 255, 255, 0.2);
- border-right: 1px solid rgba(255, 255, 255, 0.2);
+audio::-webkit-media-controls-play-button, video::-webkit-media-controls-play-button {
+ -webkit-appearance: media-play-button;
+ display: inline;
+ border: none;
+ box-sizing: border-box;
+ width: 35px;
+ height: 35px;
+ line-height: 35px;
+ margin-left: 9px;
+ margin-right: 9px;
+ padding: 0;
}
-audio::-webkit-media-controls-current-time-display, video::-webkit-media-controls-current-time-display {
+audio::-webkit-media-controls-current-time-display, video::-webkit-media-controls-current-time-display,
+audio::-webkit-media-controls-time-remaining-display, video::-webkit-media-controls-time-remaining-display {
-webkit-appearance: media-current-time-display;
-webkit-user-select: none;
- display: -webkit-box;
- -webkit-box-flex: 0;
- -webkit-box-pack: center;
- -webkit-box-align: center;
-
- overflow: hidden;
+ display: block;
+ border: none;
cursor: default;
- line-height: 21px;
- height: 20px;
- width: 58px;
+ height: 35px;
+ margin: 0 9px 0 0;
+ padding: 0;
- text-align: center;
- font-family: Arial;
- font-size: 16px;
+ line-height: 35px;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 18px;
font-weight: bold;
color: white;
@@ -144,39 +121,51 @@ audio::-webkit-media-controls-current-time-display, video::-webkit-media-control
audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline {
-webkit-appearance: media-slider;
display: -webkit-box;
- box-sizing: border-box;
-webkit-box-flex: 1;
-
- padding: 0px;
- margin: 0px 6px;
- height: 18px;
-
- border-color: rgba(255, 255, 255, 0.2);
- border-style: solid;
- border-width: 1px;
- border-radius: 2px;
- background-color: rgba(255, 255, 255, 0.08);
- color: rgb(50, 140, 223);
+ height: 8px;
+ margin: 0 15px 0 0;
+ padding: 0;
+ background-color: transparent;
+ min-width: 25px;
}
video::-webkit-media-controls-fullscreen-button {
-webkit-appearance: media-enter-fullscreen-button;
- position: absolute;
- top: auto;
- bottom: 0;
- right: 0;
- left: auto;
+ display: inline;
+ border: none;
+ box-sizing: border-box;
+ width: 35px;
+ height: 35px;
+ line-height: 35px;
+ margin-left: -5px;
+ margin-right: 9px;
+ padding: 0;
+}
- width: 34px;
- height: 32px;
+input[type="range"]::-webkit-media-slider-container {
+ display: -webkit-box;
+ -webkit-box-align: center;
+ -webkit-box-orient: horizontal;
+ -webkit-box-sizing: border-box;
+ height: 100%;
+ width: 100%;
+ border: 1px solid rgba(230, 230, 230, 0.35);
+ border-radius: 4px;
+ background-color: transparent;
}
-audio::-webkit-media-controls-fullscreen-button {
- display: none;
+input[type="range"]::-webkit-media-slider-thumb {
+ display: block;
+ -webkit-appearance: sliderthumb-horizontal;
+ -webkit-box-sizing: border-box;
+ position: relative;
+ bottom: 1px;
+ margin-left: -7px;
+ margin-right: -7px;
}
-audio::-webkit-media-controls-volume-slider-container, video::-webkit-media-controls-volume-slider-container {
+audio::-webkit-media-controls-fullscreen-button {
display: none;
}
diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp
index 132680ab0..7f190b269 100644
--- a/Source/WebCore/dom/Document.cpp
+++ b/Source/WebCore/dom/Document.cpp
@@ -3401,14 +3401,11 @@ void Document::removeStyleSheetCandidateNode(Node* node)
void Document::collectActiveStylesheets(Vector<RefPtr<StyleSheet> >& sheets)
{
- bool matchAuthorAndUserStyles = true;
- if (Settings* settings = this->settings())
- matchAuthorAndUserStyles = settings->authorAndUserStylesEnabled();
+ if (settings() && !settings()->authorAndUserStylesEnabled())
+ return;
StyleSheetCandidateListHashSet::iterator begin = m_styleSheetCandidateNodes.begin();
StyleSheetCandidateListHashSet::iterator end = m_styleSheetCandidateNodes.end();
- if (!matchAuthorAndUserStyles)
- end = begin;
for (StyleSheetCandidateListHashSet::iterator it = begin; it != end; ++it) {
Node* n = *it;
StyleSheet* sheet = 0;
@@ -4581,7 +4578,7 @@ KURL Document::openSearchDescriptionURL()
return KURL();
HTMLCollection* children = head()->children();
- for (Node* child = children->firstItem(); child; child = children->nextItem()) {
+ for (unsigned i = 0; Node* child = children->item(i); i++) {
if (!child->hasTagName(linkTag))
continue;
HTMLLinkElement* linkElement = static_cast<HTMLLinkElement*>(child);
@@ -5928,7 +5925,7 @@ PassRefPtr<NodeList> Document::getItems(const String& typeNames)
{
// Since documet.getItem() is allowed for microdata, typeNames will be null string.
// In this case we need to create an unique string identifier to map such request in the cache.
- String localTypeNames = typeNames.isNull() ? String("http://webkit.org/microdata/undefinedItemType") : typeNames;
+ String localTypeNames = typeNames.isNull() ? MicroDataItemList::undefinedItemType() : typeNames;
return ensureRareData()->ensureNodeLists(this)->addCacheWithName<MicroDataItemList>(this, DynamicNodeList::MicroDataItemListType, localTypeNames);
}
diff --git a/Source/WebCore/dom/EventNames.h b/Source/WebCore/dom/EventNames.h
index 3056d4a39..598bcdde5 100644
--- a/Source/WebCore/dom/EventNames.h
+++ b/Source/WebCore/dom/EventNames.h
@@ -251,7 +251,21 @@ namespace WebCore {
inline bool isTouchEventType(const AtomicString& eventType) const
{
- return eventType == touchstartEvent || eventType == touchmoveEvent || eventType == touchendEvent || eventType == touchcancelEvent;
+ return eventType == touchstartEvent
+ || eventType == touchmoveEvent
+ || eventType == touchendEvent
+ || eventType == touchcancelEvent;
+ }
+
+ Vector<AtomicString> touchEventNames() const
+ {
+ Vector<AtomicString> names;
+ names.reserveCapacity(4);
+ names.append(touchstartEvent);
+ names.append(touchmoveEvent);
+ names.append(touchendEvent);
+ names.append(touchcancelEvent);
+ return names;
}
};
diff --git a/Source/WebCore/dom/MicroDataItemList.cpp b/Source/WebCore/dom/MicroDataItemList.cpp
index 7c90dda62..21c170a40 100644
--- a/Source/WebCore/dom/MicroDataItemList.cpp
+++ b/Source/WebCore/dom/MicroDataItemList.cpp
@@ -38,17 +38,22 @@ namespace WebCore {
using namespace HTMLNames;
+const String& MicroDataItemList::undefinedItemType()
+{
+ DEFINE_STATIC_LOCAL(String, undefinedItemTypeString, ("http://webkit.org/microdata/undefinedItemType"));
+ return undefinedItemTypeString;
+}
+
MicroDataItemList::MicroDataItemList(PassRefPtr<Node> rootNode, const String& typeNames)
: DynamicSubtreeNodeList(rootNode)
- , m_typeNames(typeNames, node()->document()->inQuirksMode())
+ , m_typeNames(typeNames, document()->inQuirksMode())
, m_originalTypeNames(typeNames)
{
}
MicroDataItemList::~MicroDataItemList()
{
- String localTypeNames = m_originalTypeNames.isNull() ? String("http://webkit.org/microdata/undefinedItemType") : m_originalTypeNames;
- m_node->nodeLists()->removeCacheWithName(this, DynamicNodeList::MicroDataItemListType, localTypeNames);
+ ownerNode()->nodeLists()->removeCacheWithName(this, DynamicNodeList::MicroDataItemListType, m_originalTypeNames);
}
bool MicroDataItemList::nodeMatches(Element* testNode) const
@@ -60,7 +65,7 @@ bool MicroDataItemList::nodeMatches(Element* testNode) const
if (!testElement->fastHasAttribute(itemscopeAttr) || testElement->fastHasAttribute(itempropAttr))
return false;
- if (!m_typeNames.size())
+ if (m_originalTypeNames == undefinedItemType())
return true;
return testElement->itemType()->tokens().containsAll(m_typeNames);
diff --git a/Source/WebCore/dom/MicroDataItemList.h b/Source/WebCore/dom/MicroDataItemList.h
index d4e22947b..fbfc1e03e 100644
--- a/Source/WebCore/dom/MicroDataItemList.h
+++ b/Source/WebCore/dom/MicroDataItemList.h
@@ -43,6 +43,8 @@ public:
virtual ~MicroDataItemList();
+ static const String& undefinedItemType();
+
private:
MicroDataItemList(PassRefPtr<Node> rootNode, const String& typeNames);
diff --git a/Source/WebCore/dom/MouseEvent.h b/Source/WebCore/dom/MouseEvent.h
index 576b57379..0863893ce 100644
--- a/Source/WebCore/dom/MouseEvent.h
+++ b/Source/WebCore/dom/MouseEvent.h
@@ -92,9 +92,10 @@ class PlatformMouseEvent;
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
PassRefPtr<EventTarget> relatedTarget, PassRefPtr<Clipboard> clipboard, bool isSimulated);
- private:
+ protected:
MouseEvent();
+ private:
unsigned short m_button;
bool m_buttonDown;
RefPtr<EventTarget> m_relatedTarget;
diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp
index 7446cfa04..ae3945be5 100644
--- a/Source/WebCore/dom/Node.cpp
+++ b/Source/WebCore/dom/Node.cpp
@@ -2309,6 +2309,21 @@ void Node::didMoveToNewDocument(Document* oldDocument)
// FIXME: Event listener types for this node should be set on the new owner document here.
+ const EventListenerVector& wheelListeners = getEventListeners(eventNames().mousewheelEvent);
+ for (size_t i = 0; i < wheelListeners.size(); ++i) {
+ oldDocument->didRemoveWheelEventHandler();
+ document()->didAddWheelEventHandler();
+ }
+
+ Vector<AtomicString> touchEventNames = eventNames().touchEventNames();
+ for (size_t i = 0; i < touchEventNames.size(); ++i) {
+ const EventListenerVector& listeners = getEventListeners(touchEventNames[i]);
+ for (size_t j = 0; j < listeners.size(); ++j) {
+ oldDocument->didRemoveTouchEventHandler();
+ document()->didAddTouchEventHandler();
+ }
+ }
+
#if ENABLE(MUTATION_OBSERVERS)
if (Vector<OwnPtr<MutationObserverRegistration> >* registry = mutationObserverRegistry()) {
for (size_t i = 0; i < registry->size(); ++i) {
diff --git a/Source/WebCore/dom/TreeScopeAdopter.cpp b/Source/WebCore/dom/TreeScopeAdopter.cpp
index 3db50e98c..88e1a6fd5 100644
--- a/Source/WebCore/dom/TreeScopeAdopter.cpp
+++ b/Source/WebCore/dom/TreeScopeAdopter.cpp
@@ -32,11 +32,6 @@
namespace WebCore {
-static inline ElementShadow* shadowFor(Node* node)
-{
- return node->isElementNode() ? toElement(node)->shadow() : 0;
-}
-
void TreeScopeAdopter::moveTreeToNewScope(Node* root) const
{
ASSERT(needsScopeChange());
diff --git a/Source/WebCore/dom/WebKitMutationObserver.cpp b/Source/WebCore/dom/WebKitMutationObserver.cpp
index 6fe6aa778..80c26a577 100644
--- a/Source/WebCore/dom/WebKitMutationObserver.cpp
+++ b/Source/WebCore/dom/WebKitMutationObserver.cpp
@@ -89,11 +89,6 @@ void WebKitMutationObserver::observe(Node* node, const Dictionary& optionsDictio
return;
}
- if (optionsDictionary.isUndefinedOrNull()) {
- ec = TYPE_MISMATCH_ERR;
- return;
- }
-
static const struct {
const char* name;
MutationObserverOptions value;
diff --git a/Source/WebCore/dom/WheelEvent.cpp b/Source/WebCore/dom/WheelEvent.cpp
index c31112c79..e76c33ace 100644..100755
--- a/Source/WebCore/dom/WheelEvent.cpp
+++ b/Source/WebCore/dom/WheelEvent.cpp
@@ -42,12 +42,13 @@ WheelEvent::WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta,
const IntPoint& screenLocation, const IntPoint& pageLocation,
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
bool directionInvertedFromDevice)
- : MouseRelatedEvent(eventNames().mousewheelEvent,
- true, true, view, 0, screenLocation, pageLocation,
+ : MouseEvent(eventNames().mousewheelEvent,
+ true, true, view, 0, screenLocation.x(), screenLocation.y(),
+ pageLocation.x(), pageLocation.y(),
#if ENABLE(POINTER_LOCK)
- IntPoint(0, 0),
+ 0, 0,
#endif
- ctrlKey, altKey, shiftKey, metaKey)
+ ctrlKey, altKey, shiftKey, metaKey, 0, 0, 0, false)
, m_wheelDelta(IntPoint(static_cast<int>(wheelTicks.x() * tickMultiplier), static_cast<int>(wheelTicks.y() * tickMultiplier)))
, m_rawDelta(roundedIntPoint(rawDelta))
, m_granularity(granularity)
@@ -93,6 +94,11 @@ const AtomicString& WheelEvent::interfaceName() const
return eventNames().interfaceForWheelEvent;
}
+bool WheelEvent::isMouseEvent() const
+{
+ return false;
+}
+
inline static WheelEvent::Granularity granularity(const PlatformWheelEvent& event)
{
return event.granularity() == ScrollByPageWheelEvent ? WheelEvent::Page : WheelEvent::Pixel;
diff --git a/Source/WebCore/dom/WheelEvent.h b/Source/WebCore/dom/WheelEvent.h
index 6b36ab9f6..13576890d 100644..100755
--- a/Source/WebCore/dom/WheelEvent.h
+++ b/Source/WebCore/dom/WheelEvent.h
@@ -26,12 +26,12 @@
#include "EventDispatchMediator.h"
#include "FloatPoint.h"
-#include "MouseRelatedEvent.h"
+#include "MouseEvent.h"
namespace WebCore {
// extension: mouse wheel event
- class WheelEvent : public MouseRelatedEvent {
+ class WheelEvent : public MouseEvent {
public:
enum { tickMultiplier = 120 };
@@ -70,11 +70,12 @@ namespace WebCore {
bool isHorizontal() const { return m_wheelDelta.x(); }
virtual const AtomicString& interfaceName() const;
+ virtual bool isMouseEvent() const;
private:
WheelEvent();
WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta,
- Granularity granularity, PassRefPtr<AbstractView>,
+ Granularity, PassRefPtr<AbstractView>,
const IntPoint& screenLocation, const IntPoint& pageLocation,
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice);
diff --git a/Source/WebCore/dom/WheelEvent.idl b/Source/WebCore/dom/WheelEvent.idl
index 0282525fb..b57fd0e9b 100644
--- a/Source/WebCore/dom/WheelEvent.idl
+++ b/Source/WebCore/dom/WheelEvent.idl
@@ -20,25 +20,14 @@
module events {
- // Based off of proposed IDL interface for WheelEvent:
- interface WheelEvent : UIEvent {
- readonly attribute long screenX;
- readonly attribute long screenY;
- readonly attribute long clientX;
- readonly attribute long clientY;
- readonly attribute boolean ctrlKey;
- readonly attribute boolean shiftKey;
- readonly attribute boolean altKey;
- readonly attribute boolean metaKey;
+ // Based off http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-wheelevents
+ interface WheelEvent : MouseEvent
+ {
readonly attribute long wheelDelta;
readonly attribute long wheelDeltaX;
readonly attribute long wheelDeltaY;
- // WebKit Extensions
- readonly attribute long offsetX;
- readonly attribute long offsetY;
- readonly attribute long x;
- readonly attribute long y;
+ // WebKit Extension
readonly attribute boolean webkitDirectionInvertedFromDevice;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
diff --git a/Source/WebCore/editing/AlternativeTextController.cpp b/Source/WebCore/editing/AlternativeTextController.cpp
index b199af156..d4a0e43b7 100644
--- a/Source/WebCore/editing/AlternativeTextController.cpp
+++ b/Source/WebCore/editing/AlternativeTextController.cpp
@@ -273,7 +273,12 @@ void AlternativeTextController::applyAlternativeTextToRange(const Range* range,
// Clone the range, since the caller of this method may want to keep the original range around.
RefPtr<Range> rangeWithAlternative = range->cloneRange(ec);
+
+ int paragraphStartIndex = TextIterator::rangeLength(Range::create(m_frame->document(), m_frame->document(), 0, paragraphRangeContainingCorrection.get()->startContainer(), paragraphRangeContainingCorrection.get()->startOffset()).get());
applyCommand(SpellingCorrectionCommand::create(rangeWithAlternative, alternative));
+ // Recalculate pragraphRangeContainingCorrection, since SpellingCorrectionCommand modified the DOM, such that the original paragraphRangeContainingCorrection is no longer valid. Radar: 10305315 Bugzilla: 89526
+ paragraphRangeContainingCorrection = TextIterator::rangeFromLocationAndLength(m_frame->document(), paragraphStartIndex, correctionStartOffsetInParagraph + alternative.length());
+
setEnd(paragraphRangeContainingCorrection.get(), m_frame->selection()->selection().start());
RefPtr<Range> replacementRange = TextIterator::subrange(paragraphRangeContainingCorrection.get(), correctionStartOffsetInParagraph, alternative.length());
String newText = plainText(replacementRange.get());
diff --git a/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp b/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp
index eafd8f7c6..786d61fcc 100644
--- a/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp
+++ b/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp
@@ -47,7 +47,7 @@ void DeleteFromTextNodeCommand::doApply()
{
ASSERT(m_node);
- if (!m_node->rendererIsEditable())
+ if (!m_node->isContentEditable())
return;
ExceptionCode ec = 0;
diff --git a/Source/WebCore/editing/DeleteSelectionCommand.cpp b/Source/WebCore/editing/DeleteSelectionCommand.cpp
index a59ed6182..2e059c840 100644
--- a/Source/WebCore/editing/DeleteSelectionCommand.cpp
+++ b/Source/WebCore/editing/DeleteSelectionCommand.cpp
@@ -297,18 +297,26 @@ void DeleteSelectionCommand::saveTypingStyleState()
bool DeleteSelectionCommand::handleSpecialCaseBRDelete()
{
+ Node* nodeAfterUpstreamStart = m_upstreamStart.computeNodeAfterPosition();
+ Node* nodeAfterDownstreamStart = m_downstreamStart.computeNodeAfterPosition();
+ // Upstream end will appear before BR due to canonicalization
+ Node* nodeAfterUpstreamEnd = m_upstreamEnd.computeNodeAfterPosition();
+
+ if (!nodeAfterUpstreamStart || !nodeAfterDownstreamStart)
+ return false;
+
// Check for special-case where the selection contains only a BR on a line by itself after another BR.
- bool upstreamStartIsBR = m_upstreamStart.deprecatedNode()->hasTagName(brTag);
- bool downstreamStartIsBR = m_downstreamStart.deprecatedNode()->hasTagName(brTag);
- bool isBROnLineByItself = upstreamStartIsBR && downstreamStartIsBR && m_downstreamStart.deprecatedNode() == m_upstreamEnd.deprecatedNode();
+ bool upstreamStartIsBR = nodeAfterUpstreamStart->hasTagName(brTag);
+ bool downstreamStartIsBR = nodeAfterDownstreamStart->hasTagName(brTag);
+ bool isBROnLineByItself = upstreamStartIsBR && downstreamStartIsBR && nodeAfterDownstreamStart == nodeAfterUpstreamEnd;
if (isBROnLineByItself) {
- removeNode(m_downstreamStart.deprecatedNode());
+ removeNode(nodeAfterDownstreamStart);
return true;
}
- // Not a special-case delete per se, but we can detect that the merging of content between blocks
- // should not be done.
- if (upstreamStartIsBR && downstreamStartIsBR) {
+ // FIXME: This code doesn't belong in here.
+ // We detect the case where the start is an empty line consisting of BR not wrapped in a block element.
+ if (upstreamStartIsBR && downstreamStartIsBR && !(isStartOfBlock(positionBeforeNode(nodeAfterUpstreamStart)) && isEndOfBlock(positionAfterNode(nodeAfterUpstreamStart)))) {
m_startsAtEmptyLine = true;
m_endingPosition = m_downstreamEnd;
}
diff --git a/Source/WebCore/editing/Editor.cpp b/Source/WebCore/editing/Editor.cpp
index 85cab133b..9018a8949 100644
--- a/Source/WebCore/editing/Editor.cpp
+++ b/Source/WebCore/editing/Editor.cpp
@@ -2085,7 +2085,7 @@ void Editor::markAndReplaceFor(PassRefPtr<SpellCheckRequest> request, const Vect
if (result->type == TextCheckingTypeLink && selectionOffset > resultLocation + resultLength + 1)
continue;
- if (!(shouldPerformReplacement || shouldShowCorrectionPanel || shouldMarkLink) || !doReplacement)
+ if (!(shouldPerformReplacement || shouldCheckForCorrection || shouldMarkLink) || !doReplacement)
continue;
String replacedString = plainText(rangeToReplace.get());
@@ -2119,8 +2119,13 @@ void Editor::markAndReplaceFor(PassRefPtr<SpellCheckRequest> request, const Vect
if (canEditRichly())
applyCommand(CreateLinkCommand::create(m_frame->document(), result->replacement));
} else if (canEdit() && shouldInsertText(result->replacement, rangeToReplace.get(), EditorInsertActionTyped)) {
+ int paragraphStartIndex = TextIterator::rangeLength(Range::create(m_frame->document(), m_frame->document(), 0, paragraph.paragraphRange()->startContainer(), paragraph.paragraphRange()->startOffset()).get());
+ int paragraphLength = TextIterator::rangeLength(paragraph.paragraphRange().get());
applyCommand(SpellingCorrectionCommand::create(rangeToReplace, result->replacement));
-
+ // Recalculate newParagraphRange, since SpellingCorrectionCommand modifies the DOM, such that the original paragraph range is no longer valid. Radar: 10305315 Bugzilla: 89526
+ RefPtr<Range> newParagraphRange = TextIterator::rangeFromLocationAndLength(m_frame->document(), paragraphStartIndex, paragraphLength+replacementLength-resultLength);
+ paragraph = TextCheckingParagraph(TextIterator::subrange(newParagraphRange.get(), resultLocation, replacementLength), newParagraphRange);
+
if (AXObjectCache::accessibilityEnabled()) {
if (Element* root = m_frame->selection()->selection().rootEditableElement())
m_frame->document()->axObjectCache()->postNotification(root->renderer(), AXObjectCache::AXAutocorrectionOccured, true);
diff --git a/Source/WebCore/editing/htmlediting.cpp b/Source/WebCore/editing/htmlediting.cpp
index 7d8fc390d..d782d177d 100644
--- a/Source/WebCore/editing/htmlediting.cpp
+++ b/Source/WebCore/editing/htmlediting.cpp
@@ -78,15 +78,15 @@ int comparePositions(const Position& a, const Position& b)
if (!commonScope)
return 0;
- Node* nodeA = commonScope->ancestorInThisScope(a.deprecatedNode());
+ Node* nodeA = commonScope->ancestorInThisScope(a.containerNode());
ASSERT(nodeA);
- bool hasDescendentA = nodeA != a.deprecatedNode();
- int offsetA = hasDescendentA ? 0 : a.deprecatedEditingOffset();
+ bool hasDescendentA = nodeA != a.containerNode();
+ int offsetA = hasDescendentA ? 0 : a.computeOffsetInContainerNode();
- Node* nodeB = commonScope->ancestorInThisScope(b.deprecatedNode());
+ Node* nodeB = commonScope->ancestorInThisScope(b.containerNode());
ASSERT(nodeB);
- bool hasDescendentB = nodeB != b.deprecatedNode();
- int offsetB = hasDescendentB ? 0 : b.deprecatedEditingOffset();
+ bool hasDescendentB = nodeB != b.containerNode();
+ int offsetB = hasDescendentB ? 0 : b.computeOffsetInContainerNode();
int bias = 0;
if (nodeA == nodeB) {
diff --git a/Source/WebCore/html/FormController.cpp b/Source/WebCore/html/FormController.cpp
index 84f44ee94..8719443b4 100644
--- a/Source/WebCore/html/FormController.cpp
+++ b/Source/WebCore/html/FormController.cpp
@@ -22,7 +22,6 @@
#include "FormController.h"
#include "HTMLFormControlElementWithState.h"
-#include <wtf/text/StringBuilder.h>
namespace WebCore {
@@ -31,61 +30,38 @@ using namespace HTMLNames;
// ----------------------------------------------------------------------------
// Serilized form of FormControlState:
+// (',' means strings around it are separated in stateVector.)
//
// SerializedControlState ::= SkipState | RestoreState
-// SkipState ::= ''
-// RestoreState ::= (',' EscapedValue )+
-// EscapedValue ::= ('\\' | '\,' | [^\,])+
+// SkipState ::= '0'
+// RestoreState ::= UnsignedNumber, ControlValue+
+// UnsignedNumber ::= [0-9]+
+// ControlValue ::= arbitrary string
+//
+// RestoreState has a sequence of ControlValues. The length of the
+// sequence is represented by UnsignedNumber.
-String FormControlState::serialize() const
+void FormControlState::serializeTo(Vector<String>& stateVector) const
{
ASSERT(!isFailure());
- if (!m_values.size())
- return emptyString();
-
- size_t enoughSize = 0;
+ stateVector.append(String::number(m_values.size()));
for (size_t i = 0; i < m_values.size(); ++i)
- enoughSize += 1 + m_values[i].length() * 2;
- StringBuilder builder;
- builder.reserveCapacity(enoughSize);
- for (size_t i = 0; i < m_values.size(); ++i) {
- builder.append(',');
- builder.appendEscaped(m_values[i], '\\', ',');
- }
- return builder.toString();
+ stateVector.append(m_values[i].isNull() ? emptyString() : m_values[i]);
}
-FormControlState FormControlState::deserialize(const String& escaped)
+FormControlState FormControlState::deserialize(const Vector<String>& stateVector, size_t& index)
{
- if (!escaped.length())
+ if (index >= stateVector.size())
+ return FormControlState(TypeFailure);
+ size_t valueSize = stateVector[index++].toUInt();
+ if (!valueSize)
return FormControlState();
- if (escaped[0] != ',')
+ if (index + valueSize > stateVector.size())
return FormControlState(TypeFailure);
-
- size_t valueSize = 1;
- for (unsigned i = 1; i < escaped.length(); ++i) {
- if (escaped[i] == '\\') {
- if (++i >= escaped.length())
- return FormControlState(TypeFailure);
- } else if (escaped[i] == ',')
- valueSize++;
- }
-
FormControlState state;
state.m_values.reserveCapacity(valueSize);
- StringBuilder builder;
- for (unsigned i = 1; i < escaped.length(); ++i) {
- if (escaped[i] == '\\') {
- if (++i >= escaped.length())
- return FormControlState(TypeFailure);
- builder.append(escaped[i]);
- } else if (escaped[i] == ',') {
- state.append(builder.toString());
- builder.clear();
- } else
- builder.append(escaped[i]);
- }
- state.append(builder.toString());
+ for (size_t i = 0; i < valueSize; ++i)
+ state.append(stateVector[index++]);
return state;
}
@@ -105,14 +81,14 @@ static String formStateSignature()
// In the legacy version of serialized state, the first item was a name
// attribute value of a form control. The following string literal should
// contain some characters which are rarely used for name attribute values.
- DEFINE_STATIC_LOCAL(String, signature, ("\n\r?% WebKit serialized form state version 4 \n\r=&"));
+ DEFINE_STATIC_LOCAL(String, signature, ("\n\r?% WebKit serialized form state version 3 \n\r=&"));
return signature;
}
Vector<String> FormController::formElementsState() const
{
Vector<String> stateVector;
- stateVector.reserveInitialCapacity(m_formElementsWithState.size() * 3 + 1);
+ stateVector.reserveInitialCapacity(m_formElementsWithState.size() * 4 + 1);
stateVector.append(formStateSignature());
typedef FormElementListHashSet::const_iterator Iterator;
Iterator end = m_formElementsWithState.end();
@@ -122,7 +98,7 @@ Vector<String> FormController::formElementsState() const
continue;
stateVector.append(elementWithState->name().string());
stateVector.append(elementWithState->formControlType().string());
- stateVector.append(elementWithState->saveFormControlState().serialize());
+ elementWithState->saveFormControlState().serializeTo(stateVector);
}
return stateVector;
}
@@ -137,15 +113,14 @@ void FormController::setStateForNewFormElements(const Vector<String>& stateVecto
typedef FormElementStateMap::iterator Iterator;
m_formElementsWithState.clear();
- if (stateVector.size() < 1 || stateVector[0] != formStateSignature())
- return;
- if ((stateVector.size() - 1) % 3)
+ size_t i = 0;
+ if (stateVector.size() < 1 || stateVector[i++] != formStateSignature())
return;
- for (size_t i = 1; i < stateVector.size(); i += 3) {
- AtomicString name = stateVector[i];
- AtomicString type = stateVector[i + 1];
- FormControlState state = FormControlState::deserialize(stateVector[i + 2]);
+ while (i + 2 < stateVector.size()) {
+ AtomicString name = stateVector[i++];
+ AtomicString type = stateVector[i++];
+ FormControlState state = FormControlState::deserialize(stateVector, i);
if (type.isEmpty() || type.impl()->find(isNotFormControlTypeCharacter) != notFound || state.isFailure())
break;
@@ -159,17 +134,16 @@ void FormController::setStateForNewFormElements(const Vector<String>& stateVecto
m_stateForNewFormElements.set(key, stateList);
}
}
+ if (i != stateVector.size())
+ m_stateForNewFormElements.clear();
}
-bool FormController::hasStateForNewFormElements() const
-{
- return !m_stateForNewFormElements.isEmpty();
-}
-
-FormControlState FormController::takeStateForFormElement(AtomicStringImpl* name, AtomicStringImpl* type)
+FormControlState FormController::takeStateForFormElement(const HTMLFormControlElementWithState& control)
{
+ if (m_stateForNewFormElements.isEmpty())
+ return FormControlState();
typedef FormElementStateMap::iterator Iterator;
- Iterator it = m_stateForNewFormElements.find(FormElementKey(name, type));
+ Iterator it = m_stateForNewFormElements.find(FormElementKey(control.name().impl(), control.type().impl()));
if (it == m_stateForNewFormElements.end())
return FormControlState();
ASSERT(it->second.size());
diff --git a/Source/WebCore/html/FormController.h b/Source/WebCore/html/FormController.h
index 4de51f524..84156953e 100644
--- a/Source/WebCore/html/FormController.h
+++ b/Source/WebCore/html/FormController.h
@@ -78,7 +78,7 @@ class FormControlState {
public:
FormControlState() : m_type(TypeSkip) { }
explicit FormControlState(const String& value) : m_type(TypeRestore) { m_values.append(value); }
- static FormControlState deserialize(const String&);
+ static FormControlState deserialize(const Vector<String>& stateVector, size_t& index);
FormControlState(const FormControlState& another) : m_type(another.m_type), m_values(another.m_values) { }
FormControlState& operator=(const FormControlState&);
@@ -86,7 +86,7 @@ public:
size_t valueSize() const { return m_values.size(); }
const String& operator[](size_t i) const { return m_values[i]; }
void append(const String&);
- String serialize() const;
+ void serializeTo(Vector<String>& stateVector) const;
private:
enum Type { TypeSkip, TypeRestore, TypeFailure };
@@ -125,8 +125,7 @@ public:
Vector<String> formElementsState() const;
// This should be callled only by Document::setStateForNewFormElements().
void setStateForNewFormElements(const Vector<String>&);
- bool hasStateForNewFormElements() const;
- FormControlState takeStateForFormElement(AtomicStringImpl* name, AtomicStringImpl* type);
+ FormControlState takeStateForFormElement(const HTMLFormControlElementWithState&);
void registerFormElementWithFormAttribute(FormAssociatedElement*);
void unregisterFormElementWithFormAttribute(FormAssociatedElement*);
diff --git a/Source/WebCore/html/HTMLCollection.cpp b/Source/WebCore/html/HTMLCollection.cpp
index c20c464e8..1129cabd9 100644
--- a/Source/WebCore/html/HTMLCollection.cpp
+++ b/Source/WebCore/html/HTMLCollection.cpp
@@ -36,16 +36,7 @@ namespace WebCore {
using namespace HTMLNames;
-HTMLCollection::HTMLCollection(Node* base, CollectionType type)
- : m_includeChildren(shouldIncludeChildren(type))
- , m_type(type)
- , m_base(base)
-{
- ASSERT(m_base);
- m_cache.clear();
-}
-
-bool HTMLCollection::shouldIncludeChildren(CollectionType type)
+static bool shouldIncludeChildren(CollectionType type)
{
switch (type) {
case DocAll:
@@ -78,6 +69,15 @@ bool HTMLCollection::shouldIncludeChildren(CollectionType type)
return false;
}
+HTMLCollection::HTMLCollection(Node* base, CollectionType type)
+ : m_includeChildren(shouldIncludeChildren(type))
+ , m_type(type)
+ , m_base(base)
+{
+ ASSERT(m_base);
+ m_cache.clear();
+}
+
PassOwnPtr<HTMLCollection> HTMLCollection::create(Node* base, CollectionType type)
{
return adoptPtr(new HTMLCollection(base, type));
@@ -199,39 +199,23 @@ unsigned HTMLCollection::length() const
Node* HTMLCollection::item(unsigned index) const
{
- invalidateCacheIfNeeded();
- if (m_cache.current && m_cache.position == index)
- return m_cache.current;
- if (m_cache.hasLength && m_cache.length <= index)
- return 0;
- if (!m_cache.current || m_cache.position > index) {
- m_cache.current = itemAfter(0);
- m_cache.position = 0;
- if (!m_cache.current)
- return 0;
- }
- Element* e = m_cache.current;
- for (unsigned pos = m_cache.position; e && pos < index; pos++)
- e = itemAfter(e);
- m_cache.current = e;
- m_cache.position = index;
- return m_cache.current;
-}
-
-Node* HTMLCollection::firstItem() const
-{
- return item(0);
-}
-
-Node* HTMLCollection::nextItem() const
-{
- invalidateCacheIfNeeded();
-
- // Look for the 'second' item. The first one is currentItem, already given back.
- Element* retval = itemAfter(m_cache.current);
- m_cache.current = retval;
- m_cache.position++;
- return retval;
+ invalidateCacheIfNeeded();
+ if (m_cache.current && m_cache.position == index)
+ return m_cache.current;
+ if (m_cache.hasLength && m_cache.length <= index)
+ return 0;
+ if (!m_cache.current || m_cache.position > index) {
+ m_cache.current = itemAfter(0);
+ m_cache.position = 0;
+ if (!m_cache.current)
+ return 0;
+ }
+ Element* e = m_cache.current;
+ for (unsigned pos = m_cache.position; e && pos < index; pos++)
+ e = itemAfter(e);
+ m_cache.current = e;
+ m_cache.position = index;
+ return m_cache.current;
}
static inline bool nameShouldBeVisibleInDocumentAll(HTMLElement* element)
diff --git a/Source/WebCore/html/HTMLCollection.h b/Source/WebCore/html/HTMLCollection.h
index fa3ff1ead..ede81c09f 100644
--- a/Source/WebCore/html/HTMLCollection.h
+++ b/Source/WebCore/html/HTMLCollection.h
@@ -44,19 +44,25 @@ public:
void ref() { m_base->ref(); }
void deref() { m_base->deref(); }
+ // DOM API
unsigned length() const;
-
virtual Node* item(unsigned index) const;
- virtual Node* nextItem() const;
-
virtual Node* namedItem(const AtomicString& name) const;
+ PassRefPtr<NodeList> tags(const String&);
- Node* firstItem() const;
-
+ // Non-DOM API
bool hasNamedItem(const AtomicString& name) const;
void namedItems(const AtomicString& name, Vector<RefPtr<Node> >&) const;
-
- PassRefPtr<NodeList> tags(const String&);
+ bool hasAnyItem() const
+ {
+ invalidateCacheIfNeeded();
+ return (m_cache.hasLength && m_cache.length) || m_cache.current || item(0);
+ }
+ bool hasExactlyOneItem() const
+ {
+ invalidateCacheIfNeeded();
+ return (m_cache.hasLength && m_cache.length == 1) || (m_cache.current && !itemAfter(m_cache.current)) || (item(0) && !item(1));
+ }
Node* base() const { return m_base; }
CollectionType type() const { return static_cast<CollectionType>(m_type); }
@@ -98,7 +104,6 @@ protected:
} m_cache;
private:
- static bool shouldIncludeChildren(CollectionType);
bool checkForNameMatch(Element*, bool checkName, const AtomicString& name) const;
virtual unsigned calcLength() const;
diff --git a/Source/WebCore/html/HTMLFormControlElementWithState.cpp b/Source/WebCore/html/HTMLFormControlElementWithState.cpp
index a884ee1bd..22940e0d6 100644
--- a/Source/WebCore/html/HTMLFormControlElementWithState.cpp
+++ b/Source/WebCore/html/HTMLFormControlElementWithState.cpp
@@ -77,12 +77,9 @@ void HTMLFormControlElementWithState::finishParsingChildren()
if (!shouldSaveAndRestoreFormControlState())
return;
- Document* doc = document();
- if (doc->formController()->hasStateForNewFormElements()) {
- FormControlState state = doc->formController()->takeStateForFormElement(name().impl(), type().impl());
- if (state.valueSize() > 0)
- restoreFormControlState(state);
- }
+ FormControlState state = document()->formController()->takeStateForFormElement(*this);
+ if (state.valueSize() > 0)
+ restoreFormControlState(state);
}
} // namespace Webcore
diff --git a/Source/WebCore/html/HTMLMapElement.cpp b/Source/WebCore/html/HTMLMapElement.cpp
index 8f6d6f64c..293eee354 100644
--- a/Source/WebCore/html/HTMLMapElement.cpp
+++ b/Source/WebCore/html/HTMLMapElement.cpp
@@ -82,8 +82,8 @@ bool HTMLMapElement::mapMouseEvent(LayoutPoint location, const LayoutSize& size,
HTMLImageElement* HTMLMapElement::imageElement()
{
- HTMLCollection* coll = document()->images();
- for (Node* curr = coll->firstItem(); curr; curr = coll->nextItem()) {
+ HTMLCollection* images = document()->images();
+ for (unsigned i = 0; Node* curr = images->item(i); i++) {
if (!curr->hasTagName(imgTag))
continue;
diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp
index bcc87fe0c..fddc42893 100644
--- a/Source/WebCore/html/HTMLMediaElement.cpp
+++ b/Source/WebCore/html/HTMLMediaElement.cpp
@@ -2708,8 +2708,6 @@ void HTMLMediaElement::endScrubbing()
// "15 to 250ms", we choose the slowest frequency
static const double maxTimeupdateEventFrequency = 0.25;
-static const double timeWithoutMouseMovementBeforeHidingControls = 3;
-
void HTMLMediaElement::startPlaybackProgressTimer()
{
if (m_playbackProgressTimer.isActive())
diff --git a/Source/WebCore/html/shadow/CalendarPickerElement.cpp b/Source/WebCore/html/shadow/CalendarPickerElement.cpp
index fe1f64e13..5358ccaf7 100644
--- a/Source/WebCore/html/shadow/CalendarPickerElement.cpp
+++ b/Source/WebCore/html/shadow/CalendarPickerElement.cpp
@@ -151,7 +151,12 @@ static void addJavaScriptString(const String& str, DocumentWriter& writer)
{
addLiteral("\"", writer);
StringBuilder builder;
- builder.appendEscaped(str, '\\', '"');
+ builder.reserveCapacity(str.length());
+ for (unsigned i = 0; i < str.length(); ++i) {
+ if (str[i] == '\\' || str[i] == '"')
+ builder.append('\\');
+ builder.append(str[i]);
+ }
addString(builder.toString(), writer);
addLiteral("\"", writer);
}
diff --git a/Source/WebCore/html/shadow/InsertionPoint.cpp b/Source/WebCore/html/shadow/InsertionPoint.cpp
index 580512862..0794c3449 100644
--- a/Source/WebCore/html/shadow/InsertionPoint.cpp
+++ b/Source/WebCore/html/shadow/InsertionPoint.cpp
@@ -128,14 +128,13 @@ Node::InsertionNotificationRequest InsertionPoint::insertedInto(ContainerNode* i
void InsertionPoint::removedFrom(ContainerNode* insertionPoint)
{
if (insertionPoint->inDocument()) {
- Node* parent = parentNode();
- if (!parent)
- parent = insertionPoint;
- if (ShadowRoot* root = parent->shadowRoot()) {
- // host can be null when removedFrom() is called from ElementShadow destructor.
- if (root->host())
- root->owner()->invalidateDistribution();
- }
+ ShadowRoot* root = shadowRoot();
+ if (!root)
+ root = insertionPoint->shadowRoot();
+
+ // host can be null when removedFrom() is called from ElementShadow destructor.
+ if (root && root->host())
+ root->owner()->invalidateDistribution();
// Since this insertion point is no longer visible from the shadow subtree, it need to clean itself up.
clearDistribution();
diff --git a/Source/WebCore/inspector/Inspector.json b/Source/WebCore/inspector/Inspector.json
index 880633e1d..0f6448349 100644
--- a/Source/WebCore/inspector/Inspector.json
+++ b/Source/WebCore/inspector/Inspector.json
@@ -1420,6 +1420,15 @@
{ "name": "resourceType", "$ref": "Page.ResourceType", "optional": true, "description": "ResourceType of the entry, available for a file only." }
],
"description": "Represents a browser side file or directory."
+ },
+ {
+ "id": "Metadata",
+ "type": "object",
+ "properties": [
+ { "name": "modificationTime", "type": "number", "description": "Modification time." },
+ { "name": "size", "type": "number", "optional": true, "description": "File size. This field is available only for a file." }
+ ],
+ "description": "Represents metadata of a file or entry."
}
],
"commands": [
@@ -1451,6 +1460,16 @@
{ "name": "requestId", "$ref": "RequestId", "description": "Request identifier. Corresponding directoryContentReceived event should have same requestId with this." }
],
"description": "Returns content of the directory as directoryContentReceived event."
+ },
+ {
+ "name": "requestMetadata",
+ "parameters": [
+ { "name": "url", "type": "string", "description": "URL of the entry that the frontend is requesting to get metadata from." }
+ ],
+ "returns": [
+ { "name": "requestId", "$ref": "RequestId", "description": "Request identifier. Corresponding metadataReceived event should have same requestId with this." }
+ ],
+ "description": "Returns metadata of the entry as metadataReceived event."
}
],
"events": [
@@ -1471,6 +1490,15 @@
{ "name": "entries", "type": "array", "items": { "$ref": "FileSystem.Entry" }, "optional": true, "description": "Contains all entries on directory if the command completed successfully." }
],
"description": "Completion event of requestDirectoryContent command."
+ },
+ {
+ "name": "metadataReceived",
+ "parameters": [
+ { "name": "requestId", "type": "integer", "description": "Request Identifier that was returned in response to the corresponding getMetadata request." },
+ { "name": "errorCode", "type": "integer", "description": "0, if no error. Otherwise, errorCode is set to FileError::ErrorCode value." },
+ { "name": "metadata", "$ref": "FileSystem.Metadata", "optional": true, "description": "Contains metadata of the entry if the command completed successfully." }
+ ],
+ "description": "Completion event of getMetadata command."
}
]
},
diff --git a/Source/WebCore/inspector/InspectorFileSystemAgent.cpp b/Source/WebCore/inspector/InspectorFileSystemAgent.cpp
index 72a2788c6..06206de26 100644
--- a/Source/WebCore/inspector/InspectorFileSystemAgent.cpp
+++ b/Source/WebCore/inspector/InspectorFileSystemAgent.cpp
@@ -52,6 +52,8 @@
#include "KURL.h"
#include "LocalFileSystem.h"
#include "MIMETypeRegistry.h"
+#include "Metadata.h"
+#include "MetadataCallback.h"
#include "SecurityOrigin.h"
using WebCore::TypeBuilder::Array;
@@ -142,7 +144,7 @@ public:
private:
bool didHitError(FileError*);
- bool gotEntry(Entry*);
+ bool didGetEntry(Entry*);
void reportResult(FileError::ErrorCode errorCode, PassRefPtr<TypeBuilder::FileSystem::Entry> entry)
{
@@ -180,14 +182,14 @@ void GetFileSystemRootTask::start(ScriptExecutionContext* scriptExecutionContext
return;
}
- RefPtr<EntryCallback> successCallback = CallbackDispatcherFactory<EntryCallback>::create(this, &GetFileSystemRootTask::gotEntry);
+ RefPtr<EntryCallback> successCallback = CallbackDispatcherFactory<EntryCallback>::create(this, &GetFileSystemRootTask::didGetEntry);
RefPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &GetFileSystemRootTask::didHitError);
OwnPtr<ResolveURICallbacks> fileSystemCallbacks = ResolveURICallbacks::create(successCallback, errorCallback, scriptExecutionContext, type, "/");
LocalFileSystem::localFileSystem().readFileSystem(scriptExecutionContext, type, fileSystemCallbacks.release());
}
-bool GetFileSystemRootTask::gotEntry(Entry* entry)
+bool GetFileSystemRootTask::didGetEntry(Entry* entry)
{
RefPtr<TypeBuilder::FileSystem::Entry> result(TypeBuilder::FileSystem::Entry::create().setUrl(entry->toURL()).setName("/").setIsDirectory(true));
reportResult(static_cast<FileError::ErrorCode>(0), result);
@@ -216,7 +218,7 @@ private:
return true;
}
- bool gotEntry(Entry*);
+ bool didGetEntry(Entry*);
bool didReadDirectoryEntries(EntryArray*);
void reportResult(FileError::ErrorCode errorCode, PassRefPtr<Array<TypeBuilder::FileSystem::Entry> > entries)
@@ -252,14 +254,14 @@ void ReadDirectoryTask::start(ScriptExecutionContext* scriptExecutionContext)
return;
}
- RefPtr<EntryCallback> successCallback = CallbackDispatcherFactory<EntryCallback>::create(this, &ReadDirectoryTask::gotEntry);
+ RefPtr<EntryCallback> successCallback = CallbackDispatcherFactory<EntryCallback>::create(this, &ReadDirectoryTask::didGetEntry);
RefPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &ReadDirectoryTask::didHitError);
OwnPtr<ResolveURICallbacks> fileSystemCallbacks = ResolveURICallbacks::create(successCallback, errorCallback, scriptExecutionContext, type, path);
LocalFileSystem::localFileSystem().readFileSystem(scriptExecutionContext, type, fileSystemCallbacks.release());
}
-bool ReadDirectoryTask::gotEntry(Entry* entry)
+bool ReadDirectoryTask::didGetEntry(Entry* entry)
{
if (!entry->isDirectory()) {
reportResult(FileError::TYPE_MISMATCH_ERR, 0);
@@ -318,6 +320,86 @@ bool ReadDirectoryTask::didReadDirectoryEntries(EntryArray* entries)
return true;
}
+class GetMetadataTask : public RefCounted<GetMetadataTask> {
+ WTF_MAKE_NONCOPYABLE(GetMetadataTask);
+public:
+ static PassRefPtr<GetMetadataTask> create(PassRefPtr<FrontendProvider> frontendProvider, int requestId, const String& url)
+ {
+ return adoptRef(new GetMetadataTask(frontendProvider, requestId, url));
+ }
+
+ virtual ~GetMetadataTask()
+ {
+ reportResult(FileError::ABORT_ERR, 0);
+ }
+
+ bool didHitError(FileError* error)
+ {
+ reportResult(error->code(), 0);
+ return true;
+ }
+
+ void start(ScriptExecutionContext*);
+ bool didGetEntry(Entry*);
+ bool didGetMetadata(Metadata*);
+
+ void reportResult(FileError::ErrorCode errorCode, PassRefPtr<TypeBuilder::FileSystem::Metadata> metadata)
+ {
+ if (!m_frontendProvider || !m_frontendProvider->frontend())
+ return;
+ m_frontendProvider->frontend()->metadataReceived(m_requestId, static_cast<int>(errorCode), metadata);
+ m_frontendProvider = 0;
+ }
+
+private:
+ GetMetadataTask(PassRefPtr<FrontendProvider> frontendProvider, int requestId, const String& url)
+ : m_frontendProvider(frontendProvider)
+ , m_requestId(requestId)
+ , m_url(ParsedURLString, url) { }
+
+ RefPtr<FrontendProvider> m_frontendProvider;
+ int m_requestId;
+ KURL m_url;
+ String m_path;
+ bool m_isDirectory;
+};
+
+void GetMetadataTask::start(ScriptExecutionContext* scriptExecutionContext)
+{
+ FileSystemType type;
+ DOMFileSystemBase::crackFileSystemURL(m_url, type, m_path);
+
+ RefPtr<EntryCallback> successCallback = CallbackDispatcherFactory<EntryCallback>::create(this, &GetMetadataTask::didGetEntry);
+ RefPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &GetMetadataTask::didHitError);
+
+ OwnPtr<ResolveURICallbacks> fileSystemCallbacks = ResolveURICallbacks::create(successCallback, errorCallback, scriptExecutionContext, type, m_path);
+ LocalFileSystem::localFileSystem().readFileSystem(scriptExecutionContext, type, fileSystemCallbacks.release());
+}
+
+bool GetMetadataTask::didGetEntry(Entry* entry)
+{
+ if (!entry->filesystem()->scriptExecutionContext()) {
+ reportResult(FileError::ABORT_ERR, 0);
+ return true;
+ }
+
+ RefPtr<MetadataCallback> successCallback = CallbackDispatcherFactory<MetadataCallback>::create(this, &GetMetadataTask::didGetMetadata);
+ RefPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &GetMetadataTask::didHitError);
+ entry->getMetadata(successCallback, errorCallback);
+ m_isDirectory = entry->isDirectory();
+ return true;
+}
+
+bool GetMetadataTask::didGetMetadata(Metadata* metadata)
+{
+ using TypeBuilder::FileSystem::Metadata;
+ RefPtr<Metadata> result = Metadata::create().setModificationTime(metadata->modificationTime());
+ if (!m_isDirectory)
+ result->setSize(metadata->size());
+ reportResult(static_cast<FileError::ErrorCode>(0), result);
+ return true;
+}
+
}
// static
@@ -351,8 +433,10 @@ void InspectorFileSystemAgent::disable(ErrorString*)
void InspectorFileSystemAgent::requestFileSystemRoot(ErrorString* error, const String& origin, const String& type, int* requestId)
{
- if (!m_enabled || !m_frontendProvider)
+ if (!m_enabled || !m_frontendProvider) {
+ *error = "FileSystem agent is not enabled";
return;
+ }
ASSERT(m_frontendProvider->frontend());
*requestId = m_nextRequestId++;
@@ -362,10 +446,12 @@ void InspectorFileSystemAgent::requestFileSystemRoot(ErrorString* error, const S
m_frontendProvider->frontend()->fileSystemRootReceived(*requestId, static_cast<int>(FileError::ABORT_ERR), 0);
}
-void InspectorFileSystemAgent::requestDirectoryContent(ErrorString*, const String& url, int* requestId)
+void InspectorFileSystemAgent::requestDirectoryContent(ErrorString* error, const String& url, int* requestId)
{
- if (!m_enabled || !m_frontendProvider)
+ if (!m_enabled || !m_frontendProvider) {
+ *error = "FileSystem agent is not enabled";
return;
+ }
ASSERT(m_frontendProvider->frontend());
*requestId = m_nextRequestId++;
@@ -376,6 +462,22 @@ void InspectorFileSystemAgent::requestDirectoryContent(ErrorString*, const Strin
m_frontendProvider->frontend()->directoryContentReceived(*requestId, static_cast<int>(FileError::ABORT_ERR), 0);
}
+void InspectorFileSystemAgent::requestMetadata(ErrorString* error, const String& url, int* requestId)
+{
+ if (!m_enabled || !m_frontendProvider) {
+ *error = "FileSystem agent is not enabled";
+ return;
+ }
+ ASSERT(m_frontendProvider->frontend());
+
+ *requestId = m_nextRequestId++;
+
+ if (ScriptExecutionContext* scriptExecutionContext = scriptExecutionContextForOrigin(SecurityOrigin::createFromString(url).get()))
+ GetMetadataTask::create(m_frontendProvider, *requestId, url)->start(scriptExecutionContext);
+ else
+ m_frontendProvider->frontend()->metadataReceived(*requestId, static_cast<int>(FileError::ABORT_ERR), 0);
+}
+
void InspectorFileSystemAgent::setFrontend(InspectorFrontend* frontend)
{
ASSERT(frontend);
diff --git a/Source/WebCore/inspector/InspectorFileSystemAgent.h b/Source/WebCore/inspector/InspectorFileSystemAgent.h
index 59a16e907..82f95c4b6 100644
--- a/Source/WebCore/inspector/InspectorFileSystemAgent.h
+++ b/Source/WebCore/inspector/InspectorFileSystemAgent.h
@@ -61,6 +61,7 @@ public:
virtual void requestFileSystemRoot(ErrorString*, const String& origin, const String& type, int* requestId) OVERRIDE;
virtual void requestDirectoryContent(ErrorString*, const String& url, int* requestId) OVERRIDE;
+ virtual void requestMetadata(ErrorString*, const String& url, int* requestId) OVERRIDE;
virtual void setFrontend(InspectorFrontend*) OVERRIDE;
virtual void clearFrontend() OVERRIDE;
diff --git a/Source/WebCore/inspector/front-end/FileSystemModel.js b/Source/WebCore/inspector/front-end/FileSystemModel.js
index 661e915ff..edb647fa7 100644
--- a/Source/WebCore/inspector/front-end/FileSystemModel.js
+++ b/Source/WebCore/inspector/front-end/FileSystemModel.js
@@ -235,6 +235,11 @@ WebInspector.FileSystemModel.prototype = {
}
callback(errorCode, entries);
+ },
+
+ requestMetadata: function(entry, callback)
+ {
+ this._agentWrapper.requestMetadata(entry.url, callback);
}
}
@@ -325,6 +330,14 @@ WebInspector.FileSystemModel.Entry.prototype = {
get isDirectory()
{
return this._isDirectory;
+ },
+
+ /**
+ * @param {function(number, FileSystemAgent.Metadata)} callback
+ */
+ requestMetadata: function(callback)
+ {
+ this.fileSystemModel.requestMetadata(this, callback);
}
}
@@ -394,6 +407,7 @@ WebInspector.FileSystemRequestManager = function()
{
this._pendingFileSystemRootRequests = {};
this._pendingDirectoryContentRequests = {};
+ this._pendingMetadataRequests = {};
InspectorBackend.registerFileSystemDispatcher(new WebInspector.FileSystemDispatcher(this));
FileSystemAgent.enable();
@@ -459,6 +473,31 @@ WebInspector.FileSystemRequestManager.prototype = {
return;
delete this._pendingDirectoryContentRequests[requestId];
callback(errorCode, backendEntries);
+ },
+
+ /**
+ * @param {string} url
+ * @param {function(number, FileSystemAgent.Metadata=)} callback
+ */
+ requestMetadata: function(url, callback)
+ {
+ var store = this._pendingMetadataRequests;
+ FileSystemAgent.requestMetadata(url, requestAccepted);
+
+ function requestAccepted(error, requestId)
+ {
+ if (!error)
+ store[requestId] = callback;
+ }
+ },
+
+ _metadataReceived: function(requestId, errorCode, metadata)
+ {
+ var callback = this._pendingMetadataRequests[requestId];
+ if (!callback)
+ return;
+ delete this._pendingMetadataRequests[requestId];
+ callback(errorCode, metadata);
}
}
@@ -491,5 +530,15 @@ WebInspector.FileSystemDispatcher.prototype = {
directoryContentReceived: function(requestId, errorCode, backendEntries)
{
this._agentWrapper._directoryContentReceived(requestId, errorCode, backendEntries);
+ },
+
+ /**
+ * @param {number} requestId
+ * @param {number} errorCode
+ * @param {FileSystemAgent.Metadata=} metadata
+ */
+ metadataReceived: function(requestId, errorCode, metadata)
+ {
+ this._agentWrapper._metadataReceived(requestId, errorCode, metadata);
}
}
diff --git a/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js b/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js
index 007c4a3a9..40b5e3057 100644
--- a/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js
+++ b/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js
@@ -379,6 +379,7 @@ WebInspector.HeapSnapshotViewportDataGrid.prototype = {
onResize: function()
{
+ WebInspector.HeapSnapshotSortableDataGrid.prototype.onResize.call(this);
this.updateVisibleNodes();
},
diff --git a/Source/WebCore/inspector/front-end/HeapSnapshotGridNodes.js b/Source/WebCore/inspector/front-end/HeapSnapshotGridNodes.js
index 3c3395bf9..f8c8b4a89 100644
--- a/Source/WebCore/inspector/front-end/HeapSnapshotGridNodes.js
+++ b/Source/WebCore/inspector/front-end/HeapSnapshotGridNodes.js
@@ -91,7 +91,7 @@ WebInspector.HeapSnapshotGridNode.prototype = {
node.dispose();
},
- hasHoverMessage: false,
+ _reachableFromWindow: false,
queryObjectContent: function(callback)
{
@@ -356,12 +356,12 @@ WebInspector.HeapSnapshotGenericObjectNode = function(tree, node)
this.snapshotNodeId = node.id;
this.snapshotNodeIndex = node.nodeIndex;
if (this._type === "string")
- this.hasHoverMessage = true;
+ this._reachableFromWindow = true;
else if (this._type === "object" && this.isWindow(this._name)) {
this._name = this.shortenWindowURL(this._name, false);
- this.hasHoverMessage = true;
+ this._reachableFromWindow = true;
} else if (node.flags & tree.snapshot.nodeFlags.canBeQueried)
- this.hasHoverMessage = true;
+ this._reachableFromWindow = true;
if (node.flags & tree.snapshot.nodeFlags.detachedDOMTreeNode)
this.detachedDOMTreeNode = true;
};
@@ -435,7 +435,7 @@ WebInspector.HeapSnapshotGenericObjectNode.prototype = {
value += "[]";
break;
};
- if (this.hasHoverMessage)
+ if (this._reachableFromWindow)
valueStyle += " highlight";
if (value === "Object")
value = "";
diff --git a/Source/WebCore/inspector/front-end/HeapSnapshotView.js b/Source/WebCore/inspector/front-end/HeapSnapshotView.js
index 9a8dd08ed..5a2fe54fb 100644
--- a/Source/WebCore/inspector/front-end/HeapSnapshotView.js
+++ b/Source/WebCore/inspector/front-end/HeapSnapshotView.js
@@ -562,10 +562,7 @@ WebInspector.HeapSnapshotView.prototype = {
var row = target.enclosingNodeOrSelfWithNodeName("tr");
if (!row)
return;
- var gridNode = row._dataGridNode;
- if (!gridNode.hasHoverMessage)
- return;
- span.node = gridNode;
+ span.node = row._dataGridNode;
return span;
},
diff --git a/Source/WebCore/inspector/front-end/StylesSidebarPane.js b/Source/WebCore/inspector/front-end/StylesSidebarPane.js
index c9d4b9c21..ef091cdac 100644
--- a/Source/WebCore/inspector/front-end/StylesSidebarPane.js
+++ b/Source/WebCore/inspector/front-end/StylesSidebarPane.js
@@ -1693,7 +1693,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
enabledCheckboxElement.className = "enabled-button";
enabledCheckboxElement.type = "checkbox";
enabledCheckboxElement.checked = !this.disabled;
- enabledCheckboxElement.addEventListener("change", this.toggleEnabled.bind(this), false);
+ enabledCheckboxElement.addEventListener("click", this.toggleEnabled.bind(this), false);
}
var nameElement = document.createElement("span");
@@ -1986,6 +1986,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
this._parentPane._userOperation = true;
this.property.setDisabled(disabled, callback.bind(this));
+ event.consume();
},
updateState: function()
diff --git a/Source/WebCore/inspector/front-end/elementsPanel.css b/Source/WebCore/inspector/front-end/elementsPanel.css
index b4dcfb2cc..6b7455b73 100644
--- a/Source/WebCore/inspector/front-end/elementsPanel.css
+++ b/Source/WebCore/inspector/front-end/elementsPanel.css
@@ -352,7 +352,7 @@
}
.styles-section .properties > li.child-editing .webkit-css-property {
- margin-left: -8px;
+ margin-left: 0;
}
.styles-section.matched-styles .properties li {
@@ -362,6 +362,7 @@
.styles-section .properties li.child-editing {
word-wrap: break-word !important;
white-space: normal !important;
+ padding-left: 0;
}
.styles-section .properties ol {
diff --git a/Source/WebCore/loader/archive/Archive.cpp b/Source/WebCore/loader/archive/Archive.cpp
index 8f45fbd49..ea76a114d 100644
--- a/Source/WebCore/loader/archive/Archive.cpp
+++ b/Source/WebCore/loader/archive/Archive.cpp
@@ -35,4 +35,21 @@ Archive::~Archive()
{
}
+void Archive::clearAllSubframeArchives()
+{
+ Vector<RefPtr<Archive> > clearedArchives;
+ clearAllSubframeArchivesImpl(&clearedArchives);
+}
+
+void Archive::clearAllSubframeArchivesImpl(Vector<RefPtr<Archive> >* clearedArchives)
+{
+ for (Vector<RefPtr<Archive> >::iterator it = m_subframeArchives.begin(); it != m_subframeArchives.end(); ++it) {
+ if (!clearedArchives->contains(*it)) {
+ clearedArchives->append(*it);
+ (*it)->clearAllSubframeArchivesImpl(clearedArchives);
+ }
+ }
+ m_subframeArchives.clear();
+}
+
}
diff --git a/Source/WebCore/loader/archive/Archive.h b/Source/WebCore/loader/archive/Archive.h
index d41c60872..b7656e579 100644
--- a/Source/WebCore/loader/archive/Archive.h
+++ b/Source/WebCore/loader/archive/Archive.h
@@ -56,8 +56,12 @@ protected:
void setMainResource(PassRefPtr<ArchiveResource> mainResource) { m_mainResource = mainResource; }
void addSubresource(PassRefPtr<ArchiveResource> subResource) { m_subresources.append(subResource); }
void addSubframeArchive(PassRefPtr<Archive> subframeArchive) { m_subframeArchives.append(subframeArchive); }
-
+
+ void clearAllSubframeArchives();
+
private:
+ void clearAllSubframeArchivesImpl(Vector<RefPtr<Archive> >* clearedArchives);
+
RefPtr<ArchiveResource> m_mainResource;
Vector<RefPtr<ArchiveResource> > m_subresources;
Vector<RefPtr<Archive> > m_subframeArchives;
diff --git a/Source/WebCore/loader/archive/mhtml/MHTMLArchive.cpp b/Source/WebCore/loader/archive/mhtml/MHTMLArchive.cpp
index b996f2d4b..cb9c7e570 100644
--- a/Source/WebCore/loader/archive/mhtml/MHTMLArchive.cpp
+++ b/Source/WebCore/loader/archive/mhtml/MHTMLArchive.cpp
@@ -96,6 +96,12 @@ MHTMLArchive::MHTMLArchive()
{
}
+MHTMLArchive::~MHTMLArchive()
+{
+ // Because all frames know about each other we need to perform a deep clearing of the archives graph.
+ clearAllSubframeArchives();
+}
+
PassRefPtr<MHTMLArchive> MHTMLArchive::create()
{
return adoptRef(new MHTMLArchive);
@@ -115,7 +121,7 @@ PassRefPtr<MHTMLArchive> MHTMLArchive::create(const KURL& url, SharedBuffer* dat
// Since MHTML is a flat format, we need to make all frames aware of all resources.
for (size_t i = 0; i < parser.frameCount(); ++i) {
RefPtr<MHTMLArchive> archive = parser.frameAt(i);
- for (size_t j = 0; j < parser.frameCount(); ++j) {
+ for (size_t j = 1; j < parser.frameCount(); ++j) {
if (i != j)
archive->addSubframeArchive(parser.frameAt(j));
}
diff --git a/Source/WebCore/loader/archive/mhtml/MHTMLArchive.h b/Source/WebCore/loader/archive/mhtml/MHTMLArchive.h
index 037153666..dd14d99c4 100644
--- a/Source/WebCore/loader/archive/mhtml/MHTMLArchive.h
+++ b/Source/WebCore/loader/archive/mhtml/MHTMLArchive.h
@@ -52,6 +52,8 @@ public:
// Binary encoding results in smaller MHTML files but they might not work in other browsers.
static PassRefPtr<SharedBuffer> generateMHTMLDataUsingBinaryEncoding(Page*);
+ virtual ~MHTMLArchive();
+
private:
static PassRefPtr<SharedBuffer> generateMHTMLData(Page*, bool useBinaryEncoding);
diff --git a/Source/WebCore/loader/cache/CachedResource.cpp b/Source/WebCore/loader/cache/CachedResource.cpp
index cd5bd2336..3998efd32 100755
--- a/Source/WebCore/loader/cache/CachedResource.cpp
+++ b/Source/WebCore/loader/cache/CachedResource.cpp
@@ -56,20 +56,21 @@ static ResourceLoadPriority defaultPriorityForResourceType(CachedResource::Type
{
switch (type) {
case CachedResource::CSSStyleSheet:
-#if ENABLE(XSLT)
- case CachedResource::XSLStyleSheet:
-#endif
return ResourceLoadPriorityHigh;
case CachedResource::Script:
-#if ENABLE(SVG)
- case CachedResource::SVGDocumentResource:
- return ResourceLoadPriorityLow;
-#endif
case CachedResource::FontResource:
case CachedResource::RawResource:
return ResourceLoadPriorityMedium;
case CachedResource::ImageResource:
return ResourceLoadPriorityLow;
+#if ENABLE(XSLT)
+ case CachedResource::XSLStyleSheet:
+ return ResourceLoadPriorityHigh;
+#endif
+#if ENABLE(SVG)
+ case CachedResource::SVGDocumentResource:
+ return ResourceLoadPriorityLow;
+#endif
#if ENABLE(LINK_PREFETCH)
case CachedResource::LinkPrefetch:
return ResourceLoadPriorityVeryLow;
diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp
index 7e0c8fbfa..90060476c 100644
--- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp
+++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp
@@ -267,6 +267,7 @@ bool CachedResourceLoader::checkInsecureContent(CachedResource::Type type, const
#if ENABLE(CSS_SHADERS)
case CachedResource::ShaderResource:
#endif
+ case CachedResource::RawResource:
case CachedResource::ImageResource:
case CachedResource::FontResource: {
// These resources can corrupt only the frame's pixels.
@@ -277,7 +278,6 @@ bool CachedResourceLoader::checkInsecureContent(CachedResource::Type type, const
}
break;
}
- case CachedResource::RawResource:
#if ENABLE(LINK_PREFETCH)
case CachedResource::LinkPrefetch:
case CachedResource::LinkSubresource:
diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp
index 82f3300da..367ab0443 100644
--- a/Source/WebCore/page/EventHandler.cpp
+++ b/Source/WebCore/page/EventHandler.cpp
@@ -1484,6 +1484,11 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
{
RefPtr<FrameView> protector(m_frame->view());
+ if (InspectorInstrumentation::handleMousePress(m_frame->page())) {
+ invalidateClick();
+ return true;
+ }
+
#if ENABLE(TOUCH_EVENTS)
bool defaultPrevented = dispatchSyntheticTouchEventIfEnabled(mouseEvent);
if (defaultPrevented)
@@ -1527,11 +1532,6 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
m_mousePressNode = targetNode(mev);
- if (InspectorInstrumentation::handleMousePress(m_frame->page())) {
- invalidateClick();
- return true;
- }
-
Frame* subframe = subframeForHitTestResult(mev);
if (subframe && passMousePressEventToSubframe(mev, subframe)) {
// Start capturing future events for this frame. We only do this if we didn't clear
@@ -2483,11 +2483,19 @@ bool EventHandler::bestClickableNodeForTouchPoint(const IntPoint& touchCenter, c
{
HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active;
IntPoint hitTestPoint = m_frame->view()->windowToContents(touchCenter);
- HitTestResult result = hitTestResultAtPoint(hitTestPoint, /*allowShadowContent*/ false, /*ignoreClipping*/ false, DontHitTestScrollbars, hitType, touchRadius);
+ HitTestResult result = hitTestResultAtPoint(hitTestPoint, /*allowShadowContent*/ true, /*ignoreClipping*/ false, DontHitTestScrollbars, hitType, touchRadius);
IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius);
RefPtr<StaticHashSetNodeList> nodeList = StaticHashSetNodeList::adopt(result.rectBasedTestResult());
- return findBestClickableCandidate(targetNode, targetPoint, touchCenter, touchRect, *nodeList.get());
+
+ // FIXME: Should be able to handle targetNode being a shadow DOM node to avoid performing uncessary hit tests
+ // in the case where further processing on the node is required. Returning the shadow ancestor prevents a
+ // regression in touchadjustment/html-label.html. Some refinement is required to testing/internals to
+ // handle targetNode being a shadow DOM node.
+ bool success = findBestClickableCandidate(targetNode, targetPoint, touchCenter, touchRect, *nodeList.get());
+ if (success && targetNode)
+ targetNode = targetNode->shadowAncestorNode();
+ return success;
}
bool EventHandler::bestZoomableAreaForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntRect& targetArea, Node*& targetNode)
diff --git a/Source/WebCore/page/EventSource.cpp b/Source/WebCore/page/EventSource.cpp
index 2a4db03fa..03f78e988 100644
--- a/Source/WebCore/page/EventSource.cpp
+++ b/Source/WebCore/page/EventSource.cpp
@@ -315,6 +315,11 @@ void EventSource::parseEventStream()
parseEventStreamLine(bufPos, fieldLength, lineLength);
bufPos += lineLength + 1;
+
+ // EventSource.close() might've been called by one of the message event handlers.
+ // Per spec, no further messages should be fired after that.
+ if (m_state == CLOSED)
+ break;
}
if (bufPos == bufSize)
diff --git a/Source/WebCore/page/Performance.h b/Source/WebCore/page/Performance.h
index deae0aec0..8ba8c5eea 100644
--- a/Source/WebCore/page/Performance.h
+++ b/Source/WebCore/page/Performance.h
@@ -90,7 +90,6 @@ private:
virtual EventTargetData* ensureEventTargetData();
EventTargetData m_eventTargetData;
- ScriptExecutionContext *m_scriptExecutionContext;
mutable RefPtr<PerformanceNavigation> m_navigation;
mutable RefPtr<PerformanceTiming> m_timing;
diff --git a/Source/WebCore/page/Settings.h b/Source/WebCore/page/Settings.h
index 158d240ab..a464cc86e 100644
--- a/Source/WebCore/page/Settings.h
+++ b/Source/WebCore/page/Settings.h
@@ -21,7 +21,7 @@
* 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 Settings_h
@@ -333,7 +333,7 @@ namespace WebCore {
#if ENABLE(CSS_VARIABLES)
void setCSSVariablesEnabled(bool enabled) { m_cssVariablesEnabled = enabled; }
- bool cssVariablesEnabled() const { return true; }
+ bool cssVariablesEnabled() const { return m_cssVariablesEnabled; }
#else
void setCSSVariablesEnabled(bool) { }
bool cssVariablesEnabled() const { return false; }
diff --git a/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp b/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp
index 0c3b0c329..7cfb86c0f 100644
--- a/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp
+++ b/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp
@@ -36,6 +36,10 @@
#include "ScrollbarLayerChromium.h"
#include "ScrollbarTheme.h"
#include "cc/CCProxy.h"
+#include <public/WebScrollableLayer.h>
+
+using WebKit::WebLayer;
+using WebKit::WebScrollableLayer;
namespace WebCore {
@@ -45,33 +49,34 @@ public:
ScrollingCoordinatorPrivate() { }
~ScrollingCoordinatorPrivate() { }
- void setScrollLayer(LayerChromium* layer)
+ void setScrollLayer(WebScrollableLayer layer)
{
m_scrollLayer = layer;
- int id = layer ? layer->id() : 0;
- if (m_horizontalScrollbarLayer)
- m_horizontalScrollbarLayer->setScrollLayerId(id);
- if (m_verticalScrollbarLayer)
- m_verticalScrollbarLayer->setScrollLayerId(id);
+ int id = layer.isNull() ? 0 : layer.unwrap<LayerChromium>()->id();
+ if (!m_horizontalScrollbarLayer.isNull())
+ m_horizontalScrollbarLayer.unwrap<ScrollbarLayerChromium>()->setScrollLayerId(id);
+ if (!m_verticalScrollbarLayer.isNull())
+ m_verticalScrollbarLayer.unwrap<ScrollbarLayerChromium>()->setScrollLayerId(id);
}
- void setHorizontalScrollbarLayer(PassRefPtr<ScrollbarLayerChromium> layer)
+ void setHorizontalScrollbarLayer(WebLayer layer)
{
m_horizontalScrollbarLayer = layer;
}
- void setVerticalScrollbarLayer(PassRefPtr<ScrollbarLayerChromium> layer)
+ void setVerticalScrollbarLayer(WebLayer layer)
{
m_verticalScrollbarLayer = layer;
}
- LayerChromium* scrollLayer() const { return m_scrollLayer.get(); }
+ bool hasScrollLayer() const { return !m_scrollLayer.isNull(); }
+ WebScrollableLayer scrollLayer() const { return m_scrollLayer; }
private:
- RefPtr<LayerChromium> m_scrollLayer;
- RefPtr<ScrollbarLayerChromium> m_horizontalScrollbarLayer;
- RefPtr<ScrollbarLayerChromium> m_verticalScrollbarLayer;
+ WebScrollableLayer m_scrollLayer;
+ WebLayer m_horizontalScrollbarLayer;
+ WebLayer m_verticalScrollbarLayer;
};
PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
@@ -103,15 +108,15 @@ static GraphicsLayer* scrollLayerForFrameView(FrameView* frameView)
#endif
}
-static PassRefPtr<ScrollbarLayerChromium> createScrollbarLayer(Scrollbar* scrollbar, LayerChromium* scrollLayer, GraphicsLayer* scrollbarGraphicsLayer, FrameView* frameView)
+static WebLayer createScrollbarLayer(Scrollbar* scrollbar, WebScrollableLayer scrollLayer, GraphicsLayer* scrollbarGraphicsLayer, FrameView* frameView)
{
ASSERT(scrollbar);
ASSERT(scrollbarGraphicsLayer);
- if (!scrollLayer) {
+ if (scrollLayer.isNull()) {
// FIXME: sometimes we get called before setScrollLayer, workaround by finding the scroll layout ourselves.
- scrollLayer = scrollLayerForFrameView(frameView)->platformLayer();
- ASSERT(scrollLayer);
+ scrollLayer = WebScrollableLayer(scrollLayerForFrameView(frameView)->platformLayer());
+ ASSERT(!scrollLayer.isNull());
}
// Root layer non-overlay scrollbars should be marked opaque to disable
@@ -129,15 +134,15 @@ static PassRefPtr<ScrollbarLayerChromium> createScrollbarLayer(Scrollbar* scroll
if (!platformSupported || scrollbar->isOverlayScrollbar()) {
scrollbarGraphicsLayer->setContentsToMedia(0);
scrollbarGraphicsLayer->setDrawsContent(true);
- return 0;
+ return WebLayer();
}
- RefPtr<ScrollbarLayerChromium> scrollbarLayer = ScrollbarLayerChromium::create(scrollbar, scrollLayer->id());
+ RefPtr<ScrollbarLayerChromium> scrollbarLayer = ScrollbarLayerChromium::create(scrollbar, scrollLayer.unwrap<LayerChromium>()->id());
scrollbarGraphicsLayer->setContentsToMedia(scrollbarLayer.get());
scrollbarGraphicsLayer->setDrawsContent(false);
scrollbarLayer->setOpaque(scrollbarGraphicsLayer->contentsOpaque());
- return scrollbarLayer.release();
+ return WebLayer(scrollbarLayer.release());
}
void ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange(FrameView* frameView, GraphicsLayer* horizontalScrollbarLayer)
@@ -158,13 +163,13 @@ void ScrollingCoordinator::frameViewVerticalScrollbarLayerDidChange(FrameView* f
void ScrollingCoordinator::setScrollLayer(GraphicsLayer* scrollLayer)
{
- m_private->setScrollLayer(scrollLayer ? scrollLayer->platformLayer() : 0);
+ m_private->setScrollLayer(WebScrollableLayer(scrollLayer ? scrollLayer->platformLayer() : 0));
}
void ScrollingCoordinator::setNonFastScrollableRegion(const Region& region)
{
- if (LayerChromium* layer = m_private->scrollLayer())
- layer->setNonFastScrollableRegion(region);
+ if (m_private->hasScrollLayer())
+ m_private->scrollLayer().unwrap<LayerChromium>()->setNonFastScrollableRegion(region);
}
void ScrollingCoordinator::setScrollParameters(const ScrollParameters&)
@@ -174,14 +179,14 @@ void ScrollingCoordinator::setScrollParameters(const ScrollParameters&)
void ScrollingCoordinator::setWheelEventHandlerCount(unsigned wheelEventHandlerCount)
{
- if (LayerChromium* layer = m_private->scrollLayer())
- layer->setHaveWheelEventHandlers(wheelEventHandlerCount > 0);
+ if (m_private->hasScrollLayer())
+ m_private->scrollLayer().setHaveWheelEventHandlers(wheelEventHandlerCount > 0);
}
void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(bool should)
{
- if (LayerChromium* layer = m_private->scrollLayer())
- layer->setShouldScrollOnMainThread(should);
+ if (m_private->hasScrollLayer())
+ m_private->scrollLayer().setShouldScrollOnMainThread(should);
}
bool ScrollingCoordinator::supportsFixedPositionLayers() const
diff --git a/Source/WebCore/platform/PlatformExportMacros.h b/Source/WebCore/platform/PlatformExportMacros.h
index ae3e30a3a..6c70813ad 100644
--- a/Source/WebCore/platform/PlatformExportMacros.h
+++ b/Source/WebCore/platform/PlatformExportMacros.h
@@ -35,8 +35,7 @@
// See note in wtf/Platform.h for more info on EXPORT_MACROS.
#if USE(EXPORT_MACROS)
-#if defined(BUILDING_WebCore) || defined(BUILDING_WebKit) || \
- defined(STATICALLY_LINKED_WITH_WebCore) || defined(STATICALLY_LINKED_WITH_WebKit)
+#if defined(BUILDING_WebCore) || defined(BUILDING_WebKit)
#define WEBKIT_EXPORTDATA WTF_EXPORT
#else
#define WEBKIT_EXPORTDATA WTF_IMPORT
@@ -46,8 +45,7 @@
#if !PLATFORM(CHROMIUM) && OS(WINDOWS) && !defined(BUILDING_WX__) && !COMPILER(GCC)
-#if defined(BUILDING_WebCore) || defined(BUILDING_WebKit) || \
- defined(STATICALLY_LINKED_WITH_WebCore) || defined(STATICALLY_LINKED_WITH_WebKit)
+#if defined(BUILDING_WebCore) || defined(BUILDING_WebKit)
#define WEBKIT_EXPORTDATA __declspec(dllexport)
#else
#define WEBKIT_EXPORTDATA __declspec(dllimport)
diff --git a/Source/WebCore/platform/chromium/support/Extensions3DChromium.cpp b/Source/WebCore/platform/chromium/support/Extensions3DChromium.cpp
index 5cdd4ba6b..75a7689e3 100644
--- a/Source/WebCore/platform/chromium/support/Extensions3DChromium.cpp
+++ b/Source/WebCore/platform/chromium/support/Extensions3DChromium.cpp
@@ -73,11 +73,6 @@ void Extensions3DChromium::renderbufferStorageMultisample(unsigned long target,
m_private->webContext()->renderbufferStorageMultisampleCHROMIUM(target, samples, internalformat, width, height);
}
-void Extensions3DChromium::postSubBufferCHROMIUM(int x, int y, int width, int height)
-{
- m_private->webContext()->postSubBufferCHROMIUM(x, y, width, height);
-}
-
void* Extensions3DChromium::mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access)
{
return m_private->webContext()->mapBufferSubDataCHROMIUM(target, offset, size, access);
@@ -98,26 +93,6 @@ void Extensions3DChromium::unmapTexSubImage2DCHROMIUM(const void* data)
m_private->webContext()->unmapTexSubImage2DCHROMIUM(data);
}
-void Extensions3DChromium::setVisibilityCHROMIUM(bool visibility)
-{
- m_private->webContext()->setVisibilityCHROMIUM(visibility);
-}
-
-void Extensions3DChromium::discardFramebufferEXT(GC3Denum target, GC3Dsizei numAttachments, const GC3Denum* attachments)
-{
- m_private->webContext()->discardFramebufferEXT(target, numAttachments, attachments);
-}
-
-void Extensions3DChromium::ensureFramebufferCHROMIUM()
-{
- m_private->webContext()->ensureFramebufferCHROMIUM();
-}
-
-void Extensions3DChromium::setGpuMemoryAllocationChangedCallbackCHROMIUM(PassOwnPtr<GpuMemoryAllocationChangedCallbackCHROMIUM> callback)
-{
- m_private->setGpuMemoryAllocationChangedCallbackCHROMIUM(callback);
-}
-
Platform3DObject Extensions3DChromium::createVertexArrayOES()
{
return 0;
@@ -141,11 +116,6 @@ String Extensions3DChromium::getTranslatedShaderSourceANGLE(Platform3DObject sha
return m_private->webContext()->getTranslatedShaderSourceANGLE(shader);
}
-void Extensions3DChromium::setSwapBuffersCompleteCallbackCHROMIUM(PassOwnPtr<SwapBuffersCompleteCallbackCHROMIUM> callback)
-{
- m_private->setSwapBuffersCompleteCallbackCHROMIUM(callback);
-}
-
void Extensions3DChromium::rateLimitOffscreenContextCHROMIUM()
{
m_private->webContext()->rateLimitOffscreenContextCHROMIUM();
diff --git a/Source/WebCore/platform/chromium/support/GraphicsContext3DChromium.cpp b/Source/WebCore/platform/chromium/support/GraphicsContext3DChromium.cpp
index d020acc38..127fcfa09 100644
--- a/Source/WebCore/platform/chromium/support/GraphicsContext3DChromium.cpp
+++ b/Source/WebCore/platform/chromium/support/GraphicsContext3DChromium.cpp
@@ -51,8 +51,6 @@ GraphicsContext3D::~GraphicsContext3D()
{
m_private->setContextLostCallback(nullptr);
m_private->setErrorMessageCallback(nullptr);
- m_private->setSwapBuffersCompleteCallbackCHROMIUM(nullptr);
- m_private->setGpuMemoryAllocationChangedCallbackCHROMIUM(nullptr);
}
void GraphicsContext3D::setContextLostCallback(PassOwnPtr<GraphicsContext3D::ContextLostCallback> callback)
@@ -83,7 +81,7 @@ PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attri
if (!webContext)
return 0;
- return GraphicsContext3DPrivate::createGraphicsContextFromWebContext(webContext.release(), renderStyle, attrs.preserveDrawingBuffer);
+ return GraphicsContext3DPrivate::createGraphicsContextFromWebContext(webContext.release(), attrs.preserveDrawingBuffer);
}
PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D() const
diff --git a/Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.cpp b/Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.cpp
index 1cf6f5cd5..f6b730ddf 100644
--- a/Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.cpp
+++ b/Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.cpp
@@ -38,6 +38,7 @@
#include "GrGLInterface.h"
#include "ImageBuffer.h"
#include <public/WebGraphicsContext3D.h>
+#include <public/WebGraphicsMemoryAllocation.h>
#include <wtf/text/CString.h>
#include <wtf/text/StringHash.h>
@@ -68,16 +69,15 @@ GraphicsContext3DPrivate::GraphicsContext3DPrivate(PassOwnPtr<WebKit::WebGraphic
GraphicsContext3DPrivate::~GraphicsContext3DPrivate()
{
if (m_grContext) {
+ m_impl->setMemoryAllocationChangedCallbackCHROMIUM(0);
m_grContext->contextDestroyed();
GrSafeUnref(m_grContext);
}
}
-PassRefPtr<GraphicsContext3D> GraphicsContext3DPrivate::createGraphicsContextFromWebContext(PassOwnPtr<WebKit::WebGraphicsContext3D> webContext, GraphicsContext3D::RenderStyle renderStyle, bool preserveDrawingBuffer)
+PassRefPtr<GraphicsContext3D> GraphicsContext3DPrivate::createGraphicsContextFromWebContext(PassOwnPtr<WebKit::WebGraphicsContext3D> webContext, bool preserveDrawingBuffer)
{
- bool renderDirectlyToHostWindow = renderStyle == GraphicsContext3D::RenderDirectlyToHostWindow;
-
- RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(GraphicsContext3D::Attributes(), 0, renderDirectlyToHostWindow));
+ RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(GraphicsContext3D::Attributes(), 0, false /* onscreen */));
OwnPtr<GraphicsContext3DPrivate> priv = adoptPtr(new GraphicsContext3DPrivate(webContext, preserveDrawingBuffer));
context->m_private = priv.release();
@@ -91,28 +91,27 @@ WebKit::WebGraphicsContext3D* GraphicsContext3DPrivate::extractWebGraphicsContex
return context->m_private->webContext();
}
-class GrMemoryAllocationChangedCallback : public Extensions3DChromium::GpuMemoryAllocationChangedCallbackCHROMIUM {
+class GrMemoryAllocationChangedCallbackAdapter : public WebKit::WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM {
public:
- GrMemoryAllocationChangedCallback(GraphicsContext3DPrivate* context)
+ GrMemoryAllocationChangedCallbackAdapter(GrContext* context)
: m_context(context)
{
}
- virtual void onGpuMemoryAllocationChanged(Extensions3DChromium::GpuMemoryAllocationCHROMIUM allocation)
+ virtual void onMemoryAllocationChanged(WebKit::WebGraphicsMemoryAllocation allocation) OVERRIDE
{
- GrContext* context = m_context->grContext();
- if (!context)
+ if (!m_context)
return;
if (!allocation.gpuResourceSizeInBytes) {
- context->freeGpuResources();
- context->setTextureCacheLimits(0, 0);
+ m_context->freeGpuResources();
+ m_context->setTextureCacheLimits(0, 0);
} else
- context->setTextureCacheLimits(maxGaneshTextureCacheCount, maxGaneshTextureCacheBytes);
+ m_context->setTextureCacheLimits(maxGaneshTextureCacheCount, maxGaneshTextureCacheBytes);
}
private:
- GraphicsContext3DPrivate* m_context;
+ GrContext* m_context;
};
GrContext* GraphicsContext3DPrivate::grContext()
@@ -122,9 +121,8 @@ GrContext* GraphicsContext3DPrivate::grContext()
m_grContext = GrContext::Create(kOpenGL_Shaders_GrEngine, reinterpret_cast<GrPlatform3DContext>(interface.get()));
if (m_grContext) {
m_grContext->setTextureCacheLimits(maxGaneshTextureCacheCount, maxGaneshTextureCacheBytes);
- Extensions3DChromium* extensions3DChromium = static_cast<Extensions3DChromium*>(getExtensions());
- if (extensions3DChromium->supports("GL_CHROMIUM_gpu_memory_manager"))
- extensions3DChromium->setGpuMemoryAllocationChangedCallbackCHROMIUM(adoptPtr(new GrMemoryAllocationChangedCallback(this)));
+ m_grContextMemoryAllocationCallbackAdapter = adoptPtr(new GrMemoryAllocationChangedCallbackAdapter(m_grContext));
+ m_impl->setMemoryAllocationChangedCallbackCHROMIUM(m_grContextMemoryAllocationCallbackAdapter.get());
}
}
return m_grContext;
@@ -325,55 +323,4 @@ bool GraphicsContext3DPrivate::isResourceSafe()
return m_resourceSafety == ResourceSafe;
}
-class GraphicsContext3DMemoryAllocationChangedCallbackAdapter : public WebKit::WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM {
-public:
- GraphicsContext3DMemoryAllocationChangedCallbackAdapter(PassOwnPtr<Extensions3DChromium::GpuMemoryAllocationChangedCallbackCHROMIUM> callback)
- : m_memoryAllocationChangedCallback(callback) { }
-
- virtual ~GraphicsContext3DMemoryAllocationChangedCallbackAdapter() { }
-
- virtual void onMemoryAllocationChanged(size_t gpuResourceSizeInBytes)
- {
- // FIXME: Remove this once clients start using WebGraphicsMemoryAllocation exclusively.
- onMemoryAllocationChanged(WebKit::WebGraphicsMemoryAllocation(gpuResourceSizeInBytes, true));
- }
-
- virtual void onMemoryAllocationChanged(WebKit::WebGraphicsMemoryAllocation allocation)
- {
- if (m_memoryAllocationChangedCallback)
- m_memoryAllocationChangedCallback->onGpuMemoryAllocationChanged(Extensions3DChromium::GpuMemoryAllocationCHROMIUM(allocation.gpuResourceSizeInBytes, allocation.suggestHaveBackbuffer));
- }
-
-private:
- OwnPtr<Extensions3DChromium::GpuMemoryAllocationChangedCallbackCHROMIUM> m_memoryAllocationChangedCallback;
-};
-
-void GraphicsContext3DPrivate::setGpuMemoryAllocationChangedCallbackCHROMIUM(PassOwnPtr<Extensions3DChromium::GpuMemoryAllocationChangedCallbackCHROMIUM> callback)
-{
- m_memoryAllocationChangedCallbackAdapter = adoptPtr(new GraphicsContext3DMemoryAllocationChangedCallbackAdapter(callback));
- m_impl->setMemoryAllocationChangedCallbackCHROMIUM(m_memoryAllocationChangedCallbackAdapter.get());
-}
-
-class GraphicsContext3DSwapBuffersCompleteCallbackAdapter : public WebKit::WebGraphicsContext3D::WebGraphicsSwapBuffersCompleteCallbackCHROMIUM {
-public:
- GraphicsContext3DSwapBuffersCompleteCallbackAdapter(PassOwnPtr<Extensions3DChromium::SwapBuffersCompleteCallbackCHROMIUM> callback)
- : m_swapBuffersCompleteCallback(callback) { }
- virtual ~GraphicsContext3DSwapBuffersCompleteCallbackAdapter() { }
-
- virtual void onSwapBuffersComplete()
- {
- if (m_swapBuffersCompleteCallback)
- m_swapBuffersCompleteCallback->onSwapBuffersComplete();
- }
-
-private:
- OwnPtr<Extensions3DChromium::SwapBuffersCompleteCallbackCHROMIUM> m_swapBuffersCompleteCallback;
-};
-
-void GraphicsContext3DPrivate::setSwapBuffersCompleteCallbackCHROMIUM(PassOwnPtr<Extensions3DChromium::SwapBuffersCompleteCallbackCHROMIUM> callback)
-{
- m_swapBuffersCompleteCallbackAdapter = adoptPtr(new GraphicsContext3DSwapBuffersCompleteCallbackAdapter(callback));
- m_impl->setSwapBuffersCompleteCallbackCHROMIUM(m_swapBuffersCompleteCallbackAdapter.get());
-}
-
} // namespace WebCore
diff --git a/Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.h b/Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.h
index 42fa7092f..5bbb85a22 100644
--- a/Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.h
+++ b/Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.h
@@ -45,15 +45,14 @@ class DrawingBuffer;
class Extensions3DChromium;
class GraphicsContext3DContextLostCallbackAdapter;
class GraphicsContext3DErrorMessageCallbackAdapter;
-class GraphicsContext3DMemoryAllocationChangedCallbackAdapter;
-class GraphicsContext3DSwapBuffersCompleteCallbackAdapter;
+class GrMemoryAllocationChangedCallbackAdapter;
class GraphicsContext3DPrivate {
public:
// Callers must make the context current before using it AND check that the context was created successfully
// via ContextLost before using the context in any way. Once made current on a thread, the context cannot
// be used on any other thread.
- static PassRefPtr<GraphicsContext3D> createGraphicsContextFromWebContext(PassOwnPtr<WebKit::WebGraphicsContext3D>, GraphicsContext3D::RenderStyle, bool preserveDrawingBuffer = false);
+ static PassRefPtr<GraphicsContext3D> createGraphicsContextFromWebContext(PassOwnPtr<WebKit::WebGraphicsContext3D>, bool preserveDrawingBuffer = false);
// Helper function to provide access to the lower-level WebGraphicsContext3D,
// which is needed for subordinate contexts like WebGL's to share resources
@@ -83,12 +82,6 @@ public:
bool isResourceSafe();
- // GL_CHROMIUM_gpu_memory_manager
- void setGpuMemoryAllocationChangedCallbackCHROMIUM(PassOwnPtr<Extensions3DChromium::GpuMemoryAllocationChangedCallbackCHROMIUM>);
-
- // GL_CHROMIUM_swapbuffers_complete_callback
- void setSwapBuffersCompleteCallbackCHROMIUM(PassOwnPtr<Extensions3DChromium::SwapBuffersCompleteCallbackCHROMIUM>);
-
bool preserveDrawingBuffer() const { return m_preserveDrawingBuffer; }
private:
@@ -100,8 +93,7 @@ private:
OwnPtr<Extensions3DChromium> m_extensions;
OwnPtr<GraphicsContext3DContextLostCallbackAdapter> m_contextLostCallbackAdapter;
OwnPtr<GraphicsContext3DErrorMessageCallbackAdapter> m_errorMessageCallbackAdapter;
- OwnPtr<GraphicsContext3DMemoryAllocationChangedCallbackAdapter> m_memoryAllocationChangedCallbackAdapter;
- OwnPtr<GraphicsContext3DSwapBuffersCompleteCallbackAdapter> m_swapBuffersCompleteCallbackAdapter;
+ OwnPtr<GrMemoryAllocationChangedCallbackAdapter> m_grContextMemoryAllocationCallbackAdapter;
bool m_initializedAvailableExtensions;
HashSet<String> m_enabledExtensions;
HashSet<String> m_requestableExtensions;
diff --git a/Source/WebCore/platform/efl/EflScreenUtilities.cpp b/Source/WebCore/platform/efl/EflScreenUtilities.cpp
index e4a727797..e7cd1e46d 100644
--- a/Source/WebCore/platform/efl/EflScreenUtilities.cpp
+++ b/Source/WebCore/platform/efl/EflScreenUtilities.cpp
@@ -127,6 +127,23 @@ int getDPI()
#endif
}
+int getPixelDepth(const Evas* evas)
+{
+#ifdef HAVE_ECORE_X
+ Ecore_Evas* ecoreEvas = ecore_evas_ecore_evas_get(evas);
+ // FIXME: ecore_evas_software_x11_window_get() can't get Ecore_X_Window during the layout test.
+ // Because, EFL DumpRenderTree doesn't use X11 window by default.
+ // See also, http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/efl/DumpRenderTree.cpp#L69
+ Ecore_X_Window window = ecore_evas_software_x11_window_get(ecoreEvas);
+ if (!window)
+ return 8;
+
+ return ecore_x_window_depth_get(window);
+#else
+ return 8;
+#endif
+}
+
bool isUsingEcoreX(const Evas* evas)
{
#ifdef HAVE_ECORE_X
diff --git a/Source/WebCore/platform/efl/EflScreenUtilities.h b/Source/WebCore/platform/efl/EflScreenUtilities.h
index 6ec60ef02..ebf52b64a 100644
--- a/Source/WebCore/platform/efl/EflScreenUtilities.h
+++ b/Source/WebCore/platform/efl/EflScreenUtilities.h
@@ -27,6 +27,7 @@ namespace WebCore {
void applyFallbackCursor(Ecore_Evas*, const char*);
int getDPI();
+int getPixelDepth(const Evas*);
bool isUsingEcoreX(const Evas*);
} // namespace WebCore
diff --git a/Source/WebCore/platform/efl/FileSystemEfl.cpp b/Source/WebCore/platform/efl/FileSystemEfl.cpp
index d4adb169b..c6bff150a 100644
--- a/Source/WebCore/platform/efl/FileSystemEfl.cpp
+++ b/Source/WebCore/platform/efl/FileSystemEfl.cpp
@@ -86,50 +86,19 @@ String homeDirectoryPath()
Vector<String> listDirectory(const String& path, const String& filter)
{
- Vector<String> entries;
- CString cpath = path.utf8();
+ Vector<String> matchingEntries;
CString cfilter = filter.utf8();
- char filePath[PATH_MAX];
- char* fileName;
- size_t fileNameSpace;
- DIR* dir;
+ const char *f_name;
- if (cpath.length() + NAME_MAX >= sizeof(filePath))
- return entries;
- // loop invariant: directory part + '/'
- memcpy(filePath, cpath.data(), cpath.length());
- fileName = filePath + cpath.length();
- if (cpath.length() > 0 && filePath[cpath.length() - 1] != '/') {
- fileName[0] = '/';
- fileName++;
+ Eina_Iterator* it = eina_file_ls(path.utf8().data());
+ EINA_ITERATOR_FOREACH(it, f_name) {
+ if (!fnmatch(cfilter.data(), f_name, 0))
+ matchingEntries.append(String::fromUTF8(f_name));
+ eina_stringshare_del(f_name);
}
- fileNameSpace = sizeof(filePath) - (fileName - filePath) - 1;
+ eina_iterator_free(it);
- dir = opendir(cpath.data());
- if (!dir)
- return entries;
-
- struct dirent* de;
- while (de = readdir(dir)) {
- size_t nameLen;
- if (de->d_name[0] == '.') {
- if (de->d_name[1] == '\0')
- continue;
- if (de->d_name[1] == '.' && de->d_name[2] == '\0')
- continue;
- }
- if (fnmatch(cfilter.data(), de->d_name, 0))
- continue;
-
- nameLen = strlen(de->d_name);
- if (nameLen >= fileNameSpace)
- continue; // maybe assert? it should never happen anyway...
-
- memcpy(fileName, de->d_name, nameLen + 1);
- entries.append(filePath);
- }
- closedir(dir);
- return entries;
+ return matchingEntries;
}
}
diff --git a/Source/WebCore/platform/efl/PlatformScreenEfl.cpp b/Source/WebCore/platform/efl/PlatformScreenEfl.cpp
index ca655fbc1..5010f1851 100644
--- a/Source/WebCore/platform/efl/PlatformScreenEfl.cpp
+++ b/Source/WebCore/platform/efl/PlatformScreenEfl.cpp
@@ -34,6 +34,7 @@
#include "config.h"
#include "PlatformScreen.h"
+#include "EflScreenUtilities.h"
#include "NotImplemented.h"
#include "PlatformString.h"
#include "Widget.h"
@@ -57,14 +58,19 @@ int screenVerticalDPI(Widget* widget)
int screenDepth(Widget* widget)
{
- notImplemented();
- return 8;
+ if (!widget || !widget->evas())
+ return 0;
+
+ return getPixelDepth(widget->evas());
}
-int screenDepthPerComponent(Widget*)
+int screenDepthPerComponent(Widget* widget)
{
- notImplemented();
- return 8;
+ if (!widget || !widget->evas())
+ return 0;
+
+ // FIXME: How to support this functionality based on EFL library ?
+ return getPixelDepth(widget->evas());
}
bool screenIsMonochrome(Widget*)
diff --git a/Source/WebCore/platform/efl/SharedBufferEfl.cpp b/Source/WebCore/platform/efl/SharedBufferEfl.cpp
index 9e7646d1c..8db44a654 100644
--- a/Source/WebCore/platform/efl/SharedBufferEfl.cpp
+++ b/Source/WebCore/platform/efl/SharedBufferEfl.cpp
@@ -39,32 +39,24 @@ namespace WebCore {
PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String& filePath)
{
- FILE* file;
- struct stat fileStat;
- RefPtr<SharedBuffer> result;
-
if (filePath.isEmpty())
return 0;
- if (!(file = fopen(filePath.utf8().data(), "rb")))
+ FILE* file = fopen(filePath.utf8().data(), "rb");
+ if (!file)
return 0;
+ struct stat fileStat;
if (fstat(fileno(file), &fileStat)) {
fclose(file);
return 0;
}
- result = SharedBuffer::create();
- result->m_buffer.resize(fileStat.st_size);
- if (result->m_buffer.size() != static_cast<unsigned>(fileStat.st_size)) {
- fclose(file);
- return 0;
- }
-
- const size_t bytesRead = fread(result->m_buffer.data(), 1, fileStat.st_size, file);
+ Vector<char> buffer(fileStat.st_size);
+ const size_t bytesRead = fread(buffer.data(), 1, buffer.size(), file);
fclose(file);
- return bytesRead == static_cast<unsigned>(fileStat.st_size) ? result.release() : 0;
+ return (bytesRead == buffer.size()) ? SharedBuffer::adoptVector(buffer) : 0;
}
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp
index 73848bd1c..c93166659 100644
--- a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp
+++ b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp
@@ -32,11 +32,11 @@
namespace WebCore {
-
-ANGLEWebKitBridge::ANGLEWebKitBridge() :
+ANGLEWebKitBridge::ANGLEWebKitBridge(ShShaderOutput shaderOutput) :
builtCompilers(false),
m_fragmentCompiler(0),
- m_vertexCompiler(0)
+ m_vertexCompiler(0),
+ m_shaderOutput(shaderOutput)
{
ShInitialize();
}
@@ -69,8 +69,8 @@ void ANGLEWebKitBridge::setResources(ShBuiltInResources resources)
bool ANGLEWebKitBridge::validateShaderSource(const char* shaderSource, ANGLEShaderType shaderType, String& translatedShaderSource, String& shaderValidationLog)
{
if (!builtCompilers) {
- m_fragmentCompiler = ShConstructCompiler(SH_FRAGMENT_SHADER, SH_WEBGL_SPEC, SH_GLSL_OUTPUT, &m_resources);
- m_vertexCompiler = ShConstructCompiler(SH_VERTEX_SHADER, SH_WEBGL_SPEC, SH_GLSL_OUTPUT, &m_resources);
+ m_fragmentCompiler = ShConstructCompiler(SH_FRAGMENT_SHADER, SH_WEBGL_SPEC, m_shaderOutput, &m_resources);
+ m_vertexCompiler = ShConstructCompiler(SH_VERTEX_SHADER, SH_WEBGL_SPEC, m_shaderOutput, &m_resources);
if (!m_fragmentCompiler || !m_vertexCompiler) {
cleanupCompilers();
return false;
diff --git a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h
index 7d6ad7895..d75b5f298 100644
--- a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h
+++ b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h
@@ -47,7 +47,7 @@ enum ANGLEShaderType {
class ANGLEWebKitBridge {
public:
- ANGLEWebKitBridge();
+ ANGLEWebKitBridge(ShShaderOutput = SH_GLSL_OUTPUT);
~ANGLEWebKitBridge();
ShBuiltInResources getResources() { return m_resources; }
@@ -64,6 +64,8 @@ private:
ShHandle m_fragmentCompiler;
ShHandle m_vertexCompiler;
+ ShShaderOutput m_shaderOutput;
+
ShBuiltInResources m_resources;
};
diff --git a/Source/WebCore/platform/graphics/BitmapImage.h b/Source/WebCore/platform/graphics/BitmapImage.h
index 2f1969e43..64c81c791 100644
--- a/Source/WebCore/platform/graphics/BitmapImage.h
+++ b/Source/WebCore/platform/graphics/BitmapImage.h
@@ -272,8 +272,8 @@ protected:
mutable IntSize m_sizeRespectingOrientation;
size_t m_currentFrame; // The index of the current frame of animation.
- Vector<FrameData> m_frames; // An array of the cached frames of the animation. We have to ref frames to pin them in the cache.
-
+ Vector<FrameData, 1> m_frames; // An array of the cached frames of the animation. We have to ref frames to pin them in the cache.
+
Timer<BitmapImage>* m_frameTimer;
int m_repetitionCount; // How many total animation loops we should do. This will be cAnimationNone if this image type is incapable of animation.
RepetitionCountStatus m_repetitionCountStatus;
diff --git a/Source/WebCore/platform/graphics/GraphicsContext3D.h b/Source/WebCore/platform/graphics/GraphicsContext3D.h
index b6c1b6441..dbd9dfede 100644
--- a/Source/WebCore/platform/graphics/GraphicsContext3D.h
+++ b/Source/WebCore/platform/graphics/GraphicsContext3D.h
@@ -555,7 +555,7 @@ public:
// return the suggested GL error indicating the cause of the failure:
// INVALID_VALUE if width/height is negative or overflow happens.
// INVALID_ENUM if format/type is illegal.
- GC3Denum computeImageSizeInBytes(GC3Denum format,
+ static GC3Denum computeImageSizeInBytes(GC3Denum format,
GC3Denum type,
GC3Dsizei width,
GC3Dsizei height,
@@ -567,7 +567,7 @@ public:
// packing the pixel data according to the given format and type,
// and obeying the flipY, premultiplyAlpha, and ignoreGammaAndColorProfile
// flags. Returns true upon success.
- bool extractImageData(Image* image,
+ static bool extractImageData(Image*,
GC3Denum format,
GC3Denum type,
bool flipY,
@@ -579,7 +579,7 @@ public:
// packing the pixel data according to the given format and type,
// and obeying the flipY and premultiplyAlpha flags. Returns true
// upon success.
- bool extractImageData(ImageData*,
+ static bool extractImageData(ImageData*,
GC3Denum format,
GC3Denum type,
bool flipY,
@@ -591,7 +591,7 @@ public:
// If the data is not tightly packed according to the passed
// unpackAlignment, the output data will be tightly packed.
// Returns true if successful, false if any error occurred.
- bool extractTextureData(unsigned int width, unsigned int height,
+ static bool extractTextureData(unsigned int width, unsigned int height,
GC3Denum format, GC3Denum type,
unsigned int unpackAlignment,
bool flipY, bool premultiplyAlpha,
@@ -599,7 +599,7 @@ public:
Vector<uint8_t>& data);
// Flips the given image data vertically, in-place.
- void flipVertically(void* imageData,
+ static void flipVertically(void* imageData,
unsigned int width,
unsigned int height,
unsigned int bytesPerPixel,
@@ -888,7 +888,7 @@ public:
//
// No vertical flip of the image data is performed by this
// method.
- bool getImageData(Image* image,
+ static bool getImageData(Image*,
GC3Denum format,
GC3Denum type,
bool premultiplyAlpha,
@@ -909,7 +909,7 @@ public:
// A sourceUnpackAlignment of zero indicates that the source
// data is tightly packed. Non-zero values may take a slow path.
// Destination data will have no gaps between rows.
- bool packPixels(const uint8_t* sourceData,
+ static bool packPixels(const uint8_t* sourceData,
SourceDataFormat sourceDataFormat,
unsigned int width,
unsigned int height,
diff --git a/Source/WebCore/platform/graphics/chromium/Extensions3DChromium.h b/Source/WebCore/platform/graphics/chromium/Extensions3DChromium.h
index 82787f400..ff7ed7e29 100644
--- a/Source/WebCore/platform/graphics/chromium/Extensions3DChromium.h
+++ b/Source/WebCore/platform/graphics/chromium/Extensions3DChromium.h
@@ -90,49 +90,12 @@ public:
COMMANDS_ISSUED_CHROMIUM = 0x84F2
};
- // GL_CHROMIUM_post_sub_buffer
- void postSubBufferCHROMIUM(int x, int y, int width, int height);
-
// GL_CHROMIUM_map_sub
void* mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access);
void unmapBufferSubDataCHROMIUM(const void*);
void* mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access);
void unmapTexSubImage2DCHROMIUM(const void*);
- // GL_CHROMIUM_set_visibility
- void setVisibilityCHROMIUM(bool);
-
- // GL_EXT_discard_framebuffer
- virtual void discardFramebufferEXT(GC3Denum target, GC3Dsizei numAttachments, const GC3Denum* attachments);
- virtual void ensureFramebufferCHROMIUM();
-
- // GL_CHROMIUM_gpu_memory_manager
- struct GpuMemoryAllocationCHROMIUM {
- size_t gpuResourceSizeInBytes;
- bool suggestHaveBackbuffer;
-
- GpuMemoryAllocationCHROMIUM(size_t gpuResourceSizeInBytes, bool suggestHaveBackbuffer)
- : gpuResourceSizeInBytes(gpuResourceSizeInBytes)
- , suggestHaveBackbuffer(suggestHaveBackbuffer)
- {
- }
- };
- class GpuMemoryAllocationChangedCallbackCHROMIUM {
- public:
-
- virtual void onGpuMemoryAllocationChanged(GpuMemoryAllocationCHROMIUM) = 0;
- virtual ~GpuMemoryAllocationChangedCallbackCHROMIUM() { }
- };
- void setGpuMemoryAllocationChangedCallbackCHROMIUM(PassOwnPtr<GpuMemoryAllocationChangedCallbackCHROMIUM>);
-
- // GL_CHROMIUM_swapbuffers_complete_callback
- class SwapBuffersCompleteCallbackCHROMIUM {
- public:
- virtual void onSwapBuffersComplete() = 0;
- virtual ~SwapBuffersCompleteCallbackCHROMIUM() { }
- };
- void setSwapBuffersCompleteCallbackCHROMIUM(PassOwnPtr<SwapBuffersCompleteCallbackCHROMIUM>);
-
// GL_CHROMIUM_rate_limit_offscreen_context
void rateLimitOffscreenContextCHROMIUM();
diff --git a/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp b/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp
index a2c43ce1b..743bcc1f7 100644
--- a/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp
+++ b/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp
@@ -31,9 +31,10 @@
#include "FrameBufferSkPictureCanvasLayerTextureUpdater.h"
#include "LayerPainterChromium.h"
+#include "SharedGraphicsContext3D.h"
#include "SkCanvas.h"
#include "SkGpuDevice.h"
-#include "cc/CCGraphicsContext.h"
+#include "cc/CCProxy.h"
namespace WebCore {
@@ -67,9 +68,12 @@ FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::~Texture()
{
}
-void FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::updateRect(CCGraphicsContext* context, TextureAllocator* allocator, const IntRect& sourceRect, const IntRect& destRect)
+void FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::updateRect(CCGraphicsContext*, TextureAllocator* allocator, const IntRect& sourceRect, const IntRect& destRect)
{
- textureUpdater()->updateTextureRect(context, allocator, texture(), sourceRect, destRect);
+ RefPtr<GraphicsContext3D> sharedContext = CCProxy::hasImplThread() ? SharedGraphicsContext3D::getForImplThread() : SharedGraphicsContext3D::get();
+ if (!sharedContext)
+ return;
+ textureUpdater()->updateTextureRect(sharedContext.release(), allocator, texture(), sourceRect, destRect);
}
PassRefPtr<FrameBufferSkPictureCanvasLayerTextureUpdater> FrameBufferSkPictureCanvasLayerTextureUpdater::create(PassOwnPtr<LayerPainterChromium> painter)
@@ -97,21 +101,15 @@ LayerTextureUpdater::SampledTexelFormat FrameBufferSkPictureCanvasLayerTextureUp
return LayerTextureUpdater::SampledTexelFormatRGBA;
}
-void FrameBufferSkPictureCanvasLayerTextureUpdater::updateTextureRect(CCGraphicsContext* context, TextureAllocator* allocator, ManagedTexture* texture, const IntRect& sourceRect, const IntRect& destRect)
+void FrameBufferSkPictureCanvasLayerTextureUpdater::updateTextureRect(PassRefPtr<GraphicsContext3D> prpContext, TextureAllocator* allocator, ManagedTexture* texture, const IntRect& sourceRect, const IntRect& destRect)
{
- GraphicsContext3D* context3d = context->context3D();
- if (!context3d) {
- // FIXME: Implement this path for software compositing.
- return;
- }
+ RefPtr<GraphicsContext3D> context(prpContext);
// Make sure ganesh uses the correct GL context.
- context3d->makeContextCurrent();
- // Notify ganesh to sync its internal GL state.
- context3d->grContext()->resetContext();
+ context->makeContextCurrent();
// Create an accelerated canvas to draw on.
- OwnPtr<SkCanvas> canvas = createAcceleratedCanvas(context3d, allocator, texture);
+ OwnPtr<SkCanvas> canvas = createAcceleratedCanvas(context.get(), allocator, texture);
// The compositor expects the textures to be upside-down so it can flip
// the final composited image. Ganesh renders the image upright so we
@@ -127,7 +125,10 @@ void FrameBufferSkPictureCanvasLayerTextureUpdater::updateTextureRect(CCGraphics
drawPicture(canvas.get());
// Flush ganesh context so that all the rendered stuff appears on the texture.
- context3d->grContext()->flush();
+ context->grContext()->flush();
+
+ // Flush the GL context so rendering results from this context are visible in the compositor's context.
+ context->flush();
}
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h b/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h
index abeaf523d..1f2f20cce 100644
--- a/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h
+++ b/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h
@@ -56,7 +56,7 @@ public:
virtual PassOwnPtr<LayerTextureUpdater::Texture> createTexture(TextureManager*) OVERRIDE;
virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat) OVERRIDE;
- void updateTextureRect(CCGraphicsContext*, TextureAllocator*, ManagedTexture*, const IntRect& sourceRect, const IntRect& destRect);
+ void updateTextureRect(PassRefPtr<GraphicsContext3D>, TextureAllocator*, ManagedTexture*, const IntRect& sourceRect, const IntRect& destRect);
private:
explicit FrameBufferSkPictureCanvasLayerTextureUpdater(PassOwnPtr<LayerPainterChromium>);
diff --git a/Source/WebCore/platform/graphics/chromium/GeometryBinding.cpp b/Source/WebCore/platform/graphics/chromium/GeometryBinding.cpp
index a859aae73..1a4568bb0 100644
--- a/Source/WebCore/platform/graphics/chromium/GeometryBinding.cpp
+++ b/Source/WebCore/platform/graphics/chromium/GeometryBinding.cpp
@@ -29,13 +29,13 @@
#include "GeometryBinding.h"
-#include "GraphicsContext.h"
#include "GraphicsContext3D.h"
#include "LayerRendererChromium.h"
+#include <public/WebGraphicsContext3D.h>
namespace WebCore {
-GeometryBinding::GeometryBinding(GraphicsContext3D* context)
+GeometryBinding::GeometryBinding(WebKit::WebGraphicsContext3D* context)
: m_context(context)
, m_quadVerticesVbo(0)
, m_quadElementsVbo(0)
diff --git a/Source/WebCore/platform/graphics/chromium/GeometryBinding.h b/Source/WebCore/platform/graphics/chromium/GeometryBinding.h
index ec199703e..20b2d5a00 100644
--- a/Source/WebCore/platform/graphics/chromium/GeometryBinding.h
+++ b/Source/WebCore/platform/graphics/chromium/GeometryBinding.h
@@ -28,20 +28,20 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "PlatformString.h"
+namespace WebKit {
+class WebGraphicsContext3D;
+}
namespace WebCore {
-class GraphicsContext3D;
-
class GeometryBinding {
public:
- explicit GeometryBinding(GraphicsContext3D*);
+ explicit GeometryBinding(WebKit::WebGraphicsContext3D*);
~GeometryBinding();
bool initialized() const { return m_initialized; }
- GraphicsContext3D* context() const { return m_context; }
+ WebKit::WebGraphicsContext3D* context() const { return m_context; }
unsigned quadVerticesVbo() const { return m_quadVerticesVbo; }
unsigned quadElementsVbo() const { return m_quadElementsVbo; }
@@ -54,7 +54,7 @@ public:
static int texCoordAttribLocation() { return 1; }
private:
- GraphicsContext3D* m_context;
+ WebKit::WebGraphicsContext3D* m_context;
unsigned m_quadVerticesVbo;
unsigned m_quadElementsVbo;
bool m_initialized;
diff --git a/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
index 5aed1c7f9..1a4038a4f 100644
--- a/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
@@ -228,7 +228,7 @@ void LayerChromium::setBounds(const IntSize& size)
if (bounds() == size)
return;
- bool firstResize = !bounds().width() && !bounds().height() && size.width() && size.height();
+ bool firstResize = bounds().isEmpty() && !size.isEmpty();
m_bounds = size;
diff --git a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
index 595cae2e9..ca2d1902a 100644
--- a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
@@ -38,7 +38,6 @@
#include "FloatQuad.h"
#include "GeometryBinding.h"
#include "GrTexture.h"
-#include "GraphicsContext3D.h"
#include "ManagedTexture.h"
#include "NativeImageSkia.h"
#include "NotImplemented.h"
@@ -67,11 +66,15 @@
#include "cc/CCTileDrawQuad.h"
#include "cc/CCVideoLayerImpl.h"
#include "cc/CCYUVVideoDrawQuad.h"
+#include <public/WebGraphicsContext3D.h>
#include <public/WebVideoFrame.h>
#include <wtf/CurrentTime.h>
#include <wtf/MainThread.h>
+#include <wtf/text/StringHash.h>
using namespace std;
+using WebKit::WebGraphicsContext3D;
+using WebKit::WebGraphicsMemoryAllocation;
using WebKit::WebTransformationMatrix;
namespace WebCore {
@@ -112,35 +115,10 @@ static WebTransformationMatrix screenMatrix(int x, int y, int width, int height)
return screen;
}
-bool contextSupportsAcceleratedPainting(GraphicsContext3D* context)
-{
- WebCore::Extensions3D* extensions = context->getExtensions();
- if (extensions->supports("GL_EXT_texture_format_BGRA8888"))
- extensions->ensureEnabled("GL_EXT_texture_format_BGRA8888");
- else
- return false;
-
- if (extensions->supports("GL_EXT_read_format_bgra"))
- extensions->ensureEnabled("GL_EXT_read_format_bgra");
- else
- return false;
-
- if (!context->grContext())
- return false;
-
- return true;
-}
-
-bool needsLionIOSurfaceReadbackWorkaround()
+bool needsIOSurfaceReadbackWorkaround()
{
#if OS(DARWIN)
- static SInt32 systemVersion = 0;
- if (!systemVersion) {
- if (Gestalt(gestaltSystemVersion, &systemVersion) != noErr)
- return false;
- }
-
- return systemVersion >= 0x1070;
+ return true;
#else
return false;
#endif
@@ -166,66 +144,7 @@ protected:
} // anonymous namespace
-class LayerRendererSwapBuffersCompleteCallbackAdapter : public Extensions3DChromium::SwapBuffersCompleteCallbackCHROMIUM {
-public:
- static PassOwnPtr<LayerRendererSwapBuffersCompleteCallbackAdapter> create(LayerRendererChromium* layerRenderer)
- {
- return adoptPtr(new LayerRendererSwapBuffersCompleteCallbackAdapter(layerRenderer));
- }
- virtual ~LayerRendererSwapBuffersCompleteCallbackAdapter() { }
-
- virtual void onSwapBuffersComplete()
- {
- m_layerRenderer->onSwapBuffersComplete();
- }
-
-private:
- explicit LayerRendererSwapBuffersCompleteCallbackAdapter(LayerRendererChromium* layerRenderer)
- {
- m_layerRenderer = layerRenderer;
- }
-
- LayerRendererChromium* m_layerRenderer;
-};
-
-class LayerRendererGpuMemoryAllocationChangedCallbackAdapter : public Extensions3DChromium::GpuMemoryAllocationChangedCallbackCHROMIUM {
-public:
- static PassOwnPtr<LayerRendererGpuMemoryAllocationChangedCallbackAdapter> create(LayerRendererChromium* layerRenderer)
- {
- return adoptPtr(new LayerRendererGpuMemoryAllocationChangedCallbackAdapter(layerRenderer));
- }
- virtual ~LayerRendererGpuMemoryAllocationChangedCallbackAdapter() { }
-
- virtual void onGpuMemoryAllocationChanged(Extensions3DChromium::GpuMemoryAllocationCHROMIUM allocation)
- {
- // FIXME: This is called on the main thread in single threaded mode, but we expect it on the impl thread.
- if (m_bindToImplThread) {
- ASSERT(CCProxy::isMainThread());
- DebugScopedSetImplThread impl;
- onGpuMemoryAllocationChangedOnImpl(allocation);
- } else {
- ASSERT(CCProxy::isImplThread());
- onGpuMemoryAllocationChangedOnImpl(allocation);
- }
- }
-
-private:
- explicit LayerRendererGpuMemoryAllocationChangedCallbackAdapter(LayerRendererChromium* layerRenderer)
- : m_layerRenderer(layerRenderer), m_bindToImplThread(!CCProxy::hasImplThread())
- {
- }
-
- void onGpuMemoryAllocationChangedOnImpl(Extensions3DChromium::GpuMemoryAllocationCHROMIUM allocation)
- {
- ASSERT(CCProxy::isImplThread());
- m_layerRenderer->setGpuMemoryAllocation(allocation);
- }
-
- LayerRendererChromium* m_layerRenderer;
- bool m_bindToImplThread;
-};
-
-PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(CCRendererClient* client, PassRefPtr<GraphicsContext3D> context, TextureUploaderOption textureUploaderSetting)
+PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(CCRendererClient* client, WebGraphicsContext3D* context, TextureUploaderOption textureUploaderSetting)
{
OwnPtr<LayerRendererChromium> layerRenderer(adoptPtr(new LayerRendererChromium(client, context, textureUploaderSetting)));
if (!layerRenderer->initialize())
@@ -235,7 +154,7 @@ PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(CCRendererClient
}
LayerRendererChromium::LayerRendererChromium(CCRendererClient* client,
- PassRefPtr<GraphicsContext3D> context,
+ WebGraphicsContext3D* context,
TextureUploaderOption textureUploaderSetting)
: CCRenderer(client)
, m_currentRenderPass(0)
@@ -249,96 +168,65 @@ LayerRendererChromium::LayerRendererChromium(CCRendererClient* client,
, m_visible(true)
, m_textureUploaderSetting(textureUploaderSetting)
{
- ASSERT(m_context.get());
+ ASSERT(m_context);
}
-class ContextLostCallbackAdapter : public GraphicsContext3D::ContextLostCallback {
-public:
- static PassOwnPtr<ContextLostCallbackAdapter> create(CCRendererClient* client)
- {
- return adoptPtr(new ContextLostCallbackAdapter(client));
- }
-
- virtual void onContextLost()
- {
- m_client->didLoseContext();
- }
-
-private:
- explicit ContextLostCallbackAdapter(CCRendererClient* client)
- : m_client(client) { }
-
- CCRendererClient* m_client;
-};
-
bool LayerRendererChromium::initialize()
{
if (!m_context->makeContextCurrent())
return false;
- m_context->setContextLostCallback(ContextLostCallbackAdapter::create(m_client));
+ m_context->setContextLostCallback(this);
+
+ String extensionsString = m_context->getString(GraphicsContext3D::EXTENSIONS);
+ Vector<String> extensionsList;
+ extensionsString.split(' ', extensionsList);
+ HashSet<String> extensions;
+ for (size_t i = 0; i < extensionsList.size(); ++i)
+ extensions.add(extensionsList[i]);
- if (settings().acceleratePainting && contextSupportsAcceleratedPainting(m_context.get()))
+ if (settings().acceleratePainting && extensions.contains("GL_EXT_texture_format_BGRA8888")
+ && extensions.contains("GL_EXT_read_format_bgra"))
m_capabilities.usingAcceleratedPainting = true;
+ else
+ m_capabilities.usingAcceleratedPainting = false;
- WebCore::Extensions3D* extensions = m_context->getExtensions();
- m_capabilities.contextHasCachedFrontBuffer = extensions->supports("GL_CHROMIUM_front_buffer_cached");
- if (m_capabilities.contextHasCachedFrontBuffer)
- extensions->ensureEnabled("GL_CHROMIUM_front_buffer_cached");
- m_capabilities.usingPartialSwap = CCSettings::partialSwapEnabled() && extensions->supports("GL_CHROMIUM_post_sub_buffer");
- if (m_capabilities.usingPartialSwap)
- extensions->ensureEnabled("GL_CHROMIUM_post_sub_buffer");
+ m_capabilities.contextHasCachedFrontBuffer = extensions.contains("GL_CHROMIUM_front_buffer_cached");
- m_capabilities.usingMapSub = extensions->supports("GL_CHROMIUM_map_sub");
- if (m_capabilities.usingMapSub)
- extensions->ensureEnabled("GL_CHROMIUM_map_sub");
+ m_capabilities.usingPartialSwap = CCSettings::partialSwapEnabled() && extensions.contains("GL_CHROMIUM_post_sub_buffer");
+
+ m_capabilities.usingMapSub = extensions.contains("GL_CHROMIUM_map_sub");
// Use the swapBuffers callback only with the threaded proxy.
if (CCProxy::hasImplThread())
- m_capabilities.usingSwapCompleteCallback = extensions->supports("GL_CHROMIUM_swapbuffers_complete_callback");
+ m_capabilities.usingSwapCompleteCallback = extensions.contains("GL_CHROMIUM_swapbuffers_complete_callback");
if (m_capabilities.usingSwapCompleteCallback) {
- extensions->ensureEnabled("GL_CHROMIUM_swapbuffers_complete_callback");
- Extensions3DChromium* extensions3DChromium = static_cast<Extensions3DChromium*>(extensions);
- extensions3DChromium->setSwapBuffersCompleteCallbackCHROMIUM(LayerRendererSwapBuffersCompleteCallbackAdapter::create(this));
+ m_context->setSwapBuffersCompleteCallbackCHROMIUM(this);
}
- if (extensions->supports("GL_EXT_texture_format_BGRA8888"))
- extensions->ensureEnabled("GL_EXT_texture_format_BGRA8888");
-
- m_capabilities.usingSetVisibility = extensions->supports("GL_CHROMIUM_set_visibility");
- if (m_capabilities.usingSetVisibility)
- extensions->ensureEnabled("GL_CHROMIUM_set_visibility");
+ m_capabilities.usingSetVisibility = extensions.contains("GL_CHROMIUM_set_visibility");
- if (extensions->supports("GL_CHROMIUM_iosurface")) {
- ASSERT(extensions->supports("GL_ARB_texture_rectangle"));
- extensions->ensureEnabled("GL_ARB_texture_rectangle");
- extensions->ensureEnabled("GL_CHROMIUM_iosurface");
+ if (extensions.contains("GL_CHROMIUM_iosurface")) {
+ ASSERT(extensions.contains("GL_ARB_texture_rectangle"));
}
- m_capabilities.usingTextureUsageHint = extensions->supports("GL_ANGLE_texture_usage");
- if (m_capabilities.usingTextureUsageHint)
- extensions->ensureEnabled("GL_ANGLE_texture_usage");
+ m_capabilities.usingTextureUsageHint = extensions.contains("GL_ANGLE_texture_usage");
- m_capabilities.usingTextureStorageExtension = extensions->supports("GL_EXT_texture_storage");
- if (m_capabilities.usingTextureStorageExtension)
- extensions->ensureEnabled("GL_EXT_texture_storage");
+ m_capabilities.usingTextureStorageExtension = extensions.contains("GL_EXT_texture_storage");
- m_capabilities.usingGpuMemoryManager = extensions->supports("GL_CHROMIUM_gpu_memory_manager");
- if (m_capabilities.usingGpuMemoryManager) {
- extensions->ensureEnabled("GL_CHROMIUM_gpu_memory_manager");
- Extensions3DChromium* extensions3DChromium = static_cast<Extensions3DChromium*>(extensions);
- extensions3DChromium->setGpuMemoryAllocationChangedCallbackCHROMIUM(LayerRendererGpuMemoryAllocationChangedCallbackAdapter::create(this));
- } else {
+ m_capabilities.usingGpuMemoryManager = extensions.contains("GL_CHROMIUM_gpu_memory_manager");
+ if (m_capabilities.usingGpuMemoryManager)
+ m_context->setMemoryAllocationChangedCallbackCHROMIUM(this);
+ else
m_client->setMemoryAllocationLimitBytes(TextureManager::highLimitBytes(viewportSize()));
- }
- m_capabilities.usingDiscardFramebuffer = extensions->supports("GL_CHROMIUM_discard_framebuffer");
- if (m_capabilities.usingDiscardFramebuffer)
- extensions->ensureEnabled("GL_CHROMIUM_discard_framebuffer");
+ m_capabilities.usingDiscardFramebuffer = extensions.contains("GL_CHROMIUM_discard_framebuffer");
+
+ m_capabilities.usingEglImage = extensions.contains("GL_OES_EGL_image_external");
GLC(m_context, m_context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_SIZE, &m_capabilities.maxTextureSize));
- m_capabilities.bestTextureFormat = PlatformColor::bestTextureFormat(m_context.get());
+ m_capabilities.bestTextureFormat = PlatformColor::bestTextureFormat(m_context, extensions.contains("GL_EXT_texture_format_BGRA8888"));
if (!initializeSharedObjects())
return false;
@@ -351,18 +239,18 @@ bool LayerRendererChromium::initialize()
LayerRendererChromium::~LayerRendererChromium()
{
ASSERT(CCProxy::isImplThread());
- Extensions3DChromium* extensions3DChromium = static_cast<Extensions3DChromium*>(m_context->getExtensions());
- extensions3DChromium->setSwapBuffersCompleteCallbackCHROMIUM(nullptr);
- extensions3DChromium->setGpuMemoryAllocationChangedCallbackCHROMIUM(nullptr);
+ m_context->setSwapBuffersCompleteCallbackCHROMIUM(0);
+ m_context->setMemoryAllocationChangedCallbackCHROMIUM(0);
+ m_context->setContextLostCallback(0);
cleanupSharedObjects();
}
-GraphicsContext3D* LayerRendererChromium::context()
+WebGraphicsContext3D* LayerRendererChromium::context()
{
- return m_context.get();
+ return m_context;
}
-void LayerRendererChromium::debugGLCall(GraphicsContext3D* context, const char* command, const char* file, int line)
+void LayerRendererChromium::debugGLCall(WebGraphicsContext3D* context, const char* command, const char* file, int line)
{
unsigned long error = context->getError();
if (error != GraphicsContext3D::NO_ERROR)
@@ -378,8 +266,7 @@ void LayerRendererChromium::setVisible(bool visible)
// TODO: Replace setVisibilityCHROMIUM with an extension to explicitly manage front/backbuffers
// crbug.com/116049
if (m_capabilities.usingSetVisibility) {
- Extensions3DChromium* extensions3DChromium = static_cast<Extensions3DChromium*>(m_context->getExtensions());
- extensions3DChromium->setVisibilityCHROMIUM(visible);
+ m_context->setVisibilityCHROMIUM(visible);
}
}
@@ -1047,7 +934,7 @@ void LayerRendererChromium::drawStreamVideoQuad(const CCStreamVideoDrawQuad* qua
{
static float glMatrix[16];
- ASSERT(context()->getExtensions()->supports("GL_OES_EGL_image_external") && context()->getExtensions()->isEnabled("GL_OES_EGL_image_external"));
+ ASSERT(m_capabilities.usingEglImage);
const VideoStreamTextureProgram* program = videoStreamTextureProgram();
GLC(context(), context()->useProgram(program->program()));
@@ -1165,8 +1052,9 @@ void LayerRendererChromium::drawHeadsUpDisplay(ManagedTexture* hudTexture, const
const HeadsUpDisplayProgram* program = headsUpDisplayProgram();
ASSERT(program && program->initialized());
GLC(m_context, m_context->activeTexture(GraphicsContext3D::TEXTURE0));
- RefPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(m_context);
- hudTexture->bindTexture(ccContext.get(), m_implTextureAllocator.get());
+ if (!hudTexture->textureId())
+ hudTexture->allocate(m_implTextureAllocator.get());
+ GLC(m_context, m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, hudTexture->textureId()));
GLC(m_context, m_context->useProgram(program->program()));
GLC(m_context, m_context->uniform1i(program->fragmentShader().samplerLocation(), 0));
@@ -1184,12 +1072,6 @@ void LayerRendererChromium::finishDrawingFrame()
GLC(m_context, m_context->disable(GraphicsContext3D::BLEND));
m_implTextureManager->unprotectAllTextures();
-
- size_t contentsMemoryUseBytes = m_contentsTextureAllocator->currentMemoryUseBytes();
- size_t reclaimLimit = TextureManager::reclaimLimitBytes(viewportSize());
- size_t preferredLimit = reclaimLimit > contentsMemoryUseBytes ? reclaimLimit - contentsMemoryUseBytes : 0;
- m_implTextureManager->setPreferredMemoryLimitBytes(preferredLimit);
- m_implTextureManager->reduceMemoryToLimit(preferredLimit);
m_implTextureManager->deleteEvictedTextures(m_implTextureAllocator.get());
}
@@ -1267,22 +1149,6 @@ void LayerRendererChromium::copyTextureToFramebuffer(int textureId, const IntSiz
-1);
}
-void LayerRendererChromium::setGpuMemoryAllocation(Extensions3DChromium::GpuMemoryAllocationCHROMIUM allocation)
-{
- if (m_visible && !allocation.gpuResourceSizeInBytes)
- return;
-
- if (!allocation.suggestHaveBackbuffer && !m_visible)
- discardFramebuffer();
-
- if (!allocation.gpuResourceSizeInBytes) {
- releaseRenderPassTextures();
- m_client->releaseContentsTextures();
- GLC(m_context, m_context->flush());
- } else
- m_client->setMemoryAllocationLimitBytes(allocation.gpuResourceSizeInBytes);
-}
-
void LayerRendererChromium::finish()
{
TRACE_EVENT("LayerRendererChromium::finish", this, 0);
@@ -1301,12 +1167,11 @@ bool LayerRendererChromium::swapBuffers(const IntRect& subBuffer)
// If supported, we can save significant bandwidth by only swapping the damaged/scissored region (clamped to the viewport)
IntRect clippedSubBuffer = subBuffer;
clippedSubBuffer.intersect(IntRect(IntPoint::zero(), viewportSize()));
- Extensions3DChromium* extensions3DChromium = static_cast<Extensions3DChromium*>(m_context->getExtensions());
int flippedYPosOfRectBottom = viewportHeight() - clippedSubBuffer.y() - clippedSubBuffer.height();
- extensions3DChromium->postSubBufferCHROMIUM(clippedSubBuffer.x(), flippedYPosOfRectBottom, clippedSubBuffer.width(), clippedSubBuffer.height());
+ m_context->postSubBufferCHROMIUM(clippedSubBuffer.x(), flippedYPosOfRectBottom, clippedSubBuffer.width(), clippedSubBuffer.height());
} else
// Note that currently this has the same effect as swapBuffers; we should
- // consider exposing a different entry point on GraphicsContext3D.
+ // consider exposing a different entry point on WebGraphicsContext3D.
m_context->prepareTexture();
return true;
@@ -1317,6 +1182,35 @@ void LayerRendererChromium::onSwapBuffersComplete()
m_client->onSwapBuffersComplete();
}
+void LayerRendererChromium::onMemoryAllocationChanged(WebGraphicsMemoryAllocation allocation)
+{
+ // FIXME: This is called on the main thread in single threaded mode, but we expect it on the impl thread.
+ if (!CCProxy::hasImplThread()) {
+ ASSERT(CCProxy::isMainThread());
+ DebugScopedSetImplThread impl;
+ onMemoryAllocationChangedOnImplThread(allocation);
+ } else {
+ ASSERT(CCProxy::isImplThread());
+ onMemoryAllocationChangedOnImplThread(allocation);
+ }
+}
+
+void LayerRendererChromium::onMemoryAllocationChangedOnImplThread(WebKit::WebGraphicsMemoryAllocation allocation)
+{
+ if (m_visible && !allocation.gpuResourceSizeInBytes)
+ return;
+
+ if (!allocation.suggestHaveBackbuffer && !m_visible)
+ discardFramebuffer();
+
+ if (!allocation.gpuResourceSizeInBytes) {
+ releaseRenderPassTextures();
+ m_client->releaseContentsTextures();
+ GLC(m_context, m_context->flush());
+ } else
+ m_client->setMemoryAllocationLimitBytes(allocation.gpuResourceSizeInBytes);
+}
+
void LayerRendererChromium::discardFramebuffer()
{
if (m_isFramebufferDiscarded)
@@ -1325,10 +1219,8 @@ void LayerRendererChromium::discardFramebuffer()
if (!m_capabilities.usingDiscardFramebuffer)
return;
- Extensions3D* extensions = m_context->getExtensions();
- Extensions3DChromium* extensions3DChromium = static_cast<Extensions3DChromium*>(extensions);
// FIXME: Update attachments argument to appropriate values once they are no longer ignored.
- extensions3DChromium->discardFramebufferEXT(GraphicsContext3D::TEXTURE_2D, 0, 0);
+ m_context->discardFramebufferEXT(GraphicsContext3D::TEXTURE_2D, 0, 0);
m_isFramebufferDiscarded = true;
// Damage tracker needs a full reset every time framebuffer is discarded.
@@ -1343,12 +1235,16 @@ void LayerRendererChromium::ensureFramebuffer()
if (!m_capabilities.usingDiscardFramebuffer)
return;
- Extensions3D* extensions = m_context->getExtensions();
- Extensions3DChromium* extensions3DChromium = static_cast<Extensions3DChromium*>(extensions);
- extensions3DChromium->ensureFramebufferCHROMIUM();
+ m_context->ensureFramebufferCHROMIUM();
m_isFramebufferDiscarded = false;
}
+void LayerRendererChromium::onContextLost()
+{
+ m_client->didLoseContext();
+}
+
+
void LayerRendererChromium::getFramebufferPixels(void *pixels, const IntRect& rect)
{
ASSERT(rect.maxX() <= viewportWidth() && rect.maxY() <= viewportHeight());
@@ -1358,43 +1254,42 @@ void LayerRendererChromium::getFramebufferPixels(void *pixels, const IntRect& re
makeContextCurrent();
- bool doWorkaround = needsLionIOSurfaceReadbackWorkaround();
+ bool doWorkaround = needsIOSurfaceReadbackWorkaround();
Platform3DObject temporaryTexture = NullPlatform3DObject;
Platform3DObject temporaryFBO = NullPlatform3DObject;
- GraphicsContext3D* context = m_context.get();
if (doWorkaround) {
- // On Mac OS X 10.7, calling glReadPixels against an FBO whose color attachment is an
+ // On Mac OS X, calling glReadPixels against an FBO whose color attachment is an
// IOSurface-backed texture causes corruption of future glReadPixels calls, even those on
// different OpenGL contexts. It is believed that this is the root cause of top crasher
// http://crbug.com/99393. <rdar://problem/10949687>
- temporaryTexture = context->createTexture();
- GLC(context, context->bindTexture(GraphicsContext3D::TEXTURE_2D, temporaryTexture));
- GLC(context, context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR));
- GLC(context, context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR));
- GLC(context, context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE));
- GLC(context, context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE));
+ temporaryTexture = m_context->createTexture();
+ GLC(m_context, m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, temporaryTexture));
+ GLC(m_context, m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR));
+ GLC(m_context, m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR));
+ GLC(m_context, m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE));
+ GLC(m_context, m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE));
// Copy the contents of the current (IOSurface-backed) framebuffer into a temporary texture.
- GLC(context, context->copyTexImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, 0, 0, rect.maxX(), rect.maxY(), 0));
- temporaryFBO = context->createFramebuffer();
+ GLC(m_context, m_context->copyTexImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, 0, 0, rect.maxX(), rect.maxY(), 0));
+ temporaryFBO = m_context->createFramebuffer();
// Attach this texture to an FBO, and perform the readback from that FBO.
- GLC(context, context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, temporaryFBO));
- GLC(context, context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, temporaryTexture, 0));
+ GLC(m_context, m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, temporaryFBO));
+ GLC(m_context, m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, temporaryTexture, 0));
- ASSERT(context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) == GraphicsContext3D::FRAMEBUFFER_COMPLETE);
+ ASSERT(m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) == GraphicsContext3D::FRAMEBUFFER_COMPLETE);
}
- GLC(context, context->readPixels(rect.x(), rect.y(), rect.width(), rect.height(),
+ GLC(m_context, m_context->readPixels(rect.x(), rect.y(), rect.width(), rect.height(),
GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, pixels));
if (doWorkaround) {
// Clean up.
- GLC(context, context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0));
- GLC(context, context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0));
- GLC(context, context->deleteFramebuffer(temporaryFBO));
- GLC(context, context->deleteTexture(temporaryTexture));
+ GLC(m_context, m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0));
+ GLC(m_context, m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0));
+ GLC(m_context, m_context->deleteFramebuffer(temporaryFBO));
+ GLC(m_context, m_context->deleteTexture(temporaryTexture));
}
if (!m_visible) {
@@ -1411,8 +1306,9 @@ bool LayerRendererChromium::getFramebufferTexture(ManagedTexture* texture, const
if (!texture->reserve(deviceRect.size(), GraphicsContext3D::RGB))
return false;
- RefPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(m_context);
- texture->bindTexture(ccContext.get(), m_implTextureAllocator.get());
+ if (!texture->textureId())
+ texture->allocate(m_implTextureAllocator.get());
+ GLC(m_context, m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, texture->textureId()));
GLC(m_context, m_context->copyTexImage2D(GraphicsContext3D::TEXTURE_2D, 0, texture->format(),
deviceRect.x(), deviceRect.y(), deviceRect.width(), deviceRect.height(), 0));
return true;
@@ -1452,8 +1348,9 @@ bool LayerRendererChromium::bindFramebufferToTexture(ManagedTexture* texture, co
{
GLC(m_context, m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_offscreenFramebufferId));
- RefPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(m_context);
- texture->framebufferTexture2D(ccContext.get(), m_implTextureAllocator.get());
+ if (!texture->textureId())
+ texture->allocate(m_implTextureAllocator.get());
+ GLC(m_context, m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, texture->textureId(), 0));
#if !defined ( NDEBUG )
if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != GraphicsContext3D::FRAMEBUFFER_COMPLETE) {
@@ -1518,23 +1415,23 @@ bool LayerRendererChromium::initializeSharedObjects()
// We will always need these programs to render, so create the programs eagerly so that the shader compilation can
// start while we do other work. Other programs are created lazily on first access.
- m_sharedGeometry = adoptPtr(new GeometryBinding(m_context.get()));
- m_renderPassProgram = adoptPtr(new RenderPassProgram(m_context.get()));
- m_tileProgram = adoptPtr(new TileProgram(m_context.get()));
- m_tileProgramOpaque = adoptPtr(new TileProgramOpaque(m_context.get()));
+ m_sharedGeometry = adoptPtr(new GeometryBinding(m_context));
+ m_renderPassProgram = adoptPtr(new RenderPassProgram(m_context));
+ m_tileProgram = adoptPtr(new TileProgram(m_context));
+ m_tileProgramOpaque = adoptPtr(new TileProgramOpaque(m_context));
GLC(m_context, m_context->flush());
m_implTextureManager = TextureManager::create(TextureManager::highLimitBytes(viewportSize()),
TextureManager::reclaimLimitBytes(viewportSize()),
m_capabilities.maxTextureSize);
- m_textureCopier = AcceleratedTextureCopier::create(m_context.get());
+ m_textureCopier = AcceleratedTextureCopier::create(m_context);
if (m_textureUploaderSetting == ThrottledUploader)
- m_textureUploader = ThrottledTextureUploader::create(m_context.get());
+ m_textureUploader = ThrottledTextureUploader::create(m_context);
else
m_textureUploader = UnthrottledTextureUploader::create();
- m_contentsTextureAllocator = TrackingTextureAllocator::create(m_context.get());
- m_implTextureAllocator = TrackingTextureAllocator::create(m_context.get());
+ m_contentsTextureAllocator = TrackingTextureAllocator::create(m_context);
+ m_implTextureAllocator = TrackingTextureAllocator::create(m_context);
if (m_capabilities.usingTextureUsageHint)
m_implTextureAllocator->setTextureUsageHint(TrackingTextureAllocator::FramebufferAttachment);
if (m_capabilities.usingTextureStorageExtension) {
@@ -1548,10 +1445,10 @@ bool LayerRendererChromium::initializeSharedObjects()
const LayerRendererChromium::TileCheckerboardProgram* LayerRendererChromium::tileCheckerboardProgram()
{
if (!m_tileCheckerboardProgram)
- m_tileCheckerboardProgram = adoptPtr(new TileCheckerboardProgram(m_context.get()));
+ m_tileCheckerboardProgram = adoptPtr(new TileCheckerboardProgram(m_context));
if (!m_tileCheckerboardProgram->initialized()) {
TRACE_EVENT("LayerRendererChromium::checkerboardProgram::initalize", this, 0);
- m_tileCheckerboardProgram->initialize(m_context.get());
+ m_tileCheckerboardProgram->initialize(m_context);
}
return m_tileCheckerboardProgram.get();
}
@@ -1559,10 +1456,10 @@ const LayerRendererChromium::TileCheckerboardProgram* LayerRendererChromium::til
const LayerRendererChromium::SolidColorProgram* LayerRendererChromium::solidColorProgram()
{
if (!m_solidColorProgram)
- m_solidColorProgram = adoptPtr(new SolidColorProgram(m_context.get()));
+ m_solidColorProgram = adoptPtr(new SolidColorProgram(m_context));
if (!m_solidColorProgram->initialized()) {
TRACE_EVENT("LayerRendererChromium::solidColorProgram::initialize", this, 0);
- m_solidColorProgram->initialize(m_context.get());
+ m_solidColorProgram->initialize(m_context);
}
return m_solidColorProgram.get();
}
@@ -1570,10 +1467,10 @@ const LayerRendererChromium::SolidColorProgram* LayerRendererChromium::solidColo
const LayerRendererChromium::HeadsUpDisplayProgram* LayerRendererChromium::headsUpDisplayProgram()
{
if (!m_headsUpDisplayProgram)
- m_headsUpDisplayProgram = adoptPtr(new HeadsUpDisplayProgram(m_context.get()));
+ m_headsUpDisplayProgram = adoptPtr(new HeadsUpDisplayProgram(m_context));
if (!m_headsUpDisplayProgram->initialized()) {
TRACE_EVENT("LayerRendererChromium::headsUpDisplayProgram::initialize", this, 0);
- m_headsUpDisplayProgram->initialize(m_context.get());
+ m_headsUpDisplayProgram->initialize(m_context);
}
return m_headsUpDisplayProgram.get();
}
@@ -1583,7 +1480,7 @@ const LayerRendererChromium::RenderPassProgram* LayerRendererChromium::renderPas
ASSERT(m_renderPassProgram);
if (!m_renderPassProgram->initialized()) {
TRACE_EVENT("LayerRendererChromium::renderPassProgram::initialize", this, 0);
- m_renderPassProgram->initialize(m_context.get());
+ m_renderPassProgram->initialize(m_context);
}
return m_renderPassProgram.get();
}
@@ -1591,10 +1488,10 @@ const LayerRendererChromium::RenderPassProgram* LayerRendererChromium::renderPas
const LayerRendererChromium::RenderPassProgramAA* LayerRendererChromium::renderPassProgramAA()
{
if (!m_renderPassProgramAA)
- m_renderPassProgramAA = adoptPtr(new RenderPassProgramAA(m_context.get()));
+ m_renderPassProgramAA = adoptPtr(new RenderPassProgramAA(m_context));
if (!m_renderPassProgramAA->initialized()) {
TRACE_EVENT("LayerRendererChromium::renderPassProgramAA::initialize", this, 0);
- m_renderPassProgramAA->initialize(m_context.get());
+ m_renderPassProgramAA->initialize(m_context);
}
return m_renderPassProgramAA.get();
}
@@ -1602,10 +1499,10 @@ const LayerRendererChromium::RenderPassProgramAA* LayerRendererChromium::renderP
const LayerRendererChromium::RenderPassMaskProgram* LayerRendererChromium::renderPassMaskProgram()
{
if (!m_renderPassMaskProgram)
- m_renderPassMaskProgram = adoptPtr(new RenderPassMaskProgram(m_context.get()));
+ m_renderPassMaskProgram = adoptPtr(new RenderPassMaskProgram(m_context));
if (!m_renderPassMaskProgram->initialized()) {
TRACE_EVENT("LayerRendererChromium::renderPassMaskProgram::initialize", this, 0);
- m_renderPassMaskProgram->initialize(m_context.get());
+ m_renderPassMaskProgram->initialize(m_context);
}
return m_renderPassMaskProgram.get();
}
@@ -1613,10 +1510,10 @@ const LayerRendererChromium::RenderPassMaskProgram* LayerRendererChromium::rende
const LayerRendererChromium::RenderPassMaskProgramAA* LayerRendererChromium::renderPassMaskProgramAA()
{
if (!m_renderPassMaskProgramAA)
- m_renderPassMaskProgramAA = adoptPtr(new RenderPassMaskProgramAA(m_context.get()));
+ m_renderPassMaskProgramAA = adoptPtr(new RenderPassMaskProgramAA(m_context));
if (!m_renderPassMaskProgramAA->initialized()) {
TRACE_EVENT("LayerRendererChromium::renderPassMaskProgramAA::initialize", this, 0);
- m_renderPassMaskProgramAA->initialize(m_context.get());
+ m_renderPassMaskProgramAA->initialize(m_context);
}
return m_renderPassMaskProgramAA.get();
}
@@ -1626,7 +1523,7 @@ const LayerRendererChromium::TileProgram* LayerRendererChromium::tileProgram()
ASSERT(m_tileProgram);
if (!m_tileProgram->initialized()) {
TRACE_EVENT("LayerRendererChromium::tileProgram::initialize", this, 0);
- m_tileProgram->initialize(m_context.get());
+ m_tileProgram->initialize(m_context);
}
return m_tileProgram.get();
}
@@ -1636,7 +1533,7 @@ const LayerRendererChromium::TileProgramOpaque* LayerRendererChromium::tileProgr
ASSERT(m_tileProgramOpaque);
if (!m_tileProgramOpaque->initialized()) {
TRACE_EVENT("LayerRendererChromium::tileProgramOpaque::initialize", this, 0);
- m_tileProgramOpaque->initialize(m_context.get());
+ m_tileProgramOpaque->initialize(m_context);
}
return m_tileProgramOpaque.get();
}
@@ -1644,10 +1541,10 @@ const LayerRendererChromium::TileProgramOpaque* LayerRendererChromium::tileProgr
const LayerRendererChromium::TileProgramAA* LayerRendererChromium::tileProgramAA()
{
if (!m_tileProgramAA)
- m_tileProgramAA = adoptPtr(new TileProgramAA(m_context.get()));
+ m_tileProgramAA = adoptPtr(new TileProgramAA(m_context));
if (!m_tileProgramAA->initialized()) {
TRACE_EVENT("LayerRendererChromium::tileProgramAA::initialize", this, 0);
- m_tileProgramAA->initialize(m_context.get());
+ m_tileProgramAA->initialize(m_context);
}
return m_tileProgramAA.get();
}
@@ -1655,10 +1552,10 @@ const LayerRendererChromium::TileProgramAA* LayerRendererChromium::tileProgramAA
const LayerRendererChromium::TileProgramSwizzle* LayerRendererChromium::tileProgramSwizzle()
{
if (!m_tileProgramSwizzle)
- m_tileProgramSwizzle = adoptPtr(new TileProgramSwizzle(m_context.get()));
+ m_tileProgramSwizzle = adoptPtr(new TileProgramSwizzle(m_context));
if (!m_tileProgramSwizzle->initialized()) {
TRACE_EVENT("LayerRendererChromium::tileProgramSwizzle::initialize", this, 0);
- m_tileProgramSwizzle->initialize(m_context.get());
+ m_tileProgramSwizzle->initialize(m_context);
}
return m_tileProgramSwizzle.get();
}
@@ -1666,10 +1563,10 @@ const LayerRendererChromium::TileProgramSwizzle* LayerRendererChromium::tileProg
const LayerRendererChromium::TileProgramSwizzleOpaque* LayerRendererChromium::tileProgramSwizzleOpaque()
{
if (!m_tileProgramSwizzleOpaque)
- m_tileProgramSwizzleOpaque = adoptPtr(new TileProgramSwizzleOpaque(m_context.get()));
+ m_tileProgramSwizzleOpaque = adoptPtr(new TileProgramSwizzleOpaque(m_context));
if (!m_tileProgramSwizzleOpaque->initialized()) {
TRACE_EVENT("LayerRendererChromium::tileProgramSwizzleOpaque::initialize", this, 0);
- m_tileProgramSwizzleOpaque->initialize(m_context.get());
+ m_tileProgramSwizzleOpaque->initialize(m_context);
}
return m_tileProgramSwizzleOpaque.get();
}
@@ -1677,10 +1574,10 @@ const LayerRendererChromium::TileProgramSwizzleOpaque* LayerRendererChromium::ti
const LayerRendererChromium::TileProgramSwizzleAA* LayerRendererChromium::tileProgramSwizzleAA()
{
if (!m_tileProgramSwizzleAA)
- m_tileProgramSwizzleAA = adoptPtr(new TileProgramSwizzleAA(m_context.get()));
+ m_tileProgramSwizzleAA = adoptPtr(new TileProgramSwizzleAA(m_context));
if (!m_tileProgramSwizzleAA->initialized()) {
TRACE_EVENT("LayerRendererChromium::tileProgramSwizzleAA::initialize", this, 0);
- m_tileProgramSwizzleAA->initialize(m_context.get());
+ m_tileProgramSwizzleAA->initialize(m_context);
}
return m_tileProgramSwizzleAA.get();
}
@@ -1688,10 +1585,10 @@ const LayerRendererChromium::TileProgramSwizzleAA* LayerRendererChromium::tilePr
const LayerRendererChromium::TextureProgram* LayerRendererChromium::textureProgram()
{
if (!m_textureProgram)
- m_textureProgram = adoptPtr(new TextureProgram(m_context.get()));
+ m_textureProgram = adoptPtr(new TextureProgram(m_context));
if (!m_textureProgram->initialized()) {
TRACE_EVENT("LayerRendererChromium::textureProgram::initialize", this, 0);
- m_textureProgram->initialize(m_context.get());
+ m_textureProgram->initialize(m_context);
}
return m_textureProgram.get();
}
@@ -1699,10 +1596,10 @@ const LayerRendererChromium::TextureProgram* LayerRendererChromium::textureProgr
const LayerRendererChromium::TextureProgramFlip* LayerRendererChromium::textureProgramFlip()
{
if (!m_textureProgramFlip)
- m_textureProgramFlip = adoptPtr(new TextureProgramFlip(m_context.get()));
+ m_textureProgramFlip = adoptPtr(new TextureProgramFlip(m_context));
if (!m_textureProgramFlip->initialized()) {
TRACE_EVENT("LayerRendererChromium::textureProgramFlip::initialize", this, 0);
- m_textureProgramFlip->initialize(m_context.get());
+ m_textureProgramFlip->initialize(m_context);
}
return m_textureProgramFlip.get();
}
@@ -1710,10 +1607,10 @@ const LayerRendererChromium::TextureProgramFlip* LayerRendererChromium::textureP
const LayerRendererChromium::TextureIOSurfaceProgram* LayerRendererChromium::textureIOSurfaceProgram()
{
if (!m_textureIOSurfaceProgram)
- m_textureIOSurfaceProgram = adoptPtr(new TextureIOSurfaceProgram(m_context.get()));
+ m_textureIOSurfaceProgram = adoptPtr(new TextureIOSurfaceProgram(m_context));
if (!m_textureIOSurfaceProgram->initialized()) {
TRACE_EVENT("LayerRendererChromium::textureIOSurfaceProgram::initialize", this, 0);
- m_textureIOSurfaceProgram->initialize(m_context.get());
+ m_textureIOSurfaceProgram->initialize(m_context);
}
return m_textureIOSurfaceProgram.get();
}
@@ -1721,10 +1618,10 @@ const LayerRendererChromium::TextureIOSurfaceProgram* LayerRendererChromium::tex
const LayerRendererChromium::VideoYUVProgram* LayerRendererChromium::videoYUVProgram()
{
if (!m_videoYUVProgram)
- m_videoYUVProgram = adoptPtr(new VideoYUVProgram(m_context.get()));
+ m_videoYUVProgram = adoptPtr(new VideoYUVProgram(m_context));
if (!m_videoYUVProgram->initialized()) {
TRACE_EVENT("LayerRendererChromium::videoYUVProgram::initialize", this, 0);
- m_videoYUVProgram->initialize(m_context.get());
+ m_videoYUVProgram->initialize(m_context);
}
return m_videoYUVProgram.get();
}
@@ -1732,10 +1629,10 @@ const LayerRendererChromium::VideoYUVProgram* LayerRendererChromium::videoYUVPro
const LayerRendererChromium::VideoStreamTextureProgram* LayerRendererChromium::videoStreamTextureProgram()
{
if (!m_videoStreamTextureProgram)
- m_videoStreamTextureProgram = adoptPtr(new VideoStreamTextureProgram(m_context.get()));
+ m_videoStreamTextureProgram = adoptPtr(new VideoStreamTextureProgram(m_context));
if (!m_videoStreamTextureProgram->initialized()) {
TRACE_EVENT("LayerRendererChromium::streamTextureProgram::initialize", this, 0);
- m_videoStreamTextureProgram->initialize(m_context.get());
+ m_videoStreamTextureProgram->initialize(m_context);
}
return m_videoStreamTextureProgram.get();
}
@@ -1747,46 +1644,46 @@ void LayerRendererChromium::cleanupSharedObjects()
m_sharedGeometry.clear();
if (m_tileProgram)
- m_tileProgram->cleanup(m_context.get());
+ m_tileProgram->cleanup(m_context);
if (m_tileProgramOpaque)
- m_tileProgramOpaque->cleanup(m_context.get());
+ m_tileProgramOpaque->cleanup(m_context);
if (m_tileProgramSwizzle)
- m_tileProgramSwizzle->cleanup(m_context.get());
+ m_tileProgramSwizzle->cleanup(m_context);
if (m_tileProgramSwizzleOpaque)
- m_tileProgramSwizzleOpaque->cleanup(m_context.get());
+ m_tileProgramSwizzleOpaque->cleanup(m_context);
if (m_tileProgramAA)
- m_tileProgramAA->cleanup(m_context.get());
+ m_tileProgramAA->cleanup(m_context);
if (m_tileProgramSwizzleAA)
- m_tileProgramSwizzleAA->cleanup(m_context.get());
+ m_tileProgramSwizzleAA->cleanup(m_context);
if (m_tileCheckerboardProgram)
- m_tileCheckerboardProgram->cleanup(m_context.get());
+ m_tileCheckerboardProgram->cleanup(m_context);
if (m_renderPassMaskProgram)
- m_renderPassMaskProgram->cleanup(m_context.get());
+ m_renderPassMaskProgram->cleanup(m_context);
if (m_renderPassProgram)
- m_renderPassProgram->cleanup(m_context.get());
+ m_renderPassProgram->cleanup(m_context);
if (m_renderPassMaskProgramAA)
- m_renderPassMaskProgramAA->cleanup(m_context.get());
+ m_renderPassMaskProgramAA->cleanup(m_context);
if (m_renderPassProgramAA)
- m_renderPassProgramAA->cleanup(m_context.get());
+ m_renderPassProgramAA->cleanup(m_context);
if (m_textureProgram)
- m_textureProgram->cleanup(m_context.get());
+ m_textureProgram->cleanup(m_context);
if (m_textureProgramFlip)
- m_textureProgramFlip->cleanup(m_context.get());
+ m_textureProgramFlip->cleanup(m_context);
if (m_textureIOSurfaceProgram)
- m_textureIOSurfaceProgram->cleanup(m_context.get());
+ m_textureIOSurfaceProgram->cleanup(m_context);
if (m_videoYUVProgram)
- m_videoYUVProgram->cleanup(m_context.get());
+ m_videoYUVProgram->cleanup(m_context);
if (m_videoStreamTextureProgram)
- m_videoStreamTextureProgram->cleanup(m_context.get());
+ m_videoStreamTextureProgram->cleanup(m_context);
if (m_solidColorProgram)
- m_solidColorProgram->cleanup(m_context.get());
+ m_solidColorProgram->cleanup(m_context);
if (m_headsUpDisplayProgram)
- m_headsUpDisplayProgram->cleanup(m_context.get());
+ m_headsUpDisplayProgram->cleanup(m_context);
if (m_offscreenFramebufferId)
GLC(m_context, m_context->deleteFramebuffer(m_offscreenFramebufferId));
@@ -1799,7 +1696,7 @@ void LayerRendererChromium::cleanupSharedObjects()
bool LayerRendererChromium::isContextLost()
{
- return (m_context.get()->getExtensions()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR);
+ return (m_context->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR);
}
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
index f7ccb651f..34254b00b 100644
--- a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
+++ b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
@@ -40,6 +40,10 @@
#include "cc/CCRenderer.h"
#include <wtf/PassOwnPtr.h>
+namespace WebKit {
+class WebGraphicsContext3D;
+}
+
namespace WebCore {
class CCCheckerboardDrawQuad;
@@ -53,22 +57,23 @@ class CCTextureDrawQuad;
class CCTileDrawQuad;
class CCYUVVideoDrawQuad;
class GeometryBinding;
-class GraphicsContext3D;
-class LayerRendererSwapBuffersCompleteCallbackAdapter;
class ManagedTexture;
class ScopedEnsureFramebufferAllocation;
// Class that handles drawing of composited render layers using GL.
-class LayerRendererChromium : public CCRenderer {
+class LayerRendererChromium : public CCRenderer,
+ public WebKit::WebGraphicsContext3D::WebGraphicsSwapBuffersCompleteCallbackCHROMIUM,
+ public WebKit::WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM ,
+ public WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback {
WTF_MAKE_NONCOPYABLE(LayerRendererChromium);
public:
- static PassOwnPtr<LayerRendererChromium> create(CCRendererClient*, PassRefPtr<GraphicsContext3D>, TextureUploaderOption);
+ static PassOwnPtr<LayerRendererChromium> create(CCRendererClient*, WebKit::WebGraphicsContext3D*, TextureUploaderOption);
virtual ~LayerRendererChromium();
virtual const LayerRendererCapabilities& capabilities() const OVERRIDE { return m_capabilities; }
- GraphicsContext3D* context();
+ WebKit::WebGraphicsContext3D* context();
virtual void viewportChanged() OVERRIDE;
@@ -88,7 +93,7 @@ public:
// puts backbuffer onscreen
virtual bool swapBuffers(const IntRect& subBuffer) OVERRIDE;
- static void debugGLCall(GraphicsContext3D*, const char* command, const char* file, int line);
+ static void debugGLCall(WebKit::WebGraphicsContext3D*, const char* command, const char* file, int line);
const GeometryBinding* sharedGeometry() const { return m_sharedGeometry.get(); }
@@ -111,14 +116,11 @@ public:
float width, float height, float opacity, const FloatQuad&,
int matrixLocation, int alphaLocation, int quadLocation);
void copyTextureToFramebuffer(int textureId, const IntSize& bounds, const WebKit::WebTransformationMatrix& drawMatrix);
- void setGpuMemoryAllocation(Extensions3DChromium::GpuMemoryAllocationCHROMIUM);
protected:
- void discardFramebuffer();
- void ensureFramebuffer();
- bool isFramebufferDiscarded() const { return m_isFramebufferDiscarded; }
+ LayerRendererChromium(CCRendererClient*, WebKit::WebGraphicsContext3D*, TextureUploaderOption);
- LayerRendererChromium(CCRendererClient*, PassRefPtr<GraphicsContext3D>, TextureUploaderOption);
+ bool isFramebufferDiscarded() const { return m_isFramebufferDiscarded; }
bool initialize();
private:
@@ -154,8 +156,17 @@ private:
bool initializeSharedObjects();
void cleanupSharedObjects();
- friend class LayerRendererSwapBuffersCompleteCallbackAdapter;
- void onSwapBuffersComplete();
+ // WebKit::WebGraphicsContext3D::WebGraphicsSwapBuffersCompleteCallbackCHROMIUM implementation.
+ virtual void onSwapBuffersComplete() OVERRIDE;
+
+ // WebKit::WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM implementation.
+ virtual void onMemoryAllocationChanged(WebKit::WebGraphicsMemoryAllocation) OVERRIDE;
+ void onMemoryAllocationChangedOnImplThread(WebKit::WebGraphicsMemoryAllocation);
+ void discardFramebuffer();
+ void ensureFramebuffer();
+
+ // WebGraphicsContext3D::WebGraphicsContextLostCallback implementation.
+ virtual void onContextLost() OVERRIDE;
LayerRendererCapabilities m_capabilities;
@@ -252,7 +263,7 @@ private:
OwnPtr<TrackingTextureAllocator> m_contentsTextureAllocator;
OwnPtr<TrackingTextureAllocator> m_implTextureAllocator;
- RefPtr<GraphicsContext3D> m_context;
+ WebKit::WebGraphicsContext3D* m_context;
const CCRenderPass* m_defaultRenderPass;
diff --git a/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp b/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp
index 4bea9042f..4aa9965e7 100644
--- a/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp
+++ b/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp
@@ -89,7 +89,7 @@ void LayerTextureSubImage::uploadWithTexSubImage(const uint8_t* image, const Int
pixelSource = &m_subImage[0];
}
- GraphicsContext3D* context3d = context->context3D();
+ WebKit::WebGraphicsContext3D* context3d = context->context3D();
if (!context3d) {
// FIXME: Implement this path for software compositing.
return;
@@ -102,7 +102,7 @@ void LayerTextureSubImage::uploadWithMapTexSubImage(const uint8_t* image, const
GC3Denum format, CCGraphicsContext* context)
{
TRACE_EVENT("LayerTextureSubImage::uploadWithMapTexSubImage", this, 0);
- GraphicsContext3D* context3d = context->context3D();
+ WebKit::WebGraphicsContext3D* context3d = context->context3D();
if (!context3d) {
// FIXME: Implement this path for software compositing.
return;
@@ -112,8 +112,7 @@ void LayerTextureSubImage::uploadWithMapTexSubImage(const uint8_t* image, const
IntPoint offset(sourceRect.x() - imageRect.x(), sourceRect.y() - imageRect.y());
// Upload tile data via a mapped transfer buffer
- Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(context3d->getExtensions());
- uint8_t* pixelDest = static_cast<uint8_t*>(extensions->mapTexSubImage2DCHROMIUM(GraphicsContext3D::TEXTURE_2D, 0, destRect.x(), destRect.y(), destRect.width(), destRect.height(), format, GraphicsContext3D::UNSIGNED_BYTE, Extensions3DChromium::WRITE_ONLY));
+ uint8_t* pixelDest = static_cast<uint8_t*>(context3d->mapTexSubImage2DCHROMIUM(GraphicsContext3D::TEXTURE_2D, 0, destRect.x(), destRect.y(), destRect.width(), destRect.height(), format, GraphicsContext3D::UNSIGNED_BYTE, Extensions3DChromium::WRITE_ONLY));
if (!pixelDest) {
uploadWithTexSubImage(image, imageRect, sourceRect, destRect, format, context);
@@ -137,7 +136,7 @@ void LayerTextureSubImage::uploadWithMapTexSubImage(const uint8_t* image, const
&image[4 * (offset.x() + (offset.y() + row) * imageRect.width())],
destRect.width() * componentsPerPixel * bytesPerComponent);
}
- GLC(context3d, extensions->unmapTexSubImage2DCHROMIUM(pixelDest));
+ GLC(context3d, context3d->unmapTexSubImage2DCHROMIUM(pixelDest));
}
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/chromium/ManagedTexture.cpp b/Source/WebCore/platform/graphics/chromium/ManagedTexture.cpp
index b06aaa91b..4dabf1beb 100644
--- a/Source/WebCore/platform/graphics/chromium/ManagedTexture.cpp
+++ b/Source/WebCore/platform/graphics/chromium/ManagedTexture.cpp
@@ -30,6 +30,9 @@
#include "GraphicsContext3D.h"
#include "cc/CCGraphicsContext.h"
+#include <public/WebGraphicsContext3D.h>
+
+using WebKit::WebGraphicsContext3D;
namespace WebCore {
@@ -120,7 +123,7 @@ void ManagedTexture::allocate(TextureAllocator* allocator)
void ManagedTexture::bindTexture(CCGraphicsContext* context, TextureAllocator* allocator)
{
allocate(allocator);
- GraphicsContext3D* context3d = context->context3D();
+ WebGraphicsContext3D* context3d = context->context3D();
if (!context3d) {
// FIXME: Implement this path for software compositing.
return;
@@ -128,17 +131,6 @@ void ManagedTexture::bindTexture(CCGraphicsContext* context, TextureAllocator* a
context3d->bindTexture(GraphicsContext3D::TEXTURE_2D, m_textureId);
}
-void ManagedTexture::framebufferTexture2D(CCGraphicsContext* context, TextureAllocator* allocator)
-{
- allocate(allocator);
- GraphicsContext3D* context3d = context->context3D();
- if (!context3d) {
- // FIXME: Implement this path for software compositing.
- return;
- }
- context3d->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_textureId, 0);
-}
-
PassOwnPtr<ManagedTexture> ManagedTexture::steal()
{
OwnPtr<ManagedTexture> texture = adoptPtr(new ManagedTexture(m_textureManager, m_token, m_size, m_format, m_textureId));
diff --git a/Source/WebCore/platform/graphics/chromium/ManagedTexture.h b/Source/WebCore/platform/graphics/chromium/ManagedTexture.h
index 8a6566c31..6e67ebf68 100644
--- a/Source/WebCore/platform/graphics/chromium/ManagedTexture.h
+++ b/Source/WebCore/platform/graphics/chromium/ManagedTexture.h
@@ -59,7 +59,6 @@ public:
void allocate(TextureAllocator*);
void bindTexture(CCGraphicsContext*, TextureAllocator*);
- void framebufferTexture2D(CCGraphicsContext*, TextureAllocator*);
IntSize size() const { return m_size; }
unsigned format() const { return m_format; }
diff --git a/Source/WebCore/platform/graphics/chromium/PlatformColor.h b/Source/WebCore/platform/graphics/chromium/PlatformColor.h
index ab6545dce..a855215bd 100644
--- a/Source/WebCore/platform/graphics/chromium/PlatformColor.h
+++ b/Source/WebCore/platform/graphics/chromium/PlatformColor.h
@@ -29,6 +29,7 @@
#include "Extensions3D.h"
#include "GraphicsContext3D.h"
#include "SkTypes.h"
+#include <public/WebGraphicsContext3D.h>
namespace WebCore {
@@ -40,14 +41,14 @@ public:
}
// Returns the most efficient texture format for this platform.
- static GC3Denum bestTextureFormat(GraphicsContext3D* context)
+ static GC3Denum bestTextureFormat(WebKit::WebGraphicsContext3D* context, bool supportsBGRA8888)
{
GC3Denum textureFormat = GraphicsContext3D::RGBA;
switch (format()) {
case GraphicsContext3D::SourceFormatRGBA8:
break;
case GraphicsContext3D::SourceFormatBGRA8:
- if (context->getExtensions()->supports("GL_EXT_texture_format_BGRA8888"))
+ if (supportsBGRA8888)
textureFormat = Extensions3D::BGRA_EXT;
break;
default:
diff --git a/Source/WebCore/platform/graphics/chromium/ProgramBinding.cpp b/Source/WebCore/platform/graphics/chromium/ProgramBinding.cpp
index 376434e62..6afbb34ae 100644
--- a/Source/WebCore/platform/graphics/chromium/ProgramBinding.cpp
+++ b/Source/WebCore/platform/graphics/chromium/ProgramBinding.cpp
@@ -29,12 +29,13 @@
#include "ProgramBinding.h"
-#include "Extensions3D.h"
#include "GeometryBinding.h"
-#include "GraphicsContext.h"
#include "GraphicsContext3D.h"
#include "LayerRendererChromium.h"
#include "TraceEvent.h"
+#include <public/WebGraphicsContext3D.h>
+
+using WebKit::WebGraphicsContext3D;
namespace WebCore {
@@ -51,19 +52,19 @@ ProgramBindingBase::~ProgramBindingBase()
ASSERT(!m_initialized);
}
-static bool contextLost(GraphicsContext3D* context)
+static bool contextLost(WebGraphicsContext3D* context)
{
- return (context->getExtensions()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR);
+ return (context->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR);
}
-void ProgramBindingBase::init(GraphicsContext3D* context, const String& vertexShader, const String& fragmentShader)
+void ProgramBindingBase::init(WebGraphicsContext3D* context, const String& vertexShader, const String& fragmentShader)
{
m_program = createShaderProgram(context, vertexShader, fragmentShader);
ASSERT(m_program || contextLost(context));
}
-void ProgramBindingBase::cleanup(GraphicsContext3D* context)
+void ProgramBindingBase::cleanup(WebGraphicsContext3D* context)
{
m_initialized = false;
if (!m_program)
@@ -74,13 +75,13 @@ void ProgramBindingBase::cleanup(GraphicsContext3D* context)
m_program = 0;
}
-unsigned ProgramBindingBase::loadShader(GraphicsContext3D* context, unsigned type, const String& shaderSource)
+unsigned ProgramBindingBase::loadShader(WebGraphicsContext3D* context, unsigned type, const String& shaderSource)
{
unsigned shader = context->createShader(type);
if (!shader)
return 0;
String sourceString(shaderSource);
- GLC(context, context->shaderSource(shader, sourceString));
+ GLC(context, context->shaderSource(shader, sourceString.utf8().data()));
GLC(context, context->compileShader(shader));
#ifndef NDEBUG
int compiled = 0;
@@ -93,9 +94,9 @@ unsigned ProgramBindingBase::loadShader(GraphicsContext3D* context, unsigned typ
return shader;
}
-unsigned ProgramBindingBase::createShaderProgram(GraphicsContext3D* context, const String& vertexShaderSource, const String& fragmentShaderSource)
+unsigned ProgramBindingBase::createShaderProgram(WebGraphicsContext3D* context, const String& vertexShaderSource, const String& fragmentShaderSource)
{
- TRACE_EVENT("ProgramBindingBase::createShaderProgram", this, 0);
+ TRACE_EVENT0("cc", "ProgramBindingBase::createShaderProgram");
unsigned vertexShader = loadShader(context, GraphicsContext3D::VERTEX_SHADER, vertexShaderSource);
if (!vertexShader) {
if (!contextLost(context))
diff --git a/Source/WebCore/platform/graphics/chromium/ProgramBinding.h b/Source/WebCore/platform/graphics/chromium/ProgramBinding.h
index aea285689..39048f903 100644
--- a/Source/WebCore/platform/graphics/chromium/ProgramBinding.h
+++ b/Source/WebCore/platform/graphics/chromium/ProgramBinding.h
@@ -28,27 +28,29 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "PlatformString.h"
+#include <wtf/text/WTFString.h>
-namespace WebCore {
+namespace WebKit {
+class WebGraphicsContext3D;
+}
-class GraphicsContext3D;
+namespace WebCore {
class ProgramBindingBase {
public:
ProgramBindingBase();
~ProgramBindingBase();
- void init(GraphicsContext3D*, const String& vertexShader, const String& fragmentShader);
- void cleanup(GraphicsContext3D*);
+ void init(WebKit::WebGraphicsContext3D*, const String& vertexShader, const String& fragmentShader);
+ void cleanup(WebKit::WebGraphicsContext3D*);
unsigned program() const { ASSERT(m_initialized); return m_program; }
bool initialized() const { return m_initialized; }
protected:
- unsigned loadShader(GraphicsContext3D*, unsigned type, const String& shaderSource);
- unsigned createShaderProgram(GraphicsContext3D*, const String& vertexShaderSource, const String& fragmentShaderSource);
+ unsigned loadShader(WebKit::WebGraphicsContext3D*, unsigned type, const String& shaderSource);
+ unsigned createShaderProgram(WebKit::WebGraphicsContext3D*, const String& vertexShaderSource, const String& fragmentShaderSource);
unsigned m_program;
bool m_initialized;
@@ -57,12 +59,12 @@ protected:
template<class VertexShader, class FragmentShader>
class ProgramBinding : public ProgramBindingBase {
public:
- explicit ProgramBinding(GraphicsContext3D* context)
+ explicit ProgramBinding(WebKit::WebGraphicsContext3D* context)
{
ProgramBindingBase::init(context, m_vertexShader.getShaderString(), m_fragmentShader.getShaderString());
}
- void initialize(GraphicsContext3D* context)
+ void initialize(WebKit::WebGraphicsContext3D* context)
{
ASSERT(context);
ASSERT(m_program);
diff --git a/Source/WebCore/platform/graphics/chromium/ShaderChromium.cpp b/Source/WebCore/platform/graphics/chromium/ShaderChromium.cpp
index 6ed6f4a8e..2a140d1d7 100644
--- a/Source/WebCore/platform/graphics/chromium/ShaderChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/ShaderChromium.cpp
@@ -29,12 +29,13 @@
#include "ShaderChromium.h"
-#include "GraphicsContext.h"
-#include "GraphicsContext3D.h"
+#include <public/WebGraphicsContext3D.h>
#define SHADER0(Src) #Src
#define SHADER(Src) SHADER0(Src)
+using WebKit::WebGraphicsContext3D;
+
namespace WebCore {
VertexShaderPosTex::VertexShaderPosTex()
@@ -42,7 +43,7 @@ VertexShaderPosTex::VertexShaderPosTex()
{
}
-void VertexShaderPosTex::init(GraphicsContext3D* context, unsigned program)
+void VertexShaderPosTex::init(WebGraphicsContext3D* context, unsigned program)
{
m_matrixLocation = context->getUniformLocation(program, "matrix");
ASSERT(m_matrixLocation != -1);
@@ -70,7 +71,7 @@ VertexShaderPosTexYUVStretch::VertexShaderPosTexYUVStretch()
{
}
-void VertexShaderPosTexYUVStretch::init(GraphicsContext3D* context, unsigned program)
+void VertexShaderPosTexYUVStretch::init(WebGraphicsContext3D* context, unsigned program)
{
m_matrixLocation = context->getUniformLocation(program, "matrix");
m_yWidthScaleFactorLocation = context->getUniformLocation(program, "y_widthScaleFactor");
@@ -103,7 +104,7 @@ VertexShaderPos::VertexShaderPos()
{
}
-void VertexShaderPos::init(GraphicsContext3D* context, unsigned program)
+void VertexShaderPos::init(WebGraphicsContext3D* context, unsigned program)
{
m_matrixLocation = context->getUniformLocation(program, "matrix");
ASSERT(m_matrixLocation != -1);
@@ -127,7 +128,7 @@ VertexShaderPosTexTransform::VertexShaderPosTexTransform()
{
}
-void VertexShaderPosTexTransform::init(GraphicsContext3D* context, unsigned program)
+void VertexShaderPosTexTransform::init(WebGraphicsContext3D* context, unsigned program)
{
m_matrixLocation = context->getUniformLocation(program, "matrix");
m_texTransformLocation = context->getUniformLocation(program, "texTransform");
@@ -169,7 +170,7 @@ String VertexShaderPosTexIdentity::getShaderString() const
);
}
-void VertexShaderQuad::init(GraphicsContext3D* context, unsigned program)
+void VertexShaderQuad::init(WebGraphicsContext3D* context, unsigned program)
{
m_matrixLocation = context->getUniformLocation(program, "matrix");
m_pointLocation = context->getUniformLocation(program, "point");
@@ -205,7 +206,7 @@ VertexShaderTile::VertexShaderTile()
{
}
-void VertexShaderTile::init(GraphicsContext3D* context, unsigned program)
+void VertexShaderTile::init(WebGraphicsContext3D* context, unsigned program)
{
m_matrixLocation = context->getUniformLocation(program, "matrix");
m_pointLocation = context->getUniformLocation(program, "point");
@@ -242,7 +243,7 @@ VertexShaderVideoTransform::VertexShaderVideoTransform()
{
}
-bool VertexShaderVideoTransform::init(GraphicsContext3D* context, unsigned program)
+bool VertexShaderVideoTransform::init(WebGraphicsContext3D* context, unsigned program)
{
m_matrixLocation = context->getUniformLocation(program, "matrix");
m_texMatrixLocation = context->getUniformLocation(program, "texMatrix");
@@ -271,7 +272,7 @@ FragmentTexAlphaBinding::FragmentTexAlphaBinding()
{
}
-void FragmentTexAlphaBinding::init(GraphicsContext3D* context, unsigned program)
+void FragmentTexAlphaBinding::init(WebGraphicsContext3D* context, unsigned program)
{
m_samplerLocation = context->getUniformLocation(program, "s_texture");
m_alphaLocation = context->getUniformLocation(program, "alpha");
@@ -284,7 +285,7 @@ FragmentTexOpaqueBinding::FragmentTexOpaqueBinding()
{
}
-void FragmentTexOpaqueBinding::init(GraphicsContext3D* context, unsigned program)
+void FragmentTexOpaqueBinding::init(WebGraphicsContext3D* context, unsigned program)
{
m_samplerLocation = context->getUniformLocation(program, "s_texture");
@@ -306,7 +307,7 @@ String FragmentShaderRGBATexFlipAlpha::getShaderString() const
);
}
-bool FragmentShaderOESImageExternal::init(GraphicsContext3D* context, unsigned program)
+bool FragmentShaderOESImageExternal::init(WebGraphicsContext3D* context, unsigned program)
{
m_samplerLocation = context->getUniformLocation(program, "s_texture");
@@ -436,7 +437,7 @@ FragmentShaderRGBATexAlphaAA::FragmentShaderRGBATexAlphaAA()
{
}
-void FragmentShaderRGBATexAlphaAA::init(GraphicsContext3D* context, unsigned program)
+void FragmentShaderRGBATexAlphaAA::init(WebGraphicsContext3D* context, unsigned program)
{
m_samplerLocation = context->getUniformLocation(program, "s_texture");
m_alphaLocation = context->getUniformLocation(program, "alpha");
@@ -478,7 +479,7 @@ FragmentTexClampAlphaAABinding::FragmentTexClampAlphaAABinding()
{
}
-void FragmentTexClampAlphaAABinding::init(GraphicsContext3D* context, unsigned program)
+void FragmentTexClampAlphaAABinding::init(WebGraphicsContext3D* context, unsigned program)
{
m_samplerLocation = context->getUniformLocation(program, "s_texture");
m_alphaLocation = context->getUniformLocation(program, "alpha");
@@ -549,7 +550,7 @@ FragmentShaderRGBATexAlphaMask::FragmentShaderRGBATexAlphaMask()
{
}
-void FragmentShaderRGBATexAlphaMask::init(GraphicsContext3D* context, unsigned program)
+void FragmentShaderRGBATexAlphaMask::init(WebGraphicsContext3D* context, unsigned program)
{
m_samplerLocation = context->getUniformLocation(program, "s_texture");
m_maskSamplerLocation = context->getUniformLocation(program, "s_mask");
@@ -582,7 +583,7 @@ FragmentShaderRGBATexAlphaMaskAA::FragmentShaderRGBATexAlphaMaskAA()
{
}
-void FragmentShaderRGBATexAlphaMaskAA::init(GraphicsContext3D* context, unsigned program)
+void FragmentShaderRGBATexAlphaMaskAA::init(WebGraphicsContext3D* context, unsigned program)
{
m_samplerLocation = context->getUniformLocation(program, "s_texture");
m_maskSamplerLocation = context->getUniformLocation(program, "s_mask");
@@ -628,7 +629,7 @@ FragmentShaderYUVVideo::FragmentShaderYUVVideo()
{
}
-void FragmentShaderYUVVideo::init(GraphicsContext3D* context, unsigned program)
+void FragmentShaderYUVVideo::init(WebGraphicsContext3D* context, unsigned program)
{
m_yTextureLocation = context->getUniformLocation(program, "y_texture");
m_uTextureLocation = context->getUniformLocation(program, "u_texture");
@@ -671,7 +672,7 @@ FragmentShaderColor::FragmentShaderColor()
{
}
-void FragmentShaderColor::init(GraphicsContext3D* context, unsigned program)
+void FragmentShaderColor::init(WebGraphicsContext3D* context, unsigned program)
{
m_colorLocation = context->getUniformLocation(program, "color");
ASSERT(m_colorLocation != -1);
@@ -696,7 +697,7 @@ FragmentShaderCheckerboard::FragmentShaderCheckerboard()
{
}
-void FragmentShaderCheckerboard::init(GraphicsContext3D* context, unsigned program)
+void FragmentShaderCheckerboard::init(WebGraphicsContext3D* context, unsigned program)
{
m_alphaLocation = context->getUniformLocation(program, "alpha");
m_texTransformLocation = context->getUniformLocation(program, "texTransform");
diff --git a/Source/WebCore/platform/graphics/chromium/ShaderChromium.h b/Source/WebCore/platform/graphics/chromium/ShaderChromium.h
index 9277ecca5..475b78962 100644
--- a/Source/WebCore/platform/graphics/chromium/ShaderChromium.h
+++ b/Source/WebCore/platform/graphics/chromium/ShaderChromium.h
@@ -31,15 +31,17 @@
#include "PlatformString.h"
#include "SkColorPriv.h"
-namespace WebCore {
+namespace WebKit {
+class WebGraphicsContext3D;
+}
-class GraphicsContext3D;
+namespace WebCore {
class VertexShaderPosTex {
public:
VertexShaderPosTex();
- void init(GraphicsContext3D*, unsigned program);
+ void init(WebKit::WebGraphicsContext3D*, unsigned program);
String getShaderString() const;
int matrixLocation() const { return m_matrixLocation; }
@@ -52,7 +54,7 @@ class VertexShaderPosTexYUVStretch {
public:
VertexShaderPosTexYUVStretch();
- void init(GraphicsContext3D*, unsigned program);
+ void init(WebKit::WebGraphicsContext3D*, unsigned program);
String getShaderString() const;
int matrixLocation() const { return m_matrixLocation; }
@@ -69,7 +71,7 @@ class VertexShaderPos {
public:
VertexShaderPos();
- void init(GraphicsContext3D*, unsigned program);
+ void init(WebKit::WebGraphicsContext3D*, unsigned program);
String getShaderString() const;
int matrixLocation() const { return m_matrixLocation; }
@@ -80,7 +82,7 @@ private:
class VertexShaderPosTexIdentity {
public:
- void init(GraphicsContext3D*, unsigned program) { }
+ void init(WebKit::WebGraphicsContext3D*, unsigned program) { }
String getShaderString() const;
};
@@ -88,7 +90,7 @@ class VertexShaderPosTexTransform {
public:
VertexShaderPosTexTransform();
- void init(GraphicsContext3D*, unsigned program);
+ void init(WebKit::WebGraphicsContext3D*, unsigned program);
String getShaderString() const;
int matrixLocation() const { return m_matrixLocation; }
@@ -103,7 +105,7 @@ class VertexShaderQuad {
public:
VertexShaderQuad();
- void init(GraphicsContext3D*, unsigned program);
+ void init(WebKit::WebGraphicsContext3D*, unsigned program);
String getShaderString() const;
int matrixLocation() const { return m_matrixLocation; }
@@ -118,7 +120,7 @@ class VertexShaderTile {
public:
VertexShaderTile();
- void init(GraphicsContext3D*, unsigned program);
+ void init(WebKit::WebGraphicsContext3D*, unsigned program);
String getShaderString() const;
int matrixLocation() const { return m_matrixLocation; }
@@ -135,7 +137,7 @@ class VertexShaderVideoTransform {
public:
VertexShaderVideoTransform();
- bool init(GraphicsContext3D*, unsigned program);
+ bool init(WebKit::WebGraphicsContext3D*, unsigned program);
String getShaderString() const;
int matrixLocation() const { return m_matrixLocation; }
@@ -150,7 +152,7 @@ class FragmentTexAlphaBinding {
public:
FragmentTexAlphaBinding();
- void init(GraphicsContext3D*, unsigned program);
+ void init(WebKit::WebGraphicsContext3D*, unsigned program);
int alphaLocation() const { return m_alphaLocation; }
int edgeLocation() const { return -1; }
int fragmentTexTransformLocation() const { return -1; }
@@ -165,7 +167,7 @@ class FragmentTexOpaqueBinding {
public:
FragmentTexOpaqueBinding();
- void init(GraphicsContext3D*, unsigned program);
+ void init(WebKit::WebGraphicsContext3D*, unsigned program);
int alphaLocation() const { return -1; }
int edgeLocation() const { return -1; }
int fragmentTexTransformLocation() const { return -1; }
@@ -221,7 +223,7 @@ public:
class FragmentShaderOESImageExternal : public FragmentTexAlphaBinding {
public:
String getShaderString() const;
- bool init(GraphicsContext3D*, unsigned program);
+ bool init(WebKit::WebGraphicsContext3D*, unsigned program);
private:
int m_samplerLocation;
};
@@ -230,7 +232,7 @@ class FragmentShaderRGBATexAlphaAA {
public:
FragmentShaderRGBATexAlphaAA();
- void init(GraphicsContext3D*, unsigned program);
+ void init(WebKit::WebGraphicsContext3D*, unsigned program);
String getShaderString() const;
int alphaLocation() const { return m_alphaLocation; }
@@ -247,7 +249,7 @@ class FragmentTexClampAlphaAABinding {
public:
FragmentTexClampAlphaAABinding();
- void init(GraphicsContext3D*, unsigned program);
+ void init(WebKit::WebGraphicsContext3D*, unsigned program);
int alphaLocation() const { return m_alphaLocation; }
int samplerLocation() const { return m_samplerLocation; }
int fragmentTexTransformLocation() const { return m_fragmentTexTransformLocation; }
@@ -276,7 +278,7 @@ public:
FragmentShaderRGBATexAlphaMask();
String getShaderString() const;
- void init(GraphicsContext3D*, unsigned program);
+ void init(WebKit::WebGraphicsContext3D*, unsigned program);
int alphaLocation() const { return m_alphaLocation; }
int samplerLocation() const { return m_samplerLocation; }
int maskSamplerLocation() const { return m_maskSamplerLocation; }
@@ -292,7 +294,7 @@ public:
FragmentShaderRGBATexAlphaMaskAA();
String getShaderString() const;
- void init(GraphicsContext3D*, unsigned program);
+ void init(WebKit::WebGraphicsContext3D*, unsigned program);
int alphaLocation() const { return m_alphaLocation; }
int samplerLocation() const { return m_samplerLocation; }
int maskSamplerLocation() const { return m_maskSamplerLocation; }
@@ -310,7 +312,7 @@ public:
FragmentShaderYUVVideo();
String getShaderString() const;
- void init(GraphicsContext3D*, unsigned program);
+ void init(WebKit::WebGraphicsContext3D*, unsigned program);
int yTextureLocation() const { return m_yTextureLocation; }
int uTextureLocation() const { return m_uTextureLocation; }
@@ -333,7 +335,7 @@ public:
FragmentShaderColor();
String getShaderString() const;
- void init(GraphicsContext3D*, unsigned program);
+ void init(WebKit::WebGraphicsContext3D*, unsigned program);
int colorLocation() const { return m_colorLocation; }
private:
@@ -345,7 +347,7 @@ public:
FragmentShaderCheckerboard();
String getShaderString() const;
- void init(GraphicsContext3D*, unsigned program);
+ void init(WebKit::WebGraphicsContext3D*, unsigned program);
int alphaLocation() const { return m_alphaLocation; }
int texTransformLocation() const { return m_texTransformLocation; }
int frequencyLocation() const { return m_frequencyLocation; }
diff --git a/Source/WebCore/platform/graphics/chromium/TextureCopier.cpp b/Source/WebCore/platform/graphics/chromium/TextureCopier.cpp
index a29c28551..0f2309068 100644
--- a/Source/WebCore/platform/graphics/chromium/TextureCopier.cpp
+++ b/Source/WebCore/platform/graphics/chromium/TextureCopier.cpp
@@ -25,16 +25,19 @@
#include "config.h"
#include "TextureCopier.h"
-#include "TraceEvent.h"
+#include "GraphicsContext3D.h"
#include "LayerRendererChromium.h" // For the GLC() macro
+#include "TraceEvent.h"
+#include <public/WebGraphicsContext3D.h>
namespace WebCore {
#if USE(ACCELERATED_COMPOSITING)
-AcceleratedTextureCopier::AcceleratedTextureCopier(PassRefPtr<GraphicsContext3D> context)
+AcceleratedTextureCopier::AcceleratedTextureCopier(WebKit::WebGraphicsContext3D* context)
: m_context(context)
{
+ ASSERT(m_context);
GLC(m_context, m_fbo = m_context->createFramebuffer());
GLC(m_context, m_positionBuffer = m_context->createBuffer());
@@ -45,17 +48,17 @@ AcceleratedTextureCopier::AcceleratedTextureCopier(PassRefPtr<GraphicsContext3D>
{-1, 1, 0, 1}
};
- GLC(m_context.get(), m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, m_positionBuffer));
- GLC(m_context.get(), m_context->bufferData(GraphicsContext3D::ARRAY_BUFFER, sizeof(kPositions), kPositions, GraphicsContext3D::STATIC_DRAW));
- GLC(m_context.get(), m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, 0));
+ GLC(m_context, m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, m_positionBuffer));
+ GLC(m_context, m_context->bufferData(GraphicsContext3D::ARRAY_BUFFER, sizeof(kPositions), kPositions, GraphicsContext3D::STATIC_DRAW));
+ GLC(m_context, m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, 0));
- m_blitProgram = adoptPtr(new BlitProgram(m_context.get()));
+ m_blitProgram = adoptPtr(new BlitProgram(m_context));
}
AcceleratedTextureCopier::~AcceleratedTextureCopier()
{
if (m_blitProgram)
- m_blitProgram->cleanup(m_context.get());
+ m_blitProgram->cleanup(m_context);
if (m_positionBuffer)
GLC(m_context, m_context->deleteBuffer(m_positionBuffer));
if (m_fbo)
@@ -66,7 +69,7 @@ void AcceleratedTextureCopier::copyTexture(CCGraphicsContext* ccContext, unsigne
{
TRACE_EVENT("TextureCopier::copyTexture", this, 0);
- GraphicsContext3D* context = ccContext->context3D();
+ WebKit::WebGraphicsContext3D* context = ccContext->context3D();
if (!context) {
// FIXME: Implement this path for software compositing.
return;
diff --git a/Source/WebCore/platform/graphics/chromium/TextureCopier.h b/Source/WebCore/platform/graphics/chromium/TextureCopier.h
index 3ac2d1191..646189ab6 100644
--- a/Source/WebCore/platform/graphics/chromium/TextureCopier.h
+++ b/Source/WebCore/platform/graphics/chromium/TextureCopier.h
@@ -29,9 +29,13 @@
#include "ProgramBinding.h"
#include "ShaderChromium.h"
#include "cc/CCGraphicsContext.h"
-#include <wtf/PassRefPtr.h>
+
+namespace WebKit {
+class WebGraphicsContext3D;
+}
namespace WebCore {
+class IntSize;
class TextureCopier {
public:
@@ -49,7 +53,7 @@ protected:
class AcceleratedTextureCopier : public TextureCopier {
WTF_MAKE_NONCOPYABLE(AcceleratedTextureCopier);
public:
- static PassOwnPtr<AcceleratedTextureCopier> create(PassRefPtr<GraphicsContext3D> context)
+ static PassOwnPtr<AcceleratedTextureCopier> create(WebKit::WebGraphicsContext3D* context)
{
return adoptPtr(new AcceleratedTextureCopier(context));
}
@@ -58,12 +62,12 @@ public:
virtual void copyTexture(CCGraphicsContext*, unsigned sourceTextureId, unsigned destTextureId, const IntSize&);
protected:
- explicit AcceleratedTextureCopier(PassRefPtr<GraphicsContext3D>);
+ explicit AcceleratedTextureCopier(WebKit::WebGraphicsContext3D*);
private:
typedef ProgramBinding<VertexShaderPosTexIdentity, FragmentShaderRGBATex> BlitProgram;
- RefPtr<GraphicsContext3D> m_context;
+ WebKit::WebGraphicsContext3D* m_context;
Platform3DObject m_fbo;
Platform3DObject m_positionBuffer;
OwnPtr<BlitProgram> m_blitProgram;
diff --git a/Source/WebCore/platform/graphics/chromium/TextureManager.h b/Source/WebCore/platform/graphics/chromium/TextureManager.h
index 7ca14f437..47a189bcc 100644
--- a/Source/WebCore/platform/graphics/chromium/TextureManager.h
+++ b/Source/WebCore/platform/graphics/chromium/TextureManager.h
@@ -28,7 +28,6 @@
#include "GraphicsContext3D.h"
#include "IntRect.h"
#include "IntSize.h"
-
#include <wtf/FastAllocBase.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
diff --git a/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.cpp b/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.cpp
index f5cf2a4e1..a8253d065 100644
--- a/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.cpp
+++ b/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.cpp
@@ -27,6 +27,7 @@
#include "ThrottledTextureUploader.h"
#include "Extensions3DChromium.h"
+#include <public/WebGraphicsContext3D.h>
namespace {
@@ -37,57 +38,52 @@ static const size_t maxPendingQueries = 2;
namespace WebCore {
-ThrottledTextureUploader::Query::Query(PassRefPtr<GraphicsContext3D> context)
+ThrottledTextureUploader::Query::Query(WebKit::WebGraphicsContext3D* context)
: m_context(context)
, m_queryId(0)
{
- Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(m_context->getExtensions());
- m_queryId = extensions->createQueryEXT();
+ m_queryId = m_context->createQueryEXT();
}
ThrottledTextureUploader::Query::~Query()
{
- Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(m_context->getExtensions());
- extensions->deleteQueryEXT(m_queryId);
+ m_context->deleteQueryEXT(m_queryId);
}
void ThrottledTextureUploader::Query::begin()
{
- Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(m_context->getExtensions());
- extensions->beginQueryEXT(Extensions3DChromium::COMMANDS_ISSUED_CHROMIUM, m_queryId);
+ m_context->beginQueryEXT(Extensions3DChromium::COMMANDS_ISSUED_CHROMIUM, m_queryId);
}
void ThrottledTextureUploader::Query::end()
{
- Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(m_context->getExtensions());
- extensions->endQueryEXT(Extensions3DChromium::COMMANDS_ISSUED_CHROMIUM);
+ m_context->endQueryEXT(Extensions3DChromium::COMMANDS_ISSUED_CHROMIUM);
}
bool ThrottledTextureUploader::Query::isPending()
{
- Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(m_context->getExtensions());
unsigned available = 1;
- extensions->getQueryObjectuivEXT(m_queryId, Extensions3DChromium::QUERY_RESULT_AVAILABLE_EXT, &available);
+ m_context->getQueryObjectuivEXT(m_queryId, Extensions3DChromium::QUERY_RESULT_AVAILABLE_EXT, &available);
return !available;
}
void ThrottledTextureUploader::Query::wait()
{
- Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(m_context->getExtensions());
unsigned result;
- extensions->getQueryObjectuivEXT(m_queryId, Extensions3DChromium::QUERY_RESULT_EXT, &result);
+ m_context->getQueryObjectuivEXT(m_queryId, Extensions3DChromium::QUERY_RESULT_EXT, &result);
}
-ThrottledTextureUploader::ThrottledTextureUploader(PassRefPtr<GraphicsContext3D> context)
+ThrottledTextureUploader::ThrottledTextureUploader(WebKit::WebGraphicsContext3D* context)
: m_context(context)
, m_maxPendingQueries(maxPendingQueries)
{
}
-ThrottledTextureUploader::ThrottledTextureUploader(PassRefPtr<GraphicsContext3D> context, size_t pendingUploadLimit)
+ThrottledTextureUploader::ThrottledTextureUploader(WebKit::WebGraphicsContext3D* context, size_t pendingUploadLimit)
: m_context(context)
, m_maxPendingQueries(pendingUploadLimit)
{
+ ASSERT(m_context);
}
ThrottledTextureUploader::~ThrottledTextureUploader()
diff --git a/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.h b/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.h
index dea3d354c..ae5b7491f 100644
--- a/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.h
+++ b/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.h
@@ -29,16 +29,20 @@
#include <wtf/Deque.h>
+namespace WebKit {
+class WebGraphicsContext3D;
+}
+
namespace WebCore {
class ThrottledTextureUploader : public TextureUploader {
WTF_MAKE_NONCOPYABLE(ThrottledTextureUploader);
public:
- static PassOwnPtr<ThrottledTextureUploader> create(PassRefPtr<GraphicsContext3D> context)
+ static PassOwnPtr<ThrottledTextureUploader> create(WebKit::WebGraphicsContext3D* context)
{
return adoptPtr(new ThrottledTextureUploader(context));
}
- static PassOwnPtr<ThrottledTextureUploader> create(PassRefPtr<GraphicsContext3D> context, size_t pendingUploadLimit)
+ static PassOwnPtr<ThrottledTextureUploader> create(WebKit::WebGraphicsContext3D* context, size_t pendingUploadLimit)
{
return adoptPtr(new ThrottledTextureUploader(context, pendingUploadLimit));
}
@@ -52,7 +56,7 @@ public:
private:
class Query {
public:
- static PassOwnPtr<Query> create(PassRefPtr<GraphicsContext3D> context) { return adoptPtr(new Query(context)); }
+ static PassOwnPtr<Query> create(WebKit::WebGraphicsContext3D* context) { return adoptPtr(new Query(context)); }
virtual ~Query();
@@ -62,18 +66,18 @@ private:
void wait();
private:
- explicit Query(PassRefPtr<GraphicsContext3D>);
+ explicit Query(WebKit::WebGraphicsContext3D*);
- RefPtr<GraphicsContext3D> m_context;
+ WebKit::WebGraphicsContext3D* m_context;
unsigned m_queryId;
};
- ThrottledTextureUploader(PassRefPtr<GraphicsContext3D>);
- ThrottledTextureUploader(PassRefPtr<GraphicsContext3D>, size_t pendingUploadLimit);
+ ThrottledTextureUploader(WebKit::WebGraphicsContext3D*);
+ ThrottledTextureUploader(WebKit::WebGraphicsContext3D*, size_t pendingUploadLimit);
void processQueries();
- RefPtr<GraphicsContext3D> m_context;
+ WebKit::WebGraphicsContext3D* m_context;
size_t m_maxPendingQueries;
Deque<OwnPtr<Query> > m_pendingQueries;
Deque<OwnPtr<Query> > m_availableQueries;
diff --git a/Source/WebCore/platform/graphics/chromium/TrackingTextureAllocator.cpp b/Source/WebCore/platform/graphics/chromium/TrackingTextureAllocator.cpp
index 957711eaa..8e586e25a 100644
--- a/Source/WebCore/platform/graphics/chromium/TrackingTextureAllocator.cpp
+++ b/Source/WebCore/platform/graphics/chromium/TrackingTextureAllocator.cpp
@@ -27,17 +27,19 @@
#include "TrackingTextureAllocator.h"
#include "Extensions3DChromium.h"
+#include "GraphicsContext3D.h"
#include "IntRect.h"
#include "LayerRendererChromium.h" // For the GLC() macro
namespace WebCore {
-TrackingTextureAllocator::TrackingTextureAllocator(PassRefPtr<GraphicsContext3D> context)
+TrackingTextureAllocator::TrackingTextureAllocator(WebKit::WebGraphicsContext3D* context)
: m_context(context)
, m_currentMemoryUseBytes(0)
, m_textureUsageHint(Any)
, m_useTextureStorageExt(false)
{
+ ASSERT(m_context);
}
TrackingTextureAllocator::~TrackingTextureAllocator()
@@ -72,23 +74,22 @@ unsigned TrackingTextureAllocator::createTexture(const IntSize& size, GC3Denum f
m_currentMemoryUseBytes += TextureManager::memoryUseBytes(size, format);
unsigned textureId = 0;
- GLC(m_context.get(), textureId = m_context->createTexture());
- GLC(m_context.get(), m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, textureId));
+ GLC(m_context, textureId = m_context->createTexture());
+ GLC(m_context, m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, textureId));
// Do basic linear filtering on resize.
- GLC(m_context.get(), m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR));
- GLC(m_context.get(), m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR));
+ GLC(m_context, m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR));
+ GLC(m_context, m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR));
// NPOT textures in GL ES only work when the wrap mode is set to GraphicsContext3D::CLAMP_TO_EDGE.
- GLC(m_context.get(), m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE));
- GLC(m_context.get(), m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE));
+ GLC(m_context, m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE));
+ GLC(m_context, m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE));
if (m_textureUsageHint == FramebufferAttachment)
- GLC(m_context.get(), m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, Extensions3DChromium::GL_TEXTURE_USAGE_ANGLE, Extensions3DChromium::GL_FRAMEBUFFER_ATTACHMENT_ANGLE));
+ GLC(m_context, m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, Extensions3DChromium::GL_TEXTURE_USAGE_ANGLE, Extensions3DChromium::GL_FRAMEBUFFER_ATTACHMENT_ANGLE));
if (m_useTextureStorageExt && isTextureFormatSupportedForStorage(format)) {
- Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(m_context->getExtensions());
GC3Denum storageFormat = textureToStorageFormat(format);
- extensions->texStorage2DEXT(GraphicsContext3D::TEXTURE_2D, 1, storageFormat, size.width(), size.height());
+ m_context->texStorage2DEXT(GraphicsContext3D::TEXTURE_2D, 1, storageFormat, size.width(), size.height());
} else
- GLC(m_context.get(), m_context->texImage2DResourceSafe(GraphicsContext3D::TEXTURE_2D, 0, format, size.width(), size.height(), 0, format, GraphicsContext3D::UNSIGNED_BYTE));
+ GLC(m_context, m_context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, format, size.width(), size.height(), 0, format, GraphicsContext3D::UNSIGNED_BYTE, 0));
m_allocatedTextureIds.add(textureId);
return textureId;
}
@@ -96,7 +97,8 @@ unsigned TrackingTextureAllocator::createTexture(const IntSize& size, GC3Denum f
void TrackingTextureAllocator::deleteTexture(unsigned textureId, const IntSize& size, GC3Denum format)
{
m_currentMemoryUseBytes -= TextureManager::memoryUseBytes(size, format);
- GLC(m_context.get(), m_context->deleteTexture(textureId));
+ GLC(m_context, m_context->deleteTexture(textureId));
+ GLC(m_context, m_context->deleteTexture(textureId));
ASSERT(m_allocatedTextureIds.contains(textureId));
m_allocatedTextureIds.remove(textureId);
}
@@ -104,7 +106,7 @@ void TrackingTextureAllocator::deleteTexture(unsigned textureId, const IntSize&
void TrackingTextureAllocator::deleteAllTextures()
{
for (HashSet<unsigned>::const_iterator it = m_allocatedTextureIds.begin(); it != m_allocatedTextureIds.end(); ++it)
- GLC(m_context.get(), m_context->deleteTexture(*it));
+ GLC(m_context, m_context->deleteTexture(*it));
m_currentMemoryUseBytes = 0;
m_allocatedTextureIds.clear();
}
diff --git a/Source/WebCore/platform/graphics/chromium/TrackingTextureAllocator.h b/Source/WebCore/platform/graphics/chromium/TrackingTextureAllocator.h
index 980b94e12..c10c25721 100644
--- a/Source/WebCore/platform/graphics/chromium/TrackingTextureAllocator.h
+++ b/Source/WebCore/platform/graphics/chromium/TrackingTextureAllocator.h
@@ -25,17 +25,20 @@
#ifndef TrackingTextureAllocator_h
#define TrackingTextureAllocator_h
-#include "GraphicsContext3D.h"
#include "TextureManager.h"
#include <wtf/HashSet.h>
#include <wtf/PassRefPtr.h>
+namespace WebKit {
+class WebGraphicsContext3D;
+}
+
namespace WebCore {
class TrackingTextureAllocator : public TextureAllocator {
WTF_MAKE_NONCOPYABLE(TrackingTextureAllocator);
public:
- static PassOwnPtr<TrackingTextureAllocator> create(PassRefPtr<GraphicsContext3D> context)
+ static PassOwnPtr<TrackingTextureAllocator> create(WebKit::WebGraphicsContext3D* context)
{
return adoptPtr(new TrackingTextureAllocator(context));
}
@@ -53,9 +56,9 @@ public:
void setUseTextureStorageExt(bool useStorageExt) { m_useTextureStorageExt = useStorageExt; }
protected:
- explicit TrackingTextureAllocator(PassRefPtr<GraphicsContext3D>);
+ explicit TrackingTextureAllocator(WebKit::WebGraphicsContext3D*);
- RefPtr<GraphicsContext3D> m_context;
+ WebKit::WebGraphicsContext3D* m_context;
size_t m_currentMemoryUseBytes;
TextureUsageHint m_textureUsageHint;
bool m_useTextureStorageExt;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCGraphicsContext.h b/Source/WebCore/platform/graphics/chromium/cc/CCGraphicsContext.h
index 395f18c34..43536a421 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCGraphicsContext.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCGraphicsContext.h
@@ -26,32 +26,33 @@
#ifndef CCGraphicsContext_h
#define CCGraphicsContext_h
-#include "GraphicsContext3D.h"
-#include <wtf/PassRefPtr.h>
+#include <public/WebGraphicsContext3D.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/OwnPtr.h>
namespace WebCore {
-class GraphicsContext3D;
-class CCGraphicsContext : public RefCounted<CCGraphicsContext> {
+class CCGraphicsContext {
+ WTF_MAKE_NONCOPYABLE(CCGraphicsContext);
public:
- static PassRefPtr<CCGraphicsContext> create2D()
+ static PassOwnPtr<CCGraphicsContext> create2D()
{
- return adoptRef(new CCGraphicsContext());
+ return adoptPtr(new CCGraphicsContext());
}
- static PassRefPtr<CCGraphicsContext> create3D(PassRefPtr<GraphicsContext3D> context3D)
+ static PassOwnPtr<CCGraphicsContext> create3D(PassOwnPtr<WebKit::WebGraphicsContext3D> context3D)
{
- return adoptRef(new CCGraphicsContext(context3D));
+ return adoptPtr(new CCGraphicsContext(context3D));
}
- GraphicsContext3D* context3D() { return m_context3D.get(); }
+ WebKit::WebGraphicsContext3D* context3D() { return m_context3D.get(); }
private:
CCGraphicsContext() { }
- explicit CCGraphicsContext(PassRefPtr<GraphicsContext3D> context3D)
+ explicit CCGraphicsContext(PassOwnPtr<WebKit::WebGraphicsContext3D> context3D)
: m_context3D(context3D) { }
- RefPtr<GraphicsContext3D> m_context3D;
+ OwnPtr<WebKit::WebGraphicsContext3D> m_context3D;
};
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp
index 1b61317cc..f3d415dcf 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp
@@ -35,6 +35,7 @@
#include "cc/CCDebugRectHistory.h"
#include "cc/CCFrameRateCounter.h"
#include "cc/CCLayerTreeHostImpl.h"
+#include <public/WebGraphicsContext3D.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -68,7 +69,7 @@ bool CCHeadsUpDisplay::showDebugRects(const CCLayerTreeSettings& settings) const
void CCHeadsUpDisplay::draw(CCLayerTreeHostImpl* layerTreeHostImpl)
{
CCRenderer* layerRenderer = layerTreeHostImpl->layerRenderer();
- GraphicsContext3D* context = layerTreeHostImpl->context()->context3D();
+ WebKit::WebGraphicsContext3D* context = layerTreeHostImpl->context()->context3D();
if (!context) {
// FIXME: Implement this path for software compositing.
return;
@@ -106,13 +107,12 @@ void CCHeadsUpDisplay::draw(CCLayerTreeHostImpl* layerTreeHostImpl)
m_hudTexture->bindTexture(layerTreeHostImpl->context(), layerRenderer->implTextureAllocator());
bool uploadedViaMap = false;
if (layerRenderer->capabilities().usingMapSub) {
- Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(context->getExtensions());
- uint8_t* pixelDest = static_cast<uint8_t*>(extensions->mapTexSubImage2DCHROMIUM(GraphicsContext3D::TEXTURE_2D, 0, 0, 0, hudSize.width(), hudSize.height(), GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, Extensions3DChromium::WRITE_ONLY));
+ uint8_t* pixelDest = static_cast<uint8_t*>(context->mapTexSubImage2DCHROMIUM(GraphicsContext3D::TEXTURE_2D, 0, 0, 0, hudSize.width(), hudSize.height(), GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, Extensions3DChromium::WRITE_ONLY));
if (pixelDest) {
uploadedViaMap = true;
memcpy(pixelDest, locker.pixels(), hudSize.width() * hudSize.height() * 4);
- extensions->unmapTexSubImage2DCHROMIUM(pixelDest);
+ context->unmapTexSubImage2DCHROMIUM(pixelDest);
}
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp
index f8446670a..ce3b38e96 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp
@@ -29,13 +29,14 @@
#include "cc/CCIOSurfaceLayerImpl.h"
-#include "Extensions3DChromium.h"
+#include "Extensions3D.h"
#include "LayerRendererChromium.h"
#include "TextStream.h"
#include "cc/CCGraphicsContext.h"
#include "cc/CCIOSurfaceDrawQuad.h"
#include "cc/CCLayerTreeHostImpl.h"
#include "cc/CCQuadCuller.h"
+#include <public/WebGraphicsContext3D.h>
namespace WebCore {
@@ -54,7 +55,7 @@ CCIOSurfaceLayerImpl::~CCIOSurfaceLayerImpl()
CCGraphicsContext* context = layerTreeHostImpl()->context();
// FIXME: Implement this path for software compositing.
- GraphicsContext3D* context3d = context->context3D();
+ WebKit::WebGraphicsContext3D* context3d = context->context3D();
if (context3d)
context3d->deleteTexture(m_ioSurfaceTextureId);
}
@@ -64,14 +65,11 @@ void CCIOSurfaceLayerImpl::willDraw(CCRenderer* layerRenderer, CCGraphicsContext
CCLayerImpl::willDraw(layerRenderer, context);
if (m_ioSurfaceChanged) {
- GraphicsContext3D* context3d = context->context3D();
+ WebKit::WebGraphicsContext3D* context3d = context->context3D();
if (!context3d) {
// FIXME: Implement this path for software compositing.
return;
}
- Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(context3d->getExtensions());
- ASSERT(extensions->supports("GL_CHROMIUM_iosurface"));
- ASSERT(extensions->supports("GL_ARB_texture_rectangle"));
// FIXME: Do this in a way that we can track memory usage.
if (!m_ioSurfaceTextureId)
@@ -83,11 +81,11 @@ void CCIOSurfaceLayerImpl::willDraw(CCRenderer* layerRenderer, CCGraphicsContext
GLC(context3d, context3d->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR));
GLC(context3d, context3d->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE));
GLC(context3d, context3d->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE));
- extensions->texImageIOSurface2DCHROMIUM(Extensions3D::TEXTURE_RECTANGLE_ARB,
- m_ioSurfaceSize.width(),
- m_ioSurfaceSize.height(),
- m_ioSurfaceId,
- 0);
+ context3d->texImageIOSurface2DCHROMIUM(Extensions3D::TEXTURE_RECTANGLE_ARB,
+ m_ioSurfaceSize.width(),
+ m_ioSurfaceSize.height(),
+ m_ioSurfaceId,
+ 0);
// Do not check for error conditions. texImageIOSurface2DCHROMIUM is supposed to hold on to
// the last good IOSurface if the new one is already closed. This is only a possibility
// during live resizing of plugins. However, it seems that this is not sufficient to
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
index 7d14cf5da..351112bd5 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
@@ -39,6 +39,7 @@
#include "cc/CCLayerTreeHostImpl.h"
#include "cc/CCOcclusionTracker.h"
#include "cc/CCOverdrawMetrics.h"
+#include "cc/CCRenderingStats.h"
#include "cc/CCSettings.h"
#include "cc/CCSingleThreadProxy.h"
#include "cc/CCThreadProxy.h"
@@ -72,7 +73,8 @@ CCLayerTreeHost::CCLayerTreeHost(CCLayerTreeHostClient* client, const CCLayerTre
, m_animating(false)
, m_needsAnimateLayers(false)
, m_client(client)
- , m_frameNumber(0)
+ , m_animationFrameNumber(0)
+ , m_commitNumber(0)
, m_layerRendererInitialized(false)
, m_contextLost(false)
, m_numTimesRecreateShouldFail(0)
@@ -211,6 +213,8 @@ void CCLayerTreeHost::updateAnimations(double monotonicFrameBeginTime)
m_client->updateAnimations(monotonicFrameBeginTime);
animateLayers(monotonicFrameBeginTime);
m_animating = false;
+
+ m_animationFrameNumber++;
}
void CCLayerTreeHost::layout()
@@ -243,14 +247,14 @@ void CCLayerTreeHost::finishCommitOnImplThread(CCLayerTreeHostImpl* hostImpl)
if (rootLayer() && m_needsAnimateLayers)
hostImpl->setNeedsAnimateLayers();
- hostImpl->setSourceFrameNumber(frameNumber());
+ hostImpl->setSourceFrameNumber(commitNumber());
hostImpl->setViewportSize(viewportSize());
hostImpl->setDeviceScaleFactor(deviceScaleFactor());
hostImpl->setPageScaleFactorAndLimits(m_pageScaleFactor, m_minPageScaleFactor, m_maxPageScaleFactor);
hostImpl->setBackgroundColor(m_backgroundColor);
hostImpl->setHasTransparentBackground(m_hasTransparentBackground);
- m_frameNumber++;
+ m_commitNumber++;
}
void CCLayerTreeHost::commitComplete()
@@ -260,9 +264,8 @@ void CCLayerTreeHost::commitComplete()
m_client->didCommit();
}
-PassRefPtr<CCGraphicsContext> CCLayerTreeHost::createContext()
+PassOwnPtr<CCGraphicsContext> CCLayerTreeHost::createContext()
{
- RefPtr<CCGraphicsContext> context;
if (settings().forceSoftwareCompositing)
return CCGraphicsContext::create2D();
return CCGraphicsContext::create3D(m_client->createContext3D());
@@ -282,12 +285,6 @@ void CCLayerTreeHost::didLoseContext()
setNeedsCommit();
}
-// Temporary hack until WebViewImpl context creation gets simplified
-CCGraphicsContext* CCLayerTreeHost::context()
-{
- return m_proxy->context();
-}
-
bool CCLayerTreeHost::compositeAndReadback(void *pixels, const IntRect& rect)
{
m_triggerIdlePaints = false;
@@ -303,6 +300,12 @@ void CCLayerTreeHost::finishAllRendering()
m_proxy->finishAllRendering();
}
+void CCLayerTreeHost::renderingStats(CCRenderingStats& stats) const
+{
+ m_proxy->implSideRenderingStats(stats);
+ stats.numAnimationFrames = animationFrameNumber();
+}
+
const LayerRendererCapabilities& CCLayerTreeHost::layerRendererCapabilities() const
{
return m_proxy->layerRendererCapabilities();
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
index 6f6946e31..23ac33140 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
@@ -46,12 +46,13 @@ class CCGraphicsContext;
class CCLayerChromium;
class CCLayerTreeHostImpl;
class CCLayerTreeHostImplClient;
-struct CCScrollAndScaleSet;
class CCTextureUpdater;
class ManagedTexture;
class Region;
class TextureAllocator;
class TextureManager;
+struct CCRenderingStats;
+struct CCScrollAndScaleSet;
class CCLayerTreeHostClient {
public:
@@ -61,7 +62,7 @@ public:
virtual void updateAnimations(double frameBeginTime) = 0;
virtual void layout() = 0;
virtual void applyScrollAndScale(const IntSize& scrollDelta, float pageScale) = 0;
- virtual PassRefPtr<GraphicsContext3D> createContext3D() = 0;
+ virtual PassOwnPtr<WebKit::WebGraphicsContext3D> createContext3D() = 0;
virtual void didRecreateContext(bool success) = 0;
virtual void willCommit() = 0;
virtual void didCommit() = 0;
@@ -117,6 +118,7 @@ struct LayerRendererCapabilities {
, usingTextureStorageExtension(false)
, usingGpuMemoryManager(false)
, usingDiscardFramebuffer(false)
+ , usingEglImage(false)
, maxTextureSize(0) { }
GC3Denum bestTextureFormat;
@@ -130,6 +132,7 @@ struct LayerRendererCapabilities {
bool usingTextureStorageExtension;
bool usingGpuMemoryManager;
bool usingDiscardFramebuffer;
+ bool usingEglImage;
int maxTextureSize;
};
@@ -146,6 +149,7 @@ public:
static bool needsFilterContext() { return s_needsFilterContext; }
static void setNeedsFilterContext(bool needsFilterContext) { s_needsFilterContext = needsFilterContext; }
+ bool needsSharedContext() const { return needsFilterContext() || settings().acceleratePainting; }
// CCLayerTreeHost interface to CCProxy.
void willBeginFrame() { m_client->willBeginFrame(); }
@@ -155,7 +159,7 @@ public:
void beginCommitOnImplThread(CCLayerTreeHostImpl*);
void finishCommitOnImplThread(CCLayerTreeHostImpl*);
void commitComplete();
- PassRefPtr<CCGraphicsContext> createContext();
+ PassOwnPtr<CCGraphicsContext> createContext();
virtual PassOwnPtr<CCLayerTreeHostImpl> createLayerTreeHostImpl(CCLayerTreeHostImplClient*);
void didLoseContext();
enum RecreateResult {
@@ -181,10 +185,6 @@ public:
void composite();
void scheduleComposite();
- // NOTE: The returned value can only be used to make GL calls or make the
- // context current on the thread the compositor is running on!
- CCGraphicsContext* context();
-
// Composites and attempts to read back the result into the provided
// buffer. If it wasn't possible, e.g. due to context lost, will return
// false.
@@ -192,7 +192,11 @@ public:
void finishAllRendering();
- int frameNumber() const { return m_frameNumber; }
+ int animationFrameNumber() const { return m_animationFrameNumber; }
+
+ int commitNumber() const { return m_commitNumber; }
+
+ void renderingStats(CCRenderingStats&) const;
const LayerRendererCapabilities& layerRendererCapabilities() const;
@@ -284,7 +288,8 @@ private:
CCLayerTreeHostClient* m_client;
- int m_frameNumber;
+ int m_animationFrameNumber;
+ int m_commitNumber;
OwnPtr<CCProxy> m_proxy;
bool m_layerRendererInitialized;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
index 9a11bd280..1dca36a60 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
@@ -114,7 +114,7 @@ PassOwnPtr<CCLayerTreeHostImpl> CCLayerTreeHostImpl::create(const CCLayerTreeSet
CCLayerTreeHostImpl::CCLayerTreeHostImpl(const CCLayerTreeSettings& settings, CCLayerTreeHostImplClient* client)
: m_client(client)
, m_sourceFrameNumber(-1)
- , m_frameNumber(0)
+ , m_sourceAnimationFrameNumber(0)
, m_rootScrollLayerImpl(0)
, m_currentlyScrollingLayerImpl(0)
, m_scrollingLayerIdFromPreviousTree(-1)
@@ -519,7 +519,7 @@ void CCLayerTreeHostImpl::drawLayers(const FrameData& frame)
m_layerRenderer->finishDrawingFrame();
- ++m_frameNumber;
+ ++m_sourceAnimationFrameNumber;
// The next frame should start by assuming nothing has changed, and changes are noted as they occur.
m_rootLayerImpl->resetAllChangeTrackingForSubtree();
@@ -649,9 +649,9 @@ void CCLayerTreeHostImpl::setVisible(bool visible)
setBackgroundTickingEnabled(!m_visible && m_needsAnimateLayers);
}
-bool CCLayerTreeHostImpl::initializeLayerRenderer(PassRefPtr<CCGraphicsContext> context, TextureUploaderOption textureUploader)
+bool CCLayerTreeHostImpl::initializeLayerRenderer(PassOwnPtr<CCGraphicsContext> context, TextureUploaderOption textureUploader)
{
- GraphicsContext3D* context3d = context->context3D();
+ WebKit::WebGraphicsContext3D* context3d = context->context3D();
if (!context3d) {
// FIXME: Implement this path for software compositing.
return false;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
index 939e42e6b..726037f17 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
@@ -119,9 +119,9 @@ public:
void setFontAtlas(PassOwnPtr<CCFontAtlas>);
void finishAllRendering();
- int frameNumber() const { return m_frameNumber; }
+ int sourceAnimationFrameNumber() const { return m_sourceAnimationFrameNumber; }
- bool initializeLayerRenderer(PassRefPtr<CCGraphicsContext>, TextureUploaderOption);
+ bool initializeLayerRenderer(PassOwnPtr<CCGraphicsContext>, TextureUploaderOption);
bool isContextLost();
CCRenderer* layerRenderer() { return m_layerRenderer.get(); }
const LayerRendererCapabilities& layerRendererCapabilities() const;
@@ -196,7 +196,7 @@ protected:
CCLayerTreeHostImplClient* m_client;
int m_sourceFrameNumber;
- int m_frameNumber;
+ int m_sourceAnimationFrameNumber;
private:
void computeDoubleTapZoomDeltas(CCScrollAndScaleSet* scrollInfo);
@@ -224,7 +224,7 @@ private:
void dumpRenderSurfaces(TextStream&, int indent, const CCLayerImpl*) const;
- RefPtr<CCGraphicsContext> m_context;
+ OwnPtr<CCGraphicsContext> m_context;
OwnPtr<CCRenderer> m_layerRenderer;
OwnPtr<CCLayerImpl> m_rootLayerImpl;
CCLayerImpl* m_rootScrollLayerImpl;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCOverdrawMetrics.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCOverdrawMetrics.cpp
index 7b57c89b1..0cc2fa5ec 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCOverdrawMetrics.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCOverdrawMetrics.cpp
@@ -131,9 +131,9 @@ template<typename LayerTreeHostType>
void CCOverdrawMetrics::recordMetricsInternal(MetricsType metricsType, const LayerTreeHostType* layerTreeHost) const
{
// This gives approximately 10x the percentage of pixels to fill the viewport once.
- float normalization = 1000.f / (layerTreeHost->viewportSize().width() * layerTreeHost->viewportSize().height());
+ float normalization = 1000.f / (layerTreeHost->deviceViewportSize().width() * layerTreeHost->deviceViewportSize().height());
// This gives approximately 100x the percentage of tiles to fill the viewport once, if all tiles were 256x256.
- float tileNormalization = 10000.f / (layerTreeHost->viewportSize().width() / 256.f * layerTreeHost->viewportSize().height() / 256.f);
+ float tileNormalization = 10000.f / (layerTreeHost->deviceViewportSize().width() / 256.f * layerTreeHost->deviceViewportSize().height() / 256.f);
switch (metricsType) {
case DrawingToScreen:
@@ -142,8 +142,8 @@ void CCOverdrawMetrics::recordMetricsInternal(MetricsType metricsType, const Lay
WebKit::Platform::current()->histogramCustomCounts("Renderer4.pixelCountCulled_Draw", static_cast<int>(normalization * m_pixelsCulledForDrawing), 100, 1000000, 50);
{
- TRACE_COUNTER_ID1("webkit", "DrawPixelsCulled", layerTreeHost, m_pixelsCulledForDrawing);
- TRACE_EVENT2("webkit", "CCOverdrawMetrics", "PixelsDrawnOpaque", m_pixelsDrawnOpaque, "PixelsDrawnTranslucent", m_pixelsDrawnTranslucent);
+ TRACE_COUNTER_ID1("cc", "DrawPixelsCulled", layerTreeHost, m_pixelsCulledForDrawing);
+ TRACE_EVENT2("cc", "CCOverdrawMetrics", "PixelsDrawnOpaque", m_pixelsDrawnOpaque, "PixelsDrawnTranslucent", m_pixelsDrawnTranslucent);
}
break;
case UpdateAndCommit:
@@ -153,12 +153,12 @@ void CCOverdrawMetrics::recordMetricsInternal(MetricsType metricsType, const Lay
WebKit::Platform::current()->histogramCustomCounts("Renderer4.tileCountCulled_Upload", static_cast<int>(tileNormalization * m_tilesCulledForUpload), 100, 10000000, 50);
{
- TRACE_COUNTER_ID1("webkit", "UploadTilesCulled", layerTreeHost, m_tilesCulledForUpload);
- TRACE_EVENT2("webkit", "CCOverdrawMetrics", "PixelsUploadedOpaque", m_pixelsUploadedOpaque, "PixelsUploadedTranslucent", m_pixelsUploadedTranslucent);
+ TRACE_COUNTER_ID1("cc", "UploadTilesCulled", layerTreeHost, m_tilesCulledForUpload);
+ TRACE_EVENT2("cc", "CCOverdrawMetrics", "PixelsUploadedOpaque", m_pixelsUploadedOpaque, "PixelsUploadedTranslucent", m_pixelsUploadedTranslucent);
}
{
// This must be in a different scope than the TRACE_EVENT2 above.
- TRACE_EVENT1("webkit", "CCOverdrawPaintMetrics", "PixelsPainted", m_pixelsPainted);
+ TRACE_EVENT1("cc", "CCOverdrawPaintMetrics", "PixelsPainted", m_pixelsPainted);
}
break;
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h b/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h
index 1c2f9cafd..f19032abb 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h
@@ -36,6 +36,7 @@ namespace WebCore {
class CCFontAtlas;
class CCThread;
class CCGraphicsContext;
+struct CCRenderingStats;
struct LayerRendererCapabilities;
// Abstract class responsible for proxying commands from the main-thread side of
@@ -81,6 +82,8 @@ public:
virtual int compositorIdentifier() const = 0;
+ virtual void implSideRenderingStats(CCRenderingStats&) = 0;
+
virtual const LayerRendererCapabilities& layerRendererCapabilities() const = 0;
virtual void setNeedsAnimate() = 0;
@@ -113,9 +116,6 @@ public:
static void setMainThreadBlocked(bool);
#endif
- // Temporary hack while render_widget still does scheduling for CCLayerTreeHostMainThreadI
- virtual CCGraphicsContext* context() = 0;
-
// Testing hooks
virtual void loseContext() = 0;
diff --git a/Source/WebKit/chromium/tests/CompositorFakeGraphicsContext3D.h b/Source/WebCore/platform/graphics/chromium/cc/CCRenderingStats.h
index 937b62d4c..f69c8e026 100644
--- a/Source/WebKit/chromium/tests/CompositorFakeGraphicsContext3D.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCRenderingStats.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -22,23 +22,21 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef CompositorFakeGraphicsContext3D_h
-#define CompositorFakeGraphicsContext3D_h
-
-#include "CompositorFakeWebGraphicsContext3D.h"
-#include "GraphicsContext3D.h"
-#include "GraphicsContext3DPrivate.h"
+#ifndef CCRenderingStats_h
+#define CCRenderingStats_h
namespace WebCore {
-static PassRefPtr<GraphicsContext3D> createCompositorMockGraphicsContext3D(GraphicsContext3D::Attributes attrs)
-{
- WebKit::WebGraphicsContext3D::Attributes webAttrs;
- webAttrs.alpha = attrs.alpha;
+struct CCRenderingStats {
+ int numAnimationFrames;
+ int numFramesSentToScreen;
- OwnPtr<WebKit::WebGraphicsContext3D> webContext = WebKit::CompositorFakeWebGraphicsContext3D::create(webAttrs);
- return GraphicsContext3DPrivate::createGraphicsContextFromWebContext(webContext.release(), GraphicsContext3D::RenderDirectlyToHostWindow);
-}
+ CCRenderingStats()
+ : numAnimationFrames(0)
+ , numFramesSentToScreen(0)
+ {
+ }
+};
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
index f54ba7750..d69e4bc45 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
@@ -31,6 +31,7 @@
#include "cc/CCFontAtlas.h"
#include "cc/CCGraphicsContext.h"
#include "cc/CCLayerTreeHost.h"
+#include "cc/CCRenderingStats.h"
#include "cc/CCTextureUpdater.h"
#include "cc/CCTimer.h"
#include <wtf/CurrentTime.h>
@@ -39,26 +40,6 @@ using namespace WTF;
namespace WebCore {
-class CCSingleThreadProxyAnimationTimer : public CCTimer, CCTimerClient {
-public:
- static PassOwnPtr<CCSingleThreadProxyAnimationTimer> create(CCSingleThreadProxy* proxy) { return adoptPtr(new CCSingleThreadProxyAnimationTimer(proxy)); }
-
- virtual void onTimerFired() OVERRIDE
- {
- if (m_proxy->m_layerRendererInitialized)
- m_proxy->compositeImmediately();
- }
-
-private:
- explicit CCSingleThreadProxyAnimationTimer(CCSingleThreadProxy* proxy)
- : CCTimer(CCProxy::mainThread(), this)
- , m_proxy(proxy)
- {
- }
-
- CCSingleThreadProxy* m_proxy;
-};
-
PassOwnPtr<CCProxy> CCSingleThreadProxy::create(CCLayerTreeHost* layerTreeHost)
{
return adoptPtr(new CCSingleThreadProxy(layerTreeHost));
@@ -68,7 +49,6 @@ CCSingleThreadProxy::CCSingleThreadProxy(CCLayerTreeHost* layerTreeHost)
: m_layerTreeHost(layerTreeHost)
, m_contextLost(false)
, m_compositorIdentifier(-1)
- , m_animationTimer(CCSingleThreadProxyAnimationTimer::create(this))
, m_layerRendererInitialized(false)
, m_nextFrameIsNewlyCommittedFrame(false)
{
@@ -113,15 +93,6 @@ void CCSingleThreadProxy::startPageScaleAnimation(const IntSize& targetPosition,
m_layerTreeHostImpl->startPageScaleAnimation(targetPosition, useAnchor, scale, monotonicallyIncreasingTime(), duration);
}
-CCGraphicsContext* CCSingleThreadProxy::context()
-{
- ASSERT(CCProxy::isMainThread());
- if (m_contextBeforeInitialization)
- return m_contextBeforeInitialization.get();
- DebugScopedSetImplThread impl;
- return m_layerTreeHostImpl->context();
-}
-
void CCSingleThreadProxy::finishAllRendering()
{
ASSERT(CCProxy::isMainThread());
@@ -140,11 +111,10 @@ bool CCSingleThreadProxy::isStarted() const
bool CCSingleThreadProxy::initializeContext()
{
ASSERT(CCProxy::isMainThread());
- RefPtr<CCGraphicsContext> context = m_layerTreeHost->createContext();
+ OwnPtr<CCGraphicsContext> context = m_layerTreeHost->createContext();
if (!context)
return false;
- ASSERT(context->hasOneRef());
- m_contextBeforeInitialization = context;
+ m_contextBeforeInitialization = context.release();
return true;
}
@@ -169,9 +139,7 @@ bool CCSingleThreadProxy::initializeLayerRenderer()
if (ok) {
m_layerRendererInitialized = true;
m_layerRendererCapabilitiesForMainThread = m_layerTreeHostImpl->layerRendererCapabilities();
- } else
- // If we couldn't initialize the layer renderer, we shouldn't process any future animation events.
- m_animationTimer->stop();
+ }
return ok;
}
@@ -183,16 +151,15 @@ bool CCSingleThreadProxy::recreateContext()
ASSERT(CCProxy::isMainThread());
ASSERT(m_contextLost);
- RefPtr<CCGraphicsContext> context = m_layerTreeHost->createContext();
+ OwnPtr<CCGraphicsContext> context = m_layerTreeHost->createContext();
if (!context)
return false;
- ASSERT(context->hasOneRef());
bool initialized;
{
DebugScopedSetImplThread impl;
m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->contentsTextureAllocator());
- initialized = m_layerTreeHostImpl->initializeLayerRenderer(context, UnthrottledUploader);
+ initialized = m_layerTreeHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader);
if (initialized) {
m_layerRendererCapabilitiesForMainThread = m_layerTreeHostImpl->layerRendererCapabilities();
}
@@ -204,6 +171,11 @@ bool CCSingleThreadProxy::recreateContext()
return initialized;
}
+void CCSingleThreadProxy::implSideRenderingStats(CCRenderingStats& stats)
+{
+ stats.numFramesSentToScreen = m_layerTreeHostImpl->sourceAnimationFrameNumber();
+}
+
const LayerRendererCapabilities& CCSingleThreadProxy::layerRendererCapabilities() const
{
ASSERT(m_layerRendererInitialized);
@@ -279,7 +251,6 @@ bool CCSingleThreadProxy::commitRequested() const
void CCSingleThreadProxy::didAddAnimation()
{
- m_animationTimer->startOneShot(animationTimerDelay());
}
void CCSingleThreadProxy::stop()
@@ -320,11 +291,6 @@ void CCSingleThreadProxy::compositeImmediately()
}
}
-double CCSingleThreadProxy::animationTimerDelay()
-{
- return 1 / 60.0;
-}
-
void CCSingleThreadProxy::forceSerializeOnSwapBuffers()
{
{
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h b/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h
index 46cb302ac..e8aa75515 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h
@@ -34,7 +34,6 @@
namespace WebCore {
class CCLayerTreeHost;
-class CCSingleThreadProxyAnimationTimer;
class CCSingleThreadProxy : public CCProxy, CCLayerTreeHostImplClient {
public:
@@ -44,7 +43,6 @@ public:
// CCProxy implementation
virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE;
virtual void startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, double duration) OVERRIDE;
- virtual CCGraphicsContext* context() OVERRIDE;
virtual void finishAllRendering() OVERRIDE;
virtual bool isStarted() const OVERRIDE;
virtual bool initializeContext() OVERRIDE;
@@ -53,6 +51,7 @@ public:
virtual bool initializeLayerRenderer() OVERRIDE;
virtual bool recreateContext() OVERRIDE;
virtual int compositorIdentifier() const OVERRIDE { return m_compositorIdentifier; }
+ virtual void implSideRenderingStats(CCRenderingStats&) OVERRIDE;
virtual const LayerRendererCapabilities& layerRendererCapabilities() const OVERRIDE;
virtual void loseContext() OVERRIDE;
virtual void setNeedsAnimate() OVERRIDE;
@@ -77,12 +76,7 @@ public:
// Called by the legacy path where RenderWidget does the scheduling.
void compositeImmediately();
- // Measured in seconds.
- static double animationTimerDelay();
-
private:
- friend class CCSingleThreadProxyAnimationTimer;
-
explicit CCSingleThreadProxy(CCLayerTreeHost*);
bool commitAndComposite();
@@ -97,9 +91,7 @@ private:
// Holds on to the context between initializeContext() and initializeLayerRenderer() calls. Shouldn't
// be used for anything else.
- RefPtr<CCGraphicsContext> m_contextBeforeInitialization;
-
- OwnPtr<CCSingleThreadProxyAnimationTimer> m_animationTimer;
+ OwnPtr<CCGraphicsContext> m_contextBeforeInitialization;
// Used on the CCThread, but checked on main thread during initialization/shutdown.
OwnPtr<CCLayerTreeHostImpl> m_layerTreeHostImpl;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp
index 1fd0c736e..c3299939b 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp
@@ -129,7 +129,7 @@ void CCTextureUpdater::update(CCGraphicsContext* context, TextureAllocator* allo
// before letting the main thread proceed as it may make draw calls to the source texture of one of
// our copy operations.
if (m_copyEntries.size()) {
- GraphicsContext3D* context3d = context->context3D();
+ WebKit::WebGraphicsContext3D* context3d = context->context3D();
if (context3d)
context3d->flush();
// FIXME: Implement this path for software compositing.
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
index e2ecb9c58..382274746 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
@@ -36,6 +36,7 @@
#include "cc/CCGraphicsContext.h"
#include "cc/CCInputHandler.h"
#include "cc/CCLayerTreeHost.h"
+#include "cc/CCRenderingStats.h"
#include "cc/CCScheduler.h"
#include "cc/CCScopedThreadProxy.h"
#include "cc/CCTextureUpdater.h"
@@ -156,11 +157,6 @@ void CCThreadProxy::requestStartPageScaleAnimationOnImplThread(IntSize targetPos
m_layerTreeHostImpl->startPageScaleAnimation(targetPosition, useAnchor, scale, monotonicallyIncreasingTime(), duration);
}
-CCGraphicsContext* CCThreadProxy::context()
-{
- return 0;
-}
-
void CCThreadProxy::finishAllRendering()
{
ASSERT(CCProxy::isMainThread());
@@ -180,17 +176,12 @@ bool CCThreadProxy::isStarted() const
bool CCThreadProxy::initializeContext()
{
TRACE_EVENT("CCThreadProxy::initializeContext", this, 0);
- RefPtr<CCGraphicsContext> context = m_layerTreeHost->createContext();
+ OwnPtr<CCGraphicsContext> context = m_layerTreeHost->createContext();
if (!context)
return false;
- ASSERT(context->hasOneRef());
-
- // Leak the context pointer so we can transfer ownership of it to the other side...
- CCGraphicsContext* contextPtr = context.release().leakRef();
- ASSERT(contextPtr->hasOneRef());
CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::initializeContextOnImplThread,
- AllowCrossThreadAccess(contextPtr)));
+ AllowCrossThreadAccess(context.leakPtr())));
return true;
}
@@ -249,19 +240,13 @@ bool CCThreadProxy::recreateContext()
ASSERT(isMainThread());
// Try to create the context.
- RefPtr<CCGraphicsContext> context = m_layerTreeHost->createContext();
+ OwnPtr<CCGraphicsContext> context = m_layerTreeHost->createContext();
if (!context)
return false;
- if (CCLayerTreeHost::needsFilterContext() && !m_layerTreeHost->settings().forceSoftwareCompositing)
+ if (m_layerTreeHost->needsSharedContext() && !m_layerTreeHost->settings().forceSoftwareCompositing)
if (!SharedGraphicsContext3D::createForImplThread())
return false;
- ASSERT(context->hasOneRef());
-
- // Leak the context pointer so we can transfer ownership of it to the other side...
- CCGraphicsContext* contextPtr = context.release().leakRef();
- ASSERT(contextPtr->hasOneRef());
-
// Make a blocking call to recreateContextOnImplThread. The results of that
// call are pushed into the recreateSucceeded and capabilities local
// variables.
@@ -270,7 +255,7 @@ bool CCThreadProxy::recreateContext()
LayerRendererCapabilities capabilities;
CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::recreateContextOnImplThread,
AllowCrossThreadAccess(&completion),
- AllowCrossThreadAccess(contextPtr),
+ AllowCrossThreadAccess(context.leakPtr()),
AllowCrossThreadAccess(&recreateSucceeded),
AllowCrossThreadAccess(&capabilities)));
completion.wait();
@@ -286,6 +271,17 @@ int CCThreadProxy::compositorIdentifier() const
return m_compositorIdentifier;
}
+void CCThreadProxy::implSideRenderingStats(CCRenderingStats& stats)
+{
+ ASSERT(isMainThread());
+
+ CCCompletionEvent completion;
+ CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::implSideRenderingStatsOnImplThread,
+ AllowCrossThreadAccess(&completion),
+ AllowCrossThreadAccess(&stats)));
+ completion.wait();
+}
+
const LayerRendererCapabilities& CCThreadProxy::layerRendererCapabilities() const
{
ASSERT(m_layerRendererInitialized);
@@ -480,7 +476,7 @@ void CCThreadProxy::beginFrame()
return;
}
- if (CCLayerTreeHost::needsFilterContext() && !m_layerTreeHost->settings().forceSoftwareCompositing && !SharedGraphicsContext3D::haveForImplThread())
+ if (m_layerTreeHost->needsSharedContext() && !m_layerTreeHost->settings().forceSoftwareCompositing && !SharedGraphicsContext3D::haveForImplThread())
SharedGraphicsContext3D::createForImplThread();
OwnPtr<BeginFrameAndCommitState> request(m_pendingBeginFrameRequest.release());
@@ -621,7 +617,6 @@ void CCThreadProxy::scheduledActionCommit()
m_layerTreeHost->beginCommitOnImplThread(m_layerTreeHostImpl.get());
m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get());
- m_schedulerOnImplThread->setVisible(m_layerTreeHostImpl->visible());
m_layerTreeHostImpl->commitComplete();
@@ -629,6 +624,9 @@ void CCThreadProxy::scheduledActionCommit()
m_commitCompletionEventOnImplThread->signal();
m_commitCompletionEventOnImplThread = 0;
+
+ // SetVisible kicks off the next scheduler action, so this must be last.
+ m_schedulerOnImplThread->setVisible(m_layerTreeHostImpl->visible());
}
void CCThreadProxy::scheduledActionBeginContextRecreation()
@@ -828,7 +826,7 @@ void CCThreadProxy::initializeContextOnImplThread(CCGraphicsContext* context)
{
TRACE_EVENT("CCThreadProxy::initializeContextOnImplThread", this, 0);
ASSERT(isImplThread());
- m_contextBeforeInitializationOnImplThread = adoptRef(context);
+ m_contextBeforeInitializationOnImplThread = adoptPtr(context);
}
void CCThreadProxy::initializeLayerRendererOnImplThread(CCCompletionEvent* completion, bool* initializeSucceeded, LayerRendererCapabilities* capabilities)
@@ -887,7 +885,7 @@ void CCThreadProxy::recreateContextOnImplThread(CCCompletionEvent* completion, C
TRACE_EVENT0("cc", "CCThreadProxy::recreateContextOnImplThread");
ASSERT(isImplThread());
m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->contentsTextureAllocator());
- *recreateSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(adoptRef(contextPtr), textureUploader);
+ *recreateSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(adoptPtr(contextPtr), textureUploader);
if (*recreateSucceeded) {
*capabilities = m_layerTreeHostImpl->layerRendererCapabilities();
m_schedulerOnImplThread->didRecreateContext();
@@ -895,4 +893,11 @@ void CCThreadProxy::recreateContextOnImplThread(CCCompletionEvent* completion, C
completion->signal();
}
+void CCThreadProxy::implSideRenderingStatsOnImplThread(CCCompletionEvent* completion, CCRenderingStats* stats)
+{
+ ASSERT(isImplThread());
+ stats->numFramesSentToScreen = m_layerTreeHostImpl->sourceAnimationFrameNumber();
+ completion->signal();
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h b/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h
index 572f9f488..e10c3dcb0 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h
@@ -51,7 +51,6 @@ public:
// CCProxy implementation
virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE;
virtual void startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, double duration) OVERRIDE;
- virtual CCGraphicsContext* context() OVERRIDE;
virtual void finishAllRendering() OVERRIDE;
virtual bool isStarted() const OVERRIDE;
virtual bool initializeContext() OVERRIDE;
@@ -60,6 +59,7 @@ public:
virtual bool initializeLayerRenderer() OVERRIDE;
virtual bool recreateContext() OVERRIDE;
virtual int compositorIdentifier() const OVERRIDE;
+ virtual void implSideRenderingStats(CCRenderingStats&) OVERRIDE;
virtual const LayerRendererCapabilities& layerRendererCapabilities() const OVERRIDE;
virtual void loseContext() OVERRIDE;
virtual void setNeedsAnimate() OVERRIDE;
@@ -142,6 +142,7 @@ private:
void setFullRootLayerDamageOnImplThread();
void acquireLayerTexturesForMainThreadOnImplThread(CCCompletionEvent*);
void recreateContextOnImplThread(CCCompletionEvent*, CCGraphicsContext*, bool* recreateSucceeded, LayerRendererCapabilities*);
+ void implSideRenderingStatsOnImplThread(CCCompletionEvent*, CCRenderingStats*);
CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool forcedDraw);
void setFontAtlasOnImplThread(PassOwnPtr<CCFontAtlas>);
void forceSerializeOnSwapBuffersOnImplThread(CCCompletionEvent*);
@@ -171,7 +172,7 @@ private:
// Holds on to the context we might use for compositing in between initializeContext()
// and initializeLayerRenderer() calls.
- RefPtr<CCGraphicsContext> m_contextBeforeInitializationOnImplThread;
+ OwnPtr<CCGraphicsContext> m_contextBeforeInitializationOnImplThread;
// Set when the main thread is waiting on a scheduledActionBeginFrame to be issued.
CCCompletionEvent* m_beginFrameCompletionEventOnImplThread;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp
index dbb07a004..3e1f58135 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp
@@ -213,7 +213,7 @@ void CCVideoLayerImpl::appendQuads(CCQuadCuller& quadList, const CCSharedQuadSta
FloatRect uvRect(0, 0, 1, 1);
#if defined(OS_CHROMEOS) && defined(__ARMEL__)
bool flipped = true; // Under the covers, implemented by OpenMAX IL.
-#elif defined(OS_WINDOWS)
+#elif OS(WINDOWS)
bool flipped = true; // Under the covers, implemented by DXVA.
#else
bool flipped = false; // LibVA (cros/intel), MacOS.
@@ -288,7 +288,7 @@ bool CCVideoLayerImpl::FramePlane::allocateData(CCGraphicsContext* context)
if (textureId)
return true;
- GraphicsContext3D* context3D = context->context3D();
+ WebKit::WebGraphicsContext3D* context3D = context->context3D();
if (!context3D)
return false;
@@ -301,7 +301,7 @@ bool CCVideoLayerImpl::FramePlane::allocateData(CCGraphicsContext* context)
GLC(context3D, context3D->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE));
GLC(context3D, context3D->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE));
- GLC(context3D, context3D->texImage2DResourceSafe(GraphicsContext3D::TEXTURE_2D, 0, format, size.width(), size.height(), 0, format, GraphicsContext3D::UNSIGNED_BYTE));
+ GLC(context3D, context3D->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, format, size.width(), size.height(), 0, format, GraphicsContext3D::UNSIGNED_BYTE, 0));
return textureId;
}
@@ -311,7 +311,7 @@ void CCVideoLayerImpl::FramePlane::freeData(CCGraphicsContext* context)
if (!textureId)
return;
- GraphicsContext3D* context3D = context->context3D();
+ WebKit::WebGraphicsContext3D* context3D = context->context3D();
if (!context3D)
return;
@@ -351,7 +351,7 @@ bool CCVideoLayerImpl::copyPlaneData(CCRenderer* layerRenderer, CCGraphicsContex
if (!softwarePlaneCount)
return true;
- GraphicsContext3D* context3d = context->context3D();
+ WebKit::WebGraphicsContext3D* context3d = context->context3D();
if (!context3d) {
// FIXME: Implement this path for software compositing.
return false;
diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
index d2854486b..e9d1bc119 100644
--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
@@ -749,6 +749,8 @@ gboolean MediaPlayerPrivateGStreamer::handleMessage(GstMessage* message)
gst_message_parse_error(message, &err.outPtr(), &debug.outPtr());
LOG_VERBOSE(Media, "Error: %d, %s", err->code, err->message);
+ GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(m_playBin), GST_DEBUG_GRAPH_SHOW_ALL, "webkit-video.error");
+
error = MediaPlayer::Empty;
if (err->code == GST_STREAM_ERROR_CODEC_NOT_FOUND
|| err->code == GST_STREAM_ERROR_WRONG_TYPE
@@ -788,8 +790,19 @@ gboolean MediaPlayerPrivateGStreamer::handleMessage(GstMessage* message)
// Ignore state changes from internal elements. They are
// forwarded to playbin2 anyway.
- if (GST_MESSAGE_SRC(message) == reinterpret_cast<GstObject*>(m_playBin))
+ if (GST_MESSAGE_SRC(message) == reinterpret_cast<GstObject*>(m_playBin)) {
updateStates();
+
+ // Construct a filename for the graphviz dot file output.
+ GstState oldState, newState;
+ gst_message_parse_state_changed(message, &oldState, &newState, 0);
+
+ CString dotFileName = String::format("webkit-video.%s_%s",
+ gst_element_state_get_name(oldState),
+ gst_element_state_get_name(newState)).utf8();
+
+ GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(m_playBin), GST_DEBUG_GRAPH_SHOW_ALL, dotFileName.data());
+ }
break;
case GST_MESSAGE_BUFFERING:
processBufferingStats(message);
diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
index 2f5262195..7be2c5e05 100644
--- a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
@@ -35,6 +35,7 @@
#include "SharedBuffer.h"
#if HAVE(QT5)
#include <QWindow>
+#include <qpa/qplatformpixmap.h>
#endif
#include <wtf/UnusedParam.h>
#include <wtf/text/CString.h>
@@ -312,6 +313,7 @@ PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attri
GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool)
: m_currentWidth(0)
, m_currentHeight(0)
+ , m_compiler(isGLES2Compliant() ? SH_ESSL_OUTPUT : SH_GLSL_OUTPUT)
, m_attrs(attrs)
, m_texture(0)
, m_compositorTexture(0)
@@ -412,6 +414,7 @@ GraphicsContext3D::~GraphicsContext3D()
// If GraphicsContext3D init failed in constructor, m_private set to nullptr and no buffers are allocated.
if (!m_private)
return;
+
makeContextCurrent();
glDeleteTextures(1, &m_texture);
glDeleteFramebuffers(1, &m_fbo);
@@ -484,25 +487,46 @@ bool GraphicsContext3D::getImageData(Image* image,
UNUSED_PARAM(ignoreGammaAndColorProfile);
if (!image)
return false;
- QImage nativeImage;
+
+ QImage qtImage;
// Is image already loaded? If not, load it.
if (image->data())
- nativeImage = QImage::fromData(reinterpret_cast<const uchar*>(image->data()->data()), image->data()->size()).convertToFormat(QImage::Format_ARGB32);
+ qtImage = QImage::fromData(reinterpret_cast<const uchar*>(image->data()->data()), image->data()->size());
else {
QPixmap* nativePixmap = image->nativeImageForCurrentFrame();
- nativeImage = nativePixmap->toImage().convertToFormat(QImage::Format_ARGB32);
+#if HAVE(QT5)
+ // With QPA, we can avoid a deep copy.
+ qtImage = *nativePixmap->handle()->buffer();
+#else
+ // This might be a deep copy, depending on other references to the pixmap.
+ qtImage = nativePixmap->toImage();
+#endif
+ }
+
+ AlphaOp alphaOp = AlphaDoNothing;
+ switch (qtImage.format()) {
+ case QImage::Format_ARGB32:
+ if (premultiplyAlpha)
+ alphaOp = AlphaDoPremultiply;
+ break;
+ case QImage::Format_ARGB32_Premultiplied:
+ if (!premultiplyAlpha)
+ alphaOp = AlphaDoUnmultiply;
+ break;
+ default:
+ // The image has a format that is not supported in packPixels. We have to convert it here.
+ qtImage = qtImage.convertToFormat(premultiplyAlpha ? QImage::Format_ARGB32_Premultiplied : QImage::Format_ARGB32);
+ break;
}
- AlphaOp neededAlphaOp = AlphaDoNothing;
- if (premultiplyAlpha)
- neededAlphaOp = AlphaDoPremultiply;
unsigned int packedSize;
// Output data is tightly packed (alignment == 1).
if (computeImageSizeInBytes(format, type, image->width(), image->height(), 1, &packedSize, 0) != GraphicsContext3D::NO_ERROR)
return false;
+
outputVector.resize(packedSize);
- return packPixels(nativeImage.bits(), SourceFormatBGRA8, image->width(), image->height(), 0, format, type, neededAlphaOp, outputVector.data());
+ return packPixels(qtImage.bits(), SourceFormatBGRA8, image->width(), image->height(), 0, format, type, alphaOp, outputVector.data());
}
void GraphicsContext3D::setContextLostCallback(PassOwnPtr<ContextLostCallback>)
diff --git a/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
index ee8b92248..ac3d929bc 100644
--- a/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
@@ -202,12 +202,7 @@ void ImageBuffer::clip(GraphicsContext* context, const FloatRect& rect) const
static bool drawNeedsCopy(GraphicsContext* src, GraphicsContext* dst)
{
- if (src == dst)
- return true;
- // If we're rendering into a deferred canvas, we need to make a deep copy of the source pixels because Skia does not
- // retain a reference to the actual pixels otherwise. We check if we're drawing into a deferred canvas by seeing if the
- // device's bitmap configuration is set or not - if it's not, then we must not have a bitmap target yet.
- return dst->platformContext()->canvas()->getDevice()->config() == SkBitmap::kNo_Config;
+ return dst->platformContext()->isDeferred() || src == dst;
}
void ImageBuffer::draw(GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
diff --git a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index d7bab4392..74a4f38cf 100644
--- a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -122,7 +122,11 @@ PlatformContextSkia::State::State()
, m_lineJoin(SkPaint::kDefault_Join)
, m_dash(0)
, m_textDrawingMode(TextModeFill)
+#if USE(LOW_QUALITY_IMAGE_INTERPOLATION)
+ , m_interpolationQuality(InterpolationLow)
+#else
, m_interpolationQuality(InterpolationHigh)
+#endif
{
}
@@ -182,6 +186,7 @@ PlatformContextSkia::PlatformContextSkia(SkCanvas* canvas)
, m_trackOpaqueRegion(false)
, m_printing(false)
, m_accelerated(false)
+ , m_deferred(false)
, m_drawingToImageBuffer(false)
{
m_stateStack.append(State());
diff --git a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h
index 1c85ec928..b9fcb7b42 100644
--- a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h
+++ b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h
@@ -186,6 +186,12 @@ public:
bool isAccelerated() const { return m_accelerated; }
void setAccelerated(bool accelerated) { m_accelerated = accelerated; }
+ // True if this context is deferring draw calls to be executed later.
+ // We need to know this for context-to-context draws, in order to know if
+ // the source bitmap needs to be copied.
+ bool isDeferred() const { return m_deferred; }
+ void setDeferred(bool deferred) { m_deferred = deferred; }
+
void setTrackOpaqueRegion(bool track) { m_trackOpaqueRegion = track; }
// This will be an empty region unless tracking is enabled.
@@ -235,6 +241,7 @@ private:
FloatSize m_imageResamplingHintDstSize;
bool m_printing;
bool m_accelerated;
+ bool m_deferred;
bool m_drawingToImageBuffer;
};
diff --git a/Source/WebCore/platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp b/Source/WebCore/platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp
index a8fe4ddc2..84312def2 100644
--- a/Source/WebCore/platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp
+++ b/Source/WebCore/platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp
@@ -88,6 +88,12 @@ void GraphicsSurface::platformCopyToGLTexture(uint32_t target, uint32_t id, cons
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE_ARB, 0, 0);
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
glPopAttrib();
+
+ // According to IOSurface's documentation, glBindFramebuffer is the one triggering an update of the surface's cache.
+ // If the web process starts rendering and unlocks the surface before this happens, we might copy contents
+ // of the currently rendering frame on our texture instead of the previously completed frame.
+ // Flush the command buffer to reduce the odds of this happening, this would not be necessary with double buffering.
+ glFlush();
}
void GraphicsSurface::platformCopyFromFramebuffer(uint32_t originFbo, const IntRect& sourceRect)
@@ -168,18 +174,14 @@ static int ioSurfaceLockOptions(int lockOptions)
return options;
}
-static int ioSurfaceUnlockOptions(int lockOptions)
-{
- int options = 0;
- if (lockOptions & GraphicsSurface::ReadOnly)
- options |= (kIOSurfaceLockAvoidSync | kIOSurfaceLockReadOnly);
- return options;
-}
-
char* GraphicsSurface::platformLock(const IntRect& rect, int* outputStride, LockOptions lockOptions)
{
m_lockOptions = lockOptions;
- IOSurfaceLock(m_platformSurface, ioSurfaceLockOptions(m_lockOptions), 0);
+ IOReturn status = IOSurfaceLock(m_platformSurface, ioSurfaceLockOptions(m_lockOptions), 0);
+ if (status == kIOReturnCannotLock) {
+ m_lockOptions |= RetainPixels;
+ IOSurfaceLock(m_platformSurface, ioSurfaceLockOptions(m_lockOptions), 0);
+ }
int stride = IOSurfaceGetBytesPerRow(m_platformSurface);
if (outputStride)
@@ -191,7 +193,7 @@ char* GraphicsSurface::platformLock(const IntRect& rect, int* outputStride, Lock
void GraphicsSurface::platformUnlock()
{
- IOSurfaceUnlock(m_platformSurface, ioSurfaceUnlockOptions(m_lockOptions) & (~kIOSurfaceLockAvoidSync), 0);
+ IOSurfaceUnlock(m_platformSurface, ioSurfaceLockOptions(m_lockOptions), 0);
}
void GraphicsSurface::platformDestroy()
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
index 6e176e865..6db7d6f0d 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
@@ -22,6 +22,7 @@
#include "TextureMapperGL.h"
#include "GraphicsContext.h"
+#include "GraphicsContext3D.h"
#include "Image.h"
#include "TextureMapperShaderManager.h"
#include "Timer.h"
@@ -36,9 +37,8 @@
#endif
#if PLATFORM(QT)
-#if QT_VERSION >= 0x050000
+#if HAVE(QT5)
#include <QOpenGLContext>
-#include <qpa/qplatformpixmap.h>
#else
#include <QGLContext>
#endif // QT_VERSION
@@ -50,12 +50,6 @@
#include <GL/glx.h>
#endif
-#if USE(CAIRO)
-#include "CairoUtilities.h"
-#include "RefPtrCairo.h"
-#include <cairo.h>
-#endif
-
#define GL_CMD(...) do { __VA_ARGS__; ASSERT_ARG(__VA_ARGS__, !glGetError()); } while (0)
namespace WebCore {
struct TextureMapperGLData {
@@ -447,26 +441,6 @@ bool BitmapTextureGL::canReuseWith(const IntSize& contentsSize, Flags)
#define DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE GL_UNSIGNED_BYTE
#endif
-static void swizzleBGRAToRGBA(uint32_t* data, const IntRect& rect, int stride = 0)
-{
- stride = stride ? stride : rect.width();
- for (int y = rect.y(); y < rect.maxY(); ++y) {
- uint32_t* p = data + y * stride;
- for (int x = rect.x(); x < rect.maxX(); ++x)
- p[x] = ((p[x] << 16) & 0xff0000) | ((p[x] >> 16) & 0xff) | (p[x] & 0xff00ff00);
- }
-}
-
-static bool driverSupportsBGRASwizzling()
-{
-#if defined(TEXMAP_OPENGL_ES_2)
- // FIXME: Implement reliable detection. See also https://bugs.webkit.org/show_bug.cgi?id=81103.
- return false;
-#else
- return true;
-#endif
-}
-
static bool driverSupportsSubImage()
{
#if defined(TEXMAP_OPENGL_ES_2)
@@ -486,57 +460,50 @@ void BitmapTextureGL::didReset()
if (m_textureSize == contentSize())
return;
- GLuint format = driverSupportsBGRASwizzling() ? GL_BGRA : GL_RGBA;
-
m_textureSize = contentSize();
GL_CMD(glBindTexture(GL_TEXTURE_2D, m_id));
GL_CMD(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
GL_CMD(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
GL_CMD(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE));
GL_CMD(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));
- GL_CMD(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_textureSize.width(), m_textureSize.height(), 0, format, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, 0));
+ GL_CMD(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_textureSize.width(), m_textureSize.height(), 0, GL_RGBA, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, 0));
}
void BitmapTextureGL::updateContents(const void* data, const IntRect& targetRect, const IntPoint& sourceOffset, int bytesPerLine)
{
- GLuint glFormat = GL_RGBA;
GL_CMD(glBindTexture(GL_TEXTURE_2D, m_id));
- if (driverSupportsBGRASwizzling())
- glFormat = GL_BGRA;
- else
- swizzleBGRAToRGBA(reinterpret_cast<uint32_t*>(const_cast<void*>(data)), IntRect(sourceOffset, targetRect.size()), bytesPerLine / 4);
-
- if (bytesPerLine == targetRect.width() / 4 && sourceOffset == IntPoint::zero()) {
- GL_CMD(glTexSubImage2D(GL_TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, (const char*)data));
+ const unsigned bytesPerPixel = 4;
+ if (bytesPerLine == targetRect.width() * bytesPerPixel && sourceOffset == IntPoint::zero()) {
+ GL_CMD(glTexSubImage2D(GL_TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), GL_RGBA, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, (const char*)data));
return;
}
// For ES drivers that don't support sub-images.
if (!driverSupportsSubImage()) {
const char* bits = static_cast<const char*>(data);
- const char* src = bits + sourceOffset.y() * bytesPerLine + sourceOffset.x() * 4;
- Vector<char> temporaryData(targetRect.width() * targetRect.height() * 4);
+ const char* src = bits + sourceOffset.y() * bytesPerLine + sourceOffset.x() * bytesPerPixel;
+ Vector<char> temporaryData(targetRect.width() * targetRect.height() * bytesPerPixel);
char* dst = temporaryData.data();
- const int targetBytesPerLine = targetRect.width() * 4;
+ const int targetBytesPerLine = targetRect.width() * bytesPerPixel;
for (int y = 0; y < targetRect.height(); ++y) {
memcpy(dst, src, targetBytesPerLine);
src += bytesPerLine;
dst += targetBytesPerLine;
}
- GL_CMD(glTexSubImage2D(GL_TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, temporaryData.data()));
+ GL_CMD(glTexSubImage2D(GL_TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), GL_RGBA, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, temporaryData.data()));
return;
}
#if !defined(TEXMAP_OPENGL_ES_2)
// Use the OpenGL sub-image extension, now that we know it's available.
- GL_CMD(glPixelStorei(GL_UNPACK_ROW_LENGTH, bytesPerLine / 4));
+ GL_CMD(glPixelStorei(GL_UNPACK_ROW_LENGTH, bytesPerLine / bytesPerPixel));
GL_CMD(glPixelStorei(GL_UNPACK_SKIP_ROWS, sourceOffset.y()));
GL_CMD(glPixelStorei(GL_UNPACK_SKIP_PIXELS, sourceOffset.x()));
- GL_CMD(glTexSubImage2D(GL_TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, (const char*)data));
+ GL_CMD(glTexSubImage2D(GL_TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), GL_RGBA, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, (const char*)data));
GL_CMD(glPixelStorei(GL_UNPACK_ROW_LENGTH, 0));
GL_CMD(glPixelStorei(GL_UNPACK_SKIP_ROWS, 0));
GL_CMD(glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0));
@@ -547,31 +514,12 @@ void BitmapTextureGL::updateContents(Image* image, const IntRect& targetRect, co
{
if (!image)
return;
- NativeImagePtr frameImage = image->nativeImageForCurrentFrame();
- if (!frameImage)
- return;
- int bytesPerLine;
- const char* imageData;
-
-#if PLATFORM(QT)
- QImage qtImage;
-#if HAVE(QT5)
- // With QPA, we can avoid a deep copy.
- qtImage = *frameImage->handle()->buffer();
-#else
- // This might be a deep copy, depending on other references to the pixmap.
- qtImage = frameImage->toImage();
-#endif
- imageData = reinterpret_cast<const char*>(qtImage.constBits());
- bytesPerLine = qtImage.bytesPerLine();
-#elif USE(CAIRO)
- cairo_surface_t* surface = frameImage->surface();
- imageData = reinterpret_cast<const char*>(cairo_image_surface_get_data(surface));
- bytesPerLine = cairo_image_surface_get_stride(surface);
-#endif
+ Vector<uint8_t> imageData;
+ GraphicsContext3D::extractImageData(image, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, false /* flipY */, true /* premultiplyAlpha */, false /* ignoreGammaAndColorProfile */, imageData);
- updateContents(imageData, targetRect, offset, bytesPerLine);
+ const unsigned bytesPerPixel = 4;
+ updateContents(imageData.data(), targetRect, offset, image->width() * bytesPerPixel);
}
#if ENABLE(CSS_FILTERS)
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
index c138912ec..fd4bf2f7a 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
@@ -351,9 +351,6 @@ void TextureMapperLayer::paintRecursive(const TextureMapperPaintOptions& options
TextureMapperPaintOptions paintOptions(options);
paintOptions.mask = maskTexture.get();
- IntRect surfaceRect;
-
- RefPtr<BitmapTexture> surface;
if (!shouldPaintToIntermediateSurface()) {
paintOptions.opacity = opacity;
@@ -363,8 +360,9 @@ void TextureMapperLayer::paintRecursive(const TextureMapperPaintOptions& options
// Prepare a surface to paint into.
// We paint into the surface ignoring the opacity/transform of the current layer.
- surfaceRect = intermediateSurfaceRect();
- surface = options.textureMapper->acquireTextureFromPool(surfaceRect.size());
+ IntRect surfaceRect = intermediateSurfaceRect();
+ RefPtr<BitmapTexture> surface = options.textureMapper->acquireTextureFromPool(surfaceRect.size());
+ paintOptions.surface = surface;
options.textureMapper->bindSurface(surface.get());
paintOptions.opacity = 1;
diff --git a/Source/WebCore/platform/image-decoders/ImageDecoder.h b/Source/WebCore/platform/image-decoders/ImageDecoder.h
index e92ba7dae..2611be900 100644
--- a/Source/WebCore/platform/image-decoders/ImageDecoder.h
+++ b/Source/WebCore/platform/image-decoders/ImageDecoder.h
@@ -362,7 +362,7 @@ namespace WebCore {
int scaledY(int origY, int searchStart = 0);
RefPtr<SharedBuffer> m_data; // The encoded data.
- Vector<ImageFrame> m_frameBufferCache;
+ Vector<ImageFrame, 1> m_frameBufferCache;
// FIXME: Do we need m_colorProfile any more, for any port?
ColorProfile m_colorProfile;
bool m_scaled;
diff --git a/Source/WebCore/platform/text/LocaleICU.cpp b/Source/WebCore/platform/text/LocaleICU.cpp
index 56d6a7760..f6b4ef80f 100644
--- a/Source/WebCore/platform/text/LocaleICU.cpp
+++ b/Source/WebCore/platform/text/LocaleICU.cpp
@@ -272,13 +272,18 @@ bool LocaleICU::initializeShortDateFormat()
{
if (m_didCreateShortDateFormat)
return m_shortDateFormat;
- const UChar gmtTimezone[3] = {'G', 'M', 'T'};
- UErrorCode status = U_ZERO_ERROR;
- m_shortDateFormat = udat_open(UDAT_NONE, UDAT_SHORT, m_locale.data(), gmtTimezone, WTF_ARRAY_LENGTH(gmtTimezone), 0, -1, &status);
+ m_shortDateFormat = openDateFormat(UDAT_NONE, UDAT_SHORT);
m_didCreateShortDateFormat = true;
return m_shortDateFormat;
}
+UDateFormat* LocaleICU::openDateFormat(UDateFormatStyle timeStyle, UDateFormatStyle dateStyle) const
+{
+ const UChar gmtTimezone[3] = {'G', 'M', 'T'};
+ UErrorCode status = U_ZERO_ERROR;
+ return udat_open(timeStyle, dateStyle, m_locale.data(), gmtTimezone, WTF_ARRAY_LENGTH(gmtTimezone), 0, -1, &status);
+}
+
double LocaleICU::parseLocalizedDate(const String& input)
{
if (!initializeShortDateFormat())
@@ -313,6 +318,23 @@ String LocaleICU::formatLocalizedDate(const DateComponents& dateComponents)
}
#if ENABLE(CALENDAR_PICKER)
+static String getDateFormatPattern(const UDateFormat* dateFormat)
+{
+ if (!dateFormat)
+ return emptyString();
+
+ UErrorCode status = U_ZERO_ERROR;
+ int32_t length = udat_toPattern(dateFormat, TRUE, 0, 0, &status);
+ if (status != U_BUFFER_OVERFLOW_ERROR || !length)
+ return emptyString();
+ Vector<UChar> buffer(length);
+ status = U_ZERO_ERROR;
+ udat_toPattern(dateFormat, TRUE, buffer.data(), length, &status);
+ if (U_FAILURE(status))
+ return emptyString();
+ return String::adopt(buffer);
+}
+
static inline bool isICUYearSymbol(UChar letter)
{
return letter == 'y' || letter == 'Y';
@@ -330,12 +352,12 @@ static inline bool isICUDayInMonthSymbol(UChar letter)
// Specification of the input:
// http://icu-project.org/apiref/icu4c/classSimpleDateFormat.html#details
-static String localizeFormat(const Vector<UChar>& buffer)
+static String localizeFormat(const String& buffer)
{
StringBuilder builder;
UChar lastChar = 0;
bool inQuote = false;
- for (unsigned i = 0; i < buffer.size(); ++i) {
+ for (unsigned i = 0; i < buffer.length(); ++i) {
if (inQuote) {
if (buffer[i] == '\'') {
inQuote = false;
@@ -374,16 +396,7 @@ void LocaleICU::initializeLocalizedDateFormatText()
m_localizedDateFormatText = emptyString();
if (!initializeShortDateFormat())
return;
- UErrorCode status = U_ZERO_ERROR;
- int32_t length = udat_toPattern(m_shortDateFormat, TRUE, 0, 0, &status);
- if (status != U_BUFFER_OVERFLOW_ERROR)
- return;
- Vector<UChar> buffer(length);
- status = U_ZERO_ERROR;
- udat_toPattern(m_shortDateFormat, TRUE, buffer.data(), length, &status);
- if (U_FAILURE(status))
- return;
- m_localizedDateFormatText = localizeFormat(buffer);
+ m_localizedDateFormatText = localizeFormat(getDateFormatPattern(m_shortDateFormat));
}
String LocaleICU::localizedDateFormatText()
@@ -392,23 +405,23 @@ String LocaleICU::localizedDateFormatText()
return m_localizedDateFormatText;
}
-PassOwnPtr<Vector<String> > LocaleICU::createLabelVector(UDateFormatSymbolType type, int32_t startIndex, int32_t size)
+PassOwnPtr<Vector<String> > LocaleICU::createLabelVector(const UDateFormat* dateFormat, UDateFormatSymbolType type, int32_t startIndex, int32_t size)
{
- if (!m_shortDateFormat)
+ if (!dateFormat)
return PassOwnPtr<Vector<String> >();
- if (udat_countSymbols(m_shortDateFormat, type) != startIndex + size)
+ if (udat_countSymbols(dateFormat, type) != startIndex + size)
return PassOwnPtr<Vector<String> >();
OwnPtr<Vector<String> > labels = adoptPtr(new Vector<String>());
labels->reserveCapacity(size);
for (int32_t i = 0; i < size; ++i) {
UErrorCode status = U_ZERO_ERROR;
- int32_t length = udat_getSymbols(m_shortDateFormat, type, startIndex + i, 0, 0, &status);
+ int32_t length = udat_getSymbols(dateFormat, type, startIndex + i, 0, 0, &status);
if (status != U_BUFFER_OVERFLOW_ERROR)
return PassOwnPtr<Vector<String> >();
Vector<UChar> buffer(length);
status = U_ZERO_ERROR;
- udat_getSymbols(m_shortDateFormat, type, startIndex + i, buffer.data(), length, &status);
+ udat_getSymbols(dateFormat, type, startIndex + i, buffer.data(), length, &status);
if (U_FAILURE(status))
return PassOwnPtr<Vector<String> >();
labels->append(String::adopt(buffer));
@@ -452,11 +465,11 @@ void LocaleICU::initializeCalendar()
}
m_firstDayOfWeek = ucal_getAttribute(udat_getCalendar(m_shortDateFormat), UCAL_FIRST_DAY_OF_WEEK) - UCAL_SUNDAY;
- m_monthLabels = createLabelVector(UDAT_MONTHS, UCAL_JANUARY, 12);
+ m_monthLabels = createLabelVector(m_shortDateFormat, UDAT_MONTHS, UCAL_JANUARY, 12);
if (!m_monthLabels)
m_monthLabels = createFallbackMonthLabels();
- m_weekDayShortLabels = createLabelVector(UDAT_SHORT_WEEKDAYS, UCAL_SUNDAY, 7);
+ m_weekDayShortLabels = createLabelVector(m_shortDateFormat, UDAT_SHORT_WEEKDAYS, UCAL_SUNDAY, 7);
if (!m_weekDayShortLabels)
m_weekDayShortLabels = createFallbackWeekDayShortLabels();
}
diff --git a/Source/WebCore/platform/text/LocaleICU.h b/Source/WebCore/platform/text/LocaleICU.h
index 77360a2aa..8c9b39e73 100644
--- a/Source/WebCore/platform/text/LocaleICU.h
+++ b/Source/WebCore/platform/text/LocaleICU.h
@@ -75,10 +75,11 @@ private:
unsigned matchedDecimalSymbolIndex(const String& input, unsigned& position);
bool initializeShortDateFormat();
+ UDateFormat* openDateFormat(UDateFormatStyle timeStyle, UDateFormatStyle dateStyle) const;
#if ENABLE(CALENDAR_PICKER)
void initializeLocalizedDateFormatText();
- PassOwnPtr<Vector<String> > createLabelVector(UDateFormatSymbolType, int32_t startIndex, int32_t size);
+ PassOwnPtr<Vector<String> > createLabelVector(const UDateFormat*, UDateFormatSymbolType, int32_t startIndex, int32_t size);
void initializeCalendar();
#endif
diff --git a/Source/WebCore/platform/win/DragDataWin.cpp b/Source/WebCore/platform/win/DragDataWin.cpp
index 29f0e7671..6a9aeaf88 100644
--- a/Source/WebCore/platform/win/DragDataWin.cpp
+++ b/Source/WebCore/platform/win/DragDataWin.cpp
@@ -140,17 +140,17 @@ void DragData::asFilenames(Vector<String>& result) const
STGMEDIUM medium;
if (FAILED(m_platformDragData->GetData(cfHDropFormat(), &medium)))
return;
-
- HDROP hdrop = (HDROP)GlobalLock(medium.hGlobal);
+
+ HDROP hdrop = reinterpret_cast<HDROP>(GlobalLock(medium.hGlobal));
if (!hdrop)
return;
const unsigned numFiles = DragQueryFileW(hdrop, 0xFFFFFFFF, 0, 0);
for (unsigned i = 0; i < numFiles; i++) {
- if (!DragQueryFileW(hdrop, 0, filename, WTF_ARRAY_LENGTH(filename)))
+ if (!DragQueryFileW(hdrop, i, filename, WTF_ARRAY_LENGTH(filename)))
continue;
- result.append((UChar*)filename);
+ result.append(static_cast<UChar*>(filename));
}
// Free up memory from drag
diff --git a/Source/WebCore/rendering/AutoTableLayout.cpp b/Source/WebCore/rendering/AutoTableLayout.cpp
index 7a64e7a10..019b11d53 100644
--- a/Source/WebCore/rendering/AutoTableLayout.cpp
+++ b/Source/WebCore/rendering/AutoTableLayout.cpp
@@ -498,8 +498,11 @@ void AutoTableLayout::layout()
int available = tableLogicalWidth;
size_t nEffCols = m_table->numEffCols();
+ // FIXME: It is possible to be called without having properly updated our internal representation.
+ // This means that our preferred logical widths were not recomputed as expected.
if (nEffCols != m_layoutStruct.size()) {
fullRecalc();
+ // FIXME: Table layout shouldn't modify our table structure (but does due to columns and column-groups).
nEffCols = m_table->numEffCols();
}
diff --git a/Source/WebCore/rendering/FixedTableLayout.cpp b/Source/WebCore/rendering/FixedTableLayout.cpp
index 41dd906e1..8649a08d3 100644
--- a/Source/WebCore/rendering/FixedTableLayout.cpp
+++ b/Source/WebCore/rendering/FixedTableLayout.cpp
@@ -207,6 +207,15 @@ void FixedTableLayout::layout()
{
int tableLogicalWidth = m_table->logicalWidth() - m_table->bordersPaddingAndSpacingInRowDirection();
unsigned nEffCols = m_table->numEffCols();
+
+ // FIXME: It is possible to be called without having properly updated our internal representation.
+ // This means that our preferred logical widths were not recomputed as expected.
+ if (nEffCols != m_width.size()) {
+ calcWidthArray(tableLogicalWidth);
+ // FIXME: Table layout shouldn't modify our table structure (but does due to columns and column-groups).
+ nEffCols = m_table->numEffCols();
+ }
+
Vector<int> calcWidth(nEffCols, 0);
unsigned numAuto = 0;
diff --git a/Source/WebCore/rendering/RenderBoxModelObject.cpp b/Source/WebCore/rendering/RenderBoxModelObject.cpp
index b77438d96..a35a206e2 100644
--- a/Source/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/Source/WebCore/rendering/RenderBoxModelObject.cpp
@@ -1070,7 +1070,7 @@ IntSize RenderBoxModelObject::calculateFillTileSize(const FillLayer* fillLayer,
h = imageIntrinsicSize.height();
}
- return IntSize(max(1, w), max(1, h));
+ return IntSize(max(0, w), max(0, h));
}
case SizeNone: {
// If both values are ‘auto’ then the intrinsic width and/or height of the image should be used, if any.
diff --git a/Source/WebCore/rendering/RenderGeometryMap.cpp b/Source/WebCore/rendering/RenderGeometryMap.cpp
index af19ba4e2..a1f50ed33 100644
--- a/Source/WebCore/rendering/RenderGeometryMap.cpp
+++ b/Source/WebCore/rendering/RenderGeometryMap.cpp
@@ -46,25 +46,6 @@ public:
{
}
- FloatPoint mapPoint(const FloatPoint& p) const
- {
- if (!m_transform)
- return p + m_offset;
-
- return m_transform->mapPoint(p);
- }
-
- FloatQuad mapQuad(const FloatQuad& quad) const
- {
- if (!m_transform) {
- FloatQuad q = quad;
- q.move(m_offset);
- return q;
- }
-
- return m_transform->mapQuad(quad);
- }
-
const RenderObject* m_renderer;
LayoutSize m_offset;
OwnPtr<TransformationMatrix> m_transform; // Includes offset if non-null.
@@ -216,8 +197,11 @@ void RenderGeometryMap::push(const RenderObject* renderer, const TransformationM
ASSERT(m_insertionPosition != notFound);
OwnPtr<RenderGeometryMapStep> step = adoptPtr(new RenderGeometryMapStep(renderer, accumulatingTransform, isNonUniform, isFixedPosition, hasTransform));
- step->m_transform = adoptPtr(new TransformationMatrix(t));
-
+ if (!t.isIntegerTranslation())
+ step->m_transform = adoptPtr(new TransformationMatrix(t));
+ else
+ step->m_offset = LayoutSize(t.e(), t.f());
+
stepInserted(*step.get());
m_mapping.insert(m_insertionPosition, step.release());
}
diff --git a/Source/WebCore/rendering/RenderImage.cpp b/Source/WebCore/rendering/RenderImage.cpp
index e3aea912d..6e1109c7b 100644
--- a/Source/WebCore/rendering/RenderImage.cpp
+++ b/Source/WebCore/rendering/RenderImage.cpp
@@ -453,6 +453,14 @@ void RenderImage::paintIntoRect(GraphicsContext* context, const LayoutRect& rect
context->drawImage(m_imageResource->image(alignedRect.width(), alignedRect.height()).get(), style()->colorSpace(), alignedRect, compositeOperator, shouldRespectImageOrientation(), useLowQualityScaling);
}
+bool RenderImage::boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance bleedAvoidance, InlineFlowBox*) const
+{
+ if (!RenderBoxModelObject::boxShadowShouldBeAppliedToBackground(bleedAvoidance))
+ return false;
+
+ return !backgroundIsObscured();
+}
+
bool RenderImage::backgroundIsObscured() const
{
if (!m_imageResource->hasImage() || m_imageResource->errorOccurred())
diff --git a/Source/WebCore/rendering/RenderImage.h b/Source/WebCore/rendering/RenderImage.h
index e7092e11c..b6725f005 100644
--- a/Source/WebCore/rendering/RenderImage.h
+++ b/Source/WebCore/rendering/RenderImage.h
@@ -91,6 +91,8 @@ private:
virtual void notifyFinished(CachedResource*);
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE;
+ virtual bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance, InlineFlowBox*) const OVERRIDE;
+
IntSize imageSizeForError(CachedImage*) const;
void imageDimensionsChanged(bool imageSizeChanged, const IntRect* = 0);
bool updateIntrinsicSizeIfNeeded(const IntSize&, bool imageSizeChanged);
diff --git a/Source/WebCore/rendering/RenderTable.cpp b/Source/WebCore/rendering/RenderTable.cpp
index ab3187794..64337bd5e 100644
--- a/Source/WebCore/rendering/RenderTable.cpp
+++ b/Source/WebCore/rendering/RenderTable.cpp
@@ -273,7 +273,8 @@ LayoutUnit RenderTable::convertStyleLogicalWidthToComputedWidth(const Length& st
bool isCSSTable = !node() || !node()->hasTagName(tableTag);
if (isCSSTable && styleLogicalWidth.isFixed() && styleLogicalWidth.isPositive()) {
recalcBordersInRowDirection();
- borders = borderStart() + borderEnd() + (collapseBorders() ? ZERO_LAYOUT_UNIT : paddingStart() + paddingEnd());
+ if (style()->boxSizing() == CONTENT_BOX)
+ borders = borderStart() + borderEnd() + (collapseBorders() ? ZERO_LAYOUT_UNIT : paddingStart() + paddingEnd());
}
return minimumValueForLength(styleLogicalWidth, availableWidth, view()) + borders;
}
@@ -397,7 +398,10 @@ void RenderTable::layout()
LayoutUnit computedLogicalHeight = 0;
if (logicalHeightLength.isFixed()) {
// HTML tables size as though CSS height includes border/padding, CSS tables do not.
- LayoutUnit borders = node() && node()->hasTagName(tableTag) ? (borderAndPaddingBefore + borderAndPaddingAfter) : ZERO_LAYOUT_UNIT;
+ LayoutUnit borders = ZERO_LAYOUT_UNIT;
+ // FIXME: We cannot apply box-sizing: content-box on <table> which other browsers allow.
+ if ((node() && node()->hasTagName(tableTag)) || style()->boxSizing() == BORDER_BOX)
+ borders = borderAndPaddingBefore + borderAndPaddingAfter;
computedLogicalHeight = logicalHeightLength.value() - borders;
} else if (logicalHeightLength.isPercent())
computedLogicalHeight = computePercentageLogicalHeight(logicalHeightLength);
diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h
index 805aff79d..d0702691c 100644
--- a/Source/WebCore/rendering/style/RenderStyle.h
+++ b/Source/WebCore/rendering/style/RenderStyle.h
@@ -19,6 +19,7 @@
* 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 RenderStyle_h
diff --git a/Source/WebCore/rendering/style/StyleRareInheritedData.h b/Source/WebCore/rendering/style/StyleRareInheritedData.h
index 8bd3bf9ce..93908e446 100644
--- a/Source/WebCore/rendering/style/StyleRareInheritedData.h
+++ b/Source/WebCore/rendering/style/StyleRareInheritedData.h
@@ -19,6 +19,7 @@
* 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 StyleRareInheritedData_h
diff --git a/Source/WebCore/rendering/style/StyleVariableData.h b/Source/WebCore/rendering/style/StyleVariableData.h
index b1e42dbee..bb45989f1 100644
--- a/Source/WebCore/rendering/style/StyleVariableData.h
+++ b/Source/WebCore/rendering/style/StyleVariableData.h
@@ -26,7 +26,6 @@
* 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.
- *
*/
diff --git a/Source/WebCore/svg/animation/SMILTimeContainer.cpp b/Source/WebCore/svg/animation/SMILTimeContainer.cpp
index 156653315..b032f3158 100644
--- a/Source/WebCore/svg/animation/SMILTimeContainer.cpp
+++ b/Source/WebCore/svg/animation/SMILTimeContainer.cpp
@@ -112,10 +112,11 @@ void SMILTimeContainer::pause()
void SMILTimeContainer::resume()
{
- if (!m_beginTime)
- return;
ASSERT(isPaused());
- m_accumulatedPauseTime += currentTime() - m_pauseTime;
+
+ if (m_beginTime)
+ m_accumulatedPauseTime += currentTime() - m_pauseTime;
+
m_pauseTime = 0;
startTimer(0);
}
@@ -131,8 +132,12 @@ void SMILTimeContainer::setElapsed(SMILTime time)
if (m_beginTime)
m_timer.stop();
- m_beginTime = currentTime() - time.value();
+ double now = currentTime();
+ m_beginTime = now - time.value();
+
m_accumulatedPauseTime = 0;
+ if (m_pauseTime)
+ m_pauseTime = now;
Vector<SVGSMILElement*> toReset;
copyToVector(m_scheduledAnimations, toReset);
diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp
index 44ef4d5c5..2270b4acc 100644
--- a/Source/WebCore/testing/Internals.cpp
+++ b/Source/WebCore/testing/Internals.cpp
@@ -1005,7 +1005,7 @@ void Internals::setBatteryStatus(Document* document, const String& eventType, bo
#endif
}
-void Internals::setNetworkInformation(Document* document, const String& eventType, long bandwidth, bool metered, ExceptionCode& ec)
+void Internals::setNetworkInformation(Document* document, const String& eventType, double bandwidth, bool metered, ExceptionCode& ec)
{
if (!document || !document->page()) {
ec = INVALID_ACCESS_ERR;
@@ -1028,6 +1028,14 @@ bool Internals::hasSpellingMarker(Document* document, int from, int length, Exce
return document->frame()->editor()->selectionStartHasMarkerFor(DocumentMarker::Spelling, from, length);
}
+
+bool Internals::hasAutocorrectedMarker(Document* document, int from, int length, ExceptionCode&)
+{
+ if (!document || !document->frame())
+ return 0;
+
+ return document->frame()->editor()->selectionStartHasMarkerFor(DocumentMarker::Autocorrected, from, length);
+}
#if ENABLE(INSPECTOR)
unsigned Internals::numberOfLiveNodes() const
diff --git a/Source/WebCore/testing/Internals.h b/Source/WebCore/testing/Internals.h
index cac206be2..beac6f039 100644
--- a/Source/WebCore/testing/Internals.h
+++ b/Source/WebCore/testing/Internals.h
@@ -158,6 +158,7 @@ public:
bool hasSpellingMarker(Document*, int from, int length, ExceptionCode&);
bool hasGrammarMarker(Document*, int from, int length, ExceptionCode&);
+ bool hasAutocorrectedMarker(Document*, int from, int length, ExceptionCode&);
unsigned numberOfScrollableAreas(Document*, ExceptionCode&);
@@ -169,7 +170,7 @@ public:
void setBatteryStatus(Document*, const String& eventType, bool charging, double chargingTime, double dischargingTime, double level, ExceptionCode&);
- void setNetworkInformation(Document*, const String& eventType, long bandwidth, bool metered, ExceptionCode&);
+ void setNetworkInformation(Document*, const String& eventType, double bandwidth, bool metered, ExceptionCode&);
void suspendAnimations(Document*, ExceptionCode&) const;
void resumeAnimations(Document*, ExceptionCode&) const;
diff --git a/Source/WebCore/testing/Internals.idl b/Source/WebCore/testing/Internals.idl
index b3a249f66..2f17f5558 100644
--- a/Source/WebCore/testing/Internals.idl
+++ b/Source/WebCore/testing/Internals.idl
@@ -132,6 +132,7 @@ module window {
boolean hasSpellingMarker(in Document document, in long from, in long length) raises (DOMException);
boolean hasGrammarMarker(in Document document, in long from, in long length) raises (DOMException);
+ boolean hasAutocorrectedMarker(in Document document, in long from, in long length) raises (DOMException);
unsigned long numberOfScrollableAreas(in Document document) raises (DOMException);
@@ -149,7 +150,7 @@ module window {
#endif
#if defined(ENABLE_NETWORK_INFO) && ENABLE_NETWORK_INFO
- void setNetworkInformation(in Document document, in DOMString eventType, in long bandwidth, in boolean metered) raises (DOMException);
+ void setNetworkInformation(in Document document, in DOMString eventType, in double bandwidth, in boolean metered) raises (DOMException);
#endif
[Conditional=INSPECTOR] unsigned long numberOfLiveNodes();
diff --git a/Source/WebCore/xml/XMLHttpRequest.idl b/Source/WebCore/xml/XMLHttpRequest.idl
index 045398194..095f4dc5c 100644
--- a/Source/WebCore/xml/XMLHttpRequest.idl
+++ b/Source/WebCore/xml/XMLHttpRequest.idl
@@ -93,8 +93,6 @@ module xml {
getter raises(DOMException);
readonly attribute Document responseXML
getter raises(DOMException);
- readonly attribute Blob responseBlob
- getter raises(DOMException);
attribute DOMString responseType
setter raises(DOMException);
diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog
index cdf2ebc4a..f399afad9 100644
--- a/Source/WebKit/ChangeLog
+++ b/Source/WebKit/ChangeLog
@@ -1,3 +1,40 @@
+2012-06-26 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt][Win] Symbols are not exported in QtWebKit5.dll
+ https://bugs.webkit.org/show_bug.cgi?id=88873
+
+ Reviewed by Tor Arne Vestbø.
+
+ * api.pri: Remove MAKEDLL setting done now in win32/default_post.prf.
+
+2012-06-25 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed build fix: Don't do QT += widgets with Qt 4
+
+ * WebKit1.pro: This is already done in WebKit1.pri.
+
+2012-06-25 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Make it possible to build WebKit without QtWidgets
+ https://bugs.webkit.org/show_bug.cgi?id=78109
+
+ Reviewed by Tor Arne Vestbø.
+
+ Moved WebKit1 sources into a separate static library. Only WK1
+ depends on QtWidgets.
+
+ * WebKit1.pri: Added.
+ * WebKit1.pro: Added.
+
+2012-06-25 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ [EFL] Implement Network Information API
+ https://bugs.webkit.org/show_bug.cgi?id=87067
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * PlatformEfl.cmake: Add dependency of eeze library.
+
2012-06-22 Joshua Netterfield <jnetterfield@rim.com>
[BlackBerry] Sanitize GLSL code using ANGLE.
diff --git a/Source/WebKit/PlatformEfl.cmake b/Source/WebKit/PlatformEfl.cmake
index 2def86987..e1a99e228 100644
--- a/Source/WebKit/PlatformEfl.cmake
+++ b/Source/WebKit/PlatformEfl.cmake
@@ -68,12 +68,19 @@ IF (WTF_USE_PANGO)
ENDIF ()
IF (ENABLE_NETWORK_INFO)
+ LIST(APPEND WebKit_LINK_FLAGS
+ ${EEZE_LDFLAGS}
+ )
LIST(APPEND WebKit_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/Modules/networkinfo"
+ ${EEZE_INCLUDE_DIRS}
)
LIST(APPEND WebKit_SOURCES
efl/WebCoreSupport/NetworkInfoClientEfl.cpp
)
+ LIST(APPEND WebKit_LIBRARIES
+ ${EEZE_LIBRARIES}
+ )
ENDIF ()
IF (ENABLE_NOTIFICATIONS)
diff --git a/Source/WebKit/WebKit1.pri b/Source/WebKit/WebKit1.pri
new file mode 100644
index 000000000..69a2842b2
--- /dev/null
+++ b/Source/WebKit/WebKit1.pri
@@ -0,0 +1,54 @@
+# -------------------------------------------------------------------
+# This file contains shared rules used both when building WebKit1
+# itself, and by targets that use WebKit1.
+#
+# See 'Tools/qmake/README' for an overview of the build system
+# -------------------------------------------------------------------
+
+SOURCE_DIR = $${ROOT_WEBKIT_DIR}/Source/WebKit
+
+INCLUDEPATH += \
+ $$SOURCE_DIR/qt/Api \
+ $$SOURCE_DIR/qt/WebCoreSupport \
+ $$ROOT_WEBKIT_DIR/Source/WTF/wtf/qt
+
+contains(DEFINES, ENABLE_VIDEO=1):contains(DEFINES, WTF_USE_QTKIT=1) {
+ LIBS += -framework Security -framework IOKit
+
+ # We can know the Mac OS version by using the Darwin major version
+ DARWIN_VERSION = $$split(QMAKE_HOST.version, ".")
+ DARWIN_MAJOR_VERSION = $$first(DARWIN_VERSION)
+ equals(DARWIN_MAJOR_VERSION, "11") {
+ LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLion.a
+ } else:equals(DARWIN_MAJOR_VERSION, "10") {
+ LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
+ } else:equals(DARWIN_MAJOR_VERSION, "9") {
+ LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
+ }
+}
+
+contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) || contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1) {
+ haveQt(5) {
+ QT += sensors
+ } else {
+ CONFIG *= mobility
+ MOBILITY *= sensors
+ }
+}
+
+contains(DEFINES, ENABLE_GEOLOCATION=1):haveQt(5): QT += location
+
+contains(CONFIG, texmap): DEFINES += WTF_USE_TEXTURE_MAPPER=1
+
+plugin_backend_xlib: PKGCONFIG += x11
+
+QT += network
+haveQt(5): QT += widgets printsupport quick
+
+contains(DEFINES, WTF_USE_TEXTURE_MAPPER_GL=1)|contains(DEFINES, ENABLE_WEBGL=1) {
+ QT *= opengl
+ # Make sure OpenGL libs are after the webcore lib so MinGW can resolve symbols
+ win32*:!win32-msvc*: LIBS += $$QMAKE_LIBS_OPENGL
+}
+
+
diff --git a/Source/WebKit/WebKit1.pro b/Source/WebKit/WebKit1.pro
new file mode 100644
index 000000000..fce809cf5
--- /dev/null
+++ b/Source/WebKit/WebKit1.pro
@@ -0,0 +1,152 @@
+# -------------------------------------------------------------------
+# Target file for the WebKit1 static library
+#
+# See 'Tools/qmake/README' for an overview of the build system
+# -------------------------------------------------------------------
+
+TEMPLATE = lib
+TARGET = WebKit1
+
+load(features)
+
+include(WebKit1.pri)
+
+WEBKIT += wtf javascriptcore webcore
+QT += gui
+
+CONFIG += staticlib
+
+SOURCES += \
+ $$PWD/qt/Api/qwebframe.cpp \
+ $$PWD/qt/Api/qgraphicswebview.cpp \
+ $$PWD/qt/Api/qwebpage.cpp \
+ $$PWD/qt/Api/qwebview.cpp \
+ $$PWD/qt/Api/qwebelement.cpp \
+ $$PWD/qt/Api/qwebhistory.cpp \
+ $$PWD/qt/Api/qwebsettings.cpp \
+ $$PWD/qt/Api/qwebhistoryinterface.cpp \
+ $$PWD/qt/Api/qwebplugindatabase.cpp \
+ $$PWD/qt/Api/qwebpluginfactory.cpp \
+ $$PWD/qt/Api/qwebsecurityorigin.cpp \
+ $$PWD/qt/Api/qwebscriptworld.cpp \
+ $$PWD/qt/Api/qwebdatabase.cpp \
+ $$PWD/qt/Api/qwebinspector.cpp \
+ $$PWD/qt/Api/qwebkitversion.cpp \
+ $$PWD/qt/Api/qhttpheader.cpp \
+ $$PWD/qt/WebCoreSupport/QtFallbackWebPopup.cpp \
+ $$PWD/qt/WebCoreSupport/QtWebComboBox.cpp \
+ $$PWD/qt/WebCoreSupport/ChromeClientQt.cpp \
+ $$PWD/qt/WebCoreSupport/ContextMenuClientQt.cpp \
+ $$PWD/qt/WebCoreSupport/DragClientQt.cpp \
+ $$PWD/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp \
+ $$PWD/qt/WebCoreSupport/EditorClientQt.cpp \
+ $$PWD/qt/WebCoreSupport/UndoStepQt.cpp \
+ $$PWD/qt/WebCoreSupport/FrameLoaderClientQt.cpp \
+ $$PWD/qt/WebCoreSupport/FrameNetworkingContextQt.cpp \
+ $$PWD/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp \
+ $$PWD/qt/WebCoreSupport/InitWebCoreQt.cpp \
+ $$PWD/qt/WebCoreSupport/InspectorClientQt.cpp \
+ $$PWD/qt/WebCoreSupport/InspectorServerQt.cpp \
+ $$PWD/qt/WebCoreSupport/NotificationPresenterClientQt.cpp \
+ $$PWD/qt/WebCoreSupport/PageClientQt.cpp \
+ $$PWD/qt/WebCoreSupport/PopupMenuQt.cpp \
+ $$PWD/qt/WebCoreSupport/QtPlatformPlugin.cpp \
+ $$PWD/qt/WebCoreSupport/RenderThemeQStyle.cpp \
+ $$PWD/qt/WebCoreSupport/ScrollbarThemeQStyle.cpp \
+ $$PWD/qt/WebCoreSupport/SearchPopupMenuQt.cpp \
+ $$PWD/qt/WebCoreSupport/TextCheckerClientQt.cpp \
+ $$PWD/qt/WebCoreSupport/PlatformStrategiesQt.cpp \
+ $$PWD/qt/WebCoreSupport/WebEventConversion.cpp
+
+HEADERS += \
+ $$PWD/qt/Api/qwebframe.h \
+ $$PWD/qt/Api/qwebframe_p.h \
+ $$PWD/qt/Api/qgraphicswebview.h \
+ $$PWD/qt/Api/qwebkitglobal.h \
+ $$PWD/qt/Api/qwebkitplatformplugin.h \
+ $$PWD/qt/Api/qwebpage.h \
+ $$PWD/qt/Api/qwebview.h \
+ $$PWD/qt/Api/qwebsettings.h \
+ $$PWD/qt/Api/qwebhistoryinterface.h \
+ $$PWD/qt/Api/qwebdatabase.h \
+ $$PWD/qt/Api/qwebsecurityorigin.h \
+ $$PWD/qt/Api/qwebelement.h \
+ $$PWD/qt/Api/qwebelement_p.h \
+ $$PWD/qt/Api/qwebpluginfactory.h \
+ $$PWD/qt/Api/qwebhistory.h \
+ $$PWD/qt/Api/qwebinspector.h \
+ $$PWD/qt/Api/qwebkitversion.h \
+ $$PWD/qt/Api/qwebplugindatabase_p.h \
+ $$PWD/qt/Api/qhttpheader_p.h \
+ $$PWD/qt/WebCoreSupport/InitWebCoreQt.h \
+ $$PWD/qt/WebCoreSupport/InspectorServerQt.h \
+ $$PWD/qt/WebCoreSupport/QtFallbackWebPopup.h \
+ $$PWD/qt/WebCoreSupport/QtWebComboBox.h \
+ $$PWD/qt/WebCoreSupport/FrameLoaderClientQt.h \
+ $$PWD/qt/WebCoreSupport/FrameNetworkingContextQt.h \
+ $$PWD/qt/WebCoreSupport/GeolocationPermissionClientQt.h \
+ $$PWD/qt/WebCoreSupport/NotificationPresenterClientQt.h \
+ $$PWD/qt/WebCoreSupport/PageClientQt.h \
+ $$PWD/qt/WebCoreSupport/PopupMenuQt.h \
+ $$PWD/qt/WebCoreSupport/QtPlatformPlugin.h \
+ $$PWD/qt/WebCoreSupport/RenderThemeQStyle.h \
+ $$PWD/qt/WebCoreSupport/ScrollbarThemeQStyle.h \
+ $$PWD/qt/WebCoreSupport/SearchPopupMenuQt.h \
+ $$PWD/qt/WebCoreSupport/TextCheckerClientQt.h \
+ $$PWD/qt/WebCoreSupport/PlatformStrategiesQt.h \
+ $$PWD/qt/WebCoreSupport/WebEventConversion.h
+
+INCLUDEPATH += \
+ $$PWD/qt/Api \
+ $$PWD/qt/WebCoreSupport
+
+contains(DEFINES, ENABLE_VIDEO=1) {
+ !contains(DEFINES, WTF_USE_QTKIT=1):!contains(DEFINES, WTF_USE_GSTREAMER=1):contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
+ HEADERS += $$PWD/qt/WebCoreSupport/FullScreenVideoWidget.h
+ SOURCES += $$PWD/qt/WebCoreSupport/FullScreenVideoWidget.cpp
+ }
+
+ contains(DEFINES, WTF_USE_QTKIT=1) | contains(DEFINES, WTF_USE_GSTREAMER=1) | contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
+ HEADERS += $$PWD/qt/WebCoreSupport/FullScreenVideoQt.h
+ SOURCES += $$PWD/qt/WebCoreSupport/FullScreenVideoQt.cpp
+ }
+
+ contains(DEFINES, WTF_USE_QTKIT=1) {
+ INCLUDEPATH += \
+ $$PWD/../WebCore/platform/qt/ \
+ $$PWD/../WebCore/platform/mac/ \
+ $$PWD/../../WebKitLibraries/
+
+ DEFINES += NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+
+ contains(CONFIG, "x86") {
+ DEFINES+=NS_BUILD_32_LIKE_64
+ }
+
+ HEADERS += \
+ $$PWD/qt/WebCoreSupport/WebSystemInterface.h \
+ $$PWD/qt/WebCoreSupport/QTKitFullScreenVideoHandler.h
+
+ OBJECTIVE_SOURCES += \
+ $$PWD/qt/WebCoreSupport/WebSystemInterface.mm \
+ $$PWD/qt/WebCoreSupport/QTKitFullScreenVideoHandler.mm
+ }
+}
+
+contains(DEFINES, ENABLE_ICONDATABASE=1) {
+ HEADERS += \
+ $$PWD/../WebCore/loader/icon/IconDatabaseClient.h \
+ $$PWD/qt/WebCoreSupport/IconDatabaseClientQt.h
+
+ SOURCES += \
+ $$PWD/qt/WebCoreSupport/IconDatabaseClientQt.cpp
+}
+
+contains(DEFINES, ENABLE_GEOLOCATION=1) {
+ HEADERS += \
+ $$PWD/qt/WebCoreSupport/GeolocationClientQt.h
+ SOURCES += \
+ $$PWD/qt/WebCoreSupport/GeolocationClientQt.cpp
+}
+
+
diff --git a/Source/WebKit/blackberry/Api/WebPage.cpp b/Source/WebKit/blackberry/Api/WebPage.cpp
index 411fcb3ab..a37826baf 100644
--- a/Source/WebKit/blackberry/Api/WebPage.cpp
+++ b/Source/WebKit/blackberry/Api/WebPage.cpp
@@ -4510,6 +4510,11 @@ void WebPage::setSpellCheckingEnabled(bool enabled)
static_cast<EditorClientBlackBerry*>(d->m_page->editorClient())->enableSpellChecking(enabled);
}
+void WebPage::spellCheckingRequestProcessed(int32_t id, spannable_string_t* spannableString)
+{
+ d->m_inputHandler->spellCheckingRequestProcessed(id, spannableString);
+}
+
class DeferredTaskSelectionCancelled: public DeferredTask<&WebPagePrivate::m_wouldCancelSelection> {
public:
explicit DeferredTaskSelectionCancelled(WebPagePrivate* webPagePrivate)
@@ -5572,8 +5577,10 @@ void WebPage::notifyAppActivationStateChange(ActivationStateType activationState
void WebPage::notifySwipeEvent()
{
- FOR_EACH_PLUGINVIEW(d->m_pluginViews)
- (*it)->handleSwipeEvent();
+ if (d->m_fullScreenPluginView.get())
+ d->m_fullScreenPluginView->handleSwipeEvent();
+ else
+ notifyFullScreenVideoExited(true);
}
void WebPage::notifyScreenPowerStateChanged(bool powered)
@@ -6310,6 +6317,7 @@ void WebPagePrivate::didChangeSettings(WebSettings* webSettings)
coreSettings->setOfflineWebApplicationCacheEnabled(webSettings->isAppCacheEnabled());
m_page->group().groupSettings()->setLocalStorageQuotaBytes(webSettings->localStorageQuota());
+ coreSettings->setSessionStorageQuota(webSettings->sessionStorageQuota());
coreSettings->setUsesPageCache(webSettings->maximumPagesInCache());
coreSettings->setFrameFlatteningEnabled(webSettings->isFrameFlatteningEnabled());
#endif
diff --git a/Source/WebKit/blackberry/Api/WebPage.h b/Source/WebKit/blackberry/Api/WebPage.h
index eb38583c4..54fdc9a5c 100644
--- a/Source/WebKit/blackberry/Api/WebPage.h
+++ b/Source/WebKit/blackberry/Api/WebPage.h
@@ -250,6 +250,7 @@ public:
int32_t commitText(spannable_string_t*, int32_t relativeCursorPosition);
void setSpellCheckingEnabled(bool);
+ void spellCheckingRequestProcessed(int32_t id, spannable_string_t*);
void setSelection(const Platform::IntPoint& startPoint, const Platform::IntPoint& endPoint);
void setCaretPosition(const Platform::IntPoint&);
diff --git a/Source/WebKit/blackberry/Api/WebPageClient.h b/Source/WebKit/blackberry/Api/WebPageClient.h
index 132e6d0b5..0a581421b 100644
--- a/Source/WebKit/blackberry/Api/WebPageClient.h
+++ b/Source/WebKit/blackberry/Api/WebPageClient.h
@@ -144,6 +144,8 @@ public:
virtual void checkSpellingOfString(const unsigned short* text, int length, int& misspellingLocation, int& misspellingLength) = 0;
virtual void requestSpellingSuggestionsForString(unsigned start, unsigned end) = 0;
+ virtual int32_t checkSpellingOfStringAsync(wchar_t* text, int length) = 0;
+
virtual void notifySelectionDetailsChanged(const Platform::IntRect& start, const Platform::IntRect& end, const Platform::IntRectRegion&, bool overrideTouchHandling = false) = 0;
virtual void cancelSelectionVisuals() = 0;
virtual void notifySelectionHandlesReversed() = 0;
@@ -160,6 +162,7 @@ public:
virtual void resetBackForwardList(unsigned listSize, unsigned currentIndex) = 0;
+ virtual void openPopupList(bool multiple, int size, const ScopeArray<WebString>& labels, const bool* enableds, const int* itemType, const bool* selecteds) = 0;
virtual void openDateTimePopup(int type, const WebString& value, const WebString& min, const WebString& max, double step) = 0;
virtual void openColorPopup(const WebString& value) = 0;
@@ -251,7 +254,7 @@ public:
virtual void clearCache() = 0;
virtual bool hasKeyboardFocus() = 0;
- virtual void createPopupWebView(const Platform::IntRect& webViewRect) = 0;
+ virtual bool createPopupWebView(const Platform::IntRect&) = 0;
virtual void closePopupWebView() = 0;
};
} // namespace WebKit
diff --git a/Source/WebKit/blackberry/Api/WebSettings.cpp b/Source/WebKit/blackberry/Api/WebSettings.cpp
index 702dcc773..5996c6ab1 100644
--- a/Source/WebKit/blackberry/Api/WebSettings.cpp
+++ b/Source/WebKit/blackberry/Api/WebSettings.cpp
@@ -76,6 +76,7 @@ DEFINE_STATIC_LOCAL(String, WebKitLoadsImagesAutomatically, ("WebKitLoadsImagesA
DEFINE_STATIC_LOCAL(String, WebKitLocalStorageEnabled, ("WebKitLocalStorageEnabled"));
DEFINE_STATIC_LOCAL(String, WebKitLocalStoragePath, ("WebKitLocalStoragePath"));
DEFINE_STATIC_LOCAL(String, WebKitLocalStorageQuota, ("WebKitLocalStorageQuota"));
+DEFINE_STATIC_LOCAL(String, WebKitSessionStorageQuota, ("WebKitSessionStorageQuota"));
DEFINE_STATIC_LOCAL(String, WebKitMaximumPagesInCache, ("WebKitMaximumPagesInCache"));
DEFINE_STATIC_LOCAL(String, WebKitMinimumFontSize, ("WebKitMinimumFontSize"));
DEFINE_STATIC_LOCAL(String, WebKitOfflineWebApplicationCacheEnabled, ("WebKitOfflineWebApplicationCacheEnabled"));
@@ -180,6 +181,7 @@ WebSettings* WebSettings::standardSettings()
settings->m_private->setBoolean(WebKitJavaScriptEnabled, true);
settings->m_private->setBoolean(WebKitLoadsImagesAutomatically, true);
settings->m_private->setUnsignedLongLong(WebKitLocalStorageQuota, 5 * 1024 * 1024);
+ settings->m_private->setUnsignedLongLong(WebKitSessionStorageQuota, 5 * 1024 * 1024);
settings->m_private->setInteger(WebKitMaximumPagesInCache, 0);
settings->m_private->setInteger(WebKitMinimumFontSize, 8);
settings->m_private->setBoolean(WebKitWebSocketsEnabled, true);
@@ -599,6 +601,16 @@ void WebSettings::setLocalStorageQuota(unsigned long long quota)
m_private->setUnsignedLongLong(WebKitLocalStorageQuota, quota);
}
+unsigned long long WebSettings::sessionStorageQuota() const
+{
+ return m_private->getUnsignedLongLong(WebKitSessionStorageQuota);
+}
+
+void WebSettings::setSessionStorageQuota(unsigned long long quota)
+{
+ m_private->setUnsignedLongLong(WebKitSessionStorageQuota, quota);
+}
+
int WebSettings::maximumPagesInCache() const
{
// FIXME: We shouldn't be calling into WebCore from here. This class should just be a state store.
diff --git a/Source/WebKit/blackberry/Api/WebSettings.h b/Source/WebKit/blackberry/Api/WebSettings.h
index 53f2eee4c..794b8c607 100644
--- a/Source/WebKit/blackberry/Api/WebSettings.h
+++ b/Source/WebKit/blackberry/Api/WebSettings.h
@@ -168,6 +168,8 @@ public:
unsigned long long localStorageQuota() const;
void setLocalStorageQuota(unsigned long long);
+ unsigned long long sessionStorageQuota() const;
+ void setSessionStorageQuota(unsigned long long);
// Page cache
void setMaximumPagesInCache(int);
diff --git a/Source/WebKit/blackberry/ChangeLog b/Source/WebKit/blackberry/ChangeLog
index 67aa6558f..164a6f887 100644
--- a/Source/WebKit/blackberry/ChangeLog
+++ b/Source/WebKit/blackberry/ChangeLog
@@ -1,3 +1,133 @@
+2012-06-26 Mike Fenton <mifenton@rim.com>
+
+ [BlackBerry] Add WebPage interface for Async spell check.
+ https://bugs.webkit.org/show_bug.cgi?id=89999
+
+ Reviewed by Rob Buis.
+
+ PR 124517.
+
+ Add interface for IMS async spell checking.
+
+ Reviewed Internally by Nima Ghanavatian.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPage::spellCheckingRequestProcessed):
+ (WebKit):
+ * Api/WebPage.h:
+ * Api/WebPageClient.h:
+ * WebKitSupport/InputHandler.cpp:
+ (WebKit):
+ (BlackBerry::WebKit::InputHandler::spellCheckingRequestProcessed):
+ * WebKitSupport/InputHandler.h:
+ (InputHandler):
+
+2012-06-26 Jonathan Dong <jonathan.dong@torchmobile.com.cn>
+
+ [BlackBerry] Limit session storage quota to 5MB by default
+ https://bugs.webkit.org/show_bug.cgi?id=89941
+
+ Reviewed by Rob Buis.
+
+ Limit session storage quota to 5MB by default for BlackBerry
+ porting.
+ Internally reviewed by George Staikos.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::didChangeSettings):
+ * Api/WebSettings.cpp:
+ (WebKit):
+ (BlackBerry::WebKit::WebSettings::standardSettings):
+ (BlackBerry::WebKit::WebSettings::sessionStorageQuota):
+ (BlackBerry::WebKit::WebSettings::setSessionStorageQuota):
+ * Api/WebSettings.h:
+
+2012-06-26 Charles Wei <charles.wei@torchmobile.com.cn>
+
+ [BlackBerry] Use gesture SwipeDown to exit fullscreen for both video and plugin.
+ https://bugs.webkit.org/show_bug.cgi?id=89960
+
+ Reviewed by Antonio Gomes.
+
+ We used to use gesture swipedown to exit fullscreen for plugin, but not fullscreen
+ HTML5 video; When a swipe down happens, it applies this event to all the pluginviews
+ in a page, even though only the one in fullscreen mode will process this.
+
+ With this patch, the SwipeDown gesture will only apply to the fullscreen elemement,
+ which is either a plugin, or an Video element.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPage::notifySwipeEvent):
+
+2012-06-25 Leo Yang <leo.yang@torchmobile.com.cn>
+
+ [BlackBerry] Fill more data in device motion event
+ https://bugs.webkit.org/show_bug.cgi?id=89857
+
+ Reviewed by Antonio Gomes.
+
+ Reviewed internally by Robin Cao.
+
+ Fill acceleration and rotation rate into DeviceMotionData.
+
+ * WebCoreSupport/DeviceMotionClientBlackBerry.cpp:
+ (DeviceMotionClientBlackBerry::onMotion):
+
+2012-06-25 Yong Li <yoli@rim.com>
+
+ [BlackBerry] Add JSC statistics into about:memory
+ https://bugs.webkit.org/show_bug.cgi?id=89779
+
+ Reviewed by Rob Buis.
+
+ Add detailed JS memory statistics to about:memory page.
+
+ * WebCoreSupport/AboutData.cpp:
+ (WebCore::dumpJSCTypeCountSetToTableHTML):
+ (WebCore):
+ (WebCore::memoryPage):
+
+2012-06-25 Crystal Zhang <haizhang@rim.com>
+
+ [BlackBerry] Use AIR controls if client doesn't support HTML control
+ https://bugs.webkit.org/show_bug.cgi?id=89777
+
+ Reviewed by Yong Li.
+
+ Currently HTML controls depend on client implementing CreateWindow event, for those clients
+ that don't implement CreateWindow event, use old AIR controls so we don't break them.
+
+ PR 163818.
+
+ Internal reviewed by Mike Fenton.
+
+ * Api/WebPageClient.h:
+ * WebCoreSupport/ChromeClientBlackBerry.cpp:
+ (WebCore::ChromeClientBlackBerry::openPagePopup):
+ * WebCoreSupport/PagePopupBlackBerry.cpp:
+ (WebCore::PagePopupBlackBerry::sendCreatePopupWebViewRequest):
+ * WebCoreSupport/PagePopupBlackBerry.h:
+ (PagePopupBlackBerry):
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::openSelectPopup):
+
+2012-06-25 Rob Buis <rbuis@rim.com>
+
+ [BlackBerry] Require text editable element to be enabled for VKB
+ https://bugs.webkit.org/show_bug.cgi?id=89876
+
+ Reviewed by Yong Li.
+
+ After bug 58837 got in, children of <fieldset> now can inherit the disabled
+ state of the fieldset. When trying for instance fast/forms/fieldset/fieldset-disabled.html,
+ it can be seen that when they are visually disabled, the input handling can still be triggered. So
+ add an extra check to isTextBasedContentEditableElement that the element is enabled.
+
+ Reviewed internally by Mike Fenton.
+
+ * WebKitSupport/DOMSupport.cpp:
+ (BlackBerry::WebKit::DOMSupport::isTextBasedContentEditableElement):
+
2012-06-24 Simon Fraser <simon.fraser@apple.com>
Rename isPositioned to isOutOfFlowPositioned for clarity
diff --git a/Source/WebKit/blackberry/WebCoreSupport/AboutData.cpp b/Source/WebKit/blackberry/WebCoreSupport/AboutData.cpp
index dc950b348..bc44ccb5a 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/AboutData.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/AboutData.cpp
@@ -20,12 +20,16 @@
#include "AboutData.h"
#include "CString.h"
+#include "JSDOMWindow.h"
#include "MemoryCache.h"
+#include "MemoryStatistics.h"
#include "SurfacePool.h"
#include "WebKitVersion.h"
#include <process.h>
#include <BlackBerryPlatformSettings.h>
+#include <heap/Heap.h>
+#include <runtime/JSGlobalData.h>
#include <sys/stat.h>
#include <sys/utsname.h>
@@ -188,19 +192,28 @@ static String cacheTypeStatisticToHTMLTr(const String& description, const Memory
+ "</tr>";
}
+static void dumpJSCTypeCountSetToTableHTML(String& tableHTML, JSC::TypeCountSet* typeCountSet)
+{
+ if (!typeCountSet)
+ return;
+
+ for (JSC::TypeCountSet::const_iterator iter = typeCountSet->begin(); iter != typeCountSet->end(); ++iter)
+ tableHTML += numberToHTMLTr(iter->first, iter->second);
+}
+
String memoryPage()
{
String page;
// generate memory information
- page = String("<html><head><title>BlackBerry Browser Memory Information</title></head><body><h2>BlackBerry Browser Memory Information</h2>");
+ page = "<html><head><title>BlackBerry Browser Memory Information</title></head><body><h2>BlackBerry Browser Memory Information</h2>";
// generate cache information
MemoryCache* cacheInc = memoryCache();
MemoryCache::Statistics cacheStat = cacheInc->getStatistics();
- page += String("<h2>Cache Information</h2>")
- + "<table align=\"center\" rules=\"all\"><tr> <th>Item</th> <th>Count</th> <th>Size<br>KB</th> <th>Living<br>KB</th> <th>Decoded<br>KB</th></tr>";
+ page += "<h2>Cache Information</h2>"
+ "<table align=\"center\" rules=\"all\"><tr> <th>Item</th> <th>Count</th> <th>Size<br>KB</th> <th>Living<br>KB</th> <th>Decoded<br>KB</th></tr>";
MemoryCache::TypeStatistic total;
total.count = cacheStat.images.count + cacheStat.cssStyleSheets.count
@@ -224,9 +237,38 @@ String memoryPage()
page += "</table>";
#if !defined(PUBLIC_BUILD) || !PUBLIC_BUILD
+
+ // JS engine memory usage.
+ JSC::GlobalMemoryStatistics jscMemoryStat = JSC::globalMemoryStatistics();
+ JSC::Heap& mainHeap = JSDOMWindow::commonJSGlobalData()->heap;
+ OwnPtr<JSC::TypeCountSet> objectTypeCounts = mainHeap.objectTypeCounts();
+ OwnPtr<JSC::TypeCountSet> protectedObjectTypeCounts = mainHeap.protectedObjectTypeCounts();
+
+ page += "<h2>JS engine memory usage</h2><table align=\"center\" rules=\"all\">";
+
+ page += numberToHTMLTr("Stack size", jscMemoryStat.stackBytes);
+ page += numberToHTMLTr("JIT memory usage", jscMemoryStat.JITBytes);
+ page += numberToHTMLTr("Main heap capacity", mainHeap.capacity());
+ page += numberToHTMLTr("Main heap size", mainHeap.size());
+ page += numberToHTMLTr("Object count", mainHeap.objectCount());
+ page += numberToHTMLTr("Global object count", mainHeap.globalObjectCount());
+ page += numberToHTMLTr("Protected object count", mainHeap.protectedObjectCount());
+ page += numberToHTMLTr("Protected global object count", mainHeap.protectedGlobalObjectCount());
+
+ page += "</table>";
+
+ page += "<h3>Object type counts</h3><table align=\"center\" rules=\"all\">";
+ dumpJSCTypeCountSetToTableHTML(page, objectTypeCounts.get());
+ page += "</table>";
+
+ page += "<h3>Protected object type counts</h3><table align=\"center\" rules=\"all\">";
+ dumpJSCTypeCountSetToTableHTML(page, protectedObjectTypeCounts.get());
+ page += "</table>";
+
+ // Malloc info.
struct mallinfo mallocInfo = mallinfo();
- page += String("<h2>Malloc Information</h2>") + "<table align=\"center\" rules=\"all\">";
+ page += "<h2>Malloc Information</h2><table align=\"center\" rules=\"all\">";
page += numberToHTMLTr("Total space in use", mallocInfo.usmblks + mallocInfo.uordblks);
page += numberToHTMLTr("Total space in free blocks", mallocInfo.fsmblks + mallocInfo.fordblks);
diff --git a/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp
index 5862a206e..4d2024b0e 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp
@@ -307,8 +307,11 @@ PagePopup* ChromeClientBlackBerry::openPagePopup(PagePopupClient* client, const
PagePopupBlackBerry* webPopup = new PagePopupBlackBerry(m_webPagePrivate, client, rootViewToScreen(originBoundsInRootView));
m_webPagePrivate->m_webPage->popupOpened(webPopup);
- webPopup->sendCreatePopupWebViewRequest();
- return webPopup;
+ if (webPopup->sendCreatePopupWebViewRequest())
+ return webPopup;
+
+ closePagePopup(0);
+ return 0;
}
void ChromeClientBlackBerry::closePagePopup(PagePopup*)
diff --git a/Source/WebKit/blackberry/WebCoreSupport/DeviceMotionClientBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/DeviceMotionClientBlackBerry.cpp
index 8b0078f35..b826ba84c 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/DeviceMotionClientBlackBerry.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/DeviceMotionClientBlackBerry.cpp
@@ -71,11 +71,19 @@ DeviceMotionData* DeviceMotionClientBlackBerry::lastMotion() const
void DeviceMotionClientBlackBerry::onMotion(const BlackBerry::Platform::DeviceMotionEvent* event)
{
- RefPtr<DeviceMotionData::Acceleration> accel = DeviceMotionData::Acceleration::create(
- true, event->x, true, event->y, true, event->z);
+ // All boolean parameters in the following create() calls indicate that if the following parameter is validly provided.
+
+ RefPtr<DeviceMotionData::Acceleration> acceleration = DeviceMotionData::Acceleration::create(
+ true, event->acceleration.x, true, event->acceleration.y, true, event->acceleration.z);
+
+ RefPtr<DeviceMotionData::Acceleration> accelerationIncludingGravity = DeviceMotionData::Acceleration::create(
+ true, event->accelerationIncludingGravity.x, true, event->accelerationIncludingGravity.y, true, event->accelerationIncludingGravity.z);
+
+ RefPtr<DeviceMotionData::RotationRate> rotationRate = DeviceMotionData::RotationRate::create(
+ true, event->rotationRate.alpha, true, event->rotationRate.beta, true, event->rotationRate.gamma);
double now = WTF::currentTimeMS();
- m_currentMotion = DeviceMotionData::create(0, accel, 0, m_lastEventTime, m_lastEventTime - now);
+ m_currentMotion = DeviceMotionData::create(acceleration, accelerationIncludingGravity, rotationRate, m_lastEventTime, m_lastEventTime - now);
m_lastEventTime = now;
if (!m_controller)
diff --git a/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp
index 01f7bc8f3..a751fb7a2 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp
@@ -56,9 +56,9 @@ PagePopupBlackBerry::~PagePopupBlackBerry()
{
}
-void PagePopupBlackBerry::sendCreatePopupWebViewRequest()
+bool PagePopupBlackBerry::sendCreatePopupWebViewRequest()
{
- m_webPagePrivate->client()->createPopupWebView(m_rect);
+ return m_webPagePrivate->client()->createPopupWebView(m_rect);
}
bool PagePopupBlackBerry::init(WebPage* webpage)
diff --git a/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.h b/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.h
index 4774f1e94..c82e8c6b6 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.h
+++ b/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.h
@@ -41,7 +41,7 @@ public:
PagePopupBlackBerry(BlackBerry::WebKit::WebPagePrivate*, PagePopupClient*, const IntRect&);
~PagePopupBlackBerry();
- void sendCreatePopupWebViewRequest();
+ bool sendCreatePopupWebViewRequest();
bool init(BlackBerry::WebKit::WebPage*);
void closePopup();
void installDomFunction(Frame*);
diff --git a/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp b/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp
index 3b972d6c9..2b54c337c 100644
--- a/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp
@@ -231,7 +231,7 @@ bool isTextBasedContentEditableElement(Element* element)
if (!element)
return false;
- if (element->isReadOnlyFormControl())
+ if (element->isReadOnlyFormControl() || !element->isEnabledFormControl())
return false;
if (isPopupInputField(element))
diff --git a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
index ea6741d65..b3f5413bc 100644
--- a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
@@ -404,6 +404,14 @@ void InputHandler::learnText()
sendLearnTextDetails(textInField);
}
+
+void InputHandler::spellCheckingRequestProcessed(int32_t id, spannable_string_t* spannableString)
+{
+ UNUSED_PARAM(id);
+ UNUSED_PARAM(spannableString);
+ // TODO implement.
+}
+
void InputHandler::setElementUnfocused(bool refocusOccuring)
{
if (isActiveTextEdit()) {
@@ -1174,8 +1182,10 @@ bool InputHandler::openSelectPopup(HTMLSelectElement* select)
}
SelectPopupClient* selectClient = new SelectPopupClient(multiple, size, labels, enableds, itemTypes, selecteds, m_webPage, select);
- WebCore::IntRect elementRectInRootView = select->document()->view()->contentsToRootView(select->getRect());
- m_webPage->m_page->chrome()->client()->openPagePopup(selectClient, elementRectInRootView);
+ WebCore::IntRect elementRectInRootView = select->document()->view()->contentsToRootView(enclosingIntRect(select->getRect()));
+ // Fail to create HTML popup, use the old path
+ if (!m_webPage->m_page->chrome()->client()->openPagePopup(selectClient, elementRectInRootView))
+ m_webPage->m_client->openPopupList(multiple, size, labels, enableds, itemTypes, selecteds);
return true;
}
diff --git a/Source/WebKit/blackberry/WebKitSupport/InputHandler.h b/Source/WebKit/blackberry/WebKitSupport/InputHandler.h
index e34126ba2..ec916f824 100644
--- a/Source/WebKit/blackberry/WebKitSupport/InputHandler.h
+++ b/Source/WebKit/blackberry/WebKitSupport/InputHandler.h
@@ -121,6 +121,8 @@ public:
int32_t setComposingText(spannable_string_t*, int32_t relativeCursorPosition);
int32_t commitText(spannable_string_t*, int32_t relativeCursorPosition);
+ void spellCheckingRequestProcessed(int32_t id, spannable_string_t*);
+
private:
enum PendingKeyboardStateChange { NoChange, Visible, NotVisible };
diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog
index 3cbb2e803..365d0eb3c 100644
--- a/Source/WebKit/chromium/ChangeLog
+++ b/Source/WebKit/chromium/ChangeLog
@@ -1,3 +1,513 @@
+2012-06-26 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
+2012-06-26 James Robinson <jamesr@chromium.org>
+
+ [chromium] Remove WebView::graphicsContext3D getter
+ https://bugs.webkit.org/show_bug.cgi?id=89916
+
+ Reviewed by Adrienne Walker.
+
+ Removes WebView::graphicsContext3D getter. This getter was used to access the compositor's context, which is an
+ inherently dangerous operation since the compositor context may not be safe to use on the main thread and has
+ somewhat complicated creation / recreation semantics. A shared context is exposed
+ (WebView::sharedGraphicsContext3D) for callers who may want access to a context in a share group with the
+ compositor.
+
+ * public/WebView.h:
+ (WebView):
+ * src/WebLayerTreeView.cpp:
+ * src/WebViewImpl.cpp:
+ * src/WebViewImpl.h:
+ (WebViewImpl):
+
+2012-06-26 Peter Beverloo <peter@chromium.org>
+
+ [Chromium] Decrease the number of conditional blocks in features.gypi
+ https://bugs.webkit.org/show_bug.cgi?id=90013
+
+ Reviewed by Adam Barth.
+
+ Consolidate two Android-specific and accelerated-compositing-specific
+ conditional blocks into other blocks which serve an identical purpose.
+
+ * features.gypi:
+
+2012-06-26 Dave Tu <dtu@chromium.org>
+
+ [chromium] Expose rendering statistics to WebWidget.
+ https://bugs.webkit.org/show_bug.cgi?id=88268
+
+ Reviewed by James Robinson.
+
+ The WebKit side of a basic framework for exposing rendering statistics
+ to Chromium's --enable-benchmarking extension.
+
+ * src/WebLayerTreeView.cpp:
+ (WebKit::WebLayerTreeView::renderingStatistics):
+ (WebKit):
+
+2012-06-25 James Robinson <jamesr@chromium.org>
+
+ [chromium] Add WebLayer API for scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=89913
+
+ Reviewed by Adrienne Walker.
+
+ Use WebScrollableLayer type in NonCompositedContentHost.
+
+ * WebKit.gyp:
+ * src/NonCompositedContentHost.cpp:
+ (WebKit::NonCompositedContentHost::setScrollLayer):
+ (WebKit::reserveScrollbarLayers):
+ (WebKit::NonCompositedContentHost::setViewport):
+ (WebKit::NonCompositedContentHost::haveScrollLayer):
+ (WebKit):
+ (WebKit::NonCompositedContentHost::scrollLayer):
+ * src/NonCompositedContentHost.h:
+ (WebCore):
+ * src/WebContentLayer.cpp:
+ (WebKit::WebContentLayer::WebContentLayer):
+ * src/WebLayer.cpp:
+ (WebKit::WebLayer::numberOfChildren):
+ (WebKit):
+ (WebKit::WebLayer::childAt):
+ (WebKit::WebLayer::setAlwaysReserveTextures):
+ * src/WebScrollableLayer.cpp:
+ (WebKit):
+ (WebKit::WebScrollableLayer::setScrollPosition):
+ (WebKit::WebScrollableLayer::setScrollable):
+ (WebKit::WebScrollableLayer::setHaveWheelEventHandlers):
+ (WebKit::WebScrollableLayer::setShouldScrollOnMainThread):
+
+2012-06-26 Ian Vollick <vollick@chromium.org>
+
+ [chromium] The single thread proxy should not automatically tick new animations.
+ https://bugs.webkit.org/show_bug.cgi?id=89996
+
+ Reviewed by James Robinson.
+
+ * WebKit.gypi:
+ * tests/CCSingleThreadProxyTest.cpp: Removed.
+
+2012-06-26 Ian Vollick <vollick@chromium.org>
+
+ [chromium] Layer chromium should need a redraw after getting its first non-empty bounds.
+ https://bugs.webkit.org/show_bug.cgi?id=89784
+
+ Reviewed by James Robinson.
+
+ Previously, we'd only set needs redraw if the old bounds were zero,
+ and the new bounds were non-zero, but we should actually have
+ checked that the old bounds were non-empty.
+
+ * tests/LayerChromiumTest.cpp:
+
+2012-06-26 James Robinson <jamesr@chromium.org>
+
+ [chromium] Remove dead compositor-related API from GraphicsContext3DPrivate / Extensions3DChromium
+ https://bugs.webkit.org/show_bug.cgi?id=89933
+
+ Reviewed by Kenneth Russell.
+
+ * tests/Canvas2DLayerBridgeTest.cpp:
+ (Canvas2DLayerBridgeTest::fullLifecycleTest):
+
+2012-06-26 Shawn Singh <shawnsingh@chromium.org>
+
+ [chromium] Fix incorrect #ifdef WEBKIT_IMPLEMENTATION statements
+ https://bugs.webkit.org/show_bug.cgi?id=89931
+
+ Reviewed by James Robinson.
+
+ WEBKIT_IMPLEMENTATION is defined as either 0 or 1, so the usage of
+ #ifdef or #if have different behavior. There are some places in
+ the code that use "#ifdef WEBKIT_IMLPEMENTATION", but they should
+ actually be "#if WEBKIT_IMPLEMENTATION". This patch fixes those
+ #ifdef statements.
+
+ * public/WebTextRun.h:
+ (WebTextRun):
+ * public/linux/WebFontRenderStyle.h:
+
+2012-06-26 Jun Mukai <mukai@chromium.org>
+
+ Allow using <input type="color"> UI in ChromeOS.
+ https://bugs.webkit.org/show_bug.cgi?id=89944
+
+ Reviewed by Kent Tamura.
+
+ http://crrev.com/144111 adds the UI of <input type="color"> for
+ ChromeOS, so now we can set its flag too.
+
+ * features.gypi:
+
+2012-06-25 Ryosuke Niwa <rniwa@webkit.org>
+
+ Get rid of firstItem and nextItem from HTMLCollection
+ https://bugs.webkit.org/show_bug.cgi?id=89923
+
+ Reviewed by Andreas Kling.
+
+ Re-implement WebNodeCollection::firstItem() and WebNodeCollection::nextItem() in WebKit code
+ because we got rid of it from WebCore implementation.
+
+ This is an extremely poor API and we shouldn't be exposing it in the future.
+
+ * public/WebNodeCollection.h:
+ (WebKit::WebNodeCollection::WebNodeCollection):
+ (WebNodeCollection):
+ * src/WebNodeCollection.cpp:
+ (WebKit::WebNodeCollection::nextItem):
+ (WebKit::WebNodeCollection::firstItem):
+ * src/WebPageSerializerImpl.cpp:
+ (WebKit::WebPageSerializerImpl::collectTargetFrames):
+
+2012-06-25 Luke Macpherson <macpherson@chromium.org>
+
+ Add runtime flag to enable/disable CSS variables (in addition to existing compile-time flag).
+ https://bugs.webkit.org/show_bug.cgi?id=89542
+
+ Reviewed by Dimitri Glazkov.
+
+ * features.gypi:
+ * public/WebSettings.h:
+ * src/WebSettingsImpl.cpp:
+ (WebKit::WebSettingsImpl::setExperimentalCSSVariablesEnabled):
+ (WebKit):
+ * src/WebSettingsImpl.h:
+ (WebSettingsImpl):
+
+2012-06-25 Adrienne Walker <enne@google.com>
+
+ [chromium] Add WebPluginScrollbar and WebPluginScrollbarClient stub implementations
+ https://bugs.webkit.org/show_bug.cgi?id=89928
+
+ Reviewed by Darin Fisher.
+
+ These classes are just typedef'd to be the non-Plugin version. The
+ next step is to change Chromium to use the Plugin version, then move
+ most of WebPluginScrollbar to a WebScrollbar in Platform to separate
+ out the base functionality, while providing the same top level API.
+
+ * WebKit.gyp:
+ * public/WebPluginScrollbar.h: Added.
+ (WebKit):
+ * public/WebPluginScrollbarClient.h: Added.
+ (WebKit):
+
+2012-06-25 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
+2012-06-25 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r121206.
+ http://trac.webkit.org/changeset/121206
+ https://bugs.webkit.org/show_bug.cgi?id=89935
+
+ [chromium] webkit_unit_tests
+ WebViewTest.MHTMLWithMissingResourceFinishesLoading crash
+ (Requested by ukai on #webkit).
+
+ * tests/EventListenerTest.cpp:
+ * tests/FrameTestHelpers.cpp:
+ (WebKit::FrameTestHelpers::registerMockedURLLoad):
+ (WebKit::FrameTestHelpers::createWebViewAndLoad):
+ * tests/FrameTestHelpers.h:
+ (FrameTestHelpers):
+ * tests/ListenerLeakTest.cpp:
+ (WebKit::ListenerLeakTest::RunTest):
+ * tests/WebFrameTest.cpp:
+ (WebKit::WebFrameTest::registerMockedHttpURLLoad):
+ (WebKit::WebFrameTest::registerMockedChromeURLLoad):
+ * tests/WebViewTest.cpp:
+ (WebKit::TEST_F):
+ (WebKit::WebViewTest::testAutoResize):
+ (WebKit::WebViewTest::testTextInputType):
+
+2012-06-25 Adam Barth <abarth@webkit.org>
+
+ [Chromium] Let the embedder override the max page scale factor set by the page
+ https://bugs.webkit.org/show_bug.cgi?id=89406
+
+ Reviewed by James Robinson.
+
+ Chrome on Android has an option to force the web site to allow page
+ scaling (for accessibility). This patch adds
+ WebView::setIgnoreViewportTagMaximumScale, which instructs the WebView
+ to ignore the maximum scale factor supplied by by the page in the
+ viewport meta tag.
+
+ This patch is a bit different from how this is implemented on the
+ chromium-android branch, but I'll clean up the branch once this patch
+ lands.
+
+ * public/WebView.h:
+ (WebView):
+ * src/ChromeClientImpl.cpp:
+ (WebKit::ChromeClientImpl::dispatchViewportPropertiesDidChange):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+ (WebKit::WebViewImpl::setIgnoreViewportTagMaximumScale):
+ (WebKit):
+ * src/WebViewImpl.h:
+ (WebViewImpl):
+ (WebKit::WebViewImpl::ignoreViewportTagMaximumScale):
+ * tests/WebFrameTest.cpp:
+ (WebKit::TEST_F):
+ (WebKit):
+
+2012-06-25 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r121176.
+ http://trac.webkit.org/changeset/121176
+ https://bugs.webkit.org/show_bug.cgi?id=89934
+
+ [chromium] browser_tests assert failed:
+ FATAL:native_theme_win.cc(1541)] Check failed: false. Invalid
+ part: 16 (Requested by ukai on #webkit).
+
+ * src/PlatformSupport.cpp:
+
+2012-06-25 Jay Civelli <jcivelli@chromium.org>
+
+ Fix progress load reporting for MHTML documents.
+
+ MHTML documents containing references to resources they don't include
+ never finish loading.
+ https://bugs.webkit.org/show_bug.cgi?id=71859
+
+ Reviewed by Nate Chapin.
+
+ * tests/EventListenerTest.cpp:
+ * tests/FrameTestHelpers.cpp:
+ (FrameTestHelpers):
+ (WebKit::FrameTestHelpers::registerMockedURLLoad):
+ (WebKit::FrameTestHelpers::registerMockedURLLoadAsHTML):
+ (WebKit::FrameTestHelpers::createWebViewAndLoad):
+ * tests/FrameTestHelpers.h:
+ (FrameTestHelpers):
+ * tests/ListenerLeakTest.cpp:
+ (WebKit::ListenerLeakTest::RunTest):
+ * tests/WebFrameTest.cpp:
+ (WebKit::WebFrameTest::registerMockedHttpURLLoad):
+ (WebKit::WebFrameTest::registerMockedChromeURLLoad):
+ * tests/WebViewTest.cpp:
+ (WebKit::TEST_F):
+ (WebKit::WebViewTest::testAutoResize):
+ (WebKit::WebViewTest::testTextInputType):
+ (TestWebViewClient):
+ (WebKit::TestWebViewClient::TestWebViewClient):
+ (WebKit::TestWebViewClient::didStartLoading):
+ (WebKit::TestWebViewClient::didStopLoading):
+ (WebKit::TestWebViewClient::didChangeLoadProgress):
+ (WebKit::TestWebViewClient::loadingStarted):
+ (WebKit::TestWebViewClient::loadingStopped):
+ (WebKit::TestWebViewClient::loadProgress):
+ (WebKit):
+
+2012-06-25 James Robinson <jamesr@chromium.org>
+
+ [chromium] Use WebGraphicsContext3D in compositor implementation
+ https://bugs.webkit.org/show_bug.cgi?id=89700
+
+ Reviewed by Adrienne Walker.
+
+ Updates tests for refactor, mostly by removing unnecessary GraphicsContext3D wrapper around mock contexts.
+
+ * WebKit.gypi:
+ * src/WebLayerTreeView.cpp:
+ (WebKit::WebLayerTreeView::context):
+ * src/WebLayerTreeViewImpl.cpp:
+ * tests/CCLayerTreeHostImplTest.cpp:
+ * tests/CCLayerTreeHostTest.cpp:
+ (WTF::CCLayerTreeHostTestAtomicCommit::commitCompleteOnCCThread):
+ (WTF::CCLayerTreeHostTestAtomicCommit::drawLayersOnCCThread):
+ (WTF::CCLayerTreeHostTestAtomicCommitWithPartialUpdate::commitCompleteOnCCThread):
+ (WTF::CCLayerTreeHostTestAtomicCommitWithPartialUpdate::drawLayersOnCCThread):
+ * tests/CCSingleThreadProxyTest.cpp:
+ * tests/CCThreadedTest.cpp:
+ (WebKitTests::TestHooks::createContext):
+ * tests/CCThreadedTest.h:
+ (TestHooks):
+ * tests/Canvas2DLayerBridgeTest.cpp:
+ (Canvas2DLayerBridgeTest::fullLifecycleTest):
+ * tests/CompositorFakeGraphicsContext3D.h: Removed.
+ * tests/DrawingBufferChromiumTest.cpp: Removed.
+ * tests/FakeCCLayerTreeHostClient.h:
+ * tests/FakeGraphicsContext3DTest.cpp:
+ (TEST):
+ * tests/GraphicsLayerChromiumTest.cpp:
+ * tests/LayerRendererChromiumTest.cpp:
+ (FakeLayerRendererChromium::FakeLayerRendererChromium):
+ (LayerRendererChromiumTest::LayerRendererChromiumTest):
+ (LayerRendererChromiumTest):
+ (TEST_F):
+ (TEST):
+ * tests/TextureCopierTest.cpp:
+ * tests/ThrottledTextureUploaderTest.cpp:
+ (WebKit::TEST):
+ * tests/TiledLayerChromiumTest.cpp:
+
+2012-06-25 Kausalya Madhusudhanan <kmadhusu@chromium.org>
+
+ [Chromium] Add a chromium-webkit API to create a serializable file system.
+ https://bugs.webkit.org/show_bug.cgi?id=89776
+
+ In order to send a DOMFileSystem as part of WebIntent payload data it
+ should be serializable. Therefore, I added an API that allows us to
+ create serializable file system in chromium code.
+
+ Reviewed by Adam Barth.
+
+ * public/WebFrame.h:
+ (WebFrame):
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::createSerializableFileSystem):
+ (WebKit):
+ * src/WebFrameImpl.h:
+ (WebFrameImpl):
+
+2012-06-25 Alpha Lam <hclam@chromium.org>
+
+ Unreviewed, rolling out r121178.
+ http://trac.webkit.org/changeset/121178
+ https://bugs.webkit.org/show_bug.cgi?id=89784
+
+ New unit test added is failing on WebKit Linux (dbg)
+
+ * tests/LayerChromiumTest.cpp:
+
+2012-06-25 Alpha Lam <hclam@chromium.org>
+
+ Unreviewed, rolling out r121129.
+ http://trac.webkit.org/changeset/121129
+ https://bugs.webkit.org/show_bug.cgi?id=89542
+
+ Chromium ASan failure: crbug.com/134402
+
+ * features.gypi:
+ * public/WebSettings.h:
+ * src/WebSettingsImpl.cpp:
+ * src/WebSettingsImpl.h:
+ (WebSettingsImpl):
+
+2012-06-25 Alpha Lam <hclam@chromium.org>
+
+ Roll Chromium DEPS to r144020
+ https://bugs.webkit.org/show_bug.cgi?id=89912
+
+ Build fixed now! Unreviewed.
+
+ Rolled DEPS to fix chromium build.
+ Patch by Scott Graham <scottmg@chromium.org>.
+
+ * DEPS:
+
+2012-06-25 Alec Flett <alecflett@chromium.org>
+
+ IndexedDB: Stub out new onSuccess() handler for chromium
+ https://bugs.webkit.org/show_bug.cgi?id=89895
+
+ This is the chromium side of a refactor which will
+ introduce an onSuccess() method which includes the raw
+ SerializedScriptValue to the frontend, so the primaryKey
+ injection can happen in the front end, rather than
+ the V8 helper process.
+
+ Reviewed by Darin Fisher.
+
+ * public/WebIDBCallbacks.h:
+ (WebKit):
+ (WebKit::WebIDBCallbacks::onSuccess):
+ * src/IDBCallbacksProxy.cpp:
+ (WebKit::IDBCallbacksProxy::onSuccess):
+ * src/IDBCallbacksProxy.h:
+ (IDBCallbacksProxy):
+ * src/WebIDBCallbacksImpl.cpp:
+ (WebKit::WebIDBCallbacksImpl::onSuccess):
+ (WebKit):
+ * src/WebIDBCallbacksImpl.h:
+ (WebIDBCallbacksImpl):
+
+2012-06-25 Joshua Bell <jsbell@chromium.org>
+
+ IndexedDB: Remove unused backend property accessors
+ https://bugs.webkit.org/show_bug.cgi?id=89893
+
+ Reviewed by Darin Fisher.
+
+ Following the "metadata" API addition in trac.webkit.org/changeset/121059
+ per-property accessors can be removed from the Chromium WebKit API.
+
+ * src/WebIDBDatabaseImpl.cpp: Removed name, version, objectStoreNames.
+ * src/WebIDBDatabaseImpl.h:
+ (WebIDBDatabaseImpl):
+ * src/WebIDBIndexImpl.cpp: Removed name, keyPath, unique, multiEntry.
+ * src/WebIDBIndexImpl.h:
+ (WebIDBIndexImpl):
+ * src/WebIDBObjectStoreImpl.cpp: Removed name, keyPath, autoIncrement, indexNames.
+ * src/WebIDBObjectStoreImpl.h:
+ (WebIDBObjectStoreImpl):
+
+2012-06-25 Ian Vollick <vollick@chromium.org>
+
+ [chromium] Layer chromium should need a redraw after getting its first non-empty bounds.
+ https://bugs.webkit.org/show_bug.cgi?id=89784
+
+ Reviewed by James Robinson.
+
+ Previously, we'd only set needs redraw if the old bounds were zero,
+ and the new bounds were non-zero, but we should actually have
+ checked that the old bounds were non-empty.
+
+ * tests/LayerChromiumTest.cpp:
+
+2012-06-25 Scott Graham <scottmg@chromium.org>
+
+ Plumb Scrollbar button dimensions down to WebThemeEngine
+ https://bugs.webkit.org/show_bug.cgi?id=89264
+
+ Reviewed by James Robinson.
+
+ Rather than making the height of the scrollbar buttons the same as the
+ width of the scrollbar, delegate to the WebThemeEngine. This allows
+ matching the Aura theme rather than the standard Windows theme.
+
+ * src/PlatformSupport.cpp:
+ (WebCore::PlatformSupport::getThemePartSize):
+ (WebCore):
+
+2012-06-25 Zeev Lieber <zlieber@chromium.org>
+
+ [Chromium] RenderPass textures are evicted at the end of every frame
+ https://bugs.webkit.org/show_bug.cgi?id=89786
+
+ Reviewed by Adrienne Walker.
+
+ Added unit tests to verify large textures are staying in memory
+ and available for render pass optimization.
+
+ * tests/CCLayerTreeHostImplTest.cpp:
+
+2012-06-25 Kinuko Yasuda <kinuko@chromium.org>
+
+ Heap-use-after-free in WebKit::MainThreadFileSystemCallbacks
+ https://bugs.webkit.org/show_bug.cgi?id=87019
+
+ Reviewed by David Levin.
+
+ Should not access the CallbacksBridge's member field after it's freed.
+
+ * src/WorkerFileSystemCallbacksBridge.cpp:
+ (WebKit::WorkerFileSystemCallbacksBridge::cleanUpAfterCallback):
+
2012-06-24 Luke Macpherson <macpherson@chromium.org>
Add runtime flag to enable/disable CSS variables (in addition to existing compile-time flag).
diff --git a/Source/WebKit/chromium/DEPS b/Source/WebKit/chromium/DEPS
index 307c63cc0..94cb27e29 100644
--- a/Source/WebKit/chromium/DEPS
+++ b/Source/WebKit/chromium/DEPS
@@ -32,7 +32,7 @@
vars = {
'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
- 'chromium_rev': '143776'
+ 'chromium_rev': '144160'
}
deps = {
diff --git a/Source/WebKit/chromium/WebKit.gyp b/Source/WebKit/chromium/WebKit.gyp
index bcbb91386..d75f5b709 100644
--- a/Source/WebKit/chromium/WebKit.gyp
+++ b/Source/WebKit/chromium/WebKit.gyp
@@ -222,6 +222,8 @@
'public/WebPluginContainer.h',
'public/WebPluginDocument.h',
'public/WebPluginListBuilder.h',
+ 'public/WebPluginScrollbar.h',
+ 'public/WebPluginScrollbarClient.h',
'public/WebPrintParams.h',
'public/WebPrintScalingOption.h',
'public/WebPopupMenu.h',
@@ -621,6 +623,7 @@
'src/WebScopedMicrotaskSuppression.cpp',
'src/WebScopedUserGesture.cpp',
'src/WebScriptController.cpp',
+ 'src/WebScrollableLayer.cpp',
'src/WebScrollbarImpl.cpp',
'src/WebScrollbarImpl.h',
'src/WebSearchableFormData.cpp',
diff --git a/Source/WebKit/chromium/WebKit.gypi b/Source/WebKit/chromium/WebKit.gypi
index 549fdfa44..c410e6f4f 100644
--- a/Source/WebKit/chromium/WebKit.gypi
+++ b/Source/WebKit/chromium/WebKit.gypi
@@ -86,7 +86,6 @@
'tests/CCSchedulerStateMachineTest.cpp',
'tests/CCSchedulerTestCommon.h',
'tests/CCSchedulerTest.cpp',
- 'tests/CCSingleThreadProxyTest.cpp',
'tests/CCSolidColorLayerImplTest.cpp',
'tests/CCTestCommon.h',
'tests/CCTiledLayerImplTest.cpp',
@@ -97,11 +96,9 @@
'tests/CCThreadedTest.h',
'tests/CCTimerTest.cpp',
'tests/ClipboardChromiumTest.cpp',
- 'tests/CompositorFakeGraphicsContext3D.h',
'tests/CompositorFakeWebGraphicsContext3D.h',
'tests/DecimalTest.cpp',
'tests/DragImageTest.cpp',
- 'tests/DrawingBufferChromiumTest.cpp',
'tests/EventListenerTest.cpp',
'tests/FakeCCLayerTreeHostClient.h',
'tests/FakeGraphicsContext3DTest.cpp',
diff --git a/Source/WebKit/chromium/features.gypi b/Source/WebKit/chromium/features.gypi
index 2ae79ba92..caa41dae3 100644
--- a/Source/WebKit/chromium/features.gypi
+++ b/Source/WebKit/chromium/features.gypi
@@ -46,7 +46,7 @@
'ENABLE_CSS_IMAGE_RESOLUTION=0',
'ENABLE_CSS_REGIONS=1',
'ENABLE_CSS_SHADERS=1',
- 'ENABLE_CSS_VARIABLES=1',
+ 'ENABLE_CSS_VARIABLES=0',
'ENABLE_CUSTOM_SCHEME_HANDLER=0',
'ENABLE_DATALIST=1',
'ENABLE_DASHBOARD_SUPPORT=0',
@@ -137,6 +137,7 @@
'ENABLE_CALENDAR_PICKER=0',
'ENABLE_FONT_BOOSTING=1',
'ENABLE_INPUT_SPEECH=0',
+ 'ENABLE_INPUT_TYPE_COLOR=0',
'ENABLE_INPUT_TYPE_DATETIME=1',
'ENABLE_INPUT_TYPE_DATETIMELOCAL=1',
'ENABLE_INPUT_TYPE_MONTH=1',
@@ -157,11 +158,12 @@
'WTF_USE_NATIVE_FULLSCREEN_VIDEO=1',
],
'enable_touch_icon_loading': 1,
- }, {
+ }, { # OS!="android"
'feature_defines': [
'ENABLE_CALENDAR_PICKER=1',
'ENABLE_FONT_BOOSTING=0',
'ENABLE_INPUT_SPEECH=1',
+ 'ENABLE_INPUT_TYPE_COLOR=1',
'ENABLE_JAVASCRIPT_I18N_API=1',
'ENABLE_LEGACY_NOTIFICATIONS=1',
'ENABLE_MEDIA_CAPTURE=0',
@@ -174,24 +176,11 @@
'ENABLE_WEB_AUDIO=1',
],
}],
- ['OS=="android" or chromeos==1', {
- 'feature_defines': [
- 'ENABLE_INPUT_TYPE_COLOR=0',
- ],
- }, {
- 'feature_defines': [
- 'ENABLE_INPUT_TYPE_COLOR=1',
- ],
- }],
['use_accelerated_compositing==1', {
'feature_defines': [
- 'WTF_USE_ACCELERATED_COMPOSITING=1',
'ENABLE_3D_RENDERING=1',
- ],
- }],
- ['use_accelerated_compositing==1', {
- 'feature_defines': [
'ENABLE_ACCELERATED_2D_CANVAS=1',
+ 'WTF_USE_ACCELERATED_COMPOSITING=1',
],
}],
# Mac OS X uses Accelerate.framework FFT by default instead of FFmpeg.
diff --git a/Source/WebKit/chromium/public/WebFrame.h b/Source/WebKit/chromium/public/WebFrame.h
index 5cd7f5f1e..ab67c496d 100644
--- a/Source/WebKit/chromium/public/WebFrame.h
+++ b/Source/WebKit/chromium/public/WebFrame.h
@@ -297,6 +297,12 @@ public:
virtual v8::Handle<v8::Value> createFileSystem(WebFileSystem::Type,
const WebString& name,
const WebString& rootURL) = 0;
+ // Creates an instance of serializable file system object.
+ // FIXME: Remove this API after we have a better way of creating serialized
+ // file system object.
+ virtual v8::Handle<v8::Value> createSerializableFileSystem(WebFileSystem::Type,
+ const WebString& name,
+ const WebString& rootURL) = 0;
// Creates an instance of file or directory entry object.
virtual v8::Handle<v8::Value> createFileEntry(WebFileSystem::Type,
const WebString& fileSystemName,
diff --git a/Source/WebKit/chromium/public/WebIDBCallbacks.h b/Source/WebKit/chromium/public/WebIDBCallbacks.h
index 31d665b4b..a63c0bc9e 100644
--- a/Source/WebKit/chromium/public/WebIDBCallbacks.h
+++ b/Source/WebKit/chromium/public/WebIDBCallbacks.h
@@ -36,6 +36,7 @@ class WebIDBCursor;
class WebIDBDatabase;
class WebIDBDatabaseError;
class WebIDBKey;
+class WebIDBKeyPath;
class WebIDBIndex;
class WebIDBObjectStore;
class WebIDBTransaction;
@@ -54,6 +55,7 @@ public:
virtual void onSuccess(const WebIDBKey&) { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void onSuccess(WebIDBTransaction*) { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void onSuccess(const WebSerializedScriptValue&) { WEBKIT_ASSERT_NOT_REACHED(); }
+ virtual void onSuccess(const WebSerializedScriptValue&, const WebIDBKey&, const WebIDBKeyPath&) { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void onSuccessWithContinuation() { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void onBlocked() { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void onSuccessWithPrefetch(const WebVector<WebIDBKey>& keys, const WebVector<WebIDBKey>& primaryKeys, const WebVector<WebSerializedScriptValue>& values) { WEBKIT_ASSERT_NOT_REACHED(); }
diff --git a/Source/WebKit/chromium/public/WebNodeCollection.h b/Source/WebKit/chromium/public/WebNodeCollection.h
index b168b6d5b..a896f5d5d 100644
--- a/Source/WebKit/chromium/public/WebNodeCollection.h
+++ b/Source/WebKit/chromium/public/WebNodeCollection.h
@@ -46,7 +46,7 @@ class WebNodeCollection {
public:
~WebNodeCollection() { reset(); }
- WebNodeCollection() : m_private(0) { }
+ WebNodeCollection() : m_private(0), m_current(0) { }
WebNodeCollection(const WebNodeCollection& n) : m_private(0) { assign(n); }
WebNodeCollection& operator=(const WebNodeCollection& n)
{
@@ -70,6 +70,7 @@ public:
private:
void assign(WebCore::HTMLCollection*);
WebCore::HTMLCollection* m_private;
+ mutable unsigned m_current;
};
} // namespace WebKit
diff --git a/Source/WebKit/chromium/public/WebPluginScrollbar.h b/Source/WebKit/chromium/public/WebPluginScrollbar.h
new file mode 100644
index 000000000..306f098aa
--- /dev/null
+++ b/Source/WebKit/chromium/public/WebPluginScrollbar.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 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 WebPluginScrollbar_h
+#define WebPluginScrollbar_h
+
+#include "WebScrollbar.h"
+
+namespace WebKit {
+
+typedef WebScrollbar WebPluginScrollbar;
+
+} // namespace WebKit
+
+#endif
diff --git a/Source/WebKit/chromium/public/WebPluginScrollbarClient.h b/Source/WebKit/chromium/public/WebPluginScrollbarClient.h
new file mode 100644
index 000000000..36f8e49c8
--- /dev/null
+++ b/Source/WebKit/chromium/public/WebPluginScrollbarClient.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 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 WebPluginScrollbarClient_h
+#define WebPluginScrollbarClient_h
+
+#include "WebPluginScrollbar.h"
+#include "WebScrollbarClient.h"
+
+namespace WebKit {
+
+typedef WebScrollbarClient WebPluginScrollbarClient;
+
+} // namespace WebKit
+
+#endif
diff --git a/Source/WebKit/chromium/public/WebTextRun.h b/Source/WebKit/chromium/public/WebTextRun.h
index b7a57ae69..bacfe31ad 100644
--- a/Source/WebKit/chromium/public/WebTextRun.h
+++ b/Source/WebKit/chromium/public/WebTextRun.h
@@ -33,7 +33,7 @@
#include "platform/WebString.h"
-#ifdef WEBKIT_IMPLEMENTATION
+#if WEBKIT_IMPLEMENTATION
namespace WebCore { class TextRun; }
#endif
@@ -56,7 +56,7 @@ struct WebTextRun {
bool rtl;
bool directionalOverride;
-#ifdef WEBKIT_IMPLEMENTATION
+#if 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;
diff --git a/Source/WebKit/chromium/public/WebView.h b/Source/WebKit/chromium/public/WebView.h
index c15298204..96642f666 100644
--- a/Source/WebKit/chromium/public/WebView.h
+++ b/Source/WebKit/chromium/public/WebView.h
@@ -62,6 +62,7 @@ struct WebActiveWheelFlingParameters;
struct WebMediaPlayerAction;
struct WebPluginAction;
struct WebPoint;
+struct WebRenderingStats;
class WebView : public WebWidget {
public:
@@ -249,6 +250,11 @@ public:
virtual float minimumPageScaleFactor() const = 0;
virtual float maximumPageScaleFactor() const = 0;
+ // Prevent the web page from setting a maximum scale via the viewport meta
+ // tag. This is an accessibility feature that lets folks zoom in to web
+ // pages even if the web page tries to block scaling.
+ virtual void setIgnoreViewportTagMaximumScale(bool) = 0;
+
// The ratio of the current device's screen DPI to the target device's screen DPI.
virtual float deviceScaleFactor() const = 0;
@@ -442,13 +448,6 @@ public:
// GPU acceleration support --------------------------------------------
- // Returns the (on-screen) WebGraphicsContext3D associated with
- // this WebView. One will be created if it doesn't already exist.
- // This is used to set up sharing between this context (which is
- // that used by the compositor) and contexts for WebGL and other
- // APIs.
- virtual WebGraphicsContext3D* graphicsContext3D() = 0;
-
// Context that's in the compositor's share group, but is not the compositor context itself.
// Can be used for allocating resources that the compositor will later access.
virtual WebGraphicsContext3D* sharedGraphicsContext3D() = 0;
@@ -459,6 +458,10 @@ public:
virtual bool setEditableSelectionOffsets(int start, int end) = 0;
+ // Fills in a WebRenderingStats struct containing information about the state of the compositor.
+ // This call is relatively expensive in threaded mode as it blocks on the compositor thread.
+ virtual void renderingStats(WebRenderingStats&) const { }
+
// Visibility -----------------------------------------------------------
// Sets the visibility of the WebView.
diff --git a/Source/WebKit/chromium/public/linux/WebFontRenderStyle.h b/Source/WebKit/chromium/public/linux/WebFontRenderStyle.h
index 78a85916e..f4858f3ec 100644
--- a/Source/WebKit/chromium/public/linux/WebFontRenderStyle.h
+++ b/Source/WebKit/chromium/public/linux/WebFontRenderStyle.h
@@ -50,7 +50,7 @@ struct WEBKIT_EXPORT WebFontRenderStyle {
char useSubpixelRendering; // use subpixel rendering (partially-filled pixels)
char useSubpixelPositioning; // use subpixel positioning (fractional X positions for glyphs)
-#ifdef WEBKIT_IMPLEMENTATION
+#if WEBKIT_IMPLEMENTATION
// Translates the members of this struct to a FontRenderStyle
void toFontRenderStyle(WebCore::FontRenderStyle*);
#endif
diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp
index dd1e2104b..50c560908 100644
--- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp
+++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp
@@ -657,6 +657,11 @@ void ChromeClientImpl::dispatchViewportPropertiesDidChange(const ViewportArgumen
args, settings->layoutFallbackWidth(), deviceRect.width, deviceRect.height,
dpi, IntSize(deviceRect.width, deviceRect.height));
+ if (m_webView->ignoreViewportTagMaximumScale()) {
+ computed.maximumScale = max(computed.maximumScale, m_webView->maxPageScaleFactor);
+ computed.userScalable = true;
+ }
+
int layoutWidth = computed.layoutSize.width();
int layoutHeight = computed.layoutSize.height();
m_webView->setFixedLayoutSize(IntSize(layoutWidth, layoutHeight));
diff --git a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp b/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp
index d0e75485a..a544189b6 100644
--- a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp
+++ b/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp
@@ -94,6 +94,10 @@ void IDBCallbacksProxy::onSuccess(PassRefPtr<SerializedScriptValue> serializedSc
m_callbacks->onSuccess(WebSerializedScriptValue(serializedScriptValue));
}
+void IDBCallbacksProxy::onSuccess(PassRefPtr<SerializedScriptValue> serializedScriptValue, PassRefPtr<IDBKey> key, const IDBKeyPath& keyPath)
+{
+ m_callbacks->onSuccess(serializedScriptValue, key, keyPath);
+}
void IDBCallbacksProxy::onSuccessWithContinuation()
{
m_callbacks->onSuccessWithContinuation();
diff --git a/Source/WebKit/chromium/src/IDBCallbacksProxy.h b/Source/WebKit/chromium/src/IDBCallbacksProxy.h
index 333351fdb..db3056550 100644
--- a/Source/WebKit/chromium/src/IDBCallbacksProxy.h
+++ b/Source/WebKit/chromium/src/IDBCallbacksProxy.h
@@ -52,6 +52,7 @@ public:
virtual void onSuccess(PassRefPtr<WebCore::IDBKey>);
virtual void onSuccess(PassRefPtr<WebCore::IDBTransactionBackendInterface>);
virtual void onSuccess(PassRefPtr<WebCore::SerializedScriptValue>);
+ virtual void onSuccess(PassRefPtr<WebCore::SerializedScriptValue>, PassRefPtr<WebCore::IDBKey>, const WebCore::IDBKeyPath&);
virtual void onSuccessWithContinuation();
virtual void onSuccessWithPrefetch(const Vector<RefPtr<WebCore::IDBKey> >& keys, const Vector<RefPtr<WebCore::IDBKey> >& primaryKeys, const Vector<RefPtr<WebCore::SerializedScriptValue> >& values);
virtual void onBlocked();
diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
index 2c37209c6..0970ce6c2 100644
--- a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
+++ b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
@@ -34,6 +34,7 @@
#include "PlatformContextSkia.h"
#include "WebViewImpl.h"
#include "cc/CCLayerTreeHost.h"
+#include <public/WebFloatPoint.h>
namespace WebKit {
@@ -80,41 +81,41 @@ void NonCompositedContentHost::setScrollLayer(WebCore::GraphicsLayer* layer)
return;
}
- if (layer->platformLayer() == scrollLayer())
+ if (WebScrollableLayer(layer->platformLayer()) == scrollLayer())
return;
layer->addChildAtIndex(m_graphicsLayer.get(), 0);
- ASSERT(scrollLayer());
+ ASSERT(haveScrollLayer());
}
-static void reserveScrollbarLayers(WebCore::LayerChromium* layer, WebCore::LayerChromium* clipLayer)
+static void reserveScrollbarLayers(WebLayer layer, WebLayer clipLayer)
{
// Scrollbars and corners are known to be attached outside the root clip
// rect, so skip the clipLayer subtree.
if (layer == clipLayer)
return;
- for (size_t i = 0; i < layer->children().size(); ++i)
- reserveScrollbarLayers(layer->children()[i].get(), clipLayer);
+ for (size_t i = 0; i < layer.numberOfChildren(); ++i)
+ reserveScrollbarLayers(layer.childAt(i), clipLayer);
- if (layer->drawsContent())
- layer->setAlwaysReserveTextures(true);
+ if (layer.drawsContent())
+ layer.setAlwaysReserveTextures(true);
}
void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize, const WebCore::IntSize& contentsSize, const WebCore::IntPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, float deviceScale)
{
- if (!scrollLayer())
+ if (!haveScrollLayer())
return;
bool visibleRectChanged = m_viewportSize != viewportSize;
m_viewportSize = viewportSize;
-
- scrollLayer()->setScrollPosition(scrollPosition + toSize(scrollOrigin));
- scrollLayer()->setPosition(-scrollPosition);
+ WebScrollableLayer layer = scrollLayer();
+ layer.setScrollPosition(scrollPosition + scrollOrigin);
+ layer.setPosition(WebFloatPoint(-scrollPosition));
// Due to the possibility of pinch zoom, the noncomposited layer is always
// assumed to be scrollable.
- scrollLayer()->setScrollable(true);
+ layer.setScrollable(true);
m_deviceScaleFactor = deviceScale;
m_graphicsLayer->deviceOrPageScaleFactorChanged();
m_graphicsLayer->setSize(contentsSize);
@@ -135,18 +136,23 @@ void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize,
} else if (visibleRectChanged)
m_graphicsLayer->setNeedsDisplay();
- WebCore::LayerChromium* clipLayer = scrollLayer()->parent();
- WebCore::LayerChromium* rootLayer = clipLayer;
- while (rootLayer->parent())
- rootLayer = rootLayer->parent();
+ WebLayer clipLayer = layer.parent();
+ WebLayer rootLayer = clipLayer;
+ while (!rootLayer.parent().isNull())
+ rootLayer = rootLayer.parent();
reserveScrollbarLayers(rootLayer, clipLayer);
}
-WebCore::LayerChromium* NonCompositedContentHost::scrollLayer()
+bool NonCompositedContentHost::haveScrollLayer()
+{
+ return m_graphicsLayer->parent();
+}
+
+WebScrollableLayer NonCompositedContentHost::scrollLayer()
{
if (!m_graphicsLayer->parent())
- return 0;
- return m_graphicsLayer->parent()->platformLayer();
+ return WebScrollableLayer();
+ return WebScrollableLayer(m_graphicsLayer->parent()->platformLayer());
}
void NonCompositedContentHost::invalidateRect(const WebCore::IntRect& rect)
diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.h b/Source/WebKit/chromium/src/NonCompositedContentHost.h
index 9706860d7..e60e9ef48 100644
--- a/Source/WebKit/chromium/src/NonCompositedContentHost.h
+++ b/Source/WebKit/chromium/src/NonCompositedContentHost.h
@@ -29,6 +29,7 @@
#include "GraphicsLayerClient.h"
#include "IntSize.h"
+#include <public/WebScrollableLayer.h>
#include <wtf/Noncopyable.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
@@ -39,7 +40,6 @@ class GraphicsLayer;
class GraphicsContext;
class IntPoint;
class IntRect;
-class LayerChromium;
}
namespace WebKit {
@@ -79,7 +79,8 @@ private:
// size, so it is always 1 for the GraphicsLayer.
virtual float deviceScaleFactor() const OVERRIDE { return m_deviceScaleFactor; }
- WebCore::LayerChromium* scrollLayer();
+ bool haveScrollLayer();
+ WebScrollableLayer scrollLayer();
OwnPtr<WebCore::GraphicsLayer> m_graphicsLayer;
WebViewImpl* m_webView;
diff --git a/Source/WebKit/chromium/src/WebContentLayer.cpp b/Source/WebKit/chromium/src/WebContentLayer.cpp
index 2c041c2cb..14ce98039 100644
--- a/Source/WebKit/chromium/src/WebContentLayer.cpp
+++ b/Source/WebKit/chromium/src/WebContentLayer.cpp
@@ -54,7 +54,7 @@ void WebContentLayer::setContentsScale(float scale)
}
WebContentLayer::WebContentLayer(const PassRefPtr<ContentLayerChromium>& node)
- : WebLayer(node)
+ : WebScrollableLayer(node)
{
}
diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp
index 8ccec72b1..afe0f99ff 100644
--- a/Source/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp
@@ -950,6 +950,15 @@ v8::Handle<v8::Value> WebFrameImpl::createFileSystem(WebFileSystem::Type type,
return toV8(DOMFileSystem::create(frame()->document(), name, static_cast<WebCore::FileSystemType>(type), KURL(ParsedURLString, path.utf8().data()), AsyncFileSystemChromium::create()));
}
+v8::Handle<v8::Value> WebFrameImpl::createSerializableFileSystem(WebFileSystem::Type type,
+ const WebString& name,
+ const WebString& path)
+{
+ RefPtr<DOMFileSystem> fs = DOMFileSystem::create(frame()->document(), name, static_cast<WebCore::FileSystemType>(type), KURL(ParsedURLString, path.utf8().data()), AsyncFileSystemChromium::create());
+ fs->makeClonable();
+ return toV8(fs.release());
+}
+
v8::Handle<v8::Value> WebFrameImpl::createFileEntry(WebFileSystem::Type type,
const WebString& fileSystemName,
const WebString& fileSystemPath,
diff --git a/Source/WebKit/chromium/src/WebFrameImpl.h b/Source/WebKit/chromium/src/WebFrameImpl.h
index 39937471a..3ddfb76d2 100644
--- a/Source/WebKit/chromium/src/WebFrameImpl.h
+++ b/Source/WebKit/chromium/src/WebFrameImpl.h
@@ -126,6 +126,9 @@ public:
virtual v8::Handle<v8::Value> createFileSystem(WebFileSystem::Type,
const WebString& name,
const WebString& path);
+ virtual v8::Handle<v8::Value> createSerializableFileSystem(WebFileSystem::Type,
+ const WebString& name,
+ const WebString& path);
virtual v8::Handle<v8::Value> createFileEntry(WebFileSystem::Type,
const WebString& fileSystemName,
const WebString& fileSystemPath,
diff --git a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp
index 1a82a63d8..31266b1a3 100644
--- a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp
@@ -90,6 +90,13 @@ void WebIDBCallbacksImpl::onSuccess(const WebSerializedScriptValue& serializedSc
m_callbacks->onSuccess(serializedScriptValue);
}
+void WebIDBCallbacksImpl::onSuccess(const WebSerializedScriptValue& serializedScriptValue, const WebIDBKey& key, const WebIDBKeyPath& keyPath)
+{
+ // FIXME: proxy to the 3-parameter version when interface lands:
+ // m_callbacks->onSuccess(serializedScriptValue, key, keyPath););
+ ASSERT_NOT_REACHED();
+}
+
void WebIDBCallbacksImpl::onSuccessWithContinuation()
{
m_callbacks->onSuccessWithContinuation();
diff --git a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h
index be8541b70..7b0216359 100644
--- a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h
@@ -48,6 +48,7 @@ public:
virtual void onSuccess(const WebIDBKey&);
virtual void onSuccess(WebIDBTransaction*);
virtual void onSuccess(const WebSerializedScriptValue&);
+ virtual void onSuccess(const WebSerializedScriptValue&, const WebIDBKey&, const WebIDBKeyPath&);
virtual void onSuccessWithContinuation();
virtual void onBlocked();
diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
index 39803e145..18573cacf 100644
--- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
@@ -58,21 +58,6 @@ WebIDBMetadata WebIDBDatabaseImpl::metadata() const
return m_databaseBackend->metadata();
}
-WebString WebIDBDatabaseImpl::name() const
-{
- return m_databaseBackend->name();
-}
-
-WebString WebIDBDatabaseImpl::version() const
-{
- return m_databaseBackend->version();
-}
-
-WebDOMStringList WebIDBDatabaseImpl::objectStoreNames() const
-{
- return m_databaseBackend->objectStoreNames();
-}
-
WebIDBObjectStore* WebIDBDatabaseImpl::createObjectStore(const WebString& name, const WebIDBKeyPath& keyPath, bool autoIncrement, const WebIDBTransaction& transaction, WebExceptionCode& ec)
{
RefPtr<IDBObjectStoreBackendInterface> objectStore = m_databaseBackend->createObjectStore(name, keyPath, autoIncrement, transaction.getIDBTransactionBackendInterface(), ec);
diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h
index 5e989e00e..4f8251820 100644
--- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h
@@ -51,9 +51,6 @@ public:
virtual ~WebIDBDatabaseImpl();
virtual WebIDBMetadata metadata() const;
- virtual WebString name() const;
- virtual WebString version() const;
- virtual WebDOMStringList objectStoreNames() const;
virtual WebIDBObjectStore* createObjectStore(const WebString& name, const WebIDBKeyPath&, bool autoIncrement, const WebIDBTransaction&, WebExceptionCode&);
virtual void deleteObjectStore(const WebString& name, const WebIDBTransaction&, WebExceptionCode&);
diff --git a/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp b/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp
index 7f74e5a47..9b1d68cff 100644
--- a/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp
@@ -48,26 +48,6 @@ WebIDBIndexImpl::~WebIDBIndexImpl()
{
}
-WebString WebIDBIndexImpl::name() const
-{
- return m_backend->name();
-}
-
-WebIDBKeyPath WebIDBIndexImpl::keyPath() const
-{
- return WebIDBKeyPath(m_backend->keyPath());
-}
-
-bool WebIDBIndexImpl::unique() const
-{
- return m_backend->unique();
-}
-
-bool WebIDBIndexImpl::multiEntry() const
-{
- return m_backend->multiEntry();
-}
-
void WebIDBIndexImpl::openObjectCursor(const WebIDBKeyRange& keyRange, unsigned short direction, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec)
{
m_backend->openCursor(keyRange, direction, IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), ec);
diff --git a/Source/WebKit/chromium/src/WebIDBIndexImpl.h b/Source/WebKit/chromium/src/WebIDBIndexImpl.h
index 04fea582f..220962b57 100644
--- a/Source/WebKit/chromium/src/WebIDBIndexImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBIndexImpl.h
@@ -43,11 +43,6 @@ public:
WebIDBIndexImpl(WTF::PassRefPtr<WebCore::IDBIndexBackendInterface>);
virtual ~WebIDBIndexImpl();
- virtual WebString name() const;
- virtual WebIDBKeyPath keyPath() const;
- virtual bool unique() const;
- virtual bool multiEntry() const;
-
virtual void openObjectCursor(const WebIDBKeyRange&, unsigned short direction, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
virtual void openKeyCursor(const WebIDBKeyRange&, unsigned short direction, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
virtual void count(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
index 4c45be2f9..9bac6d3c3 100755
--- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
@@ -53,26 +53,6 @@ WebIDBObjectStoreImpl::~WebIDBObjectStoreImpl()
{
}
-WebString WebIDBObjectStoreImpl::name() const
-{
- return m_objectStore->name();
-}
-
-WebIDBKeyPath WebIDBObjectStoreImpl::keyPath() const
-{
- return m_objectStore->keyPath();
-}
-
-WebDOMStringList WebIDBObjectStoreImpl::indexNames() const
-{
- return m_objectStore->indexNames();
-}
-
-bool WebIDBObjectStoreImpl::autoIncrement() const
-{
- return m_objectStore->autoIncrement();
-}
-
void WebIDBObjectStoreImpl::get(const WebIDBKeyRange& keyRange, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec)
{
m_objectStore->get(keyRange, IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), ec);
diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
index 1bffd562b..5a881b592 100644
--- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
@@ -45,11 +45,6 @@ public:
WebIDBObjectStoreImpl(WTF::PassRefPtr<WebCore::IDBObjectStoreBackendInterface>);
~WebIDBObjectStoreImpl();
- WebString name() const;
- WebIDBKeyPath keyPath() const;
- WebDOMStringList indexNames() const;
- bool autoIncrement() const;
-
void get(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
void put(const WebSerializedScriptValue&, const WebIDBKey&, PutMode, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
void deleteFunction(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
diff --git a/Source/WebKit/chromium/src/WebLayer.cpp b/Source/WebKit/chromium/src/WebLayer.cpp
index 25cb5868c..5b8d55cf4 100644
--- a/Source/WebKit/chromium/src/WebLayer.cpp
+++ b/Source/WebKit/chromium/src/WebLayer.cpp
@@ -118,6 +118,16 @@ WebLayer WebLayer::parent() const
return WebLayer(const_cast<LayerChromium*>(m_private->parent()));
}
+size_t WebLayer::numberOfChildren() const
+{
+ return m_private->children().size();
+}
+
+WebLayer WebLayer::childAt(size_t index) const
+{
+ return WebLayer(m_private->children()[index]);
+}
+
void WebLayer::addChild(const WebLayer& child)
{
m_private->addChild(child);
@@ -300,6 +310,11 @@ void WebLayer::setDebugBorderWidth(float width)
m_private->setDebugBorderWidth(width);
}
+void WebLayer::setAlwaysReserveTextures(bool reserve)
+{
+ m_private->setAlwaysReserveTextures(reserve);
+}
+
void WebLayer::setForceRenderSurface(bool forceRenderSurface)
{
m_private->setForceRenderSurface(forceRenderSurface);
diff --git a/Source/WebKit/chromium/src/WebLayerTreeView.cpp b/Source/WebKit/chromium/src/WebLayerTreeView.cpp
index 356af1de2..207a8350d 100644
--- a/Source/WebKit/chromium/src/WebLayerTreeView.cpp
+++ b/Source/WebKit/chromium/src/WebLayerTreeView.cpp
@@ -31,10 +31,12 @@
#include "WebLayerTreeViewImpl.h"
#include "cc/CCGraphicsContext.h"
#include "cc/CCLayerTreeHost.h"
+#include "cc/CCRenderingStats.h"
#include "platform/WebLayer.h"
#include "platform/WebPoint.h"
#include "platform/WebRect.h"
#include "platform/WebSize.h"
+#include <public/WebRenderingStats.h>
using namespace WebCore;
@@ -173,9 +175,13 @@ void WebLayerTreeView::finishAllRendering()
m_private->layerTreeHost()->finishAllRendering();
}
-WebGraphicsContext3D* WebLayerTreeView::context()
+void WebLayerTreeView::renderingStats(WebRenderingStats& stats) const
{
- return GraphicsContext3DPrivate::extractWebGraphicsContext3D(m_private->layerTreeHost()->context()->context3D());
+ CCRenderingStats ccStats;
+ m_private->layerTreeHost()->renderingStats(ccStats);
+
+ stats.numAnimationFrames = ccStats.numAnimationFrames;
+ stats.numFramesSentToScreen = ccStats.numFramesSentToScreen;
}
void WebLayerTreeView::loseCompositorContext(int numTimes)
diff --git a/Source/WebKit/chromium/src/WebLayerTreeViewImpl.cpp b/Source/WebKit/chromium/src/WebLayerTreeViewImpl.cpp
index 17d5fe867..825fc01ef 100644
--- a/Source/WebKit/chromium/src/WebLayerTreeViewImpl.cpp
+++ b/Source/WebKit/chromium/src/WebLayerTreeViewImpl.cpp
@@ -54,12 +54,9 @@ public:
virtual void updateAnimations(double monotonicFrameBeginTime) OVERRIDE { m_client->updateAnimations(monotonicFrameBeginTime); }
virtual void layout() OVERRIDE { m_client->layout(); }
virtual void applyScrollAndScale(const WebCore::IntSize& scrollDelta, float pageScale) OVERRIDE { m_client->applyScrollAndScale(scrollDelta, pageScale); }
- virtual PassRefPtr<WebCore::GraphicsContext3D> createContext3D() OVERRIDE
+ virtual PassOwnPtr<WebGraphicsContext3D> createContext3D() OVERRIDE
{
- OwnPtr<WebGraphicsContext3D> webContext = adoptPtr(m_client->createContext3D());
- if (!webContext)
- return 0;
- return GraphicsContext3DPrivate::createGraphicsContextFromWebContext(webContext.release(), GraphicsContext3D::RenderDirectlyToHostWindow, false /* preserveDrawingBuffer */ );
+ return adoptPtr(m_client->createContext3D());
}
virtual void didRecreateContext(bool success) OVERRIDE { m_client->didRebindGraphicsContext(success); }
virtual void willCommit() OVERRIDE { m_client->willCommit(); }
diff --git a/Source/WebKit/chromium/src/WebNodeCollection.cpp b/Source/WebKit/chromium/src/WebNodeCollection.cpp
index a8356d9d5..617bf564a 100644
--- a/Source/WebKit/chromium/src/WebNodeCollection.cpp
+++ b/Source/WebKit/chromium/src/WebNodeCollection.cpp
@@ -74,12 +74,16 @@ unsigned WebNodeCollection::length() const
WebNode WebNodeCollection::nextItem() const
{
- return WebNode(m_private->nextItem());
+ Node* node = m_private->item(m_current);
+ if (node)
+ m_current++;
+ return WebNode(node);
}
WebNode WebNodeCollection::firstItem() const
{
- return WebNode(m_private->firstItem());
+ m_current = 0;
+ return nextItem();
}
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp b/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp
index 072a9909c..ac200f1c9 100644
--- a/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp
+++ b/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp
@@ -477,7 +477,8 @@ void WebPageSerializerImpl::collectTargetFrames()
Document* currentDoc = currentFrame->frame()->document();
// Go through sub-frames.
RefPtr<HTMLAllCollection> all = currentDoc->all();
- for (Node* node = all->firstItem(); node; node = all->nextItem()) {
+
+ for (unsigned i = 0; Node* node = all->item(i); i++) {
if (!node->isHTMLElement())
continue;
Element* element = static_cast<Element*>(node);
diff --git a/Source/WebKit/chromium/src/WebScrollableLayer.cpp b/Source/WebKit/chromium/src/WebScrollableLayer.cpp
new file mode 100644
index 000000000..19e410aa5
--- /dev/null
+++ b/Source/WebKit/chromium/src/WebScrollableLayer.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 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 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 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 <public/WebScrollableLayer.h>
+
+#include "LayerChromium.h"
+
+
+namespace WebKit {
+
+void WebScrollableLayer::setScrollPosition(WebPoint position)
+{
+ m_private->setScrollPosition(position);
+}
+
+void WebScrollableLayer::setScrollable(bool scrollable)
+{
+ m_private->setScrollable(scrollable);
+}
+
+void WebScrollableLayer::setHaveWheelEventHandlers(bool haveWheelEventHandlers)
+{
+ m_private->setHaveWheelEventHandlers(haveWheelEventHandlers);
+}
+
+void WebScrollableLayer::setShouldScrollOnMainThread(bool shouldScrollOnMainThread)
+{
+ m_private->setShouldScrollOnMainThread(shouldScrollOnMainThread);
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp
index d2393c31c..652e9a616 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.cpp
+++ b/Source/WebKit/chromium/src/WebViewImpl.cpp
@@ -386,6 +386,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
, m_pageDefinedMaximumPageScaleFactor(-1)
, m_minimumPageScaleFactor(minPageScaleFactor)
, m_maximumPageScaleFactor(maxPageScaleFactor)
+ , m_ignoreViewportTagMaximumScale(false)
, m_pageScaleFactorIsSet(false)
, m_contextMenuAllowed(false)
, m_doingDragAndDrop(false)
@@ -728,6 +729,13 @@ void WebViewImpl::transferActiveWheelFlingAnimation(const WebActiveWheelFlingPar
scheduleAnimation();
}
+void WebViewImpl::renderingStats(WebRenderingStats& stats) const
+{
+ ASSERT(isAcceleratedCompositingActive());
+ if (!m_layerTreeView.isNull())
+ m_layerTreeView.renderingStats(stats);
+}
+
void WebViewImpl::startPageScaleAnimation(const IntPoint& scroll, bool useAnchor, float newScale, double durationSec)
{
if (!m_layerTreeView.isNull())
@@ -2607,6 +2615,16 @@ void WebViewImpl::setPageScaleFactorLimits(float minPageScale, float maxPageScal
computePageScaleFactorLimits();
}
+void WebViewImpl::setIgnoreViewportTagMaximumScale(bool flag)
+{
+ m_ignoreViewportTagMaximumScale = flag;
+
+ if (!page() || !page()->mainFrame())
+ return;
+
+ m_page->chrome()->client()->dispatchViewportPropertiesDidChange(page()->mainFrame()->document()->viewportArguments());
+}
+
bool WebViewImpl::computePageScaleFactorLimits()
{
if (m_pageDefinedMinimumPageScaleFactor == -1 || m_pageDefinedMaximumPageScaleFactor == -1)
@@ -3698,30 +3716,6 @@ void WebViewImpl::updateLayerTreeViewport()
m_layerTreeView.setPageScaleFactorAndLimits(pageScaleFactor(), m_minimumPageScaleFactor, m_maximumPageScaleFactor);
}
-WebGraphicsContext3D* WebViewImpl::graphicsContext3D()
-{
-#if USE(ACCELERATED_COMPOSITING)
- if (m_page->settings()->acceleratedCompositingEnabled() && allowsAcceleratedCompositing()) {
- if (!m_layerTreeView.isNull()) {
- WebGraphicsContext3D* context = m_layerTreeView.context();
- if (context && !context->isContextLost())
- return context;
- }
- // If we get here it means that some system needs access to the context the compositor will use but the compositor itself
- // hasn't requested a context or it was unable to successfully instantiate a context.
- // We need to return the context that the compositor will later use so we allocate a new context (if needed) and stash it
- // until the compositor requests and takes ownership of the context via createLayerTreeHost3D().
- if (!m_temporaryOnscreenGraphicsContext3D)
- m_temporaryOnscreenGraphicsContext3D = createCompositorGraphicsContext3D();
-
- WebGraphicsContext3D* webContext = m_temporaryOnscreenGraphicsContext3D.get();
- if (webContext && !webContext->isContextLost())
- return webContext;
- }
-#endif
- return 0;
-}
-
WebGraphicsContext3D* WebViewImpl::sharedGraphicsContext3D()
{
if (!m_page->settings()->acceleratedCompositingEnabled() || !allowsAcceleratedCompositing())
diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h
index d4527da0d..f657504f2 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.h
+++ b/Source/WebKit/chromium/src/WebViewImpl.h
@@ -207,6 +207,7 @@ public:
virtual void setPageScaleFactorLimits(float minPageScale, float maxPageScale);
virtual float minimumPageScaleFactor() const;
virtual float maximumPageScaleFactor() const;
+ virtual void setIgnoreViewportTagMaximumScale(bool);
virtual float deviceScaleFactor() const;
virtual void setDeviceScaleFactor(float);
@@ -293,6 +294,7 @@ public:
virtual void updateBatteryStatus(const WebBatteryStatus&);
#endif
virtual void transferActiveWheelFlingAnimation(const WebActiveWheelFlingParameters&);
+ virtual void renderingStats(WebRenderingStats&) const;
// WebLayerTreeViewClient
virtual void willBeginFrame();
@@ -451,6 +453,8 @@ public:
return m_emulatedTextZoomFactor;
}
+ bool ignoreViewportTagMaximumScale() const { return m_ignoreViewportTagMaximumScale; }
+
// Determines whether a page should e.g. be opened in a background tab.
// Returns false if it has no opinion, in which case it doesn't set *policy.
static bool navigationPolicyFromMouseEvent(
@@ -516,13 +520,6 @@ public:
void scheduleAnimation();
#endif
- // Returns the onscreen 3D context used by the compositor. This is
- // used by the renderer's code to set up resource sharing between
- // the compositor's context and subordinate contexts for APIs like
- // WebGL. Returns 0 if compositing support is not compiled in or
- // we could not successfully instantiate a context.
- virtual WebGraphicsContext3D* graphicsContext3D();
-
virtual WebGraphicsContext3D* sharedGraphicsContext3D();
PassOwnPtr<WebGraphicsContext3D> createCompositorGraphicsContext3D();
@@ -709,6 +706,8 @@ private:
float m_minimumPageScaleFactor;
float m_maximumPageScaleFactor;
+ bool m_ignoreViewportTagMaximumScale;
+
bool m_pageScaleFactorIsSet;
bool m_contextMenuAllowed;
diff --git a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp
index e87b5aa29..bd9b1761a 100644
--- a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp
+++ b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp
@@ -187,8 +187,10 @@ void WorkerFileSystemCallbacksBridge::cleanUpAfterCallback()
m_callbacksOnWorkerThread = 0;
if (m_workerContextObserver) {
- delete m_workerContextObserver;
+ WorkerFileSystemContextObserver* observer = m_workerContextObserver;
m_workerContextObserver = 0;
+ // The next line may delete this.
+ delete observer;
}
}
diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
index d19b036bb..34846b7c2 100644
--- a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
@@ -30,7 +30,6 @@
#include "CCLayerTestCommon.h"
#include "CCTestCommon.h"
#include "FakeWebGraphicsContext3D.h"
-#include "GraphicsContext3DPrivate.h"
#include "LayerRendererChromium.h"
#include "ManagedTexture.h"
#include "cc/CCIOSurfaceLayerImpl.h"
@@ -82,7 +81,7 @@ public:
virtual void setNeedsCommitOnImplThread() OVERRIDE { m_didRequestCommit = true; }
virtual void postAnimationEventsToMainThreadOnImplThread(PassOwnPtr<CCAnimationEventsVector>, double wallClockTime) OVERRIDE { }
- PassOwnPtr<CCLayerTreeHostImpl> createLayerTreeHost(bool partialSwap, PassRefPtr<CCGraphicsContext> graphicsContext, PassOwnPtr<CCLayerImpl> rootPtr)
+ PassOwnPtr<CCLayerTreeHostImpl> createLayerTreeHost(bool partialSwap, PassOwnPtr<CCGraphicsContext> graphicsContext, PassOwnPtr<CCLayerImpl> rootPtr)
{
CCSettings::setPartialSwapEnabled(partialSwap);
@@ -162,9 +161,9 @@ public:
}
protected:
- PassRefPtr<CCGraphicsContext> createContext()
+ PassOwnPtr<CCGraphicsContext> createContext()
{
- return CCGraphicsContext::create3D(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FakeWebGraphicsContext3D()), GraphicsContext3D::RenderDirectlyToHostWindow));
+ return CCGraphicsContext::create3D(adoptPtr(new FakeWebGraphicsContext3D));
}
DebugScopedSetImplThread m_alwaysImplThread;
@@ -1511,10 +1510,9 @@ public:
// viewport size is never set.
TEST_F(CCLayerTreeHostImplTest, reshapeNotCalledUntilDraw)
{
- ReshapeTrackerContext* reshapeTracker = new ReshapeTrackerContext();
- RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(reshapeTracker), GraphicsContext3D::RenderDirectlyToHostWindow);
- RefPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(context);
- m_hostImpl->initializeLayerRenderer(ccContext, UnthrottledUploader);
+ OwnPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(adoptPtr(new ReshapeTrackerContext));
+ ReshapeTrackerContext* reshapeTracker = static_cast<ReshapeTrackerContext*>(ccContext->context3D());
+ m_hostImpl->initializeLayerRenderer(ccContext.release(), UnthrottledUploader);
CCLayerImpl* root = new FakeDrawableCCLayerImpl(1);
root->setAnchorPoint(FloatPoint(0, 0));
@@ -1555,16 +1553,15 @@ private:
// where it should request to swap only the subBuffer that is damaged.
TEST_F(CCLayerTreeHostImplTest, partialSwapReceivesDamageRect)
{
- PartialSwapTrackerContext* partialSwapTracker = new PartialSwapTrackerContext();
- RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(partialSwapTracker), GraphicsContext3D::RenderDirectlyToHostWindow);
- RefPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(context);
+ OwnPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(adoptPtr(new PartialSwapTrackerContext));
+ PartialSwapTrackerContext* partialSwapTracker = static_cast<PartialSwapTrackerContext*>(ccContext->context3D());
// This test creates its own CCLayerTreeHostImpl, so
// that we can force partial swap enabled.
CCLayerTreeSettings settings;
CCSettings::setPartialSwapEnabled(true);
OwnPtr<CCLayerTreeHostImpl> layerTreeHostImpl = CCLayerTreeHostImpl::create(settings, this);
- layerTreeHostImpl->initializeLayerRenderer(ccContext, UnthrottledUploader);
+ layerTreeHostImpl->initializeLayerRenderer(ccContext.release(), UnthrottledUploader);
layerTreeHostImpl->setViewportSize(IntSize(500, 500));
CCLayerImpl* root = new FakeDrawableCCLayerImpl(1);
@@ -1725,15 +1722,15 @@ public:
TEST_F(CCLayerTreeHostImplTest, noPartialSwap)
{
- MockContext* mockContext = new MockContext();
- RefPtr<CCGraphicsContext> context = CCGraphicsContext::create3D(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(mockContext), GraphicsContext3D::RenderDirectlyToHostWindow));
+ OwnPtr<CCGraphicsContext> context = CCGraphicsContext::create3D(adoptPtr(new MockContext));
+ MockContext* mockContext = static_cast<MockContext*>(context->context3D());
MockContextHarness harness(mockContext);
harness.mustDrawSolidQuad();
harness.mustSetScissor(0, 0, 10, 10);
// Run test case
- OwnPtr<CCLayerTreeHostImpl> myHostImpl = createLayerTreeHost(false, context, FakeLayerWithQuads::create(1));
+ OwnPtr<CCLayerTreeHostImpl> myHostImpl = createLayerTreeHost(false, context.release(), FakeLayerWithQuads::create(1));
CCLayerTreeHostImpl::FrameData frame;
EXPECT_TRUE(myHostImpl->prepareToDraw(frame));
@@ -1744,14 +1741,14 @@ TEST_F(CCLayerTreeHostImplTest, noPartialSwap)
TEST_F(CCLayerTreeHostImplTest, partialSwap)
{
- MockContext* mockContext = new MockContext();
- RefPtr<CCGraphicsContext> context = CCGraphicsContext::create3D(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(mockContext), GraphicsContext3D::RenderDirectlyToHostWindow));
+ OwnPtr<CCGraphicsContext> context = CCGraphicsContext::create3D(adoptPtr(new MockContext));
+ MockContext* mockContext = static_cast<MockContext*>(context->context3D());
MockContextHarness harness(mockContext);
harness.mustDrawSolidQuad();
harness.mustSetScissor(0, 0, 10, 10);
- OwnPtr<CCLayerTreeHostImpl> myHostImpl = createLayerTreeHost(true, context, FakeLayerWithQuads::create(1));
+ OwnPtr<CCLayerTreeHostImpl> myHostImpl = createLayerTreeHost(true, context.release(), FakeLayerWithQuads::create(1));
CCLayerTreeHostImpl::FrameData frame;
EXPECT_TRUE(myHostImpl->prepareToDraw(frame));
@@ -1762,8 +1759,8 @@ TEST_F(CCLayerTreeHostImplTest, partialSwap)
TEST_F(CCLayerTreeHostImplTest, partialSwapNoUpdate)
{
- MockContext* mockContext = new MockContext();
- RefPtr<CCGraphicsContext> context = CCGraphicsContext::create3D(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(mockContext), GraphicsContext3D::RenderDirectlyToHostWindow));
+ OwnPtr<CCGraphicsContext> context = CCGraphicsContext::create3D(adoptPtr(new MockContext));
+ MockContext* mockContext = static_cast<MockContext*>(context->context3D());
MockContextHarness harness(mockContext);
harness.mustDrawSolidQuad();
@@ -1771,7 +1768,7 @@ TEST_F(CCLayerTreeHostImplTest, partialSwapNoUpdate)
harness.mustDrawSolidQuad();
harness.mustSetScissor(0, 0, 10, 10);
- OwnPtr<CCLayerTreeHostImpl> myHostImpl = createLayerTreeHost(true, context, FakeLayerWithQuads::create(1));
+ OwnPtr<CCLayerTreeHostImpl> myHostImpl = createLayerTreeHost(true, context.release(), FakeLayerWithQuads::create(1));
// Draw once to make sure layer is not new
CCLayerTreeHostImpl::FrameData frame;
@@ -1804,13 +1801,20 @@ public:
{
return WebString("GL_CHROMIUM_post_sub_buffer");
}
+
+ // Unlimited texture size.
+ virtual void getIntegerv(WGC3Denum pname, WGC3Dint* value)
+ {
+ if (pname == WebCore::GraphicsContext3D::MAX_TEXTURE_SIZE)
+ *value = 8192;
+ }
};
static PassOwnPtr<CCLayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, CCLayerTreeHostImplClient* client)
{
CCSettings::setPartialSwapEnabled(partialSwap);
- RefPtr<CCGraphicsContext> context = CCGraphicsContext::create3D(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new PartialSwapContext()), GraphicsContext3D::RenderDirectlyToHostWindow));
+ OwnPtr<CCGraphicsContext> context = CCGraphicsContext::create3D(adoptPtr(new PartialSwapContext));
CCLayerTreeSettings settings;
OwnPtr<CCLayerTreeHostImpl> myHostImpl = CCLayerTreeHostImpl::create(settings, client);
@@ -1921,7 +1925,7 @@ TEST_F(CCLayerTreeHostImplTest, didDrawNotCalledOnScissoredLayer)
CCLayerTreeSettings settings;
CCSettings::setPartialSwapEnabled(true);
- RefPtr<CCGraphicsContext> context = CCGraphicsContext::create3D(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new PartialSwapContext()), GraphicsContext3D::RenderDirectlyToHostWindow));
+ OwnPtr<CCGraphicsContext> context = CCGraphicsContext::create3D(adoptPtr(new PartialSwapContext));
OwnPtr<CCLayerTreeHostImpl> myHostImpl = CCLayerTreeHostImpl::create(settings, this);
myHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader);
myHostImpl->setViewportSize(IntSize(10, 10));
@@ -2021,7 +2025,7 @@ public:
TEST_F(CCLayerTreeHostImplTest, finishAllRenderingAfterContextLost)
{
// The context initialization will fail, but we should still be able to call finishAllRendering() without any ill effects.
- m_hostImpl->initializeLayerRenderer(CCGraphicsContext::create3D(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails), GraphicsContext3D::RenderDirectlyToHostWindow)), UnthrottledUploader);
+ m_hostImpl->initializeLayerRenderer(CCGraphicsContext::create3D(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails)), UnthrottledUploader);
m_hostImpl->finishAllRendering();
}
@@ -2131,11 +2135,6 @@ public:
ADD_FAILURE() << "Trying to bind texture id " << id;
}
- static PassRefPtr<GraphicsContext3D> createGraphicsContext()
- {
- return GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new StrictWebGraphicsContext3D()), GraphicsContext3D::RenderDirectlyToHostWindow);
- }
-
private:
HashSet<unsigned> m_allocatedTextureIds;
};
@@ -2186,11 +2185,6 @@ public:
return WebString();
}
-
- static PassRefPtr<GraphicsContext3D> createGraphicsContext()
- {
- return GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new StrictWebGraphicsContext3DWithIOSurface()), GraphicsContext3D::RenderDirectlyToHostWindow);
- }
};
class FakeWebGraphicsContext3DWithIOSurface : public FakeWebGraphicsContext3D {
@@ -2202,11 +2196,6 @@ public:
return WebString();
}
-
- static PassRefPtr<GraphicsContext3D> createGraphicsContext()
- {
- return GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FakeWebGraphicsContext3DWithIOSurface()), GraphicsContext3D::RenderDirectlyToHostWindow);
- }
};
TEST_F(CCLayerTreeHostImplTest, dontUseOldResourcesAfterLostContext)
@@ -2254,7 +2243,7 @@ TEST_F(CCLayerTreeHostImplTest, dontUseOldResourcesAfterLostContext)
rootLayer->addChild(ioSurfaceLayer.release());
// Use a context that supports IOSurfaces
- m_hostImpl->initializeLayerRenderer(CCGraphicsContext::create3D(FakeWebGraphicsContext3DWithIOSurface::createGraphicsContext()), UnthrottledUploader);
+ m_hostImpl->initializeLayerRenderer(CCGraphicsContext::create3D(adoptPtr(new FakeWebGraphicsContext3DWithIOSurface)), UnthrottledUploader);
m_hostImpl->setRootLayer(rootLayer.release());
@@ -2266,7 +2255,7 @@ TEST_F(CCLayerTreeHostImplTest, dontUseOldResourcesAfterLostContext)
// Lose the context, replacing it with a StrictWebGraphicsContext3DWithIOSurface,
// that will warn if any resource from the previous context gets used.
- m_hostImpl->initializeLayerRenderer(CCGraphicsContext::create3D(StrictWebGraphicsContext3DWithIOSurface::createGraphicsContext()), UnthrottledUploader);
+ m_hostImpl->initializeLayerRenderer(CCGraphicsContext::create3D(adoptPtr(new StrictWebGraphicsContext3DWithIOSurface)), UnthrottledUploader);
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
m_hostImpl->drawLayers(frame);
m_hostImpl->didDrawAllLayers(frame);
@@ -2307,11 +2296,6 @@ public:
return WebString();
}
- PassRefPtr<GraphicsContext3D> createGraphicsContext()
- {
- return GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(this), GraphicsContext3D::RenderDirectlyToHostWindow);
- }
-
unsigned numTextures() const { return m_numTextures; }
private:
@@ -2363,11 +2347,10 @@ TEST_F(CCLayerTreeHostImplTest, layersFreeTextures)
ioSurfaceLayer->setLayerTreeHostImpl(m_hostImpl.get());
rootLayer->addChild(ioSurfaceLayer.release());
- // Lose the context, replacing it with a TrackingWebGraphicsContext3D, that
- // tracks the number of textures allocated. This pointer is owned by its
- // GraphicsContext3D.
- TrackingWebGraphicsContext3D* trackingWebGraphicsContext = new TrackingWebGraphicsContext3D();
- m_hostImpl->initializeLayerRenderer(CCGraphicsContext::create3D(trackingWebGraphicsContext->createGraphicsContext()), UnthrottledUploader);
+ // Lose the context, replacing it with a TrackingWebGraphicsContext3D (which the CCLayerTreeHostImpl takes ownership of).
+ OwnPtr<CCGraphicsContext> ccContext(CCGraphicsContext::create3D(adoptPtr(new TrackingWebGraphicsContext3D)));
+ TrackingWebGraphicsContext3D* trackingWebGraphicsContext = static_cast<TrackingWebGraphicsContext3D*>(ccContext->context3D());
+ m_hostImpl->initializeLayerRenderer(ccContext.release(), UnthrottledUploader);
m_hostImpl->setRootLayer(rootLayer.release());
@@ -2395,11 +2378,11 @@ public:
TEST_F(CCLayerTreeHostImplTest, hasTransparentBackground)
{
- MockDrawQuadsToFillScreenContext* mockContext = new MockDrawQuadsToFillScreenContext();
- RefPtr<CCGraphicsContext> context = CCGraphicsContext::create3D(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(mockContext), GraphicsContext3D::RenderDirectlyToHostWindow));
+ OwnPtr<CCGraphicsContext> context = CCGraphicsContext::create3D(adoptPtr(new MockDrawQuadsToFillScreenContext));
+ MockDrawQuadsToFillScreenContext* mockContext = static_cast<MockDrawQuadsToFillScreenContext*>(context->context3D());
// Run test case
- OwnPtr<CCLayerTreeHostImpl> myHostImpl = createLayerTreeHost(false, context, CCLayerImpl::create(1));
+ OwnPtr<CCLayerTreeHostImpl> myHostImpl = createLayerTreeHost(false, context.release(), CCLayerImpl::create(1));
myHostImpl->setBackgroundColor(Color::white);
// Verify one quad is drawn when transparent background set is not set.
@@ -2422,21 +2405,21 @@ TEST_F(CCLayerTreeHostImplTest, hasTransparentBackground)
Mock::VerifyAndClearExpectations(&mockContext);
}
-static void setupLayersForTextureCaching(CCLayerTreeHostImpl* layerTreeHostImpl, CCLayerImpl*& rootPtr, CCLayerImpl*& intermediateLayerPtr, CCLayerImpl*& surfaceLayerPtr, CCLayerImpl*& childPtr)
+static void setupLayersForTextureCaching(CCLayerTreeHostImpl* layerTreeHostImpl, CCLayerImpl*& rootPtr, CCLayerImpl*& intermediateLayerPtr, CCLayerImpl*& surfaceLayerPtr, CCLayerImpl*& childPtr, const IntSize& rootSize)
{
- RefPtr<CCGraphicsContext> context = CCGraphicsContext::create3D(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new PartialSwapContext()), GraphicsContext3D::RenderDirectlyToHostWindow));
+ OwnPtr<CCGraphicsContext> context = CCGraphicsContext::create3D(adoptPtr(new PartialSwapContext));
layerTreeHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader);
- layerTreeHostImpl->setViewportSize(IntSize(100, 100));
+ layerTreeHostImpl->setViewportSize(rootSize);
OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
rootPtr = root.get();
root->setAnchorPoint(FloatPoint(0, 0));
root->setPosition(FloatPoint(0, 0));
- root->setBounds(IntSize(100, 100));
- root->setContentBounds(IntSize(100, 100));
- root->setVisibleLayerRect(IntRect(0, 0, 100, 100));
+ root->setBounds(rootSize);
+ root->setContentBounds(rootSize);
+ root->setVisibleLayerRect(IntRect(IntPoint(0, 0), rootSize));
root->setDrawsContent(true);
layerTreeHostImpl->setRootLayer(root.release());
@@ -2446,9 +2429,9 @@ static void setupLayersForTextureCaching(CCLayerTreeHostImpl* layerTreeHostImpl,
intermediateLayerPtr->setAnchorPoint(FloatPoint(0, 0));
intermediateLayerPtr->setPosition(FloatPoint(10, 10));
- intermediateLayerPtr->setBounds(IntSize(100, 100));
- intermediateLayerPtr->setContentBounds(IntSize(100, 100));
- intermediateLayerPtr->setVisibleLayerRect(IntRect(0, 0, 100, 100));
+ intermediateLayerPtr->setBounds(rootSize);
+ intermediateLayerPtr->setContentBounds(rootSize);
+ intermediateLayerPtr->setVisibleLayerRect(IntRect(IntPoint(0, 0), rootSize));
intermediateLayerPtr->setDrawsContent(false); // only children draw content
rootPtr->addChild(intermediateLayer.release());
@@ -2457,11 +2440,12 @@ static void setupLayersForTextureCaching(CCLayerTreeHostImpl* layerTreeHostImpl,
// Surface layer is the layer that changes its opacity
// It will contain other layers that draw content.
+ IntSize surfaceSize(rootSize.width(), rootSize.height());
surfaceLayerPtr->setAnchorPoint(FloatPoint(0, 0));
surfaceLayerPtr->setPosition(FloatPoint(10, 10));
- surfaceLayerPtr->setBounds(IntSize(50, 50));
- surfaceLayerPtr->setContentBounds(IntSize(50, 50));
- surfaceLayerPtr->setVisibleLayerRect(IntRect(0, 0, 50, 50));
+ surfaceLayerPtr->setBounds(surfaceSize);
+ surfaceLayerPtr->setContentBounds(surfaceSize);
+ surfaceLayerPtr->setVisibleLayerRect(IntRect(IntPoint(0, 0), surfaceSize));
surfaceLayerPtr->setDrawsContent(false); // only children draw content
surfaceLayerPtr->setOpacity(0.5f); // This will cause it to have a surface
intermediateLayerPtr->addChild(surfaceLayer.release());
@@ -2470,11 +2454,12 @@ static void setupLayersForTextureCaching(CCLayerTreeHostImpl* layerTreeHostImpl,
OwnPtr<FakeLayerWithQuads> child = FakeLayerWithQuads::create(4);
childPtr = child.get();
+ IntSize childSize(rootSize.width(), rootSize.height());
childPtr->setAnchorPoint(FloatPoint(0, 0));
childPtr->setPosition(FloatPoint(5, 5));
- childPtr->setBounds(IntSize(10, 10));
- childPtr->setContentBounds(IntSize(10, 10));
- childPtr->setVisibleLayerRect(IntRect(0, 0, 10, 10));
+ childPtr->setBounds(childSize);
+ childPtr->setContentBounds(childSize);
+ childPtr->setVisibleLayerRect(IntRect(IntPoint(0, 0), childSize));
childPtr->setDrawsContent(true);
surfaceLayerPtr->addChild(child.release());
@@ -2492,7 +2477,7 @@ TEST_F(CCLayerTreeHostImplTest, surfaceTextureCaching)
CCLayerImpl* surfaceLayerPtr;
CCLayerImpl* childPtr;
- setupLayersForTextureCaching(myHostImpl.get(), rootPtr, intermediateLayerPtr, surfaceLayerPtr, childPtr);
+ setupLayersForTextureCaching(myHostImpl.get(), rootPtr, intermediateLayerPtr, surfaceLayerPtr, childPtr, IntSize(100, 100));
{
CCLayerTreeHostImpl::FrameData frame;
@@ -2649,7 +2634,7 @@ TEST_F(CCLayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap)
CCLayerImpl* surfaceLayerPtr;
CCLayerImpl* childPtr;
- setupLayersForTextureCaching(myHostImpl.get(), rootPtr, intermediateLayerPtr, surfaceLayerPtr, childPtr);
+ setupLayersForTextureCaching(myHostImpl.get(), rootPtr, intermediateLayerPtr, surfaceLayerPtr, childPtr, IntSize(100, 100));
{
CCLayerTreeHostImpl::FrameData frame;
@@ -2796,6 +2781,80 @@ TEST_F(CCLayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap)
}
}
+// FIXME: This test is temporary until memory management in render surfaces gets refactored.
+// It depends on implementation of TextureManager and needs to get removed as
+// it will become meaningless with a different implementation.
+TEST_F(CCLayerTreeHostImplTest, surfaceTextureCachingMemoryLimit)
+{
+ CCSettings::setPartialSwapEnabled(true);
+
+ CCLayerTreeSettings settings;
+ OwnPtr<CCLayerTreeHostImpl> myHostImpl = CCLayerTreeHostImpl::create(settings, this);
+
+ CCLayerImpl* rootPtr;
+ CCLayerImpl* intermediateLayerPtr;
+ CCLayerImpl* surfaceLayerPtr;
+ CCLayerImpl* childPtr;
+
+ // FIXME: The number 4200 is the "magic" number which will cause render surface size
+ // to go above 64M. This will bring it above reclaimLimitBytes().
+ // We could compute this number from return value of reclaimLimitBytes(), however
+ // it takes a viewport, so it's no better as it still contains same kind of assumption
+ // (namely that reclaimLimitBytes() ignores viewport size).
+ IntSize largeSurfaceSize(4200, 4200);
+ setupLayersForTextureCaching(myHostImpl.get(), rootPtr, intermediateLayerPtr, surfaceLayerPtr, childPtr, largeSurfaceSize);
+
+ {
+ CCLayerTreeHostImpl::FrameData frame;
+ EXPECT_TRUE(myHostImpl->prepareToDraw(frame));
+
+ // Must receive two render passes, each with one quad
+ ASSERT_EQ(2U, frame.renderPasses.size());
+ EXPECT_EQ(1U, frame.renderPasses[0]->quadList().size());
+ EXPECT_EQ(1U, frame.renderPasses[1]->quadList().size());
+
+ EXPECT_EQ(CCDrawQuad::RenderPass, frame.renderPasses[1]->quadList()[0]->material());
+ CCRenderPassDrawQuad* quad = static_cast<CCRenderPassDrawQuad*>(frame.renderPasses[1]->quadList()[0].get());
+ EXPECT_TRUE(quad->renderPass()->targetSurface()->contentsChanged());
+
+ myHostImpl->drawLayers(frame);
+ myHostImpl->didDrawAllLayers(frame);
+ }
+
+ // Draw without any change
+ {
+ CCLayerTreeHostImpl::FrameData frame;
+ EXPECT_TRUE(myHostImpl->prepareToDraw(frame));
+
+ // Must receive two EMPTY render passes
+ ASSERT_EQ(2U, frame.renderPasses.size());
+ EXPECT_EQ(0U, frame.renderPasses[0]->quadList().size());
+ EXPECT_EQ(0U, frame.renderPasses[1]->quadList().size());
+
+ myHostImpl->drawLayers(frame);
+ myHostImpl->didDrawAllLayers(frame);
+ }
+
+ // Change opacity and draw.
+ // If all goes well, the texture must still be available, even though it's really big.
+ surfaceLayerPtr->setOpacity(0.6f);
+ {
+ CCLayerTreeHostImpl::FrameData frame;
+ EXPECT_TRUE(myHostImpl->prepareToDraw(frame));
+
+ // Must receive one render pass, as the other one should be culled
+ ASSERT_EQ(1U, frame.renderPasses.size());
+
+ EXPECT_EQ(1U, frame.renderPasses[0]->quadList().size());
+ EXPECT_EQ(CCDrawQuad::RenderPass, frame.renderPasses[0]->quadList()[0]->material());
+ CCRenderPassDrawQuad* quad = static_cast<CCRenderPassDrawQuad*>(frame.renderPasses[0]->quadList()[0].get());
+ EXPECT_FALSE(quad->renderPass()->targetSurface()->contentsChanged());
+
+ myHostImpl->drawLayers(frame);
+ myHostImpl->didDrawAllLayers(frame);
+ }
+}
+
struct RenderPassCacheEntry {
mutable OwnPtr<CCRenderPass> renderPassPtr;
CCRenderPass* renderPass;
diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
index d2773790e..7d14d38d5 100644
--- a/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
@@ -866,7 +866,7 @@ public:
virtual void layout()
{
LayerChromium* root = m_layerTreeHost->rootLayer();
- if (!m_layerTreeHost->frameNumber())
+ if (!m_layerTreeHost->commitNumber())
EXPECT_EQ(root->scrollPosition(), m_initialScroll);
else {
EXPECT_EQ(root->scrollPosition(), m_initialScroll + m_scrollAmount);
@@ -952,7 +952,7 @@ public:
root->setScrollable(true);
root->setMaxScrollPosition(IntSize(100, 100));
- if (!impl->sourceFrameNumber() && impl->frameNumber() == 1) {
+ if (!impl->sourceFrameNumber() && impl->sourceAnimationFrameNumber() == 1) {
// First draw after first commit.
EXPECT_EQ(root->scrollDelta(), IntSize());
root->scrollBy(m_scrollAmount);
@@ -960,7 +960,7 @@ public:
EXPECT_EQ(root->scrollPosition(), m_initialScroll);
postSetNeedsRedrawToMainThread();
- } else if (!impl->sourceFrameNumber() && impl->frameNumber() == 2) {
+ } else if (!impl->sourceFrameNumber() && impl->sourceAnimationFrameNumber() == 2) {
// Second draw after first commit.
EXPECT_EQ(root->scrollDelta(), m_scrollAmount);
root->scrollBy(m_scrollAmount);
@@ -970,7 +970,7 @@ public:
postSetNeedsCommitToMainThread();
} else if (impl->sourceFrameNumber() == 1) {
// Third or later draw after second commit.
- EXPECT_GE(impl->frameNumber(), 3);
+ EXPECT_GE(impl->sourceAnimationFrameNumber(), 3);
EXPECT_EQ(root->scrollDelta(), IntSize());
EXPECT_EQ(root->scrollPosition(), m_initialScroll + m_scrollAmount + m_scrollAmount);
endTest();
@@ -1369,7 +1369,7 @@ public:
virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl)
{
- CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(impl->context()->context3D()));
+ CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(impl->context()->context3D());
switch (impl->sourceFrameNumber()) {
case 0:
@@ -1403,7 +1403,7 @@ public:
virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl)
{
- CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(impl->context()->context3D()));
+ CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(impl->context()->context3D());
// Number of textures used for draw should always be one.
EXPECT_EQ(1, context->numUsedTextures());
@@ -1473,7 +1473,7 @@ public:
virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl)
{
- CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(impl->context()->context3D()));
+ CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(impl->context()->context3D());
switch (impl->sourceFrameNumber()) {
case 0:
@@ -1542,7 +1542,7 @@ public:
virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl)
{
- CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(impl->context()->context3D()));
+ CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(impl->context()->context3D());
// Number of textures used for drawing should two except for frame 4
// where the viewport only contains one layer.
@@ -2235,7 +2235,7 @@ public:
virtual void beginCommitOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE
{
EXPECT_EQ(m_rootScrollLayer->scrollPosition(), IntPoint());
- if (!m_layerTreeHost->frameNumber())
+ if (!m_layerTreeHost->commitNumber())
EXPECT_EQ(m_childLayer->scrollPosition(), IntPoint());
else
EXPECT_EQ(m_childLayer->scrollPosition(), IntPoint() + m_scrollAmount);
@@ -2243,11 +2243,11 @@ public:
virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE
{
- if (impl->frameNumber() == 1) {
+ if (impl->sourceAnimationFrameNumber() == 1) {
EXPECT_EQ(impl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
impl->scrollBy(m_scrollAmount);
impl->scrollEnd();
- } else if (impl->frameNumber() == 2)
+ } else if (impl->sourceAnimationFrameNumber() == 2)
endTest();
}
diff --git a/Source/WebKit/chromium/tests/CCSingleThreadProxyTest.cpp b/Source/WebKit/chromium/tests/CCSingleThreadProxyTest.cpp
deleted file mode 100644
index 4fe40f241..000000000
--- a/Source/WebKit/chromium/tests/CCSingleThreadProxyTest.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) 2011 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:
- * 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 "cc/CCSingleThreadProxy.h"
-
-#include "CCThreadedTest.h"
-#include "CompositorFakeWebGraphicsContext3D.h"
-#include "FakeWebGraphicsContext3D.h"
-#include "GraphicsContext3DPrivate.h"
-#include "platform/WebThread.h"
-
-using namespace WebCore;
-using namespace WebKit;
-using namespace WebKitTests;
-
-class FakeWebGraphicsContext3DMakeCurrentFails : public FakeWebGraphicsContext3D {
-public:
- virtual bool makeContextCurrent() { return false; }
-};
-
-class CCSingleThreadProxyTestInitializeLayerRendererFailsAfterAddAnimation : public CCThreadedTest {
-public:
- CCSingleThreadProxyTestInitializeLayerRendererFailsAfterAddAnimation()
- {
- }
-
- virtual void beginTest()
- {
- // This will cause the animation timer to be set which will fire in
- // CCSingleThreadProxy::animationTimerDelay() seconds.
- postAddAnimationToMainThread();
- }
-
- virtual void animateLayers(CCLayerTreeHostImpl* layerTreeHostImpl, double monotonicTime)
- {
- ASSERT_NOT_REACHED();
- }
-
- virtual void didRecreateContext(bool succeeded)
- {
- EXPECT_FALSE(succeeded);
-
- // Make sure we wait CCSingleThreadProxy::animationTimerDelay() seconds
- // (use ceil just to be sure). If the timer was not disabled, we will
- // attempt to call CCSingleThreadProxy::compositeImmediately and the
- // test will fail.
- endTestAfterDelay(ceil(CCSingleThreadProxy::animationTimerDelay() * 1000));
- }
-
- virtual PassRefPtr<GraphicsContext3D> createContext() OVERRIDE
- {
- return GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails), GraphicsContext3D::RenderDirectlyToHostWindow);
- }
-
- virtual void afterTest()
- {
- }
-};
-
-TEST_F(CCSingleThreadProxyTestInitializeLayerRendererFailsAfterAddAnimation, runSingleThread)
-{
- runTest(false);
-}
-
-class CCSingleThreadProxyTestDidAddAnimationBeforeInitializingLayerRenderer : public CCThreadedTest {
-public:
- CCSingleThreadProxyTestDidAddAnimationBeforeInitializingLayerRenderer()
- {
- }
-
- virtual void beginTest()
- {
- // This will cause the animation timer to be set which will fire in
- // CCSingleThreadProxy::animationTimerDelay() seconds.
- postDidAddAnimationToMainThread();
- }
-
- virtual void animateLayers(CCLayerTreeHostImpl*, double)
- {
- ASSERT_NOT_REACHED();
- }
-
- virtual void didRecreateContext(bool)
- {
- ASSERT_NOT_REACHED();
- }
-
- virtual void didAddAnimation()
- {
- // Make sure we wait CCSingleThreadProxy::animationTimerDelay() seconds
- // (use ceil just to be sure). If the timer was not disabled, we will
- // attempt to call CCSingleThreadProxy::compositeImmediately and the
- // test will fail.
- endTestAfterDelay(ceil(CCSingleThreadProxy::animationTimerDelay() * 1000));
- }
-
- virtual PassRefPtr<GraphicsContext3D> createContext() OVERRIDE
- {
- return GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails), GraphicsContext3D::RenderDirectlyToHostWindow);
- }
-
- virtual void afterTest()
- {
- }
-};
-
-TEST_F(CCSingleThreadProxyTestDidAddAnimationBeforeInitializingLayerRenderer, runSingleThread)
-{
- runTest(false);
-}
diff --git a/Source/WebKit/chromium/tests/CCThreadedTest.cpp b/Source/WebKit/chromium/tests/CCThreadedTest.cpp
index 57b6df14e..40d3ce5e6 100644
--- a/Source/WebKit/chromium/tests/CCThreadedTest.cpp
+++ b/Source/WebKit/chromium/tests/CCThreadedTest.cpp
@@ -103,14 +103,9 @@ CompositorFakeWebGraphicsContext3DWithTextureTracking::CompositorFakeWebGraphics
{
}
-PassRefPtr<GraphicsContext3D> TestHooks::createContext()
+PassOwnPtr<WebGraphicsContext3D> TestHooks::createContext()
{
- GraphicsContext3D::Attributes attrs;
- WebGraphicsContext3D::Attributes webAttrs;
- webAttrs.alpha = attrs.alpha;
-
- OwnPtr<WebGraphicsContext3D> webContext = CompositorFakeWebGraphicsContext3DWithTextureTracking::create(webAttrs);
- return GraphicsContext3DPrivate::createGraphicsContextFromWebContext(webContext.release(), GraphicsContext3D::RenderDirectlyToHostWindow);
+ return CompositorFakeWebGraphicsContext3DWithTextureTracking::create(WebGraphicsContext3D::Attributes());
}
PassOwnPtr<MockLayerTreeHostImpl> MockLayerTreeHostImpl::create(TestHooks* testHooks, const CCLayerTreeSettings& settings, CCLayerTreeHostImplClient* client)
@@ -232,7 +227,7 @@ public:
m_testHooks->applyScrollAndScale(scrollDelta, scale);
}
- virtual PassRefPtr<GraphicsContext3D> createContext3D() OVERRIDE
+ virtual PassOwnPtr<WebGraphicsContext3D> createContext3D() OVERRIDE
{
return m_testHooks->createContext();
}
diff --git a/Source/WebKit/chromium/tests/CCThreadedTest.h b/Source/WebKit/chromium/tests/CCThreadedTest.h
index c0ca44fee..75886effe 100644
--- a/Source/WebKit/chromium/tests/CCThreadedTest.h
+++ b/Source/WebKit/chromium/tests/CCThreadedTest.h
@@ -68,7 +68,7 @@ public:
virtual void notifyAnimationStarted(double time) { }
virtual void notifyAnimationFinished(double time) { }
- virtual PassRefPtr<WebCore::GraphicsContext3D> createContext();
+ virtual PassOwnPtr<WebKit::WebGraphicsContext3D> createContext();
};
class TimeoutTask;
diff --git a/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp b/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp
index bacf873fc..435907c94 100644
--- a/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp
+++ b/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp
@@ -74,15 +74,11 @@ class Canvas2DLayerBridgeTest : public Test {
protected:
void fullLifecycleTest(ThreadMode threadMode, DeferralMode deferralMode)
{
- GraphicsContext3D::Attributes attrs;
-
- RefPtr<GraphicsContext3D> mainContext = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new MockCanvasContext()), GraphicsContext3D::RenderDirectlyToHostWindow);
- RefPtr<CCGraphicsContext> ccMainContext = CCGraphicsContext::create3D(mainContext);
- RefPtr<GraphicsContext3D> implContext = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new MockCanvasContext()), GraphicsContext3D::RenderDirectlyToHostWindow);
- RefPtr<CCGraphicsContext> ccImplContext = CCGraphicsContext::create3D(implContext);
+ RefPtr<GraphicsContext3D> mainContext = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new MockCanvasContext));
+ OwnPtr<CCGraphicsContext> ccImplContext = CCGraphicsContext::create3D(adoptPtr(new MockCanvasContext));
MockCanvasContext& mainMock = *static_cast<MockCanvasContext*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(mainContext.get()));
- MockCanvasContext& implMock = *static_cast<MockCanvasContext*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(implContext.get()));
+ MockCanvasContext& implMock = *static_cast<MockCanvasContext*>(ccImplContext->context3D());
MockWebTextureUpdater updater;
@@ -151,7 +147,7 @@ TEST(Canvas2DLayerBridgeTest2, testClearClient)
{
GraphicsContext3D::Attributes attrs;
- RefPtr<GraphicsContext3D> mainContext = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new MockCanvasContext()), GraphicsContext3D::RenderDirectlyToHostWindow);
+ RefPtr<GraphicsContext3D> mainContext = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new MockCanvasContext));
OwnPtr<Canvas2DLayerBridge> bridge = Canvas2DLayerBridge::create(mainContext.get(), IntSize(100, 100), Deferred, 1);
RefPtr<LayerChromium> layer = bridge->layer();
bridge.clear();
diff --git a/Source/WebKit/chromium/tests/DrawingBufferChromiumTest.cpp b/Source/WebKit/chromium/tests/DrawingBufferChromiumTest.cpp
deleted file mode 100644
index 27ef49281..000000000
--- a/Source/WebKit/chromium/tests/DrawingBufferChromiumTest.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 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 "DrawingBuffer.h"
-
-#include "CompositorFakeGraphicsContext3D.h"
-#include "LayerChromium.h"
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-
-using namespace WebCore;
-using namespace WebKit;
-
-namespace {
-
-TEST(DrawingBufferChromiumTest, opaqueFormats)
-{
- RefPtr<DrawingBuffer> buffer;
-
- GraphicsContext3D::Attributes alphaAttrs;
- alphaAttrs.alpha = true;
- GraphicsContext3D::Attributes opaqueAttrs;
- opaqueAttrs.alpha = false;
-
- RefPtr<GraphicsContext3D> alphaContext = createCompositorMockGraphicsContext3D(alphaAttrs);
- EXPECT_TRUE(alphaContext);
- RefPtr<GraphicsContext3D> opaqueContext = createCompositorMockGraphicsContext3D(opaqueAttrs);
- EXPECT_TRUE(opaqueContext);
-
- buffer = DrawingBuffer::create(alphaContext.get(), IntSize(), DrawingBuffer::Preserve, DrawingBuffer::Alpha);
- EXPECT_FALSE(buffer->platformLayer()->opaque());
- buffer = DrawingBuffer::create(alphaContext.get(), IntSize(), DrawingBuffer::Discard, DrawingBuffer::Alpha);
- EXPECT_FALSE(buffer->platformLayer()->opaque());
-
- buffer = DrawingBuffer::create(opaqueContext.get(), IntSize(), DrawingBuffer::Preserve, DrawingBuffer::Opaque);
- EXPECT_TRUE(buffer->platformLayer()->opaque());
- buffer = DrawingBuffer::create(opaqueContext.get(), IntSize(), DrawingBuffer::Discard, DrawingBuffer::Opaque);
- EXPECT_TRUE(buffer->platformLayer()->opaque());
-}
-
-} // namespace
diff --git a/Source/WebKit/chromium/tests/FakeCCLayerTreeHostClient.h b/Source/WebKit/chromium/tests/FakeCCLayerTreeHostClient.h
index 6ab616d3c..0b3c3fe9e 100755
--- a/Source/WebKit/chromium/tests/FakeCCLayerTreeHostClient.h
+++ b/Source/WebKit/chromium/tests/FakeCCLayerTreeHostClient.h
@@ -27,8 +27,8 @@
#include "config.h"
+#include "CompositorFakeWebGraphicsContext3D.h"
#include "cc/CCLayerTreeHost.h"
-#include "CompositorFakeGraphicsContext3D.h"
namespace WebCore {
@@ -39,10 +39,10 @@ public:
virtual void updateAnimations(double monotonicFrameBeginTime) OVERRIDE { }
virtual void layout() OVERRIDE { }
virtual void applyScrollAndScale(const IntSize& scrollDelta, float pageScale) OVERRIDE { }
- virtual PassRefPtr<GraphicsContext3D> createContext3D() OVERRIDE
+ virtual PassOwnPtr<WebKit::WebGraphicsContext3D> createContext3D() OVERRIDE
{
- GraphicsContext3D::Attributes attrs;
- return createCompositorMockGraphicsContext3D(attrs);
+ WebKit::WebGraphicsContext3D::Attributes attrs;
+ return WebKit::CompositorFakeWebGraphicsContext3D::create(WebKit::WebGraphicsContext3D::Attributes());
}
virtual void didRecreateContext(bool success) OVERRIDE { }
virtual void willCommit() OVERRIDE { }
diff --git a/Source/WebKit/chromium/tests/FakeGraphicsContext3DTest.cpp b/Source/WebKit/chromium/tests/FakeGraphicsContext3DTest.cpp
index 71cb8bab1..720630e17 100644
--- a/Source/WebKit/chromium/tests/FakeGraphicsContext3DTest.cpp
+++ b/Source/WebKit/chromium/tests/FakeGraphicsContext3DTest.cpp
@@ -25,10 +25,7 @@
#include "config.h"
-#include "GraphicsContext3D.h"
-
#include "FakeWebGraphicsContext3D.h"
-#include "GraphicsContext3DPrivate.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
@@ -36,57 +33,6 @@
using namespace WebCore;
using namespace WebKit;
-class FrameCountingContext : public FakeWebGraphicsContext3D {
-public:
- FrameCountingContext() : m_frame(0) { }
-
- // This method would normally do a glSwapBuffers under the hood.
- virtual void prepareTexture() { m_frame++; }
-
- int frameCount() { return m_frame; }
-
-private:
- int m_frame;
-};
-
-TEST(FakeGraphicsContext3DTest, CanOverrideManually)
-{
- GraphicsContext3D::Attributes attrs;
- RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FrameCountingContext()), GraphicsContext3D::RenderDirectlyToHostWindow);
- FrameCountingContext& mockContext = *static_cast<FrameCountingContext*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(context.get()));
-
- for (int i = 0; i < 10; i++) {
- context->clearColor(0, 0, 0, 1);
- context->prepareTexture();
- }
- context->finish();
-
- EXPECT_EQ(10, mockContext.frameCount());
-}
-
-
-class GMockContext : public FakeWebGraphicsContext3D {
-public:
- MOCK_METHOD0(getError, WGC3Denum());
-};
-
-TEST(FakeGraphicsContext3DTest, CanUseGMock)
-{
- GraphicsContext3D::Attributes attrs;
- RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new GMockContext()), GraphicsContext3D::RenderDirectlyToHostWindow);
- GMockContext& mockContext = *static_cast<GMockContext*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(context.get()));
-
- EXPECT_CALL(mockContext, getError())
- .WillRepeatedly(testing::Return(314));
-
- // It's OK to call methods GMock doesn't know about.
- context->makeContextCurrent();
-
- // Check that the mocked method is returning as intended.
- for (int i = 0; i < 10; i++)
- EXPECT_EQ((int)context->getError(), 314);
-}
-
class ContextThatCountsMakeCurrents : public FakeWebGraphicsContext3D {
public:
ContextThatCountsMakeCurrents() : m_makeCurrentCount(0) { }
@@ -101,21 +47,10 @@ private:
};
-TEST(FakeGraphicsContext3DTest, ContextForThisThreadShouldNotMakeCurrent)
-{
- GraphicsContext3D::Attributes attrs;
- RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new ContextThatCountsMakeCurrents()), GraphicsContext3D::RenderDirectlyToHostWindow);
- EXPECT_TRUE(context);
- ContextThatCountsMakeCurrents& mockContext = *static_cast<ContextThatCountsMakeCurrents*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(context.get()));
- EXPECT_EQ(0, mockContext.makeCurrentCount());
-}
-
-TEST(FakeGraphicsContext3DTest, ContextForAnotherThreadShouldNotMakeCurrent)
+TEST(FakeGraphicsContext3DTest, ContextCreationShouldNotMakeCurrent)
{
- GraphicsContext3D::Attributes attrs;
- RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new ContextThatCountsMakeCurrents()), GraphicsContext3D::RenderDirectlyToHostWindow);
+ OwnPtr<ContextThatCountsMakeCurrents> context(adoptPtr(new ContextThatCountsMakeCurrents));
EXPECT_TRUE(context);
- ContextThatCountsMakeCurrents& mockContext = *static_cast<ContextThatCountsMakeCurrents*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(context.get()));
- EXPECT_EQ(0, mockContext.makeCurrentCount());
+ EXPECT_EQ(0, context->makeCurrentCount());
}
diff --git a/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp
index 410c45d78..1979d935c 100644
--- a/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp
@@ -27,7 +27,7 @@
#include "GraphicsLayerChromium.h"
#include "CCAnimationTestCommon.h"
-#include "CompositorFakeGraphicsContext3D.h"
+#include "CompositorFakeWebGraphicsContext3D.h"
#include "GraphicsContext3D.h"
#include "GraphicsContext3DPrivate.h"
#include "GraphicsLayer.h"
@@ -42,6 +42,7 @@
#include "cc/CCSingleThreadProxy.h"
#include <gtest/gtest.h>
+#include <public/WebGraphicsContext3D.h>
#include <wtf/PassOwnPtr.h>
using namespace WebCore;
@@ -67,10 +68,9 @@ public:
virtual void updateAnimations(double frameBeginTime) OVERRIDE { }
virtual void layout() OVERRIDE { }
virtual void applyScrollAndScale(const IntSize& scrollDelta, float pageScale) OVERRIDE { }
- virtual PassRefPtr<GraphicsContext3D> createContext3D() OVERRIDE
+ virtual PassOwnPtr<WebGraphicsContext3D> createContext3D() OVERRIDE
{
- GraphicsContext3D::Attributes attrs;
- return createCompositorMockGraphicsContext3D(attrs);
+ return CompositorFakeWebGraphicsContext3D::create(WebGraphicsContext3D::Attributes());
}
virtual void didRecreateContext(bool success) OVERRIDE { }
virtual void willCommit() OVERRIDE { }
diff --git a/Source/WebKit/chromium/tests/LayerChromiumTest.cpp b/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
index cd4fcc340..4a92b1509 100644
--- a/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
@@ -813,4 +813,20 @@ TEST(LayerChromiumLayerTreeHostTest, replaceMaskAndReplicaLayer)
WebKit::WebCompositor::shutdown();
}
+class MockLayerChromium : public LayerChromium {
+public:
+ bool needsDisplay() const { return m_needsDisplay; }
+};
+
+TEST(LayerChromiumTestWithoutFixture, setBoundsTriggersSetNeedsRedrawAfterGettingNonEmptyBounds)
+{
+ RefPtr<MockLayerChromium> layer(adoptRef(new MockLayerChromium));
+ EXPECT_FALSE(layer->needsDisplay());
+ layer->setBounds(IntSize(0, 10));
+ EXPECT_FALSE(layer->needsDisplay());
+ layer->setBounds(IntSize(10, 10));
+ EXPECT_TRUE(layer->needsDisplay());
+}
+
+
} // namespace
diff --git a/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp b/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp
index e4650961b..cfdcdc156 100644
--- a/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp
@@ -28,7 +28,6 @@
#include "CCTestCommon.h"
#include "FakeWebGraphicsContext3D.h"
#include "GraphicsContext3D.h"
-#include "GraphicsContext3DPrivate.h"
#include "WebCompositor.h"
#include "cc/CCDrawQuad.h"
#include "cc/CCSettings.h"
@@ -109,7 +108,7 @@ private:
class FakeLayerRendererChromium : public LayerRendererChromium {
public:
- FakeLayerRendererChromium(CCRendererClient* client, PassRefPtr<GraphicsContext3D> context) : LayerRendererChromium(client, context, UnthrottledUploader) { }
+ FakeLayerRendererChromium(CCRendererClient* client, WebGraphicsContext3D* context) : LayerRendererChromium(client, context, UnthrottledUploader) { }
// LayerRendererChromium methods.
@@ -123,9 +122,8 @@ protected:
LayerRendererChromiumTest()
: m_suggestHaveBackbufferYes(1, true)
, m_suggestHaveBackbufferNo(1, false)
- , m_context(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FrameCountingMemoryAllocationSettingContext()), GraphicsContext3D::RenderDirectlyToHostWindow))
- , m_mockContext(*static_cast<FrameCountingMemoryAllocationSettingContext*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(m_context.get())))
- , m_layerRendererChromium(&m_mockClient, m_context.release())
+ , m_context(adoptPtr(new FrameCountingMemoryAllocationSettingContext))
+ , m_layerRendererChromium(&m_mockClient, m_context.get())
{
}
@@ -148,8 +146,7 @@ protected:
WebGraphicsMemoryAllocation m_suggestHaveBackbufferYes;
WebGraphicsMemoryAllocation m_suggestHaveBackbufferNo;
- RefPtr<GraphicsContext3D> m_context;
- FrameCountingMemoryAllocationSettingContext& m_mockContext;
+ OwnPtr<FrameCountingMemoryAllocationSettingContext> m_context;
FakeCCRendererClient m_mockClient;
FakeLayerRendererChromium m_layerRendererChromium;
CCScopedSettings m_scopedSettings;
@@ -160,12 +157,12 @@ protected:
// Expected: it does nothing.
TEST_F(LayerRendererChromiumTest, SuggestBackbufferYesWhenItAlreadyExistsShouldDoNothing)
{
- m_mockContext.setMemoryAllocation(m_suggestHaveBackbufferYes);
+ m_context->setMemoryAllocation(m_suggestHaveBackbufferYes);
EXPECT_EQ(0, m_mockClient.setFullRootLayerDamageCount());
EXPECT_FALSE(m_layerRendererChromium.isFramebufferDiscarded());
swapBuffers();
- EXPECT_EQ(1, m_mockContext.frameCount());
+ EXPECT_EQ(1, m_context->frameCount());
}
// Test LayerRendererChromium discardFramebuffer functionality:
@@ -174,7 +171,7 @@ TEST_F(LayerRendererChromiumTest, SuggestBackbufferYesWhenItAlreadyExistsShouldD
TEST_F(LayerRendererChromiumTest, SuggestBackbufferNoShouldDiscardBackbufferAndDamageRootLayerWhileNotVisible)
{
m_layerRendererChromium.setVisible(false);
- m_mockContext.setMemoryAllocation(m_suggestHaveBackbufferNo);
+ m_context->setMemoryAllocation(m_suggestHaveBackbufferNo);
EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount());
EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded());
}
@@ -185,7 +182,7 @@ TEST_F(LayerRendererChromiumTest, SuggestBackbufferNoShouldDiscardBackbufferAndD
TEST_F(LayerRendererChromiumTest, SuggestBackbufferNoDoNothingWhenVisible)
{
m_layerRendererChromium.setVisible(true);
- m_mockContext.setMemoryAllocation(m_suggestHaveBackbufferNo);
+ m_context->setMemoryAllocation(m_suggestHaveBackbufferNo);
EXPECT_EQ(0, m_mockClient.setFullRootLayerDamageCount());
EXPECT_FALSE(m_layerRendererChromium.isFramebufferDiscarded());
}
@@ -197,11 +194,11 @@ TEST_F(LayerRendererChromiumTest, SuggestBackbufferNoDoNothingWhenVisible)
TEST_F(LayerRendererChromiumTest, SuggestBackbufferNoWhenItDoesntExistShouldDoNothing)
{
m_layerRendererChromium.setVisible(false);
- m_mockContext.setMemoryAllocation(m_suggestHaveBackbufferNo);
+ m_context->setMemoryAllocation(m_suggestHaveBackbufferNo);
EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount());
EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded());
- m_mockContext.setMemoryAllocation(m_suggestHaveBackbufferNo);
+ m_context->setMemoryAllocation(m_suggestHaveBackbufferNo);
EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount());
EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded());
}
@@ -212,7 +209,7 @@ TEST_F(LayerRendererChromiumTest, SuggestBackbufferNoWhenItDoesntExistShouldDoNo
TEST_F(LayerRendererChromiumTest, DiscardedBackbufferIsRecreatedForScopeDuration)
{
m_layerRendererChromium.setVisible(false);
- m_mockContext.setMemoryAllocation(m_suggestHaveBackbufferNo);
+ m_context->setMemoryAllocation(m_suggestHaveBackbufferNo);
EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded());
EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount());
@@ -221,13 +218,13 @@ TEST_F(LayerRendererChromiumTest, DiscardedBackbufferIsRecreatedForScopeDuration
EXPECT_FALSE(m_layerRendererChromium.isFramebufferDiscarded());
swapBuffers();
- EXPECT_EQ(1, m_mockContext.frameCount());
+ EXPECT_EQ(1, m_context->frameCount());
}
TEST_F(LayerRendererChromiumTest, FramebufferDiscardedAfterReadbackWhenNotVisible)
{
m_layerRendererChromium.setVisible(false);
- m_mockContext.setMemoryAllocation(m_suggestHaveBackbufferNo);
+ m_context->setMemoryAllocation(m_suggestHaveBackbufferNo);
EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded());
EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount());
@@ -311,7 +308,8 @@ TEST(LayerRendererChromiumTest2, initializationDoesNotMakeSynchronousCalls)
{
CCScopedSettings scopedSettings;
FakeCCRendererClient mockClient;
- FakeLayerRendererChromium layerRendererChromium(&mockClient, GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new ForbidSynchronousCallContext), GraphicsContext3D::RenderDirectlyToHostWindow));
+ OwnPtr<WebGraphicsContext3D> context(adoptPtr(new ForbidSynchronousCallContext));
+ FakeLayerRendererChromium layerRendererChromium(&mockClient, context.get());
EXPECT_TRUE(layerRendererChromium.initialize());
}
@@ -353,7 +351,8 @@ TEST(LayerRendererChromiumTest2, initializationWithQuicklyLostContextDoesNotAsse
{
CCScopedSettings scopedSettings;
FakeCCRendererClient mockClient;
- FakeLayerRendererChromium layerRendererChromium(&mockClient, GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new LoseContextOnFirstGetContext), GraphicsContext3D::RenderDirectlyToHostWindow));
+ OwnPtr<WebGraphicsContext3D> context(adoptPtr(new LoseContextOnFirstGetContext));
+ FakeLayerRendererChromium layerRendererChromium(&mockClient, context.get());
layerRendererChromium.initialize();
}
@@ -373,7 +372,8 @@ public:
TEST(LayerRendererChromiumTest2, initializationWithoutGpuMemoryManagerExtensionSupportShouldDefaultToNonZeroAllocation)
{
FakeCCRendererClient mockClient;
- FakeLayerRendererChromium layerRendererChromium(&mockClient, GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new ContextThatDoesNotSupportMemoryManagmentExtensions), GraphicsContext3D::RenderDirectlyToHostWindow));
+ OwnPtr<WebGraphicsContext3D> context(adoptPtr(new ContextThatDoesNotSupportMemoryManagmentExtensions));
+ FakeLayerRendererChromium layerRendererChromium(&mockClient, context.get());
layerRendererChromium.initialize();
@@ -398,8 +398,8 @@ private:
TEST(LayerRendererChromiumTest2, opaqueBackground)
{
FakeCCRendererClient mockClient;
- RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new ClearCountingContext), GraphicsContext3D::RenderDirectlyToHostWindow);
- FakeLayerRendererChromium layerRendererChromium(&mockClient, context);
+ OwnPtr<ClearCountingContext> context(adoptPtr(new ClearCountingContext));
+ FakeLayerRendererChromium layerRendererChromium(&mockClient, context.get());
mockClient.rootRenderPass()->setHasTransparentBackground(false);
@@ -412,17 +412,17 @@ TEST(LayerRendererChromiumTest2, opaqueBackground)
// On DEBUG builds, render passes with opaque background clear to blue to
// easily see regions that were not drawn on the screen.
#if defined(NDEBUG)
- EXPECT_EQ(0, static_cast<ClearCountingContext*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(context.get()))->clearCount());
+ EXPECT_EQ(0, context->clearCount());
#else
- EXPECT_EQ(1, static_cast<ClearCountingContext*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(context.get()))->clearCount());
+ EXPECT_EQ(1, context->clearCount());
#endif
}
TEST(LayerRendererChromiumTest2, transparentBackground)
{
FakeCCRendererClient mockClient;
- RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new ClearCountingContext), GraphicsContext3D::RenderDirectlyToHostWindow);
- FakeLayerRendererChromium layerRendererChromium(&mockClient, context);
+ OwnPtr<ClearCountingContext> context(adoptPtr(new ClearCountingContext));
+ FakeLayerRendererChromium layerRendererChromium(&mockClient, context.get());
mockClient.rootRenderPass()->setHasTransparentBackground(true);
@@ -432,5 +432,5 @@ TEST(LayerRendererChromiumTest2, transparentBackground)
layerRendererChromium.drawRenderPass(mockClient.rootRenderPass(), FloatRect());
layerRendererChromium.finishDrawingFrame();
- EXPECT_EQ(1, static_cast<ClearCountingContext*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(context.get()))->clearCount());
+ EXPECT_EQ(1, context->clearCount());
}
diff --git a/Source/WebKit/chromium/tests/TextureCopierTest.cpp b/Source/WebKit/chromium/tests/TextureCopierTest.cpp
index d71b8ce45..2c90c4ed5 100644
--- a/Source/WebKit/chromium/tests/TextureCopierTest.cpp
+++ b/Source/WebKit/chromium/tests/TextureCopierTest.cpp
@@ -52,9 +52,8 @@ public:
TEST(TextureCopierTest, testDrawArraysCopy)
{
GraphicsContext3D::Attributes attrs;
- RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new MockContext()), GraphicsContext3D::RenderDirectlyToHostWindow);
- MockContext& mockContext = *static_cast<MockContext*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(context.get()));
- RefPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(context);
+ OwnPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(adoptPtr(new MockContext));
+ MockContext& mockContext = *static_cast<MockContext*>(ccContext->context3D());
{
InSequence sequence;
@@ -79,7 +78,7 @@ TEST(TextureCopierTest, testDrawArraysCopy)
int sourceTextureId = 1;
int destTextureId = 2;
IntSize size(256, 128);
- OwnPtr<AcceleratedTextureCopier> copier(AcceleratedTextureCopier::create(context));
+ OwnPtr<AcceleratedTextureCopier> copier(AcceleratedTextureCopier::create(ccContext->context3D()));
copier->copyTexture(ccContext.get(), sourceTextureId, destTextureId, size);
}
diff --git a/Source/WebKit/chromium/tests/ThrottledTextureUploaderTest.cpp b/Source/WebKit/chromium/tests/ThrottledTextureUploaderTest.cpp
index 4b0dfd059..39a57d131 100644
--- a/Source/WebKit/chromium/tests/ThrottledTextureUploaderTest.cpp
+++ b/Source/WebKit/chromium/tests/ThrottledTextureUploaderTest.cpp
@@ -65,11 +65,10 @@ private:
TEST(ThrottledTextureUploaderTest, IsBusy)
{
GraphicsContext3D::Attributes attrs;
- RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FakeWebGraphicsContext3DWithQueryTesting()), GraphicsContext3D::RenderDirectlyToHostWindow);
- FakeWebGraphicsContext3DWithQueryTesting& fakeContext = *static_cast<FakeWebGraphicsContext3DWithQueryTesting*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(context.get()));
- OwnPtr<ThrottledTextureUploader> uploader = ThrottledTextureUploader::create(context, 2);
+ OwnPtr<FakeWebGraphicsContext3DWithQueryTesting> fakeContext(adoptPtr(new FakeWebGraphicsContext3DWithQueryTesting));
+ OwnPtr<ThrottledTextureUploader> uploader = ThrottledTextureUploader::create(fakeContext.get(), 2);
- fakeContext.setResultAvailable(0);
+ fakeContext->setResultAvailable(0);
EXPECT_FALSE(uploader->isBusy());
uploader->beginUploads();
uploader->endUploads();
@@ -78,7 +77,7 @@ TEST(ThrottledTextureUploaderTest, IsBusy)
uploader->endUploads();
EXPECT_TRUE(uploader->isBusy());
- fakeContext.setResultAvailable(1);
+ fakeContext->setResultAvailable(1);
EXPECT_FALSE(uploader->isBusy());
uploader->beginUploads();
uploader->endUploads();
diff --git a/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
index 9495e706a..04b3c382e 100644
--- a/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
@@ -673,8 +673,7 @@ TEST(TiledLayerChromiumTest, invalidateFromPrepare)
FakeTextureAllocator fakeAllocator;
FakeTextureCopier fakeCopier;
FakeTextureUploader fakeUploader;
- RefPtr<GraphicsContext3D> context = createCompositorMockGraphicsContext3D(GraphicsContext3D::Attributes());
- RefPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(context);
+ OwnPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(WebKit::CompositorFakeWebGraphicsContext3D::create(WebKit::WebGraphicsContext3D::Attributes()));
// The tile size is 100x100, so this invalidates and then paints two tiles.
layer->setBounds(IntSize(100, 200));
diff --git a/Source/WebKit/chromium/tests/WebFrameTest.cpp b/Source/WebKit/chromium/tests/WebFrameTest.cpp
index 40705808d..4e2b0c5ea 100644
--- a/Source/WebKit/chromium/tests/WebFrameTest.cpp
+++ b/Source/WebKit/chromium/tests/WebFrameTest.cpp
@@ -284,6 +284,28 @@ TEST_F(WebFrameTest, FixedLayoutInitializeAtMinimumPageScale)
}
#endif
+TEST_F(WebFrameTest, CanOverrideMaximumScaleFactor)
+{
+ registerMockedHttpURLLoad("no_scale_for_you.html");
+
+ FixedLayoutTestWebViewClient client;
+ client.m_screenInfo.horizontalDPI = 160;
+ int viewportWidth = 640;
+ int viewportHeight = 480;
+ client.m_windowRect = WebRect(0, 0, viewportWidth, viewportHeight);
+
+ WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "no_scale_for_you.html", true, 0, &client));
+ webViewImpl->enableFixedLayoutMode(true);
+ webViewImpl->settings()->setViewportEnabled(true);
+ webViewImpl->resize(WebSize(viewportWidth, viewportHeight));
+
+ EXPECT_EQ(1.0f, webViewImpl->maximumPageScaleFactor());
+
+ webViewImpl->setIgnoreViewportTagMaximumScale(true);
+
+ EXPECT_EQ(4.0f, webViewImpl->maximumPageScaleFactor());
+}
+
#if ENABLE(GESTURE_EVENTS)
TEST_F(WebFrameTest, DivAutoZoomParamsTest)
{
diff --git a/Source/WebKit/chromium/tests/data/no_scale_for_you.html b/Source/WebKit/chromium/tests/data/no_scale_for_you.html
new file mode 100644
index 000000000..86bac2cab
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/no_scale_for_you.html
@@ -0,0 +1 @@
+<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" >
diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog
index 2273bb34c..2a675753b 100644
--- a/Source/WebKit/efl/ChangeLog
+++ b/Source/WebKit/efl/ChangeLog
@@ -1,3 +1,38 @@
+2012-06-26 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Change return type in bandwidth attribute of network information API
+ https://bugs.webkit.org/show_bug.cgi?id=89959
+
+ Reviewed by Adam Barth.
+
+ According to network information API spec, bandwidth attribute should return double type.
+ But, existing implementation has used *long* and *unsigned int* types.
+
+ * WebCoreSupport/NetworkInfoClientEfl.cpp:
+ (WebCore::NetworkInfoClientEfl::bandwidth):
+ * WebCoreSupport/NetworkInfoClientEfl.h:
+ (NetworkInfoClientEfl):
+
+2012-06-25 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ [EFL] Implement Network Information API
+ https://bugs.webkit.org/show_bug.cgi?id=87067
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Implement NetworkInfoClientEfl.cpp using eeze library. However, this patch only
+ supports this feature on ethernet interface.
+
+ * WebCoreSupport/NetworkInfoClientEfl.cpp:
+ (WebCore):
+ (WebCore::NetworkInfoClientEfl::NetworkInfoClientEfl):
+ (WebCore::NetworkInfoClientEfl::startUpdating):
+ (WebCore::NetworkInfoClientEfl::stopUpdating):
+ (WebCore::NetworkInfoClientEfl::bandwidth):
+ (WebCore::NetworkInfoClientEfl::metered):
+ * WebCoreSupport/NetworkInfoClientEfl.h:
+ (NetworkInfoClientEfl):
+
2012-06-23 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r121058.
diff --git a/Source/WebKit/efl/WebCoreSupport/NetworkInfoClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/NetworkInfoClientEfl.cpp
index 66d5a0046..67e9c16bd 100644
--- a/Source/WebKit/efl/WebCoreSupport/NetworkInfoClientEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/NetworkInfoClientEfl.cpp
@@ -31,12 +31,20 @@
#if ENABLE(NETWORK_INFO)
#include "NetworkInfo.h"
#include "NotImplemented.h"
+
+#include "ewk_private.h"
+#include <Eeze.h>
+#include <Eeze_Net.h>
#include <wtf/text/CString.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
+
+static const char* ethernetInterface = "eth0";
+
NetworkInfoClientEfl::NetworkInfoClientEfl()
: m_controller(0)
+ , m_metered(false)
{
}
@@ -46,24 +54,51 @@ NetworkInfoClientEfl::~NetworkInfoClientEfl()
void NetworkInfoClientEfl::startUpdating()
{
- notImplemented();
+ if (!eeze_init()) {
+ ERR("Fail to start network information client.");
+ return;
+ }
}
void NetworkInfoClientEfl::stopUpdating()
{
- notImplemented();
+ eeze_shutdown();
}
-unsigned int NetworkInfoClientEfl::bandwidth() const
+double NetworkInfoClientEfl::bandwidth() const
{
- notImplemented();
- return 10; // MB/s
+ // FIXME : This function should consider cellular network as well. For example, 2G, 3G and 4G.
+ // See https://bugs.webkit.org/show_bug.cgi?id=89851 for detail.
+ Eeze_Net* ethNet = eeze_net_new(ethernetInterface);
+ if (!ethNet)
+ return 0;
+
+ eeze_net_scan(ethNet);
+
+ // FIXME : The eeze library doesn't support EEZE_NET_ADDR_TYPE_IP type yet. So, EEZE_NET_ADDR_TYPE_BROADCAST
+ // is used for now.
+ // See https://bugs.webkit.org/show_bug.cgi?id=89852 for detail.
+ const char* address = eeze_net_addr_get(ethNet, EEZE_NET_ADDR_TYPE_BROADCAST);
+ if (!address)
+ return 0; // If network is offline, return 0.
+
+ double bandwidth;
+ const char* attribute = eeze_net_attribute_get(ethNet, "speed");
+ if (attribute) {
+ bool ok;
+ bandwidth = String::fromUTF8(attribute).toUIntStrict(&ok);
+ } else
+ bandwidth = std::numeric_limits<double>::infinity(); // If bandwidth is unknown, return infinity value.
+
+ eeze_net_free(ethNet);
+
+ return bandwidth / 8; // MB/s
}
bool NetworkInfoClientEfl::metered() const
{
notImplemented();
- return false;
+ return m_metered;
}
}
diff --git a/Source/WebKit/efl/WebCoreSupport/NetworkInfoClientEfl.h b/Source/WebKit/efl/WebCoreSupport/NetworkInfoClientEfl.h
index 979710369..838f34b04 100644
--- a/Source/WebKit/efl/WebCoreSupport/NetworkInfoClientEfl.h
+++ b/Source/WebKit/efl/WebCoreSupport/NetworkInfoClientEfl.h
@@ -41,12 +41,13 @@ public:
virtual void startUpdating();
virtual void stopUpdating();
- virtual unsigned int bandwidth() const;
+ virtual double bandwidth() const;
virtual bool metered() const;
private:
-
NetworkInfoController* m_controller;
+
+ bool m_metered;
};
}
diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog
index 0d08434c9..f2478d5a2 100644
--- a/Source/WebKit/gtk/ChangeLog
+++ b/Source/WebKit/gtk/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-25 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Unreviewed. Update NEWS and configure.ac for 1.9.4 release
+
+ * NEWS: Added release notes for 1.9.4.
+
2012-06-23 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r121058.
diff --git a/Source/WebKit/gtk/NEWS b/Source/WebKit/gtk/NEWS
index 349a6c634..046cdf51e 100644
--- a/Source/WebKit/gtk/NEWS
+++ b/Source/WebKit/gtk/NEWS
@@ -1,4 +1,28 @@
=================
+WebKitGTK+ 1.9.4
+=================
+
+What's new in WebKitGTK+ 1.9.4?
+
+ - Add an accelerated compositing implementation for WebKit2.
+ - Add API to register custom URI schemes to WebKit2 GTK+ API.
+ - Add support for window.showModalDialog in WebKit2 GTK+ API.
+ - Add webkit_download_get_received_data_length to WebKit2 GTK+ API.
+ - Add ContextMenu API to WebKit2 GTK+.
+ - Add Geolocation permission requests API to WebKit2 GTK.
+ - Add API to get the library version to WebKit2 GTK+.
+ - Add WebKitWebView::run-file-chooser signal to WebKit1 API.
+ - Port the video sink to GStreamer 0.11 API.
+ - Add TextureMapper ImageBuffer support as a fallback from the
+ hardware accelerated path
+ - Add input methods submenu item to the default context menu for
+ editable content.
+ - Unmark highlighted text matches when find operation finishes.
+ - Honor the device scale factor property when drawing.
+ - Prevent setting or editing httpOnly cookies from JavaScript.
+ - Fix several memory leaks.
+
+=================
WebKitGTK+ 1.9.3
=================
diff --git a/Source/WebKit/qt/Api/qwebsettings.cpp b/Source/WebKit/qt/Api/qwebsettings.cpp
index d25141720..a540dc35f 100644
--- a/Source/WebKit/qt/Api/qwebsettings.cpp
+++ b/Source/WebKit/qt/Api/qwebsettings.cpp
@@ -174,6 +174,9 @@ void QWebSettingsPrivate::apply()
value = attributes.value(QWebSettings::CSSRegionsEnabled,
global->attributes.value(QWebSettings::CSSRegionsEnabled));
settings->setCSSRegionsEnabled(value);
+ value = attributes.value(QWebSettings::CSSGridLayoutEnabled,
+ global->attributes.value(QWebSettings::CSSGridLayoutEnabled));
+ settings->setCSSGridLayoutEnabled(value);
value = attributes.value(QWebSettings::HyperlinkAuditingEnabled,
global->attributes.value(QWebSettings::HyperlinkAuditingEnabled));
@@ -522,6 +525,7 @@ QWebSettings::QWebSettings()
d->attributes.insert(QWebSettings::AcceleratedCompositingEnabled, true);
d->attributes.insert(QWebSettings::WebGLEnabled, false);
d->attributes.insert(QWebSettings::CSSRegionsEnabled, false);
+ d->attributes.insert(QWebSettings::CSSGridLayoutEnabled, false);
d->attributes.insert(QWebSettings::HyperlinkAuditingEnabled, false);
d->attributes.insert(QWebSettings::TiledBackingStoreEnabled, false);
d->attributes.insert(QWebSettings::FrameFlatteningEnabled, false);
diff --git a/Source/WebKit/qt/Api/qwebsettings.h b/Source/WebKit/qt/Api/qwebsettings.h
index 0aee525b0..2e07356f2 100644
--- a/Source/WebKit/qt/Api/qwebsettings.h
+++ b/Source/WebKit/qt/Api/qwebsettings.h
@@ -78,7 +78,8 @@ public:
JavascriptCanCloseWindows,
WebGLEnabled,
CSSRegionsEnabled,
- HyperlinkAuditingEnabled
+ HyperlinkAuditingEnabled,
+ CSSGridLayoutEnabled
};
enum WebGraphic {
MissingImageGraphic,
diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog
index d8a1e5c11..8789ec929 100644
--- a/Source/WebKit/qt/ChangeLog
+++ b/Source/WebKit/qt/ChangeLog
@@ -1,3 +1,39 @@
+2012-06-27 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Fix compilation of example platform plugin with Qt 5
+
+ Reviewed by Kenneth Christiansen.
+
+ Use QLatin1String where appropriate and use the Qt 5 plugin
+ system with Qt 5.
+
+ * examples/platformplugin/WebPlugin.cpp:
+ (SingleSelectionPopup::SingleSelectionPopup):
+ (MultipleItemListDelegate::MultipleItemListDelegate):
+ (MultipleSelectionPopup::MultipleSelectionPopup):
+ * examples/platformplugin/WebPlugin.h:
+ (WebPlugin):
+
+2012-06-26 Tony Chang <tony@chromium.org>
+
+ [Qt] Enable grid layout LayoutTests
+ https://bugs.webkit.org/show_bug.cgi?id=89909
+
+ Reviewed by Csaba Osztrogonác.
+
+ These tests pass, we just need to hook up the overridePreference.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::QWebSettings):
+ * Api/qwebsettings.h: Add enum value for CSS grid layout
+
+2012-06-25 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed build fix: Don't do QT += widgets with Qt 4
+
+ * examples/platformplugin/platformplugin.pro:
+
2012-06-23 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r121058.
diff --git a/Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp b/Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp
index b3ff4c132..fdd990f57 100644
--- a/Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp
+++ b/Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp
@@ -126,7 +126,7 @@ SingleSelectionPopup::SingleSelectionPopup(const QWebSelectData& data)
if (qstrcmp(title, "weba_ti_texlist_single"))
setWindowTitle(QString::fromUtf8(title));
else
- setWindowTitle("Select item");
+ setWindowTitle(QLatin1String("Select item"));
QHBoxLayout* hLayout = new QHBoxLayout(this);
hLayout->setContentsMargins(0, 0, 0, 0);
@@ -150,7 +150,7 @@ public:
MultipleItemListDelegate(QObject* parent = 0)
: QStyledItemDelegate(parent)
{
- tickMark = QIcon::fromTheme("widgets_tickmark_list").pixmap(48, 48);
+ tickMark = QIcon::fromTheme(QLatin1String("widgets_tickmark_list")).pixmap(48, 48);
}
void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
@@ -172,7 +172,7 @@ MultipleSelectionPopup::MultipleSelectionPopup(const QWebSelectData& data)
if (qstrcmp(title, "weba_ti_textlist_multi"))
setWindowTitle(QString::fromUtf8(title));
else
- setWindowTitle("Select items");
+ setWindowTitle(QLatin1String("Select items"));
QHBoxLayout* hLayout = new QHBoxLayout(this);
hLayout->setContentsMargins(0, 0, 0, 0);
@@ -197,7 +197,7 @@ MultipleSelectionPopup::MultipleSelectionPopup(const QWebSelectData& data)
if (qstrcmp(title, "wdgt_bd_done"))
done->setText(QString::fromUtf8(title));
else
- done->setText("Done");
+ done->setText(QLatin1String("Done"));
done->setMinimumWidth(178);
vLayout->addWidget(done);
@@ -315,4 +315,6 @@ QObject* WebPlugin::createExtension(Extension extension) const
}
}
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(platformplugin, WebPlugin)
+#endif
diff --git a/Source/WebKit/qt/examples/platformplugin/WebPlugin.h b/Source/WebKit/qt/examples/platformplugin/WebPlugin.h
index 782d1ef05..74bc2eccc 100644
--- a/Source/WebKit/qt/examples/platformplugin/WebPlugin.h
+++ b/Source/WebKit/qt/examples/platformplugin/WebPlugin.h
@@ -137,6 +137,9 @@ class WebPlugin : public QObject, public QWebKitPlatformPlugin
{
Q_OBJECT
Q_INTERFACES(QWebKitPlatformPlugin)
+#if QT_VERSION >= 0x050000
+ Q_PLUGIN_METADATA(IID "org.qt-project.QtWebKit.PlatformPluginInterface")
+#endif
public:
virtual bool supportsExtension(Extension extension) const;
virtual QObject* createExtension(Extension extension) const;
diff --git a/Source/WebKit/qt/examples/platformplugin/platformplugin.pro b/Source/WebKit/qt/examples/platformplugin/platformplugin.pro
index fc533d3bb..b5da71ca0 100644
--- a/Source/WebKit/qt/examples/platformplugin/platformplugin.pro
+++ b/Source/WebKit/qt/examples/platformplugin/platformplugin.pro
@@ -1,7 +1,8 @@
TEMPLATE = lib
TARGET = platformplugin
-QT += core gui widgets
+QT += core gui
+haveQt(5): QT += widgets
CONFIG += plugin
## load mobilityconfig if mobility is available
diff --git a/Source/WebKit2/CMakeLists.txt b/Source/WebKit2/CMakeLists.txt
index 51f7ec1d7..d40ba848a 100644
--- a/Source/WebKit2/CMakeLists.txt
+++ b/Source/WebKit2/CMakeLists.txt
@@ -209,7 +209,7 @@ SET(WebKit2_SOURCES
UIProcess/FindIndicator.cpp
UIProcess/GeolocationPermissionRequestManagerProxy.cpp
UIProcess/GeolocationPermissionRequestProxy.cpp
- UIProcess/LayerTreeHostProxy.cpp
+ UIProcess/LayerTreeCoordinatorProxy.cpp
UIProcess/ResponsivenessTimer.cpp
UIProcess/VisitedLinkProvider.cpp
UIProcess/WebApplicationCacheManagerProxy.cpp
@@ -409,7 +409,6 @@ SET(WebKit2_SOURCES
WebProcess/WebCoreSupport/WebEditorClient.cpp
WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
WebProcess/WebCoreSupport/WebGeolocationClient.cpp
- WebProcess/WebCoreSupport/WebGraphicsLayer.cpp
WebProcess/WebCoreSupport/WebInspectorClient.cpp
WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp
WebProcess/WebCoreSupport/WebNotificationClient.cpp
@@ -423,6 +422,7 @@ SET(WebKit2_SOURCES
WebProcess/WebPage/EncoderAdapter.cpp
WebProcess/WebPage/EventDispatcher.cpp
WebProcess/WebPage/FindController.cpp
+ WebProcess/WebPage/LayerTreeCoordinator/WebGraphicsLayer.cpp
WebProcess/WebPage/LayerTreeHost.cpp
WebProcess/WebPage/PageOverlay.cpp
WebProcess/WebPage/TapHighlightController.cpp
@@ -445,7 +445,7 @@ SET(WebKit2_MESSAGES_IN_FILES
Shared/Plugins/NPObjectMessageReceiver.messages.in
UIProcess/DrawingAreaProxy.messages.in
- UIProcess/LayerTreeHostProxy.messages.in
+ UIProcess/LayerTreeCoordinatorProxy.messages.in
UIProcess/WebApplicationCacheManagerProxy.messages.in
UIProcess/WebContext.messages.in
UIProcess/WebCookieManagerProxy.messages.in
@@ -495,7 +495,7 @@ SET(WebKit2_MESSAGES_IN_FILES
WebProcess/WebPage/DrawingArea.messages.in
WebProcess/WebPage/EventDispatcher.messages.in
- WebProcess/WebPage/LayerTreeHost.messages.in
+ WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.messages.in
WebProcess/WebPage/WebInspector.messages.in
WebProcess/WebPage/WebPage.messages.in
)
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index c0fd9d104..d92c0297c 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,334 @@
+2012-06-26 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Avoid use of deprecated Qt API
+
+ Reviewed by Tor Arne Vestbø.
+
+ QGuiApplication::inputPanel() has been deprecated in favour of
+ inputMethod().
+
+ * UIProcess/qt/QtWebPageEventHandler.cpp:
+ (WebKit::QtWebPageEventHandler::QtWebPageEventHandler):
+ (WebKit::QtWebPageEventHandler::~QtWebPageEventHandler):
+ (WebKit::setInputPanelVisible):
+ (WebKit::QtWebPageEventHandler::inputPanelVisibleChanged):
+ (WebKit::QtWebPageEventHandler::updateTextInputState):
+
+2012-06-26 Christophe Dumez <christophe.dumez@intel.com>
+
+ [WK2][GTK] Uninitialized variable in TextCheckerGtk.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=89948
+
+ Reviewed by Martin Robinson.
+
+ Properly initialize didInitializeState in
+ TextChecker::state().
+
+ * UIProcess/gtk/TextCheckerGtk.cpp:
+ (WebKit::TextChecker::state):
+
+2012-06-25 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Make it possible to build WebKit without QtWidgets
+ https://bugs.webkit.org/show_bug.cgi?id=78109
+
+ Reviewed by Tor Arne Vestbø.
+
+ * WebKit2.pri: Add missing WK2 specific dependencies.
+ * qt/MainQt.cpp: Do the QStyle initialization hook only if we are
+ compiling with QtWidgets support.
+ (WebKit):
+ (main):
+
+2012-06-25 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [EFL][WK2] Include unistd.h in PlatformProcessIdentifier.h.
+ https://bugs.webkit.org/show_bug.cgi?id=89804
+
+ Reviewed by Hajime Morita.
+
+ The pid_t typedef ends up coming from stdlib.h (indirectly via WTF
+ includes) on Mac and Linux, even though that is not mandated by
+ POSIX and breaks other platforms (such as FreeBSD). Fix that by
+ explicitly including unistd.h, which is where the typedef is
+ supposed to come from.
+
+ * Platform/PlatformProcessIdentifier.h:
+
+2012-06-25 YoungTaeck Song <youngtaeck.song@samsung.com>
+
+ [WK2][Qt][EFL] Extract common code from LayerTreeHostQt
+ https://bugs.webkit.org/show_bug.cgi?id=89837
+
+ Reviewed by Noam Rosenthal.
+
+ Extract common code from LayerTreeHostQt to be used by both Qt and Efl.
+ I renamed LayerTreeHost to LayerTreeCoordinator, and these are moved under WebProcess/WebPage/LayerTreeCoordinator.
+ I Modified LayerTreeHostProxy to LayerTreeCoordinatorProxy too, Because LayerTreeHostProxy and LayerTreeHost were pair.
+ Also WebGraphicsLayer moved under that directory.
+
+ * CMakeLists.txt:
+ * DerivedSources.pri:
+ * GNUmakefile.list.am:
+ * Platform/CoreIPC/MessageID.h:
+ * Target.pri:
+ * UIProcess/API/qt/qquickwebpage.cpp:
+ (QQuickWebPagePrivate::paint):
+ (QQuickWebPage::updatePaintNode):
+ (QQuickWebPagePrivate::updateSize):
+ * UIProcess/DrawingAreaProxy.cpp:
+ (WebKit::DrawingAreaProxy::didReceiveLayerTreeCoordinatorProxyMessage):
+ * UIProcess/DrawingAreaProxy.h:
+ (WebKit):
+ (WebKit::DrawingAreaProxy::layerTreeCoordinatorProxy):
+ (DrawingAreaProxy):
+ * UIProcess/DrawingAreaProxyImpl.cpp:
+ (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
+ (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
+ (WebKit::DrawingAreaProxyImpl::didReceiveLayerTreeCoordinatorProxyMessage):
+ (WebKit::DrawingAreaProxyImpl::setVisibleContentsRect):
+ * UIProcess/DrawingAreaProxyImpl.h:
+ (WebKit):
+ (DrawingAreaProxyImpl):
+ * UIProcess/LayerTreeCoordinatorProxy.cpp: Renamed from Source/WebKit2/UIProcess/LayerTreeHostProxy.cpp.
+ (WebKit):
+ (WebKit::LayerTreeCoordinatorProxy::LayerTreeCoordinatorProxy):
+ (WebKit::LayerTreeCoordinatorProxy::~LayerTreeCoordinatorProxy):
+ (WebKit::LayerTreeCoordinatorProxy::updateViewport):
+ (WebKit::LayerTreeCoordinatorProxy::dispatchUpdate):
+ (WebKit::LayerTreeCoordinatorProxy::createTileForLayer):
+ (WebKit::LayerTreeCoordinatorProxy::updateTileForLayer):
+ (WebKit::LayerTreeCoordinatorProxy::removeTileForLayer):
+ (WebKit::LayerTreeCoordinatorProxy::deleteCompositingLayer):
+ (WebKit::LayerTreeCoordinatorProxy::setRootCompositingLayer):
+ (WebKit::LayerTreeCoordinatorProxy::setCompositingLayerState):
+ (WebKit::LayerTreeCoordinatorProxy::setCompositingLayerChildren):
+ (WebKit::LayerTreeCoordinatorProxy::setCompositingLayerFilters):
+ (WebKit::LayerTreeCoordinatorProxy::didRenderFrame):
+ (WebKit::LayerTreeCoordinatorProxy::createDirectlyCompositedImage):
+ (WebKit::LayerTreeCoordinatorProxy::destroyDirectlyCompositedImage):
+ (WebKit::LayerTreeCoordinatorProxy::setContentsSize):
+ (WebKit::LayerTreeCoordinatorProxy::setVisibleContentsRect):
+ (WebKit::LayerTreeCoordinatorProxy::renderNextFrame):
+ (WebKit::LayerTreeCoordinatorProxy::didChangeScrollPosition):
+ (WebKit::LayerTreeCoordinatorProxy::syncCanvas):
+ (WebKit::LayerTreeCoordinatorProxy::purgeBackingStores):
+ * UIProcess/LayerTreeCoordinatorProxy.h: Renamed from Source/WebKit2/UIProcess/LayerTreeHostProxy.h.
+ (WebKit):
+ (LayerTreeCoordinatorProxy):
+ (WebKit::LayerTreeCoordinatorProxy::layerTreeRenderer):
+ * UIProcess/LayerTreeCoordinatorProxy.messages.in: Renamed from Source/WebKit2/UIProcess/LayerTreeHostProxy.messages.in.
+ * UIProcess/WebLayerTreeRenderer.cpp:
+ (WebKit::WebLayerTreeRenderer::WebLayerTreeRenderer):
+ (WebKit::WebLayerTreeRenderer::updateViewport):
+ (WebKit::WebLayerTreeRenderer::renderNextFrame):
+ (WebKit::WebLayerTreeRenderer::purgeBackingStores):
+ (WebKit::WebLayerTreeRenderer::detach):
+ * UIProcess/WebLayerTreeRenderer.h:
+ (WebKit):
+ (WebLayerTreeRenderer):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::didReceiveMessage):
+ * WebKit2.pri:
+ * WebProcess/WebPage/DrawingArea.h:
+ (DrawingArea):
+ * WebProcess/WebPage/DrawingAreaImpl.cpp:
+ (WebKit::DrawingAreaImpl::didReceiveLayerTreeCoordinatorMessage):
+ * WebProcess/WebPage/DrawingAreaImpl.h:
+ (DrawingAreaImpl):
+ * WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp.
+ (WebKit):
+ (WebKit::LayerTreeCoordinator::create):
+ (WebKit::LayerTreeCoordinator::~LayerTreeCoordinator):
+ (WebKit::LayerTreeCoordinator::LayerTreeCoordinator):
+ (WebKit::LayerTreeCoordinator::setLayerFlushSchedulingEnabled):
+ (WebKit::LayerTreeCoordinator::scheduleLayerFlush):
+ (WebKit::LayerTreeCoordinator::cancelPendingLayerFlush):
+ (WebKit::LayerTreeCoordinator::setShouldNotifyAfterNextScheduledLayerFlush):
+ (WebKit::LayerTreeCoordinator::setRootCompositingLayer):
+ (WebKit::LayerTreeCoordinator::invalidate):
+ (WebKit::LayerTreeCoordinator::setNonCompositedContentsNeedDisplay):
+ (WebKit::LayerTreeCoordinator::scrollNonCompositedContents):
+ (WebKit::LayerTreeCoordinator::forceRepaint):
+ (WebKit::LayerTreeCoordinator::sizeDidChange):
+ (WebKit::LayerTreeCoordinator::didInstallPageOverlay):
+ (WebKit::LayerTreeCoordinator::didUninstallPageOverlay):
+ (WebKit::LayerTreeCoordinator::setPageOverlayNeedsDisplay):
+ (WebKit::LayerTreeCoordinator::setPageOverlayOpacity):
+ (WebKit::LayerTreeCoordinator::flushPendingLayerChanges):
+ (WebKit::LayerTreeCoordinator::syncLayerState):
+ (WebKit::LayerTreeCoordinator::syncLayerChildren):
+ (WebKit::LayerTreeCoordinator::syncCanvas):
+ (WebKit::LayerTreeCoordinator::syncLayerFilters):
+ (WebKit::LayerTreeCoordinator::attachLayer):
+ (WebKit::LayerTreeCoordinator::detachLayer):
+ (WebKit::updateOffsetFromViewportForSelf):
+ (WebKit::updateOffsetFromViewportForLayer):
+ (WebKit::LayerTreeCoordinator::syncFixedLayers):
+ (WebKit::LayerTreeCoordinator::performScheduledLayerFlush):
+ (WebKit::LayerTreeCoordinator::layerFlushTimerFired):
+ (WebKit::LayerTreeCoordinator::createPageOverlayLayer):
+ (WebKit::LayerTreeCoordinator::destroyPageOverlayLayer):
+ (WebKit::LayerTreeCoordinator::adoptImageBackingStore):
+ (WebKit::LayerTreeCoordinator::releaseImageBackingStore):
+ (WebKit::LayerTreeCoordinator::notifyAnimationStarted):
+ (WebKit::LayerTreeCoordinator::notifySyncRequired):
+ (WebKit::LayerTreeCoordinator::paintContents):
+ (WebKit::LayerTreeCoordinator::showDebugBorders):
+ (WebKit::LayerTreeCoordinator::showRepaintCounter):
+ (WebKit::LayerTreeHost::supportsAcceleratedCompositing):
+ (WebKit::LayerTreeCoordinator::createTile):
+ (WebKit::LayerTreeCoordinator::updateTile):
+ (WebKit::LayerTreeCoordinator::removeTile):
+ (WebKit::LayerTreeCoordinator::visibleContentsRect):
+ (WebKit::LayerTreeCoordinator::setVisibleContentsRect):
+ (WebKit::LayerTreeCoordinator::renderNextFrame):
+ (WebKit::LayerTreeCoordinator::layerTreeTileUpdatesAllowed):
+ (WebKit::LayerTreeCoordinator::purgeBackingStores):
+ (WebKit::LayerTreeCoordinator::beginContentUpdate):
+ * WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.h: Renamed from Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.h.
+ (WebKit):
+ (LayerTreeCoordinator):
+ (WebKit::LayerTreeCoordinator::layerTreeContext):
+ (WebKit::LayerTreeCoordinator::pageOverlayShouldApplyFadeWhenPainting):
+ (WebKit::LayerTreeCoordinator::pauseRendering):
+ (WebKit::LayerTreeCoordinator::resumeRendering):
+ (WebKit::LayerTreeCoordinator::deviceScaleFactorDidChange):
+ * WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.messages.in: Renamed from Source/WebKit2/WebProcess/WebPage/LayerTreeHost.messages.in.
+ * WebProcess/WebPage/LayerTreeCoordinator/WebGraphicsLayer.cpp: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp.
+ (WebCore):
+ (WebCore::layerByIDMap):
+ (WebCore::WebGraphicsLayer::layerByID):
+ (WebCore::toWebLayerID):
+ (WebCore::WebGraphicsLayer::didChangeLayerState):
+ (WebCore::WebGraphicsLayer::didChangeChildren):
+ (WebCore::WebGraphicsLayer::didChangeFilters):
+ (WebCore::WebGraphicsLayer::setShouldUpdateVisibleRect):
+ (WebCore::WebGraphicsLayer::didChangeGeometry):
+ (WebCore::WebGraphicsLayer::WebGraphicsLayer):
+ (WebCore::WebGraphicsLayer::~WebGraphicsLayer):
+ (WebCore::WebGraphicsLayer::willBeDestroyed):
+ (WebCore::WebGraphicsLayer::setChildren):
+ (WebCore::WebGraphicsLayer::addChild):
+ (WebCore::WebGraphicsLayer::addChildAtIndex):
+ (WebCore::WebGraphicsLayer::addChildAbove):
+ (WebCore::WebGraphicsLayer::addChildBelow):
+ (WebCore::WebGraphicsLayer::replaceChild):
+ (WebCore::WebGraphicsLayer::removeFromParent):
+ (WebCore::WebGraphicsLayer::setPosition):
+ (WebCore::WebGraphicsLayer::setAnchorPoint):
+ (WebCore::WebGraphicsLayer::setSize):
+ (WebCore::WebGraphicsLayer::setTransform):
+ (WebCore::WebGraphicsLayer::setChildrenTransform):
+ (WebCore::WebGraphicsLayer::setPreserves3D):
+ (WebCore::WebGraphicsLayer::setMasksToBounds):
+ (WebCore::WebGraphicsLayer::setDrawsContent):
+ (WebCore::WebGraphicsLayer::setContentsOpaque):
+ (WebCore::WebGraphicsLayer::setBackfaceVisibility):
+ (WebCore::WebGraphicsLayer::setOpacity):
+ (WebCore::WebGraphicsLayer::setContentsRect):
+ (WebCore::WebGraphicsLayer::setContentsNeedsDisplay):
+ (WebCore::WebGraphicsLayer::setContentsToCanvas):
+ (WebCore::WebGraphicsLayer::setFilters):
+ (WebCore::WebGraphicsLayer::setContentsToImage):
+ (WebCore::WebGraphicsLayer::setMaskLayer):
+ (WebCore::WebGraphicsLayer::setReplicatedByLayer):
+ (WebCore::WebGraphicsLayer::setNeedsDisplay):
+ (WebCore::WebGraphicsLayer::setNeedsDisplayInRect):
+ (WebCore::WebGraphicsLayer::id):
+ (WebCore::WebGraphicsLayer::syncCompositingState):
+ (WebCore::toWebGraphicsLayer):
+ (WebCore::WebGraphicsLayer::syncChildren):
+ (WebCore::WebGraphicsLayer::syncFilters):
+ (WebCore::WebGraphicsLayer::syncLayerState):
+ (WebCore::WebGraphicsLayer::syncCanvas):
+ (WebCore::WebGraphicsLayer::ensureImageBackingStore):
+ (WebCore::WebGraphicsLayer::syncCompositingStateForThisLayerOnly):
+ (WebCore::WebGraphicsLayer::tiledBackingStorePaintBegin):
+ (WebCore::WebGraphicsLayer::setRootLayer):
+ (WebCore::WebGraphicsLayer::setVisibleContentRectTrajectoryVector):
+ (WebCore::WebGraphicsLayer::setContentsScale):
+ (WebCore::WebGraphicsLayer::effectiveContentsScale):
+ (WebCore::WebGraphicsLayer::adjustContentsScale):
+ (WebCore::WebGraphicsLayer::createBackingStore):
+ (WebCore::WebGraphicsLayer::tiledBackingStorePaint):
+ (WebCore::WebGraphicsLayer::tiledBackingStorePaintEnd):
+ (WebCore::WebGraphicsLayer::tiledBackingStoreUpdatesAllowed):
+ (WebCore::WebGraphicsLayer::tiledBackingStoreContentsRect):
+ (WebCore::WebGraphicsLayer::shouldUseTiledBackingStore):
+ (WebCore::WebGraphicsLayer::tiledBackingStoreVisibleRect):
+ (WebCore::WebGraphicsLayer::tiledBackingStoreBackgroundColor):
+ (WebCore::WebGraphicsLayer::beginContentUpdate):
+ (WebCore::WebGraphicsLayer::createTile):
+ (WebCore::WebGraphicsLayer::updateTile):
+ (WebCore::WebGraphicsLayer::removeTile):
+ (WebCore::WebGraphicsLayer::updateContentBuffers):
+ (WebCore::WebGraphicsLayer::purgeBackingStores):
+ (WebCore::WebGraphicsLayer::setWebGraphicsLayerClient):
+ (WebCore::WebGraphicsLayer::adjustVisibleRect):
+ (WebCore::WebGraphicsLayer::computeTransformedVisibleRect):
+ (WebCore::createWebGraphicsLayer):
+ (WebCore::WebGraphicsLayer::initFactory):
+ (WebCore::WebGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
+ * WebProcess/WebPage/LayerTreeCoordinator/WebGraphicsLayer.h: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h.
+ (WebCore):
+ (WebKit):
+ (WebGraphicsLayerClient):
+ (WebGraphicsLayer):
+ (WebCore::WebGraphicsLayer::image):
+ (WebCore::WebGraphicsLayer::fixedToViewport):
+ (WebCore::WebGraphicsLayer::setFixedToViewport):
+ (WebCore::WebGraphicsLayer::maskTarget):
+ (WebCore::WebGraphicsLayer::setMaskTarget):
+ * WebProcess/WebPage/LayerTreeHost.cpp:
+ (WebKit::LayerTreeHost::create):
+ * WebProcess/WebPage/LayerTreeHost.h:
+ (LayerTreeHost):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::didReceiveMessage):
+
+2012-06-25 Anders Carlsson <andersca@apple.com>
+
+ [Lion WK2] fast/loader/reload-zero-byte-plugin.html hits assert
+ https://bugs.webkit.org/show_bug.cgi?id=89611
+ <rdar://problem/11714023>
+
+ Reviewed by Sam Weinig.
+
+ Make sure to send the response along to the plug-in in the case where the stream was empty.
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::finishedLoading):
+
+2012-06-25 YoungTaeck Song <youngtaeck.song@samsung.com>
+
+ [WK2][Qt][EFL] Move LayerBackingStore into common directory
+ https://bugs.webkit.org/show_bug.cgi?id=89838
+
+ Reviewed by Noam Rosenthal.
+
+ Move LayerBackingStore into 'Source/WebKit2/UIProcess/texmap' to be used by both Qt and Efl.
+
+ * Target.pri:
+ * UIProcess/texmap/LayerBackingStore.cpp: Renamed from Source/WebKit2/UIProcess/qt/LayerBackingStore.cpp.
+ (WebKit):
+ (WebKit::LayerBackingStoreTile::swapBuffers):
+ (WebKit::LayerBackingStoreTile::setBackBuffer):
+ (WebKit::LayerBackingStore::createTile):
+ (WebKit::LayerBackingStore::removeTile):
+ (WebKit::LayerBackingStore::updateTile):
+ (WebKit::LayerBackingStore::texture):
+ (WebKit::LayerBackingStore::paintToTextureMapper):
+ (WebKit::LayerBackingStore::commitTileOperations):
+ * UIProcess/texmap/LayerBackingStore.h: Renamed from Source/WebKit2/UIProcess/qt/LayerBackingStore.h.
+ (WebKit):
+ (LayerBackingStoreTile):
+ (WebKit::LayerBackingStoreTile::LayerBackingStoreTile):
+ (WebKit::LayerBackingStoreTile::scale):
+ (LayerBackingStore):
+ (WebKit::LayerBackingStore::create):
+ (WebKit::LayerBackingStore::LayerBackingStore):
+
2012-06-25 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Test /webkit2/WebKitWebView/permission-requests fails due to a runtime warning
diff --git a/Source/WebKit2/DerivedSources.pri b/Source/WebKit2/DerivedSources.pri
index 0a50c7dad..319bf7e14 100644
--- a/Source/WebKit2/DerivedSources.pri
+++ b/Source/WebKit2/DerivedSources.pri
@@ -63,7 +63,7 @@ MESSAGE_RECEIVERS = \
DownloadProxy.messages.in \
DrawingAreaProxy.messages.in \
EventDispatcher.messages.in \
- LayerTreeHostProxy.messages.in \
+ LayerTreeCoordinatorProxy.messages.in \
PluginControllerProxy.messages.in \
PluginProcess.messages.in \
PluginProcessConnection.messages.in \
@@ -90,7 +90,7 @@ MESSAGE_RECEIVERS = \
WebFullScreenManager.messages.in \
WebFullScreenManagerProxy.messages.in \
WebPage/DrawingArea.messages.in \
- WebPage/LayerTreeHost.messages.in \
+ WebPage/LayerTreeCoordinator/LayerTreeCoordinator.messages.in \
WebPage/WebInspector.messages.in \
WebPage/WebPage.messages.in \
WebPageProxy.messages.in \
diff --git a/Source/WebKit2/GNUmakefile.list.am b/Source/WebKit2/GNUmakefile.list.am
index a6bc70d84..836dad601 100644
--- a/Source/WebKit2/GNUmakefile.list.am
+++ b/Source/WebKit2/GNUmakefile.list.am
@@ -133,8 +133,8 @@ webkit2_built_sources += \
DerivedSources/WebKit2/DrawingAreaProxyMessages.h \
DerivedSources/WebKit2/EventDispatcherMessageReceiver.cpp \
DerivedSources/WebKit2/EventDispatcherMessages.h \
- DerivedSources/WebKit2/LayerTreeHostProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/LayerTreeHostProxyMessages.h \
+ DerivedSources/WebKit2/LayerTreeCoordinatorProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/LayerTreeCoordinatorProxyMessages.h \
DerivedSources/WebKit2/NPObjectMessageReceiverMessageReceiver.cpp \
DerivedSources/WebKit2/NPObjectMessageReceiverMessages.h \
DerivedSources/WebKit2/PluginControllerProxyMessageReceiver.cpp \
diff --git a/Source/WebKit2/Platform/CoreIPC/MessageID.h b/Source/WebKit2/Platform/CoreIPC/MessageID.h
index 5f398aa8d..d923a1be2 100644
--- a/Source/WebKit2/Platform/CoreIPC/MessageID.h
+++ b/Source/WebKit2/Platform/CoreIPC/MessageID.h
@@ -38,7 +38,7 @@ enum MessageClass {
MessageClassAuthenticationManager,
MessageClassDrawingArea,
MessageClassInjectedBundle,
- MessageClassLayerTreeHost,
+ MessageClassLayerTreeCoordinator,
MessageClassWebApplicationCacheManager,
MessageClassWebCookieManager,
MessageClassWebDatabaseManager,
@@ -60,7 +60,7 @@ enum MessageClass {
// Messages sent by the web process to the UI process.
MessageClassDownloadProxy,
MessageClassDrawingAreaProxy,
- MessageClassLayerTreeHostProxy,
+ MessageClassLayerTreeCoordinatorProxy,
MessageClassWebApplicationCacheManagerProxy,
MessageClassWebContext,
MessageClassWebContextLegacy,
diff --git a/Source/WebKit2/Platform/PlatformProcessIdentifier.h b/Source/WebKit2/Platform/PlatformProcessIdentifier.h
index 9cafd3294..96ecbe872 100644
--- a/Source/WebKit2/Platform/PlatformProcessIdentifier.h
+++ b/Source/WebKit2/Platform/PlatformProcessIdentifier.h
@@ -29,6 +29,8 @@
#if PLATFORM(QT)
class QProcess;
+#elif PLATFORM(EFL)
+#include <unistd.h>
#endif
namespace WebKit {
diff --git a/Source/WebKit2/Target.pri b/Source/WebKit2/Target.pri
index 7b9ab99ef..3799d85fe 100644
--- a/Source/WebKit2/Target.pri
+++ b/Source/WebKit2/Target.pri
@@ -214,7 +214,7 @@ HEADERS += \
UIProcess/GeolocationPermissionRequestProxy.h \
UIProcess/Launcher/ProcessLauncher.h \
UIProcess/Launcher/ThreadLauncher.h \
- UIProcess/LayerTreeHostProxy.h \
+ UIProcess/LayerTreeCoordinatorProxy.h \
UIProcess/Notifications/NotificationPermissionRequest.h \
UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h \
UIProcess/Notifications/WebNotification.h \
@@ -273,7 +273,6 @@ HEADERS += \
UIProcess/WebResourceCacheManagerProxy.h \
UIProcess/WebResourceLoadClient.h \
UIProcess/WebUIClient.h \
- UIProcess/qt/LayerBackingStore.h \
UIProcess/qt/QtWebContext.h \
UIProcess/qt/QtWebPageEventHandler.h \
UIProcess/qt/QtGestureRecognizer.h \
@@ -294,6 +293,7 @@ HEADERS += \
UIProcess/qt/WebContextMenuProxyQt.h \
UIProcess/qt/WebGeolocationProviderQt.h \
UIProcess/qt/WebPopupMenuProxyQt.h \
+ UIProcess/texmap/LayerBackingStore.h \
WebProcess/ApplicationCache/WebApplicationCacheManager.h \
WebProcess/Authentication/AuthenticationManager.h \
WebProcess/Cookies/WebCookieManager.h \
@@ -355,7 +355,6 @@ HEADERS += \
WebProcess/WebCoreSupport/WebErrors.h \
WebProcess/WebCoreSupport/WebFrameLoaderClient.h \
WebProcess/WebCoreSupport/WebGeolocationClient.h \
- WebProcess/WebCoreSupport/WebGraphicsLayer.h \
WebProcess/WebCoreSupport/WebInspectorClient.h \
WebProcess/WebCoreSupport/WebInspectorFrontendClient.h \
WebProcess/WebCoreSupport/WebNotificationClient.h \
@@ -367,6 +366,8 @@ HEADERS += \
WebProcess/WebPage/DrawingAreaImpl.h \
WebProcess/WebPage/EventDispatcher.h \
WebProcess/WebPage/FindController.h \
+ WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.h \
+ WebProcess/WebPage/LayerTreeCoordinator/WebGraphicsLayer.h \
WebProcess/WebPage/TapHighlightController.h \
WebProcess/WebPage/PageOverlay.h \
WebProcess/WebPage/UpdateAtlas.h \
@@ -377,7 +378,6 @@ HEADERS += \
WebProcess/WebPage/WebPage.h \
WebProcess/WebPage/WebPageGroupProxy.h \
WebProcess/WebPage/WebUndoStep.h \
- WebProcess/WebPage/qt/LayerTreeHostQt.h \
WebProcess/WebConnectionToUIProcess.h \
WebProcess/WebProcess.h \
WebProcess/qt/QtBuiltinBundle.h \
@@ -566,7 +566,7 @@ SOURCES += \
UIProcess/Launcher/ThreadLauncher.cpp \
UIProcess/Launcher/qt/ProcessLauncherQt.cpp \
UIProcess/Launcher/qt/ThreadLauncherQt.cpp \
- UIProcess/LayerTreeHostProxy.cpp \
+ UIProcess/LayerTreeCoordinatorProxy.cpp \
UIProcess/Notifications/NotificationPermissionRequest.cpp \
UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp \
UIProcess/Notifications/WebNotification.cpp \
@@ -624,7 +624,6 @@ SOURCES += \
UIProcess/WebResourceLoadClient.cpp \
UIProcess/WebUIClient.cpp \
UIProcess/qt/QtWebContext.cpp \
- UIProcess/qt/LayerBackingStore.cpp \
UIProcess/qt/QtWebPageEventHandler.cpp \
UIProcess/qt/QtGestureRecognizer.cpp \
UIProcess/qt/QtPanGestureRecognizer.cpp \
@@ -649,6 +648,7 @@ SOURCES += \
UIProcess/qt/WebPopupMenuProxyQt.cpp \
UIProcess/qt/WebPreferencesQt.cpp \
UIProcess/qt/QtWebIconDatabaseClient.cpp \
+ UIProcess/texmap/LayerBackingStore.cpp \
WebProcess/ApplicationCache/WebApplicationCacheManager.cpp \
WebProcess/Authentication/AuthenticationManager.cpp \
WebProcess/Cookies/WebCookieManager.cpp \
@@ -722,7 +722,6 @@ SOURCES += \
WebProcess/WebCoreSupport/WebEditorClient.cpp \
WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp \
WebProcess/WebCoreSupport/WebGeolocationClient.cpp \
- WebProcess/WebCoreSupport/WebGraphicsLayer.cpp \
WebProcess/WebCoreSupport/WebInspectorClient.cpp \
WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp \
WebProcess/WebCoreSupport/WebNotificationClient.cpp \
@@ -740,6 +739,8 @@ SOURCES += \
WebProcess/WebPage/EncoderAdapter.cpp \
WebProcess/WebPage/EventDispatcher.cpp \
WebProcess/WebPage/FindController.cpp \
+ WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp \
+ WebProcess/WebPage/LayerTreeCoordinator/WebGraphicsLayer.cpp \
WebProcess/WebPage/TapHighlightController.cpp \
WebProcess/WebPage/LayerTreeHost.cpp \
WebProcess/WebPage/PageOverlay.cpp \
@@ -754,7 +755,6 @@ SOURCES += \
WebProcess/WebPage/WebPageGroupProxy.cpp \
WebProcess/WebPage/WebUndoStep.cpp \
WebProcess/WebPage/qt/WebInspectorQt.cpp \
- WebProcess/WebPage/qt/LayerTreeHostQt.cpp \
WebProcess/WebPage/qt/WebPageQt.cpp \
WebProcess/WebConnectionToUIProcess.cpp \
WebProcess/WebProcess.cpp \
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
index e0d6012d2..e1f6759ac 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
@@ -21,7 +21,7 @@
#include "config.h"
#include "qquickwebpage_p.h"
-#include "LayerTreeHostProxy.h"
+#include "LayerTreeCoordinatorProxy.h"
#include "QtWebPageEventHandler.h"
#include "QtWebPageSGNode.h"
#include "TransformationMatrix.h"
@@ -72,9 +72,9 @@ void QQuickWebPagePrivate::paint(QPainter* painter)
if (!webPageProxy->drawingArea())
return;
- LayerTreeHostProxy* layerTreeHostProxy = webPageProxy->drawingArea()->layerTreeHostProxy();
- if (layerTreeHostProxy->layerTreeRenderer())
- layerTreeHostProxy->layerTreeRenderer()->paintToGraphicsContext(painter);
+ LayerTreeCoordinatorProxy* layerTreeCoordinatorProxy = webPageProxy->drawingArea()->layerTreeCoordinatorProxy();
+ if (layerTreeCoordinatorProxy->layerTreeRenderer())
+ layerTreeCoordinatorProxy->layerTreeRenderer()->paintToGraphicsContext(painter);
}
QSGNode* QQuickWebPage::updatePaintNode(QSGNode* oldNode, UpdatePaintNodeData*)
@@ -82,8 +82,8 @@ QSGNode* QQuickWebPage::updatePaintNode(QSGNode* oldNode, UpdatePaintNodeData*)
if (!d->webPageProxy->drawingArea())
return oldNode;
- LayerTreeHostProxy* layerTreeHostProxy = d->webPageProxy->drawingArea()->layerTreeHostProxy();
- WebLayerTreeRenderer* renderer = layerTreeHostProxy->layerTreeRenderer();
+ LayerTreeCoordinatorProxy* layerTreeCoordinatorProxy = d->webPageProxy->drawingArea()->layerTreeCoordinatorProxy();
+ WebLayerTreeRenderer* renderer = layerTreeCoordinatorProxy->layerTreeRenderer();
QtWebPageSGNode* node = static_cast<QtWebPageSGNode*>(oldNode);
if (!node)
@@ -159,8 +159,8 @@ void QQuickWebPagePrivate::updateSize()
QSizeF scaledSize = contentsSize * contentsScale;
DrawingAreaProxy* drawingArea = webPageProxy->drawingArea();
- if (drawingArea && drawingArea->layerTreeHostProxy())
- drawingArea->layerTreeHostProxy()->setContentsSize(contentsSize);
+ if (drawingArea && drawingArea->layerTreeCoordinatorProxy())
+ drawingArea->layerTreeCoordinatorProxy()->setContentsSize(contentsSize);
q->setSize(scaledSize);
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp b/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp
index 08b225743..5f7b10654 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp
@@ -29,7 +29,7 @@
#include "WebPageProxy.h"
#if USE(UI_SIDE_COMPOSITING)
-#include "LayerTreeHostProxy.h"
+#include "LayerTreeCoordinatorProxy.h"
#include <CoreIPC/MessageID.h>
#endif
@@ -69,7 +69,7 @@ WebCore::IntRect DrawingAreaProxy::contentsRect() const
return IntRect(IntPoint::zero(), m_webPageProxy->viewSize());
}
-void DrawingAreaProxy::didReceiveLayerTreeHostProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void DrawingAreaProxy::didReceiveLayerTreeCoordinatorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
{
}
#endif
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxy.h b/Source/WebKit2/UIProcess/DrawingAreaProxy.h
index 9f1705dd7..426fea14a 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxy.h
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxy.h
@@ -54,7 +54,7 @@ namespace WebCore {
namespace WebKit {
class LayerTreeContext;
-class LayerTreeHostProxy;
+class LayerTreeCoordinatorProxy;
class UpdateInfo;
class WebLayerTreeInfo;
class WebLayerUpdateInfo;
@@ -93,12 +93,12 @@ public:
virtual WebCore::IntRect viewportVisibleRect() const { return contentsRect(); }
virtual WebCore::IntRect contentsRect() const;
virtual bool isBackingStoreReady() const { return true; }
- LayerTreeHostProxy* layerTreeHostProxy() const { return m_layerTreeHostProxy.get(); }
+ LayerTreeCoordinatorProxy* layerTreeCoordinatorProxy() const { return m_layerTreeCoordinatorProxy.get(); }
virtual void setVisibleContentsRect(const WebCore::IntRect& visibleContentsRect, float scale, const WebCore::FloatPoint& trajectoryVector, const WebCore::FloatPoint& accurateVisibleContentsPosition = WebCore::FloatPoint()) { }
virtual void createTileForLayer(int layerID, int tileID, const WebKit::UpdateInfo&) { }
virtual void updateTileForLayer(int layerID, int tileID, const WebKit::UpdateInfo&) { }
virtual void removeTileForLayer(int layerID, int tileID) { }
- virtual void didReceiveLayerTreeHostProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveLayerTreeCoordinatorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
WebPageProxy* page() { return m_webPageProxy; }
#endif
@@ -112,7 +112,7 @@ protected:
WebCore::IntSize m_scrollOffset;
#if USE(UI_SIDE_COMPOSITING)
- OwnPtr<LayerTreeHostProxy> m_layerTreeHostProxy;
+ OwnPtr<LayerTreeCoordinatorProxy> m_layerTreeCoordinatorProxy;
#endif
private:
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
index 156267164..0bb74484e 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
@@ -37,7 +37,7 @@
#include <WebCore/Region.h>
#if USE(UI_SIDE_COMPOSITING)
-#include "LayerTreeHostProxy.h"
+#include "LayerTreeCoordinatorProxy.h"
#endif
using namespace WebCore;
@@ -61,7 +61,7 @@ DrawingAreaProxyImpl::DrawingAreaProxyImpl(WebPageProxy* webPageProxy)
#if USE(UI_SIDE_COMPOSITING)
// Construct the proxy early to allow messages to be sent to the web process while AC is entered there.
if (webPageProxy->pageGroup()->preferences()->forceCompositingMode())
- m_layerTreeHostProxy = adoptPtr(new LayerTreeHostProxy(this));
+ m_layerTreeCoordinatorProxy = adoptPtr(new LayerTreeCoordinatorProxy(this));
#endif
}
@@ -354,22 +354,22 @@ void DrawingAreaProxyImpl::enterAcceleratedCompositingMode(const LayerTreeContex
m_layerTreeContext = layerTreeContext;
m_webPageProxy->enterAcceleratedCompositingMode(layerTreeContext);
#if USE(UI_SIDE_COMPOSITING)
- if (!m_layerTreeHostProxy)
- m_layerTreeHostProxy = adoptPtr(new LayerTreeHostProxy(this));
+ if (!m_layerTreeCoordinatorProxy)
+ m_layerTreeCoordinatorProxy = adoptPtr(new LayerTreeCoordinatorProxy(this));
#endif
}
#if USE(UI_SIDE_COMPOSITING)
-void DrawingAreaProxyImpl::didReceiveLayerTreeHostProxyMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void DrawingAreaProxyImpl::didReceiveLayerTreeCoordinatorProxyMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
{
- if (m_layerTreeHostProxy)
- m_layerTreeHostProxy->didReceiveLayerTreeHostProxyMessage(connection, messageID, arguments);
+ if (m_layerTreeCoordinatorProxy)
+ m_layerTreeCoordinatorProxy->didReceiveLayerTreeCoordinatorProxyMessage(connection, messageID, arguments);
}
void DrawingAreaProxyImpl::setVisibleContentsRect(const WebCore::IntRect& visibleContentsRect, float scale, const WebCore::FloatPoint& trajectoryVector, const WebCore::FloatPoint& accurateVisibleContentsPosition)
{
- if (m_layerTreeHostProxy)
- m_layerTreeHostProxy->setVisibleContentsRect(visibleContentsRect, scale, trajectoryVector, accurateVisibleContentsPosition);
+ if (m_layerTreeCoordinatorProxy)
+ m_layerTreeCoordinatorProxy->setVisibleContentsRect(visibleContentsRect, scale, trajectoryVector, accurateVisibleContentsPosition);
}
#endif
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
index 346f3546d..4c4ac5939 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
@@ -39,7 +39,7 @@ class Region;
namespace WebKit {
-class LayerTreeHostProxy;
+class LayerTreeCoordinatorProxy;
class DrawingAreaProxyImpl : public DrawingAreaProxy {
public:
@@ -83,7 +83,7 @@ private:
#if USE(UI_SIDE_COMPOSITING)
virtual void setVisibleContentsRect(const WebCore::IntRect& visibleContentsRect, float scale, const WebCore::FloatPoint& trajectory, const WebCore::FloatPoint& accurateVisibleContentsPosition = WebCore::FloatPoint());
- void didReceiveLayerTreeHostProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveLayerTreeCoordinatorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
#endif
#else
bool isInAcceleratedCompositingMode() const { return false; }
diff --git a/Source/WebKit2/UIProcess/LayerTreeHostProxy.cpp b/Source/WebKit2/UIProcess/LayerTreeCoordinatorProxy.cpp
index 687f072f6..3b0214344 100644
--- a/Source/WebKit2/UIProcess/LayerTreeHostProxy.cpp
+++ b/Source/WebKit2/UIProcess/LayerTreeCoordinatorProxy.cpp
@@ -20,9 +20,9 @@
#include "config.h"
#if USE(UI_SIDE_COMPOSITING)
-#include "LayerTreeHostProxy.h"
+#include "LayerTreeCoordinatorProxy.h"
-#include "LayerTreeHostMessages.h"
+#include "LayerTreeCoordinatorMessages.h"
#include "UpdateInfo.h"
#include "WebCoreArgumentCoders.h"
#include "WebLayerTreeInfo.h"
@@ -34,34 +34,34 @@ namespace WebKit {
using namespace WebCore;
-LayerTreeHostProxy::LayerTreeHostProxy(DrawingAreaProxy* drawingAreaProxy)
+LayerTreeCoordinatorProxy::LayerTreeCoordinatorProxy(DrawingAreaProxy* drawingAreaProxy)
: m_drawingAreaProxy(drawingAreaProxy)
, m_renderer(adoptRef(new WebLayerTreeRenderer(this)))
{
}
-LayerTreeHostProxy::~LayerTreeHostProxy()
+LayerTreeCoordinatorProxy::~LayerTreeCoordinatorProxy()
{
m_renderer->detach();
}
-void LayerTreeHostProxy::updateViewport()
+void LayerTreeCoordinatorProxy::updateViewport()
{
m_drawingAreaProxy->updateViewport();
}
-void LayerTreeHostProxy::dispatchUpdate(const Function<void()>& function)
+void LayerTreeCoordinatorProxy::dispatchUpdate(const Function<void()>& function)
{
m_renderer->appendUpdate(function);
}
-void LayerTreeHostProxy::createTileForLayer(int layerID, int tileID, const IntRect& targetRect, const WebKit::SurfaceUpdateInfo& updateInfo)
+void LayerTreeCoordinatorProxy::createTileForLayer(int layerID, int tileID, const IntRect& targetRect, const WebKit::SurfaceUpdateInfo& updateInfo)
{
dispatchUpdate(bind(&WebLayerTreeRenderer::createTile, m_renderer.get(), layerID, tileID, updateInfo.scaleFactor));
updateTileForLayer(layerID, tileID, targetRect, updateInfo);
}
-void LayerTreeHostProxy::updateTileForLayer(int layerID, int tileID, const IntRect& targetRect, const WebKit::SurfaceUpdateInfo& updateInfo)
+void LayerTreeCoordinatorProxy::updateTileForLayer(int layerID, int tileID, const IntRect& targetRect, const WebKit::SurfaceUpdateInfo& updateInfo)
{
RefPtr<ShareableSurface> surface;
#if USE(GRAPHICS_SURFACE)
@@ -78,86 +78,86 @@ void LayerTreeHostProxy::updateTileForLayer(int layerID, int tileID, const IntRe
dispatchUpdate(bind(&WebLayerTreeRenderer::updateTile, m_renderer.get(), layerID, tileID, WebLayerTreeRenderer::TileUpdate(updateInfo.updateRect, targetRect, surface, updateInfo.surfaceOffset)));
}
-void LayerTreeHostProxy::removeTileForLayer(int layerID, int tileID)
+void LayerTreeCoordinatorProxy::removeTileForLayer(int layerID, int tileID)
{
dispatchUpdate(bind(&WebLayerTreeRenderer::removeTile, m_renderer.get(), layerID, tileID));
}
-void LayerTreeHostProxy::deleteCompositingLayer(WebLayerID id)
+void LayerTreeCoordinatorProxy::deleteCompositingLayer(WebLayerID id)
{
dispatchUpdate(bind(&WebLayerTreeRenderer::deleteLayer, m_renderer.get(), id));
updateViewport();
}
-void LayerTreeHostProxy::setRootCompositingLayer(WebLayerID id)
+void LayerTreeCoordinatorProxy::setRootCompositingLayer(WebLayerID id)
{
dispatchUpdate(bind(&WebLayerTreeRenderer::setRootLayerID, m_renderer.get(), id));
updateViewport();
}
-void LayerTreeHostProxy::setCompositingLayerState(WebLayerID id, const WebLayerInfo& info)
+void LayerTreeCoordinatorProxy::setCompositingLayerState(WebLayerID id, const WebLayerInfo& info)
{
dispatchUpdate(bind(&WebLayerTreeRenderer::setLayerState, m_renderer.get(), id, info));
}
-void LayerTreeHostProxy::setCompositingLayerChildren(WebLayerID id, const Vector<WebLayerID>& children)
+void LayerTreeCoordinatorProxy::setCompositingLayerChildren(WebLayerID id, const Vector<WebLayerID>& children)
{
dispatchUpdate(bind(&WebLayerTreeRenderer::setLayerChildren, m_renderer.get(), id, children));
}
#if ENABLE(CSS_FILTERS)
-void LayerTreeHostProxy::setCompositingLayerFilters(WebLayerID id, const FilterOperations& filters)
+void LayerTreeCoordinatorProxy::setCompositingLayerFilters(WebLayerID id, const FilterOperations& filters)
{
dispatchUpdate(bind(&WebLayerTreeRenderer::setLayerFilters, m_renderer.get(), id, filters));
}
#endif
-void LayerTreeHostProxy::didRenderFrame()
+void LayerTreeCoordinatorProxy::didRenderFrame()
{
dispatchUpdate(bind(&WebLayerTreeRenderer::flushLayerChanges, m_renderer.get()));
updateViewport();
}
-void LayerTreeHostProxy::createDirectlyCompositedImage(int64_t key, const WebKit::ShareableBitmap::Handle& handle)
+void LayerTreeCoordinatorProxy::createDirectlyCompositedImage(int64_t key, const WebKit::ShareableBitmap::Handle& handle)
{
RefPtr<ShareableBitmap> bitmap = ShareableBitmap::create(handle);
dispatchUpdate(bind(&WebLayerTreeRenderer::createImage, m_renderer.get(), key, bitmap));
}
-void LayerTreeHostProxy::destroyDirectlyCompositedImage(int64_t key)
+void LayerTreeCoordinatorProxy::destroyDirectlyCompositedImage(int64_t key)
{
dispatchUpdate(bind(&WebLayerTreeRenderer::destroyImage, m_renderer.get(), key));
}
-void LayerTreeHostProxy::setContentsSize(const FloatSize& contentsSize)
+void LayerTreeCoordinatorProxy::setContentsSize(const FloatSize& contentsSize)
{
dispatchUpdate(bind(&WebLayerTreeRenderer::setContentsSize, m_renderer.get(), contentsSize));
}
-void LayerTreeHostProxy::setVisibleContentsRect(const IntRect& rect, float scale, const FloatPoint& trajectoryVector, const WebCore::FloatPoint& accurateVisibleContentsPosition)
+void LayerTreeCoordinatorProxy::setVisibleContentsRect(const IntRect& rect, float scale, const FloatPoint& trajectoryVector, const WebCore::FloatPoint& accurateVisibleContentsPosition)
{
dispatchUpdate(bind(&WebLayerTreeRenderer::setVisibleContentsRect, m_renderer.get(), rect, scale, accurateVisibleContentsPosition));
- m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeHost::SetVisibleContentsRect(rect, scale, trajectoryVector), m_drawingAreaProxy->page()->pageID());
+ m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeCoordinator::SetVisibleContentsRect(rect, scale, trajectoryVector), m_drawingAreaProxy->page()->pageID());
}
-void LayerTreeHostProxy::renderNextFrame()
+void LayerTreeCoordinatorProxy::renderNextFrame()
{
- m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeHost::RenderNextFrame(), m_drawingAreaProxy->page()->pageID());
+ m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeCoordinator::RenderNextFrame(), m_drawingAreaProxy->page()->pageID());
}
-void LayerTreeHostProxy::didChangeScrollPosition(const IntPoint& position)
+void LayerTreeCoordinatorProxy::didChangeScrollPosition(const IntPoint& position)
{
dispatchUpdate(bind(&WebLayerTreeRenderer::didChangeScrollPosition, m_renderer.get(), position));
}
-void LayerTreeHostProxy::syncCanvas(uint32_t id, const IntSize& canvasSize, uint32_t graphicsSurfaceToken)
+void LayerTreeCoordinatorProxy::syncCanvas(uint32_t id, const IntSize& canvasSize, uint32_t graphicsSurfaceToken)
{
dispatchUpdate(bind(&WebLayerTreeRenderer::syncCanvas, m_renderer.get(), id, canvasSize, graphicsSurfaceToken));
}
-void LayerTreeHostProxy::purgeBackingStores()
+void LayerTreeCoordinatorProxy::purgeBackingStores()
{
- m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeHost::PurgeBackingStores(), m_drawingAreaProxy->page()->pageID());
+ m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeCoordinator::PurgeBackingStores(), m_drawingAreaProxy->page()->pageID());
}
}
diff --git a/Source/WebKit2/UIProcess/LayerTreeHostProxy.h b/Source/WebKit2/UIProcess/LayerTreeCoordinatorProxy.h
index 7958a5a5d..b4e7b7ce2 100644
--- a/Source/WebKit2/UIProcess/LayerTreeHostProxy.h
+++ b/Source/WebKit2/UIProcess/LayerTreeCoordinatorProxy.h
@@ -17,8 +17,8 @@
Boston, MA 02110-1301, USA.
*/
-#ifndef LayerTreeHostProxy_h
-#define LayerTreeHostProxy_h
+#ifndef LayerTreeCoordinatorProxy_h
+#define LayerTreeCoordinatorProxy_h
#if USE(UI_SIDE_COMPOSITING)
@@ -44,10 +44,10 @@ class WebLayerInfo;
class WebLayerTreeRenderer;
class WebLayerUpdateInfo;
-class LayerTreeHostProxy {
+class LayerTreeCoordinatorProxy {
public:
- LayerTreeHostProxy(DrawingAreaProxy*);
- virtual ~LayerTreeHostProxy();
+ LayerTreeCoordinatorProxy(DrawingAreaProxy*);
+ virtual ~LayerTreeCoordinatorProxy();
void setCompositingLayerState(WebLayerID, const WebLayerInfo&);
void setCompositingLayerChildren(WebLayerID, const Vector<WebLayerID>&);
#if ENABLE(CSS_FILTERS)
@@ -65,7 +65,7 @@ public:
void removeTileForLayer(int layerID, int tileID);
void createDirectlyCompositedImage(int64_t, const WebKit::ShareableBitmap::Handle&);
void destroyDirectlyCompositedImage(int64_t);
- void didReceiveLayerTreeHostProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveLayerTreeCoordinatorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
void updateViewport();
void renderNextFrame();
void didChangeScrollPosition(const WebCore::IntPoint& position);
@@ -87,4 +87,4 @@ protected:
#endif
-#endif // LayerTreeHostProxy_h
+#endif // LayerTreeCoordinatorProxy_h
diff --git a/Source/WebKit2/UIProcess/LayerTreeHostProxy.messages.in b/Source/WebKit2/UIProcess/LayerTreeCoordinatorProxy.messages.in
index a88b44fd8..c284b915b 100644
--- a/Source/WebKit2/UIProcess/LayerTreeHostProxy.messages.in
+++ b/Source/WebKit2/UIProcess/LayerTreeCoordinatorProxy.messages.in
@@ -18,7 +18,7 @@
#
#if USE(ACCELERATED_COMPOSITING) && USE(TILED_BACKING_STORE)
-messages -> LayerTreeHostProxy {
+messages -> LayerTreeCoordinatorProxy {
SetCompositingLayerState(uint32_t id, WebKit::WebLayerInfo layerInfo)
SetCompositingLayerChildren(uint32_t id, Vector<uint32_t> children)
#if ENABLE(CSS_FILTERS)
diff --git a/Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp b/Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp
index 3850e53ca..b85e01383 100644
--- a/Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp
+++ b/Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp
@@ -25,7 +25,7 @@
#include "GraphicsLayerTextureMapper.h"
#include "LayerBackingStore.h"
-#include "LayerTreeHostProxy.h"
+#include "LayerTreeCoordinatorProxy.h"
#include "MessageID.h"
#include "ShareableBitmap.h"
#include "TextureMapper.h"
@@ -85,9 +85,9 @@ static IntPoint boundedScrollPosition(const IntPoint& scrollPosition, const IntR
return IntPoint(scrollPositionX, scrollPositionY);
}
-WebLayerTreeRenderer::WebLayerTreeRenderer(LayerTreeHostProxy* layerTreeHostProxy)
+WebLayerTreeRenderer::WebLayerTreeRenderer(LayerTreeCoordinatorProxy* layerTreeCoordinatorProxy)
: m_contentsScale(1)
- , m_layerTreeHostProxy(layerTreeHostProxy)
+ , m_layerTreeCoordinatorProxy(layerTreeCoordinatorProxy)
, m_rootLayerID(InvalidWebLayerID)
, m_isActive(false)
{
@@ -175,8 +175,8 @@ void WebLayerTreeRenderer::setVisibleContentsRect(const IntRect& rect, float sca
void WebLayerTreeRenderer::updateViewport()
{
- if (m_layerTreeHostProxy)
- m_layerTreeHostProxy->updateViewport();
+ if (m_layerTreeCoordinatorProxy)
+ m_layerTreeCoordinatorProxy->updateViewport();
}
void WebLayerTreeRenderer::adjustPositionForFixedLayers()
@@ -406,8 +406,8 @@ void WebLayerTreeRenderer::flushLayerChanges()
void WebLayerTreeRenderer::renderNextFrame()
{
- if (m_layerTreeHostProxy)
- m_layerTreeHostProxy->renderNextFrame();
+ if (m_layerTreeCoordinatorProxy)
+ m_layerTreeCoordinatorProxy->renderNextFrame();
}
void WebLayerTreeRenderer::ensureRootLayer()
@@ -465,13 +465,13 @@ void WebLayerTreeRenderer::purgeGLResources()
void WebLayerTreeRenderer::purgeBackingStores()
{
- if (m_layerTreeHostProxy)
- m_layerTreeHostProxy->purgeBackingStores();
+ if (m_layerTreeCoordinatorProxy)
+ m_layerTreeCoordinatorProxy->purgeBackingStores();
}
void WebLayerTreeRenderer::detach()
{
- m_layerTreeHostProxy = 0;
+ m_layerTreeCoordinatorProxy = 0;
}
void WebLayerTreeRenderer::appendUpdate(const Function<void()>& function)
diff --git a/Source/WebKit2/UIProcess/WebLayerTreeRenderer.h b/Source/WebKit2/UIProcess/WebLayerTreeRenderer.h
index d66b19d63..2a4bab536 100644
--- a/Source/WebKit2/UIProcess/WebLayerTreeRenderer.h
+++ b/Source/WebKit2/UIProcess/WebLayerTreeRenderer.h
@@ -40,7 +40,7 @@
namespace WebKit {
class LayerBackingStore;
-class LayerTreeHostProxy;
+class LayerTreeCoordinatorProxy;
class WebLayerInfo;
class WebLayerUpdateInfo;
@@ -59,7 +59,7 @@ public:
{
}
};
- WebLayerTreeRenderer(LayerTreeHostProxy*);
+ WebLayerTreeRenderer(LayerTreeCoordinatorProxy*);
virtual ~WebLayerTreeRenderer();
void purgeGLResources();
void paintToCurrentGLContext(const WebCore::TransformationMatrix&, float, const WebCore::FloatRect&, WebCore::TextureMapper::PaintFlags = 0);
@@ -135,7 +135,7 @@ private:
void renderNextFrame();
void purgeBackingStores();
- LayerTreeHostProxy* m_layerTreeHostProxy;
+ LayerTreeCoordinatorProxy* m_layerTreeCoordinatorProxy;
OwnPtr<WebCore::GraphicsLayer> m_rootLayer;
Vector<WebLayerID> m_layersToDelete;
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp
index 627ee5207..b5046b299 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp
@@ -94,7 +94,7 @@
#endif
#if USE(UI_SIDE_COMPOSITING)
-#include "LayerTreeHostProxyMessages.h"
+#include "LayerTreeCoordinatorProxyMessages.h"
#endif
#if PLATFORM(QT)
@@ -1737,8 +1737,8 @@ void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::M
}
#if USE(UI_SIDE_COMPOSITING)
- if (messageID.is<CoreIPC::MessageClassLayerTreeHostProxy>()) {
- m_drawingArea->didReceiveLayerTreeHostProxyMessage(connection, messageID, arguments);
+ if (messageID.is<CoreIPC::MessageClassLayerTreeCoordinatorProxy>()) {
+ m_drawingArea->didReceiveLayerTreeCoordinatorProxyMessage(connection, messageID, arguments);
return;
}
#endif
diff --git a/Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp b/Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp
index 5b26d1207..405c0e132 100644
--- a/Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp
+++ b/Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp
@@ -38,7 +38,7 @@ static TextCheckerState textCheckerState;
const TextCheckerState& TextChecker::state()
{
- static bool didInitializeState;
+ static bool didInitializeState = false;
if (didInitializeState)
return textCheckerState;
diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
index 4f131ccdf..648119486 100644
--- a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
@@ -31,7 +31,7 @@
#include <QCursor>
#include <QDrag>
#include <QGuiApplication>
-#include <QInputPanel>
+#include <QInputMethod>
#include <QMimeData>
#include <QtQuick/QQuickCanvas>
#include <QStyleHints>
@@ -100,12 +100,12 @@ QtWebPageEventHandler::QtWebPageEventHandler(WKPageRef pageRef, QQuickWebPage* q
, m_postponeTextInputStateChanged(false)
, m_isTapHighlightActive(false)
{
- connect(qApp->inputPanel(), SIGNAL(visibleChanged()), this, SLOT(inputPanelVisibleChanged()));
+ connect(qApp->inputMethod(), SIGNAL(visibleChanged()), this, SLOT(inputPanelVisibleChanged()));
}
QtWebPageEventHandler::~QtWebPageEventHandler()
{
- disconnect(qApp->inputPanel(), SIGNAL(visibleChanged()), this, SLOT(inputPanelVisibleChanged()));
+ disconnect(qApp->inputMethod(), SIGNAL(visibleChanged()), this, SLOT(inputPanelVisibleChanged()));
}
void QtWebPageEventHandler::handleMouseMoveEvent(QMouseEvent* ev)
@@ -390,10 +390,10 @@ void QtWebPageEventHandler::resetGestureRecognizers()
static void setInputPanelVisible(bool visible)
{
- if (qApp->inputPanel()->visible() == visible)
+ if (qApp->inputMethod()->visible() == visible)
return;
- qApp->inputPanel()->setVisible(visible);
+ qApp->inputMethod()->setVisible(visible);
}
void QtWebPageEventHandler::inputPanelVisibleChanged()
@@ -402,7 +402,7 @@ void QtWebPageEventHandler::inputPanelVisibleChanged()
return;
// We only respond to the input panel becoming visible.
- if (!m_webView->hasActiveFocus() || !qApp->inputPanel()->visible())
+ if (!m_webView->hasActiveFocus() || !qApp->inputMethod()->visible())
return;
const EditorState& editor = m_webPageProxy->editorState();
@@ -422,7 +422,7 @@ void QtWebPageEventHandler::updateTextInputState()
if (!m_webView->hasActiveFocus())
return;
- qApp->inputPanel()->update(Qt::ImQueryInput | Qt::ImEnabled);
+ qApp->inputMethod()->update(Qt::ImQueryInput | Qt::ImEnabled);
setInputPanelVisible(editor.isContentEditable);
}
diff --git a/Source/WebKit2/UIProcess/qt/LayerBackingStore.cpp b/Source/WebKit2/UIProcess/texmap/LayerBackingStore.cpp
index caaffe9e5..caaffe9e5 100644
--- a/Source/WebKit2/UIProcess/qt/LayerBackingStore.cpp
+++ b/Source/WebKit2/UIProcess/texmap/LayerBackingStore.cpp
diff --git a/Source/WebKit2/UIProcess/qt/LayerBackingStore.h b/Source/WebKit2/UIProcess/texmap/LayerBackingStore.h
index a3e219b04..a3e219b04 100644
--- a/Source/WebKit2/UIProcess/qt/LayerBackingStore.h
+++ b/Source/WebKit2/UIProcess/texmap/LayerBackingStore.h
diff --git a/Source/WebKit2/WebKit2.pri b/Source/WebKit2/WebKit2.pri
index 24cc5a216..75734521b 100644
--- a/Source/WebKit2/WebKit2.pri
+++ b/Source/WebKit2/WebKit2.pri
@@ -33,6 +33,7 @@ INCLUDEPATH += \
$$SOURCE_DIR/UIProcess/Notifications \
$$SOURCE_DIR/UIProcess/Plugins \
$$SOURCE_DIR/UIProcess/qt \
+ $$SOURCE_DIR/UIProcess/texmap \
$$SOURCE_DIR/WebProcess \
$$SOURCE_DIR/WebProcess/ApplicationCache \
$$SOURCE_DIR/WebProcess/Authentication \
@@ -55,6 +56,7 @@ INCLUDEPATH += \
$$SOURCE_DIR/WebProcess/WebCoreSupport \
$$SOURCE_DIR/WebProcess/WebCoreSupport/qt \
$$SOURCE_DIR/WebProcess/WebPage \
+ $$SOURCE_DIR/WebProcess/WebPage/LayerTreeCoordinator \
$$SOURCE_DIR/WebProcess/qt \
$$SOURCE_DIR/PluginProcess
@@ -69,3 +71,7 @@ linux-*: {
# -lrt is required for shm_open and shm_unlink.
LIBS += -lrt
}
+
+QT += qml quick
+
+contains(DEFINES, ENABLE_GEOLOCATION=1):haveQt(5): QT += location
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
index ac76c4d4e..9a7d29377 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -907,8 +907,17 @@ void WebFrameLoaderClient::finishedLoading(DocumentLoader* loader)
}
}
- // Plugin view could have been created inside committedLoad().
if (m_pluginView) {
+ // If we just received an empty response without any data, we won't have sent a response to the plug-in view.
+ // Make sure to do this before calling manualLoadDidFinishLoading.
+ if (!m_hasSentResponseToPluginView) {
+ m_pluginView->manualLoadDidReceiveResponse(loader->response());
+
+ // Protect against the above call nulling out the plug-in (by trying to cancel the load for example).
+ if (!m_pluginView)
+ return;
+ }
+
m_pluginView->manualLoadDidFinishLoading();
m_pluginView = 0;
m_hasSentResponseToPluginView = false;
diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingArea.h b/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
index 685cb83d8..71aa607cb 100644
--- a/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
+++ b/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
@@ -91,7 +91,7 @@ public:
#endif
#if USE(UI_SIDE_COMPOSITING)
- virtual void didReceiveLayerTreeHostMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) = 0;
+ virtual void didReceiveLayerTreeCoordinatorMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) = 0;
#endif
#if PLATFORM(WIN)
diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
index ddadcb15f..5e6d5ec0a 100644
--- a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
@@ -689,10 +689,10 @@ void DrawingAreaImpl::display(UpdateInfo& updateInfo)
}
#if USE(UI_SIDE_COMPOSITING)
-void DrawingAreaImpl::didReceiveLayerTreeHostMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void DrawingAreaImpl::didReceiveLayerTreeCoordinatorMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
{
if (m_layerTreeHost)
- m_layerTreeHost->didReceiveLayerTreeHostMessage(connection, messageID, arguments);
+ m_layerTreeHost->didReceiveLayerTreeCoordinatorMessage(connection, messageID, arguments);
}
#endif
diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h
index 39d0515b5..2cebbd5c4 100644
--- a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h
+++ b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h
@@ -78,7 +78,7 @@ private:
#endif
#if USE(UI_SIDE_COMPOSITING)
- virtual void didReceiveLayerTreeHostMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveLayerTreeCoordinatorMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
#endif
// CoreIPC message handlers.
diff --git a/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp b/Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp
index 1fa91ac3f..f3e8735e5 100644
--- a/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp
@@ -26,11 +26,11 @@
#include "config.h"
-#include "LayerTreeHostQt.h"
+#include "LayerTreeCoordinator.h"
#include "DrawingAreaImpl.h"
#include "GraphicsContext.h"
-#include "LayerTreeHostProxyMessages.h"
+#include "LayerTreeCoordinatorProxyMessages.h"
#include "MessageID.h"
#include "SurfaceUpdateInfo.h"
#include "WebCoreArgumentCoders.h"
@@ -49,12 +49,12 @@ using namespace WebCore;
namespace WebKit {
-PassRefPtr<LayerTreeHostQt> LayerTreeHostQt::create(WebPage* webPage)
+PassRefPtr<LayerTreeCoordinator> LayerTreeCoordinator::create(WebPage* webPage)
{
- return adoptRef(new LayerTreeHostQt(webPage));
+ return adoptRef(new LayerTreeCoordinator(webPage));
}
-LayerTreeHostQt::~LayerTreeHostQt()
+LayerTreeCoordinator::~LayerTreeCoordinator()
{
// Prevent setWebGraphicsLayerClient(0) -> detachLayer() from modifying the set while we iterate it.
HashSet<WebCore::WebGraphicsLayer*> registeredLayers;
@@ -65,7 +65,7 @@ LayerTreeHostQt::~LayerTreeHostQt()
(*it)->setWebGraphicsLayerClient(0);
}
-LayerTreeHostQt::LayerTreeHostQt(WebPage* webPage)
+LayerTreeCoordinator::LayerTreeCoordinator(WebPage* webPage)
: LayerTreeHost(webPage)
, m_notifyAfterScheduledLayerFlush(false)
, m_isValid(true)
@@ -75,7 +75,7 @@ LayerTreeHostQt::LayerTreeHostQt(WebPage* webPage)
, m_shouldSendScrollPositionUpdate(true)
, m_shouldSyncFrame(false)
, m_shouldSyncRootLayer(true)
- , m_layerFlushTimer(this, &LayerTreeHostQt::layerFlushTimerFired)
+ , m_layerFlushTimer(this, &LayerTreeCoordinator::layerFlushTimerFired)
, m_layerFlushSchedulingEnabled(true)
{
// Create a root layer.
@@ -83,7 +83,7 @@ LayerTreeHostQt::LayerTreeHostQt(WebPage* webPage)
WebGraphicsLayer* webRootLayer = toWebGraphicsLayer(m_rootLayer.get());
webRootLayer->setRootLayer(true);
#ifndef NDEBUG
- m_rootLayer->setName("LayerTreeHostQt root layer");
+ m_rootLayer->setName("LayerTreeCoordinator root layer");
#endif
m_rootLayer->setDrawsContent(false);
m_rootLayer->setSize(m_webPage->size());
@@ -92,7 +92,7 @@ LayerTreeHostQt::LayerTreeHostQt(WebPage* webPage)
m_nonCompositedContentLayer = GraphicsLayer::create(this);
toWebGraphicsLayer(m_rootLayer.get())->setWebGraphicsLayerClient(this);
#ifndef NDEBUG
- m_nonCompositedContentLayer->setName("LayerTreeHostQt non-composited content");
+ m_nonCompositedContentLayer->setName("LayerTreeCoordinator non-composited content");
#endif
m_nonCompositedContentLayer->setDrawsContent(true);
m_nonCompositedContentLayer->setSize(m_webPage->size());
@@ -105,7 +105,7 @@ LayerTreeHostQt::LayerTreeHostQt(WebPage* webPage)
scheduleLayerFlush();
}
-void LayerTreeHostQt::setLayerFlushSchedulingEnabled(bool layerFlushingEnabled)
+void LayerTreeCoordinator::setLayerFlushSchedulingEnabled(bool layerFlushingEnabled)
{
if (m_layerFlushSchedulingEnabled == layerFlushingEnabled)
return;
@@ -120,7 +120,7 @@ void LayerTreeHostQt::setLayerFlushSchedulingEnabled(bool layerFlushingEnabled)
cancelPendingLayerFlush();
}
-void LayerTreeHostQt::scheduleLayerFlush()
+void LayerTreeCoordinator::scheduleLayerFlush()
{
if (!m_layerFlushSchedulingEnabled)
return;
@@ -129,17 +129,17 @@ void LayerTreeHostQt::scheduleLayerFlush()
m_layerFlushTimer.startOneShot(0);
}
-void LayerTreeHostQt::cancelPendingLayerFlush()
+void LayerTreeCoordinator::cancelPendingLayerFlush()
{
m_layerFlushTimer.stop();
}
-void LayerTreeHostQt::setShouldNotifyAfterNextScheduledLayerFlush(bool notifyAfterScheduledLayerFlush)
+void LayerTreeCoordinator::setShouldNotifyAfterNextScheduledLayerFlush(bool notifyAfterScheduledLayerFlush)
{
m_notifyAfterScheduledLayerFlush = notifyAfterScheduledLayerFlush;
}
-void LayerTreeHostQt::setRootCompositingLayer(WebCore::GraphicsLayer* graphicsLayer)
+void LayerTreeCoordinator::setRootCompositingLayer(WebCore::GraphicsLayer* graphicsLayer)
{
m_nonCompositedContentLayer->removeAllChildren();
m_nonCompositedContentLayer->setContentsOpaque(m_webPage->drawsBackground() && !m_webPage->drawsTransparentBackground());
@@ -149,7 +149,7 @@ void LayerTreeHostQt::setRootCompositingLayer(WebCore::GraphicsLayer* graphicsLa
m_nonCompositedContentLayer->addChild(graphicsLayer);
}
-void LayerTreeHostQt::invalidate()
+void LayerTreeCoordinator::invalidate()
{
cancelPendingLayerFlush();
@@ -158,7 +158,7 @@ void LayerTreeHostQt::invalidate()
m_isValid = false;
}
-void LayerTreeHostQt::setNonCompositedContentsNeedDisplay(const WebCore::IntRect& rect)
+void LayerTreeCoordinator::setNonCompositedContentsNeedDisplay(const WebCore::IntRect& rect)
{
m_nonCompositedContentLayer->setNeedsDisplayInRect(rect);
if (m_pageOverlayLayer)
@@ -167,17 +167,17 @@ void LayerTreeHostQt::setNonCompositedContentsNeedDisplay(const WebCore::IntRect
scheduleLayerFlush();
}
-void LayerTreeHostQt::scrollNonCompositedContents(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset)
+void LayerTreeCoordinator::scrollNonCompositedContents(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset)
{
setNonCompositedContentsNeedDisplay(scrollRect);
}
-void LayerTreeHostQt::forceRepaint()
+void LayerTreeCoordinator::forceRepaint()
{
scheduleLayerFlush();
}
-void LayerTreeHostQt::sizeDidChange(const WebCore::IntSize& newSize)
+void LayerTreeCoordinator::sizeDidChange(const WebCore::IntSize& newSize)
{
if (m_rootLayer->size() == newSize)
return;
@@ -203,33 +203,33 @@ void LayerTreeHostQt::sizeDidChange(const WebCore::IntSize& newSize)
scheduleLayerFlush();
}
-void LayerTreeHostQt::didInstallPageOverlay()
+void LayerTreeCoordinator::didInstallPageOverlay()
{
createPageOverlayLayer();
scheduleLayerFlush();
}
-void LayerTreeHostQt::didUninstallPageOverlay()
+void LayerTreeCoordinator::didUninstallPageOverlay()
{
destroyPageOverlayLayer();
scheduleLayerFlush();
}
-void LayerTreeHostQt::setPageOverlayNeedsDisplay(const WebCore::IntRect& rect)
+void LayerTreeCoordinator::setPageOverlayNeedsDisplay(const WebCore::IntRect& rect)
{
ASSERT(m_pageOverlayLayer);
m_pageOverlayLayer->setNeedsDisplayInRect(rect);
scheduleLayerFlush();
}
-void LayerTreeHostQt::setPageOverlayOpacity(float value)
+void LayerTreeCoordinator::setPageOverlayOpacity(float value)
{
ASSERT(m_pageOverlayLayer);
m_pageOverlayLayer->setOpacity(value);
scheduleLayerFlush();
}
-bool LayerTreeHostQt::flushPendingLayerChanges()
+bool LayerTreeCoordinator::flushPendingLayerChanges()
{
bool didSync = m_webPage->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes();
m_nonCompositedContentLayer->syncCompositingStateForThisLayerOnly();
@@ -240,37 +240,37 @@ bool LayerTreeHostQt::flushPendingLayerChanges()
return didSync;
}
-void LayerTreeHostQt::syncLayerState(WebLayerID id, const WebLayerInfo& info)
+void LayerTreeCoordinator::syncLayerState(WebLayerID id, const WebLayerInfo& info)
{
if (m_shouldSendScrollPositionUpdate) {
- m_webPage->send(Messages::LayerTreeHostProxy::DidChangeScrollPosition(m_visibleContentsRect.location()));
+ m_webPage->send(Messages::LayerTreeCoordinatorProxy::DidChangeScrollPosition(m_visibleContentsRect.location()));
m_shouldSendScrollPositionUpdate = false;
}
m_shouldSyncFrame = true;
- m_webPage->send(Messages::LayerTreeHostProxy::SetCompositingLayerState(id, info));
+ m_webPage->send(Messages::LayerTreeCoordinatorProxy::SetCompositingLayerState(id, info));
}
-void LayerTreeHostQt::syncLayerChildren(WebLayerID id, const Vector<WebLayerID>& children)
+void LayerTreeCoordinator::syncLayerChildren(WebLayerID id, const Vector<WebLayerID>& children)
{
m_shouldSyncFrame = true;
- m_webPage->send(Messages::LayerTreeHostProxy::SetCompositingLayerChildren(id, children));
+ m_webPage->send(Messages::LayerTreeCoordinatorProxy::SetCompositingLayerChildren(id, children));
}
-void LayerTreeHostQt::syncCanvas(WebLayerID id, const IntSize& canvasSize, uint32_t graphicsSurfaceToken)
+void LayerTreeCoordinator::syncCanvas(WebLayerID id, const IntSize& canvasSize, uint32_t graphicsSurfaceToken)
{
m_shouldSyncFrame = true;
- m_webPage->send(Messages::LayerTreeHostProxy::SyncCanvas(id, canvasSize, graphicsSurfaceToken));
+ m_webPage->send(Messages::LayerTreeCoordinatorProxy::SyncCanvas(id, canvasSize, graphicsSurfaceToken));
}
#if ENABLE(CSS_FILTERS)
-void LayerTreeHostQt::syncLayerFilters(WebLayerID id, const FilterOperations& filters)
+void LayerTreeCoordinator::syncLayerFilters(WebLayerID id, const FilterOperations& filters)
{
m_shouldSyncFrame = true;
- m_webPage->send(Messages::LayerTreeHostProxy::SetCompositingLayerFilters(id, filters));
+ m_webPage->send(Messages::LayerTreeCoordinatorProxy::SetCompositingLayerFilters(id, filters));
}
#endif
-void LayerTreeHostQt::attachLayer(WebGraphicsLayer* layer)
+void LayerTreeCoordinator::attachLayer(WebGraphicsLayer* layer)
{
ASSERT(!m_registeredLayers.contains(layer));
m_registeredLayers.add(layer);
@@ -279,11 +279,11 @@ void LayerTreeHostQt::attachLayer(WebGraphicsLayer* layer)
layer->adjustVisibleRect();
}
-void LayerTreeHostQt::detachLayer(WebGraphicsLayer* layer)
+void LayerTreeCoordinator::detachLayer(WebGraphicsLayer* layer)
{
m_registeredLayers.remove(layer);
m_shouldSyncFrame = true;
- m_webPage->send(Messages::LayerTreeHostProxy::DeleteCompositingLayer(layer->id()));
+ m_webPage->send(Messages::LayerTreeCoordinatorProxy::DeleteCompositingLayer(layer->id()));
}
static void updateOffsetFromViewportForSelf(RenderLayer* renderLayer)
@@ -320,7 +320,7 @@ static void updateOffsetFromViewportForLayer(RenderLayer* renderLayer)
updateOffsetFromViewportForLayer(renderLayer->nextSibling());
}
-void LayerTreeHostQt::syncFixedLayers()
+void LayerTreeCoordinator::syncFixedLayers()
{
if (!m_webPage->corePage()->settings() || !m_webPage->corePage()->settings()->acceleratedCompositingForFixedPositionEnabled())
return;
@@ -334,7 +334,7 @@ void LayerTreeHostQt::syncFixedLayers()
updateOffsetFromViewportForLayer(rootRenderLayer->firstChild());
}
-void LayerTreeHostQt::performScheduledLayerFlush()
+void LayerTreeCoordinator::performScheduledLayerFlush()
{
if (m_isSuspended || m_waitingForUIProcess)
return;
@@ -350,11 +350,11 @@ void LayerTreeHostQt::performScheduledLayerFlush()
return;
if (m_shouldSyncRootLayer) {
- m_webPage->send(Messages::LayerTreeHostProxy::SetRootCompositingLayer(toWebGraphicsLayer(m_rootLayer.get())->id()));
+ m_webPage->send(Messages::LayerTreeCoordinatorProxy::SetRootCompositingLayer(toWebGraphicsLayer(m_rootLayer.get())->id()));
m_shouldSyncRootLayer = false;
}
- m_webPage->send(Messages::LayerTreeHostProxy::DidRenderFrame());
+ m_webPage->send(Messages::LayerTreeCoordinatorProxy::DidRenderFrame());
m_waitingForUIProcess = true;
if (!m_notifyAfterScheduledLayerFlush)
@@ -365,18 +365,18 @@ void LayerTreeHostQt::performScheduledLayerFlush()
m_notifyAfterScheduledLayerFlush = false;
}
-void LayerTreeHostQt::layerFlushTimerFired(Timer<LayerTreeHostQt>*)
+void LayerTreeCoordinator::layerFlushTimerFired(Timer<LayerTreeCoordinator>*)
{
performScheduledLayerFlush();
}
-void LayerTreeHostQt::createPageOverlayLayer()
+void LayerTreeCoordinator::createPageOverlayLayer()
{
ASSERT(!m_pageOverlayLayer);
m_pageOverlayLayer = GraphicsLayer::create(this);
#ifndef NDEBUG
- m_pageOverlayLayer->setName("LayerTreeHostQt page overlay content");
+ m_pageOverlayLayer->setName("LayerTreeCoordinator page overlay content");
#endif
m_pageOverlayLayer->setDrawsContent(true);
@@ -385,23 +385,29 @@ void LayerTreeHostQt::createPageOverlayLayer()
m_rootLayer->addChild(m_pageOverlayLayer.get());
}
-void LayerTreeHostQt::destroyPageOverlayLayer()
+void LayerTreeCoordinator::destroyPageOverlayLayer()
{
ASSERT(m_pageOverlayLayer);
m_pageOverlayLayer->removeFromParent();
m_pageOverlayLayer = nullptr;
}
-int64_t LayerTreeHostQt::adoptImageBackingStore(Image* image)
+int64_t LayerTreeCoordinator::adoptImageBackingStore(Image* image)
{
if (!image)
return InvalidWebLayerID;
+
+ int64_t key = 0;
+
+#if PLATFORM(QT)
QPixmap* pixmap = image->nativeImageForCurrentFrame();
if (!pixmap)
return InvalidWebLayerID;
- int64_t key = pixmap->cacheKey();
+ key = pixmap->cacheKey();
+#endif
+
HashMap<int64_t, int>::iterator it = m_directlyCompositedImageRefCounts.find(key);
if (it != m_directlyCompositedImageRefCounts.end()) {
@@ -417,12 +423,12 @@ int64_t LayerTreeHostQt::adoptImageBackingStore(Image* image)
ShareableBitmap::Handle handle;
bitmap->createHandle(handle);
- m_webPage->send(Messages::LayerTreeHostProxy::CreateDirectlyCompositedImage(key, handle));
+ m_webPage->send(Messages::LayerTreeCoordinatorProxy::CreateDirectlyCompositedImage(key, handle));
m_directlyCompositedImageRefCounts.add(key, 1);
return key;
}
-void LayerTreeHostQt::releaseImageBackingStore(int64_t key)
+void LayerTreeCoordinator::releaseImageBackingStore(int64_t key)
{
if (!key)
return;
@@ -436,19 +442,19 @@ void LayerTreeHostQt::releaseImageBackingStore(int64_t key)
return;
m_directlyCompositedImageRefCounts.remove(it);
- m_webPage->send(Messages::LayerTreeHostProxy::DestroyDirectlyCompositedImage(key));
+ m_webPage->send(Messages::LayerTreeCoordinatorProxy::DestroyDirectlyCompositedImage(key));
}
-void LayerTreeHostQt::notifyAnimationStarted(const WebCore::GraphicsLayer*, double time)
+void LayerTreeCoordinator::notifyAnimationStarted(const WebCore::GraphicsLayer*, double time)
{
}
-void LayerTreeHostQt::notifySyncRequired(const WebCore::GraphicsLayer*)
+void LayerTreeCoordinator::notifySyncRequired(const WebCore::GraphicsLayer*)
{
}
-void LayerTreeHostQt::paintContents(const WebCore::GraphicsLayer* graphicsLayer, WebCore::GraphicsContext& graphicsContext, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect)
+void LayerTreeCoordinator::paintContents(const WebCore::GraphicsLayer* graphicsLayer, WebCore::GraphicsContext& graphicsContext, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect)
{
if (graphicsLayer == m_nonCompositedContentLayer) {
m_webPage->drawRect(graphicsContext, clipRect);
@@ -463,12 +469,12 @@ void LayerTreeHostQt::paintContents(const WebCore::GraphicsLayer* graphicsLayer,
}
}
-bool LayerTreeHostQt::showDebugBorders(const WebCore::GraphicsLayer*) const
+bool LayerTreeCoordinator::showDebugBorders(const WebCore::GraphicsLayer*) const
{
return m_webPage->corePage()->settings()->showDebugBorders();
}
-bool LayerTreeHostQt::showRepaintCounter(const WebCore::GraphicsLayer*) const
+bool LayerTreeCoordinator::showRepaintCounter(const WebCore::GraphicsLayer*) const
{
return m_webPage->corePage()->settings()->showRepaintCounter();
}
@@ -478,30 +484,30 @@ bool LayerTreeHost::supportsAcceleratedCompositing()
return true;
}
-void LayerTreeHostQt::createTile(WebLayerID layerID, int tileID, const SurfaceUpdateInfo& updateInfo, const WebCore::IntRect& targetRect)
+void LayerTreeCoordinator::createTile(WebLayerID layerID, int tileID, const SurfaceUpdateInfo& updateInfo, const WebCore::IntRect& targetRect)
{
m_shouldSyncFrame = true;
- m_webPage->send(Messages::LayerTreeHostProxy::CreateTileForLayer(layerID, tileID, targetRect, updateInfo));
+ m_webPage->send(Messages::LayerTreeCoordinatorProxy::CreateTileForLayer(layerID, tileID, targetRect, updateInfo));
}
-void LayerTreeHostQt::updateTile(WebLayerID layerID, int tileID, const SurfaceUpdateInfo& updateInfo, const WebCore::IntRect& targetRect)
+void LayerTreeCoordinator::updateTile(WebLayerID layerID, int tileID, const SurfaceUpdateInfo& updateInfo, const WebCore::IntRect& targetRect)
{
m_shouldSyncFrame = true;
- m_webPage->send(Messages::LayerTreeHostProxy::UpdateTileForLayer(layerID, tileID, targetRect, updateInfo));
+ m_webPage->send(Messages::LayerTreeCoordinatorProxy::UpdateTileForLayer(layerID, tileID, targetRect, updateInfo));
}
-void LayerTreeHostQt::removeTile(WebLayerID layerID, int tileID)
+void LayerTreeCoordinator::removeTile(WebLayerID layerID, int tileID)
{
m_shouldSyncFrame = true;
- m_webPage->send(Messages::LayerTreeHostProxy::RemoveTileForLayer(layerID, tileID));
+ m_webPage->send(Messages::LayerTreeCoordinatorProxy::RemoveTileForLayer(layerID, tileID));
}
-WebCore::IntRect LayerTreeHostQt::visibleContentsRect() const
+WebCore::IntRect LayerTreeCoordinator::visibleContentsRect() const
{
return m_visibleContentsRect;
}
-void LayerTreeHostQt::setVisibleContentsRect(const IntRect& rect, float scale, const FloatPoint& trajectoryVector)
+void LayerTreeCoordinator::setVisibleContentsRect(const IntRect& rect, float scale, const FloatPoint& trajectoryVector)
{
bool contentsRectDidChange = rect != m_visibleContentsRect;
bool contentsScaleDidChange = scale != m_contentsScale;
@@ -529,7 +535,7 @@ void LayerTreeHostQt::setVisibleContentsRect(const IntRect& rect, float scale, c
m_shouldSendScrollPositionUpdate = true;
}
-void LayerTreeHostQt::renderNextFrame()
+void LayerTreeCoordinator::renderNextFrame()
{
m_waitingForUIProcess = false;
scheduleLayerFlush();
@@ -537,12 +543,12 @@ void LayerTreeHostQt::renderNextFrame()
m_updateAtlases[i].didSwapBuffers();
}
-bool LayerTreeHostQt::layerTreeTileUpdatesAllowed() const
+bool LayerTreeCoordinator::layerTreeTileUpdatesAllowed() const
{
return !m_isSuspended && !m_waitingForUIProcess;
}
-void LayerTreeHostQt::purgeBackingStores()
+void LayerTreeCoordinator::purgeBackingStores()
{
HashSet<WebCore::WebGraphicsLayer*>::iterator end = m_registeredLayers.end();
for (HashSet<WebCore::WebGraphicsLayer*>::iterator it = m_registeredLayers.begin(); it != end; ++it)
@@ -552,7 +558,7 @@ void LayerTreeHostQt::purgeBackingStores()
m_updateAtlases.clear();
}
-PassOwnPtr<WebCore::GraphicsContext> LayerTreeHostQt::beginContentUpdate(const WebCore::IntSize& size, ShareableBitmap::Flags flags, ShareableSurface::Handle& handle, WebCore::IntPoint& offset)
+PassOwnPtr<WebCore::GraphicsContext> LayerTreeCoordinator::beginContentUpdate(const WebCore::IntSize& size, ShareableBitmap::Flags flags, ShareableSurface::Handle& handle, WebCore::IntPoint& offset)
{
OwnPtr<WebCore::GraphicsContext> graphicsContext;
for (int i = 0; i < m_updateAtlases.size(); ++i) {
diff --git a/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.h b/Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.h
index e5853ad03..bc449f46a 100644
--- a/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.h
+++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.h
@@ -17,8 +17,8 @@
Boston, MA 02110-1301, USA.
*/
-#ifndef LayerTreeHostQt_h
-#define LayerTreeHostQt_h
+#ifndef LayerTreeCoordinator_h
+#define LayerTreeCoordinator_h
#include "LayerTreeContext.h"
#include "LayerTreeHost.h"
@@ -33,12 +33,11 @@ namespace WebKit {
class UpdateInfo;
class WebPage;
-class LayerTreeHostQt : public LayerTreeHost, WebCore::GraphicsLayerClient
- , public WebGraphicsLayerClient
-{
+class LayerTreeCoordinator : public LayerTreeHost, WebCore::GraphicsLayerClient
+ , public WebGraphicsLayerClient {
public:
- static PassRefPtr<LayerTreeHostQt> create(WebPage*);
- virtual ~LayerTreeHostQt();
+ static PassRefPtr<LayerTreeCoordinator> create(WebPage*);
+ virtual ~LayerTreeCoordinator();
static bool supportsAcceleratedCompositing();
@@ -74,6 +73,8 @@ public:
virtual void purgeBackingStores();
virtual bool layerTreeTileUpdatesAllowed() const;
virtual void setVisibleContentsRect(const WebCore::IntRect&, float scale, const WebCore::FloatPoint&);
+ virtual void didReceiveLayerTreeCoordinatorMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+
virtual void syncLayerState(WebLayerID, const WebLayerInfo&);
virtual void syncLayerChildren(WebLayerID, const Vector<WebLayerID>&);
#if ENABLE(CSS_FILTERS)
@@ -87,7 +88,7 @@ public:
virtual PassOwnPtr<WebCore::GraphicsContext> beginContentUpdate(const WebCore::IntSize&, ShareableBitmap::Flags, ShareableSurface::Handle&, WebCore::IntPoint&);
protected:
- explicit LayerTreeHostQt(WebPage*);
+ explicit LayerTreeCoordinator(WebPage*);
private:
// GraphicsLayerClient
@@ -97,7 +98,7 @@ private:
virtual bool showDebugBorders(const WebCore::GraphicsLayer*) const;
virtual bool showRepaintCounter(const WebCore::GraphicsLayer*) const;
- // LayerTreeHostQt
+ // LayerTreeCoordinator
void createPageOverlayLayer();
void destroyPageOverlayLayer();
bool flushPendingLayerChanges();
@@ -129,11 +130,11 @@ private:
LayerTreeContext m_layerTreeContext;
bool m_shouldSyncFrame;
bool m_shouldSyncRootLayer;
- void layerFlushTimerFired(WebCore::Timer<LayerTreeHostQt>*);
- WebCore::Timer<LayerTreeHostQt> m_layerFlushTimer;
+ void layerFlushTimerFired(WebCore::Timer<LayerTreeCoordinator>*);
+ WebCore::Timer<LayerTreeCoordinator> m_layerFlushTimer;
bool m_layerFlushSchedulingEnabled;
};
}
-#endif // LayerTreeHostQt_h
+#endif // LayerTreeCoordinator_h
diff --git a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.messages.in b/Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.messages.in
index 8920de27f..aff6f96ad 100644
--- a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.messages.in
+++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.messages.in
@@ -18,8 +18,8 @@
#
-#if USE(TILED_BACKING_STORE)
-messages -> LayerTreeHost {
+#if USE(UI_SIDE_COMPOSITING)
+messages -> LayerTreeCoordinator {
SetVisibleContentsRect(WebCore::IntRect visibleContentsRect, float scale, WebCore::FloatPoint trajectoryVectory)
RenderNextFrame()
PurgeBackingStores()
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp b/Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/WebGraphicsLayer.cpp
index 88d64eb01..581491245 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/WebGraphicsLayer.cpp
@@ -28,7 +28,7 @@
#include "FrameView.h"
#include "GraphicsContext.h"
#include "GraphicsLayer.h"
-#include "LayerTreeHostProxyMessages.h"
+#include "LayerTreeCoordinatorProxyMessages.h"
#include "Page.h"
#include "TextureMapperPlatformLayer.h"
#include "TiledBackingStoreRemoteTile.h"
@@ -456,7 +456,7 @@ void WebGraphicsLayer::syncFilters()
#endif
void WebGraphicsLayer::syncLayerState()
- {
+{
if (!m_shouldSyncLayerState)
return;
m_shouldSyncLayerState = false;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h b/Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/WebGraphicsLayer.h
index cdd780615..649c9a950 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h
+++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/WebGraphicsLayer.h
@@ -74,8 +74,7 @@ namespace WebCore {
class WebGraphicsLayer : public WebCore::GraphicsLayer
, public TiledBackingStoreClient
- , public WebKit::TiledBackingStoreRemoteTileClient
-{
+ , public WebKit::TiledBackingStoreRemoteTileClient {
public:
WebGraphicsLayer(GraphicsLayerClient*);
virtual ~WebGraphicsLayer();
diff --git a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp
index 5a9b8b40f..bf011e085 100644
--- a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp
@@ -35,7 +35,7 @@
#endif
#if PLATFORM(QT)
-#include "qt/LayerTreeHostQt.h"
+#include "LayerTreeCoordinator.h"
#endif
#if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
@@ -53,7 +53,7 @@ PassRefPtr<LayerTreeHost> LayerTreeHost::create(WebPage* webPage)
#elif PLATFORM(WIN) && HAVE(WKQCA)
return LayerTreeHostCAWin::create(webPage);
#elif PLATFORM(QT)
- return LayerTreeHostQt::create(webPage);
+ return LayerTreeCoordinator::create(webPage);
#elif PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
return LayerTreeHostGtk::create(webPage);
#else
diff --git a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
index e503c2371..b49cc90bd 100644
--- a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
+++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
@@ -86,7 +86,7 @@ public:
virtual void setVisibleContentsRectForLayer(int layerID, const WebCore::IntRect&) { }
virtual void renderNextFrame() { }
virtual void purgeBackingStores() { }
- virtual void didReceiveLayerTreeHostMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveLayerTreeCoordinatorMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) = 0;
#endif
#if PLATFORM(WIN)
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
index 953e9b046..b4e19bfe7 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -2605,9 +2605,9 @@ void WebPage::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Messag
}
#if USE(TILED_BACKING_STORE) && USE(ACCELERATED_COMPOSITING)
- if (messageID.is<CoreIPC::MessageClassLayerTreeHost>()) {
+ if (messageID.is<CoreIPC::MessageClassLayerTreeCoordinator>()) {
if (m_drawingArea)
- m_drawingArea->didReceiveLayerTreeHostMessage(connection, messageID, arguments);
+ m_drawingArea->didReceiveLayerTreeCoordinatorMessage(connection, messageID, arguments);
return;
}
#endif
diff --git a/Source/WebKit2/qt/MainQt.cpp b/Source/WebKit2/qt/MainQt.cpp
index 97879c928..16e4faa2e 100644
--- a/Source/WebKit2/qt/MainQt.cpp
+++ b/Source/WebKit2/qt/MainQt.cpp
@@ -34,7 +34,9 @@
namespace WebKit {
Q_DECL_IMPORT int WebProcessMainQt(QGuiApplication*);
+#if !defined(QT_NO_WIDGETS)
Q_DECL_IMPORT void initializeWebKit2Theme();
+#endif
}
#if !defined(NDEBUG) && defined(Q_OS_UNIX)
@@ -72,7 +74,9 @@ int main(int argc, char** argv)
}
#endif
+#if !defined(QT_NO_WIDGETS)
WebKit::initializeWebKit2Theme();
+#endif
// Has to be done before QApplication is constructed in case
// QApplication itself produces debug output.
diff --git a/Source/api.pri b/Source/api.pri
index 3554e58da..7ae29fc5a 100644
--- a/Source/api.pri
+++ b/Source/api.pri
@@ -126,8 +126,6 @@ runSyncQt() # Generate forwarding headers for the QtWebKit API
load(features)
-include(WebKit/WebKit.pri)
-
WEBKIT += wtf
!v8:WEBKIT += javascriptcore
@@ -138,150 +136,13 @@ WEBKIT += webcore
WEBKIT += webkit2
QT += declarative
- # Ensure that changes to the WebKit2 API will trigger a qmake of this
+ # Ensure that changes to the WebKit1 and WebKit2 API will trigger a qmake of this
# file, which in turn runs syncqt to update the forwarding headers.
QMAKE_INTERNAL_INCLUDED_FILES *= WebKit2/Target.pri
+ QMAKE_INTERNAL_INCLUDED_FILES *= WebKit/WebKit1.pro
}
-QT += network
-haveQt(5): QT += widgets printsupport quick
-
-contains(DEFINES, WTF_USE_TEXTURE_MAPPER_GL=1)|contains(DEFINES, ENABLE_WEBGL=1) {
- QT *= opengl
- # Make sure OpenGL libs are after the webcore lib so MinGW can resolve symbols
- win32*:!win32-msvc*: LIBS += $$QMAKE_LIBS_OPENGL
-}
-
-!static: DEFINES += QT_MAKEDLL
-
-SOURCES += \
- $$PWD/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/QtWebComboBox.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/DragClientQt.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/EditorClientQt.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/UndoStepQt.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/InitWebCoreQt.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/PageClientQt.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/RenderThemeQStyle.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/ScrollbarThemeQStyle.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/TextCheckerClientQt.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.cpp \
- $$PWD/WebKit/qt/WebCoreSupport/WebEventConversion.cpp
-
-HEADERS += \
- $$PWD/WebKit/qt/WebCoreSupport/InitWebCoreQt.h \
- $$PWD/WebKit/qt/WebCoreSupport/InspectorServerQt.h \
- $$PWD/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h \
- $$PWD/WebKit/qt/WebCoreSupport/QtWebComboBox.h \
- $$PWD/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h \
- $$PWD/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h \
- $$PWD/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.h \
- $$PWD/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h \
- $$PWD/WebKit/qt/WebCoreSupport/PageClientQt.h \
- $$PWD/WebKit/qt/WebCoreSupport/PopupMenuQt.h \
- $$PWD/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h \
- $$PWD/WebKit/qt/WebCoreSupport/RenderThemeQStyle.h \
- $$PWD/WebKit/qt/WebCoreSupport/ScrollbarThemeQStyle.h \
- $$PWD/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.h \
- $$PWD/WebKit/qt/WebCoreSupport/TextCheckerClientQt.h \
- $$PWD/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.h \
- $$PWD/WebKit/qt/WebCoreSupport/WebEventConversion.h
-
-INCLUDEPATH += \
- $$PWD/WebKit/qt/Api \
- $$PWD/WebKit/qt/WebCoreSupport \
- $$PWD/WTF/wtf/qt
-
-contains(DEFINES, ENABLE_VIDEO=1) {
- !contains(DEFINES, WTF_USE_QTKIT=1):!contains(DEFINES, WTF_USE_GSTREAMER=1):contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
- HEADERS += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.h
- SOURCES += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.cpp
- }
-
- contains(DEFINES, WTF_USE_QTKIT=1) | contains(DEFINES, WTF_USE_GSTREAMER=1) | contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
- HEADERS += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h
- SOURCES += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp
- }
-
- contains(DEFINES, WTF_USE_QTKIT=1) {
- INCLUDEPATH += \
- $$PWD/WebCore/platform/qt/ \
- $$PWD/WebCore/platform/mac/ \
- $$PWD/../WebKitLibraries/
-
- DEFINES += NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
-
- contains(CONFIG, "x86") {
- DEFINES+=NS_BUILD_32_LIKE_64
- }
-
- HEADERS += \
- $$PWD/WebKit/qt/WebCoreSupport/WebSystemInterface.h \
- $$PWD/WebKit/qt/WebCoreSupport/QTKitFullScreenVideoHandler.h
-
- OBJECTIVE_SOURCES += \
- $$PWD/WebKit/qt/WebCoreSupport/WebSystemInterface.mm \
- $$PWD/WebKit/qt/WebCoreSupport/QTKitFullScreenVideoHandler.mm
-
- LIBS += -framework Security -framework IOKit
-
- # We can know the Mac OS version by using the Darwin major version
- DARWIN_VERSION = $$split(QMAKE_HOST.version, ".")
- DARWIN_MAJOR_VERSION = $$first(DARWIN_VERSION)
- equals(DARWIN_MAJOR_VERSION, "11") {
- LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLion.a
- } else:equals(DARWIN_MAJOR_VERSION, "10") {
- LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
- } else:equals(DARWIN_MAJOR_VERSION, "9") {
- LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
- }
- }
-}
-
-contains(DEFINES, ENABLE_ICONDATABASE=1) {
- HEADERS += \
- $$PWD/WebCore/loader/icon/IconDatabaseClient.h \
- $$PWD/WebKit/qt/WebCoreSupport/IconDatabaseClientQt.h
-
- SOURCES += \
- $$PWD/WebKit/qt/WebCoreSupport/IconDatabaseClientQt.cpp
-}
-
-contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) || contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1) {
- haveQt(5) {
- QT += sensors
- } else {
- CONFIG *= mobility
- MOBILITY *= sensors
- }
-}
-
-contains(DEFINES, ENABLE_GEOLOCATION=1) {
- haveQt(5): QT += location
-
- HEADERS += \
- $$PWD/WebKit/qt/WebCoreSupport/GeolocationClientQt.h
- SOURCES += \
- $$PWD/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp
-}
-
-contains(CONFIG, texmap) {
- DEFINES += WTF_USE_TEXTURE_MAPPER=1
-}
-
-plugin_backend_xlib: PKGCONFIG += x11
+!no_webkit1: WEBKIT += webkit1
# ------------- Install rules -------------
diff --git a/Source/cmake/FindEFL.cmake b/Source/cmake/FindEFL.cmake
index 4a4cab029..1466f8b2c 100644
--- a/Source/cmake/FindEFL.cmake
+++ b/Source/cmake/FindEFL.cmake
@@ -12,7 +12,8 @@ PKG_CHECK_MODULES (EFLDEPS REQUIRED
edje>=1.0.0
eukit>=1.1.0
edbus>=1.1.0
- ecore-input>=1.0.0)
+ ecore-input>=1.0.0
+ eeze>=1.1.99)
PKG_CHECK_MODULES (EINA REQUIRED eina>=1.0.0)
PKG_CHECK_MODULES (ECORE_X ecore-x>=1.0.0)
PKG_CHECK_MODULES (EVAS REQUIRED evas>=1.0.0)
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg b/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg
index c89b38033..9e57d323e 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg
@@ -114,8 +114,12 @@ class ConfigureBuild(buildstep.BuildStep):
class CheckOutSource(source.SVN):
baseURL = "http://svn.webkit.org/repository/webkit/"
mode = "update"
- def __init__(self, *args, **kwargs):
- source.SVN.__init__(self, baseURL=self.baseURL, defaultBranch="trunk", mode=self.mode, *args, **kwargs)
+ def __init__(self, **kwargs):
+ kwargs['baseURL'] = self.baseURL
+ kwargs['defaultBranch'] = "trunk"
+ kwargs['mode'] = self.mode
+ source.SVN.__init__(self, **kwargs)
+
class InstallWin32Dependencies(shell.Compile):
@@ -303,8 +307,11 @@ class RunWebKitTests(shell.Test):
def start(self):
platform = self.getProperty('platform')
appendCustomBuildFlags(self, platform, self.getProperty('fullPlatform'))
+ if platform.startswith('mac'):
+ self.setCommand(self.command + ['--no-build'])
if platform == "win":
rootArgument = ['--root=' + os.path.join("WebKitBuild", self.getProperty('configuration'), "bin")]
+ self.setCommand(self.command + ['--no-build'])
else:
rootArgument = ['--root=WebKitBuild/bin']
if not self.buildJSCTool:
@@ -414,6 +421,8 @@ class RunUnitTests(TestWithFailureCount):
platform = self.getProperty('platform')
if platform == 'win':
self.setCommand(self.command + ['--no-build'])
+ if platform.startswith('mac'):
+ self.setCommand(self.command + ['--no-build'])
if platform.startswith('chromium'):
self.setCommand(self.command + ['--chromium'])
return shell.Test.start(self)
@@ -663,7 +672,7 @@ class Factory(factory.BuildFactory):
def __init__(self, platform, configuration, architectures, buildOnly):
factory.BuildFactory.__init__(self)
self.addStep(ConfigureBuild, platform=platform, configuration=configuration, architecture=" ".join(architectures), buildOnly=buildOnly)
- self.addStep(CheckOutSource)
+ self.addStep(CheckOutSource())
# There are multiple Qt slaves running on same machines, so buildslaves shouldn't kill the processes of other slaves.
if not platform.startswith("qt"):
self.addStep(KillOldProcesses)
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders.js
index 24bdb1630..d45ce2233 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders.js
@@ -30,7 +30,7 @@ var builders = builders || {};
var kUpdateStepName = 'update';
var kUpdateScriptsStepName = 'update_scripts';
var kCompileStepName = 'compile';
-var kWebKitTestsStepName = 'webkit_tests';
+var kWebKitTestsStepNames = ['webkit_tests', 'layout-test'];
var kCrashedOrHungOutputMarker = 'crashed or hung';
@@ -51,8 +51,9 @@ function urlForBuildInfo(platform, builderName, buildNumber)
function didFail(step)
{
- if (step.name == kWebKitTestsStepName) {
+ if (kWebKitTestsStepNames.indexOf(step.name) != -1) {
// run-webkit-tests fails to generate test coverage when it crashes or hangs.
+ // FIXME: Do build.webkit.org bots output this marker when the tests fail to run?
return step.text.indexOf(kCrashedOrHungOutputMarker) != -1;
}
return step.results[0] > 0 && step.text.indexOf('warning') == -1;
@@ -94,10 +95,7 @@ function fetchMostRecentBuildInfoByBuilder(platform, callback)
var builderNames = Object.keys(builderStatus);
var requestTracker = new base.RequestTracker(builderNames.length, callback, [buildInfoByBuilder]);
builderNames.forEach(function(builderName) {
- // FIXME: Should garden-o-matic show these? I can imagine showing the deps bots being useful at least so
- // that the gardener only need to look at garden-o-matic and never at the waterfall. Not really sure who
- // watches the GPU bots.
- if (builderName.indexOf('GPU') != -1 || builderName.indexOf('deps') != -1 || builderName.indexOf('ASAN') != -1) {
+ if (!config.kPlatforms[config.currentPlatform].builderApplies(builderName)) {
requestTracker.requestComplete();
return;
}
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders_unittests.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders_unittests.js
index 7e0f38d8f..7f23d390f 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders_unittests.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders_unittests.js
@@ -57,6 +57,36 @@ var kExampleBuilderStatusJSON = {
},
};
+var kExampleWebKitDotOrgBuilderStatusJSON = {
+ "Apple Lion Release WK2 (Tests)": {
+ "basedir": "Webkit_Linux",
+ "cachedBuilds": [11459, 11460, 11461, 11462],
+ "category": "6webkit linux latest",
+ "currentBuilds": [11462],
+ "pendingBuilds": 0,
+ "slaves": ["vm124-m1"],
+ "state": "building"
+ },
+ "GTK Linux 64-bit Debug": {
+ "basedir": "Webkit_Linux",
+ "cachedBuilds": [11459, 11460, 11461, 11462],
+ "category": "6webkit linux latest",
+ "currentBuilds": [11461, 11462],
+ "pendingBuilds": 0,
+ "slaves": ["vm124-m1"],
+ "state": "building"
+ },
+ "Qt Linux Release": {
+ "basedir": "Webkit_Linux",
+ "cachedBuilds": [11459, 11460, 11461, 11462],
+ "category": "6webkit linux latest",
+ "currentBuilds": [11461, 11462],
+ "pendingBuilds": 0,
+ "slaves": ["vm124-m1"],
+ "state": "building"
+ },
+};
+
var kExampleBuildInfoJSON = {
"blame": ["abarth@webkit.org"],
"builderName": "Webkit Linux",
@@ -648,7 +678,7 @@ var kExampleBuildInfoWithTaskKillWarning = {
"expectations": [["output",1776,1534.0625014267862]],
"isFinished": true,
"isStarted": true,
- "logs": [["stdio","http://build.chromium.org/p/chromium.webkitbuilders/Vista%20Perf/builds/10268/steps/taskkill/logs/stdio"]],
+ "logs": [["stdio","http://build.chromium.org/p/chromium.webkitbuilders/XP%20Perf/builds/10268/steps/taskkill/logs/stdio"]],
"name": "taskkill",
"results": [1,[]],
"statistics": {},
@@ -993,6 +1023,51 @@ test("buildersFailing", 3, function() {
]);
});
+test("buildersFailing (Apple)", 3, function() {
+ var simulator = new NetworkSimulator();
+ builders.clearBuildInfoCache();
+
+ config.currentPlatform = 'apple';
+
+ var failingBuildInfoJSON = JSON.parse(JSON.stringify(kExampleBuildInfoJSON));
+ failingBuildInfoJSON.number = 11460;
+ failingBuildInfoJSON.steps[2].results[0] = 1;
+
+ var requestedURLs = [];
+ simulator.get = function(url, callback)
+ {
+ requestedURLs.push(url);
+ simulator.scheduleCallback(function() {
+ if (/\/json\/builders$/.exec(url))
+ callback(kExampleWebKitDotOrgBuilderStatusJSON);
+ else if (/Apple%20Lion%20Release%20WK2%20\(Tests\)/.exec(url))
+ callback(kExampleBuildInfoJSON);
+ else {
+ ok(false, "Unexpected URL: " + url);
+ callback();
+ }
+ });
+ };
+
+ simulator.runTest(function() {
+ builders.buildersFailingNonLayoutTests(function(builderNameList) {
+ deepEqual(builderNameList, {
+ "Apple Lion Release WK2 (Tests)": [
+ "webkit_gpu_tests"
+ ]
+ });
+ });
+ });
+
+ deepEqual(requestedURLs, [
+ "http://build.webkit.org/json/builders",
+ "http://build.webkit.org/json/builders/Apple%20Lion%20Release%20WK2%20(Tests)/builds/11461"
+ ]);
+
+ config.currentPlatform = 'chromium';
+});
+
+
test("buildersFailing (run-webkit-tests crash)", 3, function() {
var simulator = new NetworkSimulator();
builders.clearBuildInfoCache();
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js
index cca7cf8d0..83d8cd377 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js
@@ -56,7 +56,7 @@ test("updateExpectations", 4, function() {
});
});
-test("rebaseline", 4, function() {
+test("rebaseline", 3, function() {
var simulator = new NetworkSimulator();
var requests = [];
@@ -67,8 +67,8 @@ test("rebaseline", 4, function() {
};
simulator.ajax = function(options)
{
- if (options.url.indexOf('/ping') != -1)
- ok(false, 'Recieved non-ping ajax request.');
+ if (options.url.indexOf('/ping') == -1)
+ ok(false, 'Received non-ping ajax request: ' + options.url);
simulator.scheduleCallback(options.success);
};
@@ -88,7 +88,7 @@ test("rebaseline", 4, function() {
'testName': 'another/test.svg',
'failureTypeList': ['IMAGE', 'TEXT', 'IMAGE+TEXT'],
}, {
- 'builderName': 'Webkit Vista',
+ 'builderName': 'Webkit Win7',
'testName': 'fast/test.html',
'failureTypeList': ['IMAGE+TEXT'],
}], function() {
@@ -107,7 +107,7 @@ test("rebaseline", 4, function() {
"WebKit Linux": ["png"],
"WebKit Mac10.6": ["png","txt"]},
"fast/test.html": {
- "Webkit Vista": ["txt","png"]
+ "Webkit Win7": ["txt","png"]
}})]
]);
});
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js
index 40097dcb8..b0a6836cb 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js
@@ -50,6 +50,9 @@ config.kPlatforms = {
resultsDirectoryForBuildNumber: function(buildNumber, revision) {
return encodeURIComponent('r' + revision + ' (' + buildNumber + ')');
},
+ builderApplies: function(builderName) {
+ return builderName.indexOf('Apple') != -1;
+ },
},
'chromium' : {
label : 'Chromium',
@@ -58,7 +61,6 @@ config.kPlatforms = {
waterfallURL: 'http://build.chromium.org/p/chromium.webkit/waterfall',
builders: {
'Webkit Win': {version: 'xp'},
- 'Webkit Vista': {version: 'vista'},
'Webkit Win7': {version: 'win7'},
'Webkit Win (dbg)(1)': {version: 'xp', debug: true},
'Webkit Win (dbg)(2)': {version: 'xp', debug: true},
@@ -81,6 +83,12 @@ config.kPlatforms = {
resultsDirectoryForBuildNumber: function(buildNumber, revision) {
return buildNumber;
},
+ builderApplies: function(builderName) {
+ // FIXME: Should garden-o-matic show these? I can imagine showing the deps bots being useful at least so
+ // that the gardener only need to look at garden-o-matic and never at the waterfall. Not really sure who
+ // watches the GPU bots.
+ return builderName.indexOf('GPU') == -1 && builderName.indexOf('deps') == -1 && builderName.indexOf('ASAN') == -1;
+ },
},
'gtk' : {
label : 'GTK',
@@ -90,7 +98,7 @@ config.kPlatforms = {
builders: {
'GTK Linux 32-bit Release' : {version: '32-bit release'},
'GTK Linux 64-bit Release' : {version: '64-bit release'},
- 'GTK Linux 64-bit Debug' : {version: '64-bit debug',debug: true},
+ 'GTK Linux 64-bit Debug' : {version: '64-bit debug', debug: true},
},
haveBuilderAccumulatedResults : false,
useDirectoryListingForOldBuilds: false,
@@ -101,6 +109,9 @@ config.kPlatforms = {
resultsDirectoryForBuildNumber: function(buildNumber, revision) {
return encodeURIComponent('r' + revision + ' (' + buildNumber + ')');
},
+ builderApplies: function(builderName) {
+ return builderName.indexOf('GTK') != -1;
+ },
},
};
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui.js
index f09fe2915..5d3b8f366 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui.js
@@ -112,8 +112,8 @@ ui.onebar = base.extends('div', {
});
platformSelect.addEventListener('change', function() {
- window.location.search = '?platform=' + platformSelect.selectedOptions[0]._platform;
- }, false);
+ window.location.search = '?platform=' + platformSelect.options[platformSelect.selectedIndex]._platform;
+ });
platformSelect.selectedIndex = currentPlatformIndex;
},
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js
index cfd9dff5a..ba2d98be2 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js
@@ -318,7 +318,7 @@ test('FailingTestsSummary (grouping)', 1, function() {
test('BuildersFailing', 1, function() {
var builderFailing = new ui.notifications.BuildersFailing('Disasterifying');
- builderFailing.setFailingBuilders({'Webkit Linux': ['compile'], 'Webkit Vista': ['webkit_tests', 'update']});
+ builderFailing.setFailingBuilders({'Webkit Linux': ['compile'], 'Webkit Win7': ['webkit_tests', 'update']});
equal(builderFailing.innerHTML,
'<div class="how">' +
'<time class="relative"></time>' +
@@ -326,8 +326,8 @@ test('BuildersFailing', 1, function() {
'<div class="what">' +
'<div class="problem">Disasterifying:' +
'<ul class="effects">' +
- '<li class="builder"><a class="failing-builder" target="_blank" href="http://build.chromium.org/p/chromium.webkit/waterfall?builder=Webkit+Linux"><span class="version">lucid</span><span class="architecture">64-bit</span></a></li>' +
- '<li class="builder"><a class="failing-builder" target="_blank" href="http://build.chromium.org/p/chromium.webkit/waterfall?builder=Webkit+Vista"><span class="version">vista</span></a></li>' +
+ '<li class="builder"><a class="failing-builder" target="_blank" href="http://build.chromium.org/p/chromium.webkit/waterfall?builder=Webkit+Linux"><span class="version">lucid</span><span class="architecture">64-bit</span><span class="failures"> compile</span></a></li>' +
+ '<li class="builder"><a class="failing-builder" target="_blank" href="http://build.chromium.org/p/chromium.webkit/waterfall?builder=Webkit+Win7"><span class="version">win7</span><span class="failures"> webkit_tests, update</span></a></li>' +
'</ul>' +
'</div>' +
'<ul class="causes"></ul>' +
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui_unittests.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui_unittests.js
index 2464045c6..a86177d63 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui_unittests.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui_unittests.js
@@ -54,7 +54,7 @@ test("ui.onebar", 3, function() {
onebar = new ui.onebar();
onebar.attach();
equal(onebar.innerHTML,
- '<div><select id="platform-picker"><option>Apple</option><option>Chromium</option></select></div>' +
+ '<div><select id="platform-picker"><option>Apple</option><option>Chromium</option><option>GTK</option></select></div>' +
'<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">' +
'<li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#unexpected">Unexpected Failures</a></li>' +
'<li class="ui-state-default ui-corner-top"><a href="#expected">Expected Failures</a></li>' +
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/onebar.css b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/onebar.css
index 16aac11f4..ca6b59511 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/onebar.css
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/onebar.css
@@ -43,7 +43,8 @@
#onebar #platform-picker {
float: right;
- margin: 8px;
+ margin-top: 8px;
+ margin-right: 8px;
font-size: larger;
}
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index 834d46e46..4a4978604 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,20 +1,321 @@
-2012-06-19 Joel Dillon <joel.dillon@codethink.co.uk> Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+2012-06-26 Mark Hahnenberg <mhahnenberg@apple.com>
- [Qt][Win] Fix broken QtWebKit5.lib linking
- https://bugs.webkit.org/show_bug.cgi?id=88321
+ Add support for preciseTime() to WebKitTestRunner
+ https://bugs.webkit.org/show_bug.cgi?id=90027
- Reviewed by NOBODY (OOPS!).
+ Reviewed by Darin Adler.
- On windows the import/export definition is part of the symbol's signature.
- Define STATICALLY_LINKED_WITH_$$library for each dependend module
- that is being linked statically to make sure that they can be linked together
- later on.
+ It would be nice to be able to use preciseTime() in WebKitTestRunner like we can in DumpRenderTree.
- Also do not compile Assertions.cpp in DumpRenderTree anymore since all the
- used symbols are exported and it would cause a duplicate symbols error.
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::preciseTime):
+ (WTR):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ (LayoutTestController):
- * DumpRenderTree/qt/DumpRenderTree.pro:
- * qmake/mkspecs/features/default_post.prf:
+2012-06-26 Lucas Forschler <lforschler@apple.com>
+
+ Teach the Apple port how to build the test tools in build-webkit
+ https://bugs.webkit.org/show_bug.cgi?id=89540
+
+ Reviewed by Jon Lee & Simon Fraser.
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+ (RunWebKitTests.start): pass --no-build since tools should now be in the downloaded archive
+ (RunUnitTests.start): ditto
+ * Scripts/build-webkit: add tools to the projects build list
+
+2012-06-26 Ojan Vafai <ojan@chromium.org>
+
+ Only show the platform-appropriate builders for non-layout test failures in garden-o-matic
+ https://bugs.webkit.org/show_bug.cgi?id=90025
+
+ Reviewed by Simon Fraser.
+
+ Move the chromium-specific filtering code into config.js and replace it with a method on each platform
+ config. Also, let the webkit test step name be webkit_tests (build.chromium.org) or layout-test (build.webkit.org).
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders_unittests.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js:
+
+2012-06-26 Ojan Vafai <ojan@chromium.org>
+
+ Fix failing garden-o-matic unittests
+ https://bugs.webkit.org/show_bug.cgi?id=90021
+
+ Reviewed by Adam Barth.
+
+ These had all just fallen out of date.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui_unittests.js:
+
+2012-06-26 Ojan Vafai <ojan@chromium.org>
+
+ Fix platform picker change handler in garden-o-matic
+ https://bugs.webkit.org/show_bug.cgi?id=90010
+
+ Reviewed by Simon Fraser.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui.js:
+ The old code never worked. This is hard to test because change handlers require
+ a user-initiated action and the code is changing the window's location, which would
+ navigate the test page.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/onebar.css:
+ Fix the CSS so it doesn't cause the tabstrip to be disconnected from the tabs on Linux
+ due to the large margin-bottom.
+
+2012-06-26 Thiago Marcos P. Santos <thiago.santos@intel.com>
+
+ webkitpy: Make webkit-patch patches-to-review useful
+ https://bugs.webkit.org/show_bug.cgi?id=89470
+
+ Reviewed by Eric Seidel.
+
+ webkit-patch patches-to-review will now output the list of
+ bugs with patches pending for review that has the user on CC,
+ excluding patches with cq-, sorted by the age of the patch.
+
+ * Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
+ (BugzillaQueries.fetch_bugs_from_review_queue):
+ * Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py:
+ (MockBugzillaQueries.fetch_bugs_from_review_queue):
+ (MockBugzilla.__init__):
+ (MockBugzilla.authenticate):
+ * Scripts/webkitpy/tool/commands/queries.py:
+ (PatchesToReview):
+ (PatchesToReview.__init__):
+ (PatchesToReview._print_report):
+ (PatchesToReview._generate_report):
+ (PatchesToReview.execute):
+ * Scripts/webkitpy/tool/commands/queries_unittest.py:
+ (QueryCommandsTest.test_patches_to_review):
+
+2012-06-26 Dirk Pranke <dpranke@chromium.org>
+
+ nrwt: broken for chromium on vista
+ https://bugs.webkit.org/show_bug.cgi?id=89988
+
+ Reviewed by Tony Chang.
+
+ r121194 removed support for 'chromium-win-vista' as a separate
+ port, but this actually prevented the code from running on vista
+ at all, which is unduly harsh and broke the websocket tests on
+ the (non-webkit) chromium bots that are still running on vista.
+
+ It's probably good enough to pretend that vista is win7 instead;
+ some layout tests will still fail but at least things'll run.
+
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ (ChromiumWinPort.determine_full_port_name):
+ * Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py:
+ (ChromiumWinTest.test_versions):
+
+2012-06-26 Csaba Osztrogonác <ossy@webkit.org>
+
+ master.cfg cleanup: Pass CheckOutSource instance instead of class to BuildStep.addStep
+ https://bugs.webkit.org/show_bug.cgi?id=89215
+
+ We need it because it is deprecated and will be dropped in buildbot 0.8.7
+
+ Reviewed by Tony Chang.
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+ (CheckOutSource.__init__):
+ (Factory.__init__):
+
+2012-06-26 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt][Win] Symbols are not exported in QtWebKit5.dll
+ https://bugs.webkit.org/show_bug.cgi?id=88873
+
+ Reviewed by Tor Arne Vestbø.
+
+ When linking the target dll make sure to re-export the symbols from
+ the static libraries marked as export, with the help of a little python
+ script and a qmake extra compiler.
+
+ * Scripts/generate-win32-export-forwards: Added.
+ * qmake/mkspecs/features/win32/default_post.prf:
+
+2012-06-25 Jocelyn Turcotte <turcotte.j@gmail.com>
+
+ Add a note about hostname completion not working well with --cc completion
+
+ Reviewed by Simon Hausmann.
+
+ Hostname completion tries to resolve anything after an @ sign which is present
+ in the completed list of contributor emails to CC.
+
+ * Scripts/webkit-tools-completion.sh:
+
+2012-06-26 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r121244.
+ http://trac.webkit.org/changeset/121244
+ https://bugs.webkit.org/show_bug.cgi?id=89966
+
+ skip list path is incorrect now. (Requested by Ossy on
+ #webkit).
+
+ * Scripts/webkitpy/layout_tests/port/qt.py:
+ (QtPort.baseline_search_path):
+ (QtPort._skipped_file_search_paths):
+ * Scripts/webkitpy/layout_tests/port/qt_unittest.py:
+ (QtPortTest.test_baseline_search_path):
+
+2012-06-26 János Badics <jbadics@inf.u-szeged.hu>
+
+ [Qt][NRWT] Fix baseline and skipped file search path.
+ https://bugs.webkit.org/show_bug.cgi?id=89882
+
+ Reviewed by Csaba Osztrogonác.
+
+ * Scripts/webkitpy/layout_tests/port/qt.py:
+ (QtPort.baseline_search_path):
+ * Scripts/webkitpy/layout_tests/port/qt_unittest.py:
+ (QtPortTest.test_baseline_search_path):
+
+2012-06-26 Tony Chang <tony@chromium.org>
+
+ [Qt] Enable grid layout LayoutTests
+ https://bugs.webkit.org/show_bug.cgi?id=89909
+
+ Reviewed by Csaba Osztrogonác.
+
+ These tests pass, we just need to hook up the overridePreference.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::resetSettings): Reset grid layout and regions between tests.
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::overridePreference): Add WebKitCSSGridLayoutEnabled.
+
+2012-06-26 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r121236.
+ http://trac.webkit.org/changeset/121236
+ https://bugs.webkit.org/show_bug.cgi?id=89956
+
+ It's broke the nrwt on qt and gtk platform (Requested by
+ kkristof on #webkit).
+
+ * Scripts/webkitpy/layout_tests/port/qt.py:
+ (QtPort._build_driver):
+ * Scripts/webkitpy/layout_tests/port/xvfbdriver.py:
+ (XvfbDriver._start):
+ (XvfbDriver._start.x_filter):
+ (XvfbDriver.stop):
+
+2012-06-26 Kristóf Kosztyó <kkristof@inf.u-szeged.hu>
+
+ [NRWT] XvfbDriver should choose the next free display
+ https://bugs.webkit.org/show_bug.cgi?id=88414
+
+ Reviewed by Dirk Pranke.
+
+ * Scripts/webkitpy/layout_tests/port/qt.py:
+ (QtPort._driver_class):
+ * Scripts/webkitpy/layout_tests/port/xvfbdriver.py:
+ (XvfbDriver.__init__):
+ (XvfbDriver._start):
+ (XvfbDriver._start.next_free_id):
+ (XvfbDriver.stop):
+
+2012-06-25 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Make it possible to build WebKit without QtWidgets
+ https://bugs.webkit.org/show_bug.cgi?id=78109
+
+ Reviewed by Tor Arne Vestbø.
+
+ * Tools.pro: Disable various tools that depend on WK1.
+ * qmake/mkspecs/features/default_post.prf: Add WK1 as supported static lib in WEBKIT
+ * qmake/mkspecs/features/default_pre.prf: Disable WK1 if QtWidgets is not built.
+ * qmake/mkspecs/modules/webkit1.prf: Added.
+
+2012-06-25 Dirk Pranke <dpranke@chromium.org>
+
+ put vista back for chromium (non-webkit) bots ...
+ https://bugs.webkit.org/show_bug.cgi?id=89929
+
+ Unreviewed, build fix.
+
+ Turns out we've only gotten rid of vista on the webkit tests so
+ far. Put vista back for the other chromium bots ...
+
+ * TestResultServer/static-dashboards/flakiness_dashboard.js:
+ (chromiumPlatform):
+ * TestResultServer/static-dashboards/flakiness_dashboard_unittests.js:
+ (test):
+
+2012-06-25 Dirk Pranke <dpranke@chromium.org>
+
+ update flakiness dashboard after removing chromium-vista bots
+ https://bugs.webkit.org/show_bug.cgi?id=89925
+
+ Unreviewed, build fix.
+
+ More changes missed in r121194 :(.
+
+ * TestResultServer/static-dashboards/flakiness_dashboard.js:
+ (chromiumPlatform):
+ * TestResultServer/static-dashboards/flakiness_dashboard_unittests.js:
+ (test):
+
+2012-06-25 Dirk Pranke <dpranke@chromium.org>
+
+ remove support for chromium vista from tools
+ https://bugs.webkit.org/show_bug.cgi?id=89915
+
+ Reviewed by Tony Chang.
+
+ This change is all deleting code and updating tests to handle
+ the configuration being gone. All tests now pass except for a
+ few unittests for the flakiness dashboard which were failing
+ before this patch.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders_unittests.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js:
+ * Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py:
+ (BaselineOptimizerTest.test_complex_shadowing):
+ * Scripts/webkitpy/layout_tests/port/builders.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ (ChromiumWinPort):
+ * Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py:
+ (ChromiumWinTest.test_versions):
+ (ChromiumWinTest.test_baseline_path):
+ * Scripts/webkitpy/tool/commands/rebaseline_unittest.py:
+ * Scripts/webkitpy/tool/servers/gardeningserver_unittest.py:
+ (BuildCoverageExtrapolatorTest.test_extrapolate):
+
+2012-06-25 Scott Graham <scottmg@chromium.org>
+
+ [Chromium] add empty impl of WebThemeEngine::getSize() for DRT
+ https://bugs.webkit.org/show_bug.cgi?id=89907
+
+ Not reviewed. Fix build in Chromium.
+
+ * DumpRenderTree/chromium/WebThemeEngineDRTWin.cpp:
+ (WebThemeEngineDRTWin::getSize):
+ * DumpRenderTree/chromium/WebThemeEngineDRTWin.h:
+ (WebThemeEngineDRTWin):
+
+2012-06-25 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ [EFL] Implement Network Information API
+ https://bugs.webkit.org/show_bug.cgi?id=87067
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * efl/jhbuild.modules: Add eeze library dependency.
2012-06-25 Simon Hausmann <simon.hausmann@nokia.com>
diff --git a/Tools/DumpRenderTree/chromium/WebThemeEngineDRTWin.cpp b/Tools/DumpRenderTree/chromium/WebThemeEngineDRTWin.cpp
index 831c354fa..db8c38b7b 100755
--- a/Tools/DumpRenderTree/chromium/WebThemeEngineDRTWin.cpp
+++ b/Tools/DumpRenderTree/chromium/WebThemeEngineDRTWin.cpp
@@ -785,3 +785,9 @@ void WebThemeEngineDRTWin::paintProgressBar(WebKit::WebCanvas* canvas,
drawProgressBar(canvas, ctype, cstate, barRect, valueRect);
}
+
+WebKit::WebSize WebThemeEngineDRTWin::getSize(int part)
+{
+ return WebKit::WebSize();
+}
+
diff --git a/Tools/DumpRenderTree/chromium/WebThemeEngineDRTWin.h b/Tools/DumpRenderTree/chromium/WebThemeEngineDRTWin.h
index daa911166..33fd6126a 100644
--- a/Tools/DumpRenderTree/chromium/WebThemeEngineDRTWin.h
+++ b/Tools/DumpRenderTree/chromium/WebThemeEngineDRTWin.h
@@ -93,6 +93,8 @@ public:
WebKit::WebCanvas*, const WebKit::WebRect& barRect,
const WebKit::WebRect& valueRect,
bool determinate, double time);
+
+ virtual WebKit::WebSize getSize(int part);
};
#endif // WebThemeEngineDRTWin_h
diff --git a/Tools/DumpRenderTree/qt/DumpRenderTree.pro b/Tools/DumpRenderTree/qt/DumpRenderTree.pro
index 327dc3a79..53a8c01f8 100644
--- a/Tools/DumpRenderTree/qt/DumpRenderTree.pro
+++ b/Tools/DumpRenderTree/qt/DumpRenderTree.pro
@@ -37,6 +37,7 @@ HEADERS += \
testplugin.h
SOURCES += \
+ $${ROOT_WEBKIT_DIR}/Source/WTF/wtf/Assertions.cpp \
$$PWD/../WorkQueue.cpp \
DumpRenderTreeQt.cpp \
EventSenderQt.cpp \
diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
index 764394bc2..9d0ae62ac 100755
--- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
+++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
@@ -189,6 +189,8 @@ void WebPage::resetSettings()
settings()->resetAttribute(QWebSettings::JavascriptCanAccessClipboard);
settings()->resetAttribute(QWebSettings::AutoLoadImages);
settings()->resetAttribute(QWebSettings::ZoomTextOnly);
+ settings()->resetAttribute(QWebSettings::CSSRegionsEnabled);
+ settings()->resetAttribute(QWebSettings::CSSGridLayoutEnabled);
m_drt->layoutTestController()->setCaretBrowsingEnabled(false);
m_drt->layoutTestController()->setAuthorAndUserStylesEnabled(true);
diff --git a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
index 7689d5b4b..b8f998947 100644
--- a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
+++ b/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
@@ -669,6 +669,8 @@ void LayoutTestController::overridePreference(const QString& name, const QVarian
settings->setAttribute(QWebSettings::WebGLEnabled, value.toBool());
else if (name == "WebKitCSSRegionsEnabled")
settings->setAttribute(QWebSettings::CSSRegionsEnabled, value.toBool());
+ else if (name == "WebKitCSSGridLayoutEnabled")
+ settings->setAttribute(QWebSettings::CSSGridLayoutEnabled, value.toBool());
else if (name == "WebKitHyperlinkAuditingEnabled")
settings->setAttribute(QWebSettings::HyperlinkAuditingEnabled, value.toBool());
else if (name == "WebKitHixie76WebSocketProtocolEnabled")
diff --git a/Tools/Scripts/build-webkit b/Tools/Scripts/build-webkit
index 8ade40890..44a1bbf0f 100755
--- a/Tools/Scripts/build-webkit
+++ b/Tools/Scripts/build-webkit
@@ -246,6 +246,9 @@ if (isGtk()) {
# WebKit2 is only supported in SnowLeopard and later at present.
push @projects, ("Source/WebKit2", "Tools/MiniBrowser") if osXVersion()->{"minor"} >= 6 and !$noWebKit2;
+ # Build Tools needed for Apple ports
+ push @projects, ("Tools/DumpRenderTree", "Tools/WebKitTestRunner", "Source/ThirdParty/gtest", "Tools/TestWebKitAPI");
+
# Copy library and header from WebKitLibraries to a findable place in the product directory.
(system("perl", "Tools/Scripts/copy-webkitlibraries-to-product-directory", $productDir) == 0) or die;
} elsif (isWinCairo()) {
@@ -375,6 +378,7 @@ for my $dir (@projects) {
push @local_options, XcodeCoverageSupportOptions() if $coverageSupport && $project ne "ANGLE";
my $useGYPProject = $useGYP && ($project =~ "WebCore|JavaScriptCore");
my $projectPath = $useGYPProject ? "gyp/$project" : $project;
+ $projectPath = $project =~ /gtest/ ? "xcode/gtest" : $project;
$result = buildXCodeProject($projectPath, $clean, @local_options, @ARGV);
} elsif (isAppleWinWebKit()) {
if ($project eq "WebKit") {
diff --git a/Tools/Scripts/generate-win32-export-forwards b/Tools/Scripts/generate-win32-export-forwards
new file mode 100755
index 000000000..e75b430f4
--- /dev/null
+++ b/Tools/Scripts/generate-win32-export-forwards
@@ -0,0 +1,48 @@
+#!/usr/bin/env python
+
+#Copyright (C) 2012 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.
+
+# Extract /EXPORT: linker directives from static library and write it into a
+# separate file as linker pragmas.
+# Usage: generate-win32-export-forwards \path\to\static\library.lib outputfile.cpp
+# Then compile outputfile.cpp into the final .dll and link the static library
+# into the dll.
+
+import subprocess
+import sys
+import re
+
+dumpBin = subprocess.Popen("dumpbin /directives " + sys.argv[1], stdout=subprocess.PIPE, universal_newlines=True);
+
+output, errors = dumpBin.communicate();
+
+exportedSymbolRegexp = re.compile("\s*(?P<symbol>/EXPORT:.+)");
+
+symbols = set()
+
+for line in output.splitlines():
+ match = exportedSymbolRegexp.match(line)
+ if match != None:
+ symbols.add(match.group("symbol"))
+
+print "Forwarding %s symbols from static library %s" % (len(symbols), sys.argv[1])
+
+exportFile = open(sys.argv[2], "w")
+for symbol in symbols:
+ exportFile.write("#pragma comment(linker, \"%s\")\n" % symbol);
+exportFile.close()
diff --git a/Tools/Scripts/webkit-tools-completion.sh b/Tools/Scripts/webkit-tools-completion.sh
index 76578e159..d83a5a6ce 100755
--- a/Tools/Scripts/webkit-tools-completion.sh
+++ b/Tools/Scripts/webkit-tools-completion.sh
@@ -39,6 +39,7 @@ __webkit-patch_generate_reply()
__webkit-patch_upload_cc_generate_reply()
{
+ # Note: This won't work well if hostname completion is enabled, disable it with: shopt -u hostcomplete
# Completion is done on tokens and our comma-separated list is one single token, so we have to do completion on the whole list each time.
# Return a \n separated list for each possible bugzilla email completion of the substring following the last comma.
# Redirect strerr to /dev/null to prevent noise in the shell if this ever breaks somehow.
diff --git a/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py b/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py
index b70e5d06f..414cc06df 100644
--- a/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py
+++ b/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py
@@ -155,7 +155,7 @@ class BaselineOptimizerTest(unittest.TestCase):
'LayoutTests/platform/chromium-win-xp': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
'LayoutTests/platform/chromium-mac-leopard': '65e7d42f8b4882b29d46dc77bb879dd41bc074dc',
'LayoutTests/platform/mac-lion': '7ad045ece7c030e2283c5d21d9587be22bcba56e',
- 'LayoutTests/platform/chromium-win-vista': 'f83af9732ce74f702b8c9c4a3d9a4c6636b8d3bd',
+ 'LayoutTests/platform/chromium-win': 'f83af9732ce74f702b8c9c4a3d9a4c6636b8d3bd',
'LayoutTests/platform/win-xp': '5b1253ef4d5094530d5f1bc6cdb95c90b446bec7',
'LayoutTests/platform/chromium-linux': 'f52fcdde9e4be8bd5142171cd859230bd4471036',
}, {
@@ -164,7 +164,7 @@ class BaselineOptimizerTest(unittest.TestCase):
'LayoutTests/platform/chromium-win-xp': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
'LayoutTests/platform/chromium-mac-leopard': '65e7d42f8b4882b29d46dc77bb879dd41bc074dc',
'LayoutTests/platform/mac-lion': '7ad045ece7c030e2283c5d21d9587be22bcba56e',
- 'LayoutTests/platform/chromium-win-vista': 'f83af9732ce74f702b8c9c4a3d9a4c6636b8d3bd',
+ 'LayoutTests/platform/chromium-win': 'f83af9732ce74f702b8c9c4a3d9a4c6636b8d3bd',
'LayoutTests/platform/win-xp': '5b1253ef4d5094530d5f1bc6cdb95c90b446bec7',
'LayoutTests/platform/chromium-linux': 'f52fcdde9e4be8bd5142171cd859230bd4471036'
})
diff --git a/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py b/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
index 58d497dc6..e48293b89 100644
--- a/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
+++ b/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
@@ -219,6 +219,14 @@ class BugzillaQueries(object):
return sum([self._fetch_bug(bug_id).reviewed_patches()
for bug_id in self.fetch_bug_ids_from_pending_commit_list()], [])
+ def fetch_bugs_from_review_queue(self, cc_email=None):
+ query = "buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field0-0-0=flagtypes.name&type0-0-0=equals&value0-0-0=review?"
+
+ if cc_email:
+ query += "&emailcc1=1&emailtype1=substring&email1=%s" % urllib.quote(cc_email)
+
+ return self._fetch_bugs_from_advanced_query(query)
+
def fetch_bug_ids_from_commit_queue(self):
commit_queue_url = "buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field0-0-0=flagtypes.name&type0-0-0=equals&value0-0-0=commit-queue%2B&order=Last+Changed"
return self._fetch_bug_ids_advanced_query(commit_queue_url)
diff --git a/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py b/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py
index 4e50189a1..cd12c8033 100644
--- a/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py
+++ b/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py
@@ -82,7 +82,9 @@ _patch3 = {
"is_obsolete": False,
"is_patch": True,
"review": "?",
+ "commit-queue": "-",
"attacher_email": "eric@webkit.org",
+ "attach_date": datetime.datetime.today(),
}
@@ -266,6 +268,14 @@ class MockBugzillaQueries(object):
# will return bugs with patches which have r+, but are also obsolete.
return bug_ids + [50002]
+ def fetch_bugs_from_review_queue(self, cc_email=None):
+ unreviewed_bugs = [bug for bug in self._all_bugs() if bug.unreviewed_patches()]
+
+ if cc_email:
+ return [bug for bug in unreviewed_bugs if cc_email in bug.cc_emails()]
+
+ return unreviewed_bugs
+
def fetch_patches_from_pending_commit_list(self):
return sum([bug.reviewed_patches() for bug in self._all_bugs()], [])
@@ -302,8 +312,12 @@ class MockBugzilla(object):
self.queries = MockBugzillaQueries(self)
# FIXME: This should move onto the Host object, and we should use a MockCommitterList
self.committers = CommitterList(reviewers=_mock_reviewers)
+ self.username = None
self._override_patch = None
+ def authenticate(self):
+ self.username = "username@webkit.org"
+
def create_bug(self,
bug_title,
bug_description,
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/builders.py b/Tools/Scripts/webkitpy/layout_tests/port/builders.py
index cc0fa6932..3ad45be17 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/builders.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/builders.py
@@ -38,7 +38,6 @@ from webkitpy.common.memoized import memoized
_exact_matches = {
# These builders are on build.chromium.org.
"Webkit Win": {"port_name": "chromium-win-xp", "specifiers": set(["xp", "release"])},
- "Webkit Vista": {"port_name": "chromium-win-vista", "specifiers": set(["vista"])},
"Webkit Win7": {"port_name": "chromium-win-win7", "specifiers": set(["win7"])},
"Webkit Win (dbg)(1)": {"port_name": "chromium-win-xp", "specifiers": set(["win", "debug"])},
"Webkit Win (dbg)(2)": {"port_name": "chromium-win-xp", "specifiers": set(["win", "debug"])},
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
index b510305a3..5aad94c0f 100755
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
@@ -56,7 +56,6 @@ class ChromiumPort(Port):
('snowleopard', 'x86'),
('lion', 'x86'),
('xp', 'x86'),
- ('vista', 'x86'),
('win7', 'x86'),
('lucid', 'x86'),
('lucid', 'x86_64'),
@@ -66,13 +65,13 @@ class ChromiumPort(Port):
ALL_BASELINE_VARIANTS = [
'chromium-mac-lion', 'chromium-mac-snowleopard', 'chromium-mac-leopard',
- 'chromium-win-win7', 'chromium-win-vista', 'chromium-win-xp',
+ 'chromium-win-win7', 'chromium-win-xp',
'chromium-linux-x86_64', 'chromium-linux-x86',
]
CONFIGURATION_SPECIFIER_MACROS = {
'mac': ['leopard', 'snowleopard', 'lion'],
- 'win': ['xp', 'vista', 'win7'],
+ 'win': ['xp', 'win7'],
'linux': ['lucid'],
'android': ['icecreamsandwich'],
}
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py
index 532843a9f..492deedf2 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py
@@ -194,8 +194,6 @@ class ChromiumPortTest(port_testcase.PortTestCase):
TestConfiguration('lion', 'x86', 'release'),
TestConfiguration('xp', 'x86', 'debug'),
TestConfiguration('xp', 'x86', 'release'),
- TestConfiguration('vista', 'x86', 'debug'),
- TestConfiguration('vista', 'x86', 'release'),
TestConfiguration('win7', 'x86', 'debug'),
TestConfiguration('win7', 'x86', 'release'),
TestConfiguration('lucid', 'x86', 'debug'),
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py
index b76f7ee68..ff58842b6 100755
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py
@@ -42,19 +42,12 @@ class ChromiumWinPort(chromium.ChromiumPort):
port_name = 'chromium-win'
# FIXME: Figure out how to unify this with base.TestConfiguration.all_systems()?
- SUPPORTED_VERSIONS = ('xp', 'vista', 'win7')
+ SUPPORTED_VERSIONS = ('xp', 'win7')
# FIXME: Do we need mac-snowleopard here, like the base win port?
FALLBACK_PATHS = {
'xp': [
'chromium-win-xp',
- 'chromium-win-vista',
- 'chromium-win',
- 'chromium',
- 'mac',
- ],
- 'vista': [
- 'chromium-win-vista',
'chromium-win',
'chromium',
'mac',
@@ -72,7 +65,8 @@ class ChromiumWinPort(chromium.ChromiumPort):
def determine_full_port_name(cls, host, options, port_name):
if port_name.endswith('-win'):
assert host.platform.is_win()
- if host.platform.os_version in ('7sp0', '7sp1', 'future'):
+ # We don't maintain separate baselines for vista, so we pretend it is win7.
+ if host.platform.os_version in ('vista', '7sp0', '7sp1', 'future'):
version = 'win7'
else:
version = host.platform.os_version
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py
index 759bc7e1d..ac2358194 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py
@@ -74,25 +74,19 @@ class ChromiumWinTest(port_testcase.PortTestCase):
def test_versions(self):
port = self.make_port()
- self.assertTrue(port.name() in ('chromium-win-xp', 'chromium-win-vista', 'chromium-win-win7'))
+ self.assertTrue(port.name() in ('chromium-win-xp', 'chromium-win-win7'))
self.assert_name(None, 'xp', 'chromium-win-xp')
self.assert_name('chromium-win', 'xp', 'chromium-win-xp')
self.assert_name('chromium-win-xp', 'xp', 'chromium-win-xp')
- self.assert_name('chromium-win-xp', 'vista', 'chromium-win-xp')
self.assert_name('chromium-win-xp', '7sp0', 'chromium-win-xp')
- self.assert_name(None, 'vista', 'chromium-win-vista')
- self.assert_name('chromium-win', 'vista', 'chromium-win-vista')
- self.assert_name('chromium-win-vista', 'xp', 'chromium-win-vista')
- self.assert_name('chromium-win-vista', 'vista', 'chromium-win-vista')
- self.assert_name('chromium-win-vista', '7sp0', 'chromium-win-vista')
-
self.assert_name(None, '7sp0', 'chromium-win-win7')
+ self.assert_name(None, 'vista', 'chromium-win-win7')
self.assert_name('chromium-win', '7sp0', 'chromium-win-win7')
self.assert_name('chromium-win-win7', 'xp', 'chromium-win-win7')
- self.assert_name('chromium-win-win7', 'vista', 'chromium-win-win7')
self.assert_name('chromium-win-win7', '7sp0', 'chromium-win-win7')
+ self.assert_name('chromium-win-win7', 'vista', 'chromium-win-win7')
self.assertRaises(AssertionError, self.assert_name, None, 'w2k', 'chromium-win-xp')
@@ -100,9 +94,6 @@ class ChromiumWinTest(port_testcase.PortTestCase):
port = self.make_port(port_name='chromium-win-xp')
self.assertEquals(port.baseline_path(), port._webkit_baseline_path('chromium-win-xp'))
- port = self.make_port(port_name='chromium-win-vista')
- self.assertEquals(port.baseline_path(), port._webkit_baseline_path('chromium-win-vista'))
-
port = self.make_port(port_name='chromium-win-win7')
self.assertEquals(port.baseline_path(), port._webkit_baseline_path('chromium-win'))
diff --git a/Tools/Scripts/webkitpy/tool/commands/queries.py b/Tools/Scripts/webkitpy/tool/commands/queries.py
index a738d3267..731b598a6 100644
--- a/Tools/Scripts/webkitpy/tool/commands/queries.py
+++ b/Tools/Scripts/webkitpy/tool/commands/queries.py
@@ -1,5 +1,6 @@
# Copyright (c) 2009 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple Inc. All rights reserved.
+# Copyright (c) 2012 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -30,6 +31,7 @@
import fnmatch
import re
+from datetime import datetime
from optparse import make_option
from webkitpy.tool import steps
@@ -121,14 +123,56 @@ class PatchesToCommitQueue(AbstractDeclarativeCommand):
class PatchesToReview(AbstractDeclarativeCommand):
name = "patches-to-review"
- help_text = "List patches that are pending review"
+ help_text = "List bugs which have attachments pending review"
+
+ def __init__(self):
+ options = [
+ make_option("--all", action="store_true",
+ help="Show all bugs regardless of who is on CC (it might take a while)"),
+ make_option("--include-cq-denied", action="store_true",
+ help="By default, r? patches with cq- are omitted unless this option is set"),
+ make_option("--cc-email",
+ help="Specifies the email on the CC field (defaults to your bugzilla login email)"),
+ ]
+ AbstractDeclarativeCommand.__init__(self, options=options)
+
+ def _print_report(self, report, cc_email, print_all):
+ if print_all:
+ print "Bugs with attachments pending review:"
+ else:
+ print "Bugs with attachments pending review that has %s in the CC list:" % cc_email
+
+ print "http://webkit.org/b/bugid Description (age in days)"
+ for row in report:
+ print "%s (%d)" % (row[1], row[0])
+
+ print "Total: %d" % len(report)
+
+ def _generate_report(self, bugs, include_cq_denied):
+ report = []
+
+ for bug in bugs:
+ patch = bug.unreviewed_patches()[-1]
+
+ if not include_cq_denied and patch.commit_queue() == "-":
+ continue
+
+ age_in_days = (datetime.today() - patch.attach_date()).days
+ report.append((age_in_days, "http://webkit.org/b/%-7s %s" % (bug.id(), bug.title())))
+
+ report.sort()
+ return report
def execute(self, options, args, tool):
- patch_ids = tool.bugs.queries.fetch_attachment_ids_from_review_queue()
- log("Patches pending review:")
- for patch_id in patch_ids:
- print patch_id
+ tool.bugs.authenticate()
+
+ cc_email = options.cc_email
+ if not cc_email and not options.all:
+ cc_email = tool.bugs.username
+ bugs = tool.bugs.queries.fetch_bugs_from_review_queue(cc_email=cc_email)
+ report = self._generate_report(bugs, options.include_cq_denied)
+ self._print_report(report, cc_email, options.all)
class WhatBroke(AbstractDeclarativeCommand):
name = "what-broke"
diff --git a/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py b/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
index a86154b78..09b45ba55 100644
--- a/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
@@ -1,4 +1,5 @@
# Copyright (C) 2009 Google Inc. All rights reserved.
+# Copyright (C) 2012 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -84,9 +85,59 @@ class QueryCommandsTest(CommandsTest):
self.assert_execute_outputs(PatchesToCommitQueue(), None, expected_stdout, expected_stderr, options=options)
def test_patches_to_review(self):
- expected_stdout = "10002\n"
- expected_stderr = "Patches pending review:\n"
- self.assert_execute_outputs(PatchesToReview(), None, expected_stdout, expected_stderr)
+ options = Mock()
+
+ # When no cc_email is provided, we use the Bugzilla username by default.
+ # The MockBugzilla will fake the authentication using username@webkit.org
+ # as login and it should match the username at the report header.
+ options.cc_email = None
+ options.include_cq_denied = False
+ options.all = False
+ expected_stdout = \
+ "Bugs with attachments pending review that has username@webkit.org in the CC list:\n" \
+ "http://webkit.org/b/bugid Description (age in days)\n" \
+ "Total: 0\n"
+ expected_stderr = ""
+ self.assert_execute_outputs(PatchesToReview(), None, expected_stdout, expected_stderr, options=options)
+
+ options.cc_email = "abarth@webkit.org"
+ options.include_cq_denied = True
+ options.all = False
+ expected_stdout = \
+ "Bugs with attachments pending review that has abarth@webkit.org in the CC list:\n" \
+ "http://webkit.org/b/bugid Description (age in days)\n" \
+ "http://webkit.org/b/50001 Bug with a patch needing review. (0)\n" \
+ "Total: 1\n"
+ expected_stderr = ""
+ self.assert_execute_outputs(PatchesToReview(), None, expected_stdout, expected_stderr, options=options)
+
+ options.cc_email = None
+ options.include_cq_denied = True
+ options.all = True
+ expected_stdout = \
+ "Bugs with attachments pending review:\n" \
+ "http://webkit.org/b/bugid Description (age in days)\n" \
+ "http://webkit.org/b/50001 Bug with a patch needing review. (0)\n" \
+ "Total: 1\n"
+ self.assert_execute_outputs(PatchesToReview(), None, expected_stdout, expected_stderr, options=options)
+
+ options.cc_email = None
+ options.include_cq_denied = False
+ options.all = True
+ expected_stdout = \
+ "Bugs with attachments pending review:\n" \
+ "http://webkit.org/b/bugid Description (age in days)\n" \
+ "Total: 0\n"
+ self.assert_execute_outputs(PatchesToReview(), None, expected_stdout, expected_stderr, options=options)
+
+ options.cc_email = "invalid_email@example.com"
+ options.all = False
+ options.include_cq_denied = True
+ expected_stdout = \
+ "Bugs with attachments pending review that has invalid_email@example.com in the CC list:\n" \
+ "http://webkit.org/b/bugid Description (age in days)\n" \
+ "Total: 0\n"
+ self.assert_execute_outputs(PatchesToReview(), None, expected_stdout, expected_stderr, options=options)
def test_tree_status(self):
expected_stdout = "ok : Builder1\nok : Builder2\n"
diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
index b5a043ff8..84036d46e 100644
--- a/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
@@ -204,9 +204,6 @@ Retrieving results for chromium-mac-lion from Webkit Mac10.7.
Retrieving results for chromium-mac-snowleopard from Webkit Mac10.6.
userscripts/another-test.html (txt)
userscripts/images.svg (png)
-Retrieving results for chromium-win-vista from Webkit Vista.
- userscripts/another-test.html (txt)
- userscripts/images.svg (png)
Retrieving results for chromium-win-win7 from Webkit Win7.
userscripts/another-test.html (txt)
userscripts/images.svg (png)
@@ -225,8 +222,6 @@ MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt', 'Webkit Mac10
MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'png', 'Webkit Mac10.7', 'userscripts/images.svg'], cwd=/mock-checkout
MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt', 'Webkit Mac10.6', 'userscripts/another-test.html'], cwd=/mock-checkout
MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'png', 'Webkit Mac10.6', 'userscripts/images.svg'], cwd=/mock-checkout
-MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt', 'Webkit Vista', 'userscripts/another-test.html'], cwd=/mock-checkout
-MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'png', 'Webkit Vista', 'userscripts/images.svg'], cwd=/mock-checkout
MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt', 'Webkit Win7', 'userscripts/another-test.html'], cwd=/mock-checkout
MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'png', 'Webkit Win7', 'userscripts/images.svg'], cwd=/mock-checkout
MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt', 'Webkit Win', 'userscripts/another-test.html'], cwd=/mock-checkout
diff --git a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py
index dcecb500c..4cc772ca2 100644
--- a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py
@@ -91,9 +91,9 @@ class BuildCoverageExtrapolatorTest(unittest.TestCase):
converter = TestConfigurationConverter(port.all_test_configurations(), port.configuration_specifier_macros())
extrapolator = BuildCoverageExtrapolator(converter)
self.assertEquals(extrapolator.extrapolate_test_configurations("Webkit Win"), set([TestConfiguration(version='xp', architecture='x86', build_type='release')]))
- self.assertEquals(extrapolator.extrapolate_test_configurations("Webkit Vista"), set([
- TestConfiguration(version='vista', architecture='x86', build_type='debug'),
- TestConfiguration(version='vista', architecture='x86', build_type='release')]))
+ self.assertEquals(extrapolator.extrapolate_test_configurations("Webkit Win7"), set([
+ TestConfiguration(version='win7', architecture='x86', build_type='debug'),
+ TestConfiguration(version='win7', architecture='x86', build_type='release')]))
self.assertRaises(KeyError, extrapolator.extrapolate_test_configurations, "Potato")
diff --git a/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js b/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js
index 59b2ba946..5c390c8f8 100644
--- a/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js
+++ b/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js
@@ -43,7 +43,7 @@ var GPU_RESULTS_BASE_PATH = 'http://chromium-browser-gpu-tests.commondatastorage
var PLATFORMS = ['LION', 'SNOWLEOPARD', 'LEOPARD', 'XP', 'VISTA', 'WIN7', 'LUCID', 'APPLE_LION', 'APPLE_LEOPARD', 'APPLE_SNOWLEOPARD', 'APPLE_XP', 'APPLE_WIN7', 'GTK_LINUX', 'QT_LINUX'];
var PLATFORM_UNIONS = {
'MAC': ['LEOPARD', 'SNOWLEOPARD', 'LION'],
- 'WIN': ['XP', 'VISTA', 'WIN7'],
+ 'WIN': ['XP', 'WIN7'],
'LINUX': ['LUCID']
}
@@ -51,7 +51,6 @@ var PLATFORM_UNIONS = {
var PLATFORM_FALLBACKS = {
'WIN': 'ALL',
'XP': 'WIN',
- 'VISTA': 'WIN',
'WIN7': 'WIN',
'MAC': 'ALL',
'LION': 'MAC',
@@ -575,8 +574,8 @@ function addTestToAllExpectations(test, expectations, modifiers)
// expectations and modifiers properties for this platform/buildType.
//
// platform and buildType both go through fallback sets of keys from most
-// specific key to least specific. For example, on Windows Vista, we first
-// check the platform WIN-VISTA, if there's no such object, we check WIN,
+// specific key to least specific. For example, on Windows XP, we first
+// check the platform WIN-XP, if there's no such object, we check WIN,
// then finally we check ALL. For build types, we check the current
// buildType, then ALL.
var g_allExpectations;
@@ -2271,8 +2270,7 @@ function hideLegend()
}
var g_fallbacksMap = {};
-g_fallbacksMap['WIN-XP'] = ['chromium-win-xp', 'chromium-win-vista', 'chromium-win', 'chromium', 'mac'];
-g_fallbacksMap['WIN-VISTA'] = ['chromium-win-vista', 'chromium-win', 'chromium', 'mac'];
+g_fallbacksMap['WIN-XP'] = ['chromium-win-xp', 'chromium-win', 'chromium', 'mac'];
g_fallbacksMap['WIN-7'] = ['chromium-win', 'chromium', 'mac'];
g_fallbacksMap['MAC-LEOPARD'] = ['chromium-mac-leopard', 'chromium-mac-snowleopard', 'chromium-mac', 'chromium', 'mac'];
g_fallbacksMap['MAC-SNOWLEOPARD'] = ['chromium-mac-snowleopard', 'chromium-mac', 'chromium', 'mac'];
diff --git a/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js b/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js
index bc2bc4d08..e8d1ca85d 100644
--- a/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js
+++ b/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js
@@ -129,7 +129,7 @@ test('overrideJustBuildType', 12, function() {
runExpectationsTest('Webkit Mac10.5 (dbg)(3)', test, 'FAIL', 'WONTFIX MAC');
});
-test('platformAndBuildType', 88, function() {
+test('platformAndBuildType', 86, function() {
var runPlatformAndBuildTypeTest = function(builder, expectedPlatform, expectedBuildType) {
g_perBuilderPlatformAndBuildType = {};
buildInfo = platformAndBuildType(builder);
@@ -147,7 +147,6 @@ test('platformAndBuildType', 88, function() {
runPlatformAndBuildTypeTest('Webkit Mac10.6 (deps)(dbg)(1)', 'SNOWLEOPARD', 'DEBUG');
runPlatformAndBuildTypeTest('Webkit Mac10.6 (deps)(dbg)(2)', 'SNOWLEOPARD', 'DEBUG');
runPlatformAndBuildTypeTest('Webkit Win', 'XP', 'RELEASE');
- runPlatformAndBuildTypeTest('Webkit Vista', 'VISTA', 'RELEASE');
runPlatformAndBuildTypeTest('Webkit Win7', 'WIN7', 'RELEASE');
runPlatformAndBuildTypeTest('Webkit Win (dbg)(1)', 'XP', 'DEBUG');
runPlatformAndBuildTypeTest('Webkit Win (dbg)(2)', 'XP', 'DEBUG');
@@ -212,7 +211,7 @@ test('filterBugs',4, function() {
equal(filtered.bugs, '');
});
-test('getExpectations', 12, function() {
+test('getExpectations', 11, function() {
resetGlobals();
g_builders['WebKit Win'] = true;
g_resultsByBuilder = {
@@ -233,7 +232,7 @@ test('getExpectations', 12, function() {
'RELEASE : test1.html = FAIL\n' +
'DEBUG : test1.html = CRASH\n' +
'WIN7 : http/tests/appcache/interrupted-update.html = TIMEOUT\n' +
- 'MAC LINUX XP VISTA : http/tests/appcache/interrupted-update.html = FAIL\n';
+ 'MAC LINUX XP : http/tests/appcache/interrupted-update.html = FAIL\n';
processExpectations();
@@ -265,13 +264,10 @@ test('getExpectations', 12, function() {
equal(JSON.stringify(expectations), '{"modifiers":"WIN7","expectations":"TIMEOUT"}');
var expectations = getExpectations('http/tests/appcache/interrupted-update.html', 'LEOPARD', 'RELEASE');
- equal(JSON.stringify(expectations), '{"modifiers":"MAC LINUX XP VISTA","expectations":"FAIL"}');
+ equal(JSON.stringify(expectations), '{"modifiers":"MAC LINUX XP","expectations":"FAIL"}');
var expectations = getExpectations('http/tests/appcache/interrupted-update.html', 'LUCID', 'RELEASE');
- equal(JSON.stringify(expectations), '{"modifiers":"MAC LINUX XP VISTA","expectations":"FAIL"}');
-
- var expectations = getExpectations('http/tests/appcache/interrupted-update.html', 'VISTA', 'RELEASE');
- equal(JSON.stringify(expectations), '{"modifiers":"MAC LINUX XP VISTA","expectations":"FAIL"}');
+ equal(JSON.stringify(expectations), '{"modifiers":"MAC LINUX XP","expectations":"FAIL"}');
});
test('substringList', 2, function() {
@@ -506,7 +502,7 @@ test('generateChromiumTipOfTreeGpuBuildersFromBuilderList', 1, function() {
var builderList = ["Chrome Frame Tests", "GPU Linux (NVIDIA)", "GPU Linux (dbg) (NVIDIA)", "GPU Mac", "GPU Mac (dbg)", "GPU Win7 (NVIDIA)", "GPU Win7 (dbg) (NVIDIA)", "Linux Perf",
"Linux Tests", "Linux Valgrind", "Mac Builder (dbg)", "Mac10.6 Perf", "Mac10.6 Tests", "Vista Perf", "Vista Tests", "Webkit Linux", "Webkit Linux ASAN", "Webkit Linux (dbg)", "Webkit Linux (deps)",
"Webkit Linux 32", "Webkit Mac Builder", "Webkit Mac Builder (dbg)", "Webkit Mac Builder (deps)", "Webkit Mac10.5", "Webkit Mac10.5 (dbg)(1)", "Webkit Mac10.5 (dbg)(2)",
- "Webkit Mac10.6", "Webkit Mac10.6 (dbg)", "Webkit Mac10.6 (deps)", "Webkit Mac10.7", "Webkit Vista", "Webkit Win", "Webkit Win (dbg)(1)", "Webkit Win (dbg)(2)",
+ "Webkit Mac10.6", "Webkit Mac10.6 (dbg)", "Webkit Mac10.6 (deps)", "Webkit Mac10.7", "Webkit Win", "Webkit Win (dbg)(1)", "Webkit Win (dbg)(2)",
"Webkit Win (deps)", "Webkit Win Builder", "Webkit Win Builder (dbg)", "Webkit Win Builder (deps)", "Webkit Win7", "Win (dbg)", "Win Builder"];
var expectedBuilders = [["GPU Linux (NVIDIA)", 2], ["GPU Linux (dbg) (NVIDIA)"], ["GPU Mac"], ["GPU Mac (dbg)"], ["GPU Win7 (NVIDIA)"], ["GPU Win7 (dbg) (NVIDIA)"]];
deepEqual(generateBuildersFromBuilderList(builderList, isChromiumTipOfTreeGpuTestRunner), expectedBuilders);
@@ -531,10 +527,10 @@ test('generateChromiumWebkitTipOfTreeBuildersFromBuilderList', 1, function() {
var builderList = ["Chrome Frame Tests", "GPU Linux (NVIDIA)", "GPU Linux (dbg) (NVIDIA)", "GPU Mac", "GPU Mac (dbg)", "GPU Win7 (NVIDIA)", "GPU Win7 (dbg) (NVIDIA)", "Linux Perf", "Linux Tests",
"Linux Valgrind", "Mac Builder (dbg)", "Mac10.6 Perf", "Mac10.6 Tests", "Vista Perf", "Vista Tests", "Webkit Linux", "Webkit Linux ASAN", "Webkit Linux (dbg)", "Webkit Linux (deps)", "Webkit Linux 32",
"Webkit Mac Builder", "Webkit Mac Builder (dbg)", "Webkit Mac Builder (deps)", "Webkit Mac10.5", "Webkit Mac10.5 (dbg)(1)", "Webkit Mac10.5 (dbg)(2)", "Webkit Mac10.6", "Webkit Mac10.6 (dbg)",
- "Webkit Mac10.6 (deps)", "Webkit Mac10.7", "Webkit Vista", "Webkit Win", "Webkit Win (dbg)(1)", "Webkit Win (dbg)(2)", "Webkit Win (deps)", "Webkit Win Builder", "Webkit Win Builder (dbg)",
+ "Webkit Mac10.6 (deps)", "Webkit Mac10.7", "Webkit Win", "Webkit Win (dbg)(1)", "Webkit Win (dbg)(2)", "Webkit Win (deps)", "Webkit Win Builder", "Webkit Win Builder (dbg)",
"Webkit Win Builder (deps)", "Webkit Win7", "Win (dbg)", "Win Builder"];
var expectedBuilders = [["Webkit Linux", 2], ["Webkit Linux (dbg)"], ["Webkit Linux 32"], ["Webkit Mac10.5"], ["Webkit Mac10.5 (dbg)(1)"], ["Webkit Mac10.5 (dbg)(2)"], ["Webkit Mac10.6"],
- ["Webkit Mac10.6 (dbg)"], ["Webkit Mac10.7"], ["Webkit Vista"], ["Webkit Win"], ["Webkit Win (dbg)(1)"], ["Webkit Win (dbg)(2)"], ["Webkit Win7"]];
+ ["Webkit Mac10.6 (dbg)"], ["Webkit Mac10.7"], ["Webkit Win"], ["Webkit Win (dbg)(1)"], ["Webkit Win (dbg)(2)"], ["Webkit Win7"]];
deepEqual(generateBuildersFromBuilderList(builderList, isChromiumWebkitTipOfTreeTestRunner), expectedBuilders);
});
@@ -542,7 +538,7 @@ test('generateChromiumWebkitDepsBuildersFromBuilderList', 1, function() {
var builderList = ["Chrome Frame Tests", "GPU Linux (NVIDIA)", "GPU Linux (dbg) (NVIDIA)", "GPU Mac", "GPU Mac (dbg)", "GPU Win7 (NVIDIA)", "GPU Win7 (dbg) (NVIDIA)", "Linux Perf", "Linux Tests",
"Linux Valgrind", "Mac Builder (dbg)", "Mac10.6 Perf", "Mac10.6 Tests", "Vista Perf", "Vista Tests", "Webkit Linux", "Webkit Linux ASAN", "Webkit Linux (dbg)", "Webkit Linux (deps)", "Webkit Linux 32",
"Webkit Mac Builder", "Webkit Mac Builder (dbg)", "Webkit Mac Builder (deps)", "Webkit Mac10.5", "Webkit Mac10.5 (dbg)(1)", "Webkit Mac10.5 (dbg)(2)", "Webkit Mac10.6", "Webkit Mac10.6 (dbg)",
- "Webkit Mac10.6 (deps)", "Webkit Mac10.7", "Webkit Vista", "Webkit Win", "Webkit Win (dbg)(1)", "Webkit Win (dbg)(2)", "Webkit Win (deps)", "Webkit Win Builder", "Webkit Win Builder (dbg)",
+ "Webkit Mac10.6 (deps)", "Webkit Mac10.7", "Webkit Win", "Webkit Win (dbg)(1)", "Webkit Win (dbg)(2)", "Webkit Win (deps)", "Webkit Win Builder", "Webkit Win Builder (dbg)",
"Webkit Win Builder (deps)", "Webkit Win7", "Win (dbg)", "Win Builder"];
var expectedBuilders = [["Webkit Linux (deps)", 2], ["Webkit Mac10.6 (deps)"], ["Webkit Win (deps)"]];
deepEqual(generateBuildersFromBuilderList(builderList, isChromiumWebkitDepsTestRunner), expectedBuilders);
@@ -577,7 +573,7 @@ test('generateChromiumTipOfTreeGTestBuildersFromBuilderList', 1, function() {
var builderList = ["Chrome Frame Tests", "GPU Linux (NVIDIA)", "GPU Linux (dbg) (NVIDIA)", "GPU Mac", "GPU Mac (dbg)", "GPU Win7 (NVIDIA)", "GPU Win7 (dbg) (NVIDIA)", "Linux Perf",
"Linux Tests", "Linux Valgrind", "Mac Builder (dbg)", "Mac10.6 Perf", "Mac10.6 Tests", "Vista Perf", "Vista Tests", "Webkit Linux", "Webkit Linux (dbg)", "Webkit Linux (deps)",
"Webkit Linux 32", "Webkit Mac Builder", "Webkit Mac Builder (dbg)", "Webkit Mac Builder (deps)", "Webkit Mac10.5", "Webkit Mac10.5 (dbg)(1)", "Webkit Mac10.5 (dbg)(2)",
- "Webkit Mac10.6", "Webkit Mac10.6 (dbg)", "Webkit Mac10.6 (deps)", "Webkit Mac10.7", "Webkit Vista", "Webkit Win", "Webkit Win (dbg)(1)", "Webkit Win (dbg)(2)",
+ "Webkit Mac10.6", "Webkit Mac10.6 (dbg)", "Webkit Mac10.6 (deps)", "Webkit Mac10.7", "Webkit Win", "Webkit Win (dbg)(1)", "Webkit Win (dbg)(2)",
"Webkit Win (deps)", "Webkit Win Builder", "Webkit Win Builder (dbg)", "Webkit Win Builder (deps)", "Webkit Win7", "Win (dbg)", "Win Builder"];
var expectedBuilders = [['Linux Tests', BuilderGroup.DEFAULT_BUILDER], ['Mac10.6 Tests'], ['Vista Tests'], ['Win (dbg)']];
deepEqual(generateBuildersFromBuilderList(builderList, isChromiumTipOfTreeGTestRunner), expectedBuilders);
diff --git a/Tools/Tools.pro b/Tools/Tools.pro
index 6c997c295..63c993be6 100644
--- a/Tools/Tools.pro
+++ b/Tools/Tools.pro
@@ -9,13 +9,16 @@ CONFIG += ordered
load(features)
-SUBDIRS += QtTestBrowser/QtTestBrowser.pro
-SUBDIRS += DumpRenderTree/qt/DumpRenderTree.pro
-SUBDIRS += DumpRenderTree/qt/ImageDiff.pro
+!no_webkit1 {
+ SUBDIRS += QtTestBrowser/QtTestBrowser.pro
+ SUBDIRS += DumpRenderTree/qt/DumpRenderTree.pro
+ SUBDIRS += DumpRenderTree/qt/ImageDiff.pro
+}
!no_webkit2 {
- SUBDIRS += MiniBrowser/qt/MiniBrowser.pro \
- WebKitTestRunner/WebKitTestRunner.pro
+ SUBDIRS += MiniBrowser/qt/MiniBrowser.pro
+ # WTR's InjectedBundle depends currently on WK1's DumpRenderTreeSupport
+ !no_webkit1: SUBDIRS += WebKitTestRunner/WebKitTestRunner.pro
}
# FIXME: with Qt 5 the test plugin cause some trouble during layout tests.
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
index b5766c01c..7a2a488eb 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
@@ -32,6 +32,7 @@ module WTR {
void waitForPolicyDelegate();
void waitUntilDone();
void notifyDone();
+ double preciseTime();
// Other dumping.
void dumpBackForwardList();
diff --git a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
index df9dfa407..31f97f28c 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
@@ -43,6 +43,7 @@
#include <WebKit2/WKBundleScriptWorld.h>
#include <WebKit2/WKRetainPtr.h>
#include <WebKit2/WebKit2.h>
+#include <wtf/CurrentTime.h>
#include <wtf/HashMap.h>
#include <wtf/text/StringBuilder.h>
@@ -617,4 +618,9 @@ void LayoutTestController::overridePreference(JSStringRef preference, bool value
WKBundleOverrideBoolPreferenceForTestRunner(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), toWK(preference).get(), value);
}
+double LayoutTestController::preciseTime()
+{
+ return currentTime();
+}
+
} // namespace WTR
diff --git a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
index c0500f78e..6aedacc43 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
+++ b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
@@ -63,6 +63,7 @@ public:
void dumpChildFramesAsText() { m_whatToDump = AllFramesText; }
void waitUntilDone();
void notifyDone();
+ double preciseTime();
// Other dumping.
void dumpBackForwardList() { m_shouldDumpBackForwardListsForAllWindows = true; }
diff --git a/Tools/efl/jhbuild.modules b/Tools/efl/jhbuild.modules
index 14faf784c..9811ec271 100644
--- a/Tools/efl/jhbuild.modules
+++ b/Tools/efl/jhbuild.modules
@@ -14,6 +14,7 @@
<dep package="libsoup"/>
<dep package="edje"/>
<dep package="e_dbus"/>
+ <dep package="eeze"/>
</dependencies>
</metamodule>
@@ -218,4 +219,14 @@
</dependencies>
</autotools>
+ <autotools id="eeze">
+ <branch module="eeze"
+ repo="enlightenment.org"
+ revision="68629"/>
+ <dependencies>
+ <dep package="ecore"/>
+ <dep package="eina"/>
+ </dependencies>
+ </autotools>
+
</moduleset>
diff --git a/Tools/qmake/mkspecs/features/default_post.prf b/Tools/qmake/mkspecs/features/default_post.prf
index 2efbd7298..dec4a6d16 100644
--- a/Tools/qmake/mkspecs/features/default_post.prf
+++ b/Tools/qmake/mkspecs/features/default_post.prf
@@ -164,7 +164,7 @@ contains(QT, webkit) {
# Reorder libraries so that the link and include order is correct,
# and make sure the case matches the original case.
-libraries = WebKit2 WebCore JavaScriptCore WTF
+libraries = WebKit1 WebKit2 WebCore JavaScriptCore WTF
for(library, libraries) {
contains(WEBKIT, $$lower($$library)) {
WEBKIT -= $$lower($$library)
@@ -212,12 +212,6 @@ for(library, WEBKIT) {
LIBS += $$dependent_libs
}
- # Anything not linking dynamically to QtWebKit should make sure to have their export
- # macros syncrhonized with the code that it will linked with statically.
- !contains(QT, webkit) {
- DEFINES += STATICALLY_LINKED_WITH_$$library
- }
-
LIBS = $$existing_libs $$LIBS
}
diff --git a/Tools/qmake/mkspecs/features/default_pre.prf b/Tools/qmake/mkspecs/features/default_pre.prf
index 31c5ef996..bb82e15fe 100644
--- a/Tools/qmake/mkspecs/features/default_pre.prf
+++ b/Tools/qmake/mkspecs/features/default_pre.prf
@@ -105,7 +105,8 @@ else: PYTHON = python
haveQt(5): {
isEmpty(QT.widgets.name)|isEmpty(QT.printsupport.name) {
- root_project_file: error("Building WebKit against Qt 5.0 requires the QtWidgets and QtPrintSupport modules.")
+ root_project_file: message("WebKit1 requires the QtWidgets and QtPrintSupport modules. Disabling WebKit1.")
+ CONFIG += no_webkit1
}
}
diff --git a/Tools/qmake/mkspecs/features/win32/default_post.prf b/Tools/qmake/mkspecs/features/win32/default_post.prf
index a07a9bd71..d45d0455e 100644
--- a/Tools/qmake/mkspecs/features/win32/default_post.prf
+++ b/Tools/qmake/mkspecs/features/win32/default_post.prf
@@ -18,3 +18,24 @@ win32-msvc*|wince*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4396 -wd4503 -wd4800 -w
win32-icc: QMAKE_CXXFLAGS += -wd873
load(default_post)
+
+# When creating the target DLL, extract exporting linker directives from
+# all static libraries we're linking into the DLL and make sure they are
+# also exported from the DLL.
+shared:contains(TEMPLATE, lib) {
+ for(target, POST_TARGETDEPS) {
+ libdep = $$find(target, .*\\.lib)
+ exists($$libdep): LIBSWITHEXPORTS += $$libdep
+ }
+}
+
+!isEmpty(LIBSWITHEXPORTS) {
+ exportgen.input = LIBSWITHEXPORTS
+ exportgen.output = exports_${QMAKE_FILE_BASE}.cpp
+ exportgen.commands = python $${ROOT_WEBKIT_DIR}$${QMAKE_DIR_SEP}Tools$${QMAKE_DIR_SEP}Scripts$${QMAKE_DIR_SEP}generate-win32-export-forwards ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
+ exportgen.variable_out = SOURCES
+ QMAKE_EXTRA_COMPILERS += exportgen
+}
+
+# To ensure the Qt export macros are set to dllexport
+contains(TEMPLATE, lib):!contains(QT, webkit): DEFINES += QT_MAKEDLL
diff --git a/Tools/qmake/mkspecs/modules/webkit1.prf b/Tools/qmake/mkspecs/modules/webkit1.prf
new file mode 100644
index 000000000..ffab9a7fc
--- /dev/null
+++ b/Tools/qmake/mkspecs/modules/webkit1.prf
@@ -0,0 +1,9 @@
+# -------------------------------------------------------------------
+# Module file for WebKit1, used by targets that depend on WebKit1
+#
+# See 'Tools/qmake/README' for an overview of the build system
+# -------------------------------------------------------------------
+
+WEBKIT.webkit1.root_source_dir = $${ROOT_WEBKIT_DIR}/Source/WebKit
+
+include($${WEBKIT.webkit1.root_source_dir}/WebKit1.pri)
diff --git a/WebKit.pro b/WebKit.pro
index eb23fd331..9b4007b51 100644
--- a/WebKit.pro
+++ b/WebKit.pro
@@ -30,12 +30,18 @@ WebCore.file = Source/WebCore/WebCore.pro
WebCore.makefile = Makefile.WebCore
SUBDIRS += WebCore
-!CONFIG(no_webkit2) {
+!no_webkit2 {
webkit2.file = Source/WebKit2/WebKit2.pro
webkit2.makefile = Makefile.WebKit2
SUBDIRS += webkit2
}
+!no_webkit1 {
+ webkit1.file = Source/WebKit/WebKit1.pro
+ webkit1.makefile = Makefile.WebKit1
+ SUBDIRS += webkit1
+}
+
QtWebKit.file = Source/QtWebKit.pro
QtWebKit.makefile = Makefile.QtWebKit
SUBDIRS += QtWebKit
diff --git a/configure.ac b/configure.ac
index 95957b538..e6cb220e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ(2.60)
m4_define([webkit_major_version], [1])
m4_define([webkit_minor_version], [9])
-m4_define([webkit_micro_version], [3])
+m4_define([webkit_micro_version], [4])
# This is the version we'll be using as part of our User-Agent string
# e.g., AppleWebKit/$(webkit_user_agent_version) ...
@@ -35,13 +35,13 @@ AC_CONFIG_SRCDIR([Source/WebCore/config.h])
dnl # Libtool library version, not to confuse with API version
dnl # see http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html
-LIBWEBKITGTK_VERSION=13:2:13
+LIBWEBKITGTK_VERSION=14:0:14
AC_SUBST([LIBWEBKITGTK_VERSION])
-LIBJAVASCRIPTCOREGTK_VERSION=13:2:13
+LIBJAVASCRIPTCOREGTK_VERSION=13:3:13
AC_SUBST([LIBJAVASCRIPTCOREGTK_VERSION])
-LIBWEBKIT2GTK_VERSION=14:0:14
+LIBWEBKIT2GTK_VERSION=15:0:15
AC_SUBST([LIBWEBKIT2GTK_VERSION])
AM_INIT_AUTOMAKE([foreign subdir-objects dist-xz no-dist-gzip tar-ustar])