summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog242
-rw-r--r--Source/JavaScriptCore/CMakeLists.txt1
-rw-r--r--Source/JavaScriptCore/ChangeLog840
-rw-r--r--Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig3
-rw-r--r--Source/JavaScriptCore/GNUmakefile.list.am3
-rw-r--r--Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj8
-rwxr-xr-xSource/JavaScriptCore/JavaScriptCore.vcproj/testRegExp/testRegExp.vcproj7
-rw-r--r--Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj12
-rw-r--r--Source/JavaScriptCore/Target.pri2
-rw-r--r--Source/JavaScriptCore/assembler/ARMAssembler.cpp80
-rw-r--r--Source/JavaScriptCore/assembler/ARMAssembler.h154
-rw-r--r--Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp22
-rw-r--r--Source/JavaScriptCore/assembler/MacroAssemblerARM.h246
-rw-r--r--Source/JavaScriptCore/bytecode/ArrayProfile.cpp55
-rw-r--r--Source/JavaScriptCore/bytecode/ArrayProfile.h104
-rw-r--r--Source/JavaScriptCore/bytecode/CodeBlock.cpp116
-rw-r--r--Source/JavaScriptCore/bytecode/CodeBlock.h25
-rw-r--r--Source/JavaScriptCore/bytecode/Instruction.h3
-rw-r--r--Source/JavaScriptCore/bytecode/Opcode.h6
-rw-r--r--Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp17
-rw-r--r--Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h1
-rw-r--r--Source/JavaScriptCore/config.h5
-rw-r--r--Source/JavaScriptCore/dfg/DFGAbstractState.cpp87
-rw-r--r--Source/JavaScriptCore/dfg/DFGAbstractValue.h536
-rw-r--r--Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp24
-rw-r--r--Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp39
-rw-r--r--Source/JavaScriptCore/dfg/DFGCFGSimplificationPhase.cpp4
-rw-r--r--Source/JavaScriptCore/dfg/DFGCSEPhase.cpp13
-rw-r--r--Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp15
-rw-r--r--Source/JavaScriptCore/dfg/DFGDriver.cpp45
-rw-r--r--Source/JavaScriptCore/dfg/DFGDriver.h8
-rw-r--r--Source/JavaScriptCore/dfg/DFGFixupPhase.cpp31
-rw-r--r--Source/JavaScriptCore/dfg/DFGGraph.h83
-rw-r--r--Source/JavaScriptCore/dfg/DFGNode.h22
-rw-r--r--Source/JavaScriptCore/dfg/DFGNodeType.h1
-rw-r--r--Source/JavaScriptCore/dfg/DFGOSREntry.cpp4
-rw-r--r--Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp1
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp84
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h10
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp76
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp60
-rw-r--r--Source/JavaScriptCore/dfg/DFGStructureAbstractValue.h327
-rw-r--r--Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp22
-rw-r--r--Source/JavaScriptCore/interpreter/Interpreter.cpp2
-rw-r--r--Source/JavaScriptCore/jit/JITDriver.h8
-rw-r--r--Source/JavaScriptCore/jit/JITPropertyAccess.cpp18
-rw-r--r--Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp18
-rw-r--r--Source/JavaScriptCore/jit/JITStubs.cpp3
-rw-r--r--Source/JavaScriptCore/llint/LLIntExceptions.cpp11
-rw-r--r--Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp1
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm38
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter64.asm36
-rw-r--r--Source/JavaScriptCore/runtime/Executable.cpp44
-rw-r--r--Source/JavaScriptCore/runtime/Executable.h22
-rw-r--r--Source/JavaScriptCore/runtime/ExecutionHarness.h8
-rw-r--r--Source/JavaScriptCore/runtime/Structure.h5
-rw-r--r--Source/JavaScriptCore/shell/PlatformEfl.cmake2
-rw-r--r--Source/Platform/ChangeLog147
-rw-r--r--Source/Platform/chromium/public/WebAnimation.h48
-rw-r--r--Source/Platform/chromium/public/WebBlobData.h7
-rw-r--r--Source/Platform/chromium/public/WebContentLayer.h36
-rw-r--r--Source/Platform/chromium/public/WebExternalTextureLayer.h34
-rw-r--r--Source/Platform/chromium/public/WebFilterOperation.h18
-rw-r--r--Source/Platform/chromium/public/WebGraphicsContext3D.h5
-rw-r--r--Source/Platform/chromium/public/WebHTTPBody.h8
-rw-r--r--Source/Platform/chromium/public/WebIOSurfaceLayer.h18
-rw-r--r--Source/Platform/chromium/public/WebImageLayer.h16
-rw-r--r--Source/Platform/chromium/public/WebLayer.h193
-rw-r--r--Source/Platform/chromium/public/WebScrollableLayer.h64
-rw-r--r--Source/Platform/chromium/public/WebScrollbarLayer.h19
-rw-r--r--Source/Platform/chromium/public/WebSolidColorLayer.h17
-rw-r--r--Source/Platform/chromium/public/WebVideoLayer.h17
-rw-r--r--Source/QtWebKit.pro6
-rw-r--r--Source/ThirdParty/ANGLE/src/libEGL/libEGL.vcproj4
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.vcproj4
-rw-r--r--Source/ThirdParty/gtest/msvc/gtest_prod_test-md.vcproj2
-rw-r--r--Source/ThirdParty/gtest/msvc/gtest_prod_test.vcproj2
-rw-r--r--Source/ThirdParty/gtest/msvc/gtest_unittest-md.vcproj2
-rw-r--r--Source/ThirdParty/gtest/msvc/gtest_unittest.vcproj2
-rw-r--r--Source/WTF/ChangeLog155
-rw-r--r--Source/WTF/WTF.pri5
-rw-r--r--Source/WTF/config.h5
-rw-r--r--Source/WTF/wtf/Alignment.h7
-rw-r--r--Source/WTF/wtf/DateMath.cpp5
-rw-r--r--Source/WTF/wtf/DisallowCType.h10
-rw-r--r--Source/WTF/wtf/MathExtras.h16
-rw-r--r--Source/WTF/wtf/Platform.h8
-rw-r--r--Source/WTF/wtf/PlatformEfl.cmake5
-rw-r--r--Source/WTF/wtf/Uint8ClampedArray.h7
-rw-r--r--Source/WTF/wtf/text/ASCIIFastPath.h43
-rw-r--r--Source/WTF/wtf/text/AtomicString.cpp32
-rw-r--r--Source/WTF/wtf/text/AtomicString.h2
-rw-r--r--Source/WTF/wtf/text/StringBuilder.h5
-rw-r--r--Source/WTF/wtf/text/StringImpl.h2
-rw-r--r--Source/WTF/wtf/text/StringStatics.cpp26
-rw-r--r--Source/WTF/wtf/text/WTFString.cpp13
-rw-r--r--Source/WTF/wtf/text/WTFString.h20
-rw-r--r--Source/WebCore/CMakeLists.txt24
-rw-r--r--Source/WebCore/ChangeLog11581
-rw-r--r--Source/WebCore/Configurations/FeatureDefines.xcconfig3
-rw-r--r--Source/WebCore/DerivedSources.cpp4
-rw-r--r--Source/WebCore/DerivedSources.make4
-rw-r--r--Source/WebCore/DerivedSources.pri3
-rw-r--r--Source/WebCore/English.lproj/localizedStrings.js4
-rw-r--r--Source/WebCore/GNUmakefile.am38
-rw-r--r--Source/WebCore/GNUmakefile.list.am2080
-rw-r--r--Source/WebCore/Modules/filesystem/DOMFileSystem.cpp22
-rw-r--r--Source/WebCore/Modules/filesystem/DOMFileSystemBase.cpp12
-rw-r--r--Source/WebCore/Modules/filesystem/DOMFileSystemBase.h6
-rw-r--r--Source/WebCore/Modules/filesystem/DOMFileSystemSync.cpp24
-rw-r--r--Source/WebCore/Modules/filesystem/DirectoryEntry.cpp6
-rw-r--r--Source/WebCore/Modules/filesystem/DirectoryEntry.h6
-rw-r--r--Source/WebCore/Modules/filesystem/DirectoryEntry.idl4
-rw-r--r--Source/WebCore/Modules/filesystem/DirectoryEntrySync.cpp6
-rw-r--r--Source/WebCore/Modules/filesystem/DirectoryEntrySync.h6
-rw-r--r--Source/WebCore/Modules/filesystem/DirectoryEntrySync.idl4
-rw-r--r--Source/WebCore/Modules/filesystem/FileSystemCallbacks.cpp4
-rw-r--r--Source/WebCore/Modules/filesystem/FileSystemFlags.h (renamed from Source/WebCore/Modules/filesystem/WebKitFlags.h)36
-rw-r--r--Source/WebCore/Modules/filesystem/FileWriter.cpp2
-rw-r--r--Source/WebCore/Modules/filesystem/SyncCallbackHelper.h3
-rw-r--r--Source/WebCore/Modules/filesystem/WorkerContextFileSystem.cpp4
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBAny.cpp22
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBAny.h8
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBCallbacks.h13
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBCursor.cpp8
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBCursor.h2
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp32
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.h15
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBCursorBackendInterface.h4
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabase.cpp15
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabase.h1
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp11
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h2
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp6
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h1
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBFactory.cpp13
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBFactory.h5
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBFactory.idl2
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.cpp4
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.h2
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h2
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBIndex.cpp1
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBIndex.h3
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBIndex.idl2
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp4
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp42
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBKeyPath.h3
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp35
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h2
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp107
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBObjectStore.h22
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBObjectStore.idl6
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp224
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h22
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h5
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp102
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h (renamed from Source/WebCore/bindings/js/JSCustomVoidCallback.h)55
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.idl (renamed from Source/WebKit/chromium/src/WebImageLayer.cpp)30
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBRequest.cpp76
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBRequest.h29
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBTransaction.cpp25
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBTransaction.h5
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp33
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h9
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBUpgradeNeededEvent.cpp69
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBUpgradeNeededEvent.h62
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBUpgradeNeededEvent.idl (renamed from Source/WebKit/chromium/src/WebSolidColorLayer.cpp)30
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBVersionChangeRequest.cpp2
-rw-r--r--Source/WebCore/Modules/mediasource/MediaSource.cpp23
-rw-r--r--Source/WebCore/Modules/mediasource/MediaSource.h2
-rw-r--r--Source/WebCore/Modules/mediasource/SourceBuffer.cpp17
-rw-r--r--Source/WebCore/Modules/mediasource/SourceBuffer.h5
-rw-r--r--Source/WebCore/Modules/mediasource/SourceBuffer.idl4
-rw-r--r--Source/WebCore/Modules/mediasource/SourceBufferList.cpp29
-rw-r--r--Source/WebCore/Modules/mediasource/SourceBufferList.h6
-rw-r--r--Source/WebCore/Modules/mediastream/LocalMediaStream.h3
-rw-r--r--Source/WebCore/Modules/mediastream/MediaStream.h2
-rw-r--r--Source/WebCore/Modules/vibration/Vibration.cpp10
-rw-r--r--Source/WebCore/Modules/webaudio/AudioContext.cpp15
-rw-r--r--Source/WebCore/Modules/webaudio/AudioParam.cpp34
-rw-r--r--Source/WebCore/Modules/webaudio/AudioParam.h8
-rw-r--r--Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp1
-rw-r--r--Source/WebCore/Modules/webaudio/ConvolverNode.idl2
-rw-r--r--Source/WebCore/Modules/webaudio/DelayDSPKernel.cpp2
-rw-r--r--Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.h4
-rw-r--r--Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.h4
-rw-r--r--Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl2
-rw-r--r--Source/WebCore/Modules/webaudio/Oscillator.cpp12
-rw-r--r--Source/WebCore/Modules/webaudio/Oscillator.h2
-rw-r--r--Source/WebCore/Modules/webaudio/Oscillator.idl3
-rw-r--r--Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.cpp2
-rw-r--r--Source/WebCore/PlatformBlackBerry.cmake3
-rw-r--r--Source/WebCore/PlatformEfl.cmake35
-rw-r--r--Source/WebCore/Resources/blackberry/selectControlBlackBerry.css1
-rw-r--r--Source/WebCore/Resources/pagepopups/calendarPicker.css (renamed from Source/WebCore/Resources/calendarPicker.css)3
-rw-r--r--Source/WebCore/Resources/pagepopups/calendarPicker.js (renamed from Source/WebCore/Resources/calendarPicker.js)98
-rw-r--r--Source/WebCore/Resources/pagepopups/calendarPickerMac.css (renamed from Source/WebCore/Resources/calendarPickerMac.css)0
-rw-r--r--Source/WebCore/Resources/pagepopups/colorSuggestionPicker.css (renamed from Source/WebCore/Resources/colorSuggestionPicker.css)0
-rw-r--r--Source/WebCore/Resources/pagepopups/colorSuggestionPicker.js (renamed from Source/WebCore/Resources/colorSuggestionPicker.js)64
-rw-r--r--Source/WebCore/Resources/pagepopups/pickerCommon.css (renamed from Source/WebCore/bindings/js/JSConvolverNodeCustom.cpp)34
-rw-r--r--Source/WebCore/Resources/pagepopups/pickerCommon.js78
-rw-r--r--Source/WebCore/Target.pri42
-rw-r--r--Source/WebCore/UseJSC.cmake11
-rwxr-xr-xSource/WebCore/UseV8.cmake15
-rw-r--r--Source/WebCore/WebCore.exp.in13
-rw-r--r--Source/WebCore/WebCore.gyp/WebCore.gyp39
-rw-r--r--Source/WebCore/WebCore.gypi231
-rw-r--r--Source/WebCore/WebCore.order1
-rw-r--r--Source/WebCore/WebCore.pri6
-rwxr-xr-xSource/WebCore/WebCore.vcproj/WebCore.vcproj300
-rw-r--r--Source/WebCore/WebCore.vcproj/WebCoreTestSupport.vcproj6
-rw-r--r--Source/WebCore/WebCore.xcodeproj/project.pbxproj128
-rw-r--r--Source/WebCore/accessibility/AXObjectCache.cpp141
-rw-r--r--Source/WebCore/accessibility/AXObjectCache.h47
-rw-r--r--Source/WebCore/accessibility/AccessibilityListBoxOption.cpp2
-rw-r--r--Source/WebCore/accessibility/AccessibilityNodeObject.h2
-rw-r--r--Source/WebCore/accessibility/AccessibilityObject.cpp4
-rw-r--r--Source/WebCore/accessibility/AccessibilityObject.h1
-rw-r--r--Source/WebCore/accessibility/AccessibilityRenderObject.cpp26
-rw-r--r--Source/WebCore/accessibility/AccessibilityScrollView.cpp6
-rw-r--r--Source/WebCore/accessibility/AccessibilitySpinButton.h2
-rw-r--r--Source/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp8
-rw-r--r--Source/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp6
-rw-r--r--Source/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp2
-rw-r--r--Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceEditableText.cpp5
-rw-r--r--Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceText.cpp2
-rw-r--r--Source/WebCore/accessibility/mac/AXObjectCacheMac.mm2
-rw-r--r--Source/WebCore/accessibility/win/AXObjectCacheWin.cpp6
-rw-r--r--Source/WebCore/bindings/cpp/WebDOMCustomVoidCallback.cpp48
-rw-r--r--Source/WebCore/bindings/cpp/WebDOMCustomVoidCallback.h55
-rw-r--r--Source/WebCore/bindings/generic/BindingSecurity.cpp12
-rw-r--r--Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp4
-rw-r--r--Source/WebCore/bindings/gobject/GNUmakefile.am3
-rw-r--r--Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp8
-rw-r--r--Source/WebCore/bindings/gobject/WebKitDOMCustom.h1
-rw-r--r--Source/WebCore/bindings/js/DOMTransaction.cpp60
-rw-r--r--Source/WebCore/bindings/js/DOMTransaction.h61
-rw-r--r--Source/WebCore/bindings/js/JSArrayBufferViewHelper.h21
-rw-r--r--Source/WebCore/bindings/js/JSBindingsAllInOne.cpp2
-rw-r--r--Source/WebCore/bindings/js/JSBlobCustom.cpp2
-rw-r--r--Source/WebCore/bindings/js/JSCustomVoidCallback.cpp71
-rw-r--r--Source/WebCore/bindings/js/JSDOMBinding.cpp31
-rw-r--r--Source/WebCore/bindings/js/JSDOMBinding.h3
-rw-r--r--Source/WebCore/bindings/js/JSDOMWindowBase.cpp4
-rw-r--r--Source/WebCore/bindings/js/JSDOMWindowCustom.cpp4
-rw-r--r--Source/WebCore/bindings/js/JSDOMWindowCustom.h4
-rw-r--r--Source/WebCore/bindings/js/JSDOMWrapper.h19
-rw-r--r--Source/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp6
-rw-r--r--Source/WebCore/bindings/js/JSDictionary.cpp2
-rw-r--r--Source/WebCore/bindings/js/JSDictionary.h3
-rw-r--r--Source/WebCore/bindings/js/JSDirectoryEntryCustom.cpp146
-rw-r--r--Source/WebCore/bindings/js/JSDirectoryEntrySyncCustom.cpp98
-rw-r--r--Source/WebCore/bindings/js/JSDocumentCustom.cpp4
-rw-r--r--Source/WebCore/bindings/js/JSEventListener.cpp10
-rw-r--r--Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp2
-rw-r--r--Source/WebCore/bindings/js/JSUndoManagerCustom.cpp43
-rw-r--r--Source/WebCore/bindings/js/ScriptCachedFrameData.cpp6
-rw-r--r--Source/WebCore/bindings/js/ScriptController.cpp12
-rw-r--r--Source/WebCore/bindings/js/ScriptController.h2
-rw-r--r--Source/WebCore/bindings/js/ScriptDebugServer.cpp3
-rw-r--r--Source/WebCore/bindings/js/SerializedScriptValue.cpp20
-rw-r--r--Source/WebCore/bindings/js/SerializedScriptValue.h1
-rw-r--r--Source/WebCore/bindings/objc/DOMAbstractView.mm4
-rw-r--r--Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm8
-rw-r--r--Source/WebCore/bindings/scripts/CodeGeneratorJS.pm7
-rw-r--r--Source/WebCore/bindings/scripts/CodeGeneratorV8.pm71
-rw-r--r--Source/WebCore/bindings/scripts/IDLAttributes.txt2
-rw-r--r--Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp10
-rw-r--r--Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h2
-rw-r--r--Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp17
-rw-r--r--Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h11
-rw-r--r--Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp1
-rw-r--r--Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp21
-rw-r--r--Source/WebCore/bindings/scripts/test/JS/JSTestObj.h1
-rw-r--r--Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h2
-rw-r--r--Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm8
-rw-r--r--Source/WebCore/bindings/scripts/test/TestObj.idl1
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp4
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp8
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp2
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp2
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp4
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp14
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp16
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp2
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp10
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp2
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp198
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp14
-rw-r--r--Source/WebCore/bindings/v8/BindingState.cpp21
-rw-r--r--Source/WebCore/bindings/v8/BindingState.h1
-rw-r--r--Source/WebCore/bindings/v8/DOMTransaction.cpp121
-rw-r--r--Source/WebCore/bindings/v8/DOMTransaction.h66
-rw-r--r--Source/WebCore/bindings/v8/DateExtension.cpp4
-rw-r--r--Source/WebCore/bindings/v8/Dictionary.cpp12
-rw-r--r--Source/WebCore/bindings/v8/IDBBindingUtilities.cpp2
-rw-r--r--Source/WebCore/bindings/v8/NPV8Object.cpp41
-rwxr-xr-xSource/WebCore/bindings/v8/PageScriptDebugServer.cpp8
-rw-r--r--Source/WebCore/bindings/v8/ScheduledAction.cpp11
-rw-r--r--Source/WebCore/bindings/v8/ScheduledAction.h4
-rw-r--r--Source/WebCore/bindings/v8/ScriptController.cpp283
-rw-r--r--Source/WebCore/bindings/v8/ScriptController.h49
-rw-r--r--Source/WebCore/bindings/v8/ScriptDebugServer.cpp2
-rw-r--r--Source/WebCore/bindings/v8/ScriptFunctionCall.cpp8
-rw-r--r--Source/WebCore/bindings/v8/ScriptGCEvent.cpp10
-rw-r--r--Source/WebCore/bindings/v8/ScriptGCEvent.h32
-rw-r--r--Source/WebCore/bindings/v8/ScriptState.cpp3
-rw-r--r--Source/WebCore/bindings/v8/SerializedScriptValue.cpp8
-rw-r--r--Source/WebCore/bindings/v8/V8AbstractEventListener.cpp2
-rw-r--r--Source/WebCore/bindings/v8/V8Binding.cpp117
-rw-r--r--Source/WebCore/bindings/v8/V8Binding.h125
-rw-r--r--Source/WebCore/bindings/v8/V8BindingHelpers.cpp59
-rw-r--r--Source/WebCore/bindings/v8/V8Callback.cpp (renamed from Source/WebCore/bindings/v8/custom/V8CustomVoidCallback.cpp)44
-rw-r--r--Source/WebCore/bindings/v8/V8Callback.h (renamed from Source/WebCore/bindings/v8/V8BindingHelpers.h)16
-rw-r--r--Source/WebCore/bindings/v8/V8Collection.cpp4
-rw-r--r--Source/WebCore/bindings/v8/V8Collection.h2
-rw-r--r--Source/WebCore/bindings/v8/V8DOMConfiguration.cpp8
-rw-r--r--Source/WebCore/bindings/v8/V8DOMConfiguration.h2
-rw-r--r--Source/WebCore/bindings/v8/V8DOMWindowShell.cpp21
-rw-r--r--Source/WebCore/bindings/v8/V8DOMWrapper.cpp6
-rw-r--r--Source/WebCore/bindings/v8/V8EventListener.cpp2
-rw-r--r--Source/WebCore/bindings/v8/V8GCController.cpp31
-rw-r--r--Source/WebCore/bindings/v8/V8GCController.h2
-rw-r--r--Source/WebCore/bindings/v8/V8HiddenPropertyName.h16
-rw-r--r--Source/WebCore/bindings/v8/V8IsolatedContext.cpp14
-rw-r--r--Source/WebCore/bindings/v8/V8IsolatedContext.h4
-rw-r--r--Source/WebCore/bindings/v8/V8LazyEventListener.cpp4
-rw-r--r--Source/WebCore/bindings/v8/V8NPObject.cpp24
-rw-r--r--Source/WebCore/bindings/v8/V8NPUtils.cpp2
-rw-r--r--Source/WebCore/bindings/v8/V8NodeFilterCondition.cpp6
-rw-r--r--Source/WebCore/bindings/v8/V8ObjectConstructor.cpp92
-rw-r--r--Source/WebCore/bindings/v8/V8ObjectConstructor.h (renamed from Source/WebCore/bindings/v8/SafeAllocation.h)71
-rw-r--r--Source/WebCore/bindings/v8/V8PerContextData.cpp4
-rw-r--r--Source/WebCore/bindings/v8/V8PerIsolateData.cpp22
-rw-r--r--Source/WebCore/bindings/v8/V8Proxy.cpp402
-rw-r--r--Source/WebCore/bindings/v8/V8Proxy.h91
-rw-r--r--Source/WebCore/bindings/v8/V8RecursionScope.h2
-rw-r--r--Source/WebCore/bindings/v8/V8ThrowException.cpp116
-rw-r--r--Source/WebCore/bindings/v8/V8ThrowException.h53
-rw-r--r--Source/WebCore/bindings/v8/V8Utilities.cpp26
-rw-r--r--Source/WebCore/bindings/v8/V8Utilities.h7
-rw-r--r--Source/WebCore/bindings/v8/V8WindowErrorHandler.cpp4
-rw-r--r--Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp8
-rw-r--r--Source/WebCore/bindings/v8/WorldContextHandle.cpp6
-rw-r--r--Source/WebCore/bindings/v8/WorldContextHandle.h4
-rw-r--r--Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp4
-rw-r--r--Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h39
-rw-r--r--Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp4
-rw-r--r--Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp22
-rw-r--r--Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp14
-rw-r--r--Source/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp6
-rw-r--r--Source/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.cpp4
-rw-r--r--Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp4
-rw-r--r--Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8DOMTransactionCustom.cpp50
-rw-r--r--Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp12
-rwxr-xr-xSource/WebCore/bindings/v8/custom/V8DataViewCustom.cpp20
-rw-r--r--Source/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp139
-rw-r--r--Source/WebCore/bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp127
-rw-r--r--Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp4
-rw-r--r--Source/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp4
-rw-r--r--Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp6
-rw-r--r--Source/WebCore/bindings/v8/custom/V8HTMLElementCustom.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8HTMLFormElementCustom.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp20
-rw-r--r--Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp6
-rw-r--r--Source/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp14
-rw-r--r--Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp6
-rw-r--r--Source/WebCore/bindings/v8/custom/V8HistoryCustom.cpp4
-rw-r--r--Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp12
-rw-r--r--Source/WebCore/bindings/v8/custom/V8InjectedScriptManager.cpp3
-rw-r--r--Source/WebCore/bindings/v8/custom/V8IntentConstructor.cpp12
-rw-r--r--Source/WebCore/bindings/v8/custom/V8LocationCustom.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8MessageChannelConstructor.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp6
-rw-r--r--Source/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8MutationCallbackCustom.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8MutationObserverCustom.cpp8
-rw-r--r--Source/WebCore/bindings/v8/custom/V8NodeCustom.cpp8
-rw-r--r--Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp16
-rw-r--r--Source/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp6
-rw-r--r--Source/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp10
-rw-r--r--Source/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp6
-rw-r--r--Source/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp14
-rw-r--r--Source/WebCore/bindings/v8/custom/V8ScriptProfileCustom.cpp3
-rw-r--r--Source/WebCore/bindings/v8/custom/V8ScriptProfileNodeCustom.cpp3
-rw-r--r--Source/WebCore/bindings/v8/custom/V8StorageCustom.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8UndoManagerCustom.cpp65
-rw-r--r--Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp76
-rw-r--r--Source/WebCore/bindings/v8/custom/V8WebKitPointConstructor.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp14
-rw-r--r--Source/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8WorkerCustom.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp4
-rw-r--r--Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp14
-rw-r--r--Source/WebCore/bridge/qt/qt_class.cpp52
-rw-r--r--Source/WebCore/bridge/qt/qt_instance.cpp70
-rw-r--r--Source/WebCore/bridge/qt/qt_instance.h63
-rw-r--r--Source/WebCore/bridge/qt/qt_runtime.cpp554
-rw-r--r--Source/WebCore/bridge/qt/qt_runtime.h159
-rw-r--r--Source/WebCore/bridge/testqtbindings.cpp2
-rw-r--r--Source/WebCore/config.h7
-rw-r--r--Source/WebCore/css/CSSComputedStyleDeclaration.cpp93
-rw-r--r--Source/WebCore/css/CSSParser.cpp238
-rw-r--r--Source/WebCore/css/CSSParser.h6
-rw-r--r--Source/WebCore/css/CSSPrimitiveValue.cpp48
-rw-r--r--Source/WebCore/css/CSSPrimitiveValueMappings.h553
-rw-r--r--Source/WebCore/css/CSSProperty.cpp10
-rw-r--r--Source/WebCore/css/CSSPropertyNames.in6
-rw-r--r--Source/WebCore/css/CSSSelector.cpp140
-rw-r--r--Source/WebCore/css/CSSStyleSheet.cpp33
-rw-r--r--Source/WebCore/css/CSSStyleSheet.h5
-rw-r--r--Source/WebCore/css/CSSValueKeywords.in6
-rw-r--r--Source/WebCore/css/CSSValueList.cpp20
-rw-r--r--Source/WebCore/css/CSSValueList.h4
-rw-r--r--Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp6
-rw-r--r--Source/WebCore/css/StyleBuilder.cpp45
-rw-r--r--Source/WebCore/css/StylePropertySet.cpp13
-rw-r--r--Source/WebCore/css/StyleResolver.cpp27
-rw-r--r--Source/WebCore/css/StyleResolver.h2
-rw-r--r--Source/WebCore/css/StyleRuleImport.cpp15
-rw-r--r--Source/WebCore/css/StyleSheetContents.cpp14
-rw-r--r--Source/WebCore/css/StyleSheetContents.h15
-rw-r--r--Source/WebCore/css/html.css29
-rw-r--r--Source/WebCore/css/makeprop.pl44
-rw-r--r--Source/WebCore/css/themeWin.css2
-rw-r--r--Source/WebCore/dom/Attr.cpp2
-rw-r--r--Source/WebCore/dom/Attr.h2
-rw-r--r--Source/WebCore/dom/Attribute.h7
-rw-r--r--Source/WebCore/dom/CDATASection.cpp2
-rw-r--r--Source/WebCore/dom/CDATASection.h2
-rw-r--r--Source/WebCore/dom/Comment.cpp2
-rw-r--r--Source/WebCore/dom/Comment.h2
-rw-r--r--Source/WebCore/dom/ContainerNodeAlgorithms.h22
-rw-r--r--Source/WebCore/dom/ContextDestructionObserver.cpp27
-rw-r--r--Source/WebCore/dom/ContextDestructionObserver.h1
-rw-r--r--Source/WebCore/dom/ContextFeatures.cpp8
-rw-r--r--Source/WebCore/dom/ContextFeatures.h2
-rw-r--r--Source/WebCore/dom/Document.cpp135
-rw-r--r--Source/WebCore/dom/Document.h36
-rw-r--r--Source/WebCore/dom/DocumentFragment.cpp2
-rw-r--r--Source/WebCore/dom/DocumentFragment.h2
-rw-r--r--Source/WebCore/dom/DocumentType.cpp2
-rw-r--r--Source/WebCore/dom/DocumentType.h2
-rw-r--r--Source/WebCore/dom/Element.cpp30
-rw-r--r--Source/WebCore/dom/Element.h2
-rw-r--r--Source/WebCore/dom/ElementAttributeData.cpp2
-rw-r--r--Source/WebCore/dom/ElementAttributeData.h10
-rw-r--r--Source/WebCore/dom/EntityReference.cpp2
-rw-r--r--Source/WebCore/dom/EntityReference.h2
-rw-r--r--Source/WebCore/dom/EventDispatcher.cpp68
-rw-r--r--Source/WebCore/dom/EventNames.h1
-rw-r--r--Source/WebCore/dom/EventNames.in1
-rw-r--r--Source/WebCore/dom/EventTargetFactory.in1
-rw-r--r--Source/WebCore/dom/MemoryInstrumentation.cpp5
-rw-r--r--Source/WebCore/dom/MemoryInstrumentation.h12
-rw-r--r--Source/WebCore/dom/MessagePort.idl4
-rw-r--r--Source/WebCore/dom/Node.cpp20
-rw-r--r--Source/WebCore/dom/Node.h8
-rw-r--r--Source/WebCore/dom/Node.idl4
-rw-r--r--Source/WebCore/dom/NodeRenderingContext.cpp137
-rw-r--r--Source/WebCore/dom/Notation.cpp2
-rw-r--r--Source/WebCore/dom/Notation.h2
-rw-r--r--Source/WebCore/dom/ProcessingInstruction.cpp4
-rw-r--r--Source/WebCore/dom/ProcessingInstruction.h2
-rw-r--r--Source/WebCore/dom/Range.cpp1
-rw-r--r--Source/WebCore/dom/Range.h6
-rw-r--r--Source/WebCore/dom/ScriptElement.cpp1
-rw-r--r--Source/WebCore/dom/ScriptExecutionContext.h2
-rw-r--r--Source/WebCore/dom/ScriptedAnimationController.cpp2
-rw-r--r--Source/WebCore/dom/ShadowRoot.cpp3
-rw-r--r--Source/WebCore/dom/ShadowRoot.h2
-rw-r--r--Source/WebCore/dom/Text.cpp2
-rw-r--r--Source/WebCore/dom/Text.h2
-rw-r--r--Source/WebCore/dom/ViewportArguments.cpp2
-rw-r--r--Source/WebCore/editing/AlternativeTextController.cpp2
-rw-r--r--Source/WebCore/editing/AppendNodeCommand.cpp2
-rw-r--r--Source/WebCore/editing/CompositeEditCommand.h3
-rw-r--r--Source/WebCore/editing/DOMTransaction.idl33
-rw-r--r--Source/WebCore/editing/DeleteFromTextNodeCommand.cpp4
-rw-r--r--Source/WebCore/editing/DeleteSelectionCommand.cpp18
-rw-r--r--Source/WebCore/editing/DeleteSelectionCommand.h1
-rw-r--r--Source/WebCore/editing/Editor.cpp47
-rw-r--r--Source/WebCore/editing/FrameSelection.cpp8
-rw-r--r--Source/WebCore/editing/FrameSelection.h2
-rw-r--r--Source/WebCore/editing/InsertIntoTextNodeCommand.cpp4
-rw-r--r--Source/WebCore/editing/InsertNodeBeforeCommand.cpp4
-rw-r--r--Source/WebCore/editing/MarkupAccumulator.cpp46
-rw-r--r--Source/WebCore/editing/UndoManager.cpp137
-rw-r--r--Source/WebCore/editing/UndoManager.h41
-rw-r--r--Source/WebCore/editing/UndoManager.idl7
-rw-r--r--Source/WebCore/editing/UndoStep.h3
-rw-r--r--Source/WebCore/editing/chromium/FrameSelectionChromium.cpp2
-rw-r--r--Source/WebCore/fileapi/Blob.cpp10
-rw-r--r--Source/WebCore/fileapi/File.cpp16
-rw-r--r--Source/WebCore/fileapi/File.h10
-rw-r--r--Source/WebCore/fileapi/WebKitBlobBuilder.cpp11
-rw-r--r--Source/WebCore/fileapi/WebKitBlobBuilder.h8
-rw-r--r--Source/WebCore/history/CachedFrame.cpp8
-rw-r--r--Source/WebCore/history/CachedFrame.h2
-rw-r--r--Source/WebCore/history/PageCache.cpp4
-rw-r--r--Source/WebCore/html/BaseDateAndTimeInputType.cpp6
-rw-r--r--Source/WebCore/html/BaseDateAndTimeInputType.h3
-rw-r--r--Source/WebCore/html/DateInputType.cpp10
-rw-r--r--Source/WebCore/html/DateInputType.h2
-rw-r--r--Source/WebCore/html/FileInputType.cpp21
-rw-r--r--Source/WebCore/html/FileInputType.h1
-rw-r--r--Source/WebCore/html/FormController.cpp71
-rw-r--r--Source/WebCore/html/FormController.h3
-rw-r--r--Source/WebCore/html/HTMLAllCollection.idl1
-rw-r--r--Source/WebCore/html/HTMLBodyElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLBodyElement.h2
-rw-r--r--Source/WebCore/html/HTMLFormElement.cpp6
-rw-r--r--Source/WebCore/html/HTMLFrameElementBase.cpp4
-rw-r--r--Source/WebCore/html/HTMLFrameElementBase.h2
-rw-r--r--Source/WebCore/html/HTMLFrameOwnerElement.cpp2
-rw-r--r--Source/WebCore/html/HTMLImageElement.cpp8
-rw-r--r--Source/WebCore/html/HTMLImageElement.h2
-rw-r--r--Source/WebCore/html/HTMLImageLoader.cpp2
-rw-r--r--Source/WebCore/html/HTMLInputElement.cpp20
-rw-r--r--Source/WebCore/html/HTMLInputElement.h3
-rw-r--r--Source/WebCore/html/HTMLLinkElement.cpp12
-rw-r--r--Source/WebCore/html/HTMLLinkElement.h8
-rw-r--r--Source/WebCore/html/HTMLMediaElement.h1
-rw-r--r--Source/WebCore/html/HTMLMediaElement.idl5
-rw-r--r--Source/WebCore/html/HTMLMeterElement.cpp44
-rw-r--r--Source/WebCore/html/HTMLMeterElement.h20
-rw-r--r--Source/WebCore/html/HTMLProgressElement.cpp5
-rw-r--r--Source/WebCore/html/HTMLProgressElement.h2
-rw-r--r--Source/WebCore/html/HTMLSelectElement.cpp20
-rw-r--r--Source/WebCore/html/HTMLSelectElement.h15
-rw-r--r--Source/WebCore/html/HTMLTableCellElement.cpp3
-rw-r--r--Source/WebCore/html/HTMLTextFormControlElement.cpp2
-rw-r--r--Source/WebCore/html/HTMLTrackElement.cpp1
-rw-r--r--Source/WebCore/html/HTMLViewSourceDocument.cpp6
-rw-r--r--Source/WebCore/html/HTMLViewSourceDocument.h2
-rw-r--r--Source/WebCore/html/InputType.cpp52
-rw-r--r--Source/WebCore/html/InputType.h2
-rw-r--r--Source/WebCore/html/NumberInputType.cpp5
-rw-r--r--Source/WebCore/html/NumberInputType.h1
-rw-r--r--Source/WebCore/html/PluginDocument.cpp2
-rw-r--r--Source/WebCore/html/RangeInputType.cpp2
-rw-r--r--Source/WebCore/html/SearchInputType.cpp18
-rw-r--r--Source/WebCore/html/SearchInputType.h4
-rw-r--r--Source/WebCore/html/TextFieldInputType.cpp40
-rw-r--r--Source/WebCore/html/TextFieldInputType.h10
-rw-r--r--Source/WebCore/html/TimeInputType.cpp188
-rw-r--r--Source/WebCore/html/TimeInputType.h55
-rw-r--r--Source/WebCore/html/VoidCallback.h6
-rw-r--r--Source/WebCore/html/VoidCallback.idl5
-rw-r--r--Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp61
-rw-r--r--Source/WebCore/html/canvas/OESVertexArrayObject.cpp6
-rw-r--r--Source/WebCore/html/canvas/WebGLRenderingContext.cpp7
-rw-r--r--Source/WebCore/html/parser/HTMLDocumentParser.cpp5
-rw-r--r--Source/WebCore/html/parser/HTMLDocumentParser.h2
-rw-r--r--Source/WebCore/html/parser/HTMLTokenizer.cpp2
-rw-r--r--Source/WebCore/html/parser/HTMLTreeBuilder.cpp12
-rw-r--r--Source/WebCore/html/parser/XSSAuditor.cpp22
-rw-r--r--Source/WebCore/html/parser/XSSAuditor.h2
-rw-r--r--Source/WebCore/html/shadow/CalendarPickerElement.cpp3
-rw-r--r--Source/WebCore/html/shadow/DateTimeEditElement.cpp28
-rw-r--r--Source/WebCore/html/shadow/DateTimeEditElement.h11
-rw-r--r--Source/WebCore/html/shadow/ImageInnerElement.h2
-rw-r--r--Source/WebCore/html/shadow/MediaControlRootElement.cpp3
-rw-r--r--Source/WebCore/html/shadow/MeterShadowElement.cpp35
-rw-r--r--Source/WebCore/html/shadow/MeterShadowElement.h18
-rw-r--r--Source/WebCore/html/shadow/SliderThumbElement.cpp23
-rw-r--r--Source/WebCore/html/shadow/SliderThumbElement.h1
-rw-r--r--Source/WebCore/html/shadow/SpinButtonElement.cpp244
-rw-r--r--Source/WebCore/html/shadow/SpinButtonElement.h95
-rw-r--r--Source/WebCore/html/shadow/TextControlInnerElements.cpp197
-rw-r--r--Source/WebCore/html/shadow/TextControlInnerElements.h53
-rw-r--r--Source/WebCore/inspector/Inspector.json12
-rw-r--r--Source/WebCore/inspector/InspectorCSSAgent.cpp52
-rw-r--r--Source/WebCore/inspector/InspectorCSSAgent.h6
-rw-r--r--Source/WebCore/inspector/InspectorDOMAgent.h2
-rw-r--r--Source/WebCore/inspector/InspectorDOMStorageAgent.cpp2
-rw-r--r--Source/WebCore/inspector/InspectorDatabaseAgent.cpp2
-rw-r--r--Source/WebCore/inspector/InspectorFileSystemAgent.cpp44
-rw-r--r--Source/WebCore/inspector/InspectorIndexedDBAgent.cpp16
-rw-r--r--Source/WebCore/inspector/InspectorInstrumentation.cpp23
-rw-r--r--Source/WebCore/inspector/InspectorInstrumentation.h12
-rw-r--r--Source/WebCore/inspector/InspectorProfilerAgent.cpp2
-rw-r--r--Source/WebCore/inspector/InspectorResourceAgent.cpp15
-rw-r--r--Source/WebCore/inspector/InspectorResourceAgent.h3
-rw-r--r--Source/WebCore/inspector/InspectorStyleSheet.cpp12
-rw-r--r--Source/WebCore/inspector/InspectorTimelineAgent.cpp42
-rw-r--r--Source/WebCore/inspector/InspectorTimelineAgent.h19
-rw-r--r--Source/WebCore/inspector/TimelineRecordFactory.cpp14
-rw-r--r--Source/WebCore/inspector/TimelineRecordFactory.h4
-rwxr-xr-xSource/WebCore/inspector/compile-front-end.py33
-rw-r--r--Source/WebCore/inspector/front-end/AdvancedSearchController.js6
-rw-r--r--Source/WebCore/inspector/front-end/AuditRules.js4
-rw-r--r--Source/WebCore/inspector/front-end/AuditsPanel.js29
-rw-r--r--Source/WebCore/inspector/front-end/BreakpointManager.js19
-rw-r--r--Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js53
-rw-r--r--Source/WebCore/inspector/front-end/CPUProfileView.js24
-rw-r--r--Source/WebCore/inspector/front-end/CSSSelectorProfileView.js26
-rw-r--r--Source/WebCore/inspector/front-end/CSSStyleModel.js20
-rw-r--r--Source/WebCore/inspector/front-end/CodeMirrorTextEditor.js104
-rw-r--r--Source/WebCore/inspector/front-end/Color.js11
-rw-r--r--Source/WebCore/inspector/front-end/ConsoleMessage.js8
-rw-r--r--Source/WebCore/inspector/front-end/ConsoleModel.js6
-rw-r--r--Source/WebCore/inspector/front-end/ConsolePanel.js5
-rw-r--r--Source/WebCore/inspector/front-end/ConsoleView.js4
-rw-r--r--Source/WebCore/inspector/front-end/DOMAgent.js8
-rw-r--r--Source/WebCore/inspector/front-end/DOMStorage.js4
-rw-r--r--Source/WebCore/inspector/front-end/Database.js2
-rw-r--r--Source/WebCore/inspector/front-end/DebuggerModel.js37
-rw-r--r--Source/WebCore/inspector/front-end/DefaultTextEditor.js93
-rw-r--r--Source/WebCore/inspector/front-end/ElementsPanel.js134
-rw-r--r--Source/WebCore/inspector/front-end/ElementsTreeOutline.js1
-rw-r--r--Source/WebCore/inspector/front-end/ExtensionPanel.js22
-rw-r--r--Source/WebCore/inspector/front-end/ExtensionServer.js25
-rw-r--r--Source/WebCore/inspector/front-end/FileContentView.js2
-rw-r--r--Source/WebCore/inspector/front-end/FilteredItemSelectionDialog.js5
-rw-r--r--Source/WebCore/inspector/front-end/HandlerRegistry.js7
-rw-r--r--Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js8
-rw-r--r--Source/WebCore/inspector/front-end/HeapSnapshotView.js18
-rw-r--r--Source/WebCore/inspector/front-end/InspectorFrontendAPI.js44
-rw-r--r--Source/WebCore/inspector/front-end/InspectorView.js45
-rw-r--r--Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js89
-rw-r--r--Source/WebCore/inspector/front-end/MetricsSidebarPane.js2
-rw-r--r--Source/WebCore/inspector/front-end/NativeBreakpointsSidebarPane.js82
-rw-r--r--Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js7
-rw-r--r--Source/WebCore/inspector/front-end/NetworkLog.js11
-rw-r--r--Source/WebCore/inspector/front-end/NetworkManager.js2
-rw-r--r--Source/WebCore/inspector/front-end/NetworkPanel.js139
-rw-r--r--Source/WebCore/inspector/front-end/ObjectPropertiesSection.js2
-rw-r--r--Source/WebCore/inspector/front-end/Panel.js83
-rw-r--r--Source/WebCore/inspector/front-end/ProfilesPanel.js90
-rw-r--r--Source/WebCore/inspector/front-end/ResourceTreeModel.js5
-rw-r--r--Source/WebCore/inspector/front-end/ResourcesPanel.js16
-rw-r--r--Source/WebCore/inspector/front-end/ScriptSnippetModel.js39
-rw-r--r--Source/WebCore/inspector/front-end/ScriptsPanel.js153
-rw-r--r--Source/WebCore/inspector/front-end/SearchController.js98
-rw-r--r--Source/WebCore/inspector/front-end/Settings.js2
-rw-r--r--Source/WebCore/inspector/front-end/SettingsScreen.js11
-rw-r--r--Source/WebCore/inspector/front-end/SnippetJavaScriptSourceFrame.js61
-rw-r--r--Source/WebCore/inspector/front-end/SourceFrame.js49
-rw-r--r--Source/WebCore/inspector/front-end/Spectrum.js2
-rw-r--r--Source/WebCore/inspector/front-end/SplitView.js5
-rw-r--r--Source/WebCore/inspector/front-end/StatusBarButton.js10
-rw-r--r--Source/WebCore/inspector/front-end/StyleSheetOutlineDialog.js154
-rw-r--r--Source/WebCore/inspector/front-end/StyleSource.js (renamed from Source/WebCore/inspector/front-end/StylesPanel.js)144
-rw-r--r--Source/WebCore/inspector/front-end/StylesSidebarPane.js51
-rw-r--r--Source/WebCore/inspector/front-end/TabbedEditorContainer.js37
-rw-r--r--Source/WebCore/inspector/front-end/TestController.js1
-rw-r--r--Source/WebCore/inspector/front-end/TextEditor.js37
-rw-r--r--Source/WebCore/inspector/front-end/TextPrompt.js8
-rw-r--r--Source/WebCore/inspector/front-end/TimelineModel.js2
-rw-r--r--Source/WebCore/inspector/front-end/TimelinePanel.js22
-rw-r--r--Source/WebCore/inspector/front-end/TimelinePresentationModel.js50
-rw-r--r--Source/WebCore/inspector/front-end/Toolbar.js97
-rw-r--r--Source/WebCore/inspector/front-end/UISourceCode.js3
-rw-r--r--Source/WebCore/inspector/front-end/UISourceCodeFrame.js4
-rw-r--r--Source/WebCore/inspector/front-end/UIUtils.js98
-rw-r--r--Source/WebCore/inspector/front-end/WebKit.qrc5
-rw-r--r--Source/WebCore/inspector/front-end/cmdevtools.css59
-rw-r--r--Source/WebCore/inspector/front-end/elementsPanel.css3
-rw-r--r--Source/WebCore/inspector/front-end/externs.js17
-rw-r--r--Source/WebCore/inspector/front-end/inspector.css40
-rw-r--r--Source/WebCore/inspector/front-end/inspector.html74
-rw-r--r--Source/WebCore/inspector/front-end/inspector.js254
-rw-r--r--Source/WebCore/inspector/front-end/networkLogView.css18
-rw-r--r--Source/WebCore/inspector/front-end/test-runner.html365
-rw-r--r--Source/WebCore/inspector/front-end/timelinePanel.css18
-rw-r--r--Source/WebCore/inspector/front-end/utilities.js16
-rwxr-xr-xSource/WebCore/inspector/inline-javascript-imports.py2
-rw-r--r--Source/WebCore/loader/DocumentLoader.cpp13
-rw-r--r--Source/WebCore/loader/DocumentThreadableLoader.cpp2
-rw-r--r--Source/WebCore/loader/DocumentWriter.cpp15
-rw-r--r--Source/WebCore/loader/FrameLoader.cpp68
-rw-r--r--Source/WebCore/loader/FrameLoader.h5
-rw-r--r--Source/WebCore/loader/ImageLoaderClient.h1
-rw-r--r--Source/WebCore/loader/MainResourceLoader.cpp7
-rw-r--r--Source/WebCore/loader/ResourceLoadNotifier.cpp6
-rw-r--r--Source/WebCore/loader/ResourceLoadNotifier.h2
-rw-r--r--Source/WebCore/loader/ResourceLoader.cpp5
-rw-r--r--Source/WebCore/loader/ResourceLoader.h1
-rw-r--r--Source/WebCore/loader/SubframeLoader.cpp10
-rw-r--r--Source/WebCore/loader/SubresourceLoader.cpp10
-rw-r--r--Source/WebCore/loader/SubresourceLoader.h2
-rw-r--r--Source/WebCore/loader/TextTrackLoader.cpp1
-rw-r--r--Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp24
-rw-r--r--Source/WebCore/loader/cache/CachedImage.cpp10
-rw-r--r--Source/WebCore/loader/cache/CachedResourceLoader.cpp2
-rw-r--r--Source/WebCore/page/ContentSecurityPolicy.cpp385
-rw-r--r--Source/WebCore/page/ContentSecurityPolicy.h3
-rw-r--r--Source/WebCore/page/DOMSecurityPolicy.cpp22
-rw-r--r--Source/WebCore/page/DOMSecurityPolicy.h2
-rw-r--r--Source/WebCore/page/DOMSecurityPolicy.idl2
-rw-r--r--Source/WebCore/page/DOMWindow.cpp86
-rw-r--r--Source/WebCore/page/DOMWindow.h34
-rw-r--r--Source/WebCore/page/DOMWindowProperty.cpp5
-rw-r--r--Source/WebCore/page/DragController.cpp2
-rw-r--r--Source/WebCore/page/EventHandler.cpp109
-rw-r--r--Source/WebCore/page/EventHandler.h7
-rw-r--r--Source/WebCore/page/FocusController.cpp2
-rw-r--r--Source/WebCore/page/Frame.cpp33
-rw-r--r--Source/WebCore/page/Frame.h9
-rw-r--r--Source/WebCore/page/FrameView.cpp12
-rw-r--r--Source/WebCore/page/FrameView.h6
-rw-r--r--Source/WebCore/page/GestureTapHighlighter.cpp10
-rw-r--r--Source/WebCore/page/Location.cpp8
-rw-r--r--Source/WebCore/page/MouseEventWithHitTestResults.h1
-rw-r--r--Source/WebCore/page/PagePopupController.cpp6
-rw-r--r--Source/WebCore/page/PagePopupController.h1
-rw-r--r--Source/WebCore/page/PagePopupController.idl1
-rw-r--r--Source/WebCore/page/SecurityOrigin.cpp6
-rw-r--r--Source/WebCore/page/SecurityOrigin.h5
-rw-r--r--Source/WebCore/page/SpeechInputClient.h3
-rw-r--r--Source/WebCore/page/TouchAdjustment.cpp34
-rw-r--r--Source/WebCore/page/TouchAdjustment.h1
-rw-r--r--Source/WebCore/page/animation/CSSPropertyAnimation.cpp13
-rw-r--r--Source/WebCore/page/animation/ImplicitAnimation.cpp2
-rw-r--r--Source/WebCore/page/chromium/EventHandlerChromium.cpp6
-rw-r--r--Source/WebCore/page/efl/EventHandlerEfl.cpp2
-rw-r--r--Source/WebCore/page/gtk/EventHandlerGtk.cpp2
-rw-r--r--Source/WebCore/page/mac/EventHandlerMac.mm4
-rw-r--r--Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp90
-rw-r--r--Source/WebCore/page/wx/EventHandlerWx.cpp4
-rw-r--r--Source/WebCore/platform/FractionalLayoutUnit.h14
-rw-r--r--Source/WebCore/platform/PlatformInstrumentation.cpp48
-rw-r--r--Source/WebCore/platform/PlatformInstrumentation.h106
-rw-r--r--Source/WebCore/platform/PlatformKeyboardEvent.h9
-rw-r--r--Source/WebCore/platform/PlatformMouseEvent.h10
-rw-r--r--Source/WebCore/platform/PlatformWheelEvent.h9
-rw-r--r--Source/WebCore/platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.cpp18
-rw-r--r--Source/WebCore/platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.h3
-rw-r--r--Source/WebCore/platform/blackberry/CookieManager.cpp17
-rw-r--r--Source/WebCore/platform/blackberry/CookieManager.h2
-rw-r--r--Source/WebCore/platform/blackberry/ReadOnlyLatin1String.h50
-rw-r--r--Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp28
-rw-r--r--Source/WebCore/platform/blackberry/TemporaryLinkStubs.cpp5
-rw-r--r--Source/WebCore/platform/chromium/PopupContainer.cpp115
-rw-r--r--Source/WebCore/platform/chromium/PopupContainer.h6
-rw-r--r--Source/WebCore/platform/chromium/PopupListBox.cpp5
-rw-r--r--Source/WebCore/platform/chromium/PopupListBox.h21
-rw-r--r--Source/WebCore/platform/chromium/ThemeChromiumMac.h60
-rw-r--r--Source/WebCore/platform/chromium/ThemeChromiumMac.mm819
-rw-r--r--Source/WebCore/platform/chromium/support/CCThreadImpl.cpp2
-rw-r--r--Source/WebCore/platform/chromium/support/CCThreadImpl.h2
-rw-r--r--Source/WebCore/platform/chromium/support/Extensions3DChromium.cpp15
-rw-r--r--Source/WebCore/platform/chromium/support/WebCompositorImpl.cpp6
-rw-r--r--Source/WebCore/platform/chromium/support/WebHTTPBody.cpp24
-rw-r--r--Source/WebCore/platform/efl/RenderThemeEfl.cpp22
-rw-r--r--Source/WebCore/platform/efl/ScrollbarEfl.cpp5
-rw-r--r--Source/WebCore/platform/graphics/BitmapImage.h4
-rw-r--r--Source/WebCore/platform/graphics/Extensions3D.h6
-rw-r--r--Source/WebCore/platform/graphics/Font.cpp5
-rw-r--r--Source/WebCore/platform/graphics/Font.h11
-rw-r--r--Source/WebCore/platform/graphics/GraphicsContext.cpp2
-rw-r--r--Source/WebCore/platform/graphics/GraphicsContext3D.cpp2
-rw-r--r--Source/WebCore/platform/graphics/GraphicsContext3D.h20
-rw-r--r--Source/WebCore/platform/graphics/MediaPlayer.cpp6
-rw-r--r--Source/WebCore/platform/graphics/MediaPlayer.h1
-rw-r--r--Source/WebCore/platform/graphics/MediaPlayerPrivate.h1
-rw-r--r--Source/WebCore/platform/graphics/SimpleFontData.cpp4
-rw-r--r--Source/WebCore/platform/graphics/SimpleFontData.h10
-rw-r--r--Source/WebCore/platform/graphics/WidthIterator.cpp3
-rw-r--r--Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.cpp51
-rw-r--r--Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.h11
-rw-r--r--Source/WebCore/platform/graphics/blackberry/EGLImageLayerCompositingThreadClient.cpp126
-rw-r--r--Source/WebCore/platform/graphics/blackberry/EGLImageLayerCompositingThreadClient.h76
-rw-r--r--Source/WebCore/platform/graphics/blackberry/EGLImageLayerWebKitThread.cpp295
-rw-r--r--Source/WebCore/platform/graphics/blackberry/EGLImageLayerWebKitThread.h69
-rw-r--r--Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp14
-rw-r--r--Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp12
-rw-r--r--Source/WebCore/platform/graphics/blackberry/InstrumentedPlatformCanvas.h6
-rw-r--r--Source/WebCore/platform/graphics/blackberry/LayerAnimation.h39
-rw-r--r--Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.cpp44
-rw-r--r--Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.h7
-rw-r--r--Source/WebCore/platform/graphics/blackberry/LayerData.h9
-rw-r--r--Source/WebCore/platform/graphics/blackberry/LayerFilterRenderer.cpp2
-rw-r--r--Source/WebCore/platform/graphics/blackberry/LayerFilterRenderer.h1
-rw-r--r--Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.cpp46
-rw-r--r--Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.h7
-rw-r--r--Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp164
-rw-r--r--Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h16
-rw-r--r--Source/WebCore/platform/graphics/blackberry/TextureCacheCompositingThread.cpp4
-rw-r--r--Source/WebCore/platform/graphics/blackberry/WebGLLayerWebKitThread.cpp30
-rw-r--r--Source/WebCore/platform/graphics/blackberry/WebGLLayerWebKitThread.h8
-rw-r--r--Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp4
-rw-r--r--Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp7
-rw-r--r--Source/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/AnimationTranslationUtil.cpp32
-rw-r--r--Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp8
-rw-r--r--Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h4
-rw-r--r--Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp6
-rw-r--r--Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp64
-rw-r--r--Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.h12
-rw-r--r--Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/CompositorHUDFontAtlas.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp4
-rw-r--r--Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp11
-rw-r--r--Source/WebCore/platform/graphics/chromium/Extensions3DChromium.h6
-rw-r--r--Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp16
-rw-r--r--Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h4
-rw-r--r--Source/WebCore/platform/graphics/chromium/GeometryBinding.cpp10
-rw-r--r--Source/WebCore/platform/graphics/chromium/GeometryBinding.h4
-rw-r--r--Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp352
-rw-r--r--Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h44
-rw-r--r--Source/WebCore/platform/graphics/chromium/HeadsUpDisplayLayerChromium.cpp4
-rw-r--r--Source/WebCore/platform/graphics/chromium/HeadsUpDisplayLayerChromium.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/IOSurfaceLayerChromium.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp14
-rw-r--r--Source/WebCore/platform/graphics/chromium/LayerChromium.cpp20
-rw-r--r--Source/WebCore/platform/graphics/chromium/LayerChromium.h12
-rw-r--r--Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp321
-rw-r--r--Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h106
-rw-r--r--Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp32
-rw-r--r--Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.h6
-rw-r--r--Source/WebCore/platform/graphics/chromium/LayerTextureUpdater.h4
-rw-r--r--Source/WebCore/platform/graphics/chromium/LinkHighlight.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/RateLimiter.cpp6
-rw-r--r--Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/ScrollbarLayerChromium.cpp10
-rw-r--r--Source/WebCore/platform/graphics/chromium/SolidColorLayerChromium.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/TextureCopier.h1
-rw-r--r--Source/WebCore/platform/graphics/chromium/TextureLayerChromium.cpp4
-rw-r--r--Source/WebCore/platform/graphics/chromium/TextureUploader.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp182
-rw-r--r--Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/TreeSynchronizer.cpp6
-rw-r--r--Source/WebCore/platform/graphics/chromium/UnthrottledTextureUploader.h53
-rw-r--r--Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp3
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.cpp74
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.h26
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCActiveGestureAnimation.cpp4
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCAnimationCurve.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCAnimationEvents.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCCheckerboardDrawQuad.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCCheckerboardDrawQuad.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCDamageTracker.cpp10
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp12
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h7
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCDirectRenderer.cpp233
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCDirectRenderer.h127
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.cpp20
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCFontAtlas.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.cpp26
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.h4
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp56
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.h8
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceDrawQuad.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceDrawQuad.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp10
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCInputHandler.h24
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCKeyframedAnimationCurve.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCKeyframedAnimationCurve.h6
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp30
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp16
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h10
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.cpp6
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerQuad.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerSorter.cpp6
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerSorter.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp11
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp32
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h16
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp18
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp154
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h23
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCMathUtil.cpp17
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCMathUtil.h7
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp9
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCOverdrawMetrics.cpp8
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCPageScaleAnimation.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTexture.cpp4
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTexture.h8
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCPriorityCalculator.h1
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCProxy.cpp4
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp12
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp16
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.h6
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.h4
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.cpp18
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCRenderSurfaceFilters.cpp18
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCRenderer.h4
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.cpp195
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.h100
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCScheduler.cpp16
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCScheduler.h6
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCSchedulerStateMachine.cpp4
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCScopedTexture.cpp3
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCScopedTexture.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCScopedThreadProxy.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCScrollbarAnimationController.cpp6
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCScrollbarAnimationControllerLinearFade.cpp4
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCScrollbarAnimationControllerLinearFade.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp6
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCSettings.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCSharedQuadState.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp17
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h6
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCSolidColorDrawQuad.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCSolidColorDrawQuad.h3
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCSolidColorLayerImpl.cpp6
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCSolidColorLayerImpl.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCStreamVideoDrawQuad.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCStreamVideoDrawQuad.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTexture.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTexture.h4
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTextureDrawQuad.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTextureDrawQuad.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTextureLayerImpl.cpp17
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTextureLayerImpl.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateController.cpp64
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateController.h25
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateQueue.cpp8
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateQueue.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp56
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h18
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCThreadTask.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTileDrawQuad.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTileDrawQuad.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp19
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTimer.cpp4
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTimingFunction.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTimingFunction.h3
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp30
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCYUVVideoDrawQuad.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCYUVVideoDrawQuad.h4
-rw-r--r--Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp5
-rw-r--r--Source/WebCore/platform/graphics/filters/FECustomFilter.cpp3
-rw-r--r--Source/WebCore/platform/graphics/filters/FilterEffect.cpp37
-rw-r--r--Source/WebCore/platform/graphics/filters/FilterEffect.h8
-rw-r--r--Source/WebCore/platform/graphics/filters/SourceGraphic.h1
-rw-r--r--Source/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp3
-rw-r--r--Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowPrivate.h6
-rw-r--r--Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp2
-rw-r--r--Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaperBase.h5
-rw-r--r--Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp4
-rw-r--r--Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp21
-rw-r--r--Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h3
-rw-r--r--Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp15
-rw-r--r--Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h3
-rw-r--r--Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp22
-rw-r--r--Source/WebCore/platform/graphics/qt/FontCacheQt.cpp11
-rw-r--r--Source/WebCore/platform/graphics/qt/FontCustomPlatformData.h12
-rw-r--r--Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp31
-rw-r--r--Source/WebCore/platform/graphics/qt/FontPlatformData.h42
-rw-r--r--Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp22
-rw-r--r--Source/WebCore/platform/graphics/qt/FontQt4.cpp432
-rw-r--r--Source/WebCore/platform/graphics/qt/GlyphPageTreeNodeQt.cpp13
-rw-r--r--Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp31
-rw-r--r--Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp7
-rw-r--r--Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h2
-rw-r--r--Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp42
-rw-r--r--Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp2
-rw-r--r--Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp18
-rw-r--r--Source/WebCore/platform/graphics/surfaces/GraphicsSurface.cpp14
-rw-r--r--Source/WebCore/platform/graphics/surfaces/GraphicsSurface.h15
-rw-r--r--Source/WebCore/platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp235
-rw-r--r--Source/WebCore/platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp51
-rw-r--r--Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp25
-rw-r--r--Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h4
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp28
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h34
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp1
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h1
-rw-r--r--Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h10
-rw-r--r--Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp13
-rw-r--r--Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp13
-rw-r--r--Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp13
-rw-r--r--Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp13
-rw-r--r--Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp13
-rw-r--r--Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp37
-rw-r--r--Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h1
-rw-r--r--Source/WebCore/platform/mac/ThemeMac.mm8
-rw-r--r--Source/WebCore/platform/network/BlobData.cpp7
-rw-r--r--Source/WebCore/platform/network/BlobData.h26
-rw-r--r--Source/WebCore/platform/network/BlobRegistryImpl.cpp14
-rw-r--r--Source/WebCore/platform/network/FormData.cpp64
-rw-r--r--Source/WebCore/platform/network/FormData.h25
-rw-r--r--Source/WebCore/platform/network/ResourceRequestBase.cpp15
-rw-r--r--Source/WebCore/platform/network/ResourceRequestBase.h3
-rw-r--r--Source/WebCore/platform/network/ResourceResponseBase.cpp15
-rw-r--r--Source/WebCore/platform/network/ResourceResponseBase.h3
-rw-r--r--Source/WebCore/platform/network/blackberry/DNSBlackBerry.cpp38
-rw-r--r--Source/WebCore/platform/network/blackberry/NetworkJob.cpp28
-rw-r--r--Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp28
-rw-r--r--Source/WebCore/platform/network/blackberry/SocketStreamHandleBlackBerry.cpp4
-rw-r--r--Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp2
-rw-r--r--Source/WebCore/platform/network/qt/DnsPrefetchHelper.h2
-rw-r--r--Source/WebCore/platform/network/qt/NetworkStateNotifierPrivate.h4
-rw-r--r--Source/WebCore/platform/network/qt/QNetworkReplyHandler.h2
-rw-r--r--Source/WebCore/platform/network/qt/QtMIMETypeSniffer.h4
-rw-r--r--Source/WebCore/platform/network/qt/SocketStreamHandlePrivate.h2
-rw-r--r--Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp2
-rw-r--r--Source/WebCore/platform/qt/GamepadsQt.cpp4
-rw-r--r--Source/WebCore/platform/qt/SharedTimerQt.cpp2
-rw-r--r--Source/WebCore/platform/sql/SQLiteDatabase.cpp10
-rw-r--r--Source/WebCore/platform/text/LocaleWin.cpp57
-rw-r--r--Source/WebCore/platform/text/LocaleWin.h5
-rw-r--r--Source/WebCore/platform/text/UnicodeBidi.h6
-rw-r--r--Source/WebCore/platform/text/cf/StringCF.cpp4
-rw-r--r--Source/WebCore/platform/text/cf/StringImplCF.cpp21
-rw-r--r--Source/WebCore/platform/text/gtk/TextCheckerEnchant.cpp2
-rw-r--r--Source/WebCore/platform/win/WindowMessageListener.h7
-rw-r--r--Source/WebCore/rendering/AutoTableLayout.cpp24
-rw-r--r--Source/WebCore/rendering/EllipsisBox.cpp30
-rw-r--r--Source/WebCore/rendering/EllipsisBox.h5
-rw-r--r--Source/WebCore/rendering/FilterEffectRenderer.cpp4
-rw-r--r--Source/WebCore/rendering/HitTestResult.cpp15
-rw-r--r--Source/WebCore/rendering/HitTestResult.h2
-rwxr-xr-xSource/WebCore/rendering/RenderBlock.cpp59
-rw-r--r--Source/WebCore/rendering/RenderBlock.h2
-rwxr-xr-xSource/WebCore/rendering/RenderBlockLineLayout.cpp29
-rw-r--r--Source/WebCore/rendering/RenderBox.cpp13
-rw-r--r--Source/WebCore/rendering/RenderBox.h6
-rw-r--r--Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp9
-rw-r--r--Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h2
-rw-r--r--Source/WebCore/rendering/RenderFlexibleBox.h1
-rw-r--r--Source/WebCore/rendering/RenderFlowThread.cpp7
-rw-r--r--Source/WebCore/rendering/RenderGeometryMap.cpp2
-rw-r--r--Source/WebCore/rendering/RenderGrid.h1
-rw-r--r--Source/WebCore/rendering/RenderInline.cpp33
-rw-r--r--Source/WebCore/rendering/RenderInline.h4
-rw-r--r--Source/WebCore/rendering/RenderLayer.cpp75
-rw-r--r--Source/WebCore/rendering/RenderLayer.h16
-rw-r--r--Source/WebCore/rendering/RenderLayerBacking.cpp23
-rw-r--r--Source/WebCore/rendering/RenderLayerBacking.h8
-rw-r--r--Source/WebCore/rendering/RenderLayerCompositor.cpp21
-rw-r--r--Source/WebCore/rendering/RenderLineBoxList.cpp4
-rw-r--r--Source/WebCore/rendering/RenderListBox.cpp33
-rw-r--r--Source/WebCore/rendering/RenderListBox.h4
-rw-r--r--Source/WebCore/rendering/RenderListItem.cpp14
-rw-r--r--Source/WebCore/rendering/RenderListItem.h3
-rw-r--r--Source/WebCore/rendering/RenderMenuList.cpp47
-rw-r--r--Source/WebCore/rendering/RenderMenuList.h3
-rw-r--r--Source/WebCore/rendering/RenderMeter.cpp15
-rw-r--r--Source/WebCore/rendering/RenderMeter.h8
-rwxr-xr-xSource/WebCore/rendering/RenderObject.cpp99
-rw-r--r--Source/WebCore/rendering/RenderObject.h17
-rw-r--r--Source/WebCore/rendering/RenderObjectChildList.cpp132
-rw-r--r--Source/WebCore/rendering/RenderObjectChildList.h6
-rw-r--r--Source/WebCore/rendering/RenderQuote.cpp170
-rw-r--r--Source/WebCore/rendering/RenderQuote.h8
-rw-r--r--Source/WebCore/rendering/RenderRegion.cpp22
-rw-r--r--Source/WebCore/rendering/RenderRegion.h3
-rw-r--r--Source/WebCore/rendering/RenderReplica.cpp2
-rw-r--r--Source/WebCore/rendering/RenderTableCell.h8
-rw-r--r--Source/WebCore/rendering/RenderTableSection.cpp14
-rw-r--r--Source/WebCore/rendering/RenderTextControl.cpp7
-rw-r--r--Source/WebCore/rendering/RenderTextControlSingleLine.cpp19
-rw-r--r--Source/WebCore/rendering/RenderTextControlSingleLine.h5
-rw-r--r--Source/WebCore/rendering/RenderTheme.cpp1
-rw-r--r--Source/WebCore/rendering/RenderTheme.h4
-rw-r--r--Source/WebCore/rendering/RenderThemeChromiumMac.h1
-rw-r--r--Source/WebCore/rendering/RenderThemeChromiumMac.mm17
-rw-r--r--Source/WebCore/rendering/RenderThemeMac.mm2
-rw-r--r--Source/WebCore/rendering/RenderView.h2
-rw-r--r--Source/WebCore/rendering/RenderWidget.cpp4
-rw-r--r--Source/WebCore/rendering/TextAutosizer.cpp86
-rw-r--r--Source/WebCore/rendering/TextAutosizer.h13
-rw-r--r--Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp2
-rw-r--r--Source/WebCore/rendering/style/NinePieceImage.cpp8
-rw-r--r--Source/WebCore/rendering/style/NinePieceImage.h121
-rw-r--r--Source/WebCore/rendering/style/QuotesData.cpp6
-rw-r--r--Source/WebCore/rendering/style/RenderStyle.cpp104
-rw-r--r--Source/WebCore/rendering/style/RenderStyle.h107
-rw-r--r--Source/WebCore/rendering/style/RenderStyleConstants.h10
-rw-r--r--Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp24
-rw-r--r--Source/WebCore/rendering/style/StyleRareNonInheritedData.h11
-rw-r--r--Source/WebCore/rendering/style/StyleVisualData.cpp6
-rw-r--r--Source/WebCore/rendering/style/StyleVisualData.h16
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp4
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGForeignObject.h2
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGInline.cpp4
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGInline.h2
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGModelObject.cpp4
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGModelObject.h2
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp8
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGRoot.h2
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGText.cpp4
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGText.h2
-rw-r--r--Source/WebCore/rendering/svg/SVGRenderSupport.cpp9
-rw-r--r--Source/WebCore/rendering/svg/SVGRenderSupport.h2
-rw-r--r--Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp10
-rw-r--r--Source/WebCore/storage/StorageEventDispatcher.cpp4
-rw-r--r--Source/WebCore/svg/GradientAttributes.h25
-rw-r--r--Source/WebCore/svg/SVGAnimationElement.cpp11
-rw-r--r--Source/WebCore/svg/SVGDocumentExtensions.cpp4
-rw-r--r--Source/WebCore/svg/SVGMaskElement.cpp4
-rw-r--r--Source/WebCore/svg/SVGMaskElement.h4
-rw-r--r--Source/WebCore/svg/SVGPathElement.cpp14
-rw-r--r--Source/WebCore/svg/SVGPathElement.h2
-rw-r--r--Source/WebCore/svg/animation/SVGSMILElement.cpp3
-rwxr-xr-xSource/WebCore/testing/InternalSettings.cpp8
-rwxr-xr-xSource/WebCore/testing/InternalSettings.h2
-rwxr-xr-xSource/WebCore/testing/InternalSettings.idl1
-rw-r--r--Source/WebCore/testing/Internals.cpp65
-rw-r--r--Source/WebCore/testing/Internals.h9
-rw-r--r--Source/WebCore/testing/Internals.idl7
-rw-r--r--Source/WebCore/testing/MallocStatistics.h (renamed from Source/WebCore/testing/FastMallocStatistics.h)10
-rw-r--r--Source/WebCore/testing/MallocStatistics.idl (renamed from Source/WebCore/testing/FastMallocStatistics.idl)2
-rw-r--r--Source/WebCore/xml/XMLHttpRequest.cpp2
-rw-r--r--Source/WebCore/xml/XPathPath.cpp13
-rw-r--r--Source/WebCore/xml/XSLImportRule.cpp6
-rw-r--r--Source/WebCore/xml/XSLStyleSheetLibxslt.cpp4
-rw-r--r--Source/WebCore/xml/XSLTProcessor.cpp1
-rw-r--r--Source/WebCore/xml/XSLTProcessorLibxslt.cpp4
-rw-r--r--Source/WebCore/xml/XSLTProcessorQt.cpp5
-rw-r--r--Source/WebCore/xml/parser/MarkupTokenBase.h31
-rw-r--r--Source/WebKit/ChangeLog68
-rw-r--r--Source/WebKit/PlatformBlackBerry.cmake15
-rw-r--r--Source/WebKit/PlatformEfl.cmake23
-rw-r--r--Source/WebKit/WebKit1.pri3
-rw-r--r--Source/WebKit/blackberry/Api/InRegionScroller.cpp116
-rw-r--r--Source/WebKit/blackberry/Api/InRegionScroller.h3
-rw-r--r--Source/WebKit/blackberry/Api/InRegionScroller_p.h15
-rw-r--r--Source/WebKit/blackberry/Api/WebOverlay.cpp25
-rw-r--r--Source/WebKit/blackberry/Api/WebOverlayOverride.cpp34
-rw-r--r--Source/WebKit/blackberry/Api/WebOverlayOverride.h2
-rw-r--r--Source/WebKit/blackberry/Api/WebOverlay_p.h5
-rw-r--r--Source/WebKit/blackberry/Api/WebPage.cpp141
-rw-r--r--Source/WebKit/blackberry/Api/WebPageClient.h7
-rw-r--r--Source/WebKit/blackberry/Api/WebPageCompositor.cpp5
-rw-r--r--Source/WebKit/blackberry/Api/WebPage_p.h11
-rw-r--r--Source/WebKit/blackberry/ChangeLog788
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/AboutDataEnableFeatures.in6
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/AboutDataHaveFeatures.in1
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/AboutTemplate.html.cpp2
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp21
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp37
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.h6
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/GeolocationControllerClientBlackBerry.cpp11
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp15
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.h3
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/BackingStoreTile.cpp2
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/BackingStoreTile.h40
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp12
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/DOMSupport.h1
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.cpp7
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.h1
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/FrameLayers.cpp6
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/FrameLayers.h2
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.cpp8
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.h5
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp260
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/InputHandler.h13
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/SurfacePool.cpp41
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/SurfacePool.h2
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp45
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.h1
-rw-r--r--Source/WebKit/chromium/ChangeLog1714
-rw-r--r--Source/WebKit/chromium/DEPS6
-rw-r--r--Source/WebKit/chromium/WebKit.gyp194
-rw-r--r--Source/WebKit/chromium/WebKit.gypi33
-rw-r--r--Source/WebKit/chromium/WebKitUnitTests.gyp10
-rw-r--r--Source/WebKit/chromium/features.gypi4
-rwxr-xr-xSource/WebKit/chromium/gyp_webkit3
-rw-r--r--Source/WebKit/chromium/public/WebDevToolsAgent.h2
-rw-r--r--Source/WebKit/chromium/public/WebHistoryItem.h2
-rw-r--r--Source/WebKit/chromium/public/WebIDBCallbacks.h8
-rw-r--r--Source/WebKit/chromium/public/WebIDBCursor.h16
-rw-r--r--Source/WebKit/chromium/public/WebIDBObjectStore.h5
-rw-r--r--Source/WebKit/chromium/public/WebInputEvent.h37
-rw-r--r--Source/WebKit/chromium/public/WebMediaPlayer.h1
-rw-r--r--Source/WebKit/chromium/public/WebPermissionClient.h5
-rw-r--r--Source/WebKit/chromium/public/WebSpeechInputController.h3
-rw-r--r--Source/WebKit/chromium/public/WebView.h2
-rw-r--r--Source/WebKit/chromium/public/WebViewClient.h7
-rw-r--r--Source/WebKit/chromium/scripts/concatenate_js_files.py1
-rw-r--r--Source/WebKit/chromium/scripts/inline_js_imports.py9
-rw-r--r--Source/WebKit/chromium/src/AudioDestinationChromium.cpp56
-rw-r--r--Source/WebKit/chromium/src/AudioDestinationChromium.h5
-rw-r--r--Source/WebKit/chromium/src/ChromeClientImpl.cpp1
-rw-r--r--Source/WebKit/chromium/src/ColorChooserUIController.cpp3
-rw-r--r--Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp2
-rw-r--r--Source/WebKit/chromium/src/ContextMenuClientImpl.cpp5
-rw-r--r--Source/WebKit/chromium/src/FindInPageCoordinates.cpp142
-rw-r--r--Source/WebKit/chromium/src/FindInPageCoordinates.h (renamed from Source/WebCore/bindings/v8/custom/V8CustomVoidCallback.h)72
-rw-r--r--Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp7
-rw-r--r--Source/WebKit/chromium/src/IDBCallbacksProxy.cpp19
-rw-r--r--Source/WebKit/chromium/src/IDBCallbacksProxy.h6
-rw-r--r--Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp15
-rw-r--r--Source/WebKit/chromium/src/IDBCursorBackendProxy.h3
-rw-r--r--Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp1
-rw-r--r--Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp5
-rw-r--r--Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h1
-rwxr-xr-xSource/WebKit/chromium/src/IDBFactoryBackendProxy.cpp4
-rw-r--r--Source/WebKit/chromium/src/IDBFactoryBackendProxy.h2
-rwxr-xr-xSource/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp28
-rw-r--r--Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h5
-rw-r--r--Source/WebKit/chromium/src/NonCompositedContentHost.cpp45
-rw-r--r--Source/WebKit/chromium/src/NonCompositedContentHost.h4
-rw-r--r--Source/WebKit/chromium/src/StorageAreaProxy.cpp4
-rw-r--r--Source/WebKit/chromium/src/WebAnimationCurveCommon.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebAnimationImpl.cpp (renamed from Source/WebKit/chromium/src/WebAnimation.cpp)64
-rw-r--r--Source/WebKit/chromium/src/WebAnimationImpl.h65
-rw-r--r--Source/WebKit/chromium/src/WebBindings.cpp4
-rw-r--r--Source/WebKit/chromium/src/WebBlobData.cpp7
-rw-r--r--Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp10
-rw-r--r--Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.h4
-rw-r--r--Source/WebKit/chromium/src/WebContentLayerImpl.cpp47
-rw-r--r--Source/WebKit/chromium/src/WebContentLayerImpl.h18
-rw-r--r--Source/WebKit/chromium/src/WebDOMMessageEvent.cpp3
-rw-r--r--Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebExternalTextureLayer.cpp131
-rw-r--r--Source/WebKit/chromium/src/WebExternalTextureLayerImpl.cpp132
-rw-r--r--Source/WebKit/chromium/src/WebExternalTextureLayerImpl.h (renamed from Source/WebKit/chromium/src/WebContentLayer.cpp)72
-rw-r--r--Source/WebKit/chromium/src/WebFloatAnimationCurve.cpp4
-rw-r--r--Source/WebKit/chromium/src/WebFrameImpl.cpp259
-rw-r--r--Source/WebKit/chromium/src/WebFrameImpl.h63
-rw-r--r--Source/WebKit/chromium/src/WebHistoryItem.cpp18
-rw-r--r--Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp24
-rw-r--r--Source/WebKit/chromium/src/WebIDBCallbacksImpl.h7
-rw-r--r--Source/WebKit/chromium/src/WebIDBCursorImpl.cpp15
-rw-r--r--Source/WebKit/chromium/src/WebIDBCursorImpl.h3
-rw-r--r--Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp5
-rw-r--r--Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h1
-rw-r--r--Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp7
-rw-r--r--Source/WebKit/chromium/src/WebIDBDatabaseImpl.h3
-rwxr-xr-xSource/WebKit/chromium/src/WebIDBFactoryImpl.cpp10
-rw-r--r--Source/WebKit/chromium/src/WebIDBFactoryImpl.h1
-rwxr-xr-xSource/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp29
-rw-r--r--Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h4
-rw-r--r--Source/WebKit/chromium/src/WebIOSurfaceLayerImpl.cpp (renamed from Source/WebKit/chromium/src/WebIOSurfaceLayer.cpp)27
-rw-r--r--Source/WebKit/chromium/src/WebIOSurfaceLayerImpl.h54
-rw-r--r--Source/WebKit/chromium/src/WebImageLayerImpl.cpp60
-rw-r--r--Source/WebKit/chromium/src/WebImageLayerImpl.h54
-rw-r--r--Source/WebKit/chromium/src/WebInputEvent.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebLayer.cpp403
-rw-r--r--Source/WebKit/chromium/src/WebLayerImpl.cpp367
-rw-r--r--Source/WebKit/chromium/src/WebLayerImpl.h78
-rw-r--r--Source/WebKit/chromium/src/WebLayerTreeView.cpp11
-rw-r--r--Source/WebKit/chromium/src/WebLayerTreeViewImpl.cpp7
-rw-r--r--Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp25
-rw-r--r--Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h3
-rw-r--r--Source/WebKit/chromium/src/WebPagePopupImpl.cpp5
-rw-r--r--Source/WebKit/chromium/src/WebPluginContainerImpl.cpp41
-rw-r--r--Source/WebKit/chromium/src/WebPluginContainerImpl.h4
-rw-r--r--Source/WebKit/chromium/src/WebScriptController.cpp4
-rw-r--r--Source/WebKit/chromium/src/WebScrollableLayer.cpp75
-rw-r--r--Source/WebKit/chromium/src/WebScrollbarLayerImpl.cpp (renamed from Source/WebKit/chromium/src/WebScrollbarLayer.cpp)31
-rw-r--r--Source/WebKit/chromium/src/WebScrollbarLayerImpl.h55
-rw-r--r--Source/WebKit/chromium/src/WebSolidColorLayerImpl.cpp25
-rw-r--r--Source/WebKit/chromium/src/WebSolidColorLayerImpl.h22
-rw-r--r--Source/WebKit/chromium/src/WebTransformAnimationCurve.cpp4
-rw-r--r--Source/WebKit/chromium/src/WebVideoLayerImpl.cpp58
-rw-r--r--Source/WebKit/chromium/src/WebVideoLayerImpl.h (renamed from Source/WebKit/chromium/src/WebVideoLayer.cpp)35
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.cpp17
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.h4
-rw-r--r--Source/WebKit/chromium/tests/AnimationTranslationUtilTest.cpp243
-rw-r--r--Source/WebKit/chromium/tests/CCActiveAnimationTest.cpp4
-rw-r--r--Source/WebKit/chromium/tests/CCAnimationTestCommon.cpp7
-rw-r--r--Source/WebKit/chromium/tests/CCAnimationTestCommon.h5
-rw-r--r--Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp12
-rw-r--r--Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp42
-rw-r--r--Source/WebKit/chromium/tests/CCFrameRateControllerTest.cpp40
-rw-r--r--Source/WebKit/chromium/tests/CCKeyframedAnimationCurveTest.cpp2
-rw-r--r--Source/WebKit/chromium/tests/CCLayerAnimationControllerTest.cpp7
-rw-r--r--Source/WebKit/chromium/tests/CCLayerImplTest.cpp4
-rw-r--r--Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp4
-rw-r--r--Source/WebKit/chromium/tests/CCLayerQuadTest.cpp2
-rw-r--r--Source/WebKit/chromium/tests/CCLayerSorterTest.cpp8
-rw-r--r--Source/WebKit/chromium/tests/CCLayerTestCommon.cpp2
-rw-r--r--Source/WebKit/chromium/tests/CCLayerTestCommon.h2
-rw-r--r--Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp46
-rw-r--r--Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp257
-rw-r--r--Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp261
-rw-r--r--Source/WebKit/chromium/tests/CCMathUtilTest.cpp49
-rw-r--r--Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp14
-rw-r--r--Source/WebKit/chromium/tests/CCOcclusionTrackerTestCommon.h4
-rw-r--r--Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp8
-rw-r--r--Source/WebKit/chromium/tests/CCQuadCullerTest.cpp18
-rw-r--r--Source/WebKit/chromium/tests/CCRenderSurfaceFiltersTest.cpp15
-rw-r--r--Source/WebKit/chromium/tests/CCRenderSurfaceTest.cpp8
-rw-r--r--Source/WebKit/chromium/tests/CCResourceProviderTest.cpp290
-rw-r--r--Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp2
-rw-r--r--Source/WebKit/chromium/tests/CCSchedulerTest.cpp24
-rw-r--r--Source/WebKit/chromium/tests/CCSchedulerTestCommon.h18
-rw-r--r--Source/WebKit/chromium/tests/CCScopedTextureTest.cpp7
-rw-r--r--Source/WebKit/chromium/tests/CCScrollbarAnimationControllerLinearFadeTest.cpp20
-rw-r--r--Source/WebKit/chromium/tests/CCSolidColorLayerImplTest.cpp7
-rw-r--r--Source/WebKit/chromium/tests/CCTestCommon.h2
-rw-r--r--Source/WebKit/chromium/tests/CCTextureUpdateControllerTest.cpp157
-rw-r--r--Source/WebKit/chromium/tests/CCThreadTaskTest.cpp2
-rw-r--r--Source/WebKit/chromium/tests/CCThreadedTest.cpp18
-rw-r--r--Source/WebKit/chromium/tests/CCThreadedTest.h7
-rw-r--r--Source/WebKit/chromium/tests/CCTiledLayerImplTest.cpp8
-rw-r--r--Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp2
-rw-r--r--Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h14
-rw-r--r--Source/WebKit/chromium/tests/CCTimerTest.cpp2
-rw-r--r--Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp7
-rw-r--r--Source/WebKit/chromium/tests/ContentLayerChromiumTest.cpp3
-rw-r--r--Source/WebKit/chromium/tests/FakeCCGraphicsContext.h2
-rwxr-xr-xSource/WebKit/chromium/tests/FakeCCLayerTreeHostClient.h3
-rw-r--r--Source/WebKit/chromium/tests/FloatQuadTest.cpp2
-rw-r--r--Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp345
-rw-r--r--Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp7
-rw-r--r--Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp5
-rw-r--r--Source/WebKit/chromium/tests/IDBRequestTest.cpp4
-rw-r--r--Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp6
-rw-r--r--Source/WebKit/chromium/tests/LayerChromiumTest.cpp13
-rw-r--r--Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp11
-rw-r--r--Source/WebKit/chromium/tests/LocaleWinTest.cpp9
-rw-r--r--Source/WebKit/chromium/tests/MockCCQuadCuller.h4
-rw-r--r--Source/WebKit/chromium/tests/PlatformGestureCurveTest.cpp4
-rw-r--r--Source/WebKit/chromium/tests/PopupContainerTest.cpp159
-rw-r--r--Source/WebKit/chromium/tests/ScrollbarLayerChromiumTest.cpp6
-rw-r--r--Source/WebKit/chromium/tests/TextureLayerChromiumTest.cpp2
-rw-r--r--Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp185
-rw-r--r--Source/WebKit/chromium/tests/TreeSynchronizerTest.cpp8
-rw-r--r--Source/WebKit/chromium/tests/WebAnimationTest.cpp28
-rw-r--r--Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp42
-rw-r--r--Source/WebKit/chromium/tests/WebFloatAnimationCurveTest.cpp2
-rw-r--r--Source/WebKit/chromium/tests/WebFrameTest.cpp194
-rw-r--r--Source/WebKit/chromium/tests/WebLayerTest.cpp104
-rw-r--r--Source/WebKit/chromium/tests/WebLayerTreeViewTest.cpp30
-rw-r--r--Source/WebKit/chromium/tests/WebLayerTreeViewTestCommon.h58
-rw-r--r--Source/WebKit/chromium/tests/WebTransformAnimationCurveTest.cpp2
-rw-r--r--Source/WebKit/chromium/tests/data/find_in_page.html13
-rw-r--r--Source/WebKit/chromium/tests/data/find_in_page_frame.html58
-rw-r--r--Source/WebKit/chromium/tests/data/select_range_basic.html17
-rw-r--r--Source/WebKit/chromium/tests/data/select_range_editable.html19
-rw-r--r--Source/WebKit/chromium/tests/data/select_range_iframe.html11
-rw-r--r--Source/WebKit/chromium/tests/data/select_range_scroll.html15
-rw-r--r--Source/WebKit/efl/ChangeLog65
-rw-r--r--Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp2
-rw-r--r--Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp4
-rw-r--r--Source/WebKit/efl/ewk/ewk_frame.cpp4
-rw-r--r--Source/WebKit/efl/ewk/ewk_touch_event.cpp4
-rw-r--r--Source/WebKit/efl/ewk/ewk_touch_event_private.h4
-rw-r--r--Source/WebKit/efl/ewk/ewk_view.cpp24
-rw-r--r--Source/WebKit/efl/tests/UnitTestUtils/EWKTestBase.cpp7
-rw-r--r--Source/WebKit/efl/tests/UnitTestUtils/EWKTestBase.h1
-rw-r--r--Source/WebKit/gtk/ChangeLog73
-rw-r--r--Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp2
-rw-r--r--Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp4
-rw-r--r--Source/WebKit/gtk/tests/testatk.c42
-rw-r--r--Source/WebKit/gtk/webkit/webkitwebview.cpp2
-rw-r--r--Source/WebKit/mac/ChangeLog65
-rw-r--r--Source/WebKit/mac/Configurations/FeatureDefines.xcconfig3
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm3
-rw-r--r--Source/WebKit/mac/WebView/WebFrame.mm4
-rw-r--r--Source/WebKit/qt/Api/qwebelement.cpp2
-rw-r--r--Source/WebKit/qt/Api/qwebframe.cpp4
-rw-r--r--Source/WebKit/qt/Api/qwebview.cpp4
-rw-r--r--Source/WebKit/qt/ChangeLog176
-rw-r--r--Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h2
-rw-r--r--Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp6
-rw-r--r--Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h4
-rw-r--r--Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h2
-rw-r--r--Source/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.h2
-rw-r--r--Source/WebKit/qt/WebCoreSupport/IconDatabaseClientQt.h2
-rw-r--r--Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp2
-rw-r--r--Source/WebKit/qt/WebCoreSupport/InspectorServerQt.h4
-rw-r--r--Source/WebKit/qt/WebCoreSupport/PopupMenuQt.h2
-rw-r--r--Source/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h2
-rw-r--r--Source/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp2
-rw-r--r--Source/WebKit/qt/docs/webkitsnippets/webpage/main.cpp4
-rw-r--r--Source/WebKit/qt/examples/platformplugin/WebPlugin.h6
-rw-r--r--Source/WebKit/qt/tests/MIMESniffing/MIMESniffing.pro5
-rw-r--r--Source/WebKit/qt/tests/benchmarks/webgl/tst_webgl.cpp2
-rw-r--r--Source/WebKit/qt/tests/hybridPixmap/tst_hybridPixmap.cpp4
-rw-r--r--Source/WebKit/qt/tests/hybridPixmap/widget.h6
-rw-r--r--Source/WebKit/qt/tests/qdeclarativewebview/tst_qdeclarativewebview.cpp2
-rw-r--r--Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp8
-rw-r--r--Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp72
-rw-r--r--Source/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp4
-rw-r--r--Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp10
-rw-r--r--Source/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp4
-rw-r--r--Source/WebKit/qt/tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp4
-rw-r--r--Source/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp2
-rw-r--r--Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp14
-rw-r--r--Source/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp2
-rw-r--r--Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp6
-rw-r--r--Source/WebKit/win/ChangeLog33
-rw-r--r--Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl2
-rw-r--r--Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp3
-rw-r--r--Source/WebKit/win/WebFrame.cpp4
-rw-r--r--Source/WebKit/wince/ChangeLog13
-rw-r--r--Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp4
-rw-r--r--Source/WebKit/wx/ChangeLog15
-rw-r--r--Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp4
-rw-r--r--Source/WebKit2/CMakeLists.txt4
-rw-r--r--Source/WebKit2/ChangeLog1291
-rw-r--r--Source/WebKit2/Configurations/FeatureDefines.xcconfig3
-rw-r--r--Source/WebKit2/GNUmakefile.list.am4
-rw-r--r--Source/WebKit2/Platform/CoreIPC/Connection.h3
-rw-r--r--Source/WebKit2/PlatformEfl.cmake23
-rw-r--r--Source/WebKit2/PluginProcess/PluginControllerProxy.cpp15
-rw-r--r--Source/WebKit2/PluginProcess/PluginControllerProxy.h9
-rw-r--r--Source/WebKit2/PluginProcess/WebProcessConnection.cpp42
-rw-r--r--Source/WebKit2/PluginProcess/WebProcessConnection.h3
-rw-r--r--Source/WebKit2/PluginProcess/WebProcessConnection.messages.in2
-rw-r--r--Source/WebKit2/Shared/API/c/WKBase.h1
-rw-r--r--Source/WebKit2/Shared/API/c/WKImage.h3
-rw-r--r--Source/WebKit2/Shared/API/c/WKSharedAPICast.h2
-rw-r--r--Source/WebKit2/Shared/API/c/WKURL.cpp5
-rw-r--r--Source/WebKit2/Shared/API/c/WKURL.h1
-rw-r--r--Source/WebKit2/Shared/API/c/WKURLRequest.cpp10
-rw-r--r--Source/WebKit2/Shared/API/c/WKURLRequest.h4
-rw-r--r--Source/WebKit2/Shared/API/c/WKURLResponse.cpp5
-rw-r--r--Source/WebKit2/Shared/API/c/WKURLResponse.h2
-rw-r--r--Source/WebKit2/Shared/APIObject.h1
-rw-r--r--Source/WebKit2/Shared/CommandLine.h2
-rw-r--r--Source/WebKit2/Shared/ImageOptions.h3
-rw-r--r--Source/WebKit2/Shared/IntentData.cpp12
-rw-r--r--Source/WebKit2/Shared/IntentData.h4
-rw-r--r--Source/WebKit2/Shared/ShareableSurface.h2
-rw-r--r--Source/WebKit2/Shared/UserMessageCoders.h1
-rw-r--r--Source/WebKit2/Shared/WebCoreArgumentCoders.cpp7
-rw-r--r--Source/WebKit2/Shared/WebOpenPanelParameters.cpp9
-rw-r--r--Source/WebKit2/Shared/WebOpenPanelParameters.h4
-rw-r--r--Source/WebKit2/Shared/WebPreferencesStore.cpp2
-rw-r--r--Source/WebKit2/Shared/WebURL.h6
-rw-r--r--Source/WebKit2/Target.pri6
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKIntentData.cpp24
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKIntentData.h4
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp10
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h3
-rw-r--r--Source/WebKit2/UIProcess/API/cpp/efl/WKEinaSharedString.cpp5
-rw-r--r--Source/WebKit2/UIProcess/API/cpp/efl/WKEinaSharedString.h3
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.cpp3
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.cpp32
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_download_job.cpp13
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp48
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_intent_service.cpp92
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.cpp6
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_url_request.cpp46
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp21
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view.cpp44
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view.h2
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_web_error.cpp23
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_web_resource.cpp10
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp8
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h1
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/resources/default_test_page.html1
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/resources/intent-request.html29
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/resources/intent-service.html9
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp183
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp81
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_eina_shared_string.cpp118
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_intents.cpp116
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp42
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.h18
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp26
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp150
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h14
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/TestContextMenu.cpp146
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/TestLoaderClient.cpp8
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/TestPrinting.cpp8
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp40
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitFindController.cpp8
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp75
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp19
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp32
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.h5
-rw-r--r--Source/WebKit2/UIProcess/API/mac/WKView.mm13
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp1
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h1
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp6
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qwebkittest_p.h4
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/html/inputmethod.html2
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/inspectorserver/tst_inspectorserver.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/qmltests/DesktopBehavior.pro1
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView.pro1
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp30
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp4
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/util.cpp4
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/util.h4
-rw-r--r--Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp4
-rw-r--r--Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h2
-rw-r--r--Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.messages.in2
-rw-r--r--Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp4
-rw-r--r--Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h2
-rw-r--r--Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp3
-rw-r--r--Source/WebKit2/UIProcess/InspectorServer/qt/WebSocketServerQt.h2
-rw-r--r--Source/WebKit2/UIProcess/WebContext.cpp233
-rw-r--r--Source/WebKit2/UIProcess/WebContext.h57
-rw-r--r--Source/WebKit2/UIProcess/WebContext.messages.in15
-rw-r--r--Source/WebKit2/UIProcess/WebIntentData.cpp16
-rw-r--r--Source/WebKit2/UIProcess/WebIntentData.h16
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.cpp433
-rw-r--r--Source/WebKit2/UIProcess/WebProcessProxy.cpp96
-rw-r--r--Source/WebKit2/UIProcess/WebProcessProxy.h16
-rw-r--r--Source/WebKit2/UIProcess/WebProcessProxy.messages.in7
-rw-r--r--Source/WebKit2/UIProcess/WebTextChecker.cpp14
-rw-r--r--Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp68
-rw-r--r--Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp24
-rw-r--r--Source/WebKit2/UIProcess/qt/QtDialogRunner.h2
-rw-r--r--Source/WebKit2/UIProcess/qt/QtWebContext.cpp3
-rw-r--r--Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.h2
-rw-r--r--Source/WebKit2/WebProcess/Cookies/soup/WebCookieManagerSoup.cpp3
-rw-r--r--Source/WebKit2/WebProcess/Downloads/qt/QtFileDownloader.h2
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h2
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp134
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.h51
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.cpp8
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.h2
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp10
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h2
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntent.cpp100
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntent.h72
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntentRequest.cpp5
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntentRequest.h4
-rw-r--r--Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp3
-rw-r--r--Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.h2
-rw-r--r--Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp6
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp3
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp3
-rw-r--r--Source/WebKit2/WebProcess/WebPage/AreaAllocator.cpp331
-rw-r--r--Source/WebKit2/WebProcess/WebPage/AreaAllocator.h110
-rw-r--r--Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp6
-rw-r--r--Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp18
-rw-r--r--Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/UpdateAtlas.cpp87
-rw-r--r--Source/WebKit2/WebProcess/WebPage/UpdateAtlas.h15
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebFrame.cpp36
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebFrame.h4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.cpp23
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.h9
-rw-r--r--Source/WebKit2/WebProcess/WebProcess.cpp33
-rw-r--r--Source/WebKit2/WebProcess/WebProcess.h15
-rw-r--r--Source/WebKit2/WebProcess/WebProcess.messages.in4
-rw-r--r--Source/WebKit2/WebProcess/gtk/WebProcessGtk.cpp62
-rw-r--r--Source/WebKit2/WebProcess/mac/WebProcessMainMac.mm4
-rw-r--r--Source/WebKit2/win/WebKit2.def3
-rw-r--r--Source/api.pri11
-rw-r--r--Source/autotools/symbols.filter5
-rw-r--r--Source/cmake/FindDBus.cmake59
-rw-r--r--Source/cmake/FindGIO.cmake27
-rw-r--r--Source/cmake/FindGLIB.cmake102
-rw-r--r--Source/cmake/FindGlib.cmake43
-rw-r--r--Source/cmake/FindGthread.cmake4
-rw-r--r--Source/cmake/FindLibSoup.cmake52
-rw-r--r--Source/cmake/FindLibSoup2.cmake191
-rw-r--r--Source/cmake/FindPango.cmake46
-rw-r--r--Source/cmake/LibFindMacros.cmake99
-rw-r--r--Source/cmake/OptionsBlackBerry.cmake10
-rw-r--r--Source/cmake/OptionsEfl.cmake33
-rw-r--r--Source/cmake/WebKitFeatures.cmake1
-rw-r--r--Source/cmakeconfig.h.cmake2
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/config.json8
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg12
-rwxr-xr-xTools/BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py4
-rwxr-xr-xTools/BuildSlaveSupport/build.webkit.org-config/templates/root.html1
-rw-r--r--Tools/BuildSlaveSupport/built-product-archive2
-rw-r--r--Tools/CLWrapper/CLWrapper.vcproj2
-rw-r--r--Tools/ChangeLog1306
-rw-r--r--Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp10
-rw-r--r--Tools/DumpRenderTree/DumpRenderTree.gypi4
-rw-r--r--Tools/DumpRenderTree/DumpRenderTree.h4
-rw-r--r--Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj28
-rw-r--r--Tools/DumpRenderTree/PixelDumpSupport.cpp6
-rw-r--r--Tools/DumpRenderTree/StorageTrackerDelegate.h8
-rw-r--r--Tools/DumpRenderTree/StorageTrackerDelegate.mm6
-rw-r--r--Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp24
-rw-r--r--Tools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSWithinNPP_New.cpp56
-rw-r--r--Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp5
-rw-r--r--Tools/DumpRenderTree/TestRunner.cpp (renamed from Tools/DumpRenderTree/LayoutTestController.cpp)412
-rw-r--r--Tools/DumpRenderTree/TestRunner.h (renamed from Tools/DumpRenderTree/LayoutTestController.h)54
-rw-r--r--Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp110
-rw-r--r--Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp (renamed from Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp)230
-rw-r--r--Tools/DumpRenderTree/cg/ImageDiffCG.cpp16
-rw-r--r--Tools/DumpRenderTree/chromium/DRTTestRunner.cpp (renamed from Tools/DumpRenderTree/chromium/LayoutTestController.cpp)700
-rw-r--r--Tools/DumpRenderTree/chromium/DRTTestRunner.h (renamed from Tools/DumpRenderTree/chromium/LayoutTestController.h)30
-rw-r--r--Tools/DumpRenderTree/chromium/DumpRenderTree.cpp2
-rw-r--r--Tools/DumpRenderTree/chromium/NotificationPresenter.h4
-rw-r--r--Tools/DumpRenderTree/chromium/TestShell.cpp47
-rw-r--r--Tools/DumpRenderTree/chromium/TestShell.h18
-rw-r--r--Tools/DumpRenderTree/chromium/WebPermissions.cpp10
-rw-r--r--Tools/DumpRenderTree/chromium/WebPermissions.h4
-rw-r--r--Tools/DumpRenderTree/chromium/WebViewHost.cpp79
-rw-r--r--Tools/DumpRenderTree/chromium/WebViewHost.h7
-rw-r--r--Tools/DumpRenderTree/efl/CMakeLists.txt13
-rw-r--r--Tools/DumpRenderTree/efl/DumpRenderTree.cpp54
-rw-r--r--Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp82
-rw-r--r--Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp14
-rw-r--r--Tools/DumpRenderTree/efl/EditingCallbacks.cpp24
-rw-r--r--Tools/DumpRenderTree/efl/TestRunnerEfl.cpp (renamed from Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp)242
-rw-r--r--Tools/DumpRenderTree/gtk/DumpRenderTree.cpp111
-rw-r--r--Tools/DumpRenderTree/gtk/EditingCallbacks.cpp24
-rw-r--r--Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp (renamed from Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp)246
-rw-r--r--Tools/DumpRenderTree/mac/DumpRenderTree.mm80
-rw-r--r--Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm9
-rw-r--r--Tools/DumpRenderTree/mac/EditingDelegate.mm28
-rw-r--r--Tools/DumpRenderTree/mac/FrameLoadDelegate.mm58
-rw-r--r--Tools/DumpRenderTree/mac/HistoryDelegate.mm4
-rw-r--r--Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm6
-rw-r--r--Tools/DumpRenderTree/mac/PolicyDelegate.h6
-rw-r--r--Tools/DumpRenderTree/mac/PolicyDelegate.mm4
-rw-r--r--Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm38
-rw-r--r--Tools/DumpRenderTree/mac/TestRunnerMac.mm (renamed from Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm)242
-rw-r--r--Tools/DumpRenderTree/mac/UIDelegate.mm42
-rw-r--r--Tools/DumpRenderTree/qt/DumpRenderTree.pro7
-rwxr-xr-xTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp68
-rw-r--r--Tools/DumpRenderTree/qt/DumpRenderTreeQt.h12
-rw-r--r--Tools/DumpRenderTree/qt/EventSenderQt.h2
-rw-r--r--Tools/DumpRenderTree/qt/GCControllerQt.h2
-rw-r--r--Tools/DumpRenderTree/qt/TestRunnerQt.cpp (renamed from Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp)276
-rw-r--r--Tools/DumpRenderTree/qt/TestRunnerQt.h (renamed from Tools/DumpRenderTree/qt/LayoutTestControllerQt.h)67
-rw-r--r--Tools/DumpRenderTree/qt/TextInputControllerQt.h2
-rw-r--r--Tools/DumpRenderTree/qt/main.cpp1
-rw-r--r--Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp4
-rw-r--r--Tools/DumpRenderTree/win/DumpRenderTree.cpp66
-rw-r--r--Tools/DumpRenderTree/win/DumpRenderTree.vcproj6
-rw-r--r--Tools/DumpRenderTree/win/DumpRenderTreeLauncher.vcproj6
-rw-r--r--Tools/DumpRenderTree/win/EditingDelegate.cpp30
-rw-r--r--Tools/DumpRenderTree/win/FrameLoadDelegate.cpp38
-rw-r--r--Tools/DumpRenderTree/win/HistoryDelegate.cpp14
-rw-r--r--Tools/DumpRenderTree/win/PolicyDelegate.cpp2
-rw-r--r--Tools/DumpRenderTree/win/PolicyDelegate.h6
-rw-r--r--Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp28
-rw-r--r--Tools/DumpRenderTree/win/TestRunnerWin.cpp (renamed from Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp)250
-rw-r--r--Tools/DumpRenderTree/win/UIDelegate.cpp11
-rw-r--r--Tools/DumpRenderTree/wscript4
-rw-r--r--Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp34
-rw-r--r--Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp640
-rw-r--r--Tools/DumpRenderTree/wx/TestRunnerWx.cpp641
-rw-r--r--Tools/EWebLauncher/CMakeLists.txt9
-rw-r--r--Tools/GNUmakefile.am12
-rw-r--r--Tools/MIDLWrapper/MIDLWrapper.vcproj2
-rw-r--r--Tools/MiniBrowser/efl/CMakeLists.txt7
-rw-r--r--Tools/MiniBrowser/mac/AppDelegate.m8
-rw-r--r--Tools/MiniBrowser/mac/WebBundle/WebBundleMain.m8
-rw-r--r--Tools/MiniBrowser/qt/BrowserWindow.h6
-rw-r--r--Tools/MiniBrowser/qt/MiniBrowserApplication.h2
-rw-r--r--Tools/MiniBrowser/qt/UrlLoader.h6
-rw-r--r--Tools/QtTestBrowser/QtTestBrowser.pro3
-rw-r--r--Tools/QtTestBrowser/cookiejar.h4
-rw-r--r--Tools/QtTestBrowser/fpstimer.h2
-rw-r--r--Tools/QtTestBrowser/launcherwindow.cpp7
-rw-r--r--Tools/QtTestBrowser/launcherwindow.h10
-rw-r--r--Tools/QtTestBrowser/locationedit.h4
-rw-r--r--Tools/QtTestBrowser/mainwindow.h2
-rw-r--r--Tools/QtTestBrowser/urlloader.h6
-rw-r--r--Tools/QtTestBrowser/webinspector.h2
-rw-r--r--Tools/QtTestBrowser/webpage.h2
-rw-r--r--Tools/QtTestBrowser/webview.h4
-rw-r--r--Tools/Scripts/VCSUtils.pm2
-rwxr-xr-xTools/Scripts/old-run-webkit-tests14
-rwxr-xr-xTools/Scripts/run-gtk-tests2
-rwxr-xr-xTools/Scripts/update-webkit-chromium23
-rwxr-xr-xTools/Scripts/update-webkit-libs-jhbuild70
-rwxr-xr-xTools/Scripts/update-webkitefl-libs2
-rwxr-xr-xTools/Scripts/webkitdirs.pm155
-rw-r--r--Tools/Scripts/webkitperl/FeatureList.pm8
-rw-r--r--Tools/Scripts/webkitpy/common/config/build.py6
-rw-r--r--Tools/Scripts/webkitpy/common/config/build_unittest.py16
-rw-r--r--Tools/Scripts/webkitpy/common/config/committers.py4
-rw-r--r--Tools/Scripts/webkitpy/common/config/ports.py1
-rw-r--r--Tools/Scripts/webkitpy/common/config/ports_unittest.py5
-rwxr-xr-xTools/Scripts/webkitpy/common/config/watchlist5
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py32
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py24
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py46
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py16
-rwxr-xr-xTools/Scripts/webkitpy/layout_tests/port/base.py26
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py19
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/driver.py45
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/driver_unittest.py2
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/efl.py10
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/server_process.py69
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/server_process_unittest.py7
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/test.py5
-rwxr-xr-xTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py2
-rwxr-xr-xTools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py4
-rw-r--r--Tools/Scripts/webkitpy/performance_tests/perftest.py4
-rwxr-xr-xTools/Scripts/webkitpy/performance_tests/perftest_unittest.py12
-rwxr-xr-xTools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py8
-rw-r--r--Tools/Scripts/webkitpy/style/checkers/cpp.py4
-rw-r--r--Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py9
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/perfalizer.py10
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/perfalizer_unittest.py3
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/queries_unittest.py4
-rw-r--r--Tools/TestResultServer/static-dashboards/builders.js43
-rw-r--r--Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js5
-rw-r--r--Tools/TestWebKitAPI/PlatformEfl.cmake2
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp10
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp2
-rw-r--r--Tools/Tools.pro4
-rw-r--r--Tools/WebKitTestRunner/CMakeLists.txt4
-rw-r--r--Tools/WebKitTestRunner/DerivedSources.make2
-rw-r--r--Tools/WebKitTestRunner/GNUmakefile.am8
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (renamed from Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl)3
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/DerivedSources.pri2
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp12
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h6
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp324
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Target.pri8
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (renamed from Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp)187
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (renamed from Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h)17
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp (renamed from Tools/WebKitTestRunner/InjectedBundle/efl/LayoutTestControllerEfl.cpp)14
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp (renamed from Tools/WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp)14
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm (renamed from Tools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm)14
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp (renamed from Tools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp)18
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/win/TestRunnerWin.cpp (renamed from Tools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp)14
-rw-r--r--Tools/WebKitTestRunner/PlatformEfl.cmake7
-rw-r--r--Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj36
-rw-r--r--Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp2
-rw-r--r--Tools/WebKitTestRunner/qt/main.cpp2
-rw-r--r--Tools/WebKitTestRunner/win/InjectedBundle.vcproj12
-rw-r--r--Tools/WinLauncher/WinLauncher.cpp19
-rw-r--r--Tools/efl/jhbuild.modules88
-rwxr-xr-xTools/jhbuild/jhbuild-wrapper8
-rw-r--r--Tools/qmake/mkspecs/features/default_pre.prf4
-rw-r--r--Tools/qmake/mkspecs/features/features.prf44
-rw-r--r--Tools/qmake/mkspecs/features/features.pri1
-rw-r--r--Tools/qmake/mkspecs/features/functions.prf14
-rw-r--r--Tools/qmake/mkspecs/features/gprof.prf11
-rw-r--r--Tools/qmake/qt_webkit.pri2
-rw-r--r--Tools/win/DLLLauncher/DLLLauncherMain.cpp8
-rw-r--r--WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme5
-rw-r--r--WebKitLibraries/ChangeLog36
-rw-r--r--WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops20
-rw-r--r--WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops7
-rw-r--r--WebKitLibraries/win/tools/vsprops/common.vsprops2
-rw-r--r--configure.ac26
1743 files changed, 48722 insertions, 20844 deletions
diff --git a/ChangeLog b/ChangeLog
index e8cffea0e..babf3cf67 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,245 @@
+2012-08-20 George Staikos <staikos@webkit.org>
+
+ [BlackBerry] Enable XHR Response BLOB
+ https://bugs.webkit.org/show_bug.cgi?id=94525
+
+ Reviewed by Rob Buis.
+
+ Add the XHR response blob enable feature to the cmake build system and
+ enable it for BlackBerry.
+
+ * Source/cmake/OptionsBlackBerry.cmake: Add the feature and enable
+ * Source/cmakeconfig.h.cmake: Add the feature
+
+2012-08-20 Dominik Röttsches <dominik.rottsches@intel.com>
+
+ [EFL] Get rid of pango backend support once harfbuzz-ng is working
+ https://bugs.webkit.org/show_bug.cgi?id=92102
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Removing choice of font backend, Pango detection not required any more.
+
+ * Source/cmake/FindPango.cmake: Removed.
+ * Source/cmake/LibFindMacros.cmake: Removed.
+ * Source/cmake/OptionsEfl.cmake: Removing choice of font backend.
+
+2012-08-17 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] Add FindDBus.cmake and use it in the EFL port.
+ https://bugs.webkit.org/show_bug.cgi?id=94319
+
+ Reviewed by Daniel Bates.
+
+ Currently, the Battery Status-related code in the EFL port uses
+ libdbus but does not directly include its directories or link
+ against it, relying instead on the compiler flags coming via
+ EDbus's pkg-config information.
+
+ That will break once we stop obtaining EFL's include directories
+ and library paths from pkg-config, so write FindDBus.cmake to
+ prepare for that.
+
+ * Source/cmake/FindDBus.cmake: Added.
+ * Source/cmake/OptionsEfl.cmake: Look for D-Bus if BATTERY_STATUS
+ support is enabled.
+
+2012-08-17 Rob Buis <rbuis@rim.com>
+
+ [BlackBerry] Remove some shared libraries from linking
+ https://bugs.webkit.org/show_bug.cgi?id=94253
+
+ Reviewed by Yong Li.
+
+ Remove some shared libraries.
+
+ * Source/cmake/OptionsBlackBerry.cmake:
+
+2012-08-16 Gustavo Noronha Silva <gns@gnome.org>
+
+ Unreviewed speculative 32 bits build fix.
+
+ * Source/autotools/symbols.filter: add symbol version that gets
+ generated in 32 bits build.
+
+2012-08-16 Max Feil <mfeil@rim.com>
+
+ [BlackBerry] Some media controls are mispositioned for dynamic live streams (HLS)
+ https://bugs.webkit.org/show_bug.cgi?id=94176
+
+ Reviewed by Antonio Gomes.
+
+ An automated layout test is not possible for this patch because
+ dynamic live streams require a special dedicated web server.
+ Putting an external video URL into an automated test is not
+ correct either. So I have created a manual test that points to
+ an external HLS video that works today.
+
+ * ManualTests/blackberry/video-hls-controls.html: Added.
+
+2012-08-16 Marja Hölttä <marja@chromium.org>
+
+ FormController, WebHistoryItem: Enable reading selected file names from document state
+ https://bugs.webkit.org/show_bug.cgi?id=91231
+
+ Reviewed by Jochen Eisinger.
+
+ This change enables Chromium to set up file permissions properly when
+ the session restore feature restores a page with selected files.
+
+ * Source/autotools/symbols.filter: Exported FormController::getReferencedFilePaths and HistoryController::saveDocumentAndScrollState.
+
+2012-08-15 Kent Tamura <tkent@chromium.org>
+
+ Calendar Picker: Localize numbers in a calendar picker
+ https://bugs.webkit.org/show_bug.cgi?id=93704
+
+ Reviewed by Hajime Morita.
+
+ * ManualTests/forms/calendar-picker.html:
+ Add a mock pagePopupController.localizeNumberString().
+
+2012-08-15 Ryosuke Niwa <rniwa@webkit.org>
+
+ Update manual tests and comments to refer to TestRunner instead of LayoutTestController
+ https://bugs.webkit.org/show_bug.cgi?id=94168
+
+ Reviewed by Kent Tamura.
+
+ * ManualTests/resources/multiFileResources/post-echo-and-notify-done.cgi:
+
+2012-08-15 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com>
+
+ [css3-text] Add CSS3 Text decoration compile flag
+ https://bugs.webkit.org/show_bug.cgi?id=93863
+
+ Reviewed by Julien Chaffraix.
+
+ This patch handles the compile flag implementation, which will come disabled by
+ default, thus not exposing the CSS3 text decoration features to the web, unless
+ when explicitly enabling it with "--css3-text-decoration" build parameter.
+
+ * Source/cmake/WebKitFeatures.cmake:
+ * Source/cmakeconfig.h.cmake:
+ * configure.ac:
+
+2012-08-15 Brady Eidson <beidson@apple.com>
+
+ Removing a plug-in element from a page opened in a background tab in Safari crashes
+ <rdar://problem/12057991> and https://bugs.webkit.org/show_bug.cgi?id=93913
+
+ Reviewed by Beth Dakin.
+
+ * Source/autotools/symbols.filter: Allow this symbol through for DRT's sake.
+
+2012-08-14 Keishi Hattori <keishi@webkit.org>
+
+ Share common code between calendar picker and color suggestion picker
+ https://bugs.webkit.org/show_bug.cgi?id=93802
+
+ Reviewed by Kent Tamura.
+
+ * ManualTests/forms/calendar-picker.html:
+ * ManualTests/forms/color-suggestion-picker.html:
+
+2012-08-14 Milian Wolff <milian.wolff@kdab.com>
+
+ [Qt] QtWebKit linking fails for QNX cross build
+ https://bugs.webkit.org/show_bug.cgi?id=93460
+
+ Reviewed by Simon Hausmann.
+
+ The GCC 4.4.2 used by the QNX BBNDK 2.0.1 fails to link QtWebKit.
+ Apparently it does not properly support the linker invokation using
+ -Wl,-whole-archive -l... -Wl,-no-whole-archive
+ yielding a "cc: no files to process" error. This patch works around
+ this issue by adding an empty dummy file (and thus object file) to
+ the linking stage.
+
+ * Source/api.pri:
+
+2012-08-14 Keishi Hattori <keishi@webkit.org>
+
+ Move page popup resources to separate directory
+ https://bugs.webkit.org/show_bug.cgi?id=93932
+
+ Reviewed by Kent Tamura.
+
+ * ManualTests/forms/calendar-picker.html:
+ * ManualTests/forms/color-suggestion-picker.html:
+
+2012-08-11 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] Rewrite FindLibSoup2.cmake.
+ https://bugs.webkit.org/show_bug.cgi?id=93191
+
+ Reviewed by Rob Buis.
+
+ The existing LibSoup2 was imported from somewhere else and not
+ only did it contain a lot of unnecessary cruft to look for libsoup
+ 2.2 (which we do not support anyway), but it also relied on the
+ paths returned by pkg-config for setting the library and include
+ paths.
+
+ For one, this meant "-lsoup-2.4" was passed to the linked instead
+ of "-L/path/to/libsoup-2.4.so", which would sometimes make a
+ system version of libsoup to be picked up instead of the one
+ installed by, say, jhbuild.
+
+ The new FindLibSoup.cmake now only looks for libsoup 2.4 and
+ relies on pkg-config solely for retrieving the current LibSoup
+ version.
+
+ * Source/cmake/FindLibSoup.cmake: Added.
+ * Source/cmake/FindLibSoup2.cmake: Removed.
+ * Source/cmake/OptionsEfl.cmake: Look for LibSoup instead of
+ LibSoup2, look for the GObject component of Glib.
+
+2012-08-13 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] Remove glib-related Find modules and write single new one instead.
+ https://bugs.webkit.org/show_bug.cgi?id=93786
+
+ Reviewed by Rob Buis.
+
+ As part of the ongoing effort to write proper Find modules that use
+ absolute include and library paths instead of the short ones from
+ pkg-config, replace Find{GIO,Glib,Gthread}.cmake with a single
+ FindGLIB.cmake that optionally detects components such as GIO and
+ GObject.
+
+ Library paths are now defined as "/full/path/to/libfoo.so" instead of
+ simply "foo", so that the linker receives a full path and we can then
+ avoid accidentally picking up a libfoo.so installed into /usr/lib
+ instead of a local one built with jhbuild.
+
+ * Source/cmake/FindGIO.cmake: Removed.
+ * Source/cmake/FindGLIB.cmake: Added.
+ * Source/cmake/FindGlib.cmake: Removed.
+ * Source/cmake/FindGthread.cmake: Removed.
+ * Source/cmake/OptionsEfl.cmake: Look for GLIB with the GIO component.
+
+2012-08-13 Zan Dobersek <zandobersek@gmail.com>
+
+ [Gtk] Remove SVG_FEATURES and HTML_FEATURES from Source/WebCore/GNUmakefile.am
+ https://bugs.webkit.org/show_bug.cgi?id=90693
+
+ Reviewed by Philippe Normand.
+
+ Remove exportation of SVG_FLAGS and HTML_FLAGS as Automake conditionals
+ as they are not required anymore.
+
+ * configure.ac:
+
+2012-08-12 Loïc Yhuel <loic.yhuel@softathome.com>
+
+ [Qt] Make it possible to build without QtTest/QtPrintSupport
+ https://bugs.webkit.org/show_bug.cgi?id=93492
+
+ Reviewed by Tor Arne Vestbø.
+
+ * Source/QtWebKit.pro: Disable tests if no testlib
+
2012-08-10 Rob Buis <rbuis@rim.com>
[BlackBerry] Enable relro link option for JSC executable
diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt
index 146a11910..317814aa9 100644
--- a/Source/JavaScriptCore/CMakeLists.txt
+++ b/Source/JavaScriptCore/CMakeLists.txt
@@ -39,6 +39,7 @@ SET(JavaScriptCore_SOURCES
assembler/LinkBuffer.cpp
+ bytecode/ArrayProfile.cpp
bytecode/CallLinkInfo.cpp
bytecode/CallLinkStatus.cpp
bytecode/CodeBlock.cpp
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 063b2f519..4297df1e5 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,843 @@
+2012-08-20 Mark Lam <mark.lam@apple.com>
+
+ Fix broken non-JIT build.
+ https://bugs.webkit.org/show_bug.cgi?id=94564.
+
+ Reviewed by Filip Pizlo.
+
+ Added some UNUSED_PARAM() macros to make the compiler happy.
+
+ * runtime/Executable.cpp:
+ (JSC::EvalExecutable::compileInternal):
+ (JSC::ProgramExecutable::compileInternal):
+ (JSC::FunctionExecutable::compileForCallInternal):
+ (JSC::FunctionExecutable::compileForConstructInternal):
+
+2012-08-20 Mark Lam <mark.lam@apple.com>
+
+ Fixed erroneous line number for LLint frame when throwing exceptions.
+ https://bugs.webkit.org/show_bug.cgi?id=94051.
+
+ Reviewed by Filip Pizlo.
+
+ For LLInt frames, before throwing an exception, adjust the PC from the
+ return PC back to the call PC if we are indeed at a call site.
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::adjustPCIfAtCallSite):
+ (JSC):
+ (JSC::CodeBlock::bytecodeOffset):
+ * bytecode/CodeBlock.h:
+ (CodeBlock):
+ * llint/LLIntExceptions.cpp:
+ (JSC::LLInt::fixupPCforExceptionIfNeeded):
+ (LLInt):
+ (JSC::LLInt::interpreterThrowInCaller):
+ (JSC::LLInt::returnToThrow):
+ (JSC::LLInt::callToThrow):
+
+2012-08-20 Filip Pizlo <fpizlo@apple.com>
+
+ fast/js/dfg-peephole-compare-final-object-to-final-object-or-other-when-both-proven-final-object.html on 32-bit
+ https://bugs.webkit.org/show_bug.cgi?id=94538
+
+ Reviewed by Mark Hahnenberg.
+
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
+
+2012-08-20 Filip Pizlo <fpizlo@apple.com>
+
+ fast/js/dfg-compare-final-object-to-final-object-or-other-when-both-proven-final-object.html crashes on 32-bit
+ https://bugs.webkit.org/show_bug.cgi?id=94026
+
+ Reviewed by Mark Hahnenberg.
+
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
+
+2012-08-19 Filip Pizlo <fpizlo@apple.com>
+
+ The relationship between abstract values and structure transition watchpoints should be rationalized
+ https://bugs.webkit.org/show_bug.cgi?id=94205
+
+ Reviewed by Geoffrey Garen.
+
+ This patch does a number of things related to the handling of the abstract values
+ arrising from values with structures known to be watchpointable:
+
+ - This rationalizes the relationship between the structure that we know an object
+ to have *right now* based on having executed a check against that structure, and
+ the structure that we know the object could have *in the future* based on a type
+ check executed in the past over a structure that was watchpointable.
+
+ - We use the above to assert that structure transition watchpoints are being used
+ soundly.
+
+ - We use the above to strength reduce CheckStructure into StructureTransitionWatchpoint
+ whenever possible.
+
+ - This rationalizes the handling of CFA over constants that appeared in the bytecode.
+ If at compile-time the constant has a watchpointable structure, then we can prove
+ what structures it may have in the future. The analysis uses this to both assert
+ that structure transition watchpoints are being used correctly, and to find
+ opportunities for using them more aggressively.
+
+ The net effect of all of these changes is that OSR entry should work more smoothly.
+ It may also be a slight win due to strength reductions, though most of those strength
+ reductions would have already been done by the parser and the structure check hoister.
+
+ * GNUmakefile.list.am:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * dfg/DFGAbstractState.cpp:
+ (JSC::DFG::AbstractState::beginBasicBlock):
+ (JSC::DFG::AbstractState::execute):
+ * dfg/DFGAbstractValue.h:
+ (DFG):
+ (JSC::DFG::AbstractValue::clear):
+ (JSC::DFG::AbstractValue::isClear):
+ (JSC::DFG::AbstractValue::makeTop):
+ (JSC::DFG::AbstractValue::clobberStructures):
+ (JSC::DFG::AbstractValue::isTop):
+ (JSC::DFG::AbstractValue::setFuturePossibleStructure):
+ (AbstractValue):
+ (JSC::DFG::AbstractValue::filterFuturePossibleStructure):
+ (JSC::DFG::AbstractValue::setMostSpecific):
+ (JSC::DFG::AbstractValue::set):
+ (JSC::DFG::AbstractValue::operator==):
+ (JSC::DFG::AbstractValue::merge):
+ (JSC::DFG::AbstractValue::filter):
+ (JSC::DFG::AbstractValue::filterValueByType):
+ (JSC::DFG::AbstractValue::validateType):
+ (JSC::DFG::AbstractValue::validate):
+ (JSC::DFG::AbstractValue::checkConsistency):
+ (JSC::DFG::AbstractValue::dump):
+ * dfg/DFGArgumentsSimplificationPhase.cpp:
+ (JSC::DFG::ArgumentsSimplificationPhase::run):
+ * dfg/DFGCSEPhase.cpp:
+ (JSC::DFG::CSEPhase::checkStructureLoadElimination):
+ (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
+ (JSC::DFG::CSEPhase::performNodeCSE):
+ * dfg/DFGConstantFoldingPhase.cpp:
+ (JSC::DFG::ConstantFoldingPhase::foldConstants):
+ * dfg/DFGNode.h:
+ (JSC::DFG::Node::convertToStructureTransitionWatchpoint):
+ (Node):
+ (JSC::DFG::Node::hasStructure):
+ * dfg/DFGNodeType.h:
+ (DFG):
+ * dfg/DFGOSREntry.cpp:
+ (JSC::DFG::prepareOSREntry):
+ * dfg/DFGPredictionPropagationPhase.cpp:
+ (JSC::DFG::PredictionPropagationPhase::propagate):
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::convertLastOSRExitToForward):
+ (JSC::DFG::SpeculativeJIT::forwardSpeculationWatchpoint):
+ (DFG):
+ (JSC::DFG::SpeculativeJIT::speculationWatchpointWithConditionalDirection):
+ (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
+ (JSC::DFG::SpeculativeJIT::speculateArray):
+ * dfg/DFGSpeculativeJIT.h:
+ (SpeculativeJIT):
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * dfg/DFGStructureAbstractValue.h: Added.
+ (DFG):
+ (StructureAbstractValue):
+ (JSC::DFG::StructureAbstractValue::StructureAbstractValue):
+ (JSC::DFG::StructureAbstractValue::clear):
+ (JSC::DFG::StructureAbstractValue::makeTop):
+ (JSC::DFG::StructureAbstractValue::top):
+ (JSC::DFG::StructureAbstractValue::add):
+ (JSC::DFG::StructureAbstractValue::addAll):
+ (JSC::DFG::StructureAbstractValue::contains):
+ (JSC::DFG::StructureAbstractValue::isSubsetOf):
+ (JSC::DFG::StructureAbstractValue::doesNotContainAnyOtherThan):
+ (JSC::DFG::StructureAbstractValue::isSupersetOf):
+ (JSC::DFG::StructureAbstractValue::filter):
+ (JSC::DFG::StructureAbstractValue::isClear):
+ (JSC::DFG::StructureAbstractValue::isTop):
+ (JSC::DFG::StructureAbstractValue::isClearOrTop):
+ (JSC::DFG::StructureAbstractValue::isNeitherClearNorTop):
+ (JSC::DFG::StructureAbstractValue::size):
+ (JSC::DFG::StructureAbstractValue::at):
+ (JSC::DFG::StructureAbstractValue::operator[]):
+ (JSC::DFG::StructureAbstractValue::last):
+ (JSC::DFG::StructureAbstractValue::speculationFromStructures):
+ (JSC::DFG::StructureAbstractValue::hasSingleton):
+ (JSC::DFG::StructureAbstractValue::singleton):
+ (JSC::DFG::StructureAbstractValue::operator==):
+ (JSC::DFG::StructureAbstractValue::dump):
+ (JSC::DFG::StructureAbstractValue::topValue):
+ * dfg/DFGStructureCheckHoistingPhase.cpp:
+ (JSC::DFG::StructureCheckHoistingPhase::run):
+
+2012-08-17 Filip Pizlo <fpizlo@apple.com>
+
+ The current state of the call frame should be taken into account in the DFG for both predictions and proofs
+ https://bugs.webkit.org/show_bug.cgi?id=94412
+
+ Reviewed by Geoffrey Garen.
+
+ This ensures that no matter how smart the DFG gets, it'll always know through
+ which entrypoint OSR will try to enter, and with which values it will attempt
+ to do so. For prologue OSR, this has no effect other than adding the current
+ arguments to the argument predictions. For loop OSR, this makes our treatment
+ of the loop slightly more conservative - just conservative enough to ensure
+ that OSR succeeds.
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::ProgramCodeBlock::compileOptimized):
+ (JSC::EvalCodeBlock::compileOptimized):
+ (JSC::FunctionCodeBlock::compileOptimized):
+ * bytecode/CodeBlock.h:
+ (CodeBlock):
+ (ProgramCodeBlock):
+ (EvalCodeBlock):
+ (FunctionCodeBlock):
+ * dfg/DFGAbstractState.cpp:
+ (JSC::DFG::AbstractState::initialize):
+ * dfg/DFGAbstractValue.h:
+ (JSC::DFG::AbstractValue::setMostSpecific):
+ (AbstractValue):
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::fixVariableAccessPredictions):
+ (JSC::DFG::ByteCodeParser::parse):
+ * dfg/DFGDriver.cpp:
+ (JSC::DFG::compile):
+ (JSC::DFG::tryCompile):
+ (JSC::DFG::tryCompileFunction):
+ * dfg/DFGDriver.h:
+ (DFG):
+ (JSC::DFG::tryCompile):
+ (JSC::DFG::tryCompileFunction):
+ * dfg/DFGGraph.h:
+ (JSC::DFG::Graph::Graph):
+ (Graph):
+ * jit/JITDriver.h:
+ (JSC::jitCompileIfAppropriate):
+ (JSC::jitCompileFunctionIfAppropriate):
+ * jit/JITStubs.cpp:
+ (JSC::DEFINE_STUB_FUNCTION):
+ * runtime/Executable.cpp:
+ (JSC::EvalExecutable::compileOptimized):
+ (JSC::EvalExecutable::compileInternal):
+ (JSC::ProgramExecutable::compileOptimized):
+ (JSC::ProgramExecutable::compileInternal):
+ (JSC::FunctionExecutable::compileOptimizedForCall):
+ (JSC::FunctionExecutable::compileOptimizedForConstruct):
+ (JSC::FunctionExecutable::compileForCallInternal):
+ (JSC::FunctionExecutable::compileForConstructInternal):
+ * runtime/Executable.h:
+ (EvalExecutable):
+ (ProgramExecutable):
+ (FunctionExecutable):
+ (JSC::FunctionExecutable::compileOptimizedFor):
+ * runtime/ExecutionHarness.h:
+ (JSC::prepareForExecution):
+ (JSC::prepareFunctionForExecution):
+
+2012-08-17 Filip Pizlo <fpizlo@apple.com>
+
+ DFG CSE should be more honest about when it changed the IR
+ https://bugs.webkit.org/show_bug.cgi?id=94408
+
+ Reviewed by Geoffrey Garen.
+
+ The CSE phase now always returns true if it changed the IR.
+
+ * dfg/DFGCSEPhase.cpp:
+ (JSC::DFG::CSEPhase::setReplacement):
+ (JSC::DFG::CSEPhase::eliminate):
+ (JSC::DFG::CSEPhase::performNodeCSE):
+
+2012-08-17 Filip Pizlo <fpizlo@apple.com>
+
+ DFG is still too pessimistic about what constitutes a side-effect on array accesses
+ https://bugs.webkit.org/show_bug.cgi?id=94309
+
+ Reviewed by Geoffrey Garen.
+
+ This change means that even if structure transition watchpoints are not used for
+ hoisting of clobbered structure checks, we still retain good performance on the
+ benchmarks we care about. That's important, since butterflies will likely make
+ most array structures not watchpointable.
+
+ * dfg/DFGAbstractState.cpp:
+ (JSC::DFG::AbstractState::execute):
+ * dfg/DFGStructureCheckHoistingPhase.cpp:
+ (JSC::DFG::StructureCheckHoistingPhase::run):
+
+2012-08-17 Milian Wolff <milian.wolff@kdab.com>
+
+ [Qt] QNX build fails due to ctype usage in system headers
+ https://bugs.webkit.org/show_bug.cgi?id=93849
+
+ Reviewed by Simon Hausmann.
+
+ Move the check for whether DisallowCType should be active or not
+ to the DisallowCType.h header. This way, we can update the list
+ of platforms or OSes which do not work with this header in a
+ central place. All users can now safely include the header
+ and do not need to place custom guards around it.
+
+ * config.h:
+
+2012-08-16 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Replace use of internal Weak smart pointer with JSWeakObjectMap
+ https://bugs.webkit.org/show_bug.cgi?id=93872
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * Target.pri: Add missing JSWeakObjectMap file to build.
+
+2012-08-16 Filip Pizlo <fpizlo@apple.com>
+
+ Structure check hoisting should be less expensive
+ https://bugs.webkit.org/show_bug.cgi?id=94201
+
+ Reviewed by Mark Hahnenberg.
+
+ This appears like a broad win on short-running programs.
+
+ * dfg/DFGArgumentsSimplificationPhase.cpp:
+ (JSC::DFG::ArgumentsSimplificationPhase::run):
+ * dfg/DFGCSEPhase.cpp:
+ (JSC::DFG::CSEPhase::performNodeCSE):
+ * dfg/DFGDriver.cpp:
+ (JSC::DFG::compile):
+ * dfg/DFGGraph.h:
+ (JSC::DFG::Graph::compareAndSwap):
+ (Graph):
+ (JSC::DFG::Graph::substitute):
+ (JSC::DFG::Graph::substituteGetLocal):
+ * dfg/DFGStructureCheckHoistingPhase.cpp:
+ (JSC::DFG::StructureCheckHoistingPhase::run):
+
+2012-08-16 Filip Pizlo <fpizlo@apple.com>
+
+ All op_resolve_global instructions should end up in the list of global resolve instructions
+ https://bugs.webkit.org/show_bug.cgi?id=94247
+ <rdar://problem/12103500>
+
+ Reviewed by Mark Hahnenberg.
+
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::emitResolveWithBase):
+
+2012-08-15 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com>
+
+ [css3-text] Add CSS3 Text decoration compile flag
+ https://bugs.webkit.org/show_bug.cgi?id=93863
+
+ Reviewed by Julien Chaffraix.
+
+ This patch handles the compile flag implementation, which will come disabled by
+ default, thus not exposing the CSS3 text decoration features to the web, unless
+ when explicitly enabling it with "--css3-text-decoration" build parameter.
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2012-08-15 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125687.
+ http://trac.webkit.org/changeset/125687
+ https://bugs.webkit.org/show_bug.cgi?id=94147
+
+ It broke the whole world (Requested by Ossy_night on #webkit).
+
+ * API/JSValueRef.cpp:
+ (JSValueToBoolean):
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+ * bytecode/Watchpoint.h:
+ (WatchpointSet):
+ * debugger/DebuggerCallFrame.h:
+ * dfg/DFGAbstractState.cpp:
+ (JSC::DFG::AbstractState::execute):
+ * dfg/DFGCFGSimplificationPhase.cpp:
+ (JSC::DFG::CFGSimplificationPhase::run):
+ * dfg/DFGOperations.cpp:
+ * dfg/DFGOperations.h:
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
+ (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
+ (JSC::DFG::SpeculativeJIT::compile):
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
+ (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
+ (JSC::DFG::SpeculativeJIT::compile):
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_is_undefined):
+ (JSC::JIT::emit_op_jeq_null):
+ (JSC::JIT::emit_op_jneq_null):
+ (JSC::JIT::emit_op_eq_null):
+ (JSC::JIT::emit_op_neq_null):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_is_undefined):
+ (JSC::JIT::emit_op_jeq_null):
+ (JSC::JIT::emit_op_jneq_null):
+ (JSC::JIT::emit_op_eq_null):
+ (JSC::JIT::emit_op_neq_null):
+ * jit/JITStubs.cpp:
+ (JSC::DEFINE_STUB_FUNCTION):
+ * llint/LLIntSlowPaths.cpp:
+ (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+ * llint/LowLevelInterpreter32_64.asm:
+ * llint/LowLevelInterpreter64.asm:
+ * runtime/ArrayPrototype.cpp:
+ (JSC::arrayProtoFuncFilter):
+ (JSC::arrayProtoFuncEvery):
+ (JSC::arrayProtoFuncSome):
+ * runtime/BooleanConstructor.cpp:
+ (JSC::constructBoolean):
+ (JSC::callBooleanConstructor):
+ * runtime/JSCell.h:
+ (JSCell):
+ * runtime/JSGlobalObject.cpp:
+ (JSC::JSGlobalObject::JSGlobalObject):
+ * runtime/JSGlobalObject.h:
+ (JSGlobalObject):
+ * runtime/JSString.h:
+ (JSC::JSCell::toBoolean):
+ (JSC::JSValue::toBoolean):
+ * runtime/JSValue.h:
+ * runtime/ObjectConstructor.cpp:
+ (JSC::toPropertyDescriptor):
+ * runtime/Operations.cpp:
+ (JSC::jsTypeStringForValue):
+ (JSC::jsIsObjectType):
+ * runtime/Operations.h:
+ (JSC):
+ (JSC::JSValue::equalSlowCaseInline):
+ * runtime/RegExpConstructor.cpp:
+ (JSC::setRegExpConstructorMultiline):
+ * runtime/RegExpPrototype.cpp:
+ (JSC::regExpProtoFuncToString):
+ * runtime/Structure.h:
+
+2012-08-15 Gabor Ballabas <gaborb@inf.u-szeged.hu>
+
+ Buildfix after r125541
+ https://bugs.webkit.org/show_bug.cgi?id=94097
+
+ Reviewed by Filip Pizlo.
+
+ r125541 has broken the traditional ARM port build of JSC.
+
+ * assembler/MacroAssemblerARM.h:
+ (JSC::MacroAssemblerARM::neg32):
+ (JSC::MacroAssemblerARM::xor32):
+
+2012-08-14 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ Change behavior of MasqueradesAsUndefined to better accommodate DFG changes
+ https://bugs.webkit.org/show_bug.cgi?id=93884
+
+ Reviewed by Geoffrey Garen.
+
+ With some upcoming changes to the DFG to remove uses of ClassInfo, we will be changing the behavior of
+ MasqueradesAsUndefined. In order to make this change consistent across all of our execution engines,
+ we will make this change to MasqueradesAsUndefined as a separate patch. After this patch, MasqueradesAsUndefined
+ objects will only masquerade as undefined in their original context (i.e. their original JSGlobalObject).
+ For example, if an object that masquerades as undefined in frame A is passed to frame B, it will not
+ masquerade as undefined within frame B, but it will continue to masquerade in frame A.
+
+ There are two primary changes that are taking place here. One is to thread the ExecState* through
+ JSValue::toBoolean and JSCell::toBoolean so that JSCell::toBoolean can check the object's
+ JSGlobalObject to compare it to the lexical JSGlobalObject of the currently running code. If the two
+ are distinct, then the object cannot MasqueradeAsUndefined.
+
+ The other change is to perform this comparison of JSGlobalObjects everywhere where the MasqueradesAsUndefined
+ flag in the Structure is checked. For C++ code, this check has been factored into its own function in
+ Structure::masqueradesAsUndefined. We only perform this check in the DFG if the current JSGlobalObject has
+ had a MasqueradesAsUndefined object allocated within its context. This conditional compilation is managed
+ through the use of a WatchpointSet in each JSGlobalObject and alternate create() functions for JS DOM wrappers
+ that are MasqueradesAsUndefined.
+
+ * API/JSValueRef.cpp:
+ (JSValueToBoolean):
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+ * bytecode/Watchpoint.h:
+ (WatchpointSet):
+ * debugger/DebuggerCallFrame.h:
+ (JSC::DebuggerCallFrame::callFrame):
+ * dfg/DFGAbstractState.cpp:
+ (JSC::DFG::AbstractState::execute):
+ * dfg/DFGCFGSimplificationPhase.cpp:
+ (JSC::DFG::CFGSimplificationPhase::run):
+ * dfg/DFGOperations.cpp:
+ * dfg/DFGOperations.h:
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
+ (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
+ (JSC::DFG::SpeculativeJIT::compile):
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
+ (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
+ (JSC::DFG::SpeculativeJIT::compile):
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_is_undefined):
+ (JSC::JIT::emit_op_jeq_null):
+ (JSC::JIT::emit_op_jneq_null):
+ (JSC::JIT::emit_op_eq_null):
+ (JSC::JIT::emit_op_neq_null):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_is_undefined):
+ (JSC::JIT::emit_op_jeq_null):
+ (JSC::JIT::emit_op_jneq_null):
+ (JSC::JIT::emit_op_eq_null):
+ (JSC::JIT::emit_op_neq_null):
+ * jit/JITStubs.cpp:
+ (JSC::DEFINE_STUB_FUNCTION):
+ * llint/LLIntSlowPaths.cpp:
+ (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+ * llint/LowLevelInterpreter32_64.asm:
+ * llint/LowLevelInterpreter64.asm:
+ * runtime/ArrayPrototype.cpp:
+ (JSC::arrayProtoFuncFilter):
+ (JSC::arrayProtoFuncEvery):
+ (JSC::arrayProtoFuncSome):
+ * runtime/BooleanConstructor.cpp:
+ (JSC::constructBoolean):
+ (JSC::callBooleanConstructor):
+ * runtime/JSCell.h:
+ (JSCell):
+ * runtime/JSGlobalObject.cpp:
+ (JSC::JSGlobalObject::JSGlobalObject):
+ * runtime/JSGlobalObject.h:
+ (JSGlobalObject):
+ (JSC::JSGlobalObject::masqueradesAsUndefinedWatchpoint):
+ * runtime/JSString.h:
+ (JSC::JSCell::toBoolean):
+ (JSC::JSValue::toBoolean):
+ * runtime/JSValue.h:
+ * runtime/ObjectConstructor.cpp:
+ (JSC::toPropertyDescriptor):
+ * runtime/Operations.cpp:
+ (JSC::jsTypeStringForValue):
+ (JSC::jsIsObjectType):
+ * runtime/Operations.h:
+ (JSC):
+ (JSC::JSValue::equalSlowCaseInline):
+ * runtime/RegExpConstructor.cpp:
+ (JSC::setRegExpConstructorMultiline):
+ * runtime/RegExpPrototype.cpp:
+ (JSC::regExpProtoFuncToString):
+ * runtime/Structure.h:
+ (Structure):
+ (JSC::Structure::globalObjectOffset):
+ (JSC::Structure::masqueradesAsUndefined):
+ (JSC):
+
+2012-08-14 Filip Pizlo <fpizlo@apple.com>
+
+ Unreviewed, build fix for !ENABLE(DFG_JIT)
+
+ * jit/JITPropertyAccess.cpp:
+ (JSC::JIT::emit_op_get_by_val):
+ (JSC::JIT::emit_op_put_by_val):
+ (JSC::JIT::privateCompilePatchGetArrayLength):
+ * jit/JITPropertyAccess32_64.cpp:
+ (JSC::JIT::emit_op_get_by_val):
+ (JSC::JIT::emit_op_put_by_val):
+ (JSC::JIT::privateCompilePatchGetArrayLength):
+ * llint/LowLevelInterpreter32_64.asm:
+ * llint/LowLevelInterpreter64.asm:
+
+2012-08-13 Filip Pizlo <fpizlo@apple.com>
+
+ Array checks should use the structure, not the class info
+ https://bugs.webkit.org/show_bug.cgi?id=93150
+
+ Reviewed by Mark Hahnenberg.
+
+ This changes all array checks used in array accesses (get, put, get length,
+ push, pop) to use the structure, not the class info. Additionally, these
+ checks in the LLInt and baseline JIT record the structure in an ArrayProfile,
+ so that the DFG can know exactly what structure to check for.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * Target.pri:
+ * bytecode/ArrayProfile.cpp: Added.
+ (JSC):
+ (JSC::ArrayProfile::computeUpdatedPrediction):
+ * bytecode/ArrayProfile.h: Added.
+ (JSC):
+ (JSC::arrayModeFromStructure):
+ (ArrayProfile):
+ (JSC::ArrayProfile::ArrayProfile):
+ (JSC::ArrayProfile::bytecodeOffset):
+ (JSC::ArrayProfile::addressOfLastSeenStructure):
+ (JSC::ArrayProfile::observeStructure):
+ (JSC::ArrayProfile::expectedStructure):
+ (JSC::ArrayProfile::structureIsPolymorphic):
+ (JSC::ArrayProfile::hasDefiniteStructure):
+ (JSC::ArrayProfile::observedArrayModes):
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::dump):
+ (JSC::CodeBlock::getArrayProfile):
+ (JSC):
+ (JSC::CodeBlock::getOrAddArrayProfile):
+ (JSC::CodeBlock::updateAllPredictionsAndCountLiveness):
+ * bytecode/CodeBlock.h:
+ (JSC::CodeBlock::executionEntryCount):
+ (JSC::CodeBlock::numberOfArrayProfiles):
+ (JSC::CodeBlock::arrayProfiles):
+ (JSC::CodeBlock::addArrayProfile):
+ (CodeBlock):
+ * bytecode/Instruction.h:
+ (JSC):
+ (JSC::Instruction::Instruction):
+ * bytecode/Opcode.h:
+ (JSC):
+ (JSC::padOpcodeName):
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::emitGetArgumentByVal):
+ (JSC::BytecodeGenerator::emitGetByVal):
+ (JSC::BytecodeGenerator::emitPutByVal):
+ * dfg/DFGAbstractState.cpp:
+ (JSC::DFG::AbstractState::initialize):
+ (JSC::DFG::AbstractState::execute):
+ * dfg/DFGAbstractValue.h:
+ (JSC::DFG::StructureAbstractValue::hasSingleton):
+ (StructureAbstractValue):
+ (JSC::DFG::StructureAbstractValue::singleton):
+ * dfg/DFGArgumentsSimplificationPhase.cpp:
+ (JSC::DFG::ArgumentsSimplificationPhase::run):
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::parseBlock):
+ * dfg/DFGFixupPhase.cpp:
+ (JSC::DFG::FixupPhase::fixupNode):
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::speculateArray):
+ (DFG):
+ (JSC::DFG::SpeculativeJIT::compile):
+ (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
+ (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
+ * dfg/DFGSpeculativeJIT.h:
+ (SpeculativeJIT):
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * dfg/DFGStructureCheckHoistingPhase.cpp:
+ (JSC::DFG::StructureCheckHoistingPhase::run):
+ * jit/JITPropertyAccess.cpp:
+ (JSC::JIT::emit_op_get_by_val):
+ (JSC::JIT::emit_op_put_by_val):
+ (JSC::JIT::privateCompilePatchGetArrayLength):
+ * jit/JITPropertyAccess32_64.cpp:
+ (JSC::JIT::emit_op_get_by_val):
+ (JSC::JIT::emit_op_put_by_val):
+ (JSC::JIT::privateCompilePatchGetArrayLength):
+ * llint/LLIntOffsetsExtractor.cpp:
+ * llint/LowLevelInterpreter32_64.asm:
+ * llint/LowLevelInterpreter64.asm:
+ * runtime/Structure.h:
+ (Structure):
+ (JSC::Structure::classInfoOffset):
+
+2012-08-14 Gabor Ballabas <gaborb@inf.u-szeged.hu>
+
+ Rename functions in the ARM port of DFG-JIT for better code readability.
+ https://bugs.webkit.org/show_bug.cgi?id=93609
+
+ Reviewed by Zoltan Herczeg.
+
+ Rename functions in the ARM port of DFG-JIT for better code
+ readability, and for following the WebKit coding style
+ wherever it is possible.
+
+ * assembler/ARMAssembler.cpp:
+ (JSC::ARMAssembler::genInt):
+ (JSC::ARMAssembler::getImm):
+ (JSC::ARMAssembler::moveImm):
+ (JSC::ARMAssembler::encodeComplexImm):
+ (JSC::ARMAssembler::dataTransfer32):
+ (JSC::ARMAssembler::baseIndexTransfer32):
+ (JSC::ARMAssembler::dataTransfer16):
+ (JSC::ARMAssembler::baseIndexTransfer16):
+ (JSC::ARMAssembler::dataTransferFloat):
+ (JSC::ARMAssembler::baseIndexTransferFloat):
+ * assembler/ARMAssembler.h:
+ (JSC::ARMAssembler::bitAnd):
+ (JSC::ARMAssembler::bitAnds):
+ (JSC::ARMAssembler::eor):
+ (JSC::ARMAssembler::eors):
+ (JSC::ARMAssembler::sub):
+ (JSC::ARMAssembler::subs):
+ (JSC::ARMAssembler::rsb):
+ (JSC::ARMAssembler::rsbs):
+ (JSC::ARMAssembler::add):
+ (JSC::ARMAssembler::adds):
+ (JSC::ARMAssembler::adc):
+ (JSC::ARMAssembler::adcs):
+ (JSC::ARMAssembler::sbc):
+ (JSC::ARMAssembler::sbcs):
+ (JSC::ARMAssembler::rsc):
+ (JSC::ARMAssembler::rscs):
+ (JSC::ARMAssembler::tst):
+ (JSC::ARMAssembler::teq):
+ (JSC::ARMAssembler::cmp):
+ (JSC::ARMAssembler::cmn):
+ (JSC::ARMAssembler::orr):
+ (JSC::ARMAssembler::orrs):
+ (JSC::ARMAssembler::mov):
+ (JSC::ARMAssembler::movw):
+ (JSC::ARMAssembler::movt):
+ (JSC::ARMAssembler::movs):
+ (JSC::ARMAssembler::bic):
+ (JSC::ARMAssembler::bics):
+ (JSC::ARMAssembler::mvn):
+ (JSC::ARMAssembler::mvns):
+ (JSC::ARMAssembler::mul):
+ (JSC::ARMAssembler::muls):
+ (JSC::ARMAssembler::mull):
+ (JSC::ARMAssembler::vmov_f64):
+ (JSC::ARMAssembler::vadd_f64):
+ (JSC::ARMAssembler::vdiv_f64):
+ (JSC::ARMAssembler::vsub_f64):
+ (JSC::ARMAssembler::vmul_f64):
+ (JSC::ARMAssembler::vcmp_f64):
+ (JSC::ARMAssembler::vsqrt_f64):
+ (JSC::ARMAssembler::vabs_f64):
+ (JSC::ARMAssembler::vneg_f64):
+ (JSC::ARMAssembler::ldrImmediate):
+ (JSC::ARMAssembler::ldrUniqueImmediate):
+ (JSC::ARMAssembler::dtrUp):
+ (JSC::ARMAssembler::dtrUpRegister):
+ (JSC::ARMAssembler::dtrDown):
+ (JSC::ARMAssembler::dtrDownRegister):
+ (JSC::ARMAssembler::halfDtrUp):
+ (JSC::ARMAssembler::halfDtrUpRegister):
+ (JSC::ARMAssembler::halfDtrDown):
+ (JSC::ARMAssembler::halfDtrDownRegister):
+ (JSC::ARMAssembler::doubleDtrUp):
+ (JSC::ARMAssembler::doubleDtrDown):
+ (JSC::ARMAssembler::push):
+ (JSC::ARMAssembler::pop):
+ (JSC::ARMAssembler::poke):
+ (JSC::ARMAssembler::peek):
+ (JSC::ARMAssembler::vmov_vfp64):
+ (JSC::ARMAssembler::vmov_arm64):
+ (JSC::ARMAssembler::vmov_vfp32):
+ (JSC::ARMAssembler::vmov_arm32):
+ (JSC::ARMAssembler::vcvt_f64_s32):
+ (JSC::ARMAssembler::vcvt_s32_f64):
+ (JSC::ARMAssembler::vcvt_u32_f64):
+ (JSC::ARMAssembler::vcvt_f64_f32):
+ (JSC::ARMAssembler::vcvt_f32_f64):
+ (JSC::ARMAssembler::clz):
+ (JSC::ARMAssembler::lslRegister):
+ (JSC::ARMAssembler::lsrRegister):
+ (JSC::ARMAssembler::asrRegister):
+ (JSC::ARMAssembler::align):
+ (JSC::ARMAssembler::loadBranchTarget):
+ (JSC::ARMAssembler::vmov):
+ * assembler/MacroAssemblerARM.cpp:
+ (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
+ * assembler/MacroAssemblerARM.h:
+ (JSC::MacroAssemblerARM::add32):
+ (JSC::MacroAssemblerARM::and32):
+ (JSC::MacroAssemblerARM::lshift32):
+ (JSC::MacroAssemblerARM::mul32):
+ (JSC::MacroAssemblerARM::or32):
+ (JSC::MacroAssemblerARM::rshift32):
+ (JSC::MacroAssemblerARM::urshift32):
+ (JSC::MacroAssemblerARM::sub32):
+ (JSC::MacroAssemblerARM::xor32):
+ (JSC::MacroAssemblerARM::countLeadingZeros32):
+ (JSC::MacroAssemblerARM::convertibleLoadPtr):
+ (JSC::MacroAssemblerARM::load32WithAddressOffsetPatch):
+ (JSC::MacroAssemblerARM::load32WithCompactAddressOffsetPatch):
+ (JSC::MacroAssemblerARM::store32WithAddressOffsetPatch):
+ (JSC::MacroAssemblerARM::store32):
+ (JSC::MacroAssemblerARM::pop):
+ (JSC::MacroAssemblerARM::push):
+ (JSC::MacroAssemblerARM::move):
+ (JSC::MacroAssemblerARM::swap):
+ (JSC::MacroAssemblerARM::branch32):
+ (JSC::MacroAssemblerARM::branchTest32):
+ (JSC::MacroAssemblerARM::mull32):
+ (JSC::MacroAssemblerARM::branchSub32):
+ (JSC::MacroAssemblerARM::compare32):
+ (JSC::MacroAssemblerARM::test32):
+ (JSC::MacroAssemblerARM::load32):
+ (JSC::MacroAssemblerARM::relativeTableJump):
+ (JSC::MacroAssemblerARM::moveWithPatch):
+ (JSC::MacroAssemblerARM::loadDouble):
+ (JSC::MacroAssemblerARM::moveDouble):
+ (JSC::MacroAssemblerARM::addDouble):
+ (JSC::MacroAssemblerARM::divDouble):
+ (JSC::MacroAssemblerARM::subDouble):
+ (JSC::MacroAssemblerARM::mulDouble):
+ (JSC::MacroAssemblerARM::sqrtDouble):
+ (JSC::MacroAssemblerARM::absDouble):
+ (JSC::MacroAssemblerARM::negateDouble):
+ (JSC::MacroAssemblerARM::convertInt32ToDouble):
+ (JSC::MacroAssemblerARM::convertFloatToDouble):
+ (JSC::MacroAssemblerARM::convertDoubleToFloat):
+ (JSC::MacroAssemblerARM::branchDouble):
+ (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
+ (JSC::MacroAssemblerARM::branchTruncateDoubleToUint32):
+ (JSC::MacroAssemblerARM::truncateDoubleToInt32):
+ (JSC::MacroAssemblerARM::truncateDoubleToUint32):
+ (JSC::MacroAssemblerARM::branchConvertDoubleToInt32):
+ (JSC::MacroAssemblerARM::branchDoubleNonZero):
+ (JSC::MacroAssemblerARM::branchDoubleZeroOrNaN):
+
+2012-08-13 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed, rolling out r125444.
+ http://trac.webkit.org/changeset/125444
+ https://bugs.webkit.org/show_bug.cgi?id=93872
+
+ Broke some tests
+
+ * Target.pri:
+
+2012-08-13 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Replace use of internal Weak smart pointer with JSWeakObjectMap
+ https://bugs.webkit.org/show_bug.cgi?id=93872
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * Target.pri: Add missing JSWeakObjectMap file to build.
+
+2012-08-13 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] Remove glib-related Find modules and write single new one instead.
+ https://bugs.webkit.org/show_bug.cgi?id=93786
+
+ Reviewed by Rob Buis.
+
+ * shell/PlatformEfl.cmake: Use GLIB_* instead of Glib_*.
+
+2012-08-12 Allan Sandfeld Jensen <allan.jensen@nokia.com>
+
+ Doesn't build with ENABLE_JIT=0
+ https://bugs.webkit.org/show_bug.cgi?id=85042
+
+ Reviewed by Eric Seidel.
+
+ Include headers without which CallFrame.h does not build, and
+ fix gcc warning about comparing unsigned int with 0.
+
+ * dfg/DFGDriver.cpp:
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::isOpcode):
+
2012-08-10 Yong Li <yoli@rim.com>
[BlackBerry] GCActivityCallback should always schedule GC even allocated bytes is a small number
diff --git a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig b/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
index 40d95cb9c..9c1b8ffa7 100644
--- a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
+++ b/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
@@ -48,6 +48,7 @@ ENABLE_CSS_COMPOSITING = ;
ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION;
ENABLE_CSS_VARIABLES = ;
ENABLE_CSS3_FLEXBOX = ENABLE_CSS3_FLEXBOX;
+ENABLE_CSS3_TEXT_DECORATION = ;
ENABLE_CUSTOM_SCHEME_HANDLER = ;
ENABLE_DASHBOARD_SUPPORT = $(ENABLE_DASHBOARD_SUPPORT_$(REAL_PLATFORM_NAME));
ENABLE_DASHBOARD_SUPPORT_macosx = ENABLE_DASHBOARD_SUPPORT;
@@ -139,4 +140,4 @@ ENABLE_WIDGET_REGION_macosx = ENABLE_WIDGET_REGION;
ENABLE_WORKERS = ENABLE_WORKERS;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_FLEXBOX) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WIDGET_REGION) $(ENABLE_WORKERS) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_FLEXBOX) $(ENABLE_CSS3_TEXT_DECORATION) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WIDGET_REGION) $(ENABLE_WORKERS) $(ENABLE_XSLT);
diff --git a/Source/JavaScriptCore/GNUmakefile.list.am b/Source/JavaScriptCore/GNUmakefile.list.am
index ab8b110c2..c504962cc 100644
--- a/Source/JavaScriptCore/GNUmakefile.list.am
+++ b/Source/JavaScriptCore/GNUmakefile.list.am
@@ -82,6 +82,8 @@ javascriptcore_sources += \
Source/JavaScriptCore/assembler/RepatchBuffer.h \
Source/JavaScriptCore/assembler/SH4Assembler.h \
Source/JavaScriptCore/assembler/X86Assembler.h \
+ Source/JavaScriptCore/bytecode/ArrayProfile.cpp \
+ Source/JavaScriptCore/bytecode/ArrayProfile.h \
Source/JavaScriptCore/bytecode/BytecodeConventions.h \
Source/JavaScriptCore/bytecode/CallLinkInfo.cpp \
Source/JavaScriptCore/bytecode/CallLinkInfo.h \
@@ -227,6 +229,7 @@ javascriptcore_sources += \
Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp \
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp \
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h \
+ Source/JavaScriptCore/dfg/DFGStructureAbstractValue.h \
Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp \
Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.h \
Source/JavaScriptCore/dfg/DFGThunks.cpp \
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
index 2efa84059..e91baa473 100644
--- a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
+++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
@@ -1530,6 +1530,14 @@
Name="bytecode"
>
<File
+ RelativePath="..\..\bytecode\ArrayProfile.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\bytecode\ArrayProfile.h"
+ >
+ </File>
+ <File
RelativePath="..\..\bytecode\CallLinkInfo.cpp"
>
</File>
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/testRegExp/testRegExp.vcproj b/Source/JavaScriptCore/JavaScriptCore.vcproj/testRegExp/testRegExp.vcproj
index b7053908d..57b9ce643 100755
--- a/Source/JavaScriptCore/JavaScriptCore.vcproj/testRegExp/testRegExp.vcproj
+++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/testRegExp/testRegExp.vcproj
@@ -50,6 +50,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
/>
<Tool
Name="VCALinkTool"
@@ -111,6 +112,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
/>
<Tool
Name="VCALinkTool"
@@ -172,6 +174,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
/>
<Tool
Name="VCALinkTool"
@@ -233,6 +236,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
/>
<Tool
Name="VCALinkTool"
@@ -295,6 +299,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
/>
<Tool
Name="VCALinkTool"
@@ -356,6 +361,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
/>
<Tool
Name="VCALinkTool"
@@ -417,6 +423,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
/>
<Tool
Name="VCALinkTool"
diff --git a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index add311969..a41fb993b 100644
--- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -140,6 +140,9 @@
0F620179143FCD480068B77C /* DFGAbstractState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F62016D143FCD2F0068B77C /* DFGAbstractState.cpp */; };
0F63943F15C75F19006A597C /* DFGStructureCheckHoistingPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F63943D15C75F14006A597C /* DFGStructureCheckHoistingPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F63944015C75F1D006A597C /* DFGStructureCheckHoistingPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F63943C15C75F14006A597C /* DFGStructureCheckHoistingPhase.cpp */; };
+ 0F63945415D07055006A597C /* ArrayProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F63945115D07051006A597C /* ArrayProfile.cpp */; };
+ 0F63945515D07057006A597C /* ArrayProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F63945215D07051006A597C /* ArrayProfile.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0F63947815DCE34B006A597C /* DFGStructureAbstractValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F63947615DCE347006A597C /* DFGStructureAbstractValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F66E16B14DF3F1600B7B2E4 /* DFGAdjacencyList.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F66E16814DF3F1300B7B2E4 /* DFGAdjacencyList.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F66E16C14DF3F1600B7B2E4 /* DFGEdge.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F66E16914DF3F1300B7B2E4 /* DFGEdge.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F766D2815A8CC1E008F363E /* JITStubRoutine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F766D2615A8CC1B008F363E /* JITStubRoutine.cpp */; };
@@ -889,6 +892,9 @@
0F620172143FCD2F0068B77C /* DFGVariableAccessData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGVariableAccessData.h; path = dfg/DFGVariableAccessData.h; sourceTree = "<group>"; };
0F63943C15C75F14006A597C /* DFGStructureCheckHoistingPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGStructureCheckHoistingPhase.cpp; path = dfg/DFGStructureCheckHoistingPhase.cpp; sourceTree = "<group>"; };
0F63943D15C75F14006A597C /* DFGStructureCheckHoistingPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGStructureCheckHoistingPhase.h; path = dfg/DFGStructureCheckHoistingPhase.h; sourceTree = "<group>"; };
+ 0F63945115D07051006A597C /* ArrayProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ArrayProfile.cpp; sourceTree = "<group>"; };
+ 0F63945215D07051006A597C /* ArrayProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayProfile.h; sourceTree = "<group>"; };
+ 0F63947615DCE347006A597C /* DFGStructureAbstractValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGStructureAbstractValue.h; path = dfg/DFGStructureAbstractValue.h; sourceTree = "<group>"; };
0F66E16814DF3F1300B7B2E4 /* DFGAdjacencyList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGAdjacencyList.h; path = dfg/DFGAdjacencyList.h; sourceTree = "<group>"; };
0F66E16914DF3F1300B7B2E4 /* DFGEdge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGEdge.h; path = dfg/DFGEdge.h; sourceTree = "<group>"; };
0F766D1C15A5028D008F363E /* JITStubRoutine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITStubRoutine.h; sourceTree = "<group>"; };
@@ -2325,6 +2331,7 @@
86EC9DC31328DF82002B2AD7 /* DFGSpeculativeJIT.h */,
86880F1B14328BB900B08D42 /* DFGSpeculativeJIT32_64.cpp */,
86880F4C14353B2100B08D42 /* DFGSpeculativeJIT64.cpp */,
+ 0F63947615DCE347006A597C /* DFGStructureAbstractValue.h */,
0F63943C15C75F14006A597C /* DFGStructureCheckHoistingPhase.cpp */,
0F63943D15C75F14006A597C /* DFGStructureCheckHoistingPhase.h */,
0FC0979F146B28C700CF2442 /* DFGThunks.cpp */,
@@ -2407,6 +2414,8 @@
969A078F0ED1D3AE00F1F681 /* bytecode */ = {
isa = PBXGroup;
children = (
+ 0F63945115D07051006A597C /* ArrayProfile.cpp */,
+ 0F63945215D07051006A597C /* ArrayProfile.h */,
0F56A1D415001CF2002992B1 /* ExecutionCounter.cpp */,
0F56A1D115000F31002992B1 /* ExecutionCounter.h */,
0FB5467C14F5CFD3002C2989 /* MethodOfGettingAValueProfile.cpp */,
@@ -2867,6 +2876,8 @@
0F766D4415B2A3C0008F363E /* DFGRegisterSet.h in Headers */,
0F766D4615B3701F008F363E /* DFGScratchRegisterAllocator.h in Headers */,
0F63943F15C75F19006A597C /* DFGStructureCheckHoistingPhase.h in Headers */,
+ 0F63945515D07057006A597C /* ArrayProfile.h in Headers */,
+ 0F63947815DCE34B006A597C /* DFGStructureAbstractValue.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -3465,6 +3476,7 @@
0F766D3415AE2538008F363E /* JumpReplacementWatchpoint.cpp in Sources */,
0F766D3815AE4A1C008F363E /* StructureStubClearingWatchpoint.cpp in Sources */,
0F63944015C75F1D006A597C /* DFGStructureCheckHoistingPhase.cpp in Sources */,
+ 0F63945415D07055006A597C /* ArrayProfile.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/Source/JavaScriptCore/Target.pri b/Source/JavaScriptCore/Target.pri
index 3d0e41df4..e8622363c 100644
--- a/Source/JavaScriptCore/Target.pri
+++ b/Source/JavaScriptCore/Target.pri
@@ -40,12 +40,14 @@ SOURCES += \
API/JSObjectRef.cpp \
API/JSStringRef.cpp \
API/JSValueRef.cpp \
+ API/JSWeakObjectMapRefPrivate.cpp \
API/OpaqueJSString.cpp \
assembler/ARMAssembler.cpp \
assembler/ARMv7Assembler.cpp \
assembler/LinkBuffer.cpp \
assembler/MacroAssemblerARM.cpp \
assembler/MacroAssemblerSH4.cpp \
+ bytecode/ArrayProfile.cpp \
bytecode/CallLinkInfo.cpp \
bytecode/CallLinkStatus.cpp \
bytecode/CodeBlock.cpp \
diff --git a/Source/JavaScriptCore/assembler/ARMAssembler.cpp b/Source/JavaScriptCore/assembler/ARMAssembler.cpp
index 533640ea8..9655557a5 100644
--- a/Source/JavaScriptCore/assembler/ARMAssembler.cpp
+++ b/Source/JavaScriptCore/assembler/ARMAssembler.cpp
@@ -187,11 +187,11 @@ int ARMAssembler::genInt(int reg, ARMWord imm, bool positive)
}
if (positive) {
- mov_r(reg, imm1);
- orr_r(reg, reg, imm2);
+ mov(reg, imm1);
+ orr(reg, reg, imm2);
} else {
- mvn_r(reg, imm1);
- bic_r(reg, reg, imm2);
+ mvn(reg, imm1);
+ bic(reg, reg, imm2);
}
return 1;
@@ -210,7 +210,7 @@ ARMWord ARMAssembler::getImm(ARMWord imm, int tmpReg, bool invert)
if (tmp != InvalidImmediate) {
if (invert)
return tmp | Op2InvertedImmediate;
- mvn_r(tmpReg, tmp);
+ mvn(tmpReg, tmp);
return tmpReg;
}
@@ -224,13 +224,13 @@ void ARMAssembler::moveImm(ARMWord imm, int dest)
// Do it by 1 instruction
tmp = getOp2(imm);
if (tmp != InvalidImmediate) {
- mov_r(dest, tmp);
+ mov(dest, tmp);
return;
}
tmp = getOp2(~imm);
if (tmp != InvalidImmediate) {
- mvn_r(dest, tmp);
+ mvn(dest, tmp);
return;
}
@@ -242,11 +242,11 @@ ARMWord ARMAssembler::encodeComplexImm(ARMWord imm, int dest)
#if WTF_ARM_ARCH_AT_LEAST(7)
ARMWord tmp = getImm16Op2(imm);
if (tmp != InvalidImmediate) {
- movw_r(dest, tmp);
+ movw(dest, tmp);
return dest;
}
- movw_r(dest, getImm16Op2(imm & 0xffff));
- movt_r(dest, getImm16Op2(imm >> 16));
+ movw(dest, getImm16Op2(imm & 0xffff));
+ movt(dest, getImm16Op2(imm >> 16));
return dest;
#else
// Do it by 2 instruction
@@ -255,7 +255,7 @@ ARMWord ARMAssembler::encodeComplexImm(ARMWord imm, int dest)
if (genInt(dest, ~imm, false))
return dest;
- ldr_imm(dest, imm);
+ ldrImmediate(dest, imm);
return dest;
#endif
}
@@ -266,23 +266,23 @@ void ARMAssembler::dataTransfer32(DataTransferTypeA transferType, RegisterID src
{
if (offset >= 0) {
if (offset <= 0xfff)
- dtr_u(transferType, srcDst, base, offset);
+ dtrUp(transferType, srcDst, base, offset);
else if (offset <= 0xfffff) {
- add_r(ARMRegisters::S0, base, Op2Immediate | (offset >> 12) | (10 << 8));
- dtr_u(transferType, srcDst, ARMRegisters::S0, (offset & 0xfff));
+ add(ARMRegisters::S0, base, Op2Immediate | (offset >> 12) | (10 << 8));
+ dtrUp(transferType, srcDst, ARMRegisters::S0, (offset & 0xfff));
} else {
moveImm(offset, ARMRegisters::S0);
- dtr_ur(transferType, srcDst, base, ARMRegisters::S0);
+ dtrUpRegister(transferType, srcDst, base, ARMRegisters::S0);
}
} else {
if (offset >= -0xfff)
- dtr_d(transferType, srcDst, base, -offset);
+ dtrDown(transferType, srcDst, base, -offset);
else if (offset >= -0xfffff) {
- sub_r(ARMRegisters::S0, base, Op2Immediate | (-offset >> 12) | (10 << 8));
- dtr_d(transferType, srcDst, ARMRegisters::S0, (-offset & 0xfff));
+ sub(ARMRegisters::S0, base, Op2Immediate | (-offset >> 12) | (10 << 8));
+ dtrDown(transferType, srcDst, ARMRegisters::S0, (-offset & 0xfff));
} else {
moveImm(offset, ARMRegisters::S0);
- dtr_ur(transferType, srcDst, base, ARMRegisters::S0);
+ dtrUpRegister(transferType, srcDst, base, ARMRegisters::S0);
}
}
}
@@ -293,11 +293,11 @@ void ARMAssembler::baseIndexTransfer32(DataTransferTypeA transferType, RegisterI
ARMWord op2 = lsl(index, scale);
if (!offset) {
- dtr_ur(transferType, srcDst, base, op2);
+ dtrUpRegister(transferType, srcDst, base, op2);
return;
}
- add_r(ARMRegisters::S1, base, op2);
+ add(ARMRegisters::S1, base, op2);
dataTransfer32(transferType, srcDst, ARMRegisters::S1, offset);
}
@@ -305,23 +305,23 @@ void ARMAssembler::dataTransfer16(DataTransferTypeB transferType, RegisterID src
{
if (offset >= 0) {
if (offset <= 0xff)
- dtrh_u(transferType, srcDst, base, getOp2Half(offset));
+ halfDtrUp(transferType, srcDst, base, getOp2Half(offset));
else if (offset <= 0xffff) {
- add_r(ARMRegisters::S0, base, Op2Immediate | (offset >> 8) | (12 << 8));
- dtrh_u(transferType, srcDst, ARMRegisters::S0, getOp2Half(offset & 0xff));
+ add(ARMRegisters::S0, base, Op2Immediate | (offset >> 8) | (12 << 8));
+ halfDtrUp(transferType, srcDst, ARMRegisters::S0, getOp2Half(offset & 0xff));
} else {
moveImm(offset, ARMRegisters::S0);
- dtrh_ur(transferType, srcDst, base, ARMRegisters::S0);
+ halfDtrUpRegister(transferType, srcDst, base, ARMRegisters::S0);
}
} else {
if (offset >= -0xff)
- dtrh_d(transferType, srcDst, base, getOp2Half(-offset));
+ halfDtrDown(transferType, srcDst, base, getOp2Half(-offset));
else if (offset >= -0xffff) {
- sub_r(ARMRegisters::S0, base, Op2Immediate | (-offset >> 8) | (12 << 8));
- dtrh_d(transferType, srcDst, ARMRegisters::S0, getOp2Half(-offset & 0xff));
+ sub(ARMRegisters::S0, base, Op2Immediate | (-offset >> 8) | (12 << 8));
+ halfDtrDown(transferType, srcDst, ARMRegisters::S0, getOp2Half(-offset & 0xff));
} else {
moveImm(offset, ARMRegisters::S0);
- dtrh_ur(transferType, srcDst, base, ARMRegisters::S0);
+ halfDtrUpRegister(transferType, srcDst, base, ARMRegisters::S0);
}
}
}
@@ -329,11 +329,11 @@ void ARMAssembler::dataTransfer16(DataTransferTypeB transferType, RegisterID src
void ARMAssembler::baseIndexTransfer16(DataTransferTypeB transferType, RegisterID srcDst, RegisterID base, RegisterID index, int scale, int32_t offset)
{
if (!scale && !offset) {
- dtrh_ur(transferType, srcDst, base, index);
+ halfDtrUpRegister(transferType, srcDst, base, index);
return;
}
- add_r(ARMRegisters::S1, base, lsl(index, scale));
+ add(ARMRegisters::S1, base, lsl(index, scale));
dataTransfer16(transferType, srcDst, ARMRegisters::S1, offset);
}
@@ -342,36 +342,36 @@ void ARMAssembler::dataTransferFloat(DataTransferTypeFloat transferType, FPRegis
// VFP cannot directly access memory that is not four-byte-aligned
if (!(offset & 0x3)) {
if (offset <= 0x3ff && offset >= 0) {
- fdtr_u(transferType, srcDst, base, offset >> 2);
+ doubleDtrUp(transferType, srcDst, base, offset >> 2);
return;
}
if (offset <= 0x3ffff && offset >= 0) {
- add_r(ARMRegisters::S0, base, Op2Immediate | (offset >> 10) | (11 << 8));
- fdtr_u(transferType, srcDst, ARMRegisters::S0, (offset >> 2) & 0xff);
+ add(ARMRegisters::S0, base, Op2Immediate | (offset >> 10) | (11 << 8));
+ doubleDtrUp(transferType, srcDst, ARMRegisters::S0, (offset >> 2) & 0xff);
return;
}
offset = -offset;
if (offset <= 0x3ff && offset >= 0) {
- fdtr_d(transferType, srcDst, base, offset >> 2);
+ doubleDtrDown(transferType, srcDst, base, offset >> 2);
return;
}
if (offset <= 0x3ffff && offset >= 0) {
- sub_r(ARMRegisters::S0, base, Op2Immediate | (offset >> 10) | (11 << 8));
- fdtr_d(transferType, srcDst, ARMRegisters::S0, (offset >> 2) & 0xff);
+ sub(ARMRegisters::S0, base, Op2Immediate | (offset >> 10) | (11 << 8));
+ doubleDtrDown(transferType, srcDst, ARMRegisters::S0, (offset >> 2) & 0xff);
return;
}
offset = -offset;
}
moveImm(offset, ARMRegisters::S0);
- add_r(ARMRegisters::S0, ARMRegisters::S0, base);
- fdtr_u(transferType, srcDst, ARMRegisters::S0, 0);
+ add(ARMRegisters::S0, ARMRegisters::S0, base);
+ doubleDtrUp(transferType, srcDst, ARMRegisters::S0, 0);
}
void ARMAssembler::baseIndexTransferFloat(DataTransferTypeFloat transferType, FPRegisterID srcDst, RegisterID base, RegisterID index, int scale, int32_t offset)
{
- add_r(ARMRegisters::S1, base, lsl(index, scale));
+ add(ARMRegisters::S1, base, lsl(index, scale));
dataTransferFloat(transferType, srcDst, ARMRegisters::S1, offset);
}
diff --git a/Source/JavaScriptCore/assembler/ARMAssembler.h b/Source/JavaScriptCore/assembler/ARMAssembler.h
index ac918f31e..38d0c5e6d 100644
--- a/Source/JavaScriptCore/assembler/ARMAssembler.h
+++ b/Source/JavaScriptCore/assembler/ARMAssembler.h
@@ -268,355 +268,355 @@ namespace JSC {
| (sm >> 1) | ((sm & 0x1) << 5));
}
- void and_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void bitAnd(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | AND, rd, rn, op2);
}
- void ands_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void bitAnds(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | AND | SetConditionalCodes, rd, rn, op2);
}
- void eor_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void eor(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | EOR, rd, rn, op2);
}
- void eors_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void eors(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | EOR | SetConditionalCodes, rd, rn, op2);
}
- void sub_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void sub(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | SUB, rd, rn, op2);
}
- void subs_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void subs(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | SUB | SetConditionalCodes, rd, rn, op2);
}
- void rsb_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void rsb(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | RSB, rd, rn, op2);
}
- void rsbs_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void rsbs(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | RSB | SetConditionalCodes, rd, rn, op2);
}
- void add_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void add(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | ADD, rd, rn, op2);
}
- void adds_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void adds(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | ADD | SetConditionalCodes, rd, rn, op2);
}
- void adc_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void adc(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | ADC, rd, rn, op2);
}
- void adcs_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void adcs(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | ADC | SetConditionalCodes, rd, rn, op2);
}
- void sbc_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void sbc(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | SBC, rd, rn, op2);
}
- void sbcs_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void sbcs(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | SBC | SetConditionalCodes, rd, rn, op2);
}
- void rsc_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void rsc(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | RSC, rd, rn, op2);
}
- void rscs_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void rscs(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | RSC | SetConditionalCodes, rd, rn, op2);
}
- void tst_r(int rn, ARMWord op2, Condition cc = AL)
+ void tst(int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | TST | SetConditionalCodes, 0, rn, op2);
}
- void teq_r(int rn, ARMWord op2, Condition cc = AL)
+ void teq(int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | TEQ | SetConditionalCodes, 0, rn, op2);
}
- void cmp_r(int rn, ARMWord op2, Condition cc = AL)
+ void cmp(int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | CMP | SetConditionalCodes, 0, rn, op2);
}
- void cmn_r(int rn, ARMWord op2, Condition cc = AL)
+ void cmn(int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | CMN | SetConditionalCodes, 0, rn, op2);
}
- void orr_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void orr(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | ORR, rd, rn, op2);
}
- void orrs_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void orrs(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | ORR | SetConditionalCodes, rd, rn, op2);
}
- void mov_r(int rd, ARMWord op2, Condition cc = AL)
+ void mov(int rd, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | MOV, rd, ARMRegisters::r0, op2);
}
#if WTF_ARM_ARCH_AT_LEAST(7)
- void movw_r(int rd, ARMWord op2, Condition cc = AL)
+ void movw(int rd, ARMWord op2, Condition cc = AL)
{
ASSERT((op2 | 0xf0fff) == 0xf0fff);
m_buffer.putInt(toARMWord(cc) | MOVW | RD(rd) | op2);
}
- void movt_r(int rd, ARMWord op2, Condition cc = AL)
+ void movt(int rd, ARMWord op2, Condition cc = AL)
{
ASSERT((op2 | 0xf0fff) == 0xf0fff);
m_buffer.putInt(toARMWord(cc) | MOVT | RD(rd) | op2);
}
#endif
- void movs_r(int rd, ARMWord op2, Condition cc = AL)
+ void movs(int rd, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | MOV | SetConditionalCodes, rd, ARMRegisters::r0, op2);
}
- void bic_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void bic(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | BIC, rd, rn, op2);
}
- void bics_r(int rd, int rn, ARMWord op2, Condition cc = AL)
+ void bics(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | BIC | SetConditionalCodes, rd, rn, op2);
}
- void mvn_r(int rd, ARMWord op2, Condition cc = AL)
+ void mvn(int rd, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | MVN, rd, ARMRegisters::r0, op2);
}
- void mvns_r(int rd, ARMWord op2, Condition cc = AL)
+ void mvns(int rd, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | MVN | SetConditionalCodes, rd, ARMRegisters::r0, op2);
}
- void mul_r(int rd, int rn, int rm, Condition cc = AL)
+ void mul(int rd, int rn, int rm, Condition cc = AL)
{
m_buffer.putInt(toARMWord(cc) | MUL | RN(rd) | RS(rn) | RM(rm));
}
- void muls_r(int rd, int rn, int rm, Condition cc = AL)
+ void muls(int rd, int rn, int rm, Condition cc = AL)
{
m_buffer.putInt(toARMWord(cc) | MUL | SetConditionalCodes | RN(rd) | RS(rn) | RM(rm));
}
- void mull_r(int rdhi, int rdlo, int rn, int rm, Condition cc = AL)
+ void mull(int rdhi, int rdlo, int rn, int rm, Condition cc = AL)
{
m_buffer.putInt(toARMWord(cc) | MULL | RN(rdhi) | RD(rdlo) | RS(rn) | RM(rm));
}
- void vmov_f64_r(int dd, int dm, Condition cc = AL)
+ void vmov_f64(int dd, int dm, Condition cc = AL)
{
emitDoublePrecisionInstruction(toARMWord(cc) | VMOV_F64, dd, 0, dm);
}
- void vadd_f64_r(int dd, int dn, int dm, Condition cc = AL)
+ void vadd_f64(int dd, int dn, int dm, Condition cc = AL)
{
emitDoublePrecisionInstruction(toARMWord(cc) | VADD_F64, dd, dn, dm);
}
- void vdiv_f64_r(int dd, int dn, int dm, Condition cc = AL)
+ void vdiv_f64(int dd, int dn, int dm, Condition cc = AL)
{
emitDoublePrecisionInstruction(toARMWord(cc) | VDIV_F64, dd, dn, dm);
}
- void vsub_f64_r(int dd, int dn, int dm, Condition cc = AL)
+ void vsub_f64(int dd, int dn, int dm, Condition cc = AL)
{
emitDoublePrecisionInstruction(toARMWord(cc) | VSUB_F64, dd, dn, dm);
}
- void vmul_f64_r(int dd, int dn, int dm, Condition cc = AL)
+ void vmul_f64(int dd, int dn, int dm, Condition cc = AL)
{
emitDoublePrecisionInstruction(toARMWord(cc) | VMUL_F64, dd, dn, dm);
}
- void vcmp_f64_r(int dd, int dm, Condition cc = AL)
+ void vcmp_f64(int dd, int dm, Condition cc = AL)
{
emitDoublePrecisionInstruction(toARMWord(cc) | VCMP_F64, dd, 0, dm);
}
- void vsqrt_f64_r(int dd, int dm, Condition cc = AL)
+ void vsqrt_f64(int dd, int dm, Condition cc = AL)
{
emitDoublePrecisionInstruction(toARMWord(cc) | VSQRT_F64, dd, 0, dm);
}
- void vabs_f64_r(int dd, int dm, Condition cc = AL)
+ void vabs_f64(int dd, int dm, Condition cc = AL)
{
emitDoublePrecisionInstruction(toARMWord(cc) | VABS_F64, dd, 0, dm);
}
- void vneg_f64_r(int dd, int dm, Condition cc = AL)
+ void vneg_f64(int dd, int dm, Condition cc = AL)
{
emitDoublePrecisionInstruction(toARMWord(cc) | VNEG_F64, dd, 0, dm);
}
- void ldr_imm(int rd, ARMWord imm, Condition cc = AL)
+ void ldrImmediate(int rd, ARMWord imm, Condition cc = AL)
{
m_buffer.putIntWithConstantInt(toARMWord(cc) | LoadUint32 | DataTransferUp | RN(ARMRegisters::pc) | RD(rd), imm, true);
}
- void ldr_un_imm(int rd, ARMWord imm, Condition cc = AL)
+ void ldrUniqueImmediate(int rd, ARMWord imm, Condition cc = AL)
{
m_buffer.putIntWithConstantInt(toARMWord(cc) | LoadUint32 | DataTransferUp | RN(ARMRegisters::pc) | RD(rd), imm);
}
- void dtr_u(DataTransferTypeA transferType, int rd, int rb, ARMWord op2, Condition cc = AL)
+ void dtrUp(DataTransferTypeA transferType, int rd, int rb, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | transferType | DataTransferUp, rd, rb, op2);
}
- void dtr_ur(DataTransferTypeA transferType, int rd, int rb, int rm, Condition cc = AL)
+ void dtrUpRegister(DataTransferTypeA transferType, int rd, int rb, int rm, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | transferType | DataTransferUp | Op2IsRegisterArgument, rd, rb, rm);
}
- void dtr_d(DataTransferTypeA transferType, int rd, int rb, ARMWord op2, Condition cc = AL)
+ void dtrDown(DataTransferTypeA transferType, int rd, int rb, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | transferType, rd, rb, op2);
}
- void dtr_dr(DataTransferTypeA transferType, int rd, int rb, int rm, Condition cc = AL)
+ void dtrDownRegister(DataTransferTypeA transferType, int rd, int rb, int rm, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | transferType | Op2IsRegisterArgument, rd, rb, rm);
}
- void dtrh_u(DataTransferTypeB transferType, int rd, int rb, ARMWord op2, Condition cc = AL)
+ void halfDtrUp(DataTransferTypeB transferType, int rd, int rb, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | transferType | DataTransferUp, rd, rb, op2);
}
- void dtrh_ur(DataTransferTypeB transferType, int rd, int rn, int rm, Condition cc = AL)
+ void halfDtrUpRegister(DataTransferTypeB transferType, int rd, int rn, int rm, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | transferType | DataTransferUp, rd, rn, rm);
}
- void dtrh_d(DataTransferTypeB transferType, int rd, int rb, ARMWord op2, Condition cc = AL)
+ void halfDtrDown(DataTransferTypeB transferType, int rd, int rb, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | transferType, rd, rb, op2);
}
- void dtrh_dr(DataTransferTypeB transferType, int rd, int rn, int rm, Condition cc = AL)
+ void halfDtrDownRegister(DataTransferTypeB transferType, int rd, int rn, int rm, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | transferType, rd, rn, rm);
}
- void fdtr_u(DataTransferTypeFloat type, int rd, int rb, ARMWord op2, Condition cc = AL)
+ void doubleDtrUp(DataTransferTypeFloat type, int rd, int rb, ARMWord op2, Condition cc = AL)
{
ASSERT(op2 <= 0xff && rd <= 15);
/* Only d0-d15 and s0, s2, s4 ... s30 are supported. */
m_buffer.putInt(toARMWord(cc) | DataTransferUp | type | (rd << 12) | RN(rb) | op2);
}
- void fdtr_d(DataTransferTypeFloat type, int rd, int rb, ARMWord op2, Condition cc = AL)
+ void doubleDtrDown(DataTransferTypeFloat type, int rd, int rb, ARMWord op2, Condition cc = AL)
{
ASSERT(op2 <= 0xff && rd <= 15);
/* Only d0-d15 and s0, s2, s4 ... s30 are supported. */
m_buffer.putInt(toARMWord(cc) | type | (rd << 12) | RN(rb) | op2);
}
- void push_r(int reg, Condition cc = AL)
+ void push(int reg, Condition cc = AL)
{
ASSERT(ARMWord(reg) <= 0xf);
m_buffer.putInt(toARMWord(cc) | StoreUint32 | DataTransferWriteBack | RN(ARMRegisters::sp) | RD(reg) | 0x4);
}
- void pop_r(int reg, Condition cc = AL)
+ void pop(int reg, Condition cc = AL)
{
ASSERT(ARMWord(reg) <= 0xf);
m_buffer.putInt(toARMWord(cc) | (LoadUint32 ^ DataTransferPostUpdate) | DataTransferUp | RN(ARMRegisters::sp) | RD(reg) | 0x4);
}
- inline void poke_r(int reg, Condition cc = AL)
+ inline void poke(int reg, Condition cc = AL)
{
- dtr_d(StoreUint32, ARMRegisters::sp, 0, reg, cc);
+ dtrDown(StoreUint32, ARMRegisters::sp, 0, reg, cc);
}
- inline void peek_r(int reg, Condition cc = AL)
+ inline void peek(int reg, Condition cc = AL)
{
- dtr_u(LoadUint32, reg, ARMRegisters::sp, 0, cc);
+ dtrUp(LoadUint32, reg, ARMRegisters::sp, 0, cc);
}
- void vmov_vfp64_r(int sm, int rt, int rt2, Condition cc = AL)
+ void vmov_vfp64(int sm, int rt, int rt2, Condition cc = AL)
{
ASSERT(rt != rt2);
m_buffer.putInt(toARMWord(cc) | VMOV_VFP64 | RN(rt2) | RD(rt) | (sm & 0xf) | ((sm & 0x10) << (5 - 4)));
}
- void vmov_arm64_r(int rt, int rt2, int sm, Condition cc = AL)
+ void vmov_arm64(int rt, int rt2, int sm, Condition cc = AL)
{
ASSERT(rt != rt2);
m_buffer.putInt(toARMWord(cc) | VMOV_ARM64 | RN(rt2) | RD(rt) | (sm & 0xf) | ((sm & 0x10) << (5 - 4)));
}
- void vmov_vfp32_r(int sn, int rt, Condition cc = AL)
+ void vmov_vfp32(int sn, int rt, Condition cc = AL)
{
ASSERT(rt <= 15);
emitSinglePrecisionInstruction(toARMWord(cc) | VMOV_VFP32, rt << 1, sn, 0);
}
- void vmov_arm32_r(int rt, int sn, Condition cc = AL)
+ void vmov_arm32(int rt, int sn, Condition cc = AL)
{
ASSERT(rt <= 15);
emitSinglePrecisionInstruction(toARMWord(cc) | VMOV_ARM32, rt << 1, sn, 0);
}
- void vcvt_f64_s32_r(int dd, int sm, Condition cc = AL)
+ void vcvt_f64_s32(int dd, int sm, Condition cc = AL)
{
ASSERT(!(sm & 0x1)); // sm must be divisible by 2
emitDoublePrecisionInstruction(toARMWord(cc) | VCVT_F64_S32, dd, 0, (sm >> 1));
}
- void vcvt_s32_f64_r(int sd, int dm, Condition cc = AL)
+ void vcvt_s32_f64(int sd, int dm, Condition cc = AL)
{
ASSERT(!(sd & 0x1)); // sd must be divisible by 2
emitDoublePrecisionInstruction(toARMWord(cc) | VCVT_S32_F64, (sd >> 1), 0, dm);
}
- void vcvt_u32_f64_r(int sd, int dm, Condition cc = AL)
+ void vcvt_u32_f64(int sd, int dm, Condition cc = AL)
{
ASSERT(!(sd & 0x1)); // sd must be divisible by 2
emitDoublePrecisionInstruction(toARMWord(cc) | VCVT_U32_F64, (sd >> 1), 0, dm);
}
- void vcvt_f64_f32_r(int dd, int sm, Condition cc = AL)
+ void vcvt_f64_f32(int dd, int sm, Condition cc = AL)
{
ASSERT(dd <= 15 && sm <= 15);
emitDoublePrecisionInstruction(toARMWord(cc) | VCVT_F64_F32, dd, 0, sm);
}
- void vcvt_f32_f64_r(int dd, int sm, Condition cc = AL)
+ void vcvt_f32_f64(int dd, int sm, Condition cc = AL)
{
ASSERT(dd <= 15 && sm <= 15);
emitDoublePrecisionInstruction(toARMWord(cc) | VCVT_F32_F64, dd, 0, sm);
@@ -627,7 +627,7 @@ namespace JSC {
m_buffer.putInt(toARMWord(cc) | VMRS_APSR);
}
- void clz_r(int rd, int rm, Condition cc = AL)
+ void clz(int rd, int rm, Condition cc = AL)
{
m_buffer.putInt(toARMWord(cc) | CLZ | RD(rd) | RM(rm));
}
@@ -674,21 +674,21 @@ namespace JSC {
return reg | (value << 7) | 0x40;
}
- static ARMWord lsl_r(int reg, int shiftReg)
+ static ARMWord lslRegister(int reg, int shiftReg)
{
ASSERT(reg <= ARMRegisters::pc);
ASSERT(shiftReg <= ARMRegisters::pc);
return reg | (shiftReg << 8) | 0x10;
}
- static ARMWord lsr_r(int reg, int shiftReg)
+ static ARMWord lsrRegister(int reg, int shiftReg)
{
ASSERT(reg <= ARMRegisters::pc);
ASSERT(shiftReg <= ARMRegisters::pc);
return reg | (shiftReg << 8) | 0x30;
}
- static ARMWord asr_r(int reg, int shiftReg)
+ static ARMWord asrRegister(int reg, int shiftReg)
{
ASSERT(reg <= ARMRegisters::pc);
ASSERT(shiftReg <= ARMRegisters::pc);
@@ -742,7 +742,7 @@ namespace JSC {
AssemblerLabel align(int alignment)
{
while (!m_buffer.isAligned(alignment))
- mov_r(ARMRegisters::r0, ARMRegisters::r0);
+ mov(ARMRegisters::r0, ARMRegisters::r0);
return label();
}
@@ -751,7 +751,7 @@ namespace JSC {
{
ensureSpace(sizeof(ARMWord), sizeof(ARMWord));
m_jumps.append(m_buffer.codeSize() | (useConstantPool & 0x1));
- ldr_un_imm(rd, InvalidBranchTarget, cc);
+ ldrUniqueImmediate(rd, InvalidBranchTarget, cc);
return m_buffer.label();
}
@@ -767,12 +767,12 @@ namespace JSC {
// DFG assembly helpers for moving data between fp and registers.
void vmov(RegisterID rd1, RegisterID rd2, FPRegisterID rn)
{
- vmov_arm64_r(rd1, rd2, rn);
+ vmov_arm64(rd1, rd2, rn);
}
void vmov(FPRegisterID rd, RegisterID rn1, RegisterID rn2)
{
- vmov_vfp64_r(rd, rn1, rn2);
+ vmov_vfp64(rd, rn1, rn2);
}
// Patching helpers
diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp b/Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp
index a251a4376..98dc3e987 100644
--- a/Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp
+++ b/Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp
@@ -76,21 +76,21 @@ void MacroAssemblerARM::load32WithUnalignedHalfWords(BaseIndex address, Register
op2 = m_assembler.lsl(address.index, static_cast<int>(address.scale));
if (address.offset >= 0 && address.offset + 0x2 <= 0xff) {
- m_assembler.add_r(ARMRegisters::S0, address.base, op2);
- m_assembler.dtrh_u(ARMAssembler::LoadUint16, dest, ARMRegisters::S0, ARMAssembler::getOp2Half(address.offset));
- m_assembler.dtrh_u(ARMAssembler::LoadUint16, ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::getOp2Half(address.offset + 0x2));
+ m_assembler.add(ARMRegisters::S0, address.base, op2);
+ m_assembler.halfDtrUp(ARMAssembler::LoadUint16, dest, ARMRegisters::S0, ARMAssembler::getOp2Half(address.offset));
+ m_assembler.halfDtrUp(ARMAssembler::LoadUint16, ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::getOp2Half(address.offset + 0x2));
} else if (address.offset < 0 && address.offset >= -0xff) {
- m_assembler.add_r(ARMRegisters::S0, address.base, op2);
- m_assembler.dtrh_d(ARMAssembler::LoadUint16, dest, ARMRegisters::S0, ARMAssembler::getOp2Half(-address.offset));
- m_assembler.dtrh_d(ARMAssembler::LoadUint16, ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::getOp2Half(-address.offset - 0x2));
+ m_assembler.add(ARMRegisters::S0, address.base, op2);
+ m_assembler.halfDtrDown(ARMAssembler::LoadUint16, dest, ARMRegisters::S0, ARMAssembler::getOp2Half(-address.offset));
+ m_assembler.halfDtrDown(ARMAssembler::LoadUint16, ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::getOp2Half(-address.offset - 0x2));
} else {
m_assembler.moveImm(address.offset, ARMRegisters::S0);
- m_assembler.add_r(ARMRegisters::S0, ARMRegisters::S0, op2);
- m_assembler.dtrh_ur(ARMAssembler::LoadUint16, dest, address.base, ARMRegisters::S0);
- m_assembler.add_r(ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::Op2Immediate | 0x2);
- m_assembler.dtrh_ur(ARMAssembler::LoadUint16, ARMRegisters::S0, address.base, ARMRegisters::S0);
+ m_assembler.add(ARMRegisters::S0, ARMRegisters::S0, op2);
+ m_assembler.halfDtrUpRegister(ARMAssembler::LoadUint16, dest, address.base, ARMRegisters::S0);
+ m_assembler.add(ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::Op2Immediate | 0x2);
+ m_assembler.halfDtrUpRegister(ARMAssembler::LoadUint16, ARMRegisters::S0, address.base, ARMRegisters::S0);
}
- m_assembler.orr_r(dest, dest, m_assembler.lsl(ARMRegisters::S0, 16));
+ m_assembler.orr(dest, dest, m_assembler.lsl(ARMRegisters::S0, 16));
}
#endif
diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerARM.h b/Source/JavaScriptCore/assembler/MacroAssemblerARM.h
index 85d0ffbcc..295354119 100644
--- a/Source/JavaScriptCore/assembler/MacroAssemblerARM.h
+++ b/Source/JavaScriptCore/assembler/MacroAssemblerARM.h
@@ -86,12 +86,12 @@ public:
void add32(RegisterID src, RegisterID dest)
{
- m_assembler.adds_r(dest, dest, src);
+ m_assembler.adds(dest, dest, src);
}
void add32(RegisterID op1, RegisterID op2, RegisterID dest)
{
- m_assembler.adds_r(dest, op1, op2);
+ m_assembler.adds(dest, op1, op2);
}
void add32(TrustedImm32 imm, Address address)
@@ -103,13 +103,13 @@ public:
void add32(TrustedImm32 imm, RegisterID dest)
{
- m_assembler.adds_r(dest, dest, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
+ m_assembler.adds(dest, dest, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
}
void add32(AbsoluteAddress src, RegisterID dest)
{
move(TrustedImmPtr(src.m_ptr), ARMRegisters::S1);
- m_assembler.dtr_u(ARMAssembler::LoadUint32, ARMRegisters::S1, ARMRegisters::S1, 0);
+ m_assembler.dtrUp(ARMAssembler::LoadUint32, ARMRegisters::S1, ARMRegisters::S1, 0);
add32(ARMRegisters::S1, dest);
}
@@ -121,35 +121,35 @@ public:
void add32(RegisterID src, TrustedImm32 imm, RegisterID dest)
{
- m_assembler.adds_r(dest, src, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
+ m_assembler.adds(dest, src, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
}
void and32(RegisterID src, RegisterID dest)
{
- m_assembler.ands_r(dest, dest, src);
+ m_assembler.bitAnds(dest, dest, src);
}
void and32(RegisterID op1, RegisterID op2, RegisterID dest)
{
- m_assembler.ands_r(dest, op1, op2);
+ m_assembler.bitAnds(dest, op1, op2);
}
void and32(TrustedImm32 imm, RegisterID dest)
{
ARMWord w = m_assembler.getImm(imm.m_value, ARMRegisters::S0, true);
if (w & ARMAssembler::Op2InvertedImmediate)
- m_assembler.bics_r(dest, dest, w & ~ARMAssembler::Op2InvertedImmediate);
+ m_assembler.bics(dest, dest, w & ~ARMAssembler::Op2InvertedImmediate);
else
- m_assembler.ands_r(dest, dest, w);
+ m_assembler.bitAnds(dest, dest, w);
}
void and32(TrustedImm32 imm, RegisterID src, RegisterID dest)
{
ARMWord w = m_assembler.getImm(imm.m_value, ARMRegisters::S0, true);
if (w & ARMAssembler::Op2InvertedImmediate)
- m_assembler.bics_r(dest, src, w & ~ARMAssembler::Op2InvertedImmediate);
+ m_assembler.bics(dest, src, w & ~ARMAssembler::Op2InvertedImmediate);
else
- m_assembler.ands_r(dest, src, w);
+ m_assembler.bitAnds(dest, src, w);
}
void lshift32(RegisterID shiftAmount, RegisterID dest)
@@ -160,19 +160,19 @@ public:
void lshift32(RegisterID src, RegisterID shiftAmount, RegisterID dest)
{
ARMWord w = ARMAssembler::getOp2Byte(0x1f);
- m_assembler.and_r(ARMRegisters::S0, shiftAmount, w);
+ m_assembler.bitAnd(ARMRegisters::S0, shiftAmount, w);
- m_assembler.movs_r(dest, m_assembler.lsl_r(src, ARMRegisters::S0));
+ m_assembler.movs(dest, m_assembler.lslRegister(src, ARMRegisters::S0));
}
void lshift32(TrustedImm32 imm, RegisterID dest)
{
- m_assembler.movs_r(dest, m_assembler.lsl(dest, imm.m_value & 0x1f));
+ m_assembler.movs(dest, m_assembler.lsl(dest, imm.m_value & 0x1f));
}
void lshift32(RegisterID src, TrustedImm32 imm, RegisterID dest)
{
- m_assembler.movs_r(dest, m_assembler.lsl(src, imm.m_value & 0x1f));
+ m_assembler.movs(dest, m_assembler.lsl(src, imm.m_value & 0x1f));
}
void mul32(RegisterID op1, RegisterID op2, RegisterID dest)
@@ -188,7 +188,7 @@ public:
op2 = tmp;
}
}
- m_assembler.muls_r(dest, op1, op2);
+ m_assembler.muls(dest, op1, op2);
}
void mul32(RegisterID src, RegisterID dest)
@@ -199,32 +199,32 @@ public:
void mul32(TrustedImm32 imm, RegisterID src, RegisterID dest)
{
move(imm, ARMRegisters::S0);
- m_assembler.muls_r(dest, src, ARMRegisters::S0);
+ m_assembler.muls(dest, src, ARMRegisters::S0);
}
void neg32(RegisterID srcDest)
{
- m_assembler.rsbs_r(srcDest, srcDest, ARMAssembler::getOp2Byte(0));
+ m_assembler.rsbs(srcDest, srcDest, ARMAssembler::getOp2Byte(0));
}
void or32(RegisterID src, RegisterID dest)
{
- m_assembler.orrs_r(dest, dest, src);
+ m_assembler.orrs(dest, dest, src);
}
void or32(TrustedImm32 imm, RegisterID dest)
{
- m_assembler.orrs_r(dest, dest, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
+ m_assembler.orrs(dest, dest, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
}
void or32(TrustedImm32 imm, RegisterID src, RegisterID dest)
{
- m_assembler.orrs_r(dest, src, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
+ m_assembler.orrs(dest, src, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
}
void or32(RegisterID op1, RegisterID op2, RegisterID dest)
{
- m_assembler.orrs_r(dest, op1, op2);
+ m_assembler.orrs(dest, op1, op2);
}
void rshift32(RegisterID shiftAmount, RegisterID dest)
@@ -235,9 +235,9 @@ public:
void rshift32(RegisterID src, RegisterID shiftAmount, RegisterID dest)
{
ARMWord w = ARMAssembler::getOp2Byte(0x1f);
- m_assembler.and_r(ARMRegisters::S0, shiftAmount, w);
+ m_assembler.bitAnd(ARMRegisters::S0, shiftAmount, w);
- m_assembler.movs_r(dest, m_assembler.asr_r(src, ARMRegisters::S0));
+ m_assembler.movs(dest, m_assembler.asrRegister(src, ARMRegisters::S0));
}
void rshift32(TrustedImm32 imm, RegisterID dest)
@@ -247,7 +247,7 @@ public:
void rshift32(RegisterID src, TrustedImm32 imm, RegisterID dest)
{
- m_assembler.movs_r(dest, m_assembler.asr(src, imm.m_value & 0x1f));
+ m_assembler.movs(dest, m_assembler.asr(src, imm.m_value & 0x1f));
}
void urshift32(RegisterID shiftAmount, RegisterID dest)
@@ -258,29 +258,29 @@ public:
void urshift32(RegisterID src, RegisterID shiftAmount, RegisterID dest)
{
ARMWord w = ARMAssembler::getOp2Byte(0x1f);
- m_assembler.and_r(ARMRegisters::S0, shiftAmount, w);
+ m_assembler.bitAnd(ARMRegisters::S0, shiftAmount, w);
- m_assembler.movs_r(dest, m_assembler.lsr_r(src, ARMRegisters::S0));
+ m_assembler.movs(dest, m_assembler.lsrRegister(src, ARMRegisters::S0));
}
void urshift32(TrustedImm32 imm, RegisterID dest)
{
- m_assembler.movs_r(dest, m_assembler.lsr(dest, imm.m_value & 0x1f));
+ m_assembler.movs(dest, m_assembler.lsr(dest, imm.m_value & 0x1f));
}
void urshift32(RegisterID src, TrustedImm32 imm, RegisterID dest)
{
- m_assembler.movs_r(dest, m_assembler.lsr(src, imm.m_value & 0x1f));
+ m_assembler.movs(dest, m_assembler.lsr(src, imm.m_value & 0x1f));
}
void sub32(RegisterID src, RegisterID dest)
{
- m_assembler.subs_r(dest, dest, src);
+ m_assembler.subs(dest, dest, src);
}
void sub32(TrustedImm32 imm, RegisterID dest)
{
- m_assembler.subs_r(dest, dest, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
+ m_assembler.subs(dest, dest, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
}
void sub32(TrustedImm32 imm, Address address)
@@ -298,39 +298,39 @@ public:
void sub32(RegisterID src, TrustedImm32 imm, RegisterID dest)
{
- m_assembler.subs_r(dest, src, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
+ m_assembler.subs(dest, src, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
}
void xor32(RegisterID src, RegisterID dest)
{
- m_assembler.eors_r(dest, dest, src);
+ m_assembler.eors(dest, dest, src);
}
void xor32(RegisterID op1, RegisterID op2, RegisterID dest)
{
- m_assembler.eors_r(dest, op1, op2);
+ m_assembler.eors(dest, op1, op2);
}
void xor32(TrustedImm32 imm, RegisterID dest)
{
if (imm.m_value == -1)
- m_assembler.mvns_r(dest, dest);
+ m_assembler.mvns(dest, dest);
else
- m_assembler.eors_r(dest, dest, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
+ m_assembler.eors(dest, dest, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
}
void xor32(TrustedImm32 imm, RegisterID src, RegisterID dest)
{
if (imm.m_value == -1)
- m_assembler.mvns_r(dest, src);
+ m_assembler.mvns(dest, src);
else
- m_assembler.eors_r(dest, src, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
+ m_assembler.eors(dest, src, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
}
void countLeadingZeros32(RegisterID src, RegisterID dest)
{
#if WTF_ARM_ARCH_AT_LEAST(5)
- m_assembler.clz_r(dest, src);
+ m_assembler.clz(dest, src);
#else
UNUSED_PARAM(src);
UNUSED_PARAM(dest);
@@ -396,15 +396,15 @@ public:
{
ConvertibleLoadLabel result(this);
ASSERT(address.offset >= 0 && address.offset <= 255);
- m_assembler.dtr_u(ARMAssembler::LoadUint32, dest, address.base, address.offset);
+ m_assembler.dtrUp(ARMAssembler::LoadUint32, dest, address.base, address.offset);
return result;
}
DataLabel32 load32WithAddressOffsetPatch(Address address, RegisterID dest)
{
DataLabel32 dataLabel(this);
- m_assembler.ldr_un_imm(ARMRegisters::S0, 0);
- m_assembler.dtr_ur(ARMAssembler::LoadUint32, dest, address.base, ARMRegisters::S0);
+ m_assembler.ldrUniqueImmediate(ARMRegisters::S0, 0);
+ m_assembler.dtrUpRegister(ARMAssembler::LoadUint32, dest, address.base, ARMRegisters::S0);
return dataLabel;
}
@@ -418,17 +418,17 @@ public:
DataLabelCompact dataLabel(this);
ASSERT(isCompactPtrAlignedAddressOffset(address.offset));
if (address.offset >= 0)
- m_assembler.dtr_u(ARMAssembler::LoadUint32, dest, address.base, address.offset);
+ m_assembler.dtrUp(ARMAssembler::LoadUint32, dest, address.base, address.offset);
else
- m_assembler.dtr_d(ARMAssembler::LoadUint32, dest, address.base, address.offset);
+ m_assembler.dtrDown(ARMAssembler::LoadUint32, dest, address.base, address.offset);
return dataLabel;
}
DataLabel32 store32WithAddressOffsetPatch(RegisterID src, Address address)
{
DataLabel32 dataLabel(this);
- m_assembler.ldr_un_imm(ARMRegisters::S0, 0);
- m_assembler.dtr_ur(ARMAssembler::StoreUint32, src, address.base, ARMRegisters::S0);
+ m_assembler.ldrUniqueImmediate(ARMRegisters::S0, 0);
+ m_assembler.dtrUpRegister(ARMAssembler::StoreUint32, src, address.base, ARMRegisters::S0);
return dataLabel;
}
@@ -466,25 +466,25 @@ public:
void store32(RegisterID src, void* address)
{
- m_assembler.ldr_un_imm(ARMRegisters::S0, reinterpret_cast<ARMWord>(address));
- m_assembler.dtr_u(ARMAssembler::StoreUint32, src, ARMRegisters::S0, 0);
+ m_assembler.ldrUniqueImmediate(ARMRegisters::S0, reinterpret_cast<ARMWord>(address));
+ m_assembler.dtrUp(ARMAssembler::StoreUint32, src, ARMRegisters::S0, 0);
}
void store32(TrustedImm32 imm, void* address)
{
- m_assembler.ldr_un_imm(ARMRegisters::S0, reinterpret_cast<ARMWord>(address));
+ m_assembler.ldrUniqueImmediate(ARMRegisters::S0, reinterpret_cast<ARMWord>(address));
m_assembler.moveImm(imm.m_value, ARMRegisters::S1);
- m_assembler.dtr_u(ARMAssembler::StoreUint32, ARMRegisters::S1, ARMRegisters::S0, 0);
+ m_assembler.dtrUp(ARMAssembler::StoreUint32, ARMRegisters::S1, ARMRegisters::S0, 0);
}
void pop(RegisterID dest)
{
- m_assembler.pop_r(dest);
+ m_assembler.pop(dest);
}
void push(RegisterID src)
{
- m_assembler.push_r(src);
+ m_assembler.push(src);
}
void push(Address address)
@@ -507,7 +507,7 @@ public:
void move(RegisterID src, RegisterID dest)
{
if (src != dest)
- m_assembler.mov_r(dest, src);
+ m_assembler.mov(dest, src);
}
void move(TrustedImmPtr imm, RegisterID dest)
@@ -517,9 +517,9 @@ public:
void swap(RegisterID reg1, RegisterID reg2)
{
- m_assembler.mov_r(ARMRegisters::S0, reg1);
- m_assembler.mov_r(reg1, reg2);
- m_assembler.mov_r(reg2, ARMRegisters::S0);
+ m_assembler.mov(ARMRegisters::S0, reg1);
+ m_assembler.mov(reg1, reg2);
+ m_assembler.mov(reg2, ARMRegisters::S0);
}
void signExtend32ToPtr(RegisterID src, RegisterID dest)
@@ -549,7 +549,7 @@ public:
Jump branch32(RelationalCondition cond, RegisterID left, RegisterID right, int useConstantPool = 0)
{
- m_assembler.cmp_r(left, right);
+ m_assembler.cmp(left, right);
return Jump(m_assembler.jmp(ARMCondition(cond), useConstantPool));
}
@@ -557,9 +557,9 @@ public:
{
ARMWord tmp = (right.m_value == 0x80000000) ? ARMAssembler::InvalidImmediate : m_assembler.getOp2(-right.m_value);
if (tmp != ARMAssembler::InvalidImmediate)
- m_assembler.cmn_r(left, tmp);
+ m_assembler.cmn(left, tmp);
else
- m_assembler.cmp_r(left, m_assembler.getImm(right.m_value, ARMRegisters::S0));
+ m_assembler.cmp(left, m_assembler.getImm(right.m_value, ARMRegisters::S0));
return Jump(m_assembler.jmp(ARMCondition(cond), useConstantPool));
}
@@ -609,7 +609,7 @@ public:
Jump branchTest32(ResultCondition cond, RegisterID reg, RegisterID mask)
{
ASSERT((cond == Zero) || (cond == NonZero));
- m_assembler.tst_r(reg, mask);
+ m_assembler.tst(reg, mask);
return Jump(m_assembler.jmp(ARMCondition(cond)));
}
@@ -618,9 +618,9 @@ public:
ASSERT((cond == Zero) || (cond == NonZero));
ARMWord w = m_assembler.getImm(mask.m_value, ARMRegisters::S0, true);
if (w & ARMAssembler::Op2InvertedImmediate)
- m_assembler.bics_r(ARMRegisters::S0, reg, w & ~ARMAssembler::Op2InvertedImmediate);
+ m_assembler.bics(ARMRegisters::S0, reg, w & ~ARMAssembler::Op2InvertedImmediate);
else
- m_assembler.tst_r(reg, w);
+ m_assembler.tst(reg, w);
return Jump(m_assembler.jmp(ARMCondition(cond)));
}
@@ -705,8 +705,8 @@ public:
op2 = tmp;
}
}
- m_assembler.mull_r(ARMRegisters::S1, dest, op1, op2);
- m_assembler.cmp_r(ARMRegisters::S1, m_assembler.asr(dest, 31));
+ m_assembler.mull(ARMRegisters::S1, dest, op1, op2);
+ m_assembler.cmp(ARMRegisters::S1, m_assembler.asr(dest, 31));
}
Jump branchMul32(ResultCondition cond, RegisterID src1, RegisterID src2, RegisterID dest)
@@ -763,7 +763,7 @@ public:
Jump branchSub32(ResultCondition cond, RegisterID op1, RegisterID op2, RegisterID dest)
{
ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
- m_assembler.subs_r(dest, op1, op2);
+ m_assembler.subs(dest, op1, op2);
return Jump(m_assembler.jmp(ARMCondition(cond)));
}
@@ -809,16 +809,16 @@ public:
void compare32(RelationalCondition cond, RegisterID left, RegisterID right, RegisterID dest)
{
- m_assembler.cmp_r(left, right);
- m_assembler.mov_r(dest, ARMAssembler::getOp2Byte(0));
- m_assembler.mov_r(dest, ARMAssembler::getOp2Byte(1), ARMCondition(cond));
+ m_assembler.cmp(left, right);
+ m_assembler.mov(dest, ARMAssembler::getOp2Byte(0));
+ m_assembler.mov(dest, ARMAssembler::getOp2Byte(1), ARMCondition(cond));
}
void compare32(RelationalCondition cond, RegisterID left, TrustedImm32 right, RegisterID dest)
{
- m_assembler.cmp_r(left, m_assembler.getImm(right.m_value, ARMRegisters::S0));
- m_assembler.mov_r(dest, ARMAssembler::getOp2Byte(0));
- m_assembler.mov_r(dest, ARMAssembler::getOp2Byte(1), ARMCondition(cond));
+ m_assembler.cmp(left, m_assembler.getImm(right.m_value, ARMRegisters::S0));
+ m_assembler.mov(dest, ARMAssembler::getOp2Byte(0));
+ m_assembler.mov(dest, ARMAssembler::getOp2Byte(1), ARMCondition(cond));
}
void compare8(RelationalCondition cond, Address left, TrustedImm32 right, RegisterID dest)
@@ -830,11 +830,11 @@ public:
void test32(ResultCondition cond, RegisterID reg, TrustedImm32 mask, RegisterID dest)
{
if (mask.m_value == -1)
- m_assembler.cmp_r(0, reg);
+ m_assembler.cmp(0, reg);
else
- m_assembler.tst_r(reg, m_assembler.getImm(mask.m_value, ARMRegisters::S0));
- m_assembler.mov_r(dest, ARMAssembler::getOp2Byte(0));
- m_assembler.mov_r(dest, ARMAssembler::getOp2Byte(1), ARMCondition(cond));
+ m_assembler.tst(reg, m_assembler.getImm(mask.m_value, ARMRegisters::S0));
+ m_assembler.mov(dest, ARMAssembler::getOp2Byte(0));
+ m_assembler.mov(dest, ARMAssembler::getOp2Byte(1), ARMCondition(cond));
}
void test32(ResultCondition cond, Address address, TrustedImm32 mask, RegisterID dest)
@@ -851,31 +851,31 @@ public:
void add32(TrustedImm32 imm, RegisterID src, RegisterID dest)
{
- m_assembler.add_r(dest, src, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
+ m_assembler.add(dest, src, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
}
void add32(TrustedImm32 imm, AbsoluteAddress address)
{
- m_assembler.ldr_un_imm(ARMRegisters::S1, reinterpret_cast<ARMWord>(address.m_ptr));
- m_assembler.dtr_u(ARMAssembler::LoadUint32, ARMRegisters::S1, ARMRegisters::S1, 0);
+ m_assembler.ldrUniqueImmediate(ARMRegisters::S1, reinterpret_cast<ARMWord>(address.m_ptr));
+ m_assembler.dtrUp(ARMAssembler::LoadUint32, ARMRegisters::S1, ARMRegisters::S1, 0);
add32(imm, ARMRegisters::S1);
- m_assembler.ldr_un_imm(ARMRegisters::S0, reinterpret_cast<ARMWord>(address.m_ptr));
- m_assembler.dtr_u(ARMAssembler::StoreUint32, ARMRegisters::S1, ARMRegisters::S0, 0);
+ m_assembler.ldrUniqueImmediate(ARMRegisters::S0, reinterpret_cast<ARMWord>(address.m_ptr));
+ m_assembler.dtrUp(ARMAssembler::StoreUint32, ARMRegisters::S1, ARMRegisters::S0, 0);
}
void sub32(TrustedImm32 imm, AbsoluteAddress address)
{
- m_assembler.ldr_un_imm(ARMRegisters::S1, reinterpret_cast<ARMWord>(address.m_ptr));
- m_assembler.dtr_u(ARMAssembler::LoadUint32, ARMRegisters::S1, ARMRegisters::S1, 0);
+ m_assembler.ldrUniqueImmediate(ARMRegisters::S1, reinterpret_cast<ARMWord>(address.m_ptr));
+ m_assembler.dtrUp(ARMAssembler::LoadUint32, ARMRegisters::S1, ARMRegisters::S1, 0);
sub32(imm, ARMRegisters::S1);
- m_assembler.ldr_un_imm(ARMRegisters::S0, reinterpret_cast<ARMWord>(address.m_ptr));
- m_assembler.dtr_u(ARMAssembler::StoreUint32, ARMRegisters::S1, ARMRegisters::S0, 0);
+ m_assembler.ldrUniqueImmediate(ARMRegisters::S0, reinterpret_cast<ARMWord>(address.m_ptr));
+ m_assembler.dtrUp(ARMAssembler::StoreUint32, ARMRegisters::S1, ARMRegisters::S0, 0);
}
void load32(const void* address, RegisterID dest)
{
- m_assembler.ldr_un_imm(ARMRegisters::S0, reinterpret_cast<ARMWord>(address));
- m_assembler.dtr_u(ARMAssembler::LoadUint32, dest, ARMRegisters::S0, 0);
+ m_assembler.ldrUniqueImmediate(ARMRegisters::S0, reinterpret_cast<ARMWord>(address));
+ m_assembler.dtrUp(ARMAssembler::LoadUint32, dest, ARMRegisters::S0, 0);
}
Jump branch32(RelationalCondition cond, AbsoluteAddress left, RegisterID right)
@@ -893,10 +893,10 @@ public:
void relativeTableJump(RegisterID index, int scale)
{
ASSERT(scale >= 0 && scale <= 31);
- m_assembler.add_r(ARMRegisters::pc, ARMRegisters::pc, m_assembler.lsl(index, scale));
+ m_assembler.add(ARMRegisters::pc, ARMRegisters::pc, m_assembler.lsl(index, scale));
// NOP the default prefetching
- m_assembler.mov_r(ARMRegisters::r0, ARMRegisters::r0);
+ m_assembler.mov(ARMRegisters::r0, ARMRegisters::r0);
}
Call call()
@@ -919,7 +919,7 @@ public:
DataLabelPtr moveWithPatch(TrustedImmPtr initialValue, RegisterID dest)
{
DataLabelPtr dataLabel(this);
- m_assembler.ldr_un_imm(dest, reinterpret_cast<ARMWord>(initialValue.m_value));
+ m_assembler.ldrUniqueImmediate(dest, reinterpret_cast<ARMWord>(initialValue.m_value));
return dataLabel;
}
@@ -985,7 +985,7 @@ public:
void loadDouble(const void* address, FPRegisterID dest)
{
move(TrustedImm32(reinterpret_cast<ARMWord>(address)), ARMRegisters::S0);
- m_assembler.fdtr_u(ARMAssembler::LoadDouble, dest, ARMRegisters::S0, 0);
+ m_assembler.doubleDtrUp(ARMAssembler::LoadDouble, dest, ARMRegisters::S0, 0);
}
void storeFloat(FPRegisterID src, BaseIndex address)
@@ -1012,17 +1012,17 @@ public:
void moveDouble(FPRegisterID src, FPRegisterID dest)
{
if (src != dest)
- m_assembler.vmov_f64_r(dest, src);
+ m_assembler.vmov_f64(dest, src);
}
void addDouble(FPRegisterID src, FPRegisterID dest)
{
- m_assembler.vadd_f64_r(dest, dest, src);
+ m_assembler.vadd_f64(dest, dest, src);
}
void addDouble(FPRegisterID op1, FPRegisterID op2, FPRegisterID dest)
{
- m_assembler.vadd_f64_r(dest, op1, op2);
+ m_assembler.vadd_f64(dest, op1, op2);
}
void addDouble(Address src, FPRegisterID dest)
@@ -1039,12 +1039,12 @@ public:
void divDouble(FPRegisterID src, FPRegisterID dest)
{
- m_assembler.vdiv_f64_r(dest, dest, src);
+ m_assembler.vdiv_f64(dest, dest, src);
}
void divDouble(FPRegisterID op1, FPRegisterID op2, FPRegisterID dest)
{
- m_assembler.vdiv_f64_r(dest, op1, op2);
+ m_assembler.vdiv_f64(dest, op1, op2);
}
void divDouble(Address src, FPRegisterID dest)
@@ -1056,12 +1056,12 @@ public:
void subDouble(FPRegisterID src, FPRegisterID dest)
{
- m_assembler.vsub_f64_r(dest, dest, src);
+ m_assembler.vsub_f64(dest, dest, src);
}
void subDouble(FPRegisterID op1, FPRegisterID op2, FPRegisterID dest)
{
- m_assembler.vsub_f64_r(dest, op1, op2);
+ m_assembler.vsub_f64(dest, op1, op2);
}
void subDouble(Address src, FPRegisterID dest)
@@ -1072,7 +1072,7 @@ public:
void mulDouble(FPRegisterID src, FPRegisterID dest)
{
- m_assembler.vmul_f64_r(dest, dest, src);
+ m_assembler.vmul_f64(dest, dest, src);
}
void mulDouble(Address src, FPRegisterID dest)
@@ -1083,28 +1083,28 @@ public:
void mulDouble(FPRegisterID op1, FPRegisterID op2, FPRegisterID dest)
{
- m_assembler.vmul_f64_r(dest, op1, op2);
+ m_assembler.vmul_f64(dest, op1, op2);
}
void sqrtDouble(FPRegisterID src, FPRegisterID dest)
{
- m_assembler.vsqrt_f64_r(dest, src);
+ m_assembler.vsqrt_f64(dest, src);
}
void absDouble(FPRegisterID src, FPRegisterID dest)
{
- m_assembler.vabs_f64_r(dest, src);
+ m_assembler.vabs_f64(dest, src);
}
void negateDouble(FPRegisterID src, FPRegisterID dest)
{
- m_assembler.vneg_f64_r(dest, src);
+ m_assembler.vneg_f64(dest, src);
}
void convertInt32ToDouble(RegisterID src, FPRegisterID dest)
{
- m_assembler.vmov_vfp32_r(dest << 1, src);
- m_assembler.vcvt_f64_s32_r(dest, dest << 1);
+ m_assembler.vmov_vfp32(dest << 1, src);
+ m_assembler.vcvt_f64_s32(dest, dest << 1);
}
void convertInt32ToDouble(Address src, FPRegisterID dest)
@@ -1122,20 +1122,20 @@ public:
void convertFloatToDouble(FPRegisterID src, FPRegisterID dst)
{
- m_assembler.vcvt_f64_f32_r(dst, src);
+ m_assembler.vcvt_f64_f32(dst, src);
}
void convertDoubleToFloat(FPRegisterID src, FPRegisterID dst)
{
- m_assembler.vcvt_f32_f64_r(dst, src);
+ m_assembler.vcvt_f32_f64(dst, src);
}
Jump branchDouble(DoubleCondition cond, FPRegisterID left, FPRegisterID right)
{
- m_assembler.vcmp_f64_r(left, right);
+ m_assembler.vcmp_f64(left, right);
m_assembler.vmrs_apsr();
if (cond & DoubleConditionBitSpecial)
- m_assembler.cmp_r(ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::VS);
+ m_assembler.cmp(ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::VS);
return Jump(m_assembler.jmp(static_cast<ARMAssembler::Condition>(cond & ~DoubleConditionMask)));
}
@@ -1148,12 +1148,12 @@ public:
{
truncateDoubleToInt32(src, dest);
- m_assembler.add_r(ARMRegisters::S0, dest, ARMAssembler::getOp2Byte(1));
- m_assembler.bic_r(ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::getOp2Byte(1));
+ m_assembler.add(ARMRegisters::S0, dest, ARMAssembler::getOp2Byte(1));
+ m_assembler.bic(ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::getOp2Byte(1));
ARMWord w = ARMAssembler::getOp2(0x80000000);
ASSERT(w != ARMAssembler::InvalidImmediate);
- m_assembler.cmp_r(ARMRegisters::S0, w);
+ m_assembler.cmp(ARMRegisters::S0, w);
return Jump(m_assembler.jmp(branchType == BranchIfTruncateFailed ? ARMAssembler::EQ : ARMAssembler::NE));
}
@@ -1161,24 +1161,24 @@ public:
{
truncateDoubleToUint32(src, dest);
- m_assembler.add_r(ARMRegisters::S0, dest, ARMAssembler::getOp2Byte(1));
- m_assembler.bic_r(ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::getOp2Byte(1));
+ m_assembler.add(ARMRegisters::S0, dest, ARMAssembler::getOp2Byte(1));
+ m_assembler.bic(ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::getOp2Byte(1));
- m_assembler.cmp_r(ARMRegisters::S0, ARMAssembler::getOp2Byte(0));
+ m_assembler.cmp(ARMRegisters::S0, ARMAssembler::getOp2Byte(0));
return Jump(m_assembler.jmp(branchType == BranchIfTruncateFailed ? ARMAssembler::EQ : ARMAssembler::NE));
}
// Result is undefined if the value is outside of the integer range.
void truncateDoubleToInt32(FPRegisterID src, RegisterID dest)
{
- m_assembler.vcvt_s32_f64_r(ARMRegisters::SD0 << 1, src);
- m_assembler.vmov_arm32_r(dest, ARMRegisters::SD0 << 1);
+ m_assembler.vcvt_s32_f64(ARMRegisters::SD0 << 1, src);
+ m_assembler.vmov_arm32(dest, ARMRegisters::SD0 << 1);
}
void truncateDoubleToUint32(FPRegisterID src, RegisterID dest)
{
- m_assembler.vcvt_u32_f64_r(ARMRegisters::SD0 << 1, src);
- m_assembler.vmov_arm32_r(dest, ARMRegisters::SD0 << 1);
+ m_assembler.vcvt_u32_f64(ARMRegisters::SD0 << 1, src);
+ m_assembler.vmov_arm32(dest, ARMRegisters::SD0 << 1);
}
// Convert 'src' to an integer, and places the resulting 'dest'.
@@ -1187,11 +1187,11 @@ public:
// (specifically, in this case, 0).
void branchConvertDoubleToInt32(FPRegisterID src, RegisterID dest, JumpList& failureCases, FPRegisterID fpTemp)
{
- m_assembler.vcvt_s32_f64_r(ARMRegisters::SD0 << 1, src);
- m_assembler.vmov_arm32_r(dest, ARMRegisters::SD0 << 1);
+ m_assembler.vcvt_s32_f64(ARMRegisters::SD0 << 1, src);
+ m_assembler.vmov_arm32(dest, ARMRegisters::SD0 << 1);
// Convert the integer result back to float & compare to the original value - if not equal or unordered (NaN) then jump.
- m_assembler.vcvt_f64_s32_r(ARMRegisters::SD0, ARMRegisters::SD0 << 1);
+ m_assembler.vcvt_f64_s32(ARMRegisters::SD0, ARMRegisters::SD0 << 1);
failureCases.append(branchDouble(DoubleNotEqualOrUnordered, src, ARMRegisters::SD0));
// If the result is zero, it might have been -0.0, and 0.0 equals to -0.0
@@ -1200,14 +1200,14 @@ public:
Jump branchDoubleNonZero(FPRegisterID reg, FPRegisterID scratch)
{
- m_assembler.mov_r(ARMRegisters::S0, ARMAssembler::getOp2Byte(0));
+ m_assembler.mov(ARMRegisters::S0, ARMAssembler::getOp2Byte(0));
convertInt32ToDouble(ARMRegisters::S0, scratch);
return branchDouble(DoubleNotEqual, reg, scratch);
}
Jump branchDoubleZeroOrNaN(FPRegisterID reg, FPRegisterID scratch)
{
- m_assembler.mov_r(ARMRegisters::S0, ARMAssembler::getOp2Byte(0));
+ m_assembler.mov(ARMRegisters::S0, ARMAssembler::getOp2Byte(0));
convertInt32ToDouble(ARMRegisters::S0, scratch);
return branchDouble(DoubleEqualOrUnordered, reg, scratch);
}
diff --git a/Source/JavaScriptCore/bytecode/ArrayProfile.cpp b/Source/JavaScriptCore/bytecode/ArrayProfile.cpp
new file mode 100644
index 000000000..6b97f7806
--- /dev/null
+++ b/Source/JavaScriptCore/bytecode/ArrayProfile.cpp
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ArrayProfile.h"
+
+namespace JSC {
+
+void ArrayProfile::computeUpdatedPrediction(OperationInProgress operation)
+{
+ if (m_lastSeenStructure) {
+ m_observedArrayModes |= arrayModeFromStructure(m_lastSeenStructure);
+ if (!m_structureIsPolymorphic) {
+ if (!m_expectedStructure)
+ m_expectedStructure = m_lastSeenStructure;
+ else if (m_expectedStructure != m_lastSeenStructure) {
+ m_expectedStructure = 0;
+ m_structureIsPolymorphic = true;
+ }
+ }
+ m_lastSeenStructure = 0;
+ }
+
+ if (operation == Collection
+ && m_expectedStructure
+ && !Heap::isMarked(m_expectedStructure)) {
+ m_expectedStructure = 0;
+ m_structureIsPolymorphic = true;
+ }
+}
+
+} // namespace JSC
+
diff --git a/Source/JavaScriptCore/bytecode/ArrayProfile.h b/Source/JavaScriptCore/bytecode/ArrayProfile.h
new file mode 100644
index 000000000..5a656e2dd
--- /dev/null
+++ b/Source/JavaScriptCore/bytecode/ArrayProfile.h
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ArrayProfile_h
+#define ArrayProfile_h
+
+#include "JSArray.h"
+#include "Structure.h"
+#include <wtf/HashMap.h>
+#include <wtf/SegmentedVector.h>
+
+namespace JSC {
+
+class LLIntOffsetsExtractor;
+
+typedef unsigned ArrayModes;
+
+static const unsigned IsNotArray = 1;
+static const unsigned IsJSArray = 2;
+
+inline ArrayModes arrayModeFromStructure(Structure* structure)
+{
+ if (structure->classInfo() == &JSArray::s_info)
+ return IsJSArray;
+ return IsNotArray;
+}
+
+class ArrayProfile {
+public:
+ ArrayProfile()
+ : m_bytecodeOffset(std::numeric_limits<unsigned>::max())
+ , m_lastSeenStructure(0)
+ , m_expectedStructure(0)
+ , m_structureIsPolymorphic(false)
+ , m_observedArrayModes(0)
+ {
+ }
+
+ ArrayProfile(unsigned bytecodeOffset)
+ : m_bytecodeOffset(bytecodeOffset)
+ , m_lastSeenStructure(0)
+ , m_expectedStructure(0)
+ , m_structureIsPolymorphic(false)
+ , m_observedArrayModes(0)
+ {
+ }
+
+ unsigned bytecodeOffset() const { return m_bytecodeOffset; }
+
+ Structure** addressOfLastSeenStructure() { return &m_lastSeenStructure; }
+
+ void observeStructure(Structure* structure)
+ {
+ m_lastSeenStructure = structure;
+ }
+
+ void computeUpdatedPrediction(OperationInProgress operation = NoOperation);
+
+ Structure* expectedStructure() const { return m_expectedStructure; }
+ bool structureIsPolymorphic() const { return m_structureIsPolymorphic; }
+ bool hasDefiniteStructure() const
+ {
+ return !structureIsPolymorphic() && m_expectedStructure;
+ }
+ ArrayModes observedArrayModes() const { return m_observedArrayModes; }
+
+private:
+ friend class LLIntOffsetsExtractor;
+
+ unsigned m_bytecodeOffset;
+ Structure* m_lastSeenStructure;
+ Structure* m_expectedStructure;
+ bool m_structureIsPolymorphic;
+ ArrayModes m_observedArrayModes;
+};
+
+typedef SegmentedVector<ArrayProfile, 4, 0> ArrayProfileVector;
+
+} // namespace JSC
+
+#endif // ArrayProfile_h
+
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
index 0e2a98bc5..2ea969fcf 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -1155,6 +1155,7 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
dataLog("[%4d] get_by_val\t %s, %s, %s", location, registerName(exec, r0).data(), registerName(exec, r1).data(), registerName(exec, r2).data());
dumpBytecodeCommentAndNewLine(location);
it++;
+ it++;
break;
}
case op_get_argument_by_val: {
@@ -1164,6 +1165,7 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
dataLog("[%4d] get_argument_by_val\t %s, %s, %s", location, registerName(exec, r0).data(), registerName(exec, r1).data(), registerName(exec, r2).data());
dumpBytecodeCommentAndNewLine(location);
++it;
+ ++it;
break;
}
case op_get_by_pname: {
@@ -1183,6 +1185,7 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
int r2 = (++it)->u.operand;
dataLog("[%4d] put_by_val\t %s, %s, %s", location, registerName(exec, r0).data(), registerName(exec, r1).data(), registerName(exec, r2).data());
dumpBytecodeCommentAndNewLine(location);
+ ++it;
break;
}
case op_del_by_val: {
@@ -2577,6 +2580,60 @@ void CodeBlock::unlinkIncomingCalls()
m_incomingCalls.begin()->unlink(*m_globalData, repatchBuffer);
}
+#if ENABLE(LLINT)
+Instruction* CodeBlock::adjustPCIfAtCallSite(Instruction* potentialReturnPC)
+{
+ ASSERT(potentialReturnPC);
+
+ unsigned returnPCOffset = potentialReturnPC - instructions().begin();
+ Instruction* adjustedPC;
+ unsigned opcodeLength;
+
+ // If we are at a callsite, the LLInt stores the PC after the call
+ // instruction rather than the PC of the call instruction. This requires
+ // some correcting. If so, we can rely on the fact that the preceding
+ // instruction must be one of the call instructions, so either it's a
+ // call_varargs or it's a call, construct, or eval.
+ //
+ // If we are not at a call site, then we need to guard against the
+ // possibility of peeking past the start of the bytecode range for this
+ // codeBlock. Hence, we do a bounds check before we peek at the
+ // potential "preceding" instruction.
+ // The bounds check is done by comparing the offset of the potential
+ // returnPC with the length of the opcode. If there is room for a call
+ // instruction before the returnPC, then the offset of the returnPC must
+ // be greater than the size of the call opcode we're looking for.
+
+ // The determination of the call instruction present (if we are at a
+ // callsite) depends on the following assumptions. So, assert that
+ // they are still true:
+ ASSERT(OPCODE_LENGTH(op_call_varargs) <= OPCODE_LENGTH(op_call));
+ ASSERT(OPCODE_LENGTH(op_call) == OPCODE_LENGTH(op_construct));
+ ASSERT(OPCODE_LENGTH(op_call) == OPCODE_LENGTH(op_call_eval));
+
+ // Check for the case of a preceeding op_call_varargs:
+ opcodeLength = OPCODE_LENGTH(op_call_varargs);
+ adjustedPC = potentialReturnPC - opcodeLength;
+ if ((returnPCOffset >= opcodeLength)
+ && (adjustedPC->u.pointer == bitwise_cast<void*>(llint_op_call_varargs))) {
+ return adjustedPC;
+ }
+
+ // Check for the case of the other 3 call instructions:
+ opcodeLength = OPCODE_LENGTH(op_call);
+ adjustedPC = potentialReturnPC - opcodeLength;
+ if ((returnPCOffset >= opcodeLength)
+ && (adjustedPC->u.pointer == bitwise_cast<void*>(llint_op_call)
+ || adjustedPC->u.pointer == bitwise_cast<void*>(llint_op_construct)
+ || adjustedPC->u.pointer == bitwise_cast<void*>(llint_op_call_eval))) {
+ return adjustedPC;
+ }
+
+ // Not a call site. No need to adjust PC. Just return the original.
+ return potentialReturnPC;
+}
+#endif
+
unsigned CodeBlock::bytecodeOffset(ExecState* exec, ReturnAddressPtr returnAddress)
{
#if ENABLE(LLINT)
@@ -2587,28 +2644,8 @@ unsigned CodeBlock::bytecodeOffset(ExecState* exec, ReturnAddressPtr returnAddre
ASSERT(JITCode::isBaselineCode(getJITType()));
Instruction* instruction = exec->currentVPC();
ASSERT(instruction);
-
- // The LLInt stores the PC after the call instruction rather than the PC of
- // the call instruction. This requires some correcting. We rely on the fact
- // that the preceding instruction must be one of the call instructions, so
- // either it's a call_varargs or it's a call, construct, or eval.
- ASSERT(OPCODE_LENGTH(op_call_varargs) <= OPCODE_LENGTH(op_call));
- ASSERT(OPCODE_LENGTH(op_call) == OPCODE_LENGTH(op_construct));
- ASSERT(OPCODE_LENGTH(op_call) == OPCODE_LENGTH(op_call_eval));
- if (instruction[-OPCODE_LENGTH(op_call_varargs)].u.pointer == bitwise_cast<void*>(llint_op_call_varargs)) {
- // We know that the preceding instruction must be op_call_varargs because there is no way that
- // the pointer to the call_varargs could be an operand to the call.
- instruction -= OPCODE_LENGTH(op_call_varargs);
- ASSERT(instruction[-OPCODE_LENGTH(op_call)].u.pointer != bitwise_cast<void*>(llint_op_call)
- && instruction[-OPCODE_LENGTH(op_call)].u.pointer != bitwise_cast<void*>(llint_op_construct)
- && instruction[-OPCODE_LENGTH(op_call)].u.pointer != bitwise_cast<void*>(llint_op_call_eval));
- } else {
- // Must be that the last instruction was some op_call.
- ASSERT(instruction[-OPCODE_LENGTH(op_call)].u.pointer == bitwise_cast<void*>(llint_op_call)
- || instruction[-OPCODE_LENGTH(op_call)].u.pointer == bitwise_cast<void*>(llint_op_construct)
- || instruction[-OPCODE_LENGTH(op_call)].u.pointer == bitwise_cast<void*>(llint_op_call_eval));
- instruction -= OPCODE_LENGTH(op_call);
- }
+
+ instruction = adjustPCIfAtCallSite(instruction);
return bytecodeOffset(instruction);
}
@@ -2684,27 +2721,27 @@ CodeBlock* FunctionCodeBlock::replacement()
return &static_cast<FunctionExecutable*>(ownerExecutable())->generatedBytecodeFor(m_isConstructor ? CodeForConstruct : CodeForCall);
}
-JSObject* ProgramCodeBlock::compileOptimized(ExecState* exec, ScopeChainNode* scopeChainNode)
+JSObject* ProgramCodeBlock::compileOptimized(ExecState* exec, ScopeChainNode* scopeChainNode, unsigned bytecodeIndex)
{
if (replacement()->getJITType() == JITCode::nextTierJIT(getJITType()))
return 0;
- JSObject* error = static_cast<ProgramExecutable*>(ownerExecutable())->compileOptimized(exec, scopeChainNode);
+ JSObject* error = static_cast<ProgramExecutable*>(ownerExecutable())->compileOptimized(exec, scopeChainNode, bytecodeIndex);
return error;
}
-JSObject* EvalCodeBlock::compileOptimized(ExecState* exec, ScopeChainNode* scopeChainNode)
+JSObject* EvalCodeBlock::compileOptimized(ExecState* exec, ScopeChainNode* scopeChainNode, unsigned bytecodeIndex)
{
if (replacement()->getJITType() == JITCode::nextTierJIT(getJITType()))
return 0;
- JSObject* error = static_cast<EvalExecutable*>(ownerExecutable())->compileOptimized(exec, scopeChainNode);
+ JSObject* error = static_cast<EvalExecutable*>(ownerExecutable())->compileOptimized(exec, scopeChainNode, bytecodeIndex);
return error;
}
-JSObject* FunctionCodeBlock::compileOptimized(ExecState* exec, ScopeChainNode* scopeChainNode)
+JSObject* FunctionCodeBlock::compileOptimized(ExecState* exec, ScopeChainNode* scopeChainNode, unsigned bytecodeIndex)
{
if (replacement()->getJITType() == JITCode::nextTierJIT(getJITType()))
return 0;
- JSObject* error = static_cast<FunctionExecutable*>(ownerExecutable())->compileOptimizedFor(exec, scopeChainNode, m_isConstructor ? CodeForConstruct : CodeForCall);
+ JSObject* error = static_cast<FunctionExecutable*>(ownerExecutable())->compileOptimizedFor(exec, scopeChainNode, bytecodeIndex, m_isConstructor ? CodeForConstruct : CodeForCall);
return error;
}
@@ -2769,6 +2806,23 @@ bool FunctionCodeBlock::jitCompileImpl(ExecState* exec)
#endif
#if ENABLE(VALUE_PROFILER)
+ArrayProfile* CodeBlock::getArrayProfile(unsigned bytecodeOffset)
+{
+ for (unsigned i = 0; i < m_arrayProfiles.size(); ++i) {
+ if (m_arrayProfiles[i].bytecodeOffset() == bytecodeOffset)
+ return &m_arrayProfiles[i];
+ }
+ return 0;
+}
+
+ArrayProfile* CodeBlock::getOrAddArrayProfile(unsigned bytecodeOffset)
+{
+ ArrayProfile* result = getArrayProfile(bytecodeOffset);
+ if (result)
+ return result;
+ return addArrayProfile(bytecodeOffset);
+}
+
void CodeBlock::updateAllPredictionsAndCountLiveness(
OperationInProgress operation, unsigned& numberOfLiveNonArgumentValueProfiles, unsigned& numberOfSamplesInProfiles)
{
@@ -2792,6 +2846,12 @@ void CodeBlock::updateAllPredictionsAndCountLiveness(
#if ENABLE(DFG_JIT)
m_lazyOperandValueProfiles.computeUpdatedPredictions(operation);
#endif
+
+ // Don't count the array profiles towards statistics, since each array profile
+ // site also has a value profile site - so we already know whether or not it's
+ // live.
+ for (unsigned i = m_arrayProfiles.size(); i--;)
+ m_arrayProfiles[i].computeUpdatedPrediction(operation);
}
void CodeBlock::updateAllPredictions(OperationInProgress operation)
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.h b/Source/JavaScriptCore/bytecode/CodeBlock.h
index 2a7d2120a..a8b2a5871 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.h
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.h
@@ -30,6 +30,7 @@
#ifndef CodeBlock_h
#define CodeBlock_h
+#include "ArrayProfile.h"
#include "BytecodeConventions.h"
#include "CallLinkInfo.h"
#include "CallReturnOffsetToBytecodeOffset.h"
@@ -229,6 +230,9 @@ namespace JSC {
return *(binarySearch<MethodCallLinkInfo, unsigned, getMethodCallLinkInfoBytecodeIndex>(m_methodCallLinkInfos.begin(), m_methodCallLinkInfos.size(), bytecodeIndex));
}
+#if ENABLE(LLINT)
+ Instruction* adjustPCIfAtCallSite(Instruction*);
+#endif
unsigned bytecodeOffset(ExecState*, ReturnAddressPtr);
unsigned bytecodeOffsetForCallAtIndex(unsigned index)
@@ -441,7 +445,7 @@ namespace JSC {
MacroAssemblerCodePtr getJITCodeWithArityCheck() { return m_jitCodeWithArityCheck; }
JITCode::JITType getJITType() { return m_jitCode.jitType(); }
ExecutableMemoryHandle* executableMemory() { return getJITCode().getExecutableMemory(); }
- virtual JSObject* compileOptimized(ExecState*, ScopeChainNode*) = 0;
+ virtual JSObject* compileOptimized(ExecState*, ScopeChainNode*, unsigned bytecodeIndex) = 0;
virtual void jettison() = 0;
enum JITCompilationResult { AlreadyCompiled, CouldNotCompile, CompiledSuccessfully };
JITCompilationResult jitCompile(ExecState* exec)
@@ -751,8 +755,18 @@ namespace JSC {
}
unsigned executionEntryCount() const { return m_executionEntryCount; }
-#endif
+ unsigned numberOfArrayProfiles() const { return m_arrayProfiles.size(); }
+ const ArrayProfileVector& arrayProfiles() { return m_arrayProfiles; }
+ ArrayProfile* addArrayProfile(unsigned bytecodeOffset)
+ {
+ m_arrayProfiles.append(ArrayProfile(bytecodeOffset));
+ return &m_arrayProfiles.last();
+ }
+ ArrayProfile* getArrayProfile(unsigned bytecodeOffset);
+ ArrayProfile* getOrAddArrayProfile(unsigned bytecodeOffset);
+#endif
+
unsigned globalResolveInfoCount() const
{
#if ENABLE(JIT)
@@ -1333,6 +1347,7 @@ namespace JSC {
SegmentedVector<ValueProfile, 8> m_valueProfiles;
SegmentedVector<RareCaseProfile, 8> m_rareCaseProfiles;
SegmentedVector<RareCaseProfile, 8> m_specialFastCaseProfiles;
+ ArrayProfileVector m_arrayProfiles;
unsigned m_executionEntryCount;
#endif
@@ -1436,7 +1451,7 @@ namespace JSC {
#if ENABLE(JIT)
protected:
- virtual JSObject* compileOptimized(ExecState*, ScopeChainNode*);
+ virtual JSObject* compileOptimized(ExecState*, ScopeChainNode*, unsigned bytecodeIndex);
virtual void jettison();
virtual bool jitCompileImpl(ExecState*);
virtual CodeBlock* replacement();
@@ -1471,7 +1486,7 @@ namespace JSC {
#if ENABLE(JIT)
protected:
- virtual JSObject* compileOptimized(ExecState*, ScopeChainNode*);
+ virtual JSObject* compileOptimized(ExecState*, ScopeChainNode*, unsigned bytecodeIndex);
virtual void jettison();
virtual bool jitCompileImpl(ExecState*);
virtual CodeBlock* replacement();
@@ -1509,7 +1524,7 @@ namespace JSC {
#if ENABLE(JIT)
protected:
- virtual JSObject* compileOptimized(ExecState*, ScopeChainNode*);
+ virtual JSObject* compileOptimized(ExecState*, ScopeChainNode*, unsigned bytecodeIndex);
virtual void jettison();
virtual bool jitCompileImpl(ExecState*);
virtual CodeBlock* replacement();
diff --git a/Source/JavaScriptCore/bytecode/Instruction.h b/Source/JavaScriptCore/bytecode/Instruction.h
index 2e94b452c..6c1260abc 100644
--- a/Source/JavaScriptCore/bytecode/Instruction.h
+++ b/Source/JavaScriptCore/bytecode/Instruction.h
@@ -46,6 +46,7 @@ namespace JSC {
// curently actually use PolymorphicAccessStructureLists, which we should). Anyway, this seems like the best
// solution for now - will need to something smarter if/when we actually want mixed-mode operation.
+ class ArrayProfile;
class JSCell;
class Structure;
class StructureChain;
@@ -190,6 +191,7 @@ namespace JSC {
Instruction(LLIntCallLinkInfo* callLinkInfo) { u.callLinkInfo = callLinkInfo; }
Instruction(ValueProfile* profile) { u.profile = profile; }
+ Instruction(ArrayProfile* profile) { u.arrayProfile = profile; }
Instruction(WriteBarrier<Unknown>* registerPointer) { u.registerPointer = registerPointer; }
@@ -205,6 +207,7 @@ namespace JSC {
PropertySlot::GetValueFunc getterFunc;
LLIntCallLinkInfo* callLinkInfo;
ValueProfile* profile;
+ ArrayProfile* arrayProfile;
void* pointer;
bool* predicatePointer;
} u;
diff --git a/Source/JavaScriptCore/bytecode/Opcode.h b/Source/JavaScriptCore/bytecode/Opcode.h
index 4308e79df..777b4876f 100644
--- a/Source/JavaScriptCore/bytecode/Opcode.h
+++ b/Source/JavaScriptCore/bytecode/Opcode.h
@@ -132,10 +132,10 @@ namespace JSC {
macro(op_put_by_id_replace, 9) \
macro(op_put_by_id_generic, 9) \
macro(op_del_by_id, 4) \
- macro(op_get_by_val, 5) /* has value profiling */ \
- macro(op_get_argument_by_val, 5) /* must be the same size as op_get_by_val */ \
+ macro(op_get_by_val, 6) /* has value profiling */ \
+ macro(op_get_argument_by_val, 6) /* must be the same size as op_get_by_val */ \
macro(op_get_by_pname, 7) \
- macro(op_put_by_val, 4) \
+ macro(op_put_by_val, 5) \
macro(op_del_by_val, 4) \
macro(op_put_by_index, 4) \
macro(op_put_getter_setter, 5) \
diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
index 14a69b530..c8cfa74b6 100644
--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
@@ -708,6 +708,15 @@ void BytecodeGenerator::prependComment(const char* string)
}
#endif
+ArrayProfile* BytecodeGenerator::newArrayProfile()
+{
+#if ENABLE(VALUE_PROFILER)
+ return m_codeBlock->addArrayProfile(instructions().size());
+#else
+ return 0;
+#endif
+}
+
ValueProfile* BytecodeGenerator::emitProfiledOpcode(OpcodeID opcodeID)
{
#if ENABLE(VALUE_PROFILER)
@@ -1455,9 +1464,7 @@ RegisterID* BytecodeGenerator::emitResolveWithBase(RegisterID* baseDst, Register
#if ENABLE(JIT)
m_codeBlock->addGlobalResolveInfo(instructions().size());
#endif
-#if ENABLE(CLASSIC_INTERPRETER)
m_codeBlock->addGlobalResolveInstruction(instructions().size());
-#endif
ValueProfile* profile = emitProfiledOpcode(op_resolve_global);
instructions().append(propDst->index());
instructions().append(addConstant(property));
@@ -1669,11 +1676,13 @@ RegisterID* BytecodeGenerator::emitDeleteById(RegisterID* dst, RegisterID* base,
RegisterID* BytecodeGenerator::emitGetArgumentByVal(RegisterID* dst, RegisterID* base, RegisterID* property)
{
+ ArrayProfile* arrayProfile = newArrayProfile();
ValueProfile* profile = emitProfiledOpcode(op_get_argument_by_val);
instructions().append(dst->index());
ASSERT(base->index() == m_codeBlock->argumentsRegister());
instructions().append(base->index());
instructions().append(property->index());
+ instructions().append(arrayProfile);
instructions().append(profile);
return dst;
}
@@ -1693,20 +1702,24 @@ RegisterID* BytecodeGenerator::emitGetByVal(RegisterID* dst, RegisterID* base, R
return dst;
}
}
+ ArrayProfile* arrayProfile = newArrayProfile();
ValueProfile* profile = emitProfiledOpcode(op_get_by_val);
instructions().append(dst->index());
instructions().append(base->index());
instructions().append(property->index());
+ instructions().append(arrayProfile);
instructions().append(profile);
return dst;
}
RegisterID* BytecodeGenerator::emitPutByVal(RegisterID* base, RegisterID* property, RegisterID* value)
{
+ ArrayProfile* arrayProfile = newArrayProfile();
emitOpcode(op_put_by_val);
instructions().append(base->index());
instructions().append(property->index());
instructions().append(value->index());
+ instructions().append(arrayProfile);
return value;
}
diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
index 490991fa7..9c094414d 100644
--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
@@ -555,6 +555,7 @@ namespace JSC {
#endif
void emitOpcode(OpcodeID);
+ ArrayProfile* newArrayProfile();
ValueProfile* emitProfiledOpcode(OpcodeID);
void retrieveLastBinaryOp(int& dstIndex, int& src1Index, int& src2Index);
void retrieveLastUnaryOp(int& dstIndex, int& srcIndex);
diff --git a/Source/JavaScriptCore/config.h b/Source/JavaScriptCore/config.h
index 1e49c96bf..7f7eda0f1 100644
--- a/Source/JavaScriptCore/config.h
+++ b/Source/JavaScriptCore/config.h
@@ -69,12 +69,7 @@
#include <wtf/FastMalloc.h>
#endif
-// this breaks compilation of <QFontDatabase>, at least, so turn it off for now
-// Also generates errors on wx on Windows and QNX, because these functions
-// are used from wx and QNX headers.
-#if !PLATFORM(QT) && !PLATFORM(WX) && !OS(QNX)
#include <wtf/DisallowCType.h>
-#endif
#if COMPILER(MSVC)
#define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
diff --git a/Source/JavaScriptCore/dfg/DFGAbstractState.cpp b/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
index 4f02ee793..5c53f6d78 100644
--- a/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
+++ b/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
@@ -62,13 +62,13 @@ void AbstractState::beginBasicBlock(BasicBlock* basicBlock)
m_variables = basicBlock->valuesAtHead;
m_haveStructures = false;
for (size_t i = 0; i < m_variables.numberOfArguments(); ++i) {
- if (m_variables.argument(i).m_structure.isNeitherClearNorTop()) {
+ if (m_variables.argument(i).m_currentKnownStructure.isNeitherClearNorTop()) {
m_haveStructures = true;
break;
}
}
for (size_t i = 0; i < m_variables.numberOfLocals(); ++i) {
- if (m_variables.local(i).m_structure.isNeitherClearNorTop()) {
+ if (m_variables.local(i).m_currentKnownStructure.isNeitherClearNorTop()) {
m_haveStructures = true;
break;
}
@@ -106,8 +106,6 @@ void AbstractState::initialize(Graph& graph)
SpeculatedType prediction = node.variableAccessData()->prediction();
if (isInt32Speculation(prediction))
root->valuesAtHead.argument(i).set(SpecInt32);
- else if (isArraySpeculation(prediction))
- root->valuesAtHead.argument(i).set(SpecArray);
else if (isBooleanSpeculation(prediction))
root->valuesAtHead.argument(i).set(SpecBoolean);
else if (isInt8ArraySpeculation(prediction))
@@ -160,6 +158,16 @@ void AbstractState::initialize(Graph& graph)
block->valuesAtHead.local(i).clear();
block->valuesAtTail.local(i).clear();
}
+ if (!block->isOSRTarget)
+ continue;
+ if (block->bytecodeBegin != graph.m_osrEntryBytecodeIndex)
+ continue;
+ for (size_t i = 0; i < graph.m_mustHandleValues.size(); ++i) {
+ AbstractValue value;
+ value.setMostSpecific(graph.m_mustHandleValues[i]);
+ block->valuesAtHead.operand(graph.m_mustHandleValues.operandForIndex(i)).merge(value);
+ }
+ block->cfaShouldRevisit = true;
}
}
@@ -290,10 +298,7 @@ bool AbstractState::execute(unsigned indexInBlock)
SpeculatedType predictedType = node.variableAccessData()->argumentAwarePrediction();
if (isInt32Speculation(predictedType))
speculateInt32Unary(node);
- else if (isArraySpeculation(predictedType)) {
- node.setCanExit(!isArraySpeculation(forNode(node.child1()).m_type));
- forNode(node.child1()).filter(SpecArray);
- } else if (isCellSpeculation(predictedType)) {
+ else if (isCellSpeculation(predictedType)) {
node.setCanExit(!isCellSpeculation(forNode(node.child1()).m_type));
forNode(node.child1()).filter(SpecCell);
} else if (isBooleanSpeculation(predictedType))
@@ -867,7 +872,7 @@ bool AbstractState::execute(unsigned indexInBlock)
m_isValid = false;
break;
}
- if (!isActionableArraySpeculation(m_graph[node.child1()].prediction()) || !m_graph[node.child2()].shouldSpeculateInteger()) {
+ if (!m_graph[node.child2()].shouldSpeculateInteger() || (!node.child3() && !m_graph[node.child1()].shouldSpeculateArguments())) {
clobberWorld(node.codeOrigin, indexInBlock);
forNode(nodeIndex).makeTop();
break;
@@ -942,8 +947,7 @@ bool AbstractState::execute(unsigned indexInBlock)
forNode(nodeIndex).set(SpecDouble);
break;
}
- ASSERT(m_graph[node.child1()].shouldSpeculateArray());
- forNode(node.child1()).filter(SpecArray);
+ forNode(node.child1()).filter(SpecCell);
forNode(node.child2()).filter(SpecInt32);
forNode(nodeIndex).makeTop();
break;
@@ -962,7 +966,7 @@ bool AbstractState::execute(unsigned indexInBlock)
m_isValid = false;
break;
}
- if (!m_graph[child2].shouldSpeculateInteger() || !isActionableMutableArraySpeculation(m_graph[child1].prediction())
+ if (!m_graph[child2].shouldSpeculateInteger()
#if USE(JSVALUE32_64)
|| m_graph[child1].shouldSpeculateArguments()
#endif
@@ -1053,8 +1057,7 @@ bool AbstractState::execute(unsigned indexInBlock)
forNode(child3).filter(SpecNumber);
break;
}
- ASSERT(m_graph[child1].shouldSpeculateArray());
- forNode(child1).filter(SpecArray);
+ forNode(child1).filter(SpecCell);
forNode(child2).filter(SpecInt32);
if (node.op() == PutByValSafe)
clobberWorld(node.codeOrigin, indexInBlock);
@@ -1063,13 +1066,13 @@ bool AbstractState::execute(unsigned indexInBlock)
case ArrayPush:
node.setCanExit(true);
- forNode(node.child1()).filter(SpecArray);
+ forNode(node.child1()).filter(SpecCell);
forNode(nodeIndex).set(SpecNumber);
break;
case ArrayPop:
node.setCanExit(true);
- forNode(node.child1()).filter(SpecArray);
+ forNode(node.child1()).filter(SpecCell);
forNode(nodeIndex).makeTop();
break;
@@ -1354,7 +1357,7 @@ bool AbstractState::execute(unsigned indexInBlock)
case GetArrayLength:
node.setCanExit(true);
- forNode(node.child1()).filter(SpecArray);
+ forNode(node.child1()).filter(SpecCell);
forNode(nodeIndex).set(SpecInt32);
break;
@@ -1420,19 +1423,52 @@ bool AbstractState::execute(unsigned indexInBlock)
case ForwardCheckStructure: {
// FIXME: We should be able to propagate the structure sets of constants (i.e. prototypes).
AbstractValue& value = forNode(node.child1());
+ // If this structure check is attempting to prove knowledge already held in
+ // the futurePossibleStructure set then the constant folding phase should
+ // turn this into a watchpoint instead.
+ StructureSet& set = node.structureSet();
+ if (value.m_futurePossibleStructure.isSubsetOf(set))
+ m_foundConstants = true;
node.setCanExit(
- !value.m_structure.isSubsetOf(node.structureSet())
+ !value.m_currentKnownStructure.isSubsetOf(set)
|| !isCellSpeculation(value.m_type));
- value.filter(node.structureSet());
+ value.filter(set);
+ // This is likely to be unnecessary, but it's conservative, and that's a good thing.
+ // This is trying to avoid situations where the CFA proves that this structure check
+ // must fail due to a future structure proof. We have two options at that point. We
+ // can either compile all subsequent code as we would otherwise, or we can ensure
+ // that the subsequent code is never reachable. The former is correct because the
+ // Proof Is Infallible (TM) -- hence even if we don't force the subsequent code to
+ // be unreachable, it must be unreachable nonetheless. But imagine what would happen
+ // if the proof was borked. In the former case, we'd get really bizarre bugs where
+ // we assumed that the structure of this object was known even though it wasn't. In
+ // the latter case, we'd have a slight performance pathology because this would be
+ // turned into an OSR exit unnecessarily. Which would you rather have?
+ if (value.m_currentKnownStructure.isClear()
+ || value.m_futurePossibleStructure.isClear())
+ m_isValid = false;
m_haveStructures = true;
break;
}
- case StructureTransitionWatchpoint: {
- // FIXME: Turn CheckStructure into StructureTransitionWatchpoint when possible!
+ case StructureTransitionWatchpoint:
+ case ForwardStructureTransitionWatchpoint: {
AbstractValue& value = forNode(node.child1());
+
+ // It's only valid to issue a structure transition watchpoint if we already
+ // know that the watchpoint covers a superset of the structures known to
+ // belong to the set of future structures that this value may have.
+ // Currently, we only issue singleton watchpoints (that check one structure)
+ // and our futurePossibleStructure set can only contain zero, one, or an
+ // infinity of structures.
+ ASSERT(value.m_futurePossibleStructure.isSubsetOf(StructureSet(node.structure())));
+
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());
+ // See comment in CheckStructure for why this is here.
+ if (value.m_currentKnownStructure.isClear()
+ || value.m_futurePossibleStructure.isClear())
+ m_isValid = false;
m_haveStructures = true;
node.setCanExit(true);
break;
@@ -1453,12 +1489,9 @@ bool AbstractState::execute(unsigned indexInBlock)
forNode(nodeIndex).clear(); // The result is not a JS value.
break;
case GetIndexedPropertyStorage: {
+ ASSERT(m_graph[node.child1()].prediction());
+ ASSERT(m_graph[node.child2()].shouldSpeculateInteger());
node.setCanExit(true); // Lies, but this is (almost) always followed by GetByVal, which does exit. So no point in trying to be more precise.
- SpeculatedType basePrediction = m_graph[node.child2()].prediction();
- if (!(basePrediction & SpecInt32) && basePrediction) {
- forNode(nodeIndex).clear();
- break;
- }
if (m_graph[node.child1()].shouldSpeculateArguments()) {
ASSERT_NOT_REACHED();
break;
@@ -1514,7 +1547,7 @@ bool AbstractState::execute(unsigned indexInBlock)
forNode(nodeIndex).clear();
break;
}
- forNode(node.child1()).filter(SpecArray);
+ forNode(node.child1()).filter(SpecCell);
forNode(nodeIndex).clear();
break;
}
diff --git a/Source/JavaScriptCore/dfg/DFGAbstractValue.h b/Source/JavaScriptCore/dfg/DFGAbstractValue.h
index 402fd0fcd..ff1c6d205 100644
--- a/Source/JavaScriptCore/dfg/DFGAbstractValue.h
+++ b/Source/JavaScriptCore/dfg/DFGAbstractValue.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,283 +30,13 @@
#if ENABLE(DFG_JIT)
+#include "DFGStructureAbstractValue.h"
#include "JSCell.h"
#include "SpeculatedType.h"
#include "StructureSet.h"
namespace JSC { namespace DFG {
-class StructureAbstractValue {
-public:
- StructureAbstractValue()
- : m_structure(0)
- {
- }
-
- StructureAbstractValue(Structure* structure)
- : m_structure(structure)
- {
- }
-
- StructureAbstractValue(const StructureSet& set)
- {
- switch (set.size()) {
- case 0:
- m_structure = 0;
- break;
-
- case 1:
- m_structure = set[0];
- break;
-
- default:
- m_structure = topValue();
- break;
- }
- }
-
- void clear()
- {
- m_structure = 0;
- }
-
- void makeTop()
- {
- m_structure = topValue();
- }
-
- static StructureAbstractValue top()
- {
- StructureAbstractValue value;
- value.makeTop();
- return value;
- }
-
- void add(Structure* structure)
- {
- ASSERT(!contains(structure) && !isTop());
- if (m_structure)
- makeTop();
- else
- m_structure = structure;
- }
-
- bool addAll(const StructureSet& other)
- {
- if (isTop() || !other.size())
- return false;
- if (other.size() > 1) {
- makeTop();
- return true;
- }
- if (!m_structure) {
- m_structure = other[0];
- return true;
- }
- if (m_structure == other[0])
- return false;
- makeTop();
- return true;
- }
-
- bool addAll(const StructureAbstractValue& other)
- {
- if (!other.m_structure)
- return false;
- if (isTop())
- return false;
- if (other.isTop()) {
- makeTop();
- return true;
- }
- if (m_structure) {
- if (m_structure == other.m_structure)
- return false;
- makeTop();
- return true;
- }
- m_structure = other.m_structure;
- return true;
- }
-
- bool contains(Structure* structure) const
- {
- if (isTop())
- return true;
- if (m_structure == structure)
- return true;
- return false;
- }
-
- bool isSubsetOf(const StructureSet& other) const
- {
- if (isTop())
- return false;
- if (!m_structure)
- return true;
- return other.contains(m_structure);
- }
-
- bool doesNotContainAnyOtherThan(Structure* structure) const
- {
- if (isTop())
- return false;
- if (!m_structure)
- return true;
- return m_structure == structure;
- }
-
- bool isSupersetOf(const StructureSet& other) const
- {
- if (isTop())
- return true;
- if (!other.size())
- return true;
- if (other.size() > 1)
- return false;
- return m_structure == other[0];
- }
-
- bool isSubsetOf(const StructureAbstractValue& other) const
- {
- if (other.isTop())
- return true;
- if (isTop())
- return false;
- if (m_structure) {
- if (other.m_structure)
- return m_structure == other.m_structure;
- return false;
- }
- return true;
- }
-
- bool isSupersetOf(const StructureAbstractValue& other) const
- {
- return other.isSubsetOf(*this);
- }
-
- void filter(const StructureSet& other)
- {
- if (!m_structure)
- return;
-
- if (isTop()) {
- switch (other.size()) {
- case 0:
- m_structure = 0;
- return;
-
- case 1:
- m_structure = other[0];
- return;
-
- default:
- return;
- }
- }
-
- if (other.contains(m_structure))
- return;
-
- m_structure = 0;
- }
-
- void filter(const StructureAbstractValue& other)
- {
- if (isTop()) {
- m_structure = other.m_structure;
- return;
- }
- if (m_structure == other.m_structure)
- return;
- if (other.isTop())
- return;
- m_structure = 0;
- }
-
- void filter(SpeculatedType other)
- {
- if (!(other & SpecCell)) {
- clear();
- return;
- }
-
- if (isClearOrTop())
- return;
-
- if (!(speculationFromStructure(m_structure) & other))
- m_structure = 0;
- }
-
- bool isClear() const
- {
- return !m_structure;
- }
-
- bool isTop() const { return m_structure == topValue(); }
-
- bool isClearOrTop() const { return m_structure <= topValue(); }
- bool isNeitherClearNorTop() const { return !isClearOrTop(); }
-
- size_t size() const
- {
- ASSERT(!isTop());
- return !!m_structure;
- }
-
- Structure* at(size_t i) const
- {
- ASSERT(!isTop());
- ASSERT(m_structure);
- ASSERT_UNUSED(i, !i);
- return m_structure;
- }
-
- Structure* operator[](size_t i) const
- {
- return at(i);
- }
-
- Structure* last() const
- {
- return at(0);
- }
-
- SpeculatedType speculationFromStructures() const
- {
- if (isTop())
- return SpecCell;
- if (isClear())
- return SpecNone;
- return speculationFromStructure(m_structure);
- }
-
- bool operator==(const StructureAbstractValue& other) const
- {
- return m_structure == other.m_structure;
- }
-
- void dump(FILE* out) const
- {
- if (isTop()) {
- fprintf(out, "TOP");
- return;
- }
-
- fprintf(out, "[");
- if (m_structure)
- fprintf(out, "%p", m_structure);
- fprintf(out, "]");
- }
-
-private:
- static Structure* topValue() { return reinterpret_cast<Structure*>(1); }
-
- // This can only remember one structure at a time.
- Structure* m_structure;
-};
-
struct AbstractValue {
AbstractValue()
: m_type(SpecNone)
@@ -316,15 +46,15 @@ struct AbstractValue {
void clear()
{
m_type = SpecNone;
- m_structure.clear();
- m_unclobberedStructure.clear();
+ m_currentKnownStructure.clear();
+ m_futurePossibleStructure.clear();
m_value = JSValue();
checkConsistency();
}
bool isClear() const
{
- bool result = m_type == SpecNone && m_structure.isClear() && m_unclobberedStructure.isClear();
+ bool result = m_type == SpecNone && m_currentKnownStructure.isClear() && m_futurePossibleStructure.isClear();
if (result)
ASSERT(!m_value);
return result;
@@ -333,8 +63,8 @@ struct AbstractValue {
void makeTop()
{
m_type = SpecTop;
- m_structure.makeTop();
- m_unclobberedStructure.makeTop();
+ m_currentKnownStructure.makeTop();
+ m_futurePossibleStructure.makeTop();
m_value = JSValue();
checkConsistency();
}
@@ -342,9 +72,9 @@ struct AbstractValue {
void clobberStructures()
{
if (m_type & SpecCell)
- m_structure.makeTop();
+ m_currentKnownStructure.makeTop();
else
- ASSERT(m_structure.isClear());
+ ASSERT(m_currentKnownStructure.isClear());
checkConsistency();
}
@@ -355,7 +85,7 @@ struct AbstractValue {
bool isTop() const
{
- return m_type == SpecTop && m_structure.isTop() && m_unclobberedStructure.isTop();
+ return m_type == SpecTop && m_currentKnownStructure.isTop() && m_futurePossibleStructure.isTop();
}
bool valueIsTop() const
@@ -375,20 +105,29 @@ struct AbstractValue {
return result;
}
- void set(JSValue value)
+ void setFuturePossibleStructure(Structure* structure)
+ {
+ if (structure->transitionWatchpointSetIsStillValid())
+ m_futurePossibleStructure = structure;
+ else
+ m_futurePossibleStructure.makeTop();
+ }
+
+ void filterFuturePossibleStructure(Structure* structure)
+ {
+ if (structure->transitionWatchpointSetIsStillValid())
+ m_futurePossibleStructure.filter(StructureAbstractValue(structure));
+ }
+
+ void setMostSpecific(JSValue value)
{
if (!!value && value.isCell()) {
- // Have to be careful here! It's tempting to set the structure to the
- // value's structure, but that would be wrong, since that would
- // constitute a proof that this value will always have the same
- // structure. The whole point of a value having a structure is that
- // it may change in the future - for example between when we compile
- // the code and when we run it.
- m_structure.makeTop();
- m_unclobberedStructure.makeTop(); // FIXME: Consider not clobbering this.
+ Structure* structure = value.asCell()->structure();
+ m_currentKnownStructure = structure;
+ setFuturePossibleStructure(structure);
} else {
- m_structure.clear();
- m_unclobberedStructure.clear();
+ m_currentKnownStructure.clear();
+ m_futurePossibleStructure.clear();
}
m_type = speculationFromValue(value);
@@ -397,14 +136,26 @@ struct AbstractValue {
checkConsistency();
}
- void set(Structure* structure)
+ void set(JSValue value)
{
- m_structure.clear();
- m_structure.add(structure);
+ if (!!value && value.isCell()) {
+ m_currentKnownStructure.makeTop();
+ setFuturePossibleStructure(value.asCell()->structure());
+ } else {
+ m_currentKnownStructure.clear();
+ m_futurePossibleStructure.clear();
+ }
- m_unclobberedStructure.clear();
- m_unclobberedStructure.add(structure);
+ m_type = speculationFromValue(value);
+ m_value = value;
+ checkConsistency();
+ }
+
+ void set(Structure* structure)
+ {
+ m_currentKnownStructure = structure;
+ setFuturePossibleStructure(structure);
m_type = speculationFromStructure(structure);
m_value = JSValue();
@@ -414,11 +165,11 @@ struct AbstractValue {
void set(SpeculatedType type)
{
if (type & SpecCell) {
- m_structure.makeTop();
- m_unclobberedStructure.makeTop();
+ m_currentKnownStructure.makeTop();
+ m_futurePossibleStructure.makeTop();
} else {
- m_structure.clear();
- m_unclobberedStructure.clear();
+ m_currentKnownStructure.clear();
+ m_futurePossibleStructure.clear();
}
m_type = type;
m_value = JSValue();
@@ -428,8 +179,8 @@ struct AbstractValue {
bool operator==(const AbstractValue& other) const
{
return m_type == other.m_type
- && m_structure == other.m_structure
- && m_unclobberedStructure == other.m_unclobberedStructure
+ && m_currentKnownStructure == other.m_currentKnownStructure
+ && m_futurePossibleStructure == other.m_futurePossibleStructure
&& m_value == other.m_value;
}
bool operator!=(const AbstractValue& other) const
@@ -448,8 +199,8 @@ struct AbstractValue {
result = !other.isClear();
} else {
result |= mergeSpeculation(m_type, other.m_type);
- result |= m_structure.addAll(other.m_structure);
- result |= m_unclobberedStructure.addAll(other.m_unclobberedStructure);
+ result |= m_currentKnownStructure.addAll(other.m_currentKnownStructure);
+ result |= m_futurePossibleStructure.addAll(other.m_futurePossibleStructure);
if (m_value != other.m_value) {
result |= !!m_value;
m_value = JSValue();
@@ -465,8 +216,8 @@ struct AbstractValue {
mergeSpeculation(m_type, type);
if (type & SpecCell) {
- m_structure.makeTop();
- m_unclobberedStructure.makeTop();
+ m_currentKnownStructure.makeTop();
+ m_futurePossibleStructure.makeTop();
}
m_value = JSValue();
@@ -476,19 +227,21 @@ struct AbstractValue {
void filter(const StructureSet& other)
{
m_type &= other.speculationFromStructures();
- m_structure.filter(other);
- m_unclobberedStructure.filter(other);
+ m_currentKnownStructure.filter(other);
+ if (m_currentKnownStructure.isClear())
+ m_futurePossibleStructure.clear();
+ else if (m_currentKnownStructure.hasSingleton())
+ filterFuturePossibleStructure(m_currentKnownStructure.singleton());
// It's possible that prior to the above two statements we had (Foo, TOP), where
// Foo is a SpeculatedType that is disjoint with the passed StructureSet. In that
// case, we will now have (None, [someStructure]). In general, we need to make
// sure that new information gleaned from the SpeculatedType needs to be fed back
// into the information gleaned from the StructureSet.
- m_structure.filter(m_type);
- m_unclobberedStructure.filter(m_type);
+ m_currentKnownStructure.filter(m_type);
+ m_futurePossibleStructure.filter(m_type);
- if (!!m_value && !validateIgnoringValue(m_value))
- clear();
+ filterValueByType();
checkConsistency();
}
@@ -503,47 +256,38 @@ struct AbstractValue {
// the passed type is Array. At this point we'll have (None, TOP). The best way
// to ensure that the structure filtering does the right thing is to filter on
// the new type (None) rather than the one passed (Array).
- m_structure.filter(m_type);
- m_unclobberedStructure.filter(m_type);
+ m_currentKnownStructure.filter(m_type);
+ m_futurePossibleStructure.filter(m_type);
- if (!!m_value && !validateIgnoringValue(m_value))
- clear();
+ filterValueByType();
checkConsistency();
}
- bool validateIgnoringValue(JSValue value) const
+ // We could go further, and ensure that if the futurePossibleStructure contravenes
+ // the value, then we could clear both of those things. But that's unlikely to help
+ // in any realistic scenario, so we don't do it. Simpler is better.
+ void filterValueByType()
{
- if (isTop())
- return true;
-
- if (mergeSpeculations(m_type, speculationFromValue(value)) != m_type)
- return false;
-
- if (value.isEmpty()) {
- ASSERT(m_type & SpecEmpty);
- return true;
- }
-
- if (m_structure.isTop())
- return true;
-
- if (!!value && value.isCell()) {
- ASSERT(m_type & SpecCell);
- return m_structure.contains(value.asCell()->structure());
+ if (!!m_type) {
+ // The type is still non-empty. This implies that regardless of what filtering
+ // was done, we either didn't have a value to begin with, or that value is still
+ // valid.
+ ASSERT(!m_value || validateType(m_value));
+ return;
}
- return true;
+ // The type has been rendered empty. That means that the value must now be invalid,
+ // as well.
+ ASSERT(!m_value || !validateType(m_value));
+ m_value = JSValue();
}
- bool validate(JSValue value) const
+ bool validateType(JSValue value) const
{
if (isTop())
return true;
- if (!!m_value && m_value != value)
- return false;
-
if (mergeSpeculations(m_type, speculationFromValue(value)) != m_type)
return false;
@@ -552,18 +296,10 @@ struct AbstractValue {
return true;
}
- if (m_structure.isTop())
- return true;
-
- if (!!value && value.isCell()) {
- ASSERT(m_type & SpecCell);
- return m_structure.contains(value.asCell()->structure());
- }
-
return true;
}
- bool validateForEntry(JSValue value) const
+ bool validate(JSValue value) const
{
if (isTop())
return true;
@@ -579,12 +315,11 @@ struct AbstractValue {
return true;
}
- if (m_unclobberedStructure.isTop())
- return true;
-
if (!!value && value.isCell()) {
ASSERT(m_type & SpecCell);
- return m_unclobberedStructure.contains(value.asCell()->structure());
+ Structure* structure = value.asCell()->structure();
+ return m_currentKnownStructure.contains(structure)
+ && m_futurePossibleStructure.contains(structure);
}
return true;
@@ -593,8 +328,8 @@ struct AbstractValue {
void checkConsistency() const
{
if (!(m_type & SpecCell)) {
- ASSERT(m_structure.isClear());
- ASSERT(m_unclobberedStructure.isClear());
+ ASSERT(m_currentKnownStructure.isClear());
+ ASSERT(m_futurePossibleStructure.isClear());
}
if (isClear())
@@ -612,17 +347,102 @@ struct AbstractValue {
void dump(FILE* out) const
{
fprintf(out, "(%s, ", speculationToString(m_type));
- m_structure.dump(out);
+ m_currentKnownStructure.dump(out);
dataLog(", ");
- m_unclobberedStructure.dump(out);
+ m_futurePossibleStructure.dump(out);
if (!!m_value)
fprintf(out, ", %s", m_value.description());
fprintf(out, ")");
}
+
+ // A great way to think about the difference between m_currentKnownStructure and
+ // m_futurePossibleStructure is to consider these four examples:
+ //
+ // 1) x = foo();
+ //
+ // In this case x's m_currentKnownStructure and m_futurePossibleStructure will
+ // both be TOP, since we don't know anything about x for sure, yet.
+ //
+ // 2) x = foo();
+ // y = x.f;
+ //
+ // Where x will later have a new property added to it, 'g'. Because of the
+ // known but not-yet-executed property addition, x's currently structure will
+ // not be watchpointable; hence we have no way of statically bounding the set
+ // of possible structures that x may have if a clobbering event happens. So,
+ // x's m_currentKnownStructure will be whatever structure we check to get
+ // property 'f', and m_futurePossibleStructure will be TOP.
+ //
+ // 3) x = foo();
+ // y = x.f;
+ //
+ // Where x has a terminal structure that is still watchpointable. In this case,
+ // x's m_currentKnownStructure and m_futurePossibleStructure will both be
+ // whatever structure we checked for when getting 'f'.
+ //
+ // 4) x = foo();
+ // y = x.f;
+ // bar();
+ //
+ // Where x has a terminal structure that is still watchpointable. In this
+ // case, m_currentKnownStructure will be TOP because bar() may potentially
+ // change x's structure and we have no way of proving otherwise, but
+ // x's m_futurePossibleStructure will be whatever structure we had checked
+ // when getting property 'f'.
- StructureAbstractValue m_structure;
- StructureAbstractValue m_unclobberedStructure;
+ // This is a proven constraint on the structures that this value can have right
+ // now. The structure of the current value must belong to this set. The set may
+ // be TOP, indicating that it is the set of all possible structures, in which
+ // case the current value can have any structure. The set may be BOTTOM (empty)
+ // in which case this value cannot be a cell. This is all subject to change
+ // anytime a new value is assigned to this one, anytime there is a control flow
+ // merge, or most crucially, anytime a side-effect or structure check happens.
+ // In case of a side-effect, we typically must assume that any value may have
+ // had its structure changed, hence contravening our proof. We make the proof
+ // valid again by switching this to TOP (i.e. claiming that we have proved that
+ // this value may have any structure). Of note is that the proof represented by
+ // this field is not subject to structure transition watchpoints - even if one
+ // fires, we can be sure that this proof is still valid.
+ StructureAbstractValue m_currentKnownStructure;
+
+ // This is a proven constraint on the structures that this value can have now
+ // or any time in the future subject to the structure transition watchpoints of
+ // all members of this set not having fired. This set is impervious to side-
+ // effects; even if one happens the side-effect can only cause the value to
+ // change to at worst another structure that is also a member of this set. But,
+ // the theorem being proved by this field is predicated upon there not being
+ // any new structure transitions introduced into any members of this set. In
+ // cases where there is no way for us to guard this happening, the set must be
+ // TOP. But in cases where we can guard new structure transitions (all members
+ // of the set have still-valid structure transition watchpoints) then this set
+ // will be finite. Anytime that we make use of the finite nature of this set,
+ // we must first issue a structure transition watchpoint, which will effectively
+ // result in m_currentKnownStructure being filtered according to
+ // m_futurePossibleStructure.
+ StructureAbstractValue m_futurePossibleStructure;
+
+ // This is a proven constraint on the possible types that this value can have
+ // now or any time in the future, unless it is reassigned. This field is
+ // impervious to side-effects unless the side-effect can reassign the value
+ // (for example if we're talking about a captured variable). The relationship
+ // between this field, and the structure fields above, is as follows. The
+ // fields above constraint the structures that a cell may have, but they say
+ // nothing about whether or not the value is known to be a cell. More formally,
+ // the m_currentKnownStructure is itself an abstract value that consists of the
+ // union of the set of all non-cell values and the set of cell values that have
+ // the given structure. This abstract value is then the intersection of the
+ // m_currentKnownStructure and the set of values whose type is m_type. So, for
+ // example if m_type is SpecFinal|SpecInt32 and m_currentKnownStructure is
+ // [0x12345] then this abstract value corresponds to the set of all integers
+ // unified with the set of all objects with structure 0x12345.
SpeculatedType m_type;
+
+ // This is a proven constraint on the possible values that this value can
+ // have now or any time in the future, unless it is reassigned. Note that this
+ // implies nothing about the structure. Oddly, JSValue() (i.e. the empty value)
+ // means either BOTTOM or TOP depending on the state of m_type: if m_type is
+ // BOTTOM then JSValue() means BOTTOM; if m_type is not BOTTOM then JSValue()
+ // means TOP.
JSValue m_value;
};
diff --git a/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp b/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp
index 9208cde1b..000e1a938 100644
--- a/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp
@@ -317,6 +317,17 @@ public:
// PhantomArguments and OSR exit will still do the right things.
break;
+ case CheckStructure:
+ case ForwardCheckStructure:
+ case StructureTransitionWatchpoint:
+ case ForwardStructureTransitionWatchpoint:
+ // We don't care about these because if we get uses of the relevant
+ // variable then we can safely get rid of these, too. This of course
+ // relies on there not being any information transferred by the CFA
+ // from a CheckStructure on one variable to the information about the
+ // structures of another variable.
+ break;
+
default:
observeBadArgumentsUses(node);
break;
@@ -471,6 +482,19 @@ public:
break;
}
+ case CheckStructure:
+ case ForwardCheckStructure:
+ case StructureTransitionWatchpoint:
+ case ForwardStructureTransitionWatchpoint: {
+ // We can just get rid of this node, if it references a phantom argument.
+ if (!isOKToOptimize(m_graph[node.child1()]))
+ break;
+ m_graph.deref(node.child1());
+ node.setOpAndDefaultFlags(Phantom);
+ node.children.setChild1(Edge());
+ break;
+ }
+
case GetByVal: {
if (!node.prediction()
|| !m_graph[node.child1()].prediction()
diff --git a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
index b7f48aa4b..f7536f87f 100644
--- a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
+++ b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
@@ -118,7 +118,7 @@ private:
template<PhiStackType stackType>
void processPhiStack();
- void fixVariableAccessSpeculations();
+ void fixVariableAccessPredictions();
// Add spill locations to nodes.
void allocateVirtualRegisters();
@@ -2149,6 +2149,10 @@ bool ByteCodeParser::parseBlock(unsigned limit)
NodeIndex base = get(currentInstruction[2].u.operand);
NodeIndex property = get(currentInstruction[3].u.operand);
+ ArrayProfile* profile = currentInstruction[4].u.arrayProfile;
+ profile->computeUpdatedPrediction();
+ if (profile->hasDefiniteStructure())
+ addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(profile->expectedStructure())), base);
NodeIndex propertyStorage = addToGraph(GetIndexedPropertyStorage, base, property);
NodeIndex getByVal = addToGraph(GetByVal, OpInfo(0), OpInfo(prediction), base, property, propertyStorage);
set(currentInstruction[1].u.operand, getByVal);
@@ -2160,6 +2164,15 @@ bool ByteCodeParser::parseBlock(unsigned limit)
NodeIndex base = get(currentInstruction[1].u.operand);
NodeIndex property = get(currentInstruction[2].u.operand);
NodeIndex value = get(currentInstruction[3].u.operand);
+
+ ArrayProfile* profile = currentInstruction[4].u.arrayProfile;
+ profile->computeUpdatedPrediction();
+ if (profile->hasDefiniteStructure())
+ addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(profile->expectedStructure())), base);
+
+#if DFG_ENABLE(DEBUG_PROPAGATION_VERBOSE)
+ dataLog("Slow case profile for bc#%u: %u\n", m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter);
+#endif
bool makeSafe =
m_inlineStackTop->m_profiledBlock->couldTakeSlowCase(m_currentIndex)
@@ -3017,7 +3030,7 @@ void ByteCodeParser::processPhiStack()
}
}
-void ByteCodeParser::fixVariableAccessSpeculations()
+void ByteCodeParser::fixVariableAccessPredictions()
{
for (unsigned i = 0; i < m_graph.m_variableAccessData.size(); ++i) {
VariableAccessData* data = &m_graph.m_variableAccessData[i];
@@ -3349,7 +3362,27 @@ bool ByteCodeParser::parse()
m_graph.m_blocks[blockIndex].clear();
}
- fixVariableAccessSpeculations();
+ fixVariableAccessPredictions();
+
+ for (BlockIndex blockIndex = 0; blockIndex < m_graph.m_blocks.size(); ++blockIndex) {
+ BasicBlock* block = m_graph.m_blocks[blockIndex].get();
+ if (!block)
+ continue;
+ if (!block->isOSRTarget)
+ continue;
+ if (block->bytecodeBegin != m_graph.m_osrEntryBytecodeIndex)
+ continue;
+ for (size_t i = 0; i < m_graph.m_mustHandleValues.size(); ++i) {
+ NodeIndex nodeIndex = block->variablesAtHead.operand(
+ m_graph.m_mustHandleValues.operandForIndex(i));
+ if (nodeIndex == NoNode)
+ continue;
+ Node& node = m_graph[nodeIndex];
+ ASSERT(node.hasLocal());
+ node.variableAccessData()->predict(
+ speculationFromValue(m_graph.m_mustHandleValues[i]));
+ }
+ }
m_graph.m_preservedVars = m_preservedVars;
m_graph.m_localVars = m_numLocals;
diff --git a/Source/JavaScriptCore/dfg/DFGCFGSimplificationPhase.cpp b/Source/JavaScriptCore/dfg/DFGCFGSimplificationPhase.cpp
index dc1632dc4..f054707e2 100644
--- a/Source/JavaScriptCore/dfg/DFGCFGSimplificationPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGCFGSimplificationPhase.cpp
@@ -613,7 +613,9 @@ private:
ASSERT(node.shouldGenerate());
Node& possibleLocalOp = m_graph[node.child1()];
- if (possibleLocalOp.hasLocal() && !possibleLocalOp.variableAccessData()->isCaptured()) {
+ if (possibleLocalOp.op() != GetLocal
+ && possibleLocalOp.hasLocal()
+ && !possibleLocalOp.variableAccessData()->isCaptured()) {
NodeIndex setLocalIndex =
firstBlock->variablesAtTail.operand(possibleLocalOp.local());
Node& setLocal = m_graph[setLocalIndex];
diff --git a/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp b/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
index e9b1e0d8b..b78ddc89d 100644
--- a/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
@@ -345,6 +345,7 @@ private:
break;
case StructureTransitionWatchpoint:
+ case ForwardStructureTransitionWatchpoint:
if (node.child1() == child1
&& structureSet.contains(node.structure()))
return true;
@@ -418,6 +419,7 @@ private:
return false;
case StructureTransitionWatchpoint:
+ case ForwardStructureTransitionWatchpoint:
if (node.structure() == structure && node.child1() == child1)
return true;
break;
@@ -843,6 +845,8 @@ private:
// At this point we will eliminate all references to this node.
m_replacements[m_compileIndex] = replacement;
+ m_changed = true;
+
return true;
}
@@ -856,6 +860,8 @@ private:
ASSERT(node.refCount() == 1);
ASSERT(node.mustGenerate());
node.setOpAndDefaultFlags(Phantom);
+
+ m_changed = true;
}
void eliminate(NodeIndex nodeIndex, NodeType phantomType = Phantom)
@@ -867,6 +873,8 @@ private:
return;
ASSERT(node.mustGenerate());
node.setOpAndDefaultFlags(phantomType);
+
+ m_changed = true;
}
void performNodeCSE(Node& node)
@@ -944,7 +952,7 @@ private:
case GetLocal: {
VariableAccessData* variableAccessData = node.variableAccessData();
- if (m_fixpointState == FixpointNotConverged && !variableAccessData->isCaptured())
+ if (!variableAccessData->isCaptured())
break;
NodeIndex relevantLocalOp;
NodeIndex possibleReplacement = getLocalLoadElimination(variableAccessData->local(), relevantLocalOp, variableAccessData->isCaptured());
@@ -982,7 +990,7 @@ private:
case GetLocalUnlinked: {
NodeIndex relevantLocalOpIgnored;
- m_changed |= setReplacement(getLocalLoadElimination(node.unlinkedLocal(), relevantLocalOpIgnored, true));
+ setReplacement(getLocalLoadElimination(node.unlinkedLocal(), relevantLocalOpIgnored, true));
break;
}
@@ -1117,6 +1125,7 @@ private:
break;
case StructureTransitionWatchpoint:
+ case ForwardStructureTransitionWatchpoint:
if (structureTransitionWatchpointElimination(node.structure(), node.child1().index()))
eliminate();
break;
diff --git a/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp b/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
index a8eb9ee5c..68d5534e0 100644
--- a/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
@@ -91,7 +91,16 @@ private:
break;
}
- // FIXME: This would be a great place to remove CheckStructure's.
+ case CheckStructure:
+ case ForwardCheckStructure: {
+ AbstractValue& value = m_state.forNode(node.child1());
+ StructureAbstractValue& structureValue = value.m_futurePossibleStructure;
+ if (structureValue.isSubsetOf(node.structureSet())
+ && structureValue.hasSingleton()
+ && isCellSpeculation(value.m_type))
+ node.convertToStructureTransitionWatchpoint(structureValue.singleton());
+ break;
+ }
default:
break;
@@ -103,9 +112,7 @@ private:
}
m_state.execute(indexInBlock);
- if (!node.shouldGenerate()
- || m_state.didClobber()
- || node.hasConstant())
+ if (!node.shouldGenerate() || m_state.didClobber() || node.hasConstant())
continue;
JSValue value = m_state.forNode(nodeIndex).value();
if (!value)
diff --git a/Source/JavaScriptCore/dfg/DFGDriver.cpp b/Source/JavaScriptCore/dfg/DFGDriver.cpp
index ddad4f864..ccef65208 100644
--- a/Source/JavaScriptCore/dfg/DFGDriver.cpp
+++ b/Source/JavaScriptCore/dfg/DFGDriver.cpp
@@ -26,6 +26,10 @@
#include "config.h"
#include "DFGDriver.h"
+#include "JSObject.h"
+#include "JSString.h"
+#include "ScopeChain.h"
+
#if ENABLE(DFG_JIT)
#include "DFGArgumentsSimplificationPhase.h"
@@ -53,7 +57,7 @@ unsigned getNumCompilations()
}
enum CompileMode { CompileFunction, CompileOther };
-inline bool compile(CompileMode compileMode, ExecState* exec, CodeBlock* codeBlock, JITCode& jitCode, MacroAssemblerCodePtr* jitCodeWithArityCheck)
+inline bool compile(CompileMode compileMode, ExecState* exec, CodeBlock* codeBlock, JITCode& jitCode, MacroAssemblerCodePtr* jitCodeWithArityCheck, unsigned osrEntryBytecodeIndex)
{
SamplingRegion samplingRegion("DFG Compilation (Driver)");
@@ -62,6 +66,8 @@ inline bool compile(CompileMode compileMode, ExecState* exec, CodeBlock* codeBlo
ASSERT(codeBlock);
ASSERT(codeBlock->alternative());
ASSERT(codeBlock->alternative()->getJITType() == JITCode::BaselineJIT);
+
+ ASSERT(osrEntryBytecodeIndex != UINT_MAX);
if (!Options::useDFGJIT())
return false;
@@ -70,7 +76,30 @@ inline bool compile(CompileMode compileMode, ExecState* exec, CodeBlock* codeBlo
dataLog("DFG compiling code block %p(%p) for executable %p, number of instructions = %u.\n", codeBlock, codeBlock->alternative(), codeBlock->ownerExecutable(), codeBlock->instructionCount());
#endif
- Graph dfg(exec->globalData(), codeBlock);
+ // Derive our set of must-handle values. The compilation must be at least conservative
+ // enough to allow for OSR entry with these values.
+ unsigned numVarsWithValues;
+ if (osrEntryBytecodeIndex)
+ numVarsWithValues = codeBlock->m_numVars;
+ else
+ numVarsWithValues = 0;
+ Operands<JSValue> mustHandleValues(codeBlock->numParameters(), numVarsWithValues);
+ for (size_t i = 0; i < mustHandleValues.size(); ++i) {
+ int operand = mustHandleValues.operandForIndex(i);
+ if (operandIsArgument(operand)
+ && !operandToArgument(operand)
+ && compileMode == CompileFunction
+ && codeBlock->specializationKind() == CodeForConstruct) {
+ // Ugh. If we're in a constructor, the 'this' argument may hold garbage. It will
+ // also never be used. It doesn't matter what we put into the value for this,
+ // but it has to be an actual value that can be grokked by subsequent DFG passes,
+ // so we sanitize it here by turning it into Undefined.
+ mustHandleValues[i] = jsUndefined();
+ } else
+ mustHandleValues[i] = exec->uncheckedR(operand).jsValue();
+ }
+
+ Graph dfg(exec->globalData(), codeBlock, osrEntryBytecodeIndex, mustHandleValues);
if (!parse(exec, dfg))
return false;
@@ -86,6 +115,7 @@ inline bool compile(CompileMode compileMode, ExecState* exec, CodeBlock* codeBlo
validate(dfg);
performPredictionPropagation(dfg);
performFixup(dfg);
+ performStructureCheckHoisting(dfg);
unsigned cnt = 1;
for (;; ++cnt) {
#if DFG_ENABLE(DEBUG_VERBOSE)
@@ -102,10 +132,7 @@ inline bool compile(CompileMode compileMode, ExecState* exec, CodeBlock* codeBlo
dfg.resetExitStates();
performFixup(dfg);
}
- bool shouldRedoCFA = performStructureCheckHoisting(dfg);
performCSE(dfg, FixpointConverged);
- if (shouldRedoCFA)
- performCFA(dfg);
#if DFG_ENABLE(DEBUG_VERBOSE)
dataLog("DFG optimization fixpoint converged in %u iterations.\n", cnt);
#endif
@@ -135,14 +162,14 @@ inline bool compile(CompileMode compileMode, ExecState* exec, CodeBlock* codeBlo
return result;
}
-bool tryCompile(ExecState* exec, CodeBlock* codeBlock, JITCode& jitCode)
+bool tryCompile(ExecState* exec, CodeBlock* codeBlock, JITCode& jitCode, unsigned bytecodeIndex)
{
- return compile(CompileOther, exec, codeBlock, jitCode, 0);
+ return compile(CompileOther, exec, codeBlock, jitCode, 0, bytecodeIndex);
}
-bool tryCompileFunction(ExecState* exec, CodeBlock* codeBlock, JITCode& jitCode, MacroAssemblerCodePtr& jitCodeWithArityCheck)
+bool tryCompileFunction(ExecState* exec, CodeBlock* codeBlock, JITCode& jitCode, MacroAssemblerCodePtr& jitCodeWithArityCheck, unsigned bytecodeIndex)
{
- return compile(CompileFunction, exec, codeBlock, jitCode, &jitCodeWithArityCheck);
+ return compile(CompileFunction, exec, codeBlock, jitCode, &jitCodeWithArityCheck, bytecodeIndex);
}
} } // namespace JSC::DFG
diff --git a/Source/JavaScriptCore/dfg/DFGDriver.h b/Source/JavaScriptCore/dfg/DFGDriver.h
index a6e82fef5..1964ec34a 100644
--- a/Source/JavaScriptCore/dfg/DFGDriver.h
+++ b/Source/JavaScriptCore/dfg/DFGDriver.h
@@ -41,11 +41,11 @@ namespace DFG {
JS_EXPORT_PRIVATE unsigned getNumCompilations();
#if ENABLE(DFG_JIT)
-bool tryCompile(ExecState*, CodeBlock*, JITCode&);
-bool tryCompileFunction(ExecState*, CodeBlock*, JITCode&, MacroAssemblerCodePtr& jitCodeWithArityCheck);
+bool tryCompile(ExecState*, CodeBlock*, JITCode&, unsigned bytecodeIndex);
+bool tryCompileFunction(ExecState*, CodeBlock*, JITCode&, MacroAssemblerCodePtr& jitCodeWithArityCheck, unsigned bytecodeIndex);
#else
-inline bool tryCompile(ExecState*, CodeBlock*, JITCode&) { return false; }
-inline bool tryCompileFunction(ExecState*, CodeBlock*, JITCode&, MacroAssemblerCodePtr&) { return false; }
+inline bool tryCompile(ExecState*, CodeBlock*, JITCode&, unsigned) { return false; }
+inline bool tryCompileFunction(ExecState*, CodeBlock*, JITCode&, MacroAssemblerCodePtr&, unsigned) { return false; }
#endif
} } // namespace JSC::DFG
diff --git a/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp b/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
index 4e3cd5782..f7b10fc43 100644
--- a/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
@@ -96,9 +96,29 @@ private:
#if DFG_ENABLE(DEBUG_PROPAGATION_VERBOSE)
dataLog(" @%u -> %s", m_compileIndex, isArray ? "GetArrayLength" : "GetStringLength");
#endif
- if (isArray)
+ if (isArray) {
node.setOp(GetArrayLength);
- else if (isArguments)
+ ASSERT(node.flags() & NodeMustGenerate);
+ node.clearFlags(NodeMustGenerate);
+ m_graph.deref(m_compileIndex);
+
+ ArrayProfile* arrayProfile =
+ m_graph.baselineCodeBlockFor(node.codeOrigin)->getArrayProfile(
+ node.codeOrigin.bytecodeIndex);
+ if (!arrayProfile)
+ break;
+ arrayProfile->computeUpdatedPrediction();
+ if (!arrayProfile->hasDefiniteStructure())
+ break;
+ m_graph.ref(node.child1());
+ Node checkStructure(CheckStructure, node.codeOrigin, OpInfo(m_graph.addStructureSet(arrayProfile->expectedStructure())), node.child1().index());
+ checkStructure.ref();
+ NodeIndex checkStructureIndex = m_graph.size();
+ m_graph.append(checkStructure);
+ m_insertionSet.append(m_indexInBlock, checkStructureIndex);
+ break;
+ }
+ if (isArguments)
node.setOp(GetArgumentsLength);
else if (isString)
node.setOp(GetStringLength);
@@ -129,10 +149,9 @@ private:
break;
}
case GetIndexedPropertyStorage: {
- SpeculatedType basePrediction = m_graph[node.child2()].prediction();
- if ((!(basePrediction & SpecInt32) && basePrediction)
- || m_graph[node.child1()].shouldSpeculateArguments()
- || !isActionableArraySpeculation(m_graph[node.child1()].prediction())) {
+ if (!m_graph[node.child1()].prediction()
+ || !m_graph[node.child2()].shouldSpeculateInteger()
+ || m_graph[node.child1()].shouldSpeculateArguments()) {
node.setOpAndDefaultFlags(Nop);
m_graph.clearAndDerefChild1(node);
m_graph.clearAndDerefChild2(node);
diff --git a/Source/JavaScriptCore/dfg/DFGGraph.h b/Source/JavaScriptCore/dfg/DFGGraph.h
index fdb78cf9b..8d164a299 100644
--- a/Source/JavaScriptCore/dfg/DFGGraph.h
+++ b/Source/JavaScriptCore/dfg/DFGGraph.h
@@ -76,11 +76,13 @@ struct ResolveGlobalData {
// Nodes that are 'dead' remain in the vector with refCount 0.
class Graph : public Vector<Node, 64> {
public:
- Graph(JSGlobalData& globalData, CodeBlock* codeBlock)
+ Graph(JSGlobalData& globalData, CodeBlock* codeBlock, unsigned osrEntryBytecodeIndex, const Operands<JSValue>& mustHandleValues)
: m_globalData(globalData)
, m_codeBlock(codeBlock)
, m_profiledBlock(codeBlock->alternative())
, m_hasArguments(false)
+ , m_osrEntryBytecodeIndex(osrEntryBytecodeIndex)
+ , m_mustHandleValues(mustHandleValues)
{
ASSERT(m_profiledBlock);
}
@@ -137,6 +139,20 @@ public:
edge = newEdge;
}
+ void compareAndSwap(Edge& edge, NodeIndex oldIndex, NodeIndex newIndex, bool changeRef)
+ {
+ if (edge.index() != oldIndex)
+ return;
+ changeIndex(edge, newIndex, changeRef);
+ }
+
+ void compareAndSwap(Edge& edge, Edge oldEdge, Edge newEdge, bool changeRef)
+ {
+ if (edge != oldEdge)
+ return;
+ changeEdge(edge, newEdge, changeRef);
+ }
+
void clearAndDerefChild1(Node& node)
{
if (!node.child1())
@@ -614,6 +630,69 @@ public:
vote(node.child3(), ballot);
}
+ template<typename T> // T = NodeIndex or Edge
+ void substitute(BasicBlock& block, unsigned startIndexInBlock, T oldThing, T newThing)
+ {
+ for (unsigned indexInBlock = startIndexInBlock; indexInBlock < block.size(); ++indexInBlock) {
+ NodeIndex nodeIndex = block[indexInBlock];
+ Node& node = at(nodeIndex);
+ if (node.flags() & NodeHasVarArgs) {
+ for (unsigned childIdx = node.firstChild(); childIdx < node.firstChild() + node.numChildren(); ++childIdx)
+ compareAndSwap(m_varArgChildren[childIdx], oldThing, newThing, node.shouldGenerate());
+ continue;
+ }
+ if (!node.child1())
+ continue;
+ compareAndSwap(node.children.child1(), oldThing, newThing, node.shouldGenerate());
+ if (!node.child2())
+ continue;
+ compareAndSwap(node.children.child2(), oldThing, newThing, node.shouldGenerate());
+ if (!node.child3())
+ continue;
+ compareAndSwap(node.children.child3(), oldThing, newThing, node.shouldGenerate());
+ }
+ }
+
+ // Use this if you introduce a new GetLocal and you know that you introduced it *before*
+ // any GetLocals in the basic block.
+ // FIXME: it may be appropriate, in the future, to generalize this to handle GetLocals
+ // introduced anywhere in the basic block.
+ void substituteGetLocal(BasicBlock& block, unsigned startIndexInBlock, VariableAccessData* variableAccessData, NodeIndex newGetLocal)
+ {
+ if (variableAccessData->isCaptured()) {
+ // Let CSE worry about this one.
+ return;
+ }
+ for (unsigned indexInBlock = startIndexInBlock; indexInBlock < block.size(); ++indexInBlock) {
+ NodeIndex nodeIndex = block[indexInBlock];
+ Node& node = at(nodeIndex);
+ bool shouldContinue = true;
+ switch (node.op()) {
+ case SetLocal: {
+ if (node.local() == variableAccessData->local())
+ shouldContinue = false;
+ break;
+ }
+
+ case GetLocal: {
+ if (node.variableAccessData() != variableAccessData)
+ continue;
+ substitute(block, indexInBlock, nodeIndex, newGetLocal);
+ NodeIndex oldTailIndex = block.variablesAtTail.operand(variableAccessData->local());
+ if (oldTailIndex == nodeIndex)
+ block.variablesAtTail.operand(variableAccessData->local()) = newGetLocal;
+ shouldContinue = false;
+ break;
+ }
+
+ default:
+ break;
+ }
+ if (!shouldContinue)
+ break;
+ }
+ }
+
JSGlobalData& m_globalData;
CodeBlock* m_codeBlock;
CodeBlock* m_profiledBlock;
@@ -633,6 +712,8 @@ public:
Dominators m_dominators;
unsigned m_localVars;
unsigned m_parameterSlots;
+ unsigned m_osrEntryBytecodeIndex;
+ Operands<JSValue> m_mustHandleValues;
private:
void handleSuccessor(Vector<BlockIndex, 16>& worklist, BlockIndex blockIndex, BlockIndex successorIndex);
diff --git a/Source/JavaScriptCore/dfg/DFGNode.h b/Source/JavaScriptCore/dfg/DFGNode.h
index 60cdd4b50..dac855be0 100644
--- a/Source/JavaScriptCore/dfg/DFGNode.h
+++ b/Source/JavaScriptCore/dfg/DFGNode.h
@@ -245,11 +245,19 @@ struct Node {
children.reset();
}
+ void convertToStructureTransitionWatchpoint(Structure* structure)
+ {
+ ASSERT(m_op == CheckStructure || m_op == ForwardCheckStructure);
+ m_opInfo = bitwise_cast<uintptr_t>(structure);
+ if (m_op == CheckStructure)
+ m_op = StructureTransitionWatchpoint;
+ else
+ m_op = ForwardStructureTransitionWatchpoint;
+ }
+
void convertToStructureTransitionWatchpoint()
{
- ASSERT(m_op == CheckStructure);
- m_opInfo = bitwise_cast<uintptr_t>(structureSet().singletonStructure());
- m_op = StructureTransitionWatchpoint;
+ convertToStructureTransitionWatchpoint(structureSet().singletonStructure());
}
JSCell* weakConstant()
@@ -675,7 +683,13 @@ struct Node {
bool hasStructure()
{
- return op() == StructureTransitionWatchpoint;
+ switch (op()) {
+ case StructureTransitionWatchpoint:
+ case ForwardStructureTransitionWatchpoint:
+ return true;
+ default:
+ return false;
+ }
}
Structure* structure()
diff --git a/Source/JavaScriptCore/dfg/DFGNodeType.h b/Source/JavaScriptCore/dfg/DFGNodeType.h
index 7657663a9..f0f8cb1d0 100644
--- a/Source/JavaScriptCore/dfg/DFGNodeType.h
+++ b/Source/JavaScriptCore/dfg/DFGNodeType.h
@@ -133,6 +133,7 @@ namespace JSC { namespace DFG {
/* the object's structure does not need to be rechecked due to side-effecting */\
/* (clobbering) operations. */\
macro(StructureTransitionWatchpoint, NodeMustGenerate) \
+ macro(ForwardStructureTransitionWatchpoint, NodeMustGenerate) \
macro(PutStructure, NodeMustGenerate) \
macro(PhantomPutStructure, NodeMustGenerate | NodeDoesNotExit) \
macro(AllocatePropertyStorage, NodeMustGenerate | NodeDoesNotExit | NodeResultStorage) \
diff --git a/Source/JavaScriptCore/dfg/DFGOSREntry.cpp b/Source/JavaScriptCore/dfg/DFGOSREntry.cpp
index 97061bfb2..9a7bc96cc 100644
--- a/Source/JavaScriptCore/dfg/DFGOSREntry.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOSREntry.cpp
@@ -99,7 +99,7 @@ void* prepareOSREntry(ExecState* exec, CodeBlock* codeBlock, unsigned bytecodeIn
else
value = exec->argument(argument - 1);
- if (!entry->m_expectedValues.argument(argument).validateForEntry(value)) {
+ if (!entry->m_expectedValues.argument(argument).validate(value)) {
#if ENABLE(JIT_VERBOSE_OSR)
dataLog(" OSR failed because argument %zu is %s, expected ", argument, value.description());
entry->m_expectedValues.argument(argument).dump(WTF::dataFile());
@@ -119,7 +119,7 @@ void* prepareOSREntry(ExecState* exec, CodeBlock* codeBlock, unsigned bytecodeIn
}
continue;
}
- if (!entry->m_expectedValues.local(local).validateForEntry(exec->registers()[local].jsValue())) {
+ if (!entry->m_expectedValues.local(local).validate(exec->registers()[local].jsValue())) {
#if ENABLE(JIT_VERBOSE_OSR)
dataLog(" OSR failed because variable %zu is %s, expected ", local, exec->registers()[local].jsValue().description());
entry->m_expectedValues.local(local).dump(WTF::dataFile());
diff --git a/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp b/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
index 94f69abc2..1247528e8 100644
--- a/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
@@ -675,6 +675,7 @@ private:
case CheckStructure:
case ForwardCheckStructure:
case StructureTransitionWatchpoint:
+ case ForwardStructureTransitionWatchpoint:
case CheckFunction:
case PutStructure:
case TearOffActivation:
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
index f17e2d7e4..6c6615716 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
@@ -119,11 +119,8 @@ JumpReplacementWatchpoint* SpeculativeJIT::speculationWatchpoint(ExitKind kind)
return speculationWatchpoint(kind, JSValueSource(), NoNode);
}
-void SpeculativeJIT::forwardSpeculationCheck(ExitKind kind, JSValueSource jsValueSource, NodeIndex nodeIndex, MacroAssembler::Jump jumpToFail, const ValueRecovery& valueRecovery)
+void SpeculativeJIT::convertLastOSRExitToForward(const ValueRecovery& valueRecovery)
{
- ASSERT(at(m_compileIndex).canExit() || m_isCheckingArgumentTypes);
- speculationCheck(kind, jsValueSource, nodeIndex, jumpToFail);
-
#if !ASSERT_DISABLED
if (!valueRecovery) {
// Check that the preceding node was a SetLocal with the same code origin.
@@ -155,6 +152,10 @@ void SpeculativeJIT::forwardSpeculationCheck(ExitKind kind, JSValueSource jsValu
ASSERT(setLocal->codeOrigin == at(m_compileIndex).codeOrigin);
Node* nextNode = &at(m_jit.graph().m_blocks[m_block]->at(setLocalIndexInBlock + 1));
+ if (nextNode->op() == Jump && nextNode->codeOrigin == at(m_compileIndex).codeOrigin) {
+ // We're at an inlined return. Use a backward speculation instead.
+ return;
+ }
ASSERT(nextNode->codeOrigin != at(m_compileIndex).codeOrigin);
OSRExit& exit = m_jit.codeBlock()->lastOSRExit();
@@ -167,6 +168,28 @@ void SpeculativeJIT::forwardSpeculationCheck(ExitKind kind, JSValueSource jsValu
new ValueRecoveryOverride(setLocal->local(), valueRecovery));
}
+JumpReplacementWatchpoint* SpeculativeJIT::forwardSpeculationWatchpoint(ExitKind kind)
+{
+ JumpReplacementWatchpoint* result = speculationWatchpoint(kind);
+ convertLastOSRExitToForward();
+ return result;
+}
+
+JumpReplacementWatchpoint* SpeculativeJIT::speculationWatchpointWithConditionalDirection(ExitKind kind, bool isForward)
+{
+ JumpReplacementWatchpoint* result = speculationWatchpoint(kind);
+ if (isForward)
+ convertLastOSRExitToForward();
+ return result;
+}
+
+void SpeculativeJIT::forwardSpeculationCheck(ExitKind kind, JSValueSource jsValueSource, NodeIndex nodeIndex, MacroAssembler::Jump jumpToFail, const ValueRecovery& valueRecovery)
+{
+ ASSERT(at(m_compileIndex).canExit() || m_isCheckingArgumentTypes);
+ speculationCheck(kind, jsValueSource, nodeIndex, jumpToFail);
+ convertLastOSRExitToForward(valueRecovery);
+}
+
void SpeculativeJIT::forwardSpeculationCheck(ExitKind kind, JSValueSource jsValueSource, NodeIndex nodeIndex, MacroAssembler::JumpList& jumpsToFail, const ValueRecovery& valueRecovery)
{
ASSERT(at(m_compileIndex).canExit() || m_isCheckingArgumentTypes);
@@ -246,6 +269,24 @@ void SpeculativeJIT::clearGenerationInfo()
m_fprs = RegisterBank<FPRInfo>();
}
+void SpeculativeJIT::speculateArray(Edge edge, GPRReg baseReg)
+{
+ AbstractValue& arrayValue = m_state.forNode(edge);
+ if (arrayValue.m_currentKnownStructure.hasSingleton()
+ && arrayValue.m_currentKnownStructure.singleton()->classInfo() == &JSArray::s_info)
+ return;
+
+ GPRTemporary temp(this);
+ m_jit.loadPtr(
+ MacroAssembler::Address(baseReg, JSCell::structureOffset()), temp.gpr());
+ speculationCheck(
+ Uncountable, JSValueRegs(), NoNode,
+ m_jit.branchPtr(
+ MacroAssembler::NotEqual,
+ MacroAssembler::Address(temp.gpr(), Structure::classInfoOffset()),
+ MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
+}
+
GPRReg SpeculativeJIT::fillStorage(NodeIndex nodeIndex)
{
Node& node = m_jit.graph()[nodeIndex];
@@ -1220,7 +1261,7 @@ void SpeculativeJIT::compile(BasicBlock& block)
valueSource = ValueSource(DoubleInRegisterFile);
else if (isInt32Speculation(argumentPosition.prediction()))
valueSource = ValueSource(Int32InRegisterFile);
- else if (isArraySpeculation(argumentPosition.prediction()) || isCellSpeculation(argumentPosition.prediction()))
+ else if (isCellSpeculation(argumentPosition.prediction()))
valueSource = ValueSource(CellInRegisterFile);
else if (isBooleanSpeculation(argumentPosition.prediction()))
valueSource = ValueSource(BooleanInRegisterFile);
@@ -1343,12 +1384,7 @@ void SpeculativeJIT::checkArgumentTypes()
#if USE(JSVALUE64)
if (isInt32Speculation(predictedType))
speculationCheck(BadType, valueSource, nodeIndex, m_jit.branchPtr(MacroAssembler::Below, JITCompiler::addressFor(virtualRegister), GPRInfo::tagTypeNumberRegister));
- else if (isArraySpeculation(predictedType)) {
- GPRTemporary temp(this);
- m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), temp.gpr());
- speculationCheck(BadType, valueSource, nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister));
- speculationCheck(BadType, valueSource, nodeIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr(), JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
- } else if (isBooleanSpeculation(predictedType)) {
+ else if (isBooleanSpeculation(predictedType)) {
GPRTemporary temp(this);
m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), temp.gpr());
m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), temp.gpr());
@@ -1403,13 +1439,7 @@ void SpeculativeJIT::checkArgumentTypes()
#else
if (isInt32Speculation(predictedType))
speculationCheck(BadType, valueSource, nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, JITCompiler::tagFor(virtualRegister), TrustedImm32(JSValue::Int32Tag)));
- else if (isArraySpeculation(predictedType)) {
- GPRTemporary temp(this);
- m_jit.load32(JITCompiler::tagFor(virtualRegister), temp.gpr());
- speculationCheck(BadType, valueSource, nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag)));
- m_jit.load32(JITCompiler::payloadFor(virtualRegister), temp.gpr());
- speculationCheck(BadType, valueSource, nodeIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr(), JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
- } else if (isBooleanSpeculation(predictedType))
+ else if (isBooleanSpeculation(predictedType))
speculationCheck(BadType, valueSource, nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, JITCompiler::tagFor(virtualRegister), TrustedImm32(JSValue::BooleanTag)));
else if (isInt8ArraySpeculation(predictedType)) {
GPRTemporary temp(this);
@@ -1591,7 +1621,6 @@ void SpeculativeJIT::compileGetByValOnString(Node& node)
GPRReg storageReg = storage.gpr();
if (!isStringSpeculation(m_state.forNode(node.child1()).m_type)) {
- ASSERT(!(at(node.child1()).prediction() & SpecString));
terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode);
noResult(m_compileIndex);
return;
@@ -3037,22 +3066,12 @@ bool SpeculativeJIT::compileStrictEq(Node& node)
void SpeculativeJIT::compileGetIndexedPropertyStorage(Node& node)
{
- if (!node.prediction() || !at(node.child1()).prediction() || !at(node.child2()).prediction()) {
- terminateSpeculativeExecution(InadequateCoverage, JSValueRegs(), NoNode);
- return;
- }
+ ASSERT(at(node.child1()).prediction());
+ ASSERT(at(node.child2()).shouldSpeculateInteger());
SpeculateCellOperand base(this, node.child1());
GPRReg baseReg = base.gpr();
- SpeculatedType basePrediction = at(node.child2()).prediction();
- if (!(basePrediction & SpecInt32) && basePrediction) {
- ASSERT_NOT_REACHED();
- terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode);
- noResult(m_compileIndex);
- return;
- }
-
GPRTemporary storage(this);
GPRReg storageReg = storage.gpr();
if (at(node.child1()).shouldSpeculateArguments()) {
@@ -3113,8 +3132,7 @@ void SpeculativeJIT::compileGetIndexedPropertyStorage(Node& node)
speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(descriptor.m_classInfo)));
m_jit.loadPtr(MacroAssembler::Address(baseReg, descriptor.m_storageOffset), storageReg);
} else {
- if (!isArraySpeculation(m_state.forNode(node.child1()).m_type))
- speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
+ speculateArray(node.child1(), baseReg);
m_jit.loadPtr(MacroAssembler::Address(baseReg, JSArray::storageOffset()), storageReg);
}
storageResult(storageReg, m_compileIndex);
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
index 96f2fec0a..073dbb42c 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
@@ -2181,6 +2181,10 @@ public:
// act of firing a watchpoint invalidates it. So, future recompilations will not
// attempt to set this watchpoint again.
JumpReplacementWatchpoint* speculationWatchpoint(ExitKind = UncountableWatchpoint);
+
+ // It is generally a good idea to not use this directly.
+ void convertLastOSRExitToForward(const ValueRecovery& = ValueRecovery());
+
// Note: not specifying the valueRecovery argument (leaving it as ValueRecovery()) implies
// that you've ensured that there exists a MovHint prior to your use of forwardSpeculationCheck().
void forwardSpeculationCheck(ExitKind, JSValueSource, NodeIndex, MacroAssembler::Jump jumpToFail, const ValueRecovery& = ValueRecovery());
@@ -2190,6 +2194,12 @@ public:
void terminateSpeculativeExecution(ExitKind, JSValueRegs, NodeIndex);
void terminateSpeculativeExecution(ExitKind, JSValueRegs, Edge);
void terminateSpeculativeExecutionWithConditionalDirection(ExitKind, JSValueRegs, NodeIndex, bool isForward);
+ // Issue a forward speculation watchpoint, which will exit to the next instruction rather
+ // than the current one.
+ JumpReplacementWatchpoint* forwardSpeculationWatchpoint(ExitKind = UncountableWatchpoint);
+ JumpReplacementWatchpoint* speculationWatchpointWithConditionalDirection(ExitKind, bool isForward);
+
+ void speculateArray(Edge baseEdge, GPRReg baseReg);
template<bool strict>
GPRReg fillSpeculateIntInternal(NodeIndex, DataFormat& returnFormat);
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
index bf3503d6d..7a9ba1e41 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
@@ -1530,7 +1530,7 @@ void SpeculativeJIT::compileObjectToObjectOrOtherEquality(
// We know that within this branch, rightChild must not be a cell. Check if that is enough to
// prove that it is either null or undefined.
- if (!isOtherSpeculation(m_state.forNode(rightChild).m_type & ~SpecCell)) {
+ if (!isOtherOrEmptySpeculation(m_state.forNode(rightChild).m_type & ~SpecCell)) {
m_jit.move(op2TagGPR, resultGPR);
m_jit.or32(TrustedImm32(1), resultGPR);
@@ -1602,7 +1602,7 @@ void SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality(
// We know that within this branch, rightChild must not be a cell. Check if that is enough to
// prove that it is either null or undefined.
- if (isOtherSpeculation(m_state.forNode(rightChild).m_type & ~SpecCell))
+ if (isOtherOrEmptySpeculation(m_state.forNode(rightChild).m_type & ~SpecCell))
rightNotCell.link(&m_jit);
else {
jump(notTaken, ForceJump);
@@ -1918,7 +1918,7 @@ void SpeculativeJIT::compile(Node& node)
break;
}
- if (isArraySpeculation(value.m_type) || isCellSpeculation(value.m_type)) {
+ if (isCellSpeculation(value.m_type)) {
GPRTemporary result(this);
m_jit.load32(JITCompiler::payloadFor(node.local()), result.gpr());
@@ -2036,16 +2036,6 @@ void SpeculativeJIT::compile(Node& node)
recordSetLocal(node.local(), ValueSource(Int32InRegisterFile));
break;
}
- if (isArraySpeculation(predictedType)) {
- SpeculateCellOperand cell(this, node.child1());
- GPRReg cellGPR = cell.gpr();
- if (!isArraySpeculation(m_state.forNode(node.child1()).m_type))
- speculationCheck(BadType, JSValueSource::unboxedCell(cellGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(cellGPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
- m_jit.storePtr(cellGPR, JITCompiler::payloadFor(node.local()));
- noResult(m_compileIndex);
- recordSetLocal(node.local(), ValueSource(CellInRegisterFile));
- break;
- }
if (isCellSpeculation(predictedType)) {
SpeculateCellOperand cell(this, node.child1());
GPRReg cellGPR = cell.gpr();
@@ -2356,7 +2346,7 @@ void SpeculativeJIT::compile(Node& node)
break;
}
- if (!at(node.child2()).shouldSpeculateInteger() || !isActionableArraySpeculation(at(node.child1()).prediction())) {
+ if (!at(node.child2()).shouldSpeculateInteger() || (!node.child3() && !at(node.child1()).shouldSpeculateArguments())) {
SpeculateCellOperand base(this, node.child1()); // Save a register, speculate cell. We'll probably be right.
JSValueOperand property(this, node.child2());
GPRReg baseGPR = base.gpr();
@@ -2449,8 +2439,6 @@ void SpeculativeJIT::compile(Node& node)
break;
}
- ASSERT(at(node.child1()).shouldSpeculateArray());
-
SpeculateStrictInt32Operand property(this, node.child2());
StorageOperand storage(this, node.child3());
GPRReg propertyReg = property.gpr();
@@ -2464,17 +2452,13 @@ void SpeculativeJIT::compile(Node& node)
{
SpeculateCellOperand base(this, node.child1());
GPRReg baseReg = base.gpr();
- if (!isArraySpeculation(m_state.forNode(node.child1()).m_type))
- speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
+ // We've already speculated that it's some kind of array, at this point.
speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(baseReg, JSArray::vectorLengthOffset())));
}
GPRTemporary resultTag(this);
GPRTemporary resultPayload(this);
- // FIXME: In cases where there are subsequent by_val accesses to the same base it might help to cache
- // the storage pointer - especially if there happens to be another register free right now. If we do so,
- // then we'll need to allocate a new temporary for result.
m_jit.load32(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), resultTag.gpr());
speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::Equal, resultTag.gpr(), TrustedImm32(JSValue::EmptyValueTag)));
m_jit.load32(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), resultPayload.gpr());
@@ -2495,7 +2479,6 @@ void SpeculativeJIT::compile(Node& node)
}
if (!at(child2).shouldSpeculateInteger()
- || !isActionableMutableArraySpeculation(at(child1).prediction())
|| at(child1).shouldSpeculateArguments()) {
SpeculateCellOperand base(this, child1); // Save a register, speculate cell. We'll probably be right.
JSValueOperand property(this, child2);
@@ -2578,27 +2561,23 @@ void SpeculativeJIT::compile(Node& node)
break;
}
- ASSERT(at(child1).shouldSpeculateArray());
-
JSValueOperand value(this, child3);
- GPRTemporary scratch(this);
-
// Map base, property & value into registers, allocate a scratch register.
GPRReg baseReg = base.gpr();
GPRReg propertyReg = property.gpr();
GPRReg valueTagReg = value.tagGPR();
GPRReg valuePayloadReg = value.payloadGPR();
- GPRReg scratchReg = scratch.gpr();
if (!m_compileOkay)
return;
-
- writeBarrier(baseReg, valueTagReg, child3, WriteBarrierForPropertyAccess, scratchReg);
- // Check that base is an array, and that property is contained within m_vector (< m_vectorLength).
- // If we have predicted the base to be type array, we can skip the check.
- if (!isArraySpeculation(m_state.forNode(child1).m_type))
- speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), child1, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
+ {
+ GPRTemporary scratch(this);
+ GPRReg scratchReg = scratch.gpr();
+ writeBarrier(baseReg, valueTagReg, child3, WriteBarrierForPropertyAccess, scratchReg);
+ }
+
+ speculateArray(child1, baseReg);
MacroAssembler::Jump beyondArrayBounds = m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(baseReg, JSArray::vectorLengthOffset()));
if (node.op() == PutByVal)
@@ -2609,7 +2588,8 @@ void SpeculativeJIT::compile(Node& node)
value.use();
// Get the array storage.
- GPRReg storageReg = scratchReg;
+ GPRTemporary storage(this);
+ GPRReg storageReg = storage.gpr();
m_jit.loadPtr(MacroAssembler::Address(baseReg, JSArray::storageOffset()), storageReg);
// Check if we're writing to a hole; if so increment m_numValuesInVector.
@@ -2795,20 +2775,23 @@ void SpeculativeJIT::compile(Node& node)
case ArrayPush: {
SpeculateCellOperand base(this, node.child1());
JSValueOperand value(this, node.child2());
- GPRTemporary storage(this);
GPRTemporary storageLength(this);
GPRReg baseGPR = base.gpr();
GPRReg valueTagGPR = value.tagGPR();
GPRReg valuePayloadGPR = value.payloadGPR();
- GPRReg storageGPR = storage.gpr();
GPRReg storageLengthGPR = storageLength.gpr();
- writeBarrier(baseGPR, valueTagGPR, node.child2(), WriteBarrierForPropertyAccess, storageGPR, storageLengthGPR);
+ {
+ GPRTemporary scratch(this);
+ writeBarrier(baseGPR, valueTagGPR, node.child2(), WriteBarrierForPropertyAccess, scratch.gpr(), storageLengthGPR);
+ }
- if (!isArraySpeculation(m_state.forNode(node.child1()).m_type))
- speculationCheck(BadType, JSValueSource::unboxedCell(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
+ speculateArray(node.child1(), baseGPR);
+ GPRTemporary storage(this);
+ GPRReg storageGPR = storage.gpr();
+
m_jit.loadPtr(MacroAssembler::Address(baseGPR, JSArray::storageOffset()), storageGPR);
m_jit.load32(MacroAssembler::Address(storageGPR, OBJECT_OFFSETOF(ArrayStorage, m_length)), storageLengthGPR);
@@ -2844,8 +2827,7 @@ void SpeculativeJIT::compile(Node& node)
GPRReg storageGPR = storage.gpr();
GPRReg storageLengthGPR = storageLength.gpr();
- if (!isArraySpeculation(m_state.forNode(node.child1()).m_type))
- speculationCheck(BadType, JSValueSource::unboxedCell(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
+ speculateArray(node.child1(), baseGPR);
m_jit.loadPtr(MacroAssembler::Address(baseGPR, JSArray::storageOffset()), storageGPR);
m_jit.load32(MacroAssembler::Address(storageGPR, OBJECT_OFFSETOF(ArrayStorage, m_length)), storageLengthGPR);
@@ -3395,8 +3377,7 @@ void SpeculativeJIT::compile(Node& node)
SpeculateCellOperand base(this, node.child1());
GPRReg baseGPR = base.gpr();
- if (!isArraySpeculation(m_state.forNode(node.child1()).m_type))
- speculationCheck(BadType, JSValueSource::unboxedCell(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
+ speculateArray(node.child1(), baseGPR);
GPRTemporary result(this);
GPRReg resultGPR = result.gpr();
@@ -3478,7 +3459,7 @@ void SpeculativeJIT::compile(Node& node)
case CheckStructure:
case ForwardCheckStructure: {
AbstractValue& value = m_state.forNode(node.child1());
- if (value.m_structure.isSubsetOf(node.structureSet())
+ if (value.m_currentKnownStructure.isSubsetOf(node.structureSet())
&& isCellSpeculation(value.m_type)) {
noResult(m_compileIndex);
break;
@@ -3519,9 +3500,12 @@ void SpeculativeJIT::compile(Node& node)
break;
}
- case StructureTransitionWatchpoint: {
+ case StructureTransitionWatchpoint:
+ case ForwardStructureTransitionWatchpoint: {
m_jit.addWeakReference(node.structure());
- node.structure()->addTransitionWatchpoint(speculationWatchpoint(BadCache));
+ node.structure()->addTransitionWatchpoint(
+ speculationWatchpointWithConditionalDirection(
+ BadCache, node.op() == ForwardStructureTransitionWatchpoint));
#if !ASSERT_DISABLED
SpeculateCellOperand op1(this, node.child1());
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
index 5541113f2..c2151088c 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
@@ -2072,16 +2072,6 @@ void SpeculativeJIT::compile(Node& node)
recordSetLocal(node.local(), ValueSource(Int32InRegisterFile));
break;
}
- if (isArraySpeculation(predictedType)) {
- SpeculateCellOperand cell(this, node.child1());
- GPRReg cellGPR = cell.gpr();
- if (!isArraySpeculation(m_state.forNode(node.child1()).m_type))
- speculationCheck(BadType, JSValueRegs(cellGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(cellGPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
- m_jit.storePtr(cellGPR, JITCompiler::addressFor(node.local()));
- noResult(m_compileIndex);
- recordSetLocal(node.local(), ValueSource(CellInRegisterFile));
- break;
- }
if (isCellSpeculation(predictedType)) {
SpeculateCellOperand cell(this, node.child1());
GPRReg cellGPR = cell.gpr();
@@ -2389,7 +2379,7 @@ void SpeculativeJIT::compile(Node& node)
break;
}
- if (!at(node.child2()).shouldSpeculateInteger() || !isActionableArraySpeculation(at(node.child1()).prediction())) {
+ if (!at(node.child2()).shouldSpeculateInteger() || (!node.child3() && !at(node.child1()).shouldSpeculateArguments())) {
JSValueOperand base(this, node.child1());
JSValueOperand property(this, node.child2());
GPRReg baseGPR = base.gpr();
@@ -2480,8 +2470,6 @@ void SpeculativeJIT::compile(Node& node)
break;
}
- ASSERT(at(node.child1()).shouldSpeculateArray());
-
SpeculateCellOperand base(this, node.child1());
SpeculateStrictInt32Operand property(this, node.child2());
StorageOperand storage(this, node.child3());
@@ -2493,13 +2481,11 @@ void SpeculativeJIT::compile(Node& node)
if (!m_compileOkay)
return;
- if (!isArraySpeculation(m_state.forNode(node.child1()).m_type))
- speculationCheck(BadType, JSValueRegs(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
+ // We will have already speculated that the base is some kind of array,
+ // at this point.
+
speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(baseReg, JSArray::vectorLengthOffset())));
- // FIXME: In cases where there are subsequent by_val accesses to the same base it might help to cache
- // the storage pointer - especially if there happens to be another register free right now. If we do so,
- // then we'll need to allocate a new temporary for result.
GPRTemporary result(this);
m_jit.loadPtr(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), result.gpr());
speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::Zero, result.gpr()));
@@ -2519,7 +2505,7 @@ void SpeculativeJIT::compile(Node& node)
break;
}
- if (!at(child2).shouldSpeculateInteger() || !isActionableMutableArraySpeculation(at(child1).prediction())) {
+ if (!at(child2).shouldSpeculateInteger()) {
JSValueOperand arg1(this, child1);
JSValueOperand arg2(this, child2);
JSValueOperand arg3(this, child3);
@@ -2537,9 +2523,8 @@ void SpeculativeJIT::compile(Node& node)
SpeculateCellOperand base(this, child1);
SpeculateStrictInt32Operand property(this, child2);
if (at(child1).shouldSpeculateArguments()) {
+ dataLog(" in here ");
JSValueOperand value(this, child3);
- SpeculateCellOperand base(this, child1);
- SpeculateStrictInt32Operand property(this, child2);
GPRTemporary scratch(this);
GPRTemporary scratch2(this);
@@ -2656,8 +2641,6 @@ void SpeculativeJIT::compile(Node& node)
break;
}
- ASSERT(at(child1).shouldSpeculateArray());
-
JSValueOperand value(this, child3);
GPRTemporary scratch(this);
@@ -2672,11 +2655,8 @@ void SpeculativeJIT::compile(Node& node)
writeBarrier(baseReg, value.gpr(), child3, WriteBarrierForPropertyAccess, scratchReg);
- // Check that base is an array, and that property is contained within m_vector (< m_vectorLength).
- // If we have predicted the base to be type array, we can skip the check.
- if (!isArraySpeculation(m_state.forNode(child1).m_type))
- speculationCheck(BadType, JSValueRegs(baseReg), child1, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
-
+ speculateArray(child1, baseReg);
+
MacroAssembler::Jump beyondArrayBounds = m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(baseReg, JSArray::vectorLengthOffset()));
if (node.op() == PutByVal)
speculationCheck(OutOfBounds, JSValueRegs(), NoNode, beyondArrayBounds);
@@ -2879,9 +2859,8 @@ void SpeculativeJIT::compile(Node& node)
writeBarrier(baseGPR, valueGPR, node.child2(), WriteBarrierForPropertyAccess, storageGPR, storageLengthGPR);
- if (!isArraySpeculation(m_state.forNode(node.child1()).m_type))
- speculationCheck(BadType, JSValueRegs(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
-
+ speculateArray(node.child1(), baseGPR);
+
m_jit.loadPtr(MacroAssembler::Address(baseGPR, JSArray::storageOffset()), storageGPR);
m_jit.load32(MacroAssembler::Address(storageGPR, OBJECT_OFFSETOF(ArrayStorage, m_length)), storageLengthGPR);
@@ -2917,9 +2896,8 @@ void SpeculativeJIT::compile(Node& node)
GPRReg storageGPR = storage.gpr();
GPRReg storageLengthGPR = storageLength.gpr();
- if (!isArraySpeculation(m_state.forNode(node.child1()).m_type))
- speculationCheck(BadType, JSValueRegs(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
-
+ speculateArray(node.child1(), baseGPR);
+
m_jit.loadPtr(MacroAssembler::Address(baseGPR, JSArray::storageOffset()), storageGPR);
m_jit.load32(MacroAssembler::Address(storageGPR, OBJECT_OFFSETOF(ArrayStorage, m_length)), storageLengthGPR);
@@ -3415,9 +3393,8 @@ void SpeculativeJIT::compile(Node& node)
GPRReg baseGPR = base.gpr();
GPRReg resultGPR = result.gpr();
- if (!isArraySpeculation(m_state.forNode(node.child1()).m_type))
- speculationCheck(BadType, JSValueRegs(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
-
+ speculateArray(node.child1(), baseGPR);
+
m_jit.loadPtr(MacroAssembler::Address(baseGPR, JSArray::storageOffset()), resultGPR);
m_jit.load32(MacroAssembler::Address(resultGPR, OBJECT_OFFSETOF(ArrayStorage, m_length)), resultGPR);
@@ -3493,7 +3470,7 @@ void SpeculativeJIT::compile(Node& node)
case CheckStructure:
case ForwardCheckStructure: {
AbstractValue& value = m_state.forNode(node.child1());
- if (value.m_structure.isSubsetOf(node.structureSet())
+ if (value.m_currentKnownStructure.isSubsetOf(node.structureSet())
&& isCellSpeculation(value.m_type)) {
noResult(m_compileIndex);
break;
@@ -3534,9 +3511,12 @@ void SpeculativeJIT::compile(Node& node)
break;
}
- case StructureTransitionWatchpoint: {
+ case StructureTransitionWatchpoint:
+ case ForwardStructureTransitionWatchpoint: {
m_jit.addWeakReference(node.structure());
- node.structure()->addTransitionWatchpoint(speculationWatchpoint(BadCache));
+ node.structure()->addTransitionWatchpoint(
+ speculationWatchpointWithConditionalDirection(
+ BadCache, node.op() == ForwardStructureTransitionWatchpoint));
#if !ASSERT_DISABLED
SpeculateCellOperand op1(this, node.child1());
diff --git a/Source/JavaScriptCore/dfg/DFGStructureAbstractValue.h b/Source/JavaScriptCore/dfg/DFGStructureAbstractValue.h
new file mode 100644
index 000000000..b3082de1a
--- /dev/null
+++ b/Source/JavaScriptCore/dfg/DFGStructureAbstractValue.h
@@ -0,0 +1,327 @@
+/*
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DFGStructureAbstractValue_h
+#define DFGStructureAbstractValue_h
+
+#include <wtf/Platform.h>
+
+#if ENABLE(DFG_JIT)
+
+#include "JSCell.h"
+#include "SpeculatedType.h"
+#include "StructureSet.h"
+
+namespace JSC { namespace DFG {
+
+class StructureAbstractValue {
+public:
+ StructureAbstractValue()
+ : m_structure(0)
+ {
+ }
+
+ StructureAbstractValue(Structure* structure)
+ : m_structure(structure)
+ {
+ }
+
+ StructureAbstractValue(const StructureSet& set)
+ {
+ switch (set.size()) {
+ case 0:
+ m_structure = 0;
+ break;
+
+ case 1:
+ m_structure = set[0];
+ break;
+
+ default:
+ m_structure = topValue();
+ break;
+ }
+ }
+
+ void clear()
+ {
+ m_structure = 0;
+ }
+
+ void makeTop()
+ {
+ m_structure = topValue();
+ }
+
+ static StructureAbstractValue top()
+ {
+ StructureAbstractValue value;
+ value.makeTop();
+ return value;
+ }
+
+ void add(Structure* structure)
+ {
+ ASSERT(!contains(structure) && !isTop());
+ if (m_structure)
+ makeTop();
+ else
+ m_structure = structure;
+ }
+
+ bool addAll(const StructureSet& other)
+ {
+ if (isTop() || !other.size())
+ return false;
+ if (other.size() > 1) {
+ makeTop();
+ return true;
+ }
+ if (!m_structure) {
+ m_structure = other[0];
+ return true;
+ }
+ if (m_structure == other[0])
+ return false;
+ makeTop();
+ return true;
+ }
+
+ bool addAll(const StructureAbstractValue& other)
+ {
+ if (!other.m_structure)
+ return false;
+ if (isTop())
+ return false;
+ if (other.isTop()) {
+ makeTop();
+ return true;
+ }
+ if (m_structure) {
+ if (m_structure == other.m_structure)
+ return false;
+ makeTop();
+ return true;
+ }
+ m_structure = other.m_structure;
+ return true;
+ }
+
+ bool contains(Structure* structure) const
+ {
+ if (isTop())
+ return true;
+ if (m_structure == structure)
+ return true;
+ return false;
+ }
+
+ bool isSubsetOf(const StructureSet& other) const
+ {
+ if (isTop())
+ return false;
+ if (!m_structure)
+ return true;
+ return other.contains(m_structure);
+ }
+
+ bool doesNotContainAnyOtherThan(Structure* structure) const
+ {
+ if (isTop())
+ return false;
+ if (!m_structure)
+ return true;
+ return m_structure == structure;
+ }
+
+ bool isSupersetOf(const StructureSet& other) const
+ {
+ if (isTop())
+ return true;
+ if (!other.size())
+ return true;
+ if (other.size() > 1)
+ return false;
+ return m_structure == other[0];
+ }
+
+ bool isSubsetOf(const StructureAbstractValue& other) const
+ {
+ if (other.isTop())
+ return true;
+ if (isTop())
+ return false;
+ if (m_structure) {
+ if (other.m_structure)
+ return m_structure == other.m_structure;
+ return false;
+ }
+ return true;
+ }
+
+ bool isSupersetOf(const StructureAbstractValue& other) const
+ {
+ return other.isSubsetOf(*this);
+ }
+
+ void filter(const StructureSet& other)
+ {
+ if (!m_structure)
+ return;
+
+ if (isTop()) {
+ switch (other.size()) {
+ case 0:
+ m_structure = 0;
+ return;
+
+ case 1:
+ m_structure = other[0];
+ return;
+
+ default:
+ return;
+ }
+ }
+
+ if (other.contains(m_structure))
+ return;
+
+ m_structure = 0;
+ }
+
+ void filter(const StructureAbstractValue& other)
+ {
+ if (isTop()) {
+ m_structure = other.m_structure;
+ return;
+ }
+ if (m_structure == other.m_structure)
+ return;
+ if (other.isTop())
+ return;
+ m_structure = 0;
+ }
+
+ void filter(SpeculatedType other)
+ {
+ if (!(other & SpecCell)) {
+ clear();
+ return;
+ }
+
+ if (isClearOrTop())
+ return;
+
+ if (!(speculationFromStructure(m_structure) & other))
+ m_structure = 0;
+ }
+
+ bool isClear() const
+ {
+ return !m_structure;
+ }
+
+ bool isTop() const { return m_structure == topValue(); }
+
+ bool isClearOrTop() const { return m_structure <= topValue(); }
+ bool isNeitherClearNorTop() const { return !isClearOrTop(); }
+
+ size_t size() const
+ {
+ ASSERT(!isTop());
+ return !!m_structure;
+ }
+
+ Structure* at(size_t i) const
+ {
+ ASSERT(!isTop());
+ ASSERT(m_structure);
+ ASSERT_UNUSED(i, !i);
+ return m_structure;
+ }
+
+ Structure* operator[](size_t i) const
+ {
+ return at(i);
+ }
+
+ Structure* last() const
+ {
+ return at(0);
+ }
+
+ SpeculatedType speculationFromStructures() const
+ {
+ if (isTop())
+ return SpecCell;
+ if (isClear())
+ return SpecNone;
+ return speculationFromStructure(m_structure);
+ }
+
+ bool hasSingleton() const
+ {
+ return isNeitherClearNorTop();
+ }
+
+ Structure* singleton() const
+ {
+ ASSERT(isNeitherClearNorTop());
+ return m_structure;
+ }
+
+ bool operator==(const StructureAbstractValue& other) const
+ {
+ return m_structure == other.m_structure;
+ }
+
+ void dump(FILE* out) const
+ {
+ if (isTop()) {
+ fprintf(out, "TOP");
+ return;
+ }
+
+ fprintf(out, "[");
+ if (m_structure)
+ fprintf(out, "%p", m_structure);
+ fprintf(out, "]");
+ }
+
+private:
+ static Structure* topValue() { return reinterpret_cast<Structure*>(1); }
+
+ // This can only remember one structure at a time.
+ Structure* m_structure;
+};
+
+} } // namespace JSC::DFG
+
+#endif // ENABLE(DFG_JIT)
+
+#endif // DFGStructureAbstractValue_h
+
+
diff --git a/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp b/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp
index e86c57dff..68627f95c 100644
--- a/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp
@@ -82,6 +82,7 @@ public:
}
case ForwardCheckStructure:
+ case ForwardStructureTransitionWatchpoint:
// We currently rely on the fact that we're the only ones who would
// insert this node.
ASSERT_NOT_REACHED();
@@ -94,6 +95,12 @@ public:
case AllocatePropertyStorage:
case ReallocatePropertyStorage:
case GetPropertyStorage:
+ case GetByVal:
+ case PutByVal:
+ case PutByValAlias:
+ case PutByValSafe:
+ case GetArrayLength:
+ case Phantom:
// Don't count these uses.
break;
@@ -215,17 +222,22 @@ public:
break;
case PutByVal:
- case PutByValAlias: {
+ case PutByValAlias:
+ case PutByValSafe: {
Edge child1 = m_graph.varArgChild(node, 0);
Edge child2 = m_graph.varArgChild(node, 1);
if (!m_graph[child1].prediction() || !m_graph[child2].prediction())
break;
- if (!m_graph[child2].shouldSpeculateInteger() || !isActionableMutableArraySpeculation(m_graph[child1].prediction())) {
+ if (!m_graph[child2].shouldSpeculateInteger()
+#if USE(JSVALUE32_64)
+ || m_graph[child1].shouldSpeculateArguments()
+#endif
+ ) {
clobber(live);
break;
}
- if (node.op() == PutByValAlias)
+ if (node.op() != PutByValSafe)
break;
if (m_graph[child1].shouldSpeculateArguments())
break;
@@ -291,7 +303,7 @@ public:
dataLog("Hoisting checks for %s\n", m_graph.nameOfVariableAccessData(it->first));
}
#endif // DFG_ENABLE(DEBUG_PROPAGATION_VERBOSE)
-
+
// Make changes:
// 1) If a variable's live range does not span a clobber, then inject structure
// checks before the SetLocal.
@@ -348,6 +360,8 @@ public:
if (block->variablesAtTail.operand(variable->local()) == nodeIndex)
block->variablesAtTail.operand(variable->local()) = getLocalIndex;
+ m_graph.substituteGetLocal(*block, indexInBlock, variable, getLocalIndex);
+
changed = true;
break;
}
diff --git a/Source/JavaScriptCore/interpreter/Interpreter.cpp b/Source/JavaScriptCore/interpreter/Interpreter.cpp
index 51f22bedd..a9118f43b 100644
--- a/Source/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/Source/JavaScriptCore/interpreter/Interpreter.cpp
@@ -712,7 +712,7 @@ bool Interpreter::isOpcode(Opcode opcode)
#if ENABLE(COMPUTED_GOTO_CLASSIC_INTERPRETER) || ENABLE(LLINT)
#if !ENABLE(LLINT)
if (!m_classicEnabled)
- return opcode >= 0 && static_cast<OpcodeID>(bitwise_cast<uintptr_t>(opcode)) <= op_end;
+ return static_cast<OpcodeID>(bitwise_cast<uintptr_t>(opcode)) <= op_end;
#endif
return opcode != HashTraits<Opcode>::emptyValue()
&& !HashTraits<Opcode>::isDeletedValue(opcode)
diff --git a/Source/JavaScriptCore/jit/JITDriver.h b/Source/JavaScriptCore/jit/JITDriver.h
index 6c50f4bd1..7b5cc28eb 100644
--- a/Source/JavaScriptCore/jit/JITDriver.h
+++ b/Source/JavaScriptCore/jit/JITDriver.h
@@ -38,7 +38,7 @@
namespace JSC {
template<typename CodeBlockType>
-inline bool jitCompileIfAppropriate(ExecState* exec, OwnPtr<CodeBlockType>& codeBlock, JITCode& jitCode, JITCode::JITType jitType, JITCompilationEffort effort)
+inline bool jitCompileIfAppropriate(ExecState* exec, OwnPtr<CodeBlockType>& codeBlock, JITCode& jitCode, JITCode::JITType jitType, unsigned bytecodeIndex, JITCompilationEffort effort)
{
JSGlobalData& globalData = exec->globalData();
@@ -54,7 +54,7 @@ inline bool jitCompileIfAppropriate(ExecState* exec, OwnPtr<CodeBlockType>& code
bool dfgCompiled = false;
if (jitType == JITCode::DFGJIT)
- dfgCompiled = DFG::tryCompile(exec, codeBlock.get(), jitCode);
+ dfgCompiled = DFG::tryCompile(exec, codeBlock.get(), jitCode, bytecodeIndex);
if (dfgCompiled) {
if (codeBlock->alternative())
codeBlock->alternative()->unlinkIncomingCalls();
@@ -75,7 +75,7 @@ inline bool jitCompileIfAppropriate(ExecState* exec, OwnPtr<CodeBlockType>& code
return true;
}
-inline bool jitCompileFunctionIfAppropriate(ExecState* exec, OwnPtr<FunctionCodeBlock>& codeBlock, JITCode& jitCode, MacroAssemblerCodePtr& jitCodeWithArityCheck, SharedSymbolTable*& symbolTable, JITCode::JITType jitType, JITCompilationEffort effort)
+inline bool jitCompileFunctionIfAppropriate(ExecState* exec, OwnPtr<FunctionCodeBlock>& codeBlock, JITCode& jitCode, MacroAssemblerCodePtr& jitCodeWithArityCheck, SharedSymbolTable*& symbolTable, JITCode::JITType jitType, unsigned bytecodeIndex, JITCompilationEffort effort)
{
JSGlobalData& globalData = exec->globalData();
@@ -92,7 +92,7 @@ inline bool jitCompileFunctionIfAppropriate(ExecState* exec, OwnPtr<FunctionCode
bool dfgCompiled = false;
if (jitType == JITCode::DFGJIT)
- dfgCompiled = DFG::tryCompileFunction(exec, codeBlock.get(), jitCode, jitCodeWithArityCheck);
+ dfgCompiled = DFG::tryCompileFunction(exec, codeBlock.get(), jitCode, jitCodeWithArityCheck, bytecodeIndex);
if (dfgCompiled) {
if (codeBlock->alternative())
codeBlock->alternative()->unlinkIncomingCalls();
diff --git a/Source/JavaScriptCore/jit/JITPropertyAccess.cpp b/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
index dfb2dc8ec..16af9125b 100644
--- a/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
+++ b/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
@@ -110,7 +110,11 @@ void JIT::emit_op_get_by_val(Instruction* currentInstruction)
zeroExtend32ToPtr(regT1, regT1);
emitJumpSlowCaseIfNotJSCell(regT0, base);
- addSlowCase(branchPtr(NotEqual, Address(regT0, JSCell::classInfoOffset()), TrustedImmPtr(&JSArray::s_info)));
+ loadPtr(Address(regT0, JSCell::structureOffset()), regT2);
+#if ENABLE(VALUE_PROFILER)
+ storePtr(regT2, currentInstruction[4].u.arrayProfile->addressOfLastSeenStructure());
+#endif
+ addSlowCase(branchPtr(NotEqual, Address(regT2, Structure::classInfoOffset()), TrustedImmPtr(&JSArray::s_info)));
loadPtr(Address(regT0, JSArray::storageOffset()), regT2);
addSlowCase(branch32(AboveOrEqual, regT1, Address(regT0, JSArray::vectorLengthOffset())));
@@ -231,7 +235,11 @@ void JIT::emit_op_put_by_val(Instruction* currentInstruction)
// See comment in op_get_by_val.
zeroExtend32ToPtr(regT1, regT1);
emitJumpSlowCaseIfNotJSCell(regT0, base);
- addSlowCase(branchPtr(NotEqual, Address(regT0, JSCell::classInfoOffset()), TrustedImmPtr(&JSArray::s_info)));
+ loadPtr(Address(regT0, JSCell::structureOffset()), regT2);
+#if ENABLE(VALUE_PROFILER)
+ storePtr(regT2, currentInstruction[4].u.arrayProfile->addressOfLastSeenStructure());
+#endif
+ addSlowCase(branchPtr(NotEqual, Address(regT2, Structure::classInfoOffset()), TrustedImmPtr(&JSArray::s_info)));
addSlowCase(branch32(AboveOrEqual, regT1, Address(regT0, JSArray::vectorLengthOffset())));
loadPtr(Address(regT0, JSArray::storageOffset()), regT2);
@@ -645,7 +653,11 @@ void JIT::privateCompilePatchGetArrayLength(ReturnAddressPtr returnAddress)
StructureStubInfo* stubInfo = &m_codeBlock->getStubInfo(returnAddress);
// Check eax is an array
- Jump failureCases1 = branchPtr(NotEqual, Address(regT0, JSCell::classInfoOffset()), TrustedImmPtr(&JSArray::s_info));
+ loadPtr(Address(regT0, JSCell::structureOffset()), regT3);
+#if ENABLE(VALUE_PROFILER)
+ storePtr(regT3, m_codeBlock->getOrAddArrayProfile(stubInfo->bytecodeIndex)->addressOfLastSeenStructure());
+#endif
+ Jump failureCases1 = branchPtr(NotEqual, Address(regT3, Structure::classInfoOffset()), TrustedImmPtr(&JSArray::s_info));
// Checks out okay! - get the length from the storage
loadPtr(Address(regT0, JSArray::storageOffset()), regT3);
diff --git a/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp b/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
index b506f4ecb..6ef25046f 100644
--- a/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
+++ b/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
@@ -209,7 +209,11 @@ void JIT::emit_op_get_by_val(Instruction* currentInstruction)
addSlowCase(branch32(NotEqual, regT3, TrustedImm32(JSValue::Int32Tag)));
emitJumpSlowCaseIfNotJSCell(base, regT1);
- addSlowCase(branchPtr(NotEqual, Address(regT0, JSCell::classInfoOffset()), TrustedImmPtr(&JSArray::s_info)));
+ loadPtr(Address(regT0, JSCell::structureOffset()), regT1);
+#if ENABLE(VALUE_PROFILER)
+ storePtr(regT1, currentInstruction[4].u.arrayProfile->addressOfLastSeenStructure());
+#endif
+ addSlowCase(branchPtr(NotEqual, Address(regT1, JSCell::classInfoOffset()), TrustedImmPtr(&JSArray::s_info)));
loadPtr(Address(regT0, JSArray::storageOffset()), regT3);
addSlowCase(branch32(AboveOrEqual, regT2, Address(regT0, JSArray::vectorLengthOffset())));
@@ -264,7 +268,11 @@ void JIT::emit_op_put_by_val(Instruction* currentInstruction)
addSlowCase(branch32(NotEqual, regT3, TrustedImm32(JSValue::Int32Tag)));
emitJumpSlowCaseIfNotJSCell(base, regT1);
- addSlowCase(branchPtr(NotEqual, Address(regT0, JSCell::classInfoOffset()), TrustedImmPtr(&JSArray::s_info)));
+ loadPtr(Address(regT0, JSCell::structureOffset()), regT1);
+#if ENABLE(VALUE_PROFILER)
+ storePtr(regT1, currentInstruction[4].u.arrayProfile->addressOfLastSeenStructure());
+#endif
+ addSlowCase(branchPtr(NotEqual, Address(regT1, Structure::classInfoOffset()), TrustedImmPtr(&JSArray::s_info)));
addSlowCase(branch32(AboveOrEqual, regT2, Address(regT0, JSArray::vectorLengthOffset())));
emitWriteBarrier(regT0, regT1, regT1, regT3, UnconditionalWriteBarrier, WriteBarrierForPropertyAccess);
@@ -608,7 +616,11 @@ void JIT::privateCompilePatchGetArrayLength(ReturnAddressPtr returnAddress)
// regT0 holds a JSCell*
// Check for array
- Jump failureCases1 = branchPtr(NotEqual, Address(regT0, JSCell::classInfoOffset()), TrustedImmPtr(&JSArray::s_info));
+ loadPtr(Address(regT0, JSCell::structureOffset()), regT2);
+#if ENABLE(VALUE_PROFILER)
+ storePtr(regT2, m_codeBlock->getOrAddArrayProfile(stubInfo->bytecodeIndex)->addressOfLastSeenStructure());
+#endif
+ Jump failureCases1 = branchPtr(NotEqual, Address(regT2, Structure::classInfoOffset()), TrustedImmPtr(&JSArray::s_info));
// Checks out okay! - get the length from the storage
loadPtr(Address(regT0, JSArray::storageOffset()), regT2);
diff --git a/Source/JavaScriptCore/jit/JITStubs.cpp b/Source/JavaScriptCore/jit/JITStubs.cpp
index 8b8546994..cb5adc2fa 100644
--- a/Source/JavaScriptCore/jit/JITStubs.cpp
+++ b/Source/JavaScriptCore/jit/JITStubs.cpp
@@ -2022,8 +2022,7 @@ DEFINE_STUB_FUNCTION(void, optimize)
}
ScopeChainNode* scopeChain = callFrame->scopeChain();
-
- JSObject* error = codeBlock->compileOptimized(callFrame, scopeChain);
+ JSObject* error = codeBlock->compileOptimized(callFrame, scopeChain, bytecodeIndex);
#if ENABLE(JIT_VERBOSE_OSR)
if (error)
dataLog("WARNING: optimized compilation failed.\n");
diff --git a/Source/JavaScriptCore/llint/LLIntExceptions.cpp b/Source/JavaScriptCore/llint/LLIntExceptions.cpp
index 20b0db3d9..a915c42e3 100644
--- a/Source/JavaScriptCore/llint/LLIntExceptions.cpp
+++ b/Source/JavaScriptCore/llint/LLIntExceptions.cpp
@@ -37,6 +37,14 @@
namespace JSC { namespace LLInt {
+static void fixupPCforExceptionIfNeeded(ExecState* exec)
+{
+ CodeBlock* codeBlock = exec->codeBlock();
+ ASSERT(!!codeBlock);
+ Instruction* pc = exec->currentVPC();
+ exec->setCurrentVPC(codeBlock->adjustPCIfAtCallSite(pc));
+}
+
void interpreterThrowInCaller(ExecState* exec, ReturnAddressPtr pc)
{
JSGlobalData* globalData = &exec->globalData();
@@ -44,6 +52,7 @@ void interpreterThrowInCaller(ExecState* exec, ReturnAddressPtr pc)
#if LLINT_SLOW_PATH_TRACING
dataLog("Throwing exception %s.\n", globalData->exception.description());
#endif
+ fixupPCforExceptionIfNeeded(exec);
genericThrow(
globalData, exec, globalData->exception,
exec->codeBlock()->bytecodeOffset(exec, pc));
@@ -61,6 +70,7 @@ Instruction* returnToThrow(ExecState* exec, Instruction* pc)
#if LLINT_SLOW_PATH_TRACING
dataLog("Throwing exception %s (returnToThrow).\n", globalData->exception.description());
#endif
+ fixupPCforExceptionIfNeeded(exec);
genericThrow(globalData, exec, globalData->exception, pc - exec->codeBlock()->instructions().begin());
return globalData->llintData.exceptionInstructions();
@@ -73,6 +83,7 @@ void* callToThrow(ExecState* exec, Instruction* pc)
#if LLINT_SLOW_PATH_TRACING
dataLog("Throwing exception %s (callToThrow).\n", globalData->exception.description());
#endif
+ fixupPCforExceptionIfNeeded(exec);
genericThrow(globalData, exec, globalData->exception, pc - exec->codeBlock()->instructions().begin());
return bitwise_cast<void*>(&llint_throw_during_call_trampoline);
diff --git a/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp b/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp
index f863cb218..cbb4258d0 100644
--- a/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp
+++ b/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp
@@ -25,6 +25,7 @@
#include "config.h"
+#include "ArrayProfile.h"
#include "CodeBlock.h"
#include "Executable.h"
#include "Heap.h"
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
index b8115dd6b..5f280ce1b 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
@@ -1255,14 +1255,19 @@ _llint_op_put_by_id_transition_normal_out_of_line:
_llint_op_get_by_val:
traceExecution()
- loadp CodeBlock[cfr], t1
loadi 8[PC], t2
loadi 12[PC], t3
- loadp CodeBlock::m_globalData[t1], t1
loadConstantOrVariablePayload(t2, CellTag, t0, .opGetByValSlow)
- loadp JSGlobalData::jsArrayClassInfo[t1], t2
loadConstantOrVariablePayload(t3, Int32Tag, t1, .opGetByValSlow)
- bpneq [t0], t2, .opGetByValSlow
+ loadp JSCell::m_structure[t0], t3
+ loadp 16[PC], t2
+ if VALUE_PROFILER
+ storep t3, ArrayProfile::m_lastSeenStructure[t2]
+ end
+ loadp CodeBlock[cfr], t2
+ loadp CodeBlock::m_globalData[t2], t2
+ loadp JSGlobalData::jsArrayClassInfo[t2], t2
+ bpneq Structure::m_classInfo[t3], t2, .opGetByValSlow
loadp JSArray::m_storage[t0], t3
biaeq t1, JSArray::m_vectorLength[t0], .opGetByValSlow
loadi 4[PC], t0
@@ -1271,16 +1276,18 @@ _llint_op_get_by_val:
bieq t2, EmptyValueTag, .opGetByValSlow
storei t2, TagOffset[cfr, t0, 8]
storei t1, PayloadOffset[cfr, t0, 8]
- loadi 16[PC], t0
+ loadi 20[PC], t0
valueProfile(t2, t1, t0)
- dispatch(5)
+ dispatch(6)
.opGetByValSlow:
callSlowPath(_llint_slow_path_get_by_val)
- dispatch(5)
+ dispatch(6)
_llint_op_get_argument_by_val:
+ # FIXME: At some point we should array profile this. Right now it isn't necessary
+ # since the DFG will never turn a get_argument_by_val into a GetByVal.
traceExecution()
loadi 8[PC], t0
loadi 12[PC], t1
@@ -1293,15 +1300,15 @@ _llint_op_get_argument_by_val:
loadi 4[PC], t3
loadi ThisArgumentOffset + TagOffset[cfr, t2, 8], t0
loadi ThisArgumentOffset + PayloadOffset[cfr, t2, 8], t1
- loadi 16[PC], t2
+ loadi 20[PC], t2
storei t0, TagOffset[cfr, t3, 8]
storei t1, PayloadOffset[cfr, t3, 8]
valueProfile(t0, t1, t2)
- dispatch(5)
+ dispatch(6)
.opGetArgumentByValSlow:
callSlowPath(_llint_slow_path_get_argument_by_val)
- dispatch(5)
+ dispatch(6)
_llint_op_get_by_pname:
@@ -1338,10 +1345,15 @@ _llint_op_put_by_val:
loadConstantOrVariablePayload(t0, CellTag, t1, .opPutByValSlow)
loadi 8[PC], t0
loadConstantOrVariablePayload(t0, Int32Tag, t2, .opPutByValSlow)
+ loadp JSCell::m_structure[t1], t3
+ loadp 16[PC], t0
+ if VALUE_PROFILER
+ storep t3, ArrayProfile::m_lastSeenStructure[t0]
+ end
loadp CodeBlock[cfr], t0
loadp CodeBlock::m_globalData[t0], t0
loadp JSGlobalData::jsArrayClassInfo[t0], t0
- bpneq [t1], t0, .opPutByValSlow
+ bpneq Structure::m_classInfo[t3], t0, .opPutByValSlow
biaeq t2, JSArray::m_vectorLength[t1], .opPutByValSlow
loadp JSArray::m_storage[t1], t0
bieq ArrayStorage::m_vector + TagOffset[t0, t2, 8], EmptyValueTag, .opPutByValEmpty
@@ -1351,7 +1363,7 @@ _llint_op_put_by_val:
writeBarrier(t1, t3)
storei t1, ArrayStorage::m_vector + TagOffset[t0, t2, 8]
storei t3, ArrayStorage::m_vector + PayloadOffset[t0, t2, 8]
- dispatch(4)
+ dispatch(5)
.opPutByValEmpty:
addi 1, ArrayStorage::m_numValuesInVector[t0]
@@ -1362,7 +1374,7 @@ _llint_op_put_by_val:
.opPutByValSlow:
callSlowPath(_llint_slow_path_put_by_val)
- dispatch(4)
+ dispatch(5)
_llint_op_loop:
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
index 6e752a6d0..f1a7e2998 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
@@ -1099,31 +1099,38 @@ _llint_op_put_by_id_transition_normal_out_of_line:
_llint_op_get_by_val:
traceExecution()
- loadp CodeBlock[cfr], t1
loadis 16[PB, PC, 8], t2
loadis 24[PB, PC, 8], t3
- loadp CodeBlock::m_globalData[t1], t1
loadConstantOrVariableCell(t2, t0, .opGetByValSlow)
- loadp JSGlobalData::jsArrayClassInfo[t1], t2
loadConstantOrVariableInt32(t3, t1, .opGetByValSlow)
sxi2p t1, t1
- bpneq [t0], t2, .opGetByValSlow
+ loadp JSCell::m_structure[t0], t3
+ loadp 32[PB, PC, 8], t2
+ if VALUE_PROFILER
+ storep t3, ArrayProfile::m_lastSeenStructure[t2]
+ end
+ loadp CodeBlock[cfr], t2
+ loadp CodeBlock::m_globalData[t2], t2
+ loadp JSGlobalData::jsArrayClassInfo[t2], t2
+ bpneq Structure::m_classInfo[t3], t2, .opGetByValSlow
loadp JSArray::m_storage[t0], t3
biaeq t1, JSArray::m_vectorLength[t0], .opGetByValSlow
loadis 8[PB, PC, 8], t0
loadp ArrayStorage::m_vector[t3, t1, 8], t2
btpz t2, .opGetByValSlow
storep t2, [cfr, t0, 8]
- loadp 32[PB, PC, 8], t0
+ loadp 40[PB, PC, 8], t0
valueProfile(t2, t0)
- dispatch(5)
+ dispatch(6)
.opGetByValSlow:
callSlowPath(_llint_slow_path_get_by_val)
- dispatch(5)
+ dispatch(6)
_llint_op_get_argument_by_val:
+ # FIXME: At some point we should array profile this. Right now it isn't necessary
+ # since the DFG will never turn a get_argument_by_val into a GetByVal.
traceExecution()
loadis 16[PB, PC, 8], t0
loadis 24[PB, PC, 8], t1
@@ -1139,11 +1146,11 @@ _llint_op_get_argument_by_val:
loadp ThisArgumentOffset[cfr, t2, 8], t0
storep t0, [cfr, t3, 8]
valueProfile(t0, t1)
- dispatch(5)
+ dispatch(6)
.opGetArgumentByValSlow:
callSlowPath(_llint_slow_path_get_argument_by_val)
- dispatch(5)
+ dispatch(6)
_llint_op_get_by_pname:
@@ -1182,10 +1189,15 @@ _llint_op_put_by_val:
loadis 16[PB, PC, 8], t0
loadConstantOrVariableInt32(t0, t2, .opPutByValSlow)
sxi2p t2, t2
+ loadp JSCell::m_structure[t1], t3
+ loadp 32[PB, PC, 8], t0
+ if VALUE_PROFILER
+ storep t3, ArrayProfile::m_lastSeenStructure[t0]
+ end
loadp CodeBlock[cfr], t0
loadp CodeBlock::m_globalData[t0], t0
loadp JSGlobalData::jsArrayClassInfo[t0], t0
- bpneq [t1], t0, .opPutByValSlow
+ bpneq Structure::m_classInfo[t3], t0, .opPutByValSlow
biaeq t2, JSArray::m_vectorLength[t1], .opPutByValSlow
loadp JSArray::m_storage[t1], t0
btpz ArrayStorage::m_vector[t0, t2, 8], .opPutByValEmpty
@@ -1194,7 +1206,7 @@ _llint_op_put_by_val:
loadConstantOrVariable(t3, t1)
writeBarrier(t1)
storep t1, ArrayStorage::m_vector[t0, t2, 8]
- dispatch(4)
+ dispatch(5)
.opPutByValEmpty:
addi 1, ArrayStorage::m_numValuesInVector[t0]
@@ -1205,7 +1217,7 @@ _llint_op_put_by_val:
.opPutByValSlow:
callSlowPath(_llint_slow_path_put_by_val)
- dispatch(4)
+ dispatch(5)
_llint_op_loop:
diff --git a/Source/JavaScriptCore/runtime/Executable.cpp b/Source/JavaScriptCore/runtime/Executable.cpp
index 73b4b6c4f..50bb5ffae 100644
--- a/Source/JavaScriptCore/runtime/Executable.cpp
+++ b/Source/JavaScriptCore/runtime/Executable.cpp
@@ -160,13 +160,13 @@ void FunctionExecutable::destroy(JSCell* cell)
static_cast<FunctionExecutable*>(cell)->FunctionExecutable::~FunctionExecutable();
}
-JSObject* EvalExecutable::compileOptimized(ExecState* exec, ScopeChainNode* scopeChainNode)
+JSObject* EvalExecutable::compileOptimized(ExecState* exec, ScopeChainNode* scopeChainNode, unsigned bytecodeIndex)
{
ASSERT(exec->globalData().dynamicGlobalObject);
ASSERT(!!m_evalCodeBlock);
JSObject* error = 0;
if (m_evalCodeBlock->getJITType() != JITCode::topTierJIT())
- error = compileInternal(exec, scopeChainNode, JITCode::nextTierJIT(m_evalCodeBlock->getJITType()));
+ error = compileInternal(exec, scopeChainNode, JITCode::nextTierJIT(m_evalCodeBlock->getJITType()), bytecodeIndex);
ASSERT(!!m_evalCodeBlock);
return error;
}
@@ -174,7 +174,7 @@ JSObject* EvalExecutable::compileOptimized(ExecState* exec, ScopeChainNode* scop
#if ENABLE(JIT)
bool EvalExecutable::jitCompile(ExecState* exec)
{
- return jitCompileIfAppropriate(exec, m_evalCodeBlock, m_jitCodeForCall, JITCode::bottomTierJIT(), JITCompilationCanFail);
+ return jitCompileIfAppropriate(exec, m_evalCodeBlock, m_jitCodeForCall, JITCode::bottomTierJIT(), UINT_MAX, JITCompilationCanFail);
}
#endif
@@ -193,12 +193,13 @@ inline const char* samplingDescription(JITCode::JITType jitType)
}
}
-JSObject* EvalExecutable::compileInternal(ExecState* exec, ScopeChainNode* scopeChainNode, JITCode::JITType jitType)
+JSObject* EvalExecutable::compileInternal(ExecState* exec, ScopeChainNode* scopeChainNode, JITCode::JITType jitType, unsigned bytecodeIndex)
{
SamplingRegion samplingRegion(samplingDescription(jitType));
#if !ENABLE(JIT)
UNUSED_PARAM(jitType);
+ UNUSED_PARAM(bytecodeIndex);
#endif
JSObject* exception = 0;
JSGlobalData* globalData = &exec->globalData();
@@ -235,7 +236,7 @@ JSObject* EvalExecutable::compileInternal(ExecState* exec, ScopeChainNode* scope
}
#if ENABLE(JIT)
- if (!prepareForExecution(exec, m_evalCodeBlock, m_jitCodeForCall, jitType))
+ if (!prepareForExecution(exec, m_evalCodeBlock, m_jitCodeForCall, jitType, bytecodeIndex))
return 0;
#endif
@@ -301,13 +302,13 @@ JSObject* ProgramExecutable::checkSyntax(ExecState* exec)
return exception;
}
-JSObject* ProgramExecutable::compileOptimized(ExecState* exec, ScopeChainNode* scopeChainNode)
+JSObject* ProgramExecutable::compileOptimized(ExecState* exec, ScopeChainNode* scopeChainNode, unsigned bytecodeIndex)
{
ASSERT(exec->globalData().dynamicGlobalObject);
ASSERT(!!m_programCodeBlock);
JSObject* error = 0;
if (m_programCodeBlock->getJITType() != JITCode::topTierJIT())
- error = compileInternal(exec, scopeChainNode, JITCode::nextTierJIT(m_programCodeBlock->getJITType()));
+ error = compileInternal(exec, scopeChainNode, JITCode::nextTierJIT(m_programCodeBlock->getJITType()), bytecodeIndex);
ASSERT(!!m_programCodeBlock);
return error;
}
@@ -315,16 +316,17 @@ JSObject* ProgramExecutable::compileOptimized(ExecState* exec, ScopeChainNode* s
#if ENABLE(JIT)
bool ProgramExecutable::jitCompile(ExecState* exec)
{
- return jitCompileIfAppropriate(exec, m_programCodeBlock, m_jitCodeForCall, JITCode::bottomTierJIT(), JITCompilationCanFail);
+ return jitCompileIfAppropriate(exec, m_programCodeBlock, m_jitCodeForCall, JITCode::bottomTierJIT(), UINT_MAX, JITCompilationCanFail);
}
#endif
-JSObject* ProgramExecutable::compileInternal(ExecState* exec, ScopeChainNode* scopeChainNode, JITCode::JITType jitType)
+JSObject* ProgramExecutable::compileInternal(ExecState* exec, ScopeChainNode* scopeChainNode, JITCode::JITType jitType, unsigned bytecodeIndex)
{
SamplingRegion samplingRegion(samplingDescription(jitType));
#if !ENABLE(JIT)
UNUSED_PARAM(jitType);
+ UNUSED_PARAM(bytecodeIndex);
#endif
JSObject* exception = 0;
JSGlobalData* globalData = &exec->globalData();
@@ -359,7 +361,7 @@ JSObject* ProgramExecutable::compileInternal(ExecState* exec, ScopeChainNode* sc
}
#if ENABLE(JIT)
- if (!prepareForExecution(exec, m_programCodeBlock, m_jitCodeForCall, jitType))
+ if (!prepareForExecution(exec, m_programCodeBlock, m_jitCodeForCall, jitType, bytecodeIndex))
return 0;
#endif
@@ -431,24 +433,24 @@ FunctionCodeBlock* FunctionExecutable::baselineCodeBlockFor(CodeSpecializationKi
return result;
}
-JSObject* FunctionExecutable::compileOptimizedForCall(ExecState* exec, ScopeChainNode* scopeChainNode)
+JSObject* FunctionExecutable::compileOptimizedForCall(ExecState* exec, ScopeChainNode* scopeChainNode, unsigned bytecodeIndex)
{
ASSERT(exec->globalData().dynamicGlobalObject);
ASSERT(!!m_codeBlockForCall);
JSObject* error = 0;
if (m_codeBlockForCall->getJITType() != JITCode::topTierJIT())
- error = compileForCallInternal(exec, scopeChainNode, JITCode::nextTierJIT(m_codeBlockForCall->getJITType()));
+ error = compileForCallInternal(exec, scopeChainNode, JITCode::nextTierJIT(m_codeBlockForCall->getJITType()), bytecodeIndex);
ASSERT(!!m_codeBlockForCall);
return error;
}
-JSObject* FunctionExecutable::compileOptimizedForConstruct(ExecState* exec, ScopeChainNode* scopeChainNode)
+JSObject* FunctionExecutable::compileOptimizedForConstruct(ExecState* exec, ScopeChainNode* scopeChainNode, unsigned bytecodeIndex)
{
ASSERT(exec->globalData().dynamicGlobalObject);
ASSERT(!!m_codeBlockForConstruct);
JSObject* error = 0;
if (m_codeBlockForConstruct->getJITType() != JITCode::topTierJIT())
- error = compileForConstructInternal(exec, scopeChainNode, JITCode::nextTierJIT(m_codeBlockForConstruct->getJITType()));
+ error = compileForConstructInternal(exec, scopeChainNode, JITCode::nextTierJIT(m_codeBlockForConstruct->getJITType()), bytecodeIndex);
ASSERT(!!m_codeBlockForConstruct);
return error;
}
@@ -456,12 +458,12 @@ JSObject* FunctionExecutable::compileOptimizedForConstruct(ExecState* exec, Scop
#if ENABLE(JIT)
bool FunctionExecutable::jitCompileForCall(ExecState* exec)
{
- return jitCompileFunctionIfAppropriate(exec, m_codeBlockForCall, m_jitCodeForCall, m_jitCodeForCallWithArityCheck, m_symbolTable, JITCode::bottomTierJIT(), JITCompilationCanFail);
+ return jitCompileFunctionIfAppropriate(exec, m_codeBlockForCall, m_jitCodeForCall, m_jitCodeForCallWithArityCheck, m_symbolTable, JITCode::bottomTierJIT(), UINT_MAX, JITCompilationCanFail);
}
bool FunctionExecutable::jitCompileForConstruct(ExecState* exec)
{
- return jitCompileFunctionIfAppropriate(exec, m_codeBlockForConstruct, m_jitCodeForConstruct, m_jitCodeForConstructWithArityCheck, m_symbolTable, JITCode::bottomTierJIT(), JITCompilationCanFail);
+ return jitCompileFunctionIfAppropriate(exec, m_codeBlockForConstruct, m_jitCodeForConstruct, m_jitCodeForConstructWithArityCheck, m_symbolTable, JITCode::bottomTierJIT(), UINT_MAX, JITCompilationCanFail);
}
#endif
@@ -502,7 +504,7 @@ PassOwnPtr<FunctionCodeBlock> FunctionExecutable::produceCodeBlockFor(ScopeChain
return result.release();
}
-JSObject* FunctionExecutable::compileForCallInternal(ExecState* exec, ScopeChainNode* scopeChainNode, JITCode::JITType jitType)
+JSObject* FunctionExecutable::compileForCallInternal(ExecState* exec, ScopeChainNode* scopeChainNode, JITCode::JITType jitType, unsigned bytecodeIndex)
{
SamplingRegion samplingRegion(samplingDescription(jitType));
@@ -510,6 +512,7 @@ JSObject* FunctionExecutable::compileForCallInternal(ExecState* exec, ScopeChain
UNUSED_PARAM(exec);
UNUSED_PARAM(jitType);
UNUSED_PARAM(exec);
+ UNUSED_PARAM(bytecodeIndex);
#endif
ASSERT((jitType == JITCode::bottomTierJIT()) == !m_codeBlockForCall);
JSObject* exception;
@@ -526,7 +529,7 @@ JSObject* FunctionExecutable::compileForCallInternal(ExecState* exec, ScopeChain
m_symbolTable = m_codeBlockForCall->sharedSymbolTable();
#if ENABLE(JIT)
- if (!prepareFunctionForExecution(exec, m_codeBlockForCall, m_jitCodeForCall, m_jitCodeForCallWithArityCheck, m_symbolTable, jitType, CodeForCall))
+ if (!prepareFunctionForExecution(exec, m_codeBlockForCall, m_jitCodeForCall, m_jitCodeForCallWithArityCheck, m_symbolTable, jitType, bytecodeIndex, CodeForCall))
return 0;
#endif
@@ -544,13 +547,14 @@ JSObject* FunctionExecutable::compileForCallInternal(ExecState* exec, ScopeChain
return 0;
}
-JSObject* FunctionExecutable::compileForConstructInternal(ExecState* exec, ScopeChainNode* scopeChainNode, JITCode::JITType jitType)
+JSObject* FunctionExecutable::compileForConstructInternal(ExecState* exec, ScopeChainNode* scopeChainNode, JITCode::JITType jitType, unsigned bytecodeIndex)
{
SamplingRegion samplingRegion(samplingDescription(jitType));
#if !ENABLE(JIT)
UNUSED_PARAM(jitType);
UNUSED_PARAM(exec);
+ UNUSED_PARAM(bytecodeIndex);
#endif
ASSERT((jitType == JITCode::bottomTierJIT()) == !m_codeBlockForConstruct);
@@ -568,7 +572,7 @@ JSObject* FunctionExecutable::compileForConstructInternal(ExecState* exec, Scope
m_symbolTable = m_codeBlockForConstruct->sharedSymbolTable();
#if ENABLE(JIT)
- if (!prepareFunctionForExecution(exec, m_codeBlockForConstruct, m_jitCodeForConstruct, m_jitCodeForConstructWithArityCheck, m_symbolTable, jitType, CodeForConstruct))
+ if (!prepareFunctionForExecution(exec, m_codeBlockForConstruct, m_jitCodeForConstruct, m_jitCodeForConstructWithArityCheck, m_symbolTable, jitType, bytecodeIndex, CodeForConstruct))
return 0;
#endif
diff --git a/Source/JavaScriptCore/runtime/Executable.h b/Source/JavaScriptCore/runtime/Executable.h
index 2f6c6a253..2e5ba28ca 100644
--- a/Source/JavaScriptCore/runtime/Executable.h
+++ b/Source/JavaScriptCore/runtime/Executable.h
@@ -377,7 +377,7 @@ namespace JSC {
return error;
}
- JSObject* compileOptimized(ExecState*, ScopeChainNode*);
+ JSObject* compileOptimized(ExecState*, ScopeChainNode*, unsigned bytecodeIndex);
#if ENABLE(JIT)
void jettisonOptimizedCode(JSGlobalData&);
@@ -418,7 +418,7 @@ namespace JSC {
static const unsigned StructureFlags = OverridesVisitChildren | ScriptExecutable::StructureFlags;
EvalExecutable(ExecState*, const SourceCode&, bool);
- JSObject* compileInternal(ExecState*, ScopeChainNode*, JITCode::JITType);
+ JSObject* compileInternal(ExecState*, ScopeChainNode*, JITCode::JITType, unsigned bytecodeIndex = UINT_MAX);
static void visitChildren(JSCell*, SlotVisitor&);
OwnPtr<EvalCodeBlock> m_evalCodeBlock;
@@ -448,7 +448,7 @@ namespace JSC {
return error;
}
- JSObject* compileOptimized(ExecState*, ScopeChainNode*);
+ JSObject* compileOptimized(ExecState*, ScopeChainNode*, unsigned bytecodeIndex);
#if ENABLE(JIT)
void jettisonOptimizedCode(JSGlobalData&);
@@ -485,7 +485,7 @@ namespace JSC {
static const unsigned StructureFlags = OverridesVisitChildren | ScriptExecutable::StructureFlags;
ProgramExecutable(ExecState*, const SourceCode&);
- JSObject* compileInternal(ExecState*, ScopeChainNode*, JITCode::JITType);
+ JSObject* compileInternal(ExecState*, ScopeChainNode*, JITCode::JITType, unsigned bytecodeIndex = UINT_MAX);
static void visitChildren(JSCell*, SlotVisitor&);
OwnPtr<ProgramCodeBlock> m_programCodeBlock;
@@ -543,7 +543,7 @@ namespace JSC {
return error;
}
- JSObject* compileOptimizedForCall(ExecState*, ScopeChainNode*);
+ JSObject* compileOptimizedForCall(ExecState*, ScopeChainNode*, unsigned bytecodeIndex);
#if ENABLE(JIT)
void jettisonOptimizedCodeForCall(JSGlobalData&);
@@ -571,7 +571,7 @@ namespace JSC {
return error;
}
- JSObject* compileOptimizedForConstruct(ExecState*, ScopeChainNode*);
+ JSObject* compileOptimizedForConstruct(ExecState*, ScopeChainNode*, unsigned bytecodeIndex);
#if ENABLE(JIT)
void jettisonOptimizedCodeForConstruct(JSGlobalData&);
@@ -601,16 +601,16 @@ namespace JSC {
return compileForConstruct(exec, scopeChainNode);
}
- JSObject* compileOptimizedFor(ExecState* exec, ScopeChainNode* scopeChainNode, CodeSpecializationKind kind)
+ JSObject* compileOptimizedFor(ExecState* exec, ScopeChainNode* scopeChainNode, unsigned bytecodeIndex, CodeSpecializationKind kind)
{
ASSERT(exec->callee());
ASSERT(exec->callee()->inherits(&JSFunction::s_info));
ASSERT(jsCast<JSFunction*>(exec->callee())->jsExecutable() == this);
if (kind == CodeForCall)
- return compileOptimizedForCall(exec, scopeChainNode);
+ return compileOptimizedForCall(exec, scopeChainNode, bytecodeIndex);
ASSERT(kind == CodeForConstruct);
- return compileOptimizedForConstruct(exec, scopeChainNode);
+ return compileOptimizedForConstruct(exec, scopeChainNode, bytecodeIndex);
}
#if ENABLE(JIT)
@@ -691,8 +691,8 @@ namespace JSC {
FunctionExecutable(JSGlobalData&, const Identifier& name, const Identifier& inferredName, const SourceCode&, bool forceUsesArguments, FunctionParameters*, bool);
FunctionExecutable(ExecState*, const Identifier& name, const Identifier& inferredName, const SourceCode&, bool forceUsesArguments, FunctionParameters*, bool);
- JSObject* compileForCallInternal(ExecState*, ScopeChainNode*, JITCode::JITType);
- JSObject* compileForConstructInternal(ExecState*, ScopeChainNode*, JITCode::JITType);
+ JSObject* compileForCallInternal(ExecState*, ScopeChainNode*, JITCode::JITType, unsigned bytecodeIndex = UINT_MAX);
+ JSObject* compileForConstructInternal(ExecState*, ScopeChainNode*, JITCode::JITType, unsigned bytecodeIndex = UINT_MAX);
OwnPtr<FunctionCodeBlock>& codeBlockFor(CodeSpecializationKind kind)
{
diff --git a/Source/JavaScriptCore/runtime/ExecutionHarness.h b/Source/JavaScriptCore/runtime/ExecutionHarness.h
index 4cc37f3b7..3a876402e 100644
--- a/Source/JavaScriptCore/runtime/ExecutionHarness.h
+++ b/Source/JavaScriptCore/runtime/ExecutionHarness.h
@@ -36,7 +36,7 @@
namespace JSC {
template<typename CodeBlockType>
-inline bool prepareForExecution(ExecState* exec, OwnPtr<CodeBlockType>& codeBlock, JITCode& jitCode, JITCode::JITType jitType)
+inline bool prepareForExecution(ExecState* exec, OwnPtr<CodeBlockType>& codeBlock, JITCode& jitCode, JITCode::JITType jitType, unsigned bytecodeIndex)
{
#if ENABLE(LLINT)
if (JITCode::isBaselineCode(jitType)) {
@@ -46,10 +46,10 @@ inline bool prepareForExecution(ExecState* exec, OwnPtr<CodeBlockType>& codeBloc
return true;
}
#endif // ENABLE(LLINT)
- return jitCompileIfAppropriate(exec, codeBlock, jitCode, jitType, JITCode::isBaselineCode(jitType) ? JITCompilationMustSucceed : JITCompilationCanFail);
+ return jitCompileIfAppropriate(exec, codeBlock, jitCode, jitType, bytecodeIndex, JITCode::isBaselineCode(jitType) ? JITCompilationMustSucceed : JITCompilationCanFail);
}
-inline bool prepareFunctionForExecution(ExecState* exec, OwnPtr<FunctionCodeBlock>& codeBlock, JITCode& jitCode, MacroAssemblerCodePtr& jitCodeWithArityCheck, SharedSymbolTable*& symbolTable, JITCode::JITType jitType, CodeSpecializationKind kind)
+inline bool prepareFunctionForExecution(ExecState* exec, OwnPtr<FunctionCodeBlock>& codeBlock, JITCode& jitCode, MacroAssemblerCodePtr& jitCodeWithArityCheck, SharedSymbolTable*& symbolTable, JITCode::JITType jitType, unsigned bytecodeIndex, CodeSpecializationKind kind)
{
#if ENABLE(LLINT)
if (JITCode::isBaselineCode(jitType)) {
@@ -61,7 +61,7 @@ inline bool prepareFunctionForExecution(ExecState* exec, OwnPtr<FunctionCodeBloc
#else
UNUSED_PARAM(kind);
#endif // ENABLE(LLINT)
- return jitCompileFunctionIfAppropriate(exec, codeBlock, jitCode, jitCodeWithArityCheck, symbolTable, jitType, JITCode::isBaselineCode(jitType) ? JITCompilationMustSucceed : JITCompilationCanFail);
+ return jitCompileFunctionIfAppropriate(exec, codeBlock, jitCode, jitCodeWithArityCheck, symbolTable, jitType, bytecodeIndex, JITCode::isBaselineCode(jitType) ? JITCompilationMustSucceed : JITCompilationCanFail);
}
} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/Structure.h b/Source/JavaScriptCore/runtime/Structure.h
index ee0b573d9..0b9c92210 100644
--- a/Source/JavaScriptCore/runtime/Structure.h
+++ b/Source/JavaScriptCore/runtime/Structure.h
@@ -322,6 +322,11 @@ namespace JSC {
{
return OBJECT_OFFSETOF(Structure, m_typeInfo) + TypeInfo::typeOffset();
}
+
+ static ptrdiff_t classInfoOffset()
+ {
+ return OBJECT_OFFSETOF(Structure, m_classInfo);
+ }
static Structure* createStructure(JSGlobalData&);
diff --git a/Source/JavaScriptCore/shell/PlatformEfl.cmake b/Source/JavaScriptCore/shell/PlatformEfl.cmake
index c35af2d51..53755727b 100644
--- a/Source/JavaScriptCore/shell/PlatformEfl.cmake
+++ b/Source/JavaScriptCore/shell/PlatformEfl.cmake
@@ -1,5 +1,5 @@
LIST(APPEND JSC_LIBRARIES
- ${Glib_LIBRARIES}
+ ${GLIB_LIBRARIES}
${ECORE_LIBRARIES}
${CMAKE_DL_LIBS}
)
diff --git a/Source/Platform/ChangeLog b/Source/Platform/ChangeLog
index 583666eec..c9e3f90c5 100644
--- a/Source/Platform/ChangeLog
+++ b/Source/Platform/ChangeLog
@@ -1,3 +1,150 @@
+2012-08-20 James Robinson <jamesr@chromium.org>
+
+ [chromium] REGRESSION(126076) Should not touch old GraphicsLayerChromium::m_contentsLayer when setting up a new contents layer
+ https://bugs.webkit.org/show_bug.cgi?id=94544
+
+ Reviewed by Adrienne Walker.
+
+ Exposes an id so users of the WebLayer API can make identity checks for layers that they do not have ownership
+ of.
+
+ * chromium/public/WebLayer.h:
+ (WebLayer):
+
+2012-08-16 James Robinson <jamesr@chromium.org>
+
+ [chromium] Change WebLayer from a concrete type to a pure virtual interface
+ https://bugs.webkit.org/show_bug.cgi?id=94174
+
+ Reviewed by Adrienne Walker.
+
+ This changes WebLayer from a value type to a pure virtual interface and changes Web*Layers from subtypes to
+ standalone types that have a WebLayer. This better isolates the implementation from the interface and, since
+ it's not possible to re-wrap an existing layer, makes cleanup explicit instead of requiring the caller to invoke
+ special cleanup methods before shutdown.
+
+ * chromium/public/WebContentLayer.h:
+ (WebContentLayer):
+ * chromium/public/WebExternalTextureLayer.h:
+ (WebExternalTextureLayer):
+ * chromium/public/WebIOSurfaceLayer.h:
+ (WebIOSurfaceLayer):
+ * chromium/public/WebImageLayer.h:
+ (WebImageLayer):
+ * chromium/public/WebLayer.h:
+ (WebKit):
+ (WebLayer):
+ (WebKit::WebLayer::~WebLayer):
+ * chromium/public/WebScrollableLayer.h:
+ (WebScrollableLayer):
+ * chromium/public/WebScrollbarLayer.h:
+ (WebScrollbarLayer):
+ * chromium/public/WebSolidColorLayer.h:
+ (WebKit):
+ (WebSolidColorLayer):
+ (WebKit::WebSolidColorLayer::~WebSolidColorLayer):
+ * chromium/public/WebVideoLayer.h:
+ (WebVideoLayer):
+
+2012-08-17 Zach Kuznia <zork@chromium.org>
+
+ Add support for Skia Magnifier filter to Chromium layers
+ https://bugs.webkit.org/show_bug.cgi?id=93939
+
+ Reviewed by James Robinson.
+
+ This is used by Chrome OS for the screen magnifier
+
+ * chromium/public/WebFilterOperation.h:
+ (WebKit::WebFilterOperation::zoomRect):
+ (WebFilterOperation):
+ (WebKit::WebFilterOperation::createZoomFilter):
+ (WebKit::WebFilterOperation::WebFilterOperation):
+
+2012-08-16 James Robinson <jamesr@chromium.org>
+
+ [chromium] Remove unnecessary tree hierarchy inspection APIs from WebLayer
+ https://bugs.webkit.org/show_bug.cgi?id=94229
+
+ Reviewed by Adrienne Walker.
+
+ As it turns out, these APIs are needed. Without them, there is no way to re-wrap an existing layer so we can
+ know that when all WebLayer wrappers of a given layer go away that layer will never be exposed to the public API
+ again and run appropriate cleanup code.
+
+ * chromium/public/WebLayer.h:
+ (WebLayer):
+
+2012-08-16 James Robinson <jamesr@chromium.org>
+
+ [chromium] Remove alwaysReserveTextures code - it doesn't do anything
+ https://bugs.webkit.org/show_bug.cgi?id=94183
+
+ Reviewed by Dimitri Glazkov.
+
+ Remove deprecated setAlwaysReserveTextures() call from WebLayer.
+
+ * chromium/public/WebLayer.h:
+ (WebLayer):
+
+2012-08-14 Gregg Tavares <gman@google.com>
+
+ Plumb through EXT_debug_marker entry points
+ https://bugs.webkit.org/show_bug.cgi?id=93860
+
+ Reviewed by Kenneth Russell.
+
+ insertEventMarkerEXT, pushGroupMarkerEXT, popGroupMarkerEXT are
+ all entry points exposed by the OpenGL ES EXT_debug_marker
+ extension.
+
+ * chromium/public/WebGraphicsContext3D.h:
+ (WebGraphicsContext3D):
+ (WebKit::WebGraphicsContext3D::insertEventMarkerEXT):
+ (WebKit::WebGraphicsContext3D::pushGroupMarkerEXT):
+ (WebKit::WebGraphicsContext3D::popGroupMarkerEXT):
+
+2012-08-13 James Robinson <jamesr@chromium.org>
+
+ [chromium] Make WebAnimation a pure virtual interface to hide implementation and avoid unresolved symbols
+ https://bugs.webkit.org/show_bug.cgi?id=93907
+
+ Reviewed by Darin Fisher.
+
+ This makes WebAnimation a pure virtual interface with instances returned by a factory function. Currently the
+ factory is a static function on WebAnimation, but it will likely move to a platform support interface. This
+ provides better isolation of the implementation from the interface and in particular allows for implementing the
+ WebAnimation interface outside of WebKit.dll without having unresolved external symbols in WebKit.dll.
+
+ * chromium/public/WebAnimation.h:
+ (WebKit::WebAnimation::~WebAnimation):
+ (WebAnimation):
+ * chromium/public/WebLayer.h:
+ (WebLayer):
+
+2012-08-10 James Robinson <jamesr@chromium.org>
+
+ [chromium] Clean up dependencies for Canvas2DLayerBridgeTest and GraphicsLayerChromiumTest unit tests
+ https://bugs.webkit.org/show_bug.cgi?id=93757
+
+ Reviewed by Adrienne Walker.
+
+ Exposes a function to check for active animations on a layer.
+
+ * chromium/public/WebLayer.h:
+ (WebLayer):
+
+2012-08-10 Kinuko Yasuda <kinuko@chromium.org>
+
+ Support creating File object from FileSystem URL for files in FileSystem API
+ https://bugs.webkit.org/show_bug.cgi?id=93706
+
+ Reviewed by Darin Fisher.
+
+ * chromium/public/WebBlobData.h:
+ * chromium/public/WebHTTPBody.h:
+ (WebHTTPBody):
+
2012-08-09 James Robinson <jamesr@chromium.org>
[chromium] Remove forwarding headers for compositor-related WebKit API and update includes
diff --git a/Source/Platform/chromium/public/WebAnimation.h b/Source/Platform/chromium/public/WebAnimation.h
index 0db98ad35..238bbaae1 100644
--- a/Source/Platform/chromium/public/WebAnimation.h
+++ b/Source/Platform/chromium/public/WebAnimation.h
@@ -42,60 +42,40 @@ namespace WebKit {
class WebAnimationCurve;
// A compositor driven animation.
-class WebAnimation : public WebNonCopyable {
+class WebAnimation {
public:
enum TargetProperty {
TargetPropertyTransform = 0,
TargetPropertyOpacity
};
- WebAnimation(const WebAnimationCurve& curve, TargetProperty targetProperty)
- {
- initialize(curve, targetProperty);
- }
+ // The caller takes ownership of the returned valuev
+ WEBKIT_EXPORT static WebAnimation* create(const WebAnimationCurve&, TargetProperty);
// An animationId is effectively the animation's name, and it is not unique.
// Animations with the same groupId are run at the same time. An animation
// may be uniquely identified by a combination of groupId and target property.
- WebAnimation(const WebAnimationCurve& curve, int animationId, int groupId, TargetProperty targetProperty)
- {
- initialize(curve, animationId, groupId, targetProperty);
- }
+ WEBKIT_EXPORT static WebAnimation* create(const WebAnimationCurve&, int animationId, int groupId, TargetProperty);
- ~WebAnimation()
- {
- destroy();
- }
+ virtual ~WebAnimation() { }
- WEBKIT_EXPORT TargetProperty targetProperty() const;
+ virtual TargetProperty targetProperty() const = 0;
// This is the number of times that the animation will play. If this
// value is zero the animation will not play. If it is negative, then
// the animation will loop indefinitely.
- WEBKIT_EXPORT int iterations() const;
- WEBKIT_EXPORT void setIterations(int);
+ virtual int iterations() const = 0;
+ virtual void setIterations(int) = 0;
- WEBKIT_EXPORT double startTime() const;
- WEBKIT_EXPORT void setStartTime(double monotonicTime);
- WEBKIT_EXPORT bool hasSetStartTime() const;
+ virtual double startTime() const = 0;
+ virtual void setStartTime(double monotonicTime) = 0;
- WEBKIT_EXPORT double timeOffset() const;
- WEBKIT_EXPORT void setTimeOffset(double monotonicTime);
+ virtual double timeOffset() const = 0;
+ virtual void setTimeOffset(double monotonicTime) = 0;
// If alternatesDirection is true, on odd numbered iterations we reverse the curve.
- WEBKIT_EXPORT bool alternatesDirection() const;
- WEBKIT_EXPORT void setAlternatesDirection(bool);
-
-#if WEBKIT_IMPLEMENTATION
- operator PassOwnPtr<WebCore::CCActiveAnimation>() const;
-#endif
-
-private:
- WEBKIT_EXPORT void initialize(const WebAnimationCurve&, TargetProperty);
- WEBKIT_EXPORT void initialize(const WebAnimationCurve&, int animationId, int groupId, TargetProperty);
- WEBKIT_EXPORT void destroy();
-
- WebPrivateOwnPtr<WebCore::CCActiveAnimation> m_private;
+ virtual bool alternatesDirection() const = 0;
+ virtual void setAlternatesDirection(bool) = 0;
};
} // namespace WebKit
diff --git a/Source/Platform/chromium/public/WebBlobData.h b/Source/Platform/chromium/public/WebBlobData.h
index 7fa32d3b6..47d9132e7 100644
--- a/Source/Platform/chromium/public/WebBlobData.h
+++ b/Source/Platform/chromium/public/WebBlobData.h
@@ -47,13 +47,16 @@ class WebBlobDataPrivate;
class WebBlobData {
public:
struct Item {
- enum { TypeData, TypeFile, TypeBlob } type;
+ enum { TypeData, TypeFile, TypeBlob, TypeURL } type;
WebThreadSafeData data;
WebString filePath;
- WebURL blobURL;
+ WebURL url; // For TypeBlob or TypeURL.
long long offset;
long long length; // -1 means go to the end of the file/blob.
double expectedModificationTime; // 0.0 means that the time is not set.
+
+ // FIXME: deprecate this.
+ WebURL blobURL;
};
~WebBlobData() { reset(); }
diff --git a/Source/Platform/chromium/public/WebContentLayer.h b/Source/Platform/chromium/public/WebContentLayer.h
index 7336bfabc..312107f9c 100644
--- a/Source/Platform/chromium/public/WebContentLayer.h
+++ b/Source/Platform/chromium/public/WebContentLayer.h
@@ -27,55 +27,37 @@
#define WebContentLayer_h
#include "WebCommon.h"
-#include "WebScrollableLayer.h"
-
-namespace WebCore {
-class ContentLayerChromium;
-}
namespace WebKit {
class WebContentLayerClient;
-class WebContentLayerImpl;
-class WebContentLayer : public WebScrollableLayer {
+class WebContentLayer {
public:
- WEBKIT_EXPORT static WebContentLayer create(WebContentLayerClient*);
+ // The client must outlive the WebContentLayer.
+ WEBKIT_EXPORT static WebContentLayer* create(WebContentLayerClient*);
- WebContentLayer() { }
- WebContentLayer(const WebContentLayer& layer) : WebScrollableLayer(layer) { }
virtual ~WebContentLayer() { }
- WebContentLayer& operator=(const WebContentLayer& layer)
- {
- WebLayer::assign(layer);
- return *this;
- }
- // Called when the WebContentLayerClient is going away and should not be used.
- WEBKIT_EXPORT void clearClient();
+ // The WebContentLayer has ownership of this wrapper.
+ virtual WebLayer* layer() = 0;
// Set to true if the backside of this layer's contents should be visible when composited.
// Defaults to false.
- WEBKIT_EXPORT void setDoubleSided(bool);
+ virtual void setDoubleSided(bool) = 0;
// Set to apply a scale factor used when painting and drawing this layer's content. Defaults to 1.0.
- WEBKIT_EXPORT void setContentsScale(float);
+ virtual void setContentsScale(float) = 0;
// Set to render text in this layer with LCD antialiasing. Only set if you know that this layer will be
// drawn in a way where this makes sense - i.e. opaque background, not rotated or scaled, etc.
// Defaults to false;
- WEBKIT_EXPORT void setUseLCDText(bool);
+ virtual void setUseLCDText(bool) = 0;
// Set to draw a system-defined checkerboard if the compositor would otherwise draw a tile in this layer
// and the actual contents are unavailable. If false, the compositor will draw the layer's background color
// for these tiles.
// Defaults to false.
- WEBKIT_EXPORT void setDrawCheckerboardForMissingTiles(bool);
-
-#if WEBKIT_IMPLEMENTATION
- WebContentLayer(const WTF::PassRefPtr<WebCore::ContentLayerChromium>&);
- WebContentLayer& operator=(const WTF::PassRefPtr<WebCore::ContentLayerChromium>&);
- operator WTF::PassRefPtr<WebCore::ContentLayerChromium>() const;
-#endif
+ virtual void setDrawCheckerboardForMissingTiles(bool) = 0;
};
} // namespace WebKit
diff --git a/Source/Platform/chromium/public/WebExternalTextureLayer.h b/Source/Platform/chromium/public/WebExternalTextureLayer.h
index b19c05f3e..92d2c4fee 100644
--- a/Source/Platform/chromium/public/WebExternalTextureLayer.h
+++ b/Source/Platform/chromium/public/WebExternalTextureLayer.h
@@ -30,10 +30,6 @@
#include "WebFloatRect.h"
#include "WebLayer.h"
-namespace WebCore {
-class TextureLayerChromium;
-}
-
namespace WebKit {
class WebExternalTextureLayerClient;
@@ -44,49 +40,43 @@ class WebExternalTextureLayerClient;
// When in single-thread mode, this means during WebLayerTreeView::composite().
// When using the threaded compositor, this can mean at an arbitrary time until
// the WebLayerTreeView is destroyed.
-class WebExternalTextureLayer : public WebLayer {
+class WebExternalTextureLayer {
public:
// The owner of this layer may optionally provide a client. This client will
// be called whenever the compositor wishes to produce a new frame and can
// provide a new front buffer texture ID. This is useful if the client wants to
// implement a double-buffering scheme that is synchronized with the compositor, for instance.
- WEBKIT_EXPORT static WebExternalTextureLayer create(WebExternalTextureLayerClient* = 0);
-
- // Indicates that the client for this layer is going away and shouldn't be used.
- WEBKIT_EXPORT void clearClient();
+ // The client must outlive the WebExternalTextureLayer.
+ WEBKIT_EXPORT static WebExternalTextureLayer* create(WebExternalTextureLayerClient* = 0);
- WebExternalTextureLayer() { }
virtual ~WebExternalTextureLayer() { }
+ virtual WebLayer* layer() = 0;
+
// Sets the texture id that represents the layer, in the namespace of the
// compositor context.
- WEBKIT_EXPORT void setTextureId(unsigned);
+ virtual void setTextureId(unsigned) = 0;
// Sets whether or not the texture should be flipped in the Y direction when
// rendered.
- WEBKIT_EXPORT void setFlipped(bool);
+ virtual void setFlipped(bool) = 0;
// Sets the rect in UV space of the texture that is mapped to the layer
// bounds.
- WEBKIT_EXPORT void setUVRect(const WebFloatRect&);
+ virtual void setUVRect(const WebFloatRect&) = 0;
// Sets whether every pixel in this layer is opaque. Defaults to false.
- WEBKIT_EXPORT void setOpaque(bool);
+ virtual void setOpaque(bool) = 0;
// Sets whether this layer's texture has premultiplied alpha or not. Defaults to true.
- WEBKIT_EXPORT void setPremultipliedAlpha(bool);
+ virtual void setPremultipliedAlpha(bool) = 0;
// Indicates that the most recently provided texture ID is about to be modified externally.
- WEBKIT_EXPORT void willModifyTexture();
+ virtual void willModifyTexture() = 0;
// Sets whether this context should be rate limited by the compositor. Rate limiting works by blocking
// invalidate() and invalidateRect() calls if the compositor is too many frames behind.
- WEBKIT_EXPORT void setRateLimitContext(bool);
-
-private:
-#if WEBKIT_IMPLEMENTATION
- explicit WebExternalTextureLayer(PassRefPtr<WebCore::TextureLayerChromium>);
-#endif
+ virtual void setRateLimitContext(bool) = 0;
};
} // namespace WebKit
diff --git a/Source/Platform/chromium/public/WebFilterOperation.h b/Source/Platform/chromium/public/WebFilterOperation.h
index 851a7b9d4..a8d0ec25b 100644
--- a/Source/Platform/chromium/public/WebFilterOperation.h
+++ b/Source/Platform/chromium/public/WebFilterOperation.h
@@ -30,6 +30,7 @@
#include "WebCommon.h"
#include "WebColor.h"
#include "WebPoint.h"
+#include "WebRect.h"
namespace WebKit {
@@ -47,6 +48,7 @@ public:
FilterTypeBlur,
FilterTypeDropShadow,
FilterTypeColorMatrix,
+ FilterTypeZoom,
};
FilterType type() const { return m_type; }
@@ -70,6 +72,12 @@ public:
return m_matrix;
}
+ WebRect zoomRect() const
+ {
+ WEBKIT_ASSERT(m_type == FilterTypeZoom);
+ return WebRect(m_zoomRect);
+ }
+
#define WEBKIT_HAS_NEW_WEBFILTEROPERATION_API 1
static WebFilterOperation createGrayscaleFilter(float amount) { return WebFilterOperation(FilterTypeGrayscale, amount); }
static WebFilterOperation createSepiaFilter(float amount) { return WebFilterOperation(FilterTypeSepia, amount); }
@@ -82,6 +90,7 @@ public:
static WebFilterOperation createBlurFilter(float amount) { return WebFilterOperation(FilterTypeBlur, amount); }
static WebFilterOperation createDropShadowFilter(WebPoint offset, float stdDeviation, WebColor color) { return WebFilterOperation(FilterTypeDropShadow, offset, stdDeviation, color); }
static WebFilterOperation createColorMatrixFilter(SkScalar matrix[20]) { return WebFilterOperation(FilterTypeColorMatrix, matrix); }
+ static WebFilterOperation createZoomFilter(WebRect rect, int inset) { return WebFilterOperation(FilterTypeZoom, rect, inset); }
bool equals(const WebFilterOperation& other) const;
@@ -92,6 +101,7 @@ private:
WebPoint m_dropShadowOffset;
WebColor m_dropShadowColor;
SkScalar m_matrix[20];
+ WebRect m_zoomRect;
WebFilterOperation(FilterType type, float amount)
{
@@ -111,6 +121,14 @@ private:
}
WebFilterOperation(FilterType, SkScalar matrix[20]);
+
+ WebFilterOperation(FilterType type, WebRect rect, float inset)
+ {
+ WEBKIT_ASSERT(type == FilterTypeZoom);
+ m_type = type;
+ m_amount = inset;
+ m_zoomRect = rect;
+ }
};
inline bool operator==(const WebFilterOperation& a, const WebFilterOperation& b)
diff --git a/Source/Platform/chromium/public/WebGraphicsContext3D.h b/Source/Platform/chromium/public/WebGraphicsContext3D.h
index c0f790b8a..312d4fab7 100644
--- a/Source/Platform/chromium/public/WebGraphicsContext3D.h
+++ b/Source/Platform/chromium/public/WebGraphicsContext3D.h
@@ -438,6 +438,11 @@ public:
virtual void produceTextureCHROMIUM(WGC3Denum target, const WGC3Dbyte* mailbox) { }
virtual void consumeTextureCHROMIUM(WGC3Denum target, const WGC3Dbyte* mailbox) { }
+ // GL_EXT_debug_marker
+ virtual void insertEventMarkerEXT(const WGC3Dchar* marker) { }
+ virtual void pushGroupMarkerEXT(const WGC3Dchar* marker) { }
+ virtual void popGroupMarkerEXT(void) { }
+
GrGLInterface* createGrGLInterface();
protected:
diff --git a/Source/Platform/chromium/public/WebHTTPBody.h b/Source/Platform/chromium/public/WebHTTPBody.h
index 5c638602a..13bf5fed1 100644
--- a/Source/Platform/chromium/public/WebHTTPBody.h
+++ b/Source/Platform/chromium/public/WebHTTPBody.h
@@ -48,12 +48,15 @@ class WebHTTPBodyPrivate;
class WebHTTPBody {
public:
struct Element {
- enum Type { TypeData, TypeFile, TypeBlob } type;
+ enum Type { TypeData, TypeFile, TypeBlob, TypeURL } type;
WebData data;
WebString filePath;
long long fileStart;
long long fileLength; // -1 means to the end of the file.
double modificationTime;
+ WebURL url; // For TypeBlob or TypeURL.
+
+ // FIXME: deprecate this.
WebURL blobURL;
};
@@ -87,6 +90,9 @@ public:
WEBKIT_EXPORT void appendFileRange(const WebString&, long long fileStart, long long fileLength, double modificationTime);
WEBKIT_EXPORT void appendBlob(const WebURL&);
+ // Append a resource which is identified by URL. Currently we only support FileSystem URL.
+ WEBKIT_EXPORT void appendURLRange(const WebURL&, long long start, long long length, double modificationTime);
+
// Identifies a particular form submission instance. A value of 0 is
// used to indicate an unspecified identifier.
WEBKIT_EXPORT long long identifier() const;
diff --git a/Source/Platform/chromium/public/WebIOSurfaceLayer.h b/Source/Platform/chromium/public/WebIOSurfaceLayer.h
index 37a4c6792..bcf14112a 100644
--- a/Source/Platform/chromium/public/WebIOSurfaceLayer.h
+++ b/Source/Platform/chromium/public/WebIOSurfaceLayer.h
@@ -30,27 +30,19 @@
#include "WebLayer.h"
#include "WebSize.h"
-namespace WebCore {
-class IOSurfaceLayerChromium;
-}
-
namespace WebKit {
// This class represents a layer that renders an externally managed IOSurface.
-class WebIOSurfaceLayer : public WebLayer {
+class WebIOSurfaceLayer {
public:
- WEBKIT_EXPORT static WebIOSurfaceLayer create();
+ WEBKIT_EXPORT static WebIOSurfaceLayer* create();
- WebIOSurfaceLayer() { }
virtual ~WebIOSurfaceLayer() { }
- // Sets the IO surface id that represents this layer's contents.
- WEBKIT_EXPORT void setIOSurfaceProperties(unsigned ioSurfaceId, WebSize);
+ virtual WebLayer* layer() = 0;
-private:
-#if WEBKIT_IMPLEMENTATION
- explicit WebIOSurfaceLayer(PassRefPtr<WebCore::IOSurfaceLayerChromium>);
-#endif
+ // Sets the IO surface id that represents this layer's contents.
+ virtual void setIOSurfaceProperties(unsigned ioSurfaceId, WebSize) = 0;
};
} // namespace WebKit
diff --git a/Source/Platform/chromium/public/WebImageLayer.h b/Source/Platform/chromium/public/WebImageLayer.h
index a916835f2..c7737f31a 100644
--- a/Source/Platform/chromium/public/WebImageLayer.h
+++ b/Source/Platform/chromium/public/WebImageLayer.h
@@ -30,24 +30,16 @@
#include "WebCommon.h"
#include "WebLayer.h"
-namespace WebCore {
-class ImageLayerChromium;
-}
-
namespace WebKit {
-class WebImageLayer : public WebLayer {
+class WebImageLayer {
public:
- WEBKIT_EXPORT static WebImageLayer create();
+ WEBKIT_EXPORT static WebImageLayer* create();
- WebImageLayer() { }
virtual ~WebImageLayer() { }
- WEBKIT_EXPORT void setBitmap(SkBitmap);
-
-#if WEBKIT_IMPLEMENTATION
- explicit WebImageLayer(PassRefPtr<WebCore::ImageLayerChromium>);
-#endif
+ virtual WebLayer* layer() = 0;
+ virtual void setBitmap(SkBitmap) = 0;
};
} // namespace WebKit
diff --git a/Source/Platform/chromium/public/WebLayer.h b/Source/Platform/chromium/public/WebLayer.h
index ec602411b..60ed69423 100644
--- a/Source/Platform/chromium/public/WebLayer.h
+++ b/Source/Platform/chromium/public/WebLayer.h
@@ -29,12 +29,13 @@
#include "WebAnimation.h"
#include "WebColor.h"
#include "WebCommon.h"
+#include "WebPoint.h"
#include "WebPrivatePtr.h"
+#include "WebRect.h"
#include "WebString.h"
#include "WebVector.h"
class SkMatrix44;
-namespace WebCore { class LayerChromium; }
namespace WebKit {
class WebAnimationDelegate;
@@ -44,80 +45,69 @@ struct WebFloatPoint;
struct WebFloatRect;
struct WebSize;
+class WebLayerImpl;
+
class WebLayer {
public:
- WEBKIT_EXPORT static WebLayer create();
-
- WebLayer() { }
- WebLayer(const WebLayer& layer) { assign(layer); }
- virtual ~WebLayer() { reset(); }
- WebLayer& operator=(const WebLayer& layer)
- {
- assign(layer);
- return *this;
- }
- bool isNull() const { return m_private.isNull(); }
- WEBKIT_EXPORT void reset();
- WEBKIT_EXPORT void assign(const WebLayer&);
- WEBKIT_EXPORT bool equals(const WebLayer&) const;
+#define WEBLAYER_IS_PURE_VIRTUAL
+ WEBKIT_EXPORT static WebLayer* create();
- // Sets a region of the layer as invalid, i.e. needs to update its content.
- WEBKIT_EXPORT void invalidateRect(const WebFloatRect&);
+ virtual ~WebLayer() { }
- // Sets the entire layer as invalid, i.e. needs to update its content.
- WEBKIT_EXPORT void invalidate();
+ // Returns a positive ID that will be unique across all WebLayers allocated in this process.
+ virtual int id() const = 0;
- WEBKIT_EXPORT WebLayer rootLayer() const;
- WEBKIT_EXPORT WebLayer parent() const;
- WEBKIT_EXPORT size_t numberOfChildren() const;
- WEBKIT_EXPORT WebLayer childAt(size_t) const;
+ // Sets a region of the layer as invalid, i.e. needs to update its content.
+ virtual void invalidateRect(const WebFloatRect&) = 0;
- 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);
- WEBKIT_EXPORT void setChildren(const WebVector<WebLayer>&);
- WEBKIT_EXPORT void removeFromParent();
- WEBKIT_EXPORT void removeAllChildren();
+ // Sets the entire layer as invalid, i.e. needs to update its content.
+ virtual void invalidate() = 0;
- WEBKIT_EXPORT void setAnchorPoint(const WebFloatPoint&);
- WEBKIT_EXPORT WebFloatPoint anchorPoint() const;
+ // These functions do not take ownership of the WebLayer* parameter.
+ virtual void addChild(WebLayer*) = 0;
+ virtual void insertChild(WebLayer*, size_t index) = 0;
+ virtual void replaceChild(WebLayer* reference, WebLayer* newLayer) = 0;
+ virtual void setChildren(const WebVector<WebLayer*>&) = 0;
+ virtual void removeFromParent() = 0;
+ virtual void removeAllChildren() = 0;
- WEBKIT_EXPORT void setAnchorPointZ(float);
- WEBKIT_EXPORT float anchorPointZ() const;
+ virtual void setAnchorPoint(const WebFloatPoint&) = 0;
+ virtual WebFloatPoint anchorPoint() const = 0;
- WEBKIT_EXPORT void setBounds(const WebSize&);
- WEBKIT_EXPORT WebSize bounds() const;
+ virtual void setAnchorPointZ(float) = 0;
+ virtual float anchorPointZ() const = 0;
- WEBKIT_EXPORT void setMasksToBounds(bool);
- WEBKIT_EXPORT bool masksToBounds() const;
+ virtual void setBounds(const WebSize&) = 0;
+ virtual WebSize bounds() const = 0;
- WEBKIT_EXPORT void setMaskLayer(const WebLayer&);
- WEBKIT_EXPORT WebLayer maskLayer() const;
+ virtual void setMasksToBounds(bool) = 0;
+ virtual bool masksToBounds() const = 0;
- WEBKIT_EXPORT void setReplicaLayer(const WebLayer&);
+ virtual void setMaskLayer(WebLayer*) = 0;
+ virtual void setReplicaLayer(WebLayer*) = 0;
- WEBKIT_EXPORT void setOpacity(float);
- WEBKIT_EXPORT float opacity() const;
+ virtual void setOpacity(float) = 0;
+ virtual float opacity() const = 0;
- WEBKIT_EXPORT void setOpaque(bool);
- WEBKIT_EXPORT bool opaque() const;
+ virtual void setOpaque(bool) = 0;
+ virtual bool opaque() const = 0;
- WEBKIT_EXPORT void setPosition(const WebFloatPoint&);
- WEBKIT_EXPORT WebFloatPoint position() const;
+ virtual void setPosition(const WebFloatPoint&) = 0;
+ virtual WebFloatPoint position() const = 0;
- WEBKIT_EXPORT void setSublayerTransform(const SkMatrix44&);
- WEBKIT_EXPORT void setSublayerTransform(const WebTransformationMatrix&);
- WEBKIT_EXPORT SkMatrix44 sublayerTransform() const;
+ virtual void setSublayerTransform(const SkMatrix44&) = 0;
+ virtual void setSublayerTransform(const WebTransformationMatrix&) = 0;
+ virtual SkMatrix44 sublayerTransform() const = 0;
- WEBKIT_EXPORT void setTransform(const SkMatrix44&);
- WEBKIT_EXPORT void setTransform(const WebTransformationMatrix&);
- WEBKIT_EXPORT SkMatrix44 transform() const;
+ virtual void setTransform(const SkMatrix44&) = 0;
+ virtual void setTransform(const WebTransformationMatrix&) = 0;
+ virtual SkMatrix44 transform() const = 0;
// Sets whether the layer draws its content when compositing.
- WEBKIT_EXPORT void setDrawsContent(bool);
- WEBKIT_EXPORT bool drawsContent() const;
+ virtual void setDrawsContent(bool) = 0;
+ virtual bool drawsContent() const = 0;
- WEBKIT_EXPORT void setPreserves3D(bool);
+ virtual void setPreserves3D(bool) = 0;
// Mark that this layer should use its parent's transform and double-sided
// properties in determining this layer's backface visibility instead of
@@ -126,107 +116,68 @@ public:
// Note: This API is to work around issues with visibility the handling of
// WebKit layers that have a contents layer (canvas, plugin, WebGL, video,
// etc).
- WEBKIT_EXPORT void setUseParentBackfaceVisibility(bool);
+ virtual void setUseParentBackfaceVisibility(bool) = 0;
- WEBKIT_EXPORT void setBackgroundColor(WebColor);
+ virtual void setBackgroundColor(WebColor) = 0;
// Clear the filters in use by passing in a newly instantiated
// WebFilterOperations object.
- WEBKIT_EXPORT void setFilters(const WebFilterOperations&);
+ virtual void setFilters(const WebFilterOperations&) = 0;
// Apply filters to pixels that show through the background of this layer.
// Note: These filters are only possible on layers that are drawn directly
// to a root render surface with an opaque background. This means if an
// ancestor of the background-filtered layer sets certain properties
// (opacity, transforms), it may conflict and hide the background filters.
- WEBKIT_EXPORT void setBackgroundFilters(const WebFilterOperations&);
+ virtual void setBackgroundFilters(const WebFilterOperations&) = 0;
- WEBKIT_EXPORT void setDebugBorderColor(const WebColor&);
- WEBKIT_EXPORT void setDebugBorderWidth(float);
- WEBKIT_EXPORT void setDebugName(WebString);
+ virtual void setDebugBorderColor(const WebColor&) = 0;
+ virtual void setDebugBorderWidth(float) = 0;
+ virtual void setDebugName(WebString) = 0;
// An animation delegate is notified when animations are started and
// stopped. The WebLayer does not take ownership of the delegate, and it is
// the responsibility of the client to reset the layer's delegate before
// deleting the delegate.
- WEBKIT_EXPORT void setAnimationDelegate(WebAnimationDelegate*);
+ virtual void setAnimationDelegate(WebAnimationDelegate*) = 0;
// Returns false if the animation cannot be added.
- WEBKIT_EXPORT bool addAnimation(const WebAnimation&);
+ virtual bool addAnimation(WebAnimation*) = 0;
// Removes all animations with the given id.
- WEBKIT_EXPORT void removeAnimation(int animationId);
+ virtual void removeAnimation(int animationId) = 0;
// Removes all animations with the given id targeting the given property.
- WEBKIT_EXPORT void removeAnimation(int animationId, WebAnimation::TargetProperty);
+ virtual void removeAnimation(int animationId, WebAnimation::TargetProperty) = 0;
// Pauses all animations with the given id.
- WEBKIT_EXPORT void pauseAnimation(int animationId, double timeOffset);
+ virtual void pauseAnimation(int animationId, double timeOffset) = 0;
// The following functions suspend and resume all animations. The given time
// is assumed to use the same time base as monotonicallyIncreasingTime().
- WEBKIT_EXPORT void suspendAnimations(double monotonicTime);
- WEBKIT_EXPORT void resumeAnimations(double monotonicTime);
+ virtual void suspendAnimations(double monotonicTime) = 0;
+ virtual void resumeAnimations(double monotonicTime) = 0;
+
+ // Returns true if this layer has any active animations - useful for tests.
+ virtual bool hasActiveAnimation() = 0;
// Transfers all animations running on the current layer.
- WEBKIT_EXPORT void transferAnimationsTo(WebLayer*);
+ virtual void transferAnimationsTo(WebLayer*) = 0;
- // DEPRECATED.
- // This requests that this layer's compositor-managed textures always be reserved
- // when determining texture limits.
- WEBKIT_EXPORT void setAlwaysReserveTextures(bool);
+ // Scrolling
+ virtual void setScrollPosition(WebPoint) = 0;
+ virtual void setScrollable(bool) = 0;
+ virtual void setHaveWheelEventHandlers(bool) = 0;
+ virtual void setShouldScrollOnMainThread(bool) = 0;
+ virtual void setNonFastScrollableRegion(const WebVector<WebRect>&) = 0;
+ virtual void setIsContainerForFixedPositionLayers(bool) = 0;
+ virtual void setFixedToContainerLayer(bool) = 0;
// 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);
-
- // Drops this layer's render surface, if it has one. Used to break cycles in some
- // cases - if you aren't sure, you don't need to call this.
- WEBKIT_EXPORT void clearRenderSurface();
-
- template<typename T> T to()
- {
- T res;
- res.WebLayer::assign(*this);
- return res;
- }
-
- template<typename T> const T toConst() const
- {
- T res;
- res.WebLayer::assign(*this);
- return res;
- }
-
-#if WEBKIT_IMPLEMENTATION
- WebLayer(const WTF::PassRefPtr<WebCore::LayerChromium>&);
- WebLayer& operator=(const WTF::PassRefPtr<WebCore::LayerChromium>&);
- operator WTF::PassRefPtr<WebCore::LayerChromium>() const;
- template<typename T> T* unwrap() const
- {
- return static_cast<T*>(m_private.get());
- }
-
- template<typename T> const T* constUnwrap() const
- {
- return static_cast<const T*>(m_private.get());
- }
-#endif
-
-protected:
- WebPrivatePtr<WebCore::LayerChromium> m_private;
+ virtual void setForceRenderSurface(bool) = 0;
};
-inline bool operator==(const WebLayer& a, const WebLayer& b)
-{
- return a.equals(b);
-}
-
-inline bool operator!=(const WebLayer& a, const WebLayer& b)
-{
- return !(a == b);
-}
-
} // namespace WebKit
#endif // WebLayer_h
diff --git a/Source/Platform/chromium/public/WebScrollableLayer.h b/Source/Platform/chromium/public/WebScrollableLayer.h
deleted file mode 100644
index ea02f8c73..000000000
--- a/Source/Platform/chromium/public/WebScrollableLayer.h
+++ /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 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"
-#include "WebRect.h"
-#include "WebVector.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);
- WEBKIT_EXPORT void setNonFastScrollableRegion(const WebVector<WebRect>&);
- WEBKIT_EXPORT void setIsContainerForFixedPositionLayers(bool);
- WEBKIT_EXPORT void setFixedToContainerLayer(bool);
-
-
-#if WEBKIT_IMPLEMENTATION
- WebScrollableLayer(const WTF::PassRefPtr<WebCore::LayerChromium>& layer) : WebLayer(layer) { }
-#endif
-};
-
-} // namespace WebKit
-
-#endif // WebScrollableLayer_h
diff --git a/Source/Platform/chromium/public/WebScrollbarLayer.h b/Source/Platform/chromium/public/WebScrollbarLayer.h
index 1bfe7d6ab..451a0b9c1 100644
--- a/Source/Platform/chromium/public/WebScrollbarLayer.h
+++ b/Source/Platform/chromium/public/WebScrollbarLayer.h
@@ -32,29 +32,20 @@
namespace WebCore {
class Scrollbar;
-class ScrollbarLayerChromium;
}
namespace WebKit {
-class WebScrollbarLayer : public WebLayer {
+class WebScrollbarLayer {
public:
- WebScrollbarLayer() { }
- WebScrollbarLayer(const WebScrollbarLayer& layer) : WebLayer(layer) { }
virtual ~WebScrollbarLayer() { }
- WebScrollbarLayer& operator=(const WebScrollbarLayer& layer)
- {
- WebLayer::assign(layer);
- return *this;
- }
- WEBKIT_EXPORT void setScrollLayer(const WebLayer);
+ virtual WebLayer* layer() = 0;
+
+ virtual void setScrollLayer(WebLayer*) = 0;
#if WEBKIT_IMPLEMENTATION
- static WebScrollbarLayer create(WebCore::Scrollbar*, WebScrollbarThemePainter, PassOwnPtr<WebScrollbarThemeGeometry>);
- explicit WebScrollbarLayer(const WTF::PassRefPtr<WebCore::ScrollbarLayerChromium>&);
- WebScrollbarLayer& operator=(const WTF::PassRefPtr<WebCore::ScrollbarLayerChromium>&);
- operator WTF::PassRefPtr<WebCore::ScrollbarLayerChromium>() const;
+ WEBKIT_EXPORT static WebScrollbarLayer* create(WebCore::Scrollbar*, WebScrollbarThemePainter, PassOwnPtr<WebScrollbarThemeGeometry>);
#endif
};
diff --git a/Source/Platform/chromium/public/WebSolidColorLayer.h b/Source/Platform/chromium/public/WebSolidColorLayer.h
index ad9123d96..02e46f047 100644
--- a/Source/Platform/chromium/public/WebSolidColorLayer.h
+++ b/Source/Platform/chromium/public/WebSolidColorLayer.h
@@ -26,21 +26,20 @@
#ifndef WebSolidColorLayer_h
#define WebSolidColorLayer_h
+#include "WebColor.h"
#include "WebCommon.h"
-#include "WebFloatRect.h"
-#include "WebLayer.h"
namespace WebKit {
-class WebSolidColorLayerImpl;
+class WebLayer;
-class WebSolidColorLayer : public WebLayer {
+class WebSolidColorLayer {
public:
- WEBKIT_EXPORT static WebSolidColorLayer create();
- WEBKIT_EXPORT void setBackgroundColor(const WebColor&);
+ WEBKIT_EXPORT static WebSolidColorLayer* create();
-#if WEBKIT_IMPLEMENTATION
- WebSolidColorLayer(const WTF::PassRefPtr<WebSolidColorLayerImpl>&);
-#endif
+ virtual ~WebSolidColorLayer() { }
+
+ virtual WebLayer* layer() = 0;
+ virtual void setBackgroundColor(WebColor) = 0;
};
} // namespace WebKit
diff --git a/Source/Platform/chromium/public/WebVideoLayer.h b/Source/Platform/chromium/public/WebVideoLayer.h
index 54da3454b..1acfff54a 100644
--- a/Source/Platform/chromium/public/WebVideoLayer.h
+++ b/Source/Platform/chromium/public/WebVideoLayer.h
@@ -29,27 +29,20 @@
#include "WebCommon.h"
#include "WebLayer.h"
-namespace WebCore {
-class VideoLayerChromium;
-}
-
namespace WebKit {
class WebVideoFrameProvider;
-class WebVideoLayer : public WebLayer {
+class WebVideoLayer {
public:
- WEBKIT_EXPORT static WebVideoLayer create(WebVideoFrameProvider*);
+ WEBKIT_EXPORT static WebVideoLayer* create(WebVideoFrameProvider*);
- WebVideoLayer() { }
virtual ~WebVideoLayer() { }
- // Returns true if this layer is actively rendering (e.g. currently attached to a WebLayerTreeView).
- WEBKIT_EXPORT bool active() const;
+ virtual WebLayer* layer() = 0;
-#if WEBKIT_IMPLEMENTATION
- explicit WebVideoLayer(PassRefPtr<WebCore::VideoLayerChromium>);
-#endif
+ // Returns true if this layer is actively rendering (e.g. currently attached to a WebLayerTreeView).
+ virtual bool active() const = 0;
};
} // namespace WebKit
diff --git a/Source/QtWebKit.pro b/Source/QtWebKit.pro
index e0fcb7163..b10c7acf4 100644
--- a/Source/QtWebKit.pro
+++ b/Source/QtWebKit.pro
@@ -26,8 +26,10 @@ declarative.makefile = Makefile.declarative
contains(DEFINES, HAVE_QTQUICK=1): SUBDIRS += declarative
!no_webkit1 {
- tests.file = tests.pri
- SUBDIRS += tests
+ contains(DEFINES, HAVE_QTTESTLIB=1) {
+ tests.file = tests.pri
+ SUBDIRS += tests
+ }
examples.file = WebKit/qt/examples/examples.pro
examples.CONFIG += no_default_target
diff --git a/Source/ThirdParty/ANGLE/src/libEGL/libEGL.vcproj b/Source/ThirdParty/ANGLE/src/libEGL/libEGL.vcproj
index c3e8a4b9e..d02d292fe 100644
--- a/Source/ThirdParty/ANGLE/src/libEGL/libEGL.vcproj
+++ b/Source/ThirdParty/ANGLE/src/libEGL/libEGL.vcproj
@@ -67,6 +67,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
AdditionalDependencies="d3d9.lib dxguid.lib dwmapi.lib"
LinkIncremental="2"
ModuleDefinitionFile="libEGL.def"
@@ -148,6 +149,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
AdditionalDependencies="d3d9.lib dxguid.lib dwmapi.lib"
LinkIncremental="1"
ModuleDefinitionFile="libEGL.def"
@@ -232,6 +234,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
AdditionalDependencies="d3d9.lib dxguid.lib dwmapi.lib"
LinkIncremental="2"
ModuleDefinitionFile="libEGL.def"
@@ -314,6 +317,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
AdditionalDependencies="d3d9.lib dxguid.lib dwmapi.lib"
LinkIncremental="1"
ModuleDefinitionFile="libEGL.def"
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.vcproj b/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.vcproj
index 3bc836399..d97d4e92c 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.vcproj
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.vcproj
@@ -67,6 +67,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
AdditionalDependencies="d3d9.lib D3dx9.lib d3dcompiler.lib"
LinkIncremental="2"
ModuleDefinitionFile="libGLESv2.def"
@@ -147,6 +148,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
AdditionalDependencies="d3d9.lib D3dx9.lib d3dcompiler.lib"
LinkIncremental="1"
IgnoreAllDefaultLibraries="false"
@@ -231,6 +233,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
AdditionalDependencies="d3d9.lib D3dx9.lib d3dcompiler.lib"
LinkIncremental="2"
ModuleDefinitionFile="libGLESv2.def"
@@ -312,6 +315,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
AdditionalDependencies="d3d9.lib D3dx9.lib d3dcompiler.lib"
LinkIncremental="1"
IgnoreAllDefaultLibraries="false"
diff --git a/Source/ThirdParty/gtest/msvc/gtest_prod_test-md.vcproj b/Source/ThirdParty/gtest/msvc/gtest_prod_test-md.vcproj
index 4071d28fe..255b49428 100644
--- a/Source/ThirdParty/gtest/msvc/gtest_prod_test-md.vcproj
+++ b/Source/ThirdParty/gtest/msvc/gtest_prod_test-md.vcproj
@@ -31,6 +31,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
OutputFile="$(OutDir)/gtest_prod_test.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
@@ -76,6 +77,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
OutputFile="$(OutDir)/gtest_prod_test.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
diff --git a/Source/ThirdParty/gtest/msvc/gtest_prod_test.vcproj b/Source/ThirdParty/gtest/msvc/gtest_prod_test.vcproj
index 998c75808..8fe6f24d3 100644
--- a/Source/ThirdParty/gtest/msvc/gtest_prod_test.vcproj
+++ b/Source/ThirdParty/gtest/msvc/gtest_prod_test.vcproj
@@ -31,6 +31,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
OutputFile="$(OutDir)/gtest_prod_test.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
@@ -76,6 +77,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
OutputFile="$(OutDir)/gtest_prod_test.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
diff --git a/Source/ThirdParty/gtest/msvc/gtest_unittest-md.vcproj b/Source/ThirdParty/gtest/msvc/gtest_unittest-md.vcproj
index 152593975..aeaefd035 100644
--- a/Source/ThirdParty/gtest/msvc/gtest_unittest-md.vcproj
+++ b/Source/ThirdParty/gtest/msvc/gtest_unittest-md.vcproj
@@ -31,6 +31,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
OutputFile="$(OutDir)/gtest_unittest.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
@@ -76,6 +77,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
OutputFile="$(OutDir)/gtest_unittest.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
diff --git a/Source/ThirdParty/gtest/msvc/gtest_unittest.vcproj b/Source/ThirdParty/gtest/msvc/gtest_unittest.vcproj
index 2b2d74345..560346907 100644
--- a/Source/ThirdParty/gtest/msvc/gtest_unittest.vcproj
+++ b/Source/ThirdParty/gtest/msvc/gtest_unittest.vcproj
@@ -31,6 +31,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
OutputFile="$(OutDir)/gtest_unittest.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
@@ -76,6 +77,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
OutputFile="$(OutDir)/gtest_unittest.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog
index bc761aabd..e54a38b07 100644
--- a/Source/WTF/ChangeLog
+++ b/Source/WTF/ChangeLog
@@ -1,3 +1,158 @@
+2012-08-20 Dominik Röttsches <dominik.rottsches@intel.com>
+
+ The 2d.imageData.object.round canvas test is failing
+ https://bugs.webkit.org/show_bug.cgi?id=40272
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ According to the Uint8ClampedArray spec (http://www.khronos.org/registry/typedarray/specs/latest/#7.1)
+ which references WebIDL's clamping rules, with implications defined in http://www.w3.org/TR/WebIDL/#es-octet
+ we need to round to nearest integer, and to the even one if exactly halfway in between.
+ As a solution: applying C99's lrint which, in default rounding mode, does that.
+
+ The updated version of test 2d.imageData.object.round.html test passes now.
+
+ * wtf/MathExtras.h:
+ (lrint): Assembly based implementation for MSVC under X86, otherwise falling back to casting.
+ * wtf/Uint8ClampedArray.h:
+ (WTF::Uint8ClampedArray::set): lrint instead of simple rounding.
+
+2012-08-17 Michael Saboff <msaboff@apple.com>
+
+ Add ability to create AtomicString using LChar* buffer and length
+ https://bugs.webkit.org/show_bug.cgi?id=94381
+
+ Reviewed by Geoffrey Garen.
+
+ Allows the use of 8 bit string data directly without converting to 16 bits first.
+
+ * wtf/text/AtomicString.cpp:
+ (WTF::LCharBufferTranslator::hash):
+ (LCharBufferTranslator):
+ (WTF::LCharBufferTranslator::equal):
+ (WTF::LCharBufferTranslator::translate):
+ (WTF::AtomicString::add):
+ * wtf/text/AtomicString.h:
+ (WTF::AtomicString::AtomicString):
+ (AtomicString):
+ * wtf/text/StringImpl.h:
+ (StringImpl):
+
+2012-08-17 Benjamin Poulain <bpoulain@apple.com>
+
+ Make it easier to append a literal to StringBuilder
+ https://bugs.webkit.org/show_bug.cgi?id=94273
+
+ Reviewed by Kentaro Hara.
+
+ * wtf/text/StringBuilder.h:
+ (WTF::StringBuilder::appendLiteral): Add the method StringBuilder::appendLiteral() for efficiently
+ adding a string literal to the StringBuilder.
+
+2012-08-17 Yong Li <yoli@rim.com>
+
+ [BlackBerry] Turn on a few macros for jpeg decoding and image interpolation
+ https://bugs.webkit.org/show_bug.cgi?id=94244
+
+ Reviewed by Antonio Gomes.
+
+ Turn on these macros to get better performance.
+
+ * wtf/Platform.h:
+
+2012-08-17 Milian Wolff <milian.wolff@kdab.com>
+
+ [Qt] QNX build fails due to ctype usage in system headers
+ https://bugs.webkit.org/show_bug.cgi?id=93849
+
+ Reviewed by Simon Hausmann.
+
+ Move the check for whether DisallowCType should be active or not
+ to the DisallowCType.h header. This way, we can update the list
+ of platforms or OSes which do not work with this header in a
+ central place. All users can now safely include the header
+ and do not need to place custom guards around it.
+
+ * config.h:
+ * wtf/DisallowCType.h:
+
+2012-08-17 Milian Wolff <milian.wolff@kdab.com>
+
+ [Qt] QNX build fails due to missing timegm declaration
+ https://bugs.webkit.org/show_bug.cgi?id=93842
+
+ Reviewed by Simon Hausmann.
+
+ On QNX, timegm is declared in nbutils.h and one must link against
+ nbutils to use it.
+
+ * WTF.pri:
+ * wtf/DateMath.cpp:
+
+2012-08-16 Kent Tamura <tkent@chromium.org>
+
+ Build fix for Chromium-mac.
+
+ * wtf/text/WTFString.cpp: Remove unnecessary includes.
+
+2012-08-16 Michael Saboff <msaboff@apple.com>
+
+ HTML Parser should produce 8bit substrings for inline style and script elements
+ https://bugs.webkit.org/show_bug.cgi?id=93742
+
+ Reviewed by Benjamin Poulain.
+
+ Added 8 bit path to String::isAllSpecialCharacters(). Added new String creator
+ that takes a pointer to a UChar array that is known to contain only 8 bit
+ characters (LChar's). Added new helper method to copy contents of a
+ UChar buffer to a LChar buffer. The helper method includes X86-64 intrinsics
+ of SSE family instructions for performance.
+
+ * wtf/Alignment.h:
+ (WTF::isAlignedTo):
+ * wtf/text/ASCIIFastPath.h:
+ (WTF::copyLCharsFromUCharSource):
+ * wtf/text/WTFString.cpp:
+ (WTF::String::make8BitFrom16BitSource):
+ * wtf/text/WTFString.h:
+ (String):
+ (WTF::isAllSpecialCharacters):
+ (WTF::String::isAllSpecialCharacters):
+
+2012-08-16 Benjamin Poulain <bpoulain@apple.com>
+
+ Use initialization from literals for StringStatics
+ https://bugs.webkit.org/show_bug.cgi?id=94185
+
+ Reviewed by Geoffrey Garen.
+
+ * wtf/text/StringStatics.cpp:
+ Remove the arguments for DEFINE_GLOBAL. They are no longer used by the macro.
+ (WTF::AtomicString::init):
+ Use ConstructFromLiteral to initialize the strings faster and to save memory.
+
+2012-08-14 Milian Wolff <milian.wolff@kdab.com>
+
+ [Qt] QNX build fails due to reference to MADV_FREE_REUSE and MADV_FREE_REUSABLE
+ https://bugs.webkit.org/show_bug.cgi?id=93843
+
+ Reviewed by Simon Hausmann.
+
+ QNX does not implement MADV_FREE_REUSE nor MADV_FREE_REUSABLE.
+ The Blackberry port already sets the define to use the system
+ malloc, which is now also done for QNX in general.
+
+ * wtf/Platform.h:
+
+2012-08-13 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] Remove glib-related Find modules and write single new one instead.
+ https://bugs.webkit.org/show_bug.cgi?id=93786
+
+ Reviewed by Rob Buis.
+
+ * wtf/PlatformEfl.cmake: Use GLIB_* instead of Glib_*, and link directly to GIO, as wtf/gobject uses functions from it.
+
2012-08-11 Sam Weinig <sam@webkit.org>
Enable XPC Service based WebProcess with runtime flag
diff --git a/Source/WTF/WTF.pri b/Source/WTF/WTF.pri
index 2cfb6f82b..1d2d4f771 100644
--- a/Source/WTF/WTF.pri
+++ b/Source/WTF/WTF.pri
@@ -31,3 +31,8 @@ win32-* {
LIBS += -lwinmm
LIBS += -lgdi32
}
+
+qnx {
+ # required for timegm
+ LIBS += -lnbutil
+}
diff --git a/Source/WTF/config.h b/Source/WTF/config.h
index 9ce1f8c88..dabdd0ea7 100644
--- a/Source/WTF/config.h
+++ b/Source/WTF/config.h
@@ -62,12 +62,7 @@
#include <wtf/FastMalloc.h>
#endif
-// this breaks compilation of <QFontDatabase>, at least, so turn it off for now
-// Also generates errors on wx on Windows and QNX, because these functions
-// are used from wx and QNX headers.
-#if !PLATFORM(QT) && !PLATFORM(WX) && !OS(QNX)
#include <wtf/DisallowCType.h>
-#endif
#if COMPILER(MSVC)
#define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
diff --git a/Source/WTF/wtf/Alignment.h b/Source/WTF/wtf/Alignment.h
index ac780b96e..7dfda209a 100644
--- a/Source/WTF/wtf/Alignment.h
+++ b/Source/WTF/wtf/Alignment.h
@@ -23,6 +23,8 @@
#include <wtf/Platform.h>
#include <algorithm>
+#include <stdint.h>
+
namespace WTF {
@@ -58,6 +60,11 @@ namespace WTF {
std::swap(a.buffer[i], b.buffer[i]);
}
+ template <uintptr_t mask>
+ inline bool isAlignedTo(const void* pointer)
+ {
+ return !(reinterpret_cast<uintptr_t>(pointer) & mask);
+ }
}
#endif // WTF_Alignment_h
diff --git a/Source/WTF/wtf/DateMath.cpp b/Source/WTF/wtf/DateMath.cpp
index 710bae2bf..e18eeccee 100644
--- a/Source/WTF/wtf/DateMath.cpp
+++ b/Source/WTF/wtf/DateMath.cpp
@@ -102,6 +102,11 @@
#include <sys/timeb.h>
#endif
+#if OS(QNX)
+// qnx6 defines timegm in nbutil.h
+#include <nbutil.h>
+#endif
+
using namespace WTF;
namespace WTF {
diff --git a/Source/WTF/wtf/DisallowCType.h b/Source/WTF/wtf/DisallowCType.h
index 436f7f214..a961f1d0e 100644
--- a/Source/WTF/wtf/DisallowCType.h
+++ b/Source/WTF/wtf/DisallowCType.h
@@ -35,6 +35,14 @@
// ASCII-specific functions instead. This header makes sure we get a compile-time
// error if we use one of the <ctype.h> functions by accident.
+// this breaks compilation of <QFontDatabase>, at least, so turn it off for now
+// Also generates errors on wx on Windows, presumably because these functions
+// are used from wx headers. On GTK+ for Mac many GTK+ files include <libintl.h>
+// or <glib/gi18n-lib.h>, which in turn include <xlocale/_ctype.h> which uses
+// isacii().
+#include <wtf/Platform.h>
+#if !PLATFORM(QT) && !PLATFORM(WX) && !PLATFORM(CHROMIUM) && !(OS(DARWIN) && PLATFORM(GTK)) && !OS(QNX) && !defined(_LIBCPP_VERSION)
+
#include <ctype.h>
#undef isalnum
@@ -72,3 +80,5 @@
#define toupper toupper_WTF_Please_use_ASCIICType_instead_of_ctype_see_comment_in_ASCIICType_h
#endif
+
+#endif
diff --git a/Source/WTF/wtf/MathExtras.h b/Source/WTF/wtf/MathExtras.h
index b03d45d3c..e7d7c00d4 100644
--- a/Source/WTF/wtf/MathExtras.h
+++ b/Source/WTF/wtf/MathExtras.h
@@ -202,6 +202,22 @@ inline double wtf_pow(double x, double y) { return y == 0 ? 1 : pow(x, y); }
#define fmod(x, y) wtf_fmod(x, y)
#define pow(x, y) wtf_pow(x, y)
+// MSVC's math functions do not bring lrint.
+inline long int lrint(double flt)
+{
+ int intgr;
+#if CPU(X86)
+ __asm {
+ fld flt
+ fistp intgr
+ };
+#else
+#pragma message("Falling back to casting for lrint(), causes rounding inaccuracy in halfway case.")
+ intgr = static_cast<int>flt;
+#endif
+ return intgr;
+}
+
#endif // COMPILER(MSVC)
inline double deg2rad(double d) { return d * piDouble / 180.0; }
diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
index 506537734..b426816f4 100644
--- a/Source/WTF/wtf/Platform.h
+++ b/Source/WTF/wtf/Platform.h
@@ -480,10 +480,16 @@
#endif
#endif
-#if PLATFORM(BLACKBERRY)
+#if OS(QNX)
#define USE_SYSTEM_MALLOC 1
+#endif
+
+#if PLATFORM(BLACKBERRY)
#define WTF_USE_MERSENNE_TWISTER_19937 1
#define WTF_USE_SKIA 1
+#define WTF_USE_LOW_QUALITY_IMAGE_INTERPOLATION 1
+#define WTF_USE_LOW_QUALITY_IMAGE_NO_JPEG_DITHERING 1
+#define WTF_USE_LOW_QUALITY_IMAGE_NO_JPEG_FANCY_UPSAMPLING 1
#endif
#if PLATFORM(GTK)
diff --git a/Source/WTF/wtf/PlatformEfl.cmake b/Source/WTF/wtf/PlatformEfl.cmake
index 1a13dbba3..eb85fb9d3 100644
--- a/Source/WTF/wtf/PlatformEfl.cmake
+++ b/Source/WTF/wtf/PlatformEfl.cmake
@@ -13,7 +13,8 @@ LIST(APPEND WTF_SOURCES
LIST(APPEND WTF_LIBRARIES
pthread
- ${Glib_LIBRARIES}
+ ${GLIB_LIBRARIES}
+ ${GLIB_GIO_LIBRARIES}
${ICU_LIBRARIES}
${ICU_I18N_LIBRARIES}
${ECORE_LIBRARIES}
@@ -33,7 +34,7 @@ LIST(APPEND WTF_INCLUDE_DIRECTORIES
${ECORE_INCLUDE_DIRS}
${ECORE_EVAS_INCLUDE_DIRS}
${EVAS_INCLUDE_DIRS}
- ${Glib_INCLUDE_DIRS}
+ ${GLIB_INCLUDE_DIRS}
${ICU_INCLUDE_DIRS}
${JAVASCRIPTCORE_DIR}/wtf/gobject
${JAVASCRIPTCORE_DIR}/wtf/unicode/
diff --git a/Source/WTF/wtf/Uint8ClampedArray.h b/Source/WTF/wtf/Uint8ClampedArray.h
index d63a4e6f5..8505d87ad 100644
--- a/Source/WTF/wtf/Uint8ClampedArray.h
+++ b/Source/WTF/wtf/Uint8ClampedArray.h
@@ -28,7 +28,12 @@
#ifndef Uint8ClampedArray_h
#define Uint8ClampedArray_h
+#include <wtf/Platform.h>
+
#include <wtf/Uint8Array.h>
+#if COMPILER(MSVC)
+#include <wtf/MathExtras.h>
+#endif
namespace WTF {
@@ -100,7 +105,7 @@ void Uint8ClampedArray::set(unsigned index, double value)
value = 0;
else if (value > 255)
value = 255;
- data()[index] = static_cast<unsigned char>(value + 0.5);
+ data()[index] = static_cast<unsigned char>(lrint(value));
}
Uint8ClampedArray::Uint8ClampedArray(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsigned length)
diff --git a/Source/WTF/wtf/text/ASCIIFastPath.h b/Source/WTF/wtf/text/ASCIIFastPath.h
index ace1a687d..c1485b1b3 100644
--- a/Source/WTF/wtf/text/ASCIIFastPath.h
+++ b/Source/WTF/wtf/text/ASCIIFastPath.h
@@ -22,7 +22,11 @@
#ifndef ASCIIFastPath_h
#define ASCIIFastPath_h
+#if OS(DARWIN) && (CPU(X86) || CPU(X86_64))
+#include <emmintrin.h>
+#endif
#include <stdint.h>
+#include <wtf/Alignment.h>
#include <wtf/unicode/Unicode.h>
namespace WTF {
@@ -95,6 +99,45 @@ inline bool charactersAreAllASCII(const CharacterType* characters, size_t length
return !(allCharBits & nonASCIIBitMask);
}
+inline void copyLCharsFromUCharSource(LChar* destination, const UChar* source, size_t length)
+{
+#if OS(DARWIN) && (CPU(X86) || CPU(X86_64))
+ const uintptr_t memoryAccessSize = 16; // Memory accesses on 16 byte (128 bit) alignment
+ const uintptr_t memoryAccessMask = memoryAccessSize - 1;
+
+ size_t i = 0;
+ for (;i < length && !isAlignedTo<memoryAccessMask>(&source[i]); ++i) {
+ ASSERT(!(source[i] & 0xff00));
+ destination[i] = static_cast<LChar>(source[i]);
+ }
+
+ const uintptr_t sourceLoadSize = 32; // Process 32 bytes (16 UChars) each iteration
+ const unsigned ucharsPerLoop = sourceLoadSize / sizeof(UChar);
+ if (length > ucharsPerLoop) {
+ const unsigned endLength = length - ucharsPerLoop + 1;
+ for (; i < endLength; i += ucharsPerLoop) {
+#ifndef NDEBUG
+ for (unsigned checkIndex = 0; checkIndex < ucharsPerLoop; checkIndex++)
+ ASSERT(!(source[i+checkIndex] & 0xff00));
+#endif
+ __m128i first8UChars = _mm_load_si128(reinterpret_cast<const __m128i*>(&source[i]));
+ __m128i second8UChars = _mm_load_si128(reinterpret_cast<const __m128i*>(&source[i+8]));
+ __m128i packedChars = _mm_packus_epi16(first8UChars, second8UChars);
+ _mm_storeu_si128(reinterpret_cast<__m128i*>(&destination[i]), packedChars);
+ }
+ }
+
+ for (; i < length; ++i) {
+ ASSERT(!(source[i] & 0xff00));
+ destination[i] = static_cast<LChar>(source[i]);
+ }
+#else
+ for (size_t i = 0; i < length; ++i) {
+ ASSERT(!(source[i] & 0xff00));
+ destination[i] = static_cast<LChar>(source[i]);
+ }
+#endif
+}
} // namespace WTF
diff --git a/Source/WTF/wtf/text/AtomicString.cpp b/Source/WTF/wtf/text/AtomicString.cpp
index a588117e7..8f14a5fd0 100644
--- a/Source/WTF/wtf/text/AtomicString.cpp
+++ b/Source/WTF/wtf/text/AtomicString.cpp
@@ -298,6 +298,26 @@ PassRefPtr<StringImpl> AtomicString::add(StringImpl* baseString, unsigned start,
SubstringLocation buffer = { baseString, start, length };
return addToStringTable<SubstringLocation, SubstringTranslator>(buffer);
}
+
+typedef HashTranslatorCharBuffer<LChar> LCharBuffer;
+struct LCharBufferTranslator {
+ static unsigned hash(const LCharBuffer& buf)
+ {
+ return StringHasher::computeHashAndMaskTop8Bits(buf.s, buf.length);
+ }
+
+ static bool equal(StringImpl* const& str, const LCharBuffer& buf)
+ {
+ return WTF::equal(str, buf.s, buf.length);
+ }
+
+ static void translate(StringImpl*& location, const LCharBuffer& buf, unsigned hash)
+ {
+ location = StringImpl::create(buf.s, buf.length).leakRef();
+ location->setHash(hash);
+ location->setIsAtomic(true);
+ }
+};
typedef HashTranslatorCharBuffer<char> CharBuffer;
struct CharBufferFromLiteralDataTranslator {
@@ -319,6 +339,18 @@ struct CharBufferFromLiteralDataTranslator {
}
};
+PassRefPtr<StringImpl> AtomicString::add(const LChar* s, unsigned length)
+{
+ if (!s)
+ return 0;
+
+ if (!length)
+ return StringImpl::empty();
+
+ LCharBuffer buffer = { s, length };
+ return addToStringTable<LCharBuffer, LCharBufferTranslator>(buffer);
+}
+
PassRefPtr<StringImpl> AtomicString::addFromLiteralData(const char* characters, unsigned length)
{
ASSERT(characters);
diff --git a/Source/WTF/wtf/text/AtomicString.h b/Source/WTF/wtf/text/AtomicString.h
index 194d30ac4..6b89ac837 100644
--- a/Source/WTF/wtf/text/AtomicString.h
+++ b/Source/WTF/wtf/text/AtomicString.h
@@ -43,6 +43,7 @@ public:
AtomicString() { }
AtomicString(const LChar* s) : m_string(add(s)) { }
AtomicString(const char* s) : m_string(add(s)) { }
+ AtomicString(const LChar* s, unsigned length) : m_string(add(s, length)) { }
AtomicString(const UChar* s, unsigned length) : m_string(add(s, length)) { }
AtomicString(const UChar* s, unsigned length, unsigned existingHash) : m_string(add(s, length, existingHash)) { }
AtomicString(const UChar* s) : m_string(add(s)) { }
@@ -158,6 +159,7 @@ private:
WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> add(const LChar*);
ALWAYS_INLINE static PassRefPtr<StringImpl> add(const char* s) { return add(reinterpret_cast<const LChar*>(s)); };
+ WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> add(const LChar*, unsigned length);
WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> add(const UChar*, unsigned length);
ALWAYS_INLINE static PassRefPtr<StringImpl> add(const char* s, unsigned length) { return add(reinterpret_cast<const char*>(s), length); };
WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> add(const UChar*, unsigned length, unsigned existingHash);
diff --git a/Source/WTF/wtf/text/StringBuilder.h b/Source/WTF/wtf/text/StringBuilder.h
index d896d17b1..37ef5873a 100644
--- a/Source/WTF/wtf/text/StringBuilder.h
+++ b/Source/WTF/wtf/text/StringBuilder.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2010, 2012 Apple Inc. All rights reserved.
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -130,6 +130,9 @@ public:
append(static_cast<LChar>(c));
}
+ template<unsigned charactersCount>
+ ALWAYS_INLINE void appendLiteral(const char (&characters)[charactersCount]) { append(characters, charactersCount - 1); }
+
String toString()
{
shrinkToFit();
diff --git a/Source/WTF/wtf/text/StringImpl.h b/Source/WTF/wtf/text/StringImpl.h
index 2a3ae2bd0..c6059f8d4 100644
--- a/Source/WTF/wtf/text/StringImpl.h
+++ b/Source/WTF/wtf/text/StringImpl.h
@@ -58,6 +58,7 @@ namespace WTF {
struct CStringTranslator;
template<typename CharacterType> struct HashAndCharactersTranslator;
struct HashAndUTF8CharactersTranslator;
+struct LCharBufferTranslator;
struct CharBufferFromLiteralDataTranslator;
struct SubstringTranslator;
struct UCharBufferTranslator;
@@ -77,6 +78,7 @@ class StringImpl {
template<typename CharacterType> friend struct WTF::HashAndCharactersTranslator;
friend struct WTF::HashAndUTF8CharactersTranslator;
friend struct WTF::CharBufferFromLiteralDataTranslator;
+ friend struct WTF::LCharBufferTranslator;
friend struct WTF::SubstringTranslator;
friend struct WTF::UCharBufferTranslator;
friend class AtomicStringImpl;
diff --git a/Source/WTF/wtf/text/StringStatics.cpp b/Source/WTF/wtf/text/StringStatics.cpp
index e749728fc..2e1b955ac 100644
--- a/Source/WTF/wtf/text/StringStatics.cpp
+++ b/Source/WTF/wtf/text/StringStatics.cpp
@@ -53,13 +53,13 @@ StringImpl* StringImpl::empty()
}
WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, nullAtom)
-WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, emptyAtom, "")
-WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, textAtom, "#text")
-WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, commentAtom, "#comment")
-WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, starAtom, "*")
-WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, xmlAtom, "xml")
-WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, xmlnsAtom, "xmlns")
-WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, xlinkAtom, "xlink")
+WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, emptyAtom)
+WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, textAtom)
+WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, commentAtom)
+WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, starAtom)
+WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, xmlAtom)
+WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, xmlnsAtom)
+WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, xlinkAtom)
NEVER_INLINE unsigned StringImpl::hashSlowCase() const
{
@@ -80,12 +80,12 @@ void AtomicString::init()
// Use placement new to initialize the globals.
new (NotNull, (void*)&nullAtom) AtomicString;
new (NotNull, (void*)&emptyAtom) AtomicString("");
- new (NotNull, (void*)&textAtom) AtomicString("#text");
- new (NotNull, (void*)&commentAtom) AtomicString("#comment");
- new (NotNull, (void*)&starAtom) AtomicString("*");
- new (NotNull, (void*)&xmlAtom) AtomicString("xml");
- new (NotNull, (void*)&xmlnsAtom) AtomicString("xmlns");
- new (NotNull, (void*)&xlinkAtom) AtomicString("xlink");
+ new (NotNull, (void*)&textAtom) AtomicString("#text", AtomicString::ConstructFromLiteral);
+ new (NotNull, (void*)&commentAtom) AtomicString("#comment", AtomicString::ConstructFromLiteral);
+ new (NotNull, (void*)&starAtom) AtomicString("*", AtomicString::ConstructFromLiteral);
+ new (NotNull, (void*)&xmlAtom) AtomicString("xml", AtomicString::ConstructFromLiteral);
+ new (NotNull, (void*)&xmlnsAtom) AtomicString("xmlns", AtomicString::ConstructFromLiteral);
+ new (NotNull, (void*)&xlinkAtom) AtomicString("xlink", AtomicString::ConstructFromLiteral);
initialized = true;
}
diff --git a/Source/WTF/wtf/text/WTFString.cpp b/Source/WTF/wtf/text/WTFString.cpp
index 8977444bb..fa3dad71f 100644
--- a/Source/WTF/wtf/text/WTFString.cpp
+++ b/Source/WTF/wtf/text/WTFString.cpp
@@ -775,6 +775,19 @@ CString String::utf8(bool strict) const
return CString(bufferVector.data(), buffer - bufferVector.data());
}
+String String::make8BitFrom16BitSource(const UChar* source, size_t length)
+{
+ if (!length)
+ return String();
+
+ LChar* destination;
+ String result = String::createUninitialized(length, destination);
+
+ copyLCharsFromUCharSource(destination, source, length);
+
+ return result;
+}
+
String String::fromUTF8(const LChar* stringStart, size_t length)
{
if (length > numeric_limits<unsigned>::max())
diff --git a/Source/WTF/wtf/text/WTFString.h b/Source/WTF/wtf/text/WTFString.h
index 2ef384251..c781ae3d2 100644
--- a/Source/WTF/wtf/text/WTFString.h
+++ b/Source/WTF/wtf/text/WTFString.h
@@ -102,7 +102,8 @@ enum FloatConversionFlags {
ShouldTruncateTrailingZeros = 1 << 2
};
-template<bool isSpecialCharacter(UChar)> bool isAllSpecialCharacters(const UChar*, size_t);
+template<bool isSpecialCharacter(UChar), typename CharacterType>
+bool isAllSpecialCharacters(const CharacterType*, size_t);
class String {
public:
@@ -404,6 +405,8 @@ public:
operator BlackBerry::WebKit::WebString() const;
#endif
+ WTF_EXPORT_STRING_API static String make8BitFrom16BitSource(const UChar*, size_t);
+
// String::fromUTF8 will return a null string if
// the input data contains invalid UTF-8 sequences.
WTF_EXPORT_STRING_API static String fromUTF8(const LChar*, size_t);
@@ -578,7 +581,8 @@ inline void appendNumber(Vector<CharacterType>& vector, unsigned char number)
}
}
-template<bool isSpecialCharacter(UChar)> inline bool isAllSpecialCharacters(const UChar* characters, size_t length)
+template<bool isSpecialCharacter(UChar), typename CharacterType>
+inline bool isAllSpecialCharacters(const CharacterType* characters, size_t length)
{
for (size_t i = 0; i < length; ++i) {
if (!isSpecialCharacter(characters[i]))
@@ -587,9 +591,17 @@ template<bool isSpecialCharacter(UChar)> inline bool isAllSpecialCharacters(cons
return true;
}
-template<bool isSpecialCharacter(UChar)> inline bool String::isAllSpecialCharacters() const
+template<bool isSpecialCharacter(UChar)>
+inline bool String::isAllSpecialCharacters() const
{
- return WTF::isAllSpecialCharacters<isSpecialCharacter>(characters(), length());
+ size_t len = length();
+
+ if (!len)
+ return true;
+
+ if (is8Bit())
+ return WTF::isAllSpecialCharacters<isSpecialCharacter, LChar>(characters8(), len);
+ return WTF::isAllSpecialCharacters<isSpecialCharacter, UChar>(characters(), len);
}
// StringHash is the default hash for String
diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt
index 9b9c0a6fb..364369fbe 100644
--- a/Source/WebCore/CMakeLists.txt
+++ b/Source/WebCore/CMakeLists.txt
@@ -392,6 +392,7 @@ SET(WebCore_IDL_FILES
dom/WebKitTransitionEvent.idl
dom/WheelEvent.idl
+ editing/DOMTransaction.idl
editing/UndoManager.idl
fileapi/Blob.idl
@@ -1503,6 +1504,7 @@ SET(WebCore_SOURCES
html/shadow/MeterShadowElement.cpp
html/shadow/ProgressShadowElement.cpp
html/shadow/SliderThumbElement.cpp
+ html/shadow/SpinButtonElement.cpp
html/shadow/TextControlInnerElements.cpp
html/track/LoadableTextTrack.cpp
@@ -1750,6 +1752,7 @@ SET(WebCore_SOURCES
platform/MIMETypeRegistry.cpp
platform/MemoryPressureHandler.cpp
platform/PlatformEvent.cpp
+ platform/PlatformInstrumentation.cpp
platform/RunLoop.cpp
platform/RuntimeApplicationChecks.cpp
platform/ScrollAnimator.cpp
@@ -2544,9 +2547,22 @@ IF (WTF_USE_3D_GRAPHICS)
LIST(APPEND WebCore_LIBRARIES
${OPENGL_gl_LIBRARY}
)
+
+ IF (BISON_VERSION EQUAL "2.5")
+ # Bison 2.5 can not compile generated glslang.
+ # See https://bugs.webkit.org/show_bug.cgi?id=93487
+ LIST(APPEND WebCore_SOURCES
+ ${THIRDPARTY_DIR}/ANGLE/src/compiler/glslang_lex.cpp
+ ${THIRDPARTY_DIR}/ANGLE/src/compiler/glslang_tab.cpp
+ )
+ ELSE ()
+ LIST(APPEND WebCore_SOURCES
+ ${DERIVED_SOURCES_WEBCORE_DIR}/glslang.cpp
+ ${DERIVED_SOURCES_WEBCORE_DIR}/glslang_tab.cpp
+ )
+ ENDIF ()
+
LIST(APPEND WebCore_SOURCES
- ${DERIVED_SOURCES_WEBCORE_DIR}/glslang.cpp
- ${DERIVED_SOURCES_WEBCORE_DIR}/glslang_tab.cpp
${THIRDPARTY_DIR}/ANGLE/src/compiler/BuiltInFunctionEmulator.cpp
${THIRDPARTY_DIR}/ANGLE/src/compiler/CodeGenGLSL.cpp
${THIRDPARTY_DIR}/ANGLE/src/compiler/Compiler.cpp
@@ -2566,8 +2582,6 @@ IF (WTF_USE_3D_GRAPHICS)
${THIRDPARTY_DIR}/ANGLE/src/compiler/DetectDiscontinuity.h
${THIRDPARTY_DIR}/ANGLE/src/compiler/DetectRecursion.cpp
${THIRDPARTY_DIR}/ANGLE/src/compiler/ForLoopUnroll.cpp
- ${THIRDPARTY_DIR}/ANGLE/src/compiler/glslang_lex.cpp
- ${THIRDPARTY_DIR}/ANGLE/src/compiler/glslang_tab.cpp
${THIRDPARTY_DIR}/ANGLE/src/compiler/InfoSink.cpp
${THIRDPARTY_DIR}/ANGLE/src/compiler/Initialize.cpp
${THIRDPARTY_DIR}/ANGLE/src/compiler/InitializeDll.cpp
@@ -2675,9 +2689,9 @@ SET(WebCoreTestSupport_IDL_INCLUDES
)
SET(WebCoreTestSupport_IDL_FILES
- testing/FastMallocStatistics.idl
testing/Internals.idl
testing/InternalSettings.idl
+ testing/MallocStatistics.idl
)
SET(WebCoreTestSupport_SOURCES
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 092930390..61a575fa5 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,11578 @@
+2012-08-17 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] REGRESSION(r125428): fast/profiler/nested-start-and-stop-profiler.html fails
+ https://bugs.webkit.org/show_bug.cgi?id=93897
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Before r125428 run-time methods (wrapped signals, slots or invokable functions) were subclasses of
+ JSInternalFunction and therefore real function objects in the JavaScript sense. r125428 changed them
+ to be just callable objects, but they did not have Function.prototype as prototype anymore for example
+ nor was their name correct (resulting in a layout test failure).
+
+ This patch changes run-time methods back to being real function objects that have a correct name and
+ have Function.prototype in their prototype change
+
+ The objects returned by JSObjectMakeFunctionWithCallbackInjected are light-weight internal function objects
+ that do not support JSObject{Set/Get}Private. Therefore we inject our own prototype right before the
+ Function.prototype prototype, which uses private data to store a pointer to our C++ QtRuntimeMethod object.
+ This complicates the retrieval of the pointer to that instance slightly, which is why this patch introduces
+ the toRuntimeMethod convenience function that looks up our prototype first and does a check for type-safety.
+
+ At the same time the patch removes the length properties from the run-time method itself as well as connect/disconnect.
+ The length property on a function signifies the number of arguments, but in all three cases that number is
+ actually variable, because of overloading. That is why we choose not to expose it in the first place.
+
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::prototypeForSignalsAndSlots):
+ (JSC::Bindings::QtRuntimeMethod::call):
+ (JSC::Bindings::QtRuntimeMethod::jsObjectRef):
+ (JSC::Bindings::QtRuntimeMethod::toRuntimeMethod):
+ (Bindings):
+ (JSC::Bindings::QtRuntimeMethod::connectOrDisconnect):
+ * bridge/qt/qt_runtime.h:
+ (QtRuntimeMethod): Remove unused member variables.
+
+2012-08-21 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed build fix for newer Qt 5 versions: QVariant::WidgetStar has been removed,
+ but fortunately QMetaType has a much more powerful function available for us to use.
+
+ Thanks to Jedrzej Nowacki for the hint :)
+
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::convertQVariantToValue):
+
+2012-08-21 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Remove String::New() from V8 binding (Part 1)
+ https://bugs.webkit.org/show_bug.cgi?id=94574
+
+ Reviewed by Adam Barth.
+
+ Currently, V8 binding mixes String::New(), String::NewSymbol() and v8String().
+ String::New() should be replaced with String::NewSymbol() or v8String(),
+ depending on use cases:
+
+ - If it is a symbol (e.g. attribute name, constant string, etc),
+ String::NewSymbol() should be used. Cache of created symbols is managed by V8.
+
+ - If it is not a symbol, v8String() should be used. Cache of created strings
+ is managed by V8 binding (i.e. StringCache class).
+
+ This patch replaces String::New() for symbols with String::NewSymbol().
+
+ No tests. No change in behavior.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateNamedConstructorCallback):
+ (GenerateNonStandardFunction):
+ (GenerateImplementation):
+ * bindings/scripts/test/V8/V8Float64Array.cpp:
+ (WebCore::ConfigureV8Float64ArrayTemplate):
+ * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
+ (WebCore::ConfigureV8TestActiveDOMObjectTemplate):
+ * bindings/scripts/test/V8/V8TestEventTarget.cpp:
+ (WebCore::ConfigureV8TestEventTargetTemplate):
+ * bindings/scripts/test/V8/V8TestInterface.cpp:
+ (WebCore::ConfigureV8TestInterfaceTemplate):
+ * bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
+ (WebCore::V8TestNamedConstructorConstructor::GetTemplate):
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::ConfigureV8TestObjTemplate):
+ (WebCore::V8TestObj::installPerContextProperties):
+ * bindings/v8/V8DOMConfiguration.cpp:
+ (WebCore::V8DOMConfiguration::batchConfigureConstants):
+ (WebCore::V8DOMConfiguration::batchConfigureCallbacks):
+ (WebCore::V8DOMConfiguration::configureTemplate):
+ * bindings/v8/V8DOMConfiguration.h:
+ (WebCore::V8DOMConfiguration::configureAttribute):
+
+2012-08-21 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r126028.
+ http://trac.webkit.org/changeset/126028
+ https://bugs.webkit.org/show_bug.cgi?id=94576
+
+ it broke compilation on apple webkit win. (Requested by loislo
+ on #webkit).
+
+ * inspector/CodeGeneratorInspector.py:
+ * inspector/InjectedScriptWebGLModule.cpp:
+ (WebCore::InjectedScriptWebGLModule::captureFrame):
+ * inspector/InjectedScriptWebGLModule.h:
+ (InjectedScriptWebGLModule):
+ * inspector/Inspector.json:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ * inspector/InspectorWebGLAgent.cpp:
+ (WebCore::InspectorWebGLAgent::InspectorWebGLAgent):
+ * inspector/InspectorWebGLAgent.h:
+ (WebCore):
+ (WebCore::InspectorWebGLAgent::create):
+ (InspectorWebGLAgent):
+
+2012-08-20 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Web Inspector: NMI: wrong size was reported for immutable StylePropertySet
+ https://bugs.webkit.org/show_bug.cgi?id=94489
+
+ Reviewed by Yury Semikhatsky.
+
+ Immutable StylePropertySet is created via placement new.
+ The rest of the allocated buffer is used as an array of CSSProperty.
+ This means that we don't need to report m_properties member but have to report actual size of the buffer
+ used for both, the object and CSSProperty array.
+
+ * css/StylePropertySet.cpp:
+ (WebCore::immutableStylePropertySetSize):
+ (WebCore):
+ (WebCore::StylePropertySet::createImmutable):
+ (WebCore::StylePropertySet::reportMemoryUsage):
+ * dom/MemoryInstrumentation.h:
+ (WebCore::MemoryObjectInfo::reportObjectInfo):
+ (WebCore::MemoryClassInfo::MemoryClassInfo):
+
+2012-08-20 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move handleOutOfMemory() from V8Proxy to V8Binding
+ https://bugs.webkit.org/show_bug.cgi?id=94563
+
+ Reviewed by Adam Barth.
+
+ To kill V8Proxy, this patch moves handleOutOfMemory() from V8Proxy to V8Binding.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/V8AbstractEventListener.cpp:
+ (WebCore::V8AbstractEventListener::invokeEventHandler):
+ * bindings/v8/V8Binding.cpp:
+ (WebCore::handleOutOfMemory):
+ (WebCore):
+ * bindings/v8/V8Binding.h:
+ (WebCore):
+ * bindings/v8/V8Proxy.cpp:
+ * bindings/v8/V8Proxy.h:
+ (V8Proxy):
+ * bindings/v8/WorkerContextExecutionProxy.cpp:
+ (WebCore::WorkerContextExecutionProxy::runScript):
+
+2012-08-20 MORITA Hajime <morrita@google.com>
+
+ InsertionShouldCallDidNotifyDescendantInsertions should be merged to InsertionShouldCallDidNotifySubtreeInsertions
+ https://bugs.webkit.org/show_bug.cgi?id=94570
+
+ Reviewed by Ryosuke Niwa.
+
+ Node::didNotifySubtreeInsertions() and Node::didNotifyDescendantInsertions() are used for similar purpose and
+ we could unify them to the safer one, which is didNotifySubtreeInsertions().
+
+ This change replaces the last didNotifyDescendantInsertions() implementation in HTMLBodyElement with didNotifySubtreeInsertions()
+ then eliminates related code which is no longer used.
+
+ No new tests. Covered by existing tests.
+
+ * dom/ContainerNodeAlgorithms.h:
+ (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument):
+ (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree):
+ * dom/Node.h: Removed didNotifyDescendantInsertions() stub and InsertionShouldCallDidNotifyDescendantInsertions enum value.
+ * html/HTMLBodyElement.cpp:
+ (WebCore::HTMLBodyElement::insertedInto):
+ (WebCore::HTMLBodyElement::didNotifySubtreeInsertions): morphed from didNotifyDescendantInsertions()
+ * html/HTMLBodyElement.h:
+ (HTMLBodyElement):
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::insertedInto): Remove useless InsertionShouldCallDidNotifyDescendantInsertions return statement.
+
+2012-08-20 Rob Buis <rbuis@rim.com>
+
+ Reduce GradientAttributes object size
+ https://bugs.webkit.org/show_bug.cgi?id=86151
+
+ Reviewed by Eric Seidel.
+
+ This reduces GradientAttributes in memory size by 8 bytes on my 64-bit system. It also
+ reduces the size of RenderSVGResourceLinearGradient and RenderSVGResourceRadialGradient.
+
+ * svg/GradientAttributes.h:
+ (WebCore::GradientAttributes::spreadMethod):
+ (WebCore::GradientAttributes::gradientUnits):
+ (GradientAttributes):
+ (WebCore):
+ (SameSizeAsGradientAttributes):
+
+2012-08-20 Keishi Hattori <keishi@webkit.org>
+
+ Clicking input type=range with padding or border sets wrong value
+ https://bugs.webkit.org/show_bug.cgi?id=94473
+
+ Reviewed by Kent Tamura.
+
+ We should take the padding and border width into account when calculating the value from the mouse location.
+
+ Test: fast/forms/range/range-hit-test-with-padding.html
+
+ * html/shadow/SliderThumbElement.cpp:
+ (WebCore::sliderTrackElementOf):
+ (WebCore):
+ (WebCore::SliderThumbElement::setPositionFromPoint):
+ * html/shadow/SliderThumbElement.h:
+ (WebCore):
+
+2012-08-20 MORITA Hajime <morrita@google.com>
+
+ load event shouldn't fired during node insertion traversals.
+ https://bugs.webkit.org/show_bug.cgi?id=94447
+
+ Reviewed by Ryosuke Niwa.
+
+ HTMLFrameElementBase::didNotifyDescendantInsertions() with empty @src
+ can trigger a load event during ChildNodeInsertionNotifier
+ traversal, whose handler can make DOM tree state inconsistent.
+
+ This change introduces a post traversal hook,
+ didNotifySubtreeInsertions(), for the insertion traversal and
+ replaces the problematic didNotifyDescendantInsertions() with it.
+
+ Since didNotifySubtreeInsertions() is invoked after the traversal,
+ it is safe for event handlers to mutate the tree.
+
+ Test: fast/frames/iframe-onload-and-domnodeinserted.html
+
+ * dom/ContainerNodeAlgorithms.h:
+ (ChildNodeInsertionNotifier): Added a post subtree notification.
+ (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument):
+ (WebCore::ChildNodeInsertionNotifier::notify):
+ * dom/Node.h:
+ (WebCore::Node::didNotifySubtreeInsertions): Newly added.
+ * html/HTMLFrameElementBase.cpp:
+ (WebCore::HTMLFrameElementBase::insertedInto): Now returns InsertionShouldCallDidNotifySubtreeInsertions
+ (WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions): Replaced didNotifyDescendantInsertions()
+ * html/HTMLFrameElementBase.h:
+ (HTMLFrameElementBase):
+
+2012-08-20 Shinya Kawanaka <shinyak@chromium.org>
+
+ Regression(r126127): Build break on multiple platforms
+ https://bugs.webkit.org/show_bug.cgi?id=94568
+
+ Reviewed by Hajime Morita.
+
+ Notation::cloneNode should also have ExceptionCode. We add it in this patch.
+
+ No new tests, no change in behavior.
+
+ * dom/Notation.cpp:
+ (WebCore::Notation::cloneNode):
+ * dom/Notation.h:
+ (Notation):
+
+2012-08-20 Shinya Kawanaka <shinyak@chromium.org>
+
+ ShadowRoot.cloneNode() must always throw a DATA_CLONE_ERR exception.
+ https://bugs.webkit.org/show_bug.cgi?id=91704
+
+ Reviewed by Dimitri Glazkov.
+
+ According to the spec, ShadowRoot.cloneNode() should throw a DATA_CLONE_ERR exception. The existing implementation
+ returned null object instead.
+
+ We change the cloneNode() interface so that we can throw an exception from cloneNode().
+
+ Test: fast/dom/shadow/shadowroot-clonenode.html
+
+ * dom/Attr.cpp:
+ (WebCore::Attr::cloneNode):
+ * dom/Attr.h:
+ * dom/CDATASection.cpp:
+ (WebCore::CDATASection::cloneNode):
+ * dom/CDATASection.h:
+ (CDATASection):
+ * dom/Comment.cpp:
+ (WebCore::Comment::cloneNode):
+ * dom/Comment.h:
+ (Comment):
+ * dom/Document.cpp:
+ (WebCore::Document::cloneNode):
+ * dom/Document.h:
+ (Document):
+ * dom/DocumentFragment.cpp:
+ (WebCore::DocumentFragment::cloneNode):
+ * dom/DocumentFragment.h:
+ (DocumentFragment):
+ * dom/DocumentType.cpp:
+ (WebCore::DocumentType::cloneNode):
+ * dom/DocumentType.h:
+ (DocumentType):
+ * dom/Element.cpp:
+ (WebCore::Element::cloneNode):
+ * dom/Element.h:
+ (Element):
+ * dom/EntityReference.cpp:
+ (WebCore::EntityReference::cloneNode):
+ * dom/EntityReference.h:
+ (EntityReference):
+ * dom/Node.h:
+ (Node):
+ (WebCore::Node::cloneNode):
+ * dom/Node.idl:
+ * dom/ProcessingInstruction.cpp:
+ (WebCore::ProcessingInstruction::cloneNode):
+ * dom/ProcessingInstruction.h:
+ (ProcessingInstruction):
+ * dom/ShadowRoot.cpp:
+ (WebCore::ShadowRoot::cloneNode):
+ * dom/ShadowRoot.h:
+ (ShadowRoot):
+ * dom/Text.cpp:
+ (WebCore::Text::cloneNode):
+ * dom/Text.h:
+ (Text):
+
+2012-08-20 Kent Tamura <tkent@chromium.org>
+
+ [Chromium-win] Use native digits in parsing/formatting dates in the textfield part of input[type=date]
+ https://bugs.webkit.org/show_bug.cgi?id=94281
+
+ Reviewed by Hajime Morita.
+
+ Tests: Add some cases to Source/WebKit/chromium/tests/LocaleWinTest.cpp
+
+ * platform/text/LocaleWin.cpp:
+ (WebCore::LocaleWin::isLocalizedDigit): A helper for parseNumber(). This
+ return true if the specified character is one of native digits.
+ (WebCore::LocaleWin::parseNumber):
+ Try to parse ASCII digits, then try to parse native digtis. This
+ becomes a member of LocaleWin because it uses
+ convertFromLocalizedNumber().
+ (WebCore::LocaleWin::appendNumber): Apply convertToLocalizedNumber().
+ (WebCore::LocaleWin::appendTwoDigitsNumber): ditto.
+ (WebCore::LocaleWin::appendFourDigitsNumber): ditto.
+ * platform/text/LocaleWin.h:
+ (LocaleWin):
+ - Make some static functions member functions of LocaleWin.
+ - Add isLocalizedDigit().
+
+2012-08-20 Kentaro Hara <haraken@chromium.org>
+
+ Rename collectGarbageIfNecessary() to hintForCollectGarbage()
+ https://bugs.webkit.org/show_bug.cgi?id=94455
+
+ Reviewed by Adam Barth.
+
+ This is a follow-up patch for r126098.
+
+ collectGarbage() always collects garbage. collectGarbageIfNecessary() just sends
+ an idle notification to V8, which is just a hint for V8 to trigger GC.
+ To clarify the difference, this patch renames collectGarbageIfNecessary()
+ to hintForCollectGarbage().
+
+ No tests. No change in behavior.
+
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::clearForClose):
+ (WebCore::ScriptController::clearForNavigation):
+ * bindings/v8/V8GCController.cpp:
+ (WebCore::V8GCController::hintForCollectGarbage):
+ * bindings/v8/V8GCController.h:
+ (V8GCController):
+
+2012-08-20 Alexandre Elias <aelias@google.com>
+
+ [chromium] Texture layer should not generate zero textureId quads
+ https://bugs.webkit.org/show_bug.cgi?id=94550
+
+ Reviewed by Adrienne Walker.
+
+ After a context loss, CCTextureLayerImpl would clear its textureId
+ but continued to produce external resources and quads with the zero
+ textureid. Add early returns so that CCTextureLayerImpl becomes
+ inert after a context loss.
+
+ Added assertion in read lock so that dontUseOldResourcesAfterLostContext
+ test catches the problem.
+
+ * platform/graphics/chromium/cc/CCResourceProvider.h:
+ (WebCore::CCScopedLockResourceForRead::CCScopedLockResourceForRead):
+ * platform/graphics/chromium/cc/CCTextureLayerImpl.cpp:
+ (WebCore::CCTextureLayerImpl::willDraw):
+ (WebCore::CCTextureLayerImpl::appendQuads):
+ (WebCore::CCTextureLayerImpl::didDraw):
+ (WebCore::CCTextureLayerImpl::didLoseContext):
+
+2012-08-20 Kent Tamura <tkent@chromium.org>
+
+ [Chromium] Make the popup positioning code testable
+ https://bugs.webkit.org/show_bug.cgi?id=94086
+
+ Reviewed by Hajime Morita.
+
+ Introduce PopupContent interface in order to make a mock.
+
+ * platform/chromium/PopupContainer.cpp:
+ (WebCore::PopupContainer::layoutAndCalculateWidgetRectInternal):
+ - Make it a member of PopupContainer to avoid namespace pollution.
+ - Use PopupContent interface.
+ - Make the code clearer.
+ * platform/chromium/PopupContainer.h:
+ (PopupContainer): Expose layoutAndCalculateWidgetRectInternal.
+
+ * platform/chromium/PopupListBox.cpp:
+ (WebCore::PopupListBox::popupContentHeight): Added.
+ * platform/chromium/PopupListBox.h:
+ (PopupContent): Added.
+ (PopupListBox): Inherit PopupContent.
+ (WebCore::PopupListBox::~PopupListBox):
+ Make this virtual because this class has some virtual functions.
+
+2012-08-20 Tom Sepez <tsepez@chromium.org>
+
+ XSSAuditor too tolerant of injected data: URLs from other "hostless" schemes.
+ https://bugs.webkit.org/show_bug.cgi?id=94547
+
+ Reviewed by Adam Barth.
+
+ Check that there is a host before making same-host tests.
+
+ Test: fast/frames/xss-auditor-handles-file-urls.html
+
+ * html/parser/XSSAuditor.cpp:
+ (WebCore::XSSAuditor::eraseAttributeIfInjected):
+ (WebCore::XSSAuditor::isLikelySafeResource):
+ * html/parser/XSSAuditor.h:
+
+2012-08-20 Elliott Sprehn <esprehn@chromium.org>
+
+ Removed dead code from a very old iteration of CSS counters.
+ https://bugs.webkit.org/show_bug.cgi?id=94539
+
+ Reviewed by Eric Seidel.
+
+ Remove two unused shorts that were on StyleRareNonInheritedData that are no longer used.
+
+ No tests, this just removes dead code.
+
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::diff):
+ * rendering/style/RenderStyle.h:
+ * rendering/style/StyleRareNonInheritedData.cpp:
+ (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+ (WebCore::StyleRareNonInheritedData::operator==):
+ * rendering/style/StyleRareNonInheritedData.h:
+ (StyleRareNonInheritedData):
+
+2012-08-20 Luke Macpherson <macpherson@chromium.org>
+
+ Fix inspector with variables enabled and enable inspector variables tests by default.
+ https://bugs.webkit.org/show_bug.cgi?id=94296
+
+ Reviewed by Hajime Morita.
+
+ Change from using getPropertyName static function to CSSProperty::cssName(), which can resolve variables if needed.
+
+ Covered by inspector/styles/variables.
+
+ * css/PropertySetCSSStyleDeclaration.cpp:
+ (WebCore::PropertySetCSSStyleDeclaration::item):
+
+2012-08-20 Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com>
+
+ Cancel the outstanding vibration pattern if the pattern is 0 or an empty list
+ https://bugs.webkit.org/show_bug.cgi?id=94085
+
+ Reviewed by Kentaro Hara.
+
+ vibrate() method to stop the device from vibrating is getting called before the
+ vibration is in effect. Hence, it is failing to cancel the pre-existing instance
+ of processing vibration patterns.
+
+ This patch cancel the pre-existing instance of the processing vibration patterns
+ always when the vibrate() method called with pattern 0 or an empty list.
+
+ No new tests since there is no return value in the Vibration API to test this
+ particular case. Existing test fast/dom/navigator-vibration.html covers testing of
+ the Vibration API.
+
+ * Modules/vibration/Vibration.cpp:
+ (WebCore::Vibration::vibrate):
+
+2012-08-20 Adam Klein <adamk@chromium.org>
+
+ Allow MutationEvents to be enabled/disabled per context
+ https://bugs.webkit.org/show_bug.cgi?id=94016
+
+ Reviewed by Ojan Vafai.
+
+ Chromium wants to be able to turn MutationEvents off for some
+ Documents (e.g., for Apps V2). This patch makes the firing (and the
+ constructor on DOMWindow) of MutationEvents a per-context feature, with
+ the default being enabled.
+
+ No functional change (since the feature defaults to enabled).
+ It's not clear to me that there's a way to test this in DRT without
+ adding a special hook for this one feature. It will be tested in
+ Chromium once it's implemented in Chromium.
+
+ * dom/ContextFeatures.cpp:
+ (WebCore::ContextFeatures::mutationEventsEnabled): Add new method,
+ with the default being enabled.
+ * dom/ContextFeatures.h:
+ * dom/Document.cpp:
+ (WebCore::Document::addMutationEventListenerTypeIfEnabled): Add new
+ method that checks the ContextFeature flag before adding the passed-in
+ listener type.
+ (WebCore::Document::addListenerTypeIfNeeded): Call the new method
+ instead of addListenerType for MutationEvent types.
+ * dom/Document.h:
+ (WebCore::Document::addListenerType): Make private to avoid anyone
+ outside Document from enabling MutationEvent listeners. All callers
+ must go through addListenerTypeIfNeeded.
+
+2012-08-20 Levi Weintraub <leviw@chromium.org>
+
+ [Sub-pixel Layout] Block selection gap repainting can leave one pixel gaps
+ https://bugs.webkit.org/show_bug.cgi?id=94526
+
+ Reviewed by Eric Seidel.
+
+ Reverting RenderLayer's m_blockSelectionGapsBounds to be an IntRect and applying enclosingIntRect to the
+ gapRects added to the bounds. Previously, we'd end multiple block gaps and pixel snap the result, which
+ can yield results one pixel off in width and height.
+
+ Covered by existing tests. This undoes some of the rebaselining from when sub-pixel was enabled for Chromium.
+
+ * rendering/RenderLayer.cpp:
+ * rendering/RenderLayer.h:
+
+2012-08-20 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move instrumentedCallFunction() from V8Proxy to ScriptController
+ https://bugs.webkit.org/show_bug.cgi?id=94456
+
+ Reviewed by Adam Barth.
+
+ To kill V8Proxy, this patch moves instrumentedCallFunction() from V8Proxy
+ to ScriptController. Also this patch renames instrumentedCallFunction()
+ to callFunctionWithInstrumentation(), for consistency with callFunction().
+
+ No tests. No change in behavior.
+
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::callFunction):
+ (WebCore):
+ (WebCore::handleMaxRecursionDepthExceeded):
+ (WebCore::resourceInfo):
+ (WebCore::resourceString):
+ (WebCore::ScriptController::callFunctionWithInstrumentation):
+ * bindings/v8/ScriptController.h:
+ (ScriptController):
+ * bindings/v8/ScriptFunctionCall.cpp:
+ (WebCore::ScriptCallback::call):
+ * bindings/v8/V8Callback.cpp:
+ (WebCore::invokeCallback):
+ * bindings/v8/V8NodeFilterCondition.cpp:
+ (WebCore::V8NodeFilterCondition::acceptNode):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore):
+ * bindings/v8/V8Proxy.h:
+ (V8Proxy):
+ * bindings/v8/V8WindowErrorHandler.cpp:
+ (WebCore::V8WindowErrorHandler::callListenerFunction):
+ * bindings/v8/custom/V8CustomXPathNSResolver.cpp:
+ (WebCore::V8CustomXPathNSResolver::lookupNamespaceURI):
+
+2012-08-20 Elliott Sprehn <esprehn@chromium.org>
+
+ Never notify of insertedIntoTree during document destruction.
+ https://bugs.webkit.org/show_bug.cgi?id=94535
+
+ Reviewed by Eric Seidel.
+
+ Never notify of insertedIntoTree during document destruction. Previously since we
+ avoid notifying of willBeRemovedFromTree it's possible we could have gotten several
+ insertedIntoTree notifications without ever being told we were removed.
+
+ No tests needed since this just closes holes related to future code.
+
+ * rendering/RenderObjectChildList.cpp:
+ (WebCore::RenderObjectChildList::appendChildNode): Never call insertedIntoTree during document destruction.
+ (WebCore::RenderObjectChildList::insertChildNode): Same.
+ * rendering/RenderRegion.cpp:
+ (WebCore::RenderRegion::attachRegion): Removed unneeded document destruction check.
+
+2012-08-20 James Robinson <jamesr@chromium.org>
+
+ [chromium] Initialize GraphicsLayerChromium::m_contentsLayerId when setting contents layer
+ https://bugs.webkit.org/show_bug.cgi?id=94552
+
+ Reviewed by Kenneth Russell.
+
+ Set it or it don't work good.
+
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (WebCore::GraphicsLayerChromium::setupContentsLayer):
+
+2012-08-20 Rik Cabanier <cabanier@adobe.com>
+
+ parse CSS attribute -webkit-blend-mode
+ https://bugs.webkit.org/show_bug.cgi?id=94024
+
+ Reviewed by Dirk Schulze.
+
+ Added parsing and general CSS handling of -webkit-blend-mode per http://www.w3.org/TR/2012/WD-compositing-20120816/
+
+ Tests: css3/compositing/blend-mode-property-parsing-invalid.html
+ css3/compositing/blend-mode-property-parsing.html
+ css3/compositing/blend-mode-property.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore):
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSParser.cpp:
+ (WebCore::isValidKeywordPropertyAndValue):
+ (WebCore::isKeywordPropertyID):
+ (WebCore::CSSParser::parseValue):
+ * css/CSSProperty.cpp:
+ (WebCore::CSSProperty::isInheritedProperty):
+ * css/CSSPropertyNames.in:
+ * css/CSSValueKeywords.in:
+ * css/StyleBuilder.cpp:
+ (WebCore::StyleBuilder::StyleBuilder):
+ * rendering/RenderLayer.h:
+ (RenderLayer):
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
+ (WebCore):
+ (WebCore::RenderLayerBacking::updateLayerBlendMode):
+ (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
+ (WebCore::RenderLayerBacking::setBlendMode):
+ * rendering/RenderLayerBacking.h:
+ (RenderLayerBacking):
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::diff):
+ * rendering/style/RenderStyle.h:
+ * rendering/style/StyleRareNonInheritedData.cpp:
+ (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+ (WebCore::StyleRareNonInheritedData::operator==):
+ * rendering/style/StyleRareNonInheritedData.h:
+ (StyleRareNonInheritedData):
+
+2012-08-20 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move retrieve{Window,Frame,PerContextData}() from V8Proxy to V8Binding
+ https://bugs.webkit.org/show_bug.cgi?id=94460
+
+ Reviewed by Adam Barth.
+
+ To kill V8Proxy, we move retrieve{Window,Frame,PerContextData}()
+ from V8Proxy to V8Binding. Also, this patch renames these methods as follows:
+
+ - retrieveWindow() -> toDOMWindow()
+ - retrieveFrame() -> toFrameIfNotDetached()
+ - retrievePerContextData() -> perContextDataForCurrentWorld()
+
+ No tests. No change in behavior.
+
+ * bindings/v8/BindingState.cpp:
+ (WebCore::activeDOMWindow):
+ (WebCore::firstDOMWindow):
+ (WebCore::activeFrame):
+ (WebCore::firstFrame):
+ (WebCore::currentFrame):
+ (WebCore::currentDocument):
+ * bindings/v8/PageScriptDebugServer.cpp:
+ (WebCore::retrieveFrameWithGlobalObjectCheck):
+ (WebCore::PageScriptDebugServer::getDebugListenerForContext):
+ (WebCore::PageScriptDebugServer::runMessageLoopOnPause):
+ * bindings/v8/V8Binding.cpp:
+ (WebCore::retrieveWindow):
+ (WebCore):
+ (WebCore::retrieveFrame):
+ (WebCore::retrievePerContextData):
+ * bindings/v8/V8Binding.h:
+ (WebCore):
+ * bindings/v8/V8DOMWrapper.cpp:
+ (WebCore::V8DOMWrapper::constructorForType):
+ * bindings/v8/V8NPUtils.cpp:
+ (WebCore::convertV8ObjectToNPVariant):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::handleOutOfMemory):
+ (WebCore::V8Proxy::context):
+ (WebCore::V8Proxy::matchesCurrentContext):
+ * bindings/v8/V8Proxy.h:
+ (V8Proxy):
+
+2012-08-20 Abhishek Arya <inferno@chromium.org>
+
+ Yank an unneccessary if added in r125810.
+ https://bugs.webkit.org/show_bug.cgi?id=85804
+
+ Reviewed by Levi Weintraub.
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::layoutInlineChildren):
+
+2012-08-20 James Robinson <jamesr@chromium.org>
+
+ [chromium] REGRESSION(126076) Should not touch old GraphicsLayerChromium::m_contentsLayer when setting up a new contents layer
+ https://bugs.webkit.org/show_bug.cgi?id=94544
+
+ Reviewed by Adrienne Walker.
+
+ GraphicsLayerChromium only keeps a weak pointer to its m_contentsLayer. When replacing it with a new contents
+ layer, it may be unsafe to touch the old value. It's also completely unnecessary.
+
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (WebCore::GraphicsLayerChromium::GraphicsLayerChromium):
+ (WebCore::GraphicsLayerChromium::setContentsToImage):
+ (WebCore::GraphicsLayerChromium::setContentsTo):
+ (WebCore::GraphicsLayerChromium::setupContentsLayer):
+ * platform/graphics/chromium/GraphicsLayerChromium.h:
+
+2012-08-20 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move collectGarbage() from ScriptController to V8GCController
+ https://bugs.webkit.org/show_bug.cgi?id=94455
+
+ Reviewed by Adam Barth.
+
+ - This patch moves collectGarbage() from ScriptController to V8GCController.
+ - This patch makes collectGarbage() a static method.
+ - This patch removes ScriptController::lowMemoryNotification()
+ since it is not used at all.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/ScriptController.cpp:
+ * bindings/v8/ScriptController.h:
+ * bindings/v8/V8GCController.cpp:
+ (WebCore::V8GCController::collectGarbage):
+ (WebCore):
+ * bindings/v8/V8GCController.h:
+ (V8GCController):
+
+2012-08-20 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Remove V8Proxy from V8IsolatedContext
+ https://bugs.webkit.org/show_bug.cgi?id=94450
+
+ Reviewed by Adam Barth.
+
+ This patch removes dependency on V8Proxy from V8IsolatedContext.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::evaluateInIsolatedWorld):
+ * bindings/v8/V8IsolatedContext.cpp:
+ (WebCore::V8IsolatedContext::V8IsolatedContext):
+ * bindings/v8/V8IsolatedContext.h:
+ (WebCore):
+ (V8IsolatedContext):
+
+2012-08-20 Philip Rogers <pdr@google.com>
+
+ Canvas drawImage() should draw SVG at the correct scale.
+ https://bugs.webkit.org/show_bug.cgi?id=94377
+
+ Previously, drawing SVG in canvas would render at the incorrect scale
+ because imageSizeForRenderer did not take into account the page scale.
+ After this patch, we now incorporate the page scale in
+ CachedImage::imageSizeForRenderer().
+
+ Reviewed by Tim Horton.
+
+ Test: svg/as-image/svg-as-image-canvas.html
+
+ * loader/cache/CachedImage.cpp:
+ (WebCore::CachedImage::imageSizeForRenderer):
+
+2012-08-20 Simon Fraser <simon.fraser@apple.com>
+
+ Assertion going back to results.html page from an image diff result
+ https://bugs.webkit.org/show_bug.cgi?id=94143
+
+ Reviewed by Adam Barth.
+
+ Avoid redundantly setting the DOMWindow on a JSDOMWindow shell in
+ ScriptCachedFrameData::restore(), as we may have already done this
+ in ScriptController::clearWindowShell(). This avoids an assertion
+ on some platforms when going Back to the test results page from
+ a diff image.
+
+ * bindings/js/ScriptCachedFrameData.cpp:
+ (WebCore::ScriptCachedFrameData::restore):
+
+2012-08-20 Dean Jackson <dino@apple.com>
+
+ [WebGL] OES_vertex_array_object is not correctly un/binding or deleting
+ https://bugs.webkit.org/show_bug.cgi?id=94029
+
+ Reviewed by Ken Russell.
+
+ When the currently bound vertex array is deleted, the specification says that
+ the default object should be bound in its place. Also, binding a null object
+ as a vertex array was not actually clearing the bound object at the GL layer.
+ And lastly, it should not be possible to bind a deleted vertex array.
+
+ The test case for this is the public Khronos WebGL conformance suite, in particular:
+ conformance/extensions/oes-vertex-array-object.html
+
+ * html/canvas/OESVertexArrayObject.cpp:
+ (WebCore::OESVertexArrayObject::deleteVertexArrayOES): Check if the deleted array is
+ currently bound, and if so, unbind it.
+ (WebCore::OESVertexArrayObject::bindVertexArrayOES): Make sure never to bind an
+ array that has been marked as deleted.
+ * platform/graphics/opengl/Extensions3DOpenGL.cpp:
+ (WebCore::Extensions3DOpenGL::bindVertexArrayOES): Remove the null check on bind. We
+ do need to call glBindVertexArrayAPPLE with a null value in order to clear it.
+
+2012-08-20 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move clearForClose() and clearForNavigation() from V8Proxy to ScriptController
+ https://bugs.webkit.org/show_bug.cgi?id=94459
+
+ Reviewed by Adam Barth.
+
+ To kill V8Proxy, we can move clearForClose() and
+ clearForNavigation() from V8Proxy to ScriptController.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::~ScriptController):
+ (WebCore::ScriptController::resetIsolatedWorlds):
+ (WebCore):
+ (WebCore::ScriptController::clearForClose):
+ (WebCore::ScriptController::clearForNavigation):
+ (WebCore::ScriptController::clearWindowShell):
+ * bindings/v8/ScriptController.h:
+ (ScriptController):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::~V8Proxy):
+ (WebCore::V8Proxy::handleOutOfMemory):
+ * bindings/v8/V8Proxy.h:
+ (V8Proxy):
+
+2012-08-20 Dirk Schulze <krit@webkit.org>
+
+ CSS Masking and CSS Filters applied in wrong order
+ https://bugs.webkit.org/show_bug.cgi?id=94354
+
+ Reviewed by Dean Jackson.
+
+ According to the Filter Effects spec, the order should be first filters, then masking and clipping.
+ Changed the order on applying the different effects in RenderLayer.
+
+ Test: css3/filters/filter-mask-clip-order.html
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::paintLayerContents): First filter, then mask and clip the content.
+
+2012-08-20 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move mainWorldContext() from V8Proxy to ScriptController
+ https://bugs.webkit.org/show_bug.cgi?id=94453
+
+ Reviewed by Adam Barth.
+
+ This patch moves mainWorldContext() from V8Proxy to ScriptController.
+ In addition, this patch removes dependency on V8Proxy from WorldContextHandle.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/DOMTransaction.cpp:
+ (WebCore::DOMTransaction::callFunction):
+ * bindings/v8/NPV8Object.cpp:
+ (WebCore::toV8Context):
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::evaluate):
+ (WebCore::ScriptController::mainWorldContext):
+ (WebCore):
+ (WebCore::ScriptController::bindToWindowObject):
+ (WebCore::createScriptObject):
+ (WebCore::ScriptController::createScriptObjectForPluginElement):
+ * bindings/v8/ScriptController.h:
+ (ScriptController):
+ * bindings/v8/ScriptState.cpp:
+ (WebCore::mainWorldScriptState):
+ * bindings/v8/V8LazyEventListener.cpp:
+ (WebCore::V8LazyEventListener::prepareListenerObject):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::context):
+ (WebCore::toV8Context):
+ * bindings/v8/V8Proxy.h:
+ (V8Proxy):
+ * bindings/v8/WorldContextHandle.cpp:
+ (WebCore::WorldContextHandle::adjustedContext):
+ * bindings/v8/WorldContextHandle.h:
+ (WebCore):
+ (WorldContextHandle):
+
+2012-08-20 Adam Klein <adamk@chromium.org>
+
+ Remove redundant TOUCH_LISTENER event type
+ https://bugs.webkit.org/show_bug.cgi?id=94524
+
+ Reviewed by Ryosuke Niwa.
+
+ Code that needs to determine whether there are touch listeners
+ can instead call Document::touchEventHandlerCount(), added in r107832.
+ TOUCH_LISTENER didn't fit very well into the hasListenerType() model
+ anyway, as there's not a 1:1 correspondance between the enum value and
+ an event.
+
+ * dom/Document.cpp:
+ (WebCore::Document::addListenerTypeIfNeeded): Remove two bits of code:
+ the bookkeeping for TOUCH_LISTENER, and the notification into
+ ChromeClient (which is handled by calls to didAddTouchEventHandler in
+ all the places that call addListenerTypeIfNeeded).
+ (WebCore::Document::didRemoveTouchEventHandler): Remove bookkeeping for TOUCH_LISTENER.
+ * dom/Document.h:
+ * history/CachedFrame.cpp:
+ (WebCore::CachedFrameBase::restore): Call touchEventHandlerCount instead of hasListenerType.
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::updateType): ditto
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleTouchEvent): ditto
+ * page/Frame.cpp:
+ (WebCore::Frame::setDocument): ditto
+ * testing/Internals.cpp: Remove hasTouchEventListener method since its
+ data source no longer exists.
+ * testing/Internals.h: ditto
+ (Internals):
+ * testing/Internals.idl: ditto
+
+2012-08-16 James Robinson <jamesr@chromium.org>
+
+ [chromium] Change WebLayer from a concrete type to a pure virtual interface
+ https://bugs.webkit.org/show_bug.cgi?id=94174
+
+ Reviewed by Adrienne Walker.
+
+ This updates WebCore code for the WebLayer interface changes. Classes that have ownership of specific layer
+ types (such as DrawingBufferChromium, Canvas2DLayerBridge and ScrollingCoordinatorChromium) hold ownership
+ of a specific type and a pointer to the WebLayer to GraphicsLayerChromium to be included in the final layer
+ tree. GraphicsLayerChromium holds a WebContentLayer and (optionally) a WebImageLayer and WebLayer (for
+ m_transformLayer) and assembles the final layer tree.
+
+ * page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
+ (WebCore::ScrollingCoordinatorPrivate::ScrollingCoordinatorPrivate):
+ (ScrollingCoordinatorPrivate):
+ (WebCore::ScrollingCoordinatorPrivate::setScrollLayer):
+ (WebCore::ScrollingCoordinatorPrivate::setHorizontalScrollbarLayer):
+ (WebCore::ScrollingCoordinatorPrivate::setVerticalScrollbarLayer):
+ (WebCore::ScrollingCoordinatorPrivate::scrollLayer):
+ (WebCore::scrollableLayerForGraphicsLayer):
+ (WebCore):
+ (WebCore::createScrollbarLayer):
+ (WebCore::ScrollingCoordinator::setScrollLayer):
+ (WebCore::ScrollingCoordinator::setNonFastScrollableRegion):
+ (WebCore::ScrollingCoordinator::setWheelEventHandlerCount):
+ (WebCore::ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread):
+ (WebCore::ScrollingCoordinator::setLayerIsContainerForFixedPositionLayers):
+ (WebCore::ScrollingCoordinator::setLayerIsFixedToContainerLayer):
+ * platform/graphics/chromium/Canvas2DLayerBridge.cpp:
+ (WebCore::AcceleratedDeviceContext::AcceleratedDeviceContext):
+ (WebCore::AcceleratedDeviceContext::clearLayer):
+ (AcceleratedDeviceContext):
+ (WebCore::AcceleratedDeviceContext::prepareForDraw):
+ (WebCore::Canvas2DLayerBridge::Canvas2DLayerBridge):
+ (WebCore::Canvas2DLayerBridge::~Canvas2DLayerBridge):
+ (WebCore::Canvas2DLayerBridge::skCanvas):
+ (WebCore::Canvas2DLayerBridge::layer):
+ (WebCore::Canvas2DLayerBridge::contextAcquired):
+ * platform/graphics/chromium/Canvas2DLayerBridge.h:
+ (WebCore):
+ (Canvas2DLayerBridge):
+ * platform/graphics/chromium/DrawingBufferChromium.cpp:
+ (WebCore::DrawingBufferPrivate::DrawingBufferPrivate):
+ (WebCore::DrawingBufferPrivate::~DrawingBufferPrivate):
+ (WebCore::DrawingBufferPrivate::layer):
+ (DrawingBufferPrivate):
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (WebCore::GraphicsLayerChromium::GraphicsLayerChromium):
+ (WebCore::GraphicsLayerChromium::~GraphicsLayerChromium):
+ (WebCore::GraphicsLayerChromium::updateNames):
+ (WebCore::GraphicsLayerChromium::removeFromParent):
+ (WebCore::GraphicsLayerChromium::setSize):
+ (WebCore::GraphicsLayerChromium::clearBackgroundColor):
+ (WebCore::GraphicsLayerChromium::setContentsOpaque):
+ (WebCore::GraphicsLayerChromium::setFilters):
+ (WebCore::GraphicsLayerChromium::setBackgroundFilters):
+ (WebCore::GraphicsLayerChromium::setMaskLayer):
+ (WebCore::GraphicsLayerChromium::setBackfaceVisibility):
+ (WebCore::GraphicsLayerChromium::setOpacity):
+ (WebCore::GraphicsLayerChromium::setReplicatedByLayer):
+ (WebCore::GraphicsLayerChromium::setContentsNeedsDisplay):
+ (WebCore::GraphicsLayerChromium::setNeedsDisplay):
+ (WebCore::GraphicsLayerChromium::setNeedsDisplayInRect):
+ (WebCore::GraphicsLayerChromium::setContentsToImage):
+ (WebCore::GraphicsLayerChromium::setContentsToCanvas):
+ (WebCore):
+ (WebCore::GraphicsLayerChromium::setContentsToMedia):
+ (WebCore::GraphicsLayerChromium::setContentsTo):
+ (WebCore::GraphicsLayerChromium::addAnimation):
+ (WebCore::GraphicsLayerChromium::pauseAnimation):
+ (WebCore::GraphicsLayerChromium::removeAnimation):
+ (WebCore::GraphicsLayerChromium::suspendAnimations):
+ (WebCore::GraphicsLayerChromium::resumeAnimations):
+ (WebCore::GraphicsLayerChromium::addLinkHighlight):
+ (WebCore::GraphicsLayerChromium::didFinishLinkHighlight):
+ (WebCore::GraphicsLayerChromium::platformLayer):
+ (WebCore::GraphicsLayerChromium::setDebugBackgroundColor):
+ (WebCore::GraphicsLayerChromium::setDebugBorder):
+ (WebCore::GraphicsLayerChromium::updateChildList):
+ (WebCore::GraphicsLayerChromium::updateLayerPosition):
+ (WebCore::GraphicsLayerChromium::updateLayerSize):
+ (WebCore::GraphicsLayerChromium::updateAnchorPoint):
+ (WebCore::GraphicsLayerChromium::updateTransform):
+ (WebCore::GraphicsLayerChromium::updateChildrenTransform):
+ (WebCore::GraphicsLayerChromium::updateMasksToBounds):
+ (WebCore::GraphicsLayerChromium::updateLayerPreserves3D):
+ (WebCore::GraphicsLayerChromium::updateLayerIsDrawable):
+ (WebCore::GraphicsLayerChromium::updateLayerBackgroundColor):
+ (WebCore::GraphicsLayerChromium::updateContentsRect):
+ (WebCore::GraphicsLayerChromium::updateContentsScale):
+ (WebCore::GraphicsLayerChromium::setupContentsLayer):
+ * platform/graphics/chromium/GraphicsLayerChromium.h:
+ (WebCore::GraphicsLayerChromium::hasContentsLayer):
+ (WebCore::GraphicsLayerChromium::contentLayer):
+ (GraphicsLayerChromium):
+ (WebCore::GraphicsLayerChromium::contentsLayer):
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::LayerChromium::rootLayer):
+ * platform/graphics/chromium/LayerChromium.h:
+
+2012-08-20 Leandro Gracia Gil <leandrogracia@chromium.org>
+
+ Move transformFriendlyBoundingBox out of Range
+ https://bugs.webkit.org/show_bug.cgi?id=94366
+
+ Reviewed by Simon Fraser and Ryosuke Niwa.
+
+ Bug 93111 introduced a new method in Range called transformFriendlyBoundingBox.
+ However, this method should not have been added there in order to reduce the
+ dependencies between Range and the rendering code. This patch moves it to a
+ static method in RenderObject.
+
+ Tests: existing tests, no new feature added by this patch.
+
+ * dom/Range.cpp:
+ * dom/Range.h:
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::absoluteBoundingBoxRectForRange):
+ (WebCore):
+ * rendering/RenderObject.h:
+ (RenderObject):
+
+2012-08-20 Ryosuke Niwa <rniwa@webkit.org>
+
+ Replace isolate || bidi-override by isolate-override
+ https://bugs.webkit.org/show_bug.cgi?id=89746
+
+ Reviewed by Levi Weintraub.
+
+ The combination of bidi-isolate and isolate was replaced by a single isolate-override in
+ http://lists.w3.org/Archives/Public/www-style/2012May/0541.html. The spec. has been updated accordingly:
+ http://dev.w3.org/csswg/css3-writing-modes/#unicode-bidi
+
+ To follow the specification change, added -webkit-isolate-override and removed the support for
+ isolate || bidi-override, simplifying the CSS parser and serializer.
+
+ Test: fast/text/bidi-override-isolate.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Removed. We can just new a CSSPrimitiveValue
+ constructor now.
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added now that unicode-bidi always creates a signle
+ primitive value instead of a primitive value of css value list.
+ (WebCore::CSSPrimitiveValue::operator EUnicodeBidi):
+ * css/CSSValueKeywords.in: Added -webkit-isolate-override
+ * css/StyleBuilder.cpp:
+ (WebCore): Removed ApplyPropertyUnicodeBidi since we can use ApplyPropertyDefault now.
+ (WebCore::StyleBuilder::StyleBuilder): Use ApplyPropertyDefault.
+ * platform/text/UnicodeBidi.h: Renamed OverrideIsolate to IsolateOverride to match the spec.
+ (WebCore::isIsolated):
+ (WebCore::isOverride):
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::constructBidiRuns):
+
+2012-08-20 Tony Chang <tony@chromium.org>
+
+ RenderGrid children should always be RenderBoxes
+ https://bugs.webkit.org/show_bug.cgi?id=94305
+
+ Reviewed by Abhishek Arya.
+
+ During RenderGrid::layout, we assume all the children are RenderBoxes.
+ When removing children, if the last child is an anonymous block, we don't
+ want to remove the anonymous block for grids. Ensure this doesn't happen
+ by adding canCollapseAnonymousBlockChild to RenderBlock (flexboxen and
+ grid can override this method).
+
+ Test: fast/css-grid-layout/should-not-collapse-anonymous-blocks.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::removeChild): Check canCollapseAnonymousBlockChild().
+ * rendering/RenderBlock.h:
+ (WebCore::RenderBlock::canCollapseAnonymousBlockChild):
+ (RenderBlock):
+ * rendering/RenderDeprecatedFlexibleBox.h: canCollapseAnonymousBlockChild returns false.
+ * rendering/RenderFlexibleBox.h: canCollapseAnonymousBlockChild returns false.
+ * rendering/RenderGrid.h: canCollapseAnonymousBlockChild returns false.
+
+2012-08-20 Kenneth Russell <kbr@google.com>
+
+ Unreviewed, rolling out r126026.
+ http://trac.webkit.org/changeset/126026
+ https://bugs.webkit.org/show_bug.cgi?id=94449
+
+ Caused assertion failure in layout test touchadjustment/context-menu.html
+
+ * page/TouchAdjustment.cpp:
+ (TouchAdjustment):
+ (WebCore::TouchAdjustment::providesContextMenuItems):
+ (WebCore::TouchAdjustment::appendSubtargetsForNodeToList):
+ (WebCore::TouchAdjustment::compileSubtargetList):
+ (WebCore::findBestClickableCandidate):
+ (WebCore::findBestContextMenuCandidate):
+
+2012-08-20 Andrew Lo <anlo@rim.com>
+
+ [BlackBerry] Enabling DEBUG_LAYER_ANIMATION results in build break & warnings
+ https://bugs.webkit.org/show_bug.cgi?id=94514
+
+ Reviewed by Rob Buis.
+
+ Add wtf::CString definition to fix build break when enabling DEBUG_LAYER_ANIMATION
+ debug prints. Fix build warnings from prints.
+
+ No new tests, non-functional change.
+
+ * platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:
+ (WebCore::GraphicsLayerBlackBerry::addAnimation):
+ (WebCore::GraphicsLayerBlackBerry::pauseAnimation):
+
+2012-08-20 Christophe Dumez <christophe.dumez@intel.com>
+
+ [JSC] SerializedScriptValue::create() should throw a DataCloneError if input is an unsupported object
+ https://bugs.webkit.org/show_bug.cgi?id=94493
+
+ Reviewed by Oliver Hunt.
+
+ Update JSC implementation for SerializedScriptValue::create() so that
+ a DataCloneError is thrown when the input value is an unsupported
+ object. The previous implementation was not throwing any error.
+
+ This change is according to the structured clone specification at:
+ http://www.w3.org/TR/html5/common-dom-interfaces.html#structured-clone
+
+ This also matches the corresponding V8 implementation.
+
+ Test: fast/events/message-port-multi.html.
+
+ * bindings/js/SerializedScriptValue.cpp:
+ (WebCore::CloneSerializer::dumpIfTerminal):
+ (WebCore::CloneSerializer::serialize):
+ (WebCore::SerializedScriptValue::maybeThrowExceptionIfSerializationFailed):
+ * bindings/js/SerializedScriptValue.h:
+
+2012-08-20 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125884.
+ http://trac.webkit.org/changeset/125884
+ https://bugs.webkit.org/show_bug.cgi?id=94523
+
+ Appears to be causing a top crash in the Canary channel
+ (Requested by abarth on #webkit).
+
+ * UseV8.cmake:
+ * WebCore.gypi:
+ * bindings/v8/DOMWrapperWorld.cpp:
+ (WebCore::DOMWrapperWorld::DOMWrapperWorld):
+ (WebCore::mainThreadNormalWorld):
+ * bindings/v8/DOMWrapperWorld.h:
+ (WebCore):
+ (WebCore::DOMWrapperWorld::create):
+ (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
+ (DOMWrapperWorld):
+ * bindings/v8/IsolatedWorld.cpp: Copied from Source/WebCore/bindings/v8/DOMWrapperWorld.cpp.
+ (WebCore):
+ (WebCore::IsolatedWorld::IsolatedWorld):
+ (WebCore::IsolatedWorld::~IsolatedWorld):
+ * bindings/v8/IsolatedWorld.h: Copied from Source/WebCore/bindings/v8/DOMWrapperWorld.h.
+ (WebCore):
+ (IsolatedWorld):
+ (WebCore::IsolatedWorld::create):
+ (WebCore::IsolatedWorld::count):
+ (WebCore::IsolatedWorld::id):
+ (WebCore::IsolatedWorld::domDataStore):
+ * bindings/v8/V8DOMWrapper.h:
+ (WebCore::V8DOMWrapper::getCachedWrapper):
+ * bindings/v8/V8IsolatedContext.cpp:
+ (WebCore::V8IsolatedContext::V8IsolatedContext):
+ (WebCore::V8IsolatedContext::destroy):
+ * bindings/v8/V8IsolatedContext.h:
+ (WebCore::V8IsolatedContext::getEntered):
+ (WebCore::V8IsolatedContext::world):
+ (V8IsolatedContext):
+ * bindings/v8/V8PerIsolateData.h:
+ (WebCore::V8PerIsolateData::registerDOMDataStore):
+ (WebCore::V8PerIsolateData::unregisterDOMDataStore):
+
+2012-08-20 Chris Rogers <crogers@google.com>
+
+ Remove improper ASSERT in AudioParamTimeline::valuesForTimeRangeImpl()
+ https://bugs.webkit.org/show_bug.cgi?id=94504
+
+ Reviewed by Kenneth Russell.
+
+ AudioParamTimeline::valuesForTimeRangeImpl() is able to handle the case where there are no timeline events.
+ So don't ASSERT for that case.
+
+ * Modules/webaudio/AudioParamTimeline.cpp:
+ (WebCore::AudioParamTimeline::valuesForTimeRangeImpl):
+
+2012-08-20 Ken Buchanan <kenrb@chromium.org>
+ Line boxes not being dirtied correctly during inline removal
+ https://bugs.webkit.org/show_bug.cgi?id=93156
+
+ Reviewed by David Hyatt.
+
+ When two inline objects were being removed from different lineboxes
+ in an ancestral RenderBlock, the way the RenderBlock was being marked
+ prevented the second linebox from being marked dirty. This causes
+ it to not get layout in the subsequent layout pass.
+
+ This patch causes only the descendants corresponding to actual changed
+ lineboxes to have their ancestorLineBoxDirty bit set, rather than
+ the RenderBlock that contains the lineboxes themselves.
+
+ * rendering/RenderLineBoxList.cpp:
+ (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
+
+2012-08-20 John Mellor <johnme@chromium.org>
+
+ Text Autosizing: Only take into account block width <= document layout width.
+ https://bugs.webkit.org/show_bug.cgi?id=93862
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Instead of calculating the textAutosizingMultiplier purely based on the
+ width of each block, we now work out the maximum width of the block
+ that could be displayed onscreen at any one time, and use that value.
+ This avoids excessive text size multiplication (there's no point making
+ text bigger than this, since you wouldn't be able to zoom out far
+ enough to read it!).
+
+ To determine the maximum onscreen block width, we take the minimum of
+ the block width and the layoutWidth of the narrowest non-flattened
+ ancestor frame. Flattened frames are ignored since they don't impose a
+ hard limit on the maximum width that can be displayed, instead they can
+ stretch to fit their contents. Note that on mobile the layoutWidth of
+ the main frame is the fixed layout width aka viewport width.
+
+ In practice this caps the maximum multiplier to a value that depends
+ on the metrics of the device. For example on a Nexus S (480 x 800px
+ and 1.5x devicePixelRatio) with a 980px default fixed layout width,
+ this limits the multiplier to: 980 / (480/1.5) = 3.0625
+
+ Most pages won't have blocks that actually hit this cap, or they will
+ only slightly exceed it (so their multiplier will only be slightly
+ reduced). For example it's not uncommon for desktop pages to be
+ slightly wider than 980px, but they would have to additionally have
+ text that spans the full width of the page for this to affect them, and
+ even then it would merely slightly decrease their multiplier).
+
+ This will have more dramatic effects on the rare desktop pages which
+ give a width=device-width (or similar) mobile viewport tag (on ports
+ which support viewports). A follow-up patch will hopefully address this
+ by wrapping the text in such excessively wide blocks to the layoutWidth.
+
+ Tests: fast/text-autosizing/narrow-iframe-flattened.html
+ fast/text-autosizing/narrow-iframe.html
+ fast/text-autosizing/wide-block.html
+ fast/text-autosizing/wide-iframe.html
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::isInChildFrameWithFrameFlattening):
+
+ Made public and const, so can be used from TextAutosizer.
+
+ * rendering/TextAutosizer.cpp:
+ (WebCore::TextAutosizer::processSubtree):
+
+ Computes the minimum layout width of the parent frames, as described
+ above.
+
+ (WebCore::TextAutosizer::processBlock):
+
+ Limits used block width to this min layout width.
+
+2012-08-20 Hans Wennborg <hans@chromium.org>
+
+ Respect runtime flags for Device Orientation and Device Motion
+ https://bugs.webkit.org/show_bug.cgi?id=94479
+
+ Reviewed by Adam Barth.
+
+ There are flags that allows disabling of device orientation and device
+ motion at runtime. These flags determine the availability of the
+ corresponding event constructors in DOMWindow.
+
+ However, the flags should also control the ability to add event
+ listeners for these events, otherwise the feature can be used even if
+ it is disabled.
+
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::addEventListener):
+
+2012-08-20 Philip Rogers <pdr@google.com>
+
+ Remove incorrect getBBox() code
+ https://bugs.webkit.org/show_bug.cgi?id=94419
+
+ Reviewed by Dirk Schulze.
+
+ SVGPathElement defines a getBBox() function that is wrong and
+ should use objectBoundingBox(). This patch cleans this up.
+
+ No new tests as this is just a cleanup of old code.
+
+ * svg/SVGPathElement.cpp:
+ (WebCore):
+ * svg/SVGPathElement.h:
+ (SVGPathElement):
+
+2012-08-20 David Reveman <reveman@chromium.org>
+
+ [Chromium] Schedule texture uploads based on hard-coded timer and vsync.
+ https://bugs.webkit.org/show_bug.cgi?id=84281
+
+ Reviewed by James Robinson.
+
+ Improve interaction between vsync and texture uploads by performing
+ uploads in smaller batches and use a hard-coded timer to emulate
+ upload completion. This greatly reduces the chance of the compositor
+ missing a vsync due to being busy with texture uploads.
+
+ The CCScheduler client is now given a time limit when told to update
+ more resources. This time limit is passed to an instance of the
+ CCTextureUpdateController class, which is responsible for performing
+ texture updates until the limit is reached.
+
+ Unit tests: CCSchedulerTest.RequestCommit
+ CCTextureUpdateControllerTest.UpdateMoreTextures
+ CCTextureUpdateControllerTest.HasMoreUpdates
+
+ * platform/graphics/chromium/cc/CCFrameRateController.cpp:
+ (WebCore::CCFrameRateController::nextTickTime):
+ (WebCore):
+ * platform/graphics/chromium/cc/CCFrameRateController.h:
+ (CCFrameRateController):
+ * platform/graphics/chromium/cc/CCScheduler.cpp:
+ (WebCore::CCScheduler::processScheduledActions):
+ * platform/graphics/chromium/cc/CCScheduler.h:
+ (CCSchedulerClient):
+ * platform/graphics/chromium/cc/CCTextureUpdateController.cpp:
+ (WebCore::CCTextureUpdateController::maxPartialTextureUpdates):
+ (WebCore::CCTextureUpdateController::CCTextureUpdateController):
+ (WebCore::CCTextureUpdateController::updateMoreTextures):
+ (WebCore):
+ (WebCore::CCTextureUpdateController::onTimerFired):
+ (WebCore::CCTextureUpdateController::monotonicTimeNow):
+ (WebCore::CCTextureUpdateController::updateMoreTexturesTime):
+ (WebCore::CCTextureUpdateController::updateMoreTexturesSize):
+ (WebCore::CCTextureUpdateController::updateMoreTexturesIfEnoughTimeRemaining):
+ (WebCore::CCTextureUpdateController::updateMoreTexturesNow):
+ * platform/graphics/chromium/cc/CCTextureUpdateController.h:
+ (WebCore::CCTextureUpdateController::create):
+ (CCTextureUpdateController):
+ * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+ (WebCore::CCThreadProxy::beginFrameCompleteOnImplThread):
+ (WebCore::CCThreadProxy::scheduledActionUpdateMoreResources):
+ * platform/graphics/chromium/cc/CCThreadProxy.h:
+
+2012-08-20 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com>
+
+ [css3-text] Add parsing support for -webkit-text-decoration-style
+ https://bugs.webkit.org/show_bug.cgi?id=94093
+
+ Reviewed by Julien Chaffraix.
+
+ This patch implements the "text-decoration-style" property parsing as specified
+ in CSS3 working draft, with "-webkit-" prefix. The specification can be found
+ here: http://dev.w3.org/csswg/css3-text/#text-decoration-style
+
+ Additionally, Mozilla implementation details can be found here:
+ https://developer.mozilla.org/en-US/docs/CSS/text-decoration-style
+
+ This is an individual task for bug 90958. Rendering support will be handled on a
+ different bug.
+
+ Test: fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-style.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::renderTextDecorationStyleFlagsToCSSValue):
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::operator TextDecorationStyle):
+ * css/CSSProperty.cpp:
+ (WebCore::CSSProperty::isInheritedProperty):
+ * css/CSSPropertyNames.in:
+ * css/CSSValueKeywords.in:
+ * css/StyleBuilder.cpp:
+ (WebCore::StyleBuilder::StyleBuilder):
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::collectMatchingRulesForList):
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::diff):
+ * rendering/style/RenderStyle.h:
+ * rendering/style/RenderStyleConstants.h: Added non-bitwise TextDecorationStyle enum.
+ * rendering/style/StyleRareNonInheritedData.cpp:
+ (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Added m_textDecorationStyle to default and copy constructors.
+ (WebCore::StyleRareNonInheritedData::operator==): Include m_textDecorationStyle in comparison.
+ * rendering/style/StyleRareNonInheritedData.h:
+ (StyleRareNonInheritedData):
+ Added m_textDecorationStyle here as it won't be used regularly.
+
+2012-08-20 Jakob Petsovits <jpetsovits@rim.com>
+
+ [BlackBerry] Persist cookies not from atexit() but the new onThreadFinished()
+ https://bugs.webkit.org/show_bug.cgi?id=94482
+ RIM PR 184923
+
+ Reviewed by Yong Li.
+
+ BlackBerry::Platform recently made changes that ensure
+ that MessageClient threads are being shut down correctly.
+ A new onThreadFinished() virtual was introduced for
+ custom clean-up functionality and can replace the
+ atexit() handler that we previously used to flush cookies
+ to the cookie database backingstore.
+
+ No new functionality, no new tests.
+
+ * platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.cpp:
+ (WebCore):
+ (WebCore::CookieDatabaseBackingStore::onThreadFinished):
+ (WebCore::CookieDatabaseBackingStore::sendChangesToDatabaseSynchronously):
+ * platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.h:
+ (CookieDatabaseBackingStore):
+ * platform/blackberry/CookieManager.cpp:
+ (WebCore):
+ (WebCore::cookieManager):
+ * platform/blackberry/CookieManager.h:
+
+2012-08-20 Alexandre Elias <aelias@google.com>
+
+ [chromium] Move non-GL-specific code out of LayerRendererChromium
+ https://bugs.webkit.org/show_bug.cgi?id=93927
+
+ Reviewed by Adrienne Walker.
+
+ This patch moves most of the generic logic dealing with matrices and
+ render passes into a new class "CCDirectRenderer" that sits between
+ CCRenderer and LayerRendererChromium, and also publicly exposes a
+ few other things like the UnthrottledTextureUploader.
+
+ The plan is for the future software compositing implementation to also
+ derive from CCDirectRenderer, whereas the ubercompositor delegating
+ renderer will still derive from CCRenderer.
+
+ No new tests (no-op refactoring).
+
+ * WebCore.gypi:
+ * platform/graphics/chromium/GeometryBinding.cpp:
+ (WebCore::GeometryBinding::GeometryBinding):
+ * platform/graphics/chromium/GeometryBinding.h:
+ (GeometryBinding):
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::LayerRendererChromium):
+ (WebCore::LayerRendererChromium::beginDrawingFrame):
+ (WebCore::LayerRendererChromium::drawQuad):
+ (WebCore::LayerRendererChromium::drawRenderPassQuad):
+ (WebCore::LayerRendererChromium::drawTileQuad):
+ (WebCore::LayerRendererChromium::finishDrawingFrame):
+ (WebCore::LayerRendererChromium::drawQuadGeometry):
+ (WebCore::LayerRendererChromium::bindFramebufferToOutputSurface):
+ (WebCore):
+ (WebCore::LayerRendererChromium::bindFramebufferToTexture):
+ (WebCore::LayerRendererChromium::enableScissorTestRect):
+ (WebCore::LayerRendererChromium::disableScissorTest):
+ (WebCore::LayerRendererChromium::setDrawViewportSize):
+ (WebCore::LayerRendererChromium::makeContextCurrent):
+ (WebCore::LayerRendererChromium::initializeSharedObjects):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+ (LayerRendererChromium):
+ * platform/graphics/chromium/TextureCopier.h:
+ (TextureCopier):
+ * platform/graphics/chromium/TextureUploader.h:
+ (UnthrottledTextureUploader):
+ (WebCore::UnthrottledTextureUploader::create):
+ (WebCore::UnthrottledTextureUploader::~UnthrottledTextureUploader):
+ (WebCore::UnthrottledTextureUploader::UnthrottledTextureUploader):
+ (WebCore):
+ * platform/graphics/chromium/cc/CCDirectRenderer.cpp: Added.
+ (projectionMatrix):
+ (canvasMatrix):
+ (WebCore):
+ (WebCore::CCDirectRenderer::DrawingFrame::initializeMatrices):
+ (WebCore::CCDirectRenderer::DrawingFrame::initializeScissors):
+ (WebCore::CCDirectRenderer::decideRenderPassAllocationsForFrame):
+ (WebCore::CCDirectRenderer::drawFrame):
+ (WebCore::CCDirectRenderer::drawRenderPass):
+ (WebCore::CCDirectRenderer::useRenderPass):
+ (WebCore::CCDirectRenderer::haveCachedResourcesForRenderPassId):
+ (WebCore::CCDirectRenderer::renderPassTextureSize):
+ (WebCore::CCDirectRenderer::renderPassTextureFormat):
+ * platform/graphics/chromium/cc/CCDirectRenderer.h: Added.
+ (WebCore):
+ (CCDirectRenderer):
+ (WebCore::CCDirectRenderer::~CCDirectRenderer):
+ (WebCore::CCDirectRenderer::resourceProvider):
+ (WebCore::CCDirectRenderer::CCDirectRenderer):
+ (DrawingFrame):
+ (WebCore::CCDirectRenderer::DrawingFrame::DrawingFrame):
+ (CachedTexture):
+ (WebCore::CCDirectRenderer::CachedTexture::create):
+ (WebCore::CCDirectRenderer::CachedTexture::~CachedTexture):
+ (WebCore::CCDirectRenderer::CachedTexture::isComplete):
+ (WebCore::CCDirectRenderer::CachedTexture::setIsComplete):
+ (WebCore::CCDirectRenderer::CachedTexture::CachedTexture):
+ (WebCore::CCDirectRenderer::quadVertexRect):
+ (WebCore::CCDirectRenderer::quadRectTransform):
+
+2012-08-20 Julien Chaffraix <jchaffraix@webkit.org>
+
+ Introduce a will-be-removed-from-tree notification in RenderObject
+ https://bugs.webkit.org/show_bug.cgi?id=94271
+
+ Reviewed by Abhishek Arya.
+
+ Following bug 93874, we have an insertion notification. This change adds the
+ matching removal notification (willBeRemovedFromTree).
+
+ Refactoring covered by existing tests.
+
+ * rendering/RenderObjectChildList.cpp:
+ (WebCore::RenderObjectChildList::removeChildNode):
+ Removed the code from here and moved it below.
+
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::willBeRemovedFromTree):
+ * rendering/RenderObject.h:
+ This is the base function that should be called by every instance.
+
+ * rendering/RenderListItem.cpp:
+ (WebCore::RenderListItem::willBeRemovedFromTree):
+ * rendering/RenderListItem.h:
+ * rendering/RenderQuote.cpp:
+ (WebCore::RenderQuote::willBeRemovedFromTree):
+ * rendering/RenderQuote.h:
+ * rendering/RenderRegion.cpp:
+ (WebCore::RenderRegion::willBeRemovedFromTree):
+ * rendering/RenderRegion.h:
+ Overriden functions.
+
+2012-08-20 Mike West <mkwst@chromium.org>
+
+ CSP 1.1: The 'plugin-types' warning should include details about explicit type declaration when relevant.
+ https://bugs.webkit.org/show_bug.cgi?id=94432
+
+ Reviewed by Adam Barth.
+
+ Given a 'plugin-types' Content Security Policy directive, an 'object' or
+ 'embed' tag is blocked if it doesn't include an explicit declaration of
+ the plugin's expected media type. This restriction should be made clear
+ in the console warning that's generated.
+
+ Existing tests have been adjusted to agree with the new error string.
+
+ * page/ContentSecurityPolicy.cpp:
+ (WebCore::CSPDirectiveList::checkMediaTypeAndReportViolation):
+ If a media type fail to match the policy's restrictions, and the
+ declared type attribute is empty, then add another line to the
+ console warning, espousing the virtues of explicit declaration.
+
+2012-08-20 Dana Jansens <danakj@chromium.org>
+
+ [chromium] Update HUD resources as a final step to drawing a frame
+ https://bugs.webkit.org/show_bug.cgi?id=93743
+
+ Reviewed by Adrienne Walker.
+
+ The HUD should be painted as a last step, after the whole frame has been
+ generated. This introduces a new "updateHudTexture" method on the HUD layer
+ and has the HUD layer save itself on CCLayerTreeHostImpl so that it can
+ call back to this method.
+
+ This allows the CCLayerTreeHostImpl to cause the HUD layer to update its
+ texture as a final step before drawing the frame, allowing the HUD texture
+ to contain all possible information about the current frame.
+
+ * platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp:
+ (WebCore::CCHeadsUpDisplayLayerImpl::willDraw):
+ (WebCore):
+ (WebCore::CCHeadsUpDisplayLayerImpl::appendQuads):
+ (WebCore::CCHeadsUpDisplayLayerImpl::updateHudTexture):
+ * platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.h:
+ (CCHeadsUpDisplayLayerImpl):
+ * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+ (WebCore::CCLayerTreeHost::finishCommitOnImplThread):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+ (WebCore::CCLayerTreeHostImpl::CCLayerTreeHostImpl):
+ (WebCore::CCLayerTreeHostImpl::drawLayers):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
+ (WebCore):
+ (WebCore::CCLayerTreeHostImpl::setHudLayer):
+ (WebCore::CCLayerTreeHostImpl::hudLayer):
+ (CCLayerTreeHostImpl):
+
+2012-08-20 Ian Vollick <vollick@chromium.org>
+
+ [chromium] Add tracing for active composited animations
+ https://bugs.webkit.org/show_bug.cgi?id=84210
+
+ Reviewed by James Robinson.
+
+ This patch issues the trace events from the animations. Animations will
+ report when they start and finish on the main and impl threads (via
+ TRACE_EVENT_ASYNC*), and also issues instant trace events whenever they
+ change state.
+
+ No new tests, only changes tracing behavior.
+
+ * platform/graphics/chromium/cc/CCActiveAnimation.cpp:
+ (WebCore::CCActiveAnimation::CCActiveAnimation):
+ (WebCore::CCActiveAnimation::~CCActiveAnimation):
+ (WebCore::CCActiveAnimation::setRunState):
+ (WebCore::CCActiveAnimation::clone):
+ (WebCore):
+ (WebCore::CCActiveAnimation::cloneAndInitialize):
+ * platform/graphics/chromium/cc/CCActiveAnimation.h:
+ (WebCore::CCActiveAnimation::isControllingInstance):
+ (CCActiveAnimation):
+ * platform/graphics/chromium/cc/CCLayerAnimationController.cpp:
+ (WebCore::CCLayerAnimationController::pushNewAnimationsToImplThread):
+ (WebCore::CCLayerAnimationController::replaceImplThreadAnimations):
+ (WebCore::CCLayerAnimationController::tickAnimations):
+
+2012-08-20 Bill Budge <bbudge@chromium.org>
+
+ webkitfullscreenchange not fired properly in iframe.
+ https://bugs.webkit.org/show_bug.cgi?id=93525
+
+ Reviewed by Adam Barth.
+
+ webkitCancelFullScreen exits fullscreen by invoking webkitExitFullScreen on topDocument.
+ However, if webkitDidExitFullScreenForElement is invoked on a descendant document, no events
+ get dispatched. This change starts the event dispatch delay timer on the document where
+ webkitCancelFullScreen was called, so that the events get dispatched. In addition, when events
+ are dispatched, the check whether a node has been removed is changed to also check that the
+ node isn't in another document, as can happen with frames. Finally, webkitExitFullscreen
+ is fixed to remove unnecessary code and conform to the spec.
+
+ No new tests (the existing fullscreen/exit-full-screen-iframe.html test now passes).
+
+ * dom/Document.cpp:
+ (WebCore::Document::webkitExitFullscreen):
+ (WebCore::Document::webkitDidExitFullScreenForElement):
+ (WebCore::Document::fullScreenChangeDelayTimerFired):
+
+2012-08-20 Yuzhu Shen <yzshen@chromium.com>
+
+ [chromium] pepper plugins sometimes are shifted by 1 pixel
+ https://bugs.webkit.org/show_bug.cgi?id=94257
+
+ Reviewed by Levi Weintraub.
+
+ Change RenderWidget::updateWidgetGeometry() to use LayoutRect instead of IntRect to avoid unwanted truncation
+ (when converting from FloatRect to IntRect).
+
+ This makes sure that the optimized rendering code path of Pepper plugin
+ (PluginInstance::GetBitmapForOptimizedPluginPaint) has consistent coordinates with the normal WebKit rendering
+ code path.
+
+ No new tests because we don't have Pepper plugin tests in WebKit.
+
+ * rendering/RenderWidget.cpp:
+ (WebCore::RenderWidget::updateWidgetGeometry):
+
+2012-08-20 Christophe Dumez <christophe.dumez@intel.com>
+
+ postMessage() in MessagePort.idl does not match spec
+ https://bugs.webkit.org/show_bug.cgi?id=94477
+
+ Reviewed by Kentaro Hara.
+
+ Update definition of postMessage() in MessagePort.idl
+ to match the specification at:
+ http://www.w3.org/TR/html5/comms.html#messageport
+
+ The first argument should be of type 'any', not
+ 'DOMString'.
+
+ No new tests, no behavior change.
+
+ * dom/MessagePort.idl:
+
+2012-08-20 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125989.
+ http://trac.webkit.org/changeset/125989
+ https://bugs.webkit.org/show_bug.cgi?id=94485
+
+ "Two of the new tests always failed on Mac bots" (Requested by
+ bradee-oh on #webkit).
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore):
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSParser.cpp:
+ (WebCore::isValidKeywordPropertyAndValue):
+ (WebCore::isKeywordPropertyID):
+ (WebCore::CSSParser::parseValue):
+ * css/CSSProperty.cpp:
+ (WebCore::CSSProperty::isInheritedProperty):
+ * css/CSSPropertyNames.in:
+ * css/CSSValueKeywords.in:
+ * css/StyleBuilder.cpp:
+ (WebCore::StyleBuilder::StyleBuilder):
+ * rendering/RenderLayer.h:
+ (RenderLayer):
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
+ (WebCore):
+ (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
+ * rendering/RenderLayerBacking.h:
+ (RenderLayerBacking):
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::diff):
+ * rendering/style/RenderStyle.h:
+ * rendering/style/StyleRareNonInheritedData.cpp:
+ (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+ (WebCore::StyleRareNonInheritedData::operator==):
+ * rendering/style/StyleRareNonInheritedData.h:
+ (StyleRareNonInheritedData):
+
+2012-08-20 Allan Sandfeld Jensen <allan.jensen@nokia.com>
+
+ [Qt] Custom tap-highlight-color renders fully opaque
+ https://bugs.webkit.org/show_bug.cgi?id=94468
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Adjust the default tap-highlight-color to figure in that is will be
+ drawn semi-transparent.
+
+ * rendering/RenderTheme.h:
+ (RenderTheme):
+
+2012-08-20 Andrey Adaikin <aandrey@chromium.org>
+
+ Web Inspector: [WebGL] Add minimum transport protocol from backend to frontend
+ https://bugs.webkit.org/show_bug.cgi?id=88973
+
+ Reviewed by Pavel Feldman.
+
+ Added the following protocol methods to communicate with the WebGL injected
+ module: captureFrame, getTraceLog, dropTraceLog, replayTraceLog.
+
+ * inspector/CodeGeneratorInspector.py:
+ * inspector/InjectedScriptWebGLModule.cpp:
+ (WebCore::InjectedScriptWebGLModule::captureFrame):
+ (WebCore):
+ (WebCore::InjectedScriptWebGLModule::dropTraceLog):
+ (WebCore::InjectedScriptWebGLModule::getTraceLog):
+ (WebCore::InjectedScriptWebGLModule::replayTraceLog):
+ * inspector/InjectedScriptWebGLModule.h:
+ (InjectedScriptWebGLModule):
+ * inspector/Inspector.json:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ * inspector/InspectorWebGLAgent.cpp:
+ (WebCore::InspectorWebGLAgent::InspectorWebGLAgent):
+ (WebCore::InspectorWebGLAgent::dropTraceLog):
+ (WebCore):
+ (WebCore::InspectorWebGLAgent::captureFrame):
+ (WebCore::InspectorWebGLAgent::getTraceLog):
+ (WebCore::InspectorWebGLAgent::replayTraceLog):
+ * inspector/InspectorWebGLAgent.h:
+ (WebCore):
+ (WebCore::InspectorWebGLAgent::create):
+ (InspectorWebGLAgent):
+
+2012-08-20 Allan Sandfeld Jensen <allan.jensen@nokia.com>
+
+ [TouchAdjustment] Adjust to word or selection
+ https://bugs.webkit.org/show_bug.cgi?id=94449
+
+ Reviewed by Antonio Gomes.
+
+ Makes each separate word a separate subtarget when context menu triggers
+ selections, and only the selected part of a partial selected node a
+ target when selections are not overridden.
+
+ Test: touchadjustment/context-menu-text-subtargets.html
+
+ * page/TouchAdjustment.cpp:
+ (TouchAdjustment):
+ (WebCore::TouchAdjustment::providesContextMenuItems):
+ (WebCore::TouchAdjustment::appendQuadsToSubtargetList):
+ (WebCore::TouchAdjustment::appendBasicSubtargetsForNode):
+ (WebCore::TouchAdjustment::appendContextSubtargetsForNode):
+ (WebCore::TouchAdjustment::compileSubtargetList):
+ (WebCore::findBestClickableCandidate):
+ (WebCore::findBestContextMenuCandidate):
+
+2012-08-20 Xan Lopez <xlopez@igalia.com>
+
+ [GTK] Provide backwards compatible method for WebKitDOMWebKitNamedFlow::overflow
+ https://bugs.webkit.org/show_bug.cgi?id=94464
+
+ Reviewed by Carlos Garcia Campos.
+
+ Provide a compatibility method to access the new 'overset'
+ property through the old 'overflow' name in
+ WebKitDOMWebKitNamedFlow. Note that trying to access it through
+ g_object_get directly will give a runtime warning, since the
+ property does not actually exist anymore; this is done purely to
+ maintain API compatibility.
+
+ * bindings/gobject/WebKitDOMCustom.cpp:
+ (webkit_dom_webkit_named_flow_get_overflow): add method.
+ * bindings/gobject/WebKitDOMCustom.h:
+
+2012-08-20 Sami Kyostila <skyostil@chromium.org>
+
+ [chromium] Convert screen space scroll gestures to layer space
+ https://bugs.webkit.org/show_bug.cgi?id=92499
+
+ Reviewed by James Robinson.
+
+ Scroll gestures should be converted from screen space to local layer space to
+ correctly apply the scroll delta to page scaled and/or transformed layers.
+ Visually this means that the scrolled content will always follow the user's
+ finger for any "well-formed" layer transform.
+
+ Wheel scroll deltas will still be directly interpreted as local layer scroll
+ coordinates.
+
+ We also adjust the logic for propagating ("bubbling") scroll events to parent
+ layers. Previously a parent layer was allowed to scroll in the screen-space
+ axis orthogonal to the direction the starting layer scrolled toward. For
+ example if a vertically scrolling layer is scrolled diagonally down and right,
+ the layer moves down and its parent to the right.
+
+ This patch generalizes this behavior to non-axis aligned transformed layers so
+ that the scrolling direction of any parent is constrained to be perpendicular
+ direction of movement of the starting layer. This makes the scrolling behavior
+ of transformed layers physically plausible. For instance, assume a 45 degree
+ rotated, vertically scrollable layer. Dragging your finger vertically
+ (relative to the layer) scrolls the layer up and down, while horizontal
+ movement results in the parent of the layer moving in a corresponding way.
+
+ Since generally users want to scroll a single layer in one direction, this
+ patch also introduces a rule that if the resulting movement of a layer is
+ within 45 degrees of the original scroll input, the bubbling process is
+ stopped. This makes it possible to reliably scroll a single layer without
+ affecting any of its parents.
+
+ Added new unit tests:
+ CCLayerTreeHostImplTest.scrollAxisAlignedRotatedLayer
+ CCLayerTreeHostImplTest.scrollNonAxisAlignedRotatedLayer
+ CCLayerTreeHostImplTest.scrollScaledLayer
+ CCMathUtilTest.smallestAngleBetweenVectors
+ CCMathUtilTest.vectorProjection
+
+ * platform/graphics/chromium/cc/CCInputHandler.h:
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+ (WebCore::CCLayerTreeHostImpl::CCLayerTreeHostImpl):
+ (WebCore::CCLayerTreeHostImpl::scrollBegin):
+ (WebCore::scrollLayerWithScreenSpaceDelta):
+ (WebCore):
+ (WebCore::scrollLayerWithLocalDelta):
+ (WebCore::CCLayerTreeHostImpl::scrollBy):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
+ (CCLayerTreeHostImpl):
+ * platform/graphics/chromium/cc/CCMathUtil.cpp:
+ (WebCore::CCMathUtil::smallestAngleBetweenVectors):
+ (WebCore):
+ (WebCore::CCMathUtil::projectVector):
+ * platform/graphics/chromium/cc/CCMathUtil.h:
+ (CCMathUtil):
+
+2012-08-20 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Add API to set preferred languages to WebKit2 GTK+
+ https://bugs.webkit.org/show_bug.cgi?id=90878
+
+ Unreviewed. Fix mac build.
+
+ * WebCore.exp.in: Export WebCore::languageDidChange().
+
+2012-08-20 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: improve standalone test harness to allow attaching to inspector before test.
+ https://bugs.webkit.org/show_bug.cgi?id=94426
+
+ Reviewed by Vsevolod Vlasov.
+
+ - User can not "Debug", attach inspector to the front-end and "Continue" test execution.
+ - You can also assign filter from the query parameter.
+
+ * inspector/front-end/test-runner.html:
+
+2012-08-20 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: load scripts panel lazily
+ https://bugs.webkit.org/show_bug.cgi?id=94416
+
+ Reviewed by Vsevolod Vlasov.
+
+ - removes access to WebInspector.panels.scripts and loads it lazily.
+ - extracts classes to their own files when classes residing in one file belong to different modules
+ - removes StylesPanel.js in favor of the actual classes it contains
+
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * inspector/compile-front-end.py:
+ * inspector/front-end/AdvancedSearchController.js:
+ (WebInspector.AdvancedSearchController.prototype.handleShortcut):
+ * inspector/front-end/BreakpointsSidebarPane.js:
+ * inspector/front-end/FilteredItemSelectionDialog.js:
+ * inspector/front-end/InspectorFrontendAPI.js:
+ (InspectorFrontendAPI._pendingCommands.isDebuggingEnabled):
+ (InspectorFrontendAPI.setDebuggingEnabled):
+ * inspector/front-end/NativeBreakpointsSidebarPane.js: Added.
+ (WebInspector.NativeBreakpointsSidebarPane):
+ (WebInspector.NativeBreakpointsSidebarPane.prototype._addListElement):
+ (WebInspector.NativeBreakpointsSidebarPane.prototype._removeListElement):
+ (WebInspector.NativeBreakpointsSidebarPane.prototype._reset):
+ * inspector/front-end/ObjectPropertiesSection.js:
+ (WebInspector.ObjectPropertyTreeElement.prototype._functionContextMenuEventFired):
+ * inspector/front-end/ScriptSnippetModel.js:
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype.showGoToSourceDialog):
+ * inspector/front-end/SnippetJavaScriptSourceFrame.js: Added.
+ (WebInspector.SnippetJavaScriptSourceFrame):
+ (WebInspector.SnippetJavaScriptSourceFrame.prototype.statusBarItems):
+ (WebInspector.SnippetJavaScriptSourceFrame.prototype._runButtonClicked):
+ * inspector/front-end/StyleSheetOutlineDialog.js: Added.
+ (WebInspector.StyleSheetOutlineDialog):
+ (WebInspector.StyleSheetOutlineDialog.show):
+ (WebInspector.StyleSheetOutlineDialog.prototype.itemTitleAt):
+ (WebInspector.StyleSheetOutlineDialog.prototype.itemSubtitleAt):
+ (WebInspector.StyleSheetOutlineDialog.prototype.itemKeyAt):
+ (WebInspector.StyleSheetOutlineDialog.prototype.itemsCount):
+ (WebInspector.StyleSheetOutlineDialog.prototype.requestItems):
+ (WebInspector.StyleSheetOutlineDialog.prototype.requestItems.didGetStyleSheet):
+ (WebInspector.StyleSheetOutlineDialog.prototype.selectItem):
+ (WebInspector.StyleSheetOutlineDialog.prototype.rewriteQuery):
+ * inspector/front-end/StyleSource.js: Renamed from Source/WebCore/inspector/front-end/StylesPanel.js.
+ (WebInspector.StylesUISourceCodeProvider):
+ (WebInspector.StylesUISourceCodeProvider.prototype.uiSourceCodes):
+ (WebInspector.StylesUISourceCodeProvider.prototype.rawLocationToUILocation):
+ (WebInspector.StylesUISourceCodeProvider.prototype.uiLocationToRawLocation):
+ (WebInspector.StylesUISourceCodeProvider.prototype._populate):
+ (WebInspector.StylesUISourceCodeProvider.prototype._resourceAdded):
+ (WebInspector.StylesUISourceCodeProvider.prototype.reset):
+ (WebInspector.StyleSource):
+ (WebInspector.StyleSource.prototype.isEditable):
+ (WebInspector.StyleSource.prototype.workingCopyCommitted):
+ (WebInspector.StyleSource.prototype.workingCopyChanged):
+ (WebInspector.StyleSource.prototype._callOrSetTimeout):
+ (WebInspector.StyleSource.prototype._commitIncrementalEdit):
+ (WebInspector.StyleSource.prototype._clearIncrementalUpdateTimer):
+ (WebInspector.InspectorStyleSource):
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/inspector.html:
+ * inspector/front-end/inspector.js:
+ (WebInspector._panelDescriptors):
+ (WebInspector._registerShortcuts):
+ (WebInspector.documentKeyDown):
+ (WebInspector._showAnchorLocation):
+
+2012-08-20 Dominik Röttsches <dominik.rottsches@intel.com>
+
+ [EFL] Get rid of pango backend support once harfbuzz-ng is working
+ https://bugs.webkit.org/show_bug.cgi?id=92102
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Removing support for Pango complex font rendering now that we HarfBuzz.
+
+ No new tests, no change in behavior.
+
+ * PlatformEfl.cmake: Removing Pango specific includes and libraries.
+
+2012-08-20 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: prepare scripts panel to be lazily loaded
+ https://bugs.webkit.org/show_bug.cgi?id=94423
+
+ Reviewed by Vsevolod Vlasov.
+
+ - makes scripts panel read workspace data upon creation
+ - moves pause on script state management into the debugger model
+ - updates frontend API to use debugger model, not scripts panel
+
+ * inspector/front-end/DebuggerModel.js:
+ (WebInspector.DebuggerModel.prototype.debuggerEnabled):
+ (WebInspector.DebuggerModel.prototype.disableDebugger):
+ (WebInspector.DebuggerModel.prototype._debuggerWasEnabled):
+ (WebInspector.DebuggerModel.prototype._pauseOnExceptionStateChanged):
+ (WebInspector.DebuggerModel.prototype.get _debuggerWasDisabled):
+ * inspector/front-end/InspectorFrontendAPI.js:
+ (InspectorFrontendAPI._pendingCommands.isDebuggingEnabled):
+ (InspectorFrontendAPI.setDebuggingEnabled):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel):
+ (WebInspector.ScriptsPanel.prototype._debuggerWasEnabled):
+ (WebInspector.ScriptsPanel.prototype._debuggerWasDisabled):
+ (WebInspector.ScriptsPanel.prototype._reset):
+ (WebInspector.ScriptsPanel.prototype.canShowAnchorLocation):
+ (WebInspector.ScriptsPanel.prototype._updateDebuggerButtons):
+ (WebInspector.ScriptsPanel.prototype._enableDebugging):
+ (WebInspector.ScriptsPanel.prototype._togglePauseOnExceptions):
+ (WebInspector.ScriptsPanel.prototype.showGoToSourceDialog):
+ * inspector/front-end/inspector.js:
+ (WebInspector.documentKeyDown):
+
+2012-08-20 Robin Cao <robin.cao@torchmobile.com.cn>
+
+ [BlackBerry] Adapt to changes in the platform media player API
+ https://bugs.webkit.org/show_bug.cgi?id=94329
+ PR #194237
+
+ Reviewed by Antonio Gomes.
+
+ The interface to platform's media player has changed from MMRPlayer
+ to PlatformPlayer. This patch adapts to this change.
+
+ And we also decided to postpone the creation of PlatformPlayer until
+ the loading started. This is needed because we may create different
+ types of player for different media sources.
+
+ This is a refactor, no new tests.
+
+ * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:
+ (WebCore::MediaPlayerPrivate::getSupportedTypes):
+ (WebCore::MediaPlayerPrivate::supportsType):
+ (WebCore::MediaPlayerPrivate::notifyAppActivatedEvent):
+ (WebCore::MediaPlayerPrivate::setCertificatePath):
+ (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
+ (WebCore::MediaPlayerPrivate::load):
+ (WebCore::MediaPlayerPrivate::cancelLoad):
+ (WebCore::MediaPlayerPrivate::prepareToPlay):
+ (WebCore::MediaPlayerPrivate::play):
+ (WebCore::MediaPlayerPrivate::pause):
+ (WebCore::MediaPlayerPrivate::naturalSize):
+ (WebCore::MediaPlayerPrivate::hasVideo):
+ (WebCore::MediaPlayerPrivate::hasAudio):
+ (WebCore::MediaPlayerPrivate::duration):
+ (WebCore::MediaPlayerPrivate::currentTime):
+ (WebCore::MediaPlayerPrivate::seek):
+ (WebCore::MediaPlayerPrivate::setRate):
+ (WebCore::MediaPlayerPrivate::paused):
+ (WebCore::MediaPlayerPrivate::setVolume):
+ (WebCore::MediaPlayerPrivate::maxTimeSeekable):
+ (WebCore::MediaPlayerPrivate::buffered):
+ (WebCore::MediaPlayerPrivate::paint):
+ (WebCore::MediaPlayerPrivate::hasAvailableVideoFrame):
+ (WebCore::MediaPlayerPrivate::movieLoadType):
+ (WebCore::MediaPlayerPrivate::setAllowPPSVolumeUpdates):
+ (WebCore::MediaPlayerPrivate::updateStates):
+ (WebCore):
+ (WebCore::MediaPlayerPrivate::onStateChanged):
+ (WebCore::MediaPlayerPrivate::onMediaStatusChanged):
+ (WebCore::MediaPlayerPrivate::onError):
+ (WebCore::MediaPlayerPrivate::waitMetadataTimerFired):
+ (WebCore::MediaPlayerPrivate::showErrorDialog):
+ * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h:
+ (MediaPlayerPrivate):
+
+2012-08-19 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move contextDebugId() and setContextDebugId() from V8Proxy to ScriptController
+ https://bugs.webkit.org/show_bug.cgi?id=94446
+
+ Reviewed by Adam Barth.
+
+ To kill V8Proxy, we can move contextDebugId() and setContextDebugId()
+ from V8Proxy to ScriptController.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::setContextDebugId):
+ (WebCore):
+ (WebCore::ScriptController::contextDebugId):
+ * bindings/v8/ScriptController.h:
+ (ScriptController):
+ * bindings/v8/V8IsolatedContext.cpp:
+ (WebCore::V8IsolatedContext::V8IsolatedContext):
+ * bindings/v8/V8Proxy.cpp:
+ * bindings/v8/V8Proxy.h:
+ (V8Proxy):
+
+2012-08-20 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move V8Proxy::newInstance() to V8ObjectConstructor
+ https://bugs.webkit.org/show_bug.cgi?id=94443
+
+ Reviewed by Adam Barth.
+
+ To kill V8Proxy, this patch moves V8Proxy::newInstance() to
+ V8ObjectConstructor::newInstanceInFrame().
+ In addition, this patch does the following things:
+
+ - For consistency with V8ObjectConstructor::newInstanceInFrame(),
+ this patch inserts an if(v8::V8::IsDead()) check to just after
+ Function::NewInstance(). The check is done by V8Binding::assertIfV8IsDead().
+
+ - To avoid #include circular dependency, this patch de-inline
+ V8ObjectConstructor::newInstance()s. I didn't observe any perf regression.
+ I don't think these methods are worth being inlined, because
+ these methods call Function::NewInstance(), which is not inlined
+ and calls a bunch of heavy mehtods in V8.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/NPV8Object.cpp:
+ (_NPN_Construct):
+ * bindings/v8/V8Binding.cpp:
+ (WebCore::assertIfV8IsDead):
+ (WebCore):
+ * bindings/v8/V8Binding.h:
+ (WebCore):
+ * bindings/v8/V8ObjectConstructor.cpp:
+ (WebCore::V8ObjectConstructor::newInstance):
+ (WebCore):
+ (WebCore::V8ObjectConstructor::newInstanceInFrame):
+ * bindings/v8/V8ObjectConstructor.h:
+ (WebCore):
+ (V8ObjectConstructor):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::runScript):
+ (WebCore::V8Proxy::instrumentedCallFunction):
+
+2012-08-20 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move V8Proxy::m_extensions to ScriptController
+ https://bugs.webkit.org/show_bug.cgi?id=94444
+
+ Reviewed by Adam Barth.
+
+ To kill V8Proxy, this patch moves V8Proxy::m_extensions to ScriptController.
+ This patch also renames extensions() to registeredExtensions() for clarification.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::registeredExtensions):
+ (WebCore):
+ (WebCore::ScriptController::registerExtensionIfNeeded):
+ * bindings/v8/ScriptController.h:
+ (WebCore):
+ (ScriptController):
+ * bindings/v8/V8DOMWindowShell.cpp:
+ (WebCore::V8DOMWindowShell::createNewContext):
+ * bindings/v8/V8Proxy.cpp:
+ * bindings/v8/V8Proxy.h:
+ (WebCore):
+ (V8Proxy):
+
+2012-08-20 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: toolbar causes 8 reflows upon opening
+ https://bugs.webkit.org/show_bug.cgi?id=94422
+
+ Reviewed by Yury Semikhatsky.
+
+ Toolbar's overflow code causes inspector to do 8 reflows upon opening.
+ Fixing it via introducing batch toolbar update.
+
+ * inspector/front-end/Toolbar.js:
+ (WebInspector.Toolbar):
+ (WebInspector.Toolbar.prototype.setCoalescingUpdate):
+ (WebInspector.Toolbar.prototype._updateDropdownButtonAndHideDropdown):
+ * inspector/front-end/inspector.css:
+ (body.compact .toolbar-icon):
+ (body.compact .toolbar-icon.custom-toolbar-icon):
+ (body.compact .toolbar-item:active .toolbar-icon):
+ (body.compact .toolbar-label):
+ (body.compact .toolbar-item.resources .toolbar-icon):
+ (body.compact .toolbar-item.network .toolbar-icon):
+ (body.compact .toolbar-item.scripts .toolbar-icon):
+ (body.compact .toolbar-item.timeline .toolbar-icon):
+ (body.compact .toolbar-item.profiles .toolbar-icon):
+ (body.compact .toolbar-item.audits .toolbar-icon):
+ (body.compact .toolbar-item.console .toolbar-icon):
+ * inspector/front-end/inspector.js:
+ (WebInspector.get _setCompactMode):
+ (WebInspector.windowResize):
+
+2012-08-19 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Replace proxy()->windowShell() in ScriptController with windowShell()
+ https://bugs.webkit.org/show_bug.cgi?id=94445
+
+ Reviewed by Adam Barth.
+
+ Now ScriptController owns windowShell. So ScriptController doesn't
+ need to get windowShell through V8Proxy.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::updateSecurityOrigin):
+ (WebCore::ScriptController::haveInterpreter):
+ (WebCore::ScriptController::enableEval):
+ (WebCore::ScriptController::disableEval):
+ (WebCore::ScriptController::updateDocument):
+ (WebCore::ScriptController::namedItemAdded):
+ (WebCore::ScriptController::namedItemRemoved):
+
+2012-08-19 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move V8Proxy::callFunction() to ScriptController
+ https://bugs.webkit.org/show_bug.cgi?id=94437
+
+ Reviewed by Adam Barth.
+
+ To kill V8Proxy, this patch moves callFunction() from V8Proxy to ScriptController.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/DOMTransaction.cpp:
+ (WebCore::DOMTransaction::callFunction):
+ * bindings/v8/NPV8Object.cpp:
+ (_NPN_Invoke):
+ (_NPN_InvokeDefault):
+ * bindings/v8/ScheduledAction.cpp:
+ (WebCore::ScheduledAction::execute):
+ * bindings/v8/ScheduledAction.h:
+ (WebCore):
+ (ScheduledAction):
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::callFunction):
+ (WebCore):
+ (WebCore::ScriptController::callFunctionEvenIfScriptDisabled):
+ * bindings/v8/ScriptController.h:
+ (ScriptController):
+ * bindings/v8/V8EventListener.cpp:
+ (WebCore::V8EventListener::callListenerFunction):
+ * bindings/v8/V8LazyEventListener.cpp:
+ (WebCore::V8LazyEventListener::callListenerFunction):
+ * bindings/v8/V8Proxy.cpp:
+ * bindings/v8/V8Proxy.h:
+ (V8Proxy):
+ * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+ (WebCore::V8HTMLDocument::openCallback):
+
+2012-08-19 Yoshifumi Inoue <yosin@chromium.org>
+
+ [Forms] Set SpinButtonElement free from HTMLInputElement
+ https://bugs.webkit.org/show_bug.cgi?id=93941
+
+ Reviewed by Kent Tamura.
+
+ This patch removes dependency to HTMLInputElement from SpinButtonElement.
+
+ Functionalities used to be calling HTMLInputElement functions are
+ replaced to calling functions SpinButtonOwner class.
+
+ * html/TextFieldInputType.cpp:
+ (WebCore::TextFieldInputType::focusAndSelectSpinButtonOwner): Moved functionality from SpinButtonElement::defaultEventHandler.
+ (WebCore::TextFieldInputType::shouldSpinButtonRespondToMouseEvents): Moved code from SpinButtonElement::willRespondToMouseClickEvents
+ (WebCore::TextFieldInputType::shouldSpinButtonRespondToWheelEvents): Moved code from SpinButtonElement::forwardEvent
+ * html/TextFieldInputType.h:
+ (TextFieldInputType):
+ * html/TimeInputType.cpp:
+ (WebCore::TimeInputType::DateTimeEditControlOwnerImpl::focusAndSelectEditControlOwner): Moved functionality from SpinButtonElement::defaultEventHandler.
+ (WebCore::TimeInputType::DateTimeEditControlOwnerImpl::isEditControlOwnerFocused): Added for DateTimeEditElement::shouldSpinButtonRespondToWheelEvents.
+ * html/TimeInputType.h:
+ * html/shadow/DateTimeEditElement.cpp:
+ (WebCore::DateTimeEditElement::focusAndSelectSpinButtonOwner): Added for SpinButtonElementOwner class change.
+ (WebCore::DateTimeEditElement::shouldSpinButtonRespondToMouseEvents): ditto
+ (WebCore::DateTimeEditElement::shouldSpinButtonRespondToWheelEvents): ditto
+ * html/shadow/DateTimeEditElement.h:
+ (EditControlOwner): Added new virtual function declarations for SpinButtonElementOwner class change.
+ (DateTimeEditElement): Added new function declarations for SpinButtonElementOwner.
+ * html/shadow/SpinButtonElement.cpp:
+ (WebCore::SpinButtonElement::defaultEventHandler): Changed to use SpinButtonElementOwner instead of HTMLInputElement.
+ (WebCore::SpinButtonElement::forwardEvent): ditto
+ (WebCore::SpinButtonElement::willRespondToMouseMoveEvents): ditto
+ (WebCore::SpinButtonElement::willRespondToMouseClickEvents): ditto
+ (WebCore::SpinButtonElement::step): ditto
+ (WebCore::SpinButtonElement::shouldRespondToMouseEvents): Added helper function for calling SpinButtonOwner instance.
+ * html/shadow/SpinButtonElement.h:
+ (SpinButtonOwner): Added new virtual function declarations.
+ (SpinButtonElement):
+
+2012-08-19 Yoshifumi Inoue <yosin@chromium.org>
+
+ [Tests] time-multiple-fields-appearance-basic.html and time-multiple-fields-appearance-pseudo-elements.html are failed on Chromium Mac
+ https://bugs.webkit.org/show_bug.cgi?id=94439
+
+ Reviewed by Kent Tamura.
+
+ This patch disabled CSS selector for Firefox compatibility applied to
+ multiple fields time input UI, because it is supposed to apply text
+ field rather than multiple fields.
+
+ This patch allows us to have same appearance among Chromium-Linux,
+ Mac and Win.
+
+ No new tests. Following existing tests cover this change:
+ fast/forms/time-multiple-fields/time-multiple-fields-appearance-basic.html
+ fast/forms/time-multiple-fields/time-multiple-fields-appearance-disabled-readonly.html
+ fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-classes.html
+ fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements.html
+ fast/forms/time-multiple-fields/time-multiple-fields-appearance-style.html
+
+ * css/themeWin.css: Exclude input[type="time"] selector if ENABLE_INPUT_TYPE_TIME_MULTIPLE_FIELDS
+ enabled.
+
+2012-08-19 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Rename SafeAllocation to V8ObjectConstructor
+ https://bugs.webkit.org/show_bug.cgi?id=94436
+
+ Reviewed by Adam Barth.
+
+ For clarification.
+
+ No tests. No change in behavior.
+
+ * UseV8.cmake:
+ * WebCore.gypi:
+ * bindings/v8/ScriptFunctionCall.cpp:
+ (WebCore::ScriptFunctionCall::construct):
+ * bindings/v8/V8Binding.cpp:
+ (WebCore::createRawTemplate):
+ * bindings/v8/V8Binding.h:
+ * bindings/v8/V8DOMWindowShell.cpp:
+ (WebCore::V8DOMWindowShell::installDOMWindow):
+ * bindings/v8/V8DOMWrapper.cpp:
+ (WebCore::V8DOMWrapper::instantiateV8Object):
+ * bindings/v8/V8NPObject.cpp:
+ (WebCore::createV8ObjectForNPObject):
+ * bindings/v8/V8ObjectConstructor.cpp: Renamed from Source/WebCore/bindings/v8/SafeAllocation.cpp.
+ (WebCore):
+ (WebCore::V8ObjectConstructor::isValidConstructorMode):
+ * bindings/v8/V8ObjectConstructor.h: Renamed from Source/WebCore/bindings/v8/SafeAllocation.h.
+ (WebCore):
+ (ConstructorMode):
+ (WebCore::ConstructorMode::ConstructorMode):
+ (WebCore::ConstructorMode::~ConstructorMode):
+ (WebCore::ConstructorMode::current):
+ (V8ObjectConstructor):
+ (WebCore::V8ObjectConstructor::newInstance):
+ * bindings/v8/V8PerContextData.cpp:
+ (WebCore::V8PerContextData::createWrapperFromCacheSlowCase):
+ * bindings/v8/WorkerContextExecutionProxy.cpp:
+ (WebCore::WorkerContextExecutionProxy::initContextIfNeeded):
+ * bindings/v8/custom/V8InjectedScriptManager.cpp:
+ (WebCore::createInjectedScriptHostV8Wrapper):
+ * bindings/v8/custom/V8ScriptProfileCustom.cpp:
+ (WebCore::toV8):
+ * bindings/v8/custom/V8ScriptProfileNodeCustom.cpp:
+ (WebCore::toV8):
+
+2012-08-19 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move m_windowShell from V8Proxy to ScriptController
+ https://bugs.webkit.org/show_bug.cgi?id=94438
+
+ Reviewed by Adam Barth.
+
+ m_windowShell should be owned by ScriptController.
+ After this change, I can move a bunch of V8Proxy methods
+ that access windowShell() from V8Proxy to ScriptController.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::ScriptController):
+ * bindings/v8/ScriptController.h:
+ (WebCore):
+ (WebCore::ScriptController::windowShell):
+ (ScriptController):
+ * bindings/v8/V8Binding.h:
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::V8Proxy):
+ (WebCore::V8Proxy::windowShell):
+ (WebCore):
+ * bindings/v8/V8Proxy.h:
+ (WebCore):
+ (WebCore::V8Proxy::frame):
+ (V8Proxy):
+
+2012-08-19 Benjamin Poulain <benjamin@webkit.org>
+
+ Do not allocate SQLiteDatabase's m_openErrorMessage until its needed
+ https://bugs.webkit.org/show_bug.cgi?id=94434
+
+ Reviewed by Andreas Kling.
+
+ Previously, m_openErrorMessage was initialized from a static literal string whenever
+ the database is not open.
+
+ This patch changes the way we use m_openErrorMessage to only allocate a string in the
+ few cases where we need it. If there is no error message, we fallback to the previous
+ default string.
+
+ The goal is to prevent allocating the string unless needed. That saves initialization time
+ and memory.
+
+ * platform/sql/SQLiteDatabase.cpp:
+ (WebCore::SQLiteDatabase::SQLiteDatabase):
+ (WebCore::SQLiteDatabase::close):
+ (WebCore::SQLiteDatabase::lastErrorMsg):
+
+2012-08-19 Benjamin Poulain <benjamin@webkit.org>
+
+ Use initialization from literal for HTML Input type names
+ https://bugs.webkit.org/show_bug.cgi?id=94421
+
+ Reviewed by Kent Tamura.
+
+ AtomicString's initialization from literal is faster and use less memory.
+
+ * html/InputType.cpp:
+ (WebCore::InputTypeNames::button):
+ (WebCore::InputTypeNames::checkbox):
+ (WebCore::InputTypeNames::color):
+ (WebCore::InputTypeNames::date):
+ (WebCore::InputTypeNames::datetime):
+ (WebCore::InputTypeNames::datetimelocal):
+ (WebCore::InputTypeNames::email):
+ (WebCore::InputTypeNames::file):
+ (WebCore::InputTypeNames::hidden):
+ (WebCore::InputTypeNames::image):
+ (WebCore::InputTypeNames::month):
+ (WebCore::InputTypeNames::number):
+ (WebCore::InputTypeNames::password):
+ (WebCore::InputTypeNames::radio):
+ (WebCore::InputTypeNames::range):
+ (WebCore::InputTypeNames::reset):
+ (WebCore::InputTypeNames::search):
+ (WebCore::InputTypeNames::submit):
+ (WebCore::InputTypeNames::telephone):
+ (WebCore::InputTypeNames::text):
+ (WebCore::InputTypeNames::time):
+ (WebCore::InputTypeNames::url):
+ (WebCore::InputTypeNames::week):
+
+2012-08-19 Benjamin Poulain <benjamin@webkit.org>
+
+ Remove the static Strings used for outputting values of CSS_ATTR, CSS_COUNTER, CSS_RECT
+ https://bugs.webkit.org/show_bug.cgi?id=94420
+
+ Reviewed by Kentaro Hara.
+
+ Use the new StringBuilder::appendLiteral() instead of keeping some WTF::String in
+ memory.
+
+ The patch reduces memory usage.
+ It also reduces the binary size (-1672 bytes on x86_64).
+ I did not measure any difference in performance.
+
+ * css/CSSPrimitiveValue.cpp:
+ (WebCore::CSSPrimitiveValue::customCssText):
+
+2012-08-19 Rik Cabanier <cabanier@adobe.com>
+
+ parse CSS attribute -webkit-blend-mode
+ https://bugs.webkit.org/show_bug.cgi?id=94024
+
+ Reviewed by Dirk Schulze.
+
+ Added parsing and general CSS handling of -webkit-blend-mode per http://www.w3.org/TR/2012/WD-compositing-20120816/
+
+ Tests: css3/compositing/blend-mode-property-parsing-invalid.html
+ css3/compositing/blend-mode-property-parsing.html
+ css3/compositing/blend-mode-property.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore):
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSParser.cpp:
+ (WebCore::isValidKeywordPropertyAndValue):
+ (WebCore::isKeywordPropertyID):
+ (WebCore::CSSParser::parseValue):
+ * css/CSSProperty.cpp:
+ (WebCore::CSSProperty::isInheritedProperty):
+ * css/CSSPropertyNames.in:
+ * css/CSSValueKeywords.in:
+ * css/StyleBuilder.cpp:
+ (WebCore::StyleBuilder::StyleBuilder):
+ * rendering/RenderLayer.h:
+ (RenderLayer):
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
+ (WebCore):
+ (WebCore::RenderLayerBacking::updateLayerBlendMode):
+ (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
+ (WebCore::RenderLayerBacking::setBlendMode):
+ * rendering/RenderLayerBacking.h:
+ (RenderLayerBacking):
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::diff):
+ * rendering/style/RenderStyle.h:
+ * rendering/style/StyleRareNonInheritedData.cpp:
+ (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+ (WebCore::StyleRareNonInheritedData::operator==):
+ * rendering/style/StyleRareNonInheritedData.h:
+ (StyleRareNonInheritedData):
+
+2012-08-19 MORITA Hajime <morrita@google.com>
+
+ DOM mutation against including <link> shouldn't trigger pending HTML parser.
+ https://bugs.webkit.org/show_bug.cgi?id=93641
+
+ Reviewed by Ryosuke Niwa.
+
+ HTMLLinkElement::removedFrom() invoked Document::removePendingSheet(), which can trigger
+ HTMLParser that can mutate DOM tree. DOM mutation reentrancy on like this is problematic and
+ should be prohibited.
+
+ This change add an variation of Document::removePendingSheet() which postpones the notification
+ which triggers DOM mutation, and flush such pending notifications at the end of ongoing mutation.
+
+ Test: http/tests/loading/remove-child-triggers-parser.html
+
+ * dom/ContainerNodeAlgorithms.h:
+ (WebCore::ChildNodeRemovalNotifier::notify): Flushed pending notifications at the end.
+ * dom/Document.cpp:
+ (WebCore::Document::Document):
+ (WebCore::Document::removePendingSheet): Added RemovePendingSheetNotificationType parameter.
+ (WebCore):
+ (WebCore::Document::didRemoveAllPendingStylesheet): Extracted from removePendingSheet()
+ * dom/Document.h:
+ (Document):
+ (WebCore::Document::setNeedsNotifyRemoveAllPendingStylesheet): A flag setter.
+ (WebCore::Document::notifyRemovePendingSheetIfNeeded):
+ (WebCore):
+ * html/HTMLLinkElement.cpp:
+ (WebCore::HTMLLinkElement::removedFrom): Switched to use "notification later" version of removePendingSheet()
+ (WebCore::HTMLLinkElement::removePendingSheet): Added RemovePendingSheetNotificationType parameter.
+ * html/HTMLLinkElement.h:
+
+2012-08-19 Kentaro Hara <haraken@chromium.org>
+
+ Remove RefPtr from HTMLProgressElement::m_value
+ https://bugs.webkit.org/show_bug.cgi?id=94336
+
+ Reviewed by Kent Tamura.
+
+ To avoid reference cycles of RefPtr<Node>s, we want to remove
+ unnecessary RefPtr<Node>s. The rationale is described in bug 94324.
+
+ HTMLProgressElement::m_value does not need to be a RefPtr<Node>, because
+ it is guaranteed to point to a shadow DOM tree of the HTMLProgressElement
+ node, which is guaranteed to exist in the subtree of the HTMLProgressElement node.
+
+ No tests. No change in behavior.
+
+ * html/HTMLProgressElement.cpp:
+ (WebCore::HTMLProgressElement::HTMLProgressElement):
+ (WebCore::HTMLProgressElement::createShadowSubtree):
+ * html/HTMLProgressElement.h:
+
+2012-08-19 Kentaro Hara <haraken@chromium.org>
+
+ Remove RefPtr from SearchInputType::m_resultsButton and SearchInputType::m_cancelButton
+ https://bugs.webkit.org/show_bug.cgi?id=94339
+
+ Reviewed by Kent Tamura.
+
+ To avoid reference cycles of RefPtr<Node>s, we want to remove unnecessary
+ RefPtr<Node>s. The rationale is described in bug 94324.
+
+ SearchInputType::m_resultsButton and SearchInputType::m_cancelButton do not
+ need to be RefPtr<Node>s, because they are guaranteed to point to the shadow
+ DOM tree of the SearchInputType node, which is guaranteed to exist in the
+ subtree of the SearchInputType node.
+
+ No tests. No change in behavior.
+
+ * html/SearchInputType.cpp:
+ (WebCore::SearchInputType::SearchInputType):
+ (WebCore::SearchInputType::createShadowSubtree):
+ (WebCore::SearchInputType::resultsButtonElement):
+ (WebCore::SearchInputType::cancelButtonElement):
+ (WebCore::SearchInputType::destroyShadowSubtree):
+ (WebCore::SearchInputType::subtreeHasChanged):
+ * html/SearchInputType.h:
+ (SearchInputType):
+
+2012-08-19 Mike West <mkwst@chromium.org>
+
+ CSP 1.1: Add 'plugin-types' and 'form-action' DOM API.
+ https://bugs.webkit.org/show_bug.cgi?id=94415
+
+ Reviewed by Adam Barth.
+
+ Experimental implementations of the new 'plugin-types' and 'form-action'
+ directives recently landed, but we neglected to add DOM API endpoints to
+ query their state. Those APIs have been added to the specification[1],
+ and this patch brings our implementation up to date.
+
+ Tests: http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowformaction.html
+ http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowplugintype.html
+
+ * page/DOMSecurityPolicy.cpp:
+ (isAllowed):
+ As a drive-by, change a parameter from a KURL to a String to match
+ the actual template. There's no reason to stringify an empty URL
+ when we can just use an empty string instead.
+ (isAllowedWithType):
+ Call out to the ContentSecurityPolicy object to check the protected
+ resource's ability to load a given media type.
+ (WebCore::DOMSecurityPolicy::allowsFormAction):
+ Call out to the ContentSecurityPolicy object to check the protected
+ resource's ability to submit a form to the given URL.
+ (WebCore):
+ (WebCore::DOMSecurityPolicy::allowsPluginType):
+ Pipes the plugin type through 'isAllowedWithType' for resolution.
+ * page/DOMSecurityPolicy.h:
+ Add the 'allowsPluginType' and 'allowsFormAction' methods.
+ (DOMSecurityPolicy):
+ * page/DOMSecurityPolicy.idl:
+ Add the 'allowsPluginType' and 'allowsFormAction' methods.
+
+2012-08-19 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: load network panel lazily
+ https://bugs.webkit.org/show_bug.cgi?id=94414
+
+ Reviewed by Vsevolod Vlasov.
+
+ This change removes access to WebInspector.panels.network and loads it lazily.
+
+ * WebCore.gypi:
+ * WebCore.xcodeproj/project.pbxproj:
+ * inspector/front-end/ConsoleMessage.js:
+ (WebInspector.ConsoleMessageImpl):
+ (WebInspector.ConsoleMessageImpl.prototype.clone):
+ * inspector/front-end/ConsoleModel.js:
+ (WebInspector.ConsoleMessage.create):
+ (WebInspector.ConsoleDispatcher.prototype.messageAdded):
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleMessage.create):
+ * inspector/front-end/NetworkLog.js:
+ (WebInspector.NetworkLog):
+ (WebInspector.NetworkLog.prototype._onRequestStarted):
+ (WebInspector.NetworkLog.prototype._onLoad):
+ (WebInspector.NetworkLog.prototype.requestForId):
+ * inspector/front-end/NetworkManager.js:
+ (WebInspector.NetworkDispatcher.prototype._updateNetworkRequestWithResponse):
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkLogView):
+ * inspector/front-end/ScriptSnippetModel.js:
+ (WebInspector.ScriptSnippetModel.prototype.evaluateScriptSnippet.compileCallback):
+ (WebInspector.ScriptSnippetModel.prototype.evaluateScriptSnippet):
+ * inspector/front-end/externs.js:
+ * inspector/front-end/inspector.html:
+ * inspector/front-end/inspector.js:
+ (WebInspector._panelDescriptors):
+ (WebInspector._showAnchorLocation):
+
+2012-08-19 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125976.
+ http://trac.webkit.org/changeset/125976
+ https://bugs.webkit.org/show_bug.cgi?id=94430
+
+ it does not fix build. (Requested by pfeldman on #webkit).
+
+ * GNUmakefile.am:
+ * GNUmakefile.list.am:
+
+2012-08-19 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Unreviewed. Fix make distcheck.
+
+ * GNUmakefile.am: Add idl files in Modules/quota to EXTRA_DIST.
+ * GNUmakefile.list.am: Add missing files to compilation.
+
+2012-08-19 Andreas Kling <kling@webkit.org>
+
+ Remove unused ElementAttributeData::removeAttribute() overload.
+ <http://webkit.org/b/94425>
+
+ Reviewed by Antti Koivisto.
+
+ * dom/ElementAttributeData.h:
+ (ElementAttributeData):
+
+2012-08-18 Philip Rogers <pdr@google.com>
+
+ Refactor SVGMaskElement to inherit from StyledElement
+ https://bugs.webkit.org/show_bug.cgi?id=94418
+
+ Reviewed by Dirk Schulze.
+
+ Previously, SVGMaskElement inherited from SVGStyledLocatableElement which includes
+ several unnecessary functions (e.g., getBBox()). This patch refactors SVGMaskElement
+ to inherit from SVGStyledElement which matches the spec:
+ http://www.w3.org/TR/SVG/single-page.html#masking-InterfaceSVGMaskElement
+
+ No new tests as this is just a refactoring.
+
+ * svg/SVGMaskElement.cpp:
+ (WebCore):
+ (WebCore::SVGMaskElement::SVGMaskElement):
+ * svg/SVGMaskElement.h:
+
+2012-08-18 Andreas Kling <kling@webkit.org>
+
+ CSSValueList: Reserve the exact amount of space needed when constructing from CSS parser.
+ (No bug URL as Bugzilla is down today.)
+
+ Reviewed by Antti Koivisto.
+
+ Use Vector::reserveInitialCapacity() when constructing a CSSValueList from a CSSParserValueList
+ since we have the final length available. Also inlined the trivial append() and prepend().
+
+ * css/CSSValueList.cpp:
+ (WebCore::CSSValueList::CSSValueList):
+ * css/CSSValueList.h:
+ (WebCore::CSSValueList::append):
+ (WebCore::CSSValueList::prepend):
+
+2012-08-18 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: make profiles panel a lazily loaded module.
+ https://bugs.webkit.org/show_bug.cgi?id=94351
+
+ Reviewed by Yury Semikhatsky.
+
+ - removed usages of WebInspector.panels.profiles.
+ - made panel lazily loaded
+
+ * WebCore.gypi:
+ * WebCore.xcodeproj/project.pbxproj:
+ * inspector/front-end/CPUProfileView.js:
+ (WebInspector.CPUProfileHeader.prototype.createView):
+ * inspector/front-end/CSSSelectorProfileView.js:
+ (WebInspector.CSSSelectorProfileType.prototype.buttonClicked):
+ (WebInspector.CSSSelectorProfileType.prototype._startRecordingProfile):
+ (WebInspector.CSSSelectorProfileType.prototype._stopRecordingProfile):
+ (WebInspector.CSSProfileHeader.prototype.createView):
+ * inspector/front-end/HeapSnapshotDataGrids.js:
+ (WebInspector.HeapSnapshotSortableDataGrid.prototype.populateContextMenu.revealInDominatorsView):
+ (WebInspector.HeapSnapshotSortableDataGrid.prototype.populateContextMenu.else.revealInSummaryView):
+ (WebInspector.HeapSnapshotSortableDataGrid.prototype.populateContextMenu):
+ * inspector/front-end/HeapSnapshotView.js:
+ (WebInspector.HeapSnapshotView.prototype._profiles):
+ (WebInspector.HeapSnapshotView.prototype.populateContextMenu):
+ (WebInspector.HeapSnapshotProfileType.prototype.buttonClicked):
+ (WebInspector.HeapProfileHeader.prototype.createView):
+ * inspector/front-end/InspectorFrontendAPI.js:
+ (InspectorFrontendAPI.isProfilingJavaScript):
+ (InspectorFrontendAPI.startProfilingJavaScript):
+ (InspectorFrontendAPI.stopProfilingJavaScript):
+ * inspector/front-end/NativeMemorySnapshotView.js:
+ (WebInspector.NativeMemoryProfileHeader.prototype.createView):
+ * inspector/front-end/ProfilesPanel.js:
+ (WebInspector.ProfileType.prototype.buttonClicked):
+ (WebInspector.ProfileHeader.prototype.view):
+ (WebInspector.ProfileHeader.prototype.createView):
+ (WebInspector.ProfilesPanel.prototype.toggleRecordButton):
+ (WebInspector.ProfilesPanel.prototype.showProfileForURL):
+ (WebInspector.RevealInHeapSnapshotContextMenuProvider.prototype.populateContextMenu.didReceiveHeapObjectId):
+ (WebInspector.RevealInHeapSnapshotContextMenuProvider.prototype.populateContextMenu):
+ (WebInspector.ProfileSidebarTreeElement.prototype.handleContextMenuEvent):
+ (WebInspector.ProfileGroupSidebarTreeElement.prototype.onselect):
+ * inspector/front-end/Settings.js:
+ * inspector/front-end/externs.js:
+ * inspector/front-end/inspector.html:
+ * inspector/front-end/inspector.js:
+ (WebInspector._panelDescriptors):
+ (WebInspector._toggleSearchingForNode):
+ (WebInspector._profilesLinkifier):
+ (WebInspector._requestZoom.set InspectorFrontendHost):
+ (WebInspector._requestZoom):
+ (WebInspector.documentClick.followLink):
+ (WebInspector.documentClick):
+
+2012-08-18 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: load panels code on demand
+ https://bugs.webkit.org/show_bug.cgi?id=94326
+
+ Reviewed by Vsevolod Vlasov.
+
+ - Introduces importScript that evals in debug mode and inlines for release
+ - Loads Element, Resources, Timeline, Audits panels lazily.
+
+ * WebCore.gypi:
+ * WebCore.xcodeproj/project.pbxproj:
+ * inspector/compile-front-end.py:
+ * inspector/front-end/AuditsPanel.js:
+ * inspector/front-end/CodeMirrorTextEditor.js:
+ (WebInspector.CodeMirrorTextEditor):
+ (WebInspector.CodeMirrorTextEditor.prototype._toRange):
+ * inspector/front-end/Color.js:
+ * inspector/front-end/ElementsPanel.js:
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onCreatePanel):
+ * inspector/front-end/Panel.js:
+ (WebInspector.Panel):
+ (WebInspector.PanelDescriptor):
+ (WebInspector.PanelDescriptor.prototype.panel):
+ * inspector/front-end/ResourcesPanel.js:
+ * inspector/front-end/SettingsScreen.js:
+ (WebInspector.GenericSettingsTab):
+ * inspector/front-end/SourceFrame.js:
+ (WebInspector.SourceFrame):
+ * inspector/front-end/Spectrum.js:
+ (WebInspector.Spectrum.prototype.get outputColorFormat):
+ * inspector/front-end/StylesSidebarPane.js:
+ * inspector/front-end/TimelinePanel.js:
+ * inspector/front-end/inspector.html:
+ * inspector/front-end/inspector.js:
+ (WebInspector._panelDescriptors):
+ (WebInspector.doLoadedDone):
+ * inspector/front-end/utilities.js:
+ * inspector/inline-javascript-imports.py:
+ (main):
+
+2012-08-17 Keishi Hattori <keishi@webkit.org>
+
+ Calendar picker shows wrong date when input element has year earlier than 100
+ https://bugs.webkit.org/show_bug.cgi?id=94100
+
+ Reviewed by Kent Tamura.
+
+ Date.UTC can't set an year earlier than 100. So when the input has a value earlier than 100, calendar picker shows the wrong date.
+
+ Test: fast/forms/date/calendar-picker-appearance-pre-100.html
+
+ * Resources/pagepopups/calendarPicker.js:
+ (createUTCDate): Uses setUTCFullYear when the year is pre 100.
+ (parseDateString):
+ (DaysTable.prototype._renderMonth):
+ (DaysTable.prototype._maybeSetPreviousMonth):
+ (DaysTable.prototype._maybeSetNextMonth):
+
+2012-08-17 Vangelis Kokkevis <vangelis@chromium.org>
+
+ [chromium] Fix random noise around text in FPS HUD.
+ https://bugs.webkit.org/show_bug.cgi?id=94400
+
+ Reviewed by James Robinson.
+
+ This was the result of an incorrect clear operation on the canvas
+ that stores the font atlas used by the HUD.
+
+
+ * platform/graphics/chromium/CompositorHUDFontAtlas.cpp:
+ (WebCore::CompositorHUDFontAtlas::generateFontAtlas):
+
+2012-08-17 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, rolling out r125897.
+ http://trac.webkit.org/changeset/125897
+ https://bugs.webkit.org/show_bug.cgi?id=94326
+
+ This patch seems to have broken the inspector on the apple mac bots.
+
+ * WebCore.gypi:
+ * inspector/compile-front-end.py:
+ * inspector/front-end/AuditsPanel.js:
+ * inspector/front-end/CodeMirrorTextEditor.js:
+ (WebInspector.CodeMirrorTextEditor):
+ (WebInspector.CodeMirrorTextEditor.prototype._toRange):
+ (WebInspector.CodeMirrorTextEditor.prototype._loadLibraries.loadLibrary):
+ (WebInspector.CodeMirrorTextEditor.prototype._loadLibraries):
+ * inspector/front-end/Color.js:
+ * inspector/front-end/ElementsPanel.js:
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onCreatePanel):
+ * inspector/front-end/Panel.js:
+ (WebInspector.Panel):
+ (WebInspector.PanelDescriptor):
+ (WebInspector.PanelDescriptor.prototype.panel):
+ * inspector/front-end/ResourcesPanel.js:
+ * inspector/front-end/SettingsScreen.js:
+ (WebInspector.GenericSettingsTab):
+ * inspector/front-end/SourceFrame.js:
+ (WebInspector.SourceFrame):
+ * inspector/front-end/Spectrum.js:
+ (WebInspector.Spectrum.prototype.get outputColorFormat):
+ * inspector/front-end/StylesSidebarPane.js:
+ * inspector/front-end/TimelinePanel.js:
+ * inspector/front-end/inspector.html:
+ * inspector/front-end/inspector.js:
+ (WebInspector._panelDescriptors):
+ (WebInspector.doLoadedDone):
+ * inspector/front-end/utilities.js:
+
+2012-08-17 Chris Rogers <crogers@google.com>
+
+ AudioParam must support k-rate processing with audio-rate connections
+ https://bugs.webkit.org/show_bug.cgi?id=94385
+
+ Reviewed by Kenneth Russell.
+
+ Fully implement AudioParam *final* value calculation according to spec:
+ https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioParam
+
+ In particular, this covers the case where the parameter is k-rate, and we also
+ have audio-rate connections to the AudioParam.
+
+ * Modules/webaudio/AudioParam.cpp:
+ (WebCore::AudioParam::finalValue):
+ (WebCore):
+ (WebCore::AudioParam::calculateSampleAccurateValues):
+ (WebCore::AudioParam::calculateFinalValues):
+ * Modules/webaudio/AudioParam.h:
+ (AudioParam):
+ * Modules/webaudio/DelayDSPKernel.cpp:
+ (WebCore::DelayDSPKernel::process):
+
+2012-08-17 Alice Cheng <alice_cheng@apple.com>
+
+ Preserve styling elements in DeleteSelectionCommand
+ <rdar://problem/12040676>
+ https://bugs.webkit.org/show_bug.cgi?id=93643
+
+ Reviewed by Ryosuke Niwa.
+
+ Styling elements (<link> and <style>) can appear inside editable content. To
+ prevent accidental deletion, we move styling elements to rootEditableElement in
+ DeleteSelectionCommand undoably.
+
+ Test: editing/execCommand/delete-selection-has-style.html
+
+ * editing/DeleteSelectionCommand.cpp:
+ (WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss): Added to preserve styling elements during the command
+ (WebCore::DeleteSelectionCommand::handleGeneralDelete): Modified to preserve styling elements during the command
+ * editing/DeleteSelectionCommand.h:
+ (DeleteSelectionCommand):
+
+2012-08-17 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125940.
+ http://trac.webkit.org/changeset/125940
+ https://bugs.webkit.org/show_bug.cgi?id=94398
+
+ "Causes crashes on the bots
+ http://build.webkit.org/results/Apple%20Lion%20Debug%20WK2%20(Tests)/r125944%20(2626)/fast/css
+ /first-letter-removed-added-crash-log.txt" (Requested by
+ bradee-oh on #webkit).
+
+ * rendering/RenderListItem.cpp:
+ * rendering/RenderListItem.h:
+ (RenderListItem):
+ * rendering/RenderObject.cpp:
+ * rendering/RenderObject.h:
+ (RenderObject):
+ * rendering/RenderObjectChildList.cpp:
+ (WebCore::RenderObjectChildList::removeChildNode):
+ * rendering/RenderObjectChildList.h:
+ (RenderObjectChildList):
+ * rendering/RenderQuote.cpp:
+ * rendering/RenderQuote.h:
+ * rendering/RenderRegion.cpp:
+ * rendering/RenderRegion.h:
+ (RenderRegion):
+
+2012-08-17 Sukolsak Sakshuwong <sukolsak@google.com>
+
+ Disconnect UndoManager when its undo scope host is destroyed
+ https://bugs.webkit.org/show_bug.cgi?id=94388
+
+ Reviewed by Ryosuke Niwa.
+
+ Disconnect UndoManager in Element's destructor to prevent
+ use-after-free vulnerabilities.
+
+ Test: editing/undomanager/undoscopehost-use-after-free.html
+
+ * dom/Element.cpp:
+ (WebCore::Element::~Element):
+
+2012-08-17 Dan Bernstein <mitz@apple.com>
+
+ Fixed incorrect references to JSVoidCallback.{cpp,h} in the project file.
+
+ * WebCore.xcodeproj/project.pbxproj:
+
+2012-08-17 Ryosuke Niwa <rniwa@webkit.org>
+
+ Fix Xcode project file.
+
+ * WebCore.xcodeproj/project.pbxproj:
+
+2012-08-17 Kangil Han <kangil.han@samsung.com>
+
+ [BlackBerry][EFL] Remove compile warning in WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=94328
+
+ Reviewed by Rob Buis.
+
+ Fixed compile time warning in WebCore.
+
+ * platform/efl/RenderThemeEfl.cpp:
+ (WebCore::RenderThemeEfl::createEdje): unused variable ‘errmsg’ [-Wunused-variable]
+ * platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp:
+ (WebCore::HarfBuzzShaper::selectionRect): ‘toX’ may be used uninitialized in this function [-Wuninitialized], ‘fromX’ may be used uniniti
+
+2012-08-17 Arnaud Renevier <a.renevier@sisa.samsung.com>
+
+ [V8] use checkInboundData in setWebGLArrayHelper
+ https://bugs.webkit.org/show_bug.cgi?id=93051
+
+ Reviewed by Kenneth Russell.
+
+ Use TypedArray method checkInboundData in setWebGLArrayHelper instead
+ of performing the computation manually.
+
+ No new tests. This patch doesn't change behavior.
+
+ * bindings/v8/custom/V8ArrayBufferViewCustom.h:
+ (WebCore::setWebGLArrayHelper):
+
+2012-08-17 Alexey Proskuryakov <ap@apple.com>
+
+ REGRESSION (r125912): Crashes in worker tests
+ https://bugs.webkit.org/show_bug.cgi?id=94390
+
+ Reviewed by Brady Eidson and Sam Weinig.
+
+ * bindings/js/JSDOMBinding.cpp: (WebCore::reportException): It's always fine
+ to report an exception on a worker context, but it's not fine to treat those as windows.
+
+2012-08-17 James Robinson <jamesr@chromium.org>
+
+ [chromium] Add missing header files to .gypi and missing include to CCTiledLayerImpl.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=94391
+
+ Reviewed by Adrienne Walker.
+
+ * WebCore.gypi:
+ * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
+
+2012-08-17 David Grogan <dgrogan@chromium.org>
+
+ IndexedDB: Test if getting a TRANSACTION_INACTIVE_ERR is possible when setting version
+ https://bugs.webkit.org/show_bug.cgi?id=94269
+
+ Reviewed by Ojan Vafai.
+
+ I don't see a path through which this code is exercised.
+ ASSERT_NOT_REACHED doesn't cause any of our tests to fail. It might be
+ timing-related, in which case this ASSERT should be sporadically hit.
+ If this ASSERT is hit, see if we can write a test that exercises it or
+ at least add comments explaining how it gets exercised. If this ASSERT
+ is not hit after a while, change it to
+ ASSERT(transaction.scheduleTask(...)).
+
+ No new tests, we're looking for existing tests to fail.
+
+ * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
+ (WebCore::IDBDatabaseBackendImpl::setVersion):
+ (WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction):
+
+2012-08-17 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125922.
+ http://trac.webkit.org/changeset/125922
+ https://bugs.webkit.org/show_bug.cgi?id=94389
+
+ "Causing failing/crashing tests on Mac bots" (Requested by
+ bradee-oh on #webkit).
+
+ * WebCore.gypi:
+ * inspector/front-end/CPUProfileView.js:
+ (WebInspector.CPUProfileHeader.prototype.createView):
+ * inspector/front-end/CSSSelectorProfileView.js:
+ (WebInspector.CSSSelectorProfileType.prototype.buttonClicked):
+ (WebInspector.CSSSelectorProfileType.prototype._startRecordingProfile):
+ (WebInspector.CSSSelectorProfileType.prototype._stopRecordingProfile):
+ (WebInspector.CSSProfileHeader.prototype.createView):
+ * inspector/front-end/HeapSnapshotDataGrids.js:
+ (WebInspector.HeapSnapshotSortableDataGrid.prototype.populateContextMenu.revealInDominatorsView):
+ (WebInspector.HeapSnapshotSortableDataGrid.prototype.populateContextMenu.else.revealInSummaryView):
+ (WebInspector.HeapSnapshotSortableDataGrid.prototype.populateContextMenu):
+ * inspector/front-end/HeapSnapshotView.js:
+ (WebInspector.HeapSnapshotView.prototype._profiles):
+ (WebInspector.HeapSnapshotView.prototype.populateContextMenu):
+ (WebInspector.HeapSnapshotProfileType.prototype.buttonClicked):
+ (WebInspector.HeapProfileHeader.prototype.createView):
+ * inspector/front-end/InspectorFrontendAPI.js:
+ (InspectorFrontendAPI.isProfilingJavaScript):
+ (InspectorFrontendAPI.startProfilingJavaScript):
+ (InspectorFrontendAPI.stopProfilingJavaScript):
+ * inspector/front-end/NativeMemorySnapshotView.js:
+ (WebInspector.NativeMemoryProfileHeader.prototype.createView):
+ * inspector/front-end/ProfilesPanel.js:
+ (WebInspector.ProfileType.prototype.buttonClicked):
+ (WebInspector.ProfileHeader.prototype.view):
+ (WebInspector.ProfileHeader.prototype.createView):
+ (WebInspector.ProfilesPanel.prototype.toggleRecordButton):
+ (WebInspector.ProfilesPanel.prototype.showProfileForURL):
+ (WebInspector.RevealInHeapSnapshotContextMenuProvider.prototype.populateContextMenu.didReceiveHeapObjectId):
+ (WebInspector.RevealInHeapSnapshotContextMenuProvider.prototype.populateContextMenu):
+ (WebInspector.ProfileSidebarTreeElement.prototype.handleContextMenuEvent):
+ (WebInspector.ProfileGroupSidebarTreeElement.prototype.onselect):
+ * inspector/front-end/Settings.js:
+ * inspector/front-end/externs.js:
+ * inspector/front-end/inspector.html:
+ * inspector/front-end/inspector.js:
+ (WebInspector._panelDescriptors):
+ (WebInspector._toggleSearchingForNode):
+ (WebInspector._requestZoom.set InspectorFrontendHost):
+ (WebInspector._requestZoom):
+ (WebInspector.documentClick.followLink):
+ (WebInspector.documentClick):
+ (WebInspector.frontendReused):
+
+2012-08-17 Julien Chaffraix <jchaffraix@webkit.org>
+
+ Introduce a will-be-removed-from-tree notification in RenderObject
+ https://bugs.webkit.org/show_bug.cgi?id=94271
+
+ Reviewed by Abhishek Arya.
+
+ Following bug 93874, we have an insertion notification. This change adds the
+ matching removal notification (willBeRemovedFromTree).
+
+ Refactoring covered by existing tests.
+
+ * rendering/RenderObjectChildList.cpp:
+ (WebCore::RenderObjectChildList::removeChildNode):
+ Removed the code from here and moved it below.
+
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::willBeRemovedFromTree):
+ * rendering/RenderObject.h:
+ This is the base function that should be called by every instance.
+
+ * rendering/RenderListItem.cpp:
+ (WebCore::RenderListItem::willBeRemovedFromTree):
+ * rendering/RenderListItem.h:
+ * rendering/RenderQuote.cpp:
+ (WebCore::RenderQuote::willBeRemovedFromTree):
+ * rendering/RenderQuote.h:
+ * rendering/RenderRegion.cpp:
+ (WebCore::RenderRegion::willBeRemovedFromTree):
+ * rendering/RenderRegion.h:
+ Overriden functions.
+
+2012-08-17 Brian Anderson <brianderson@chromium.org>
+
+ Fix vsyncTick drought when vsync throttling is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=94012
+
+ Reviewed by James Robinson.
+
+ CCFrameRateController made an assumption that every vsyncTick results
+ in a call to didBeginFrame, which is not necessarily true and causes
+ the CCFrameRateController to stop ticking when vsync is disabled. We
+ move the manual ticks out of didBeginFrame and manually tick in the
+ proper place.
+
+ CCFrameRateControllerTest updated with use cases that should tick
+ without a didBeginFrame and will fail without this patch.
+
+ * platform/graphics/chromium/cc/CCFrameRateController.cpp:
+ (WebCore::CCFrameRateController::setActive):
+ (WebCore::CCFrameRateController::onTimerTick):
+ (WebCore::CCFrameRateController::didBeginFrame):
+
+2012-08-16 Ojan Vafai <ojan@chromium.org>
+
+ Delete some dead code in RenderBox::computePercentageLogicalHeight
+ https://bugs.webkit.org/show_bug.cgi?id=94262
+
+ Reviewed by Tony Chang.
+
+ I'm pretty sure this is dead code. None of the layout tests hit this code,
+ including the ones added in the original patch http://trac.webkit.org/changeset/10983.
+ I spent a good while and could not concoct a test that hits this code.
+
+ The test-cases added in that file, as well as the test-cases I came up with that should
+ go through this codepath, instead go through computePositionedLogicalHeight and never
+ hit computePercentageLogicalHeight.
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::computePercentageLogicalHeight):
+
+2012-08-17 Benjamin Poulain <bpoulain@apple.com>
+
+ Make it easier to append a literal to StringBuilder
+ https://bugs.webkit.org/show_bug.cgi?id=94273
+
+ Reviewed by Kentaro Hara.
+
+ Use StringBuilder::appendLiteral() in MarkupAccumulator instead of computing every
+ value individually.
+
+ * editing/MarkupAccumulator.cpp:
+ (WebCore::MarkupAccumulator::appendComment):
+ (WebCore::MarkupAccumulator::appendXMLDeclaration):
+ (WebCore::MarkupAccumulator::appendDocumentType):
+ (WebCore::MarkupAccumulator::appendCDATASection):
+
+2012-08-17 Benjamin Poulain <bpoulain@apple.com>
+
+ Share the StringImpl the CSS property names
+ https://bugs.webkit.org/show_bug.cgi?id=94187
+
+ Reviewed by Alexey Proskuryakov.
+
+ Previously, we would instanciate a new String every time a CSS property name was needed.
+
+ This patches moves the creation of the AtomicString to CSSPropertyNames and reuse that
+ StringImpl whenever needed.
+
+ With the patch, accessing CSS property names from JavaScript gets about 2.1 times faster.
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ (WebCore::CSSComputedStyleDeclaration::item):
+ * css/CSSPrimitiveValue.cpp:
+ (WebCore::valueOrPropertyName):
+ * css/CSSProperty.cpp:
+ (WebCore::CSSProperty::cssName):
+ * css/PropertySetCSSStyleDeclaration.cpp:
+ (WebCore::PropertySetCSSStyleDeclaration::item):
+ (WebCore::PropertySetCSSStyleDeclaration::getPropertyShorthand):
+ * css/makeprop.pl:
+ * inspector/InspectorCSSAgent.cpp:
+ (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
+ * inspector/InspectorStyleSheet.cpp:
+ (WebCore::InspectorStyle::styleWithProperties):
+ * page/animation/ImplicitAnimation.cpp:
+ (WebCore::ImplicitAnimation::sendTransitionEvent):
+
+2012-08-16 James Robinson <jamesr@chromium.org>
+
+ [chromium] Add Source/WebCore/platform/graphics/chromium/cc/ to include path and remove cc/ prefix from includes
+ https://bugs.webkit.org/show_bug.cgi?id=94279
+
+ Reviewed by Adam Barth.
+
+ This brings us more in line with the rest of the WebKit repo and avoids potential header collisions during
+ transition.
+
+ * WebCore.gyp/WebCore.gyp:
+ * platform/chromium/support/CCThreadImpl.cpp:
+ * platform/chromium/support/CCThreadImpl.h:
+ * platform/chromium/support/WebCompositorImpl.cpp:
+ * platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp:
+ * platform/graphics/chromium/CanvasLayerTextureUpdater.cpp:
+ * platform/graphics/chromium/ContentLayerChromium.cpp:
+ * platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp:
+ * platform/graphics/chromium/HeadsUpDisplayLayerChromium.cpp:
+ * platform/graphics/chromium/HeadsUpDisplayLayerChromium.h:
+ * platform/graphics/chromium/IOSurfaceLayerChromium.cpp:
+ * platform/graphics/chromium/ImageLayerChromium.cpp:
+ * platform/graphics/chromium/LayerChromium.cpp:
+ * platform/graphics/chromium/LayerChromium.h:
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ * platform/graphics/chromium/LayerRendererChromium.h:
+ * platform/graphics/chromium/LayerTextureUpdater.h:
+ * platform/graphics/chromium/LinkHighlight.cpp:
+ * platform/graphics/chromium/RateLimiter.cpp:
+ * platform/graphics/chromium/RenderSurfaceChromium.cpp:
+ * platform/graphics/chromium/ScrollbarLayerChromium.cpp:
+ * platform/graphics/chromium/SolidColorLayerChromium.cpp:
+ * platform/graphics/chromium/TextureLayerChromium.cpp:
+ * platform/graphics/chromium/TiledLayerChromium.cpp:
+ * platform/graphics/chromium/TiledLayerChromium.h:
+ * platform/graphics/chromium/TreeSynchronizer.cpp:
+ * platform/graphics/chromium/VideoLayerChromium.cpp:
+ * platform/graphics/chromium/cc/CCActiveAnimation.cpp:
+ * platform/graphics/chromium/cc/CCActiveGestureAnimation.cpp:
+ * platform/graphics/chromium/cc/CCAnimationCurve.cpp:
+ * platform/graphics/chromium/cc/CCAnimationEvents.h:
+ * platform/graphics/chromium/cc/CCCheckerboardDrawQuad.cpp:
+ * platform/graphics/chromium/cc/CCCheckerboardDrawQuad.h:
+ * platform/graphics/chromium/cc/CCDamageTracker.cpp:
+ * platform/graphics/chromium/cc/CCDebugBorderDrawQuad.cpp:
+ * platform/graphics/chromium/cc/CCDebugBorderDrawQuad.h:
+ * platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp:
+ * platform/graphics/chromium/cc/CCDelayBasedTimeSource.h:
+ * platform/graphics/chromium/cc/CCDrawQuad.cpp:
+ * platform/graphics/chromium/cc/CCDrawQuad.h:
+ * platform/graphics/chromium/cc/CCFontAtlas.cpp:
+ * platform/graphics/chromium/cc/CCFrameRateController.cpp:
+ * platform/graphics/chromium/cc/CCFrameRateController.h:
+ * platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp:
+ * platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.h:
+ * platform/graphics/chromium/cc/CCIOSurfaceDrawQuad.cpp:
+ * platform/graphics/chromium/cc/CCIOSurfaceDrawQuad.h:
+ * platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp:
+ * platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.h:
+ * platform/graphics/chromium/cc/CCKeyframedAnimationCurve.cpp:
+ * platform/graphics/chromium/cc/CCKeyframedAnimationCurve.h:
+ * platform/graphics/chromium/cc/CCLayerAnimationController.cpp:
+ * platform/graphics/chromium/cc/CCLayerAnimationController.h:
+ * platform/graphics/chromium/cc/CCLayerImpl.cpp:
+ * platform/graphics/chromium/cc/CCLayerImpl.h:
+ * platform/graphics/chromium/cc/CCLayerIterator.cpp:
+ * platform/graphics/chromium/cc/CCLayerIterator.h:
+ * platform/graphics/chromium/cc/CCLayerQuad.cpp:
+ * platform/graphics/chromium/cc/CCLayerSorter.cpp:
+ * platform/graphics/chromium/cc/CCLayerSorter.h:
+ * platform/graphics/chromium/cc/CCLayerTilingData.cpp:
+ * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+ * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+ * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
+ * platform/graphics/chromium/cc/CCMathUtil.cpp:
+ * platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
+ * platform/graphics/chromium/cc/CCOcclusionTracker.h:
+ * platform/graphics/chromium/cc/CCOverdrawMetrics.cpp:
+ * platform/graphics/chromium/cc/CCPageScaleAnimation.cpp:
+ * platform/graphics/chromium/cc/CCPrioritizedTexture.h:
+ * platform/graphics/chromium/cc/CCProxy.cpp:
+ * platform/graphics/chromium/cc/CCQuadCuller.cpp:
+ * platform/graphics/chromium/cc/CCRenderPass.cpp:
+ * platform/graphics/chromium/cc/CCRenderPass.h:
+ * platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp:
+ * platform/graphics/chromium/cc/CCRenderPassDrawQuad.h:
+ * platform/graphics/chromium/cc/CCRenderSurface.cpp:
+ * platform/graphics/chromium/cc/CCRenderSurface.h:
+ * platform/graphics/chromium/cc/CCRenderSurfaceFilters.cpp:
+ * platform/graphics/chromium/cc/CCRenderer.h:
+ * platform/graphics/chromium/cc/CCResourceProvider.cpp:
+ * platform/graphics/chromium/cc/CCResourceProvider.h:
+ * platform/graphics/chromium/cc/CCScheduler.cpp:
+ * platform/graphics/chromium/cc/CCScheduler.h:
+ * platform/graphics/chromium/cc/CCSchedulerStateMachine.cpp:
+ * platform/graphics/chromium/cc/CCScopedTexture.cpp:
+ * platform/graphics/chromium/cc/CCScopedTexture.h:
+ * platform/graphics/chromium/cc/CCScopedThreadProxy.h:
+ * platform/graphics/chromium/cc/CCScrollbarAnimationController.cpp:
+ * platform/graphics/chromium/cc/CCScrollbarAnimationControllerLinearFade.cpp:
+ * platform/graphics/chromium/cc/CCScrollbarAnimationControllerLinearFade.h:
+ * platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp:
+ * platform/graphics/chromium/cc/CCScrollbarLayerImpl.h:
+ * platform/graphics/chromium/cc/CCSettings.cpp:
+ * platform/graphics/chromium/cc/CCSharedQuadState.cpp:
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.h:
+ * platform/graphics/chromium/cc/CCSolidColorDrawQuad.cpp:
+ * platform/graphics/chromium/cc/CCSolidColorDrawQuad.h:
+ * platform/graphics/chromium/cc/CCSolidColorLayerImpl.cpp:
+ * platform/graphics/chromium/cc/CCSolidColorLayerImpl.h:
+ * platform/graphics/chromium/cc/CCStreamVideoDrawQuad.cpp:
+ * platform/graphics/chromium/cc/CCStreamVideoDrawQuad.h:
+ * platform/graphics/chromium/cc/CCTexture.cpp:
+ * platform/graphics/chromium/cc/CCTexture.h:
+ * platform/graphics/chromium/cc/CCTextureDrawQuad.cpp:
+ * platform/graphics/chromium/cc/CCTextureDrawQuad.h:
+ * platform/graphics/chromium/cc/CCTextureLayerImpl.cpp:
+ * platform/graphics/chromium/cc/CCTextureLayerImpl.h:
+ * platform/graphics/chromium/cc/CCTextureUpdateController.cpp:
+ * platform/graphics/chromium/cc/CCTextureUpdateController.h:
+ * platform/graphics/chromium/cc/CCTextureUpdateQueue.cpp:
+ * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+ * platform/graphics/chromium/cc/CCThreadProxy.h:
+ * platform/graphics/chromium/cc/CCThreadTask.h:
+ * platform/graphics/chromium/cc/CCTileDrawQuad.cpp:
+ * platform/graphics/chromium/cc/CCTileDrawQuad.h:
+ * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
+ * platform/graphics/chromium/cc/CCTiledLayerImpl.h:
+ * platform/graphics/chromium/cc/CCTimer.cpp:
+ * platform/graphics/chromium/cc/CCTimingFunction.cpp:
+ * platform/graphics/chromium/cc/CCTimingFunction.h:
+ * platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
+ * platform/graphics/chromium/cc/CCVideoLayerImpl.h:
+ * platform/graphics/chromium/cc/CCYUVVideoDrawQuad.cpp:
+ * platform/graphics/chromium/cc/CCYUVVideoDrawQuad.h:
+ * platform/graphics/gpu/SharedGraphicsContext3D.cpp:
+
+2012-08-17 Ojan Vafai <ojan@chromium.org>
+
+ Delete dead code in deprecated flexbox for RTL line-clamp
+ https://bugs.webkit.org/show_bug.cgi?id=94282
+
+ Reviewed by Tony Chang.
+
+ -webkit-line-clamp and direction:rtl is not supported. Delete some
+ obviously dead code that half-tries to support it.
+ * rendering/RenderDeprecatedFlexibleBox.cpp:
+ (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
+
+2012-08-17 John Mellor <johnme@chromium.org>
+
+ Text Autosizing: Increase line height in proportion to font size.
+ https://bugs.webkit.org/show_bug.cgi?id=91660
+
+ Reviewed by Julien Chaffraix.
+
+ This patch causes line heights to be increased in proportion to font
+ size (so autosized text doesn't overlap itself). It does this by adding
+ a textAutosizingMultiplier() to RenderStyle, which the lineHeight()
+ getter multiplies its response by.
+
+ It also cleans up one or two things, for example treatAsInline is
+ renamed isNotAnAutosizingContainer to clarify that its purpose is to
+ discriminate autosizing containers (the smallest unit that we can turn
+ Text Autosizing on or off for; in particular these are not allowed to
+ be line participants, since multiple sizes on one line looks awful).
+
+ Tests: fast/text-autosizing/em-margin-border-padding.html
+ fast/text-autosizing/narrow-child.html
+ fast/text-autosizing/nested-em-line-height.html
+ fast/text-autosizing/simple-paragraph.html
+ fast/text-autosizing/span-child.html
+ fast/text-autosizing/wide-child.html
+
+ * css/StyleBuilder.cpp:
+ (WebCore::ApplyPropertyLineHeight::applyValue):
+
+ Replaced Length(-100.0, Percent) with RenderStyle::initialLineHeight(),
+ which is equivalent but makes the intent clearer.
+
+ (WebCore::ApplyPropertyLineHeight::createHandler):
+
+ Use specifiedLineHeight to match setLineHeight which takes a specified
+ line height (and generally this avoids accidentally inheriting text
+ autosizing).
+
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::applyProperty):
+
+ Similarly use specifiedLineHeight when inheriting line height.
+
+ * page/animation/CSSPropertyAnimation.cpp:
+ (WebCore::CSSPropertyAnimation::ensurePropertyMap):
+
+ Get and set specified lineHeight/fontSize if Text Autosizing is
+ enabled to avoid setting the specified value to the computed value
+ (causing values to be multiplied more than once!).
+
+ * platform/blackberry/RenderThemeBlackBerry.cpp:
+ (WebCore::RenderThemeBlackBerry::adjustMediaControlStyle):
+
+ Adjust for renamed setBlendedFontSize, and maintain cast to int.
+
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore::RenderTextControlSingleLine::createInnerTextStyle):
+
+ Replaced Length(-100.0, Percent) with RenderStyle::initialLineHeight(),
+ which is equivalent but makes the intent clearer.
+
+ * rendering/TextAutosizer.cpp:
+ (WebCore::TextAutosizer::processSubtree):
+
+ Use nextInPreOrderMatchingFilter instead of traverseNext, and some
+ other methods that got renamed.
+
+ (WebCore::TextAutosizer::processBox):
+
+ Renamed from processBlock, since RenderBoxes are sufficient; use
+ renamed nextInPreOrderMatchingFilter; make two calls to setMultiplier
+ (one for parent for line height) instead of processText.
+
+ (WebCore::TextAutosizer::setMultiplier):
+
+ Simplified from previous processText method; this just sets the
+ style's textAutosizingMultiplier (and the style does the rest).
+
+ (WebCore::TextAutosizer::isNotAnAutosizingContainer):
+
+ Renamed from treatAsInline; added explanatory comment; changed
+ isRenderBlock to isBox as boxes still have logicalWidth; changed
+ isInlineBlockOrInlineTable to isInline as it was an omission that
+ other inlines were allowed.
+
+ (WebCore::TextAutosizer::nextInPreOrderMatchingFilter):
+
+ Renamed from TextAutosizer::traverseNext.
+
+ (RenderObjectFilterFunctor):
+
+ Renamed from RenderObjectFilter to clafiry that it's a function ptr.
+
+ * rendering/TextAutosizer.h:
+ (TextAutosizer): Previously mentioned renamings.
+
+ * rendering/mathml/RenderMathMLSubSup.cpp:
+ (WebCore::RenderMathMLSubSup::fixScriptsStyle):
+
+ Adjust for renamed setBlendedFontSize.
+
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::diff):
+
+ textAutosizingMultiplier is a StyleDifferenceLayout (we want
+ setNeedsLayoutAndPrefWidthsRecalc to get called).
+
+ (WebCore::RenderStyle::setFontSize):
+
+ Renamed from setBlendedFontSize; if Text Autosizing is enabled and a
+ multiplier is set it auto-calculates the computedSize; float
+ param instead of int as discussed on webkit.org/b/91660.
+
+ * rendering/style/RenderStyle.h:
+
+ Added specifiedFontSize, computedFontSize and specifiedLineHeight
+ getters; changed lineHeight to dynamically calculate autosized line
+ height, and made computedLineHeight use this value instead of the
+ specified line height; also added textAutosizingMultiplier
+ getter/setter (the setter updated the font description's computed
+ size, by calling setFontSize); also renamed the parameter to
+ setLineHeight to explicitly note that it's setting the
+ specifiedLineHeight (and can still be adjusted by autosizing).
+
+ * rendering/style/StyleVisualData.cpp/.h:
+
+ Added m_textAutosizingMultiplier (this seems the best place to put a
+ non-inherited non-rare presentational property).
+
+2012-08-17 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] Add FindDBus.cmake and use it in the EFL port.
+ https://bugs.webkit.org/show_bug.cgi?id=94319
+
+ Reviewed by Daniel Bates.
+
+ * PlatformEfl.cmake: Link against DBUS_LIBRARIES and add
+ DBUS_INCLUDE_DIRS to the include path list if BATTERY_STATUS
+ support is enabled.
+
+2012-08-17 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: make profiles panel a lazily loaded module.
+ https://bugs.webkit.org/show_bug.cgi?id=94351
+
+ Reviewed by Yury Semikhatsky.
+
+ Moving files from .html to importScript.
+
+ * WebCore.gypi:
+ * inspector/front-end/CPUProfileView.js:
+ (WebInspector.CPUProfileHeader.prototype.createView):
+ * inspector/front-end/CSSSelectorProfileView.js:
+ (WebInspector.CSSSelectorProfileType.prototype.buttonClicked):
+ (WebInspector.CSSSelectorProfileType.prototype._startRecordingProfile):
+ (WebInspector.CSSSelectorProfileType.prototype._stopRecordingProfile):
+ (WebInspector.CSSProfileHeader.prototype.createView):
+ * inspector/front-end/HeapSnapshotDataGrids.js:
+ (WebInspector.HeapSnapshotSortableDataGrid.prototype.populateContextMenu.revealInDominatorsView):
+ (WebInspector.HeapSnapshotSortableDataGrid.prototype.populateContextMenu.else.revealInSummaryView):
+ (WebInspector.HeapSnapshotSortableDataGrid.prototype.populateContextMenu):
+ * inspector/front-end/HeapSnapshotView.js:
+ (WebInspector.HeapSnapshotView.prototype._profiles):
+ (WebInspector.HeapSnapshotView.prototype.populateContextMenu):
+ (WebInspector.HeapSnapshotProfileType.prototype.buttonClicked):
+ (WebInspector.HeapProfileHeader.prototype.createView):
+ * inspector/front-end/InspectorFrontendAPI.js:
+ (InspectorFrontendAPI.isProfilingJavaScript):
+ (InspectorFrontendAPI.startProfilingJavaScript):
+ (InspectorFrontendAPI.stopProfilingJavaScript):
+ * inspector/front-end/NativeMemorySnapshotView.js:
+ (WebInspector.NativeMemoryProfileHeader.prototype.createView):
+ * inspector/front-end/ProfilesPanel.js:
+ (WebInspector.ProfileType.prototype.buttonClicked):
+ (WebInspector.ProfileHeader.prototype.view):
+ (WebInspector.ProfileHeader.prototype.createView):
+ (WebInspector.ProfilesPanel.prototype.toggleRecordButton):
+ (WebInspector.ProfilesPanel.prototype.showProfileForURL):
+ (WebInspector.RevealInHeapSnapshotContextMenuProvider.prototype.populateContextMenu.didReceiveHeapObjectId):
+ (WebInspector.RevealInHeapSnapshotContextMenuProvider.prototype.populateContextMenu):
+ (WebInspector.ProfileSidebarTreeElement.prototype.handleContextMenuEvent):
+ (WebInspector.ProfileGroupSidebarTreeElement.prototype.onselect):
+ * inspector/front-end/externs.js:
+ * inspector/front-end/inspector.html:
+ * inspector/front-end/inspector.js:
+ (WebInspector._panelDescriptors):
+ (WebInspector._toggleSearchingForNode):
+ (WebInspector._profilesLinkifier):
+ (WebInspector._requestZoom.set InspectorFrontendHost):
+ (WebInspector._requestZoom):
+ (WebInspector.documentClick.followLink):
+ (WebInspector.documentClick):
+
+2012-08-17 Dominic Mazzoni <dmazzoni@google.com>
+
+ REGRESSION(r125710) - canvas-fallback-content tests asserting in Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=94156
+
+ Reviewed by Chris Fleizach.
+
+ When determining if a Node is focusable, check the canvas subtree
+ case first before encountering assertions that assume that anything
+ focusable must have an associated renderer.
+
+ Fixes existing tests so they don't assert.
+
+ * dom/Node.cpp:
+ (WebCore::Node::isFocusable):
+
+2012-08-17 Arpita Bahuguna <arpitabahuguna@gmail.com>
+
+ ASSERTION FAILED: allocatedMaxLogicalWidth <= cellMaxLogicalWidth : int WebCore::AutoTableLayout::calcEffectiveLogicalWidth()
+ https://bugs.webkit.org/show_bug.cgi?id=92471
+
+ Reviewed by Julien Chaffraix.
+
+ The assert occurs due to the float based computations causing a floating
+ point rounding error between allocatedMaxLogicalWidth and cellMaxLogicalWidth.
+
+ Test: fast/table/assert-autotablelayout-maxlogicalwidth.html
+
+ * rendering/AutoTableLayout.cpp:
+ (WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
+ Converting float based calculations for computing max logical width to int based;
+ similar to the calculations for min logical width.
+
+2012-08-17 John J. Barton <johnjbarton@chromium.org>
+
+ Web Inspector: Add //@ sourceURL to test-runner evals
+ https://bugs.webkit.org/show_bug.cgi?id=94268
+
+ Reviewed by Pavel Feldman.
+
+ Postpend a line that tells the debugger what to call this eval buffer.
+ Name ends in the sequennce number so all evals will appear together.
+ evaluateInWebInspector0.js eg
+
+ * inspector/front-end/TestController.js:
+ (WebInspector.evaluateForTestInFrontend):
+
+2012-08-17 Adam Barth <abarth@webkit.org>
+
+ REGRESSION (r125592): Crash in Console::addMessage, under InjectedBundle::reportException
+ https://bugs.webkit.org/show_bug.cgi?id=94220
+
+ Reviewed by Alexey Proskuryakov.
+
+ Previously, this code was trying to detect whether a DOMWindow is
+ currently displayed in a Frame by testing whether
+ DOMWindow->scriptExecutionContext is zero. That used to work, but now
+ that DOMWindow->scriptExecutionContext is non-zero for detached
+ DOMWindow, this code doesn't work anymore. This patch replaces the code
+ with the current idiom, which is to call
+ DOMWindow::isCurrentDisplayedInFrame.
+
+ Alexey and I couldn't figure out how to test this change. This bug
+ causes a crash when some Safari extensions are installed, but it's not
+ clear whether this bug can be triggered from the web platform. We're
+ going to ask Jessie for ideas when she gets back from vacation.
+
+ * bindings/js/JSDOMBinding.cpp:
+ (WebCore::reportException):
+
+2012-08-17 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125892.
+ http://trac.webkit.org/changeset/125892
+ https://bugs.webkit.org/show_bug.cgi?id=94350
+
+ Broke windows build (Requested by vollick on #webkit).
+
+ * platform/graphics/chromium/cc/CCActiveAnimation.cpp:
+ (WebCore::CCActiveAnimation::CCActiveAnimation):
+ (WebCore::CCActiveAnimation::~CCActiveAnimation):
+ (WebCore::CCActiveAnimation::setRunState):
+ (WebCore::CCActiveAnimation::cloneForImplThread):
+ * platform/graphics/chromium/cc/CCActiveAnimation.h:
+ (CCActiveAnimation):
+ * platform/graphics/chromium/cc/CCLayerAnimationController.cpp:
+ (WebCore::CCLayerAnimationController::pushNewAnimationsToImplThread):
+ (WebCore):
+ (WebCore::CCLayerAnimationController::replaceImplThreadAnimations):
+ (WebCore::CCLayerAnimationController::tickAnimations):
+
+2012-08-17 Zach Kuznia <zork@chromium.org>
+
+ Add support for Skia Magnifier filter to Chromium layers
+ https://bugs.webkit.org/show_bug.cgi?id=93939
+
+ Reviewed by James Robinson.
+
+ This is used by Chrome OS for the screen magnifier
+
+ * platform/graphics/chromium/cc/CCRenderSurfaceFilters.cpp:
+ (WebCore::CCRenderSurfaceFilters::optimize):
+ (WebCore::CCRenderSurfaceFilters::apply):
+
+2012-08-17 Allan Sandfeld Jensen <allan.jensen@nokia.com>
+
+ Touch adjustment for context menu gestures
+ https://bugs.webkit.org/show_bug.cgi?id=94101
+
+ Reviewed by Antonio Gomes.
+
+ Adds a new filter for detecting nodes that provides extra context-menu items,
+ and use that in a new set of functions for adjusting context-menu gestures.
+
+ Tests: touchadjustment/context-menu-select-text.html
+ touchadjustment/context-menu.html
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::bestContextMenuNodeForTouchPoint):
+ (WebCore::EventHandler::adjustGesturePosition):
+ * page/EventHandler.h:
+ (EventHandler):
+ * page/TouchAdjustment.cpp:
+ (WebCore::TouchAdjustment::nodeProvidesContextMenuItems):
+ (TouchAdjustment):
+ (WebCore::findBestContextMenuCandidate):
+ * page/TouchAdjustment.h:
+ * testing/Internals.cpp:
+ (WebCore::Internals::touchPositionAdjustedToBestContextMenuNode):
+ (WebCore::Internals::touchNodeAdjustedToBestContextMenuNode):
+ * testing/Internals.h:
+ (Internals):
+ * testing/Internals.idl:
+
+2012-08-17 Pavel Feldman <pfeldman@chromium.org>
+
+ https://bugs.webkit.org/show_bug.cgi?id=94326
+
+ Reviewed by Vsevolod Vlasov.
+
+ Loading code on demand (upon the panel access).
+
+ * WebCore.gypi:
+ * inspector/front-end/AuditsPanel.js:
+ * inspector/front-end/CodeMirrorTextEditor.js:
+ (WebInspector.CodeMirrorTextEditor):
+ (WebInspector.CodeMirrorTextEditor.prototype._toRange):
+ * inspector/front-end/ElementsPanel.js:
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onCreatePanel):
+ * inspector/front-end/Panel.js:
+ (WebInspector.Panel):
+ (WebInspector.PanelDescriptor):
+ (WebInspector.PanelDescriptor.prototype.panel):
+ * inspector/front-end/ResourcesPanel.js:
+ * inspector/front-end/SourceFrame.js:
+ (WebInspector.SourceFrame):
+ * inspector/front-end/TimelinePanel.js:
+ * inspector/front-end/inspector.html:
+ * inspector/front-end/inspector.js:
+ (WebInspector._panelDescriptors):
+ (WebInspector.doLoadedDone):
+ * inspector/front-end/utilities.js:
+
+2012-08-17 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125880.
+ http://trac.webkit.org/changeset/125880
+ https://bugs.webkit.org/show_bug.cgi?id=94347
+
+ Breaks front-end compilation: SourceFrame passed where View is
+ expected. (Requested by pfeldman on #webkit).
+
+ * inspector/front-end/CodeMirrorTextEditor.js:
+ (WebInspector.CodeMirrorTextEditor.prototype._loadLibraries):
+ * inspector/front-end/DefaultTextEditor.js:
+ (WebInspector.DefaultTextEditor.prototype.wasShown):
+ (WebInspector.DefaultTextEditor.prototype.willHide):
+ * inspector/front-end/JavaScriptSourceFrame.js:
+ (WebInspector.JavaScriptSourceFrame):
+ (WebInspector.JavaScriptSourceFrame.prototype.wasShown):
+ (WebInspector.JavaScriptSourceFrame.prototype.willHide):
+ * inspector/front-end/SourceFrame.js:
+ (WebInspector.SourceFrame):
+ (WebInspector.SourceFrame.prototype.wasShown):
+ (WebInspector.SourceFrame.prototype.willHide):
+ * inspector/front-end/TextEditor.js:
+ * inspector/front-end/scriptsPanel.css:
+ (.script-view):
+ (.script-view.visible):
+
+2012-08-17 Milian Wolff <milian.wolff@kdab.com>
+
+ [Qt] QNX build fails due to ctype usage in system headers
+ https://bugs.webkit.org/show_bug.cgi?id=93849
+
+ Reviewed by Simon Hausmann.
+
+ Move the check for whether DisallowCType should be active or not
+ to the DisallowCType.h header. This way, we can update the list
+ of platforms or OSes which do not work with this header in a
+ central place. All users can now safely include the header
+ and do not need to place custom guards around it.
+
+ * config.h:
+
+2012-08-17 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed trivial build fix: Correct file name in bindings/js/DOMTransaction.h used in HEADERS
+
+ * Target.pri:
+
+2012-08-17 Ian Vollick <vollick@chromium.org>
+
+ [chromium] Add tracing for active composited animations
+ https://bugs.webkit.org/show_bug.cgi?id=84210
+
+ Reviewed by James Robinson.
+
+ This patch issues the trace events from the animations. Animations will
+ report when they start and finish on the main and impl threads (via
+ TRACE_EVENT_ASYNC*), and also issues instant trace events whenever they
+ change state.
+
+ No new tests, only changes tracing behavior.
+
+ * platform/graphics/chromium/cc/CCActiveAnimation.cpp:
+ (WebCore::CCActiveAnimation::CCActiveAnimation):
+ (WebCore::CCActiveAnimation::~CCActiveAnimation):
+ (WebCore::CCActiveAnimation::setRunState):
+ (WebCore::CCActiveAnimation::clone):
+ (WebCore):
+ (WebCore::CCActiveAnimation::cloneAndInitialize):
+ * platform/graphics/chromium/cc/CCActiveAnimation.h:
+ (WebCore::CCActiveAnimation::isControllingInstance):
+ (CCActiveAnimation):
+ * platform/graphics/chromium/cc/CCLayerAnimationController.cpp:
+ (WebCore::CCLayerAnimationController::pushNewAnimationsToImplThread):
+ (WebCore::CCLayerAnimationController::replaceImplThreadAnimations):
+ (WebCore::CCLayerAnimationController::tickAnimations):
+
+2012-08-17 John J. Barton <johnjbarton@chromium.org>
+
+ Web Inspector: enhance external test-runner and add cleanup code
+ https://bugs.webkit.org/show_bug.cgi?id=94231
+
+ Reviewed by Pavel Feldman.
+
+ add 'click on test result to select for next run' feature.
+ remember the users size for the inspector popup.
+ refactor server URLs to one location at top of file.
+ use the same value for both tests and scanner servers.
+ remove one extra instruction on the page.
+ refactor clean up code.
+ close the two popup windows if the test-runner.html is reloaded.
+
+ * inspector/front-end/test-runner.html:
+
+2012-08-17 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed trivial follow-up fix to r125873: Add missing adoptRef to avoid leaks.
+
+ * bridge/qt/qt_instance.cpp:
+ (JSC::Bindings::WeakMap::set):
+
+2012-08-17 Kentaro Hara <haraken@chromium.org>
+
+ Remove RefPtr from DateInputType::m_pickerElement
+ https://bugs.webkit.org/show_bug.cgi?id=94330
+
+ Reviewed by Kent Tamura.
+
+ To avoid reference cycles of RefPtr<Node>s, we want to remove
+ unnecessary RefPtr<Node>s. The rationale is describe in bug 94324.
+
+ DateInputType::m_pickerElement does not need to be a RefPtr<Node>,
+ because it is guaranteed to point to a shadow DOM tree of the DateInputType
+ node, which is guaranteed to exist in the subtree of the DateInputType node.
+
+ No tests. No change in behavior.
+
+ * html/DateInputType.cpp:
+ (WebCore::DateInputType::DateInputType):
+ (WebCore::DateInputType::createShadowSubtree):
+ (WebCore::DateInputType::destroyShadowSubtree):
+ * html/DateInputType.h:
+ (DateInputType):
+
+2012-08-17 Dan Carney <dcarney@google.com>
+
+ Refactor away IsolatedWorld
+ https://bugs.webkit.org/show_bug.cgi?id=93971
+
+ Reviewed by Kentaro Hara.
+
+ Remove IsolatedWorld class as it was 1:1 with DOMWrapperWorld.
+ This update fixes a bad assertion which caused the previous
+ version to be rolled back.
+
+ No tests. No change in functionality.
+
+ * UseV8.cmake:
+ * WebCore.gypi:
+ * bindings/v8/DOMWrapperWorld.cpp:
+ (WebCore):
+ (WebCore::mainThreadNormalWorld):
+ * bindings/v8/DOMWrapperWorld.h:
+ (WebCore):
+ (DOMWrapperWorld):
+ (WebCore::DOMWrapperWorld::create):
+ (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
+ (WebCore::DOMWrapperWorld::count):
+ (WebCore::DOMWrapperWorld::worldId):
+ (WebCore::DOMWrapperWorld::domDataStore):
+ (WebCore::DOMWrapperWorld::DOMWrapperWorld):
+ * bindings/v8/IsolatedWorld.cpp: Removed.
+ * bindings/v8/IsolatedWorld.h: Removed.
+ * bindings/v8/V8DOMWrapper.h:
+ (WebCore::V8DOMWrapper::getCachedWrapper):
+ * bindings/v8/V8IsolatedContext.cpp:
+ (WebCore::V8IsolatedContext::V8IsolatedContext):
+ (WebCore::V8IsolatedContext::destroy):
+ * bindings/v8/V8IsolatedContext.h:
+ (WebCore::V8IsolatedContext::getEntered):
+ (WebCore::V8IsolatedContext::world):
+ (V8IsolatedContext):
+ * bindings/v8/V8PerIsolateData.h:
+ (WebCore::V8PerIsolateData::registerDOMDataStore):
+ (WebCore::V8PerIsolateData::unregisterDOMDataStore):
+
+2012-08-17 Kangil Han <kangil.han@samsung.com>
+
+ [EFL] Remove alloca usage
+ https://bugs.webkit.org/show_bug.cgi?id=93931
+
+ Reviewed by Carlos Garcia Campos.
+
+ This patch is unifying the approaches for the creation of Edje_Message_Float_Set messages, and getting rid of alloca is part of it, since it is not portable.
+
+ * platform/efl/RenderThemeEfl.cpp:
+ (WebCore::RenderThemeEfl::paintThemePart):
+ * platform/efl/ScrollbarEfl.cpp:
+ (ScrollbarEfl::updateThumbPositionAndProportion):
+
+2012-08-17 Alexander Pavlov <apavlov@chromium.org>
+
+ Web Inspector: hovering over an image link in Timeline popup kills popup
+ https://bugs.webkit.org/show_bug.cgi?id=94213
+
+ Reviewed by Pavel Feldman.
+
+ - Fixed bug with ElementsPanel PopoverHelper acting on the TimelinePanel (due to which the original issue occurs).
+ - Image preview added to resource entries popover in the timeline.
+ - Extracted the core image preview building code into UIUtils.js.
+ - Drive-by: fixed image centering in the preview element.
+
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel):
+ (WebInspector.ElementsPanel.prototype._showPopover.showPopover):
+ (WebInspector.ElementsPanel.prototype._showPopover):
+ * inspector/front-end/TimelinePanel.js:
+ (WebInspector.TimelinePanel.prototype._showPopover.showCallback):
+ (WebInspector.TimelinePanel.prototype._showPopover):
+ * inspector/front-end/TimelinePresentationModel.js:
+ (WebInspector.TimelinePresentationModel.needsPreviewElement):
+ (WebInspector.TimelinePresentationModel.Record.prototype.generatePopupContent):
+ First build the image preview element if necessary, then do everything else.
+ (WebInspector.TimelinePresentationModel.Record.prototype._generatePopupContentWithImagePreview):
+ Original generatePopupContent() code plus the preview generation when necessary.
+ * inspector/front-end/UIUtils.js:
+ (WebInspector.buildImagePreviewContents.errorCallback):
+ (WebInspector.buildImagePreviewContents.buildContent):
+ (WebInspector.buildImagePreviewContents): Extracted from ElementsPanel. Enabled building of preview elements without the dimensions text data.
+ * inspector/front-end/elementsPanel.css:
+ (.image-preview-container):
+ (.image-preview-container img):
+ * inspector/front-end/timelinePanel.css:
+ (.image-preview-container): Fixed centering of the preview container contents.
+ (.image-preview-container img):
+ (.image-container):
+
+2012-08-17 Andrey Kosyakov <caseq@chromium.org>
+
+ Web Inspector: decouple extension server from the Elements panel
+ https://bugs.webkit.org/show_bug.cgi?id=94322
+
+ Reviewed by Pavel Feldman.
+
+ - relay WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged received in ElementsPanel on WebInspector.notifications;
+
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel.prototype._selectedNodeChanged):
+ * inspector/front-end/ExtensionServer.js:
+
+2012-08-17 Jan Keromnes <janx@linux.com>
+
+ Web Inspector: SourceFrame shouldn't be a View
+ https://bugs.webkit.org/show_bug.cgi?id=93444
+
+ Reviewed by Pavel Feldman.
+
+ Move SourceFrame from being a View to being an Object. This will allow
+ future ExtensionSourceFrames to share a single iframe ExtensionView.
+
+ * inspector/front-end/CodeMirrorTextEditor.js:
+ (WebInspector.CodeMirrorTextEditor.prototype.wasShown):
+ (WebInspector.CodeMirrorTextEditor.prototype.willHide):
+ * inspector/front-end/DefaultTextEditor.js:
+ (WebInspector.DefaultTextEditor.prototype.wasShown):
+ (WebInspector.DefaultTextEditor.prototype.willHide):
+ * inspector/front-end/JavaScriptSourceFrame.js:
+ (WebInspector.JavaScriptSourceFrame):
+ * inspector/front-end/SourceFrame.js:
+ (WebInspector.SourceFrame):
+ (WebInspector.SourceFrame.prototype.show):
+ (WebInspector.SourceFrame.prototype.detach):
+ (WebInspector.SourceFrame.prototype.focus):
+ (WebInspector.SourceFrame.prototype._onTextEditorWasShown):
+ (WebInspector.SourceFrame.prototype._onTextEditorWillHide):
+ * inspector/front-end/TextEditor.js:
+ * inspector/front-end/scriptsPanel.css:
+
+2012-08-17 Pavel Chadnov <chadnov@google.com>
+
+ Web Inspector: requests filtering in network tab
+ https://bugs.webkit.org/show_bug.cgi?id=93090
+
+ Reviewed by Vsevolod Vlasov.
+
+ Added filtering support to search panel.
+ Implemented filtering for network panel.
+
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkLogView.prototype._clearSearchMatchedList):
+ (WebInspector.NetworkLogView.prototype._updateHighlightIfMatched):
+ (WebInspector.NetworkLogView.prototype._highlightMatchedRequests):
+ (WebInspector.NetworkLogView.prototype._highlightNthMatchedRequestForSearch):
+ (WebInspector.NetworkLogView.prototype.performSearch):
+ (WebInspector.NetworkLogView.prototype.performFilter):
+ (WebInspector.NetworkLogView.prototype.jumpToPreviousSearchResult):
+ (WebInspector.NetworkLogView.prototype.jumpToNextSearchResult):
+ (WebInspector.NetworkPanel.prototype.performFilter):
+ (WebInspector.NetworkDataGridNode.prototype._highlightMatchedSubstring):
+ * inspector/front-end/SearchController.js:
+ (WebInspector.SearchController):
+ (WebInspector.SearchController.prototype.cancelSearch):
+ (WebInspector.SearchController.prototype.showSearchField):
+ (WebInspector.SearchController.prototype._switchFilterToSearch):
+ (WebInspector.SearchController.prototype._switchSearchToFilter):
+ (WebInspector.SearchController.prototype._updateFilterVisibility):
+ (WebInspector.SearchController.prototype._replaceAll):
+ (WebInspector.SearchController.prototype._filterCheckboxClick):
+ (WebInspector.SearchController.prototype._performFilter):
+ (WebInspector.SearchController.prototype._onFilterInput):
+ (WebInspector.SearchController.prototype._onSearchInput):
+ (WebInspector.SearchController.prototype.resetFilter):
+ * inspector/front-end/inspector.css:
+ (.filter):
+ * inspector/front-end/networkLogView.css:
+ (.network-log-grid.data-grid.filter-other table.data tr.revealed.network-type-other:not(.filtered-out)):
+
+2012-08-17 Anthony Berent <aberent@chromium.org>
+
+ View source doesn't interpret escape characters in hrefs.
+ https://bugs.webkit.org/show_bug.cgi?id=94216
+
+ Reviewed by Adam Barth.
+
+ The cause was that HTMLViewSourceDocument was passing the unparsed content of the href attribute to the DOM as the URL for the link.
+ The fix is to pass the parsed content of the href attribute to the DOM.
+
+ Test: fast/forms/frames/viewsource-link-on-href-value.html extended to test this case.
+
+ * html/HTMLViewSourceDocument.cpp:
+ (WebCore::HTMLViewSourceDocument::processTagToken): Pass parsed URL to AddRange.
+ (WebCore::HTMLViewSourceDocument::addRange):Added argument for parsed URL, and used this instead of text, to create link.
+ * html/HTMLViewSourceDocument.h:
+ (HTMLViewSourceDocument): Add new link argument to addRange for parsed URL, defaulting to "".
+
+2012-08-17 Yoshifumi Inoue <yosin@chromium.org>
+
+ [Forms] Rename SpinButtonElement::StepActionHandler to SpinButtonOwner
+ https://bugs.webkit.org/show_bug.cgi?id=94311
+
+ Reviewed by Kent Tamura.
+
+ This patch renames SpinButtonElement::StepActionHandler class to
+ SpinButtonOwner for adding functions to it for communicating spin
+ button and its owner.
+
+ No new tests. This patch doesn't change behavior.
+
+ * html/TextFieldInputType.cpp:
+ (WebCore::TextFieldInputType::~TextFieldInputType):
+ (WebCore::TextFieldInputType::destroyShadowSubtree):
+ * html/TextFieldInputType.h:
+ (TextFieldInputType):
+ * html/shadow/DateTimeEditElement.cpp:
+ (WebCore::DateTimeEditElement::~DateTimeEditElement):
+ * html/shadow/DateTimeEditElement.h:
+ (DateTimeEditElement):
+ * html/shadow/SpinButtonElement.cpp:
+ (WebCore::SpinButtonElement::SpinButtonElement):
+ (WebCore::SpinButtonElement::create):
+ (WebCore::SpinButtonElement::doStepAction):
+ * html/shadow/SpinButtonElement.h:
+ (WebCore::SpinButtonElement::SpinButtonOwner::~SpinButtonOwner):
+ (SpinButtonElement):
+ (WebCore::SpinButtonElement::removeSpinButtonOwner):
+
+2012-08-16 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Replace use of internal Weak smart pointer with JSWeakObjectMap
+ https://bugs.webkit.org/show_bug.cgi?id=93872
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ The intention of this patch series is to replace use of internal JSC
+ API with use of the stable and public C API.
+
+ The JSC::Weak template is internal API and the only part of the C API
+ that exposes similar functionality is the JSWeakObjectMap. It is
+ special in the sense that its life-time is tied to the life-time of the
+ JS global object, which in turn is subject to garbage collection. In
+ order to maximize re-use of the same map across different JSContextRef
+ instances, we use one JSWeakObjectMap per context group and store the
+ map in a separate context.
+
+ * bridge/qt/qt_instance.cpp:
+ (JSC::Bindings::unusedWeakObjectMapCallback):
+ (Bindings):
+ (JSC::Bindings::WeakMapImpl::WeakMapImpl):
+ (JSC::Bindings::WeakMapImpl::~WeakMapImpl):
+ (JSC::Bindings::WeakMap::~WeakMap):
+ (JSC::Bindings::WeakMap::set):
+ (JSC::Bindings::WeakMap::get):
+ (JSC::Bindings::WeakMap::remove):
+ * bridge/qt/qt_instance.h:
+ (WeakMapImpl):
+ (Bindings):
+ (WeakMap):
+ (QtInstance):
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::QtRuntimeMethod::~QtRuntimeMethod):
+ (JSC::Bindings::QtRuntimeMethod::jsObjectRef):
+ * bridge/qt/qt_runtime.h:
+ (QtRuntimeMethod):
+
+
+2012-08-16 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: build Elements, Resources, Timeline, Audits and Console panels lazily.
+ https://bugs.webkit.org/show_bug.cgi?id=94222
+
+ Reviewed by Vsevolod Vlasov.
+
+ There is no need to construct these panels on inspector startup - we can do that lazily.
+ This change introduces the concept of PanelDescriptor that is sufficient for the panel
+ representation before it has been selected. It also makes selected panels build lazily.
+
+ The next step is to migrate rest of the panels and load the panel code lazily as well.
+ That should speed up startup time significantly.
+
+ * inspector/front-end/AuditsPanel.js:
+ (WebInspector.AuditsPanel):
+ (WebInspector.AuditsPanel.prototype._auditFinishedCallback):
+ (WebInspector.AuditsSidebarTreeElement):
+ (WebInspector.AuditsSidebarTreeElement.prototype.onselect):
+ (WebInspector.AuditResultSidebarTreeElement):
+ (WebInspector.AuditResultSidebarTreeElement.prototype.onselect):
+ * inspector/front-end/ConsolePanel.js:
+ * inspector/front-end/DOMStorage.js:
+ (WebInspector.DOMStorageDispatcher.prototype.addDOMStorage):
+ (WebInspector.DOMStorageDispatcher.prototype.domStorageUpdated):
+ * inspector/front-end/Database.js:
+ (WebInspector.DatabaseDispatcher.prototype.addDatabase):
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel):
+ (WebInspector.ElementsPanel.prototype.revealAndSelectNode):
+ (WebInspector.ElementsPanel.prototype.setSearchingForNode):
+ (WebInspector.ElementsPanel.prototype.toggleSearchingForNode):
+ * inspector/front-end/ElementsTreeOutline.js:
+ (WebInspector.ElementsTreeElement.prototype._populateForcedPseudoStateItems):
+ * inspector/front-end/ExtensionPanel.js:
+ (WebInspector.ExtensionPanel):
+ (WebInspector.ExtensionPanel.prototype.jumpToPreviousSearchResult):
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onCreatePanel):
+ (WebInspector.ExtensionServer.prototype._onAddAuditCategory):
+ * inspector/front-end/InspectorFrontendAPI.js:
+ (InspectorFrontendAPI.isTimelineProfilingEnabled):
+ (InspectorFrontendAPI.setTimelineProfilingEnabled):
+ (InspectorFrontendAPI.showConsole):
+ (InspectorFrontendAPI.showResources):
+ (InspectorFrontendAPI.enterInspectElementMode):
+ * inspector/front-end/InspectorView.js:
+ (WebInspector.InspectorView):
+ (WebInspector.InspectorView.prototype.addPanel):
+ (WebInspector.InspectorView.prototype.panel):
+ (WebInspector.InspectorView.prototype.showPanel):
+ (WebInspector.InspectorView.prototype._keyDownInternal):
+ * inspector/front-end/NetworkPanel.js:
+ * inspector/front-end/Panel.js:
+ (WebInspector.Panel.prototype.wasShown):
+ (WebInspector.Panel.prototype.willHide):
+ (WebInspector.PanelDescriptor):
+ (WebInspector.PanelDescriptor.prototype.name):
+ (WebInspector.PanelDescriptor.prototype.title):
+ (WebInspector.PanelDescriptor.prototype.iconURL):
+ (WebInspector.PanelDescriptor.prototype.setIconURL):
+ (WebInspector.PanelDescriptor.prototype.panel):
+ (WebInspector.PanelDescriptor.prototype.lazy):
+ * inspector/front-end/ProfilesPanel.js:
+ * inspector/front-end/ResourceTreeModel.js:
+ (WebInspector.ResourceTreeModel.prototype.cachedResourcesLoaded):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel):
+ * inspector/front-end/ScriptsPanel.js:
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylePropertiesSection.prototype.editingSelectorCommitted.successCallback):
+ (WebInspector.StylePropertiesSection.prototype.editingSelectorCommitted):
+ (WebInspector.StylePropertyTreeElement.prototype.updateTitle.linkifyURL):
+ * inspector/front-end/TimelinePanel.js:
+ * inspector/front-end/Toolbar.js:
+ (WebInspector.Toolbar.prototype.addPanel):
+ (WebInspector.Toolbar.prototype._createPanelToolbarItem.onToolbarItemClicked):
+ (WebInspector.Toolbar.prototype._createPanelToolbarItem.panelSelected):
+ (WebInspector.Toolbar.prototype._createPanelToolbarItem):
+ (WebInspector.Toolbar.prototype._panelSelected):
+ (WebInspector.Toolbar.prototype._setDropdownVisible):
+ (WebInspector.ToolbarDropdown):
+ (WebInspector.ToolbarDropdown.prototype.show):
+ (WebInspector.ToolbarDropdown.prototype._populate):
+ * inspector/front-end/inspector.css:
+ (.toolbar-small .toolbar-icon.custom-toolbar-icon):
+ * inspector/front-end/inspector.js:
+ (WebInspector._panelDescriptors):
+ (WebInspector._panelSelected):
+ (WebInspector._createGlobalStatusBarItems):
+ (WebInspector.documentClick.followLink):
+ (WebInspector.documentClick):
+ (WebInspector.openResource):
+ (WebInspector.showPanel):
+ (WebInspector.panel):
+ (WebInspector.inspect.):
+ (WebInspector.inspect):
+ (WebInspector._showAnchorLocation):
+ (WebInspector.showProfileForURL):
+ (WebInspector.frontendReused):
+
+2012-08-17 Pascal Massimino <pascal.massimino@gmail.com>
+
+ libwebp-0.2.0: handle alpha channel if present
+
+ https://bugs.webkit.org/show_bug.cgi?id=93430
+
+ Reviewed by Adam Barth.
+
+ updated the Layout test webp-image-decoding.html
+
+ * platform/image-decoders/webp/WEBPImageDecoder.cpp:
+ (outputMode):
+ switch to premultiplied-RGB if needed
+ (WebCore::WEBPImageDecoder::WEBPImageDecoder):
+ (WebCore::WEBPImageDecoder::decode):
+ use WebPGetFeatures() instead of WebPGetInfo(),
+ to detect presence of alpha channel
+ * platform/image-decoders/webp/WEBPImageDecoder.h:
+ (WEBPImageDecoder):
+ add a m_hasAlpha field
+
+2012-08-17 Yoshifumi Inoue <yosin@chromium.org>
+
+ [Forms] Enable multiple fields time input UI for Chromium except Android
+ https://bugs.webkit.org/show_bug.cgi?id=94195
+
+ Reviewed by Kent Tamura.
+
+ This patch enables multiple fields time input UI for Chromium except
+ for Android.
+
+ No new tests. Existing tests in fast/forms/time-multiple-fields/
+ covers appearance and functionality of multiple fields time UI.
+
+ A manual checking for browser displays multiple fields time input UI
+ is needed.
+
+ * bindings/generic/RuntimeEnabledFeatures.cpp:
+ (WebCore): Changed RuntimeEnabledFeatures::isInputTypeTimeEnabled to true
+ if ENABLE_INPUT_TYPE_TIME is enabled.
+
+2012-08-17 Yoshifumi Inoue <yosin@chromium.org>
+
+ [Forms] Introduce SpinButtonElement.{cpp,h} into build
+ https://bugs.webkit.org/show_bug.cgi?id=94289
+
+ Reviewed by Kent Tamura.
+
+ This patch introduces html/shadow/SpinButtonElement.{cpp,h} into
+ build, files were copied from TextControlInnerElements.{cpp,h} by
+ bug 93943.
+
+ No new tests. This patch doesn't changes behavior.
+
+ * CMakeLists.txt: Added SpinButtonElement.cpp
+ * GNUmakefile.list.am: Added SpinButtonElement.{cpp,h}
+ * Target.pri: Added SpinButtonElement.cpp
+ * WebCore.gypi: Added SpinButtonElement.{cpp,h}
+ * WebCore.vcproj/WebCore.vcproj: Added SpinButtonElement.{cpp,h}
+ * WebCore.xcodeproj/project.pbxproj: Added SpinButtonElement.{cpp,h}
+ * accessibility/AccessibilitySpinButton.h: Replaced include file to SpinButtonElement.h from TextControlInnerElements.h
+ * html/TextFieldInputType.h: Added include file SpinButtonElement.h
+ * html/shadow/DateTimeEditElement.h: Replaced include file to SpinButtonElement.h from TextControlInnerElements.h
+ * html/shadow/SpinButtonElement.cpp: Removed code other than SpinButtonElement.
+ * html/shadow/SpinButtonElement.h: Removed code other than SpinButtonElement.
+ * html/shadow/TextControlInnerElements.cpp: Removed code of SpinButtonElement.
+ * html/shadow/TextControlInnerElements.h: Removed SpinButtonElement.
+ * rendering/RenderTheme.cpp: Added include file SpinButtonElement.h
+
+2012-08-17 Sukolsak Sakshuwong <sukolsak@google.com>
+
+ Implement UndoManager's V8 bindings
+ https://bugs.webkit.org/show_bug.cgi?id=93912
+
+ Reviewed by Ryosuke Niwa.
+
+ This patch implements V8 bindings for UndoManager's transact() method.
+ We keep alive the user objects passed to transact() by storing them in
+ a hidden property of DOMTransaction's wrapper and registering implicit
+ references from UndoManager to DOMTransaction.
+
+ Tests: editing/undomanager/domtransaction-survives-gc.html
+ editing/undomanager/undomanager-isolated-world.html
+ editing/undomanager/undomanager-transact.html
+ editing/undomanager/undomanager-undo-redo.html
+ editing/undomanager/undomanager-use-after-free.html
+
+ * CMakeLists.txt:
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * DerivedSources.pri:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * UseJSC.cmake:
+ * UseV8.cmake:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/DOMTransaction.cpp: Added.
+ (WebCore):
+ (WebCore::DOMTransaction::DOMTransaction):
+ (WebCore::DOMTransaction::create):
+ (WebCore::DOMTransaction::apply):
+ (WebCore::DOMTransaction::unapply):
+ (WebCore::DOMTransaction::reapply):
+ * bindings/js/DOMTransaction.h: Added.
+ (WebCore):
+ (DOMTransaction):
+ (WebCore::DOMTransaction::undoManager):
+ (WebCore::DOMTransaction::setUndoManager):
+ * bindings/js/JSBindingsAllInOne.cpp:
+ * bindings/js/JSUndoManagerCustom.cpp: Added.
+ (WebCore):
+ (WebCore::JSUndoManager::transact):
+ * bindings/v8/DOMTransaction.cpp: Added.
+ (WebCore):
+ (WebCore::DOMTransaction::DOMTransaction):
+ (WebCore::DOMTransaction::create):
+ (WebCore::DOMTransaction::apply):
+ (WebCore::DOMTransaction::unapply):
+ (WebCore::DOMTransaction::reapply):
+ (WebCore::DOMTransaction::getFunction):
+ (WebCore::DOMTransaction::callFunction):
+ * bindings/v8/DOMTransaction.h: Added.
+ (WebCore):
+ (DOMTransaction):
+ (WebCore::DOMTransaction::undoManager):
+ (WebCore::DOMTransaction::setUndoManager):
+ * bindings/v8/V8HiddenPropertyName.h:
+ (WebCore):
+ * bindings/v8/custom/V8DOMTransactionCustom.cpp: Added.
+ (WebCore):
+ (WebCore::V8DOMTransaction::visitDOMWrapper):
+ * bindings/v8/custom/V8UndoManagerCustom.cpp: Added.
+ (WebCore):
+ (WebCore::V8UndoManager::transactCallback):
+ * dom/Document.cpp:
+ (WebCore::Document::~Document):
+ (WebCore::Document::undoManager):
+ * dom/Element.cpp:
+ (WebCore::Element::undoManager):
+ (WebCore::Element::disconnectUndoManager):
+ * editing/CompositeEditCommand.h:
+ * editing/DOMTransaction.idl: Added.
+ * editing/Editor.cpp:
+ (WebCore::Editor::appliedEditing):
+ (WebCore::Editor::unappliedEditing):
+ (WebCore::Editor::reappliedEditing):
+ (WebCore::Editor::canUndo):
+ (WebCore::Editor::undo):
+ (WebCore::Editor::canRedo):
+ (WebCore::Editor::redo):
+ * editing/UndoManager.cpp:
+ (WebCore::UndoManager::create):
+ (WebCore::UndoManager::UndoManager):
+ (WebCore::clearStack):
+ (WebCore):
+ (WebCore::UndoManager::disconnect):
+ (WebCore::UndoManager::stop):
+ (WebCore::UndoManager::~UndoManager):
+ (WebCore::createUndoManagerEntry):
+ (WebCore::UndoManager::transact):
+ (WebCore::UndoManager::undo):
+ (WebCore::UndoManager::redo):
+ (WebCore::UndoManager::registerUndoStep):
+ (WebCore::UndoManager::registerRedoStep):
+ (WebCore::UndoManager::clearUndo):
+ (WebCore::UndoManager::clearRedo):
+ * editing/UndoManager.h:
+ (WebCore):
+ (UndoManager):
+ (WebCore::UndoManager::position):
+ (WebCore::UndoManager::canUndo):
+ (WebCore::UndoManager::canRedo):
+ (WebCore::UndoManager::undoScopeHost):
+ (WebCore::UndoManager::ownerNode):
+ * editing/UndoManager.idl:
+ * editing/UndoStep.h:
+ (UndoStep):
+
+2012-08-16 Andrey Kosyakov <caseq@chromium.org>
+
+ Web Inspector: CPU profile view select overlaps with status bar buttons
+ https://bugs.webkit.org/show_bug.cgi?id=94243
+
+ Reviewed by Pavel Feldman.
+
+ - use StatusBarComboBox inated of plain select element in the status bar of CPU profile view;
+ - add StatusBarComboBox.select()
+
+ * inspector/front-end/CPUProfileView.js:
+ (WebInspector.CPUProfileView.prototype.get statusBarItems):
+ * inspector/front-end/StatusBarButton.js:
+ (WebInspector.StatusBarComboBox.prototype.selectedOption):
+ (WebInspector.StatusBarComboBox.prototype.select):
+ * inspector/front-end/externs.js: drive-by fix: add declaration to suppress compilation error;
+ (Array.prototype.select):
+
+2012-08-16 Vsevolod Vlasov <vsevik@chromium.org>
+
+ Web Inspector: Snippet script mapping should not load snippets until workspace reset event is dispatched on scripts panel.
+ https://bugs.webkit.org/show_bug.cgi?id=94218
+
+ Reviewed by Pavel Feldman.
+
+ Scripts panel does not load uiSourceCodes in workspace reset handler anymore.
+ Snippet script mapping does not start reloading snippets after reset until WorkspaceReset event is dispatched.
+
+ * inspector/front-end/JavaScriptSourceFrame.js: Simplified isComittingEditing to be reset synchronously.
+ (WebInspector.JavaScriptSourceFrame.prototype.commitEditing):
+ (WebInspector.JavaScriptSourceFrame.prototype._didEditContent):
+ * inspector/front-end/ScriptSnippetModel.js:
+ (WebInspector.ScriptSnippetModel.prototype._reset):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype._uiSourceCodeAdded):
+ (WebInspector.ScriptsPanel.prototype._addUISourceCode):
+ (WebInspector.ScriptsPanel.prototype._reset):
+ * inspector/front-end/UISourceCodeFrame.js: Simplified isComittingEditing to be reset synchronously.
+ (WebInspector.UISourceCodeFrame.prototype.commitEditing):
+ (WebInspector.UISourceCodeFrame.prototype._didEditContent):
+
+2012-08-16 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125829.
+ http://trac.webkit.org/changeset/125829
+ https://bugs.webkit.org/show_bug.cgi?id=94299
+
+ Maybe causing Chromium AutomationTabHelperBrowserTest failures
+ (Requested by enne on #webkit).
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::init):
+ (WebCore::FrameLoader::prepareForLoadStart):
+ (WebCore::FrameLoader::clearProvisionalLoad):
+ (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
+ (WebCore::FrameLoader::detachFromParent):
+ * loader/FrameLoader.h:
+ (FrameLoader):
+
+2012-08-16 Nico Weber <thakis@chromium.org>
+
+ [chromium/mac] Remove RenderThemeChromiumMac::paintTextField override
+ https://bugs.webkit.org/show_bug.cgi?id=94276
+
+ Reviewed by Eric Seidel.
+
+ The comment says this can go once 10.5 goes away. Besides, the
+ superclass implementation has the same hack anyway.
+
+ No behavior change.
+
+ * rendering/RenderThemeChromiumMac.h:
+ (RenderThemeChromiumMac):
+ * rendering/RenderThemeChromiumMac.mm:
+
+2012-08-16 David Barr <davidbarr@chromium.org>
+
+ @import url("#foo") causes stack overflow
+ https://bugs.webkit.org/show_bug.cgi?id=93687
+
+ Reviewed by Tony Chang.
+
+ Test: http/tests/css/css-imports-url-fragment.html
+
+ * css/StyleRuleImport.cpp:
+ (WebCore::StyleRuleImport::requestStyleSheet): Ignore the fragment identifier in cycle detection.
+
+2012-08-16 Antoine Labour <piman@chromium.org>
+
+ [chromium] Add resource transfer functions to CCResourceProvider
+ https://bugs.webkit.org/show_bug.cgi?id=93524
+
+ Reviewed by James Robinson.
+
+ This adds methods to CCResourceProvider to be able to transport
+ resources from a child to a parent.
+
+ Added test to CCResourceProviderTest.
+
+ * platform/graphics/chromium/cc/CCResourceProvider.cpp:
+ (WebCore::CCResourceProvider::inUseByConsumer):
+ (WebCore::CCResourceProvider::createResource):
+ (WebCore::CCResourceProvider::createResourceFromExternalTexture):
+ (WebCore::CCResourceProvider::CCResourceProvider):
+ (WebCore::CCResourceProvider::createChild):
+ (WebCore):
+ (WebCore::CCResourceProvider::destroyChild):
+ (WebCore::CCResourceProvider::getChildToParentMap):
+ (WebCore::CCResourceProvider::prepareSendToParent):
+ (WebCore::CCResourceProvider::prepareSendToChild):
+ (WebCore::CCResourceProvider::receiveFromChild):
+ (WebCore::CCResourceProvider::receiveFromParent):
+ (WebCore::CCResourceProvider::transferResource):
+ * platform/graphics/chromium/cc/CCResourceProvider.h:
+ (Mailbox):
+ (TransferableResource):
+ (TransferableResourceList):
+ (CCResourceProvider):
+ (Resource):
+ (Child):
+
+2012-08-16 David Grogan <dgrogan@chromium.org>
+
+ IndexedDB: Frontend and plumbing for integer versions
+ https://bugs.webkit.org/show_bug.cgi?id=92897
+
+ Reviewed by Tony Chang.
+
+ This patch exposes integer versions and the upgradeneeded event to
+ script.
+
+ The events surrounding an IDBOpenDBRequest follow a new pattern
+ compared to other idb requests. An open request can receive a blocked
+ event, an upgradeneeded event, and then a success event. When
+ dispatching the upgradeneeded and success events the request has its
+ readyState set to DONE and its result property set to an IDBDatabase.
+ We usually think of IDBRequests firing one event with one result,
+ cursors being the big exception. There are some minor changes around
+ enqueuing and dispatching events to support this.
+
+ There's also some funkiness in
+ IDBRequest::onSuccess(PassRefPtr<IDBDatabaseBackendInterface>) so that
+ the IDBDatabase object delivered in upgradeneeded is reused for the
+ success event.
+
+ Tests - expectations are updated in this patch.
+
+ * Modules/indexeddb/IDBDatabase.cpp:
+ (WebCore::IDBDatabase::setVersion):
+ (WebCore::IDBDatabase::onVersionChange):
+ (WebCore):
+ (WebCore::IDBDatabase::registerFrontendCallbacks):
+ * Modules/indexeddb/IDBDatabase.h:
+ (IDBDatabase):
+ * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
+ (WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction):
+ * Modules/indexeddb/IDBDatabaseCallbacks.h:
+ (IDBDatabaseCallbacks):
+ * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
+ (WebCore::IDBDatabaseCallbacksImpl::onVersionChange):
+ (WebCore):
+ * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
+ (IDBDatabaseCallbacksImpl):
+ * Modules/indexeddb/IDBFactory.cpp:
+ (WebCore::IDBFactory::open):
+ (WebCore):
+ * Modules/indexeddb/IDBFactory.h:
+ (IDBFactory):
+ * Modules/indexeddb/IDBFactory.idl:
+ * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
+ (WebCore::IDBFactoryBackendImpl::open):
+ * Modules/indexeddb/IDBFactoryBackendImpl.h:
+ (IDBFactoryBackendImpl):
+ * Modules/indexeddb/IDBFactoryBackendInterface.h:
+ (IDBFactoryBackendInterface):
+ * Modules/indexeddb/IDBOpenDBRequest.cpp: Added.
+ (WebCore):
+ (WebCore::IDBOpenDBRequest::create):
+ (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
+ (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest):
+ (WebCore::IDBOpenDBRequest::interfaceName):
+ (WebCore::IDBOpenDBRequest::onBlocked):
+ (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
+ (WebCore::IDBOpenDBRequest::shouldEnqueueEvent):
+ * Modules/indexeddb/IDBOpenDBRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h.
+ (WebCore):
+ (IDBOpenDBRequest):
+ * Modules/indexeddb/IDBOpenDBRequest.idl: Copied from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h.
+ * Modules/indexeddb/IDBRequest.cpp:
+ (WebCore::IDBRequest::IDBRequest):
+ (WebCore::IDBRequest::shouldEnqueueEvent):
+ (WebCore::IDBRequest::onSuccess):
+ This function works with WebIDBCallbacksImpl::onSuccess to reuse its
+ IDBDatabaseBackendInterface that it got during
+ IDBOpenDBRequest::onUpgradeNeeded.
+
+ (WebCore::IDBRequest::dispatchEvent):
+ (WebCore::IDBRequest::transactionDidDispatchCompleteOrAbort):
+ (WebCore):
+ (WebCore::IDBRequest::enqueueEvent):
+ * Modules/indexeddb/IDBRequest.h:
+ (WebCore::IDBRequest::onBlocked):
+ (IDBRequest):
+ * Modules/indexeddb/IDBTransaction.cpp:
+ We now take a pointer to the openDBRequest if this is a version
+ change transaction as a result of an open-with-version call so that we
+ can clear the transaction property on the openDBRequest as soon as the
+ upgradeneeded event is dispatched per the spec ("... set request's
+ transaction property to null... ", currently 4.8.12).
+
+ (WebCore::IDBTransaction::create):
+ (WebCore):
+ (WebCore::IDBTransaction::IDBTransaction):
+ (WebCore::IDBTransaction::setActive):
+ (WebCore::IDBTransaction::onComplete):
+ (WebCore::IDBTransaction::dispatchEvent):
+ * Modules/indexeddb/IDBTransaction.h:
+ (WebCore):
+ (IDBTransaction):
+ * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
+ (WebCore::IDBTransactionBackendImpl::commit):
+ * Modules/indexeddb/IDBUpgradeNeededEvent.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp.
+ (WebCore):
+ (WebCore::IDBUpgradeNeededEvent::create):
+ (WebCore::IDBUpgradeNeededEvent::IDBUpgradeNeededEvent):
+ (WebCore::IDBUpgradeNeededEvent::~IDBUpgradeNeededEvent):
+ (WebCore::IDBUpgradeNeededEvent::oldVersion):
+ (WebCore::IDBUpgradeNeededEvent::newVersion):
+ (WebCore::IDBUpgradeNeededEvent::interfaceName):
+ * Modules/indexeddb/IDBUpgradeNeededEvent.h: Copied from Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h.
+ (WebCore):
+ (IDBUpgradeNeededEvent):
+ * Modules/indexeddb/IDBUpgradeNeededEvent.idl: Copied from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h.
+ * WebCore.gypi:
+ * dom/EventNames.h:
+ (WebCore):
+ * dom/EventNames.in:
+ * dom/EventTargetFactory.in:
+ * inspector/InspectorIndexedDBAgent.cpp:
+ (WebCore):
+
+2012-08-16 Yoshifumi Inoue <yosin@chromium.org>
+
+ [Forms] Cleanup CSS selectors for multiple fields time input UI
+ https://bugs.webkit.org/show_bug.cgi?id=94287
+
+ Reviewed by Kent Tamura.
+
+ This patch cleans CSS selectors for multiple fields time input UI:
+ - Removed "width" from fields: we use monospace font for field.
+ - Use "em" instead of "px" for unit.
+ - Add left margin to spin button.
+
+ Changes of this patch affect only both ENABLE_INPUT_TYPE_TIME and
+ ENABLE_INPUT_TYPE_TIME_MULTIPLE_FIELDS are enabled.
+
+ Tests: fast/forms/time-multiple-fields/time-multiple-fields-appearance-basic.html
+ fast/forms/time-multiple-fields/time-multiple-fields-appearance-disabled-readonly.html
+ fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-classes.html
+ fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements.html
+ fast/forms/time-multiple-fields/time-multiple-fields-appearance-style.html
+
+ * css/html.css:
+ (input::-webkit-datetime-edit-ampm-field):
+ (input::-webkit-datetime-edit-hour-field):
+ (input::-webkit-datetime-edit-millisecond-field):
+ (input::-webkit-datetime-edit-minute-field):
+ (input::-webkit-datetime-edit-second-field):
+ (input[type=time]::-webkit-inner-spin-button):
+
+2012-08-16 John Bates <jbates@google.com>
+
+ Fix vsync-disabled Null pointer crash bug
+ https://bugs.webkit.org/show_bug.cgi?id=94280
+
+ Reviewed by Kentaro Hara.
+
+ The m_timeSource member is NULL for vsync-disabled path, need to check for that.
+
+ Tests: Covered by Chromium throughput tests. All the compositor thread throughput tests are crashing.
+
+ * platform/graphics/chromium/cc/CCFrameRateController.cpp:
+ (WebCore::CCFrameRateController::setTimebaseAndInterval):
+
+2012-08-16 Michael Saboff <msaboff@apple.com>
+
+ HTML Parser should produce 8bit substrings for inline style and script elements
+ https://bugs.webkit.org/show_bug.cgi?id=93742
+
+ Reviewed by Benjamin Poulain.
+
+ Currently all data associated with a token is stored and processed as UChars.
+ Added code to determine that the contents of token data is all 8 bit by keeping
+ the logical OR value of all prior characters. Also added a flag that the parser
+ can set to indicate when the token data is converted to a String that we want
+ to make an 8 bit string if possible. Enabled this handling for script, style,
+ iframe, noembed, noframes, noscript and xmp tags.
+
+ No new tests. Existing tests provide coverage.
+
+ * html/parser/HTMLTokenizer.cpp:
+ (WebCore::HTMLTokenizer::nextToken):
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::ExternalCharacterTokenBuffer):
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::isAll8BitData):
+ (HTMLTreeBuilder::ExternalCharacterTokenBuffer):
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemaining):
+ * xml/parser/MarkupTokenBase.h:
+ (WebCore::MarkupTokenBase::clear):
+ (WebCore::MarkupTokenBase::appendToCharacter):
+ (MarkupTokenBase):
+ (WebCore::MarkupTokenBase::eraseCharacters):
+ (WebCore::MarkupTokenBase::setConvertTo8Bit):
+ (WebCore::MarkupTokenBase::isAll8BitData):
+ (WebCore::AtomicMarkupTokenBase::AtomicMarkupTokenBase):
+ (WebCore::AtomicMarkupTokenBase::isAll8BitData):
+ (AtomicMarkupTokenBase):
+ (WebCore::AtomicMarkupTokenBase::clearExternalCharacters):
+
+2012-08-16 Michelangelo De Simone <michelangelo@webkit.org>
+
+ [Part 3] Parse the custom() function in -webkit-filter: parse the 3d-transforms parameters
+ https://bugs.webkit.org/show_bug.cgi?id=71443
+
+ Reviewed by Dirk Schulze.
+
+ custom() now correctly parses the 3d-tranforms parameters. In order to do that the parseTransform() method
+ has been refactored and split to reuse already present code.
+
+ * css/CSSParser.cpp:
+ (WebCore::parseTranslateTransformValue): Renamed from parseTransformValue()
+ (WebCore::CSSParser::parseValue): Reference updated from parseTransformValue() to parseTranslateTransformValue()
+ (WebCore::CSSParser::parseTransform): This method has been split in two to reuse already present code
+ (WebCore):
+ (WebCore::CSSParser::parseTransformValue): New method to parse single transform values
+ (WebCore::CSSParser::parseCustomFilter): Updated to parse the transform parameters
+ (WebCore::CSSParser::parseCustomFilterTransform): New method to parse custom() transforms
+ * css/CSSParser.h:
+
+2012-08-16 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125838.
+ http://trac.webkit.org/changeset/125838
+ https://bugs.webkit.org/show_bug.cgi?id=94283
+
+ Breaks Mac compile due to bug 74625 (Requested by enne on
+ #webkit).
+
+ * platform/graphics/chromium/cc/CCResourceProvider.cpp:
+ (WebCore::CCResourceProvider::inUseByConsumer):
+ (WebCore::CCResourceProvider::createResource):
+ (WebCore::CCResourceProvider::createResourceFromExternalTexture):
+ (WebCore::CCResourceProvider::deleteOwnedResources):
+ (WebCore::CCResourceProvider::CCResourceProvider):
+ * platform/graphics/chromium/cc/CCResourceProvider.h:
+ (CCResourceProvider):
+ (Resource):
+
+2012-08-16 Kenneth Russell <kbr@google.com>
+
+ Unreviewed, rolling out r125800.
+ http://trac.webkit.org/changeset/125800
+ https://bugs.webkit.org/show_bug.cgi?id=84281
+
+ Hypothesis that this change caused gpu_throughput_tests to
+ start timing out on all platforms on the Chromium GPU
+ canaries.
+
+ * platform/graphics/chromium/cc/CCFrameRateController.cpp:
+ * platform/graphics/chromium/cc/CCFrameRateController.h:
+ (CCFrameRateController):
+ * platform/graphics/chromium/cc/CCScheduler.cpp:
+ (WebCore::CCScheduler::processScheduledActions):
+ * platform/graphics/chromium/cc/CCScheduler.h:
+ (CCSchedulerClient):
+ * platform/graphics/chromium/cc/CCTextureUpdateController.cpp:
+ (WebCore::CCTextureUpdateController::maxPartialTextureUpdates):
+ (WebCore::CCTextureUpdateController::CCTextureUpdateController):
+ (WebCore::CCTextureUpdateController::updateMoreTextures):
+ (WebCore::CCTextureUpdateController::updateMoreTexturesSize):
+ * platform/graphics/chromium/cc/CCTextureUpdateController.h:
+ (WebCore::CCTextureUpdateController::create):
+ (CCTextureUpdateController):
+ * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+ (WebCore::CCThreadProxy::beginFrameCompleteOnImplThread):
+ (WebCore::CCThreadProxy::scheduledActionUpdateMoreResources):
+ * platform/graphics/chromium/cc/CCThreadProxy.h:
+
+2012-08-16 Kenneth Russell <kbr@google.com>
+
+ Unreviewed, rolling out r125833.
+ http://trac.webkit.org/changeset/125833
+ https://bugs.webkit.org/show_bug.cgi?id=94234
+
+ Was not the cause of the test failures. Per
+ http://crbug.com/143311 , it is probably WebKit r125800.
+
+ * platform/graphics/chromium/Canvas2DLayerBridge.cpp:
+ (WebCore::Canvas2DLayerBridge::~Canvas2DLayerBridge):
+ (WebCore::Canvas2DLayerBridge::deferredCanvas):
+ (WebCore):
+ (WebCore::Canvas2DLayerBridge::prepareForDraw):
+ (WebCore::Canvas2DLayerBridge::skCanvas):
+ * platform/graphics/chromium/Canvas2DLayerBridge.h:
+ (Canvas2DLayerBridge):
+ * platform/graphics/skia/ImageBufferSkia.cpp:
+
+2012-08-16 Antoine Labour <piman@chromium.org>
+
+ [chromium] Add resource transfer functions to CCResourceProvider
+ https://bugs.webkit.org/show_bug.cgi?id=93524
+
+ Reviewed by James Robinson.
+
+ This adds methods to CCResourceProvider to be able to transport
+ resources from a child to a parent.
+
+ Added test to CCResourceProviderTest.
+
+ * platform/graphics/chromium/cc/CCResourceProvider.cpp:
+ (WebCore::CCResourceProvider::inUseByConsumer):
+ (WebCore::CCResourceProvider::createResource):
+ (WebCore::CCResourceProvider::createResourceFromExternalTexture):
+ (WebCore::CCResourceProvider::CCResourceProvider):
+ (WebCore::CCResourceProvider::createChild):
+ (WebCore):
+ (WebCore::CCResourceProvider::destroyChild):
+ (WebCore::CCResourceProvider::getChildToParentMap):
+ (WebCore::CCResourceProvider::prepareSendToParent):
+ (WebCore::CCResourceProvider::prepareSendToChild):
+ (WebCore::CCResourceProvider::receiveFromChild):
+ (WebCore::CCResourceProvider::receiveFromParent):
+ (WebCore::CCResourceProvider::transferResource):
+ * platform/graphics/chromium/cc/CCResourceProvider.h:
+ (Mailbox):
+ (TransferableResource):
+ (TransferableResourceList):
+ (CCResourceProvider):
+ (Resource):
+ (Child):
+
+2012-08-16 Kent Tamura <tkent@chromium.org>
+
+ [Chromium-win] Use native digits in a case of "context" substitution setting too.
+ https://bugs.webkit.org/show_bug.cgi?id=94210
+
+ Reviewed by Hajime Morita.
+
+ Use native digits in a case of "context" substitution setting, not only
+ "native" substitution. IE10's input[type=number] always show native
+ digits even if the system setting is "context". We had better follow
+ this behavior.
+
+ No new tests. This behavior depends on the system locale setting.
+
+ * platform/text/LocaleWin.cpp:
+ (WebCore::LocaleWin::initializeNumberLocalizerData):
+ Uses 0-9 only if the substitution setting is "0 to 9". It measn we apply
+ native digits if the substitution setting is "context" or "native".
+
+2012-08-16 Huang Dongsung <luxtella@company100.net>
+
+ [Texmap] Render gif animation well.
+ https://bugs.webkit.org/show_bug.cgi?id=93458
+
+ Reviewed by Noam Rosenthal.
+
+ GraphicsLayerTextureMapper::setContentsToImage() checks the pointer to the
+ image, not nativeImagePtr, so Texmap currently draws only the first frame of gif
+ animations. This patch makes Texmap draw gif animations.
+
+ No new tests, could not write a test due to DRT limitation, see Bug 93458.
+
+ * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
+ (WebCore::GraphicsLayerTextureMapper::setContentsNeedsDisplay):
+ (WebCore::GraphicsLayerTextureMapper::setContentsToImage):
+ * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
+ (GraphicsLayerTextureMapper):
+
+2012-08-16 Kenneth Russell <kbr@google.com>
+
+ Unreviewed, rolling out r125804.
+ http://trac.webkit.org/changeset/125804
+ https://bugs.webkit.org/show_bug.cgi?id=94234
+
+ Made threaded tests in performance_browser_tests start timing
+ out on Chromium GPU bots
+
+ * platform/graphics/chromium/Canvas2DLayerBridge.cpp:
+ (AcceleratedDeviceContext):
+ (WebCore::AcceleratedDeviceContext::AcceleratedDeviceContext):
+ (WebCore::AcceleratedDeviceContext::prepareForDraw):
+ (WebCore):
+ (WebCore::Canvas2DLayerBridge::~Canvas2DLayerBridge):
+ (WebCore::Canvas2DLayerBridge::skCanvas):
+ * platform/graphics/chromium/Canvas2DLayerBridge.h:
+ (Canvas2DLayerBridge):
+ * platform/graphics/skia/ImageBufferSkia.cpp:
+
+2012-08-16 Adam Barth <abarth@webkit.org>
+
+ Rename DOMWindow::clear to something more descriptive
+ https://bugs.webkit.org/show_bug.cgi?id=93993
+
+ Reviewed by Eric Seidel.
+
+ As requested by Eric Seidel. In WebKit, we typically use "clear" to
+ mean zeroing out a pointer (e.g., OwnPtr::clear). For DOMWindow, it's
+ more like we're resetting the DOMWindow to a known state (i.e., its
+ initial state), modulo a wrinkle w.r.t. the PageCache. The new name
+ attempts to clarify the situation.
+
+ * dom/Document.cpp:
+ (WebCore::Document::~Document):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::clear):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::~DOMWindow):
+ (WebCore::DOMWindow::frameDestroyed):
+ (WebCore::DOMWindow::resetUnlessSuspendedForPageCache):
+ (WebCore::DOMWindow::resetDOMWindowProperties):
+ * page/DOMWindow.h:
+ (DOMWindow):
+
+2012-08-16 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125717.
+ http://trac.webkit.org/changeset/125717
+ https://bugs.webkit.org/show_bug.cgi?id=94272
+
+ Likely to be causing Chromium Win Debug extensions browser
+ tests to fail (Requested by enne on #webkit).
+
+ * UseV8.cmake:
+ * WebCore.gypi:
+ * bindings/v8/DOMWrapperWorld.cpp:
+ (WebCore::DOMWrapperWorld::DOMWrapperWorld):
+ (WebCore::mainThreadNormalWorld):
+ * bindings/v8/DOMWrapperWorld.h:
+ (WebCore):
+ (WebCore::DOMWrapperWorld::create):
+ (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
+ (DOMWrapperWorld):
+ * bindings/v8/IsolatedWorld.cpp: Copied from Source/WebCore/bindings/v8/DOMWrapperWorld.cpp.
+ (WebCore):
+ (WebCore::IsolatedWorld::IsolatedWorld):
+ (WebCore::IsolatedWorld::~IsolatedWorld):
+ * bindings/v8/IsolatedWorld.h: Copied from Source/WebCore/bindings/v8/DOMWrapperWorld.h.
+ (WebCore):
+ (IsolatedWorld):
+ (WebCore::IsolatedWorld::create):
+ (WebCore::IsolatedWorld::count):
+ (WebCore::IsolatedWorld::id):
+ (WebCore::IsolatedWorld::domDataStore):
+ * bindings/v8/V8DOMWrapper.h:
+ (WebCore::V8DOMWrapper::getCachedWrapper):
+ * bindings/v8/V8IsolatedContext.cpp:
+ (WebCore::V8IsolatedContext::V8IsolatedContext):
+ (WebCore::V8IsolatedContext::destroy):
+ * bindings/v8/V8IsolatedContext.h:
+ (WebCore::V8IsolatedContext::getEntered):
+ (WebCore::V8IsolatedContext::world):
+ (V8IsolatedContext):
+
+2012-08-16 Nico Weber <thakis@chromium.org>
+
+ Delete ThemeChromiumMac, use ThemeMac in chromium/mac instead
+ https://bugs.webkit.org/show_bug.cgi?id=94260
+
+ Reviewed by James Robinson.
+
+ ThemeChromiumMac was introduced when ThemeMac assumed that an
+ in-process Cocoa view existed. With WebKit2, that's no longer true,
+ and the files can now be merged.
+
+ No behavior change.
+
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * platform/chromium/ThemeChromiumMac.h: Removed.
+ * platform/chromium/ThemeChromiumMac.mm: Removed.
+ * platform/mac/ThemeMac.mm:
+ (WebCore::paintStepper):
+ (WebCore::ThemeMac::ensuredView):
+
+2012-08-16 Nate Chapin <japhet@chromium.org>
+
+ ProgressTracker never completes if iframe detached during parsing
+ https://bugs.webkit.org/show_bug.cgi?id=92272
+
+ Reviewed by Adam Barth.
+
+ Add a simple helper class to FrameLoader to ensure progressStarted/progressCompleted calls are matched,
+ and balance the calls when the Frame is detached.
+
+ No new tests, as this behavior has only been producing reliably by setting a breakpoint in a specific place.
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::init):
+ (WebCore::FrameLoader::FrameProgressTracker::progressStarted):
+ (WebCore::FrameLoader::FrameProgressTracker::progressCompleted):
+ (WebCore::FrameLoader::FrameProgressTracker::~FrameProgressTracker):
+ (WebCore::FrameLoader::prepareForLoadStart):
+ (WebCore::FrameLoader::clearProvisionalLoad):
+ (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
+ (WebCore::FrameLoader::detachFromParent):
+ * loader/FrameLoader.h:
+ (FrameProgressTracker):
+ (WebCore::FrameLoader::FrameProgressTracker::create):
+ (WebCore::FrameLoader::FrameProgressTracker::FrameProgressTracker):
+
+2012-08-16 Arnaud Renevier <a.renevier@sisa.samsung.com>
+
+ Update TypedArrays to throw RangeError or similar instead of INDEX_SIZE_ERR
+ https://bugs.webkit.org/show_bug.cgi?id=45118
+
+ Reviewed by Kenneth Russell.
+
+ Update TypedArrays to raise JavaScript RangeError instead of dom
+ INDEX_SIZE_ERR exceptions. Also, update TypedArrays to raise TypeError
+ instead of JavaScript SyntaxError or dom exceptions SYNTAX_ERR when
+ calling set method with invalid arguments.
+
+ Specification does not define the type of exceptions to raise, but
+ other browsers raise JavaScript errors, so those changes will improve
+ compatibility.
+
+ New Test: fast/canvas/webgl/array-set-invalid-arguments.html
+
+ Updated Tests expectations:
+ fast/canvas/webgl/array-set-out-of-bounds.html
+ fast/canvas/webgl/data-view-crash.html
+ fast/canvas/webgl/data-view-test.html
+
+ * bindings/js/JSArrayBufferViewHelper.h:
+ (WebCore):
+ (WebCore::setWebGLArrayWithTypedArrayArgument):
+ (WebCore::setWebGLArrayHelper):
+ (WebCore::constructArrayBufferViewWithTypedArrayArgument):
+ (WebCore::constructArrayBufferViewWithArrayBufferArgument):
+ (WebCore::constructArrayBufferView):
+ * bindings/v8/custom/V8ArrayBufferViewCustom.h:
+ (WebCore):
+ (WebCore::constructWebGLArrayWithArrayBufferArgument):
+ (WebCore::setWebGLArrayHelper):
+
+2012-08-16 Alexandre Elias <aelias@google.com>
+
+ [chromium] Replace destRect with destOffset in texture upload
+ https://bugs.webkit.org/show_bug.cgi?id=94154
+
+ Reviewed by James Robinson.
+
+ Previously, texture upload code implicitly assumed that sourceRect and
+ destRect have the same size. The behavior is undefined if they are
+ different, since they are used interchangeably and there's no support
+ for scaling from one rect to the other. This patch enforces that
+ constraint at the interface level by replacing all instances of
+ "IntRect destRect" by "IntSize destOffset".
+
+ No new tests (no-op refactoring).
+
+ * platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp:
+ (WebCore::BitmapCanvasLayerTextureUpdater::Texture::updateRect):
+ (WebCore::BitmapCanvasLayerTextureUpdater::updateTextureRect):
+ * platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h:
+ (Texture):
+ (BitmapCanvasLayerTextureUpdater):
+ * platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp:
+ (WebCore::BitmapSkPictureCanvasLayerTextureUpdater::Texture::updateRect):
+ * platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h:
+ (Texture):
+ * platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp:
+ (WebCore::FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::updateRect):
+ (WebCore::FrameBufferSkPictureCanvasLayerTextureUpdater::updateTextureRect):
+ * platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h:
+ (Texture):
+ (FrameBufferSkPictureCanvasLayerTextureUpdater):
+ * platform/graphics/chromium/ImageLayerChromium.cpp:
+ (WebCore::ImageLayerTextureUpdater::updateTextureRect):
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ * platform/graphics/chromium/LayerTextureSubImage.cpp:
+ (WebCore::LayerTextureSubImage::upload):
+ (WebCore::LayerTextureSubImage::uploadWithTexSubImage):
+ (WebCore::LayerTextureSubImage::uploadWithMapTexSubImage):
+ * platform/graphics/chromium/LayerTextureSubImage.h:
+ (LayerTextureSubImage):
+ * platform/graphics/chromium/LayerTextureUpdater.h:
+ (Texture):
+ * platform/graphics/chromium/ScrollbarLayerChromium.cpp:
+ (WebCore::ScrollbarLayerChromium::updatePart):
+ * platform/graphics/chromium/TextureUploader.h:
+ (Parameters):
+ * platform/graphics/chromium/ThrottledTextureUploader.cpp:
+ (WebCore::ThrottledTextureUploader::uploadTexture):
+ * platform/graphics/chromium/TiledLayerChromium.cpp:
+ (WebCore::TiledLayerChromium::updateTileTextures):
+ * platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp:
+ (WebCore::CCHeadsUpDisplayLayerImpl::willDraw):
+ * platform/graphics/chromium/cc/CCPrioritizedTexture.cpp:
+ (WebCore::CCPrioritizedTexture::upload):
+ * platform/graphics/chromium/cc/CCPrioritizedTexture.h:
+ (CCPrioritizedTexture):
+ * platform/graphics/chromium/cc/CCResourceProvider.cpp:
+ (WebCore::CCResourceProvider::upload):
+ * platform/graphics/chromium/cc/CCResourceProvider.h:
+ (CCResourceProvider):
+ * platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
+ (WebCore::CCVideoLayerImpl::copyPlaneData):
+
+2012-08-16 James Robinson <jamesr@chromium.org>
+
+ [chromium] Remove unnecessary tree hierarchy inspection APIs from WebLayer
+ https://bugs.webkit.org/show_bug.cgi?id=94229
+
+ Reviewed by Adrienne Walker.
+
+ Tweak updateLayerPreserves3D() logic to use the existing GraphicsLayer tree hierarchy instead of pulling the
+ hierarchy off of WebLayer.
+
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (WebCore::GraphicsLayerChromium::updateLayerPreserves3D):
+
+2012-08-16 Ryosuke Niwa <rniwa@webkit.org>
+
+ Let Xcode have its own way.
+
+ * WebCore.xcodeproj/project.pbxproj:
+
+2012-08-16 Mike West <mkwst@chromium.org>
+
+ Refactor CSPDirective to support non-sourcelist types.
+ https://bugs.webkit.org/show_bug.cgi?id=94252
+
+ Reviewed by Adam Barth.
+
+ The 'CSPDirective' was built to support source list Content Security
+ Policy directives like 'script-src' or 'object-src'. It doesn't support
+ new directive types like 'script-nonce' or 'plugin-types'. That
+ functionality has been implemented by hanging state off of
+ CSPDirectiveList, which isn't a great solution.
+
+ This patch pulls the source list functionality out of CSPDirective and
+ into SourceListDirective, and likewise pulls the nonce and media list
+ functionality into NonceDirective and MediaListDirective.
+
+ No new tests have been added; this refactoring should be externally
+ transparent, and the current CSP tests should continue to pass.
+
+ * page/ContentSecurityPolicy.cpp:
+ (WebCore::CSPDirective::CSPDirective):
+ (CSPDirective):
+ (WebCore::CSPDirective::text):
+ (WebCore::CSPDirective::policy):
+ CSPDirective is now a parent class for NonceDirective,
+ MediaListDirective, and SourceListDirective. It stores a pointer
+ to the ContentSecurityPolicy object in order to facilitate logging,
+ which now needs to happen at this level, rather than higher up in
+ CSPDirectiveList.
+ (WebCore):
+ (NonceDirective):
+ (WebCore::NonceDirective::NonceDirective):
+ (WebCore::NonceDirective::allows):
+ (WebCore::NonceDirective::parse):
+ Pull the nonce parsing code and state out of CSPDirectiveList
+ and into this new class.
+ (MediaListDirective):
+ (WebCore::MediaListDirective::MediaListDirective):
+ (WebCore::MediaListDirective::allows):
+ (WebCore::MediaListDirective::parse):
+ Pull the media list parsing code and state out of CSPDirectiveList
+ and into this new class.
+ (SourceListDirective):
+ (WebCore::SourceListDirective::SourceListDirective):
+ (WebCore::SourceListDirective::allows):
+ Pull the source list functionality out of CSPDirective
+ and into this new class.
+ (CSPDirectiveList):
+ (WebCore::CSPDirectiveList::checkEval):
+ (WebCore::CSPDirectiveList::checkInline):
+ (WebCore::CSPDirectiveList::checkNonce):
+ (WebCore::CSPDirectiveList::checkSource):
+ (WebCore::CSPDirectiveList::checkMediaType):
+ (WebCore::CSPDirectiveList::operativeDirective):
+ (WebCore::CSPDirectiveList::checkEvalAndReportViolation):
+ (WebCore::CSPDirectiveList::checkNonceAndReportViolation):
+ (WebCore::CSPDirectiveList::checkMediaTypeAndReportViolation):
+ (WebCore::CSPDirectiveList::checkInlineAndReportViolation):
+ (WebCore::CSPDirectiveList::checkSourceAndReportViolation):
+ (WebCore::CSPDirectiveList::allowJavaScriptURLs):
+ (WebCore::CSPDirectiveList::allowInlineEventHandlers):
+ (WebCore::CSPDirectiveList::allowScriptNonce):
+ (WebCore::CSPDirectiveList::allowPluginType):
+ (WebCore::CSPDirectiveList::setCSPDirective):
+ (WebCore::CSPDirectiveList::addDirective):
+ Use the new classes rather than CSPDirective (or no directive
+ at all, in the case of nonces and plugin types).
+
+2012-08-16 Adam Barth <abarth@webkit.org>
+
+ Null checks of m_frame->document()->domWindow() aren't needed
+ https://bugs.webkit.org/show_bug.cgi?id=94052
+
+ Reviewed by Eric Seidel.
+
+ If a document is attached to a frame, then its DOMWindow is necessarily
+ non-0. Checking for 0 is needless.
+
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::checkLoadComplete):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::stopLoading):
+ (WebCore::FrameLoader::didOpenURL):
+ (WebCore::FrameLoader::prepareForCachedPageRestore):
+
+2012-08-16 Max Feil <mfeil@rim.com>
+
+ [BlackBerry] Some media controls are mispositioned for dynamic live streams (HLS)
+ https://bugs.webkit.org/show_bug.cgi?id=94176
+
+ Reviewed by Antonio Gomes.
+
+ The default HTML5 media controls for dynamic live streams have
+ no timeline or timeline container, which for BlackBerry results
+ in mispositioning of the buttons that are supposed to be to
+ the right of the timeline (fullscreen and mute). Instead of
+ being right justified they incorrectly appear on the left next
+ to the play button. The fix is to explicitly position these 2
+ buttons whenever the media duration is infinite (indicating a
+ live stream).
+
+ Manual test: ManualTests/blackberry/video-hls-controls.html
+
+ * platform/blackberry/RenderThemeBlackBerry.cpp:
+ (WebCore::RenderThemeBlackBerry::adjustMediaControlStyle):
+
+2012-08-16 Abhishek Arya <inferno@chromium.org>
+
+ Regression(r118248): Replaced element not layout
+ https://bugs.webkit.org/show_bug.cgi?id=85804
+
+ Reviewed by Levi Weintraub.
+
+ r118248 moved the layout call of replaced elements to nextLineBreak.
+ This was intended to delay the layout after all the lineboxes are cleared
+ in RenderBlock::layoutInlineChildren. However, this caused the end line
+ object to not layout at all. We revert to the old planned way to just
+ keep a local vector of replaced elements to layout and then layout all of them
+ after the lineboxes are cleared.
+
+ Test: fast/replaced/replaced-last-line-layout.html
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::layoutInlineChildren):
+ (WebCore::RenderBlock::LineBreaker::nextLineBreak):
+
+2012-08-16 Benjamin Poulain <bpoulain@apple.com>
+
+ Do not perform 8 to 16bits characters conversion when converting a WTFString to NSString/CFString
+ https://bugs.webkit.org/show_bug.cgi?id=90720
+
+ Reviewed by Geoffrey Garen.
+
+ In most String to CFString conversion, we should be able to use the "NoCopy" constructor and have
+ a relatively cheap conversion from WTF::String to CFString.
+
+ When the String is 8 bits, it was converted to 16 bits by getData16SlowCase() because of the call
+ to String::characters().
+
+ This patch adds a path for creating a CFString from a 8bits string using CFStringCreateWithBytes.
+
+ This is covered by existing tests.
+
+ * platform/text/cf/StringCF.cpp:
+ (WTF::String::createCFString): CFSTR() create static CFString, it is unecessary to retain it.
+ * platform/text/cf/StringImplCF.cpp:
+ (WTF::StringImpl::createCFString): The logic to avoid the StringWrapperCFAllocator has also been simplified.
+ The allocator creation is now closer to where it is useful.
+
+ The function CFStringCreateWithBytesNoCopy() does not necessarilly allocate a new string, it can reuse
+ existing strings. In those cases, the allocator is not used. For that reason, the assertion regarding
+ currentString is moved to the branch that always allocate new strings.
+
+2012-08-16 Adam Barth <abarth@webkit.org>
+
+ DirectoryEntry should use Dictionary rather than custom bindings code
+ https://bugs.webkit.org/show_bug.cgi?id=94207
+
+ Reviewed by Eric Seidel.
+
+ Since this code was written, we added native support for WebIDL
+ Dictionary objects. This patch moves DirectoryEntry to use this
+ automatic facility instead of custom code.
+
+ I've also renamed and simplified WebKitFlags. This is possible because
+ this object was no longer exposed via IDL (even before to this patch).
+
+ * GNUmakefile.list.am:
+ * Modules/filesystem/DOMFileSystemBase.cpp:
+ (WebCore::DOMFileSystemBase::getFile):
+ (WebCore::DOMFileSystemBase::getDirectory):
+ * Modules/filesystem/DOMFileSystemBase.h:
+ (DOMFileSystemBase):
+ * Modules/filesystem/DirectoryEntry.cpp:
+ (WebCore::DirectoryEntry::getFile):
+ (WebCore::DirectoryEntry::getDirectory):
+ * Modules/filesystem/DirectoryEntry.h:
+ (DirectoryEntry):
+ * Modules/filesystem/DirectoryEntry.idl:
+ * Modules/filesystem/DirectoryEntrySync.cpp:
+ (WebCore::DirectoryEntrySync::getFile):
+ (WebCore::DirectoryEntrySync::getDirectory):
+ * Modules/filesystem/DirectoryEntrySync.h:
+ (DirectoryEntrySync):
+ * Modules/filesystem/DirectoryEntrySync.idl:
+ * Modules/filesystem/FileSystemCallbacks.cpp:
+ (WebCore):
+ (WebCore::ResolveURICallbacks::didOpenFileSystem):
+ * Modules/filesystem/FileSystemFlags.h: Renamed from Source/WebCore/Modules/filesystem/WebKitFlags.h.
+ (WebCore):
+ (WebCore::FileSystemFlags::FileSystemFlags):
+ (FileSystemFlags):
+ * Modules/filesystem/WorkerContextFileSystem.cpp:
+ (WebCore::WorkerContextFileSystem::webkitResolveLocalFileSystemSyncURL):
+ * Target.pri:
+ * UseJSC.cmake:
+ * UseV8.cmake:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSDirectoryEntryCustom.cpp: Removed.
+ * bindings/js/JSDirectoryEntrySyncCustom.cpp: Removed.
+ * bindings/v8/custom/V8DirectoryEntryCustom.cpp: Removed.
+ * bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp: Removed.
+
+2012-08-15 Antti Koivisto <antti@apple.com>
+
+ Remove StyleSheetContents::m_finalURL
+ https://bugs.webkit.org/show_bug.cgi?id=94140
+
+ Reviewed by Andreas Kling.
+
+ It is equal (or empty in case of inline stylesheets) to the baseURL passed in CSSParserContext.
+ Removing it simplifies the constructors and the related code.
+
+ * css/CSSStyleSheet.cpp:
+ (WebCore::CSSStyleSheet::createInline):
+ (WebCore::CSSStyleSheet::canAccessRules):
+ (WebCore::CSSStyleSheet::rules):
+ (WebCore::CSSStyleSheet::cssRules):
+
+ - factor access check to a function
+ - allow document always access rules of its inline stylesheets
+
+ * css/StyleRuleImport.cpp:
+ (WebCore::StyleRuleImport::setCSSStyleSheet):
+ (WebCore::StyleRuleImport::requestStyleSheet):
+ * css/StyleSheetContents.cpp:
+ (WebCore::StyleSheetContents::StyleSheetContents):
+ (WebCore::StyleSheetContents::parseAuthorStyleSheet):
+ * css/StyleSheetContents.h:
+ (WebCore::StyleSheetContents::create):
+ (WebCore::StyleSheetContents::originalURL):
+ (StyleSheetContents):
+ * dom/ProcessingInstruction.cpp:
+ (WebCore::ProcessingInstruction::setCSSStyleSheet):
+ * html/HTMLLinkElement.cpp:
+ (WebCore::HTMLLinkElement::setCSSStyleSheet):
+ * inspector/InspectorStyleSheet.cpp:
+ (WebCore::fillMediaListChain):
+ (WebCore::InspectorStyleSheet::styleSheetURL):
+ * xml/XSLImportRule.cpp:
+ (WebCore::XSLImportRule::loadSheet):
+
+2012-08-16 Justin Novosad <junov@chromium.org>
+
+ [Chromium] Changing Canvas2DLayerBridge to use SkDeferredCanvas's notification client API
+ https://bugs.webkit.org/show_bug.cgi?id=94234
+
+ Reviewed by James Robinson.
+
+ The existing DeviceContext API in skia's SkDeferredCanvas is being
+ deprecated in favor of the new NotificationClient interface, which is
+ designed to allow WebKit to control deferred canvas global memory
+ consumption.
+
+ No new tests: this patch does not fix any bug and does not add new
+ functionality. It is just a transition to a new skia interface.
+ Coverage is assured by existing tests.
+
+ * platform/graphics/chromium/Canvas2DLayerBridge.cpp:
+ (WebCore):
+ Removed the AcceleratedDeviceContext class completely and mixed it
+ into Canvas2DLayerBridge by inheriting
+ SkDeferredCanvas::NotificationClient
+ (WebCore::Canvas2DLayerBridge::~Canvas2DLayerBridge):
+ (WebCore::Canvas2DLayerBridge::deferredCanvas):
+ (WebCore::Canvas2DLayerBridge::prepareForDraw):
+ (WebCore::Canvas2DLayerBridge::skCanvas):
+ * platform/graphics/chromium/Canvas2DLayerBridge.h:
+ (Canvas2DLayerBridge):
+ * platform/graphics/skia/ImageBufferSkia.cpp:
+ Cleaning up unnecessary include of SkDeferredCanvas.h
+
+2012-08-16 David Reveman <reveman@chromium.org>
+
+ [Chromium] Avoid aliasing global symbol monotonicallyIncreasingTime().
+ https://bugs.webkit.org/show_bug.cgi?id=94233
+
+ Reviewed by James Robinson.
+
+ Rename virtual function CCDelayBasedTimeSource::monotonicallyIncreasingTime()
+ that exist for testing purposes to CCDelayBasedTimeSource::monotonicTimeNow().
+
+ No new tests.
+
+ * platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp:
+ (WebCore::CCDelayBasedTimeSource::setActive):
+ (WebCore::CCDelayBasedTimeSource::onTimerFired):
+ (WebCore::CCDelayBasedTimeSource::monotonicTimeNow):
+ * platform/graphics/chromium/cc/CCDelayBasedTimeSource.h:
+
+2012-08-16 David Reveman <reveman@chromium.org>
+
+ [Chromium] Schedule texture uploads based on hard-coded timer and vsync.
+ https://bugs.webkit.org/show_bug.cgi?id=84281
+
+ Reviewed by James Robinson.
+
+ Improve interaction between vsync and texture uploads by performing
+ uploads in smaller batches and use a hard-coded timer to emulate
+ upload completion. This greatly reduces the chance of the compositor
+ missing a vsync due to being busy with texture uploads.
+
+ The CCScheduler client is now given a time limit when told to update
+ more resources. This time limit is passed to an instance of the
+ CCTextureUpdateController class, which is responsible for performing
+ texture updates until the limit is reached.
+
+ Unit tests: CCSchedulerTest.RequestCommit
+ CCTextureUpdateControllerTest.UpdateMoreTextures
+ CCTextureUpdateControllerTest.HasMoreUpdates
+
+ * platform/graphics/chromium/cc/CCFrameRateController.cpp:
+ (WebCore::CCFrameRateController::nextTickTime):
+ (WebCore):
+ * platform/graphics/chromium/cc/CCFrameRateController.h:
+ (CCFrameRateController):
+ * platform/graphics/chromium/cc/CCScheduler.cpp:
+ (WebCore::CCScheduler::processScheduledActions):
+ * platform/graphics/chromium/cc/CCScheduler.h:
+ (CCSchedulerClient):
+ * platform/graphics/chromium/cc/CCTextureUpdateController.cpp:
+ (WebCore::CCTextureUpdateController::maxPartialTextureUpdates):
+ (WebCore::CCTextureUpdateController::CCTextureUpdateController):
+ (WebCore::CCTextureUpdateController::updateMoreTextures):
+ (WebCore):
+ (WebCore::CCTextureUpdateController::onTimerFired):
+ (WebCore::CCTextureUpdateController::monotonicTimeNow):
+ (WebCore::CCTextureUpdateController::updateMoreTexturesTime):
+ (WebCore::CCTextureUpdateController::updateMoreTexturesSize):
+ (WebCore::CCTextureUpdateController::updateMoreTexturesIfEnoughTimeRemaining):
+ (WebCore::CCTextureUpdateController::updateMoreTexturesNow):
+ * platform/graphics/chromium/cc/CCTextureUpdateController.h:
+ (WebCore::CCTextureUpdateController::create):
+ (CCTextureUpdateController):
+ * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+ (WebCore::CCThreadProxy::beginFrameCompleteOnImplThread):
+ (WebCore::CCThreadProxy::scheduledActionUpdateMoreResources):
+ * platform/graphics/chromium/cc/CCThreadProxy.h:
+
+2012-08-16 Dana Jansens <danakj@chromium.org>
+
+ [chromium] Impl scrolling crashes when the renderer's initialization failed
+ https://bugs.webkit.org/show_bug.cgi?id=94232
+
+ Reviewed by James Robinson.
+
+ CCLayerTreeHostImpl::calculateRenderSurfaceLayerList should not be
+ called when there is no renderer present or it will crash.
+
+ Chromium bug: crbug.com/125482
+
+ Tests: CCLayerTreeHostImplTest.scrollWithoutRenderer
+
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+ (WebCore::CCLayerTreeHostImpl::calculateRenderSurfaceLayerList):
+ (WebCore::CCLayerTreeHostImpl::ensureRenderSurfaceLayerList):
+
+2012-08-15 Levi Weintraub <leviw@chromium.org>
+
+ Accumulate sub-pixel offsets through layers and transforms
+ https://bugs.webkit.org/show_bug.cgi?id=89238
+
+ Reviewed by Eric Seidel.
+
+ Pixel snapping logic makes use of sub-pixel offsets accumulated when walking down
+ the render tree. When we align RenderLayers to paint on pixel boundaries, we were
+ also losing that accumulated value. This preserves the fractional offset and passes
+ it to the RenderLayer's RenderObjects so they paint the proper size and offset.
+
+ This also necessitates a new mode of mapLocalToContainer whereby we pixel snap the
+ offset used in transforms. Otherwise, they wouldn't account for the pixel snapping
+ done elsewhere in the render tree.
+
+ Test: fast/sub-pixel/sub-pixel-accumulates-to-layers.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::pixelSnappedSizingBox): The LayoutUnit version of sizingBox returns a
+ LayoutRect with the location zeroed out. This leads to incorrect pixel snapping, so
+ we shouldn't put these numbers into a transform. Sadly, I couldn't figure out a
+ test for this without the rest of the patch.
+ (WebCore):
+ (WebCore::computedTransform): Using pixel-snapped values when generating transforms.
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::mapLocalToContainer): Adding a mode whereby the values inputed
+ into the transform are properly pixel snapped.
+ (WebCore::RenderBox::computeRectForRepaint): Using pixel snapped values for the transform.
+ * rendering/RenderBox.h:
+ (RenderBox):
+ * rendering/RenderGeometryMap.cpp:
+ (WebCore::RenderGeometryMap::mapToAbsolute):
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::mapLocalToContainer):
+ * rendering/RenderInline.h:
+ (RenderInline):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::updateTransform): Using pixel snapped values for the transform.
+ (WebCore::RenderLayer::currentTransform): Ditto.
+ (WebCore::RenderLayer::perspectiveTransform): Ditto.
+ (WebCore::RenderLayer::paint): Support passing along the accumulated sub-pixel offset instead
+ of rounding and use enclosingIntRect for the damageRect.
+ (WebCore::RenderLayer::paintOverlayScrollbars): Updating to the new paintLayer contract
+ (WebCore::RenderLayer::paintLayer): Adding a sub-pixel accumulation LayoutSize. We pass this
+ delta to the Layer's RenderObject when we paint, but align the graphics context to the proper
+ pixel value.
+ (WebCore::RenderLayer::paintLayerContentsAndReflection): Ditto.
+ (WebCore::RenderLayer::paintLayerContents): Ditto.
+ (WebCore::RenderLayer::paintList): Ditto.
+ (WebCore::RenderLayer::paintChildLayerIntoColumns): Ditto.
+ (WebCore::RenderLayer::calculateClipRects): Avoid unnecessary rounding when sub-pixel is enabled.
+ (WebCore::RenderLayer::calculateRects): Remove unnecessary pixel snapping.
+ * rendering/RenderLayer.h:
+ (RenderLayer):
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateLayerTransform): Use pixel-snapped values for transforms.
+ (WebCore::RenderLayerBacking::paintIntoLayer): Update to new paintLayer contract.
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::localToContainerQuad): Adding a mode for optionally pixel snapping.
+ (WebCore::RenderObject::localToContainerPoint): Ditto.
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::localToAbsoluteQuad): Ditto.
+ (RenderObject):
+ * rendering/RenderReplica.cpp:
+ (WebCore::RenderReplica::paint): Updating to new paintLayer contract.
+ * rendering/RenderView.h:
+ (RenderView):
+ * rendering/svg/RenderSVGForeignObject.cpp:
+ (WebCore::RenderSVGForeignObject::mapLocalToContainer):
+ * rendering/svg/RenderSVGForeignObject.h:
+ (RenderSVGForeignObject):
+ * rendering/svg/RenderSVGInline.cpp:
+ (WebCore::RenderSVGInline::mapLocalToContainer):
+ * rendering/svg/RenderSVGInline.h:
+ (RenderSVGInline):
+ * rendering/svg/RenderSVGModelObject.cpp:
+ (WebCore::RenderSVGModelObject::mapLocalToContainer):
+ * rendering/svg/RenderSVGModelObject.h:
+ (RenderSVGModelObject):
+ * rendering/svg/RenderSVGRoot.h:
+ (RenderSVGRoot):
+ * rendering/svg/RenderSVGText.cpp:
+ (WebCore::RenderSVGText::mapLocalToContainer):
+ * rendering/svg/RenderSVGText.h:
+ (RenderSVGText):
+ * rendering/svg/SVGRenderSupport.cpp:
+ (WebCore::SVGRenderSupport::mapLocalToContainer):
+ * rendering/svg/SVGRenderSupport.h:
+ (SVGRenderSupport):
+
+2012-08-16 Mario Sanchez Prada <msanchez@igalia.com>
+
+ [GTK] Bad utf8 data is being passed to enchant_dict_check
+ https://bugs.webkit.org/show_bug.cgi?id=94202
+
+ Reviewed by Martin Robinson.
+
+ Pass the number of bytes instead of the number of UTF8 characters
+ when calling enchant_dict_check.
+
+ * platform/text/gtk/TextCheckerEnchant.cpp:
+ (TextCheckerEnchant::checkSpellingOfString): Use 'bytes' instead
+ of 'wordLength'.
+
+2012-08-16 Sergey Rogulenko <rogulenko@google.com>
+
+ Web Inspector: added Paint events for Images to TimelineAgent
+ https://bugs.webkit.org/show_bug.cgi?id=90277
+
+ Reviewed by Pavel Feldman.
+
+ - add DecodeImage & ResizeImage timeline events;
+ - implement {will,did}DecodeImage and {will,did}ResizeImage methods of Timeline agent;
+
+ Test: inspector/timeline/timeline-decode-resize.html
+
+ * English.lproj/localizedStrings.js:
+ * inspector/InspectorTimelineAgent.cpp:
+ (TimelineRecordType):
+ (WebCore::InspectorTimelineAgent::willDecodeImage):
+ (WebCore::InspectorTimelineAgent::didDecodeImage):
+ (WebCore::InspectorTimelineAgent::willResizeImage):
+ (WebCore::InspectorTimelineAgent::didResizeImage):
+ * inspector/TimelineRecordFactory.cpp:
+ (WebCore::TimelineRecordFactory::createDecodeImageData):
+ (WebCore):
+ (WebCore::TimelineRecordFactory::createResizeImageData):
+ * inspector/TimelineRecordFactory.h:
+ (TimelineRecordFactory):
+ * inspector/front-end/TimelineModel.js:
+ * inspector/front-end/TimelinePresentationModel.js:
+ (WebInspector.TimelinePresentationModel.initRecordStyles_):
+ (WebInspector.TimelinePresentationModel.Record.prototype._getRecordDetails):
+
+2012-08-16 James Robinson <jamesr@chromium.org>
+
+ [chromium] Remove alwaysReserveTextures code - it doesn't do anything
+ https://bugs.webkit.org/show_bug.cgi?id=94183
+
+ Reviewed by Dimitri Glazkov.
+
+ LayerChromium::setAlwaysReservesTextures doesn't do anything and hasn't since the prioritized texture manager
+ landed. This deletes the associated code.
+
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::LayerChromium::LayerChromium):
+ * platform/graphics/chromium/LayerChromium.h:
+ (LayerChromium):
+
+2012-08-16 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Sort the xcodeproj file.
+
+ * WebCore.xcodeproj/project.pbxproj:
+
+2012-08-16 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Update bindings tests results from my recent VoidCallback
+ patch. The new result is correct.
+
+ * bindings/scripts/test/V8/V8TestCallback.cpp:
+
+2012-08-16 Andrey Kosyakov <caseq@chromium.org>
+
+ Web Inspector: CPU profiler status bar is broken.
+ https://bugs.webkit.org/show_bug.cgi?id=94212
+
+ Reviewed by Pavel Feldman.
+
+ - properly compute floating status bar buttons offset for profile and timeline panels,
+ taking actual number of panel status bar buttons and panel sidebar offset into account;
+
+ * inspector/front-end/ProfilesPanel.js:
+ (WebInspector.ProfilesPanel.prototype.get statusBarItems):
+ (WebInspector.ProfilesPanel.prototype.sidebarResized):
+ (WebInspector.ProfilesPanel.prototype.onResize):
+ * inspector/front-end/SplitView.js:
+ (WebInspector.SplitView.prototype.sidebarWidth):
+ * inspector/front-end/StatusBarButton.js:
+ * inspector/front-end/TimelinePanel.js:
+ (WebInspector.TimelinePanel.prototype.sidebarResized):
+ (WebInspector.TimelinePanel.prototype.onResize):
+
+2012-08-16 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Fix the Mac build.
+
+ Unreviewed build fix.
+
+ * WebCore.exp.in: Export FrameView::didFirstLayout()
+
+2012-08-16 Konrad Piascik <kpiascik@rim.com>
+
+ Add BB10 User Agent String to Web Inspector.
+ https://bugs.webkit.org/show_bug.cgi?id=94217
+
+ Reviewed by George Staikos.
+
+ Add the new BlackBerry 10 User Agent String and device metrics for
+ emulation.
+
+ * inspector/front-end/SettingsScreen.js:
+ (WebInspector.UserAgentSettingsTab.prototype._createUserAgentSelectRowElement.get const):
+
+2012-08-16 Marcelo Lira <marcelo.lira@openbossa.org>
+
+ [Qt] Input method hints are not being set.
+ https://bugs.webkit.org/show_bug.cgi?id=92386
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Input method hints for an editable element must be obtained from a proper
+ HTML element. If the editable element is a complex one, it will have elements
+ in the Shadow DOM, and it's one of those that will be returned as the root
+ editable element. This works for editable DIVs, but not for INPUT elements.
+ Using Element::shadowHost() on the root editable element will provide the
+ needed HTML element, and for further clarity a method that does this was added
+ to FrameSelection.
+
+ * editing/FrameSelection.cpp:
+ (WebCore::FrameSelection::rootEditableElementRespectingShadowTree): Similar to
+ WebCore::FrameSelection::rootEditableElement, but returns the first ancestor of
+ the editable element outside the shadow tree.
+ (WebCore):
+ * editing/FrameSelection.h:
+ (FrameSelection):
+
+2012-08-16 Zeno Albisser <zeno@webkit.org>
+
+ Make GraphicsSurface double buffered by default.
+ https://bugs.webkit.org/show_bug.cgi?id=93252
+
+ Create only a single GraphicsSurface per canvas
+ on both supported platforms Mac/Linux.
+ The GraphicsSurface on Mac internally uses two IOSurface
+ to provide a front and a back buffer.
+ The GLX implementation of GraphicsSurface uses
+ an XWindow which already provides a front and a back buffer.
+
+ Reviewed by Noam Rosenthal.
+
+ * platform/graphics/qt/GraphicsContext3DQt.cpp:
+ (GraphicsContext3DPrivate):
+ Remove creation of second GraphicsSurface.
+ (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
+ (WebCore::GraphicsContext3DPrivate::copyToGraphicsSurface):
+ (WebCore):
+ (WebCore::GraphicsContext3DPrivate::graphicsSurfaceToken):
+ (WebCore::GraphicsContext3DPrivate::createGraphicsSurfaces):
+ * platform/graphics/surfaces/GraphicsSurface.cpp:
+ (WebCore::GraphicsSurface::create):
+ Adjust token type to uint64_t.
+ (WebCore::GraphicsSurface::exportToken):
+ Adjust return type to uint64_t.
+ (WebCore::GraphicsSurface::frontBuffer):
+ (WebCore):
+ (WebCore::GraphicsSurface::swapBuffers):
+ Add forwarding function to swap buffers inside GraphicsSurface.
+ * platform/graphics/surfaces/GraphicsSurface.h:
+ (GraphicsSurface):
+ Add SupportsSingleBuffered flag to allow for single buffered implementations.
+ Currently single buffered surfaces are either not implemented or disabled.
+ * platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp:
+ Move implementation details into GraphicsSurfacePrivate.
+ This way the platform specific code can be hidden in the specific cpp file
+ instead of polluting the global GraphicsSurface header.
+ (WebCore::createTexture):
+ (GraphicsSurfacePrivate):
+ (WebCore::GraphicsSurfacePrivate::GraphicsSurfacePrivate):
+ (WebCore::GraphicsSurfacePrivate::~GraphicsSurfacePrivate):
+ (WebCore::GraphicsSurfacePrivate::swapBuffers):
+ (WebCore::GraphicsSurfacePrivate::token):
+ (WebCore::GraphicsSurfacePrivate::frontBufferTextureID):
+ (WebCore::GraphicsSurfacePrivate::backBufferTextureID):
+ (WebCore::GraphicsSurfacePrivate::frontBuffer):
+ (WebCore::GraphicsSurfacePrivate::backBuffer):
+ (WebCore):
+ (WebCore::GraphicsSurface::platformExport):
+ (WebCore::GraphicsSurface::platformGetTextureID):
+ (WebCore::GraphicsSurface::platformCopyToGLTexture):
+ (WebCore::GraphicsSurface::platformCopyFromFramebuffer):
+ (WebCore::GraphicsSurface::platformFrontBuffer):
+ (WebCore::GraphicsSurface::platformSwapBuffers):
+ (WebCore::GraphicsSurface::platformCreate):
+ (WebCore::GraphicsSurface::platformImport):
+ (WebCore::ioSurfaceLockOptions):
+ (WebCore::GraphicsSurface::platformLock):
+ (WebCore::GraphicsSurface::platformUnlock):
+ (WebCore::GraphicsSurface::platformDestroy):
+ * platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp:
+ (WebCore::OffScreenRootWindow::get):
+ (WebCore::GraphicsSurfacePrivate::swapBuffers):
+ Make sure that framebuffer bindings remain consistent
+ after swapping buffers on the XWindow.
+ (WebCore::GraphicsSurface::platformExport):
+ Make sure the GLXPixmap is only bound to the texture once.
+ (WebCore::GraphicsSurface::platformGetTextureID):
+ (WebCore::GraphicsSurface::platformCopyFromFramebuffer):
+ (WebCore):
+ (WebCore::GraphicsSurface::platformFrontBuffer):
+ The GLX surface does not know how to destinguish between
+ the front and the back buffer by an id. This is not necessary
+ for GraphicsSurfaceGLX, because the texture can just be
+ read from the XWindow at any time.
+ (WebCore::GraphicsSurface::platformSwapBuffers):
+ (WebCore::GraphicsSurface::platformCreate):
+ (WebCore::GraphicsSurface::platformImport):
+ * platform/graphics/texmap/TextureMapperBackingStore.cpp:
+ Remove code that was used for switching between two GraphicsSurfaces,
+ as this is now handled directly inside GraphicsSurface.
+ (WebCore::TextureMapperSurfaceBackingStore::setGraphicsSurface):
+ (WebCore::TextureMapperSurfaceBackingStore::paintToTextureMapper):
+ (WebCore::TextureMapperSurfaceBackingStore::setSurface):
+ (WebCore):
+ * platform/graphics/texmap/TextureMapperBackingStore.h:
+ Remove GraphicsSurfaceData struct. This class is not needed anymore
+ as we do not keep track of more than one GraphicsSurface at the time.
+ (WebCore):
+ (TextureMapperSurfaceBackingStore):
+ (WebCore::TextureMapperSurfaceBackingStore::graphicsSurface):
+ (WebCore::TextureMapperSurfaceBackingStore::TextureMapperSurfaceBackingStore):
+ * platform/graphics/texmap/TextureMapperPlatformLayer.h:
+ (WebCore::TextureMapperPlatformLayer::graphicsSurfaceToken):
+
+2012-08-16 Mike West <mkwst@chromium.org>
+
+ Implement the form-action Content Security Policy directive.
+ https://bugs.webkit.org/show_bug.cgi?id=93777
+
+ Reviewed by Jochen Eisinger.
+
+ The CSP 1.1 editor's draft defines the 'form-action' directive as a
+ mechanism for whitelisting valid targets for form submission from a
+ protected resource. A web author might desire to restrict form
+ submissions to the same origin as the protected resource itself via
+ a Content Security Policy of "form-action 'self'", or ensure that all
+ submissions were sent over an SSL connection via "form-action https:".
+
+ Specification details available at: https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#form-action--experimental
+
+ This experimental directive is gated on the ENABLE_CSP_NEXT flag, which
+ is currently only enabled in Chromium.
+
+ Tests: http/tests/security/contentSecurityPolicy/1.1/form-action-src-allowed.html
+ http/tests/security/contentSecurityPolicy/1.1/form-action-src-blocked.html
+ http/tests/security/contentSecurityPolicy/1.1/form-action-src-default-ignored.html
+ http/tests/security/contentSecurityPolicy/1.1/form-action-src-get-allowed.html
+ http/tests/security/contentSecurityPolicy/1.1/form-action-src-get-blocked.html
+ http/tests/security/contentSecurityPolicy/1.1/form-action-src-javascript-blocked.html
+ http/tests/security/contentSecurityPolicy/1.1/form-action-src-redirect-blocked.html
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::checkIfFormActionAllowedByCSP):
+ Adding a callback to FrameLoader in order to allow the
+ MainResourceLoader to check the relevant CSP status without knowing
+ anything about CSP.
+ (WebCore):
+ * loader/FrameLoader.h:
+ (FrameLoader):
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::willSendRequest):
+ Check against the protected resource's Content Security Policy when
+ presented with a request that is itself a form submission, or is the
+ result of a redirect in response to a form submission. If CSP would
+ block the target, cancel the request.
+ * page/ContentSecurityPolicy.cpp:
+ (CSPDirectiveList):
+ (WebCore::CSPDirectiveList::checkSourceAndReportViolation):
+ Added explanatory text to the source violation console warning that
+ specifically calls out sending form data (as opposed to "connect to"
+ or "load the").
+ (WebCore::CSPDirectiveList::allowFormAction):
+ Check a URL against a directive list's the 'form-action' source list.
+ (WebCore):
+ (WebCore::CSPDirectiveList::addDirective):
+ Recognize the 'form-action' CSP directive.
+ (WebCore::ContentSecurityPolicy::allowFormAction):
+ Public interface to check a form action.
+ * page/ContentSecurityPolicy.h:
+
+2012-08-16 Arvid Nilsson <anilsson@rim.com>
+
+ [BlackBerry] WebGL and Canvas fail to display after being restored from page cache
+ https://bugs.webkit.org/show_bug.cgi?id=94105
+
+ Reviewed by George Staikos.
+
+ The EGLImage was being destroyed when releasing layer resources on the
+ compositing thread, but the WebKit thread layer never found out and
+ failed to create a new image.
+
+ Fixed by extending the release layer resources mechanism to also make a
+ pass on the WebKit thread so that thread's layers have a chance to
+ delete their textures and related resources.
+
+ WebGL and canvas layers now take this opportunity to release their
+ textures so the EGLImage gets recreated when compositing commits
+ resume.
+
+ The only detail that deserves extra explanation is the ownership of the
+ EGLImage.
+
+ Since the EGLImage is created in updateTextureContentsIfNeeded() and
+ that one is always followed by commitPendingTextureUploads() which
+ transfers the EGLImage to the compositing thread layer's custody, the
+ EGLImage currently referenced by EGLImageLayerWebKitThread::m_image
+ should never be deleted by the WebKit thread layer.
+
+ Thus all we have to do in deleteFrontBuffer() is to set the m_image
+ member to 0 so the image gets recreated on the next commit. It will be
+ deleted by the part of releaseLayerResources() that executes on the
+ compositing thread (which, if you recall, was the original source of
+ this bug).
+
+ Reviewed internally by Filip Spacek.
+
+ PR 192899
+
+ Not currently testable by the BlackBerry testing infrastructure.
+
+ * platform/graphics/blackberry/CanvasLayerWebKitThread.cpp:
+ (WebCore::CanvasLayerWebKitThread::deleteTextures):
+ (WebCore):
+ * platform/graphics/blackberry/CanvasLayerWebKitThread.h:
+ (CanvasLayerWebKitThread):
+ * platform/graphics/blackberry/EGLImageLayerWebKitThread.cpp:
+ (WebCore::EGLImageLayerWebKitThread::~EGLImageLayerWebKitThread):
+ (WebCore::EGLImageLayerWebKitThread::deleteFrontBuffer):
+ * platform/graphics/blackberry/EGLImageLayerWebKitThread.h:
+ (EGLImageLayerWebKitThread):
+ * platform/graphics/blackberry/LayerWebKitThread.cpp:
+ (WebCore::LayerWebKitThread::releaseLayerResources):
+ (WebCore):
+ * platform/graphics/blackberry/LayerWebKitThread.h:
+ (LayerWebKitThread):
+ (WebCore::LayerWebKitThread::deleteTextures):
+ * platform/graphics/blackberry/WebGLLayerWebKitThread.cpp:
+ (WebCore::WebGLLayerWebKitThread::~WebGLLayerWebKitThread):
+ (WebCore::WebGLLayerWebKitThread::deleteTextures):
+ (WebCore):
+ * platform/graphics/blackberry/WebGLLayerWebKitThread.h:
+ (WebGLLayerWebKitThread):
+
+2012-08-16 Andrey Kosyakov <caseq@chromium.org>
+
+ Web Inspector: enable instrumentation of platform code
+ https://bugs.webkit.org/show_bug.cgi?id=94125
+
+ Reviewed by Pavel Feldman.
+
+ - add PlatformInstrumentation class that exposes instrumentation methods that may be used by code under WebCore/platform;
+ - move TRACE_EVENT_XXX() macros into PlatformInstrumentation.h to minimize instrumentation hassle in the client code;
+ - implement PlatformInstrumentationClient by InspectorTimelineAgent;
+ - only install PlatformInstrumentationClient when we have outer events for which we expect low-level details
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * inspector/InspectorTimelineAgent.cpp:
+ (WebCore::InspectorTimelineAgent::willDecodeImage): to be implemented by subsequent change;
+ (WebCore::InspectorTimelineAgent::didDecodeImage): to be implemented by subsequent change;
+ (WebCore::InspectorTimelineAgent::willResizeImage): to be implemented by subsequent change;
+ (WebCore::InspectorTimelineAgent::didResizeImage): to be implemented by subsequent change;
+ (WebCore::InspectorTimelineAgent::didCompleteCurrentRecord):
+ (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
+ (WebCore::InspectorTimelineAgent::pushCurrentRecord):
+ (WebCore::InspectorTimelineAgent::clearRecordStack):
+ * inspector/InspectorTimelineAgent.h:
+ (InspectorTimelineAgent):
+ * platform/PlatformInstrumentation.cpp: Added.
+ (WebCore):
+ (WebCore::PlatformInstrumentation::setClient):
+ * platform/PlatformInstrumentation.h: Added.
+ (WebCore):
+ (PlatformInstrumentationClient):
+ (PlatformInstrumentation):
+ (WebCore::PlatformInstrumentation::hasClient):
+ (WebCore::PlatformInstrumentation::willDecodeImage):
+ (WebCore::PlatformInstrumentation::didDecodeImage):
+ (WebCore::PlatformInstrumentation::willResizeImage):
+ (WebCore::PlatformInstrumentation::didResizeImage):
+ * platform/graphics/skia/NativeImageSkia.cpp:
+ (WebCore::NativeImageSkia::resizedBitmap): added calls to PlatformInstrumentation, removed TRACE_EVENT();
+ * platform/image-decoders/bmp/BMPImageDecoder.cpp:
+ (WebCore::BMPImageDecoder::frameBufferAtIndex): added calls to PlatformInstrumentation;
+ (WebCore::BMPImageDecoder::decode): removed TRACE_EVENT()
+ * platform/image-decoders/gif/GIFImageDecoder.cpp:
+ (WebCore::GIFImageDecoder::frameBufferAtIndex): added calls to PlatformInstrumentation;
+ (WebCore::GIFImageDecoder::decode): removed TRACE_EVENT()
+ * platform/image-decoders/ico/ICOImageDecoder.cpp:
+ (WebCore::ICOImageDecoder::frameBufferAtIndex): added calls to PlatformInstrumentation;
+ (WebCore::ICOImageDecoder::decode): removed TRACE_EVENT()
+ * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
+ (WebCore::JPEGImageDecoder::frameBufferAtIndex): added calls to PlatformInstrumentation;
+ (WebCore::JPEGImageDecoder::decode): removed TRACE_EVENT()
+ * platform/image-decoders/png/PNGImageDecoder.cpp:
+ (WebCore::PNGImageDecoder::frameBufferAtIndex): added calls to PlatformInstrumentation;
+ * platform/image-decoders/webp/WEBPImageDecoder.cpp:
+ (WebCore::WEBPImageDecoder::frameBufferAtIndex): added calls to PlatformInstrumentation;
+ (WebCore::WEBPImageDecoder::decode): removed TRACE_EVENT();
+ * inspector/InspectorInstrumentation.cpp: removed orphan event support;
+ (WebCore):
+ * inspector/InspectorInstrumentation.h: ditto.
+
+2012-08-16 Vsevolod Vlasov <vsevik@chromium.org>
+
+ Web Inspector: Breakpoints are not correctly restored on reload.
+ https://bugs.webkit.org/show_bug.cgi?id=94209
+
+ Reviewed by Pavel Feldman.
+
+ BreakpointManager now resets uiLocations on workspace reset (was doing it on GlobalObjectCleared).
+ Breakpoint manager now calls restoreBreakpoints automatically when uiSourceCode is added to workspace.
+
+ * inspector/front-end/BreakpointManager.js:
+ (WebInspector.BreakpointManager):
+ (WebInspector.BreakpointManager.prototype._uiSourceCodeAdded):
+ (WebInspector.BreakpointManager.prototype._workspaceReset):
+ * inspector/front-end/UISourceCode.js:
+ (WebInspector.UISourceCode):
+ * inspector/front-end/inspector.js:
+
+2012-08-16 Pierre Rossi <pierre.rossi@gmail.com>
+
+ [Qt] Remove FontQt4, HAVE_QRAWFONT flag and the related dead code
+ https://bugs.webkit.org/show_bug.cgi?id=93960
+
+ Reviewed by Simon Hausmann.
+
+ Following the removal of Qt 4 support from trunk in r124879.
+
+ No new tests. Simple cleanup job.
+
+ * Target.pri:
+ * platform/graphics/Font.cpp:
+ (WebCore::Font::codePath):
+ * platform/graphics/Font.h:
+ (Font):
+ * platform/graphics/GraphicsContext.cpp:
+ (WebCore):
+ * platform/graphics/SimpleFontData.cpp:
+ (WebCore::SimpleFontData::platformGlyphInit):
+ (WebCore::SimpleFontData::glyphForCharacter):
+ * platform/graphics/SimpleFontData.h:
+ (SimpleFontData):
+ (WebCore::SimpleFontData::widthForGlyph):
+ * platform/graphics/qt/FontCacheQt.cpp:
+ (WebCore::rawFontForCharacters):
+ (WebCore::FontCache::getFontDataForCharacters):
+ * platform/graphics/qt/FontCustomPlatformData.h:
+ (FontCustomPlatformData):
+ * platform/graphics/qt/FontCustomPlatformDataQt.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ (WebCore::createFontCustomPlatformData):
+ * platform/graphics/qt/FontPlatformData.h:
+ (WebCore::FontPlatformDataPrivate::FontPlatformDataPrivate):
+ (FontPlatformDataPrivate):
+ (FontPlatformData):
+ (WebCore::FontPlatformData::FontPlatformData):
+ * platform/graphics/qt/FontPlatformDataQt.cpp:
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::operator==):
+ (WebCore::FontPlatformData::hash):
+ * platform/graphics/qt/FontQt4.cpp: Removed.
+ * platform/graphics/qt/GlyphPageTreeNodeQt.cpp:
+ (WebCore::GlyphPage::fill):
+ * platform/graphics/qt/SimpleFontDataQt.cpp:
+ (WebCore::SimpleFontData::determinePitch):
+ (WebCore::SimpleFontData::platformBoundsForGlyph):
+ (WebCore::SimpleFontData::platformInit):
+ (WebCore::SimpleFontData::platformCharWidthInit):
+ * rendering/svg/SVGTextMetricsBuilder.cpp:
+ (WebCore::SVGTextMetricsBuilder::advance):
+ (WebCore::SVGTextMetricsBuilder::advanceSimpleText):
+ (WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer):
+
+2012-08-16 Yury Semikhatsky <yurys@chromium.org>
+
+ Web Inspector: memory instrumentation for Resource{Request/Response}Base
+ https://bugs.webkit.org/show_bug.cgi?id=94109
+
+ Reviewed by Vsevolod Vlasov.
+
+ Added reportMemoryUsage methods to ResourceRequestBase, ResourceResponseBase
+ and several related classes.
+
+ * dom/MemoryInstrumentation.cpp:
+ (WebCore::MemoryInstrumentation::addInstrumentedObjectImpl): added overrides
+ for String, StringImpl and AtomicString object types so that we can reuse
+ existing addInstrumentedCollection method instead of adding a counterpart
+ that would operate on not instrumented content. Next step would be to get
+ rid od addObject overrides for these types so that all kinds of Strings are
+ considered as instrumented classes despite they don't have reportMemoryUsage
+ method.
+ (WebCore):
+ * dom/MemoryInstrumentation.h:
+ (WebCore::MemoryInstrumentation::addInstrumentedObjectImpl):
+ (MemoryInstrumentation):
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::reportMemoryUsage):
+ * platform/network/FormData.cpp:
+ (WebCore::FormData::reportMemoryUsage):
+ (WebCore):
+ * platform/network/FormData.h:
+ (WebCore):
+ (FormData):
+ * platform/network/ResourceRequestBase.cpp:
+ (WebCore::ResourceRequestBase::reportMemoryUsage):
+ (WebCore):
+ * platform/network/ResourceRequestBase.h:
+ (ResourceRequestBase):
+ * platform/network/ResourceResponseBase.cpp:
+ (WebCore):
+ (WebCore::ResourceResponseBase::reportMemoryUsage):
+ * platform/network/ResourceResponseBase.h:
+ (WebCore):
+ (ResourceResponseBase):
+
+2012-08-16 Adam Barth <abarth@webkit.org>
+
+ Delete DOMWindow::securityOrigin()
+ https://bugs.webkit.org/show_bug.cgi?id=93991
+
+ Reviewed by Eric Seidel.
+
+ DOMWindow::securityOrigin() just calls through to
+ document()->securityOrigin(). This patch updates all the callers to do
+ that work themselves, making it clearer what's going on at each call
+ site.
+
+ * bindings/generic/BindingSecurity.cpp:
+ (WebCore::canAccessDocument):
+ * bindings/js/JSDOMWindowBase.cpp:
+ (WebCore::JSDOMWindowBase::allowsAccessFrom):
+ * bindings/js/JSDOMWindowCustom.h:
+ (WebCore::JSDOMWindowBase::allowsAccessFromPrivate):
+ * bindings/js/ScriptController.cpp:
+ (WebCore::ScriptController::collectIsolatedContexts):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::isInsecureScriptAccess):
+ (WebCore::DOMWindow::createWindow):
+ * page/DOMWindow.h:
+ (DOMWindow):
+ * page/Location.cpp:
+ (WebCore::Location::reload):
+
+2012-08-16 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125751.
+ http://trac.webkit.org/changeset/125751
+ https://bugs.webkit.org/show_bug.cgi?id=94206
+
+ we shouldn't be rolling out this patch without a formal
+ review. (Requested by rniwa_ on #webkit).
+
+ * dom/CharacterData.cpp:
+ (WebCore::CharacterData::setDataAndUpdate):
+ * editing/FrameSelection.cpp:
+ (WebCore::updatePositionAfterAdoptingTextReplacement):
+ (WebCore::FrameSelection::textWasReplaced):
+ * editing/FrameSelection.h:
+ (FrameSelection):
+
+2012-08-16 Marja Hölttä <marja@chromium.org>
+
+ FormController, FileInputType: Enable reading selected file names from document state
+ https://bugs.webkit.org/show_bug.cgi?id=91231
+
+ Reviewed by Jochen Eisinger.
+
+ This change enables Chromium to set up file permissions properly when
+ the session restore feature restores a page with selected files.
+
+ Test: fast/forms/file/selected-files-from-history-state.html
+
+ * WebCore.exp.in: Exported FormController::getReferencedFilePaths.
+ * html/FileInputType.cpp:
+ (WebCore::FileInputType::filesFromFormControlState): Added. Extracts FileChooserFileInfos from a FormControlState.
+ (WebCore):
+ (WebCore::FileInputType::restoreFormControlState): Refactored to use filesFromFormControlState.
+ * html/FileInputType.h:
+ (FileInputType): Added filesFromFormControlState.
+ * html/FormController.cpp:
+ (SavedFormState): Added getReferencedFilePaths.
+ (WebCore::SavedFormState::getReferencedFilePaths): Added. Extracts selected file paths from SavedFormState.
+ (WebCore):
+ (WebCore::FormController::setStateForNewFormElements): Refactored to use formStatesFromStateVector.
+ (WebCore::FormController::formStatesFromStateVector):
+ (WebCore::FormController::getReferencedFilePaths): Added. Static. Extracts selected file paths from a document state.
+ * html/FormController.h:
+ (FormController): Added getReferencedFilePaths and formStatesFromStateVector.
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::filesFromFileInputFormControlState): Added. Delegates to FileInputType::filesFromFormControlState.
+ (WebCore):
+ * html/HTMLInputElement.h: Added filesFromFileInputFormControlState.
+ (HTMLInputElement):
+ * testing/Internals.cpp:
+ (WebCore::Internals::getReferencedFilePaths): Calls FormController::getReferencedFilePaths.
+ (WebCore):
+ * testing/Internals.h:
+ (Internals): Added getReferencedFilePaths.
+ * testing/Internals.idl: Added binding for getReferencedFilePaths.
+
+2012-08-15 Shawn Singh <shawnsingh@chromium.org>
+
+ [chromium] set scissorRect per quad so that quads are correctly clipped
+ https://bugs.webkit.org/show_bug.cgi?id=94050
+
+ Reviewed by Adrienne Walker.
+
+ Certain quad types rely on scissoring to do correct
+ clipping. Refactoring the quad types to remove this assumption
+ will be done in a later patch, but for now, we have to apply the
+ scissor rect to every quad to ensure that those quads are
+ correctly clipped.
+
+ Test: compositing/overflow/overflow-hidden-canvas-layer.html
+
+ Also updated two unit tests to reflect the change in semantics.
+
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::drawRenderPass):
+ (WebCore::LayerRendererChromium::drawQuad):
+
+2012-08-16 Yoshifumi Inoue <yosin@chromium.org>
+
+ [Forms] Wheel event support in multiple fields time input UI
+ https://bugs.webkit.org/show_bug.cgi?id=94166
+
+ Reviewed by Kent Tamura.
+
+ This patch makes multiple fields time input UI to handle wheel event
+ on spin button.
+
+ This patch affects if ENABLE_INPUT_TYPE_TIME and ENABLE_INPUT_TYPE_MULTIPLE_FIELDS
+ are enabled.
+
+ Test: fast/forms/time-multiple-fields/time-multiple-fields-wheel-event.html
+
+ * html/shadow/DateTimeEditElement.cpp:
+ (WebCore::DateTimeEditElement::defaultEventHandler): Changed to forward
+ event to spin button if available.
+
+2012-08-16 Zhigang Gong <zhigang.gong@linux.intel.com>
+
+ TextureMapperGL::beginPainting has a duplicate call to get GL_FRAMEBUFFER_BINDING.
+ https://bugs.webkit.org/show_bug.cgi?id=94180
+
+ Reviewed by Noam Rosenthal.
+
+ * platform/graphics/texmap/TextureMapperGL.cpp:
+ (WebCore::TextureMapperGL::beginPainting):
+
+2012-08-16 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r119705.
+ http://trac.webkit.org/changeset/119705
+ https://bugs.webkit.org/show_bug.cgi?id=94192
+
+ Causing crash on ClusterFuzz due to incorrect layout ordering
+ change (Requested by inferno-sec on #webkit).
+
+ * dom/CharacterData.cpp:
+ (WebCore::CharacterData::setDataAndUpdate):
+ * editing/FrameSelection.cpp:
+ (WebCore::updatePositionAfterAdoptingTextReplacement):
+ (WebCore::FrameSelection::textWillBeReplaced):
+ * editing/FrameSelection.h:
+ (FrameSelection):
+
+2012-08-15 Kent Tamura <tkent@chromium.org>
+
+ [Chromium] Refactoring: Introduce a new function for some part of PopupContainer::layoutAndCalculateWidgetRect()
+ https://bugs.webkit.org/show_bug.cgi?id=94087
+
+ Reviewed by Hajime Morita.
+
+ Move some part of PopupContainer::layoutAndCalculateWidgetRect() to a
+ new function which is not a member of PopupContainer because we'd like
+ to add a unit test for the position calculation code, and to reduce the
+ dependency.
+
+ No new tests. Popup positioning code is not testable in WebKit.
+
+ * platform/chromium/PopupContainer.cpp:
+ (WebCore::layoutAndCalculateWidgetRectInternal):
+ Added. Move the code from PopupContainer::layoutAndCalculateWidgetRect.
+ In order to avoid to call member functions of PopupContainer, we
+ don't call layoutAndGetRTLOffset() and height(). Use
+ PopupListBox::layout() to recalculate the popup content size, and use
+ PopupListBox::height() + kBorderSize * 2 instead of height(). We
+ resize the view after finishing layoutAndCalculateWidgetRectInternal
+ in PopupContainer::layoutAndCalculateWidgetRect.
+ (WebCore::PopupContainer::layoutAndCalculateWidgetRect):
+ Move some code to layoutAndCalculateWidgetRectInternal.
+ (WebCore::PopupContainer::fitToListBox):
+ Added. Move the code from PopupContainer::layoutAndGetRTLOffset.
+ (WebCore::PopupContainer::layoutAndGetRTLOffset):
+ Move some code to fitToListBox.
+ * platform/chromium/PopupContainer.h:
+ (PopupContainer): Added fitToListBox.
+
+2012-08-15 Adam Barth <abarth@webkit.org>
+
+ VoidCallback should not be a special snowflake
+ https://bugs.webkit.org/show_bug.cgi?id=94119
+
+ Reviewed by Eric Seidel.
+
+ VoidCallback is the oldest of the callbacks and it predates our ability
+ to autogenerate callback objects. The existing implementation of
+ VoidCallback is wrong because it doesn't call
+ ActiveDOMCallback::canInvokeCallback. The net result of that is that
+ void callbacks can race with navigations and occationally execute after
+ the Frame has navigated to a new Document, which was causing the
+ flakiness.
+
+ This patch changes VoidCallback to no longer be a unique snowflake.
+ Instead, we autogenerate the implementation, just like every other
+ callback in WebCore.
+
+ Tests: storage/websql/database-lock-after-reload.html is no longer flaky.
+
+ * DerivedSources.make:
+ * GNUmakefile.list.am:
+ * Modules/filesystem/SyncCallbackHelper.h:
+ (WebCore::SyncCallbackHelper::SuccessCallbackImpl::handleEvent):
+ * Target.pri:
+ * UseJSC.cmake:
+ * UseV8.cmake:
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/cpp/WebDOMCustomVoidCallback.cpp: Removed.
+ * bindings/cpp/WebDOMCustomVoidCallback.h: Removed.
+ * bindings/js/JSBindingsAllInOne.cpp:
+ * bindings/js/JSCustomVoidCallback.cpp: Removed.
+ * bindings/js/JSCustomVoidCallback.h: Removed.
+ * bindings/js/JSDesktopNotificationsCustom.cpp:
+ (WebCore::JSNotificationCenter::requestPermission):
+ * bindings/scripts/CodeGeneratorCPP.pm:
+ (GetClassName):
+ (AddIncludesForType):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GetCallbackClassName):
+ (GenerateCallbackImplementation):
+ (JSValueToNative):
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateCallbackImplementation):
+ (TypeCanFailConversion):
+ (GetCallbackClassName):
+ * bindings/scripts/test/JS/JSTestCallback.cpp:
+ (WebCore::JSTestCallback::callbackWithNoParam):
+ * bindings/scripts/test/V8/V8TestCallback.cpp:
+ * bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp:
+ * bindings/v8/custom/V8CustomVoidCallback.cpp: Removed.
+ * bindings/v8/custom/V8CustomVoidCallback.h: Removed.
+ * bindings/v8/custom/V8MutationCallbackCustom.cpp:
+ * bindings/v8/custom/V8NotificationCenterCustom.cpp:
+ (WebCore::V8NotificationCenter::requestPermissionCallback):
+ * html/VoidCallback.h:
+ (VoidCallback):
+ * html/VoidCallback.idl:
+ * inspector/InspectorDatabaseAgent.cpp:
+ (WebCore):
+
+2012-08-15 Hayato Ito <hayato@chromium.org>
+
+ [Shadow] Stop 'load' and 'error' events at shadow boundaries
+ https://bugs.webkit.org/show_bug.cgi?id=93425
+
+ Reviewed by Dimitri Glazkov.
+
+ The shadow DOM spec has added these events as 'always-be-stopped' events at shadow boundaries.
+ http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#events-that-are-always-stopped
+
+ Test: fast/dom/shadow/events-stopped-at-shadow-boundary.html
+
+ * dom/EventDispatcher.cpp:
+ (WebCore::EventDispatcher::determineDispatchBehavior):
+
+2012-08-15 Kent Tamura <tkent@chromium.org>
+
+ Calendar Picker: Localize numbers in a calendar picker
+ https://bugs.webkit.org/show_bug.cgi?id=93704
+
+ Reviewed by Hajime Morita.
+
+ Because Number.toLocaleString() of V8 returns no localized
+ numbers, we provide a localization function via
+ PagePopupController.
+
+ No new tests. We have no ways to change the locale in layout tests.
+
+ * Resources/pagepopups/calendarPicker.js:
+ (localizeNumber): Added. A wrapper for pagePopupController.localizeNumberString().
+ (formatJapaneseImperialEra): Use localizeNumber().
+ (formatYearMonth): ditto.
+ (DaysTable.prototype._renderMonth): ditto.
+ * page/PagePopupController.cpp:
+ (WebCore::PagePopupController::localizeNumberString):
+ Added. Just calls WebCore::convertToLocalizedNumber().
+ * page/PagePopupController.h:
+ (PagePopupController): Declare localizeNumberString().
+ * page/PagePopupController.idl: Add localizeNumberString().
+
+2012-08-15 MORITA Hajime <morrita@google.com>
+
+ Regression(121518) TextFieldDecorationElement formatting is broken.
+ https://bugs.webkit.org/show_bug.cgi?id=90913
+
+ Reviewed by Dimitri Glazkov.
+
+ NodeRenderingContext::nextRenderer() has a problem which cannot retrieve the renderer
+ across an insertion point in some case. That is because ad-hoc composed tree traversal on
+ NodeRenderingContext is broken. The problem is hidden before r121518 though.
+
+ This change rewrite nextRenderer() using ComposedShadowTreeWalker to eliminate the ad-hoc
+ traversal. previousRenderer() is also rewritten in the same way.
+
+ Test: fast/dom/shadow/shadow-div-reflow.html
+
+ * dom/NodeRenderingContext.cpp:
+ (WebCore):
+ (WebCore::NodeRenderingContext::nextRenderer):
+ (WebCore::NodeRenderingContext::previousRenderer):
+
+2012-08-15 Julien Chaffraix <jchaffraix@webkit.org>
+
+ Add a was-inserted-into-tree notification to RenderObject
+ https://bugs.webkit.org/show_bug.cgi?id=93874
+
+ Reviewed by Eric Seidel.
+
+ This change adds insertedIntoTree to RenderObject so that renderers
+ can now do their post-insertion task inside this function.
+
+ Our current architecture has 2 ways of doing post-insertion tasks:
+ - overriding RenderObject::addChild
+ - RenderObjectChildList::insertChildNode / appendChildNode
+
+ Because the former is not guaranteed to be called for each insertion
+ (on top of being called on the parent and not the inserted child), the
+ 2 latter functions are the one that have been mostly used recently. This
+ led to code duplication between the functions but also doesn't scale as
+ other renderers need to hop on this notification and currently don't (for
+ example, table parts). The other renderer's migration will be done in
+ follow-up patches.
+
+ Refactoring covered by existing tests.
+
+ * rendering/RenderObjectChildList.cpp:
+ (WebCore::RenderObjectChildList::removeChildNode):
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::enclosingRenderNamedFlowThread):
+ Moved the code from renderNamedFlowThreadContainer to RenderObject::enclosingRenderNamedFlowThread.
+ This is needed as now 2 classes need to access the function.
+
+ * rendering/RenderObjectChildList.cpp:
+ (WebCore::RenderObjectChildList::appendChildNode):
+ (WebCore::RenderObjectChildList::insertChildNode):
+ Moved the code duplicated from those 2 functions into
+ the instances of insertedIntoTree below.
+
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::insertedIntoTree):
+ Base function that needs to be called from all the other
+ specialized functions below.
+
+ * rendering/RenderListItem.cpp:
+ (WebCore::RenderListItem::insertedIntoTree):
+ * rendering/RenderListItem.h:
+ * rendering/RenderObject.h:
+ * rendering/RenderObjectChildList.h:
+ * rendering/RenderRegion.cpp:
+ (WebCore::RenderRegion::insertedIntoTree):
+ * rendering/RenderRegion.h:
+ Added the overriden insertedIntoTree function.
+
+ * rendering/RenderQuote.h:
+ Moved the comment from RenderObjectChildList about RenderQuote here.
+
+2012-08-14 Jeffrey Pfau <jpfau@apple.com>
+
+ Allow blocking of Web SQL databases in third-party documents
+ https://bugs.webkit.org/show_bug.cgi?id=94057
+
+ Reviewed by Adam Barth.
+
+ Add a check for pages in third-party pages to allow third-party storage blocking of Web SQL databases.
+
+ Tests: http/tests/security/cross-origin-websql-allowed.html
+ http/tests/security/cross-origin-websql.html
+
+ * Modules/webdatabase/DOMWindowWebDatabase.cpp:
+ (WebCore::DOMWindowWebDatabase::openDatabase): Pass top origin to canAccessDatabase
+ * page/SecurityOrigin.cpp:
+ (WebCore::SecurityOrigin::canAccessStorage): Common method for various types of storage that use the same criteria
+ * page/SecurityOrigin.h:
+ (WebCore::SecurityOrigin::canAccessDatabase): Use canAccessStorage
+ (WebCore::SecurityOrigin::canAccessLocalStorage): Change to using canAccessStorage
+ (SecurityOrigin):
+
+2012-08-15 Nikhil Bhargava <nbhargava@google.com>
+
+ Improve Document.h compile time - reduce includes of ScriptCallStack.h
+ https://bugs.webkit.org/show_bug.cgi?id=94161
+
+ Reviewed by Eric Seidel.
+
+ ScriptCallStack.h no longer included from ScriptExecutionContext. It's
+ relatively expensive to compile and gets compiled a ton because
+ Document.h indirectly includes it.
+
+ No new tests. Functionality should remain the same
+
+ * Modules/indexeddb/IDBDatabase.cpp:
+ * Modules/indexeddb/IDBIndex.cpp:
+ * Modules/indexeddb/IDBObjectStore.cpp:
+ * bindings/js/ScriptController.cpp:
+ * dom/ScriptElement.cpp:
+ * dom/ScriptExecutionContext.h:
+ (WebCore):
+ * fileapi/Blob.cpp:
+ * fileapi/WebKitBlobBuilder.cpp:
+ * html/HTMLTrackElement.cpp:
+ * loader/TextTrackLoader.cpp:
+ * page/DOMSecurityPolicy.cpp:
+
+2012-08-15 Alec Flett <alecflett@chromium.org>
+
+ IndexedDB: IDB*::keyPath should return IDBKeyPath, not IDBAny
+ https://bugs.webkit.org/show_bug.cgi?id=92434
+
+ Reviewed by Tony Chang.
+
+ Clean up IDBKeyPath conversion to IDBAny objects. This gets rid of
+ some implicit conversion from IDBKeyPath to IDBAny.
+
+ No new tests, just changing method signatures.
+
+ * Modules/indexeddb/IDBAny.cpp:
+ (WebCore::IDBAny::set):
+ (WebCore):
+ * Modules/indexeddb/IDBAny.h:
+ (WebCore):
+ (WebCore::IDBAny::create):
+ (IDBAny):
+ * Modules/indexeddb/IDBIndex.h:
+ (WebCore::IDBIndex::keyPathAny):
+ (WebCore::IDBIndex::keyPath):
+ * Modules/indexeddb/IDBIndex.idl:
+ * Modules/indexeddb/IDBKeyPath.cpp:
+ * Modules/indexeddb/IDBKeyPath.h:
+ * Modules/indexeddb/IDBObjectStore.h:
+ (WebCore::IDBObjectStore::keyPathAny):
+ (WebCore::IDBObjectStore::keyPath):
+ * Modules/indexeddb/IDBObjectStore.idl:
+
+2012-08-15 Ryosuke Niwa <rniwa@webkit.org>
+
+ EFL build fix attempt after r125711. Touch an IDL file to regenerate derived sources.
+
+ * html/HTMLAllCollection.idl:
+
+2012-08-15 Alec Flett <alecflett@chromium.org>
+
+ IndexedDB: generate index keys for existing data in createIndex in front end
+ https://bugs.webkit.org/show_bug.cgi?id=91125
+
+ Reviewed by Tony Chang.
+
+ Make createIndex() do index key generation in the frontend, rather
+ than the backend. When an index is created, the frontend uses the
+ cursor API to iterate through the values in the backend to
+ generate keys, sending them back to the backend using
+ IDBObjectStore::setIndexKeys()
+
+ This confines all key injection/extraction to the frontend.
+
+ The new test verifies the implemented behavior with respect to
+ error handling in degenerate uses of put(), though that behavior
+ is still in discussion as the spec is vague on the proper error
+ behavior.
+
+ Test: storage/indexeddb/lazy-index-population.html
+
+ * Modules/indexeddb/IDBCursorBackendImpl.cpp: Make sure that the
+ TaskType propagates throught the cursor and all subsequent
+ continue() calls.
+ (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl):
+ (WebCore::IDBCursorBackendImpl::continueFunction):
+ (WebCore::IDBCursorBackendImpl::prefetchContinue):
+ * Modules/indexeddb/IDBCursorBackendImpl.h:
+ (WebCore::IDBCursorBackendImpl::create):
+ (IDBCursorBackendImpl):
+ * Modules/indexeddb/IDBObjectStore.cpp: Add an IndexPopulator
+ class to run a cursor from the frontend.
+ (WebCore):
+ (WebCore::IDBObjectStore::createIndex):
+ (WebCore::IDBObjectStore::openCursor):
+ * Modules/indexeddb/IDBObjectStore.h:
+ (WebCore::IDBObjectStore::openCursor):
+ (IDBObjectStore):
+ (WebCore::IDBObjectStore::createIndex):
+ * Modules/indexeddb/IDBObjectStore.idl: Pass along ScriptContext
+ so that openCursor can be called from createIndex.
+ * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
+ (WebCore):
+ (WebCore::makeIndexWriters):
+ (WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
+ (WebCore::IDBObjectStoreBackendImpl::setIndexesReady):
+ (WebCore::IDBObjectStoreBackendImpl::setIndexesReadyInternal):
+ (WebCore::IDBObjectStoreBackendImpl::putInternal):
+ (WebCore::IDBObjectStoreBackendImpl::deleteInternal):
+ (WebCore::IDBObjectStoreBackendImpl::createIndexInternal):
+ (WebCore::IDBObjectStoreBackendImpl::openCursor):
+ (WebCore::IDBObjectStoreBackendImpl::openCursorInternal):
+ * Modules/indexeddb/IDBObjectStoreBackendImpl.h:
+ (IDBObjectStoreBackendImpl):
+ (WebCore::IDBObjectStoreBackendImpl::iterIndexesBegin):
+ (WebCore::IDBObjectStoreBackendImpl::iterIndexesEnd):
+ (WebCore::IDBObjectStoreBackendImpl::backingStore):
+ (WebCore::IDBObjectStoreBackendImpl::databaseId):
+ * Modules/indexeddb/IDBObjectStoreBackendInterface.h:
+ * Modules/indexeddb/IDBRequest.cpp:
+ Allow requests to keep their own TaskType, to give certain
+ requests priority over others.
+ (WebCore::IDBRequest::create):
+ (WebCore):
+ (WebCore::IDBRequest::IDBRequest):
+ (WebCore::IDBRequest::abort):
+ * Modules/indexeddb/IDBRequest.h:
+ (IDBRequest):
+ (WebCore::IDBRequest::taskType):
+ * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
+ Introduce a second, higher priority event queue, m_preemptiveTaskQueue,
+ which takes priority over the regular task queue.
+ (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl):
+ (WebCore::IDBTransactionBackendImpl::scheduleTask):
+ (WebCore::IDBTransactionBackendImpl::isTaskQueueEmpty):
+ (WebCore):
+ (WebCore::IDBTransactionBackendImpl::commit):
+ (WebCore::IDBTransactionBackendImpl::taskTimerFired):
+ (WebCore::IDBTransactionBackendImpl::taskEventTimerFired):
+ * Modules/indexeddb/IDBTransactionBackendImpl.h:
+ (WebCore::IDBTransactionBackendImpl::scheduleTask):
+ (IDBTransactionBackendImpl):
+ (WebCore::IDBTransactionBackendImpl::addEarlyEvent):
+ (WebCore::IDBTransactionBackendImpl::didCompleteEarlyEvent):
+ * Modules/indexeddb/IDBVersionChangeRequest.cpp:
+ (WebCore::IDBVersionChangeRequest::IDBVersionChangeRequest):
+
+2012-08-15 Hayato Ito <hayato@chromium.org>
+
+ A 'load' event should be fired on the shadow host directly, not on an inner image element of shadow dom subtree.
+ https://bugs.webkit.org/show_bug.cgi?id=93920
+
+ Reviewed by Dimitri Glazkov.
+
+ A 'load' event is a must-stoppable event at shadow boundary. So we
+ should fire a 'load' event on a shadow host directly, not on an
+ inner image element.
+
+ Test: fast/dom/shadow/shadowdom-for-image-event.html
+
+ * html/HTMLImageLoader.cpp:
+ (WebCore::HTMLImageLoader::dispatchLoadEvent):
+ * loader/ImageLoaderClient.h:
+ (WebCore::ImageLoaderClient::eventTarget):
+
+2012-08-15 Otto Derek Cheung <otcheung@rim.com>
+
+ [BlackBerry] Show custom error page when 407 is received
+ https://bugs.webkit.org/show_bug.cgi?id=94138
+
+ Reviewed by George Staikos.
+ Internally reviewed by Lianghui Chen
+
+ Adding a new custom error page when the browser receieves
+ a Wifi proxy authentication error. The previous behaviour
+ is to ask for user credentials everytime, and silently fails
+ when the username and password fields in the Wifi settings
+ are not empty. UX suggests modifying the behaviour to simply
+ asks the user to change their credentials in the Wifi settings
+ when we receive such an error.
+
+ The fix is to prevent notifyAuthReceived from sending another
+ networkjob when authCallbacks are called, and to listen to any 407
+ calls in notifyStatusReceived. Once we hit a 407, tell the frame we
+ failed and should load the custom error page.
+
+ Also removed checking functions in sendRequestWithCredentials because
+ proxy auth requests won't get into that function anymore.
+
+ #PR163400
+
+ Tested by loading on device and loading/reloading pages under
+ these scenarios:
+ - Connected to wifi (no proxy)
+ - Connected to wifi (proxy with no credentials)
+ - Connected to wifi (proxy with invalid credentials)
+ - Connected to wifi (proxy with valid credentials)
+
+ * platform/network/blackberry/NetworkJob.cpp:
+ (WebCore::NetworkJob::handleNotifyStatusReceived):
+ (WebCore::NetworkJob::notifyAuthReceived):
+ (WebCore::NetworkJob::sendRequestWithCredentials):
+
+2012-08-15 Dan Carney <dcarney@google.com>
+
+ Refactor away IsolatedWorld
+ https://bugs.webkit.org/show_bug.cgi?id=93971
+
+ Reviewed by Adam Barth.
+
+ Remove IsolatedWorld class as it was 1:1 with DOMWrapperWorld.
+ This paves the way towards a JSC-like use of DOMWrapperWorld.
+
+ No tests. No change in functionality.
+
+ * UseV8.cmake:
+ * WebCore.gypi:
+ * bindings/v8/DOMWrapperWorld.cpp:
+ (WebCore):
+ (WebCore::mainThreadNormalWorld):
+ * bindings/v8/DOMWrapperWorld.h:
+ (WebCore):
+ (DOMWrapperWorld):
+ (WebCore::DOMWrapperWorld::create):
+ (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
+ (WebCore::DOMWrapperWorld::count):
+ (WebCore::DOMWrapperWorld::worldId):
+ (WebCore::DOMWrapperWorld::domDataStore):
+ (WebCore::DOMWrapperWorld::DOMWrapperWorld):
+ * bindings/v8/IsolatedWorld.cpp: Removed.
+ * bindings/v8/IsolatedWorld.h: Removed.
+ * bindings/v8/V8DOMWrapper.h:
+ (WebCore::V8DOMWrapper::getCachedWrapper):
+ * bindings/v8/V8IsolatedContext.cpp:
+ (WebCore::V8IsolatedContext::V8IsolatedContext):
+ (WebCore::V8IsolatedContext::destroy):
+ * bindings/v8/V8IsolatedContext.h:
+ (WebCore::V8IsolatedContext::getEntered):
+ (WebCore::V8IsolatedContext::world):
+ (V8IsolatedContext):
+
+2012-08-15 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com>
+
+ [css3-text] Add CSS3 Text decoration compile flag
+ https://bugs.webkit.org/show_bug.cgi?id=93863
+
+ Reviewed by Julien Chaffraix.
+
+ This patch handles the compile flag implementation, which will come disabled by
+ default, thus not exposing the CSS3 text decoration features to the web, unless
+ when explicitly enabling it with "--css3-text-decoration" build parameter.
+
+ Changeset r125205 added "-webkit-text-decoration-line" support without proper
+ compile flag. I am fixing this on this patch by adding #ifdef's along the added
+ code and reverting getComputedStyle* layout test changes until further notice.
+ The text-decoration-line.html layout test is now moved to
+ fast/css3-text-decoration directory, which is skipped on all platforms until
+ feature is sound and ready to be exposed to web.
+
+ Test: fast/css3-text-decoration/text-decoration-line.html
+
+ * Configurations/FeatureDefines.xcconfig:
+ * GNUmakefile.am:
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ (WebCore::CSSParser::addTextDecorationProperty):
+ (WebCore::CSSParser::parseTextDecoration):
+ * css/CSSProperty.cpp:
+ (WebCore::CSSProperty::isInheritedProperty):
+ * css/CSSPropertyNames.in:
+ * css/StyleBuilder.cpp:
+ (WebCore::StyleBuilder::StyleBuilder):
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::collectMatchingRulesForList):
+ Added #ifdefs to enable/disable CSS3 Text Decoration code implemented by r125205.
+
+2012-08-15 Iain Merrick <husky@chromium.org>
+
+ Refactoring: move EventHandler::targetNode into HitTestResult
+ https://bugs.webkit.org/show_bug.cgi?id=94107
+
+ Reviewed by Dimitri Glazkov.
+
+ This static helper method in EventHandler was made public so that
+ WebFrameImpl can call it. That's untidy because EventHandler isn't
+ really involved. This patch turns it into an instance method of
+ HitTestResult (with a wrapper in MouseEventWithHitTestResult for
+ convenience).
+
+ Pure refactoring, no behavior change, no new test needed.
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::selectClosestWordFromMouseEvent):
+ (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent):
+ (WebCore::EventHandler::handleMousePressEventTripleClick):
+ (WebCore::EventHandler::handleMousePressEventSingleClick):
+ (WebCore::EventHandler::handleMousePressEvent):
+ (WebCore::EventHandler::handleMouseDraggedEvent):
+ (WebCore::EventHandler::updateSelectionForMouseDrag):
+ (WebCore::EventHandler::handleMouseReleaseEvent):
+ (WebCore::EventHandler::subframeForHitTestResult):
+ (WebCore::EventHandler::selectCursor):
+ (WebCore::EventHandler::handleMouseDoubleClickEvent):
+ (WebCore::EventHandler::handleMouseMoveEvent):
+ (WebCore::EventHandler::updateDragAndDrop):
+ (WebCore::EventHandler::handleGestureEvent):
+ (WebCore::EventHandler::sendContextMenuEvent):
+ * page/EventHandler.h:
+ (EventHandler):
+ * page/MouseEventWithHitTestResults.h:
+ (WebCore::MouseEventWithHitTestResults::targetNode):
+ * page/chromium/EventHandlerChromium.cpp:
+ (WebCore::EventHandler::passMousePressEventToSubframe):
+ (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
+ * page/efl/EventHandlerEfl.cpp:
+ (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
+ * page/gtk/EventHandlerGtk.cpp:
+ (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
+ * page/mac/EventHandlerMac.mm:
+ (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
+ (WebCore::EventHandler::passSubframeEventToSubframe):
+ * page/wx/EventHandlerWx.cpp:
+ (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
+ * rendering/HitTestResult.cpp:
+ (WebCore::HitTestResult::targetNode):
+ (WebCore):
+ * rendering/HitTestResult.h:
+ (HitTestResult):
+
+2012-08-15 David Grogan <dgrogan@chromium.org>
+
+ IndexedDB: Add some ASSERTs
+ https://bugs.webkit.org/show_bug.cgi?id=94055
+
+ Reviewed by Ojan Vafai.
+
+ These are just some additional ASSERTS and some ASSERT_WITH_MESSAGE in
+ place of ASSERT. They are from the patch in
+ https://bugs.webkit.org/show_bug.cgi?id=92897
+
+ No new tests - we should never hit this behavior.
+
+ * Modules/indexeddb/IDBDatabase.cpp:
+ (WebCore::IDBDatabase::setVersion):
+ (WebCore::IDBDatabase::registerFrontendCallbacks):
+ * Modules/indexeddb/IDBRequest.cpp:
+ (WebCore::IDBRequest::dispatchEvent):
+ (WebCore::IDBRequest::enqueueEvent):
+ * Modules/indexeddb/IDBTransaction.cpp:
+ (WebCore::IDBTransaction::setActive):
+
+2012-08-15 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125687.
+ http://trac.webkit.org/changeset/125687
+ https://bugs.webkit.org/show_bug.cgi?id=94147
+
+ It broke the whole world (Requested by Ossy_night on #webkit).
+
+ * bindings/js/JSCustomSQLStatementErrorCallback.cpp:
+ (WebCore::JSSQLStatementErrorCallback::handleEvent):
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::JSDOMWindow::addEventListener):
+ (WebCore::JSDOMWindow::removeEventListener):
+ * bindings/js/JSDataViewCustom.cpp:
+ (WebCore::getDataViewMember):
+ * bindings/js/JSDeviceMotionEventCustom.cpp:
+ (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
+ * bindings/js/JSDeviceOrientationEventCustom.cpp:
+ (WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
+ * bindings/js/JSDictionary.cpp:
+ (WebCore::JSDictionary::convertValue):
+ * bindings/js/JSDirectoryEntryCustom.cpp:
+ (WebCore::JSDirectoryEntry::getFile):
+ (WebCore::JSDirectoryEntry::getDirectory):
+ * bindings/js/JSDirectoryEntrySyncCustom.cpp:
+ (WebCore::getFlags):
+ * bindings/js/JSHTMLCanvasElementCustom.cpp:
+ (WebCore::JSHTMLCanvasElement::getContext):
+ * bindings/js/JSInspectorFrontendHostCustom.cpp:
+ (WebCore::populateContextMenuItems):
+ * bindings/js/JSMessageEventCustom.cpp:
+ (WebCore::handleInitMessageEvent):
+ * bindings/js/JSWebGLRenderingContextCustom.cpp:
+ (WebCore::dataFunctionMatrix):
+ * bindings/js/JSXMLHttpRequestCustom.cpp:
+ (WebCore::JSXMLHttpRequest::open):
+ * bindings/js/JavaScriptCallFrame.cpp:
+ * bindings/js/JavaScriptCallFrame.h:
+ (JavaScriptCallFrame):
+ * bindings/js/ScriptDebugServer.cpp:
+ (WebCore::ScriptDebugServer::hasBreakpoint):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateEventListenerCall):
+ (GenerateHeader):
+ (JSValueToNative):
+ * bindings/scripts/test/JS/JSTestEventTarget.cpp:
+ (WebCore::jsTestEventTargetPrototypeFunctionAddEventListener):
+ (WebCore::jsTestEventTargetPrototypeFunctionRemoveEventListener):
+ * bindings/scripts/test/JS/JSTestEventTarget.h:
+ (WebCore::JSTestEventTarget::create):
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::setJSTestObjCreate):
+ (WebCore::setJSTestObjReflectedBooleanAttr):
+ (WebCore::setJSTestObjReflectedCustomBooleanAttr):
+ (WebCore::jsTestObjPrototypeFunctionAddEventListener):
+ (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
+ * bridge/c/c_utility.cpp:
+ (JSC::Bindings::convertValueToNPVariant):
+ * bridge/jni/jni_jsobject.mm:
+ (JavaJSObject::convertValueToJObject):
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::convertValueToQVariant):
+
+2012-08-15 Dominic Mazzoni <dmazzoni@google.com>
+
+ AX: Calls to AXObjectCache should prefer Node over Renderer
+ https://bugs.webkit.org/show_bug.cgi?id=91794
+
+ Reviewed by Chris Fleizach.
+
+ Now that it's possible for nodes inside a canvas subtree to be focused and
+ represent accessible content, accessibility notifications should be triggered
+ with a Node* rather than with a RenderObject* whenever possible.
+
+ Every public API in AXObjectCache that took a RenderObject* before now either
+ takes a Node* instead, or has a parallel method that takes a Node*.
+
+ Tests: accessibility/accessibility-node-memory-management.html
+ accessibility/accessibility-node-reparent.html
+ accessibility/canvas-fallback-content.html
+
+ * accessibility/AXObjectCache.cpp:
+ (WebCore::AXObjectCache::focusedImageMapUIElement):
+ (WebCore::AXObjectCache::focusedUIElementForPage):
+ (WebCore::AXObjectCache::get):
+ (WebCore::AXObjectCache::getOrCreate):
+ (WebCore::AXObjectCache::contentChanged):
+ (WebCore):
+ (WebCore::AXObjectCache::updateCacheAfterNodeIsAttached):
+ (WebCore::AXObjectCache::childrenChanged):
+ (WebCore::AXObjectCache::postNotification):
+ (WebCore::AXObjectCache::checkedStateChanged):
+ (WebCore::AXObjectCache::selectedChildrenChanged):
+ (WebCore::AXObjectCache::nodeTextChangeNotification):
+ (WebCore::AXObjectCache::handleAriaExpandedChange):
+ (WebCore::AXObjectCache::handleActiveDescendantChanged):
+ (WebCore::AXObjectCache::handleAriaRoleChanged):
+ (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
+ (WebCore::AXObjectCache::rootAXEditableElement):
+ (WebCore::AXObjectCache::nodeIsTextControl):
+ * accessibility/AXObjectCache.h:
+ (AXObjectCache):
+ (WebCore::AXObjectCache::setNodeInUse):
+ (WebCore::AXObjectCache::removeNodeForUse):
+ (WebCore::AXObjectCache::isNodeInUse):
+ (WebCore::AXObjectCache::checkedStateChanged):
+ (WebCore::AXObjectCache::childrenChanged):
+ (WebCore::AXObjectCache::contentChanged):
+ (WebCore::AXObjectCache::updateCacheAfterNodeIsAttached):
+ (WebCore::AXObjectCache::handleActiveDescendantChanged):
+ (WebCore::AXObjectCache::handleAriaExpandedChange):
+ (WebCore::AXObjectCache::handleAriaRoleChanged):
+ (WebCore::AXObjectCache::handleFocusedUIElementChanged):
+ (WebCore::AXObjectCache::nodeTextChangeNotification):
+ (WebCore::AXObjectCache::postNotification):
+ (WebCore::AXObjectCache::selectedChildrenChanged):
+ * accessibility/AccessibilityListBoxOption.cpp:
+ (WebCore::AccessibilityListBoxOption::parentObject):
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::appendAccessibilityObject):
+ (WebCore::replacedNodeNeedsCharacter):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::menuForMenuButton):
+ (WebCore::AccessibilityRenderObject::menuButtonForMenu):
+ (WebCore::AccessibilityRenderObject::checkboxOrRadioRect):
+ (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers):
+ (WebCore::AccessibilityRenderObject::titleUIElement):
+ (WebCore::AccessibilityRenderObject::isTabItemSelected):
+ (WebCore::AccessibilityRenderObject::accessibilityParentForImageMap):
+ (WebCore::AccessibilityRenderObject::nodeIsTextControl):
+ (WebCore::AccessibilityRenderObject::activeDescendant):
+ (WebCore::AccessibilityRenderObject::correspondingControlForLabelElement):
+ (WebCore::AccessibilityRenderObject::correspondingLabelForControlElement):
+ * accessibility/AccessibilityRenderObject.h:
+ (AccessibilityRenderObject):
+ * accessibility/AccessibilityScrollView.cpp:
+ (WebCore::AccessibilityScrollView::webAreaObject):
+ (WebCore::AccessibilityScrollView::parentObject):
+ (WebCore::AccessibilityScrollView::parentObjectIfExists):
+ * accessibility/chromium/AXObjectCacheChromium.cpp:
+ (WebCore::AXObjectCache::postPlatformNotification):
+ (WebCore::AXObjectCache::handleFocusedUIElementChanged):
+ * accessibility/gtk/AXObjectCacheAtk.cpp:
+ (WebCore::AXObjectCache::handleFocusedUIElementChanged):
+ * accessibility/mac/AXObjectCacheMac.mm:
+ (WebCore::AXObjectCache::handleFocusedUIElementChanged):
+ * accessibility/win/AXObjectCacheWin.cpp:
+ (WebCore::AXObjectCache::handleFocusedUIElementChanged):
+ * bindings/cpp/WebDOMCustomVoidCallback.cpp:
+ (toWebCore):
+ * dom/Document.cpp:
+ (WebCore::Document::setFocusedNode):
+ * dom/Element.cpp:
+ (WebCore::Element::attributeChanged):
+ * dom/Node.cpp:
+ (WebCore::Node::~Node):
+ (WebCore::Node::attach):
+ * editing/AppendNodeCommand.cpp:
+ (WebCore::sendAXTextChangedIgnoringLineBreaks):
+ * editing/DeleteFromTextNodeCommand.cpp:
+ (WebCore::DeleteFromTextNodeCommand::doApply):
+ (WebCore::DeleteFromTextNodeCommand::doUnapply):
+ * editing/Editor.cpp:
+ (WebCore::Editor::respondToChangedContents):
+ (WebCore::Editor::markAndReplaceFor):
+ * editing/InsertIntoTextNodeCommand.cpp:
+ (WebCore::InsertIntoTextNodeCommand::doApply):
+ (WebCore::InsertIntoTextNodeCommand::doUnapply):
+ * editing/InsertNodeBeforeCommand.cpp:
+ (WebCore::InsertNodeBeforeCommand::doApply):
+ (WebCore::InsertNodeBeforeCommand::doUnapply):
+ * editing/chromium/FrameSelectionChromium.cpp:
+ (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::setChecked):
+ * html/HTMLSelectElement.cpp:
+ (WebCore::HTMLSelectElement::childrenChanged):
+ (WebCore::HTMLSelectElement::optionElementChildrenChanged):
+ * html/HTMLTextFormControlElement.cpp:
+ (WebCore::HTMLTextFormControlElement::setInnerTextValue):
+ * html/InputType.cpp:
+ (WebCore::InputType::applyStep):
+ * html/RangeInputType.cpp:
+ (WebCore::RangeInputType::handleKeydownEvent):
+ * page/FocusController.cpp:
+ (WebCore::FocusController::setInitialFocus):
+
+2012-08-15 Andreas Kling <kling@webkit.org>
+
+ NinePieceImage: Avoid unnecessary duplication of default data in assignment operator.
+ <http://webkit.org/b/94046>
+
+ Reviewed by Geoffrey Garen.
+
+ If copying a NinePieceImage with a null m_data, don't create a copy of it's data()
+ as that will point to the default NinePieceImageData. ~200kB progression on Membuster.
+
+ * rendering/style/NinePieceImage.h:
+ (WebCore::NinePieceImage::operator=):
+
+2012-08-15 Gregg Tavares <gman@google.com>
+
+ Mark Skia and Compositor Contexts
+ https://bugs.webkit.org/show_bug.cgi?id=94129
+
+ Reviewed by James Robinson.
+
+ Marks the Skia and Compositor contexts to aid in debugging.
+
+ No new tests as no new functionality.
+
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+ (WebCore::CCLayerTreeHostImpl::initializeLayerRenderer):
+ * platform/graphics/skia/ImageBufferSkia.cpp:
+ (WebCore::createAcceleratedCanvas):
+
+2012-08-15 Ian Vollick <vollick@chromium.org>
+
+ [chromium] Must account for empty transformation lists when checking for big rotations.
+ https://bugs.webkit.org/show_bug.cgi?id=93975
+
+ Reviewed by James Robinson.
+
+ AnimationTranslationUtil.cpp is supposed to reject large rotations
+ (>= 180 degrees between keyframes). The current code assumes that if
+ the lists of transforms at two consecutive keyframes do not match
+ (i.e., are different types), then do not need to reject. The rationale
+ is that we will revert to matrix blending -- we will collapse the lists
+ of transform operations to matrices at each keyframe and blend those.
+ Unfortunately, this is not true if a list is empty. It can be the case
+ that we transition from no transform to a rotation about the z axis of
+ 360 degrees. In this case, the first list of transform operations will
+ be empty and the second will have a single rotation of 360 degrees. An
+ empty list should be treated as a rotation of zero degrees.
+
+ Unit tested in: GraphicsLayerChromiumTest.createTransformAnimationWithBigRotationAndEmptyTransformOperationList
+
+ * platform/graphics/chromium/AnimationTranslationUtil.cpp:
+ (WebCore::causesRotationOfAtLeast180Degrees):
+
+2012-08-15 Beth Dakin <bdakin@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=93693
+ [WK2] REGRESSION(125091): pixel results don't sow scrollbars
+ anymore
+
+ Reviewed by Sam Weinig.
+
+ This is a regression from http://trac.webkit.org/changeset/125091
+ in which I failed to noticed that
+ WKBundlePageCreateSnapshotInViewCoordinates() did actually do
+ something different than
+ WKBundlePageCreateSnapshotInDocumentCoordinates(). Specifically,
+ it used ScrollView::paint() to paint instead of
+ FrameView::paintContents(). So this patch restores that
+ functionality by adding a value to SnapshotOptions indicating
+ whether the snapshot should be taken in ViewCoordinates
+ (otherwise it defaults to DocumentCoordinates).
+
+ FrameView:: paintContentsForSnapshot() now takes a new parameter
+ that indicates whether to take the snapshot in document
+ coordinates or view coordinates.
+ * WebCore.exp.in:
+ * page/FrameView.cpp:
+ (WebCore::FrameView::paintContentsForSnapshot):
+ * page/FrameView.h:
+
+2012-08-15 Benjamin Poulain <bpoulain@apple.com>
+
+ Use literal initialization for CSS's pseudo types
+ https://bugs.webkit.org/show_bug.cgi?id=94066
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Initialize CSS pseudo type strings with the new initialization from literal.
+
+ The first invocation of nameToPseudoTypeMap() becomes 20% faster and we use
+ less memory to store the strings.
+
+ * css/CSSSelector.cpp:
+ (WebCore::nameToPseudoTypeMap):
+
+2012-08-15 Brady Eidson <beidson@apple.com>
+
+ Removing a plug-in element from a page opened in a background tab in Safari crashes
+ <rdar://problem/12057991> and https://bugs.webkit.org/show_bug.cgi?id=93913
+
+ Reviewed by Beth Dakin.
+
+ Expose Page::setCanStartMedia to regression tests so they can pretend to be in a non-windowed WebView.
+
+ Test: platform/mac-wk2/plugins/asynchronous-destroy-before-initialization.html
+
+ * testing/InternalSettings.cpp:
+ (WebCore::InternalSettings::Backup::Backup):
+ (WebCore::InternalSettings::Backup::restoreTo):
+ (WebCore::InternalSettings::setCanStartMedia):
+ (WebCore):
+ * testing/InternalSettings.h:
+ (Backup):
+ (InternalSettings):
+ * testing/InternalSettings.idl:
+
+2012-08-15 Levi Weintraub <leviw@chromium.org>
+
+ AutoTableLayout truncates preferred widths for cells when it needs to ceil them to contain the contents
+ https://bugs.webkit.org/show_bug.cgi?id=93911
+
+ Reviewed by Eric Seidel.
+
+ Avoiding truncation of sub-pixel accumulated values when determining the preferred width of a table cell
+ in AutoTableLayout. Since we continue to layout tables using integers, we need to ceil the contents to
+ prevent premature wrapping of the contents.
+
+ This only affects ports with sub-pixel layout enabled, and fixes regressions of a handful of tests that
+ were missed when updating expectations when sub-pixel was enabled.
+
+ Test: fast/sub-pixel/auto-table-layout-should-avoid-text-wrapping.html
+
+ * rendering/AutoTableLayout.cpp:
+ (WebCore::AutoTableLayout::recalcColumn):
+
+2012-08-10 Ojan Vafai <ojan@chromium.org>
+
+ z-index should work without position on flexitems
+ https://bugs.webkit.org/show_bug.cgi?id=91405
+
+ Reviewed by Tony Chang.
+
+ Require a layer on any RenderBox that has a non-auto z-index.
+ Statically positioned, non-flex-item's have their z-index coerced to auto,
+ so it's safe to check z-index unconditionally.
+
+ Test: css3/flexbox/z-index.html
+
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::adjustRenderStyle):
+ -Don't coerce z-index to auto on statically positioned flex-items.
+ -Use the parentStyle to determine if the parent is a flexbox instead of
+ looking at the element's parentNode's renderer.
+ * rendering/RenderBox.h:
+ -Add having a non-auto z-index to the list of things that require a layer.
+
+2012-08-15 Joanmarie Diggs <jdiggs@igalia.com>
+
+ [Gtk] atk_text_set_caret_offset() fails for table cells
+ https://bugs.webkit.org/show_bug.cgi?id=83501
+
+ Reviewed by Chris Fleizach.
+
+ Allow using text ranges in accessible table cells.
+
+ * accessibility/gtk/AccessibilityObjectAtk.cpp:
+ (WebCore::AccessibilityObject::allowsTextRanges):
+ Add table cells to the list of accessibility objects supporting text ranges.
+
+2012-08-15 Scott Graham <scottmg@chromium.org>
+
+ Rename window.internals.fastMallocStatistics to mallocStatistics
+ https://bugs.webkit.org/show_bug.cgi?id=94033
+
+ Reviewed by Adam Barth.
+
+ Mechanical rename. In preparation for plumbing allocation information
+ from allocators that aren't "fastMalloc".
+
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * DerivedSources.pri:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCoreTestSupport.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * loader/DocumentLoader.h:
+ (WebCore::DocumentLoader::didTellClientAboutLoad):
+ * loader/cache/CachedResourceLoader.cpp:
+ (WebCore::CachedResourceLoader::loadResource):
+ * testing/FastMallocStatistics.h: Removed.
+ * testing/FastMallocStatistics.idl: Removed.
+ * testing/Internals.cpp:
+ (WebCore::Internals::mallocStatistics):
+ * testing/Internals.h:
+ (WebCore):
+ (Internals):
+ * testing/Internals.idl:
+ * testing/MallocStatistics.h: Added.
+ * testing/MallocStatistics.idl: Added.
+
+2012-08-15 Joshua Netterfield <jnetterfield@rim.com>
+
+ [BlackBerry] Upstream BlackBerry build fixes
+ https://bugs.webkit.org/show_bug.cgi?id=94121
+
+ Reviewed by Rob Buis.
+
+ This includes several build fixes due to incorrect upstream patches.
+ These mistakes were never present downstream.
+
+ No new tests, because no new functionality is added.
+
+ * platform/graphics/GraphicsContext3D.cpp:
+ (WebCore::GraphicsContext3D::computeFormatAndTypeParameters):
+ * platform/graphics/GraphicsContext3D.h:
+ (GraphicsContext3D):
+ (WebCore::GraphicsContext3D::ShaderSourceEntry::ShaderSourceEntry):
+ * platform/graphics/blackberry/LayerFilterRenderer.cpp:
+ (WebCore::LayerFilterRendererAction::LayerFilterRendererAction):
+ * platform/graphics/blackberry/LayerFilterRenderer.h:
+ (LayerFilterRendererAction):
+
+2012-08-15 Adam Barth <abarth@webkit.org>
+
+ JSDOMWrapper should ASSERT that it has an associated ScriptExecutionContext
+ https://bugs.webkit.org/show_bug.cgi?id=94053
+
+ Reviewed by Sam Weinig.
+
+ Previously we were unable have this ASSERT because DOMWindow needed a
+ Frame to find Document. Now that we can find the Document without a
+ Frame, we can include the ASSERT and sanity will rein across the land.
+
+ * bindings/js/JSDOMWrapper.h:
+ (WebCore::JSDOMWrapper::globalObject):
+ (WebCore::JSDOMWrapper::scriptExecutionContext):
+ (WebCore::JSDOMWrapper::JSDOMWrapper):
+
+2012-08-14 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ Change behavior of MasqueradesAsUndefined to better accommodate DFG changes
+ https://bugs.webkit.org/show_bug.cgi?id=93884
+
+ Reviewed by Geoffrey Garen.
+
+ With some upcoming changes to the DFG to remove uses of ClassInfo, we will be changing the behavior of
+ MasqueradesAsUndefined. In order to make this change consistent across all of our execution engines,
+ we will make this change to MasqueradesAsUndefined as a separate patch. After this patch, MasqueradesAsUndefined
+ objects will only masquerade as undefined in their original context (i.e. their original JSGlobalObject).
+ For example, if an object that masquerades as undefined in frame A is passed to frame B, it will not
+ masquerade as undefined within frame B, but it will continue to masquerade in frame A.
+
+ Test: fast/js/document-all-between-frames.html
+
+ All of the changes in WebCore are simply passing the additional ExecState argument to JSValue::toBoolean.
+
+ * bindings/js/JSCustomSQLStatementErrorCallback.cpp:
+ (WebCore::JSSQLStatementErrorCallback::handleEvent):
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::JSDOMWindow::addEventListener):
+ (WebCore::JSDOMWindow::removeEventListener):
+ * bindings/js/JSDataViewCustom.cpp:
+ (WebCore::getDataViewMember):
+ * bindings/js/JSDeviceMotionEventCustom.cpp:
+ (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
+ * bindings/js/JSDeviceOrientationEventCustom.cpp:
+ (WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
+ * bindings/js/JSDictionary.cpp:
+ (WebCore::JSDictionary::convertValue):
+ * bindings/js/JSDirectoryEntryCustom.cpp:
+ (WebCore::JSDirectoryEntry::getFile):
+ (WebCore::JSDirectoryEntry::getDirectory):
+ * bindings/js/JSDirectoryEntrySyncCustom.cpp:
+ (WebCore::getFlags):
+ * bindings/js/JSHTMLCanvasElementCustom.cpp:
+ (WebCore::JSHTMLCanvasElement::getContext):
+ * bindings/js/JSInspectorFrontendHostCustom.cpp:
+ (WebCore::populateContextMenuItems):
+ * bindings/js/JSMessageEventCustom.cpp:
+ (WebCore::handleInitMessageEvent):
+ * bindings/js/JSWebGLRenderingContextCustom.cpp:
+ (WebCore::dataFunctionMatrix):
+ * bindings/js/JSXMLHttpRequestCustom.cpp:
+ (WebCore::JSXMLHttpRequest::open):
+ * bindings/js/JavaScriptCallFrame.cpp:
+ (WebCore::JavaScriptCallFrame::exec):
+ (WebCore):
+ * bindings/js/JavaScriptCallFrame.h:
+ (JavaScriptCallFrame):
+ * bindings/js/ScriptDebugServer.cpp:
+ (WebCore::ScriptDebugServer::hasBreakpoint):
+ * bindings/scripts/CodeGeneratorJS.pm: Also add the custom create function for MasqueradesAsUndefined JS DOM wrappers.
+ (GenerateEventListenerCall):
+ (GenerateHeader):
+ (JSValueToNative):
+ * bindings/scripts/test/JS/JSTestEventTarget.cpp:
+ (WebCore::jsTestEventTargetPrototypeFunctionAddEventListener):
+ (WebCore::jsTestEventTargetPrototypeFunctionRemoveEventListener):
+ * bindings/scripts/test/JS/JSTestEventTarget.h:
+ (WebCore::JSTestEventTarget::create):
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::setJSTestObjCreate):
+ (WebCore::setJSTestObjReflectedBooleanAttr):
+ (WebCore::setJSTestObjReflectedCustomBooleanAttr):
+ (WebCore::jsTestObjPrototypeFunctionAddEventListener):
+ (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
+ * bridge/c/c_utility.cpp:
+ (JSC::Bindings::convertValueToNPVariant):
+ * bridge/jni/jni_jsobject.mm:
+ (JavaJSObject::convertValueToJObject):
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::convertValueToQVariant):
+
+2012-08-15 Joanmarie Diggs <jdiggs@igalia.com>
+
+ [Gtk] atk_text_get_text_at_offset() fails to provide the correct line for paragraphs in list items whose text wraps
+ https://bugs.webkit.org/show_bug.cgi?id=83435
+
+ Reviewed by Chris Fleizach.
+
+ Fix a logic error when checking if an object is a list marker.
+
+ * accessibility/gtk/WebKitAccessibleInterfaceText.cpp:
+ (textForRenderer):
+
+2012-08-15 Arpita Bahuguna <arpitabahuguna@gmail.com>
+
+ There is additional space not belonged to a table between the table cells
+ https://bugs.webkit.org/show_bug.cgi?id=74864
+
+ Reviewed by Julien Chaffraix.
+
+ Hittest for a point on the edge, i.e. between two table columns, currently
+ does not return any matching underlying element.
+
+ A hittest on such a point (on the edge of two table columns) should return
+ the column that lies either on the logical right/bottom of the said point.
+
+ Tests: fast/table/hittest-tablecell-bottom-edge.html
+ fast/table/hittest-tablecell-right-edge.html
+ fast/table/hittest-tablecell-with-borders-bottom-edge.html
+ fast/table/hittest-tablecell-with-borders-right-edge.html
+
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::spannedRows):
+ Removed the FIXME regarding the correctness of the usage of the upper_bound algorithm
+ since that is now verified by the testcases in this patch. Also, the comment
+ regarding the inconsistency between the algorithms used in spannedRows and spannedColumns
+ is no longer valid.
+
+ (WebCore::RenderTableSection::spannedColumns):
+ Changed lower_bound() algorithm to upper_bound() for obtaining the next column.
+ This is now similar to what is used for obtaining the next row in spannedRows().
+
+2012-08-15 Anna Cavender <annacc@chromium.org>
+
+ Add the timestampOffset attribute to SourceBuffer.
+ https://bugs.webkit.org/show_bug.cgi?id=93303
+
+ Reviewed by Dimitri Glazkov.
+
+ On the 30 July 2012 version of the Media Source Extensions spec, a timestampOffset
+ attribute was added to the SourceBuffer object:
+ http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#dom-timestampoffset
+
+ Tests: additions to http/tests/media/media-source/video-media-source-objects.html
+
+ * Modules/mediasource/MediaSource.cpp:
+ (WebCore::MediaSource::setTimestampOffset): Set the timestampOffset on MediaPlayer.
+ (WebCore):
+ * Modules/mediasource/MediaSource.h:
+ (MediaSource):
+ * Modules/mediasource/SourceBuffer.cpp:
+ (WebCore::SourceBuffer::SourceBuffer): Let the timestampOffset be 0 initially
+ (WebCore::SourceBuffer::timestampOffset): Return the last value set.
+ (WebCore):
+ (WebCore::SourceBuffer::setTimestampOffset): Forward the call onto MediaSouce.
+ * Modules/mediasource/SourceBuffer.h:
+ (SourceBuffer):
+ * Modules/mediasource/SourceBuffer.idl: Create the new timestampOffset attr.
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::NullMediaPlayerPrivate::sourceSetTimestampOffset): A null media player
+ should just return false (nothing to set).
+ (WebCore):
+ (WebCore::MediaPlayer::sourceSetTimestampOffset): Forward the call.
+ * platform/graphics/MediaPlayer.h:
+ * platform/graphics/MediaPlayerPrivate.h:
+ (WebCore::MediaPlayerPrivateInterface::sourceSetTimestampOffset):
+
+2012-08-15 Pavel Chadnov <chadnov@google.com>
+
+ Web Inspector: Incorrect XHR responses when two async xhrs are sent synchronously
+ https://bugs.webkit.org/show_bug.cgi?id=91630
+
+ Reviewed by Vsevolod Vlasov.
+
+ CachedResource object for XHR response is now taken from ResourceLoader (if it's possible).
+
+ Test: http/tests/inspector/network/network-xhr-async-double.html
+
+ * inspector/InspectorInstrumentation.cpp:
+ (WebCore):
+ (WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl):
+ (WebCore::InspectorInstrumentation::didReceiveResourceResponseButCanceledImpl):
+ * inspector/InspectorInstrumentation.h:
+ (InspectorInstrumentation):
+ (WebCore::InspectorInstrumentation::didReceiveResourceResponse):
+ * inspector/InspectorResourceAgent.cpp:
+ (WebCore::InspectorResourceAgent::willSendRequest):
+ (WebCore::InspectorResourceAgent::didReceiveResponse):
+ * inspector/InspectorResourceAgent.h:
+ (WebCore):
+ (InspectorResourceAgent):
+ * loader/DocumentThreadableLoader.cpp:
+ (WebCore::DocumentThreadableLoader::didReceiveResponse):
+ * loader/ResourceLoadNotifier.cpp:
+ (WebCore::ResourceLoadNotifier::didReceiveResponse):
+ (WebCore::ResourceLoadNotifier::dispatchDidReceiveResponse):
+ * loader/ResourceLoadNotifier.h:
+ (ResourceLoadNotifier):
+ * loader/ResourceLoader.cpp:
+ (WebCore::ResourceLoader::isSubresourceLoader):
+ (WebCore):
+ * loader/ResourceLoader.h:
+ (ResourceLoader):
+ * loader/SubresourceLoader.cpp:
+ (WebCore::SubresourceLoader::cachedResource):
+ (WebCore):
+ (WebCore::SubresourceLoader::isSubresourceLoader):
+ * loader/SubresourceLoader.h:
+ (SubresourceLoader):
+ * loader/appcache/ApplicationCacheGroup.cpp:
+ (WebCore::ApplicationCacheGroup::didReceiveResponse):
+
+2012-08-15 Taiju Tsuiki <tzik@chromium.org>
+
+ Web Inspector: Use default parameter on reportResult in InspectorFileSystemAgent
+ https://bugs.webkit.org/show_bug.cgi?id=93930
+
+ Reviewed by Vsevolod Vlasov.
+
+ No functional change.
+
+ * inspector/InspectorFileSystemAgent.cpp:
+ (WebCore):
+
+2012-08-15 Vsevolod Vlasov <vsevik@chromium.org>
+
+ Web Inspector: TabbedEditorContainer Doens't show '*' near modified file name sometimes.
+ https://bugs.webkit.org/show_bug.cgi?id=94095
+
+ Reviewed by Pavel Feldman.
+
+ TabbedEditorContainer now correctly updates event listeners on UISourceCodeReplaced event.
+
+ * inspector/front-end/TabbedEditorContainer.js:
+ (WebInspector.TabbedEditorContainer.prototype._appendFileTab):
+ (WebInspector.TabbedEditorContainer.prototype._tabClosed):
+ (WebInspector.TabbedEditorContainer.prototype._addUISourceCodeListeners):
+ (WebInspector.TabbedEditorContainer.prototype._removeUISourceCodeListeners):
+
+2012-08-15 Vsevolod Vlasov <vsevik@chromium.org>
+
+ Web Inspector: Scroll/selection are not saved in sources panel editors sometimes.
+ https://bugs.webkit.org/show_bug.cgi?id=94098
+
+ Reviewed by Pavel Feldman.
+
+ SourceFrame listeners and _currentFile field are now cleared only when currently open tab is closed.
+
+ * inspector/front-end/TabbedEditorContainer.js:
+ (WebInspector.TabbedEditorContainer.prototype._tabClosed):
+
+2012-08-15 Vsevolod Vlasov <vsevik@chromium.org>
+
+ Web Inspector: [REGRESSION] "save as" of edited source in developer mode fails to update saved file
+ https://bugs.webkit.org/show_bug.cgi?id=94074
+
+ Reviewed by Pavel Feldman.
+
+ Added dirty flag check when saving uiSourceCode to save working copy in this case.
+
+ * inspector/front-end/HandlerRegistry.js:
+ (WebInspector.HandlerRegistry.prototype.appendApplicableItems.save):
+ (WebInspector.HandlerRegistry.prototype.appendApplicableItems):
+
+2012-08-15 Thiago Marcos P. Santos <thiago.santos@intel.com>
+
+ Relative units are not set when the canvas has not parent
+ https://bugs.webkit.org/show_bug.cgi?id=93840
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Set the default font when no parent style is set. It will make
+ possible to apply relative units when a parent is not set.
+
+ No new tests, unskipped the existing ones.
+
+ * css/StyleBuilder.cpp:
+ (WebCore::ApplyPropertyFontSize::applyValue):
+ Make it possible to apply relative units if a parent style exist but
+ not a parent node. It works like this for em and ex, but not for
+ percent units.
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore):
+ (WebCore::CanvasRenderingContext2D::setFont):
+
+2012-08-14 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: split standalone test runner, test scanner and test stub.
+ https://bugs.webkit.org/show_bug.cgi?id=94001
+
+ Reviewed by Vsevolod Vlasov.
+
+ This change starts sending loacCompleted message to the embedder.
+
+ * inspector/front-end/InspectorFrontendAPI.js:
+ (InspectorFrontendAPI.loadCompleted):
+ * inspector/front-end/test-runner.html: Added.
+
+2012-08-15 Shinya Kawanaka <shinyak@chromium.org>
+
+ [Refactoring] The debug version and release version of toHTMLSelectElement can be merged without any penalty
+ https://bugs.webkit.org/show_bug.cgi?id=94084
+
+ Reviewed by Kent Tamura.
+
+ We have two versions of toHTMLSelectElement. One has ASSERT() and the other one does not have ASSERT().
+ We can merge them without any penalty.
+
+ No new tests, no change in behavior.
+
+ * html/HTMLSelectElement.cpp:
+ * html/HTMLSelectElement.h:
+ (WebCore::isHTMLSelectElement):
+ (WebCore::toHTMLSelectElement):
+ (WebCore):
+
+2012-08-15 Shinya Kawanaka <shinyak@chromium.org>
+
+ AuthorShadowDOM for meter element
+ https://bugs.webkit.org/show_bug.cgi?id=91970
+
+ Reviewed by Hajime Morita.
+
+ We add support for AuthorShadowDOM for a meter element.
+
+ According to the Shadow DOM spec, a meter element should behave like having a UserAgentShadowRoot and
+ an element in UserAgentShadowRoot draws a real 'meter' bar. In this patch, we change the inner structure
+ of a meter element so that we can distribute an element having RenderMeter to AuthorShadowDOM.
+
+ Before this patch, a meter element has the following inner structure.
+
+ <meter>--UserAgentShadowRoot -- -- -- -- -- -- -- -- -- -- AuthorShadowRoot
+ |
+ +-- MeterBarElement
+ |
+ +-- MeterValueElement
+
+ After this patch, a meter element will have the following inner structure.
+
+ <meter>--UserAgentShadowRoot -- -- -- -- -- -- -- -- -- -- AuthorShadowRoot
+ |
+ +-- MeterInnerElement
+ |
+ +-- MeterBarElement
+ |
+ +-- MeterValueElement
+
+ However, if RenderTheme supports rendering meter, MeterInnerElement will not create a renderer
+ unless an AuthorShadowDOM is attached to it so that we can keep the current rendering style.
+
+ Tests: fast/dom/shadow/shadowdom-for-meter-dynamic.html
+ fast/dom/shadow/shadowdom-for-meter-multiple.html
+ fast/dom/shadow/shadowdom-for-meter-with-style.html
+ fast/dom/shadow/shadowdom-for-meter-without-appearance.html
+ fast/dom/shadow/shadowdom-for-meter-without-shadow-element.html
+ fast/dom/shadow/shadowdom-for-meter.html
+
+ * css/html.css:
+ (meter): Changed the display type. inline-box is not supported WebKit. inline-block is true.
+ (meter::-webkit-meter-inner-element):
+ * html/HTMLMeterElement.cpp:
+ (WebCore::HTMLMeterElement::HTMLMeterElement):
+ (WebCore::HTMLMeterElement::createRenderer):
+ (WebCore):
+ (WebCore::HTMLMeterElement::attach): Added didElementStateChange.
+ (WebCore::HTMLMeterElement::didElementStateChange):
+ (WebCore::HTMLMeterElement::willAddAuthorShadowRoot):
+ (WebCore::HTMLMeterElement::renderMeter):
+ (WebCore::HTMLMeterElement::createShadowSubtree):
+ * html/HTMLMeterElement.h:
+ (WebCore):
+ (WebCore::HTMLMeterElement::hasAuthorShadowRoot):
+ (HTMLMeterElement):
+ (WebCore::isHTMLMeterElement):
+ (WebCore::toHTMLMeterElement):
+ * html/shadow/MeterShadowElement.cpp:
+ (WebCore::MeterShadowElement::meterElement):
+ (WebCore::MeterShadowElement::rendererIsNeeded):
+ (WebCore):
+ (WebCore::MeterInnerElement::MeterInnerElement): We introduce a new element having RenderMeter
+ so that we can distribute an element having RenderMeter to AuthorShadowDOM.
+ (WebCore::MeterInnerElement::rendererIsNeeded): Different from a progress element, meter element will not be
+ rendered using a theme. So we don't need to check the style appearance.
+ (WebCore::MeterInnerElement::createRenderer):
+ (WebCore::MeterInnerElement::shadowPseudoId):
+ * html/shadow/MeterShadowElement.h:
+ (WebCore):
+ (MeterInnerElement):
+ (WebCore::MeterInnerElement::create):
+ * rendering/RenderMeter.cpp:
+ (WebCore::RenderMeter::RenderMeter):
+ (WebCore::RenderMeter::meterElement):
+ (WebCore):
+ (WebCore::RenderMeter::valueRatio):
+ * rendering/RenderMeter.h:
+ (RenderMeter):
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderThemeMac::levelIndicatorFor):
+
+2012-08-15 Adam Barth <abarth@webkit.org>
+
+ [Chromium] fast/dom/Window/dom-access-from-closure-window.html is flaky on Linux
+ https://bugs.webkit.org/show_bug.cgi?id=94060
+
+ Reviewed by Kentaro Hara.
+
+ Previously, the V8 garbage collector might have collected the Document
+ wrapper before the DOMWindow wrapper because we overwrite the
+ "document" property of the DOMWindow during navigation.
+
+ This patch adds a hidden document property on the global object to
+ ensure that the Document wrapper lives at least as long as the
+ DOMWindow wrapper, ensuring that DOMWindows that we obtain from V8
+ always have non-null Document objects.
+
+ The JavaScriptCore bindings already have this behavior.
+
+ Test: fast/dom/Window/dom-access-from-closure-window-with-gc.html
+
+ * bindings/v8/V8DOMWindowShell.cpp:
+ (WebCore::V8DOMWindowShell::updateDocumentWrapperCache):
+ * bindings/v8/V8HiddenPropertyName.h:
+ (WebCore):
+
+2012-08-14 Andrey Kosyakov <caseq@chromium.org>
+
+ Web Inspector: Calling getEventListeners() on element with malformed javascript event listeners crashes
+ https://bugs.webkit.org/show_bug.cgi?id=93937
+
+ Reviewed by Pavel Feldman.
+
+ - check listener function to be non-null (happens upon an exception while compiling attribute listeners)
+
+ * bindings/js/JSInjectedScriptHostCustom.cpp:
+ (WebCore::getJSListenerFunctions):
+ * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+ (WebCore::getJSListenerFunctions):
+
+2012-08-14 Jan Keromnes <janx@linux.com>
+
+ Web Inspector: CodeMirrorTextEditor doesn't clear execution line
+ https://bugs.webkit.org/show_bug.cgi?id=94069
+
+ Reviewed by Pavel Feldman.
+
+ Make CodeMirrorTextEditor use line handles instead of numbers, remove
+ typeof == "number" checks.
+
+ * inspector/front-end/CodeMirrorTextEditor.js:
+ (WebInspector.CodeMirrorTextEditor.prototype.clearExecutionLine):
+ (WebInspector.CodeMirrorTextEditor.prototype.highlightLine):
+ (WebInspector.CodeMirrorTextEditor.prototype.clearLineHighlight):
+
+2012-08-14 Yuta Kitamura <yutak@google.com>
+
+ Unreviewed. Fix Chromium-Android builds.
+
+ * html/TimeInputType.cpp:
+ (WebCore::TimeInputType::TimeInputType):
+ Declare the function as a constructor.
+
+2012-08-14 Sukolsak Sakshuwong <sukolsak@google.com>
+
+ Text selection in text area in auto scroll mode goes wrong.
+ https://bugs.webkit.org/show_bug.cgi?id=74346
+
+ Reviewed by Ojan Vafai.
+
+ WebKit triggers autoscroll in text area when the user drags the cursor from inside
+ the text area to the outside. When that happens, it gets the local cursor position
+ relative to the node under the cursor from hit-testing, converts it to
+ the absolute position, and then converts it to the local position relative to the
+ text area. However, the hit-testing method of text area did not take scrolling
+ offset into account. This caused it to give an incorrect value of the local cursor
+ position. Make the hit-testing take scrolling offset into account.
+
+ Test: fast/events/autoscroll-in-textarea.html
+
+ * html/shadow/TextControlInnerElements.cpp:
+ (WebCore::TextControlInnerTextElement::createRenderer):
+ * rendering/RenderTextControl.cpp:
+ (WebCore::RenderTextControl::hitInnerTextElement):
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore):
+ * rendering/RenderTextControlSingleLine.h:
+ (WebCore::RenderTextControlInnerBlock::RenderTextControlInnerBlock):
+ (WebCore::RenderTextControlInnerBlock::hasLineIfEmpty):
+
+2012-08-14 Shinya Kawanaka <shinyak@chromium.org>
+
+ [Refactoring] RenderMenuList and RenderListBox should have a method to return HTMLSelectElement.
+ https://bugs.webkit.org/show_bug.cgi?id=94061
+
+ Reviewed by Kent Tamura.
+
+ This is a preparation patch for Bug 91487. Since RenderMenuList::node() and RenderListBox::node()
+ will not return HTMLSelectElement to fix Bug 91487, it would be good to have a method to HTMLSelectElement.
+
+ No new tests, no change in behavior.
+
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::selectElement):
+ (WebCore):
+ (WebCore::RenderListBox::updateFromElement):
+ (WebCore::RenderListBox::scrollToRevealSelection):
+ (WebCore::RenderListBox::size):
+ (WebCore::RenderListBox::numItems):
+ (WebCore::RenderListBox::addFocusRingRects):
+ (WebCore::RenderListBox::paintItemForeground):
+ (WebCore::RenderListBox::paintItemBackground):
+ (WebCore::RenderListBox::panScroll):
+ (WebCore::RenderListBox::autoscroll):
+ (WebCore::RenderListBox::stopAutoscroll):
+ (WebCore::RenderListBox::valueChanged):
+ (WebCore::RenderListBox::nodeAtPoint):
+ * rendering/RenderListBox.h:
+ (WebCore):
+ (RenderListBox):
+ * rendering/RenderMenuList.cpp:
+ (WebCore::RenderMenuList::selectElement):
+ (WebCore):
+ (WebCore::RenderMenuList::updateOptionsWidth):
+ (WebCore::RenderMenuList::updateFromElement):
+ (WebCore::RenderMenuList::setTextFromOption):
+ (WebCore::RenderMenuList::showPopup):
+ (WebCore::RenderMenuList::valueChanged):
+ (WebCore::RenderMenuList::listBoxSelectItem):
+ (WebCore::RenderMenuList::multiple):
+ (WebCore::RenderMenuList::didSetSelectedIndex):
+ (WebCore::RenderMenuList::didUpdateActiveOption):
+ (WebCore::RenderMenuList::itemText):
+ (WebCore::RenderMenuList::itemAccessibilityText):
+ (WebCore::RenderMenuList::itemToolTip):
+ (WebCore::RenderMenuList::itemIsEnabled):
+ (WebCore::RenderMenuList::itemStyle):
+ (WebCore::RenderMenuList::itemBackgroundColor):
+ (WebCore::RenderMenuList::listSize):
+ (WebCore::RenderMenuList::selectedIndex):
+ (WebCore::RenderMenuList::itemIsSeparator):
+ (WebCore::RenderMenuList::itemIsLabel):
+ (WebCore::RenderMenuList::itemIsSelected):
+ (WebCore::RenderMenuList::setTextFromItem):
+ * rendering/RenderMenuList.h:
+ (WebCore):
+ (RenderMenuList):
+
+2012-08-10 Kinuko Yasuda <kinuko@chromium.org>
+
+ FileWriter fails with assertion when trying to write empty Blob
+ https://bugs.webkit.org/show_bug.cgi?id=93694
+
+ Reviewed by Kent Tamura.
+
+ if the given data size is zero (i.e. m_bytesToWrite is zero) the assertion 'bytes + m_bytesWritten > 0' should not be tested.
+
+ Tests: fast/filesystem/file-writer-empty-blob.html
+ fast/filesystem/workers/file-writer-empty-blob.html
+
+ * Modules/filesystem/FileWriter.cpp:
+ (WebCore::FileWriter::didWrite):
+
+2012-08-14 Keishi Hattori <keishi@webkit.org>
+
+ Share common code between calendar picker and color suggestion picker
+ https://bugs.webkit.org/show_bug.cgi?id=93802
+
+ Reviewed by Kent Tamura.
+
+ We want to share common code like utility functions between picker page popups.
+
+ No new tests because no behavior change. Covered by existing tests, color-suggestion-picker-appearance.html and calendar-picker-apeparance.html.
+
+ * Resources/pagepopups/calendarPicker.js:
+ (YearMonthController.prototype.attachTo):
+ (YearMonthController.prototype._showPopup):
+ * Resources/pagepopups/colorSuggestionPicker.js:
+ (handleMessage):
+ (handleArgumentsTimeout):
+ * Resources/pagepopups/pickerCommon.css: Added.
+ (body):
+ * Resources/pagepopups/pickerCommon.js: Added.
+ (createElement):
+ (resizeWindow):
+ (getScrollbarWidth):
+ * WebCore.gyp/WebCore.gyp: Add actions for pickerCommon.{css,js}
+ * html/shadow/CalendarPickerElement.cpp:
+ (WebCore::CalendarPickerElement::writeDocument):
+
+2012-08-14 Ojan Vafai <ojan@chromium.org>
+
+ Fix access to m_markupBox in WebCore::EllipsisBox::paint
+ https://bugs.webkit.org/show_bug.cgi?id=91138
+
+ Reviewed by Abhishek Arya.
+
+ EllipsisBox would hold on to m_markupBox, which would then get destroyed during
+ the followup layoutIfNeeded in layoutVerticalBox. Instead, have EllipsisBox
+ dynamically grab to pointer to the markup box during paint since there's no
+ straightforward way to notify the EllipsisBox that the markupBox has been destroyed
+ and/or point it at the new markupBox.
+
+ Test: fast/overflow/line-clamp-and-columns.html
+
+ * rendering/EllipsisBox.cpp:
+ (WebCore::EllipsisBox::paint):
+ (WebCore):
+ (WebCore::EllipsisBox::paintMarkupBox):
+ * rendering/EllipsisBox.h:
+ (WebCore::EllipsisBox::EllipsisBox):
+ Just store a boolean that we have a markup box that needs painting.
+ * rendering/RenderDeprecatedFlexibleBox.cpp:
+ (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
+ Clearing the override size right after setting it was incorrect because
+ there are cases where we'll do a followup layout in layoutVerticalBox, at which
+ point we'll still need the override size.
+ (WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
+ Clear the override size here to handle cases where line clamp is removed since
+ we don't call applyLineClamp in those cases.
+
+2012-08-14 Yoshifumi Inoue <yosin@chromium.org>
+
+ [Forms] Make input type "time" to use multiple field time input UI
+ https://bugs.webkit.org/show_bug.cgi?id=93929
+
+ Reviewed by Kent Tamura.
+
+ This patch changes input type "time" UI to use multiple field time
+ input UI when build flag ENABLE_INPUT_TYPE_TIME_MULTIPLE_FIELDS
+ enabled.
+
+ No new tests. This patch doesn't change behavior for users, however,
+ this patch changes behavior on layout tests. Tests will be added
+ in another patch with runtime enabled feature flag is enabled.
+
+ Test expectations for following tests are updated:
+ - fast/forms/time/time-input-visible-string.html
+ - fast/forms/time/time-stepup-stepdown-from-renderer.html
+
+ * html/BaseDateAndTimeInputType.h:
+ (BaseDateAndTimeInputType): Exposed serialize() to derived classes.
+ * html/TimeInputType.cpp:
+ (WebCore::TimeInputType::DateTimeEditControlOwnerImpl::DateTimeEditControlOwnerImpl):
+ (WebCore::TimeInputType::DateTimeEditControlOwnerImpl::~DateTimeEditControlOwnerImpl):
+ (WebCore::TimeInputType::DateTimeEditControlOwnerImpl::editControlMouseFocus):
+ (WebCore::TimeInputType::DateTimeEditControlOwnerImpl::editControlValueChanged):
+ (WebCore::TimeInputType::DateTimeEditControlOwnerImpl::isEditControlOwnerDisabled):
+ (WebCore::TimeInputType::DateTimeEditControlOwnerImpl::isEditControlOwnerReadOnly):
+ (WebCore::TimeInputType::TimeInputType):
+ (WebCore::TimeInputType::~TimeInputType):
+ (WebCore::TimeInputType::createRenderer):
+ (WebCore::TimeInputType::createShadowSubtree):
+ (WebCore::TimeInputType::destroyShadowSubtree):
+ (WebCore::TimeInputType::forwardEvent):
+ (WebCore::TimeInputType::disabledAttributeChanged):
+ (WebCore::TimeInputType::handleKeydownEvent):
+ (WebCore::TimeInputType::handleDOMActivateEvent):
+ (WebCore::TimeInputType::isKeyboardFocusable):
+ (WebCore::TimeInputType::isMouseFocusable):
+ (WebCore::TimeInputType::minOrMaxAttributeChanged):
+ (WebCore::TimeInputType::readonlyAttributeChanged):
+ (WebCore::TimeInputType::isTextField):
+ (WebCore::TimeInputType::setValue):
+ (WebCore::TimeInputType::shouldUseInputMethod):
+ (WebCore::TimeInputType::stepAttributeChanged):
+ (WebCore::TimeInputType::updateEditElementLayout):
+ (WebCore::TimeInputType::updateInnerTextValue):
+ (WebCore::TimeInputType):
+ * html/TimeInputType.h:
+ (TimeInputType):
+ (DateTimeEditControlOwnerImpl):
+
+2012-08-14 Dean Jackson <dino@apple.com>
+
+ Initial call to webkitRequestAnimationFrame returns 0, Spec indicates the handle should always be > 0
+ https://bugs.webkit.org/show_bug.cgi?id=85819
+
+ Reviewed by James Robinson.
+
+ The callback id returned by requestAnimationFrame was beginning at zero, when the spec
+ says it should be above one. Use a pre-increment rather than a post-increment.
+
+ Test: fast/animation/request-animation-frame-callback-id.html
+
+ * dom/ScriptedAnimationController.cpp:
+ (WebCore::ScriptedAnimationController::registerCallback): Pre-increment rather than post-increment.
+
+2012-08-14 Levi Weintraub <leviw@chromium.org>
+
+ r125591 broke tests with SUBPIXEL_LAYOUT disabled
+ https://bugs.webkit.org/show_bug.cgi?id=94027
+
+ Reviewed by Eric Seidel.
+
+ The previous patch to fix block preferred widths for subpixel layout broke ports
+ without the flag enabled. This patch adds a static inline function --
+ adjustFloatForSubPixelLayout -- that truncates with sub-pixel layout disabled, and
+ ceil's to the nearest FractionalLayoutUnit when sub-pixel layout is enabled.
+
+ A block's max preferred width should be enough to layout the entire line without
+ wrapping. r125591 addressed a bug whereby converting floats to LayoutUnits with sub-
+ pixel layout enabled lost precision in certain cases, and could result in a line
+ being layed out to slightly over the max preferred width of the block.
+
+ This patch reverts the behavior when sub-pixel layout is disabled to truncating
+ sub-pixel values (such as those that originate in Length) when assigning them to
+ LayoutUnits, and ceiling the length of the entire line to the next largest integer.
+
+ Covered by existing tests.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore):
+ (WebCore::adjustFloatForSubPixelLayout):
+ (WebCore::RenderBlock::computeInlinePreferredLogicalWidths):
+
+2012-08-14 Chris Evans <cevans@google.com>
+
+ Handle the XPath / (root) operator correctly for nodes that aren't attached to the document.
+ https://bugs.webkit.org/show_bug.cgi?id=36427
+
+ Reviewed by Abhishek Arya.
+
+ We now behave the same as Firefox 14.
+ The consensus seems to be that the XPath spec is ambiguous for the case of detached nodes, and that using the fragment root is more intuitive than the document root for the case of detached nodes.
+ For example, http://www.w3.org/TR/xpath/ section 2 "Location Paths" is only clear for attached nodes: "A / by itself selects the root node of the document containing the context node. If it is followed by a relative location path, then the location path selects the set of nodes that would be selected by the relative location path relative to the root node of the document containing the context node."
+
+ Test: fast/xpath/xpath-detached-nodes.html
+
+ * xml/XPathPath.cpp:
+ (WebCore::XPath::LocationPath::evaluate): Jump to the root of the detached subtree instead of the parent document if the node isn't attached to the document.
+
+2012-08-14 Alexandru Chiculita <achicu@adobe.com>
+
+ [CSS Shaders][Chromium] Filters area applied twice when CustomFilterOperation is in the list
+ https://bugs.webkit.org/show_bug.cgi?id=93900
+
+ Reviewed by James Robinson.
+
+ Whenever the platform cannot render a shader in hardware it will fallback to software.
+ In such cases, the platform should remove any old filters applied, so that the filters do not apply twice.
+
+ Test: css3/filters/custom/filter-fallback-to-software.html
+
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (WebCore::GraphicsLayerChromium::setFilters):
+
+2012-08-14 Alec Flett <alecflett@chromium.org>
+
+ IndexedDB: add tracing to IDBLevelDBBackingStore
+ https://bugs.webkit.org/show_bug.cgi?id=93914
+
+ Reviewed by Tony Chang.
+
+ Add a bunch of trace events to the lower level
+ database layer, to separate database slowness
+ from core IDB slowness.
+
+ Also moving findKeyInIndex into IDBLevelDBBackingStore to
+ eventually make it const.
+
+ No new tests, just adding debug logging.
+
+ * Modules/indexeddb/IDBLevelDBBackingStore.cpp:
+ (WebCore::IDBLevelDBBackingStore::open):
+ (WebCore::IDBLevelDBBackingStore::deleteDatabase):
+ (WebCore::IDBLevelDBBackingStore::getObjectStores):
+ (WebCore::IDBLevelDBBackingStore::createObjectStore):
+ (WebCore::IDBLevelDBBackingStore::deleteObjectStore):
+ (WebCore::IDBLevelDBBackingStore::getObjectStoreRecord):
+ (WebCore):
+ (WebCore::IDBLevelDBBackingStore::putObjectStoreRecord):
+ (WebCore::IDBLevelDBBackingStore::clearObjectStore):
+ (WebCore::IDBLevelDBBackingStore::deleteObjectStoreRecord):
+ (WebCore::IDBLevelDBBackingStore::keyExistsInObjectStore):
+ (WebCore::IDBLevelDBBackingStore::getIndexes):
+ (WebCore::IDBLevelDBBackingStore::createIndex):
+ (WebCore::IDBLevelDBBackingStore::deleteIndex):
+ (WebCore::IDBLevelDBBackingStore::putIndexDataForRecord):
+ (WebCore::IDBLevelDBBackingStore::findKeyInIndex):
+ (WebCore::IDBLevelDBBackingStore::getPrimaryKeyViaIndex):
+ (WebCore::IDBLevelDBBackingStore::keyExistsInIndex):
+ (WebCore::IDBLevelDBBackingStore::openObjectStoreCursor):
+ (WebCore::IDBLevelDBBackingStore::openIndexKeyCursor):
+ (WebCore::IDBLevelDBBackingStore::openIndexCursor):
+ (WebCore::IDBLevelDBBackingStore::Transaction::commit):
+ (WebCore::IDBLevelDBBackingStore::Transaction::rollback):
+ * Modules/indexeddb/IDBLevelDBBackingStore.h:
+ (IDBLevelDBBackingStore):
+ * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
+ (WebCore):
+ * Modules/indexeddb/IDBTransaction.cpp:
+ (WebCore::IDBTransaction::onAbort):
+ (WebCore::IDBTransaction::onComplete):
+
+2012-08-14 Hayato Ito <hayato@chromium.org>
+
+ Refactor EventDispatcher, moving code to make actual changes easier to review later.
+ https://bugs.webkit.org/show_bug.cgi?id=93959
+
+ Reviewed by Dimitri Glazkov.
+
+ No new tests - no new functionality.
+
+ * dom/EventDispatcher.cpp:
+ (WebCore::EventDispatcher::dispatchScopedEvent):
+ (WebCore):
+ (WebCore::EventDispatcher::dispatchSimulatedClick):
+
+2012-08-14 Kihong Kwon <kihong.kwon@samsung.com>
+
+ Clear pattern to prevent timing problem between cancelVibration and vibrate
+ https://bugs.webkit.org/show_bug.cgi?id=93957
+
+ Reviewed by Kentaro Hara.
+
+ There is a timing issue in the cancelVibration.
+ Since vibrate works based on timer, cancelVibration might be called
+ eariler than vibrate when cancelVibration is called just after vibrate call.
+ It can be prevented from clearing m_pattern in the cancelVibration.
+
+ * Modules/vibration/Vibration.cpp:
+ (WebCore::Vibration::cancelVibration):
+
+2012-08-14 Alexandru Chiculita <achicu@adobe.com>
+
+ Layout Test css3/filters/custom/custom-filter-animation.html is failing
+ https://bugs.webkit.org/show_bug.cgi?id=91769
+
+ Reviewed by Dean Jackson.
+
+ Mountain Lion added support for accelerated filter animations, but CSS Shaders are still
+ rendered in software mode. The setFilters method is using PlatformCALayer::filtersCanBeComposited to check
+ if the filters can be handled in hardwawre, so I've reused that in the createFilterAnimationsFromKeyframes
+ to check if the animations can also run in hardware.
+
+ Also the GraphicsContext3D doesn't update its own internal m_boundFBO when a framebuffer is deleted,
+ so I've added that to the FECustomFilter. Otherwise, if the next framebuffer is created using the same
+ identifier, bindFramebuffer will just return without calling the glBindFramebuffer because of this optimization.
+
+ The documentation for glDeleteFramebuffer says that the bound framebuffer is unbound before deleting it.
+ This is not reproduceable from WebGL, because WebGLRenderingContext::deleteFramebuffer
+ already knows to unbind the framebuffer when needed. However, I'm also adding that in GraphicsContext3DOpenGLCommon.cpp
+ and efl/GraphicsContext3DPrivate.cpp, to make sure that m_boundFBO is not used for other purposes.
+
+ No new tests, this patch fixes a failing test.
+
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayerCA::createFilterAnimationsFromKeyframes):
+ * platform/graphics/efl/GraphicsContext3DPrivate.cpp:
+ (WebCore::GraphicsContext3DPrivate::deleteFramebuffer):
+ * platform/graphics/filters/FECustomFilter.cpp:
+ (WebCore::FECustomFilter::deleteRenderBuffers):
+ * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
+ (WebCore::GraphicsContext3D::deleteFramebuffer):
+
+2012-08-14 Adam Barth <abarth@webkit.org>
+
+ Delete Frame::domWindow() and Frame::existingDOMWindow()
+ https://bugs.webkit.org/show_bug.cgi?id=93990
+
+ Reviewed by Eric Seidel.
+
+ These functions just call through to document()->domWindow(). This
+ patch updates the callers so it's clearer what's going on.
+
+ * bindings/js/JSDOMBinding.cpp:
+ (WebCore::shouldAllowAccessToFrame):
+ (WebCore::printErrorMessageForFrame):
+ * bindings/js/JSDocumentCustom.cpp:
+ (WebCore::JSDocument::location):
+ (WebCore::JSDocument::setLocation):
+ * bindings/js/JSEventListener.cpp:
+ (WebCore::JSEventListener::handleEvent):
+ * bindings/js/ScriptCachedFrameData.cpp:
+ (WebCore::ScriptCachedFrameData::restore):
+ * bindings/js/ScriptController.cpp:
+ (WebCore::ScriptController::createWindowShell):
+ * bindings/objc/DOMAbstractView.mm:
+ (core):
+ * bindings/v8/NPV8Object.cpp:
+ (WebCore::toV8Context):
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::createScriptObject):
+ (WebCore::ScriptController::createScriptObjectForPluginElement):
+ * bindings/v8/V8DOMWindowShell.cpp:
+ (WebCore::V8DOMWindowShell::initContextIfNeeded):
+ * bindings/v8/V8IsolatedContext.cpp:
+ (WebCore::V8IsolatedContext::V8IsolatedContext):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::retrieveFrame):
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ (WebCore::V8DOMWindow::indexedPropertyGetter):
+ (WebCore::V8DOMWindow::namedPropertyGetter):
+ * bindings/v8/custom/V8DocumentLocationCustom.cpp:
+ (WebCore::V8Document::locationAccessorGetter):
+ (WebCore::V8Document::locationAccessorSetter):
+ * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+ (WebCore::V8HTMLDocument::GetNamedProperty):
+ * bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp:
+ (WebCore::V8HTMLFrameSetElement::namedPropertyGetter):
+ * dom/Document.cpp:
+ (WebCore::printNavigationErrorMessage):
+ * dom/ViewportArguments.cpp:
+ (WebCore::reportViewportWarning):
+ * editing/AlternativeTextController.cpp:
+ (WebCore::AlternativeTextController::insertDictatedText):
+ * editing/Editor.cpp:
+ (WebCore::Editor::pasteAsPlainText):
+ (WebCore::Editor::pasteAsFragment):
+ (WebCore::Editor::setComposition):
+ * history/PageCache.cpp:
+ (WebCore::logCanCacheFrameDecision):
+ (WebCore::PageCache::canCachePageContainingThisFrame):
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::validateInteractively):
+ * html/HTMLFrameOwnerElement.cpp:
+ (WebCore::HTMLFrameOwnerElement::contentWindow):
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore):
+ (WebCore::WebGLRenderingContext::printWarningToConsole):
+ * inspector/InspectorDOMStorageAgent.cpp:
+ (WebCore::InspectorDOMStorageAgent::storageId):
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::checkLoadComplete):
+ * loader/DocumentWriter.cpp:
+ (WebCore::DocumentWriter::begin):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::stopLoading):
+ (WebCore::FrameLoader::didOpenURL):
+ (WebCore::FrameLoader::checkIfDisplayInsecureContent):
+ (WebCore::FrameLoader::checkIfRunInsecureContent):
+ (WebCore::FrameLoader::reportLocalLoadFailed):
+ (WebCore::FrameLoader::prepareForCachedPageRestore):
+ (WebCore::FrameLoader::open):
+ (WebCore::FrameLoader::fireBeforeUnloadEvent):
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::didReceiveResponse):
+ * loader/appcache/ApplicationCacheGroup.cpp:
+ (WebCore::ApplicationCacheGroup::abort):
+ (WebCore::ApplicationCacheGroup::didReceiveResponse):
+ (WebCore::ApplicationCacheGroup::didFinishLoading):
+ (WebCore::ApplicationCacheGroup::didFail):
+ (WebCore::ApplicationCacheGroup::didReceiveManifestResponse):
+ (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
+ (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
+ * loader/cache/CachedResourceLoader.cpp:
+ (WebCore::CachedResourceLoader::printAccessDeniedMessage):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::isCurrentlyDisplayedInFrame):
+ (WebCore::DOMWindow::self):
+ (WebCore::DOMWindow::opener):
+ (WebCore::DOMWindow::parent):
+ (WebCore::DOMWindow::top):
+ (WebCore::DOMWindow::createWindow):
+ (WebCore::DOMWindow::open):
+ * page/DOMWindowProperty.cpp:
+ (WebCore::DOMWindowProperty::DOMWindowProperty):
+ (WebCore::DOMWindowProperty::reconnectFrameFromPageCache):
+ * page/DragController.cpp:
+ (WebCore::DragController::dispatchTextInputEventFor):
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleTextInputEvent):
+ * page/Frame.cpp:
+ * page/Frame.h:
+ (Frame):
+ * page/Location.cpp:
+ (WebCore::Location::replace):
+ (WebCore::Location::reload):
+ (WebCore::Location::setLocation):
+ * storage/StorageEventDispatcher.cpp:
+ (WebCore::StorageEventDispatcher::dispatch):
+ * svg/SVGDocumentExtensions.cpp:
+ (WebCore::reportMessage):
+ * xml/XSLStyleSheetLibxslt.cpp:
+ (WebCore::XSLStyleSheet::parseString):
+ * xml/XSLTProcessorLibxslt.cpp:
+ (WebCore::docLoaderFunc):
+ * xml/XSLTProcessorQt.cpp:
+ (WebCore::XSLTMessageHandler::handleMessage):
+
+2012-08-14 Mike West <mkwst@chromium.org>
+
+ Tighten up parsing the 'script-nonce' CSP directive value.
+ https://bugs.webkit.org/show_bug.cgi?id=93783
+
+ Reviewed by Adam Barth.
+
+ Currently we're accepting any non-whitespace character. This patch
+ limits the valid characters to VCHAR minus ',' and ';', and pulls the
+ validity check out into a named function for clarity.
+
+ Test: http/tests/security/contentSecurityPolicy/1.1/scriptnonce-separators-allowed.html
+
+ * page/ContentSecurityPolicy.cpp:
+ (WebCore::CSPDirectiveList::parseScriptNonce):
+
+2012-08-14 Adam Barth <abarth@webkit.org>
+
+ Delete DOMWindow::m_url
+ https://bugs.webkit.org/show_bug.cgi?id=93989
+
+ Reviewed by Eric Seidel.
+
+ There's no reason for DOMWindow to keep a separate copy of the
+ Document's URL now that there is a predictable way to get a Document
+ from a DOMWindow.
+
+ * loader/DocumentWriter.cpp:
+ (WebCore::DocumentWriter::begin):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::open):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::crossDomainAccessErrorMessage):
+ * page/DOMWindow.h:
+ (DOMWindow):
+
+2012-08-14 Nikhil Bhargava <nbhargava@google.com>
+
+ De-inline stuff from RenderStyle.h
+ https://bugs.webkit.org/show_bug.cgi?id=94019
+
+ Reviewed by Eric Seidel.
+
+ De-inline things from RenderStyle.h in preparation of fixing a series of
+ errant includes.
+
+ No new tests. Doesn't change functionality
+
+ * WebCore.exp.in:
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::listStyleImage):
+ (WebCore::RenderStyle::setListStyleImage):
+ (WebCore):
+ (WebCore::RenderStyle::color):
+ (WebCore::RenderStyle::visitedLinkColor):
+ (WebCore::RenderStyle::setColor):
+ (WebCore::RenderStyle::setVisitedLinkColor):
+ (WebCore::RenderStyle::horizontalBorderSpacing):
+ (WebCore::RenderStyle::verticalBorderSpacing):
+ (WebCore::RenderStyle::setHorizontalBorderSpacing):
+ (WebCore::RenderStyle::setVerticalBorderSpacing):
+ (WebCore::RenderStyle::font):
+ (WebCore::RenderStyle::fontMetrics):
+ (WebCore::RenderStyle::fontDescription):
+ (WebCore::RenderStyle::fontSize):
+ (WebCore::RenderStyle::wordSpacing):
+ (WebCore::RenderStyle::letterSpacing):
+ (WebCore::RenderStyle::setFontDescription):
+ (WebCore::RenderStyle::lineHeight):
+ (WebCore::RenderStyle::setLineHeight):
+ (WebCore::RenderStyle::computedLineHeight):
+ (WebCore::RenderStyle::setWordSpacing):
+ (WebCore::RenderStyle::setLetterSpacing):
+ * rendering/style/RenderStyle.h:
+
+2012-08-14 Andrei Onea <onea@adobe.com>
+
+ [CSSRegions]Region overset property is incorectly computed when content has negative letter spacing and is flowed near to the edge of a region
+ https://bugs.webkit.org/show_bug.cgi?id=92506
+
+ Reviewed by Eric Seidel.
+
+ When the content which is flowed inside a region creates visual overflow in
+ the writing direction, the overflow rect is also extended in the other direction, and
+ that forces regionOverset to become "fit" for all regions.
+
+ Tests: fast/regions/element-region-overset-state-negative-letter-spacing.html
+ fast/regions/element-region-overset-state-vertical-rl-negative-letter-spacing.html
+
+ * rendering/RenderFlowThread.cpp:
+ (WebCore::RenderFlowThread::computeOverflowStateForRegions):
+
+2012-08-14 Florin Malita <fmalita@chromium.org>
+
+ beginElement() does not observe updated animation attributes
+ https://bugs.webkit.org/show_bug.cgi?id=93972
+
+ Reviewed by Dirk Schulze.
+
+ The SVG animation attributes 'from', 'to' and 'by' should be registered as supported
+ SVGSMILElement attributes in order to trigger animationAttributeChanged() on dynamic
+ updates.
+
+ Test: svg/animations/updated-attributes.html
+
+ * svg/SVGAnimationElement.cpp:
+ (WebCore::SVGAnimationElement::updateAnimation):
+ Minor optimization - avoid recalculating animationMode().
+
+ * svg/animation/SVGSMILElement.cpp:
+ (WebCore::SVGSMILElement::isSupportedAttribute):
+ Register 'from', 'to' and 'by' as supported SVGSMILElement attributes.
+
+2012-08-14 Filip Spacek <fspacek@rim.com>
+
+ [BlackBerry] Don't crash on OOM in AC
+ https://bugs.webkit.org/show_bug.cgi?id=93999
+
+ Reviewed by George Staikos.
+
+ Internally reviewed by George Staikos.
+
+ Fail gracefully in case we fail to allocate the bitmap
+ for the AC layer contents.
+
+ * platform/graphics/blackberry/InstrumentedPlatformCanvas.h:
+ (WebCore::InstrumentedPlatformCanvas::InstrumentedPlatformCanvas):
+ * platform/graphics/blackberry/LayerWebKitThread.cpp:
+ (WebCore::LayerWebKitThread::paintContents):
+
+2012-08-14 Lauro Neto <lauro.neto@openbossa.org>
+
+ Convert signals/slots to Q_* macros.
+
+ [Qt] Use Q_SLOTS and Q_SIGNALS instead of slots and signals
+ https://bugs.webkit.org/show_bug.cgi?id=93996
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Change usage of keyword-conflicting 'signals' and 'slots' for
+ Q_SIGNALS and Q_SLOTS macro.
+
+ * bridge/testqtbindings.cpp:
+ (MyObject):
+ * platform/graphics/gstreamer/PlatformVideoWindowPrivate.h:
+ * platform/graphics/qt/MediaPlayerPrivateQt.h:
+ (MediaPlayerPrivateQt):
+ * platform/network/qt/DnsPrefetchHelper.h:
+ (DnsPrefetchHelper):
+ * platform/network/qt/NetworkStateNotifierPrivate.h:
+ (NetworkStateNotifierPrivate):
+ * platform/network/qt/QNetworkReplyHandler.h:
+ (QNetworkReplyHandler):
+ * platform/network/qt/QtMIMETypeSniffer.h:
+ (QtMIMETypeSniffer):
+ * platform/network/qt/SocketStreamHandlePrivate.h:
+ (SocketStreamHandlePrivate):
+ * platform/qt/GamepadsQt.cpp:
+ (GamepadDeviceLinuxQt):
+ (GamepadsQt):
+ * platform/qt/SharedTimerQt.cpp:
+ (SharedTimerQt):
+
+2012-08-14 Andrei Onea <onea@adobe.com>
+
+ [CSSRegions]regionOverset is computed as "overset" even though the region is not the last in the chain
+ https://bugs.webkit.org/show_bug.cgi?id=93102
+
+ Reviewed by Eric Seidel.
+
+ Making Element.webkitRegionOverset return "overset" only for the last region in a region chain,
+ if the content cannot fit inside it, to reflect current spec. http://www.w3.org/TR/css3-regions/#dom-region-regionoverset
+
+ * rendering/RenderFlowThread.cpp:
+ (WebCore::RenderFlowThread::computeOverflowStateForRegions):
+
+2012-08-14 Jan Keromnes <janx@linux.com>
+
+ Web Inspector: Render breakpoint gutter markers and execution line in CodeMirrorTextEditor
+ https://bugs.webkit.org/show_bug.cgi?id=93686
+
+ Reviewed by Pavel Feldman.
+
+ Divided TextEditor.addDecoration into addBreakpoint, setExecutionLine
+ and addDecoration. Same for removeDecoration. Render breakpoint
+ markers and execution line in CodeMirrorTextEditor.
+
+ * inspector/front-end/CodeMirrorTextEditor.js:
+ (WebInspector.CodeMirrorTextEditor):
+ (WebInspector.CodeMirrorTextEditor.prototype._onGutterClick):
+ (WebInspector.CodeMirrorTextEditor.prototype.addBreakpoint):
+ (WebInspector.CodeMirrorTextEditor.prototype.removeBreakpoint):
+ (WebInspector.CodeMirrorTextEditor.prototype.setExecutionLine):
+ (WebInspector.CodeMirrorTextEditor.prototype.clearExecutionLine):
+ (WebInspector.CodeMirrorTextEditor.prototype.addDecoration):
+ (WebInspector.CodeMirrorTextEditor.prototype.removeDecoration):
+ (WebInspector.CodeMirrorTextEditor.prototype.highlightLine):
+ (WebInspector.CodeMirrorTextEditor.prototype.clearLineHighlight):
+ (WebInspector.CodeMirrorTextEditor.prototype.removeAttribute):
+ * inspector/front-end/DefaultTextEditor.js:
+ (WebInspector.DefaultTextEditor.prototype._onMouseDown):
+ (WebInspector.DefaultTextEditor.prototype.addBreakpoint):
+ (WebInspector.DefaultTextEditor.prototype.removeBreakpoint):
+ (WebInspector.DefaultTextEditor.prototype.setExecutionLine):
+ (WebInspector.DefaultTextEditor.prototype.clearExecutionLine):
+ (WebInspector.DefaultTextEditor.prototype.addDecoration):
+ (WebInspector.DefaultTextEditor.prototype.removeDecoration):
+ * inspector/front-end/JavaScriptSourceFrame.js:
+ (WebInspector.JavaScriptSourceFrame):
+ (WebInspector.JavaScriptSourceFrame.prototype._addBreakpointDecoration):
+ (WebInspector.JavaScriptSourceFrame.prototype._removeBreakpointDecoration):
+ (WebInspector.JavaScriptSourceFrame.prototype.setExecutionLine):
+ (WebInspector.JavaScriptSourceFrame.prototype.clearExecutionLine):
+ (WebInspector.JavaScriptSourceFrame.prototype._handleGutterClick):
+ * inspector/front-end/TextEditor.js:
+ (WebInspector.TextEditor.prototype.addBreakpoint):
+ (WebInspector.TextEditor.prototype.removeBreakpoint):
+ (WebInspector.TextEditor.prototype.setExecutionLine):
+ (WebInspector.TextEditor.prototype.clearExecutionLine):
+ (WebInspector.TextEditor.prototype.addDecoration):
+ (WebInspector.TextEditor.prototype.removeDecoration):
+ * inspector/front-end/cmdevtools.css:
+ (.CodeMirror):
+ (.cm-highlight):
+ (@-webkit-keyframes fadeout):
+ (to):
+ (.cm-breakpoint):
+ (.cm-breakpoint-disabled):
+ (.cm-breakpoint-conditional):
+ (.cm-execution-line):
+ (.webkit-html-message-bubble):
+ (.webkit-html-warning-message):
+ (.webkit-html-error-message):
+ (.webkit-html-message-line):
+ (.webkit-html-message-line-hover):
+
+2012-08-13 Adrienne Walker <enne@google.com>
+
+ REGRESSION (r109851): Video controls do not render
+ https://bugs.webkit.org/show_bug.cgi?id=93859
+
+ Reviewed by Simon Fraser.
+
+ Because video layers can't act as an ancestor composited layer whose
+ backing can be shared by child layers, any child layer of a video
+ layer needs to be put into its own composited layer. Because this is
+ technically overlap, the "overlap" indirect compositing reason is
+ reused for this case.
+
+ Test: compositing/video/video-controls-layer-creation.html
+
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::computeCompositingRequirements):
+
+2012-08-14 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ WebKitTestRunner needs layoutTestController.dumpResourceLoadCallbacks
+ https://bugs.webkit.org/show_bug.cgi?id=42332
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Provide build for mac.
+
+ * WebCore.exp.in: Added __ZNK7WebCore19ResourceRequestBase20firstPartyForCookiesEv.
+
+2012-08-14 Adam Barth <abarth@webkit.org>
+
+ DOMWindow::document() should not reach through Frame
+ https://bugs.webkit.org/show_bug.cgi?id=27640
+
+ Reviewed by Eric Seidel.
+
+ Originally, the lifetime of DOMWindow was similar to that of Frame in
+ that it was reused for each document that was displayed in the Frame.
+ To fix some tricky security issues, all modern browsers use a "split
+ window" architecture whereby the DOMWindow is not reused by each
+ Document in a Frame. Instead a JavaScript "window shell" object
+ redirects JavaScript references to the active Document's DOMWindow.
+
+ When we implemented split windows, we left DOMWindow attached to the
+ Frame and attempted to keep it in sync with the Document via a lot of
+ delicate code. One of the main problems with this approach is that
+ finding the DOMWindow associated with a Document or the Document
+ associated with a DOMWindow required traversing through the Frame.
+ Because there is a many-to-one relationship between both Documents and
+ Frames (as well as DOMWindows and Frames), this traversal is error
+ prone and not always available (e.g., for inactive documents).
+
+ This patch moves the "owning" reference for DOMWindow to Document so
+ that we can directly traverse from Document to DOMWindow. For
+ traversing from DOMWindow to Document, each DOMWindow keeps a Document
+ pointer via a ContextDestructionObserver base class.
+
+ The main sublties in this patch are related to situations in which
+ there isn't precisely a one-to-one relationship between Documents and
+ DOMWindows. Previously, these situations were handled implicitly by the
+ "flex and slop" of having separate Document and DOMWindow pointers in
+ Frame. In this patch, these sublties are made explicit via
+ Document::takeDOMWindowFrom, which explicitly transfers the DOMWindow
+ (as well as ASSERTs that all the relevant objects exist in a sensible
+ constellation).
+
+ * WebCore.exp.in:
+ - These functions are no longer exported because they're inline.
+ * bindings/js/ScriptController.cpp:
+ (WebCore::ScriptController::clearWindowShell):
+ * bindings/js/ScriptController.h:
+ (ScriptController):
+ - clearWindowShell now explicitly takes the new DOMWindow that will
+ be pointed to by the WindowShell. Previously, clearWindowShell
+ would implicitly create the new DOMWindow by accessing
+ Frame::domWindow (which used to lazily create the DOMWindow).
+ * bindings/v8/BindingState.cpp:
+ (WebCore::currentDocument):
+ * bindings/v8/BindingState.h:
+ (WebCore):
+ - currentDocument provides a directly path from the current
+ v8::Context to the Document (by way of DOMWindow). Previously,
+ code transited via the Frame using currentFrame.
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::clearWindowShell):
+ * bindings/v8/ScriptController.h:
+ (ScriptController):
+ - Mirror JSC changes to clearWindowShell.
+ * bindings/v8/V8Utilities.cpp:
+ (WebCore::getScriptExecutionContext):
+ - Update getScriptExecutionContext to transit directly from the
+ DOMWindow to the Document rather than detouring via the Frame.
+ * dom/ContextDestructionObserver.cpp:
+ (WebCore::ContextDestructionObserver::ContextDestructionObserver):
+ (WebCore::ContextDestructionObserver::~ContextDestructionObserver):
+ (WebCore):
+ (WebCore::ContextDestructionObserver::observeContext):
+ * dom/ContextDestructionObserver.h:
+ (ContextDestructionObserver):
+ - When we transfer a DOMWindow from one Document to another, we
+ need to update the Document pointer in the DOMWindow to point to
+ the new Document. The DOMWindow holds the Document pointer via
+ ContextDestructionObserver, so this patch teaches
+ ContextDestructionObserver how to change which
+ ScriptExecutionContext it is observing. This code mirrors similar
+ code in FrameDestructionObserver.
+ * dom/Document.cpp:
+ (WebCore::Document::~Document):
+ (WebCore::Document::detach):
+ (WebCore::Document::createDOMWindow):
+ - createDOMWindow now explicitly creates the DOMWindow. Previously,
+ we created the DOMWindow implicitly in Frame::domWindow when it
+ was first accessed.
+ (WebCore::Document::takeDOMWindowFrom):
+ - takeDOMWindowFrom explicitly transfers the DOMWindow from one
+ Document to another. The main benefit of this function is the
+ ASSERTs that ensure that the Document, DOMWindow, and Frame all
+ point to each other the correct configuration.
+ (WebCore::Document::didUpdateSecurityOrigin):
+ - We no longer need to keep the SecurityOrigin pointer in DOMWindow
+ in sync with the Document because DOMWindow no longer has a
+ SecurityOrigin object.
+ * dom/Document.h:
+ (Document):
+ (WebCore::Document::domWindow):
+ * history/CachedFrame.cpp:
+ (WebCore::CachedFrame::CachedFrame):
+ (WebCore::CachedFrame::destroy):
+ * history/CachedFrame.h:
+ (CachedFrameBase):
+ - Previously, CachedFrame held the Document and the DOMWindow with
+ separate pointers. Now, the CachedFrame holds the DOMWnidow via
+ the Document, which makes adding and removing Documents from the
+ PageCache simpler because we don't need to keep the Frame's
+ DOMWindow pointer synchronized.
+ * loader/DocumentWriter.cpp:
+ (WebCore::DocumentWriter::begin):
+ - begin now explicitly creates the DOMWindow and transfers
+ DOMWindow when performing a "secure transition." Previously, both
+ of these processes were handled implicitly: the DOMWindow was
+ created implicitly by Frame::domWindow, and the DOMWindow was
+ reused during navigation by not clearing Frame::m_domWindow.
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::cancelAndClear):
+ (WebCore::FrameLoader::clear):
+ - These functions now pass the new Document so that we have access
+ to the new DOMWindow in clearDOMWindowShell.
+ (WebCore::FrameLoader::setOpener):
+ - We no longer need to keep the DOMWindow's SecurityOrigin in sync
+ with the Document's SecurityOrigin because DOMWindow no longer
+ has a duplicate SecurityOrigin pointer.
+ (WebCore::FrameLoader::open):
+ - We no longer need to keep the Frame::m_domWindow in sync with the
+ Document because the Document carries its own DOMWindow.
+ * loader/FrameLoader.h:
+ (FrameLoader):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::DOMWindow):
+ - DOMWindow now uses Document as its primary context object. In a
+ future patch, we should remove the FrameDestructionObserver base
+ class and instead access the frame via DOMWindow::document().
+ (WebCore::DOMWindow::didSecureTransitionTo):
+ - Notify the DOMWindow that it is now associated with a new
+ Document.
+ (WebCore::DOMWindow::scriptExecutionContext):
+ (WebCore::DOMWindow::document):
+ (WebCore::DOMWindow::securityOrigin):
+ - These functions now retrieve the Document directly rather than
+ transiting via the Frame.
+ * page/DOMWindow.h:
+ (WebCore::DOMWindow::create):
+ (DOMWindow):
+ * page/Frame.cpp:
+ (WebCore::Frame::setDocument):
+ - Add more ASSERTs that the Document and its DOMWindow are properly
+ wired up to this Frame.
+ (WebCore::Frame::domWindow):
+ - Rather than lazily creating the DOMWindow, this function now just
+ accesses the already-created DOMWindow on Document. Eventually,
+ all callers should retreive the DOMWindow from the Document
+ directly.
+ * page/Frame.h:
+ (WebCore::Frame::existingDOMWindow):
+ - The DOMWindow always exists, so there is no distinction between
+ domWindow() and existingDOMWindow().
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::open):
+ - Previously, open would exit early if it was unable to find its
+ ScriptExecutionContext (e.g., if the ScriptExecutionContext was
+ inactive). Now we can always locate the ScriptExecutionContext
+ and so we need to test whether the ScriptExecutionContext is
+ still attached to the Page before accessing Settings. Tests
+ verify that the platform-visible behaviors of XMLHttpRequest are
+ unchanged, even for XMLHttpRequest constructors associated with
+ inactive Documents.
+ * xml/XSLTProcessor.cpp:
+ (WebCore::XSLTProcessor::createDocumentFromSource):
+ - Make it explicit that XSLT re-uses the DOMWindow from the source
+ Document in the transformed Document.
+
+2012-08-14 Levi Weintraub <leviw@chromium.org>
+
+ Accumulating LayoutUnits with floats for determining block preferred width can lead to wrapping
+ https://bugs.webkit.org/show_bug.cgi?id=93513
+
+ Reviewed by Eric Seidel.
+
+ Sub-pixel values from floats are subject to small losses in precision when accumulated with
+ floating point values, as we do in RenderBlock. This patch adds a new method to FractionalLayoutUnit --
+ ceilToFloat -- which guarantees us a floating point value at least as big as our original LayoutUnit
+ value, and uses it along with ceiledLayoutUnit to avoid underprovisioning RenderBlock's preferred
+ widths due to lost precision.
+
+ Test: fast/sub-pixel/block-preferred-widths-with-sub-pixel-floats.html
+
+ * platform/FractionalLayoutUnit.h:
+ (WebCore::FractionalLayoutUnit::ceilToFloat): Returns a float value the same or larger than the
+ FractionalLayoutUnit value.
+ (FractionalLayoutUnit):
+ (WebCore::FractionalLayoutUnit::epsilon): Now returns 0 when sub-pixel is disabled.
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::computeLogicalLocationForFloat): Adding a LayoutUnit::epsilon fudge factor
+ for fitting floats. This is probably necessary due to precision being lost elsewhere.
+ (WebCore::RenderBlock::computeInlinePreferredLogicalWidths): Ensure no precision is lost due to conversion
+ when accumulating our min/max width with floats.
+
+2012-08-14 Jer Noble <jer.noble@apple.com>
+
+ Fullscreen/normal volume sliders don't stay in sync
+ https://bugs.webkit.org/show_bug.cgi?id=93867
+
+ Reviewed by Eric Carlson.
+
+ Change the full screen volume slider, if present, when the media element's volume
+ changes.
+
+ Test: media/video-controls-fullscreen-volume.html
+
+ * html/shadow/MediaControlRootElement.cpp:
+ (WebCore::MediaControlRootElement::changedVolume):
+
+2012-08-14 Olivier Blin <olivier.blin@softathome.com>
+
+ Remove unused yyparse method in CSSParser
+ https://bugs.webkit.org/show_bug.cgi?id=93986
+
+ Reviewed by Darin Adler.
+
+ This method is unused and not even declared.
+
+ No new tests, it just removes unused code.
+
+ * css/CSSParser.h:
+
+2012-08-14 Zan Dobersek <zandobersek@gmail.com>
+
+ [Gtk] Include all files guarded by ENABLE_* guards in Source/WebCore/GNUmakefile.list.am into the build
+ https://bugs.webkit.org/show_bug.cgi?id=90696
+
+ Reviewed by Philippe Normand.
+
+ Include all files in the Autotools build that are currently guarded by ENABLE_* guards in
+ the WebCore GNUmakefile.list.am, regardless of the feature being enabled. Compilation should
+ rely on proper use of guards inside source files and preprocessor work to keep the disabled
+ features out.
+
+ The only exception left is the ENABLE_WEBGL guard that includes the ANGLE into compilation
+ only if WebGL feature is enabled.
+
+ No new tests - no new functionality.
+
+ * GNUmakefile.am:
+ * GNUmakefile.list.am:
+ * bindings/gobject/GNUmakefile.am: Add StorageInfo to the DOM bindings, despite
+ the feature being currently disabled.
+
+2012-08-14 Gregg Tavares <gman@google.com>
+
+ Plumb through EXT_debug_marker entry points
+ https://bugs.webkit.org/show_bug.cgi?id=93860
+
+ Reviewed by Kenneth Russell.
+
+ insertEventMarkerEXT, pushGroupMarkerEXT, popGroupMarkerEXT,
+ are all entry points exposed by the OpenGL ES
+ EXT_debug_marker extension
+
+ No new tests as no new functionality exposed to web.
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore):
+ (WebCore::WebGLRenderingContext::create):
+ * platform/chromium/support/Extensions3DChromium.cpp:
+ (WebCore::Extensions3DChromium::insertEventMarkerEXT):
+ (WebCore):
+ (WebCore::Extensions3DChromium::pushGroupMarkerEXT):
+ (WebCore::Extensions3DChromium::popGroupMarkerEXT):
+ * platform/graphics/Extensions3D.h:
+ (Extensions3D):
+ * platform/graphics/chromium/Extensions3DChromium.h:
+ (Extensions3DChromium):
+ * platform/graphics/opengl/Extensions3DOpenGL.cpp:
+ (WebCore::Extensions3DOpenGL::insertEventMarkerEXT):
+ (WebCore):
+ (WebCore::Extensions3DOpenGL::pushGroupMarkerEXT):
+ (WebCore::Extensions3DOpenGL::popGroupMarkerEXT):
+ * platform/graphics/opengl/Extensions3DOpenGL.h:
+ (Extensions3DOpenGL):
+ * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
+ (WebCore::Extensions3DOpenGLES::insertEventMarkerEXT):
+ (WebCore):
+ (WebCore::Extensions3DOpenGLES::pushGroupMarkerEXT):
+ (WebCore::Extensions3DOpenGLES::popGroupMarkerEXT):
+ * platform/graphics/opengl/Extensions3DOpenGLES.h:
+ (Extensions3DOpenGLES):
+
+2012-06-24 Robert Hogan <robert@webkit.org>
+
+ CSS 2.1 failure: Word-spacing affects each space and non-breaking space
+ https://bugs.webkit.org/show_bug.cgi?id=89826
+
+ Reviewed by Eric Seidel.
+
+ Add word spacing to consecutive spaces in a run per http://www.w3.org/TR/CSS21/text.html#spacing-props.
+
+ Test: fast/css/word-spacing-characters.html
+ fast/css/word-spacing-characters-complex-text.html
+ fast/css/word-spacing-characters-linebreak.html
+ css2.1/20110323/word-spacing-characters-002.htm
+ css2.1/20110323/word-spacing-characters-003.htm
+ css2.1/20110323/word-spacing-remove-space-001.htm
+ css2.1/20110323/word-spacing-remove-space-002.htm
+ css2.1/20110323/word-spacing-remove-space-003.htm
+ css2.1/20110323/word-spacing-remove-space-004.htm
+ css2.1/20110323/word-spacing-remove-space-005.htm
+ css2.1/20110323/word-spacing-remove-space-006.htm
+ css2.1/20110323/c541-word-sp-001.htm
+ css2.1/20110323/c541-word-sp-000.htm
+
+ * platform/graphics/WidthIterator.cpp:
+ (WebCore::WidthIterator::advance): All spaces (ordinary space or &nbsp;) get word-spacing added, even
+ if they are consecutive.
+ * platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp:
+ (WebCore::HarfBuzzShaperBase::isWordEnd): ditto, but for the complex text case on Chromium. Had to use
+ m_run rather than m_normalizedBuffer here as m_normalizedBuffer turns tabs into spaces! Unlike the simple
+ text path, '\n' gets word-spacing - I observed this from fast/text/atsui-spacing-features.html but can't
+ find it specified anywhere.
+ * platform/graphics/harfbuzz/HarfBuzzShaperBase.h:
+ (WebCore::HarfBuzzShaperBase::isCodepointSpace):
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::LineBreaker::nextLineBreak): Tested by word-spacing-linebreak.html
+
+2012-08-14 Antoine Labour <piman@chromium.org>
+
+ [chromium] race between CCLayerTreeHostImpl::releaseContentsTextures and CCThreadProxy::beginFrameCompleteOnImplThread
+ https://bugs.webkit.org/show_bug.cgi?id=93684
+
+ Reviewed by James Robinson.
+
+ This keeps track of whether we're between the beginFrame post and the
+ commit when releaseContentsTextures comes, and if that is the case, we
+ prune the texture uploads, keep the "textures purged" flag on and kick a
+ new commit.
+
+ Added CCLayerTreeHostTestEvictTextures test.
+
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+ (WebCore::CCLayerTreeHostImpl::CCLayerTreeHostImpl):
+ (WebCore::CCLayerTreeHostImpl::beginFramePosted):
+ (WebCore):
+ (WebCore::CCLayerTreeHostImpl::commitComplete):
+ (WebCore::CCLayerTreeHostImpl::canDraw):
+ (WebCore::CCLayerTreeHostImpl::releaseContentsTextures):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
+ (CCLayerTreeHostImpl):
+ (WebCore::CCLayerTreeHostImpl::contentsTexturesPurged):
+ (WebCore::CCLayerTreeHostImpl::contentsTexturesWerePurgedSinceLastBeginFrame):
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+ (WebCore::CCSingleThreadProxy::stop):
+ (WebCore::CCSingleThreadProxy::commitAndComposite):
+ * platform/graphics/chromium/cc/CCTextureUpdateController.h:
+ (CCTextureUpdateController):
+ * platform/graphics/chromium/cc/CCTextureUpdateQueue.cpp:
+ (WebCore::CCTextureUpdateQueue::clearUploads):
+ (WebCore):
+ * platform/graphics/chromium/cc/CCTextureUpdateQueue.h:
+ (CCTextureUpdateQueue):
+ * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+ (WebCore::CCThreadProxy::scheduledActionBeginFrame):
+ (WebCore::CCThreadProxy::beginFrameCompleteOnImplThread):
+ (WebCore::CCThreadProxy::layerTreeHostClosedOnImplThread):
+
+2012-08-14 Yong Li <yoli@rim.com>
+
+ [BlackBerry] Pass URL String's 8-bit buffer directly to platform layer when possible
+ https://bugs.webkit.org/show_bug.cgi?id=93861
+
+ Reviewed by Rob Buis.
+
+ PR# 187605.
+ URL strings and HTTP header strings usually use 8-bit buffers internally. We can
+ just pass the buffers to platform calls when only Latin1 strings are needed.
+
+ * platform/blackberry/ReadOnlyLatin1String.h: Added.
+ (WebCore):
+ (ReadOnlyLatin1String): A utility class that uses either WTF::CString or WTF::String's 8-bit buffer.
+ (WebCore::ReadOnlyLatin1String::ReadOnlyLatin1String): Can only be constructed with WTF::String for now.
+ (WebCore::ReadOnlyLatin1String::data):
+ (WebCore::ReadOnlyLatin1String::length):
+ * platform/network/blackberry/ResourceRequestBlackBerry.cpp:
+ (WebCore::ResourceRequest::initializePlatformRequest):
+ * platform/network/blackberry/SocketStreamHandleBlackBerry.cpp:
+ (WebCore::SocketStreamHandle::SocketStreamHandle):
+
+2012-08-14 Christophe Dumez <christophe.dumez@intel.com>
+
+ Fix LayoutTests/canvas/philip/tests/2d.text.draw.space.collapse.nonspace.html
+ https://bugs.webkit.org/show_bug.cgi?id=92974
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Replace space characters by U+0020 SPACE characters in
+ CanvasRenderingContext2D::drawTextInternal() in order to
+ comply with the HTML Canvas 2D Context specification:
+ - http://www.w3.org/TR/2dcontext/#drawing-text-to-the-canvas
+
+ No new tests, already tested by canvas/philip/tests/2d.text.draw.space.collapse.nonspace.html.
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::replaceCharacterInString):
+ (WebCore):
+ (WebCore::CanvasRenderingContext2D::drawTextInternal):
+
+2012-08-14 George Staikos <staikos@webkit.org>
+
+ [BlackBerry] Avoid assertion failure in App Cache.
+ https://bugs.webkit.org/show_bug.cgi?id=93926
+
+ Reviewed by Rob Buis.
+
+ Short-circuit data url decoding if we know it's not a data URL to
+ avoid an assertion failure in debug mode. No functional change.
+
+ No new tests since this is just a debug mode assertion failure.
+
+ * loader/appcache/ApplicationCacheGroup.cpp:
+ (WebCore::ApplicationCacheGroup::createResourceHandle):
+
+2012-08-14 Thiago Marcos P. Santos <thiago.santos@intel.com>
+
+ [EFL] Do not warn when the default theme is not found
+ https://bugs.webkit.org/show_bug.cgi?id=93968
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Even if you are using a custom theme, we always try to load first the
+ theme at the default path (that may or may not exist). In the case it
+ doesn't exist and you have a custom theme, we were always getting a
+ misleading error message.
+
+ * platform/efl/RenderThemeEfl.cpp:
+ (WebCore::RenderThemeEfl::createEdje):
+
+2012-08-14 Joshua Bell <jsbell@chromium.org>
+
+ IndexedDB: Pass cursor continue results back in callback
+ https://bugs.webkit.org/show_bug.cgi?id=92278
+
+ Reviewed by Tony Chang.
+
+ Supply the updated cursor key/primaryKey/value in the success callback,
+ rather than forcing the callee to make three calls into the back end to
+ fetch them. Callbacks onSuccess(cursor) and onSuccessWithContinuation()
+ are given the three new payload parameters (and the latter is renamed.)
+
+ No new tests - no behavioral changes.
+
+ * Modules/indexeddb/IDBCallbacks.h: Updated callbacks.
+ (IDBCallbacks):
+ * Modules/indexeddb/IDBCursor.cpp:
+ (WebCore::IDBCursor::setValueReady): Takes values rather than fetching them.
+ * Modules/indexeddb/IDBCursor.h:
+ (IDBCursor):
+ * Modules/indexeddb/IDBCursorBackendImpl.cpp: Delete accessors.
+ (WebCore::IDBCursorBackendImpl::advanceInternal): Pass along updated cursor state.
+ (WebCore::IDBCursorBackendImpl::continueFunctionInternal): Ditto.
+ * Modules/indexeddb/IDBCursorBackendImpl.h:
+ (IDBCursorBackendImpl): Delete accessors from interface...
+ (WebCore::IDBCursorBackendImpl::key): ...but keep them for use within back-end.
+ (WebCore::IDBCursorBackendImpl::primaryKey):
+ (WebCore::IDBCursorBackendImpl::value):
+ * Modules/indexeddb/IDBCursorBackendInterface.h: Delete accessors.
+ * Modules/indexeddb/IDBIndexBackendImpl.cpp:
+ (WebCore::IDBIndexBackendImpl::openCursorInternal): Pass along new cursor state.
+ * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
+ (WebCore::IDBObjectStoreBackendImpl::openCursorInternal): Ditto.
+ * Modules/indexeddb/IDBRequest.cpp:
+ (WebCore::IDBRequest::setResultCursor): Stash updated cursor state until dispatch.
+ (WebCore::IDBRequest::onSuccess):
+ (WebCore::IDBRequest::dispatchEvent): Update cursor with new state.
+ * Modules/indexeddb/IDBRequest.h:
+ (IDBRequest):
+ * inspector/InspectorIndexedDBAgent.cpp: Update iteration code to use new callbacks.
+ (WebCore):
+
+2012-08-14 Arvid Nilsson <anilsson@rim.com>
+
+ [BlackBerry] Get rid of glCopyTexImage2D in Canvas and WebGL code paths
+ https://bugs.webkit.org/show_bug.cgi?id=93614
+
+ Reviewed by Antonio Gomes.
+
+ We used to set up resource sharing between the compositing thread
+ context and the Canvas and WebGL contexts, and use glCopyTexImage2D to
+ get a copy of the framebuffer to use as front buffer for compositing
+ purposes.
+
+ Now we instead create an EGLImage and blit the Canvas/WebGL output to
+ it. The compositing thread creates a texture from the EGLImage in order
+ to composite the output.
+
+ Created a new EGLImageLayerWebKitThread base class that handles the
+ EGLImage and does the blitting. CanvasLayerWebKitThread and
+ WebGLLayerWebKitThread now inherit from this new base class.
+
+ However, we need to be careful to restore state after the blit because
+ it's done using the Canvas/WebGL context.
+
+ The BlackBerry implementation of GraphicsContext3D::prepareTexture()
+ was changed to no longer call glCopyTexImage, and
+ GraphicsContext3D::platformLayer() now returns the target texture
+ directly.
+
+ Reviewed internally by Filip Spacek.
+
+ PR 188472
+
+ No change in behavior, new tests.
+
+ * PlatformBlackBerry.cmake:
+ * platform/graphics/blackberry/CanvasLayerWebKitThread.cpp:
+ (WebCore::CanvasLayerWebKitThread::CanvasLayerWebKitThread):
+ (WebCore::CanvasLayerWebKitThread::~CanvasLayerWebKitThread):
+ (WebCore::CanvasLayerWebKitThread::setDevice):
+ (WebCore::CanvasLayerWebKitThread::makeContextCurrent):
+ (WebCore::CanvasLayerWebKitThread::textureSize):
+ (WebCore):
+ (WebCore::CanvasLayerWebKitThread::textureID):
+ * platform/graphics/blackberry/CanvasLayerWebKitThread.h:
+ (CanvasLayerWebKitThread):
+ * platform/graphics/blackberry/EGLImageLayerCompositingThreadClient.cpp: Added.
+ (WebCore):
+ (WebCore::EGLImageLayerCompositingThreadClient::~EGLImageLayerCompositingThreadClient):
+ (WebCore::EGLImageLayerCompositingThreadClient::uploadTexturesIfNeeded):
+ (WebCore::EGLImageLayerCompositingThreadClient::drawTextures):
+ (WebCore::EGLImageLayerCompositingThreadClient::deleteTextures):
+ (WebCore::EGLImageLayerCompositingThreadClient::bindContentsTexture):
+ (WebCore::EGLImageLayerCompositingThreadClient::setImage):
+ * platform/graphics/blackberry/EGLImageLayerCompositingThreadClient.h: Added.
+ (WebCore):
+ (EGLImageLayerCompositingThreadClient):
+ (WebCore::EGLImageLayerCompositingThreadClient::create):
+ (WebCore::EGLImageLayerCompositingThreadClient::layerCompositingThreadDestroyed):
+ (WebCore::EGLImageLayerCompositingThreadClient::layerVisibilityChanged):
+ (WebCore::EGLImageLayerCompositingThreadClient::EGLImageLayerCompositingThreadClient):
+ * platform/graphics/blackberry/EGLImageLayerWebKitThread.cpp: Added.
+ (WebCore):
+ (WebCore::EGLImageLayerWebKitThread::EGLImageLayerWebKitThread):
+ (WebCore::EGLImageLayerWebKitThread::~EGLImageLayerWebKitThread):
+ (WebCore::EGLImageLayerWebKitThread::setNeedsDisplay):
+ (WebCore::EGLImageLayerWebKitThread::makeContextCurrent):
+ (WebCore::EGLImageLayerWebKitThread::updateTextureContentsIfNeeded):
+ (WebCore::EGLImageLayerWebKitThread::commitPendingTextureUploads):
+ (WebCore::EGLImageLayerWebKitThread::createImageIfNeeded):
+ (WebCore::EGLImageLayerWebKitThread::createShaderIfNeeded):
+ (WebCore::EGLImageLayerWebKitThread::drawTexture):
+ * platform/graphics/blackberry/EGLImageLayerWebKitThread.h: Copied from Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.h.
+ (WebCore):
+ (EGLImageLayerWebKitThread):
+ * platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp:
+ (WebCore::GraphicsContext3D::prepareTexture):
+ (WebCore):
+ (WebCore::GraphicsContext3D::platformTexture):
+ * platform/graphics/blackberry/LayerCompositingThread.cpp:
+ (WebCore::LayerCompositingThread::drawTextures):
+ (WebCore::LayerCompositingThread::releaseTextureResources):
+ * platform/graphics/blackberry/LayerCompositingThread.h:
+ (WebCore::LayerCompositingThread::setClient):
+ (LayerCompositingThread):
+ * platform/graphics/blackberry/LayerData.h:
+ (WebCore::LayerData::LayerData):
+ (LayerData):
+ * platform/graphics/blackberry/LayerWebKitThread.cpp:
+ (WebCore::LayerWebKitThread::~LayerWebKitThread):
+ (WebCore::LayerWebKitThread::updateTextureContentsIfNeeded):
+ (WebCore::LayerWebKitThread::commitPendingTextureUploads):
+ (WebCore::LayerWebKitThread::commitOnCompositingThread):
+ * platform/graphics/blackberry/LayerWebKitThread.h:
+ (LayerWebKitThread):
+ * platform/graphics/blackberry/WebGLLayerWebKitThread.cpp:
+ (WebCore::WebGLLayerWebKitThread::WebGLLayerWebKitThread):
+ (WebCore::WebGLLayerWebKitThread::updateTextureContentsIfNeeded):
+ (WebCore::WebGLLayerWebKitThread::makeContextCurrent):
+ (WebCore):
+ (WebCore::WebGLLayerWebKitThread::textureSize):
+ (WebCore::WebGLLayerWebKitThread::textureID):
+ * platform/graphics/blackberry/WebGLLayerWebKitThread.h:
+ (WebGLLayerWebKitThread):
+ * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
+ (WebCore):
+ (WebCore::GraphicsContext3D::prepareTexture):
+
+2012-08-14 Arvid Nilsson <anilsson@rim.com>
+
+ [BlackBerry] Texture cache must adapt to HashMap changes
+ https://bugs.webkit.org/show_bug.cgi?id=93955
+
+ Reviewed by Rob Buis.
+
+ This was fixed locally, but not upstreamed yet.
+
+ Based on an original patch by Konrad Piascik.
+
+ * platform/graphics/blackberry/TextureCacheCompositingThread.cpp:
+ (WebCore::TextureCacheCompositingThread::textureForTiledContents):
+
+2012-08-14 Arvid Nilsson <anilsson@rim.com>
+
+ [BlackBerry] LayerCompositingThread.h doesn't compile
+ https://bugs.webkit.org/show_bug.cgi?id=93956
+
+ Reviewed by Rob Buis.
+
+ I forgot to upstream this local change.
+
+ * platform/graphics/blackberry/LayerCompositingThread.h:
+ (WebCore::LayerOverride::setBounds):
+ (WebCore::LayerOverride::setOpacity):
+
+2012-08-14 Ed Baker <edbaker@rim.com>
+
+ [BlackBerry] LayerAnimation is not immutable, which makes dereferencing an expensive operation
+ https://bugs.webkit.org/show_bug.cgi?id=93946
+
+ Reviewed by Antonio Gomes.
+
+ Make LayerAnimation immutable so it can be dereferenced from the main
+ WebKit thread without having to dispatch to the compositing thread,
+ which is an expensive operation.
+
+ TransformOperation and TimingFunction need to be made thread safe as
+ they are referenced in LayerAnimation, but that effort is being tracked
+ by a separate bug, #86483.
+
+ Reviewed internally by Arvid Nilsson.
+
+ No change in behavior, no new tests.
+
+ * platform/graphics/blackberry/LayerAnimation.h:
+ (WebCore::LayerAnimation::name):
+ (LayerAnimation):
+ (WebCore::LayerAnimation::LayerAnimation):
+ (WebCore::LayerAnimation::setName):
+ * platform/graphics/blackberry/LayerCompositingThread.cpp:
+ (WebCore):
+ * platform/graphics/blackberry/LayerCompositingThread.h:
+ (LayerCompositingThread):
+ * platform/graphics/blackberry/LayerWebKitThread.cpp:
+ (WebCore::LayerWebKitThread::~LayerWebKitThread):
+
+2012-08-14 Arvid Nilsson <anilsson@rim.com>
+
+ [BlackBerry] GraphicsLayerBlackBerry::willBeDestroyed() must call superclass implementation
+ https://bugs.webkit.org/show_bug.cgi?id=93947
+
+ Reviewed by Rob Buis.
+
+ This was fixed locally, but not upstreamed yet.
+
+ Based on an original patch by Konrad Piascik.
+
+ * platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:
+ (WebCore::GraphicsLayerBlackBerry::willBeDestroyed):
+
+2012-08-14 Vineet Chaudhary <rgf748@motorola.com>
+
+ Remove custom JSC bindings from ConvolverNode.idl
+ https://bugs.webkit.org/show_bug.cgi?id=93952
+
+ Reviewed by Kentaro Hara.
+
+ We should remove custom bindings as CodeGenerator uses UNUSED_PARAM macro.
+
+ No new tests. No behavioural changes.
+ All tests under webaudio/* should behave same.
+
+ * GNUmakefile.list.am: Removed JSConvolverNodeCustom.cpp from builds.
+ * Modules/webaudio/ConvolverNode.idl: Removed [JSCustomSetter].
+ * UseJSC.cmake: Removed JSConvolverNodeCustom.cpp from builds.
+ * WebCore.gypi: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto
+ * bindings/js/JSConvolverNodeCustom.cpp: Removed.
+
+2012-08-14 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: add external test runner for running inspector front-end tests with no TestRunner infrastructure.
+ https://bugs.webkit.org/show_bug.cgi?id=93833
+
+ Reviewed by Yury Semikhatsky.
+
+ Added mock test runner that allows running front-end layout tests.
+ InspectorFrontendAPI can now dispatch whatever it receives from its embedder (opener).
+
+ * inspector/front-end/InspectorFrontendAPI.js:
+ (InspectorFrontendAPI.evaluateForTest):
+ (InspectorFrontendAPI.dispatch):
+ (InspectorFrontendAPI.loadCompleted):
+ (.onMessageFromOpener):
+
+2012-08-14 Allan Sandfeld Jensen <allan.jensen@nokia.com>
+
+ [Qt] Incomplete repaint of link underline
+ https://bugs.webkit.org/show_bug.cgi?id=66034
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ When trying to point a line of width 30, we end up painting on of width 31, because Qt
+ interprets the line as end-inclusive. So adjust for end-include/exclusive difference
+ before requesting the draw from Qt.
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::drawLine):
+
+2012-08-14 Mike West <mkwst@chromium.org>
+
+ Fix crash in http/tests/plugins/plugin-document-has-focus
+ https://bugs.webkit.org/show_bug.cgi?id=93949
+
+ Reviewed by Jochen Eisinger.
+
+ Covered by http/tests/plugins/plugin-document-has-focus.html. If that
+ doesn't crash, we're good!
+
+ * loader/SubframeLoader.cpp:
+ (WebCore::SubframeLoader::pluginIsLoadable):
+ Check the PluginDocument's ownerElement before derefing.
+
+2012-08-14 KwangYong Choi <ky0.choi@samsung.com>
+
+ [EFL] Fixed displaying buffering progress in the media control.
+ https://bugs.webkit.org/show_bug.cgi?id=75681
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ It is required "rangeRect" instead of "rect" to display buffering
+ progress properly.
+
+ * platform/efl/RenderThemeEfl.cpp:
+ (WebCore::RenderThemeEfl::paintMediaSliderTrack):
+
+2012-08-14 Yoshifumi Inoue <yosin@chromium.org>
+
+ [Forms] Copy Source/WebCore/html/shadow/TextControlInnerElements.{cpp,h} to SpinButtonElement.{cpp,h}
+ https://bugs.webkit.org/show_bug.cgi?id=93943
+
+ Reviewed by Kent Tamura.
+
+ This patch copys html/shadow/TextControlInnerElement.{cpp,h} to SpinButtonElement.{cpp,h} for
+ preparation of bug 93941, Set SpinButtonElement free from HTMLInputElement.
+
+ No new tests. This patch doesn't change behavior.
+
+ * html/shadow/SpinButtonElement.cpp: Copied from Source/WebCore/html/shadow/TextControlInnerElements.cpp.
+ * html/shadow/SpinButtonElement.h: Copied from Source/WebCore/html/shadow/TextControlInnerElements.h.
+
+2012-08-14 Mike West <mkwst@chromium.org>
+
+ Implement the plugin-types Content Security Policy directive.
+ https://bugs.webkit.org/show_bug.cgi?id=91919
+
+ Reviewed by Adam Barth.
+
+ The CSP 1.1 editor's draft defines the 'plugin-types' directive as a
+ mechanism for whitelisting only specific types of plugin content on a
+ page. A protected resource might trust only Flash content, for instance,
+ and could enforce that preference via a Content Security Policy of
+ 'plugin-types application/x-shockwave-flash'. Flash would load, no other
+ plugin type would.
+
+ Specification details available at: https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#plugin-types--experimental
+
+ This experimental directive is gated on the ENABLE_CSP_NEXT flag, which
+ is currently only enabled in Chromium.
+
+ Tests: http/tests/security/contentSecurityPolicy/1.1/plugintypes-invalid.html
+ http/tests/security/contentSecurityPolicy/1.1/plugintypes-mismatched-data.html
+ http/tests/security/contentSecurityPolicy/1.1/plugintypes-mismatched-url.html
+ http/tests/security/contentSecurityPolicy/1.1/plugintypes-notype-data.html
+ http/tests/security/contentSecurityPolicy/1.1/plugintypes-notype-url.html
+ http/tests/security/contentSecurityPolicy/1.1/plugintypes-nourl-allowed.html
+ http/tests/security/contentSecurityPolicy/1.1/plugintypes-nourl-blocked.html
+ http/tests/security/contentSecurityPolicy/1.1/plugintypes-url-01.html
+ http/tests/security/contentSecurityPolicy/1.1/plugintypes-url-02.html
+
+ * loader/SubframeLoader.cpp:
+ (WebCore::SubframeLoader::pluginIsLoadable):
+ Adding a check against 'allowPluginType', and passing in both the
+ MIME type of the plugin, as well as the declared MIME type from the
+ object/embed element (ensuring that we do this correctly, even if
+ we're inside a PluginDocument).
+ (WebCore::SubframeLoader::createJavaAppletWidget):
+ Same as 'pluginIsLoadable', but hard-coded to
+ 'application/x-java-applet'.
+ * page/ContentSecurityPolicy.cpp:
+ (CSPDirectiveList):
+ (WebCore::CSPDirectiveList::logInvalidPluginTypes):
+ Plugin types that don't match the grammar ('not/a/mime/type') are
+ logged to the console, and ignored for purposes of matching.
+ (WebCore):
+ (WebCore::CSPDirectiveList::checkPluginType):
+ Given both the plugin type and the declared type attribute, returns
+ true if both types match, and are contained in the list of accepted
+ plugin types.
+ (WebCore::CSPDirectiveList::checkPluginTypeAndReportViolation):
+ Calls out to checkPluginType, and reports a violation if that check
+ fails.
+ (WebCore::CSPDirectiveList::allowPluginType):
+ Analog to the other 'CSPDirectiveList::allowXXX' methods, this
+ branches between simply checking the type against the policy, and
+ checking against the policy and then reporting violations.
+ (WebCore::CSPDirectiveList::parsePluginTypes):
+ Given a directive value, parse out the media types contained within
+ by splitting on spaces, and validating each token. Valid tokens are
+ added to 'm_pluginTypes' for use in 'checkPluginType'.
+ (WebCore::CSPDirectiveList::addDirective):
+ Wire up 'plugin-types' as a valid directive (if the ENABLE_CSP_NEXT
+ flag is set). This has been combined with the other implemented 1.1
+ header, 'script-nonce'.
+ (WebCore::ContentSecurityPolicy::allowPluginType):
+ The public interface to this set of functionality.
+ * page/ContentSecurityPolicy.h:
+
+2012-08-14 Charles Wei <charles.wei@torchmobile.com.cn>
+
+ [BlackBerry] Enable DNS prefetch
+ https://bugs.webkit.org/show_bug.cgi?id=93846
+
+ Reviewed by George Staikos.
+
+ No new tests.
+
+ * PlatformBlackBerry.cmake:
+ * platform/blackberry/TemporaryLinkStubs.cpp:
+ * platform/network/blackberry/DNSBlackBerry.cpp: Copied from Source/WebCore/platform/blackberry/TemporaryLinkStubs.cpp.
+ (WebCore):
+ (WebCore::prefetchDNS):
+
+2012-08-14 Hans Wennborg <hans@chromium.org>
+
+ Speech Input: wrong position was reported for scolled-down elements
+ https://bugs.webkit.org/show_bug.cgi?id=93634
+
+ Reviewed by Kent Tamura.
+
+ When clicking on a speech-enabled input element, WebKit reports
+ the position of the element to the embedder, so that it can show
+ a bubble indicating that speech recognition is in progress for
+ the element that the user clicked on.
+
+ On a page that was scrolled, this position was being reported
+ erroneously: it was given relative to the frame content as opposed to
+ the root view, and the in-progress bubble would be shown in the wrong
+ place.
+
+ Test: fast/speech/bubble-position-scrolled.html
+
+ * html/shadow/TextControlInnerElements.cpp:
+ (WebCore::InputFieldSpeechButtonElement::startSpeechInput):
+
+2012-08-14 Taiju Tsuiki <tzik@chromium.org>
+
+ Web Inspector: Drop "Loading..." message from FileContentView
+ https://bugs.webkit.org/show_bug.cgi?id=91732
+
+ Reviewed by Vsevolod Vlasov.
+
+ * inspector/front-end/FileContentView.js:
+ (WebInspector.FileContentView.prototype.wasShown):
+
+2012-08-14 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125519.
+ http://trac.webkit.org/changeset/125519
+ https://bugs.webkit.org/show_bug.cgi?id=93945
+
+ New ref-tests caused image failures on chromium-mac bots.
+ (Requested by yutak on #webkit).
+
+ * css/html.css:
+ (meter):
+ * html/HTMLMeterElement.cpp:
+ (WebCore::HTMLMeterElement::HTMLMeterElement):
+ (WebCore::HTMLMeterElement::createRenderer):
+ (WebCore::HTMLMeterElement::didElementStateChange):
+ (WebCore::HTMLMeterElement::createShadowSubtree):
+ * html/HTMLMeterElement.h:
+ (WebCore):
+ (HTMLMeterElement):
+ * html/shadow/MeterShadowElement.cpp:
+ (WebCore::MeterShadowElement::meterElement):
+ (WebCore::MeterShadowElement::rendererIsNeeded):
+ (WebCore):
+ * html/shadow/MeterShadowElement.h:
+ (WebCore):
+ * rendering/RenderMeter.cpp:
+ (WebCore::RenderMeter::RenderMeter):
+ (WebCore::RenderMeter::valueRatio):
+ * rendering/RenderMeter.h:
+ (RenderMeter):
+
+2012-08-14 Keishi Hattori <keishi@webkit.org>
+
+ Move page popup resources to separate directory
+ https://bugs.webkit.org/show_bug.cgi?id=93932
+
+ Reviewed by Kent Tamura.
+
+ Keeping the resources organized.
+
+ No new tests.
+
+ * Resources/pagepopups/calendarPicker.css: Renamed from Source/WebCore/Resources/calendarPicker.css.
+ * Resources/pagepopups/calendarPicker.js: Renamed from Source/WebCore/Resources/calendarPicker.js.
+ * Resources/pagepopups/calendarPickerMac.css: Renamed from Source/WebCore/Resources/calendarPickerMac.css.
+ * Resources/pagepopups/colorSuggestionPicker.css: Renamed from Source/WebCore/Resources/colorSuggestionPicker.css.
+ * Resources/pagepopups/colorSuggestionPicker.js: Renamed from Source/WebCore/Resources/colorSuggestionPicker.js.
+ * WebCore.gyp/WebCore.gyp:
+
+2012-08-14 Yoshifumi Inoue <yosin@chromium.org>
+
+ [Forms] Move wheel event handler to spin button class
+ https://bugs.webkit.org/show_bug.cgi?id=93928
+
+ Reviewed by Kent Tamura.
+
+ This patch moves implmentation of wheel event handling from TextFieldInput
+ class to SpinButtonElement class to share implementation in TextFieldInput
+ class, and DateTimeEditElement.
+
+ No new tests. This patch doesn't change behavior. fast/orms/number/number-wheel.html
+ covers this change.
+
+ * html/BaseDateAndTimeInputType.cpp: Removed handleWheelEvent() implementation.
+ * html/BaseDateAndTimeInputType.h:
+ (BaseDateAndTimeInputType): Removed handleWheelEvent() declaration.
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::defaultEventHandler): Removed wheel event handling.
+ * html/InputType.cpp: Removed handleWheelEvent() implementation.
+ * html/InputType.h:
+ (InputType): Removed handleWheelEvent() declaration.
+ * html/NumberInputType.cpp: Removed handleWheelEvent() implementation.
+ * html/NumberInputType.h:
+ (NumberInputType): Removed handleWheelEvent() declaration.
+ * html/TextFieldInputType.cpp: Removed handleWheelEventForSpinButton() declaration.
+ (WebCore::TextFieldInputType::forwardEvent): Changed to call SpinButtonElement::forwardEvent().
+ * html/TextFieldInputType.h:
+ (TextFieldInputType): Removed handleWheelEventForSpinButton() declaration.
+ * html/shadow/TextControlInnerElements.cpp:
+ (WebCore::SpinButtonElement::forwardEvent): Moved implementation of wheel event handling code
+ from TextFieldInputType::handleWheelEventForSpinButton().
+ * html/shadow/TextControlInnerElements.h:
+ (SpinButtonElement): Added forwardEvent() declaration.
+
+2012-08-14 Shinya Kawanaka <shinyak@chromium.org>
+
+ AuthorShadowDOM for meter element
+ https://bugs.webkit.org/show_bug.cgi?id=91970
+
+ Reviewed by Hajime Morita.
+
+ We add support for AuthorShadowDOM for a meter element.
+
+ According to the Shadow DOM spec, a meter element should behave like having a UserAgentShadowRoot and
+ an element in UserAgentShadowRoot draws a real 'meter' bar. In this patch, we change the inner structure
+ of a meter element so that we can distribute an element having RenderMeter to AuthorShadowDOM.
+
+ Before this patch, a meter element has the following inner structure.
+
+ <meter>--UserAgentShadowRoot -- -- -- -- -- -- -- -- -- -- AuthorShadowRoot
+ |
+ +-- MeterBarElement
+ |
+ +-- MeterValueElement
+
+ After this patch, a meter element will have the following inner structure.
+
+ <meter>--UserAgentShadowRoot -- -- -- -- -- -- -- -- -- -- AuthorShadowRoot
+ |
+ +-- MeterInnerElement
+ |
+ +-- MeterBarElement
+ |
+ +-- MeterValueElement
+
+ However, if RenderTheme supports rendering meter, MeterInnerElement will not create a renderer
+ unless an AuthorShadowDOM is attached to it so that we can keep the current rendering style.
+
+ Tests: fast/dom/shadow/shadowdom-for-meter-dynamic.html
+ fast/dom/shadow/shadowdom-for-meter-multiple.html
+ fast/dom/shadow/shadowdom-for-meter-with-style.html
+ fast/dom/shadow/shadowdom-for-meter-without-appearance.html
+ fast/dom/shadow/shadowdom-for-meter-without-shadow-element.html
+ fast/dom/shadow/shadowdom-for-meter.html
+
+ * css/html.css:
+ (meter): Changed the display type. inline-box is not supported WebKit. inline-block is true.
+ (meter::-webkit-meter-inner-element):
+ * html/HTMLMeterElement.cpp:
+ (WebCore::HTMLMeterElement::HTMLMeterElement):
+ (WebCore::HTMLMeterElement::createRenderer):
+ (WebCore):
+ (WebCore::HTMLMeterElement::didElementStateChange):
+ (WebCore::HTMLMeterElement::willAddAuthorShadowRoot):
+ (WebCore::HTMLMeterElement::renderMeter):
+ (WebCore::HTMLMeterElement::createShadowSubtree):
+ * html/HTMLMeterElement.h:
+ (WebCore):
+ (WebCore::HTMLMeterElement::hasAuthorShadowRoot):
+ (HTMLMeterElement):
+ (WebCore::isHTMLMeterElement):
+ (WebCore::toHTMLMeterElement):
+ * html/shadow/MeterShadowElement.cpp:
+ (WebCore::MeterShadowElement::meterElement):
+ (WebCore::MeterShadowElement::rendererIsNeeded):
+ (WebCore):
+ (WebCore::MeterInnerElement::MeterInnerElement): We introduce a new element having RenderMeter
+ so that we can distribute an element having RenderMeter to AuthorShadowDOM.
+ (WebCore::MeterInnerElement::rendererIsNeeded): Different from a progress element, meter element will not be
+ rendered using a theme. So we don't need to check the style appearance.
+ (WebCore::MeterInnerElement::createRenderer):
+ (WebCore::MeterInnerElement::shadowPseudoId):
+ * html/shadow/MeterShadowElement.h:
+ (WebCore):
+ (MeterInnerElement):
+ (WebCore::MeterInnerElement::create):
+ * rendering/RenderMeter.cpp:
+ (WebCore::RenderMeter::RenderMeter):
+ (WebCore::RenderMeter::meterElement):
+ (WebCore):
+ (WebCore::RenderMeter::valueRatio):
+ * rendering/RenderMeter.h:
+ (RenderMeter):
+
+2012-08-14 Christophe Dumez <christophe.dumez@intel.com>
+
+ regression(r124510) webintents/web-intents-obj-constructor.html is crashing
+ https://bugs.webkit.org/show_bug.cgi?id=93096
+
+ Reviewed by Kentaro Hara.
+
+ Add null-check for JSC::ExecState pointer in JSDictionary constructor
+ before using it. The exec may indeed be null, thus causing crashes.
+
+ No new test, already tested by webintents/web-intents-obj-constructor.html
+
+ * bindings/js/JSDictionary.cpp:
+ (WebCore::JSDictionary::tryGetProperty):
+ (WebCore::JSDictionary::getWithUndefinedOrNullCheck):
+ * bindings/js/JSDictionary.h:
+ (WebCore::JSDictionary::JSDictionary):
+
+2012-08-13 Keishi Hattori <keishi@webkit.org>
+
+ Remove fade in transition from calendar picker
+ https://bugs.webkit.org/show_bug.cgi?id=93816
+
+ Reviewed by Kent Tamura.
+
+ The fade in transition was incomplete because it was only fading in the
+ popup content and not the popup itself. Removing the effect for now.
+
+ No new tests. Can't test animation.
+
+ * Resources/calendarPicker.css:
+ (#main):
+ * Resources/calendarPicker.js:
+ (initialize):
+ (fixWindowSize):
+
+2012-08-13 Alex Christensen <alex.christensen@flexsim.com>
+
+ WPARAM and LPARAM are incorrectly defined for x64
+ https://bugs.webkit.org/show_bug.cgi?id=89902
+
+ Reviewed by Brent Fulgham.
+
+ Include WindowsExtras.h for PLATFORM(WIN) to define WPARAM and LPARAM correctly
+ * platform/PlatformKeyboardEvent.h:
+ * platform/PlatformMouseEvent.h:
+ * platform/PlatformWheelEvent.h:
+ * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h:
+ * platform/win/WindowMessageListener.h:
+
+2012-08-13 John Bates <jbates@google.com>
+
+ [Chromium] Patch CCThreadProxy to call setTimebaseAndInterval on CCScheduler
+ https://bugs.webkit.org/show_bug.cgi?id=93918
+
+ Reviewed by James Robinson.
+
+ Also, update some trace events.
+
+ * platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp:
+ (WebCore::CCDelayBasedTimeSource::setActive):
+ * platform/graphics/chromium/cc/CCFrameRateController.cpp:
+ (WebCore::CCFrameRateController::setActive):
+ * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+ (WebCore::CCThreadProxy::onVSyncParametersChanged):
+
+2012-08-13 Douglas Stockwell <dstockwell@chromium.org>
+
+ Crash in WebCore::RenderBlock::LineBreaker::nextLineBreak
+ https://bugs.webkit.org/show_bug.cgi?id=93806
+
+ Reviewed by Abhishek Arya.
+
+ When looking for line breaks on the first line, existing code was
+ checking for text-combine only in the first-line style. Since
+ text-combine isn't inherited this resulted in a line break being
+ chosen before combineText was called. When this happened and then
+ combineText was called subsequently, the position of the line break
+ iterator would be invalid.
+
+ This patch changes the check to use the regular style as in
+ skipLeadingWhitespace and textWidth.
+
+ Test: fast/text/text-combine-first-line-crash.html
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::LineBreaker::nextLineBreak): Don't use the
+ first-line style when checking text-combine.
+
+2012-08-13 Kwang Yul Seo <skyul@company100.net>
+
+ Remove unused method HTMLDocumentParser::script()
+ https://bugs.webkit.org/show_bug.cgi?id=93916
+
+ Reviewed by Eric Seidel.
+
+ The use of HTMLDocumentParser::script() was removed in r61640 and has never been used since then.
+
+ No behavior change, so no new tests.
+
+ * html/parser/HTMLDocumentParser.cpp:
+ * html/parser/HTMLDocumentParser.h:
+
+2012-08-13 Tom Sepez <tsepez@chromium.org>
+
+ [chromium] release FrameLoaderClientImpl::m_pluginWidget refptr upon Plugin Document detach.
+ https://bugs.webkit.org/show_bug.cgi?id=93283
+
+ Reviewed by Eric Seidel.
+
+ Chromium has a refptr that needs to be NULLed at this point.
+
+ The approach is to change the client redirectDataToPlugin method(s) to expect
+ the possibility of a NULL argument, and the use this to clear the refptr on
+ the chromium platform. Other platforms can merely ignore the NULL case, thereby
+ maintaining the existing behaviour.
+
+ Formal testing is nearly impossible without some chrome-specific plugins.
+
+ * html/PluginDocument.cpp:
+ (WebCore::PluginDocument::detach):
+
+2012-08-13 Eric Penner <epenner@google.com>
+
+ [chromium] Paint animated layers immediately to avoid animation hiccups.
+ https://bugs.webkit.org/show_bug.cgi?id=93028
+
+ Reviewed by Adrienne Walker.
+
+ This is a technique used on Android, which is very prone
+ to hiccups in animations. Paint the entire layer if it is
+ of reasonable size such that there is no hiccups when the
+ animation reaches unpainted content. The reasonable size
+ is choosen for page-transitions specifically, as this was
+ the problem case (animations would just jump to the end).
+
+ Since we already have a special case this just modifies it
+ and replaces the unit test with a new one. This can be
+ improved/simplified further when distances/directions are
+ available for the animated layers.
+
+ Replaced one test.
+ Fixed bugs in and improved idlePaintNonVisibleLayers test.
+
+ * platform/graphics/chromium/TiledLayerChromium.cpp:
+ (UpdatableTile):
+ (WebCore::UpdatableTile::resetUpdateState):
+ (WebCore::UpdatableTile::markForUpdate):
+ (WebCore::UpdatableTile::UpdatableTile):
+ (WebCore::TiledLayerChromium::TiledLayerChromium):
+ (WebCore::TiledLayerChromium::pushPropertiesTo):
+ (WebCore):
+ (WebCore::TiledLayerChromium::updateTiles):
+ (WebCore::TiledLayerChromium::markOcclusionsAndRequestTextures):
+ (WebCore::TiledLayerChromium::haveTexturesForTiles):
+ (WebCore::TiledLayerChromium::markTilesForUpdate):
+ (WebCore::TiledLayerChromium::updateTileTextures):
+ (WebCore::TiledLayerChromium::setTexturePrioritiesInRect):
+ (WebCore::TiledLayerChromium::resetUpdateState):
+ (WebCore::TiledLayerChromium::updateContentRect):
+ (WebCore::TiledLayerChromium::needsIdlePaint):
+ (WebCore::TiledLayerChromium::idlePaintRect):
+ * platform/graphics/chromium/TiledLayerChromium.h:
+ (TiledLayerChromium):
+ * platform/graphics/chromium/cc/CCLayerTilingData.cpp:
+ (WebCore::CCLayerTilingData::contentRectToTileIndices):
+ * platform/graphics/chromium/cc/CCPriorityCalculator.h:
+ (WebCore::CCPriorityCalculator::maxPriority):
+
+2012-08-13 Kentaro Hara <haraken@chromium.org>
+
+ Unreviewed. Simple refactoring that I forgot to apply in r125495.
+
+ * bindings/v8/V8ThrowException.cpp:
+ (WebCore::domExceptionStackGetter):
+ (WebCore::domExceptionStackSetter):
+ (WebCore::V8ThrowException::setDOMException):
+ * bindings/v8/V8ThrowException.h:
+
+2012-08-13 Ryuan Choi <ryuan.choi@samsung.com>
+
+ [CMAKE][EFL] Fix build break with --tiled-backing-store
+ https://bugs.webkit.org/show_bug.cgi?id=93487
+
+ Unreviewed build fix for Efl with --tiled-backing-store.
+
+ * CMakeLists.txt:
+ Checked bison version and selected proper glslang files.
+
+2012-08-12 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Factor out exception related methods of V8Proxy
+ https://bugs.webkit.org/show_bug.cgi?id=93792
+
+ Reviewed by Adam Barth.
+
+ To remove V8Proxy, this patch factors out exception related methods of V8Proxy
+ to a separate file.
+
+ (1) Move exception related methods from V8Proxy.{h,cpp} to V8ThrowException.{h,cpp}.
+ (2) To avoid writing V8ThrowException::throwError() here and there in V8 binding,
+ implement WebCore::throwError() in V8Binding.{h,cpp}. Ideally, we want to list up
+ all V8 binding APIs in V8Binding.h.
+ (3) Replace all V8Proxy::throwError() with throwError().
+
+ Nit: I couldn't write the definition of WebCore::throwError() in V8BInding.h
+ due to circular dependency issues. Either way, these methods wouldn't be
+ performance-critical.
+
+ No tests. No change in behavior.
+
+ * UseV8.cmake:
+ * WebCore.gypi:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateNormalAttrGetter):
+ (GenerateNormalAttrSetter):
+ (GenerateOverloadedFunctionCallback):
+ (GenerateFunctionCallback):
+ (GenerateArgumentsCountCheck):
+ (GenerateParametersCheck):
+ (GenerateConstructorCallback):
+ (GenerateEventConstructorCallback):
+ (GenerateNamedConstructorCallback):
+ (GenerateFunctionCallString):
+ * bindings/scripts/test/V8/V8Float64Array.cpp:
+ (WebCore::Float64ArrayV8Internal::fooCallback):
+ * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
+ (WebCore::TestActiveDOMObjectV8Internal::excitingFunctionCallback):
+ (WebCore::TestActiveDOMObjectV8Internal::postMessageCallback):
+ * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
+ (WebCore::TestCustomNamedGetterV8Internal::anotherFunctionCallback):
+ * bindings/scripts/test/V8/V8TestEventConstructor.cpp:
+ (WebCore::V8TestEventConstructor::constructorCallback):
+ * bindings/scripts/test/V8/V8TestEventTarget.cpp:
+ (WebCore::TestEventTargetV8Internal::itemCallback):
+ (WebCore::TestEventTargetV8Internal::dispatchEventCallback):
+ * bindings/scripts/test/V8/V8TestInterface.cpp:
+ (WebCore::TestInterfaceV8Internal::supplementalMethod2Callback):
+ (WebCore::V8TestInterface::constructorCallback):
+ * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
+ (WebCore::TestMediaQueryListListenerV8Internal::methodCallback):
+ * bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
+ (WebCore::V8TestNamedConstructorConstructorCallback):
+ * bindings/scripts/test/V8/V8TestNode.cpp:
+ (WebCore::V8TestNode::constructorCallback):
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::TestObjV8Internal::attrWithGetterExceptionAttrGetter):
+ (WebCore::TestObjV8Internal::attrWithGetterExceptionAttrSetter):
+ (WebCore::TestObjV8Internal::attrWithSetterExceptionAttrSetter):
+ (WebCore::TestObjV8Internal::stringAttrWithGetterExceptionAttrGetter):
+ (WebCore::TestObjV8Internal::stringAttrWithGetterExceptionAttrSetter):
+ (WebCore::TestObjV8Internal::stringAttrWithSetterExceptionAttrSetter):
+ (WebCore::TestObjV8Internal::withScriptStateAttributeRaisesAttrGetter):
+ (WebCore::TestObjV8Internal::withScriptStateAttributeRaisesAttrSetter):
+ (WebCore::TestObjV8Internal::withScriptExecutionContextAttributeRaisesAttrGetter):
+ (WebCore::TestObjV8Internal::withScriptExecutionContextAttributeRaisesAttrSetter):
+ (WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeRaisesAttrGetter):
+ (WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeRaisesAttrSetter):
+ (WebCore::TestObjV8Internal::voidMethodWithArgsCallback):
+ (WebCore::TestObjV8Internal::MethodWithArgsCallback):
+ (WebCore::TestObjV8Internal::objMethodWithArgsCallback):
+ (WebCore::TestObjV8Internal::methodWithSequenceArgCallback):
+ (WebCore::TestObjV8Internal::methodReturningSequenceCallback):
+ (WebCore::TestObjV8Internal::methodThatRequiresAllArgsAndThrowsCallback):
+ (WebCore::TestObjV8Internal::serializedValueCallback):
+ (WebCore::TestObjV8Internal::idbKeyCallback):
+ (WebCore::TestObjV8Internal::optionsObjectCallback):
+ (WebCore::TestObjV8Internal::methodWithExceptionCallback):
+ (WebCore::TestObjV8Internal::withScriptStateVoidExceptionCallback):
+ (WebCore::TestObjV8Internal::withScriptStateObjExceptionCallback):
+ (WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateObjExceptionCallback):
+ (WebCore::TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgCallback):
+ (WebCore::TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsCallback):
+ (WebCore::TestObjV8Internal::methodWithCallbackArgCallback):
+ (WebCore::TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgCallback):
+ (WebCore::TestObjV8Internal::methodWithCallbackAndOptionalArgCallback):
+ (WebCore::TestObjV8Internal::overloadedMethod1Callback):
+ (WebCore::TestObjV8Internal::overloadedMethod2Callback):
+ (WebCore::TestObjV8Internal::overloadedMethod3Callback):
+ (WebCore::TestObjV8Internal::overloadedMethod4Callback):
+ (WebCore::TestObjV8Internal::overloadedMethod5Callback):
+ (WebCore::TestObjV8Internal::overloadedMethod6Callback):
+ (WebCore::TestObjV8Internal::overloadedMethod7Callback):
+ (WebCore::TestObjV8Internal::overloadedMethod8Callback):
+ (WebCore::TestObjV8Internal::overloadedMethod9Callback):
+ (WebCore::TestObjV8Internal::overloadedMethod10Callback):
+ (WebCore::TestObjV8Internal::overloadedMethodCallback):
+ (WebCore::TestObjV8Internal::overloadedMethod11Callback):
+ (WebCore::TestObjV8Internal::overloadedMethod12Callback):
+ (WebCore::TestObjV8Internal::classMethodWithClampCallback):
+ (WebCore::TestObjV8Internal::enabledAtRuntimeMethod1Callback):
+ (WebCore::TestObjV8Internal::enabledAtRuntimeMethod2Callback):
+ (WebCore::TestObjV8Internal::enabledPerContextMethod1Callback):
+ (WebCore::TestObjV8Internal::enabledPerContextMethod2Callback):
+ (WebCore::TestObjV8Internal::stringArrayFunctionCallback):
+ (WebCore::TestObjV8Internal::getSVGDocumentCallback):
+ (WebCore::TestObjV8Internal::convert1Callback):
+ (WebCore::TestObjV8Internal::convert2Callback):
+ (WebCore::TestObjV8Internal::convert3Callback):
+ (WebCore::TestObjV8Internal::convert4Callback):
+ (WebCore::TestObjV8Internal::convert5Callback):
+ (WebCore::TestObjV8Internal::strictFunctionCallback):
+ (WebCore::V8TestObj::constructorCallback):
+ * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
+ (WebCore::TestSerializedScriptValueInterfaceV8Internal::acceptTransferListCallback):
+ (WebCore::TestSerializedScriptValueInterfaceV8Internal::multiTransferListCallback):
+ (WebCore::V8TestSerializedScriptValueInterface::constructorCallback):
+ * bindings/v8/DateExtension.cpp:
+ (WebCore::DateExtension::OnSleepDetected):
+ * bindings/v8/NPV8Object.cpp:
+ (_NPN_SetException):
+ * bindings/v8/SerializedScriptValue.cpp:
+ (WebCore::SerializedScriptValue::transferArrayBuffers):
+ (WebCore::SerializedScriptValue::SerializedScriptValue):
+ * bindings/v8/V8Binding.cpp:
+ (WebCore::setDOMException):
+ (WebCore):
+ (WebCore::throwError):
+ (WebCore::throwTypeError):
+ (WebCore::throwNotEnoughArgumentsError):
+ * bindings/v8/V8Binding.h:
+ (WebCore):
+ (WebCore::toV8Sequence):
+ * bindings/v8/V8Collection.cpp:
+ (WebCore::toOptionsCollectionSetter):
+ * bindings/v8/V8NPObject.cpp:
+ (WebCore::npObjectInvokeImpl):
+ (WebCore::npObjectGetProperty):
+ (WebCore::npObjectSetProperty):
+ (WebCore::npObjectPropertyEnumerator):
+ * bindings/v8/V8NodeFilterCondition.cpp:
+ (WebCore::V8NodeFilterCondition::acceptNode):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::handleMaxRecursionDepthExceeded):
+ (WebCore::V8Proxy::checkNewLegal):
+ * bindings/v8/V8Proxy.h:
+ (V8Proxy):
+ (WebCore):
+ * bindings/v8/V8ThrowException.cpp: Added.
+ (WebCore):
+ (WebCore::DOMExceptionStackGetter):
+ (WebCore::DOMExceptionStackSetter):
+ (WebCore::V8ThrowException::setDOMException):
+ (WebCore::V8ThrowException::throwError):
+ (WebCore::V8ThrowException::throwTypeError):
+ (WebCore::V8ThrowException::throwNotEnoughArgumentsError):
+ * bindings/v8/V8ThrowException.h: Added.
+ (WebCore):
+ (V8ThrowException):
+ * bindings/v8/V8Utilities.cpp:
+ (WebCore::extractTransferables):
+ (WebCore::getMessagePortArray):
+ (WebCore::setTypeMismatchException):
+ * bindings/v8/WorkerContextExecutionProxy.cpp:
+ (WebCore::WorkerContextExecutionProxy::evaluate):
+ * bindings/v8/custom/V8ArrayBufferCustom.cpp:
+ (WebCore::V8ArrayBuffer::constructorCallback):
+ * bindings/v8/custom/V8ArrayBufferViewCustom.h:
+ (WebCore::constructWebGLArrayWithArrayBufferArgument):
+ (WebCore::constructWebGLArray):
+ (WebCore::setWebGLArrayHelper):
+ * bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp:
+ (WebCore::V8AudioBufferSourceNode::bufferAccessorSetter):
+ * bindings/v8/custom/V8AudioContextCustom.cpp:
+ (WebCore::V8AudioContext::constructorCallback):
+ * bindings/v8/custom/V8BlobCustom.cpp:
+ (WebCore::V8Blob::constructorCallback):
+ * bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp:
+ (WebCore::V8CSSStyleDeclaration::namedPropertySetter):
+ * bindings/v8/custom/V8ClipboardCustom.cpp:
+ (WebCore::V8Clipboard::clearDataCallback):
+ (WebCore::V8Clipboard::setDragImageCallback):
+ * bindings/v8/custom/V8DOMFormDataCustom.cpp:
+ (WebCore::V8DOMFormData::constructorCallback):
+ (WebCore::V8DOMFormData::appendCallback):
+ * bindings/v8/custom/V8DOMStringMapCustom.cpp:
+ (WebCore::V8DOMStringMap::namedPropertySetter):
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ (WebCore::WindowSetTimeoutImpl):
+ (WebCore::handlePostMessageCallback):
+ * bindings/v8/custom/V8DataViewCustom.cpp:
+ (WebCore::V8DataView::constructorCallback):
+ (WebCore::V8DataView::getInt8Callback):
+ (WebCore::V8DataView::getUint8Callback):
+ (WebCore::V8DataView::setInt8Callback):
+ (WebCore::V8DataView::setUint8Callback):
+ * bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp:
+ (WebCore::handlePostMessageCallback):
+ * bindings/v8/custom/V8DirectoryEntryCustom.cpp:
+ (WebCore::V8DirectoryEntry::getDirectoryCallback):
+ (WebCore::V8DirectoryEntry::getFileCallback):
+ * bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp:
+ (WebCore::V8DirectoryEntrySync::getDirectoryCallback):
+ (WebCore::V8DirectoryEntrySync::getFileCallback):
+ * bindings/v8/custom/V8DocumentCustom.cpp:
+ (WebCore::V8Document::evaluateCallback):
+ * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
+ (WebCore::V8HTMLCanvasElement::toDataURLCallback):
+ * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+ (WebCore::V8HTMLDocument::openCallback):
+ * bindings/v8/custom/V8HTMLElementCustom.cpp:
+ (WebCore::V8HTMLElement::itemValueAccessorSetter):
+ * bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
+ (WebCore::v8HTMLImageElementConstructorCallback):
+ * bindings/v8/custom/V8HTMLInputElementCustom.cpp:
+ (WebCore::V8HTMLInputElement::selectionStartAccessorGetter):
+ (WebCore::V8HTMLInputElement::selectionStartAccessorSetter):
+ (WebCore::V8HTMLInputElement::selectionEndAccessorGetter):
+ (WebCore::V8HTMLInputElement::selectionEndAccessorSetter):
+ (WebCore::V8HTMLInputElement::selectionDirectionAccessorGetter):
+ (WebCore::V8HTMLInputElement::selectionDirectionAccessorSetter):
+ (WebCore::V8HTMLInputElement::setSelectionRangeCallback):
+ * bindings/v8/custom/V8HTMLMediaElementCustom.cpp:
+ (WebCore::V8HTMLMediaElement::controllerAccessorSetter):
+ * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
+ (WebCore::V8HTMLOptionsCollection::addCallback):
+ (WebCore::V8HTMLOptionsCollection::lengthAccessorSetter):
+ * bindings/v8/custom/V8HistoryCustom.cpp:
+ (WebCore::V8History::pushStateCallback):
+ (WebCore::V8History::replaceStateCallback):
+ * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+ (WebCore::V8InjectedScriptHost::inspectedObjectCallback):
+ * bindings/v8/custom/V8IntentConstructor.cpp:
+ (WebCore::V8Intent::constructorCallback):
+ * bindings/v8/custom/V8LocationCustom.cpp:
+ (WebCore::V8Location::protocolAccessorSetter):
+ * bindings/v8/custom/V8MessageChannelConstructor.cpp:
+ (WebCore::V8MessageChannel::constructorCallback):
+ * bindings/v8/custom/V8MessagePortCustom.cpp:
+ (WebCore::handlePostMessageCallback):
+ * bindings/v8/custom/V8MutationObserverCustom.cpp:
+ (WebCore::V8MutationObserver::constructorCallback):
+ * bindings/v8/custom/V8NodeCustom.cpp:
+ (WebCore::V8Node::insertBeforeCallback):
+ (WebCore::V8Node::replaceChildCallback):
+ (WebCore::V8Node::removeChildCallback):
+ (WebCore::V8Node::appendChildCallback):
+ * bindings/v8/custom/V8NotificationCenterCustom.cpp:
+ (WebCore::V8NotificationCenter::createHTMLNotificationCallback):
+ (WebCore::V8NotificationCenter::createNotificationCallback):
+ (WebCore::V8NotificationCenter::requestPermissionCallback):
+ * bindings/v8/custom/V8SQLResultSetRowListCustom.cpp:
+ (WebCore::V8SQLResultSetRowList::itemCallback):
+ * bindings/v8/custom/V8SQLTransactionCustom.cpp:
+ (WebCore::V8SQLTransaction::executeSqlCallback):
+ * bindings/v8/custom/V8SQLTransactionSyncCustom.cpp:
+ (WebCore::V8SQLTransactionSync::executeSqlCallback):
+ * bindings/v8/custom/V8SVGLengthCustom.cpp:
+ (WebCore::V8SVGLength::valueAccessorGetter):
+ (WebCore::V8SVGLength::valueAccessorSetter):
+ (WebCore::V8SVGLength::convertToSpecifiedUnitsCallback):
+ * bindings/v8/custom/V8StorageCustom.cpp:
+ (WebCore::storageSetter):
+ * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
+ (WebCore::getObjectParameter):
+ (WebCore::V8WebGLRenderingContext::getAttachedShadersCallback):
+ (WebCore::V8WebGLRenderingContext::getExtensionCallback):
+ (WebCore::V8WebGLRenderingContext::getFramebufferAttachmentParameterCallback):
+ (WebCore::V8WebGLRenderingContext::getParameterCallback):
+ (WebCore::V8WebGLRenderingContext::getProgramParameterCallback):
+ (WebCore::V8WebGLRenderingContext::getShaderParameterCallback):
+ (WebCore::V8WebGLRenderingContext::getUniformCallback):
+ (WebCore::vertexAttribAndUniformHelperf):
+ (WebCore::uniformHelperi):
+ (WebCore::uniformMatrixHelper):
+ * bindings/v8/custom/V8WebKitPointConstructor.cpp:
+ (WebCore::V8WebKitPoint::constructorCallback):
+ * bindings/v8/custom/V8WebSocketCustom.cpp:
+ (WebCore::V8WebSocket::constructorCallback):
+ (WebCore::V8WebSocket::sendCallback):
+ * bindings/v8/custom/V8WorkerContextCustom.cpp:
+ (WebCore::V8WorkerContext::importScriptsCallback):
+ * bindings/v8/custom/V8WorkerCustom.cpp:
+ (WebCore::handlePostMessageCallback):
+ * bindings/v8/custom/V8XMLHttpRequestConstructor.cpp:
+ (WebCore::V8XMLHttpRequest::constructorCallback):
+ * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+ (WebCore::V8XMLHttpRequest::responseTextAccessorGetter):
+ (WebCore::V8XMLHttpRequest::responseAccessorGetter):
+ (WebCore::V8XMLHttpRequest::openCallback):
+ (WebCore::V8XMLHttpRequest::sendCallback):
+
+2012-08-13 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move GCEventData class from V8Binding.h to ScriptGCEvent.h
+ https://bugs.webkit.org/show_bug.cgi?id=93818
+
+ Reviewed by Adam Barth.
+
+ (1) This patch moves GCEventData class from V8Binding.h to ScriptGCEvent.h.
+ (2) This patch makes GCEventData::startTime and GCEventData::usedHeapSize
+ private members.
+ (3) This patch removes unused forward declarations from V8Binding.h.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/ScriptGCEvent.cpp:
+ (WebCore::ScriptGCEvent::gcPrologueCallback):
+ (WebCore::ScriptGCEvent::gcEpilogueCallback):
+ * bindings/v8/ScriptGCEvent.h:
+ (GCEventData):
+ (WebCore::GCEventData::GCEventData):
+ (WebCore::GCEventData::clear):
+ (WebCore::GCEventData::listeners):
+ (WebCore::GCEventData::startTime):
+ (WebCore::GCEventData::setStartTime):
+ (WebCore::GCEventData::usedHeapSize):
+ (WebCore::GCEventData::setUsedHeapSize):
+ (WebCore):
+ * bindings/v8/V8Binding.h:
+ (WebCore):
+ * bindings/v8/V8PerIsolateData.cpp:
+
+2012-08-13 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move checkNewLegal() from V8Proxy.h to SafeAllocation.h
+ https://bugs.webkit.org/show_bug.cgi?id=93830
+
+ Reviewed by Adam Barth.
+
+ This patch moves checkNewLegal() from V8Proxy.h to SafeAllocation.h.
+ In addition, this patch renames checkNewLegal() to isValidConstructorMode()
+ for clarification.
+
+ No tests. No change in behavior.
+
+ * UseV8.cmake:
+ * WebCore.gypi:
+ * bindings/v8/SafeAllocation.cpp: Added.
+ * bindings/v8/SafeAllocation.h:
+ (WebCore::SafeAllocation::newInstance):
+ (WebCore):
+ * bindings/v8/V8Binding.cpp:
+ (WebCore::createRawTemplate):
+ * bindings/v8/V8Proxy.cpp:
+ * bindings/v8/V8Proxy.h:
+ (V8Proxy):
+
+2012-08-13 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Remove unused methods from V8Binding.h
+ https://bugs.webkit.org/show_bug.cgi?id=93836
+
+ Reviewed by Adam Barth.
+
+ enableStringImplCache() and v8UndetectableString() are not used by anybody.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/V8Binding.h:
+
+2012-08-13 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move hintForGCIfNecessary() from V8Proxy.h to V8GCController.h
+ https://bugs.webkit.org/show_bug.cgi?id=93834
+
+ Reviewed by Adam Barth.
+
+ This patch moves hintForGCIfNecessary() from V8Proxy.h to V8GCController.h.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/V8GCController.cpp:
+ (WebCore::V8GCController::hintForGCIfNecessary):
+ * bindings/v8/V8GCController.h:
+ (V8GCController):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::clearForClose):
+ (WebCore::V8Proxy::clearForNavigation):
+ * bindings/v8/V8Proxy.h:
+ (V8Proxy):
+
+2012-08-13 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r124970.
+ http://trac.webkit.org/changeset/124970
+ https://bugs.webkit.org/show_bug.cgi?id=93495
+
+ Postponing the merge in a clearer context (Requested by
+ Michelangelo on #webkit).
+
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ (WebCore::CSSParser::parseTransform):
+ * css/CSSParser.h:
+
+2012-08-12 Shawn Singh <shawnsingh@chromium.org>
+
+ [chromium] renderSurface in incorrect space if owning layer has empty but non-zero bounds
+ https://bugs.webkit.org/show_bug.cgi?id=93795
+
+ Reviewed by Adrienne Walker.
+
+ If a renderSurface is created by a layer that had zero
+ area (empty) but non-zero bounds (either width or height was
+ non-zero), then one translation transform was accidentally being
+ skipped, causing the renderSurface drawTransform to be incorrect.
+ The fix is simply to move that transform outside of the
+ if-statement so it is not skipped.
+
+ Unit test added:
+ CCLayerTreeHostCommonTest.verifyTransformsForDegenerateIntermediateLayer()
+
+ * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
+ (WebCore::calculateDrawTransformsInternal):
+
+2012-08-13 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Remove [TreatReturnedNullAs=False]
+ https://bugs.webkit.org/show_bug.cgi?id=93835
+
+ Reviewed by Adam Barth.
+
+ [TreatReturnedNullAs=False] is neither defined in the Web IDL spec
+ nor used in any WebKit IDL file.
+
+ No tests. No change in behavior.
+
+ * WebCore.order:
+ * bindings/js/JSDOMBinding.cpp:
+ * bindings/js/JSDOMBinding.h:
+ (WebCore):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (NativeToJSValue):
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (NativeToJSValue):
+ * bindings/scripts/IDLAttributes.txt:
+ * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
+ * bindings/scripts/test/CPP/WebDOMTestObj.h:
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore):
+ * bindings/scripts/test/JS/JSTestObj.h:
+ (WebCore):
+ * bindings/scripts/test/ObjC/DOMTestObj.h:
+ * bindings/scripts/test/ObjC/DOMTestObj.mm:
+ * bindings/scripts/test/TestObj.idl:
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::ConfigureV8TestObjTemplate):
+ * bindings/v8/V8Binding.h:
+
+2012-08-13 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Rename v8ValueToWebCoreDOMStringList() to toDOMStringList()
+ https://bugs.webkit.org/show_bug.cgi?id=93839
+
+ Reviewed by Adam Barth.
+
+ For naming consistency with toWebCoreString() and toWebCoreAtomicString(),
+ this patch renames v8ValueToWebCoreDOMStringList() to toDOMStringList().
+ ("WebCore" wouldn't be needed because it's clear from "DOMStringList".)
+
+ No tests. No change in behavior.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (JSValueToNative):
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::TestObjV8Internal::overloadedMethod6Callback):
+ (WebCore::TestObjV8Internal::overloadedMethod7Callback):
+ (WebCore::TestObjV8Internal::overloadedMethod9Callback):
+ (WebCore::TestObjV8Internal::stringArrayFunctionCallback):
+ * bindings/v8/V8Binding.cpp:
+ (WebCore::toDOMStringList):
+ * bindings/v8/V8Binding.h:
+ (WebCore):
+
+2012-08-13 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Rename v8ValueToAtomicWebCoreString() to toWebCoreAtomicString()
+ https://bugs.webkit.org/show_bug.cgi?id=93824
+
+ Reviewed by Adam Barth.
+
+ For naming consistency with toWebCoreString(), we can rename
+ v8ValueToAtomicWebCoreString() to toWebCoreAtomicString().
+ Also we can rename v8ValueToAtomicWebCoreStringWithNullCheck()
+ to toWebCoreAtomicStringWithNullCheck().
+
+ No tests. No change in behavior.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateNormalAttrSetter):
+ (GenerateEventListenerCallback):
+ * bindings/scripts/test/V8/V8TestEventTarget.cpp:
+ (WebCore::TestEventTargetV8Internal::addEventListenerCallback):
+ (WebCore::TestEventTargetV8Internal::removeEventListenerCallback):
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::TestObjV8Internal::addEventListenerCallback):
+ (WebCore::TestObjV8Internal::removeEventListenerCallback):
+ * bindings/v8/V8Binding.cpp:
+ (WebCore::toWebCoreAtomicString):
+ * bindings/v8/V8Binding.h:
+ (WebCore::toWebCoreStringWithNullOrUndefinedCheck):
+ (WebCore::toWebCoreAtomicStringWithNullCheck):
+ * bindings/v8/V8Collection.h:
+ (WebCore::getNamedPropertyOfCollection):
+ * bindings/v8/V8DOMWindowShell.cpp:
+ (WebCore::getter):
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ (WebCore::V8DOMWindow::namedPropertyGetter):
+ * bindings/v8/custom/V8HTMLAllCollectionCustom.cpp:
+ (WebCore::V8HTMLAllCollection::namedPropertyGetter):
+ * bindings/v8/custom/V8HTMLCollectionCustom.cpp:
+ (WebCore::V8HTMLCollection::namedPropertyGetter):
+ * bindings/v8/custom/V8HTMLFormElementCustom.cpp:
+ (WebCore::V8HTMLFormElement::namedPropertyGetter):
+ * bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp:
+ (WebCore::V8HTMLFrameSetElement::namedPropertyGetter):
+ * bindings/v8/custom/V8NodeListCustom.cpp:
+ (WebCore::V8NodeList::namedPropertyGetter):
+
+2012-08-13 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Remove v8ValueToWebCoreString()
+ https://bugs.webkit.org/show_bug.cgi?id=93822
+
+ Reviewed by Adam Barth.
+
+ There are two equivalent ways to convert a V8 value to a WebCore String;
+ i.e. v8ValueToWebCoreString() and toWebCoreString(). We can remove the former.
+
+ In a follow-up patch, I will replace v8ValueToAtomicWebCoreString()
+ with toWebCoreAtomicString(), for consistency with toWebCoreString().
+
+ No tests. No change in behavior.
+
+ * bindings/v8/Dictionary.cpp:
+ (WebCore::Dictionary::get):
+ (WebCore::Dictionary::getWithUndefinedOrNullCheck):
+ (WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
+ * bindings/v8/IDBBindingUtilities.cpp:
+ (WebCore::createIDBKeyFromValue):
+ * bindings/v8/ScriptDebugServer.cpp:
+ (WebCore::ScriptDebugServer::setBreakpoint):
+ * bindings/v8/V8Binding.cpp:
+ (WebCore::toWebCoreString):
+ (WebCore::v8ValueToWebCoreDOMStringList):
+ * bindings/v8/V8Binding.h:
+ (WebCore::toWebCoreStringWithNullCheck):
+ * bindings/v8/custom/V8MessageEventCustom.cpp:
+ (WebCore::V8MessageEvent::initMessageEventCallback):
+
+2012-08-13 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move the ConstructorMode class from V8Binding.h to SafeAllocation.h
+ https://bugs.webkit.org/show_bug.cgi?id=93821
+
+ Reviewed by Adam Barth.
+
+ This patch factors out the ConstructorMode class from V8Binding.h to SafeAllocation.h.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/SafeAllocation.h:
+ (ConstructorMode):
+ (WebCore::ConstructorMode::ConstructorMode):
+ (WebCore::ConstructorMode::~ConstructorMode):
+ (WebCore::ConstructorMode::current):
+ (WebCore):
+ * bindings/v8/V8Binding.h:
+ * bindings/v8/V8RecursionScope.h:
+
+2012-08-13 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Remove V8BindingHelpers
+ https://bugs.webkit.org/show_bug.cgi?id=93807
+
+ Reviewed by Adam Barth.
+
+ V8BindingHelpers contains toV8Context() and toV8Proxy(), which are used
+ by NPV8Object.cpp only.
+
+ (1) Move these methods to NPV8Object.cpp as static methods.
+ (2) Remove V8BindingHelpers.{h,cpp}.
+
+ No tests. No change in behavior.
+
+ * UseV8.cmake:
+ * WebCore.gypi:
+ * bindings/v8/NPV8Object.cpp:
+ (WebCore::toV8Context):
+ (WebCore):
+ (WebCore::toV8Proxy):
+ * bindings/v8/V8Binding.h:
+ * bindings/v8/V8BindingHelpers.cpp: Removed.
+ * bindings/v8/V8BindingHelpers.h: Removed.
+
+2012-08-13 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Remove unused methods and headers from V8Utilities
+ https://bugs.webkit.org/show_bug.cgi?id=93805
+
+ Reviewed by Adam Barth.
+
+ This patch removes unused methods, forward declarations and
+ headers from V8Utilities.{h,cpp}.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/V8Utilities.cpp:
+ * bindings/v8/V8Utilities.h:
+ (WebCore):
+
+2012-08-13 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move V8PerIsolateData::visitExternalStrings() to V8PerIsolateData.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=93803
+
+ Reviewed by Adam Barth.
+
+ In r125015, I forgot to move V8PerIsolateData::visitExternalStrings()
+ to V8PerIsolateData.cpp. This patch moves it.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/V8Binding.cpp:
+ * bindings/v8/V8PerIsolateData.cpp:
+ (WebCore):
+ (WebCore::V8PerIsolateData::visitExternalStrings):
+
+2012-08-13 Elliott Sprehn <esprehn@chromium.org>
+
+ Expand list of supported languages for RenderQuote to match WHATWG spec
+ https://bugs.webkit.org/show_bug.cgi?id=93424
+
+ Reviewed by Eric Seidel.
+
+ Expand the table of quotes to include the 148 lang values and associated quotes
+ from the WHATWG web-apps recommended styling spec.
+
+ Test: fast/css-generated-content/quotes-lang-case-insensitive.html
+
+ * rendering/RenderQuote.cpp: Added missing copyright.
+ (WebCore::quotesDataLanguageMap): Expanded the table of quotes.
+ (WebCore::basicQuotesData): Added a FIXME to switch to using stylized "en" quotes.
+ * rendering/RenderQuote.h: Added missing copyright.
+
+2012-08-09 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Remove evaluateInIsolatedWorld() from V8Proxy
+ https://bugs.webkit.org/show_bug.cgi?id=93679
+
+ Reviewed by Adam Barth.
+
+ To remove V8Proxy, this patch moves V8Proxy::evaluateInIsolatedWorld()
+ to ScriptController.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::evaluateInIsolatedWorld):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::precompileScript):
+
+2012-08-13 Bear Travis <betravis@adobe.com>
+
+ [CSS Exclusions] Remove unused CSSWrapShapes header includes
+ https://bugs.webkit.org/show_bug.cgi?id=93395
+
+ Reviewed by Kentaro Hara.
+
+ Removing the #include "CSSWrapShapes.h" lines from StyleBuilder.cpp and
+ RenderStyle.cpp. Both files now use the length-based WrapShapes.h classes.
+
+ * css/StyleBuilder.cpp:
+ * rendering/style/RenderStyle.cpp:
+
+2012-08-13 Pravin D <pravind.2k4@gmail.com>
+
+ Bad cast in RenderBox::computeReplacedLogicalHeightUsing
+ https://bugs.webkit.org/show_bug.cgi?id=93875
+
+ Reviewed by Abhishek Arya.
+
+ Pointer to the container of a replaced element was being type casted to renderbox
+ without checking if the container is a renderbox or not.
+
+ Test: fast/replaced/render-inline-cast-to-render-box-crash.html
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
+ Scrollbar height is retrieved only if the container is a renderBox. Otherwise scrollbar is taken as zero.
+
+2012-08-13 James Robinson <jamesr@chromium.org>
+
+ [chromium] Make WebAnimation a pure virtual interface to hide implementation and avoid unresolved symbols
+ https://bugs.webkit.org/show_bug.cgi?id=93907
+
+ Reviewed by Darin Fisher.
+
+ Updates WebAnimation users for interface changes.
+
+ * platform/graphics/chromium/AnimationTranslationUtil.cpp:
+ (WebCore::createWebAnimation):
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (WebCore::GraphicsLayerChromium::addAnimation):
+
+2012-08-11 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] Rewrite FindLibSoup2.cmake.
+ https://bugs.webkit.org/show_bug.cgi?id=93191
+
+ Reviewed by Rob Buis.
+
+ * PlatformEfl.cmake: Use LIBSOUP_FOO instead of LIBSOUP24_FOO,
+ also link against GObject, which is needed by libsoup.
+
+2012-08-10 James Robinson <jamesr@chromium.org>
+
+ [chromium] Clean up dependencies for Canvas2DLayerBridgeTest and GraphicsLayerChromiumTest unit tests
+ https://bugs.webkit.org/show_bug.cgi?id=93757
+
+ Reviewed by Adrienne Walker.
+
+ Exposes the current contentsScale for tests.
+
+ * platform/graphics/chromium/GraphicsLayerChromium.h:
+ (GraphicsLayerChromium):
+
+2012-08-13 Andreas Kling <kling@webkit.org>
+
+ Reduce the size of empty NinePieceImage objects.
+ <http://webkit.org/b/93747>
+
+ Reviewed by Antti Koivisto.
+
+ Move the members of NinePieceImage into a NinePieceImageData class, leaving NinePieceImage
+ with a single OwnPtr<NinePieceImageData> member. The constant NinePieceImage::defaultData()
+ provides default values for objects with null m_data.
+
+ RenderStyle's "StyleSurroundData" member has a BorderData, which in turn holds a NinePieceImage.
+ This means that anything with left/right/top/bottom, margin, padding or border style but *no*
+ border-image will save 104 bytes (assuming their RenderStyle is unshared, which is fairly common.)
+
+ This reduces the size of StyleSurroundData by 104 bytes, effectively reducing memory consumption
+ by 1.72MB when viewing the full HTML5 spec at <http://whatwg.org/c>
+
+ * rendering/style/NinePieceImage.cpp:
+ (WebCore::NinePieceImageData::operator==):
+ (WebCore::NinePieceImage::defaultData):
+ (WebCore):
+ * rendering/style/NinePieceImage.h:
+ (WebCore::NinePieceImageData::NinePieceImageData):
+ (NinePieceImageData):
+ (WebCore::NinePieceImageData::operator!=):
+ (WebCore):
+ (NinePieceImage):
+ (WebCore::NinePieceImage::NinePieceImage):
+ (WebCore::NinePieceImage::operator=):
+ (WebCore::NinePieceImage::operator==):
+ (WebCore::NinePieceImage::operator!=):
+ (WebCore::NinePieceImage::hasImage):
+ (WebCore::NinePieceImage::image):
+ (WebCore::NinePieceImage::setImage):
+ (WebCore::NinePieceImage::imageSlices):
+ (WebCore::NinePieceImage::setImageSlices):
+ (WebCore::NinePieceImage::fill):
+ (WebCore::NinePieceImage::setFill):
+ (WebCore::NinePieceImage::borderSlices):
+ (WebCore::NinePieceImage::setBorderSlices):
+ (WebCore::NinePieceImage::outset):
+ (WebCore::NinePieceImage::setOutset):
+ (WebCore::NinePieceImage::horizontalRule):
+ (WebCore::NinePieceImage::setHorizontalRule):
+ (WebCore::NinePieceImage::verticalRule):
+ (WebCore::NinePieceImage::setVerticalRule):
+ (WebCore::NinePieceImage::copyImageSlicesFrom):
+ (WebCore::NinePieceImage::copyBorderSlicesFrom):
+ (WebCore::NinePieceImage::copyOutsetFrom):
+ (WebCore::NinePieceImage::copyRepeatFrom):
+ (WebCore::NinePieceImage::setMaskDefaults):
+ (WebCore::NinePieceImage::ensureData):
+ (WebCore::NinePieceImage::data):
+
+2012-08-13 Florin Malita <fmalita@chromium.org>
+
+ WebKit+SVG does not support color-interpolation-filters or draw filters in correct colorspace
+ https://bugs.webkit.org/show_bug.cgi?id=6033
+
+ Reviewed by Dirk Schulze.
+
+ This patch adds support for SVG color-interpolation-filters. All non-CG plarforms now
+ perform color space conversions as needed (CG performs color space adjustments internally),
+ and the new default color space for filters is linearRGB
+ (http://www.w3.org/TR/SVG/filters.html#FilterPrimitivesOverviewIntro).
+
+ FilterEffect tracks the color-interpolation-filters attribute (m_colorSpace) and the
+ current result color space (m_resultColorSpace). When applying, the input results are
+ converted to the current FilterEffect's color space, and at the end of the filter effect
+ chain the result is finally converted to ColorSpaceDeviceRGB.
+
+ FilterEffect::transformResultColorSpace() handles non-CG color space converion (CG has
+ built in support for different color spaces) by first converting the result to an image
+ buffer, and then using the platform specific ImageBuffer::transformColorSpace(). This can
+ be expensive for filter chains with alternating color-interpolation-filters, but can be
+ optimized if/when color space support is added to all the graphics backends similarly to CG.
+
+ As expected, lots of filter-related pixel results will require rebaselining after this lands.
+
+ Test: svg/filters/color-interpolation-filters.svg
+
+ * platform/graphics/filters/FilterEffect.cpp:
+ (WebCore::FilterEffect::FilterEffect):
+ (WebCore::FilterEffect::apply):
+ (WebCore::FilterEffect::asImageBuffer):
+ (WebCore::FilterEffect::createImageBufferResult):
+ (WebCore::FilterEffect::transformResultColorSpace):
+ (WebCore):
+ * platform/graphics/filters/FilterEffect.h:
+ (WebCore::FilterEffect::colorSpace):
+ (WebCore::FilterEffect::setColorSpace):
+ (FilterEffect):
+ * platform/graphics/filters/SourceGraphic.h:
+ (WebCore::SourceGraphic::SourceGraphic):
+ * rendering/FilterEffectRenderer.cpp:
+ (WebCore::FilterEffectRenderer::apply):
+ * rendering/svg/RenderSVGResourceFilter.cpp:
+ (WebCore::RenderSVGResourceFilter::buildPrimitives):
+ (WebCore::RenderSVGResourceFilter::postApplyResource):
+
+2012-08-13 Raymond Toy <rtoy@google.com>
+
+ Oscillator node should throw exception if type is assigned an invalid value
+ https://bugs.webkit.org/show_bug.cgi?id=93490
+
+ Reviewed by Chris Rogers.
+
+ New tests added to oscillator-basic to catch exceptions.
+
+ * Modules/webaudio/Oscillator.cpp:
+ (WebCore::Oscillator::Oscillator):
+ (WebCore::Oscillator::setType): Return exception
+ * Modules/webaudio/Oscillator.h:
+ (Oscillator): Update setType declaration
+ * Modules/webaudio/Oscillator.idl: setType can raise exception.
+
+2012-08-13 Chris Rogers <crogers@google.com>
+
+ AudioContext::createMediaStreamSource() must create a provider for local MediaStreams
+ https://bugs.webkit.org/show_bug.cgi?id=93756
+
+ Reviewed by Eric Carlson.
+
+ There are two main kinds of MediaStreams (local and from remote peers).
+ Internally we need to know the difference so a MediaStreamAudioSourceNode will "just work".
+
+ Tested by existing test: mediastreamaudiosourcenode.html
+ Full testing can only be verified by manual tests.
+
+ * Modules/mediastream/LocalMediaStream.h:
+ (LocalMediaStream):
+ * Modules/mediastream/MediaStream.h:
+ (WebCore::MediaStream::isLocal):
+ (MediaStream):
+ * Modules/webaudio/AudioContext.cpp:
+ (WebCore::AudioContext::createMediaStreamSource):
+
+2012-08-13 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed, rolling out r125444.
+ http://trac.webkit.org/changeset/125444
+ https://bugs.webkit.org/show_bug.cgi?id=93872
+
+ Broke some tests
+
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::QtRuntimeMethod::~QtRuntimeMethod):
+ (JSC::Bindings::QtRuntimeMethod::jsObjectRef):
+ * bridge/qt/qt_runtime.h:
+ (QtRuntimeMethod):
+
+2012-08-13 Thiago Marcos P. Santos <thiago.santos@intel.com>
+
+ CanvasRenderContext2D::font() does not re-serialize the font
+ https://bugs.webkit.org/show_bug.cgi?id=50859
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Added proper serialization for the font property.
+
+ No new tests, unskipped the existing ones.
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::font):
+
+2012-08-13 Elliott Sprehn <esprehn@chromium.org>
+
+ CSS quotes output quotes when depth is negative
+ https://bugs.webkit.org/show_bug.cgi?id=92690
+
+ Reviewed by Eric Seidel.
+
+ Previously if the quote depth would go negative we would output the close quote from the
+ first pair of quotes again instead of outputting no quotes as required by the spec.
+
+ See: http://www.w3.org/TR/CSS21/generate.html#quotes-insert
+
+ Test: fast/css-generated-content/nested-quote-more-than-pairs.html
+
+ * rendering/RenderQuote.cpp:
+ (WebCore::RenderQuote::originalText): Allow the value passed to getOpenQuote to go negative by removing std::max.
+ * rendering/style/QuotesData.cpp:
+ (WebCore::QuotesData::getOpenQuote): Bounds check for negative values for safety.
+ (WebCore::QuotesData::getCloseQuote): Allow index to be >= -1 and return an empty string for -1.
+
+2012-08-13 Vangelis Kokkevis <vangelis@chromium.org>
+
+ [chromium] Clear HUD canvas contents before drawing into it.
+ https://bugs.webkit.org/show_bug.cgi?id=93759
+
+ Reviewed by Adrienne Walker.
+
+ Not clearing the bitmaps before drawing into it results into
+ random noise. This patch also caches the SkCanvas used by the HUD
+ to avoid reallocating it every frame.
+
+ * platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp:
+ (WebCore::CCHeadsUpDisplayLayerImpl::willDraw):
+ * platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.h:
+
+2012-08-13 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Replace use of internal Weak smart pointer with JSWeakObjectMap
+ https://bugs.webkit.org/show_bug.cgi?id=93872
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ The intention of this patch series is to replace use of internal JSC
+ API with use of the stable and public C API.
+
+ The JSC::Weak template is internal API and the only part of the C API
+ that exposes similar functionality is the JSWeakObjectMap. It is
+ special in the sense that its life-time is tied to the life-time of the
+ JS global object, which in turn is subject to garbage collection. In
+ order to maximize re-use of the same map across different JSContextRef
+ instances, we use the associated global context ref as owner of the
+ weak maps. The key in the weak map is the identity (pointer) of the
+ runtime method object itself. The iteration through the maps is
+ tedious, but should usually not go beyond just a few.
+
+ * bridge/qt/qt_runtime.cpp:
+ (Bindings):
+ (JSC::Bindings::methodMapCleaner):
+ (JSC::Bindings::QtRuntimeMethod::~QtRuntimeMethod):
+ (JSC::Bindings::QtRuntimeMethod::jsObjectRef):
+ * bridge/qt/qt_runtime.h:
+ (QtRuntimeMethod):
+
+2012-08-13 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] Remove glib-related Find modules and write single new one instead.
+ https://bugs.webkit.org/show_bug.cgi?id=93786
+
+ Reviewed by Rob Buis.
+
+ No new tests, build system plumbing.
+
+ * PlatformEfl.cmake: Use GLIB_* instead of Glib_*, and link
+ directly against GIO, as code in the soup network backend uses
+ that.
+
+2012-08-13 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Simplify storage and reduce size of QtConnectionObject
+ https://bugs.webkit.org/show_bug.cgi?id=93868
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ The connection object is a child of the sender QObject, so we can use parent()
+ whenever we need the sender instead of keeping an extra QObject pointer. Also
+ QtConnectionObject kept a RefPtr to the Instance, but actually only needed the
+ root object, so we can store a pointer to that instead.
+
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::QtConnectionObject::QtConnectionObject):
+ (JSC::Bindings::QtConnectionObject::~QtConnectionObject):
+ (JSC::Bindings::QtConnectionObject::execute):
+ (JSC::Bindings::QtConnectionObject::match):
+ * bridge/qt/qt_runtime.h:
+ (QtConnectionObject):
+
+2012-08-13 Zan Dobersek <zandobersek@gmail.com>
+
+ Media(Stream|Element)AudioSourceNode should be guarded by the WEB_AUDIO condition as well
+ https://bugs.webkit.org/show_bug.cgi?id=93864
+
+ Reviewed by Eric Carlson.
+
+ Add the WEB_AUDIO to the Conditional attribute in MediaElementAudioSourceNode
+ IDL file and the ENABLE(WEB_AUDIO) compilation guard to the header files for both
+ MediaStreamAudioSourceNode and MediaElementAudioSourceNode.
+
+ No new tests - no new functionality.
+
+ * Modules/webaudio/MediaElementAudioSourceNode.h:
+ * Modules/webaudio/MediaStreamAudioSourceNode.h:
+ * Modules/webaudio/MediaStreamAudioSourceNode.idl:
+
+2012-08-13 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Clean up exception handling
+ https://bugs.webkit.org/show_bug.cgi?id=93880
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ The JSC C API uses a JSValueRef* exception parameter to indicate to the
+ caller that an exception was thrown. Naturally the caller must store
+ that ValueRef on the stack in order to get seen and marked by the
+ garbage collector, otherwise the callee would have to use
+ JSValueProtect on it.
+
+ This patch fixes one such case where in fact the exception pointer was passed as zero to the
+ callee and thus ignored. The patch also removes an unused exception parameter.
+
+ * bridge/qt/qt_class.cpp:
+ (JSC::Bindings::QtClass::fallbackObject):
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::QtRuntimeMethod::QtRuntimeMethod):
+ * bridge/qt/qt_runtime.h:
+
+2012-08-13 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: remove commitEditing from the text editor delegate.
+ https://bugs.webkit.org/show_bug.cgi?id=93858
+
+ Reviewed by Vsevolod Vlasov.
+
+ This should be up to the source frame.
+
+ * inspector/front-end/DefaultTextEditor.js:
+ (WebInspector.DefaultTextEditor.prototype._registerShortcuts):
+ * inspector/front-end/SourceFrame.js:
+ (WebInspector.SourceFrame):
+ (WebInspector.SourceFrame.prototype.scrollChanged):
+ (WebInspector.SourceFrame.prototype._handleKeyDown):
+ (WebInspector.SourceFrame.prototype._commitEditing):
+ * inspector/front-end/TextEditor.js:
+
+2012-08-13 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125430.
+ http://trac.webkit.org/changeset/125430
+ https://bugs.webkit.org/show_bug.cgi?id=93881
+
+ Caused css2.1/t1604-c541-word-sp-00-b-a.html to regress on Mac
+ builds (Requested by mwenge on #webkit).
+
+ * platform/graphics/WidthIterator.cpp:
+ (WebCore::WidthIterator::advance):
+ * platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp:
+ (WebCore::HarfBuzzShaperBase::isWordEnd):
+ * platform/graphics/harfbuzz/HarfBuzzShaperBase.h:
+ (HarfBuzzShaperBase):
+ (WebCore::HarfBuzzShaperBase::isCodepointSpace):
+ * platform/graphics/mac/ComplexTextController.cpp:
+ (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::LineBreaker::nextLineBreak):
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::widthFromCache):
+
+2012-08-13 Mike West <mkwst@chromium.org>
+
+ FrameLoader::receivedMainResourceError doesn't handle GET cancellations well.
+ https://bugs.webkit.org/show_bug.cgi?id=93850
+
+ Reviewed by Adam Barth.
+
+ 'FrameLoader::cancel' should reset the loader's state, and it mostly
+ does. In the case of a GET form submission, however, the submitted form
+ URL that's stored doesn't match the URL that's requested (query string).
+ This leads to the loader getting a bit confused about what's going on,
+ and not clearing the stored form submission URL.
+
+ This patch moves to storing the form submission's actual request URL
+ as opposed to the form action URL.
+
+ None of the current tests should break, and when issue 93777 lands, it
+ won't be broken either.
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::submitForm):
+ Switched to using 'FormSubmission::requestURL', as that matches the
+ URL that's actually requested during a form submission via GET.
+
+2012-08-13 Antonio Gomes <agomes@rim.com>
+
+ [BlackBerry] Hardware accelerated scrolling of <select> content
+ https://bugs.webkit.org/show_bug.cgi?id=93856
+
+ Reviewed by Rob Buis.
+
+ Internally reviewed by Matthew Staikos.
+
+ * Resources/blackberry/selectControlBlackBerry.css: add -webkit-overflow-scrolling: touch (EOM).
+ (.select-area):
+
+2012-08-13 Allan Sandfeld Jensen <allan.jensen@nokia.com>
+
+ [Qt] Assertion in RenderObject::offsetFromAncestorContainer
+ https://bugs.webkit.org/show_bug.cgi?id=93845
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Do not attempt to clip using layers that are not containers of the renderer.
+
+ * page/GestureTapHighlighter.cpp:
+
+2012-08-13 Dominik Röttsches <dominik.rottsches@intel.com>
+
+ [Cairo] canvas/philip/tests/2d.drawImage.self.2.html test failing on ports using Cairo
+ https://bugs.webkit.org/show_bug.cgi?id=93244
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Similar to Skia's and Qt's ImageBuffer implementation we need to make sure that buffers
+ for images are copied when the destination canvas is identical to the
+ image buffer's context. This happens mostly in JS calls to canvas' drawImage method.
+ For now fixing the drawImage case, drawPattern case is handled in bug 93854.
+
+ No new tests, covered by canvas/philip/tests/2d.drawImage.self.2.html
+
+ * platform/graphics/cairo/ImageBufferCairo.cpp:
+ (WebCore::ImageBuffer::draw): Making sure buffer is copied when source and destination contexts are identical.
+
+2012-06-24 Robert Hogan <robert@webkit.org>
+
+ CSS 2.1 failure: Word-spacing affects each space and non-breaking space
+ https://bugs.webkit.org/show_bug.cgi?id=89826
+
+ Reviewed by Eric Seidel.
+
+ Add word spacing to consecutive spaces in a run per http://www.w3.org/TR/CSS21/text.html#spacing-props.
+
+ Test: fast/css/word-spacing-characters.html
+ fast/css/word-spacing-characters-complex-text.html
+ fast/css/word-spacing-characters-linebreak.html
+ css2.1/20110323/word-spacing-characters-002.htm
+ css2.1/20110323/word-spacing-characters-003.htm
+ css2.1/20110323/word-spacing-remove-space-001.htm
+ css2.1/20110323/word-spacing-remove-space-002.htm
+ css2.1/20110323/word-spacing-remove-space-003.htm
+ css2.1/20110323/word-spacing-remove-space-004.htm
+ css2.1/20110323/word-spacing-remove-space-005.htm
+ css2.1/20110323/word-spacing-remove-space-006.htm
+ css2.1/20110323/c541-word-sp-001.htm
+
+ * platform/graphics/WidthIterator.cpp:
+ (WebCore::WidthIterator::advance): All spaces (ordinary space or &nbsp;) get word-spacing added, even
+ if they are consecutive.
+ * platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp:
+ (WebCore::HarfBuzzShaperBase::isWordEnd): ditto, but for the complex text case on Chromium. Had to use
+ m_run rather than m_normalizedBuffer here as m_normalizedBuffer turns tabs into spaces! Unlike the simple
+ text path, '\n' gets word-spacing - I observed this from fast/text/atsui-spacing-features.html but can't
+ find it specified anywhere.
+ * platform/graphics/harfbuzz/HarfBuzzShaperBase.h:
+ (WebCore::HarfBuzzShaperBase::isCodepointSpace):
+ * platform/graphics/mac/ComplexTextController.cpp:
+ (WebCore::ComplexTextController::adjustGlyphsAndAdvances): ditto, but for the complext text case on Mac.
+ The change to this file is speculative, I don't have a Mac build.
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::LineBreaker::nextLineBreak): Tested by word-spacing-linebreak.html
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::widthFromCache): This code-path is not covered by any existing layout tests!
+ I've tried to come up with a test to hit it but have failed.
+
+2012-08-13 Anna Cavender <annacc@chromium.org>
+
+ Remove webkitMediaSourceURL from HTMLMediaElement.idl
+ https://bugs.webkit.org/show_bug.cgi?id=93619
+
+ Reviewed by Adam Barth.
+
+ The webkitMediaSourceURL attribute is no longer needed now that we use
+ createObjectURL() to generate a media source URL.
+
+ Test: update http/test/media/media-source/media-source.js
+
+ * html/HTMLMediaElement.h:
+ * html/HTMLMediaElement.idl:
+
+2012-08-13 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Port meta method/signal/slot handling in run-time bridge to use JSC C API
+ https://bugs.webkit.org/show_bug.cgi?id=93476
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Based on patch by No'am Rosenthal and lots of good suggestions by Caio Marcelo.
+
+ Ported the code that mapped invokable methods (and signals/slots) as
+ well as the code that provides the connect() and disconnect() functions
+ over to use the JSC C API. In the process one behavioural change was
+ implemented: Previously meta methods were actually function objects
+ that through Function.prototype allowed calling via
+ object.method.call(object). Through the use of plain JS objects that is
+ not possible anymore.
+
+ If we tried to continue to use function objects (JSObjectMakeFunction)
+ then we would loose the ability to store the private pointer. An
+ alternative approach would be to use a regular object and install the
+ Function prototype (Function.prototype), but unfortunately we cannot do
+ that without loosing the common prototype for signals and slots.
+
+ * bridge/qt/qt_class.cpp:
+ (JSC::Bindings::QtClass::fallbackObject):
+ * bridge/qt/qt_instance.cpp:
+ (JSC::Bindings::QtInstance::~QtInstance):
+ (JSC::Bindings::QtInstance::newRuntimeObject):
+ * bridge/qt/qt_instance.h:
+ (Bindings):
+ (QtInstance):
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::prototypeForSignalsAndSlots):
+ (JSC::Bindings::QtRuntimeMethod::QtRuntimeMethod):
+ (JSC::Bindings::QtRuntimeMethod::~QtRuntimeMethod):
+ (JSC::Bindings::QtRuntimeMethod::call):
+ (JSC::Bindings::QtRuntimeMethod::connect):
+ (JSC::Bindings::QtRuntimeMethod::disconnect):
+ (JSC::Bindings::QtRuntimeMethod::jsObjectRef):
+ (JSC::Bindings::QtRuntimeMethod::connectOrDisconnect):
+ (Bindings):
+ (JSC::Bindings::QtConnectionObject::~QtConnectionObject):
+ * bridge/qt/qt_runtime.h:
+ (JSC::Bindings::QtRuntimeMethod::name):
+ (QtRuntimeMethod):
+ (QtConnectionObject):
+
+2012-08-13 Leandro Gracia Gil <leandrogracia@chromium.org>
+
+ [Chromium] Fix nits in the find-in-page match rects API
+ https://bugs.webkit.org/show_bug.cgi?id=93817
+
+ Reviewed by Adam Barth.
+
+ This patch fixes a few pending nits from 93111.
+
+ Tests: existing WebKit unit test WebFrameTest.FindInPageMatchRects
+
+ * dom/Range.cpp:
+ (WebCore::Range::transformFriendlyBoundingBox): add call to updateLayoutIgnorePendingStylesheets.
+
+2012-08-13 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: get rid of beforeTextChanged
+ https://bugs.webkit.org/show_bug.cgi?id=93851
+
+ Reviewed by Vsevolod Vlasov.
+
+ Merged beforeTextChanged and afterTextChanged into a single
+ onTextChanged event.
+
+ * inspector/front-end/CodeMirrorTextEditor.js:
+ (WebInspector.CodeMirrorTextEditor.prototype.editRange):
+ (WebInspector.CodeMirrorTextEditor.prototype._onChange):
+ * inspector/front-end/DefaultTextEditor.js:
+ (WebInspector.DefaultTextEditor.prototype._enterInternalTextChangeMode):
+ (WebInspector.DefaultTextEditor.prototype._exitInternalTextChangeMode):
+ * inspector/front-end/JavaScriptSourceFrame.js:
+ (WebInspector.JavaScriptSourceFrame.prototype.onTextChanged):
+ (WebInspector.JavaScriptSourceFrame.prototype._removeBreakpointsBeforeEditing):
+ (WebInspector.JavaScriptSourceFrame.prototype._addBreakpointDecoration):
+ (WebInspector.JavaScriptSourceFrame.prototype._removeBreakpointDecoration):
+ * inspector/front-end/SourceFrame.js:
+ (WebInspector.SourceFrame.prototype.onTextChanged):
+ (WebInspector.TextEditorDelegateForSourceFrame.prototype.onTextChanged):
+ * inspector/front-end/TextEditor.js:
+ (WebInspector.TextEditorDelegate.prototype.onTextChanged):
+ * inspector/front-end/UISourceCodeFrame.js:
+ (WebInspector.UISourceCodeFrame.prototype.onTextChanged):
+
+2012-08-13 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com>
+
+ [css] Remove "default" switch case from CSS primitive value mappings
+ https://bugs.webkit.org/show_bug.cgi?id=93781
+
+ Reviewed by Alexey Proskuryakov.
+
+ Removing the "default" switch case allows compile-time early warning check,
+ specially useful for newly added or removed enumeration values.
+
+ * css/CSSPrimitiveValueMappings.h:
+
+2012-08-13 Anna Cavender <annacc@chromium.org>
+
+ Cap the number of SourceBuffers that may be added to a MediaSource.
+ https://bugs.webkit.org/show_bug.cgi?id=93406
+
+ Reviewed by Eric Carlson.
+
+ Make sure that no more SourceBuffer objects are added to a MediaSource
+ than can fit into the sourceBuffers SourceBufferList (internally stored
+ as a Vector). Also, make sure that new SourceBuffers are added with a
+ unique id even if the variable we are using to generate id wraps around.
+
+ No new tests. It would not be realistic to add so many SourceBuffers to
+ test the id variable wrapping. Existing tests should not be affected.
+
+ * Modules/mediasource/MediaSource.cpp:
+ (WebCore::MediaSource::MediaSource):
+ (WebCore::MediaSource::addSourceBuffer): Obtain a unique id before creating
+ a new SourceBuffer.
+ * Modules/mediasource/MediaSource.h:
+ * Modules/mediasource/SourceBufferList.cpp:
+ (WebCore::SourceBufferList::SourceBufferList):
+ (WebCore::SourceBufferList::generateUniqueId): Search for and generate a
+ unique id.
+ (WebCore):
+ (WebCore::SourceBufferList::contains): Check if a SourceBuffer with a
+ given id already exists in this SourceBufferList.
+ * Modules/mediasource/SourceBufferList.h:
+ (SourceBufferList):
+
+2012-08-13 Andrey Kosyakov <caseq@chromium.org>
+
+ Web Inspector: when status bar is too narrow, cut panel status bar, not main status bar items
+ https://bugs.webkit.org/show_bug.cgi?id=93814
+
+ Reviewed by Pavel Feldman.
+
+ - set shrink factor of bottom-status-bar-container to 1;
+ - set bottom-status-bar-container's width to 0 to workaround for flex-basis being ignored;
+
+ * inspector/front-end/inspector.css:
+ (#bottom-status-bar-container):
+
+2012-08-13 Yury Semikhatsky <yurys@chromium.org>
+
+ Web Inspector: add memory instrumentation for Attribute
+ https://bugs.webkit.org/show_bug.cgi?id=93827
+
+ Reviewed by Pavel Feldman.
+
+ Attribute's name and value footprint is counted as part of the DOM
+ component.
+
+ * dom/Attribute.h:
+ (WebCore::Attribute::reportMemoryUsage):
+ (Attribute):
+ * dom/ElementAttributeData.cpp:
+ (WebCore::ElementAttributeData::reportMemoryUsage):
+
+2012-08-13 Vsevolod Vlasov <vsevik@chromium.org>
+
+ Web Inspector: Polish search/replace toolbar buttons style.
+ https://bugs.webkit.org/show_bug.cgi?id=93826
+
+ Reviewed by Pavel Feldman.
+
+ * inspector/front-end/inspector.css:
+ (.toolbar-search button):
+
+2012-08-13 Kwang Yul Seo <skyul@company100.net>
+
+ [Qt] Add gprof.prf to build WebKit with gprof enabled
+ https://bugs.webkit.org/show_bug.cgi?id=90283
+
+ Reviewed by Eric Seidel.
+
+ No behavior change, so no new tests.
+
+ * WebCore.pri:
+ -ffunction-sections conflicts with -pg option, so don't use
+ -ffunction-sections option when gprof is enabled.
+
+2012-08-13 Zan Dobersek <zandobersek@gmail.com>
+
+ Unreviewed build fix after r125408, removing another usage of SVG_FEATURES.
+
+ * GNUmakefile.am:
+
+2012-08-13 Zan Dobersek <zandobersek@gmail.com>
+
+ [Gtk] Remove SVG_FEATURES and HTML_FEATURES from Source/WebCore/GNUmakefile.am
+ https://bugs.webkit.org/show_bug.cgi?id=90693
+
+ Reviewed by Philippe Normand.
+
+ Remove SVG_FEATURES and HTML_FEATURES variables. They can be replaced by the
+ FEATURE_DEFINES variable wherever they are used.
+
+ No new tests - no new functionality.
+
+ * GNUmakefile.am:
+
+2012-08-13 Mario Sanchez Prada <msanchez@igalia.com>
+
+ [GTK] Implementation of atk_editable_text_insert_text ignores 'length' parameter
+ https://bugs.webkit.org/show_bug.cgi?id=93804
+
+ Reviewed by Carlos Garcia Campos.
+
+ Use the 'length' parameter to insert a substring of the full
+ string passed to this method from AtkEditableText interface.
+
+ * accessibility/gtk/WebKitAccessibleInterfaceEditableText.cpp:
+ (webkitAccessibleEditableTextInsertText): Don't ignore 'length'.
+
+2012-08-13 Sam D <dsam2912@gmail.com>
+
+ Web Inspector: Feature Request - Adding mouse gesture for editing attribute values in elements/css panel
+ https://bugs.webkit.org/show_bug.cgi?id=93581
+
+ Reviewed by Alexander Pavlov.
+
+ Added functionality to modify valuesAdding support for updating number values in attributes in element
+ panel/ css panel using mouse gestures as well.
+
+ No new tests.
+
+ * inspector/front-end/StylesSidebarPane.js:
+ handling mousewheel event
+ * inspector/front-end/TextPrompt.js:
+ adding mouse event listener
+ (WebInspector.TextPrompt.prototype._attachInternal):
+ (WebInspector.TextPrompt.prototype.defaultKeyHandler):
+ (WebInspector.TextPrompt.prototype.onMouseWheel):
+ * inspector/front-end/UIUtils.js:
+ handling mouse event gesture and updating number based on mouse wheel
+ scroll direction as well.
+ (WebInspector._valueModificationDirection):
+ (WebInspector._modifiedHexValue):
+ (WebInspector._modifiedFloatNumber):
+ (WebInspector.handleElementValueModifications):
+
+2012-08-13 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Unreviewed. Fix make distcheck.
+
+ * GNUmakefile.list.am: Add missing header file.
+
+2012-08-10 Alexander Pavlov <apavlov@chromium.org>
+
+ Web Inspector: [Protocol] Force elements pseudo state via a separate InspectorCSSAgent method
+ https://bugs.webkit.org/show_bug.cgi?id=93721
+
+ Reviewed by Pavel Feldman.
+
+ Introduce InspectorCSSAgent::forcePseudoState() to modify the element's forced pseudo state.
+
+ * inspector/Inspector.json:
+ * inspector/InspectorCSSAgent.cpp:
+ (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
+ (WebCore::InspectorCSSAgent::getComputedStyleForNode):
+ (WebCore::InspectorCSSAgent::forcePseudoState):
+ (WebCore):
+ * inspector/InspectorCSSAgent.h:
+ (InspectorCSSAgent):
+ * inspector/InspectorDOMAgent.h:
+ (InspectorDOMAgent):
+ * inspector/front-end/AuditRules.js:
+ (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun.getStyles):
+ * inspector/front-end/CSSStyleModel.js:
+ (WebInspector.CSSStyleModel.prototype.getMatchedStylesAsync):
+ (WebInspector.CSSStyleModel.prototype.getComputedStyleAsync):
+ (WebInspector.CSSStyleModel.prototype.forcePseudoState):
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel.prototype._setPseudoClassForNodeId):
+ * inspector/front-end/MetricsSidebarPane.js:
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylesSidebarPane.prototype._refreshUpdate):
+ (WebInspector.StylesSidebarPane.prototype._rebuildUpdate):
+
+2012-08-13 Shinya Kawanaka <shinyak@chromium.org>
+
+ Cannot select the AuthorShadowDOM inner element of an img element
+ https://bugs.webkit.org/show_bug.cgi?id=91591
+
+ Reviewed by Dimitri Glazkov.
+
+ Since HTMLImageElement::canStartSelection always returns false, we cannot start selection
+ from any children (including shadow dom) of an img element. When the img element has a shadow dom,
+ we should be able to start selection.
+
+ Test: fast/dom/shadow/select-image-with-shadow.html
+
+ * html/HTMLImageElement.cpp:
+ (WebCore::HTMLImageElement::canStartSelection):
+ (WebCore):
+ * html/HTMLImageElement.h:
+ (HTMLImageElement):
+ * html/shadow/ImageInnerElement.h:
+ (WebCore::ImageInnerElement::canStartSelection): Since ImageInnerElement is really an image,
+ this should return always false to obey the exising behavior.
+ (ImageInnerElement):
+
+2012-08-13 Peter Wang <peter.wang@torchmobile.com.cn>
+
+ REGRESSION (r124723-r124741): 5 inspector/debugger tests failing on Apple Lion Debug WK1 (Tests)
+ https://bugs.webkit.org/show_bug.cgi?id=93387
+
+ Reviewed by Pavel Feldman.
+
+ Now the front-end has problem when setting the positon of breakpoint, so remove the comparing
+ of "column" to make the behavior back to the time as JSC cannot provide "column" info.
+ Refer to https://bugs.webkit.org/show_bug.cgi?id=93473.
+
+ No new test case for this bug.
+
+ * bindings/js/ScriptDebugServer.cpp:
+ (WebCore::ScriptDebugServer::hasBreakpoint):
+
+2012-08-10 Kinuko Yasuda <kinuko@chromium.org>
+
+ Support creating File object from FileSystem URL for files in FileSystem API
+ https://bugs.webkit.org/show_bug.cgi?id=93706
+
+ Reviewed by Darin Fisher.
+
+ Current File code assumes the existence of local file (i.e. requires a platform local file path) but for FileSystem
+ files it may not be always the case. For example some implementation may want to use in-memory filesystem to realize
+ sandboxed filesystem, or others may have the filesystem in remote servers.
+
+ This patch adds basic support for making File object constructible not only from a file path but from a FileSystem URL.
+ Since File can be appended to FormData or included in another Blob this patch also extends BlobData and FormData to support URL.
+
+ FileChooser and Drag-and-drop changes are not included in this patch.
+
+ No new tests: will add tests when we implement the platform side changes to wire this change.
+
+ * Modules/filesystem/DOMFileSystem.cpp:
+ (WebCore::DOMFileSystem::createFile):
+ * Modules/filesystem/DOMFileSystemSync.cpp:
+ (WebCore::DOMFileSystemSync::createFile):
+ * fileapi/Blob.cpp:
+ (WebCore::Blob::sliceInternal):
+ * fileapi/File.cpp:
+ (WebCore::createBlobDataForFileSystemURL): Added.
+ (WebCore::File::File):
+ * fileapi/File.h:
+ (WebCore::File::createForFileSystemFile):
+ (WebCore::File::fileSystemURL): Added.
+ * fileapi/WebKitBlobBuilder.cpp:
+ (WebCore::WebKitBlobBuilder::append):
+ * platform/chromium/support/WebHTTPBody.cpp:
+ (WebKit::WebHTTPBody::elementAt):
+ (WebKit::WebHTTPBody::appendURL): Added.
+ (WebKit::WebHTTPBody::appendURLRange): Added.
+ (WebKit::WebHTTPBody::appendBlob):
+ * platform/network/BlobData.cpp:
+ (WebCore::BlobData::appendURL):
+ * platform/network/BlobData.h:
+ (BlobDataItem):
+ (WebCore::BlobDataItem::BlobDataItem):
+ * platform/network/BlobRegistryImpl.cpp:
+ (WebCore::BlobRegistryImpl::appendStorageItems):
+ (WebCore::BlobRegistryImpl::registerBlobURL):
+ * platform/network/FormData.cpp:
+ (WebCore::FormData::deepCopy):
+ (WebCore::FormData::appendURL): Added.
+ (WebCore::FormData::appendURLRange): Added.
+ (WebCore::FormData::appendKeyValuePairItems):
+ * platform/network/FormData.h:
+ (WebCore::FormDataElement::FormDataElement):
+ (FormDataElement):
+ (WebCore::operator==):
+
+2012-08-12 Dan Bernstein <mitz@apple.com>
+
+ <rdar://problem/11442485> off-screen or inactive pages can change the mouse pointer
+
+ Reviewed by Adele Peterson.
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::fakeMouseMoveEventTimerFired): Added a check that the page is
+ on-screen and active before dispatching the fake mouse event.
+
+2012-08-12 Jonathan Dong <jonathan.dong@torchmobile.com.cn>
+
+ [BlackBerry] use MediaPlayer::userAgent() in MediaPlayerPrivateBlackBerry to avoid layering violation
+ https://bugs.webkit.org/show_bug.cgi?id=93588
+
+ Reviewed by Antonio Gomes.
+
+ Removed helper function MediaPlayerPrivate::userAgent() which has
+ introduced abstraction layering violation and replaced with
+ MediaPlayer::userAgent().
+
+ No new tests since there's no functional change.
+
+ * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:
+ (WebCore::MediaPlayerPrivate::load):
+
+2012-07-04 Kinuko Yasuda <kinuko@chromium.org>
+
+ Record metrics to measure the usage of WebKitBlobBuilder to eventually deprecate it
+ https://bugs.webkit.org/show_bug.cgi?id=90535
+
+ Reviewed by Eric Seidel.
+
+ No new tests as this has no functional changes.
+
+ * bindings/js/JSBlobCustom.cpp:
+ (WebCore::JSBlobConstructor::constructJSBlob):
+ * bindings/v8/custom/V8BlobCustom.cpp:
+ (WebCore::V8Blob::constructorCallback):
+ * fileapi/WebKitBlobBuilder.cpp:
+ (WebCore::WebKitBlobBuilder::getBlob):
+ * fileapi/WebKitBlobBuilder.h:
+ (WebKitBlobBuilder):
+
+2012-08-12 Ojan Vafai <ojan@chromium.org>
+
+ Remove unnecessary null checks from pseudoStyleForElement and adjustRenderStyle
+ https://bugs.webkit.org/show_bug.cgi?id=93730
+
+ Reviewed by Tony Chang.
+
+ All the callers of both methods make sure to pass in a non-null parentStyle.
+
+ No change in behavior.
+
+ * css/StyleResolver.cpp:
+ * css/StyleResolver.h:
+
+2012-08-12 Pravin D <pravind.2k4@gmail.com>
+
+ table cell.cellIndex should return -1 if there is no parent table
+ https://bugs.webkit.org/show_bug.cgi?id=93738
+
+ Reviewed by Eric Seidel.
+
+ According to the HTML5 spec the cellIndex of a table cell(td/th) whose parent is not a table row
+ must be -1. Currently we are returning zero. This patch fixes this behavior.
+
+ Test: fast/table/cellIndex-of-cell-with-different-parents.html
+
+ * html/HTMLTableCellElement.cpp:
+ (WebCore::HTMLTableCellElement::cellIndex):
+ If the parent of the cell is not a table row, -1 is returned. Otherwise a value greater
+ than or equal to zero is return.
+
+ * rendering/RenderTableCell.h:
+ (RenderTableCell):
+ Removed dead code and made minor webkit style related fix.
+
+2012-08-12 Leandro Gracia Gil <leandrogracia@chromium.org>
+
+ [Chromium] Implement the find-in-page match rects API
+ https://bugs.webkit.org/show_bug.cgi?id=93111
+
+ Reviewed by Adam Barth.
+
+ Introduce the find-in-page coordinate system. This system tries to solve
+ the unintuitive tickmark results presented in pages with multiple frames
+ and scrolled contents where the find results might not be in the visible
+ area of a frame, which might lead to tickmarks below the container frame.
+
+ To achieve this, this coordinate system goes up the render tree
+ normalizing the coordinates by the actual contents size of its container.
+ This leads to tickmarks scaled to the visible size of their frame
+ independently of its scroll. This coordinate system supports also CSS
+ scroll:overflow, transforms and the different positions.
+
+ Also add an auxiliary method to Range in order to provide a transform
+ friendly way to retrieve the absolute coordinates of the enclosing
+ bounding box without the adjustment operations that the existing
+ enclosingRect method does.
+
+ Tested by WebFrameTest WebKit unit test.
+
+ * dom/Range.cpp:
+ (WebCore::Range::transformFriendlyBoundingBox): add a transform-friendly equivalent of boundingBox.
+ (WebCore):
+ * dom/Range.h: move boundingBox to the group of non-transform-friendly methods.
+ (Range):
+
+2012-08-12 Ami Fischman <fischman@chromium.org>
+
+ Stop Y-flipping CROS/ARM video textures
+ https://bugs.webkit.org/show_bug.cgi?id=93769
+
+ Reviewed by Eric Seidel.
+
+ No new tests; there's no cros/arm bot yet, sadly.
+
+ * platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
+ (WebCore::CCVideoLayerImpl::appendQuads): drop the single-platform Y-flipping in prep for the platform doing the flip natively.
+
+2012-08-12 Mihnea Ovidenie <mihnea@adobe.com>
+
+ CSSRegions: Crash when using style in region for removed element.
+ https://bugs.webkit.org/show_bug.cgi?id=93276
+
+ Reviewed by Abhishek Arya.
+
+ When a RenderInline object from within a render flow thread is split, the cloned
+ hierarchy built during the split process does not have the inRenderFlowThread bit
+ set properly. If the cloned hierarchy is flowed into a region with region style rules,
+ we compute the style in region also for objects that do not have inRenderFlowThread bit
+ set and we store the computed style in region for caching purposes. But we only remove
+ an object style in region information if that object has the inRenderFlowThread bit set.
+ Under these circumstances, it is possible to remove a object with cached style in region
+ and without inRenderFlowThread bit set from the render tree and leave the associated cached
+ information un-removed. Such information will be accesses during the next paint phase of
+ the region, thus resulting a crash.
+
+ The fix is to modify RenderBlock::clone() and RenderInline::clone() functions to also copy the inRenderFlowThread bit
+ from the source into the clone, therefore the cloned hierarchies will have the inRenderFlowThread
+ bit set properly.
+
+ Test: fast/regions/removed-element-style-in-region-crash.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::clone):
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::clone): Replace former static RenderInline::cloneInline with member RenderInline::clone.
+ (WebCore::RenderInline::splitInlines):
+ * rendering/RenderInline.h:
+ (RenderInline):
+ * rendering/RenderRegion.cpp:
+ (WebCore::RenderRegion::setObjectStyleInRegion):
+ Added an assert to make sure that when we are computing style in region, we are doing for objects
+ with inRenderFlowThread set. Also, bail out early in this case to prevent further crashes.
+
+2012-08-12 Huang Dongsung <luxtella@company100.net>
+
+ Set the access qualifier of two methods to query frame specific info of BitmapImage to protected.
+ https://bugs.webkit.org/show_bug.cgi?id=90505
+
+ Reviewed by Eric Seidel.
+
+ Following 4 methods are protected.
+ size_t frameCount();
+ NativeImagePtr frameAtIndex(size_t);
+ bool frameIsCompleteAtIndex(size_t);
+ float frameDurationAtIndex(size_t);
+
+ So, 2 methds also should be protected because the frame info is only specific of
+ BitmapImage.
+ bool frameHasAlphaAtIndex(size_t);
+ ImageOrientation frameOrientationAtIndex(size_t);
+
+ On the other hand, this patch amended GraphicsContext3DCG.
+ - static_cast<BitmapImage*>(image)->frameHasAlphaAtIndex(0)
+ + image->currentFrameHasAlpha()
+
+ This patch does not affect PNG, JPEG, BMP, and WEBP because those images
+ have only 0 indexed frame.
+ Thus, GIF, and ICO are affected. However, an above query to get Alpha
+ is for the image that is created by image->nativeImageForCurrentFrame(), so it
+ is proper to use image->currentFrameHasAlpha() instead of
+ image->frameHasAlphaAtIndex(0).
+
+ No new tests, because it is hard to test. We need an animated GIF that
+ one frame has alpha and another frame does not have alpha. However, I
+ cannot find the animated GIF file that suffices the requirement.
+
+ * platform/graphics/BitmapImage.h:
+ (BitmapImage):
+ * platform/graphics/cg/GraphicsContext3DCG.cpp:
+ (WebCore::GraphicsContext3D::getImageData):
+
+2012-08-12 Takashi Sakamoto <tasak@google.com>
+
+ webkit fails IETC namespaces/prefix-007.xml
+ https://bugs.webkit.org/show_bug.cgi?id=86137
+
+ Reviewed by Eric Seidel.
+
+ If a namespace prefix or default namespace is declared more than once
+ only the last declaration shall be used.
+
+ parseAddNamespace doesn't check return value of WTF::HashMap<>::add.
+ If the return value's isNewEntry is true, the new entry is added with
+ the specified value. However, if isNewEntry is false, it is required
+ to update the store value.
+
+ No new tests. ietestcenter/css3/namespaces/prefix-007.xml and
+ ietestcenter/css3/namespaces/prefix-010.xml covers this change.
+
+ * css/StyleSheetContents.cpp:
+ (WebCore::StyleSheetContents::parserAddNamespace):
+ Modified to check m_namespaces.add's return value.
+ If the result says not a new entry, updated the value stored in
+ m_namespaces by using iterator in the result.
+
+2012-08-12 Benjamin Poulain <benjamin@webkit.org>
+
+ Move CSS's propertyNameStrings[] to from the header to the cpp file
+ https://bugs.webkit.org/show_bug.cgi?id=93771
+
+ Reviewed by Eric Seidel.
+
+ The names of propertyNameStrings[] should never be accessed directly. The function getPropertyName()
+ return the correct string of propertyNameStrings.
+
+ To ensure the values are not accessed by mistake, move them from the header to the implementation.
+
+ * css/makeprop.pl:
+
+2012-08-12 Benjamin Poulain <benjamin@webkit.org>
+
+ CSSComputedStyleDeclaration::cssText() should use StringBuilder
+ https://bugs.webkit.org/show_bug.cgi?id=93776
+
+ Reviewed by Eric Seidel.
+
+ String::append() is fairly inefficient when used to create a long string by appending a lot of small
+ pieces. StringBuilder is more approriate for the kind of operations done by CSSComputedStyleDeclaration::cssText().
+
+ This changes makes CSSComputedStyleDeclaration::cssText() about 6 times faster.
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::cssText):
+
2012-08-11 Benjamin Poulain <bpoulain@apple.com>
Do the DecimalNumber to String conversion on 8 bits
@@ -12155,7 +23730,7 @@
2012-08-02 Ryosuke Niwa <rniwa@webkit.org>
- Let XCode have its own away and also sort the files.
+ Let Xcode have its own away and also sort the files.
* WebCore.xcodeproj/project.pbxproj:
@@ -36446,7 +48021,7 @@
2012-07-12 Ryosuke Niwa <rniwa@webkit.org>
- Let XCode have its own way.
+ Let Xcode have its own way.
* WebCore.xcodeproj/project.pbxproj:
@@ -38066,7 +49641,7 @@
2012-07-11 Ryosuke Niwa <rniwa@webkit.org>
Clang build fix after r122345.
- Also let XCode do its own thing.
+ Also let Xcode do its own thing.
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLCollection.cpp:
diff --git a/Source/WebCore/Configurations/FeatureDefines.xcconfig b/Source/WebCore/Configurations/FeatureDefines.xcconfig
index 10257077c..cedd95d76 100644
--- a/Source/WebCore/Configurations/FeatureDefines.xcconfig
+++ b/Source/WebCore/Configurations/FeatureDefines.xcconfig
@@ -49,6 +49,7 @@ ENABLE_CSS_COMPOSITING = ;
ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION;
ENABLE_CSS_VARIABLES = ;
ENABLE_CSS3_FLEXBOX = ENABLE_CSS3_FLEXBOX;
+ENABLE_CSS3_TEXT_DECORATION = ;
ENABLE_CUSTOM_SCHEME_HANDLER = ;
ENABLE_DASHBOARD_SUPPORT = $(ENABLE_DASHBOARD_SUPPORT_$(REAL_PLATFORM_NAME));
ENABLE_DASHBOARD_SUPPORT_macosx = ENABLE_DASHBOARD_SUPPORT;
@@ -140,4 +141,4 @@ ENABLE_WIDGET_REGION_macosx = ENABLE_WIDGET_REGION;
ENABLE_WORKERS = ENABLE_WORKERS;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_FLEXBOX) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WIDGET_REGION) $(ENABLE_WORKERS) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_FLEXBOX) $(ENABLE_CSS3_TEXT_DECORATION) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WIDGET_REGION) $(ENABLE_WORKERS) $(ENABLE_XSLT);
diff --git a/Source/WebCore/DerivedSources.cpp b/Source/WebCore/DerivedSources.cpp
index b72567215..2763a4b49 100644
--- a/Source/WebCore/DerivedSources.cpp
+++ b/Source/WebCore/DerivedSources.cpp
@@ -100,6 +100,9 @@
#include "JSDOMStringList.cpp"
#include "JSDOMStringMap.cpp"
#include "JSDOMTokenList.cpp"
+#if ENABLE(UNDO_MANAGER)
+#include "JSDOMTransaction.cpp"
+#endif
#include "JSDOMURL.cpp"
#include "JSDOMWindow.cpp"
#include "JSElement.cpp"
@@ -477,6 +480,7 @@
#include "JSUndoManager.cpp"
#endif
#include "JSValidityState.cpp"
+#include "JSVoidCallback.cpp"
#include "JSWebKitAnimation.cpp"
#include "JSWebKitAnimationEvent.cpp"
#include "JSWebKitAnimationList.cpp"
diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make
index c57ad9bb9..ff76c3ad0 100644
--- a/Source/WebCore/DerivedSources.make
+++ b/Source/WebCore/DerivedSources.make
@@ -265,6 +265,7 @@ BINDING_IDLS = \
$(WebCore)/dom/WebKitNamedFlow.idl \
$(WebCore)/dom/WebKitTransitionEvent.idl \
$(WebCore)/dom/WheelEvent.idl \
+ $(WebCore)/editing/DOMTransaction.idl \
$(WebCore)/editing/UndoManager.idl \
$(WebCore)/fileapi/Blob.idl \
$(WebCore)/fileapi/File.idl \
@@ -360,6 +361,7 @@ BINDING_IDLS = \
$(WebCore)/html/TextMetrics.idl \
$(WebCore)/html/TimeRanges.idl \
$(WebCore)/html/ValidityState.idl \
+ $(WebCore)/html/VoidCallback.idl \
$(WebCore)/html/canvas/ArrayBuffer.idl \
$(WebCore)/html/canvas/ArrayBufferView.idl \
$(WebCore)/html/canvas/CanvasGradient.idl \
@@ -591,9 +593,9 @@ BINDING_IDLS = \
$(WebCore)/svg/SVGViewSpec.idl \
$(WebCore)/svg/SVGZoomAndPan.idl \
$(WebCore)/svg/SVGZoomEvent.idl \
- $(WebCore)/testing/FastMallocStatistics.idl \
$(WebCore)/testing/Internals.idl \
$(WebCore)/testing/InternalSettings.idl \
+ $(WebCore)/testing/MallocStatistics.idl \
$(WebCore)/workers/AbstractWorker.idl \
$(WebCore)/workers/DedicatedWorkerContext.idl \
$(WebCore)/workers/SharedWorker.idl \
diff --git a/Source/WebCore/DerivedSources.pri b/Source/WebCore/DerivedSources.pri
index 3bc4d91b6..7b5cd2163 100644
--- a/Source/WebCore/DerivedSources.pri
+++ b/Source/WebCore/DerivedSources.pri
@@ -269,6 +269,7 @@ IDL_BINDINGS += \
$$PWD/dom/WebKitNamedFlow.idl \
$$PWD/dom/WebKitTransitionEvent.idl \
$$PWD/dom/WheelEvent.idl \
+ $$PWD/editing/DOMTransaction.idl \
$$PWD/editing/UndoManager.idl \
$$PWD/fileapi/Blob.idl \
$$PWD/fileapi/File.idl \
@@ -443,9 +444,9 @@ IDL_BINDINGS += \
$$PWD/plugins/DOMMimeTypeArray.idl \
$$PWD/storage/Storage.idl \
$$PWD/storage/StorageEvent.idl \
- $$PWD/testing/FastMallocStatistics.idl \
$$PWD/testing/Internals.idl \
$$PWD/testing/InternalSettings.idl \
+ $$PWD/testing/MallocStatistics.idl \
$$PWD/workers/AbstractWorker.idl \
$$PWD/workers/DedicatedWorkerContext.idl \
$$PWD/workers/SharedWorker.idl \
diff --git a/Source/WebCore/English.lproj/localizedStrings.js b/Source/WebCore/English.lproj/localizedStrings.js
index b6baa795e..95742fefb 100644
--- a/Source/WebCore/English.lproj/localizedStrings.js
+++ b/Source/WebCore/English.lproj/localizedStrings.js
@@ -296,6 +296,10 @@ localizedStrings["Open link in Resources panel"] = "Open link in Resources panel
localizedStrings["Other"] = "Other";
localizedStrings["Device metrics"] = "Device metrics";
localizedStrings["Paint"] = "Paint";
+localizedStrings["Image Decode"] = "Image Decode";
+localizedStrings["Image Resize"] = "Image Resize";
+localizedStrings["cached"] = "cached";
+localizedStrings["non-cached"] = "non-cached";
localizedStrings["Parse"] = "Parse";
localizedStrings["Parser"] = "Parser";
localizedStrings["Path"] = "Path";
diff --git a/Source/WebCore/GNUmakefile.am b/Source/WebCore/GNUmakefile.am
index e714c5ada..f9eab2441 100644
--- a/Source/WebCore/GNUmakefile.am
+++ b/Source/WebCore/GNUmakefile.am
@@ -1,8 +1,5 @@
include $(srcdir)/Source/WebCore/GNUmakefile.list.am
-SVG_FEATURES :=
-HTML_FEATURES :=
-
WEBCORE_CSS_PROPERTY_NAMES := $(WebCore)/css/CSSPropertyNames.in
WEBCORE_CSS_VALUE_KEYWORDS := $(WebCore)/css/CSSValueKeywords.in
@@ -19,6 +16,7 @@ webcore_cppflags += \
-I$(srcdir)/Source/WebCore/Modules/mediastream \
-I$(srcdir)/Source/WebCore/Modules/notifications \
-I$(srcdir)/Source/WebCore/Modules/protocolhandler \
+ -I$(srcdir)/Source/WebCore/Modules/quota \
-I$(srcdir)/Source/WebCore/Modules/webaudio \
-I$(srcdir)/Source/WebCore/Modules/webdatabase \
-I$(srcdir)/Source/WebCore/Modules/websockets \
@@ -226,7 +224,6 @@ endif # END ENABLE_SQL_DATABASE
# ----
if ENABLE_DATALIST_ELEMENT
FEATURE_DEFINES += ENABLE_DATALIST_ELEMENT=1
-HTML_FEATURES += ENABLE_DATALIST_ELEMENT=1
webcore_cppflags += -DENABLE_DATALIST_ELEMENT=1
endif # END ENABLE_DATALIST_ELEMENT
@@ -354,7 +351,6 @@ endif # END ENABLE_ORIENTATION_EVENTS
# ----
if ENABLE_VIDEO
FEATURE_DEFINES += ENABLE_VIDEO=1
-HTML_FEATURES += ENABLE_VIDEO=1
webcore_cppflags += -DENABLE_VIDEO=1
if USE_GSTREAMER
@@ -464,10 +460,6 @@ endif
if ENABLE_FILTERS
FEATURE_DEFINES += ENABLE_FILTERS=1
webcore_cppflags += -DENABLE_FILTERS=1
-if ENABLE_SVG
-SVG_FEATURES += ENABLE_FILTERS=1
-endif
-
endif # END ENABLE_FILTERS
# ----
@@ -503,10 +495,6 @@ endif # END ENABLE_CSS_FILTERS
if ENABLE_CSS_COMPOSITING
FEATURE_DEFINES += ENABLE_CSS_COMPOSITING=1
webcore_cppflags += -DENABLE_CSS_COMPOSITING=1
-if ENABLE_SVG
-SVG_FEATURES += ENABLE_CSS_COMPOSITING=1
-endif
-
endif # END ENABLE_CSS_COMPOSITING
# ----
@@ -563,7 +551,6 @@ WEBCORE_CSS_VALUE_KEYWORDS += $(WebCore)/css/SVGCSSValueKeywords.in
# SVG Features
if ENABLE_SVG_FONTS
FEATURE_DEFINES += ENABLE_SVG_FONTS=1
-SVG_FEATURES += ENABLE_SVG_FONTS=1
webcore_cppflags += -DENABLE_SVG_FONTS=1
endif
@@ -572,14 +559,8 @@ endif # END ENABLE_SVG
# SVG tag and attribute names (need to pass an extra flag if svg experimental features are enabled)
DerivedSources/WebCore/SVGNames.cpp: DerivedSources/WebCore/SVGElementFactory.cpp
DerivedSources/WebCore/JSSVGElementWrapperFactory.cpp: DerivedSources/WebCore/SVGElementFactory.cpp
-
-if SVG_FLAGS
-DerivedSources/WebCore/SVGElementFactory.cpp: $(WebCore)/dom/make_names.pl $(WebCore)/svg/svgtags.in $(WebCore)/svg/svgattrs.in
- $(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/svg/svgtags.in --attrs $(WebCore)/svg/svgattrs.in --extraDefines "$(SVG_FEATURES)" --factory --wrapperFactory --outputDir "$(GENSOURCES_WEBCORE)"
-else
DerivedSources/WebCore/SVGElementFactory.cpp: $(WebCore)/dom/make_names.pl $(WebCore)/svg/svgtags.in $(WebCore)/svg/svgattrs.in
- $(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/svg/svgtags.in --attrs $(WebCore)/svg/svgattrs.in --factory --wrapperFactory --outputDir "$(GENSOURCES_WEBCORE)"
-endif # SVG_FLAGS
+ $(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/svg/svgtags.in --attrs $(WebCore)/svg/svgattrs.in --extraDefines "$(FEATURE_DEFINES)" --factory --wrapperFactory --outputDir "$(GENSOURCES_WEBCORE)"
# end SVG Features
@@ -741,6 +722,13 @@ webcore_cppflags += -DENABLE_CSS3_FLEXBOX=1
endif # END ENABLE_CSS3_FLEXBOX
# ---
+# CSS3 Text Decoration support
+if ENABLE_CSS3_TEXT_DECORATION
+FEATURE_DEFINES += ENABLE_CSS3_TEXT_DECORATION=1
+webcore_cppflags += -DENABLE_CSS3_TEXT_DECORATION=1
+endif # END ENABLE_CSS3_TEXT_DECORATION
+
+# ---
# Link prefetch support
# ---
if ENABLE_LINK_PREFETCH
@@ -849,13 +837,8 @@ DerivedSources/WebCore/JSHTMLElementWrapperFactory.cpp: DerivedSources/WebCore/H
DerivedSources/WebCore/HTMLElementFactory.cpp: DerivedSources/WebCore/HTMLElementFactory.h
DerivedSources/WebCore/HTMLElementFactory.h: DerivedSources/WebCore/HTMLNames.cpp
DerivedSources/WebCore/HTMLNames.cpp: DerivedSources/WebCore/HTMLNames.h
-if HTML_FLAGS
-DerivedSources/WebCore/HTMLNames.h: $(WebCore)/dom/make_names.pl $(WebCore)/html/HTMLTagNames.in $(WebCore)/html/HTMLAttributeNames.in
- $(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/html/HTMLTagNames.in --attrs $(WebCore)/html/HTMLAttributeNames.in --extraDefines "$(HTML_FEATURES)" --factory --wrapperFactory --outputDir "$(GENSOURCES_WEBCORE)"
-else
DerivedSources/WebCore/HTMLNames.h: $(WebCore)/dom/make_names.pl $(WebCore)/html/HTMLTagNames.in $(WebCore)/html/HTMLAttributeNames.in
- $(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/html/HTMLTagNames.in --attrs $(WebCore)/html/HTMLAttributeNames.in --factory --wrapperFactory --outputDir "$(GENSOURCES_WEBCORE)"
-endif # HTML_FLAGS
+ $(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/html/HTMLTagNames.in --attrs $(WebCore)/html/HTMLAttributeNames.in --extraDefines "$(FEATURE_DEFINES)" --factory --wrapperFactory --outputDir "$(GENSOURCES_WEBCORE)"
DerivedSources/WebCore/XMLNSNames.cpp DerivedSources/WebCore/XMLNSNames.h: $(WebCore)/dom/make_names.pl $(WebCore)/xml/xmlnsattrs.in
@@ -913,6 +896,7 @@ IDL_PATH := \
$(WebCore)/Modules/mediasource \
$(WebCore)/Modules/mediastream \
$(WebCore)/Modules/notifications \
+ $(WebCore)/Modules/quota \
$(WebCore)/Modules/webaudio \
$(WebCore)/Modules/webdatabase \
$(WebCore)/Modules/websockets \
diff --git a/Source/WebCore/GNUmakefile.list.am b/Source/WebCore/GNUmakefile.list.am
index c61bb8df4..2bc98797f 100644
--- a/Source/WebCore/GNUmakefile.list.am
+++ b/Source/WebCore/GNUmakefile.list.am
@@ -36,14 +36,42 @@ webcore_built_sources += \
DerivedSources/WebCore/JSArrayBufferView.h \
DerivedSources/WebCore/JSAttr.cpp \
DerivedSources/WebCore/JSAttr.h \
+ DerivedSources/WebCore/JSAudioBuffer.cpp \
+ DerivedSources/WebCore/JSAudioBuffer.h \
+ DerivedSources/WebCore/JSAudioBufferCallback.cpp \
+ DerivedSources/WebCore/JSAudioBufferCallback.h \
+ DerivedSources/WebCore/JSAudioBufferSourceNode.cpp \
+ DerivedSources/WebCore/JSAudioBufferSourceNode.h \
+ DerivedSources/WebCore/JSAudioChannelMerger.cpp \
+ DerivedSources/WebCore/JSAudioChannelMerger.h \
+ DerivedSources/WebCore/JSAudioChannelSplitter.cpp \
+ DerivedSources/WebCore/JSAudioChannelSplitter.h \
DerivedSources/WebCore/JSAudioContext.cpp \
DerivedSources/WebCore/JSAudioContext.h \
+ DerivedSources/WebCore/JSAudioDestinationNode.cpp \
+ DerivedSources/WebCore/JSAudioDestinationNode.h \
+ DerivedSources/WebCore/JSAudioGain.cpp \
+ DerivedSources/WebCore/JSAudioGain.h \
+ DerivedSources/WebCore/JSAudioGainNode.cpp \
+ DerivedSources/WebCore/JSAudioGainNode.h \
+ DerivedSources/WebCore/JSAudioListener.cpp \
+ DerivedSources/WebCore/JSAudioListener.h \
+ DerivedSources/WebCore/JSAudioNode.cpp \
+ DerivedSources/WebCore/JSAudioNode.h \
DerivedSources/WebCore/JSAudioPannerNode.cpp \
DerivedSources/WebCore/JSAudioPannerNode.h \
+ DerivedSources/WebCore/JSAudioParam.cpp \
+ DerivedSources/WebCore/JSAudioParam.h \
+ DerivedSources/WebCore/JSAudioProcessingEvent.cpp \
+ DerivedSources/WebCore/JSAudioProcessingEvent.h \
+ DerivedSources/WebCore/JSAudioSourceNode.cpp \
+ DerivedSources/WebCore/JSAudioSourceNode.h \
DerivedSources/WebCore/JSBarInfo.cpp \
DerivedSources/WebCore/JSBarInfo.h \
DerivedSources/WebCore/JSBeforeLoadEvent.cpp \
DerivedSources/WebCore/JSBeforeLoadEvent.h \
+ DerivedSources/WebCore/JSBiquadFilterNode.cpp \
+ DerivedSources/WebCore/JSBiquadFilterNode.h \
DerivedSources/WebCore/JSBlob.cpp \
DerivedSources/WebCore/JSBlob.h \
DerivedSources/WebCore/JSCanvasGradient.cpp \
@@ -64,12 +92,16 @@ webcore_built_sources += \
DerivedSources/WebCore/JSClientRectList.h \
DerivedSources/WebCore/JSClipboard.cpp \
DerivedSources/WebCore/JSClipboard.h \
+ DerivedSources/WebCore/JSCloseEvent.cpp \
+ DerivedSources/WebCore/JSCloseEvent.h \
DerivedSources/WebCore/JSComment.cpp \
DerivedSources/WebCore/JSComment.h \
DerivedSources/WebCore/JSCompositionEvent.cpp \
DerivedSources/WebCore/JSCompositionEvent.h \
DerivedSources/WebCore/JSConsole.cpp \
DerivedSources/WebCore/JSConsole.h \
+ DerivedSources/WebCore/JSConvolverNode.cpp \
+ DerivedSources/WebCore/JSConvolverNode.h \
DerivedSources/WebCore/JSCoordinates.cpp \
DerivedSources/WebCore/JSCoordinates.h \
DerivedSources/WebCore/JSCounter.cpp \
@@ -104,16 +136,34 @@ webcore_built_sources += \
DerivedSources/WebCore/JSCSSValueList.h \
DerivedSources/WebCore/JSCustomEvent.cpp \
DerivedSources/WebCore/JSCustomEvent.h \
- DerivedSources/WebCore/JSDataTransferItemList.h \
+ DerivedSources/WebCore/JSDatabase.cpp \
+ DerivedSources/WebCore/JSDatabase.h \
+ DerivedSources/WebCore/JSDatabaseCallback.cpp \
+ DerivedSources/WebCore/JSDatabaseCallback.h \
+ DerivedSources/WebCore/JSDatabaseSync.cpp \
+ DerivedSources/WebCore/JSDatabaseSync.h \
+ DerivedSources/WebCore/JSDataTransferItem.cpp \
+ DerivedSources/WebCore/JSDataTransferItem.h \
DerivedSources/WebCore/JSDataTransferItemList.cpp \
+ DerivedSources/WebCore/JSDataTransferItemList.h \
DerivedSources/WebCore/JSDataView.cpp \
DerivedSources/WebCore/JSDataView.h \
DerivedSources/WebCore/JSDedicatedWorkerContext.cpp \
DerivedSources/WebCore/JSDedicatedWorkerContext.h \
+ DerivedSources/WebCore/JSDelayNode.cpp \
+ DerivedSources/WebCore/JSDelayNode.h \
DerivedSources/WebCore/JSDeviceMotionEvent.cpp \
DerivedSources/WebCore/JSDeviceMotionEvent.h \
DerivedSources/WebCore/JSDeviceOrientationEvent.cpp \
DerivedSources/WebCore/JSDeviceOrientationEvent.h \
+ DerivedSources/WebCore/JSDirectoryEntry.cpp \
+ DerivedSources/WebCore/JSDirectoryEntry.h \
+ DerivedSources/WebCore/JSDirectoryEntrySync.cpp \
+ DerivedSources/WebCore/JSDirectoryEntrySync.h \
+ DerivedSources/WebCore/JSDirectoryReader.cpp \
+ DerivedSources/WebCore/JSDirectoryReader.h \
+ DerivedSources/WebCore/JSDirectoryReaderSync.cpp \
+ DerivedSources/WebCore/JSDirectoryReaderSync.h \
DerivedSources/WebCore/JSDocument.cpp \
DerivedSources/WebCore/JSDocumentFragment.cpp \
DerivedSources/WebCore/JSDocumentFragment.h \
@@ -126,6 +176,10 @@ webcore_built_sources += \
DerivedSources/WebCore/JSDOMCoreException.h \
DerivedSources/WebCore/JSDOMError.cpp \
DerivedSources/WebCore/JSDOMError.h \
+ DerivedSources/WebCore/JSDOMFileSystem.cpp \
+ DerivedSources/WebCore/JSDOMFileSystem.h \
+ DerivedSources/WebCore/JSDOMFileSystemSync.cpp \
+ DerivedSources/WebCore/JSDOMFileSystemSync.h \
DerivedSources/WebCore/JSDOMFormData.cpp \
DerivedSources/WebCore/JSDOMFormData.h \
DerivedSources/WebCore/JSDOMImplementation.cpp \
@@ -152,6 +206,8 @@ webcore_built_sources += \
DerivedSources/WebCore/JSDOMStringMap.h \
DerivedSources/WebCore/JSDOMTokenList.cpp \
DerivedSources/WebCore/JSDOMTokenList.h \
+ DerivedSources/WebCore/JSDOMTransaction.cpp \
+ DerivedSources/WebCore/JSDOMTransaction.h \
DerivedSources/WebCore/JSDOMURL.cpp \
DerivedSources/WebCore/JSDOMURL.h \
DerivedSources/WebCore/JSDOMWindow.cpp \
@@ -160,10 +216,25 @@ webcore_built_sources += \
DerivedSources/WebCore/JSDynamicsCompressorNode.cpp \
DerivedSources/WebCore/JSElement.cpp \
DerivedSources/WebCore/JSElement.h \
+ DerivedSources/WebCore/JSElementTimeControl.h \
DerivedSources/WebCore/JSEntity.cpp \
DerivedSources/WebCore/JSEntity.h \
DerivedSources/WebCore/JSEntityReference.cpp \
DerivedSources/WebCore/JSEntityReference.h \
+ DerivedSources/WebCore/JSEntriesCallback.cpp \
+ DerivedSources/WebCore/JSEntriesCallback.h \
+ DerivedSources/WebCore/JSEntry.cpp \
+ DerivedSources/WebCore/JSEntry.h \
+ DerivedSources/WebCore/JSEntryArray.cpp \
+ DerivedSources/WebCore/JSEntryArray.h \
+ DerivedSources/WebCore/JSEntryArraySync.cpp \
+ DerivedSources/WebCore/JSEntryArraySync.h \
+ DerivedSources/WebCore/JSEntryCallback.cpp \
+ DerivedSources/WebCore/JSEntryCallback.h \
+ DerivedSources/WebCore/JSEntrySync.cpp \
+ DerivedSources/WebCore/JSEntrySync.h \
+ DerivedSources/WebCore/JSErrorCallback.cpp \
+ DerivedSources/WebCore/JSErrorCallback.h \
DerivedSources/WebCore/JSErrorEvent.cpp \
DerivedSources/WebCore/JSErrorEvent.h \
DerivedSources/WebCore/JSEXTTextureFilterAnisotropic.cpp \
@@ -177,6 +248,12 @@ webcore_built_sources += \
DerivedSources/WebCore/JSEventTarget.cpp \
DerivedSources/WebCore/JSEventTarget.h \
DerivedSources/WebCore/JSFile.cpp \
+ DerivedSources/WebCore/JSFileCallback.cpp \
+ DerivedSources/WebCore/JSFileCallback.h \
+ DerivedSources/WebCore/JSFileEntry.cpp \
+ DerivedSources/WebCore/JSFileEntry.h \
+ DerivedSources/WebCore/JSFileEntrySync.cpp \
+ DerivedSources/WebCore/JSFileEntrySync.h \
DerivedSources/WebCore/JSFileError.cpp \
DerivedSources/WebCore/JSFileError.h \
DerivedSources/WebCore/JSFile.h \
@@ -188,6 +265,14 @@ webcore_built_sources += \
DerivedSources/WebCore/JSFileReader.h \
DerivedSources/WebCore/JSFileReaderSync.cpp \
DerivedSources/WebCore/JSFileReaderSync.h \
+ DerivedSources/WebCore/JSFileSystemCallback.cpp \
+ DerivedSources/WebCore/JSFileSystemCallback.h \
+ DerivedSources/WebCore/JSFileWriter.cpp \
+ DerivedSources/WebCore/JSFileWriter.h \
+ DerivedSources/WebCore/JSFileWriterCallback.cpp \
+ DerivedSources/WebCore/JSFileWriterCallback.h \
+ DerivedSources/WebCore/JSFileWriterSync.cpp \
+ DerivedSources/WebCore/JSFileWriterSync.h \
DerivedSources/WebCore/JSFloat32Array.cpp \
DerivedSources/WebCore/JSFloat32Array.h \
DerivedSources/WebCore/JSFloat64Array.cpp \
@@ -323,6 +408,8 @@ webcore_built_sources += \
DerivedSources/WebCore/JSHTMLScriptElement.h \
DerivedSources/WebCore/JSHTMLSelectElement.cpp \
DerivedSources/WebCore/JSHTMLSelectElement.h \
+ DerivedSources/WebCore/JSHTMLShadowElement.cpp \
+ DerivedSources/WebCore/JSHTMLShadowElement.h \
DerivedSources/WebCore/JSHTMLSourceElement.cpp \
DerivedSources/WebCore/JSHTMLSourceElement.h \
DerivedSources/WebCore/JSHTMLSpanElement.cpp \
@@ -357,6 +444,34 @@ webcore_built_sources += \
DerivedSources/WebCore/JSIceCallback.h \
DerivedSources/WebCore/JSIceCandidate.cpp \
DerivedSources/WebCore/JSIceCandidate.h \
+ DerivedSources/WebCore/JSIDBAny.cpp \
+ DerivedSources/WebCore/JSIDBAny.h \
+ DerivedSources/WebCore/JSIDBCursor.cpp \
+ DerivedSources/WebCore/JSIDBCursor.h \
+ DerivedSources/WebCore/JSIDBCursorWithValue.cpp \
+ DerivedSources/WebCore/JSIDBCursorWithValue.h \
+ DerivedSources/WebCore/JSIDBDatabaseException.cpp \
+ DerivedSources/WebCore/JSIDBDatabaseException.h \
+ DerivedSources/WebCore/JSIDBDatabase.cpp \
+ DerivedSources/WebCore/JSIDBDatabase.h \
+ DerivedSources/WebCore/JSIDBFactory.cpp \
+ DerivedSources/WebCore/JSIDBFactory.h \
+ DerivedSources/WebCore/JSIDBIndex.cpp \
+ DerivedSources/WebCore/JSIDBIndex.h \
+ DerivedSources/WebCore/JSIDBKey.cpp \
+ DerivedSources/WebCore/JSIDBKey.h \
+ DerivedSources/WebCore/JSIDBKeyRange.cpp \
+ DerivedSources/WebCore/JSIDBKeyRange.h \
+ DerivedSources/WebCore/JSIDBObjectStore.cpp \
+ DerivedSources/WebCore/JSIDBObjectStore.h \
+ DerivedSources/WebCore/JSIDBRequest.cpp \
+ DerivedSources/WebCore/JSIDBRequest.h \
+ DerivedSources/WebCore/JSIDBTransaction.cpp \
+ DerivedSources/WebCore/JSIDBTransaction.h \
+ DerivedSources/WebCore/JSIDBVersionChangeEvent.cpp \
+ DerivedSources/WebCore/JSIDBVersionChangeEvent.h \
+ DerivedSources/WebCore/JSIDBVersionChangeRequest.cpp \
+ DerivedSources/WebCore/JSIDBVersionChangeRequest.h \
DerivedSources/WebCore/JSImageData.cpp \
DerivedSources/WebCore/JSImageData.h \
DerivedSources/WebCore/JSInjectedScriptHost.cpp \
@@ -369,6 +484,8 @@ webcore_built_sources += \
DerivedSources/WebCore/JSInt32Array.h \
DerivedSources/WebCore/JSInt8Array.cpp \
DerivedSources/WebCore/JSInt8Array.h \
+ DerivedSources/WebCore/JSJavaScriptAudioNode.cpp \
+ DerivedSources/WebCore/JSJavaScriptAudioNode.h \
DerivedSources/WebCore/JSJavaScriptCallFrame.cpp \
DerivedSources/WebCore/JSJavaScriptCallFrame.h \
DerivedSources/WebCore/JSKeyboardEvent.cpp \
@@ -379,6 +496,8 @@ webcore_built_sources += \
DerivedSources/WebCore/JSLocation.h \
DerivedSources/WebCore/JSMediaController.cpp \
DerivedSources/WebCore/JSMediaController.h \
+ DerivedSources/WebCore/JSMediaElementAudioSourceNode.cpp \
+ DerivedSources/WebCore/JSMediaElementAudioSourceNode.h \
DerivedSources/WebCore/JSMediaError.cpp \
DerivedSources/WebCore/JSMediaError.h \
DerivedSources/WebCore/JSMediaList.cpp \
@@ -387,6 +506,8 @@ webcore_built_sources += \
DerivedSources/WebCore/JSMediaSource.h \
DerivedSources/WebCore/JSMediaStream.cpp \
DerivedSources/WebCore/JSMediaStream.h \
+ DerivedSources/WebCore/JSMediaStreamAudioSourceNode.cpp \
+ DerivedSources/WebCore/JSMediaStreamAudioSourceNode.h \
DerivedSources/WebCore/JSMediaStreamEvent.cpp \
DerivedSources/WebCore/JSMediaStreamEvent.h \
DerivedSources/WebCore/JSMediaStreamList.cpp \
@@ -407,6 +528,10 @@ webcore_built_sources += \
DerivedSources/WebCore/JSMessageEvent.h \
DerivedSources/WebCore/JSMessagePort.cpp \
DerivedSources/WebCore/JSMessagePort.h \
+ DerivedSources/WebCore/JSMetadata.cpp \
+ DerivedSources/WebCore/JSMetadata.h \
+ DerivedSources/WebCore/JSMetadataCallback.cpp \
+ DerivedSources/WebCore/JSMetadataCallback.h \
DerivedSources/WebCore/JSMicroDataItemValue.cpp \
DerivedSources/WebCore/JSMicroDataItemValue.h \
DerivedSources/WebCore/JSMouseEvent.cpp \
@@ -451,6 +576,8 @@ webcore_built_sources += \
DerivedSources/WebCore/JSOESTextureFloat.h \
DerivedSources/WebCore/JSOESVertexArrayObject.cpp \
DerivedSources/WebCore/JSOESVertexArrayObject.h \
+ DerivedSources/WebCore/JSOfflineAudioCompletionEvent.cpp \
+ DerivedSources/WebCore/JSOfflineAudioCompletionEvent.h \
DerivedSources/WebCore/JSOscillator.cpp \
DerivedSources/WebCore/JSOscillator.h \
DerivedSources/WebCore/JSOverflowEvent.cpp \
@@ -489,8 +616,12 @@ webcore_built_sources += \
DerivedSources/WebCore/JSRangeException.cpp \
DerivedSources/WebCore/JSRangeException.h \
DerivedSources/WebCore/JSRange.h \
+ DerivedSources/WebCore/JSRealtimeAnalyserNode.cpp \
+ DerivedSources/WebCore/JSRealtimeAnalyserNode.h \
DerivedSources/WebCore/JSRect.cpp \
DerivedSources/WebCore/JSRect.h \
+ DerivedSources/WebCore/JSRequestAnimationFrameCallback.cpp \
+ DerivedSources/WebCore/JSRequestAnimationFrameCallback.h \
DerivedSources/WebCore/JSRGBColor.cpp \
DerivedSources/WebCore/JSRGBColor.h \
DerivedSources/WebCore/JSRTCPeerConnection.cpp \
@@ -519,23 +650,344 @@ webcore_built_sources += \
DerivedSources/WebCore/JSSpeechInputResult.h \
DerivedSources/WebCore/JSSpeechInputResultList.cpp \
DerivedSources/WebCore/JSSpeechInputResultList.h \
+ DerivedSources/WebCore/JSSQLError.cpp \
+ DerivedSources/WebCore/JSSQLError.h \
+ DerivedSources/WebCore/JSSQLException.cpp \
DerivedSources/WebCore/JSSQLException.h \
+ DerivedSources/WebCore/JSSQLResultSet.cpp \
+ DerivedSources/WebCore/JSSQLResultSet.h \
+ DerivedSources/WebCore/JSSQLResultSetRowList.cpp \
DerivedSources/WebCore/JSSQLResultSetRowList.h \
+ DerivedSources/WebCore/JSSQLStatementCallback.cpp \
+ DerivedSources/WebCore/JSSQLStatementCallback.h \
+ DerivedSources/WebCore/JSSQLStatementErrorCallback.h \
DerivedSources/WebCore/JSSQLStatementErrorCallback.cpp \
+ DerivedSources/WebCore/JSSQLTransaction.cpp \
DerivedSources/WebCore/JSSQLTransaction.h \
+ DerivedSources/WebCore/JSSQLTransactionCallback.cpp \
+ DerivedSources/WebCore/JSSQLTransactionCallback.h \
+ DerivedSources/WebCore/JSSQLTransactionErrorCallback.cpp \
+ DerivedSources/WebCore/JSSQLTransactionErrorCallback.h \
+ DerivedSources/WebCore/JSSQLTransactionSync.cpp \
DerivedSources/WebCore/JSSQLTransactionSync.h \
+ DerivedSources/WebCore/JSSQLTransactionSyncCallback.cpp \
+ DerivedSources/WebCore/JSSQLTransactionSyncCallback.h \
DerivedSources/WebCore/JSStorage.cpp \
DerivedSources/WebCore/JSStorage.h \
DerivedSources/WebCore/JSStorageEvent.cpp \
DerivedSources/WebCore/JSStorageEvent.h \
+ DerivedSources/WebCore/JSStorageInfo.cpp \
+ DerivedSources/WebCore/JSStorageInfo.h \
+ DerivedSources/WebCore/JSStorageInfoErrorCallback.cpp \
+ DerivedSources/WebCore/JSStorageInfoErrorCallback.h \
+ DerivedSources/WebCore/JSStorageInfoQuotaCallback.cpp \
+ DerivedSources/WebCore/JSStorageInfoQuotaCallback.h \
+ DerivedSources/WebCore/JSStorageInfoUsageCallback.cpp \
+ DerivedSources/WebCore/JSStorageInfoUsageCallback.h \
+ DerivedSources/WebCore/JSStringCallback.cpp \
+ DerivedSources/WebCore/JSStringCallback.h \
DerivedSources/WebCore/JSStyleMedia.cpp \
DerivedSources/WebCore/JSStyleMedia.h \
DerivedSources/WebCore/JSStyleSheet.cpp \
DerivedSources/WebCore/JSStyleSheet.h \
DerivedSources/WebCore/JSStyleSheetList.cpp \
DerivedSources/WebCore/JSStyleSheetList.h \
+ DerivedSources/WebCore/JSSVGAElement.cpp \
+ DerivedSources/WebCore/JSSVGAElement.h \
+ DerivedSources/WebCore/JSSVGAltGlyphDefElement.cpp \
+ DerivedSources/WebCore/JSSVGAltGlyphDefElement.h \
+ DerivedSources/WebCore/JSSVGAltGlyphElement.cpp \
+ DerivedSources/WebCore/JSSVGAltGlyphElement.h \
+ DerivedSources/WebCore/JSSVGAltGlyphItemElement.cpp \
+ DerivedSources/WebCore/JSSVGAltGlyphItemElement.h \
+ DerivedSources/WebCore/JSSVGAngle.cpp \
+ DerivedSources/WebCore/JSSVGAngle.h \
+ DerivedSources/WebCore/JSSVGAnimateColorElement.cpp \
+ DerivedSources/WebCore/JSSVGAnimateColorElement.h \
+ DerivedSources/WebCore/JSSVGAnimatedAngle.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedAngle.h \
+ DerivedSources/WebCore/JSSVGAnimatedBoolean.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedBoolean.h \
+ DerivedSources/WebCore/JSSVGAnimatedEnumeration.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedEnumeration.h \
+ DerivedSources/WebCore/JSSVGAnimatedInteger.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedInteger.h \
+ DerivedSources/WebCore/JSSVGAnimatedLength.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedLength.h \
+ DerivedSources/WebCore/JSSVGAnimatedLengthList.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedLengthList.h \
+ DerivedSources/WebCore/JSSVGAnimatedNumber.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedNumber.h \
+ DerivedSources/WebCore/JSSVGAnimatedNumberList.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedNumberList.h \
+ DerivedSources/WebCore/JSSVGAnimatedPreserveAspectRatio.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedPreserveAspectRatio.h \
+ DerivedSources/WebCore/JSSVGAnimatedRect.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedRect.h \
+ DerivedSources/WebCore/JSSVGAnimatedString.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedString.h \
+ DerivedSources/WebCore/JSSVGAnimatedTransformList.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedTransformList.h \
+ DerivedSources/WebCore/JSSVGAnimateElement.cpp \
+ DerivedSources/WebCore/JSSVGAnimateElement.h \
+ DerivedSources/WebCore/JSSVGAnimateMotionElement.cpp \
+ DerivedSources/WebCore/JSSVGAnimateMotionElement.h \
+ DerivedSources/WebCore/JSSVGAnimateTransformElement.cpp \
+ DerivedSources/WebCore/JSSVGAnimateTransformElement.h \
+ DerivedSources/WebCore/JSSVGAnimationElement.cpp \
+ DerivedSources/WebCore/JSSVGAnimationElement.h \
+ DerivedSources/WebCore/JSSVGCircleElement.cpp \
+ DerivedSources/WebCore/JSSVGCircleElement.h \
+ DerivedSources/WebCore/JSSVGClipPathElement.cpp \
+ DerivedSources/WebCore/JSSVGClipPathElement.h \
+ DerivedSources/WebCore/JSSVGColor.cpp \
+ DerivedSources/WebCore/JSSVGColor.h \
+ DerivedSources/WebCore/JSSVGComponentTransferFunctionElement.cpp \
+ DerivedSources/WebCore/JSSVGComponentTransferFunctionElement.h \
+ DerivedSources/WebCore/JSSVGCursorElement.cpp \
+ DerivedSources/WebCore/JSSVGCursorElement.h \
+ DerivedSources/WebCore/JSSVGDefsElement.cpp \
+ DerivedSources/WebCore/JSSVGDefsElement.h \
+ DerivedSources/WebCore/JSSVGDescElement.cpp \
+ DerivedSources/WebCore/JSSVGDescElement.h \
+ DerivedSources/WebCore/JSSVGDocument.cpp \
+ DerivedSources/WebCore/JSSVGDocument.h \
+ DerivedSources/WebCore/JSSVGElement.cpp \
+ DerivedSources/WebCore/JSSVGElement.h \
+ DerivedSources/WebCore/JSSVGElementInstance.cpp \
DerivedSources/WebCore/JSSVGElementInstance.h \
+ DerivedSources/WebCore/JSSVGElementInstanceList.cpp \
+ DerivedSources/WebCore/JSSVGElementInstanceList.h \
DerivedSources/WebCore/JSSVGElementWrapperFactory.cpp \
+ DerivedSources/WebCore/JSSVGEllipseElement.cpp \
+ DerivedSources/WebCore/JSSVGEllipseElement.h \
+ DerivedSources/WebCore/JSSVGException.cpp \
+ DerivedSources/WebCore/JSSVGException.h \
+ DerivedSources/WebCore/JSSVGExternalResourcesRequired.h \
+ DerivedSources/WebCore/JSSVGFEBlendElement.cpp \
+ DerivedSources/WebCore/JSSVGFEBlendElement.h \
+ DerivedSources/WebCore/JSSVGFEColorMatrixElement.cpp \
+ DerivedSources/WebCore/JSSVGFEColorMatrixElement.h \
+ DerivedSources/WebCore/JSSVGFEComponentTransferElement.cpp \
+ DerivedSources/WebCore/JSSVGFEComponentTransferElement.h \
+ DerivedSources/WebCore/JSSVGFECompositeElement.cpp \
+ DerivedSources/WebCore/JSSVGFECompositeElement.h \
+ DerivedSources/WebCore/JSSVGFEConvolveMatrixElement.cpp \
+ DerivedSources/WebCore/JSSVGFEConvolveMatrixElement.h \
+ DerivedSources/WebCore/JSSVGFEDiffuseLightingElement.cpp \
+ DerivedSources/WebCore/JSSVGFEDiffuseLightingElement.h \
+ DerivedSources/WebCore/JSSVGFEDisplacementMapElement.cpp \
+ DerivedSources/WebCore/JSSVGFEDisplacementMapElement.h \
+ DerivedSources/WebCore/JSSVGFEDistantLightElement.cpp \
+ DerivedSources/WebCore/JSSVGFEDistantLightElement.h \
+ DerivedSources/WebCore/JSSVGFEDropShadowElement.cpp \
+ DerivedSources/WebCore/JSSVGFEDropShadowElement.h \
+ DerivedSources/WebCore/JSSVGFEFloodElement.cpp \
+ DerivedSources/WebCore/JSSVGFEFloodElement.h \
+ DerivedSources/WebCore/JSSVGFEFuncAElement.cpp \
+ DerivedSources/WebCore/JSSVGFEFuncAElement.h \
+ DerivedSources/WebCore/JSSVGFEFuncBElement.cpp \
+ DerivedSources/WebCore/JSSVGFEFuncBElement.h \
+ DerivedSources/WebCore/JSSVGFEFuncGElement.cpp \
+ DerivedSources/WebCore/JSSVGFEFuncGElement.h \
+ DerivedSources/WebCore/JSSVGFEFuncRElement.cpp \
+ DerivedSources/WebCore/JSSVGFEFuncRElement.h \
+ DerivedSources/WebCore/JSSVGFEGaussianBlurElement.cpp \
+ DerivedSources/WebCore/JSSVGFEGaussianBlurElement.h \
+ DerivedSources/WebCore/JSSVGFEImageElement.cpp \
+ DerivedSources/WebCore/JSSVGFEImageElement.h \
+ DerivedSources/WebCore/JSSVGFEMergeElement.cpp \
+ DerivedSources/WebCore/JSSVGFEMergeElement.h \
+ DerivedSources/WebCore/JSSVGFEMergeNodeElement.cpp \
+ DerivedSources/WebCore/JSSVGFEMergeNodeElement.h \
+ DerivedSources/WebCore/JSSVGFEMorphologyElement.cpp \
+ DerivedSources/WebCore/JSSVGFEMorphologyElement.h \
+ DerivedSources/WebCore/JSSVGFEOffsetElement.cpp \
+ DerivedSources/WebCore/JSSVGFEOffsetElement.h \
+ DerivedSources/WebCore/JSSVGFEPointLightElement.cpp \
+ DerivedSources/WebCore/JSSVGFEPointLightElement.h \
+ DerivedSources/WebCore/JSSVGFESpecularLightingElement.cpp \
+ DerivedSources/WebCore/JSSVGFESpecularLightingElement.h \
+ DerivedSources/WebCore/JSSVGFESpotLightElement.cpp \
+ DerivedSources/WebCore/JSSVGFESpotLightElement.h \
+ DerivedSources/WebCore/JSSVGFETileElement.cpp \
+ DerivedSources/WebCore/JSSVGFETileElement.h \
+ DerivedSources/WebCore/JSSVGFETurbulenceElement.cpp \
+ DerivedSources/WebCore/JSSVGFETurbulenceElement.h \
+ DerivedSources/WebCore/JSSVGFilterElement.cpp \
+ DerivedSources/WebCore/JSSVGFilterElement.h \
+ DerivedSources/WebCore/JSSVGFilterPrimitiveStandardAttributes.h \
+ DerivedSources/WebCore/JSSVGFitToViewBox.h \
+ DerivedSources/WebCore/JSSVGFontElement.cpp \
+ DerivedSources/WebCore/JSSVGFontElement.h \
+ DerivedSources/WebCore/JSSVGFontFaceElement.cpp \
+ DerivedSources/WebCore/JSSVGFontFaceElement.h \
+ DerivedSources/WebCore/JSSVGFontFaceFormatElement.cpp \
+ DerivedSources/WebCore/JSSVGFontFaceFormatElement.h \
+ DerivedSources/WebCore/JSSVGFontFaceNameElement.cpp \
+ DerivedSources/WebCore/JSSVGFontFaceNameElement.h \
+ DerivedSources/WebCore/JSSVGFontFaceSrcElement.cpp \
+ DerivedSources/WebCore/JSSVGFontFaceSrcElement.h \
+ DerivedSources/WebCore/JSSVGFontFaceUriElement.cpp \
+ DerivedSources/WebCore/JSSVGFontFaceUriElement.h \
+ DerivedSources/WebCore/JSSVGForeignObjectElement.cpp \
+ DerivedSources/WebCore/JSSVGForeignObjectElement.h \
+ DerivedSources/WebCore/JSSVGGElement.cpp \
+ DerivedSources/WebCore/JSSVGGElement.h \
+ DerivedSources/WebCore/JSSVGGlyphElement.cpp \
+ DerivedSources/WebCore/JSSVGGlyphElement.h \
+ DerivedSources/WebCore/JSSVGGlyphRefElement.cpp \
+ DerivedSources/WebCore/JSSVGGlyphRefElement.h \
+ DerivedSources/WebCore/JSSVGGradientElement.cpp \
+ DerivedSources/WebCore/JSSVGGradientElement.h \
+ DerivedSources/WebCore/JSSVGHKernElement.cpp \
+ DerivedSources/WebCore/JSSVGHKernElement.h \
+ DerivedSources/WebCore/JSSVGImageElement.cpp \
+ DerivedSources/WebCore/JSSVGImageElement.h \
+ DerivedSources/WebCore/JSSVGLangSpace.h \
+ DerivedSources/WebCore/JSSVGLength.cpp \
+ DerivedSources/WebCore/JSSVGLength.h \
+ DerivedSources/WebCore/JSSVGLengthList.cpp \
+ DerivedSources/WebCore/JSSVGLengthList.h \
+ DerivedSources/WebCore/JSSVGLinearGradientElement.cpp \
+ DerivedSources/WebCore/JSSVGLinearGradientElement.h \
+ DerivedSources/WebCore/JSSVGLineElement.cpp \
+ DerivedSources/WebCore/JSSVGLineElement.h \
+ DerivedSources/WebCore/JSSVGLocatable.h \
+ DerivedSources/WebCore/JSSVGMPathElement.cpp \
+ DerivedSources/WebCore/JSSVGMPathElement.h \
+ DerivedSources/WebCore/JSSVGMarkerElement.cpp \
+ DerivedSources/WebCore/JSSVGMarkerElement.h \
+ DerivedSources/WebCore/JSSVGMaskElement.cpp \
+ DerivedSources/WebCore/JSSVGMaskElement.h \
+ DerivedSources/WebCore/JSSVGMatrix.cpp \
+ DerivedSources/WebCore/JSSVGMatrix.h \
+ DerivedSources/WebCore/JSSVGMetadataElement.cpp \
+ DerivedSources/WebCore/JSSVGMetadataElement.h \
+ DerivedSources/WebCore/JSSVGMissingGlyphElement.cpp \
+ DerivedSources/WebCore/JSSVGMissingGlyphElement.h \
+ DerivedSources/WebCore/JSSVGNumber.cpp \
+ DerivedSources/WebCore/JSSVGNumber.h \
+ DerivedSources/WebCore/JSSVGNumberList.cpp \
+ DerivedSources/WebCore/JSSVGNumberList.h \
+ DerivedSources/WebCore/JSSVGPaint.cpp \
+ DerivedSources/WebCore/JSSVGPaint.h \
+ DerivedSources/WebCore/JSSVGPathElement.cpp \
+ DerivedSources/WebCore/JSSVGPathElement.h \
+ DerivedSources/WebCore/JSSVGPathSegArcAbs.cpp \
+ DerivedSources/WebCore/JSSVGPathSegArcAbs.h \
+ DerivedSources/WebCore/JSSVGPathSegArcRel.cpp \
+ DerivedSources/WebCore/JSSVGPathSegArcRel.h \
+ DerivedSources/WebCore/JSSVGPathSegClosePath.cpp \
+ DerivedSources/WebCore/JSSVGPathSegClosePath.h \
+ DerivedSources/WebCore/JSSVGPathSeg.cpp \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoCubicAbs.cpp \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoCubicAbs.h \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoCubicRel.cpp \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoCubicRel.h \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoCubicSmoothAbs.cpp \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoCubicSmoothAbs.h \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoCubicSmoothRel.cpp \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoCubicSmoothRel.h \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticAbs.cpp \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticAbs.h \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticRel.cpp \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticRel.h \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticSmoothAbs.cpp \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticSmoothAbs.h \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticSmoothRel.cpp \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticSmoothRel.h \
+ DerivedSources/WebCore/JSSVGPathSeg.h \
+ DerivedSources/WebCore/JSSVGPathSegLinetoAbs.cpp \
+ DerivedSources/WebCore/JSSVGPathSegLinetoAbs.h \
+ DerivedSources/WebCore/JSSVGPathSegLinetoHorizontalAbs.cpp \
+ DerivedSources/WebCore/JSSVGPathSegLinetoHorizontalAbs.h \
+ DerivedSources/WebCore/JSSVGPathSegLinetoHorizontalRel.cpp \
+ DerivedSources/WebCore/JSSVGPathSegLinetoHorizontalRel.h \
+ DerivedSources/WebCore/JSSVGPathSegLinetoRel.cpp \
+ DerivedSources/WebCore/JSSVGPathSegLinetoRel.h \
+ DerivedSources/WebCore/JSSVGPathSegLinetoVerticalAbs.cpp \
+ DerivedSources/WebCore/JSSVGPathSegLinetoVerticalAbs.h \
+ DerivedSources/WebCore/JSSVGPathSegLinetoVerticalRel.cpp \
+ DerivedSources/WebCore/JSSVGPathSegLinetoVerticalRel.h \
+ DerivedSources/WebCore/JSSVGPathSegList.cpp \
+ DerivedSources/WebCore/JSSVGPathSegList.h \
+ DerivedSources/WebCore/JSSVGPathSegMovetoAbs.cpp \
+ DerivedSources/WebCore/JSSVGPathSegMovetoAbs.h \
+ DerivedSources/WebCore/JSSVGPathSegMovetoRel.cpp \
+ DerivedSources/WebCore/JSSVGPathSegMovetoRel.h \
+ DerivedSources/WebCore/JSSVGPatternElement.cpp \
+ DerivedSources/WebCore/JSSVGPatternElement.h \
+ DerivedSources/WebCore/JSSVGPoint.cpp \
+ DerivedSources/WebCore/JSSVGPoint.h \
+ DerivedSources/WebCore/JSSVGPointList.cpp \
+ DerivedSources/WebCore/JSSVGPointList.h \
+ DerivedSources/WebCore/JSSVGPolygonElement.cpp \
+ DerivedSources/WebCore/JSSVGPolygonElement.h \
+ DerivedSources/WebCore/JSSVGPolylineElement.cpp \
+ DerivedSources/WebCore/JSSVGPolylineElement.h \
+ DerivedSources/WebCore/JSSVGPreserveAspectRatio.cpp \
+ DerivedSources/WebCore/JSSVGPreserveAspectRatio.h \
+ DerivedSources/WebCore/JSSVGRadialGradientElement.cpp \
+ DerivedSources/WebCore/JSSVGRadialGradientElement.h \
+ DerivedSources/WebCore/JSSVGRect.cpp \
+ DerivedSources/WebCore/JSSVGRectElement.cpp \
+ DerivedSources/WebCore/JSSVGRectElement.h \
+ DerivedSources/WebCore/JSSVGRect.h \
+ DerivedSources/WebCore/JSSVGRenderingIntent.cpp \
+ DerivedSources/WebCore/JSSVGRenderingIntent.h \
+ DerivedSources/WebCore/JSSVGScriptElement.cpp \
+ DerivedSources/WebCore/JSSVGScriptElement.h \
+ DerivedSources/WebCore/JSSVGSetElement.cpp \
+ DerivedSources/WebCore/JSSVGSetElement.h \
+ DerivedSources/WebCore/JSSVGStopElement.cpp \
+ DerivedSources/WebCore/JSSVGStopElement.h \
+ DerivedSources/WebCore/JSSVGStringList.cpp \
+ DerivedSources/WebCore/JSSVGStringList.h \
+ DerivedSources/WebCore/JSSVGStylable.h \
+ DerivedSources/WebCore/JSSVGStyleElement.cpp \
+ DerivedSources/WebCore/JSSVGStyleElement.h \
+ DerivedSources/WebCore/JSSVGSVGElement.cpp \
+ DerivedSources/WebCore/JSSVGSVGElement.h \
+ DerivedSources/WebCore/JSSVGSwitchElement.cpp \
+ DerivedSources/WebCore/JSSVGSwitchElement.h \
+ DerivedSources/WebCore/JSSVGSymbolElement.cpp \
+ DerivedSources/WebCore/JSSVGSymbolElement.h \
+ DerivedSources/WebCore/JSSVGTests.h \
+ DerivedSources/WebCore/JSSVGTextContentElement.cpp \
+ DerivedSources/WebCore/JSSVGTextContentElement.h \
+ DerivedSources/WebCore/JSSVGTextElement.cpp \
+ DerivedSources/WebCore/JSSVGTextElement.h \
+ DerivedSources/WebCore/JSSVGTextPathElement.cpp \
+ DerivedSources/WebCore/JSSVGTextPathElement.h \
+ DerivedSources/WebCore/JSSVGTextPositioningElement.cpp \
+ DerivedSources/WebCore/JSSVGTextPositioningElement.h \
+ DerivedSources/WebCore/JSSVGTitleElement.cpp \
+ DerivedSources/WebCore/JSSVGTitleElement.h \
+ DerivedSources/WebCore/JSSVGTransformable.h \
+ DerivedSources/WebCore/JSSVGTransform.cpp \
+ DerivedSources/WebCore/JSSVGTransform.h \
+ DerivedSources/WebCore/JSSVGTransformList.cpp \
+ DerivedSources/WebCore/JSSVGTransformList.h \
+ DerivedSources/WebCore/JSSVGTRefElement.cpp \
+ DerivedSources/WebCore/JSSVGTRefElement.h \
+ DerivedSources/WebCore/JSSVGTSpanElement.cpp \
+ DerivedSources/WebCore/JSSVGTSpanElement.h \
+ DerivedSources/WebCore/JSSVGUnitTypes.cpp \
+ DerivedSources/WebCore/JSSVGUnitTypes.h \
+ DerivedSources/WebCore/JSSVGURIReference.h \
+ DerivedSources/WebCore/JSSVGUseElement.cpp \
+ DerivedSources/WebCore/JSSVGUseElement.h \
+ DerivedSources/WebCore/JSSVGViewElement.cpp \
+ DerivedSources/WebCore/JSSVGViewElement.h \
+ DerivedSources/WebCore/JSSVGViewSpec.cpp \
+ DerivedSources/WebCore/JSSVGViewSpec.h \
+ DerivedSources/WebCore/JSSVGVKernElement.cpp \
+ DerivedSources/WebCore/JSSVGVKernElement.h \
+ DerivedSources/WebCore/JSSVGZoomAndPan.cpp \
+ DerivedSources/WebCore/JSSVGZoomAndPan.h \
+ DerivedSources/WebCore/JSSVGZoomEvent.cpp \
+ DerivedSources/WebCore/JSSVGZoomEvent.h \
DerivedSources/WebCore/JSText.cpp \
DerivedSources/WebCore/JSTextEvent.cpp \
DerivedSources/WebCore/JSTextEvent.h \
@@ -640,6 +1092,8 @@ webcore_built_sources += \
DerivedSources/WebCore/JSWebKitPoint.h \
DerivedSources/WebCore/JSWebKitTransitionEvent.cpp \
DerivedSources/WebCore/JSWebKitTransitionEvent.h \
+ DerivedSources/WebCore/JSWebSocket.cpp \
+ DerivedSources/WebCore/JSWebSocket.h \
DerivedSources/WebCore/JSWheelEvent.cpp \
DerivedSources/WebCore/JSWheelEvent.h \
DerivedSources/WebCore/JSWorkerContext.cpp \
@@ -693,6 +1147,30 @@ webcore_built_sources += \
DerivedSources/WebCore/XPathGrammar.h
dom_binding_idls += \
+ $(WebCore)/Modules/filesystem/DOMFileSystem.idl \
+ $(WebCore)/Modules/filesystem/DOMFileSystemSync.idl \
+ $(WebCore)/Modules/filesystem/DOMWindowFileSystem.idl \
+ $(WebCore)/Modules/filesystem/DirectoryEntry.idl \
+ $(WebCore)/Modules/filesystem/DirectoryEntrySync.idl \
+ $(WebCore)/Modules/filesystem/DirectoryReader.idl \
+ $(WebCore)/Modules/filesystem/DirectoryReaderSync.idl \
+ $(WebCore)/Modules/filesystem/EntriesCallback.idl \
+ $(WebCore)/Modules/filesystem/Entry.idl \
+ $(WebCore)/Modules/filesystem/EntryArray.idl \
+ $(WebCore)/Modules/filesystem/EntryArraySync.idl \
+ $(WebCore)/Modules/filesystem/EntryCallback.idl \
+ $(WebCore)/Modules/filesystem/EntrySync.idl \
+ $(WebCore)/Modules/filesystem/ErrorCallback.idl \
+ $(WebCore)/Modules/filesystem/FileCallback.idl \
+ $(WebCore)/Modules/filesystem/FileEntry.idl \
+ $(WebCore)/Modules/filesystem/FileEntrySync.idl \
+ $(WebCore)/Modules/filesystem/FileSystemCallback.idl \
+ $(WebCore)/Modules/filesystem/FileWriter.idl \
+ $(WebCore)/Modules/filesystem/FileWriterCallback.idl \
+ $(WebCore)/Modules/filesystem/FileWriterSync.idl \
+ $(WebCore)/Modules/filesystem/Metadata.idl \
+ $(WebCore)/Modules/filesystem/MetadataCallback.idl \
+ $(WebCore)/Modules/filesystem/WorkerContextFileSystem.idl \
$(WebCore)/Modules/gamepad/Gamepad.idl \
$(WebCore)/Modules/gamepad/GamepadList.idl \
$(WebCore)/Modules/gamepad/NavigatorGamepad.idl \
@@ -702,6 +1180,22 @@ dom_binding_idls += \
$(WebCore)/Modules/geolocation/PositionCallback.idl \
$(WebCore)/Modules/geolocation/PositionError.idl \
$(WebCore)/Modules/geolocation/PositionErrorCallback.idl \
+ $(WebCore)/Modules/indexeddb/DOMWindowIndexedDatabase.idl \
+ $(WebCore)/Modules/indexeddb/IDBAny.idl \
+ $(WebCore)/Modules/indexeddb/IDBCursor.idl \
+ $(WebCore)/Modules/indexeddb/IDBCursorWithValue.idl \
+ $(WebCore)/Modules/indexeddb/IDBDatabaseException.idl \
+ $(WebCore)/Modules/indexeddb/IDBDatabase.idl \
+ $(WebCore)/Modules/indexeddb/IDBFactory.idl \
+ $(WebCore)/Modules/indexeddb/IDBIndex.idl \
+ $(WebCore)/Modules/indexeddb/IDBKey.idl \
+ $(WebCore)/Modules/indexeddb/IDBKeyRange.idl \
+ $(WebCore)/Modules/indexeddb/IDBObjectStore.idl \
+ $(WebCore)/Modules/indexeddb/IDBRequest.idl \
+ $(WebCore)/Modules/indexeddb/IDBTransaction.idl \
+ $(WebCore)/Modules/indexeddb/IDBVersionChangeEvent.idl \
+ $(WebCore)/Modules/indexeddb/IDBVersionChangeRequest.idl \
+ $(WebCore)/Modules/indexeddb/WorkerContextIndexedDatabase.idl \
$(WebCore)/Modules/mediasource/MediaSource.idl \
$(WebCore)/Modules/mediasource/SourceBuffer.idl \
$(WebCore)/Modules/mediasource/SourceBufferList.idl \
@@ -726,11 +1220,59 @@ dom_binding_idls += \
$(WebCore)/Modules/notifications/NotificationCenter.idl \
$(WebCore)/Modules/notifications/NotificationPermissionCallback.idl \
$(WebCore)/Modules/protocolhandler/NavigatorRegisterProtocolHandler.idl \
+ $(WebCore)/Modules/quota/DOMWindowQuota.idl \
+ $(WebCore)/Modules/quota/StorageInfo.idl \
+ $(WebCore)/Modules/quota/StorageInfoErrorCallback.idl \
+ $(WebCore)/Modules/quota/StorageInfoQuotaCallback.idl \
+ $(WebCore)/Modules/quota/StorageInfoUsageCallback.idl \
+ $(WebCore)/Modules/webaudio/AudioBuffer.idl \
+ $(WebCore)/Modules/webaudio/AudioBufferCallback.idl \
+ $(WebCore)/Modules/webaudio/AudioBufferSourceNode.idl \
+ $(WebCore)/Modules/webaudio/AudioChannelMerger.idl \
+ $(WebCore)/Modules/webaudio/AudioChannelSplitter.idl \
$(WebCore)/Modules/webaudio/AudioContext.idl \
+ $(WebCore)/Modules/webaudio/AudioDestinationNode.idl \
+ $(WebCore)/Modules/webaudio/AudioGain.idl \
+ $(WebCore)/Modules/webaudio/AudioGainNode.idl \
+ $(WebCore)/Modules/webaudio/AudioListener.idl \
+ $(WebCore)/Modules/webaudio/AudioNode.idl \
$(WebCore)/Modules/webaudio/AudioPannerNode.idl \
- $(WebCore)/Modules/webaudio/DynamicsCompressorNode.idl \
+ $(WebCore)/Modules/webaudio/AudioParam.idl \
+ $(WebCore)/Modules/webaudio/AudioProcessingEvent.idl \
+ $(WebCore)/Modules/webaudio/AudioSourceNode.idl \
+ $(WebCore)/Modules/webaudio/BiquadFilterNode.idl \
+ $(WebCore)/Modules/webaudio/ConvolverNode.idl \
+ $(WebCore)/Modules/webaudio/DelayNode.idl \
$(WebCore)/Modules/webaudio/DOMWindowWebAudio.idl \
+ $(WebCore)/Modules/webaudio/DynamicsCompressorNode.idl \
+ $(WebCore)/Modules/webaudio/JavaScriptAudioNode.idl \
+ $(WebCore)/Modules/webaudio/MediaElementAudioSourceNode.idl \
+ $(WebCore)/Modules/webaudio/MediaStreamAudioSourceNode.idl \
+ $(WebCore)/Modules/webaudio/OfflineAudioCompletionEvent.idl \
+ $(WebCore)/Modules/webaudio/Oscillator.idl \
+ $(WebCore)/Modules/webaudio/RealtimeAnalyserNode.idl \
$(WebCore)/Modules/webaudio/WaveShaperNode.idl \
+ $(WebCore)/Modules/webaudio/WaveTable.idl \
+ $(WebCore)/Modules/webdatabase/DOMWindowWebDatabase.idl \
+ $(WebCore)/Modules/webdatabase/Database.idl \
+ $(WebCore)/Modules/webdatabase/DatabaseCallback.idl \
+ $(WebCore)/Modules/webdatabase/DatabaseSync.idl \
+ $(WebCore)/Modules/webdatabase/SQLError.idl \
+ $(WebCore)/Modules/webdatabase/SQLException.idl \
+ $(WebCore)/Modules/webdatabase/SQLResultSet.idl \
+ $(WebCore)/Modules/webdatabase/SQLResultSetRowList.idl \
+ $(WebCore)/Modules/webdatabase/SQLStatementCallback.idl \
+ $(WebCore)/Modules/webdatabase/SQLStatementErrorCallback.idl \
+ $(WebCore)/Modules/webdatabase/SQLTransaction.idl \
+ $(WebCore)/Modules/webdatabase/SQLTransactionCallback.idl \
+ $(WebCore)/Modules/webdatabase/SQLTransactionErrorCallback.idl \
+ $(WebCore)/Modules/webdatabase/SQLTransactionSync.idl \
+ $(WebCore)/Modules/webdatabase/SQLTransactionSyncCallback.idl \
+ $(WebCore)/Modules/webdatabase/WorkerContextWebDatabase.idl \
+ $(WebCore)/Modules/websockets/CloseEvent.idl \
+ $(WebCore)/Modules/websockets/DOMWindowWebSocket.idl \
+ $(WebCore)/Modules/websockets/WebSocket.idl \
+ $(WebCore)/Modules/websockets/WorkerContextWebSocket.idl \
$(WebCore)/css/CSSCharsetRule.idl \
$(WebCore)/css/CSSFontFaceRule.idl \
$(WebCore)/css/CSSImportRule.idl \
@@ -773,6 +1315,7 @@ dom_binding_idls += \
$(WebCore)/dom/DOMImplementation.idl \
$(WebCore)/dom/DOMStringList.idl \
$(WebCore)/dom/DOMStringMap.idl \
+ $(WebCore)/dom/DataTransferItem.idl \
$(WebCore)/dom/DataTransferItemList.idl \
$(WebCore)/dom/DeviceMotionEvent.idl \
$(WebCore)/dom/DeviceOrientationEvent.idl \
@@ -810,7 +1353,9 @@ dom_binding_idls += \
$(WebCore)/dom/PropertyNodeList.idl \
$(WebCore)/dom/Range.idl \
$(WebCore)/dom/RangeException.idl \
+ $(WebCore)/dom/RequestAnimationFrameCallback.idl \
$(WebCore)/dom/ShadowRoot.idl \
+ $(WebCore)/dom/StringCallback.idl \
$(WebCore)/dom/Text.idl \
$(WebCore)/dom/TextEvent.idl \
$(WebCore)/dom/Touch.idl \
@@ -822,6 +1367,7 @@ dom_binding_idls += \
$(WebCore)/dom/WebKitNamedFlow.idl \
$(WebCore)/dom/WebKitTransitionEvent.idl \
$(WebCore)/dom/WheelEvent.idl \
+ $(WebCore)/editing/DOMTransaction.idl \
$(WebCore)/editing/UndoManager.idl \
$(WebCore)/fileapi/Blob.idl \
$(WebCore)/fileapi/File.idl \
@@ -956,6 +1502,7 @@ dom_binding_idls += \
$(WebCore)/html/canvas/WebGLUniformLocation.idl \
$(WebCore)/html/canvas/WebGLVertexArrayObjectOES.idl \
$(WebCore)/html/shadow/HTMLContentElement.idl \
+ $(WebCore)/html/shadow/HTMLShadowElement.idl \
$(WebCore)/html/track/TextTrack.idl \
$(WebCore)/html/track/TextTrackCue.idl \
$(WebCore)/html/track/TextTrackCueList.idl \
@@ -999,9 +1546,152 @@ dom_binding_idls += \
$(WebCore)/plugins/DOMPluginArray.idl \
$(WebCore)/storage/Storage.idl \
$(WebCore)/storage/StorageEvent.idl \
- $(WebCore)/testing/FastMallocStatistics.idl \
+ $(WebCore)/svg/SVGAElement.idl \
+ $(WebCore)/svg/SVGAltGlyphDefElement.idl \
+ $(WebCore)/svg/SVGAltGlyphElement.idl \
+ $(WebCore)/svg/SVGAltGlyphItemElement.idl \
+ $(WebCore)/svg/SVGAngle.idl \
+ $(WebCore)/svg/SVGAnimateColorElement.idl \
+ $(WebCore)/svg/SVGAnimateElement.idl \
+ $(WebCore)/svg/SVGAnimateMotionElement.idl \
+ $(WebCore)/svg/SVGAnimateTransformElement.idl \
+ $(WebCore)/svg/SVGAnimatedAngle.idl \
+ $(WebCore)/svg/SVGAnimatedBoolean.idl \
+ $(WebCore)/svg/SVGAnimatedEnumeration.idl \
+ $(WebCore)/svg/SVGAnimatedInteger.idl \
+ $(WebCore)/svg/SVGAnimatedLength.idl \
+ $(WebCore)/svg/SVGAnimatedLengthList.idl \
+ $(WebCore)/svg/SVGAnimatedNumber.idl \
+ $(WebCore)/svg/SVGAnimatedNumberList.idl \
+ $(WebCore)/svg/SVGAnimatedPreserveAspectRatio.idl \
+ $(WebCore)/svg/SVGAnimatedRect.idl \
+ $(WebCore)/svg/SVGAnimatedString.idl \
+ $(WebCore)/svg/SVGAnimatedTransformList.idl \
+ $(WebCore)/svg/SVGAnimationElement.idl \
+ $(WebCore)/svg/SVGCircleElement.idl \
+ $(WebCore)/svg/SVGClipPathElement.idl \
+ $(WebCore)/svg/SVGColor.idl \
+ $(WebCore)/svg/SVGComponentTransferFunctionElement.idl \
+ $(WebCore)/svg/SVGCursorElement.idl \
+ $(WebCore)/svg/SVGDefsElement.idl \
+ $(WebCore)/svg/SVGDescElement.idl \
+ $(WebCore)/svg/SVGDocument.idl \
+ $(WebCore)/svg/SVGElement.idl \
+ $(WebCore)/svg/SVGElementInstance.idl \
+ $(WebCore)/svg/SVGElementInstanceList.idl \
+ $(WebCore)/svg/SVGEllipseElement.idl \
+ $(WebCore)/svg/SVGException.idl \
+ $(WebCore)/svg/SVGFEBlendElement.idl \
+ $(WebCore)/svg/SVGFEColorMatrixElement.idl \
+ $(WebCore)/svg/SVGFEComponentTransferElement.idl \
+ $(WebCore)/svg/SVGFECompositeElement.idl \
+ $(WebCore)/svg/SVGFEConvolveMatrixElement.idl \
+ $(WebCore)/svg/SVGFEDiffuseLightingElement.idl \
+ $(WebCore)/svg/SVGFEDisplacementMapElement.idl \
+ $(WebCore)/svg/SVGFEDistantLightElement.idl \
+ $(WebCore)/svg/SVGFEDropShadowElement.idl \
+ $(WebCore)/svg/SVGFEFloodElement.idl \
+ $(WebCore)/svg/SVGFEFuncAElement.idl \
+ $(WebCore)/svg/SVGFEFuncBElement.idl \
+ $(WebCore)/svg/SVGFEFuncGElement.idl \
+ $(WebCore)/svg/SVGFEFuncRElement.idl \
+ $(WebCore)/svg/SVGFEGaussianBlurElement.idl \
+ $(WebCore)/svg/SVGFEImageElement.idl \
+ $(WebCore)/svg/SVGFEMergeElement.idl \
+ $(WebCore)/svg/SVGFEMergeNodeElement.idl \
+ $(WebCore)/svg/SVGFEMorphologyElement.idl \
+ $(WebCore)/svg/SVGFEOffsetElement.idl \
+ $(WebCore)/svg/SVGFEPointLightElement.idl \
+ $(WebCore)/svg/SVGFESpecularLightingElement.idl \
+ $(WebCore)/svg/SVGFESpotLightElement.idl \
+ $(WebCore)/svg/SVGFETileElement.idl \
+ $(WebCore)/svg/SVGFETurbulenceElement.idl \
+ $(WebCore)/svg/SVGFilterElement.idl \
+ $(WebCore)/svg/SVGFontElement.idl \
+ $(WebCore)/svg/SVGFontFaceElement.idl \
+ $(WebCore)/svg/SVGFontFaceFormatElement.idl \
+ $(WebCore)/svg/SVGFontFaceNameElement.idl \
+ $(WebCore)/svg/SVGFontFaceSrcElement.idl \
+ $(WebCore)/svg/SVGFontFaceUriElement.idl \
+ $(WebCore)/svg/SVGForeignObjectElement.idl \
+ $(WebCore)/svg/SVGGElement.idl \
+ $(WebCore)/svg/SVGGlyphElement.idl \
+ $(WebCore)/svg/SVGGlyphRefElement.idl \
+ $(WebCore)/svg/SVGGradientElement.idl \
+ $(WebCore)/svg/SVGHKernElement.idl \
+ $(WebCore)/svg/SVGImageElement.idl \
+ $(WebCore)/svg/SVGLength.idl \
+ $(WebCore)/svg/SVGLengthList.idl \
+ $(WebCore)/svg/SVGLineElement.idl \
+ $(WebCore)/svg/SVGLinearGradientElement.idl \
+ $(WebCore)/svg/SVGMPathElement.idl \
+ $(WebCore)/svg/SVGMarkerElement.idl \
+ $(WebCore)/svg/SVGMaskElement.idl \
+ $(WebCore)/svg/SVGMatrix.idl \
+ $(WebCore)/svg/SVGMetadataElement.idl \
+ $(WebCore)/svg/SVGMissingGlyphElement.idl \
+ $(WebCore)/svg/SVGNumber.idl \
+ $(WebCore)/svg/SVGNumberList.idl \
+ $(WebCore)/svg/SVGPaint.idl \
+ $(WebCore)/svg/SVGPathElement.idl \
+ $(WebCore)/svg/SVGPathSeg.idl \
+ $(WebCore)/svg/SVGPathSegArcAbs.idl \
+ $(WebCore)/svg/SVGPathSegArcRel.idl \
+ $(WebCore)/svg/SVGPathSegClosePath.idl \
+ $(WebCore)/svg/SVGPathSegCurvetoCubicAbs.idl \
+ $(WebCore)/svg/SVGPathSegCurvetoCubicRel.idl \
+ $(WebCore)/svg/SVGPathSegCurvetoCubicSmoothAbs.idl \
+ $(WebCore)/svg/SVGPathSegCurvetoCubicSmoothRel.idl \
+ $(WebCore)/svg/SVGPathSegCurvetoQuadraticAbs.idl \
+ $(WebCore)/svg/SVGPathSegCurvetoQuadraticRel.idl \
+ $(WebCore)/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl \
+ $(WebCore)/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl \
+ $(WebCore)/svg/SVGPathSegLinetoAbs.idl \
+ $(WebCore)/svg/SVGPathSegLinetoHorizontalAbs.idl \
+ $(WebCore)/svg/SVGPathSegLinetoHorizontalRel.idl \
+ $(WebCore)/svg/SVGPathSegLinetoRel.idl \
+ $(WebCore)/svg/SVGPathSegLinetoVerticalAbs.idl \
+ $(WebCore)/svg/SVGPathSegLinetoVerticalRel.idl \
+ $(WebCore)/svg/SVGPathSegList.idl \
+ $(WebCore)/svg/SVGPathSegMovetoAbs.idl \
+ $(WebCore)/svg/SVGPathSegMovetoRel.idl \
+ $(WebCore)/svg/SVGPatternElement.idl \
+ $(WebCore)/svg/SVGPoint.idl \
+ $(WebCore)/svg/SVGPointList.idl \
+ $(WebCore)/svg/SVGPolygonElement.idl \
+ $(WebCore)/svg/SVGPolylineElement.idl \
+ $(WebCore)/svg/SVGPreserveAspectRatio.idl \
+ $(WebCore)/svg/SVGRadialGradientElement.idl \
+ $(WebCore)/svg/SVGRect.idl \
+ $(WebCore)/svg/SVGRectElement.idl \
+ $(WebCore)/svg/SVGRenderingIntent.idl \
+ $(WebCore)/svg/SVGSVGElement.idl \
+ $(WebCore)/svg/SVGScriptElement.idl \
+ $(WebCore)/svg/SVGSetElement.idl \
+ $(WebCore)/svg/SVGStopElement.idl \
+ $(WebCore)/svg/SVGStringList.idl \
+ $(WebCore)/svg/SVGStyleElement.idl \
+ $(WebCore)/svg/SVGSwitchElement.idl \
+ $(WebCore)/svg/SVGSymbolElement.idl \
+ $(WebCore)/svg/SVGTRefElement.idl \
+ $(WebCore)/svg/SVGTSpanElement.idl \
+ $(WebCore)/svg/SVGTextContentElement.idl \
+ $(WebCore)/svg/SVGTextElement.idl \
+ $(WebCore)/svg/SVGTextPathElement.idl \
+ $(WebCore)/svg/SVGTextPositioningElement.idl \
+ $(WebCore)/svg/SVGTitleElement.idl \
+ $(WebCore)/svg/SVGTransform.idl \
+ $(WebCore)/svg/SVGTransformList.idl \
+ $(WebCore)/svg/SVGUnitTypes.idl \
+ $(WebCore)/svg/SVGUseElement.idl \
+ $(WebCore)/svg/SVGVKernElement.idl \
+ $(WebCore)/svg/SVGViewElement.idl \
+ $(WebCore)/svg/SVGViewSpec.idl \
+ $(WebCore)/svg/SVGZoomAndPan.idl \
+ $(WebCore)/svg/SVGZoomEvent.idl \
$(WebCore)/testing/Internals.idl \
$(WebCore)/testing/InternalSettings.idl \
+ $(WebCore)/testing/MallocStatistics.idl \
$(WebCore)/workers/AbstractWorker.idl \
$(WebCore)/workers/DedicatedWorkerContext.idl \
$(WebCore)/workers/SharedWorker.idl \
@@ -1064,6 +1754,7 @@ webcore_modules_sources += \
Source/WebCore/Modules/filesystem/FileSystemCallback.h \
Source/WebCore/Modules/filesystem/FileSystemCallbacks.cpp \
Source/WebCore/Modules/filesystem/FileSystemCallbacks.h \
+ Source/WebCore/Modules/filesystem/FileSystemFlags.h \
Source/WebCore/Modules/filesystem/FileSystemType.h \
Source/WebCore/Modules/filesystem/FileWriter.cpp \
Source/WebCore/Modules/filesystem/FileWriter.h \
@@ -1077,7 +1768,6 @@ webcore_modules_sources += \
Source/WebCore/Modules/filesystem/LocalFileSystem.h \
Source/WebCore/Modules/filesystem/MetadataCallback.h \
Source/WebCore/Modules/filesystem/Metadata.h \
- Source/WebCore/Modules/filesystem/WebKitFlags.h \
Source/WebCore/Modules/filesystem/WorkerContextFileSystem.cpp \
Source/WebCore/Modules/filesystem/WorkerContextFileSystem.h \
Source/WebCore/Modules/gamepad/Gamepad.cpp \
@@ -1233,6 +1923,98 @@ webcore_modules_sources += \
Source/WebCore/Modules/protocolhandler/NavigatorRegisterProtocolHandler.cpp \
Source/WebCore/Modules/protocolhandler/NavigatorRegisterProtocolHandler.h \
Source/WebCore/Modules/protocolhandler/RegisterProtocolHandlerClient.h \
+ Source/WebCore/Modules/quota/DOMWindowQuota.cpp \
+ Source/WebCore/Modules/quota/DOMWindowQuota.h \
+ Source/WebCore/Modules/quota/StorageInfo.cpp \
+ Source/WebCore/Modules/quota/StorageInfo.h \
+ Source/WebCore/Modules/quota/StorageInfoErrorCallback.h \
+ Source/WebCore/Modules/quota/StorageInfoQuotaCallback.h \
+ Source/WebCore/Modules/quota/StorageInfoUsageCallback.h \
+ Source/WebCore/Modules/webaudio/AsyncAudioDecoder.cpp \
+ Source/WebCore/Modules/webaudio/AsyncAudioDecoder.h \
+ Source/WebCore/Modules/webaudio/AudioBasicInspectorNode.cpp \
+ Source/WebCore/Modules/webaudio/AudioBasicInspectorNode.h \
+ Source/WebCore/Modules/webaudio/AudioBasicProcessorNode.cpp \
+ Source/WebCore/Modules/webaudio/AudioBasicProcessorNode.h \
+ Source/WebCore/Modules/webaudio/AudioBuffer.cpp \
+ Source/WebCore/Modules/webaudio/AudioBuffer.h \
+ Source/WebCore/Modules/webaudio/AudioBufferCallback.h \
+ Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp \
+ Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h \
+ Source/WebCore/Modules/webaudio/AudioChannelMerger.cpp \
+ Source/WebCore/Modules/webaudio/AudioChannelMerger.h \
+ Source/WebCore/Modules/webaudio/AudioChannelSplitter.cpp \
+ Source/WebCore/Modules/webaudio/AudioChannelSplitter.h \
+ Source/WebCore/Modules/webaudio/AudioContext.cpp \
+ Source/WebCore/Modules/webaudio/AudioContext.h \
+ Source/WebCore/Modules/webaudio/AudioDestinationNode.cpp \
+ Source/WebCore/Modules/webaudio/AudioDestinationNode.h \
+ Source/WebCore/Modules/webaudio/AudioGain.h \
+ Source/WebCore/Modules/webaudio/AudioGainNode.cpp \
+ Source/WebCore/Modules/webaudio/AudioGainNode.h \
+ Source/WebCore/Modules/webaudio/AudioListener.cpp \
+ Source/WebCore/Modules/webaudio/AudioListener.h \
+ Source/WebCore/Modules/webaudio/AudioNode.cpp \
+ Source/WebCore/Modules/webaudio/AudioNode.h \
+ Source/WebCore/Modules/webaudio/AudioNodeInput.cpp \
+ Source/WebCore/Modules/webaudio/AudioNodeInput.h \
+ Source/WebCore/Modules/webaudio/AudioNodeOutput.cpp \
+ Source/WebCore/Modules/webaudio/AudioNodeOutput.h \
+ Source/WebCore/Modules/webaudio/AudioPannerNode.cpp \
+ Source/WebCore/Modules/webaudio/AudioPannerNode.h \
+ Source/WebCore/Modules/webaudio/AudioParam.cpp \
+ Source/WebCore/Modules/webaudio/AudioParam.h \
+ Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp \
+ Source/WebCore/Modules/webaudio/AudioParamTimeline.h \
+ Source/WebCore/Modules/webaudio/AudioProcessingEvent.cpp \
+ Source/WebCore/Modules/webaudio/AudioProcessingEvent.h \
+ Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp \
+ Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.h \
+ Source/WebCore/Modules/webaudio/AudioSummingJunction.cpp \
+ Source/WebCore/Modules/webaudio/AudioSummingJunction.h \
+ Source/WebCore/Modules/webaudio/AudioSourceNode.h \
+ Source/WebCore/Modules/webaudio/BiquadDSPKernel.cpp \
+ Source/WebCore/Modules/webaudio/BiquadDSPKernel.h \
+ Source/WebCore/Modules/webaudio/BiquadFilterNode.cpp \
+ Source/WebCore/Modules/webaudio/BiquadFilterNode.h \
+ Source/WebCore/Modules/webaudio/BiquadProcessor.cpp \
+ Source/WebCore/Modules/webaudio/BiquadProcessor.h \
+ Source/WebCore/Modules/webaudio/ConvolverNode.cpp \
+ Source/WebCore/Modules/webaudio/ConvolverNode.h \
+ Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.h \
+ Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.cpp \
+ Source/WebCore/Modules/webaudio/DelayDSPKernel.cpp \
+ Source/WebCore/Modules/webaudio/DelayDSPKernel.h \
+ Source/WebCore/Modules/webaudio/DelayNode.cpp \
+ Source/WebCore/Modules/webaudio/DelayNode.h \
+ Source/WebCore/Modules/webaudio/DelayProcessor.cpp \
+ Source/WebCore/Modules/webaudio/DelayProcessor.h \
+ Source/WebCore/Modules/webaudio/DynamicsCompressorNode.cpp \
+ Source/WebCore/Modules/webaudio/DynamicsCompressorNode.h \
+ Source/WebCore/Modules/webaudio/JavaScriptAudioNode.cpp \
+ Source/WebCore/Modules/webaudio/JavaScriptAudioNode.h \
+ Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.cpp \
+ Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.h \
+ Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.cpp \
+ Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.h \
+ Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.h \
+ Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.cpp \
+ Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.h \
+ Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.cpp \
+ Source/WebCore/Modules/webaudio/Oscillator.h \
+ Source/WebCore/Modules/webaudio/Oscillator.cpp \
+ Source/WebCore/Modules/webaudio/RealtimeAnalyser.cpp \
+ Source/WebCore/Modules/webaudio/RealtimeAnalyser.h \
+ Source/WebCore/Modules/webaudio/RealtimeAnalyserNode.cpp \
+ Source/WebCore/Modules/webaudio/RealtimeAnalyserNode.h \
+ Source/WebCore/Modules/webaudio/WaveShaperNode.cpp \
+ Source/WebCore/Modules/webaudio/WaveShaperProcessor.h \
+ Source/WebCore/Modules/webaudio/WaveShaperDSPKernel.cpp \
+ Source/WebCore/Modules/webaudio/WaveShaperDSPKernel.h \
+ Source/WebCore/Modules/webaudio/WaveShaperProcessor.cpp \
+ Source/WebCore/Modules/webaudio/WaveShaperNode.h \
+ Source/WebCore/Modules/webaudio/WaveTable.cpp \
+ Source/WebCore/Modules/webaudio/WaveTable.h \
Source/WebCore/Modules/webdatabase/AbstractDatabase.cpp \
Source/WebCore/Modules/webdatabase/AbstractDatabase.h \
Source/WebCore/Modules/webdatabase/ChangeVersionWrapper.cpp \
@@ -1384,6 +2166,8 @@ webcore_sources += \
Source/WebCore/bindings/js/CallbackFunction.h \
Source/WebCore/bindings/js/DOMObjectHashTableMap.cpp \
Source/WebCore/bindings/js/DOMObjectHashTableMap.h \
+ Source/WebCore/bindings/js/DOMTransaction.cpp \
+ Source/WebCore/bindings/js/DOMTransaction.h \
Source/WebCore/bindings/js/DOMWrapperWorld.cpp \
Source/WebCore/bindings/js/DOMWrapperWorld.h \
Source/WebCore/bindings/js/GCController.cpp \
@@ -1392,6 +2176,8 @@ webcore_sources += \
Source/WebCore/bindings/js/JSArrayBufferCustom.cpp \
Source/WebCore/bindings/js/JSArrayBufferViewHelper.h \
Source/WebCore/bindings/js/JSAttrCustom.cpp \
+ Source/WebCore/bindings/js/JSAudioBufferSourceNodeCustom.cpp \
+ Source/WebCore/bindings/js/JSAudioContextCustom.cpp \
Source/WebCore/bindings/js/JSBlobCustom.cpp \
Source/WebCore/bindings/js/JSCDATASectionCustom.cpp \
Source/WebCore/bindings/js/JSCSSFontFaceRuleCustom.cpp \
@@ -1412,8 +2198,6 @@ webcore_sources += \
Source/WebCore/bindings/js/JSConsoleCustom.cpp \
Source/WebCore/bindings/js/JSCoordinatesCustom.cpp \
Source/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp \
- Source/WebCore/bindings/js/JSCustomVoidCallback.cpp \
- Source/WebCore/bindings/js/JSCustomVoidCallback.h \
Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp \
Source/WebCore/bindings/js/JSCustomXPathNSResolver.h \
Source/WebCore/bindings/js/JSDictionary.cpp \
@@ -1445,8 +2229,6 @@ webcore_sources += \
Source/WebCore/bindings/js/JSDedicatedWorkerContextCustom.cpp \
Source/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp \
Source/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp \
- Source/WebCore/bindings/js/JSDirectoryEntryCustom.cpp \
- Source/WebCore/bindings/js/JSDirectoryEntrySyncCustom.cpp \
Source/WebCore/bindings/js/JSDocumentCustom.cpp \
Source/WebCore/bindings/js/JSElementCustom.cpp \
Source/WebCore/bindings/js/JSEntryCustom.cpp \
@@ -1486,12 +2268,16 @@ webcore_sources += \
Source/WebCore/bindings/js/JSHTMLStyleElementCustom.cpp \
Source/WebCore/bindings/js/JSHistoryCustom.cpp \
Source/WebCore/bindings/js/JSHistoryCustom.h \
+ Source/WebCore/bindings/js/JSIDBAnyCustom.cpp \
+ Source/WebCore/bindings/js/JSIDBKeyCustom.cpp \
+ Source/WebCore/bindings/js/JSIDBVersionChangeRequestCustom.cpp \
Source/WebCore/bindings/js/JSImageConstructor.cpp \
Source/WebCore/bindings/js/JSImageConstructor.h \
Source/WebCore/bindings/js/JSImageDataCustom.cpp \
Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp \
Source/WebCore/bindings/js/JSInjectedScriptManager.cpp \
Source/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp \
+ Source/WebCore/bindings/js/JSJavaScriptAudioNodeCustom.cpp \
Source/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp \
Source/WebCore/bindings/js/JSLazyEventListener.cpp \
Source/WebCore/bindings/js/JSLazyEventListener.h \
@@ -1520,6 +2306,7 @@ webcore_sources += \
Source/WebCore/bindings/js/JSPluginElementFunctions.h \
Source/WebCore/bindings/js/JSPopStateEventCustom.cpp \
Source/WebCore/bindings/js/JSProcessingInstructionCustom.cpp \
+ Source/WebCore/bindings/js/JSRequestAnimationFrameCallbackCustom.cpp \
Source/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp \
Source/WebCore/bindings/js/JSSQLTransactionCustom.cpp \
Source/WebCore/bindings/js/JSSQLTransactionSyncCustom.cpp \
@@ -1543,6 +2330,7 @@ webcore_sources += \
Source/WebCore/bindings/js/JSTrackCustom.h \
Source/WebCore/bindings/js/JSTrackEventCustom.cpp \
Source/WebCore/bindings/js/JSTreeWalkerCustom.cpp \
+ Source/WebCore/bindings/js/JSUndoManagerCustom.cpp \
Source/WebCore/bindings/js/JSWebKitAnimationCustom.cpp \
Source/WebCore/bindings/js/JSWebKitAnimationListCustom.cpp \
Source/WebCore/bindings/js/JSWebKitCSSKeyframeRuleCustom.cpp \
@@ -1872,6 +2660,9 @@ webcore_sources += \
Source/WebCore/dom/CustomEvent.h \
Source/WebCore/dom/DatasetDOMStringMap.cpp \
Source/WebCore/dom/DatasetDOMStringMap.h \
+ Source/WebCore/dom/DataTransferItem.cpp \
+ Source/WebCore/dom/DataTransferItem.h \
+ Source/WebCore/dom/DataTransferItemList.h \
Source/WebCore/dom/DecodedDataDocumentParser.cpp \
Source/WebCore/dom/DecodedDataDocumentParser.h \
Source/WebCore/dom/default/PlatformMessagePortChannel.cpp \
@@ -2051,10 +2842,13 @@ webcore_sources += \
Source/WebCore/dom/RegisteredEventListener.cpp \
Source/WebCore/dom/RegisteredEventListener.h \
Source/WebCore/dom/RenderedDocumentMarker.h \
+ Source/WebCore/dom/RequestAnimationFrameCallback.h \
Source/WebCore/dom/ScopedEventQueue.cpp \
Source/WebCore/dom/ScopedEventQueue.h \
Source/WebCore/dom/ScriptableDocumentParser.cpp \
Source/WebCore/dom/ScriptableDocumentParser.h \
+ Source/WebCore/dom/ScriptedAnimationController.cpp \
+ Source/WebCore/dom/ScriptedAnimationController.h \
Source/WebCore/dom/ScriptElement.cpp \
Source/WebCore/dom/ScriptElement.h \
Source/WebCore/dom/ScriptExecutionContext.cpp \
@@ -2316,6 +3110,63 @@ webcore_sources += \
Source/WebCore/html/canvas/CheckedInt.h \
Source/WebCore/html/canvas/DataView.cpp \
Source/WebCore/html/canvas/DataView.h \
+ Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.cpp \
+ Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.h \
+ Source/WebCore/html/canvas/OESStandardDerivatives.cpp \
+ Source/WebCore/html/canvas/OESStandardDerivatives.h \
+ Source/WebCore/html/canvas/OESTextureFloat.cpp \
+ Source/WebCore/html/canvas/OESTextureFloat.h \
+ Source/WebCore/html/canvas/OESVertexArrayObject.cpp \
+ Source/WebCore/html/canvas/OESVertexArrayObject.h \
+ Source/WebCore/html/canvas/WebGLActiveInfo.h \
+ Source/WebCore/html/canvas/WebGLBuffer.cpp \
+ Source/WebCore/html/canvas/WebGLBuffer.h \
+ Source/WebCore/html/canvas/WebGLCompressedTextureS3TC.cpp \
+ Source/WebCore/html/canvas/WebGLCompressedTextureS3TC.h \
+ Source/WebCore/html/canvas/WebGLContextAttributes.cpp \
+ Source/WebCore/html/canvas/WebGLContextAttributes.h \
+ Source/WebCore/html/canvas/WebGLContextEvent.cpp \
+ Source/WebCore/html/canvas/WebGLContextEvent.h \
+ Source/WebCore/html/canvas/WebGLContextGroup.cpp \
+ Source/WebCore/html/canvas/WebGLContextGroup.h \
+ Source/WebCore/html/canvas/WebGLContextObject.cpp \
+ Source/WebCore/html/canvas/WebGLContextObject.h \
+ Source/WebCore/html/canvas/WebGLDebugRendererInfo.cpp \
+ Source/WebCore/html/canvas/WebGLDebugRendererInfo.h \
+ Source/WebCore/html/canvas/WebGLDebugShaders.cpp \
+ Source/WebCore/html/canvas/WebGLDebugShaders.h \
+ Source/WebCore/html/canvas/WebGLDepthTexture.cpp \
+ Source/WebCore/html/canvas/WebGLDepthTexture.h \
+ Source/WebCore/html/canvas/WebGLFramebuffer.cpp \
+ Source/WebCore/html/canvas/WebGLFramebuffer.h \
+ Source/WebCore/html/canvas/WebGLGetInfo.cpp \
+ Source/WebCore/html/canvas/WebGLGetInfo.h \
+ Source/WebCore/html/canvas/WebGLLoseContext.cpp \
+ Source/WebCore/html/canvas/WebGLLoseContext.h \
+ Source/WebCore/html/canvas/WebGLObject.cpp \
+ Source/WebCore/html/canvas/WebGLObject.h \
+ Source/WebCore/html/canvas/WebGLProgram.cpp \
+ Source/WebCore/html/canvas/WebGLProgram.h \
+ Source/WebCore/html/canvas/WebGLRenderbuffer.cpp \
+ Source/WebCore/html/canvas/WebGLRenderbuffer.h \
+ Source/WebCore/html/canvas/WebGLRenderingContext.cpp \
+ Source/WebCore/html/canvas/WebGLRenderingContext.h \
+ Source/WebCore/html/canvas/WebGLShader.cpp \
+ Source/WebCore/html/canvas/WebGLShader.h \
+ Source/WebCore/html/canvas/WebGLShaderPrecisionFormat.cpp \
+ Source/WebCore/html/canvas/WebGLShaderPrecisionFormat.h \
+ Source/WebCore/html/canvas/WebGLSharedObject.cpp \
+ Source/WebCore/html/canvas/WebGLSharedObject.h \
+ Source/WebCore/html/canvas/WebGLTexture.cpp \
+ Source/WebCore/html/canvas/WebGLTexture.h \
+ Source/WebCore/html/canvas/WebGLUniformLocation.cpp \
+ Source/WebCore/html/canvas/WebGLUniformLocation.h \
+ Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.cpp \
+ Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.h \
+ Source/WebCore/html/canvas/WebGLExtension.cpp \
+ Source/WebCore/html/canvas/WebGLExtension.h \
+ Source/WebCore/html/shadow/HTMLShadowElement.cpp \
+ Source/WebCore/html/shadow/HTMLShadowElement.h \
Source/WebCore/html/DOMSettableTokenList.cpp \
Source/WebCore/html/DOMSettableTokenList.h \
Source/WebCore/html/DOMTokenList.cpp \
@@ -2629,6 +3480,8 @@ webcore_sources += \
Source/WebCore/html/shadow/ProgressShadowElement.h \
Source/WebCore/html/shadow/SliderThumbElement.cpp \
Source/WebCore/html/shadow/SliderThumbElement.h \
+ Source/WebCore/html/shadow/SpinButtonElement.cpp \
+ Source/WebCore/html/shadow/SpinButtonElement.h \
Source/WebCore/html/shadow/TextControlInnerElements.cpp \
Source/WebCore/html/shadow/TextControlInnerElements.h \
Source/WebCore/html/PasswordInputType.cpp \
@@ -2861,6 +3714,10 @@ webcore_sources += \
Source/WebCore/loader/appcache/DOMApplicationCache.h \
Source/WebCore/loader/appcache/ManifestParser.cpp \
Source/WebCore/loader/appcache/ManifestParser.h \
+ Source/WebCore/loader/archive/mhtml/MHTMLArchive.cpp \
+ Source/WebCore/loader/archive/mhtml/MHTMLArchive.h \
+ Source/WebCore/loader/archive/mhtml/MHTMLParser.cpp \
+ Source/WebCore/loader/archive/mhtml/MHTMLParser.h \
Source/WebCore/loader/archive/ArchiveFactory.cpp \
Source/WebCore/loader/archive/ArchiveFactory.h \
Source/WebCore/loader/archive/Archive.cpp \
@@ -2876,6 +3733,7 @@ webcore_sources += \
Source/WebCore/loader/cache/CachedFont.h \
Source/WebCore/loader/cache/CachedImage.cpp \
Source/WebCore/loader/cache/CachedImage.h \
+ Source/WebCore/loader/cache/CachedImageClient.h \
Source/WebCore/loader/cache/CachedResourceClient.h \
Source/WebCore/loader/cache/CachedResourceClientWalker.h \
Source/WebCore/loader/cache/CachedRawResource.cpp \
@@ -3178,6 +4036,76 @@ webcore_sources += \
Source/WebCore/platform/animation/AnimationList.h \
Source/WebCore/platform/animation/AnimationUtilities.h \
Source/WebCore/platform/animation/TimingFunction.h \
+ Source/WebCore/platform/audio/AudioArray.h \
+ Source/WebCore/platform/audio/AudioBus.cpp \
+ Source/WebCore/platform/audio/AudioBus.h \
+ Source/WebCore/platform/audio/AudioChannel.cpp \
+ Source/WebCore/platform/audio/AudioChannel.h \
+ Source/WebCore/platform/audio/AudioDestination.h \
+ Source/WebCore/platform/audio/AudioDSPKernel.h \
+ Source/WebCore/platform/audio/AudioDSPKernelProcessor.cpp \
+ Source/WebCore/platform/audio/AudioDSPKernelProcessor.h \
+ Source/WebCore/platform/audio/AudioFileReader.h \
+ Source/WebCore/platform/audio/AudioIOCallback.h \
+ Source/WebCore/platform/audio/AudioProcessor.h \
+ Source/WebCore/platform/audio/AudioResampler.cpp \
+ Source/WebCore/platform/audio/AudioResampler.h \
+ Source/WebCore/platform/audio/AudioResamplerKernel.cpp \
+ Source/WebCore/platform/audio/AudioResamplerKernel.h \
+ Source/WebCore/platform/audio/AudioSourceProvider.h \
+ Source/WebCore/platform/audio/AudioSourceProviderClient.h \
+ Source/WebCore/platform/audio/AudioUtilities.cpp \
+ Source/WebCore/platform/audio/AudioUtilities.h \
+ Source/WebCore/platform/audio/Biquad.cpp \
+ Source/WebCore/platform/audio/Biquad.h \
+ Source/WebCore/platform/audio/Cone.cpp \
+ Source/WebCore/platform/audio/Cone.h \
+ Source/WebCore/platform/audio/DenormalDisabler.h \
+ Source/WebCore/platform/audio/DirectConvolver.cpp \
+ Source/WebCore/platform/audio/DirectConvolver.h \
+ Source/WebCore/platform/audio/Distance.cpp \
+ Source/WebCore/platform/audio/Distance.h \
+ Source/WebCore/platform/audio/DynamicsCompressor.h \
+ Source/WebCore/platform/audio/DynamicsCompressorKernel.cpp \
+ Source/WebCore/platform/audio/DynamicsCompressorKernel.h \
+ Source/WebCore/platform/audio/DynamicsCompressor.cpp \
+ Source/WebCore/platform/audio/EqualPowerPanner.cpp \
+ Source/WebCore/platform/audio/EqualPowerPanner.h \
+ Source/WebCore/platform/audio/FFTConvolver.cpp \
+ Source/WebCore/platform/audio/FFTConvolver.h \
+ Source/WebCore/platform/audio/FFTFrame.cpp \
+ Source/WebCore/platform/audio/FFTFrame.h \
+ Source/WebCore/platform/audio/FFTFrameStub.cpp \
+ Source/WebCore/platform/audio/HRTFDatabase.cpp \
+ Source/WebCore/platform/audio/HRTFDatabase.h \
+ Source/WebCore/platform/audio/HRTFDatabaseLoader.cpp \
+ Source/WebCore/platform/audio/HRTFDatabaseLoader.h \
+ Source/WebCore/platform/audio/HRTFElevation.cpp \
+ Source/WebCore/platform/audio/HRTFElevation.h \
+ Source/WebCore/platform/audio/HRTFKernel.cpp \
+ Source/WebCore/platform/audio/HRTFKernel.h \
+ Source/WebCore/platform/audio/HRTFPanner.cpp \
+ Source/WebCore/platform/audio/HRTFPanner.h \
+ Source/WebCore/platform/audio/MultiChannelResampler.cpp \
+ Source/WebCore/platform/audio/MultiChannelResampler.h \
+ Source/WebCore/platform/audio/Panner.cpp \
+ Source/WebCore/platform/audio/Panner.h \
+ Source/WebCore/platform/audio/ReverbAccumulationBuffer.cpp \
+ Source/WebCore/platform/audio/ReverbAccumulationBuffer.h \
+ Source/WebCore/platform/audio/ReverbConvolver.cpp \
+ Source/WebCore/platform/audio/ReverbConvolver.h \
+ Source/WebCore/platform/audio/ReverbConvolverStage.cpp \
+ Source/WebCore/platform/audio/ReverbConvolverStage.h \
+ Source/WebCore/platform/audio/Reverb.cpp \
+ Source/WebCore/platform/audio/Reverb.h \
+ Source/WebCore/platform/audio/ReverbInputBuffer.cpp \
+ Source/WebCore/platform/audio/ReverbInputBuffer.h \
+ Source/WebCore/platform/audio/SincResampler.cpp \
+ Source/WebCore/platform/audio/SincResampler.h \
+ Source/WebCore/platform/audio/VectorMath.cpp \
+ Source/WebCore/platform/audio/VectorMath.h \
+ Source/WebCore/platform/audio/ZeroPole.cpp \
+ Source/WebCore/platform/audio/ZeroPole.h \
Source/WebCore/platform/ActivePlatformGestureAnimation.cpp \
Source/WebCore/platform/ActivePlatformGestureAnimation.h \
Source/WebCore/platform/PlatformGestureCurve.h \
@@ -3217,6 +4145,8 @@ webcore_sources += \
Source/WebCore/platform/EventLoop.h \
Source/WebCore/platform/EventTracer.cpp \
Source/WebCore/platform/EventTracer.h \
+ Source/WebCore/platform/PlatformInstrumentation.cpp \
+ Source/WebCore/platform/PlatformInstrumentation.h \
Source/WebCore/platform/FileChooser.cpp \
Source/WebCore/platform/FileChooser.h \
Source/WebCore/platform/FileIconLoader.cpp \
@@ -3233,6 +4163,8 @@ webcore_sources += \
Source/WebCore/platform/HashTools.h \
Source/WebCore/platform/HistogramSupport.cpp \
Source/WebCore/platform/HistogramSupport.h \
+ Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp \
+ Source/WebCore/platform/graphics/ANGLEWebKitBridge.h \
Source/WebCore/platform/graphics/BitmapImage.cpp \
Source/WebCore/platform/graphics/BitmapImage.h \
Source/WebCore/platform/graphics/Color.cpp \
@@ -3392,10 +4324,14 @@ webcore_sources += \
Source/WebCore/platform/graphics/GlyphPage.h \
Source/WebCore/platform/graphics/GlyphPageTreeNode.cpp \
Source/WebCore/platform/graphics/GlyphPageTreeNode.h \
+ Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp \
+ Source/WebCore/platform/graphics/gpu/DrawingBuffer.h \
Source/WebCore/platform/graphics/Gradient.cpp \
Source/WebCore/platform/graphics/Gradient.h \
Source/WebCore/platform/graphics/GraphicsContext.cpp \
Source/WebCore/platform/graphics/GraphicsContext.h \
+ Source/WebCore/platform/graphics/GraphicsContext3D.cpp \
+ Source/WebCore/platform/graphics/GraphicsContext3D.h \
Source/WebCore/platform/graphics/GraphicsLayer.h \
Source/WebCore/platform/graphics/GraphicsLayer.cpp \
Source/WebCore/platform/graphics/GraphicsLayerClient.h \
@@ -3422,6 +4358,14 @@ webcore_sources += \
Source/WebCore/platform/graphics/MediaPlayer.cpp \
Source/WebCore/platform/graphics/MediaPlayer.h \
Source/WebCore/platform/graphics/MediaPlayerPrivate.h \
+ Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp \
+ Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h \
+ Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp \
+ Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.h \
+ Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp \
+ Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp \
+ Source/WebCore/platform/graphics/OpenGLShims.cpp \
+ Source/WebCore/platform/graphics/OpenGLShims.h \
Source/WebCore/platform/graphics/opentype/OpenTypeVerticalData.h \
Source/WebCore/platform/graphics/Path.cpp \
Source/WebCore/platform/graphics/Path.h \
@@ -3738,6 +4682,8 @@ webcore_sources += \
Source/WebCore/platform/SuddenTermination.h \
Source/WebCore/platform/Supplementable.h \
Source/WebCore/platform/SystemTime.h \
+ Source/WebCore/platform/text/gtk/TextCheckerEnchant.h \
+ Source/WebCore/platform/text/gtk/TextCheckerEnchant.cpp \
Source/WebCore/platform/text/BidiContext.cpp \
Source/WebCore/platform/text/BidiContext.h \
Source/WebCore/platform/text/BidiResolver.h \
@@ -3970,13 +4916,13 @@ webcore_sources += \
Source/WebCore/rendering/RenderMenuList.h \
Source/WebCore/rendering/RenderMeter.cpp \
Source/WebCore/rendering/RenderMeter.h \
- Source/WebCore/rendering/RenderMultiColumnBlock.cpp \
- Source/WebCore/rendering/RenderMultiColumnBlock.h \
- Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp \
- Source/WebCore/rendering/RenderMultiColumnFlowThread.h \
- Source/WebCore/rendering/RenderMultiColumnSet.cpp \
- Source/WebCore/rendering/RenderMultiColumnSet.h \
- Source/WebCore/rendering/RenderNamedFlowThread.cpp \
+ Source/WebCore/rendering/RenderMultiColumnBlock.cpp \
+ Source/WebCore/rendering/RenderMultiColumnBlock.h \
+ Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp \
+ Source/WebCore/rendering/RenderMultiColumnFlowThread.h \
+ Source/WebCore/rendering/RenderMultiColumnSet.cpp \
+ Source/WebCore/rendering/RenderMultiColumnSet.h \
+ Source/WebCore/rendering/RenderNamedFlowThread.cpp \
Source/WebCore/rendering/RenderNamedFlowThread.h \
Source/WebCore/rendering/RenderObjectChildList.cpp \
Source/WebCore/rendering/RenderObjectChildList.h \
@@ -3991,7 +4937,7 @@ webcore_sources += \
Source/WebCore/rendering/RenderQuote.h \
Source/WebCore/rendering/RenderRegion.cpp \
Source/WebCore/rendering/RenderRegion.h \
- Source/WebCore/rendering/RenderRegionSet.cpp \
+ Source/WebCore/rendering/RenderRegionSet.cpp \
Source/WebCore/rendering/RenderRegionSet.h \
Source/WebCore/rendering/RenderReplaced.cpp \
Source/WebCore/rendering/RenderReplaced.h \
@@ -4818,6 +5764,13 @@ webcoregtk_sources += \
Source/WebCore/editing/gtk/FrameSelectionGtk.cpp \
Source/WebCore/page/gtk/DragControllerGtk.cpp \
Source/WebCore/page/gtk/EventHandlerGtk.cpp \
+ Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp \
+ Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.h \
+ Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp \
+ Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp \
+ Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp \
+ Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.h \
+ Source/WebCore/platform/audio/gtk/AudioBusGtk.cpp \
Source/WebCore/platform/cairo/WidgetBackingStore.h \
Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.h \
Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.cpp \
@@ -4844,6 +5797,8 @@ webcoregtk_sources += \
Source/WebCore/platform/graphics/gtk/ImageGtk.cpp \
Source/WebCore/platform/graphics/gtk/IntPointGtk.cpp \
Source/WebCore/platform/graphics/gtk/IntRectGtk.cpp \
+ Source/WebCore/platform/gtk/AsyncFileSystemGtk.cpp \
+ Source/WebCore/platform/gtk/AsyncFileSystemGtk.h \
Source/WebCore/platform/gtk/ClipboardGtk.cpp \
Source/WebCore/platform/gtk/ClipboardGtk.h \
Source/WebCore/platform/gtk/ClipboardUtilitiesGtk.cpp \
@@ -5005,924 +5960,6 @@ webcoregtk_sources += \
Source/WebCore/platform/graphics/pango/FontPango.cpp
endif # END USE_PANGO
-# ----
-# Database Support
-# ----
-if ENABLE_SQL_DATABASE
-webcore_built_sources += \
- DerivedSources/WebCore/JSDatabase.cpp \
- DerivedSources/WebCore/JSDatabase.h \
- DerivedSources/WebCore/JSDatabaseCallback.cpp \
- DerivedSources/WebCore/JSDatabaseCallback.h \
- DerivedSources/WebCore/JSDatabaseSync.cpp \
- DerivedSources/WebCore/JSDatabaseSync.h \
- DerivedSources/WebCore/JSSQLError.cpp \
- DerivedSources/WebCore/JSSQLError.h \
- DerivedSources/WebCore/JSSQLException.cpp \
- DerivedSources/WebCore/JSSQLResultSet.cpp \
- DerivedSources/WebCore/JSSQLResultSet.h \
- DerivedSources/WebCore/JSSQLResultSetRowList.cpp \
- DerivedSources/WebCore/JSSQLStatementCallback.cpp \
- DerivedSources/WebCore/JSSQLStatementCallback.h \
- DerivedSources/WebCore/JSSQLStatementErrorCallback.h \
- DerivedSources/WebCore/JSSQLTransaction.cpp \
- DerivedSources/WebCore/JSSQLTransactionCallback.cpp \
- DerivedSources/WebCore/JSSQLTransactionCallback.h \
- DerivedSources/WebCore/JSSQLTransactionErrorCallback.cpp \
- DerivedSources/WebCore/JSSQLTransactionErrorCallback.h \
- DerivedSources/WebCore/JSSQLTransactionSync.cpp \
- DerivedSources/WebCore/JSSQLTransactionSyncCallback.cpp \
- DerivedSources/WebCore/JSSQLTransactionSyncCallback.h
-
-dom_binding_idls += \
- $(WebCore)/Modules/webdatabase/DOMWindowWebDatabase.idl \
- $(WebCore)/Modules/webdatabase/Database.idl \
- $(WebCore)/Modules/webdatabase/DatabaseCallback.idl \
- $(WebCore)/Modules/webdatabase/DatabaseSync.idl \
- $(WebCore)/Modules/webdatabase/SQLError.idl \
- $(WebCore)/Modules/webdatabase/SQLException.idl \
- $(WebCore)/Modules/webdatabase/SQLResultSet.idl \
- $(WebCore)/Modules/webdatabase/SQLResultSetRowList.idl \
- $(WebCore)/Modules/webdatabase/SQLStatementCallback.idl \
- $(WebCore)/Modules/webdatabase/SQLStatementErrorCallback.idl \
- $(WebCore)/Modules/webdatabase/SQLTransaction.idl \
- $(WebCore)/Modules/webdatabase/SQLTransactionCallback.idl \
- $(WebCore)/Modules/webdatabase/SQLTransactionErrorCallback.idl \
- $(WebCore)/Modules/webdatabase/SQLTransactionSync.idl \
- $(WebCore)/Modules/webdatabase/SQLTransactionSyncCallback.idl \
- $(WebCore)/Modules/webdatabase/WorkerContextWebDatabase.idl
-endif # END ENABLE_SQL_DATABASE
-
-# ----
-# HTML5 data transfer items support
-# ----
-if ENABLE_DATA_TRANSFER_ITEMS
-webcore_built_sources += \
- DerivedSources/WebCore/JSDataTransferItem.cpp \
- DerivedSources/WebCore/JSDataTransferItem.h \
- DerivedSources/WebCore/JSDataTransferItemList.cpp \
- DerivedSources/WebCore/JSDataTransferItemList.h \
- DerivedSources/WebCore/JSStringCallback.cpp \
- DerivedSources/WebCore/JSStringCallback.h
-
-dom_binding_idls += \
- $(WebCore)/dom/DataTransferItem.idl \
- $(WebCore)/dom/StringCallback.idl
-
-webcore_sources += \
- Source/WebCore/dom/DataTransferItem.cpp \
- Source/WebCore/dom/DataTransferItem.h \
- Source/WebCore/dom/DataTransferItemList.h \
- Source/WebCore/dom/StringCallback.cpp \
- Source/WebCore/dom/StringCallback.h
-endif # END ENABLE_DATA_TRANSFER_ITEMS
-
-# ----
-# Indexed Database API support
-# ----
-if ENABLE_INDEXED_DATABASE
-webcore_built_sources += \
- DerivedSources/WebCore/JSIDBAny.cpp \
- DerivedSources/WebCore/JSIDBAny.h \
- DerivedSources/WebCore/JSIDBCursor.cpp \
- DerivedSources/WebCore/JSIDBCursor.h \
- DerivedSources/WebCore/JSIDBCursorWithValue.cpp \
- DerivedSources/WebCore/JSIDBCursorWithValue.h \
- DerivedSources/WebCore/JSIDBDatabaseException.cpp \
- DerivedSources/WebCore/JSIDBDatabaseException.h \
- DerivedSources/WebCore/JSIDBDatabase.cpp \
- DerivedSources/WebCore/JSIDBDatabase.h \
- DerivedSources/WebCore/JSIDBFactory.cpp \
- DerivedSources/WebCore/JSIDBFactory.h \
- DerivedSources/WebCore/JSIDBIndex.cpp \
- DerivedSources/WebCore/JSIDBIndex.h \
- DerivedSources/WebCore/JSIDBKey.cpp \
- DerivedSources/WebCore/JSIDBKey.h \
- DerivedSources/WebCore/JSIDBKeyRange.cpp \
- DerivedSources/WebCore/JSIDBKeyRange.h \
- DerivedSources/WebCore/JSIDBObjectStore.cpp \
- DerivedSources/WebCore/JSIDBObjectStore.h \
- DerivedSources/WebCore/JSIDBRequest.cpp \
- DerivedSources/WebCore/JSIDBRequest.h \
- DerivedSources/WebCore/JSIDBTransaction.cpp \
- DerivedSources/WebCore/JSIDBTransaction.h \
- DerivedSources/WebCore/JSIDBVersionChangeEvent.cpp \
- DerivedSources/WebCore/JSIDBVersionChangeEvent.h \
- DerivedSources/WebCore/JSIDBVersionChangeRequest.cpp \
- DerivedSources/WebCore/JSIDBVersionChangeRequest.h
-
-dom_binding_idls += \
- $(WebCore)/Modules/indexeddb/DOMWindowIndexedDatabase.idl \
- $(WebCore)/Modules/indexeddb/IDBAny.idl \
- $(WebCore)/Modules/indexeddb/IDBCursor.idl \
- $(WebCore)/Modules/indexeddb/IDBCursorWithValue.idl \
- $(WebCore)/Modules/indexeddb/IDBDatabaseException.idl \
- $(WebCore)/Modules/indexeddb/IDBDatabase.idl \
- $(WebCore)/Modules/indexeddb/IDBFactory.idl \
- $(WebCore)/Modules/indexeddb/IDBIndex.idl \
- $(WebCore)/Modules/indexeddb/IDBKey.idl \
- $(WebCore)/Modules/indexeddb/IDBKeyRange.idl \
- $(WebCore)/Modules/indexeddb/IDBObjectStore.idl \
- $(WebCore)/Modules/indexeddb/IDBRequest.idl \
- $(WebCore)/Modules/indexeddb/IDBTransaction.idl \
- $(WebCore)/Modules/indexeddb/IDBVersionChangeEvent.idl \
- $(WebCore)/Modules/indexeddb/IDBVersionChangeRequest.idl \
- $(WebCore)/Modules/indexeddb/WorkerContextIndexedDatabase.idl
-webcore_sources += \
- Source/WebCore/bindings/js/JSIDBAnyCustom.cpp \
- Source/WebCore/bindings/js/JSIDBKeyCustom.cpp \
- Source/WebCore/bindings/js/JSIDBVersionChangeRequestCustom.cpp
-endif # END ENABLE_INDEXED_DATABASE
-
-# ----
-# LevelDB
-# ----
-if USE_LEVELDB
-webcore_sources += \
- Source/WebCore/platform/leveldb/LevelDBComparator.h \
- Source/WebCore/platform/leveldb/LevelDBDatabase.cpp \
- Source/WebCore/platform/leveldb/LevelDBDatabase.h \
- Source/WebCore/platform/leveldb/LevelDBIterator.h \
- Source/WebCore/platform/leveldb/LevelDBSlice.h \
- Source/WebCore/platform/leveldb/LevelDBTransaction.cpp \
- Source/WebCore/platform/leveldb/LevelDBTransaction.h \
- Source/WebCore/platform/leveldb/LevelDBWriteBatch.cpp \
- Source/WebCore/platform/leveldb/LevelDBWriteBatch.h
-endif # end USE_LEVELDB
-
-# ----
-# FileSystem API support
-# ----
-if ENABLE_FILE_SYSTEM
-webcore_built_sources += \
- DerivedSources/WebCore/JSDirectoryEntry.cpp \
- DerivedSources/WebCore/JSDirectoryEntry.h \
- DerivedSources/WebCore/JSDirectoryEntrySync.cpp \
- DerivedSources/WebCore/JSDirectoryEntrySync.h \
- DerivedSources/WebCore/JSDirectoryReader.cpp \
- DerivedSources/WebCore/JSDirectoryReader.h \
- DerivedSources/WebCore/JSDirectoryReaderSync.cpp \
- DerivedSources/WebCore/JSDirectoryReaderSync.h \
- DerivedSources/WebCore/JSDOMFileSystem.cpp \
- DerivedSources/WebCore/JSDOMFileSystem.h \
- DerivedSources/WebCore/JSDOMFileSystemSync.cpp \
- DerivedSources/WebCore/JSDOMFileSystemSync.h \
- DerivedSources/WebCore/JSEntriesCallback.cpp \
- DerivedSources/WebCore/JSEntriesCallback.h \
- DerivedSources/WebCore/JSEntry.cpp \
- DerivedSources/WebCore/JSEntry.h \
- DerivedSources/WebCore/JSEntryArray.cpp \
- DerivedSources/WebCore/JSEntryArray.h \
- DerivedSources/WebCore/JSEntryArraySync.cpp \
- DerivedSources/WebCore/JSEntryArraySync.h \
- DerivedSources/WebCore/JSEntryCallback.cpp \
- DerivedSources/WebCore/JSEntryCallback.h \
- DerivedSources/WebCore/JSEntrySync.cpp \
- DerivedSources/WebCore/JSEntrySync.h \
- DerivedSources/WebCore/JSErrorCallback.cpp \
- DerivedSources/WebCore/JSErrorCallback.h \
- DerivedSources/WebCore/JSFileCallback.cpp \
- DerivedSources/WebCore/JSFileCallback.h \
- DerivedSources/WebCore/JSFileEntry.cpp \
- DerivedSources/WebCore/JSFileEntry.h \
- DerivedSources/WebCore/JSFileEntrySync.cpp \
- DerivedSources/WebCore/JSFileEntrySync.h \
- DerivedSources/WebCore/JSFileSystemCallback.cpp \
- DerivedSources/WebCore/JSFileSystemCallback.h \
- DerivedSources/WebCore/JSFileWriter.cpp \
- DerivedSources/WebCore/JSFileWriter.h \
- DerivedSources/WebCore/JSFileWriterCallback.cpp \
- DerivedSources/WebCore/JSFileWriterCallback.h \
- DerivedSources/WebCore/JSFileWriterSync.cpp \
- DerivedSources/WebCore/JSFileWriterSync.h \
- DerivedSources/WebCore/JSMetadata.cpp \
- DerivedSources/WebCore/JSMetadata.h \
- DerivedSources/WebCore/JSMetadataCallback.cpp \
- DerivedSources/WebCore/JSMetadataCallback.h
-
-dom_binding_idls += \
- $(WebCore)/Modules/filesystem/DOMFileSystem.idl \
- $(WebCore)/Modules/filesystem/DOMFileSystemSync.idl \
- $(WebCore)/Modules/filesystem/DOMWindowFileSystem.idl \
- $(WebCore)/Modules/filesystem/DirectoryEntry.idl \
- $(WebCore)/Modules/filesystem/DirectoryEntrySync.idl \
- $(WebCore)/Modules/filesystem/DirectoryReader.idl \
- $(WebCore)/Modules/filesystem/DirectoryReaderSync.idl \
- $(WebCore)/Modules/filesystem/EntriesCallback.idl \
- $(WebCore)/Modules/filesystem/Entry.idl \
- $(WebCore)/Modules/filesystem/EntryArray.idl \
- $(WebCore)/Modules/filesystem/EntryArraySync.idl \
- $(WebCore)/Modules/filesystem/EntryCallback.idl \
- $(WebCore)/Modules/filesystem/EntrySync.idl \
- $(WebCore)/Modules/filesystem/ErrorCallback.idl \
- $(WebCore)/Modules/filesystem/FileCallback.idl \
- $(WebCore)/Modules/filesystem/FileEntry.idl \
- $(WebCore)/Modules/filesystem/FileEntrySync.idl \
- $(WebCore)/Modules/filesystem/FileSystemCallback.idl \
- $(WebCore)/Modules/filesystem/FileWriter.idl \
- $(WebCore)/Modules/filesystem/FileWriterCallback.idl \
- $(WebCore)/Modules/filesystem/FileWriterSync.idl \
- $(WebCore)/Modules/filesystem/Metadata.idl \
- $(WebCore)/Modules/filesystem/MetadataCallback.idl \
- $(WebCore)/Modules/filesystem/WorkerContextFileSystem.idl
-
-webcoregtk_sources += \
- Source/WebCore/platform/gtk/AsyncFileSystemGtk.cpp \
- Source/WebCore/platform/gtk/AsyncFileSystemGtk.h
-endif # END ENABLE_FILE_SYSTEM
-
-# ----
-# SVG Support
-#
-# FIXME: allow a more fine-grained inclusion/generation of sources per SVG feature
-# ----
-if ENABLE_SVG
-webcore_built_sources += \
- DerivedSources/WebCore/JSElementTimeControl.h \
- DerivedSources/WebCore/JSSVGAElement.cpp \
- DerivedSources/WebCore/JSSVGAElement.h \
- DerivedSources/WebCore/JSSVGAltGlyphDefElement.cpp \
- DerivedSources/WebCore/JSSVGAltGlyphDefElement.h \
- DerivedSources/WebCore/JSSVGAltGlyphElement.cpp \
- DerivedSources/WebCore/JSSVGAltGlyphElement.h \
- DerivedSources/WebCore/JSSVGAltGlyphItemElement.cpp \
- DerivedSources/WebCore/JSSVGAltGlyphItemElement.h \
- DerivedSources/WebCore/JSSVGAngle.cpp \
- DerivedSources/WebCore/JSSVGAngle.h \
- DerivedSources/WebCore/JSSVGAnimateColorElement.cpp \
- DerivedSources/WebCore/JSSVGAnimateColorElement.h \
- DerivedSources/WebCore/JSSVGAnimatedAngle.cpp \
- DerivedSources/WebCore/JSSVGAnimatedAngle.h \
- DerivedSources/WebCore/JSSVGAnimatedBoolean.cpp \
- DerivedSources/WebCore/JSSVGAnimatedBoolean.h \
- DerivedSources/WebCore/JSSVGAnimatedEnumeration.cpp \
- DerivedSources/WebCore/JSSVGAnimatedEnumeration.h \
- DerivedSources/WebCore/JSSVGAnimatedInteger.cpp \
- DerivedSources/WebCore/JSSVGAnimatedInteger.h \
- DerivedSources/WebCore/JSSVGAnimatedLength.cpp \
- DerivedSources/WebCore/JSSVGAnimatedLength.h \
- DerivedSources/WebCore/JSSVGAnimatedLengthList.cpp \
- DerivedSources/WebCore/JSSVGAnimatedLengthList.h \
- DerivedSources/WebCore/JSSVGAnimatedNumber.cpp \
- DerivedSources/WebCore/JSSVGAnimatedNumber.h \
- DerivedSources/WebCore/JSSVGAnimatedNumberList.cpp \
- DerivedSources/WebCore/JSSVGAnimatedNumberList.h \
- DerivedSources/WebCore/JSSVGAnimatedPreserveAspectRatio.cpp \
- DerivedSources/WebCore/JSSVGAnimatedPreserveAspectRatio.h \
- DerivedSources/WebCore/JSSVGAnimatedRect.cpp \
- DerivedSources/WebCore/JSSVGAnimatedRect.h \
- DerivedSources/WebCore/JSSVGAnimatedString.cpp \
- DerivedSources/WebCore/JSSVGAnimatedString.h \
- DerivedSources/WebCore/JSSVGAnimatedTransformList.cpp \
- DerivedSources/WebCore/JSSVGAnimatedTransformList.h \
- DerivedSources/WebCore/JSSVGAnimateElement.cpp \
- DerivedSources/WebCore/JSSVGAnimateElement.h \
- DerivedSources/WebCore/JSSVGAnimateMotionElement.cpp \
- DerivedSources/WebCore/JSSVGAnimateMotionElement.h \
- DerivedSources/WebCore/JSSVGAnimateTransformElement.cpp \
- DerivedSources/WebCore/JSSVGAnimateTransformElement.h \
- DerivedSources/WebCore/JSSVGAnimationElement.cpp \
- DerivedSources/WebCore/JSSVGAnimationElement.h \
- DerivedSources/WebCore/JSSVGCircleElement.cpp \
- DerivedSources/WebCore/JSSVGCircleElement.h \
- DerivedSources/WebCore/JSSVGClipPathElement.cpp \
- DerivedSources/WebCore/JSSVGClipPathElement.h \
- DerivedSources/WebCore/JSSVGColor.cpp \
- DerivedSources/WebCore/JSSVGColor.h \
- DerivedSources/WebCore/JSSVGComponentTransferFunctionElement.cpp \
- DerivedSources/WebCore/JSSVGComponentTransferFunctionElement.h \
- DerivedSources/WebCore/JSSVGCursorElement.cpp \
- DerivedSources/WebCore/JSSVGCursorElement.h \
- DerivedSources/WebCore/JSSVGDefsElement.cpp \
- DerivedSources/WebCore/JSSVGDefsElement.h \
- DerivedSources/WebCore/JSSVGDescElement.cpp \
- DerivedSources/WebCore/JSSVGDescElement.h \
- DerivedSources/WebCore/JSSVGDocument.cpp \
- DerivedSources/WebCore/JSSVGDocument.h \
- DerivedSources/WebCore/JSSVGElement.cpp \
- DerivedSources/WebCore/JSSVGElement.h \
- DerivedSources/WebCore/JSSVGElementInstance.cpp \
- DerivedSources/WebCore/JSSVGElementInstanceList.cpp \
- DerivedSources/WebCore/JSSVGElementInstanceList.h \
- DerivedSources/WebCore/JSSVGEllipseElement.cpp \
- DerivedSources/WebCore/JSSVGEllipseElement.h \
- DerivedSources/WebCore/JSSVGException.cpp \
- DerivedSources/WebCore/JSSVGException.h \
- DerivedSources/WebCore/JSSVGExternalResourcesRequired.h \
- DerivedSources/WebCore/JSSVGFEBlendElement.cpp \
- DerivedSources/WebCore/JSSVGFEBlendElement.h \
- DerivedSources/WebCore/JSSVGFEColorMatrixElement.cpp \
- DerivedSources/WebCore/JSSVGFEColorMatrixElement.h \
- DerivedSources/WebCore/JSSVGFEComponentTransferElement.cpp \
- DerivedSources/WebCore/JSSVGFEComponentTransferElement.h \
- DerivedSources/WebCore/JSSVGFECompositeElement.cpp \
- DerivedSources/WebCore/JSSVGFECompositeElement.h \
- DerivedSources/WebCore/JSSVGFEConvolveMatrixElement.cpp \
- DerivedSources/WebCore/JSSVGFEConvolveMatrixElement.h \
- DerivedSources/WebCore/JSSVGFEDiffuseLightingElement.cpp \
- DerivedSources/WebCore/JSSVGFEDiffuseLightingElement.h \
- DerivedSources/WebCore/JSSVGFEDisplacementMapElement.cpp \
- DerivedSources/WebCore/JSSVGFEDisplacementMapElement.h \
- DerivedSources/WebCore/JSSVGFEDistantLightElement.cpp \
- DerivedSources/WebCore/JSSVGFEDistantLightElement.h \
- DerivedSources/WebCore/JSSVGFEDropShadowElement.cpp \
- DerivedSources/WebCore/JSSVGFEDropShadowElement.h \
- DerivedSources/WebCore/JSSVGFEFloodElement.cpp \
- DerivedSources/WebCore/JSSVGFEFloodElement.h \
- DerivedSources/WebCore/JSSVGFEFuncAElement.cpp \
- DerivedSources/WebCore/JSSVGFEFuncAElement.h \
- DerivedSources/WebCore/JSSVGFEFuncBElement.cpp \
- DerivedSources/WebCore/JSSVGFEFuncBElement.h \
- DerivedSources/WebCore/JSSVGFEFuncGElement.cpp \
- DerivedSources/WebCore/JSSVGFEFuncGElement.h \
- DerivedSources/WebCore/JSSVGFEFuncRElement.cpp \
- DerivedSources/WebCore/JSSVGFEFuncRElement.h \
- DerivedSources/WebCore/JSSVGFEGaussianBlurElement.cpp \
- DerivedSources/WebCore/JSSVGFEGaussianBlurElement.h \
- DerivedSources/WebCore/JSSVGFEImageElement.cpp \
- DerivedSources/WebCore/JSSVGFEImageElement.h \
- DerivedSources/WebCore/JSSVGFEMergeElement.cpp \
- DerivedSources/WebCore/JSSVGFEMergeElement.h \
- DerivedSources/WebCore/JSSVGFEMergeNodeElement.cpp \
- DerivedSources/WebCore/JSSVGFEMergeNodeElement.h \
- DerivedSources/WebCore/JSSVGFEMorphologyElement.cpp \
- DerivedSources/WebCore/JSSVGFEMorphologyElement.h \
- DerivedSources/WebCore/JSSVGFEOffsetElement.cpp \
- DerivedSources/WebCore/JSSVGFEOffsetElement.h \
- DerivedSources/WebCore/JSSVGFEPointLightElement.cpp \
- DerivedSources/WebCore/JSSVGFEPointLightElement.h \
- DerivedSources/WebCore/JSSVGFESpecularLightingElement.cpp \
- DerivedSources/WebCore/JSSVGFESpecularLightingElement.h \
- DerivedSources/WebCore/JSSVGFESpotLightElement.cpp \
- DerivedSources/WebCore/JSSVGFESpotLightElement.h \
- DerivedSources/WebCore/JSSVGFETileElement.cpp \
- DerivedSources/WebCore/JSSVGFETileElement.h \
- DerivedSources/WebCore/JSSVGFETurbulenceElement.cpp \
- DerivedSources/WebCore/JSSVGFETurbulenceElement.h \
- DerivedSources/WebCore/JSSVGFilterElement.cpp \
- DerivedSources/WebCore/JSSVGFilterElement.h \
- DerivedSources/WebCore/JSSVGFilterPrimitiveStandardAttributes.h \
- DerivedSources/WebCore/JSSVGFitToViewBox.h \
- DerivedSources/WebCore/JSSVGFontElement.cpp \
- DerivedSources/WebCore/JSSVGFontElement.h \
- DerivedSources/WebCore/JSSVGFontFaceElement.cpp \
- DerivedSources/WebCore/JSSVGFontFaceElement.h \
- DerivedSources/WebCore/JSSVGFontFaceFormatElement.cpp \
- DerivedSources/WebCore/JSSVGFontFaceFormatElement.h \
- DerivedSources/WebCore/JSSVGFontFaceNameElement.cpp \
- DerivedSources/WebCore/JSSVGFontFaceNameElement.h \
- DerivedSources/WebCore/JSSVGFontFaceSrcElement.cpp \
- DerivedSources/WebCore/JSSVGFontFaceSrcElement.h \
- DerivedSources/WebCore/JSSVGFontFaceUriElement.cpp \
- DerivedSources/WebCore/JSSVGFontFaceUriElement.h \
- DerivedSources/WebCore/JSSVGForeignObjectElement.cpp \
- DerivedSources/WebCore/JSSVGForeignObjectElement.h \
- DerivedSources/WebCore/JSSVGGElement.cpp \
- DerivedSources/WebCore/JSSVGGElement.h \
- DerivedSources/WebCore/JSSVGGlyphElement.cpp \
- DerivedSources/WebCore/JSSVGGlyphElement.h \
- DerivedSources/WebCore/JSSVGGlyphRefElement.cpp \
- DerivedSources/WebCore/JSSVGGlyphRefElement.h \
- DerivedSources/WebCore/JSSVGGradientElement.cpp \
- DerivedSources/WebCore/JSSVGGradientElement.h \
- DerivedSources/WebCore/JSSVGHKernElement.cpp \
- DerivedSources/WebCore/JSSVGHKernElement.h \
- DerivedSources/WebCore/JSSVGImageElement.cpp \
- DerivedSources/WebCore/JSSVGImageElement.h \
- DerivedSources/WebCore/JSSVGLangSpace.h \
- DerivedSources/WebCore/JSSVGLength.cpp \
- DerivedSources/WebCore/JSSVGLength.h \
- DerivedSources/WebCore/JSSVGLengthList.cpp \
- DerivedSources/WebCore/JSSVGLengthList.h \
- DerivedSources/WebCore/JSSVGLinearGradientElement.cpp \
- DerivedSources/WebCore/JSSVGLinearGradientElement.h \
- DerivedSources/WebCore/JSSVGLineElement.cpp \
- DerivedSources/WebCore/JSSVGLineElement.h \
- DerivedSources/WebCore/JSSVGLocatable.h \
- DerivedSources/WebCore/JSSVGMPathElement.cpp \
- DerivedSources/WebCore/JSSVGMPathElement.h \
- DerivedSources/WebCore/JSSVGMarkerElement.cpp \
- DerivedSources/WebCore/JSSVGMarkerElement.h \
- DerivedSources/WebCore/JSSVGMaskElement.cpp \
- DerivedSources/WebCore/JSSVGMaskElement.h \
- DerivedSources/WebCore/JSSVGMatrix.cpp \
- DerivedSources/WebCore/JSSVGMatrix.h \
- DerivedSources/WebCore/JSSVGMetadataElement.cpp \
- DerivedSources/WebCore/JSSVGMetadataElement.h \
- DerivedSources/WebCore/JSSVGMissingGlyphElement.cpp \
- DerivedSources/WebCore/JSSVGMissingGlyphElement.h \
- DerivedSources/WebCore/JSSVGNumber.cpp \
- DerivedSources/WebCore/JSSVGNumber.h \
- DerivedSources/WebCore/JSSVGNumberList.cpp \
- DerivedSources/WebCore/JSSVGNumberList.h \
- DerivedSources/WebCore/JSSVGPaint.cpp \
- DerivedSources/WebCore/JSSVGPaint.h \
- DerivedSources/WebCore/JSSVGPathElement.cpp \
- DerivedSources/WebCore/JSSVGPathElement.h \
- DerivedSources/WebCore/JSSVGPathSegArcAbs.cpp \
- DerivedSources/WebCore/JSSVGPathSegArcAbs.h \
- DerivedSources/WebCore/JSSVGPathSegArcRel.cpp \
- DerivedSources/WebCore/JSSVGPathSegArcRel.h \
- DerivedSources/WebCore/JSSVGPathSegClosePath.cpp \
- DerivedSources/WebCore/JSSVGPathSegClosePath.h \
- DerivedSources/WebCore/JSSVGPathSeg.cpp \
- DerivedSources/WebCore/JSSVGPathSegCurvetoCubicAbs.cpp \
- DerivedSources/WebCore/JSSVGPathSegCurvetoCubicAbs.h \
- DerivedSources/WebCore/JSSVGPathSegCurvetoCubicRel.cpp \
- DerivedSources/WebCore/JSSVGPathSegCurvetoCubicRel.h \
- DerivedSources/WebCore/JSSVGPathSegCurvetoCubicSmoothAbs.cpp \
- DerivedSources/WebCore/JSSVGPathSegCurvetoCubicSmoothAbs.h \
- DerivedSources/WebCore/JSSVGPathSegCurvetoCubicSmoothRel.cpp \
- DerivedSources/WebCore/JSSVGPathSegCurvetoCubicSmoothRel.h \
- DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticAbs.cpp \
- DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticAbs.h \
- DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticRel.cpp \
- DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticRel.h \
- DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticSmoothAbs.cpp \
- DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticSmoothAbs.h \
- DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticSmoothRel.cpp \
- DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticSmoothRel.h \
- DerivedSources/WebCore/JSSVGPathSeg.h \
- DerivedSources/WebCore/JSSVGPathSegLinetoAbs.cpp \
- DerivedSources/WebCore/JSSVGPathSegLinetoAbs.h \
- DerivedSources/WebCore/JSSVGPathSegLinetoHorizontalAbs.cpp \
- DerivedSources/WebCore/JSSVGPathSegLinetoHorizontalAbs.h \
- DerivedSources/WebCore/JSSVGPathSegLinetoHorizontalRel.cpp \
- DerivedSources/WebCore/JSSVGPathSegLinetoHorizontalRel.h \
- DerivedSources/WebCore/JSSVGPathSegLinetoRel.cpp \
- DerivedSources/WebCore/JSSVGPathSegLinetoRel.h \
- DerivedSources/WebCore/JSSVGPathSegLinetoVerticalAbs.cpp \
- DerivedSources/WebCore/JSSVGPathSegLinetoVerticalAbs.h \
- DerivedSources/WebCore/JSSVGPathSegLinetoVerticalRel.cpp \
- DerivedSources/WebCore/JSSVGPathSegLinetoVerticalRel.h \
- DerivedSources/WebCore/JSSVGPathSegList.cpp \
- DerivedSources/WebCore/JSSVGPathSegList.h \
- DerivedSources/WebCore/JSSVGPathSegMovetoAbs.cpp \
- DerivedSources/WebCore/JSSVGPathSegMovetoAbs.h \
- DerivedSources/WebCore/JSSVGPathSegMovetoRel.cpp \
- DerivedSources/WebCore/JSSVGPathSegMovetoRel.h \
- DerivedSources/WebCore/JSSVGPatternElement.cpp \
- DerivedSources/WebCore/JSSVGPatternElement.h \
- DerivedSources/WebCore/JSSVGPoint.cpp \
- DerivedSources/WebCore/JSSVGPoint.h \
- DerivedSources/WebCore/JSSVGPointList.cpp \
- DerivedSources/WebCore/JSSVGPointList.h \
- DerivedSources/WebCore/JSSVGPolygonElement.cpp \
- DerivedSources/WebCore/JSSVGPolygonElement.h \
- DerivedSources/WebCore/JSSVGPolylineElement.cpp \
- DerivedSources/WebCore/JSSVGPolylineElement.h \
- DerivedSources/WebCore/JSSVGPreserveAspectRatio.cpp \
- DerivedSources/WebCore/JSSVGPreserveAspectRatio.h \
- DerivedSources/WebCore/JSSVGRadialGradientElement.cpp \
- DerivedSources/WebCore/JSSVGRadialGradientElement.h \
- DerivedSources/WebCore/JSSVGRect.cpp \
- DerivedSources/WebCore/JSSVGRectElement.cpp \
- DerivedSources/WebCore/JSSVGRectElement.h \
- DerivedSources/WebCore/JSSVGRect.h \
- DerivedSources/WebCore/JSSVGRenderingIntent.cpp \
- DerivedSources/WebCore/JSSVGRenderingIntent.h \
- DerivedSources/WebCore/JSSVGScriptElement.cpp \
- DerivedSources/WebCore/JSSVGScriptElement.h \
- DerivedSources/WebCore/JSSVGSetElement.cpp \
- DerivedSources/WebCore/JSSVGSetElement.h \
- DerivedSources/WebCore/JSSVGStopElement.cpp \
- DerivedSources/WebCore/JSSVGStopElement.h \
- DerivedSources/WebCore/JSSVGStringList.cpp \
- DerivedSources/WebCore/JSSVGStringList.h \
- DerivedSources/WebCore/JSSVGStylable.h \
- DerivedSources/WebCore/JSSVGStyleElement.cpp \
- DerivedSources/WebCore/JSSVGStyleElement.h \
- DerivedSources/WebCore/JSSVGSVGElement.cpp \
- DerivedSources/WebCore/JSSVGSVGElement.h \
- DerivedSources/WebCore/JSSVGSwitchElement.cpp \
- DerivedSources/WebCore/JSSVGSwitchElement.h \
- DerivedSources/WebCore/JSSVGSymbolElement.cpp \
- DerivedSources/WebCore/JSSVGSymbolElement.h \
- DerivedSources/WebCore/JSSVGTests.h \
- DerivedSources/WebCore/JSSVGTextContentElement.cpp \
- DerivedSources/WebCore/JSSVGTextContentElement.h \
- DerivedSources/WebCore/JSSVGTextElement.cpp \
- DerivedSources/WebCore/JSSVGTextElement.h \
- DerivedSources/WebCore/JSSVGTextPathElement.cpp \
- DerivedSources/WebCore/JSSVGTextPathElement.h \
- DerivedSources/WebCore/JSSVGTextPositioningElement.cpp \
- DerivedSources/WebCore/JSSVGTextPositioningElement.h \
- DerivedSources/WebCore/JSSVGTitleElement.cpp \
- DerivedSources/WebCore/JSSVGTitleElement.h \
- DerivedSources/WebCore/JSSVGTransformable.h \
- DerivedSources/WebCore/JSSVGTransform.cpp \
- DerivedSources/WebCore/JSSVGTransform.h \
- DerivedSources/WebCore/JSSVGTransformList.cpp \
- DerivedSources/WebCore/JSSVGTransformList.h \
- DerivedSources/WebCore/JSSVGTRefElement.cpp \
- DerivedSources/WebCore/JSSVGTRefElement.h \
- DerivedSources/WebCore/JSSVGTSpanElement.cpp \
- DerivedSources/WebCore/JSSVGTSpanElement.h \
- DerivedSources/WebCore/JSSVGUnitTypes.cpp \
- DerivedSources/WebCore/JSSVGUnitTypes.h \
- DerivedSources/WebCore/JSSVGURIReference.h \
- DerivedSources/WebCore/JSSVGUseElement.cpp \
- DerivedSources/WebCore/JSSVGUseElement.h \
- DerivedSources/WebCore/JSSVGViewElement.cpp \
- DerivedSources/WebCore/JSSVGViewElement.h \
- DerivedSources/WebCore/JSSVGViewSpec.cpp \
- DerivedSources/WebCore/JSSVGViewSpec.h \
- DerivedSources/WebCore/JSSVGVKernElement.cpp \
- DerivedSources/WebCore/JSSVGVKernElement.h \
- DerivedSources/WebCore/JSSVGZoomAndPan.cpp \
- DerivedSources/WebCore/JSSVGZoomAndPan.h \
- DerivedSources/WebCore/JSSVGZoomEvent.cpp \
- DerivedSources/WebCore/JSSVGZoomEvent.h
-
-dom_binding_idls += \
- $(WebCore)/svg/SVGAElement.idl \
- $(WebCore)/svg/SVGAltGlyphDefElement.idl \
- $(WebCore)/svg/SVGAltGlyphElement.idl \
- $(WebCore)/svg/SVGAltGlyphItemElement.idl \
- $(WebCore)/svg/SVGAngle.idl \
- $(WebCore)/svg/SVGAnimateColorElement.idl \
- $(WebCore)/svg/SVGAnimateElement.idl \
- $(WebCore)/svg/SVGAnimateMotionElement.idl \
- $(WebCore)/svg/SVGAnimateTransformElement.idl \
- $(WebCore)/svg/SVGAnimatedAngle.idl \
- $(WebCore)/svg/SVGAnimatedBoolean.idl \
- $(WebCore)/svg/SVGAnimatedEnumeration.idl \
- $(WebCore)/svg/SVGAnimatedInteger.idl \
- $(WebCore)/svg/SVGAnimatedLength.idl \
- $(WebCore)/svg/SVGAnimatedLengthList.idl \
- $(WebCore)/svg/SVGAnimatedNumber.idl \
- $(WebCore)/svg/SVGAnimatedNumberList.idl \
- $(WebCore)/svg/SVGAnimatedPreserveAspectRatio.idl \
- $(WebCore)/svg/SVGAnimatedRect.idl \
- $(WebCore)/svg/SVGAnimatedString.idl \
- $(WebCore)/svg/SVGAnimatedTransformList.idl \
- $(WebCore)/svg/SVGAnimationElement.idl \
- $(WebCore)/svg/SVGCircleElement.idl \
- $(WebCore)/svg/SVGClipPathElement.idl \
- $(WebCore)/svg/SVGColor.idl \
- $(WebCore)/svg/SVGComponentTransferFunctionElement.idl \
- $(WebCore)/svg/SVGCursorElement.idl \
- $(WebCore)/svg/SVGDefsElement.idl \
- $(WebCore)/svg/SVGDescElement.idl \
- $(WebCore)/svg/SVGDocument.idl \
- $(WebCore)/svg/SVGElement.idl \
- $(WebCore)/svg/SVGElementInstance.idl \
- $(WebCore)/svg/SVGElementInstanceList.idl \
- $(WebCore)/svg/SVGEllipseElement.idl \
- $(WebCore)/svg/SVGException.idl \
- $(WebCore)/svg/SVGFEBlendElement.idl \
- $(WebCore)/svg/SVGFEColorMatrixElement.idl \
- $(WebCore)/svg/SVGFEComponentTransferElement.idl \
- $(WebCore)/svg/SVGFECompositeElement.idl \
- $(WebCore)/svg/SVGFEConvolveMatrixElement.idl \
- $(WebCore)/svg/SVGFEDiffuseLightingElement.idl \
- $(WebCore)/svg/SVGFEDisplacementMapElement.idl \
- $(WebCore)/svg/SVGFEDistantLightElement.idl \
- $(WebCore)/svg/SVGFEDropShadowElement.idl \
- $(WebCore)/svg/SVGFEFloodElement.idl \
- $(WebCore)/svg/SVGFEFuncAElement.idl \
- $(WebCore)/svg/SVGFEFuncBElement.idl \
- $(WebCore)/svg/SVGFEFuncGElement.idl \
- $(WebCore)/svg/SVGFEFuncRElement.idl \
- $(WebCore)/svg/SVGFEGaussianBlurElement.idl \
- $(WebCore)/svg/SVGFEImageElement.idl \
- $(WebCore)/svg/SVGFEMergeElement.idl \
- $(WebCore)/svg/SVGFEMergeNodeElement.idl \
- $(WebCore)/svg/SVGFEMorphologyElement.idl \
- $(WebCore)/svg/SVGFEOffsetElement.idl \
- $(WebCore)/svg/SVGFEPointLightElement.idl \
- $(WebCore)/svg/SVGFESpecularLightingElement.idl \
- $(WebCore)/svg/SVGFESpotLightElement.idl \
- $(WebCore)/svg/SVGFETileElement.idl \
- $(WebCore)/svg/SVGFETurbulenceElement.idl \
- $(WebCore)/svg/SVGFilterElement.idl \
- $(WebCore)/svg/SVGFontElement.idl \
- $(WebCore)/svg/SVGFontFaceElement.idl \
- $(WebCore)/svg/SVGFontFaceFormatElement.idl \
- $(WebCore)/svg/SVGFontFaceNameElement.idl \
- $(WebCore)/svg/SVGFontFaceSrcElement.idl \
- $(WebCore)/svg/SVGFontFaceUriElement.idl \
- $(WebCore)/svg/SVGForeignObjectElement.idl \
- $(WebCore)/svg/SVGGElement.idl \
- $(WebCore)/svg/SVGGlyphElement.idl \
- $(WebCore)/svg/SVGGlyphRefElement.idl \
- $(WebCore)/svg/SVGGradientElement.idl \
- $(WebCore)/svg/SVGHKernElement.idl \
- $(WebCore)/svg/SVGImageElement.idl \
- $(WebCore)/svg/SVGLength.idl \
- $(WebCore)/svg/SVGLengthList.idl \
- $(WebCore)/svg/SVGLineElement.idl \
- $(WebCore)/svg/SVGLinearGradientElement.idl \
- $(WebCore)/svg/SVGMPathElement.idl \
- $(WebCore)/svg/SVGMarkerElement.idl \
- $(WebCore)/svg/SVGMaskElement.idl \
- $(WebCore)/svg/SVGMatrix.idl \
- $(WebCore)/svg/SVGMetadataElement.idl \
- $(WebCore)/svg/SVGMissingGlyphElement.idl \
- $(WebCore)/svg/SVGNumber.idl \
- $(WebCore)/svg/SVGNumberList.idl \
- $(WebCore)/svg/SVGPaint.idl \
- $(WebCore)/svg/SVGPathElement.idl \
- $(WebCore)/svg/SVGPathSeg.idl \
- $(WebCore)/svg/SVGPathSegArcAbs.idl \
- $(WebCore)/svg/SVGPathSegArcRel.idl \
- $(WebCore)/svg/SVGPathSegClosePath.idl \
- $(WebCore)/svg/SVGPathSegCurvetoCubicAbs.idl \
- $(WebCore)/svg/SVGPathSegCurvetoCubicRel.idl \
- $(WebCore)/svg/SVGPathSegCurvetoCubicSmoothAbs.idl \
- $(WebCore)/svg/SVGPathSegCurvetoCubicSmoothRel.idl \
- $(WebCore)/svg/SVGPathSegCurvetoQuadraticAbs.idl \
- $(WebCore)/svg/SVGPathSegCurvetoQuadraticRel.idl \
- $(WebCore)/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl \
- $(WebCore)/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl \
- $(WebCore)/svg/SVGPathSegLinetoAbs.idl \
- $(WebCore)/svg/SVGPathSegLinetoHorizontalAbs.idl \
- $(WebCore)/svg/SVGPathSegLinetoHorizontalRel.idl \
- $(WebCore)/svg/SVGPathSegLinetoRel.idl \
- $(WebCore)/svg/SVGPathSegLinetoVerticalAbs.idl \
- $(WebCore)/svg/SVGPathSegLinetoVerticalRel.idl \
- $(WebCore)/svg/SVGPathSegList.idl \
- $(WebCore)/svg/SVGPathSegMovetoAbs.idl \
- $(WebCore)/svg/SVGPathSegMovetoRel.idl \
- $(WebCore)/svg/SVGPatternElement.idl \
- $(WebCore)/svg/SVGPoint.idl \
- $(WebCore)/svg/SVGPointList.idl \
- $(WebCore)/svg/SVGPolygonElement.idl \
- $(WebCore)/svg/SVGPolylineElement.idl \
- $(WebCore)/svg/SVGPreserveAspectRatio.idl \
- $(WebCore)/svg/SVGRadialGradientElement.idl \
- $(WebCore)/svg/SVGRect.idl \
- $(WebCore)/svg/SVGRectElement.idl \
- $(WebCore)/svg/SVGRenderingIntent.idl \
- $(WebCore)/svg/SVGSVGElement.idl \
- $(WebCore)/svg/SVGScriptElement.idl \
- $(WebCore)/svg/SVGSetElement.idl \
- $(WebCore)/svg/SVGStopElement.idl \
- $(WebCore)/svg/SVGStringList.idl \
- $(WebCore)/svg/SVGStyleElement.idl \
- $(WebCore)/svg/SVGSwitchElement.idl \
- $(WebCore)/svg/SVGSymbolElement.idl \
- $(WebCore)/svg/SVGTRefElement.idl \
- $(WebCore)/svg/SVGTSpanElement.idl \
- $(WebCore)/svg/SVGTextContentElement.idl \
- $(WebCore)/svg/SVGTextElement.idl \
- $(WebCore)/svg/SVGTextPathElement.idl \
- $(WebCore)/svg/SVGTextPositioningElement.idl \
- $(WebCore)/svg/SVGTitleElement.idl \
- $(WebCore)/svg/SVGTransform.idl \
- $(WebCore)/svg/SVGTransformList.idl \
- $(WebCore)/svg/SVGUnitTypes.idl \
- $(WebCore)/svg/SVGUseElement.idl \
- $(WebCore)/svg/SVGVKernElement.idl \
- $(WebCore)/svg/SVGViewElement.idl \
- $(WebCore)/svg/SVGViewSpec.idl \
- $(WebCore)/svg/SVGZoomAndPan.idl \
- $(WebCore)/svg/SVGZoomEvent.idl
-endif # END ENABLE_SVG
-
-# ----
-# Web Audio Support
-# ----
-
-if ENABLE_WEB_AUDIO
-webcore_sources += \
- Source/WebCore/Modules/webaudio/AsyncAudioDecoder.cpp \
- Source/WebCore/Modules/webaudio/AsyncAudioDecoder.h \
- Source/WebCore/Modules/webaudio/AudioBasicInspectorNode.cpp \
- Source/WebCore/Modules/webaudio/AudioBasicInspectorNode.h \
- Source/WebCore/Modules/webaudio/AudioBasicProcessorNode.cpp \
- Source/WebCore/Modules/webaudio/AudioBasicProcessorNode.h \
- Source/WebCore/Modules/webaudio/AudioBuffer.cpp \
- Source/WebCore/Modules/webaudio/AudioBuffer.h \
- Source/WebCore/Modules/webaudio/AudioBufferCallback.h \
- Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp \
- Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h \
- Source/WebCore/Modules/webaudio/AudioChannelMerger.cpp \
- Source/WebCore/Modules/webaudio/AudioChannelMerger.h \
- Source/WebCore/Modules/webaudio/AudioChannelSplitter.cpp \
- Source/WebCore/Modules/webaudio/AudioChannelSplitter.h \
- Source/WebCore/Modules/webaudio/AudioContext.cpp \
- Source/WebCore/Modules/webaudio/AudioContext.h \
- Source/WebCore/Modules/webaudio/AudioDestinationNode.cpp \
- Source/WebCore/Modules/webaudio/AudioDestinationNode.h \
- Source/WebCore/Modules/webaudio/AudioGain.h \
- Source/WebCore/Modules/webaudio/AudioGainNode.cpp \
- Source/WebCore/Modules/webaudio/AudioGainNode.h \
- Source/WebCore/Modules/webaudio/AudioListener.cpp \
- Source/WebCore/Modules/webaudio/AudioListener.h \
- Source/WebCore/Modules/webaudio/AudioNode.cpp \
- Source/WebCore/Modules/webaudio/AudioNode.h \
- Source/WebCore/Modules/webaudio/AudioNodeInput.cpp \
- Source/WebCore/Modules/webaudio/AudioNodeInput.h \
- Source/WebCore/Modules/webaudio/AudioNodeOutput.cpp \
- Source/WebCore/Modules/webaudio/AudioNodeOutput.h \
- Source/WebCore/Modules/webaudio/AudioPannerNode.cpp \
- Source/WebCore/Modules/webaudio/AudioPannerNode.h \
- Source/WebCore/Modules/webaudio/AudioParam.cpp \
- Source/WebCore/Modules/webaudio/AudioParam.h \
- Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp \
- Source/WebCore/Modules/webaudio/AudioParamTimeline.h \
- Source/WebCore/Modules/webaudio/AudioProcessingEvent.cpp \
- Source/WebCore/Modules/webaudio/AudioProcessingEvent.h \
- Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp \
- Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.h \
- Source/WebCore/Modules/webaudio/AudioSummingJunction.cpp \
- Source/WebCore/Modules/webaudio/AudioSummingJunction.h \
- Source/WebCore/Modules/webaudio/AudioSourceNode.h \
- Source/WebCore/Modules/webaudio/BiquadDSPKernel.cpp \
- Source/WebCore/Modules/webaudio/BiquadDSPKernel.h \
- Source/WebCore/Modules/webaudio/BiquadFilterNode.cpp \
- Source/WebCore/Modules/webaudio/BiquadFilterNode.h \
- Source/WebCore/Modules/webaudio/BiquadProcessor.cpp \
- Source/WebCore/Modules/webaudio/BiquadProcessor.h \
- Source/WebCore/Modules/webaudio/ConvolverNode.cpp \
- Source/WebCore/Modules/webaudio/ConvolverNode.h \
- Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.h \
- Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.cpp \
- Source/WebCore/Modules/webaudio/DelayDSPKernel.cpp \
- Source/WebCore/Modules/webaudio/DelayDSPKernel.h \
- Source/WebCore/Modules/webaudio/DelayNode.cpp \
- Source/WebCore/Modules/webaudio/DelayNode.h \
- Source/WebCore/Modules/webaudio/DelayProcessor.cpp \
- Source/WebCore/Modules/webaudio/DelayProcessor.h \
- Source/WebCore/Modules/webaudio/DynamicsCompressorNode.cpp \
- Source/WebCore/Modules/webaudio/DynamicsCompressorNode.h \
- Source/WebCore/Modules/webaudio/JavaScriptAudioNode.cpp \
- Source/WebCore/Modules/webaudio/JavaScriptAudioNode.h \
- Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.cpp \
- Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.h \
- Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.cpp \
- Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.h \
- Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.h \
- Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.cpp \
- Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.h \
- Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.cpp \
- Source/WebCore/Modules/webaudio/Oscillator.h \
- Source/WebCore/Modules/webaudio/Oscillator.cpp \
- Source/WebCore/Modules/webaudio/RealtimeAnalyser.cpp \
- Source/WebCore/Modules/webaudio/RealtimeAnalyser.h \
- Source/WebCore/Modules/webaudio/RealtimeAnalyserNode.cpp \
- Source/WebCore/Modules/webaudio/RealtimeAnalyserNode.h \
- Source/WebCore/Modules/webaudio/WaveShaperNode.cpp \
- Source/WebCore/Modules/webaudio/WaveShaperProcessor.h \
- Source/WebCore/Modules/webaudio/WaveShaperDSPKernel.cpp \
- Source/WebCore/Modules/webaudio/WaveShaperDSPKernel.h \
- Source/WebCore/Modules/webaudio/WaveShaperProcessor.cpp \
- Source/WebCore/Modules/webaudio/WaveShaperNode.h \
- Source/WebCore/Modules/webaudio/WaveTable.cpp \
- Source/WebCore/Modules/webaudio/WaveTable.h \
- Source/WebCore/bindings/js/JSAudioBufferSourceNodeCustom.cpp \
- Source/WebCore/bindings/js/JSAudioContextCustom.cpp \
- Source/WebCore/bindings/js/JSConvolverNodeCustom.cpp \
- Source/WebCore/bindings/js/JSJavaScriptAudioNodeCustom.cpp \
- Source/WebCore/platform/audio/AudioArray.h \
- Source/WebCore/platform/audio/AudioBus.cpp \
- Source/WebCore/platform/audio/AudioBus.h \
- Source/WebCore/platform/audio/AudioChannel.cpp \
- Source/WebCore/platform/audio/AudioChannel.h \
- Source/WebCore/platform/audio/AudioDestination.h \
- Source/WebCore/platform/audio/AudioDSPKernel.h \
- Source/WebCore/platform/audio/AudioDSPKernelProcessor.cpp \
- Source/WebCore/platform/audio/AudioDSPKernelProcessor.h \
- Source/WebCore/platform/audio/AudioFileReader.h \
- Source/WebCore/platform/audio/AudioIOCallback.h \
- Source/WebCore/platform/audio/AudioProcessor.h \
- Source/WebCore/platform/audio/AudioResampler.cpp \
- Source/WebCore/platform/audio/AudioResampler.h \
- Source/WebCore/platform/audio/AudioResamplerKernel.cpp \
- Source/WebCore/platform/audio/AudioResamplerKernel.h \
- Source/WebCore/platform/audio/AudioSourceProvider.h \
- Source/WebCore/platform/audio/AudioSourceProviderClient.h \
- Source/WebCore/platform/audio/AudioUtilities.cpp \
- Source/WebCore/platform/audio/AudioUtilities.h \
- Source/WebCore/platform/audio/Biquad.cpp \
- Source/WebCore/platform/audio/Biquad.h \
- Source/WebCore/platform/audio/Cone.cpp \
- Source/WebCore/platform/audio/Cone.h \
- Source/WebCore/platform/audio/DenormalDisabler.h \
- Source/WebCore/platform/audio/DirectConvolver.cpp \
- Source/WebCore/platform/audio/DirectConvolver.h \
- Source/WebCore/platform/audio/Distance.cpp \
- Source/WebCore/platform/audio/Distance.h \
- Source/WebCore/platform/audio/DynamicsCompressor.h \
- Source/WebCore/platform/audio/DynamicsCompressorKernel.cpp \
- Source/WebCore/platform/audio/DynamicsCompressorKernel.h \
- Source/WebCore/platform/audio/DynamicsCompressor.cpp \
- Source/WebCore/platform/audio/EqualPowerPanner.cpp \
- Source/WebCore/platform/audio/EqualPowerPanner.h \
- Source/WebCore/platform/audio/FFTConvolver.cpp \
- Source/WebCore/platform/audio/FFTConvolver.h \
- Source/WebCore/platform/audio/FFTFrame.cpp \
- Source/WebCore/platform/audio/FFTFrame.h \
- Source/WebCore/platform/audio/FFTFrameStub.cpp \
- Source/WebCore/platform/audio/HRTFDatabase.cpp \
- Source/WebCore/platform/audio/HRTFDatabase.h \
- Source/WebCore/platform/audio/HRTFDatabaseLoader.cpp \
- Source/WebCore/platform/audio/HRTFDatabaseLoader.h \
- Source/WebCore/platform/audio/HRTFElevation.cpp \
- Source/WebCore/platform/audio/HRTFElevation.h \
- Source/WebCore/platform/audio/HRTFKernel.cpp \
- Source/WebCore/platform/audio/HRTFKernel.h \
- Source/WebCore/platform/audio/HRTFPanner.cpp \
- Source/WebCore/platform/audio/HRTFPanner.h \
- Source/WebCore/platform/audio/MultiChannelResampler.cpp \
- Source/WebCore/platform/audio/MultiChannelResampler.h \
- Source/WebCore/platform/audio/Panner.cpp \
- Source/WebCore/platform/audio/Panner.h \
- Source/WebCore/platform/audio/ReverbAccumulationBuffer.cpp \
- Source/WebCore/platform/audio/ReverbAccumulationBuffer.h \
- Source/WebCore/platform/audio/ReverbConvolver.cpp \
- Source/WebCore/platform/audio/ReverbConvolver.h \
- Source/WebCore/platform/audio/ReverbConvolverStage.cpp \
- Source/WebCore/platform/audio/ReverbConvolverStage.h \
- Source/WebCore/platform/audio/Reverb.cpp \
- Source/WebCore/platform/audio/Reverb.h \
- Source/WebCore/platform/audio/ReverbInputBuffer.cpp \
- Source/WebCore/platform/audio/ReverbInputBuffer.h \
- Source/WebCore/platform/audio/SincResampler.cpp \
- Source/WebCore/platform/audio/SincResampler.h \
- Source/WebCore/platform/audio/VectorMath.cpp \
- Source/WebCore/platform/audio/VectorMath.h \
- Source/WebCore/platform/audio/ZeroPole.cpp \
- Source/WebCore/platform/audio/ZeroPole.h \
- Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp \
- Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.h \
- Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp \
- Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp \
- Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp \
- Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.h \
- Source/WebCore/platform/audio/gtk/AudioBusGtk.cpp
-
-webcore_built_sources += \
- DerivedSources/WebCore/JSAudioBuffer.cpp \
- DerivedSources/WebCore/JSAudioBuffer.h \
- DerivedSources/WebCore/JSAudioBufferCallback.cpp \
- DerivedSources/WebCore/JSAudioBufferCallback.h \
- DerivedSources/WebCore/JSAudioBufferSourceNode.cpp \
- DerivedSources/WebCore/JSAudioBufferSourceNode.h \
- DerivedSources/WebCore/JSAudioChannelMerger.cpp \
- DerivedSources/WebCore/JSAudioChannelMerger.h \
- DerivedSources/WebCore/JSAudioChannelSplitter.cpp \
- DerivedSources/WebCore/JSAudioChannelSplitter.h \
- DerivedSources/WebCore/JSAudioDestinationNode.cpp \
- DerivedSources/WebCore/JSAudioDestinationNode.h \
- DerivedSources/WebCore/JSAudioGain.cpp \
- DerivedSources/WebCore/JSAudioGain.h \
- DerivedSources/WebCore/JSAudioGainNode.cpp \
- DerivedSources/WebCore/JSAudioGainNode.h \
- DerivedSources/WebCore/JSAudioListener.cpp \
- DerivedSources/WebCore/JSAudioListener.h \
- DerivedSources/WebCore/JSAudioNode.cpp \
- DerivedSources/WebCore/JSAudioNode.h \
- DerivedSources/WebCore/JSAudioParam.cpp \
- DerivedSources/WebCore/JSAudioParam.h \
- DerivedSources/WebCore/JSAudioProcessingEvent.cpp \
- DerivedSources/WebCore/JSAudioProcessingEvent.h \
- DerivedSources/WebCore/JSAudioSourceNode.cpp \
- DerivedSources/WebCore/JSAudioSourceNode.h \
- DerivedSources/WebCore/JSBiquadFilterNode.cpp \
- DerivedSources/WebCore/JSBiquadFilterNode.h \
- DerivedSources/WebCore/JSConvolverNode.cpp \
- DerivedSources/WebCore/JSConvolverNode.h \
- DerivedSources/WebCore/JSDelayNode.cpp \
- DerivedSources/WebCore/JSDelayNode.h \
- DerivedSources/WebCore/JSJavaScriptAudioNode.cpp \
- DerivedSources/WebCore/JSJavaScriptAudioNode.h \
- DerivedSources/WebCore/JSOfflineAudioCompletionEvent.cpp \
- DerivedSources/WebCore/JSOfflineAudioCompletionEvent.h \
- DerivedSources/WebCore/JSMediaElementAudioSourceNode.cpp \
- DerivedSources/WebCore/JSMediaElementAudioSourceNode.h \
- DerivedSources/WebCore/JSMediaStreamAudioSourceNode.cpp \
- DerivedSources/WebCore/JSMediaStreamAudioSourceNode.h \
- DerivedSources/WebCore/JSRealtimeAnalyserNode.cpp \
- DerivedSources/WebCore/JSRealtimeAnalyserNode.h
-
-dom_binding_idls += \
- $(WebCore)/Modules/webaudio/AudioBuffer.idl \
- $(WebCore)/Modules/webaudio/AudioBufferCallback.idl \
- $(WebCore)/Modules/webaudio/AudioBufferSourceNode.idl \
- $(WebCore)/Modules/webaudio/AudioChannelMerger.idl \
- $(WebCore)/Modules/webaudio/AudioChannelSplitter.idl \
- $(WebCore)/Modules/webaudio/AudioDestinationNode.idl \
- $(WebCore)/Modules/webaudio/AudioGain.idl \
- $(WebCore)/Modules/webaudio/AudioGainNode.idl \
- $(WebCore)/Modules/webaudio/AudioListener.idl \
- $(WebCore)/Modules/webaudio/AudioNode.idl \
- $(WebCore)/Modules/webaudio/AudioParam.idl \
- $(WebCore)/Modules/webaudio/AudioProcessingEvent.idl \
- $(WebCore)/Modules/webaudio/AudioSourceNode.idl \
- $(WebCore)/Modules/webaudio/BiquadFilterNode.idl \
- $(WebCore)/Modules/webaudio/ConvolverNode.idl \
- $(WebCore)/Modules/webaudio/DelayNode.idl \
- $(WebCore)/Modules/webaudio/JavaScriptAudioNode.idl \
- $(WebCore)/Modules/webaudio/MediaElementAudioSourceNode.idl \
- $(WebCore)/Modules/webaudio/MediaStreamAudioSourceNode.idl \
- $(WebCore)/Modules/webaudio/OfflineAudioCompletionEvent.idl \
- $(WebCore)/Modules/webaudio/Oscillator.idl \
- $(WebCore)/Modules/webaudio/RealtimeAnalyserNode.idl \
- $(WebCore)/Modules/webaudio/WaveTable.idl
-endif
-
if USE_GSTREAMER
webcoregtk_sources += \
Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp \
@@ -5933,23 +5970,6 @@ webcoregtk_sources += \
Source/WebCore/platform/graphics/gstreamer/GStreamerVersioning.h
endif
-# ----
-# Web Sockets Support
-# ----
-if ENABLE_WEB_SOCKETS
-webcore_built_sources += \
- DerivedSources/WebCore/JSCloseEvent.cpp \
- DerivedSources/WebCore/JSCloseEvent.h \
- DerivedSources/WebCore/JSWebSocket.cpp \
- DerivedSources/WebCore/JSWebSocket.h
-
-dom_binding_idls += \
- $(WebCore)/Modules/websockets/CloseEvent.idl \
- $(WebCore)/Modules/websockets/DOMWindowWebSocket.idl \
- $(WebCore)/Modules/websockets/WebSocket.idl \
- $(WebCore)/Modules/websockets/WorkerContextWebSocket.idl
-endif # END ENABLE_WEB_SOCKETS
-
# ---
# 3D canvas (WebGL) support
# ---
@@ -6096,76 +6116,8 @@ webcore_sources += \
Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.cpp \
Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.h \
Source/ThirdParty/ANGLE/src/compiler/VariableInfo.cpp \
- Source/ThirdParty/ANGLE/src/compiler/VariableInfo.h \
- Source/WebCore/html/canvas/WebGLActiveInfo.h \
- Source/WebCore/html/canvas/WebGLBuffer.cpp \
- Source/WebCore/html/canvas/WebGLBuffer.h \
- Source/WebCore/html/canvas/WebGLCompressedTextureS3TC.cpp \
- Source/WebCore/html/canvas/WebGLCompressedTextureS3TC.h \
- Source/WebCore/html/canvas/WebGLContextAttributes.cpp \
- Source/WebCore/html/canvas/WebGLContextAttributes.h \
- Source/WebCore/html/canvas/WebGLContextEvent.cpp \
- Source/WebCore/html/canvas/WebGLContextEvent.h \
- Source/WebCore/html/canvas/WebGLContextGroup.cpp \
- Source/WebCore/html/canvas/WebGLContextGroup.h \
- Source/WebCore/html/canvas/WebGLContextObject.cpp \
- Source/WebCore/html/canvas/WebGLContextObject.h \
- Source/WebCore/html/canvas/WebGLDebugRendererInfo.cpp \
- Source/WebCore/html/canvas/WebGLDebugRendererInfo.h \
- Source/WebCore/html/canvas/WebGLDebugShaders.cpp \
- Source/WebCore/html/canvas/WebGLDebugShaders.h \
- Source/WebCore/html/canvas/WebGLDepthTexture.cpp \
- Source/WebCore/html/canvas/WebGLDepthTexture.h \
- Source/WebCore/html/canvas/WebGLFramebuffer.cpp \
- Source/WebCore/html/canvas/WebGLFramebuffer.h \
- Source/WebCore/html/canvas/WebGLGetInfo.cpp \
- Source/WebCore/html/canvas/WebGLGetInfo.h \
- Source/WebCore/html/canvas/WebGLLoseContext.cpp \
- Source/WebCore/html/canvas/WebGLLoseContext.h \
- Source/WebCore/html/canvas/WebGLObject.cpp \
- Source/WebCore/html/canvas/WebGLObject.h \
- Source/WebCore/html/canvas/WebGLProgram.cpp \
- Source/WebCore/html/canvas/WebGLProgram.h \
- Source/WebCore/html/canvas/WebGLRenderbuffer.cpp \
- Source/WebCore/html/canvas/WebGLRenderbuffer.h \
- Source/WebCore/html/canvas/WebGLRenderingContext.cpp \
- Source/WebCore/html/canvas/WebGLRenderingContext.h \
- Source/WebCore/html/canvas/WebGLShader.cpp \
- Source/WebCore/html/canvas/WebGLShader.h \
- Source/WebCore/html/canvas/WebGLShaderPrecisionFormat.cpp \
- Source/WebCore/html/canvas/WebGLShaderPrecisionFormat.h \
- Source/WebCore/html/canvas/WebGLSharedObject.cpp \
- Source/WebCore/html/canvas/WebGLSharedObject.h \
- Source/WebCore/html/canvas/WebGLTexture.cpp \
- Source/WebCore/html/canvas/WebGLTexture.h \
- Source/WebCore/html/canvas/WebGLUniformLocation.cpp \
- Source/WebCore/html/canvas/WebGLUniformLocation.h \
- Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.cpp \
- Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.h \
- Source/WebCore/html/canvas/WebGLExtension.cpp \
- Source/WebCore/html/canvas/WebGLExtension.h \
- Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.cpp \
- Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.h \
- Source/WebCore/html/canvas/OESStandardDerivatives.cpp \
- Source/WebCore/html/canvas/OESStandardDerivatives.h \
- Source/WebCore/html/canvas/OESTextureFloat.cpp \
- Source/WebCore/html/canvas/OESTextureFloat.h \
- Source/WebCore/html/canvas/OESVertexArrayObject.cpp \
- Source/WebCore/html/canvas/OESVertexArrayObject.h \
- Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp \
- Source/WebCore/platform/graphics/ANGLEWebKitBridge.h \
- Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp \
- Source/WebCore/platform/graphics/gpu/DrawingBuffer.h \
- Source/WebCore/platform/graphics/GraphicsContext3D.cpp \
- Source/WebCore/platform/graphics/GraphicsContext3D.h \
- Source/WebCore/platform/graphics/OpenGLShims.cpp \
- Source/WebCore/platform/graphics/OpenGLShims.h \
- Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp \
- Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h \
- Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp \
- Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.h \
- Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp \
- Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
+ Source/ThirdParty/ANGLE/src/compiler/VariableInfo.h
+
if USE_CLUTTER
webcore_sources += \
Source/WebCore/platform/graphics/clutter/DrawingBufferClutter.cpp \
@@ -6183,35 +6135,6 @@ endif # END USE_CLUTTER
endif # END ENABLE_WEBGL
# ---
-# MHTML support
-# ---
-if ENABLE_MHTML
-webcore_sources += \
- Source/WebCore/loader/archive/mhtml/MHTMLArchive.cpp \
- Source/WebCore/loader/archive/mhtml/MHTMLArchive.h \
- Source/WebCore/loader/archive/mhtml/MHTMLParser.cpp \
- Source/WebCore/loader/archive/mhtml/MHTMLParser.h
-endif # END ENABLE_MHTML
-
-# ---
-# RequestAnimationFrame support
-# ---
-if ENABLE_REQUEST_ANIMATION_FRAME
-webcore_built_sources += \
- DerivedSources/WebCore/JSRequestAnimationFrameCallback.cpp \
- DerivedSources/WebCore/JSRequestAnimationFrameCallback.h
-
-dom_binding_idls += \
- $(WebCore)/dom/RequestAnimationFrameCallback.idl
-
-webcore_sources += \
- Source/WebCore/bindings/js/JSRequestAnimationFrameCallbackCustom.cpp \
- Source/WebCore/dom/RequestAnimationFrameCallback.h \
- Source/WebCore/dom/ScriptedAnimationController.cpp \
- Source/WebCore/dom/ScriptedAnimationController.h
-endif # END ENABLE_REQUEST_ANIMATION_FRAME
-
-# ---
# Accelerated compositing support
# ---
if USE_ACCELERATED_COMPOSITING
@@ -6267,60 +6190,3 @@ webcore_sources += \
Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h
endif # END USE_TEXTURE_MAPPER_GL
endif # USE_ACCELERATED_COMPOSITING
-
-# ---
-# Shadow DOM support
-# ---
-if ENABLE_SHADOW_DOM
-webcore_sources += \
- Source/WebCore/html/shadow/HTMLShadowElement.cpp \
- Source/WebCore/html/shadow/HTMLShadowElement.h
-webcore_built_sources += \
- DerivedSources/WebCore/JSHTMLShadowElement.cpp \
- DerivedSources/WebCore/JSHTMLShadowElement.h
-dom_binding_idls += \
- $(WebCore)/html/shadow/HTMLShadowElement.idl
-
-endif # END ENABLE_SHADOW_DOM
-
-# ----
-# Quota support
-# ----
-if ENABLE_QUOTA
-webcore_sources += \
- Source/WebCore/Modules/quota/DOMWindowQuota.cpp \
- Source/WebCore/Modules/quota/DOMWindowQuota.h \
- Source/WebCore/Modules/quota/StorageInfo.cpp \
- Source/WebCore/Modules/quota/StorageInfo.h \
- Source/WebCore/Modules/quota/StorageInfoErrorCallback.h \
- Source/WebCore/Modules/quota/StorageInfoQuotaCallback.h \
- Source/WebCore/Modules/quota/StorageInfoUsageCallback.h
-
-webcore_built_sources += \
- DerivedSources/WebCore/JSStorageInfo.cpp \
- DerivedSources/WebCore/JSStorageInfo.h \
- DerivedSources/WebCore/JSStorageInfoErrorCallback.cpp \
- DerivedSources/WebCore/JSStorageInfoErrorCallback.h \
- DerivedSources/WebCore/JSStorageInfoQuotaCallback.cpp \
- DerivedSources/WebCore/JSStorageInfoQuotaCallback.h \
- DerivedSources/WebCore/JSStorageInfoUsageCallback.cpp \
- DerivedSources/WebCore/JSStorageInfoUsageCallback.h
-
-dom_binding_idls += \
- $(WebCore)/Modules/quota/DOMWindowQuota.idl \
- $(WebCore)/Modules/quota/StorageInfo.idl \
- $(WebCore)/Modules/quota/StorageInfoErrorCallback.idl \
- $(WebCore)/Modules/quota/StorageInfoQuotaCallback.idl \
- $(WebCore)/Modules/quota/StorageInfoUsageCallback.idl
-
-endif # END ENABLE_QUOTA
-
-# ----
-# Spell check support
-# ----
-if ENABLE_SPELLCHECK
-webcore_sources += \
- Source/WebCore/platform/text/gtk/TextCheckerEnchant.h \
- Source/WebCore/platform/text/gtk/TextCheckerEnchant.cpp
-endif # END ENABLE_SPELLCHECK
-
diff --git a/Source/WebCore/Modules/filesystem/DOMFileSystem.cpp b/Source/WebCore/Modules/filesystem/DOMFileSystem.cpp
index 50b51859d..4e8ed4b41 100644
--- a/Source/WebCore/Modules/filesystem/DOMFileSystem.cpp
+++ b/Source/WebCore/Modules/filesystem/DOMFileSystem.cpp
@@ -150,9 +150,9 @@ namespace {
class GetMetadataCallback : public FileSystemCallbacksBase {
public:
- static PassOwnPtr<GetMetadataCallback> create(PassRefPtr<DOMFileSystem> filesystem, const String& name, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+ static PassOwnPtr<GetMetadataCallback> create(PassRefPtr<DOMFileSystem> filesystem, const String& name, const KURL& url, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
{
- return adoptPtr(new GetMetadataCallback(filesystem, name, successCallback, errorCallback));
+ return adoptPtr(new GetMetadataCallback(filesystem, name, url, successCallback, errorCallback));
}
virtual void didReadMetadata(const FileMetadata& metadata)
@@ -163,25 +163,34 @@ public:
// For regular filesystem types (temporary or persistent), we should not cache file metadata as it could change File semantics.
// For other filesystem types (which could be platform-specific ones), there's a chance that the files are on remote filesystem. If the port has returned metadata just pass it to File constructor (so we may cache the metadata).
- if (m_filesystem->type() == FileSystemTypeTemporary || m_filesystem->type() == FileSystemTypePersistent)
+ // FIXME: We should use the snapshot metadata for all files.
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=17746
+ if (m_filesystem->type() == FileSystemTypeTemporary || m_filesystem->type() == FileSystemTypePersistent) {
m_successCallback->handleEvent(File::createWithName(metadata.platformPath, m_name).get());
- else
+ } else if (!metadata.platformPath.isEmpty()) {
+ // If the platformPath in the returned metadata is given, we create a File object for the path.
m_successCallback->handleEvent(File::createForFileSystemFile(m_name, metadata).get());
+ } else {
+ // Otherwise create a File from the FileSystem URL.
+ m_successCallback->handleEvent(File::createForFileSystemFile(m_url, metadata).get());
+ }
m_successCallback.release();
}
private:
- GetMetadataCallback(PassRefPtr<DOMFileSystem> filesystem, const String& name, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+ GetMetadataCallback(PassRefPtr<DOMFileSystem> filesystem, const String& name, const KURL& url, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
: FileSystemCallbacksBase(errorCallback)
, m_filesystem(filesystem)
, m_name(name)
+ , m_url(url)
, m_successCallback(successCallback)
{
}
RefPtr<DOMFileSystem> m_filesystem;
String m_name;
+ KURL m_url;
RefPtr<FileCallback> m_successCallback;
};
@@ -189,7 +198,8 @@ private:
void DOMFileSystem::createFile(const FileEntry* fileEntry, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
{
- m_asyncFileSystem->createSnapshotFileAndReadMetadata(createFileSystemURL(fileEntry), GetMetadataCallback::create(this, fileEntry->name(), successCallback, errorCallback));
+ KURL fileSystemURL = createFileSystemURL(fileEntry);
+ m_asyncFileSystem->createSnapshotFileAndReadMetadata(fileSystemURL, GetMetadataCallback::create(this, fileEntry->name(), fileSystemURL, successCallback, errorCallback));
}
} // namespace WebCore
diff --git a/Source/WebCore/Modules/filesystem/DOMFileSystemBase.cpp b/Source/WebCore/Modules/filesystem/DOMFileSystemBase.cpp
index d938b8025..a6ee64255 100644
--- a/Source/WebCore/Modules/filesystem/DOMFileSystemBase.cpp
+++ b/Source/WebCore/Modules/filesystem/DOMFileSystemBase.cpp
@@ -222,29 +222,29 @@ bool DOMFileSystemBase::getParent(const EntryBase* entry, PassRefPtr<EntryCallba
return true;
}
-bool DOMFileSystemBase::getFile(const EntryBase* entry, const String& path, PassRefPtr<WebKitFlags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+bool DOMFileSystemBase::getFile(const EntryBase* entry, const String& path, const FileSystemFlags& flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
{
String absolutePath;
if (!pathToAbsolutePath(m_type, entry, path, absolutePath))
return false;
OwnPtr<EntryCallbacks> callbacks = EntryCallbacks::create(successCallback, errorCallback, this, absolutePath, false);
- if (flags && flags->isCreate())
- m_asyncFileSystem->createFile(createFileSystemURL(absolutePath), flags->isExclusive(), callbacks.release());
+ if (flags.create)
+ m_asyncFileSystem->createFile(createFileSystemURL(absolutePath), flags.exclusive, callbacks.release());
else
m_asyncFileSystem->fileExists(createFileSystemURL(absolutePath), callbacks.release());
return true;
}
-bool DOMFileSystemBase::getDirectory(const EntryBase* entry, const String& path, PassRefPtr<WebKitFlags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+bool DOMFileSystemBase::getDirectory(const EntryBase* entry, const String& path, const FileSystemFlags& flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
{
String absolutePath;
if (!pathToAbsolutePath(m_type, entry, path, absolutePath))
return false;
OwnPtr<EntryCallbacks> callbacks = EntryCallbacks::create(successCallback, errorCallback, this, absolutePath, true);
- if (flags && flags->isCreate())
- m_asyncFileSystem->createDirectory(createFileSystemURL(absolutePath), flags->isExclusive(), callbacks.release());
+ if (flags.create)
+ m_asyncFileSystem->createDirectory(createFileSystemURL(absolutePath), flags.exclusive, callbacks.release());
else
m_asyncFileSystem->directoryExists(createFileSystemURL(absolutePath), callbacks.release());
return true;
diff --git a/Source/WebCore/Modules/filesystem/DOMFileSystemBase.h b/Source/WebCore/Modules/filesystem/DOMFileSystemBase.h
index a37cab04b..ae38278b1 100644
--- a/Source/WebCore/Modules/filesystem/DOMFileSystemBase.h
+++ b/Source/WebCore/Modules/filesystem/DOMFileSystemBase.h
@@ -34,10 +34,10 @@
#if ENABLE(FILE_SYSTEM)
#include "AsyncFileSystem.h"
+#include "FileSystemFlags.h"
#include "FileSystemType.h"
#include "KURL.h"
#include "PlatformString.h"
-#include "WebKitFlags.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -98,8 +98,8 @@ public:
bool remove(const EntryBase*, PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>);
bool removeRecursively(const EntryBase*, PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>);
bool getParent(const EntryBase*, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
- bool getFile(const EntryBase*, const String& path, PassRefPtr<WebKitFlags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
- bool getDirectory(const EntryBase*, const String& path, PassRefPtr<WebKitFlags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
+ bool getFile(const EntryBase*, const String& path, const FileSystemFlags&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
+ bool getDirectory(const EntryBase*, const String& path, const FileSystemFlags&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
bool readDirectory(PassRefPtr<DirectoryReaderBase>, const String& path, PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>);
protected:
diff --git a/Source/WebCore/Modules/filesystem/DOMFileSystemSync.cpp b/Source/WebCore/Modules/filesystem/DOMFileSystemSync.cpp
index bc36caedd..dad432f24 100644
--- a/Source/WebCore/Modules/filesystem/DOMFileSystemSync.cpp
+++ b/Source/WebCore/Modules/filesystem/DOMFileSystemSync.cpp
@@ -98,9 +98,9 @@ public:
friend class WTF::RefCounted<CreateFileResult>;
};
- static PassOwnPtr<CreateFileHelper> create(PassRefPtr<CreateFileResult> result, const String& name, FileSystemType type)
+ static PassOwnPtr<CreateFileHelper> create(PassRefPtr<CreateFileResult> result, const String& name, const KURL& url, FileSystemType type)
{
- return adoptPtr(new CreateFileHelper(result, name, type));
+ return adoptPtr(new CreateFileHelper(result, name, url, type));
}
virtual void didFail(int code)
@@ -117,21 +117,30 @@ public:
{
// For regular filesystem types (temporary or persistent), we should not cache file metadata as it could change File semantics.
// For other filesystem types (which could be platform-specific ones), there's a chance that the files are on remote filesystem. If the port has returned metadata just pass it to File constructor (so we may cache the metadata).
- if (m_type == FileSystemTypeTemporary || m_type == FileSystemTypePersistent)
+ // FIXME: We should use the snapshot metadata for all files.
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=17746
+ if (m_type == FileSystemTypeTemporary || m_type == FileSystemTypePersistent) {
m_result->m_file = File::createWithName(metadata.platformPath, m_name);
- else
- m_result->m_file = File::createForFileSystemFile(m_name, metadata);
+ } else if (!metadata.platformPath.isEmpty()) {
+ // If the platformPath in the returned metadata is given, we create a File object for the path.
+ m_result->m_file = File::createForFileSystemFile(m_name, metadata).get();
+ } else {
+ // Otherwise create a File from the FileSystem URL.
+ m_result->m_file = File::createForFileSystemFile(m_url, metadata).get();
+ }
}
private:
- CreateFileHelper(PassRefPtr<CreateFileResult> result, const String& name, FileSystemType type)
+ CreateFileHelper(PassRefPtr<CreateFileResult> result, const String& name, const KURL& url, FileSystemType type)
: m_result(result)
, m_name(name)
+ , m_url(url)
, m_type(type)
{
}
RefPtr<CreateFileResult> m_result;
String m_name;
+ KURL m_url;
FileSystemType m_type;
};
@@ -140,8 +149,9 @@ private:
PassRefPtr<File> DOMFileSystemSync::createFile(const FileEntrySync* fileEntry, ExceptionCode& ec)
{
ec = 0;
+ KURL fileSystemURL = createFileSystemURL(fileEntry);
RefPtr<CreateFileHelper::CreateFileResult> result(CreateFileHelper::CreateFileResult::create());
- m_asyncFileSystem->createSnapshotFileAndReadMetadata(createFileSystemURL(fileEntry), CreateFileHelper::create(result, fileEntry->name(), type()));
+ m_asyncFileSystem->createSnapshotFileAndReadMetadata(fileSystemURL, CreateFileHelper::create(result, fileEntry->name(), fileSystemURL, type()));
if (!m_asyncFileSystem->waitForOperationToComplete()) {
ec = FileException::ABORT_ERR;
return 0;
diff --git a/Source/WebCore/Modules/filesystem/DirectoryEntry.cpp b/Source/WebCore/Modules/filesystem/DirectoryEntry.cpp
index 0f6e49f44..cd90e1f45 100644
--- a/Source/WebCore/Modules/filesystem/DirectoryEntry.cpp
+++ b/Source/WebCore/Modules/filesystem/DirectoryEntry.cpp
@@ -51,15 +51,17 @@ PassRefPtr<DirectoryReader> DirectoryEntry::createReader()
return DirectoryReader::create(m_fileSystem, m_fullPath);
}
-void DirectoryEntry::getFile(const String& path, PassRefPtr<WebKitFlags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef)
+void DirectoryEntry::getFile(const String& path, const Dictionary& options, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef)
{
+ FileSystemFlags flags(options);
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->getFile(this, path, flags, successCallback, errorCallback))
filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
}
-void DirectoryEntry::getDirectory(const String& path, PassRefPtr<WebKitFlags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef)
+void DirectoryEntry::getDirectory(const String& path, const Dictionary& options, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef)
{
+ FileSystemFlags flags(options);
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->getDirectory(this, path, flags, successCallback, errorCallback))
filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
diff --git a/Source/WebCore/Modules/filesystem/DirectoryEntry.h b/Source/WebCore/Modules/filesystem/DirectoryEntry.h
index b27411a86..62d99e395 100644
--- a/Source/WebCore/Modules/filesystem/DirectoryEntry.h
+++ b/Source/WebCore/Modules/filesystem/DirectoryEntry.h
@@ -34,8 +34,8 @@
#if ENABLE(FILE_SYSTEM)
#include "Entry.h"
+#include "FileSystemFlags.h"
#include "PlatformString.h"
-#include "WebKitFlags.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -56,8 +56,8 @@ public:
virtual bool isDirectory() const { return true; }
PassRefPtr<DirectoryReader> createReader();
- void getFile(const String& path, PassRefPtr<WebKitFlags> = 0, PassRefPtr<EntryCallback> = 0, PassRefPtr<ErrorCallback> = 0);
- void getDirectory(const String& path, PassRefPtr<WebKitFlags> = 0, PassRefPtr<EntryCallback> = 0, PassRefPtr<ErrorCallback> = 0);
+ void getFile(const String& path, const Dictionary& = Dictionary(), PassRefPtr<EntryCallback> = 0, PassRefPtr<ErrorCallback> = 0);
+ void getDirectory(const String& path, const Dictionary& = Dictionary(), PassRefPtr<EntryCallback> = 0, PassRefPtr<ErrorCallback> = 0);
void removeRecursively(PassRefPtr<VoidCallback> successCallback = 0, PassRefPtr<ErrorCallback> = 0) const;
private:
diff --git a/Source/WebCore/Modules/filesystem/DirectoryEntry.idl b/Source/WebCore/Modules/filesystem/DirectoryEntry.idl
index c6c9ae9bb..b4737b41d 100644
--- a/Source/WebCore/Modules/filesystem/DirectoryEntry.idl
+++ b/Source/WebCore/Modules/filesystem/DirectoryEntry.idl
@@ -36,8 +36,8 @@ module storage {
JSNoStaticTables
] DirectoryEntry : Entry {
DirectoryReader createReader();
- [Custom] void getFile(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in [Optional] WebKitFlags flags, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
- [Custom] void getDirectory(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in [Optional] WebKitFlags flags, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+ void getFile(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in [Optional] Dictionary options, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+ void getDirectory(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in [Optional] Dictionary options, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
void removeRecursively(in [Callback] VoidCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
};
}
diff --git a/Source/WebCore/Modules/filesystem/DirectoryEntrySync.cpp b/Source/WebCore/Modules/filesystem/DirectoryEntrySync.cpp
index 10deaceb0..0960eed36 100644
--- a/Source/WebCore/Modules/filesystem/DirectoryEntrySync.cpp
+++ b/Source/WebCore/Modules/filesystem/DirectoryEntrySync.cpp
@@ -51,9 +51,10 @@ PassRefPtr<DirectoryReaderSync> DirectoryEntrySync::createReader(ExceptionCode&)
return DirectoryReaderSync::create(m_fileSystem, m_fullPath);
}
-PassRefPtr<FileEntrySync> DirectoryEntrySync::getFile(const String& path, PassRefPtr<WebKitFlags> flags, ExceptionCode& ec)
+PassRefPtr<FileEntrySync> DirectoryEntrySync::getFile(const String& path, const Dictionary& options, ExceptionCode& ec)
{
ec = 0;
+ FileSystemFlags flags(options);
EntrySyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->getFile(this, path, flags, helper.successCallback(), helper.errorCallback())) {
ec = FileException::INVALID_MODIFICATION_ERR;
@@ -62,9 +63,10 @@ PassRefPtr<FileEntrySync> DirectoryEntrySync::getFile(const String& path, PassRe
return static_pointer_cast<FileEntrySync>(helper.getResult(ec));
}
-PassRefPtr<DirectoryEntrySync> DirectoryEntrySync::getDirectory(const String& path, PassRefPtr<WebKitFlags> flags, ExceptionCode& ec)
+PassRefPtr<DirectoryEntrySync> DirectoryEntrySync::getDirectory(const String& path, const Dictionary& options, ExceptionCode& ec)
{
ec = 0;
+ FileSystemFlags flags(options);
EntrySyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->getDirectory(this, path, flags, helper.successCallback(), helper.errorCallback())) {
ec = FileException::INVALID_MODIFICATION_ERR;
diff --git a/Source/WebCore/Modules/filesystem/DirectoryEntrySync.h b/Source/WebCore/Modules/filesystem/DirectoryEntrySync.h
index b9f7a85cc..6989b2770 100644
--- a/Source/WebCore/Modules/filesystem/DirectoryEntrySync.h
+++ b/Source/WebCore/Modules/filesystem/DirectoryEntrySync.h
@@ -34,8 +34,8 @@
#if ENABLE(FILE_SYSTEM)
#include "EntrySync.h"
+#include "FileSystemFlags.h"
#include "PlatformString.h"
-#include "WebKitFlags.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -53,8 +53,8 @@ public:
virtual bool isDirectory() const { return true; }
PassRefPtr<DirectoryReaderSync> createReader(ExceptionCode&);
- PassRefPtr<FileEntrySync> getFile(const String& path, PassRefPtr<WebKitFlags>, ExceptionCode&);
- PassRefPtr<DirectoryEntrySync> getDirectory(const String& path, PassRefPtr<WebKitFlags>, ExceptionCode&);
+ PassRefPtr<FileEntrySync> getFile(const String& path, const Dictionary&, ExceptionCode&);
+ PassRefPtr<DirectoryEntrySync> getDirectory(const String& path, const Dictionary&, ExceptionCode&);
void removeRecursively(ExceptionCode&);
private:
diff --git a/Source/WebCore/Modules/filesystem/DirectoryEntrySync.idl b/Source/WebCore/Modules/filesystem/DirectoryEntrySync.idl
index 66c288fbb..13c3aab5f 100644
--- a/Source/WebCore/Modules/filesystem/DirectoryEntrySync.idl
+++ b/Source/WebCore/Modules/filesystem/DirectoryEntrySync.idl
@@ -36,8 +36,8 @@ module storage {
JSNoStaticTables
] DirectoryEntrySync : EntrySync {
DirectoryReaderSync createReader() raises (FileException);
- [Custom] FileEntrySync getFile(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in WebKitFlags flags) raises (FileException);
- [Custom] DirectoryEntrySync getDirectory(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in WebKitFlags flags) raises (FileException);
+ FileEntrySync getFile(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in Dictionary flags) raises (FileException);
+ DirectoryEntrySync getDirectory(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in Dictionary flags) raises (FileException);
void removeRecursively() raises (FileException);
};
}
diff --git a/Source/WebCore/Modules/filesystem/FileSystemCallbacks.cpp b/Source/WebCore/Modules/filesystem/FileSystemCallbacks.cpp
index ab0834b12..9d81a2246 100644
--- a/Source/WebCore/Modules/filesystem/FileSystemCallbacks.cpp
+++ b/Source/WebCore/Modules/filesystem/FileSystemCallbacks.cpp
@@ -173,7 +173,7 @@ public:
{
ASSERT(error);
if (error->code() == FileError::TYPE_MISMATCH_ERR)
- m_root->getFile(m_filePath, 0, m_successCallback, m_errorCallback);
+ m_root->getFile(m_filePath, Dictionary(), m_successCallback, m_errorCallback);
else if (m_errorCallback)
m_errorCallback->handleEvent(error);
return true;
@@ -215,7 +215,7 @@ void ResolveURICallbacks::didOpenFileSystem(const String& name, const KURL& root
{
ASSERT(asyncFileSystem);
RefPtr<DirectoryEntry> root = DOMFileSystem::create(m_scriptExecutionContext.get(), name, m_type, rootURL, asyncFileSystem)->root();
- root->getDirectory(m_filePath, 0, m_successCallback, ErrorCallbackWrapper::create(m_successCallback, m_errorCallback, root, m_filePath));
+ root->getDirectory(m_filePath, Dictionary(), m_successCallback, ErrorCallbackWrapper::create(m_successCallback, m_errorCallback, root, m_filePath));
}
// MetadataCallbacks ----------------------------------------------------------
diff --git a/Source/WebCore/Modules/filesystem/WebKitFlags.h b/Source/WebCore/Modules/filesystem/FileSystemFlags.h
index a75b47230..6316c7499 100644
--- a/Source/WebCore/Modules/filesystem/WebKitFlags.h
+++ b/Source/WebCore/Modules/filesystem/FileSystemFlags.h
@@ -28,40 +28,30 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebKitFlags_h
-#define WebKitFlags_h
+#ifndef FileSystemFlags_h
+#define FileSystemFlags_h
#if ENABLE(FILE_SYSTEM)
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
+#include "Dictionary.h"
namespace WebCore {
-class WebKitFlags : public RefCounted<WebKitFlags> {
-public:
- static PassRefPtr<WebKitFlags> create(bool create = false, bool exclusive = false)
+struct FileSystemFlags {
+ explicit FileSystemFlags(const Dictionary& options)
+ : create(false)
+ , exclusive(false)
{
- return adoptRef(new WebKitFlags(create, exclusive));
+ options.get("create", create);
+ options.get("exclusive", exclusive);
}
- bool isCreate() const { return m_create; }
- void setCreate(bool create) { m_create = create; }
- bool isExclusive() const { return m_exclusive; }
- void setExclusive(bool exclusive) { m_exclusive = exclusive; }
-
-private:
- WebKitFlags(bool create, bool exclusive)
- : m_create(create)
- , m_exclusive(exclusive)
- {
- }
- bool m_create;
- bool m_exclusive;
+ bool create;
+ bool exclusive;
};
-} // namespace
+}
#endif // ENABLE(FILE_SYSTEM)
-#endif // WebKitFlags_h
+#endif // FileSystemFlags_h
diff --git a/Source/WebCore/Modules/filesystem/FileWriter.cpp b/Source/WebCore/Modules/filesystem/FileWriter.cpp
index ecb4475d0..52bcba753 100644
--- a/Source/WebCore/Modules/filesystem/FileWriter.cpp
+++ b/Source/WebCore/Modules/filesystem/FileWriter.cpp
@@ -188,7 +188,7 @@ void FileWriter::didWrite(long long bytes, bool complete)
ASSERT(m_readyState == WRITING);
ASSERT(m_truncateLength == -1);
ASSERT(m_operationInProgress == OperationWrite);
- ASSERT(bytes + m_bytesWritten > 0);
+ ASSERT(!m_bytesToWrite || bytes + m_bytesWritten > 0);
ASSERT(bytes + m_bytesWritten <= m_bytesToWrite);
m_bytesWritten += bytes;
ASSERT((m_bytesWritten == m_bytesToWrite) || !complete);
diff --git a/Source/WebCore/Modules/filesystem/SyncCallbackHelper.h b/Source/WebCore/Modules/filesystem/SyncCallbackHelper.h
index 51ae04d8f..d84691649 100644
--- a/Source/WebCore/Modules/filesystem/SyncCallbackHelper.h
+++ b/Source/WebCore/Modules/filesystem/SyncCallbackHelper.h
@@ -97,9 +97,10 @@ private:
return adoptRef(new SuccessCallbackImpl(helper));
}
- virtual void handleEvent()
+ virtual bool handleEvent()
{
m_helper->setError(0);
+ return true;
}
virtual bool handleEvent(CallbackArg* arg)
diff --git a/Source/WebCore/Modules/filesystem/WorkerContextFileSystem.cpp b/Source/WebCore/Modules/filesystem/WorkerContextFileSystem.cpp
index d62ee3273..6f8e50c41 100644
--- a/Source/WebCore/Modules/filesystem/WorkerContextFileSystem.cpp
+++ b/Source/WebCore/Modules/filesystem/WorkerContextFileSystem.cpp
@@ -127,9 +127,9 @@ PassRefPtr<EntrySync> WorkerContextFileSystem::webkitResolveLocalFileSystemSyncU
if (!fileSystem)
return 0;
- RefPtr<EntrySync> entry = fileSystem->root()->getDirectory(filePath, 0, ec);
+ RefPtr<EntrySync> entry = fileSystem->root()->getDirectory(filePath, Dictionary(), ec);
if (ec == FileException::TYPE_MISMATCH_ERR)
- return fileSystem->root()->getFile(filePath, 0, ec);
+ return fileSystem->root()->getFile(filePath, Dictionary(), ec);
return entry.release();
}
diff --git a/Source/WebCore/Modules/indexeddb/IDBAny.cpp b/Source/WebCore/Modules/indexeddb/IDBAny.cpp
index 30028ccfd..2cd8a094c 100644
--- a/Source/WebCore/Modules/indexeddb/IDBAny.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBAny.cpp
@@ -32,6 +32,7 @@
#include "IDBDatabase.h"
#include "IDBFactory.h"
#include "IDBIndex.h"
+#include "IDBKeyPath.h"
#include "IDBObjectStore.h"
#include "SerializedScriptValue.h"
@@ -207,6 +208,27 @@ void IDBAny::set(PassRefPtr<SerializedScriptValue> value)
m_serializedScriptValue = value;
}
+void IDBAny::set(const IDBKeyPath& value)
+{
+ ASSERT(m_type == UndefinedType);
+ switch (value.type()) {
+ case IDBKeyPath::NullType:
+ m_type = NullType;
+ break;
+ case IDBKeyPath::StringType:
+ m_type = StringType;
+ m_string = value.string();
+ break;
+ case IDBKeyPath::ArrayType:
+ RefPtr<DOMStringList> keyPaths = DOMStringList::create();
+ for (Vector<String>::const_iterator it = value.array().begin(); it != value.array().end(); ++it)
+ keyPaths->append(*it);
+ m_type = DOMStringListType;
+ m_domStringList = keyPaths.release();
+ break;
+ }
+}
+
void IDBAny::set(const String& value)
{
ASSERT(m_type == UndefinedType);
diff --git a/Source/WebCore/Modules/indexeddb/IDBAny.h b/Source/WebCore/Modules/indexeddb/IDBAny.h
index 93eb2401d..8ba77429a 100644
--- a/Source/WebCore/Modules/indexeddb/IDBAny.h
+++ b/Source/WebCore/Modules/indexeddb/IDBAny.h
@@ -42,6 +42,7 @@ class IDBDatabase;
class IDBFactory;
class IDBIndex;
class IDBKey;
+class IDBKeyPath;
class IDBObjectStore;
class IDBTransaction;
class SerializedScriptValue;
@@ -58,6 +59,12 @@ public:
any->set(idbObject);
return any.release();
}
+ static PassRefPtr<IDBAny> create(const IDBKeyPath& keyPath)
+ {
+ RefPtr<IDBAny> any = IDBAny::createInvalid();
+ any->set(keyPath);
+ return any.release();
+ }
template<typename T>
static PassRefPtr<IDBAny> create(PassRefPtr<T> idbObject)
{
@@ -109,6 +116,7 @@ public:
void set(PassRefPtr<IDBObjectStore>);
void set(PassRefPtr<IDBTransaction>);
void set(PassRefPtr<SerializedScriptValue>);
+ void set(const IDBKeyPath&);
void set(const String&);
private:
diff --git a/Source/WebCore/Modules/indexeddb/IDBCallbacks.h b/Source/WebCore/Modules/indexeddb/IDBCallbacks.h
index 8e85c4201..a79483e9b 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCallbacks.h
+++ b/Source/WebCore/Modules/indexeddb/IDBCallbacks.h
@@ -50,14 +50,23 @@ public:
virtual ~IDBCallbacks() { }
virtual void onError(PassRefPtr<IDBDatabaseError>) = 0;
+ // From IDBFactory.webkitGetDatabaseNames()
virtual void onSuccess(PassRefPtr<DOMStringList>) = 0;
- virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>) = 0;
+ // From IDBObjectStore/IDBIndex.openCursor(), IDBIndex.openKeyCursor()
+ virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue>) = 0;
+ // From IDBFactory.open()
virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>) = 0;
+ // From IDBObjectStore.add()/put(), IDBIndex.getKey()
virtual void onSuccess(PassRefPtr<IDBKey>) = 0;
+ // From IDBDatabase.setVersion()
virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>) = 0;
+ // From IDBObjectStore/IDBIndex.get()/count(), and various methods that yield null/undefined.
virtual void onSuccess(PassRefPtr<SerializedScriptValue>) = 0;
+ // From IDBObjectStore/IDBIndex.get() (with key injection)
virtual void onSuccess(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, const IDBKeyPath&) = 0;
- virtual void onSuccessWithContinuation() = 0;
+ // From IDBCursor.advance()/continue()
+ virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue>) = 0;
+ // From IDBCursor.advance()/continue()
virtual void onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >& keys, const Vector<RefPtr<IDBKey> >& primaryKeys, const Vector<RefPtr<SerializedScriptValue> >& values) = 0;
virtual void onBlocked() { ASSERT_NOT_REACHED(); }
virtual void onBlocked(int64_t existingVersion) { ASSERT_NOT_REACHED(); }
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursor.cpp b/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
index 156e484ec..1539c6287 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
@@ -265,12 +265,12 @@ void IDBCursor::close()
m_request.clear();
}
-void IDBCursor::setValueReady()
+void IDBCursor::setValueReady(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue> prpValue)
{
- m_currentKey = m_backend->key();
- m_currentPrimaryKey = m_backend->primaryKey();
+ m_currentKey = key;
+ m_currentPrimaryKey = primaryKey;
- RefPtr<SerializedScriptValue> value = m_backend->value();
+ RefPtr<SerializedScriptValue> value = prpValue;
if (!isKeyCursor()) {
RefPtr<IDBObjectStore> objectStore = effectiveObjectStore();
const IDBObjectStoreMetadata metadata = objectStore->metadata();
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursor.h b/Source/WebCore/Modules/indexeddb/IDBCursor.h
index fd46cbbca..590828859 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursor.h
+++ b/Source/WebCore/Modules/indexeddb/IDBCursor.h
@@ -82,7 +82,7 @@ public:
void postSuccessHandlerCallback();
void close();
- void setValueReady();
+ void setValueReady(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue>);
// The spec requires that the script object that wraps the value
// be unchanged until the value changes as a result of the cursor
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp
index 9569990cd..8300c0542 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp
@@ -42,8 +42,9 @@
namespace WebCore {
-IDBCursorBackendImpl::IDBCursorBackendImpl(PassRefPtr<IDBBackingStore::Cursor> cursor, CursorType cursorType, IDBTransactionBackendImpl* transaction, IDBObjectStoreBackendImpl* objectStore)
+IDBCursorBackendImpl::IDBCursorBackendImpl(PassRefPtr<IDBBackingStore::Cursor> cursor, CursorType cursorType, IDBTransactionBackendInterface::TaskType taskType, IDBTransactionBackendImpl* transaction, IDBObjectStoreBackendImpl* objectStore)
: m_cursor(cursor)
+ , m_taskType(taskType)
, m_cursorType(cursorType)
, m_transaction(transaction)
, m_objectStore(objectStore)
@@ -62,32 +63,11 @@ IDBCursorBackendImpl::~IDBCursorBackendImpl()
m_objectStore.clear();
}
-PassRefPtr<IDBKey> IDBCursorBackendImpl::key() const
-{
- IDB_TRACE("IDBCursorBackendImpl::key");
- return m_cursor->key();
-}
-
-PassRefPtr<IDBKey> IDBCursorBackendImpl::primaryKey() const
-{
- IDB_TRACE("IDBCursorBackendImpl::primaryKey");
- return m_cursor->primaryKey();
-}
-
-PassRefPtr<SerializedScriptValue> IDBCursorBackendImpl::value() const
-{
- IDB_TRACE("IDBCursorBackendImpl::value");
- if (m_cursorType == IndexKeyCursor)
- return SerializedScriptValue::nullValue();
- return SerializedScriptValue::createFromWire(m_cursor->value());
-}
-
void IDBCursorBackendImpl::continueFunction(PassRefPtr<IDBKey> prpKey, PassRefPtr<IDBCallbacks> prpCallbacks, ExceptionCode& ec)
{
IDB_TRACE("IDBCursorBackendImpl::continue");
- RefPtr<IDBKey> key = prpKey;
- if (!m_transaction->scheduleTask(createCallbackTask(&IDBCursorBackendImpl::continueFunctionInternal, this, key, prpCallbacks)))
+ if (!m_transaction->scheduleTask(m_taskType, createCallbackTask(&IDBCursorBackendImpl::continueFunctionInternal, this, prpKey, prpCallbacks)))
ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
}
@@ -109,7 +89,7 @@ void IDBCursorBackendImpl::advanceInternal(ScriptExecutionContext*, PassRefPtr<I
return;
}
- callbacks->onSuccessWithContinuation();
+ callbacks->onSuccess(cursor->key(), cursor->primaryKey(), cursor->value());
}
void IDBCursorBackendImpl::continueFunctionInternal(ScriptExecutionContext*, PassRefPtr<IDBCursorBackendImpl> prpCursor, PassRefPtr<IDBKey> prpKey, PassRefPtr<IDBCallbacks> callbacks)
@@ -124,7 +104,7 @@ void IDBCursorBackendImpl::continueFunctionInternal(ScriptExecutionContext*, Pas
return;
}
- callbacks->onSuccessWithContinuation();
+ callbacks->onSuccess(cursor->key(), cursor->primaryKey(), cursor->value());
}
void IDBCursorBackendImpl::deleteFunction(PassRefPtr<IDBCallbacks> prpCallbacks, ExceptionCode& ec)
@@ -146,7 +126,7 @@ void IDBCursorBackendImpl::deleteFunction(PassRefPtr<IDBCallbacks> prpCallbacks,
void IDBCursorBackendImpl::prefetchContinue(int numberToFetch, PassRefPtr<IDBCallbacks> prpCallbacks, ExceptionCode& ec)
{
IDB_TRACE("IDBCursorBackendImpl::prefetchContinue");
- if (!m_transaction->scheduleTask(createCallbackTask(&IDBCursorBackendImpl::prefetchContinueInternal, this, numberToFetch, prpCallbacks)))
+ if (!m_transaction->scheduleTask(m_taskType, createCallbackTask(&IDBCursorBackendImpl::prefetchContinueInternal, this, numberToFetch, prpCallbacks)))
ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
}
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.h b/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.h
index 8c9b2e6ed..2b76dd48c 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.h
+++ b/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.h
@@ -49,14 +49,15 @@ class IDBCursorBackendImpl : public IDBCursorBackendInterface {
public:
static PassRefPtr<IDBCursorBackendImpl> create(PassRefPtr<IDBBackingStore::Cursor> cursor, CursorType cursorType, IDBTransactionBackendImpl* transaction, IDBObjectStoreBackendImpl* objectStore)
{
- return adoptRef(new IDBCursorBackendImpl(cursor, cursorType, transaction, objectStore));
+ return adoptRef(new IDBCursorBackendImpl(cursor, cursorType, IDBTransactionBackendInterface::NormalTask, transaction, objectStore));
+ }
+ static PassRefPtr<IDBCursorBackendImpl> create(PassRefPtr<IDBBackingStore::Cursor> cursor, CursorType cursorType, IDBTransactionBackendInterface::TaskType taskType, IDBTransactionBackendImpl* transaction, IDBObjectStoreBackendImpl* objectStore)
+ {
+ return adoptRef(new IDBCursorBackendImpl(cursor, cursorType, taskType, transaction, objectStore));
}
virtual ~IDBCursorBackendImpl();
// IDBCursorBackendInterface
- virtual PassRefPtr<IDBKey> key() const;
- virtual PassRefPtr<IDBKey> primaryKey() const;
- virtual PassRefPtr<SerializedScriptValue> value() const;
virtual void advance(unsigned long, PassRefPtr<IDBCallbacks>, ExceptionCode&);
virtual void continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, ExceptionCode&);
virtual void deleteFunction(PassRefPtr<IDBCallbacks>, ExceptionCode&);
@@ -64,10 +65,13 @@ public:
virtual void prefetchReset(int usedPrefetches, int unusedPrefetches);
virtual void postSuccessHandlerCallback() { ASSERT_NOT_REACHED(); }
+ PassRefPtr<IDBKey> key() const { return m_cursor->key(); }
+ PassRefPtr<IDBKey> primaryKey() const { return m_cursor->primaryKey(); }
+ PassRefPtr<SerializedScriptValue> value() const { return (m_cursorType == IndexKeyCursor) ? SerializedScriptValue::nullValue() : SerializedScriptValue::createFromWire(m_cursor->value()); }
void close();
private:
- IDBCursorBackendImpl(PassRefPtr<IDBBackingStore::Cursor>, CursorType, IDBTransactionBackendImpl*, IDBObjectStoreBackendImpl*);
+ IDBCursorBackendImpl(PassRefPtr<IDBBackingStore::Cursor>, CursorType, IDBTransactionBackendInterface::TaskType, IDBTransactionBackendImpl*, IDBObjectStoreBackendImpl*);
static void advanceInternal(ScriptExecutionContext*, PassRefPtr<IDBCursorBackendImpl>, unsigned long, PassRefPtr<IDBCallbacks>);
static void continueFunctionInternal(ScriptExecutionContext*, PassRefPtr<IDBCursorBackendImpl>, PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>);
@@ -75,6 +79,7 @@ private:
RefPtr<IDBBackingStore::Cursor> m_cursor;
RefPtr<IDBBackingStore::Cursor> m_savedCursor;
+ IDBTransactionBackendInterface::TaskType m_taskType;
CursorType m_cursorType;
RefPtr<IDBTransactionBackendImpl> m_transaction;
RefPtr<IDBObjectStoreBackendImpl> m_objectStore;
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursorBackendInterface.h b/Source/WebCore/Modules/indexeddb/IDBCursorBackendInterface.h
index 1df28456a..9b2d57b30 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursorBackendInterface.h
+++ b/Source/WebCore/Modules/indexeddb/IDBCursorBackendInterface.h
@@ -53,10 +53,6 @@ public:
ObjectStoreCursor
};
- virtual PassRefPtr<IDBKey> key() const = 0;
- virtual PassRefPtr<IDBKey> primaryKey() const = 0;
- virtual PassRefPtr<SerializedScriptValue> value() const = 0;
-
virtual void advance(unsigned long count, PassRefPtr<IDBCallbacks>, ExceptionCode&) = 0;
virtual void continueFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>, ExceptionCode&) = 0;
virtual void deleteFunction(PassRefPtr<IDBCallbacks>, ExceptionCode&) = 0;
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp b/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
index 5c3dfcb6b..dab74ed0e 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
@@ -41,8 +41,10 @@
#include "IDBObjectStore.h"
#include "IDBTracing.h"
#include "IDBTransaction.h"
+#include "IDBUpgradeNeededEvent.h"
#include "IDBVersionChangeEvent.h"
#include "IDBVersionChangeRequest.h"
+#include "ScriptCallStack.h"
#include "ScriptExecutionContext.h"
#include <limits>
@@ -208,6 +210,7 @@ PassRefPtr<IDBVersionChangeRequest> IDBDatabase::setVersion(ScriptExecutionConte
}
RefPtr<IDBVersionChangeRequest> request = IDBVersionChangeRequest::create(context, IDBAny::create(this), version);
+ ASSERT(m_backend);
m_backend->setVersion(version, request, m_databaseCallbacks, ec);
return request;
}
@@ -301,6 +304,17 @@ void IDBDatabase::closeConnection()
}
}
+void IDBDatabase::onVersionChange(int64_t oldVersion, int64_t newVersion)
+{
+ if (m_contextStopped || !scriptExecutionContext())
+ return;
+
+ if (m_closePending)
+ return;
+
+ enqueueEvent(IDBUpgradeNeededEvent::create(oldVersion, newVersion, eventNames().versionchangeEvent));
+}
+
void IDBDatabase::onVersionChange(const String& version)
{
if (m_contextStopped || !scriptExecutionContext())
@@ -314,6 +328,7 @@ void IDBDatabase::onVersionChange(const String& version)
void IDBDatabase::registerFrontendCallbacks()
{
+ ASSERT(m_backend);
m_backend->registerFrontendCallbacks(m_databaseCallbacks);
}
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.h b/Source/WebCore/Modules/indexeddb/IDBDatabase.h
index 64cbb326a..a7d72ce19 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.h
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.h
@@ -78,6 +78,7 @@ public:
DEFINE_ATTRIBUTE_EVENT_LISTENER(versionchange);
// IDBDatabaseCallbacks
+ virtual void onVersionChange(int64_t oldVersion, int64_t newVersion);
virtual void onVersionChange(const String& requestedVersion);
// ActiveDOMObject
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
index a31251c8d..05b257dff 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
@@ -267,6 +267,8 @@ void IDBDatabaseBackendImpl::setVersion(const String& version, PassRefPtr<IDBCal
if (!transaction->scheduleTask(
createCallbackTask(&IDBDatabaseBackendImpl::setVersionInternal, database, version, callbacks, transaction),
createCallbackTask(&IDBDatabaseBackendImpl::resetVersion, database, m_version))) {
+ // FIXME: Remove one of the following lines.
+ ASSERT_NOT_REACHED();
ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
}
}
@@ -444,10 +446,6 @@ void IDBDatabaseBackendImpl::openConnection(PassRefPtr<IDBCallbacks> callbacks)
void IDBDatabaseBackendImpl::runIntVersionChangeTransaction(int64_t requestedVersion, PassRefPtr<IDBCallbacks> prpCallbacks)
{
- // FIXME: This function won't be reached until it's exposed to script in
- // wbk.ug/92897.
- ASSERT_NOT_REACHED();
-
RefPtr<IDBCallbacks> callbacks = prpCallbacks;
ASSERT(callbacks);
for (DatabaseCallbacksSet::const_iterator it = m_databaseCallbacksSet.begin(); it != m_databaseCallbacksSet.end(); ++it) {
@@ -483,8 +481,11 @@ void IDBDatabaseBackendImpl::runIntVersionChangeTransaction(int64_t requestedVer
OwnPtr<ScriptExecutionContext::Task> intVersionTask = createCallbackTask(&IDBDatabaseBackendImpl::setIntVersionInternal, database, requestedVersion, callbacks, transaction);
// FIXME: Make this reset the integer version as well.
OwnPtr<ScriptExecutionContext::Task> resetVersionOnAbortTask = createCallbackTask(&IDBDatabaseBackendImpl::resetVersion, database, m_version);
- if (!transaction->scheduleTask(intVersionTask.release(), resetVersionOnAbortTask.release()))
+ if (!transaction->scheduleTask(intVersionTask.release(), resetVersionOnAbortTask.release())) {
+ // FIXME: Remove one of the following lines.
+ ASSERT_NOT_REACHED();
ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
+ }
m_pendingSecondHalfOpenWithVersionCalls.append(PendingOpenWithVersionCall::create(callbacks, requestedVersion));
}
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h b/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h
index 16a9ea6c5..faa166f7f 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h
@@ -38,7 +38,7 @@ public:
virtual ~IDBDatabaseCallbacks() { }
virtual void onVersionChange(const String& version) = 0;
- virtual void onVersionChange(int64_t currentVersion, int64_t requestedVersion) { ASSERT_NOT_REACHED(); }
+ virtual void onVersionChange(int64_t oldVersion, int64_t newVersion) = 0;
};
} // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp
index 19412fcbe..ceb7af31f 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp
@@ -52,6 +52,12 @@ void IDBDatabaseCallbacksImpl::onVersionChange(const String& version)
m_database->onVersionChange(version);
}
+void IDBDatabaseCallbacksImpl::onVersionChange(int64_t oldVersion, int64_t newVersion)
+{
+ if (m_database)
+ m_database->onVersionChange(oldVersion, newVersion);
+}
+
void IDBDatabaseCallbacksImpl::unregisterDatabase(IDBDatabase* database)
{
ASSERT_UNUSED(database, database == m_database);
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h b/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h
index e8b1f99b8..02c8de0df 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h
@@ -42,6 +42,7 @@ public:
virtual ~IDBDatabaseCallbacksImpl();
virtual void onVersionChange(const String& version);
+ virtual void onVersionChange(int64_t oldVersion, int64_t newVersion);
void unregisterDatabase(IDBDatabase*);
private:
diff --git a/Source/WebCore/Modules/indexeddb/IDBFactory.cpp b/Source/WebCore/Modules/indexeddb/IDBFactory.cpp
index cf52cc1fe..c83ba3645 100644
--- a/Source/WebCore/Modules/indexeddb/IDBFactory.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBFactory.cpp
@@ -41,7 +41,7 @@
#include "IDBFactoryBackendInterface.h"
#include "IDBKey.h"
#include "IDBKeyRange.h"
-#include "IDBRequest.h"
+#include "IDBOpenDBRequest.h"
#include "IDBVersionChangeRequest.h"
#include "Page.h"
#include "PageGroup.h"
@@ -105,7 +105,7 @@ PassRefPtr<IDBRequest> IDBFactory::getDatabaseNames(ScriptExecutionContext* cont
return request;
}
-PassRefPtr<IDBRequest> IDBFactory::open(ScriptExecutionContext* context, const String& name, ExceptionCode& ec)
+PassRefPtr<IDBOpenDBRequest> IDBFactory::open(ScriptExecutionContext* context, const String& name, int64_t version, ExceptionCode& ec)
{
if (name.isNull()) {
ec = NATIVE_TYPE_ERR;
@@ -114,11 +114,16 @@ PassRefPtr<IDBRequest> IDBFactory::open(ScriptExecutionContext* context, const S
if (!isContextValid(context))
return 0;
- RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), 0);
- m_backend->open(name, request, context->securityOrigin(), context, getIndexedDBDatabasePath(context));
+ RefPtr<IDBOpenDBRequest> request = IDBOpenDBRequest::create(context, IDBAny::create(this), version);
+ m_backend->open(name, version, request, context->securityOrigin(), context, getIndexedDBDatabasePath(context));
return request;
}
+PassRefPtr<IDBOpenDBRequest> IDBFactory::open(ScriptExecutionContext* context, const String& name, ExceptionCode& ec)
+{
+ return open(context, name, IDBDatabaseMetadata::NoIntVersion, ec);
+}
+
PassRefPtr<IDBVersionChangeRequest> IDBFactory::deleteDatabase(ScriptExecutionContext* context, const String& name, ExceptionCode& ec)
{
if (name.isNull()) {
diff --git a/Source/WebCore/Modules/indexeddb/IDBFactory.h b/Source/WebCore/Modules/indexeddb/IDBFactory.h
index 4611cb6c4..3645bb81d 100644
--- a/Source/WebCore/Modules/indexeddb/IDBFactory.h
+++ b/Source/WebCore/Modules/indexeddb/IDBFactory.h
@@ -30,7 +30,7 @@
#include "DOMStringList.h"
#include "IDBFactoryBackendInterface.h"
-#include "IDBRequest.h"
+#include "IDBOpenDBRequest.h"
#include "PlatformString.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -58,7 +58,8 @@ public:
PassRefPtr<IDBRequest> getDatabaseNames(ScriptExecutionContext*);
- PassRefPtr<IDBRequest> open(ScriptExecutionContext*, const String& name, ExceptionCode&);
+ PassRefPtr<IDBOpenDBRequest> open(ScriptExecutionContext*, const String& name, ExceptionCode&);
+ PassRefPtr<IDBOpenDBRequest> open(ScriptExecutionContext*, const String& name, int64_t version, ExceptionCode&);
PassRefPtr<IDBVersionChangeRequest> deleteDatabase(ScriptExecutionContext*, const String& name, ExceptionCode&);
short cmp(PassRefPtr<IDBKey> first, PassRefPtr<IDBKey> second, ExceptionCode&);
diff --git a/Source/WebCore/Modules/indexeddb/IDBFactory.idl b/Source/WebCore/Modules/indexeddb/IDBFactory.idl
index 0389eb2aa..bf71a2dd2 100644
--- a/Source/WebCore/Modules/indexeddb/IDBFactory.idl
+++ b/Source/WebCore/Modules/indexeddb/IDBFactory.idl
@@ -30,7 +30,7 @@ module storage {
] IDBFactory {
[CallWith=ScriptExecutionContext, ImplementedAs=getDatabaseNames] IDBRequest webkitGetDatabaseNames();
- [CallWith=ScriptExecutionContext] IDBRequest open(in DOMString name)
+ [CallWith=ScriptExecutionContext] IDBOpenDBRequest open(in DOMString name, in [Optional] unsigned long long version)
raises (IDBDatabaseException);
[CallWith=ScriptExecutionContext] IDBVersionChangeRequest deleteDatabase(in DOMString name)
raises (IDBDatabaseException);
diff --git a/Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.cpp
index 63bd4783e..8da5c02e4 100644
--- a/Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.cpp
@@ -150,10 +150,8 @@ PassRefPtr<IDBBackingStore> IDBFactoryBackendImpl::openBackingStore(PassRefPtr<S
return 0;
}
-void IDBFactoryBackendImpl::open(const String& name, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> prpSecurityOrigin, ScriptExecutionContext*, const String& dataDirectory)
+void IDBFactoryBackendImpl::open(const String& name, int64_t version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> prpSecurityOrigin, ScriptExecutionContext*, const String& dataDirectory)
{
- // FIXME: Make this a parameter and plumb through from javascript.
- int64_t version = IDBDatabaseMetadata::NoIntVersion;
RefPtr<SecurityOrigin> securityOrigin = prpSecurityOrigin;
const String uniqueIdentifier = computeUniqueIdentifier(name, securityOrigin.get());
diff --git a/Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.h b/Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.h
index ca1d05282..cad3b5a24 100644
--- a/Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.h
+++ b/Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.h
@@ -57,7 +57,7 @@ public:
virtual void removeIDBBackingStore(const String& fileIdentifier);
virtual void getDatabaseNames(PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir);
- virtual void open(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir);
+ virtual void open(const String& name, int64_t version, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir);
virtual void deleteDatabase(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir);
protected:
diff --git a/Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h b/Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h
index 44f5c786e..4ea5d8a33 100644
--- a/Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h
+++ b/Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h
@@ -54,7 +54,7 @@ public:
virtual ~IDBFactoryBackendInterface() { }
virtual void getDatabaseNames(PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir) = 0;
- virtual void open(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir) = 0;
+ virtual void open(const String& name, int64_t version, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir) = 0;
virtual void deleteDatabase(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String& dataDir) = 0;
};
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
index eae488400..1e02d9063 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
@@ -37,6 +37,7 @@
#include "IDBRequest.h"
#include "IDBTracing.h"
#include "IDBTransaction.h"
+#include "ScriptCallStack.h"
namespace WebCore {
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.h b/Source/WebCore/Modules/indexeddb/IDBIndex.h
index 8201d5d33..59e038836 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndex.h
+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.h
@@ -53,7 +53,8 @@ public:
// Implement the IDL
const String name() const { return m_metadata.name; }
PassRefPtr<IDBObjectStore> objectStore() const { return m_objectStore; }
- PassRefPtr<IDBAny> keyPath() const { return m_metadata.keyPath; }
+ PassRefPtr<IDBAny> keyPathAny() const { return IDBAny::create(m_metadata.keyPath); }
+ const IDBKeyPath keyPath() const { return m_metadata.keyPath; }
bool unique() const { return m_metadata.unique; }
bool multiEntry() const { return m_metadata.multiEntry; }
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.idl b/Source/WebCore/Modules/indexeddb/IDBIndex.idl
index a1708ca62..7789236a1 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndex.idl
+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.idl
@@ -30,7 +30,7 @@ module storage {
] IDBIndex {
readonly attribute DOMString name;
readonly attribute IDBObjectStore objectStore;
- readonly attribute IDBAny keyPath;
+ readonly attribute [ImplementedAs=keyPathAny] IDBAny keyPath;
readonly attribute boolean unique;
readonly attribute boolean multiEntry;
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp
index 61289a5b8..38cfcec97 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp
@@ -99,8 +99,8 @@ void IDBIndexBackendImpl::openCursorInternal(ScriptExecutionContext*, PassRefPtr
return;
}
- RefPtr<IDBCursorBackendInterface> cursor = IDBCursorBackendImpl::create(backingStoreCursor.get(), cursorType, transaction.get(), index->m_objectStoreBackend);
- callbacks->onSuccess(cursor.release());
+ RefPtr<IDBCursorBackendImpl> cursor = IDBCursorBackendImpl::create(backingStoreCursor.get(), cursorType, transaction.get(), index->m_objectStoreBackend);
+ callbacks->onSuccess(cursor, cursor->key(), cursor->primaryKey(), cursor->value());
}
void IDBIndexBackendImpl::openCursor(PassRefPtr<IDBKeyRange> prpKeyRange, unsigned short direction, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
diff --git a/Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp b/Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp
index 8c7b84f9e..0d7b82116 100644
--- a/Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp
@@ -219,48 +219,6 @@ bool IDBKeyPath::isValid() const
return false;
}
-IDBKeyPath::operator PassRefPtr<IDBAny>() const
-{
- switch (m_type) {
- case NullType:
- return IDBAny::createNull();
- case StringType:
- return IDBAny::createString(m_string);
- case ArrayType:
- RefPtr<DOMStringList> keyPaths = DOMStringList::create();
- for (Vector<String>::const_iterator it = m_array.begin(); it != m_array.end(); ++it)
- keyPaths->append(*it);
- return IDBAny::create(static_cast<PassRefPtr<DOMStringList> >(keyPaths));
- }
- ASSERT_NOT_REACHED();
- return 0;
-}
-
-bool IDBKeyPath::operator==(PassRefPtr<IDBAny> other) const
-{
- if (!isValid())
- return false;
-
- switch (m_type) {
- case NullType:
- return other->type() == IDBAny::NullType;
- case StringType:
- return other->type() == IDBAny::StringType && other->string() == string();
- case ArrayType:
- if (other->type() != IDBAny::DOMStringListType)
- return false;
-
- RefPtr<DOMStringList> otherList = other->domStringList();
- for (size_t i = 0; i < m_array.size(); ++i) {
- if (otherList->item(i) != m_array[i])
- return false;
- }
- return true;
- }
- ASSERT_NOT_REACHED();
- return false;
-}
-
bool IDBKeyPath::operator==(const IDBKeyPath& other) const
{
if (m_type != other.m_type)
diff --git a/Source/WebCore/Modules/indexeddb/IDBKeyPath.h b/Source/WebCore/Modules/indexeddb/IDBKeyPath.h
index df31e2abc..5244c8a1b 100644
--- a/Source/WebCore/Modules/indexeddb/IDBKeyPath.h
+++ b/Source/WebCore/Modules/indexeddb/IDBKeyPath.h
@@ -28,7 +28,6 @@
#if ENABLE(INDEXED_DATABASE)
-#include "IDBAny.h"
#include "PlatformString.h"
#include <wtf/Vector.h>
@@ -71,8 +70,6 @@ public:
bool isNull() const { return m_type == NullType; }
bool isValid() const;
- operator PassRefPtr<IDBAny>() const;
- bool operator==(PassRefPtr<IDBAny> other) const;
bool operator==(const IDBKeyPath& other) const;
private:
diff --git a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp
index a809bc92a..04a4fbba2 100644
--- a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp
@@ -25,6 +25,7 @@
#include "config.h"
#include "IDBLevelDBBackingStore.h"
+#include "IDBTracing.h"
#if ENABLE(INDEXED_DATABASE)
#if USE(LEVELDB)
@@ -200,6 +201,7 @@ IDBLevelDBBackingStore::~IDBLevelDBBackingStore()
PassRefPtr<IDBBackingStore> IDBLevelDBBackingStore::open(SecurityOrigin* securityOrigin, const String& pathBaseArg, const String& fileIdentifier, IDBFactoryBackendImpl* factory)
{
+ IDB_TRACE("IDBLevelDBBackingStore::open");
String pathBase = pathBaseArg;
OwnPtr<LevelDBComparator> comparator = adoptPtr(new Comparator());
@@ -357,6 +359,7 @@ static bool deleteRange(LevelDBTransaction* transaction, const Vector<char>& beg
bool IDBLevelDBBackingStore::deleteDatabase(const String& name)
{
+ IDB_TRACE("IDBLevelDBBackingStore::deleteDatabase");
RefPtr<LevelDBTransaction> transaction = LevelDBTransaction::create(m_db.get());
int64_t databaseId;
@@ -397,6 +400,7 @@ static bool checkObjectStoreAndMetaDataType(const LevelDBIterator* it, const Vec
void IDBLevelDBBackingStore::getObjectStores(int64_t databaseId, Vector<int64_t>& foundIds, Vector<String>& foundNames, Vector<IDBKeyPath>& foundKeyPaths, Vector<bool>& foundAutoIncrementFlags)
{
+ IDB_TRACE("IDBLevelDBBackingStore::getObjectStores");
const Vector<char> startKey = ObjectStoreMetaDataKey::encode(databaseId, 1, 0);
const Vector<char> stopKey = ObjectStoreMetaDataKey::encodeMaxKey(databaseId);
@@ -508,6 +512,7 @@ static int64_t getNewObjectStoreId(LevelDBTransaction* transaction, int64_t data
bool IDBLevelDBBackingStore::createObjectStore(int64_t databaseId, const String& name, const IDBKeyPath& keyPath, bool autoIncrement, int64_t& assignedObjectStoreId)
{
+ IDB_TRACE("IDBLevelDBBackingStore::createObjectStore");
ASSERT(m_currentTransaction);
int64_t objectStoreId = getNewObjectStoreId(m_currentTransaction.get(), databaseId);
if (objectStoreId < 0)
@@ -584,6 +589,7 @@ bool IDBLevelDBBackingStore::createObjectStore(int64_t databaseId, const String&
void IDBLevelDBBackingStore::deleteObjectStore(int64_t databaseId, int64_t objectStoreId)
{
+ IDB_TRACE("IDBLevelDBBackingStore::deleteObjectStore");
ASSERT(m_currentTransaction);
String objectStoreName;
@@ -604,6 +610,7 @@ void IDBLevelDBBackingStore::deleteObjectStore(int64_t databaseId, int64_t objec
String IDBLevelDBBackingStore::getObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey& key)
{
+ IDB_TRACE("IDBLevelDBBackingStore::getObjectStoreRecord");
const Vector<char> leveldbKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, key);
Vector<char> data;
@@ -662,6 +669,7 @@ static int64_t getNewVersionNumber(LevelDBTransaction* transaction, int64_t data
bool IDBLevelDBBackingStore::putObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey& key, const String& value, ObjectStoreRecordIdentifier* recordIdentifier)
{
+ IDB_TRACE("IDBLevelDBBackingStore::putObjectStoreRecord");
ASSERT(key.isValid());
ASSERT(m_currentTransaction);
int64_t version = getNewVersionNumber(m_currentTransaction.get(), databaseId, objectStoreId);
@@ -686,6 +694,7 @@ bool IDBLevelDBBackingStore::putObjectStoreRecord(int64_t databaseId, int64_t ob
void IDBLevelDBBackingStore::clearObjectStore(int64_t databaseId, int64_t objectStoreId)
{
+ IDB_TRACE("IDBLevelDBBackingStore::clearObjectStore");
ASSERT(m_currentTransaction);
const Vector<char> startKey = KeyPrefix(databaseId, objectStoreId, 0).encode();
const Vector<char> stopKey = KeyPrefix(databaseId, objectStoreId + 1, 0).encode();
@@ -700,6 +709,7 @@ PassRefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> IDBLevelDBBackingStore:
void IDBLevelDBBackingStore::deleteObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier* recordIdentifier)
{
+ IDB_TRACE("IDBLevelDBBackingStore::deleteObjectStoreRecord");
ASSERT(m_currentTransaction);
const LevelDBRecordIdentifier* levelDBRecordIdentifier = static_cast<const LevelDBRecordIdentifier*>(recordIdentifier);
@@ -774,6 +784,7 @@ bool IDBLevelDBBackingStore::maybeUpdateKeyGeneratorCurrentNumber(int64_t databa
bool IDBLevelDBBackingStore::keyExistsInObjectStore(int64_t databaseId, int64_t objectStoreId, const IDBKey& key, ObjectStoreRecordIdentifier* foundRecordIdentifier)
{
+ IDB_TRACE("IDBLevelDBBackingStore::keyExistsInObjectStore");
ASSERT(m_currentTransaction);
const Vector<char> leveldbKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, key);
Vector<char> data;
@@ -840,6 +851,7 @@ static bool checkIndexAndMetaDataKey(const LevelDBIterator* it, const Vector<cha
void IDBLevelDBBackingStore::getIndexes(int64_t databaseId, int64_t objectStoreId, Vector<int64_t>& foundIds, Vector<String>& foundNames, Vector<IDBKeyPath>& foundKeyPaths, Vector<bool>& foundUniqueFlags, Vector<bool>& foundMultiEntryFlags)
{
+ IDB_TRACE("IDBLevelDBBackingStore::getIndexes");
const Vector<char> startKey = IndexMetaDataKey::encode(databaseId, objectStoreId, 0, 0);
const Vector<char> stopKey = IndexMetaDataKey::encode(databaseId, objectStoreId + 1, 0, 0);
@@ -916,6 +928,7 @@ static int64_t getNewIndexId(LevelDBTransaction* transaction, int64_t databaseId
bool IDBLevelDBBackingStore::createIndex(int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath& keyPath, bool isUnique, bool isMultiEntry, int64_t& indexId)
{
+ IDB_TRACE("IDBLevelDBBackingStore::createIndex");
ASSERT(m_currentTransaction);
indexId = getNewIndexId(m_currentTransaction.get(), databaseId, objectStoreId);
if (indexId < 0)
@@ -955,6 +968,7 @@ bool IDBLevelDBBackingStore::createIndex(int64_t databaseId, int64_t objectStore
void IDBLevelDBBackingStore::deleteIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId)
{
+ IDB_TRACE("IDBLevelDBBackingStore::deleteIndex");
ASSERT(m_currentTransaction);
const Vector<char> indexMetaDataStart = IndexMetaDataKey::encode(databaseId, objectStoreId, indexId, 0);
@@ -976,6 +990,7 @@ void IDBLevelDBBackingStore::deleteIndex(int64_t databaseId, int64_t objectStore
bool IDBLevelDBBackingStore::putIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key, const ObjectStoreRecordIdentifier* recordIdentifier)
{
+ IDB_TRACE("IDBLevelDBBackingStore::putIndexDataForRecord");
ASSERT(key.isValid());
ASSERT(indexId >= MinimumIndexId);
const LevelDBRecordIdentifier* levelDBRecordIdentifier = static_cast<const LevelDBRecordIdentifier*>(recordIdentifier);
@@ -1035,12 +1050,13 @@ static bool versionExists(LevelDBTransaction* transaction, int64_t databaseId, i
return decodeInt(data.begin(), data.end()) == version;
}
-static bool findKeyInIndex(LevelDBTransaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key, Vector<char>& foundEncodedPrimaryKey)
+bool IDBLevelDBBackingStore::findKeyInIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key, Vector<char>& foundEncodedPrimaryKey)
{
+ IDB_TRACE("IDBLevelDBBackingStore::findKeyInIndex");
ASSERT(foundEncodedPrimaryKey.isEmpty());
const Vector<char> leveldbKey = IndexDataKey::encode(databaseId, objectStoreId, indexId, key);
- OwnPtr<LevelDBIterator> it = transaction->createIterator();
+ OwnPtr<LevelDBIterator> it = m_currentTransaction->createIterator();
it->seek(leveldbKey);
for (;;) {
@@ -1055,9 +1071,9 @@ static bool findKeyInIndex(LevelDBTransaction* transaction, int64_t databaseId,
return false;
foundEncodedPrimaryKey.append(p, it->value().end() - p);
- if (!versionExists(transaction, databaseId, objectStoreId, version, foundEncodedPrimaryKey)) {
+ if (!versionExists(m_currentTransaction.get(), databaseId, objectStoreId, version, foundEncodedPrimaryKey)) {
// Delete stale index data entry and continue.
- transaction->remove(it->key());
+ m_currentTransaction->remove(it->key());
it->next();
continue;
}
@@ -1068,10 +1084,11 @@ static bool findKeyInIndex(LevelDBTransaction* transaction, int64_t databaseId,
PassRefPtr<IDBKey> IDBLevelDBBackingStore::getPrimaryKeyViaIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key)
{
+ IDB_TRACE("IDBLevelDBBackingStore::getPrimaryKeyViaIndex");
ASSERT(m_currentTransaction);
Vector<char> foundEncodedPrimaryKey;
- if (findKeyInIndex(m_currentTransaction.get(), databaseId, objectStoreId, indexId, key, foundEncodedPrimaryKey)) {
+ if (findKeyInIndex(databaseId, objectStoreId, indexId, key, foundEncodedPrimaryKey)) {
RefPtr<IDBKey> primaryKey;
decodeIDBKey(foundEncodedPrimaryKey.begin(), foundEncodedPrimaryKey.end(), primaryKey);
return primaryKey.release();
@@ -1082,10 +1099,11 @@ PassRefPtr<IDBKey> IDBLevelDBBackingStore::getPrimaryKeyViaIndex(int64_t databas
bool IDBLevelDBBackingStore::keyExistsInIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey)
{
+ IDB_TRACE("IDBLevelDBBackingStore::keyExistsInIndex");
ASSERT(m_currentTransaction);
Vector<char> foundEncodedPrimaryKey;
- if (!findKeyInIndex(m_currentTransaction.get(), databaseId, objectStoreId, indexId, indexKey, foundEncodedPrimaryKey))
+ if (!findKeyInIndex(databaseId, objectStoreId, indexId, indexKey, foundEncodedPrimaryKey))
return false;
decodeIDBKey(foundEncodedPrimaryKey.begin(), foundEncodedPrimaryKey.end(), foundPrimaryKey);
@@ -1518,6 +1536,7 @@ bool IndexCursorImpl::loadCurrentRow()
PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openObjectStoreCursor(int64_t databaseId, int64_t objectStoreId, const IDBKeyRange* range, IDBCursor::Direction direction)
{
+ IDB_TRACE("IDBLevelDBBackingStore::openObjectStoreCursor");
ASSERT(m_currentTransaction);
CursorOptions cursorOptions;
@@ -1572,6 +1591,7 @@ PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openObjectStoreCurso
PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openIndexKeyCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange* range, IDBCursor::Direction direction)
{
+ IDB_TRACE("IDBLevelDBBackingStore::openIndexKeyCursor");
ASSERT(m_currentTransaction);
CursorOptions cursorOptions;
bool lowerBound = range && range->lower();
@@ -1620,6 +1640,7 @@ PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openIndexKeyCursor(i
PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openIndexCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange* range, IDBCursor::Direction direction)
{
+ IDB_TRACE("IDBLevelDBBackingStore::openIndexCursor");
ASSERT(m_currentTransaction);
CursorOptions cursorOptions;
bool lowerBound = range && range->lower();
@@ -1689,6 +1710,7 @@ void IDBLevelDBBackingStore::Transaction::begin()
bool IDBLevelDBBackingStore::Transaction::commit()
{
+ IDB_TRACE("IDBLevelDBBackingStore::Transaction::commit");
ASSERT(m_backingStore->m_currentTransaction);
bool result = m_backingStore->m_currentTransaction->commit();
m_backingStore->m_currentTransaction.clear();
@@ -1697,6 +1719,7 @@ bool IDBLevelDBBackingStore::Transaction::commit()
void IDBLevelDBBackingStore::Transaction::rollback()
{
+ IDB_TRACE("IDBLevelDBBackingStore::Transaction::rollback");
ASSERT(m_backingStore->m_currentTransaction);
m_backingStore->m_currentTransaction->rollback();
m_backingStore->m_currentTransaction.clear();
diff --git a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h
index 479efecc0..c3759cf7e 100644
--- a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h
+++ b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h
@@ -85,6 +85,8 @@ protected:
IDBLevelDBBackingStore(const String& identifier, IDBFactoryBackendImpl*, PassOwnPtr<LevelDBDatabase>);
private:
+ bool findKeyInIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, Vector<char>& foundEncodedPrimaryKey);
+
String m_identifier;
RefPtr<IDBFactoryBackendImpl> m_factory;
OwnPtr<LevelDBDatabase> m_db;
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
index 7f7cd74bb..c30a253a4 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
@@ -32,6 +32,7 @@
#include "IDBAny.h"
#include "IDBBindingUtilities.h"
#include "IDBCursorBackendInterface.h"
+#include "IDBCursorWithValue.h"
#include "IDBDatabase.h"
#include "IDBDatabaseException.h"
#include "IDBIndex.h"
@@ -40,6 +41,7 @@
#include "IDBKeyRange.h"
#include "IDBTracing.h"
#include "IDBTransaction.h"
+#include "ScriptCallStack.h"
#include "SerializedScriptValue.h"
#include <wtf/UnusedParam.h>
@@ -282,18 +284,96 @@ PassRefPtr<IDBRequest> IDBObjectStore::clear(ScriptExecutionContext* context, Ex
return request.release();
}
-PassRefPtr<IDBIndex> IDBObjectStore::createIndex(const String& name, const String& keyPath, const Dictionary& options, ExceptionCode& ec)
+namespace {
+// This class creates the index keys for a given index by extracting
+// them from the SerializedScriptValue, for all the existing values in
+// the objectStore. It only needs to be kept alive by virtue of being
+// a listener on an IDBRequest object, in the same way that JavaScript
+// cursor success handlers are kept alive.
+class IndexPopulator : public EventListener {
+public:
+ static PassRefPtr<IndexPopulator> create(PassRefPtr<IDBObjectStoreBackendInterface> backend, PassRefPtr<IDBTransactionBackendInterface> transaction, PassRefPtr<IDBRequest> request, const IDBIndexMetadata& indexMetadata)
+ {
+ return adoptRef(new IndexPopulator(backend, transaction, indexMetadata));
+ }
+
+ virtual bool operator==(const EventListener& other)
+ {
+ return this == &other;
+ }
+
+private:
+ IndexPopulator(PassRefPtr<IDBObjectStoreBackendInterface> backend,
+ PassRefPtr<IDBTransactionBackendInterface> transaction,
+ const IDBIndexMetadata& indexMetadata)
+ : EventListener(CPPEventListenerType)
+ , m_objectStoreBackend(backend)
+ , m_transaction(transaction)
+ , m_indexMetadata(indexMetadata)
+ {
+ }
+
+ virtual void handleEvent(ScriptExecutionContext*, Event* event)
+ {
+ ASSERT(event->type() == eventNames().successEvent);
+ EventTarget* target = event->target();
+ IDBRequest* request = static_cast<IDBRequest*>(target);
+
+ ExceptionCode ec = 0;
+ RefPtr<IDBAny> cursorAny = request->result(ec);
+ ASSERT(!ec);
+ RefPtr<IDBCursorWithValue> cursor;
+ if (cursorAny->type() == IDBAny::IDBCursorWithValueType)
+ cursor = cursorAny->idbCursorWithValue();
+
+ Vector<String, 1> indexNames;
+ indexNames.append(m_indexMetadata.name);
+ if (cursor) {
+ cursor->continueFunction(ec);
+ ASSERT(!ec);
+
+ RefPtr<IDBKey> primaryKey = cursor->primaryKey();
+ RefPtr<IDBAny> valueAny = cursor->value();
+
+ ASSERT(valueAny->type() == IDBAny::SerializedScriptValueType);
+ RefPtr<SerializedScriptValue> value = valueAny->serializedScriptValue();
+
+ IDBObjectStore::IndexKeys indexKeys;
+ generateIndexKeysForValue(m_indexMetadata, value, &indexKeys);
+
+ Vector<IDBObjectStore::IndexKeys, 1> indexKeysList;
+ indexKeysList.append(indexKeys);
+
+ m_objectStoreBackend->setIndexKeys(primaryKey, indexNames, indexKeysList, m_transaction.get());
+
+ } else {
+ // Now that we are done indexing, tell the backend to go
+ // back to processing tasks of type NormalTask.
+ m_objectStoreBackend->setIndexesReady(indexNames, m_transaction.get());
+ m_objectStoreBackend.clear();
+ m_transaction.clear();
+ }
+
+ }
+
+ RefPtr<IDBObjectStoreBackendInterface> m_objectStoreBackend;
+ RefPtr<IDBTransactionBackendInterface> m_transaction;
+ IDBIndexMetadata m_indexMetadata;
+};
+}
+
+PassRefPtr<IDBIndex> IDBObjectStore::createIndex(ScriptExecutionContext* context, const String& name, const String& keyPath, const Dictionary& options, ExceptionCode& ec)
{
- return createIndex(name, IDBKeyPath(keyPath), options, ec);
+ return createIndex(context, name, IDBKeyPath(keyPath), options, ec);
}
-PassRefPtr<IDBIndex> IDBObjectStore::createIndex(const String& name, PassRefPtr<DOMStringList> keyPath, const Dictionary& options, ExceptionCode& ec)
+PassRefPtr<IDBIndex> IDBObjectStore::createIndex(ScriptExecutionContext* context, const String& name, PassRefPtr<DOMStringList> keyPath, const Dictionary& options, ExceptionCode& ec)
{
- return createIndex(name, IDBKeyPath(*keyPath), options, ec);
+ return createIndex(context, name, IDBKeyPath(*keyPath), options, ec);
}
-PassRefPtr<IDBIndex> IDBObjectStore::createIndex(const String& name, const IDBKeyPath& keyPath, const Dictionary& options, ExceptionCode& ec)
+PassRefPtr<IDBIndex> IDBObjectStore::createIndex(ScriptExecutionContext* context, const String& name, const IDBKeyPath& keyPath, const Dictionary& options, ExceptionCode& ec)
{
IDB_TRACE("IDBObjectStore::createIndex");
if (!m_transaction->isVersionChange() || m_deleted) {
@@ -338,6 +418,19 @@ PassRefPtr<IDBIndex> IDBObjectStore::createIndex(const String& name, const IDBKe
m_indexMap.set(name, index);
m_metadata.indexes.set(name, metadata);
+ ASSERT(!ec);
+ if (ec)
+ return 0;
+
+ RefPtr<IDBRequest> indexRequest = openCursor(context, static_cast<IDBKeyRange*>(0), IDBCursor::directionNext(), IDBTransactionBackendInterface::PreemptiveTask, ec);
+ ASSERT(!ec);
+ if (ec)
+ return 0;
+
+ // This is kept alive by being the success handler of the request, which is in turn kept alive by the owning transaction.
+ RefPtr<IndexPopulator> indexPopulator = IndexPopulator::create(m_backend, m_transaction->backend(), indexRequest, metadata);
+ indexRequest->setOnsuccess(indexPopulator);
+
return index.release();
}
@@ -398,7 +491,7 @@ void IDBObjectStore::deleteIndex(const String& name, ExceptionCode& ec)
}
}
-PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, const String& directionString, ExceptionCode& ec)
+PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, const String& directionString, IDBTransactionBackendInterface::TaskType taskType, ExceptionCode& ec)
{
IDB_TRACE("IDBObjectStore::openCursor");
if (m_deleted) {
@@ -415,7 +508,7 @@ PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* contex
RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
request->setCursorDetails(IDBCursorBackendInterface::ObjectStoreCursor, direction);
- m_backend->openCursor(range, direction, request, m_transaction->backend(), ec);
+ m_backend->openCursor(range, direction, request, taskType, m_transaction->backend(), ec);
if (ec) {
request->markEarlyDeath();
return 0;
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
index 6fefc4e2b..92e0fed96 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
@@ -58,7 +58,8 @@ public:
// Implement the IDBObjectStore IDL
const String name() const { return m_metadata.name; }
- PassRefPtr<IDBAny> keyPath() const { return m_metadata.keyPath; }
+ PassRefPtr<IDBAny> keyPathAny() const { return IDBAny::create(m_metadata.keyPath); }
+ const IDBKeyPath keyPath() const { return m_metadata.keyPath; }
PassRefPtr<DOMStringList> indexNames() const;
PassRefPtr<IDBTransaction> transaction() const { return m_transaction; }
bool autoIncrement() const { return m_metadata.autoIncrement; }
@@ -68,6 +69,11 @@ public:
PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, ExceptionCode& ec) { return openCursor(context, static_cast<IDBKeyRange*>(0), ec); }
PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec) { return openCursor(context, keyRange, IDBCursor::directionNext(), ec); }
PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, ExceptionCode& ec) { return openCursor(context, key, IDBCursor::directionNext(), ec); }
+ PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, const String& direction, ExceptionCode& ec) { return openCursor(context, range, direction, IDBTransactionBackendInterface::NormalTask, ec); }
+ PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, IDBTransactionBackendInterface::TaskType, ExceptionCode&);
+ PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKey>, const String& direction, ExceptionCode&);
+ PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, unsigned short direction, ExceptionCode&);
+ PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKey>, unsigned short direction, ExceptionCode&);
PassRefPtr<IDBRequest> get(ScriptExecutionContext*, PassRefPtr<IDBKey>, ExceptionCode&);
PassRefPtr<IDBRequest> get(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
@@ -78,19 +84,15 @@ public:
PassRefPtr<IDBRequest> clear(ScriptExecutionContext*, ExceptionCode&);
// FIXME: Try to modify the code generator so this duplication is unneeded.
- PassRefPtr<IDBIndex> createIndex(const String& name, const String& keyPath, const Dictionary&, ExceptionCode&);
- PassRefPtr<IDBIndex> createIndex(const String& name, const String& keyPath, ExceptionCode& ec) { return createIndex(name, keyPath, Dictionary(), ec); }
- PassRefPtr<IDBIndex> createIndex(const String& name, PassRefPtr<DOMStringList> keyPath, const Dictionary&, ExceptionCode&);
- PassRefPtr<IDBIndex> createIndex(const String& name, PassRefPtr<DOMStringList> keyPath, ExceptionCode& ec) { return createIndex(name, keyPath, Dictionary(), ec); }
- PassRefPtr<IDBIndex> createIndex(const String&, const IDBKeyPath&, const Dictionary&, ExceptionCode&);
+ PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext*, const String& name, const String& keyPath, const Dictionary&, ExceptionCode&);
+ PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext* context, const String& name, const String& keyPath, ExceptionCode& ec) { return createIndex(context, name, keyPath, Dictionary(), ec); }
+ PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext*, const String& name, PassRefPtr<DOMStringList> keyPath, const Dictionary&, ExceptionCode&);
+ PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext* context, const String& name, PassRefPtr<DOMStringList> keyPath, ExceptionCode& ec) { return createIndex(context, name, keyPath, Dictionary(), ec); }
+ PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext*, const String&, const IDBKeyPath&, const Dictionary&, ExceptionCode&);
PassRefPtr<IDBIndex> index(const String& name, ExceptionCode&);
void deleteIndex(const String& name, ExceptionCode&);
- PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, ExceptionCode&);
- PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKey>, const String& direction, ExceptionCode&);
- PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, unsigned short direction, ExceptionCode&);
- PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKey>, unsigned short direction, ExceptionCode&);
PassRefPtr<IDBRequest> count(ScriptExecutionContext* context, ExceptionCode& ec) { return count(context, static_cast<IDBKeyRange*>(0), ec); }
PassRefPtr<IDBRequest> count(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
PassRefPtr<IDBRequest> count(ScriptExecutionContext*, PassRefPtr<IDBKey>, ExceptionCode&);
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl b/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl
index 9ed1422b7..99d86846b 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl
@@ -29,7 +29,7 @@ module storage {
Conditional=INDEXED_DATABASE
] IDBObjectStore {
readonly attribute [TreatReturnedNullStringAs=Null] DOMString name;
- readonly attribute IDBAny keyPath;
+ readonly attribute [ImplementedAs=keyPathAny] IDBAny keyPath;
readonly attribute DOMStringList indexNames;
readonly attribute IDBTransaction transaction;
readonly attribute boolean autoIncrement;
@@ -59,9 +59,9 @@ module storage {
[CallWith=ScriptExecutionContext] IDBRequest openCursor(in IDBKey key, in [Optional] unsigned short direction)
raises (IDBDatabaseException);
- IDBIndex createIndex(in DOMString name, in DOMString[] keyPath, in [Optional] Dictionary options)
+ [CallWith=ScriptExecutionContext] IDBIndex createIndex(in DOMString name, in DOMString[] keyPath, in [Optional] Dictionary options)
raises (IDBDatabaseException);
- IDBIndex createIndex(in DOMString name, in DOMString keyPath, in [Optional] Dictionary options)
+ [CallWith=ScriptExecutionContext] IDBIndex createIndex(in DOMString name, in DOMString keyPath, in [Optional] Dictionary options)
raises (IDBDatabaseException);
IDBIndex index(in DOMString name)
raises (IDBDatabaseException);
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp
index ce0915a30..c23a74b60 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp
@@ -154,31 +154,6 @@ public:
, m_indexKeys(indexKeys)
{ }
- // FIXME: remove this once createIndex() generates these in the renderer.
- void generateIndexKeysForValue(SerializedScriptValue* objectValue)
- {
- m_indexKeys.clear();
-
- RefPtr<IDBKey> indexKey = fetchKeyFromKeyPath(objectValue);
-
- if (!indexKey)
- return;
-
- if (!m_indexMetadata.multiEntry || indexKey->type() != IDBKey::ArrayType) {
- if (!indexKey->isValid())
- return;
-
- m_indexKeys.append(indexKey);
- } else {
- ASSERT(m_indexMetadata.multiEntry);
- ASSERT(indexKey->type() == IDBKey::ArrayType);
- indexKey = IDBKey::createMultiEntryArray(indexKey->array());
-
- for (size_t i = 0; i < indexKey->array().size(); ++i)
- m_indexKeys.append(indexKey->array()[i]);
- }
- }
-
bool verifyIndexKeys(IDBBackingStore& backingStore,
int64_t databaseId, int64_t objectStoreId, int64_t indexId,
const IDBKey* primaryKey = 0, String* errorMessage = 0)
@@ -212,7 +187,7 @@ private:
bool addingKeyAllowed(IDBBackingStore& backingStore,
int64_t databaseId, int64_t objectStoreId, int64_t indexId,
- const IDBKey* indexKey, const IDBKey* primaryKey)
+ const IDBKey* indexKey, const IDBKey* primaryKey) const
{
if (!m_indexMetadata.unique)
return true;
@@ -245,6 +220,98 @@ private:
};
}
+static bool makeIndexWriters(IDBObjectStoreBackendImpl* objectStore, PassRefPtr<IDBKey> primaryKey, bool keyWasGenerated, const Vector<String> indexNames, const Vector<IDBObjectStoreBackendInterface::IndexKeys>& indexKeys, Vector<OwnPtr<IndexWriter> >* indexWriters, String* errorMessage)
+{
+ ASSERT(indexNames.size() == indexKeys.size());
+
+ HashMap<String, IDBObjectStoreBackendInterface::IndexKeys> indexKeyMap;
+ for (size_t i = 0; i < indexNames.size(); i++)
+ indexKeyMap.add(indexNames[i], indexKeys[i]);
+
+ for (IDBObjectStoreBackendImpl::IndexMap::iterator it = objectStore->iterIndexesBegin(); it != objectStore->iterIndexesEnd(); ++it) {
+
+ const RefPtr<IDBIndexBackendImpl>& index = it->second;
+ if (!index->hasValidId())
+ continue; // The index object has been created, but does not exist in the database yet.
+
+ IDBObjectStoreBackendInterface::IndexKeys keys = indexKeyMap.get(it->first);
+ // If the objectStore is using autoIncrement, then any indexes with an identical keyPath need to also use the primary (generated) key as a key.
+ if (keyWasGenerated) {
+ const IDBKeyPath& indexKeyPath = index->keyPath();
+ if (indexKeyPath == objectStore->keyPath())
+ keys.append(primaryKey);
+ }
+
+ OwnPtr<IndexWriter> indexWriter(adoptPtr(new IndexWriter(index->metadata(), keys)));
+ if (!indexWriter->verifyIndexKeys(*objectStore->backingStore(),
+ objectStore->databaseId(),
+ objectStore->id(),
+ index->id(), primaryKey.get(), errorMessage)) {
+ return false;
+ }
+
+ indexWriters->append(indexWriter.release());
+ }
+
+ return true;
+}
+
+void IDBObjectStoreBackendImpl::setIndexKeys(PassRefPtr<IDBKey> prpPrimaryKey, const Vector<String>& indexNames, const Vector<IndexKeys>& indexKeys, IDBTransactionBackendInterface* transaction)
+{
+ IDB_TRACE("IDBObjectStoreBackendImpl::setIndexKeys");
+ RefPtr<IDBKey> primaryKey = prpPrimaryKey;
+
+ // FIXME: This method could be asynchronous, but we need to evaluate if it's worth the extra complexity.
+ RefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> recordIdentifier = backingStore()->createInvalidRecordIdentifier();
+ if (!backingStore()->keyExistsInObjectStore(databaseId(), id(), *primaryKey, recordIdentifier.get())) {
+ transaction->abort();
+ return;
+ }
+
+ Vector<OwnPtr<IndexWriter> > indexWriters;
+ String errorMessage;
+ if (!makeIndexWriters(this, primaryKey, false, indexNames, indexKeys, &indexWriters, &errorMessage)) {
+ // FIXME: Need to deal with errorMessage here. makeIndexWriters only fails on uniqueness constraint errors.
+ transaction->abort();
+ return;
+ }
+
+ for (size_t i = 0; i < indexWriters.size(); ++i) {
+ IndexWriter* indexWriter = indexWriters[i].get();
+ if (!indexWriter->writeIndexKeys(recordIdentifier.get(),
+ *backingStore(),
+ databaseId(),
+ m_id,
+ m_indexes.get(indexWriter->indexName())->id())) {
+ transaction->abort();
+ return;
+ }
+ }
+}
+
+void IDBObjectStoreBackendImpl::setIndexesReady(const Vector<String>& indexNames, IDBTransactionBackendInterface* transactionInterface)
+{
+ IDB_TRACE("IDBObjectStoreBackendImpl::setIndexesReady");
+ RefPtr<IDBObjectStoreBackendImpl> objectStore = this;
+
+ OwnPtr<Vector<String> > names = adoptPtr(new Vector<String>(indexNames));
+ RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionInterface);
+
+ if (!transaction->scheduleTask(
+ IDBTransactionBackendInterface::PreemptiveTask,
+ createCallbackTask(&IDBObjectStoreBackendImpl::setIndexesReadyInternal, objectStore, names.release(), transaction)))
+ ASSERT_NOT_REACHED();
+}
+
+void IDBObjectStoreBackendImpl::setIndexesReadyInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassOwnPtr<Vector<String> > popIndexNames, PassRefPtr<IDBTransactionBackendImpl> transaction)
+{
+ IDB_TRACE("IDBObjectStoreBackendImpl::setIndexesReadyInternal");
+ OwnPtr<Vector<String> > indexNames = popIndexNames;
+ for (size_t i = 0; i < indexNames->size(); ++i)
+ transaction->didCompletePreemptiveEvent();
+ transaction->didCompleteTaskEvents();
+}
+
void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBKey> prpKey, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction, PassOwnPtr<Vector<String> > popIndexNames, PassOwnPtr<Vector<IndexKeys> > popIndexKeys)
{
IDB_TRACE("IDBObjectStoreBackendImpl::putInternal");
@@ -276,39 +343,10 @@ void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr<
}
Vector<OwnPtr<IndexWriter> > indexWriters;
- HashMap<String, IndexKeys> indexKeyMap;
- for (size_t i = 0; i < indexNames->size(); ++i) {
- IndexKeys keys = indexKeys->at(i);
-
- // If the objectStore is using autoIncrement, then any indexes with an identical keyPath need to also use the primary (generated) key as a key.
- if (keyWasGenerated) {
- const IDBKeyPath& indexKeyPath = objectStore->m_indexes.get(indexNames->at(i))->keyPath();
- if (indexKeyPath == objectStore->keyPath())
- keys.append(key);
- }
-
- indexKeyMap.add(indexNames->at(i), keys);
- }
-
- for (IndexMap::iterator it = objectStore->m_indexes.begin(); it != objectStore->m_indexes.end(); ++it) {
-
- const RefPtr<IDBIndexBackendImpl>& index = it->second;
- if (!index->hasValidId())
- continue; // The index object has been created, but does not exist in the database yet.
-
- OwnPtr<IndexWriter> indexWriter;
- indexWriter = adoptPtr(new IndexWriter(index->metadata(), indexKeyMap.get(it->first)));
-
- String errorMessage;
- if (!indexWriter->verifyIndexKeys(*objectStore->backingStore(),
- objectStore->databaseId(),
- objectStore->id(),
- index->id(), key.get(), &errorMessage)) {
- callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::DATA_ERR, errorMessage));
- return;
- }
-
- indexWriters.append(indexWriter.release());
+ String errorMessage;
+ if (!makeIndexWriters(objectStore.get(), key, keyWasGenerated, *indexNames, *indexKeys, &indexWriters, &errorMessage)) {
+ callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::CONSTRAINT_ERR, errorMessage));
+ return;
}
// Before this point, don't do any mutation. After this point, rollback the transaction in case of error.
@@ -365,7 +403,7 @@ void IDBObjectStoreBackendImpl::deleteInternal(ScriptExecutionContext*, PassRefP
do {
recordIdentifier = backingStoreCursor->objectStoreRecordIdentifier();
- for (IndexMap::iterator it = objectStore->m_indexes.begin(); it != objectStore->m_indexes.end(); ++it) {
+ for (IDBObjectStoreBackendImpl::IndexMap::iterator it = objectStore->m_indexes.begin(); it != objectStore->m_indexes.end(); ++it) {
if (!it->second->hasValidId())
continue; // The index object has been created, but does not exist in the database yet.
@@ -403,44 +441,6 @@ void IDBObjectStoreBackendImpl::clearInternal(ScriptExecutionContext*, PassRefPt
callbacks->onSuccess(SerializedScriptValue::undefinedValue());
}
-namespace {
-class PopulateIndexCallback : public IDBBackingStore::ObjectStoreRecordCallback {
-public:
- PopulateIndexCallback(IDBBackingStore& backingStore, const IDBIndexMetadata& indexMetadata, int64_t databaseId, int64_t objectStoreId, int64_t indexId)
- : m_backingStore(backingStore)
- , m_databaseId(databaseId)
- , m_objectStoreId(objectStoreId)
- , m_indexId(indexId)
- , m_writer(indexMetadata)
- {
- }
-
- virtual bool callback(const IDBBackingStore::ObjectStoreRecordIdentifier* recordIdentifier, const String& value)
- {
- RefPtr<SerializedScriptValue> objectValue = SerializedScriptValue::createFromWire(value);
- m_writer.generateIndexKeysForValue(objectValue.get());
- if (!m_writer.verifyIndexKeys(m_backingStore, m_databaseId, m_objectStoreId, m_indexId))
- return false;
- return m_writer.writeIndexKeys(recordIdentifier, m_backingStore, m_databaseId, m_objectStoreId, m_indexId);
- }
-
-private:
- IDBBackingStore& m_backingStore;
- int64_t m_databaseId;
- int64_t m_objectStoreId;
- int64_t m_indexId;
- IndexWriter m_writer;
-};
-}
-
-bool IDBObjectStoreBackendImpl::populateIndex(IDBBackingStore& backingStore, int64_t databaseId, int64_t objectStoreId, PassRefPtr<IDBIndexBackendImpl> index)
-{
- PopulateIndexCallback callback(backingStore, index->metadata(), databaseId, objectStoreId, index->id());
- if (!backingStore.forEachObjectStoreRecord(databaseId, objectStoreId, callback))
- return false;
- return true;
-}
-
PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendImpl::createIndex(const String& name, const IDBKeyPath& keyPath, bool unique, bool multiEntry, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
{
ASSERT(!m_indexes.contains(name));
@@ -473,11 +473,6 @@ void IDBObjectStoreBackendImpl::createIndexInternal(ScriptExecutionContext*, Pas
index->setId(id);
- if (!populateIndex(*objectStore->backingStore(), objectStore->databaseId(), objectStore->m_id, index)) {
- transaction->abort();
- return;
- }
-
transaction->didCompleteTaskEvents();
}
@@ -515,7 +510,13 @@ void IDBObjectStoreBackendImpl::deleteIndexInternal(ScriptExecutionContext*, Pas
transaction->didCompleteTaskEvents();
}
-void IDBObjectStoreBackendImpl::openCursor(PassRefPtr<IDBKeyRange> prpRange, unsigned short direction, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
+void IDBObjectStoreBackendImpl::openCursor(PassRefPtr<IDBKeyRange> prpRange, unsigned short tmpDirection, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
+{
+ IDBCursor::Direction direction = static_cast<IDBCursor::Direction>(tmpDirection);
+ openCursor(prpRange, direction, prpCallbacks, IDBTransactionBackendInterface::NormalTask, transactionPtr, ec);
+}
+
+void IDBObjectStoreBackendImpl::openCursor(PassRefPtr<IDBKeyRange> prpRange, IDBCursor::Direction direction, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface::TaskType taskType, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
{
IDB_TRACE("IDBObjectStoreBackendImpl::openCursor");
RefPtr<IDBObjectStoreBackendImpl> objectStore = this;
@@ -523,24 +524,29 @@ void IDBObjectStoreBackendImpl::openCursor(PassRefPtr<IDBKeyRange> prpRange, uns
RefPtr<IDBCallbacks> callbacks = prpCallbacks;
RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr);
if (!transaction->scheduleTask(
- createCallbackTask(&IDBObjectStoreBackendImpl::openCursorInternal, objectStore, range, direction, callbacks, transaction))) {
+ createCallbackTask(&IDBObjectStoreBackendImpl::openCursorInternal, objectStore, range, direction, callbacks, taskType, transaction))) {
ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
}
}
-void IDBObjectStoreBackendImpl::openCursorInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> range, unsigned short tmpDirection, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
+void IDBObjectStoreBackendImpl::openCursorInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> range, IDBCursor::Direction direction, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface::TaskType taskType, PassRefPtr<IDBTransactionBackendImpl> transaction)
{
IDB_TRACE("IDBObjectStoreBackendImpl::openCursorInternal");
- IDBCursor::Direction direction = static_cast<IDBCursor::Direction>(tmpDirection);
RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreCursor(objectStore->databaseId(), objectStore->id(), range.get(), direction);
+ // The frontend has begun indexing, so this pauses the transaction
+ // until the indexing is complete. This can't happen any earlier
+ // because we don't want to switch to early mode in case multiple
+ // indexes are being created in a row, with put()'s in between.
+ if (taskType == IDBTransactionBackendInterface::PreemptiveTask)
+ transaction->addPreemptiveEvent();
if (!backingStoreCursor) {
callbacks->onSuccess(SerializedScriptValue::nullValue());
return;
}
- RefPtr<IDBCursorBackendInterface> cursor = IDBCursorBackendImpl::create(backingStoreCursor.release(), IDBCursorBackendInterface::ObjectStoreCursor, transaction.get(), objectStore.get());
- callbacks->onSuccess(cursor.release());
+ RefPtr<IDBCursorBackendImpl> cursor = IDBCursorBackendImpl::create(backingStoreCursor.release(), IDBCursorBackendInterface::ObjectStoreCursor, taskType, transaction.get(), objectStore.get());
+ callbacks->onSuccess(cursor, cursor->key(), cursor->primaryKey(), cursor->value());
}
void IDBObjectStoreBackendImpl::count(PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h
index 5b1b54fc2..0a82473ac 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h
@@ -26,6 +26,7 @@
#ifndef IDBObjectStoreBackendImpl_h
#define IDBObjectStoreBackendImpl_h
+#include "IDBBackingStore.h"
#include "IDBDatabaseBackendImpl.h"
#include "IDBKeyPath.h"
#include "IDBMetadata.h"
@@ -56,6 +57,8 @@ public:
}
virtual ~IDBObjectStoreBackendImpl();
+ typedef HashMap<String, RefPtr<IDBIndexBackendImpl> > IndexMap;
+
static const int64_t InvalidId = 0;
int64_t id() const
{
@@ -71,19 +74,29 @@ public:
virtual void clear(PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&);
virtual PassRefPtr<IDBIndexBackendInterface> createIndex(const String& name, const IDBKeyPath&, bool unique, bool multiEntry, IDBTransactionBackendInterface*, ExceptionCode&);
+ virtual void setIndexKeys(PassRefPtr<IDBKey> prpPrimaryKey, const Vector<String>&, const Vector<IndexKeys>& , IDBTransactionBackendInterface*);
+ virtual void setIndexesReady(const Vector<String>&, IDBTransactionBackendInterface*);
virtual PassRefPtr<IDBIndexBackendInterface> index(const String& name, ExceptionCode&);
virtual void deleteIndex(const String& name, IDBTransactionBackendInterface*, ExceptionCode&);
+ // FIXME: Remove this version of openCursor when TaskType is plumbed through chromium.
virtual void openCursor(PassRefPtr<IDBKeyRange> range, unsigned short direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&);
+ virtual void openCursor(PassRefPtr<IDBKeyRange>, IDBCursor::Direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface::TaskType, IDBTransactionBackendInterface*, ExceptionCode&);
virtual void count(PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&);
static bool populateIndex(IDBBackingStore&, int64_t databaseId, int64_t objectStoreId, PassRefPtr<IDBIndexBackendImpl>);
+ const IndexMap::iterator iterIndexesBegin() { return m_indexes.begin(); };
+ const IndexMap::iterator iterIndexesEnd() { return m_indexes.end(); };
+
IDBObjectStoreMetadata metadata() const;
const String& name() { return m_name; }
const IDBKeyPath& keyPath() const { return m_keyPath; }
const bool& autoIncrement() const { return m_autoIncrement; }
-
+
+ PassRefPtr<IDBBackingStore> backingStore() const { return m_database->backingStore(); }
+ int64_t databaseId() const { return m_database->id(); }
+
private:
IDBObjectStoreBackendImpl(const IDBDatabaseBackendImpl*, int64_t databaseId, const String& name, const IDBKeyPath&, bool autoIncrement);
IDBObjectStoreBackendImpl(const IDBDatabaseBackendImpl*, const String& name, const IDBKeyPath&, bool autoIncrement);
@@ -95,26 +108,23 @@ private:
static void getInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
static void putInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, PutMode, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>, PassOwnPtr<Vector<String> > popIndexNames, PassOwnPtr<Vector<IndexKeys> >);
static void deleteInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
+ static void setIndexesReadyInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassOwnPtr<Vector<String> > popIndexNames, PassRefPtr<IDBTransactionBackendImpl>);
static void clearInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBCallbacks>);
static void createIndexInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBTransactionBackendImpl>);
static void deleteIndexInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBTransactionBackendImpl>);
- static void openCursorInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
+ static void openCursorInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, IDBCursor::Direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface::TaskType, PassRefPtr<IDBTransactionBackendImpl>);
static void countInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
// These are used as setVersion transaction abort tasks.
static void removeIndexFromMap(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>);
static void addIndexToMap(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>);
- PassRefPtr<IDBBackingStore> backingStore() const { return m_database->backingStore(); }
- int64_t databaseId() const { return m_database->id(); }
-
const IDBDatabaseBackendImpl* m_database;
int64_t m_id;
String m_name;
IDBKeyPath m_keyPath;
bool m_autoIncrement;
- typedef HashMap<String, RefPtr<IDBIndexBackendImpl> > IndexMap;
IndexMap m_indexes;
};
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h
index f2fd088c1..3801e4811 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h
@@ -26,6 +26,7 @@
#ifndef IDBObjectStoreBackendInterface_h
#define IDBObjectStoreBackendInterface_h
+#include "IDBCursor.h"
#include "PlatformString.h"
#include <wtf/Threading.h>
@@ -63,10 +64,14 @@ public:
virtual void clear(PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
virtual PassRefPtr<IDBIndexBackendInterface> createIndex(const String& name, const IDBKeyPath&, bool unique, bool multiEntry, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
+ virtual void setIndexKeys(PassRefPtr<IDBKey> prpPrimaryKey, const Vector<String>&, const Vector<IndexKeys>&, IDBTransactionBackendInterface*) = 0;
+ virtual void setIndexesReady(const Vector<String>&, IDBTransactionBackendInterface*) = 0;
virtual PassRefPtr<IDBIndexBackendInterface> index(const String& name, ExceptionCode&) = 0;
virtual void deleteIndex(const String& name, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
+ // FIXME: Remove this version of openCursor when TaskType is plumbed through chromium.
virtual void openCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
+ virtual void openCursor(PassRefPtr<IDBKeyRange>, IDBCursor::Direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface::TaskType, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
virtual void count(PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
};
diff --git a/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp b/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp
new file mode 100644
index 000000000..1d849488f
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 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 "IDBOpenDBRequest.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBDatabase.h"
+#include "IDBPendingTransactionMonitor.h"
+#include "IDBUpgradeNeededEvent.h"
+#include "ScriptExecutionContext.h"
+
+namespace WebCore {
+
+PassRefPtr<IDBOpenDBRequest> IDBOpenDBRequest::create(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, int64_t version)
+{
+ RefPtr<IDBOpenDBRequest> request(adoptRef(new IDBOpenDBRequest(context, source, version)));
+ request->suspendIfNeeded();
+ return request.release();
+}
+
+IDBOpenDBRequest::IDBOpenDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, int64_t version)
+ : IDBRequest(context, source, IDBTransactionBackendInterface::NormalTask, 0)
+ , m_version(version)
+{
+ ASSERT(!m_result);
+}
+
+IDBOpenDBRequest::~IDBOpenDBRequest()
+{
+}
+
+const AtomicString& IDBOpenDBRequest::interfaceName() const
+{
+ return eventNames().interfaceForIDBOpenDBRequest;
+}
+
+void IDBOpenDBRequest::onBlocked(int64_t oldVersion)
+{
+ if (!shouldEnqueueEvent())
+ return;
+ enqueueEvent(IDBUpgradeNeededEvent::create(oldVersion, m_version, eventNames().blockedEvent));
+}
+
+void IDBOpenDBRequest::onUpgradeNeeded(int64_t oldVersion, PassRefPtr<IDBTransactionBackendInterface> prpTransactionBackend, PassRefPtr<IDBDatabaseBackendInterface> prpDatabaseBackend)
+{
+ if (!shouldEnqueueEvent())
+ return;
+
+ RefPtr<IDBDatabaseBackendInterface> databaseBackend = prpDatabaseBackend;
+ RefPtr<IDBTransactionBackendInterface> transactionBackend = prpTransactionBackend;
+ RefPtr<IDBDatabase> idbDatabase = IDBDatabase::create(scriptExecutionContext(), databaseBackend);
+
+ RefPtr<IDBTransaction> frontend = IDBTransaction::create(scriptExecutionContext(), transactionBackend, IDBTransaction::VERSION_CHANGE, idbDatabase.get(), this);
+ transactionBackend->setCallbacks(frontend.get());
+ m_transaction = frontend;
+ m_result = IDBAny::create(idbDatabase.release());
+
+ if (oldVersion == IDBDatabaseMetadata::NoIntVersion) {
+ // This database hasn't had an integer version before.
+ oldVersion = IDBDatabaseMetadata::DefaultIntVersion;
+ }
+ enqueueEvent(IDBUpgradeNeededEvent::create(oldVersion, m_version, eventNames().upgradeneededEvent));
+}
+
+bool IDBOpenDBRequest::shouldEnqueueEvent() const
+{
+ if (m_contextStopped || !scriptExecutionContext())
+ return false;
+ ASSERT(m_readyState == PENDING || m_readyState == DONE);
+ if (m_requestAborted)
+ return false;
+ return true;
+}
+
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/bindings/js/JSCustomVoidCallback.h b/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h
index f342b8b15..638f63157 100644
--- a/Source/WebCore/bindings/js/JSCustomVoidCallback.h
+++ b/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007, 2008 Apple 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
@@ -10,9 +10,6 @@
* 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -26,36 +23,40 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef JSCustomVoidCallback_h
-#define JSCustomVoidCallback_h
+#ifndef IDBOpenDBRequest_h
+#define IDBOpenDBRequest_h
-#include "JSDOMGlobalObject.h"
-#include "VoidCallback.h"
-#include <heap/Strong.h>
-#include <wtf/Forward.h>
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBRequest.h"
namespace WebCore {
-class JSCallbackData;
-
-class JSCustomVoidCallback : public VoidCallback {
-public:
- static PassRefPtr<JSCustomVoidCallback> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)
- {
- return adoptRef(new JSCustomVoidCallback(callback, globalObject));
- }
-
- virtual ~JSCustomVoidCallback();
-
- virtual void handleEvent();
-
+class IDBOpenDBRequest : public IDBRequest {
+public:
+ static PassRefPtr<IDBOpenDBRequest> create(ScriptExecutionContext*, PassRefPtr<IDBAny> source, int64_t version);
+ virtual ~IDBOpenDBRequest();
+
+ virtual void onBlocked(int64_t existingVersion) OVERRIDE;
+ virtual void onUpgradeNeeded(int64_t oldVersion, PassRefPtr<IDBTransactionBackendInterface>, PassRefPtr<IDBDatabaseBackendInterface>) OVERRIDE;
+
+ // EventTarget
+ virtual const AtomicString& interfaceName() const;
+
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(blocked);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(upgradeneeded);
+
+protected:
+ virtual bool shouldEnqueueEvent() const OVERRIDE;
+
private:
- JSCustomVoidCallback(JSC::JSObject* callback, JSDOMGlobalObject*);
+ IDBOpenDBRequest(ScriptExecutionContext*, PassRefPtr<IDBAny> source, int64_t version);
- JSCallbackData* m_data;
- ScriptExecutionContext* m_scriptExecutionContext;
+ int64_t m_version;
};
} // namespace WebCore
-#endif // JSCustomVoidCallback_h
+#endif // ENABLE(INDEXED_DATABASE)
+
+#endif // IDBOpenDBRequest_h
diff --git a/Source/WebKit/chromium/src/WebImageLayer.cpp b/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.idl
index f76151530..1e46a52e1 100644
--- a/Source/WebKit/chromium/src/WebImageLayer.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.idl
@@ -23,26 +23,14 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
-#include <public/WebImageLayer.h>
+module storage {
-#include "ImageLayerChromium.h"
-
-namespace WebKit {
-
-WebImageLayer WebImageLayer::create()
-{
- return WebImageLayer(WebCore::ImageLayerChromium::create());
-}
-
-WebImageLayer::WebImageLayer(PassRefPtr<WebCore::ImageLayerChromium> layer)
- : WebLayer(layer)
-{
+ interface [
+ Conditional=INDEXED_DATABASE,
+ ActiveDOMObject,
+ EventTarget
+ ] IDBOpenDBRequest : IDBRequest {
+ attribute EventListener onblocked;
+ attribute EventListener onupgradeneeded;
+ };
}
-
-void WebImageLayer::setBitmap(SkBitmap bitmap)
-{
- unwrap<WebCore::ImageLayerChromium>()->setBitmap(bitmap);
-}
-
-} // namespace WebKit
diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
index 1270efccd..a63339f2a 100644
--- a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
@@ -46,22 +46,32 @@ namespace WebCore {
PassRefPtr<IDBRequest> IDBRequest::create(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, IDBTransaction* transaction)
{
- RefPtr<IDBRequest> request(adoptRef(new IDBRequest(context, source, transaction)));
+ RefPtr<IDBRequest> request(adoptRef(new IDBRequest(context, source, IDBTransactionBackendInterface::NormalTask, transaction)));
request->suspendIfNeeded();
return request.release();
}
-IDBRequest::IDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, IDBTransaction* transaction)
+PassRefPtr<IDBRequest> IDBRequest::create(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, IDBTransactionBackendInterface::TaskType taskType, IDBTransaction* transaction)
+{
+ RefPtr<IDBRequest> request(adoptRef(new IDBRequest(context, source, taskType, transaction)));
+ request->suspendIfNeeded();
+ return request.release();
+}
+
+IDBRequest::IDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, IDBTransactionBackendInterface::TaskType taskType, IDBTransaction* transaction)
: ActiveDOMObject(context, this)
+ , m_result(0)
, m_errorCode(0)
- , m_source(source)
+ , m_contextStopped(false)
, m_transaction(transaction)
, m_readyState(PENDING)
, m_requestAborted(false)
- , m_contextStopped(false)
+ , m_source(source)
+ , m_taskType(taskType)
, m_cursorType(IDBCursorBackendInterface::InvalidCursorType)
, m_cursorDirection(IDBCursor::NEXT)
, m_pendingCursor(0)
+ , m_didFireUpgradeNeededEvent(false)
{
if (m_transaction) {
m_transaction->registerRequest(this);
@@ -199,15 +209,19 @@ PassRefPtr<IDBCursor> IDBRequest::getResultCursor()
return 0;
}
-void IDBRequest::setResultCursor(PassRefPtr<IDBCursor> prpCursor)
+void IDBRequest::setResultCursor(PassRefPtr<IDBCursor> cursor, PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue> value)
{
ASSERT(m_readyState == PENDING);
+ m_cursorKey = key;
+ m_cursorPrimaryKey = primaryKey;
+ m_cursorValue = value;
+
if (m_cursorType == IDBCursorBackendInterface::IndexKeyCursor) {
- m_result = IDBAny::create(prpCursor);
+ m_result = IDBAny::create(cursor);
return;
}
- m_result = IDBAny::create(IDBCursorWithValue::fromCursor(prpCursor));
+ m_result = IDBAny::create(IDBCursorWithValue::fromCursor(cursor));
}
bool IDBRequest::shouldEnqueueEvent() const
@@ -250,7 +264,7 @@ void IDBRequest::onSuccess(PassRefPtr<DOMStringList> domStringList)
enqueueEvent(createSuccessEvent());
}
-void IDBRequest::onSuccess(PassRefPtr<IDBCursorBackendInterface> backend)
+void IDBRequest::onSuccess(PassRefPtr<IDBCursorBackendInterface> backend, PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue> value)
{
IDB_TRACE("IDBRequest::onSuccess(IDBCursor)");
if (!shouldEnqueueEvent())
@@ -262,7 +276,7 @@ void IDBRequest::onSuccess(PassRefPtr<IDBCursorBackendInterface> backend)
cursor = IDBCursor::create(backend, m_cursorDirection, this, m_source.get(), m_transaction.get());
else
cursor = IDBCursorWithValue::create(backend, m_cursorDirection, this, m_source.get(), m_transaction.get());
- setResultCursor(cursor);
+ setResultCursor(cursor, key, primaryKey, value);
enqueueEvent(createSuccessEvent());
}
@@ -273,10 +287,15 @@ void IDBRequest::onSuccess(PassRefPtr<IDBDatabaseBackendInterface> backend)
if (!shouldEnqueueEvent())
return;
- RefPtr<IDBDatabase> idbDatabase = IDBDatabase::create(scriptExecutionContext(), backend);
+ RefPtr<IDBDatabase> idbDatabase;
+ if (m_result) {
+ idbDatabase = m_result->idbDatabase();
+ ASSERT(idbDatabase);
+ } else {
+ idbDatabase = IDBDatabase::create(scriptExecutionContext(), backend);
+ m_result = IDBAny::create(idbDatabase.get());
+ }
idbDatabase->registerFrontendCallbacks();
-
- m_result = IDBAny::create(idbDatabase.release());
enqueueEvent(createSuccessEvent());
}
@@ -369,14 +388,14 @@ void IDBRequest::onSuccess(PassRefPtr<SerializedScriptValue> prpSerializedScript
onSuccess(value.release());
}
-void IDBRequest::onSuccessWithContinuation()
+void IDBRequest::onSuccess(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue> value)
{
- IDB_TRACE("IDBRequest::onSuccessWithContinuation");
+ IDB_TRACE("IDBRequest::onSuccess(key, primaryKey, value)");
if (!shouldEnqueueEvent())
return;
ASSERT(m_pendingCursor);
- setResultCursor(m_pendingCursor.release());
+ setResultCursor(m_pendingCursor.release(), key, primaryKey, value);
enqueueEvent(createSuccessEvent());
}
@@ -422,8 +441,7 @@ bool IDBRequest::dispatchEvent(PassRefPtr<Event> event)
ASSERT(m_enqueuedEvents.size());
ASSERT(scriptExecutionContext());
ASSERT(event->target() == this);
- ASSERT_WITH_MESSAGE(m_readyState < DONE, "m_readyState < DONE(%d), was %d", DONE, m_readyState);
-
+ ASSERT_WITH_MESSAGE(m_readyState < DONE, "When dispatching event %s, m_readyState < DONE(%d), was %d", event->type().string().utf8().data(), DONE, m_readyState);
if (event->type() != eventNames().blockedEvent)
m_readyState = DONE;
@@ -448,15 +466,16 @@ bool IDBRequest::dispatchEvent(PassRefPtr<Event> event)
if (event->type() == eventNames().successEvent) {
cursorToNotify = getResultCursor();
if (cursorToNotify)
- cursorToNotify->setValueReady();
+ cursorToNotify->setValueReady(m_cursorKey.release(), m_cursorPrimaryKey.release(), m_cursorValue.release());
}
// FIXME: When we allow custom event dispatching, this will probably need to change.
- ASSERT(event->type() == eventNames().successEvent || event->type() == eventNames().errorEvent || event->type() == eventNames().blockedEvent);
- const bool setTransactionActive = m_transaction && (event->type() == eventNames().successEvent || (event->type() == eventNames().errorEvent && m_errorCode != IDBDatabaseException::IDB_ABORT_ERR));
+ ASSERT_WITH_MESSAGE(event->type() == eventNames().successEvent || event->type() == eventNames().errorEvent || event->type() == eventNames().blockedEvent || event->type() == eventNames().upgradeneededEvent, "event type was %s", event->type().string().utf8().data());
+ const bool setTransactionActive = m_transaction && (event->type() == eventNames().successEvent || event->type() == eventNames().upgradeneededEvent || (event->type() == eventNames().errorEvent && m_errorCode != IDBDatabaseException::IDB_ABORT_ERR));
if (setTransactionActive)
m_transaction->setActive(true);
+
bool dontPreventDefault = IDBEventDispatcher::dispatch(event.get(), targets);
if (setTransactionActive)
m_transaction->setActive(false);
@@ -464,6 +483,11 @@ bool IDBRequest::dispatchEvent(PassRefPtr<Event> event)
if (cursorToNotify)
cursorToNotify->postSuccessHandlerCallback();
+ if (event->type() == eventNames().upgradeneededEvent) {
+ ASSERT(!m_didFireUpgradeNeededEvent);
+ m_didFireUpgradeNeededEvent = true;
+ }
+
if (m_transaction) {
if (event->type() == eventNames().errorEvent && dontPreventDefault && !m_requestAborted) {
m_transaction->setError(m_error);
@@ -490,6 +514,16 @@ void IDBRequest::uncaughtExceptionInEventHandler()
}
}
+void IDBRequest::transactionDidFinishAndDispatch()
+{
+ ASSERT(m_transaction);
+ ASSERT(m_transaction->isVersionChange());
+ ASSERT(m_readyState == DONE);
+ ASSERT(scriptExecutionContext());
+ m_transaction.clear();
+ m_readyState = PENDING;
+}
+
void IDBRequest::enqueueEvent(PassRefPtr<Event> event)
{
ASSERT(m_readyState == PENDING || m_readyState == DONE);
@@ -497,7 +531,7 @@ void IDBRequest::enqueueEvent(PassRefPtr<Event> event)
if (m_contextStopped || !scriptExecutionContext())
return;
- ASSERT(m_readyState == PENDING);
+ ASSERT_WITH_MESSAGE(m_readyState == PENDING || m_didFireUpgradeNeededEvent, "When queueing event %s, m_readyState was %d", event->type().string().utf8().data(), m_readyState);
EventQueue* eventQueue = scriptExecutionContext()->eventQueue();
event->setTarget(this);
diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.h b/Source/WebCore/Modules/indexeddb/IDBRequest.h
index f5cb5b742..7a12496ac 100644
--- a/Source/WebCore/Modules/indexeddb/IDBRequest.h
+++ b/Source/WebCore/Modules/indexeddb/IDBRequest.h
@@ -52,6 +52,7 @@ typedef int ExceptionCode;
class IDBRequest : public IDBCallbacks, public EventTarget, public ActiveDOMObject {
public:
static PassRefPtr<IDBRequest> create(ScriptExecutionContext*, PassRefPtr<IDBAny> source, IDBTransaction*);
+ static PassRefPtr<IDBRequest> create(ScriptExecutionContext*, PassRefPtr<IDBAny> source, IDBTransactionBackendInterface::TaskType, IDBTransaction*);
virtual ~IDBRequest();
PassRefPtr<IDBAny> result(ExceptionCode&) const;
@@ -82,14 +83,15 @@ public:
virtual void onError(PassRefPtr<IDBDatabaseError>);
virtual void onSuccess(PassRefPtr<DOMStringList>);
virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>);
- virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>);
+ virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue>);
virtual void onSuccess(PassRefPtr<IDBKey>);
virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>);
virtual void onSuccess(PassRefPtr<SerializedScriptValue>);
virtual void onSuccess(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, const IDBKeyPath&);
- virtual void onSuccessWithContinuation();
+ virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue>);
virtual void onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<SerializedScriptValue> >&) { ASSERT_NOT_REACHED(); } // Not implemented. Callback should not reach the renderer side.
virtual void onBlocked();
+ virtual void onBlocked(int64_t existingVersion) { ASSERT_NOT_REACHED(); }
// ActiveDOMObject
virtual bool hasPendingActivity() const OVERRIDE;
@@ -102,18 +104,26 @@ public:
bool dispatchEvent(PassRefPtr<Event> event, ExceptionCode& ec) { return EventTarget::dispatchEvent(event, ec); }
virtual void uncaughtExceptionInEventHandler();
+ void transactionDidFinishAndDispatch();
+
using ThreadSafeRefCounted<IDBCallbacks>::ref;
using ThreadSafeRefCounted<IDBCallbacks>::deref;
+ IDBTransactionBackendInterface::TaskType taskType() { return m_taskType; }
+
protected:
- IDBRequest(ScriptExecutionContext*, PassRefPtr<IDBAny> source, IDBTransaction*);
+ IDBRequest(ScriptExecutionContext*, PassRefPtr<IDBAny> source, IDBTransactionBackendInterface::TaskType, IDBTransaction*);
void enqueueEvent(PassRefPtr<Event>);
- bool shouldEnqueueEvent() const;
+ virtual bool shouldEnqueueEvent() const;
RefPtr<IDBAny> m_result;
unsigned short m_errorCode;
String m_errorMessage;
RefPtr<DOMError> m_error;
+ bool m_contextStopped;
+ RefPtr<IDBTransaction> m_transaction;
+ ReadyState m_readyState;
+ bool m_requestAborted; // May be aborted by transaction then receive async onsuccess; ignore vs. assert.
private:
// EventTarget
@@ -123,20 +133,21 @@ private:
virtual EventTargetData* ensureEventTargetData();
PassRefPtr<IDBCursor> getResultCursor();
- void setResultCursor(PassRefPtr<IDBCursor>);
+ void setResultCursor(PassRefPtr<IDBCursor>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue>);
RefPtr<IDBAny> m_source;
- RefPtr<IDBTransaction> m_transaction;
+ const IDBTransactionBackendInterface::TaskType m_taskType;
- ReadyState m_readyState;
- bool m_requestAborted; // May be aborted by transaction then receive async onsuccess; ignore vs. assert.
- bool m_contextStopped;
Vector<RefPtr<Event> > m_enqueuedEvents;
// Only used if the result type will be a cursor.
IDBCursorBackendInterface::CursorType m_cursorType;
IDBCursor::Direction m_cursorDirection;
RefPtr<IDBCursor> m_pendingCursor;
+ RefPtr<IDBKey> m_cursorKey;
+ RefPtr<IDBKey> m_cursorPrimaryKey;
+ RefPtr<SerializedScriptValue> m_cursorValue;
+ bool m_didFireUpgradeNeededEvent;
EventTargetData m_eventTargetData;
};
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
index 761234701..50216f6b3 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
@@ -36,6 +36,7 @@
#include "IDBIndex.h"
#include "IDBObjectStore.h"
#include "IDBObjectStoreBackendInterface.h"
+#include "IDBOpenDBRequest.h"
#include "IDBPendingTransactionMonitor.h"
#include "IDBTracing.h"
@@ -43,7 +44,13 @@ namespace WebCore {
PassRefPtr<IDBTransaction> IDBTransaction::create(ScriptExecutionContext* context, PassRefPtr<IDBTransactionBackendInterface> backend, IDBTransaction::Mode mode, IDBDatabase* db)
{
- RefPtr<IDBTransaction> transaction(adoptRef(new IDBTransaction(context, backend, mode, db)));
+ IDBOpenDBRequest* openDBRequest = 0;
+ return create(context, backend, mode, db, openDBRequest);
+}
+
+PassRefPtr<IDBTransaction> IDBTransaction::create(ScriptExecutionContext* context, PassRefPtr<IDBTransactionBackendInterface> backend, IDBTransaction::Mode mode, IDBDatabase* db, IDBOpenDBRequest* openDBRequest)
+{
+ RefPtr<IDBTransaction> transaction(adoptRef(new IDBTransaction(context, backend, mode, db, openDBRequest)));
transaction->suspendIfNeeded();
return transaction.release();
}
@@ -79,10 +86,11 @@ const AtomicString& IDBTransaction::modeReadWriteLegacy()
}
-IDBTransaction::IDBTransaction(ScriptExecutionContext* context, PassRefPtr<IDBTransactionBackendInterface> backend, IDBTransaction::Mode mode, IDBDatabase* db)
+IDBTransaction::IDBTransaction(ScriptExecutionContext* context, PassRefPtr<IDBTransactionBackendInterface> backend, IDBTransaction::Mode mode, IDBDatabase* db, IDBOpenDBRequest* openDBRequest)
: ActiveDOMObject(context, this)
, m_backend(backend)
, m_database(db)
+ , m_openDBRequest(openDBRequest)
, m_mode(mode)
, m_active(true)
, m_state(Unused)
@@ -182,7 +190,7 @@ void IDBTransaction::objectStoreDeleted(const String& name)
void IDBTransaction::setActive(bool active)
{
- ASSERT(m_state != Finished);
+ ASSERT_WITH_MESSAGE(m_state != Finished, "A finished transaction tried to setActive(%s)", active ? "true" : "false");
if (m_state == Finishing)
return;
ASSERT(m_state == Unused || m_state == Used);
@@ -262,6 +270,7 @@ void IDBTransaction::unregisterRequest(IDBRequest* request)
void IDBTransaction::onAbort()
{
+ IDB_TRACE("IDBTransaction::onAbort");
ASSERT(m_state != Finished);
if (m_state != Finishing) {
@@ -294,6 +303,7 @@ void IDBTransaction::onAbort()
void IDBTransaction::onComplete()
{
+ IDB_TRACE("IDBTransaction::onComplete");
ASSERT(m_state != Finished);
m_state = Finishing;
m_objectStoreCleanupMap.clear();
@@ -375,7 +385,14 @@ bool IDBTransaction::dispatchEvent(PassRefPtr<Event> event)
// FIXME: When we allow custom event dispatching, this will probably need to change.
ASSERT(event->type() == eventNames().completeEvent || event->type() == eventNames().abortEvent);
- return IDBEventDispatcher::dispatch(event.get(), targets);
+ bool returnValue = IDBEventDispatcher::dispatch(event.get(), targets);
+ // FIXME: Try to construct a test where |this| outlives openDBRequest and we
+ // get a crash.
+ if (m_openDBRequest) {
+ ASSERT(isVersionChange());
+ m_openDBRequest->transactionDidFinishAndDispatch();
+ }
+ return returnValue;
}
bool IDBTransaction::canSuspend() const
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.h b/Source/WebCore/Modules/indexeddb/IDBTransaction.h
index 1f7af7dad..005e37363 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.h
+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.h
@@ -46,6 +46,7 @@ namespace WebCore {
class IDBCursor;
class IDBDatabase;
class IDBObjectStore;
+class IDBOpenDBRequest;
class IDBTransaction : public IDBTransactionCallbacks, public EventTarget, public ActiveDOMObject {
public:
@@ -56,6 +57,7 @@ public:
};
static PassRefPtr<IDBTransaction> create(ScriptExecutionContext*, PassRefPtr<IDBTransactionBackendInterface>, Mode, IDBDatabase*);
+ static PassRefPtr<IDBTransaction> create(ScriptExecutionContext*, PassRefPtr<IDBTransactionBackendInterface>, Mode, IDBDatabase*, IDBOpenDBRequest*);
virtual ~IDBTransaction();
static const AtomicString& modeReadOnly();
@@ -119,7 +121,7 @@ public:
using RefCounted<IDBTransactionCallbacks>::deref;
private:
- IDBTransaction(ScriptExecutionContext*, PassRefPtr<IDBTransactionBackendInterface>, Mode, IDBDatabase*);
+ IDBTransaction(ScriptExecutionContext*, PassRefPtr<IDBTransactionBackendInterface>, Mode, IDBDatabase*, IDBOpenDBRequest*);
void enqueueEvent(PassRefPtr<Event>);
void closeOpenCursors();
@@ -142,6 +144,7 @@ private:
RefPtr<IDBTransactionBackendInterface> m_backend;
RefPtr<IDBDatabase> m_database;
+ IDBOpenDBRequest* m_openDBRequest;
const Mode m_mode;
bool m_active;
State m_state;
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp
index 1bbd23b56..2a6b82268 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp
@@ -51,6 +51,7 @@ IDBTransactionBackendImpl::IDBTransactionBackendImpl(DOMStringList* objectStores
, m_transaction(database->backingStore()->createTransaction())
, m_taskTimer(this, &IDBTransactionBackendImpl::taskTimerFired)
, m_taskEventTimer(this, &IDBTransactionBackendImpl::taskEventTimerFired)
+ , m_pendingPreemptiveEvents(0)
, m_pendingEvents(0)
{
ASSERT(m_objectStoreNames);
@@ -89,12 +90,16 @@ PassRefPtr<IDBObjectStoreBackendInterface> IDBTransactionBackendImpl::objectStor
return objectStore.release();
}
-bool IDBTransactionBackendImpl::scheduleTask(PassOwnPtr<ScriptExecutionContext::Task> task, PassOwnPtr<ScriptExecutionContext::Task> abortTask)
+bool IDBTransactionBackendImpl::scheduleTask(TaskType type, PassOwnPtr<ScriptExecutionContext::Task> task, PassOwnPtr<ScriptExecutionContext::Task> abortTask)
{
if (m_state == Finished)
return false;
- m_taskQueue.append(task);
+ if (type == NormalTask)
+ m_taskQueue.append(task);
+ else
+ m_preemptiveTaskQueue.append(task);
+
if (abortTask)
m_abortTaskQueue.prepend(abortTask);
@@ -149,6 +154,11 @@ void IDBTransactionBackendImpl::abort()
m_database = 0;
}
+bool IDBTransactionBackendImpl::isTaskQueueEmpty() const
+{
+ return m_preemptiveTaskQueue.isEmpty() && m_taskQueue.isEmpty();
+}
+
void IDBTransactionBackendImpl::registerOpenCursor(IDBCursorBackendImpl* cursor)
{
m_openCursors.add(cursor);
@@ -203,7 +213,7 @@ void IDBTransactionBackendImpl::commit()
// alive while executing this method.
RefPtr<IDBTransactionBackendImpl> self(this);
ASSERT(m_state == Unused || m_state == Running);
- ASSERT(m_taskQueue.isEmpty());
+ ASSERT(isTaskQueueEmpty());
bool unused = m_state == Unused;
m_state = Finished;
@@ -235,19 +245,20 @@ void IDBTransactionBackendImpl::commit()
void IDBTransactionBackendImpl::taskTimerFired(Timer<IDBTransactionBackendImpl>*)
{
IDB_TRACE("IDBTransactionBackendImpl::taskTimerFired");
- ASSERT(!m_taskQueue.isEmpty());
+ ASSERT(!isTaskQueueEmpty());
if (m_state == StartPending) {
m_transaction->begin();
m_state = Running;
}
- TaskQueue queue;
- queue.swap(m_taskQueue);
- while (!queue.isEmpty() && m_state != Finished) {
+ // Just process a single event here, in case the event itself
+ // changes which queue should be processed next.
+ TaskQueue& taskQueue = m_pendingPreemptiveEvents ? m_preemptiveTaskQueue : m_taskQueue;
+ if (!taskQueue.isEmpty() && m_state != Finished) {
ASSERT(m_state == Running);
- OwnPtr<ScriptExecutionContext::Task> task(queue.first().release());
- queue.removeFirst();
+ OwnPtr<ScriptExecutionContext::Task> task(taskQueue.first().release());
+ taskQueue.removeFirst();
m_pendingEvents++;
task->performTask(0);
}
@@ -258,7 +269,7 @@ void IDBTransactionBackendImpl::taskEventTimerFired(Timer<IDBTransactionBackendI
IDB_TRACE("IDBTransactionBackendImpl::taskEventTimerFired");
ASSERT(m_state == Running);
- if (!m_pendingEvents && m_taskQueue.isEmpty()) {
+ if (!m_pendingEvents && isTaskQueueEmpty()) {
// The last task event has completed and the task
// queue is empty. Commit the transaction.
commit();
@@ -268,7 +279,7 @@ void IDBTransactionBackendImpl::taskEventTimerFired(Timer<IDBTransactionBackendI
// We are still waiting for other events to complete. However,
// the task queue is non-empty and the timer is inactive.
// We can therfore schedule the timer again.
- if (!m_taskQueue.isEmpty() && !m_taskTimer.isActive())
+ if (!isTaskQueueEmpty() && !m_taskTimer.isActive())
m_taskTimer.startOneShot(0);
}
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h b/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h
index daa39e1c3..24c4fee04 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h
+++ b/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h
@@ -58,10 +58,13 @@ public:
void run();
unsigned short mode() const { return m_mode; }
- bool scheduleTask(PassOwnPtr<ScriptExecutionContext::Task>, PassOwnPtr<ScriptExecutionContext::Task> abortTask = nullptr);
+ bool scheduleTask(PassOwnPtr<ScriptExecutionContext::Task> task, PassOwnPtr<ScriptExecutionContext::Task> abortTask = nullptr) { return scheduleTask(NormalTask, task, abortTask); }
+ bool scheduleTask(TaskType, PassOwnPtr<ScriptExecutionContext::Task>, PassOwnPtr<ScriptExecutionContext::Task> abortTask = nullptr);
void registerOpenCursor(IDBCursorBackendImpl*);
void unregisterOpenCursor(IDBCursorBackendImpl*);
void addPendingEvents(int);
+ void addPreemptiveEvent() { m_pendingPreemptiveEvents++; }
+ void didCompletePreemptiveEvent() { m_pendingPreemptiveEvents--; ASSERT(m_pendingPreemptiveEvents >= 0); }
private:
IDBTransactionBackendImpl(DOMStringList* objectStores, unsigned short mode, IDBDatabaseBackendImpl*);
@@ -76,6 +79,8 @@ private:
void start();
void commit();
+ bool isTaskQueueEmpty() const;
+
void taskTimerFired(Timer<IDBTransactionBackendImpl>*);
void taskEventTimerFired(Timer<IDBTransactionBackendImpl>*);
void closeOpenCursors();
@@ -89,6 +94,7 @@ private:
typedef Deque<OwnPtr<ScriptExecutionContext::Task> > TaskQueue;
TaskQueue m_taskQueue;
+ TaskQueue m_preemptiveTaskQueue;
TaskQueue m_abortTaskQueue;
RefPtr<IDBBackingStore::Transaction> m_transaction;
@@ -96,6 +102,7 @@ private:
// FIXME: delete the timer once we have threads instead.
Timer<IDBTransactionBackendImpl> m_taskTimer;
Timer<IDBTransactionBackendImpl> m_taskEventTimer;
+ int m_pendingPreemptiveEvents;
int m_pendingEvents;
HashSet<IDBCursorBackendImpl*> m_openCursors;
diff --git a/Source/WebCore/Modules/indexeddb/IDBUpgradeNeededEvent.cpp b/Source/WebCore/Modules/indexeddb/IDBUpgradeNeededEvent.cpp
new file mode 100644
index 000000000..39420280e
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/IDBUpgradeNeededEvent.cpp
@@ -0,0 +1,69 @@
+/*
+ * 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 "IDBUpgradeNeededEvent.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "EventNames.h"
+#include "IDBAny.h"
+
+namespace WebCore {
+
+PassRefPtr<IDBUpgradeNeededEvent> IDBUpgradeNeededEvent::create(int64_t oldVersion, int64_t newVersion, const AtomicString& eventType)
+{
+ return adoptRef(new IDBUpgradeNeededEvent(oldVersion, newVersion, eventType));
+}
+
+IDBUpgradeNeededEvent::IDBUpgradeNeededEvent(int64_t oldVersion, int64_t newVersion, const AtomicString& eventType)
+ : Event(eventType, false /*canBubble*/, false /*cancelable*/)
+ , m_oldVersion(oldVersion)
+ , m_newVersion(newVersion)
+{
+}
+
+IDBUpgradeNeededEvent::~IDBUpgradeNeededEvent()
+{
+}
+
+int64_t IDBUpgradeNeededEvent::oldVersion()
+{
+ return m_oldVersion;
+}
+
+int64_t IDBUpgradeNeededEvent::newVersion()
+{
+ return m_newVersion;
+}
+
+const AtomicString& IDBUpgradeNeededEvent::interfaceName() const
+{
+ return eventNames().interfaceForIDBUpgradeNeededEvent;
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/Modules/indexeddb/IDBUpgradeNeededEvent.h b/Source/WebCore/Modules/indexeddb/IDBUpgradeNeededEvent.h
new file mode 100644
index 000000000..9785664f0
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/IDBUpgradeNeededEvent.h
@@ -0,0 +1,62 @@
+/*
+ * 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 IDBUpgradeNeededEvent_h
+#define IDBUpgradeNeededEvent_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "Event.h"
+#include "IDBMetadata.h"
+#include "PlatformString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class IDBAny;
+
+class IDBUpgradeNeededEvent : public Event {
+public:
+ static PassRefPtr<IDBUpgradeNeededEvent> create(int64_t oldVersion = IDBDatabaseMetadata::NoIntVersion, int64_t newVersion = IDBDatabaseMetadata::NoIntVersion, const AtomicString& eventType = AtomicString());
+ virtual ~IDBUpgradeNeededEvent();
+
+ virtual int64_t oldVersion();
+ virtual int64_t newVersion();
+
+ virtual const AtomicString& interfaceName() const;
+
+private:
+ IDBUpgradeNeededEvent(int64_t oldVersion, int64_t newVersion, const AtomicString& eventType);
+
+ int64_t m_oldVersion;
+ int64_t m_newVersion;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
+#endif // IDBUpgradeNeededEvent_h
diff --git a/Source/WebKit/chromium/src/WebSolidColorLayer.cpp b/Source/WebCore/Modules/indexeddb/IDBUpgradeNeededEvent.idl
index 83914b263..32999548f 100644
--- a/Source/WebKit/chromium/src/WebSolidColorLayer.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBUpgradeNeededEvent.idl
@@ -23,27 +23,13 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
-#include <public/WebSolidColorLayer.h>
+module storage {
-#include "WebSolidColorLayerImpl.h"
-#include <public/WebFloatRect.h>
-
-namespace WebKit {
-
-WebSolidColorLayer WebSolidColorLayer::create()
-{
- return WebSolidColorLayer(WebSolidColorLayerImpl::create());
-}
-
-WebSolidColorLayer::WebSolidColorLayer(const PassRefPtr<WebSolidColorLayerImpl>& node)
- : WebLayer(node)
-{
+ interface [
+ Conditional=INDEXED_DATABASE,
+ InterfaceName=IDBVersionChangeEvent
+ ] IDBUpgradeNeededEvent : Event {
+ readonly attribute unsigned long long oldVersion;
+ readonly attribute unsigned long long newVersion;
+ };
}
-
-void WebSolidColorLayer::setBackgroundColor(const WebColor& color)
-{
- m_private->setBackgroundColor(color);
-}
-
-} // namespace WebKit
diff --git a/Source/WebCore/Modules/indexeddb/IDBVersionChangeRequest.cpp b/Source/WebCore/Modules/indexeddb/IDBVersionChangeRequest.cpp
index c741a7be4..92f4ef123 100644
--- a/Source/WebCore/Modules/indexeddb/IDBVersionChangeRequest.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBVersionChangeRequest.cpp
@@ -42,7 +42,7 @@ PassRefPtr<IDBVersionChangeRequest> IDBVersionChangeRequest::create(ScriptExecut
}
IDBVersionChangeRequest::IDBVersionChangeRequest(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, const String& version)
- : IDBRequest(context, source, 0)
+ : IDBRequest(context, source, IDBTransactionBackendInterface::NormalTask, 0)
, m_version(version)
{
}
diff --git a/Source/WebCore/Modules/mediasource/MediaSource.cpp b/Source/WebCore/Modules/mediasource/MediaSource.cpp
index 6f84d9439..cc4f9d7d7 100644
--- a/Source/WebCore/Modules/mediasource/MediaSource.cpp
+++ b/Source/WebCore/Modules/mediasource/MediaSource.cpp
@@ -49,7 +49,6 @@ MediaSource::MediaSource(ScriptExecutionContext* context)
: ContextDestructionObserver(context)
, m_readyState(closedKeyword())
, m_player(0)
- , m_nextSourceBufferId(0)
{
m_sourceBuffers = SourceBufferList::create(scriptExecutionContext());
m_activeSourceBuffers = SourceBufferList::create(scriptExecutionContext());
@@ -94,7 +93,13 @@ SourceBuffer* MediaSource::addSourceBuffer(const String& type, ExceptionCode& ec
}
// 5. Create a new SourceBuffer object and associated resources.
- RefPtr<SourceBuffer> buffer = SourceBuffer::create(String::number(++m_nextSourceBufferId), this);
+ String id = m_sourceBuffers->generateUniqueId();
+ if (id == emptyString()) {
+ ec = QUOTA_EXCEEDED_ERR;
+ return 0;
+ }
+
+ RefPtr<SourceBuffer> buffer = SourceBuffer::create(id, this);
switch (m_player->sourceAddId(buffer->id(), contentType.type(), codecs)) {
case MediaPlayer::Ok:
@@ -262,6 +267,20 @@ void MediaSource::abort(const String& id, ExceptionCode& ec)
ASSERT_NOT_REACHED();
}
+bool MediaSource::setTimestampOffset(const String& id, double offset, ExceptionCode& ec)
+{
+ if (!m_player || m_readyState != openKeyword()) {
+ ec = INVALID_STATE_ERR;
+ return false;
+ }
+
+ if (!m_player->sourceSetTimestampOffset(id, offset)) {
+ ec = INVALID_STATE_ERR;
+ return false;
+ }
+ return true;
+}
+
const AtomicString& MediaSource::interfaceName() const
{
return eventNames().interfaceForMediaSource;
diff --git a/Source/WebCore/Modules/mediasource/MediaSource.h b/Source/WebCore/Modules/mediasource/MediaSource.h
index 646ac3ae7..b63833369 100644
--- a/Source/WebCore/Modules/mediasource/MediaSource.h
+++ b/Source/WebCore/Modules/mediasource/MediaSource.h
@@ -80,6 +80,7 @@ public:
PassRefPtr<TimeRanges> buffered(const String& id, ExceptionCode&) const;
void append(const String& id, PassRefPtr<Uint8Array> data, ExceptionCode&);
void abort(const String& id, ExceptionCode&);
+ bool setTimestampOffset(const String& id, double, ExceptionCode&);
// EventTarget interface
virtual const AtomicString& interfaceName() const OVERRIDE;
@@ -104,7 +105,6 @@ private:
RefPtr<SourceBufferList> m_sourceBuffers;
RefPtr<SourceBufferList> m_activeSourceBuffers;
- int m_nextSourceBufferId;
};
} // namespace WebCore
diff --git a/Source/WebCore/Modules/mediasource/SourceBuffer.cpp b/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
index 591910803..1d6e606a7 100644
--- a/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
+++ b/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
@@ -41,6 +41,7 @@ namespace WebCore {
SourceBuffer::SourceBuffer(const String& id, PassRefPtr<MediaSource> source)
: m_id(id)
, m_source(source)
+ , m_timestampOffset(0)
{
}
@@ -58,6 +59,22 @@ PassRefPtr<TimeRanges> SourceBuffer::buffered(ExceptionCode& ec) const
return m_source->buffered(id(), ec);
}
+double SourceBuffer::timestampOffset() const
+{
+ return m_timestampOffset;
+}
+
+void SourceBuffer::setTimestampOffset(double offset, ExceptionCode& ec)
+{
+ if (!m_source) {
+ ec = INVALID_STATE_ERR;
+ return;
+ }
+
+ if (m_source->setTimestampOffset(id(), offset, ec))
+ m_timestampOffset = offset;
+}
+
void SourceBuffer::append(PassRefPtr<Uint8Array> data, ExceptionCode& ec)
{
if (!m_source) {
diff --git a/Source/WebCore/Modules/mediasource/SourceBuffer.h b/Source/WebCore/Modules/mediasource/SourceBuffer.h
index d180dd4d7..7d1e5861c 100644
--- a/Source/WebCore/Modules/mediasource/SourceBuffer.h
+++ b/Source/WebCore/Modules/mediasource/SourceBuffer.h
@@ -54,6 +54,9 @@ public:
PassRefPtr<TimeRanges> buffered(ExceptionCode&) const;
+ double timestampOffset() const;
+ void setTimestampOffset(double, ExceptionCode&);
+
void append(PassRefPtr<Uint8Array> data, ExceptionCode&);
void abort(ExceptionCode&);
@@ -67,6 +70,8 @@ private:
String m_id;
RefPtr<MediaSource> m_source;
+
+ double m_timestampOffset;
};
} // namespace WebCore
diff --git a/Source/WebCore/Modules/mediasource/SourceBuffer.idl b/Source/WebCore/Modules/mediasource/SourceBuffer.idl
index 412b9cb61..c7c6eb3ab 100644
--- a/Source/WebCore/Modules/mediasource/SourceBuffer.idl
+++ b/Source/WebCore/Modules/mediasource/SourceBuffer.idl
@@ -39,6 +39,10 @@ module html {
readonly attribute TimeRanges buffered
getter raises(DOMException);
+ // Applies an offset to media segment timestamps.
+ attribute double timestampOffset
+ setter raises(DOMException);
+
// Append segment data.
void append(in Uint8Array data) raises (DOMException);
diff --git a/Source/WebCore/Modules/mediasource/SourceBufferList.cpp b/Source/WebCore/Modules/mediasource/SourceBufferList.cpp
index 662b46f0f..ce213d514 100644
--- a/Source/WebCore/Modules/mediasource/SourceBufferList.cpp
+++ b/Source/WebCore/Modules/mediasource/SourceBufferList.cpp
@@ -40,6 +40,7 @@ namespace WebCore {
SourceBufferList::SourceBufferList(ScriptExecutionContext* context)
: m_scriptExecutionContext(context)
+ , m_lastSourceBufferId(0)
{
}
@@ -79,6 +80,34 @@ void SourceBufferList::clear()
remove(m_list[i].get());
}
+String SourceBufferList::generateUniqueId()
+{
+ // Ensure a unique id. Until m_lastSourceBufferId wraps around (very unlikely),
+ // this loop will exit after one check. If m_lastSourceBufferId does wrap,
+ // this loop may run as many times as the size of m_list, but in most
+ // cases that should be less than 10. We may want to investigate a more
+ // efficient approach if many more SourceBuffers are allowed in the future.
+ size_t nextSourceBufferId = m_lastSourceBufferId + 1;
+
+ while (contains(nextSourceBufferId)) {
+ if (nextSourceBufferId == m_lastSourceBufferId)
+ return emptyString();
+ nextSourceBufferId++;
+ }
+ m_lastSourceBufferId = nextSourceBufferId;
+
+ return String::number(nextSourceBufferId);
+}
+
+bool SourceBufferList::contains(size_t id) const
+{
+ for (size_t i = 0; i < m_list.size(); ++i) {
+ if (m_list[i]->id() == String::number(id))
+ return true;
+ }
+ return false;
+}
+
void SourceBufferList::createAndFireEvent(const AtomicString& eventName)
{
RefPtr<Event> event = Event::create(eventName, false, false);
diff --git a/Source/WebCore/Modules/mediasource/SourceBufferList.h b/Source/WebCore/Modules/mediasource/SourceBufferList.h
index 6f7f9a789..c87cf34c8 100644
--- a/Source/WebCore/Modules/mediasource/SourceBufferList.h
+++ b/Source/WebCore/Modules/mediasource/SourceBufferList.h
@@ -56,6 +56,10 @@ public:
bool remove(SourceBuffer*);
void clear();
+ // Generates an id for adding a new SourceBuffer. Returns an empty string
+ // if this SourceBufferList is full.
+ String generateUniqueId();
+
// EventTarget interface
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
@@ -70,6 +74,7 @@ protected:
private:
explicit SourceBufferList(ScriptExecutionContext*);
+ bool contains(size_t id) const;
void createAndFireEvent(const AtomicString&);
virtual void refEventTarget() OVERRIDE { ref(); }
@@ -79,6 +84,7 @@ private:
ScriptExecutionContext* m_scriptExecutionContext;
Vector<RefPtr<SourceBuffer> > m_list;
+ size_t m_lastSourceBufferId;
};
} // namespace WebCore
diff --git a/Source/WebCore/Modules/mediastream/LocalMediaStream.h b/Source/WebCore/Modules/mediastream/LocalMediaStream.h
index e76d434f1..7c48107b1 100644
--- a/Source/WebCore/Modules/mediastream/LocalMediaStream.h
+++ b/Source/WebCore/Modules/mediastream/LocalMediaStream.h
@@ -40,6 +40,9 @@ public:
void stop();
+ // MediaStream
+ virtual bool isLocal() const OVERRIDE { return true; }
+
// EventTarget
virtual const AtomicString& interfaceName() const OVERRIDE;
diff --git a/Source/WebCore/Modules/mediastream/MediaStream.h b/Source/WebCore/Modules/mediastream/MediaStream.h
index bcdd25dc5..fc8d6679e 100644
--- a/Source/WebCore/Modules/mediastream/MediaStream.h
+++ b/Source/WebCore/Modules/mediastream/MediaStream.h
@@ -56,6 +56,8 @@ public:
MediaStreamTrackList* audioTracks() { return m_audioTracks.get(); }
MediaStreamTrackList* videoTracks() { return m_videoTracks.get(); }
+ virtual bool isLocal() const { return false; }
+
// MediaStreamDescriptorOwner
virtual void streamEnded() OVERRIDE;
diff --git a/Source/WebCore/Modules/vibration/Vibration.cpp b/Source/WebCore/Modules/vibration/Vibration.cpp
index a1da4b047..2a531fddd 100644
--- a/Source/WebCore/Modules/vibration/Vibration.cpp
+++ b/Source/WebCore/Modules/vibration/Vibration.cpp
@@ -58,11 +58,14 @@ void Vibration::vibrate(const VibrationPattern& pattern)
{
int length = pattern.size();
- if (m_isVibrating)
+ // Cancel the pre-existing instance of vibration patterns, if the pattern is 0 or an empty list.
+ if (!length || (length == 1 && !pattern[0])) {
cancelVibration();
-
- if (!length || (length == 1 && !pattern[0]))
return;
+ }
+
+ if (m_isVibrating)
+ cancelVibration();
if (m_timerStart.isActive())
m_timerStart.stop();
@@ -73,6 +76,7 @@ void Vibration::vibrate(const VibrationPattern& pattern)
void Vibration::cancelVibration()
{
+ m_pattern.clear();
if (m_isVibrating) {
m_vibrationClient->cancelVibration();
m_isVibrating = false;
diff --git a/Source/WebCore/Modules/webaudio/AudioContext.cpp b/Source/WebCore/Modules/webaudio/AudioContext.cpp
index ab8e17228..599c8b61a 100644
--- a/Source/WebCore/Modules/webaudio/AudioContext.cpp
+++ b/Source/WebCore/Modules/webaudio/AudioContext.cpp
@@ -401,8 +401,19 @@ PassRefPtr<MediaStreamAudioSourceNode> AudioContext::createMediaStreamSource(Med
ASSERT(isMainThread());
lazyInitialize();
- // FIXME: For now we don't give it an AudioSourceProvider, so it will output silence.
- RefPtr<MediaStreamAudioSourceNode> node = MediaStreamAudioSourceNode::create(this, mediaStream, 0);
+ AudioSourceProvider* provider = 0;
+
+ if (mediaStream->isLocal() && mediaStream->audioTracks()->length())
+ provider = destination()->localAudioInputProvider();
+ else {
+ // FIXME: get a provider for non-local MediaStreams (like from a remote peer).
+ provider = 0;
+ }
+
+ RefPtr<MediaStreamAudioSourceNode> node = MediaStreamAudioSourceNode::create(this, mediaStream, provider);
+
+ // FIXME: Only stereo streams are supported right now. We should be able to accept multi-channel streams.
+ node->setFormat(2, sampleRate());
refNode(node.get()); // context keeps reference until node is disconnected
return node;
diff --git a/Source/WebCore/Modules/webaudio/AudioParam.cpp b/Source/WebCore/Modules/webaudio/AudioParam.cpp
index 15c67431d..c525b2e6c 100644
--- a/Source/WebCore/Modules/webaudio/AudioParam.cpp
+++ b/Source/WebCore/Modules/webaudio/AudioParam.cpp
@@ -94,6 +94,13 @@ bool AudioParam::smooth()
return false;
}
+float AudioParam::finalValue()
+{
+ float value;
+ calculateFinalValues(&value, 1, false);
+ return value;
+}
+
void AudioParam::calculateSampleAccurateValues(float* values, unsigned numberOfValues)
{
bool isSafe = context() && context()->isAudioThread() && values && numberOfValues;
@@ -101,31 +108,30 @@ void AudioParam::calculateSampleAccurateValues(float* values, unsigned numberOfV
if (!isSafe)
return;
- if (numberOfRenderingConnections())
- calculateAudioRateSignalValues(values, numberOfValues);
- else
- calculateTimelineValues(values, numberOfValues);
+ calculateFinalValues(values, numberOfValues, true);
}
-void AudioParam::calculateAudioRateSignalValues(float* values, unsigned numberOfValues)
+void AudioParam::calculateFinalValues(float* values, unsigned numberOfValues, bool sampleAccurate)
{
- bool isGood = numberOfRenderingConnections() && numberOfValues;
+ bool isGood = context() && context()->isAudioThread() && values && numberOfValues;
ASSERT(isGood);
if (!isGood)
return;
// The calculated result will be the "intrinsic" value summed with all audio-rate connections.
- if (m_timeline.hasValues()) {
- // Calculate regular timeline values, if we have any.
+ if (sampleAccurate) {
+ // Calculate sample-accurate (a-rate) intrinsic values.
calculateTimelineValues(values, numberOfValues);
} else {
- // Otherwise set values array to our constant value.
- float value = m_value; // Cache in local.
+ // Calculate control-rate (k-rate) intrinsic value.
+ bool hasValue;
+ float timelineValue = m_timeline.valueForContextTime(context(), narrowPrecisionToFloat(m_value), hasValue);
+
+ if (hasValue)
+ m_value = timelineValue;
- // FIXME: can be optimized if we create a new VectorMath function.
- for (unsigned i = 0; i < numberOfValues; ++i)
- values[i] = value;
+ values[0] = narrowPrecisionToFloat(m_value);
}
// Now sum all of the audio-rate connections together (unity-gain summing junction).
@@ -138,7 +144,7 @@ void AudioParam::calculateAudioRateSignalValues(float* values, unsigned numberOf
ASSERT(output);
// Render audio from this output.
- AudioBus* connectionBus = output->pull(0, numberOfValues);
+ AudioBus* connectionBus = output->pull(0, AudioNode::ProcessingSizeInFrames);
// Sum, with unity-gain.
summingBus.sumFrom(*connectionBus);
diff --git a/Source/WebCore/Modules/webaudio/AudioParam.h b/Source/WebCore/Modules/webaudio/AudioParam.h
index 90fde3b52..7160b8297 100644
--- a/Source/WebCore/Modules/webaudio/AudioParam.h
+++ b/Source/WebCore/Modules/webaudio/AudioParam.h
@@ -56,9 +56,14 @@ public:
virtual bool canUpdateState() OVERRIDE { return true; }
virtual void didUpdate() OVERRIDE { }
+ // Intrinsic value.
float value();
void setValue(float);
+ // Final value for k-rate parameters, otherwise use calculateSampleAccurateValues() for a-rate.
+ // Must be called in the audio thread.
+ float finalValue();
+
String name() const { return m_name; }
float minValue() const { return static_cast<float>(m_minValue); }
@@ -112,7 +117,8 @@ protected:
}
private:
- void calculateAudioRateSignalValues(float* values, unsigned numberOfValues);
+ // sampleAccurate corresponds to a-rate (audio rate) vs. k-rate in the Web Audio specification.
+ void calculateFinalValues(float* values, unsigned numberOfValues, bool sampleAccurate);
void calculateTimelineValues(float* values, unsigned numberOfValues);
String m_name;
diff --git a/Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp b/Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp
index c02121832..9b5c2c472 100644
--- a/Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp
+++ b/Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp
@@ -170,7 +170,6 @@ float AudioParamTimeline::valuesForTimeRangeImpl(float startTime,
return defaultValue;
// Return default value if there are no events matching the desired time range.
- ASSERT(m_events.size());
if (!m_events.size() || endTime <= m_events[0].time()) {
for (unsigned i = 0; i < numberOfValues; ++i)
values[i] = defaultValue;
diff --git a/Source/WebCore/Modules/webaudio/ConvolverNode.idl b/Source/WebCore/Modules/webaudio/ConvolverNode.idl
index 0f561f0ff..d1c2c5b7a 100644
--- a/Source/WebCore/Modules/webaudio/ConvolverNode.idl
+++ b/Source/WebCore/Modules/webaudio/ConvolverNode.idl
@@ -28,7 +28,7 @@ module audio {
Conditional=WEB_AUDIO,
JSGenerateToJSObject
] ConvolverNode : AudioNode {
- attribute [JSCustomSetter] AudioBuffer buffer;
+ attribute AudioBuffer buffer;
attribute boolean normalize;
};
}
diff --git a/Source/WebCore/Modules/webaudio/DelayDSPKernel.cpp b/Source/WebCore/Modules/webaudio/DelayDSPKernel.cpp
index 1f35e55a2..7838256a8 100644
--- a/Source/WebCore/Modules/webaudio/DelayDSPKernel.cpp
+++ b/Source/WebCore/Modules/webaudio/DelayDSPKernel.cpp
@@ -99,7 +99,7 @@ void DelayDSPKernel::process(const float* source, float* destination, size_t fra
return;
float sampleRate = this->sampleRate();
- double delayTime = delayProcessor() ? delayProcessor()->delayTime()->value() : m_desiredDelayFrames / sampleRate;
+ double delayTime = delayProcessor() ? delayProcessor()->delayTime()->finalValue() : m_desiredDelayFrames / sampleRate;
// Make sure the delay time is in a valid range.
delayTime = min(maxDelayTime(), delayTime);
diff --git a/Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.h b/Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.h
index cbf7b5024..0629ed6c4 100644
--- a/Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.h
+++ b/Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.h
@@ -25,7 +25,7 @@
#ifndef MediaElementAudioSourceNode_h
#define MediaElementAudioSourceNode_h
-#if ENABLE(VIDEO)
+#if ENABLE(WEB_AUDIO) && ENABLE(VIDEO)
#include "AudioSourceNode.h"
#include "AudioSourceProviderClient.h"
@@ -74,6 +74,6 @@ private:
} // namespace WebCore
-#endif // ENABLE(VIDEO)
+#endif // ENABLE(WEB_AUDIO) && ENABLE(VIDEO)
#endif // MediaElementAudioSourceNode_h
diff --git a/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.h b/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.h
index 8bdf28787..242e62122 100644
--- a/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.h
+++ b/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.h
@@ -25,7 +25,7 @@
#ifndef MediaStreamAudioSourceNode_h
#define MediaStreamAudioSourceNode_h
-#if ENABLE(MEDIA_STREAM)
+#if ENABLE(WEB_AUDIO) && ENABLE(MEDIA_STREAM)
#include "AudioSourceNode.h"
#include "AudioSourceProvider.h"
@@ -72,6 +72,6 @@ private:
} // namespace WebCore
-#endif // ENABLE(MEDIA_STREAM)
+#endif // ENABLE(WEB_AUDIO) && ENABLE(MEDIA_STREAM)
#endif // MediaStreamAudioSourceNode_h
diff --git a/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl b/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl
index 14b91a2c6..89e7e7888 100644
--- a/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl
+++ b/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl
@@ -24,7 +24,7 @@
module audio {
interface [
- Conditional=MEDIA_STREAM,
+ Conditional=WEB_AUDIO&MEDIA_STREAM,
JSGenerateToJSObject
] MediaStreamAudioSourceNode : AudioSourceNode {
readonly attribute MediaStream mediaStream;
diff --git a/Source/WebCore/Modules/webaudio/Oscillator.cpp b/Source/WebCore/Modules/webaudio/Oscillator.cpp
index ecbd4db9b..bad1bd714 100644
--- a/Source/WebCore/Modules/webaudio/Oscillator.cpp
+++ b/Source/WebCore/Modules/webaudio/Oscillator.cpp
@@ -31,6 +31,7 @@
#include "AudioContext.h"
#include "AudioNodeOutput.h"
#include "AudioUtilities.h"
+#include "ExceptionCode.h"
#include "VectorMath.h"
#include "WaveTable.h"
#include <algorithm>
@@ -68,7 +69,8 @@ Oscillator::Oscillator(AudioContext* context, float sampleRate)
m_detune = AudioParam::create(context, "detune", 0, -4800, 4800);
// Sets up default wavetable.
- setType(m_type);
+ ExceptionCode ec;
+ setType(m_type, ec);
// An oscillator is always mono.
addOutput(adoptPtr(new AudioNodeOutput(this, 1)));
@@ -81,7 +83,7 @@ Oscillator::~Oscillator()
uninitialize();
}
-void Oscillator::setType(unsigned short type)
+void Oscillator::setType(unsigned short type, ExceptionCode& ec)
{
WaveTable* waveTable = 0;
float sampleRate = this->sampleRate();
@@ -109,10 +111,10 @@ void Oscillator::setType(unsigned short type)
break;
case CUSTOM:
default:
- // FIXME: throw exception for invalid types or if the type is CUSTOM since setWaveTable()
- // method must be called explicitly in that case.
+ // Throw exception for invalid types, including CUSTOM since setWaveTable() method must be
+ // called explicitly.
+ ec = NOT_SUPPORTED_ERR;
return;
- break;
}
setWaveTable(waveTable);
diff --git a/Source/WebCore/Modules/webaudio/Oscillator.h b/Source/WebCore/Modules/webaudio/Oscillator.h
index 127b31b2d..3dacab951 100644
--- a/Source/WebCore/Modules/webaudio/Oscillator.h
+++ b/Source/WebCore/Modules/webaudio/Oscillator.h
@@ -61,7 +61,7 @@ public:
virtual void reset();
unsigned short type() const { return m_type; }
- void setType(unsigned short);
+ void setType(unsigned short, ExceptionCode&);
AudioParam* frequency() { return m_frequency.get(); }
AudioParam* detune() { return m_detune.get(); }
diff --git a/Source/WebCore/Modules/webaudio/Oscillator.idl b/Source/WebCore/Modules/webaudio/Oscillator.idl
index fb68e401c..f8e2a8892 100644
--- a/Source/WebCore/Modules/webaudio/Oscillator.idl
+++ b/Source/WebCore/Modules/webaudio/Oscillator.idl
@@ -36,7 +36,8 @@ module audio {
const unsigned short TRIANGLE = 3;
const unsigned short CUSTOM = 4;
- attribute unsigned short type;
+ attribute unsigned short type
+ setter raises(DOMException);
// Playback state constants.
const unsigned short UNSCHEDULED_STATE = 0;
diff --git a/Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.cpp b/Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.cpp
index 85e710408..784875986 100644
--- a/Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.cpp
+++ b/Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.cpp
@@ -46,7 +46,7 @@ PassRefPtr<Database> DOMWindowWebDatabase::openDatabase(DOMWindow* window, const
return 0;
RefPtr<Database> database = 0;
- if (AbstractDatabase::isAvailable() && window->document()->securityOrigin()->canAccessDatabase())
+ if (AbstractDatabase::isAvailable() && window->document()->securityOrigin()->canAccessDatabase(window->document()->topDocument()->securityOrigin()))
database = Database::openDatabase(window->document(), name, version, displayName, estimatedSize, creationCallback, ec);
if (!database && !ec)
diff --git a/Source/WebCore/PlatformBlackBerry.cmake b/Source/WebCore/PlatformBlackBerry.cmake
index 8f6a77528..f45e501c1 100644
--- a/Source/WebCore/PlatformBlackBerry.cmake
+++ b/Source/WebCore/PlatformBlackBerry.cmake
@@ -91,6 +91,7 @@ LIST(APPEND WebCore_SOURCES
platform/network/MIMESniffing.cpp
platform/network/ProxyServer.cpp
platform/network/blackberry/AutofillBackingStore.cpp
+ platform/network/blackberry/DNSBlackBerry.cpp
platform/network/blackberry/DeferredData.cpp
platform/network/blackberry/NetworkJob.cpp
platform/network/blackberry/NetworkManager.cpp
@@ -268,6 +269,8 @@ IF (WTF_USE_ACCELERATED_COMPOSITING)
LIST(APPEND WebCore_SOURCES
${WEBCORE_DIR}/platform/graphics/GraphicsLayer.cpp
${WEBCORE_DIR}/platform/graphics/blackberry/CanvasLayerWebKitThread.cpp
+ ${WEBCORE_DIR}/platform/graphics/blackberry/EGLImageLayerWebKitThread.cpp
+ ${WEBCORE_DIR}/platform/graphics/blackberry/EGLImageLayerCompositingThreadClient.cpp
${WEBCORE_DIR}/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp
${WEBCORE_DIR}/platform/graphics/blackberry/LayerAnimation.cpp
${WEBCORE_DIR}/platform/graphics/blackberry/LayerCompositingThread.cpp
diff --git a/Source/WebCore/PlatformEfl.cmake b/Source/WebCore/PlatformEfl.cmake
index f437c2110..8de7bb49a 100644
--- a/Source/WebCore/PlatformEfl.cmake
+++ b/Source/WebCore/PlatformEfl.cmake
@@ -93,6 +93,11 @@ LIST(APPEND WebCore_SOURCES
platform/text/efl/TextBreakIteratorInternalICUEfl.cpp
)
+IF (ENABLE_BATTERY_STATUS)
+ LIST(APPEND WebCore_INCLUDE_DIRECTORIES ${DBUS_INCLUDE_DIRS})
+ LIST(APPEND WebCore_LIBRARIES ${DBUS_LIBRARIES})
+ENDIF ()
+
IF (ENABLE_NETSCAPE_PLUGIN_API)
LIST(APPEND WebCore_SOURCES
plugins/PluginDatabase.cpp
@@ -168,26 +173,6 @@ IF (WTF_USE_CAIRO)
${HARFBUZZ_LIBRARIES}
)
ENDIF ()
-
- IF (WTF_USE_PANGO)
- LIST(APPEND WebCore_INCLUDE_DIRECTORIES
- "${WEBCORE_DIR}/platform/graphics/pango"
- ${Pango_INCLUDE_DIRS}
- )
- LIST(APPEND WebCore_SOURCES
- platform/graphics/pango/FontPango.cpp
- platform/graphics/pango/FontCachePango.cpp
- platform/graphics/pango/FontCustomPlatformDataPango.cpp
- platform/graphics/pango/FontPlatformDataPango.cpp
- platform/graphics/pango/GlyphPageTreeNodePango.cpp
- platform/graphics/pango/SimpleFontDataPango.cpp
- platform/graphics/pango/PangoUtilities.cpp
- )
- LIST(APPEND WebCore_LIBRARIES
- ${Pango_LIBRARY}
- ${Pango_Cairo_LIBRARY}
- )
- ENDIF ()
ENDIF ()
IF (WTF_USE_ICU_UNICODE)
@@ -222,8 +207,10 @@ LIST(APPEND WebCore_LIBRARIES
${LIBXSLT_LIBRARIES}
${PNG_LIBRARY}
${SQLITE_LIBRARIES}
- ${Glib_LIBRARIES}
- ${LIBSOUP24_LIBRARIES}
+ ${GLIB_LIBRARIES}
+ ${GLIB_GIO_LIBRARIES}
+ ${GLIB_GOBJECT_LIBRARIES}
+ ${LIBSOUP_LIBRARIES}
${ZLIB_LIBRARIES}
)
@@ -237,8 +224,8 @@ LIST(APPEND WebCore_INCLUDE_DIRECTORIES
${LIBXML2_INCLUDE_DIR}
${LIBXSLT_INCLUDE_DIR}
${SQLITE_INCLUDE_DIR}
- ${Glib_INCLUDE_DIRS}
- ${LIBSOUP24_INCLUDE_DIRS}
+ ${GLIB_INCLUDE_DIRS}
+ ${LIBSOUP_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
)
diff --git a/Source/WebCore/Resources/blackberry/selectControlBlackBerry.css b/Source/WebCore/Resources/blackberry/selectControlBlackBerry.css
index 5aaf1d75d..b20bc333a 100644
--- a/Source/WebCore/Resources/blackberry/selectControlBlackBerry.css
+++ b/Source/WebCore/Resources/blackberry/selectControlBlackBerry.css
@@ -6,6 +6,7 @@
overflow-x: hidden;
overflow-y: auto;
white-space: nowrap;
+ -webkit-overflow-scrolling: touch;
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtUAAAANCAYAAABmQZIAAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowODgwMTE3NDA3MjA2ODExOERCQkU3QjZERTFCNzVGNyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxQzIwQ0ZFQTM0ODYxMUUxQkI0RkE0ODBENzFGMEVDRSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxQzIwQ0ZFOTM0ODYxMUUxQkI0RkE0ODBENzFGMEVDRSIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjA4ODAxMTc0MDcyMDY4MTE4REJCRTdCNkRFMUI3NUY3IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjA4ODAxMTc0MDcyMDY4MTE4REJCRTdCNkRFMUI3NUY3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+YZtOWQAAA25JREFUeNrsnetuwyAMhYPH3v+FUzNV2qSpSsAXTCA550eltingC/BBaZpKKRsEQRAEQRAEQXbl90NKCZ6AtCK4AIIgCLqxGC6ApHpvUueJweyOybwaiGJAQV5AEITxGlp3zOYH+H0aGzOSFkC0aH5ggIYgCAJUw9f++QW5Mxk00UWJACCCbfAzBEEQBD13MUOBZQ+Daqo854PXSGgECZ3EHSClhxMJUDQNGEpjwQ/xBxYHEDR4UoWtqnGAJ/I7B9m4Sj5wcB708C93iG0LzF1+yA4ja89J6CRyJGsO7OhXl7tih50FqiW/uo2+5U0yTCx3AOo7QzW+Hr33wml/WGw4cBzU3PmgLArVd2snT9Zu7Y60Bdg5wo6s6KQaAKZGA+hgImbl4NBjcI88M+xpX+qQTLVvBvJA+1jp9zvvIj+tXsAkFhfQ9b7jG9dHwoUSDbBFstt7BnSa+b0sEqNdMO+zsn0S3uGDa3PD5hZ/iv2VlclKjQT5hHDa6kdBtFBNjo6WOnRW6tTZo8obWdaXsKMnZ/0c4AO6sIxRcLYKBCbjhOG9D2hxtvOpKoN8Zq1n9j9e4MH1WHflWAiDI2y1zgGszIujfH1dHF8O+gx3KLNVhoQRekH11oBq+rfoOdpc3H9fJ2GfYi1UHwExVaA6VyCUGkCejFBLgUCsKSM5wKYHeFvgiTpMftT5urPrI6C6ByDNBtW9y70KIkf9HgLHtuJBjwf5cvRObFkgBjNAdQnwjfWcLg+ISxG0m531eICZHTHjDj7dFfFr1cdKYOcKcH9Ct8vO3BjAqALVR5CdK1CdKu9twvdIcM1XI9k8MGg9ApMcIG2dqNNJh/k878sVX7LCxl5wNgJMrtypThPbZC0vdZxUpf7xTtgR596fANWaRU9xxicK3rz5OvuZ1lmOB8x0TrcYy2RhH2jB2CdUF4e9WrCO2iHWxvdbEZddEJfWcY4z7uKTz1MFumscyTUIriUENwDsDFrZCGzWFdneaONrIOhsFbD1DBTWHe6/WLwOfGKJUTK2IxLwJNdqvtJLg9o9G2Svenwkuu/2gvTZoLpc7NtIQJxlQTIKNCPqLpO0cfSOswSqJWW/OvGNNC4WP0o+w4780NSpOZ++V8p8bed3puPKAuqPlf7vrpMgHzi9/1YRgiAIgiAIgiC7fgQYALk6BVm+VKUFAAAAAElFTkSuQmCC") bottom no-repeat rgba(255, 255, 255, 0.5);
background-size: 100% auto;
diff --git a/Source/WebCore/Resources/calendarPicker.css b/Source/WebCore/Resources/pagepopups/calendarPicker.css
index 721c11e9b..518a25ad1 100644
--- a/Source/WebCore/Resources/calendarPicker.css
+++ b/Source/WebCore/Resources/pagepopups/calendarPicker.css
@@ -47,9 +47,8 @@ body {
inset -2px -2px 1px rgba(0,0,0,0.1);
padding: 6px;
whitespace: nowrap;
- /* width and opacity are reset in the JS code. */
+ /* width is reset in the JS code. */
width: 500px;
- opacity: 0;
}
.year-month-area {
diff --git a/Source/WebCore/Resources/calendarPicker.js b/Source/WebCore/Resources/pagepopups/calendarPicker.js
index a39834c82..926f76ed1 100644
--- a/Source/WebCore/Resources/calendarPicker.js
+++ b/Source/WebCore/Resources/pagepopups/calendarPicker.js
@@ -51,7 +51,6 @@ var ClassNames = {
MonthSelectorPopup: "month-selector-popup",
MonthSelectorPopupContents: "month-selector-popup-contents",
MonthSelectorPopupEntry: "month-selector-popup-entry",
- MonthSelectorPopupSizer: "month-selector-popup-sizer",
MonthSelectorWall: "month-selector-wall",
NoFocusRing: "no-focus-ring",
NotThisMonth: "not-this-month",
@@ -81,34 +80,6 @@ var global = {
// Utility functions
/**
- * @param {!string} id
- */
-function $(id) {
- return document.getElementById(id);
-}
-
-function bind(func, context) {
- return function() {
- return func.apply(context, arguments);
- };
-}
-
-/**
- * @param {!string} tagName
- * @param {string=} opt_class
- * @param {string=} opt_text
- * @return {!Element}
- */
-function createElement(tagName, opt_class, opt_text) {
- var element = document.createElement(tagName);
- if (opt_class)
- element.setAttribute("class", opt_class);
- if (opt_text)
- element.appendChild(document.createTextNode(opt_text));
- return element;
-}
-
-/**
* @return {!string} lowercase locale name. e.g. "en-us"
*/
function getLocale() {
@@ -126,6 +97,14 @@ function getLanguage() {
return result[1];
}
+/**
+ * @param {!number} number
+ * @return {!string}
+ */
+function localizeNumber(number) {
+ return window.pagePopupController.localizeNumberString(number);
+}
+
/*
* @const
* @type {number}
@@ -143,17 +122,17 @@ function formatJapaneseImperialEra(year, month) {
if (year > ImperialEraLimit)
return "";
if (year > 1989)
- return "(平成" + (year - 1988) + "年)";
+ return "(平成" + localizeNumber(year - 1988) + "年)";
if (year == 1989)
return "(平成元年)";
if (year >= 1927)
- return "(昭和" + (year - 1925) + "年)";
+ return "(昭和" + localizeNumber(year - 1925) + "年)";
if (year > 1912)
- return "(大正" + (year - 1911) + "年)";
+ return "(大正" + localizeNumber(year - 1911) + "年)";
if (year == 1912 && month >= 7)
return "(大正元年)";
if (year > 1868)
- return "(明治" + (year - 1867) + "年)";
+ return "(明治" + localizeNumber(year - 1867) + "年)";
if (year == 1868)
return "(明治元年)";
return "";
@@ -165,8 +144,7 @@ function formatJapaneseImperialEra(year, month) {
* @return {!string}
*/
function formatYearMonth(year, month) {
- // FIXME: Need localized number?
- var yearString = String(year);
+ var yearString = localizeNumber(year);
var monthString = global.params.monthLabels[month];
switch (getLanguage()) {
case "eu":
@@ -196,6 +174,13 @@ function formatYearMonth(year, month) {
}
}
+function createUTCDate(year, month, date) {
+ var newDate = new Date(Date.UTC(year, month, date));
+ if (year < 100)
+ newDate.setUTCFullYear(year);
+ return newDate;
+};
+
/**
* @param {string=} opt_current
* @return {!Date}
@@ -204,11 +189,11 @@ function parseDateString(opt_current) {
if (opt_current) {
var result = opt_current.match(/(\d+)-(\d+)-(\d+)/);
if (result)
- return new Date(Date.UTC(Number(result[1]), Number(result[2]) - 1, Number(result[3])));
+ return createUTCDate(Number(result[1]), Number(result[2]) - 1, Number(result[3]));
}
var now = new Date();
// Create UTC date with same numbers as local date.
- return new Date(Date.UTC(now.getFullYear(), now.getMonth(), now.getDate()));
+ return createUTCDate(now.getFullYear(), now.getMonth(), now.getDate());
}
/**
@@ -224,25 +209,6 @@ function serializeDate(year, month, day) {
return yearString + "-" + ("0" + (month + 1)).substr(-2, 2) + "-" + ("0" + day).substr(-2, 2);
}
-/**
- * @param {!number} width
- * @param {!number} height
- */
-function resizeWindow(width, height) {
- if (window.frameElement) {
- window.frameElement.style.width = width + "px";
- window.frameElement.style.height = height + "px";
- } else {
- window.resizeTo(width, height);
- }
-}
-
-function showMain() {
- var main = $("main");
- main.style.webkitTransition = "opacity 0.1s ease";
- main.style.opacity = "1";
-}
-
// ----------------------------------------------------------------
// Initialization
@@ -308,7 +274,6 @@ function initialize(args) {
if (errorString) {
main.textContent = "Internal error: " + errorString;
resizeWindow(main.offsetWidth, main.offsetHeight);
- showMain();
} else {
global.params = args;
checkLimits();
@@ -359,7 +324,6 @@ function fixWindowSize() {
document.getElementsByClassName(ClassNames.YearMonthUpper)[0].style.display = "-webkit-box";
document.getElementsByClassName(ClassNames.MonthSelectorBox)[0].style.display = "block";
resizeWindow(desiredBodyWidth, mainHeight);
- showMain();
}
function checkLimits() {
@@ -459,9 +423,6 @@ YearMonthController.prototype.attachTo = function(main) {
this._monthPopup.tabIndex = 0;
this._monthPopupContents = createElement("div", ClassNames.MonthSelectorPopupContents);
this._monthPopup.appendChild(this._monthPopupContents);
- // Sizer used to determine the width of the viewport in the popup menu.
- var sizer = createElement("div", ClassNames.MonthSelectorPopupSizer);
- this._monthPopup.appendChild(sizer);
box.appendChild(this._monthPopup);
this._month = createElement("div", ClassNames.MonthSelector);
this._month.addEventListener("click", bind(this._showPopup, this), false);
@@ -617,10 +578,7 @@ YearMonthController.prototype._showPopup = function() {
if (bottom > popupHeight)
this._monthPopup.scrollTop = bottom - popupHeight;
}
- var sizer = document.querySelector("." + ClassNames.MonthSelectorPopupSizer);
- var scrollWidth = this._monthPopupContents.clientWidth - sizer.clientWidth;
- if (scrollWidth > 0)
- this._monthPopup.style.webkitPaddingEnd = scrollWidth + 'px';
+ this._monthPopup.style.webkitPaddingEnd = getScrollbarWidth() + 'px';
}
this._monthPopup.focus();
};
@@ -899,8 +857,7 @@ function isValidDate(time) {
DaysTable.prototype._renderMonth = function(year, month) {
this._currentYear = year;
this._currentMonth = month;
- var dayIterator = new Date(Date.UTC(year, month, 1));
- dayIterator.setUTCFullYear(year);
+ var dayIterator = createUTCDate(year, month, 1);
var monthStartDay = dayIterator.getUTCDay();
var weekStartDay = global.params.weekStartDay || 0;
var startOffset = weekStartDay - monthStartDay;
@@ -913,8 +870,7 @@ DaysTable.prototype._renderMonth = function(year, month) {
var iterMonth = dayIterator.getUTCMonth();
var time = dayIterator.getTime();
var element = this._days[w][d];
- // FIXME: Need localized number?
- element.innerText = String(dayIterator.getUTCDate());
+ element.innerText = localizeNumber(dayIterator.getUTCDate());
element.className = ClassNames.Day;
element.dataset.submitValue = serializeDate(iterYear, iterMonth, dayIterator.getUTCDate());
if (outOfRange(time))
@@ -1018,7 +974,7 @@ DaysTable.prototype.selectDate = function(date) {
DaysTable.prototype._maybeSetPreviousMonth = function() {
var year = global.yearMonthController.year();
var month = global.yearMonthController.month();
- var thisMonthStartTime = Date.UTC(year, month, 1);
+ var thisMonthStartTime = createUTCDate(year, month, 1).getTime();
if (global.minimumDate.getTime() >= thisMonthStartTime)
return false;
if (month == 0) {
@@ -1041,7 +997,7 @@ DaysTable.prototype._maybeSetNextMonth = function() {
month = 0;
} else
month++;
- var nextMonthStartTime = Date.UTC(year, month, 1);
+ var nextMonthStartTime = createUTCDate(year, month, 1).getTime();
if (global.maximumDate.getTime() < nextMonthStartTime)
return false;
this._navigateToMonthWithAnimation(year, month);
diff --git a/Source/WebCore/Resources/calendarPickerMac.css b/Source/WebCore/Resources/pagepopups/calendarPickerMac.css
index 414464562..414464562 100644
--- a/Source/WebCore/Resources/calendarPickerMac.css
+++ b/Source/WebCore/Resources/pagepopups/calendarPickerMac.css
diff --git a/Source/WebCore/Resources/colorSuggestionPicker.css b/Source/WebCore/Resources/pagepopups/colorSuggestionPicker.css
index 6f847febc..6f847febc 100644
--- a/Source/WebCore/Resources/colorSuggestionPicker.css
+++ b/Source/WebCore/Resources/pagepopups/colorSuggestionPicker.css
diff --git a/Source/WebCore/Resources/colorSuggestionPicker.js b/Source/WebCore/Resources/pagepopups/colorSuggestionPicker.js
index a827e96d1..d48cb96e7 100644
--- a/Source/WebCore/Resources/colorSuggestionPicker.js
+++ b/Source/WebCore/Resources/pagepopups/colorSuggestionPicker.js
@@ -23,72 +23,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-var global = {
- argumentsReceived: false,
- scrollbarWidth: null
-};
-
-/**
- * @param {!string} id
- */
-function $(id) {
- return document.getElementById(id);
-}
-
-function bind(func, context) {
- return function() {
- return func.apply(context, arguments);
- };
-}
-
-function getScrollbarWidth() {
- if (global.scrollbarWidth === null) {
- var scrollDiv = document.createElement("div");
- scrollDiv.style.opacity = "0";
- scrollDiv.style.overflow = "scroll";
- scrollDiv.style.width = "50px";
- scrollDiv.style.height = "50px";
- document.body.appendChild(scrollDiv);
- global.scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
- scrollDiv.parentNode.removeChild(scrollDiv);
- }
- return global.scrollbarWidth;
-}
-
-/**
- * @param {!string} tagName
- * @param {string=} opt_class
- * @param {string=} opt_text
- * @return {!Element}
- */
-function createElement(tagName, opt_class, opt_text) {
- var element = document.createElement(tagName);
- if (opt_class)
- element.setAttribute("class", opt_class);
- if (opt_text)
- element.appendChild(document.createTextNode(opt_text));
- return element;
-}
-
-/**
- * @param {!number} width
- * @param {!number} height
- */
-function resizeWindow(width, height) {
- if (window.frameElement) {
- window.frameElement.style.width = width + "px";
- window.frameElement.style.height = height + "px";
- } else {
- window.resizeTo(width, height);
- }
-}
+window.argumentsReceived = false;
/**
* @param {Event} event
*/
function handleMessage(event) {
initialize(JSON.parse(event.data));
- global.argumentsReceived = true;
+ window.argumentsReceived = true;
}
/**
@@ -111,7 +53,7 @@ var DefaultColorPalette = ["#000000", "#404040", "#808080", "#c0c0c0",
"#4a86e8", "#0000ff", "#9900ff", "#ff00ff"];
function handleArgumentsTimeout() {
- if (global.argumentsReceived)
+ if (window.argumentsReceived)
return;
var args = {
values : DefaultColorPalette,
diff --git a/Source/WebCore/bindings/js/JSConvolverNodeCustom.cpp b/Source/WebCore/Resources/pagepopups/pickerCommon.css
index db7e2443e..71c5ea493 100644
--- a/Source/WebCore/bindings/js/JSConvolverNodeCustom.cpp
+++ b/Source/WebCore/Resources/pagepopups/pickerCommon.css
@@ -1,12 +1,12 @@
/*
- * Copyright (C) 2010, 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
* are met:
- * 1. Redistributions of source code must retain the above copyright
+ * 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
+ * 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.
*
@@ -22,26 +22,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
-
-#if ENABLE(WEB_AUDIO)
-
-#include "ConvolverNode.h"
-
-#include "AudioBuffer.h"
-#include "JSAudioBuffer.h"
-#include "JSConvolverNode.h"
-
-using namespace JSC;
-
-namespace WebCore {
-
-void JSConvolverNode::setBuffer(ExecState*, JSValue value)
-{
- ConvolverNode* imp = static_cast<ConvolverNode*>(impl());
- imp->setBuffer(toAudioBuffer(value));
+body {
+ -webkit-user-select: none;
+ background-color: white;
+ font: -webkit-small-control;
+ margin: 0;
+ overflow: hidden;
}
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_AUDIO)
diff --git a/Source/WebCore/Resources/pagepopups/pickerCommon.js b/Source/WebCore/Resources/pagepopups/pickerCommon.js
new file mode 100644
index 000000000..dfb291814
--- /dev/null
+++ b/Source/WebCore/Resources/pagepopups/pickerCommon.js
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+
+/**
+ * @param {!string} id
+ */
+function $(id) {
+ return document.getElementById(id);
+}
+
+function bind(func, context) {
+ return function() {
+ return func.apply(context, arguments);
+ };
+}
+
+/**
+ * @param {!string} tagName
+ * @param {string=} opt_class
+ * @param {string=} opt_text
+ * @return {!Element}
+ */
+function createElement(tagName, opt_class, opt_text) {
+ var element = document.createElement(tagName);
+ if (opt_class)
+ element.setAttribute("class", opt_class);
+ if (opt_text)
+ element.appendChild(document.createTextNode(opt_text));
+ return element;
+}
+
+/**
+ * @param {!number} width
+ * @param {!number} height
+ */
+function resizeWindow(width, height) {
+ if (window.frameElement) {
+ window.frameElement.style.width = width + "px";
+ window.frameElement.style.height = height + "px";
+ } else {
+ window.resizeTo(width, height);
+ }
+}
+
+function getScrollbarWidth() {
+ if (typeof window.scrollbarWidth === "undefined") {
+ var scrollDiv = document.createElement("div");
+ scrollDiv.style.opacity = "0";
+ scrollDiv.style.overflow = "scroll";
+ scrollDiv.style.width = "50px";
+ scrollDiv.style.height = "50px";
+ document.body.appendChild(scrollDiv);
+ window.scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
+ scrollDiv.parentNode.removeChild(scrollDiv);
+ }
+ return window.scrollbarWidth;
+}
diff --git a/Source/WebCore/Target.pri b/Source/WebCore/Target.pri
index b39e897c2..bf94372bc 100644
--- a/Source/WebCore/Target.pri
+++ b/Source/WebCore/Target.pri
@@ -74,6 +74,7 @@ SOURCES += \
bindings/js/BindingState.cpp \
bindings/js/CallbackFunction.cpp \
bindings/js/DOMObjectHashTableMap.cpp \
+ bindings/js/DOMTransaction.cpp \
bindings/js/DOMWrapperWorld.cpp \
bindings/js/Dictionary.cpp \
bindings/js/GCController.cpp \
@@ -96,7 +97,6 @@ SOURCES += \
bindings/js/JSClipboardCustom.cpp \
bindings/js/JSConsoleCustom.cpp \
bindings/js/JSCoordinatesCustom.cpp \
- bindings/js/JSCustomVoidCallback.cpp \
bindings/js/JSCustomXPathNSResolver.cpp \
bindings/js/JSDictionary.cpp \
bindings/js/JSDOMBinding.cpp \
@@ -183,6 +183,7 @@ SOURCES += \
bindings/js/JSTouchCustom.cpp \
bindings/js/JSTouchListCustom.cpp \
bindings/js/JSTreeWalkerCustom.cpp \
+ bindings/js/JSUndoManagerCustom.cpp \
bindings/js/JSWebKitAnimationCustom.cpp \
bindings/js/JSWebKitAnimationListCustom.cpp \
bindings/js/JSWebKitCSSKeyframeRuleCustom.cpp \
@@ -720,6 +721,7 @@ SOURCES += \
html/shadow/MeterShadowElement.cpp \
html/shadow/ProgressShadowElement.cpp \
html/shadow/SliderThumbElement.cpp \
+ html/shadow/SpinButtonElement.cpp \
html/shadow/TextControlInnerElements.cpp \
inspector/ConsoleMessage.cpp \
inspector/ContentSearchUtils.cpp \
@@ -945,9 +947,11 @@ SOURCES += \
platform/graphics/FontData.cpp \
platform/graphics/Font.cpp \
platform/graphics/FontCache.cpp \
+ platform/graphics/FontFastPath.cpp \
platform/graphics/FractionalLayoutBoxExtent.cpp \
platform/graphics/FractionalLayoutRect.cpp \
platform/graphics/GeneratorGeneratedImage.cpp \
+ platform/graphics/GlyphPageTreeNode.cpp \
platform/graphics/Gradient.cpp \
platform/graphics/GraphicsContext.cpp \
platform/graphics/GraphicsLayer.cpp \
@@ -962,6 +966,7 @@ SOURCES += \
platform/graphics/Path.cpp \
platform/graphics/PathTraversalState.cpp \
platform/graphics/Pattern.cpp \
+ platform/graphics/qt/FontQt.cpp \
platform/graphics/Region.cpp \
platform/graphics/RoundedRect.cpp \
platform/graphics/SegmentedFontData.cpp \
@@ -971,6 +976,7 @@ SOURCES += \
platform/graphics/StringTruncator.cpp \
platform/graphics/surfaces/GraphicsSurface.cpp \
platform/graphics/surfaces/qt/GraphicsSurfaceQt.cpp \
+ platform/graphics/SurrogatePairAwareTextIterator.cpp \
platform/graphics/TextRun.cpp \
platform/graphics/TiledBackingStore.cpp \
platform/graphics/transforms/AffineTransform.cpp \
@@ -984,6 +990,7 @@ SOURCES += \
platform/graphics/transforms/TransformOperations.cpp \
platform/graphics/transforms/TransformState.cpp \
platform/graphics/transforms/TranslateTransformOperation.cpp \
+ platform/graphics/WidthIterator.cpp \
platform/image-decoders/ImageDecoder.cpp \
platform/image-decoders/bmp/BMPImageDecoder.cpp \
platform/image-decoders/bmp/BMPImageReader.cpp \
@@ -1032,6 +1039,7 @@ SOURCES += \
platform/network/ResourceResponseBase.cpp \
platform/text/RegularExpression.cpp \
platform/PlatformEvent.cpp \
+ platform/PlatformInstrumentation.cpp \
platform/RuntimeApplicationChecks.cpp \
platform/RunLoop.cpp \
platform/SchemeRegistry.cpp \
@@ -1279,12 +1287,12 @@ HEADERS += \
bindings/js/JSArrayBufferViewHelper.h \
bindings/js/JSCSSStyleDeclarationCustom.h \
bindings/js/JSCallbackData.h \
- bindings/js/JSCustomVoidCallback.h \
bindings/js/JSCustomXPathNSResolver.h \
bindings/js/JSDictionary.h \
bindings/js/JSDOMBinding.h \
bindings/js/JSDOMGlobalObject.h \
bindings/js/JSDOMStringMapCustom.h \
+ bindings/js/DOMTransaction.h \
bindings/js/JSDOMWindowBase.h \
bindings/js/JSDOMWindowCustom.h \
bindings/js/JSDOMWindowShell.h \
@@ -2104,6 +2112,7 @@ HEADERS += \
platform/graphics/ShadowBlur.h \
platform/graphics/SimpleFontData.h \
platform/graphics/surfaces/GraphicsSurface.h \
+ platform/graphics/SurrogatePairAwareTextIterator.h \
platform/graphics/texmap/GraphicsLayerTextureMapper.h \
platform/graphics/texmap/TextureMapper.h \
platform/graphics/texmap/TextureMapperBackingStore.h \
@@ -2123,6 +2132,7 @@ HEADERS += \
platform/graphics/transforms/TransformOperations.h \
platform/graphics/transforms/TransformState.h \
platform/graphics/transforms/TranslateTransformOperation.h \
+ platform/graphics/WidthIterator.h \
platform/image-decoders/bmp/BMPImageDecoder.h \
platform/image-decoders/bmp/BMPImageReader.h \
platform/image-decoders/ico/ICOImageDecoder.h \
@@ -2645,9 +2655,9 @@ HEADERS += \
svg/SVGVKernElement.h \
svg/SVGZoomAndPan.h \
svg/SVGZoomEvent.h \
- testing/FastMallocStatistics.h \
testing/Internals.h \
testing/InternalSettings.h \
+ testing/MallocStatistics.h \
workers/AbstractWorker.h \
workers/DedicatedWorkerContext.h \
workers/DedicatedWorkerThread.h \
@@ -2980,13 +2990,13 @@ contains(DEFINES, ENABLE_FILE_SYSTEM=1) {
Modules/filesystem/FileEntrySync.h \
Modules/filesystem/FileSystemCallback.h \
Modules/filesystem/FileSystemCallbacks.h \
+ Modules/filesystem/FileSystemFlags.h \
Modules/filesystem/FileWriter.h \
Modules/filesystem/FileWriterBase.h \
Modules/filesystem/FileWriterBaseCallback.h \
Modules/filesystem/FileWriterCallback.h \
Modules/filesystem/FileWriterClient.h \
Modules/filesystem/FileWriterSync.h \
- Modules/filesystem/WebKitFlags.h \
Modules/filesystem/LocalFileSystem.h \
Modules/filesystem/Metadata.h \
Modules/filesystem/MetadataCallback.h \
@@ -2995,8 +3005,6 @@ contains(DEFINES, ENABLE_FILE_SYSTEM=1) {
platform/FileMetadata.h
SOURCES += \
- bindings/js/JSDirectoryEntryCustom.cpp \
- bindings/js/JSDirectoryEntrySyncCustom.cpp \
bindings/js/JSEntryCustom.cpp \
bindings/js/JSEntrySyncCustom.cpp \
platform/AsyncFileSystem.cpp
@@ -3286,28 +3294,6 @@ contains(DEFINES, ENABLE_MATHML=1) {
rendering/mathml/RenderMathMLUnderOver.cpp
}
-# QRawFont transition handling.
-#
-# Even though QRawFont was already available in Qt 4.8, it had
-# limitations that made switching fully to it impossible.
-# We preserve the old code path when building with Qt 4.
-
-contains(DEFINES, HAVE_QRAWFONT=1) {
- SOURCES += \
- platform/graphics/qt/FontQt.cpp \
- platform/graphics/FontFastPath.cpp \
- platform/graphics/GlyphPageTreeNode.cpp \
- platform/graphics/WidthIterator.cpp \
- platform/graphics/SurrogatePairAwareTextIterator.cpp
-
- HEADERS += \
- platform/graphics/WidthIterator.h \
- platform/graphics/SurrogatePairAwareTextIterator.h
-} else {
- SOURCES += \
- platform/graphics/qt/FontQt4.cpp
-}
-
contains(DEFINES, ENABLE_TEXT_AUTOSIZING=1) {
SOURCES += # FIXME!
}
diff --git a/Source/WebCore/UseJSC.cmake b/Source/WebCore/UseJSC.cmake
index c0236b06c..e99d2eb65 100644
--- a/Source/WebCore/UseJSC.cmake
+++ b/Source/WebCore/UseJSC.cmake
@@ -49,7 +49,6 @@ LIST(APPEND WebCore_SOURCES
bindings/js/JSClipboardCustom.cpp
bindings/js/JSConsoleCustom.cpp
bindings/js/JSCoordinatesCustom.cpp
- bindings/js/JSCustomVoidCallback.cpp
bindings/js/JSCustomXPathNSResolver.cpp
bindings/js/JSDictionary.cpp
bindings/js/JSDOMBinding.cpp
@@ -251,8 +250,6 @@ ENDIF ()
if (ENABLE_FILE_SYSTEM)
LIST(APPEND WebCore_SOURCES
- bindings/js/JSDirectoryEntryCustom.cpp
- bindings/js/JSDirectoryEntrySyncCustom.cpp
bindings/js/JSEntryCustom.cpp
bindings/js/JSEntrySyncCustom.cpp
)
@@ -276,7 +273,6 @@ IF (ENABLE_WEB_AUDIO)
LIST(APPEND WebCore_SOURCES
bindings/js/JSAudioBufferSourceNodeCustom.cpp
bindings/js/JSAudioContextCustom.cpp
- bindings/js/JSConvolverNodeCustom.cpp
bindings/js/JSJavaScriptAudioNodeCustom.cpp
)
ENDIF ()
@@ -287,6 +283,13 @@ IF (ENABLE_WEB_INTENTS)
)
ENDIF ()
+IF (ENABLE_UNDO_MANAGER)
+ LIST (APPEND WebCore_SOURCES
+ bindings/js/DOMTransaction.cpp
+ bindings/js/JSUndoManagerCustom.cpp
+ )
+ENDIF ()
+
LIST(APPEND SCRIPTS_BINDINGS
${WEBCORE_DIR}/bindings/scripts/CodeGenerator.pm
)
diff --git a/Source/WebCore/UseV8.cmake b/Source/WebCore/UseV8.cmake
index 63890afeb..29d7e5872 100755
--- a/Source/WebCore/UseV8.cmake
+++ b/Source/WebCore/UseV8.cmake
@@ -46,7 +46,6 @@ LIST(APPEND WebCore_SOURCES
bindings/v8/StaticDOMDataStore.cpp
bindings/v8/V8AbstractEventListener.cpp
bindings/v8/V8Binding.cpp
- bindings/v8/V8BindingHelpers.cpp
bindings/v8/V8Collection.cpp
bindings/v8/V8DOMConfiguration.cpp,
bindings/v8/V8DOMMap.cpp
@@ -60,10 +59,12 @@ LIST(APPEND WebCore_SOURCES
bindings/v8/V8IsolatedContext.cpp
bindings/v8/V8LazyEventListener.cpp
bindings/v8/V8NodeFilterCondition.cpp
+ bindings/v8/V8ObjectConstructor.cpp
bindings/v8/V8PerContextData.cpp
bindings/v8/V8PerIsolateData.cpp
bindings/v8/V8Proxy.cpp
bindings/v8/V8RecursionScope.cpp
+ bindings/v8/V8ThrowException.cpp
bindings/v8/V8Utilities.cpp
bindings/v8/V8ValueCache.cpp
bindings/v8/V8WindowErrorHandler.cpp
@@ -86,7 +87,6 @@ LIST(APPEND WebCore_SOURCES
bindings/v8/custom/V8ConsoleCustom.cpp
bindings/v8/custom/V8CoordinatesCustom.cpp
bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp
- bindings/v8/custom/V8CustomVoidCallback.cpp
bindings/v8/custom/V8CustomXPathNSResolver.cpp
bindings/v8/custom/V8DOMFormDataCustom.cpp
bindings/v8/custom/V8DOMStringMapCustom.cpp
@@ -95,8 +95,6 @@ LIST(APPEND WebCore_SOURCES
bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp
bindings/v8/custom/V8DeviceMotionEventCustom.cpp
bindings/v8/custom/V8DeviceOrientationEventCustom.cpp
- bindings/v8/custom/V8DirectoryEntryCustom.cpp
- bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp
bindings/v8/custom/V8DocumentCustom.cpp
bindings/v8/custom/V8DocumentLocationCustom.cpp
bindings/v8/custom/V8EntrySyncCustom.cpp
@@ -209,6 +207,15 @@ IF (ENABLE_SVG)
)
ENDIF ()
+IF (ENABLE_UNDO_MANAGER)
+ LIST(APPEND WebCore_SOURCES
+ bindings/v8/DOMTransaction.cpp
+
+ bindings/v8/custom/V8DOMTransactionCustom.cpp
+ bindings/v8/custom/V8UndoManagerCustom.cpp
+ )
+ENDIF ()
+
LIST(APPEND SCRIPTS_BINDINGS
${WEBCORE_DIR}/bindings/scripts/CodeGenerator.pm
)
diff --git a/Source/WebCore/WebCore.exp.in b/Source/WebCore/WebCore.exp.in
index bdca1291d..16d04a380 100644
--- a/Source/WebCore/WebCore.exp.in
+++ b/Source/WebCore/WebCore.exp.in
@@ -253,6 +253,7 @@ __ZN7WebCore14DocumentLoaderD2Ev
__ZNK7WebCore14DocumentLoader17reportMemoryUsageEPNS_16MemoryObjectInfoE
__ZN7WebCore14DocumentWriter11setEncodingERKN3WTF6StringEb
__ZN7WebCore14FileIconLoader14notifyFinishedEN3WTF10PassRefPtrINS_4IconEEE
+__ZN7WebCore14FormController22getReferencedFilePathsERKN3WTF6VectorINS1_6StringELm0EEE
__ZN7WebCore14FrameSelection10setFocusedEb
__ZN7WebCore14FrameSelection12setSelectionERKNS_16VisibleSelectionEjNS0_19CursorAlignOnScrollENS_15TextGranularityE
__ZN7WebCore14FrameSelection15revealSelectionERKNS_15ScrollAlignmentENS_18RevealExtentOptionE
@@ -455,6 +456,7 @@ __ZN7WebCore17GlyphPageTreeNode18treeGlyphPageCountEv
__ZN7WebCore17HistoryController26saveDocumentAndScrollStateEv
__ZN7WebCore17HistoryController33restoreScrollPositionAndViewStateEv
__ZN7WebCore17JSDOMGlobalObject6s_infoE
+__ZN7WebCore17languageDidChangeEv
__ZN7WebCore17RegularExpressionC1ERKN3WTF6StringENS1_19TextCaseSensitivityE
__ZN7WebCore17RegularExpressionD1Ev
__ZN7WebCore17ViewportArguments19deprecatedTargetDPIE
@@ -956,7 +958,7 @@ __ZN7WebCore9FrameView21flushDeferredRepaintsEv
__ZN7WebCore9FrameView22setBaseBackgroundColorERKNS_5ColorE
__ZN7WebCore9FrameView23updateCanHaveScrollbarsEv
__ZN7WebCore9FrameView24forceLayoutForPaginationERKNS_9FloatSizeES3_fNS_19AdjustViewSizeOrNotE
-__ZN7WebCore9FrameView24paintContentsForSnapshotEPNS_15GraphicsContextERKNS_7IntRectENS0_18SelectionInSnaphotE
+__ZN7WebCore9FrameView24paintContentsForSnapshotEPNS_15GraphicsContextERKNS_7IntRectENS0_18SelectionInSnaphotENS0_26CoordinateSpaceForSnapshotE
__ZN7WebCore9FrameView26adjustPageHeightDeprecatedEPffff
__ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb
__ZN7WebCore9FrameView37updateLayoutAndStyleIfNeededRecursiveEv
@@ -1099,11 +1101,13 @@ __ZNK7WebCore11HistoryItem8referrerEv
__ZNK7WebCore11HistoryItem9urlStringEv
__ZNK7WebCore11HistoryItem9viewStateEv
__ZNK7WebCore11RenderLayer19absoluteBoundingBoxEv
+__ZNK7WebCore11RenderStyle11fontMetricsEv
__ZNK7WebCore11RenderStyle21visitedDependentColorEi
+__ZNK7WebCore11RenderStyle4fontEv
__ZNK7WebCore11ScriptValue9getStringEPN3JSC9ExecStateERN3WTF6StringE
__ZNK7WebCore12RenderObject14enclosingLayerEv
__ZNK7WebCore12RenderObject15localToAbsoluteERKNS_10FloatPointEbb
-__ZNK7WebCore12RenderObject20localToContainerQuadERKNS_9FloatQuadEPNS_20RenderBoxModelObjectEbPb
+__ZNK7WebCore12RenderObject20localToContainerQuadERKNS_9FloatQuadEPNS_20RenderBoxModelObjectEbbPb
__ZNK7WebCore12RenderObject23absoluteBoundingBoxRectEb
__ZNK7WebCore12RenderObject39pixelSnappedAbsoluteClippedOverflowRectEv
__ZNK7WebCore12RenderObject7childAtEj
@@ -1216,6 +1220,7 @@ __ZNK7WebCore17ResourceErrorBase8lazyInitEv
__ZNK7WebCore18PlatformPasteboard11changeCountEv
__ZNK7WebCore19AnimationController24numberOfActiveAnimationsEPNS_8DocumentE
__ZNK7WebCore19InspectorController12getHighlightEPNS_9HighlightE
+__ZNK7WebCore19ResourceRequestBase20firstPartyForCookiesEv
__ZNK7WebCore19ResourceRequestBase10httpMethodEv
__ZNK7WebCore19ResourceRequestBase15httpHeaderFieldEPKc
__ZNK7WebCore19ResourceRequestBase3urlEv
@@ -1294,7 +1299,6 @@ __ZNK7WebCore5Frame16frameScaleFactorEv
__ZNK7WebCore5Frame18documentTypeStringEv
__ZNK7WebCore5Frame31displayStringModifiedByEncodingERKN3WTF6StringE
__ZNK7WebCore5Frame8settingsEv
-__ZNK7WebCore5Frame9domWindowEv
__ZNK7WebCore5Range11startOffsetERi
__ZNK7WebCore5Range12endContainerERi
__ZNK7WebCore5Range12pastLastNodeEv
@@ -1380,6 +1384,7 @@ __ZNK7WebCore9FrameTree6parentEv
__ZNK7WebCore9FrameView11needsLayoutEv
__ZNK7WebCore9FrameView13isTransparentEv
__ZNK7WebCore9FrameView13paintBehaviorEv
+__ZNK7WebCore9FrameView14didFirstLayoutEv
__ZNK7WebCore9FrameView19baseBackgroundColorEv
__ZNK7WebCore9FrameView20isSoftwareRenderableEv
__ZNK7WebCore9FrameView23documentBackgroundColorEv
@@ -1970,7 +1975,6 @@ __ZNK7WebCore6Editor16hasBidiSelectionEv
__ZNK7WebCore6Editor6clientEv
__ZNK7WebCore7IntSizecv6CGSizeEv
__ZNK7WebCore8Document31isTelephoneNumberParsingEnabledEv
-__ZNK7WebCore8Document9domWindowEv
__ZNK7WebCore8Position28offsetForPositionAfterAnchorEv
__ZNK7WebCore9FloatRectcv6CGRectEv
__ZNK7WebCore9FloatSizecv6CGSizeEv
@@ -2168,7 +2172,6 @@ __ZN7WebCore8Document35webkitWillEnterFullScreenForElementEPNS_7ElementE
__ZN7WebCore8Document25setFullScreenRendererSizeERKNS_7IntSizeE
__ZN7WebCore8Document36setFullScreenRendererBackgroundColorENS_5ColorE
__ZN7WebCore8Document22setAnimatingFullScreenEb
-__ZNK7WebCore8Document9domWindowEv
#endif
#if ENABLE(GEOLOCATION)
diff --git a/Source/WebCore/WebCore.gyp/WebCore.gyp b/Source/WebCore/WebCore.gyp/WebCore.gyp
index 847c2d6ac..db04f4151 100644
--- a/Source/WebCore/WebCore.gyp/WebCore.gyp
+++ b/Source/WebCore/WebCore.gyp/WebCore.gyp
@@ -115,6 +115,7 @@
'../platform/chromium/support',
'../platform/graphics',
'../platform/graphics/chromium',
+ '../platform/graphics/chromium/cc',
'../platform/graphics/filters',
'../platform/graphics/filters/arm',
'../platform/graphics/gpu',
@@ -164,7 +165,6 @@
'bindings_idl_files!': [
# Custom bindings in bindings/v8/custom exist for these.
'../dom/EventListener.idl',
- '../html/VoidCallback.idl',
# Bindings with custom Objective-C implementations.
'../page/AbstractView.idl',
@@ -903,10 +903,29 @@
],
},
{
+ 'action_name': 'PickerCommon',
+ 'inputs': [
+ '../Resources/pagepopups/pickerCommon.css',
+ '../Resources/pagepopups/pickerCommon.js',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/PickerCommon.h',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/PickerCommon.cpp',
+ ],
+ 'action': [
+ 'python',
+ '../make-file-arrays.py',
+ '--condition=ENABLE(CALENDAR_PICKER)',
+ '--out-h=<(SHARED_INTERMEDIATE_DIR)/webkit/PickerCommon.h',
+ '--out-cpp=<(SHARED_INTERMEDIATE_DIR)/webkit/PickerCommon.cpp',
+ '<@(_inputs)',
+ ],
+ },
+ {
'action_name': 'CalendarPicker',
'inputs': [
- '../Resources/calendarPicker.css',
- '../Resources/calendarPicker.js',
+ '../Resources/pagepopups/calendarPicker.css',
+ '../Resources/pagepopups/calendarPicker.js',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/webkit/CalendarPicker.h',
@@ -924,7 +943,7 @@
{
'action_name': 'CalendarPickerMac',
'inputs': [
- '../Resources/calendarPickerMac.css',
+ '../Resources/pagepopups/calendarPickerMac.css',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/webkit/CalendarPickerMac.h',
@@ -942,8 +961,8 @@
{
'action_name': 'ColorSuggestionPicker',
'inputs': [
- '../Resources/colorSuggestionPicker.css',
- '../Resources/colorSuggestionPicker.js',
+ '../Resources/pagepopups/colorSuggestionPicker.css',
+ '../Resources/pagepopups/colorSuggestionPicker.js',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/webkit/ColorSuggestionPicker.h',
@@ -1213,6 +1232,7 @@
'<(SHARED_INTERMEDIATE_DIR)/webkit/EventTargetHeaders.h',
'<(SHARED_INTERMEDIATE_DIR)/webkit/EventTargetInterfaces.h',
'<(SHARED_INTERMEDIATE_DIR)/webkit/ExceptionCodeDescription.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/PickerCommon.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/UserAgentStyleSheetsData.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/V8HTMLElementWrapperFactory.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/XLinkNames.cpp',
@@ -1430,6 +1450,7 @@
# such as:
# com.google.Chrome[] objc[]: Class ScrollbarPrefsObserver is implemented in both .../Google Chrome.app/Contents/Versions/.../Google Chrome Helper.app/Contents/MacOS/../../../Google Chrome Framework.framework/Google Chrome Framework and /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore. One of the two will be used. Which one is undefined.
'WebCascadeList=ChromiumWebCoreObjCWebCascadeList',
+ 'WebCoreFlippedView=ChromiumWebCoreObjCWebCoreFlippedView',
'WebScrollbarPrefsObserver=ChromiumWebCoreObjCWebScrollbarPrefsObserver',
'WebCoreRenderThemeNotificationObserver=ChromiumWebCoreObjCWebCoreRenderThemeNotificationObserver',
'WebFontCache=ChromiumWebCoreObjCWebFontCache',
@@ -1715,6 +1736,8 @@
['include', 'platform/mac/ScrollbarThemeMac\\.mm$'],
['include', 'platform/mac/ScrollAnimatorMac\\.mm$'],
['include', 'platform/mac/ScrollElasticityController\\.mm$'],
+ ['include', 'platform/mac/ThemeMac\\.h$'],
+ ['include', 'platform/mac/ThemeMac\\.mm$'],
['include', 'platform/mac/WebCoreSystemInterface\\.mm$'],
['include', 'platform/mac/WebCoreTextRenderer\\.mm$'],
['include', 'platform/text/mac/ShapeArabic\\.c$'],
@@ -2186,8 +2209,8 @@
],
'sources': [
'<@(webcore_test_support_files)',
- '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/V8FastMallocStatistics.cpp',
- '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8FastMallocStatistics.h',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/V8MallocStatistics.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8MallocStatistics.h',
'<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/V8Internals.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8Internals.h',
'<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/V8InternalSettings.cpp',
diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi
index 184049a55..952b8001d 100644
--- a/Source/WebCore/WebCore.gypi
+++ b/Source/WebCore/WebCore.gypi
@@ -304,6 +304,8 @@
'platform/PlatformEvent.cpp',
'platform/PlatformEvent.h',
'platform/PlatformGestureEvent.h',
+ 'platform/PlatformInstrumentation.cpp',
+ 'platform/PlatformInstrumentation.h',
'platform/PlatformKeyboardEvent.h',
'platform/PlatformMenuDescription.h',
'platform/PlatformMouseEvent.h',
@@ -821,8 +823,10 @@
'Modules/indexeddb/IDBKey.idl',
'Modules/indexeddb/IDBKeyRange.idl',
'Modules/indexeddb/IDBObjectStore.idl',
+ 'Modules/indexeddb/IDBOpenDBRequest.idl',
'Modules/indexeddb/IDBRequest.idl',
'Modules/indexeddb/IDBTransaction.idl',
+ 'Modules/indexeddb/IDBUpgradeNeededEvent.idl',
'Modules/indexeddb/IDBVersionChangeEvent.idl',
'Modules/indexeddb/IDBVersionChangeRequest.idl',
'Modules/indexeddb/WorkerContextIndexedDatabase.idl',
@@ -1015,6 +1019,7 @@
'dom/WebKitNamedFlow.idl',
'dom/WebKitTransitionEvent.idl',
'dom/WheelEvent.idl',
+ 'editing/DOMTransaction.idl',
'editing/UndoManager.idl',
'fileapi/Blob.idl',
'fileapi/File.idl',
@@ -1418,6 +1423,7 @@
'Modules/filesystem/EntrySync.h',
'Modules/filesystem/ErrorCallback.h',
'Modules/filesystem/FileCallback.h',
+ 'Modules/filesystem/FileSystemFlags.h',
'Modules/filesystem/FileEntry.cpp',
'Modules/filesystem/FileEntry.h',
'Modules/filesystem/FileEntrySync.cpp',
@@ -1441,7 +1447,6 @@
'Modules/filesystem/Metadata.h',
'Modules/filesystem/MetadataCallback.h',
'Modules/filesystem/SyncCallbackHelper.h',
- 'Modules/filesystem/WebKitFlags.h',
'Modules/filesystem/WorkerContextFileSystem.cpp',
'Modules/filesystem/WorkerContextFileSystem.h',
'Modules/filesystem/chromium/DOMFileSystemChromium.cpp',
@@ -1514,6 +1519,8 @@
'Modules/indexeddb/IDBObjectStoreBackendImpl.cpp',
'Modules/indexeddb/IDBObjectStoreBackendImpl.h',
'Modules/indexeddb/IDBObjectStoreBackendInterface.h',
+ 'Modules/indexeddb/IDBOpenDBRequest.cpp',
+ 'Modules/indexeddb/IDBOpenDBRequest.h',
'Modules/indexeddb/IDBPendingTransactionMonitor.cpp',
'Modules/indexeddb/IDBPendingTransactionMonitor.h',
'Modules/indexeddb/IDBRequest.cpp',
@@ -1527,6 +1534,8 @@
'Modules/indexeddb/IDBTransactionCallbacks.h',
'Modules/indexeddb/IDBTransactionCoordinator.cpp',
'Modules/indexeddb/IDBTransactionCoordinator.h',
+ 'Modules/indexeddb/IDBUpgradeNeededEvent.cpp',
+ 'Modules/indexeddb/IDBUpgradeNeededEvent.h',
'Modules/indexeddb/IDBVersionChangeEvent.cpp',
'Modules/indexeddb/IDBVersionChangeEvent.h',
'Modules/indexeddb/IDBVersionChangeRequest.cpp',
@@ -1882,8 +1891,6 @@
'bindings/ScriptControllerBase.cpp',
'bindings/cpp/WebDOMCString.cpp',
'bindings/cpp/WebDOMCString.h',
- 'bindings/cpp/WebDOMCustomVoidCallback.cpp',
- 'bindings/cpp/WebDOMCustomVoidCallback.h',
'bindings/cpp/WebDOMDOMWindowCustom.cpp',
'bindings/cpp/WebDOMEventListenerCustom.cpp',
'bindings/cpp/WebDOMEventTarget.cpp',
@@ -1932,6 +1939,8 @@
'bindings/js/CallbackFunction.cpp',
'bindings/js/CallbackFunction.h',
'bindings/js/DOMObjectHashTableMap.cpp',
+ 'bindings/js/DOMTransaction.cpp',
+ 'bindings/js/DOMTransaction.h',
'bindings/js/DOMWrapperWorld.cpp',
'bindings/js/GCController.cpp',
'bindings/js/IDBBindingUtilities.cpp',
@@ -1960,11 +1969,8 @@
'bindings/js/JSCanvasRenderingContextCustom.cpp',
'bindings/js/JSClipboardCustom.cpp',
'bindings/js/JSConsoleCustom.cpp',
- 'bindings/js/JSConvolverNodeCustom.cpp',
'bindings/js/JSCoordinatesCustom.cpp',
'bindings/js/JSCustomSQLStatementErrorCallback.cpp',
- 'bindings/js/JSCustomVoidCallback.cpp',
- 'bindings/js/JSCustomVoidCallback.h',
'bindings/js/JSCustomXPathNSResolver.cpp',
'bindings/js/JSCustomXPathNSResolver.h',
'bindings/js/JSDictionary.cpp',
@@ -1991,8 +1997,6 @@
'bindings/js/JSDesktopNotificationsCustom.cpp',
'bindings/js/JSDeviceMotionEventCustom.cpp',
'bindings/js/JSDeviceOrientationEventCustom.cpp',
- 'bindings/js/JSDirectoryEntryCustom.cpp',
- 'bindings/js/JSDirectoryEntrySyncCustom.cpp',
'bindings/js/JSDocumentCustom.cpp',
'bindings/js/JSElementCustom.cpp',
'bindings/js/JSEntryCustom.cpp',
@@ -2091,6 +2095,7 @@
'bindings/js/JSTrackCustom.h',
'bindings/js/JSTrackEventCustom.cpp',
'bindings/js/JSTreeWalkerCustom.cpp',
+ 'bindings/js/JSUndoManagerCustom.cpp',
'bindings/js/JSWebGLRenderingContextCustom.cpp',
'bindings/js/JSWebKitAnimationCustom.cpp',
'bindings/js/JSWebKitAnimationListCustom.cpp',
@@ -2167,6 +2172,8 @@
'bindings/v8/DOMData.h',
'bindings/v8/DOMDataStore.cpp',
'bindings/v8/DOMDataStore.h',
+ 'bindings/v8/DOMTransaction.cpp',
+ 'bindings/v8/DOMTransaction.h',
'bindings/v8/DOMWrapperWorld.cpp',
'bindings/v8/DOMWrapperWorld.h',
'bindings/v8/DateExtension.cpp',
@@ -2191,7 +2198,6 @@
'bindings/v8/RetainedDOMInfo.cpp',
'bindings/v8/RetainedDOMInfo.h',
'bindings/v8/RetainedObjectInfo.h',
- 'bindings/v8/SafeAllocation.h',
'bindings/v8/ScheduledAction.cpp',
'bindings/v8/ScheduledAction.h',
'bindings/v8/ScopedDOMDataStore.cpp',
@@ -2239,9 +2245,9 @@
'bindings/v8/V8AbstractEventListener.h',
'bindings/v8/V8Binding.cpp',
'bindings/v8/V8Binding.h',
- 'bindings/v8/V8BindingHelpers.cpp',
- 'bindings/v8/V8BindingHelpers.h',
'bindings/v8/V8BindingMacros.h',
+ 'bindings/v8/V8Callback.cpp',
+ 'bindings/v8/V8Callback.h',
'bindings/v8/V8Collection.cpp',
'bindings/v8/V8Collection.h',
'bindings/v8/V8DOMConfiguration.cpp',
@@ -2272,6 +2278,8 @@
'bindings/v8/V8NPUtils.h',
'bindings/v8/V8NodeFilterCondition.cpp',
'bindings/v8/V8NodeFilterCondition.h',
+ 'bindings/v8/V8ObjectConstructor.cpp',
+ 'bindings/v8/V8ObjectConstructor.h',
'bindings/v8/V8PerContextData.cpp',
'bindings/v8/V8PerContextData.h',
'bindings/v8/V8PerIsolateData.cpp',
@@ -2280,6 +2288,8 @@
'bindings/v8/V8Proxy.h',
'bindings/v8/V8RecursionScope.cpp',
'bindings/v8/V8RecursionScope.h',
+ 'bindings/v8/V8ThrowException.cpp',
+ 'bindings/v8/V8ThrowException.h',
'bindings/v8/V8Utilities.cpp',
'bindings/v8/V8Utilities.h',
'bindings/v8/V8ValueCache.cpp',
@@ -2313,19 +2323,16 @@
'bindings/v8/custom/V8ConsoleCustom.cpp',
'bindings/v8/custom/V8CoordinatesCustom.cpp',
'bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp',
- 'bindings/v8/custom/V8CustomVoidCallback.cpp',
- 'bindings/v8/custom/V8CustomVoidCallback.h',
'bindings/v8/custom/V8CustomXPathNSResolver.cpp',
'bindings/v8/custom/V8CustomXPathNSResolver.h',
'bindings/v8/custom/V8DOMFormDataCustom.cpp',
'bindings/v8/custom/V8DOMStringMapCustom.cpp',
+ 'bindings/v8/custom/V8DOMTransactionCustom.cpp',
'bindings/v8/custom/V8DOMWindowCustom.cpp',
'bindings/v8/custom/V8DataViewCustom.cpp',
'bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp',
'bindings/v8/custom/V8DeviceMotionEventCustom.cpp',
'bindings/v8/custom/V8DeviceOrientationEventCustom.cpp',
- 'bindings/v8/custom/V8DirectoryEntryCustom.cpp',
- 'bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp',
'bindings/v8/custom/V8DocumentCustom.cpp',
'bindings/v8/custom/V8DocumentLocationCustom.cpp',
'bindings/v8/custom/V8EntryCustom.cpp',
@@ -2391,6 +2398,7 @@
'bindings/v8/custom/V8StyleSheetCustom.cpp',
'bindings/v8/custom/V8StyleSheetListCustom.cpp',
'bindings/v8/custom/V8TrackEventCustom.cpp',
+ 'bindings/v8/custom/V8UndoManagerCustom.cpp',
'bindings/v8/custom/V8WebGLRenderingContextCustom.cpp',
'bindings/v8/custom/V8WebKitAnimationCustom.cpp',
'bindings/v8/custom/V8WebKitPointConstructor.cpp',
@@ -3443,8 +3451,6 @@
'platform/chromium/SuddenTerminationChromium.cpp',
'platform/chromium/SystemTimeChromium.cpp',
'platform/chromium/TemporaryLinkStubs.cpp',
- 'platform/chromium/ThemeChromiumMac.h',
- 'platform/chromium/ThemeChromiumMac.mm',
'platform/chromium/TraceEvent.h',
'platform/chromium/VisitedLinksChromium.cpp',
'platform/chromium/WidgetChromium.cpp',
@@ -5773,6 +5779,8 @@
'html/shadow/ProgressShadowElement.h',
'html/shadow/SliderThumbElement.cpp',
'html/shadow/SliderThumbElement.h',
+ 'html/shadow/SpinButtonElement.cpp',
+ 'html/shadow/SpinButtonElement.h',
'html/shadow/TextControlInnerElements.cpp',
'html/shadow/TextControlInnerElements.h',
'html/shadow/TextFieldDecorationElement.cpp',
@@ -6228,40 +6236,29 @@
'svg/properties/SVGPathSegListPropertyTearOff.cpp',
],
'webcore_test_support_idl_files': [
- 'testing/FastMallocStatistics.idl',
'testing/Internals.idl',
'testing/InternalSettings.idl',
+ 'testing/MallocStatistics.idl',
],
'webcore_test_support_files': [
'testing/v8/WebCoreTestSupport.cpp',
'testing/v8/WebCoreTestSupport.h',
'testing/js/WebCoreTestSupport.cpp',
'testing/js/WebCoreTestSupport.h',
- 'testing/FastMallocStatistics.h',
'testing/Internals.cpp',
'testing/Internals.h',
'testing/InternalSettings.cpp',
'testing/InternalSettings.h',
+ 'testing/MallocStatistics.h',
'testing/MockPagePopupDriver.cpp',
'testing/MockPagePopupDriver.h',
],
'webinspector_files': [
'inspector/front-end/inspector.html',
'inspector/front-end/AdvancedSearchController.js',
- 'inspector/front-end/ApplicationCacheItemsView.js',
'inspector/front-end/ApplicationCacheModel.js',
- 'inspector/front-end/AuditCategories.js',
- 'inspector/front-end/AuditFormatters.js',
- 'inspector/front-end/AuditLauncherView.js',
- 'inspector/front-end/AuditResultView.js',
- 'inspector/front-end/AuditRules.js',
- 'inspector/front-end/AuditsPanel.js',
- 'inspector/front-end/BottomUpProfileDataGridTree.js',
'inspector/front-end/BreakpointManager.js',
- 'inspector/front-end/BreakpointsSidebarPane.js',
- 'inspector/front-end/CallStackSidebarPane.js',
'inspector/front-end/Checkbox.js',
- 'inspector/front-end/CodeMirrorTextEditor.js',
'inspector/front-end/Color.js',
'inspector/front-end/CompilerScriptMapping.js',
'inspector/front-end/ConsoleMessage.js',
@@ -6274,32 +6271,24 @@
'inspector/front-end/CookieItemsView.js',
'inspector/front-end/CookieParser.js',
'inspector/front-end/CookiesTable.js',
- 'inspector/front-end/CPUProfileView.js',
'inspector/front-end/CSSCompletions.js',
'inspector/front-end/CSSKeywordCompletions.js',
- 'inspector/front-end/CSSSelectorProfileView.js',
'inspector/front-end/CSSStyleModel.js',
'inspector/front-end/Database.js',
- 'inspector/front-end/DatabaseQueryView.js',
- 'inspector/front-end/DatabaseTableView.js',
'inspector/front-end/DataGrid.js',
'inspector/front-end/DebuggerModel.js',
'inspector/front-end/DebuggerScriptMapping.js',
'inspector/front-end/DefaultTextEditor.js',
'inspector/front-end/Dialog.js',
- 'inspector/front-end/DirectoryContentView.js',
'inspector/front-end/DOMAgent.js',
'inspector/front-end/DOMBreakpointsSidebarPane.js',
'inspector/front-end/DOMExtension.js',
'inspector/front-end/DOMPresentationUtils.js',
'inspector/front-end/DOMStorage.js',
- 'inspector/front-end/DOMStorageItemsView.js',
'inspector/front-end/DOMSyntaxHighlighter.js',
'inspector/front-end/Drawer.js',
- 'inspector/front-end/ElementsPanel.js',
'inspector/front-end/ElementsTreeOutline.js',
'inspector/front-end/EmptyView.js',
- 'inspector/front-end/EventListenersSidebarPane.js',
'inspector/front-end/ExtensionAPI.js',
'inspector/front-end/ExtensionAuditCategory.js',
'inspector/front-end/ExtensionPanel.js',
@@ -6307,27 +6296,14 @@
'inspector/front-end/ExtensionServer.js',
'inspector/front-end/ExtensionView.js',
'inspector/front-end/FileManager.js',
- 'inspector/front-end/FileContentView.js',
'inspector/front-end/FileSystemModel.js',
- 'inspector/front-end/FileSystemView.js',
'inspector/front-end/FileUtils.js',
- 'inspector/front-end/FilteredItemSelectionDialog.js',
- 'inspector/front-end/FontView.js',
'inspector/front-end/GoToLineDialog.js',
'inspector/front-end/HAREntry.js',
'inspector/front-end/HandlerRegistry.js',
- 'inspector/front-end/HeapSnapshot.js',
- 'inspector/front-end/HeapSnapshotDataGrids.js',
- 'inspector/front-end/HeapSnapshotGridNodes.js',
- 'inspector/front-end/HeapSnapshotLoader.js',
- 'inspector/front-end/HeapSnapshotProxy.js',
- 'inspector/front-end/HeapSnapshotView.js',
'inspector/front-end/HeapSnapshotWorker.js',
- 'inspector/front-end/HeapSnapshotWorkerDispatcher.js',
'inspector/front-end/HelpScreen.js',
- 'inspector/front-end/ImageView.js',
'inspector/front-end/IndexedDBModel.js',
- 'inspector/front-end/IndexedDBViews.js',
'inspector/front-end/InspectorBackend.js',
'inspector/front-end/InspectorFrontendAPI.js',
'inspector/front-end/InspectorFrontendHostStub.js',
@@ -6336,19 +6312,14 @@
'inspector/front-end/JavaScriptContextManager.js',
'inspector/front-end/JavaScriptFormatter.js',
'inspector/front-end/JavaScriptSource.js',
- 'inspector/front-end/JavaScriptSourceFrame.js',
'inspector/front-end/jsdifflib.js',
'inspector/front-end/KeyboardShortcut.js',
'inspector/front-end/Linkifier.js',
- 'inspector/front-end/MemoryStatistics.js',
- 'inspector/front-end/MetricsSidebarPane.js',
- 'inspector/front-end/NativeMemorySnapshotView.js',
+ 'inspector/front-end/NativeBreakpointsSidebarPane.js',
'inspector/front-end/NavigatorOverlayController.js',
'inspector/front-end/NavigatorView.js',
- 'inspector/front-end/NetworkItemView.js',
'inspector/front-end/NetworkManager.js',
'inspector/front-end/NetworkLog.js',
- 'inspector/front-end/NetworkPanel.js',
'inspector/front-end/NetworkRequest.js',
'inspector/front-end/Object.js',
'inspector/front-end/ObjectPopoverHelper.js',
@@ -6358,40 +6329,20 @@
'inspector/front-end/Placard.js',
'inspector/front-end/Popover.js',
'inspector/front-end/PresentationConsoleMessageHelper.js',
- 'inspector/front-end/ProfileDataGridTree.js',
- 'inspector/front-end/ProfileLauncherView.js',
- 'inspector/front-end/ProfilesPanel.js',
'inspector/front-end/ProgressBar.js',
'inspector/front-end/PropertiesSection.js',
- 'inspector/front-end/PropertiesSidebarPane.js',
'inspector/front-end/RawSourceCode.js',
'inspector/front-end/RemoteObject.js',
- 'inspector/front-end/RequestCookiesView.js',
- 'inspector/front-end/RequestHeadersView.js',
- 'inspector/front-end/RequestJSONView.js',
- 'inspector/front-end/RequestHTMLView.js',
- 'inspector/front-end/RequestPreviewView.js',
- 'inspector/front-end/RequestResponseView.js',
- 'inspector/front-end/RequestTimingView.js',
- 'inspector/front-end/RequestView.js',
'inspector/front-end/Resource.js',
'inspector/front-end/ResourceScriptMapping.js',
'inspector/front-end/ResourceTreeModel.js',
'inspector/front-end/ResourceType.js',
'inspector/front-end/ResourceUtils.js',
- 'inspector/front-end/ResourceView.js',
- 'inspector/front-end/ResourceWebSocketFrameView.js',
- 'inspector/front-end/ResourcesPanel.js',
- 'inspector/front-end/RevisionHistoryView.js',
'inspector/front-end/SASSSourceMapping.js',
- 'inspector/front-end/ScopeChainSidebarPane.js',
'inspector/front-end/Script.js',
'inspector/front-end/ScriptFormatter.js',
'inspector/front-end/ScriptFormatterWorker.js',
'inspector/front-end/ScriptSnippetModel.js',
- 'inspector/front-end/ScriptsNavigator.js',
- 'inspector/front-end/ScriptsPanel.js',
- 'inspector/front-end/ScriptsSearchScope.js',
'inspector/front-end/SearchController.js',
'inspector/front-end/ShortcutsScreen.js',
'inspector/front-end/SettingsScreen.js',
@@ -6412,42 +6363,31 @@
'inspector/front-end/Spectrum.js',
'inspector/front-end/SplitView.js',
'inspector/front-end/StatusBarButton.js',
- 'inspector/front-end/StylesPanel.js',
- 'inspector/front-end/StylesSidebarPane.js',
- 'inspector/front-end/TabbedEditorContainer.js',
+ 'inspector/front-end/StyleSource.js',
'inspector/front-end/TabbedPane.js',
'inspector/front-end/TestController.js',
'inspector/front-end/TextEditor.js',
'inspector/front-end/TextEditorHighlighter.js',
'inspector/front-end/TextEditorModel.js',
'inspector/front-end/TextPrompt.js',
- 'inspector/front-end/TimelineFrameController.js',
- 'inspector/front-end/TimelineManager.js',
- 'inspector/front-end/TimelineModel.js',
- 'inspector/front-end/TimelinePresentationModel.js',
- 'inspector/front-end/TimelineOverviewPane.js',
'inspector/front-end/TimelineGrid.js',
- 'inspector/front-end/TimelinePanel.js',
+ 'inspector/front-end/TimelineManager.js',
'inspector/front-end/Toolbar.js',
- 'inspector/front-end/TopDownProfileDataGridTree.js',
'inspector/front-end/treeoutline.js',
'inspector/front-end/UISourceCode.js',
- 'inspector/front-end/UISourceCodeFrame.js',
'inspector/front-end/UIUtils.js',
'inspector/front-end/UserAgentSupport.js',
'inspector/front-end/UserMetrics.js',
'inspector/front-end/utilities.js',
'inspector/front-end/View.js',
- 'inspector/front-end/WatchExpressionsSidebarPane.js',
'inspector/front-end/WorkerManager.js',
- 'inspector/front-end/WorkersSidebarPane.js',
'inspector/front-end/Workspace.js',
'inspector/front-end/dialog.css',
'inspector/front-end/inspector.css',
'inspector/front-end/inspectorSyntaxHighlight.css',
'inspector/front-end/popover.css',
+ '<@(webinspector_modules_js_files)',
'<@(webinspector_standalone_css_files)',
- '<@(webinspector_standalone_js_files)',
],
'webinspector_standalone_css_files': [
'inspector/front-end/auditsPanel.css',
@@ -6476,13 +6416,111 @@
'inspector/front-end/textPrompt.css',
'inspector/front-end/timelinePanel.css',
],
- 'webinspector_standalone_js_files': [
+ 'webinspector_elements_js_files': [
+ 'inspector/front-end/ElementsPanel.js',
+ 'inspector/front-end/EventListenersSidebarPane.js',
+ 'inspector/front-end/MetricsSidebarPane.js',
+ 'inspector/front-end/PropertiesSidebarPane.js',
+ 'inspector/front-end/StylesSidebarPane.js',
+ ],
+ 'webinspector_resources_js_files': [
+ 'inspector/front-end/ApplicationCacheItemsView.js',
+ 'inspector/front-end/DOMStorageItemsView.js',
+ 'inspector/front-end/DatabaseQueryView.js',
+ 'inspector/front-end/DatabaseTableView.js',
+ 'inspector/front-end/DirectoryContentView.js',
+ 'inspector/front-end/FileContentView.js',
+ 'inspector/front-end/FileSystemView.js',
+ 'inspector/front-end/IndexedDBViews.js',
+ 'inspector/front-end/ResourcesPanel.js',
+ ],
+ 'webinspector_network_js_files': [
+ 'inspector/front-end/FontView.js',
+ 'inspector/front-end/ImageView.js',
+ 'inspector/front-end/NetworkItemView.js',
+ 'inspector/front-end/RequestCookiesView.js',
+ 'inspector/front-end/RequestHeadersView.js',
+ 'inspector/front-end/RequestHTMLView.js',
+ 'inspector/front-end/RequestJSONView.js',
+ 'inspector/front-end/RequestPreviewView.js',
+ 'inspector/front-end/RequestResponseView.js',
+ 'inspector/front-end/RequestTimingView.js',
+ 'inspector/front-end/RequestView.js',
+ 'inspector/front-end/ResourceView.js',
+ 'inspector/front-end/ResourceWebSocketFrameView.js',
+ 'inspector/front-end/NetworkPanel.js',
+ ],
+ 'webinspector_scripts_js_files': [
+ 'inspector/front-end/BreakpointsSidebarPane.js',
+ 'inspector/front-end/CallStackSidebarPane.js',
+ 'inspector/front-end/FilteredItemSelectionDialog.js',
+ 'inspector/front-end/JavaScriptSourceFrame.js',
+ 'inspector/front-end/RevisionHistoryView.js',
+ 'inspector/front-end/ScopeChainSidebarPane.js',
+ 'inspector/front-end/ScriptsNavigator.js',
+ 'inspector/front-end/ScriptsPanel.js',
+ 'inspector/front-end/ScriptsSearchScope.js',
+ 'inspector/front-end/SnippetJavaScriptSourceFrame.js',
+ 'inspector/front-end/StyleSheetOutlineDialog.js',
+ 'inspector/front-end/TabbedEditorContainer.js',
+ 'inspector/front-end/UISourceCodeFrame.js',
+ 'inspector/front-end/WatchExpressionsSidebarPane.js',
+ 'inspector/front-end/WorkersSidebarPane.js',
+ ],
+ 'webinspector_timeline_js_files': [
+ 'inspector/front-end/MemoryStatistics.js',
+ 'inspector/front-end/TimelineFrameController.js',
+ 'inspector/front-end/TimelineModel.js',
+ 'inspector/front-end/TimelinePresentationModel.js',
+ 'inspector/front-end/TimelineOverviewPane.js',
+ 'inspector/front-end/TimelinePanel.js',
+ ],
+
+ 'webinspector_profiles_js_files': [
+ 'inspector/front-end/BottomUpProfileDataGridTree.js',
+ 'inspector/front-end/CPUProfileView.js',
+ 'inspector/front-end/CSSSelectorProfileView.js',
+ 'inspector/front-end/HeapSnapshot.js',
+ 'inspector/front-end/HeapSnapshotDataGrids.js',
+ 'inspector/front-end/HeapSnapshotGridNodes.js',
+ 'inspector/front-end/HeapSnapshotLoader.js',
+ 'inspector/front-end/HeapSnapshotProxy.js',
+ 'inspector/front-end/HeapSnapshotView.js',
+ 'inspector/front-end/HeapSnapshotWorkerDispatcher.js',
+ 'inspector/front-end/NativeMemorySnapshotView.js',
+ 'inspector/front-end/ProfileDataGridTree.js',
+ 'inspector/front-end/ProfilesPanel.js',
+ 'inspector/front-end/ProfileLauncherView.js',
+ 'inspector/front-end/TopDownProfileDataGridTree.js',
+ ],
+
+ 'webinspector_audits_js_files': [
+ 'inspector/front-end/AuditCategories.js',
+ 'inspector/front-end/AuditFormatters.js',
+ 'inspector/front-end/AuditLauncherView.js',
+ 'inspector/front-end/AuditResultView.js',
+ 'inspector/front-end/AuditRules.js',
+ 'inspector/front-end/AuditsPanel.js',
+ ],
+ 'webinspector_codemirror_js_files': [
+ 'inspector/front-end/CodeMirrorTextEditor.js',
'inspector/front-end/cm/codemirror.js',
'inspector/front-end/cm/css.js',
'inspector/front-end/cm/htmlmixed.js',
'inspector/front-end/cm/javascript.js',
'inspector/front-end/cm/xml.js',
],
+
+ 'webinspector_modules_js_files': [
+ '<@(webinspector_elements_js_files)',
+ '<@(webinspector_resources_js_files)',
+ '<@(webinspector_network_js_files)',
+ '<@(webinspector_scripts_js_files)',
+ '<@(webinspector_timeline_js_files)',
+ '<@(webinspector_profiles_js_files)',
+ '<@(webinspector_audits_js_files)',
+ '<@(webinspector_codemirror_js_files)',
+ ],
'webinspector_uglifyjs_files': [
'inspector/front-end/UglifyJS/parse-js.js',
],
@@ -8112,6 +8150,8 @@
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSUint8Array.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSValidityState.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSValidityState.h',
+ '<(PRODUCT_DIR)/DerivedSources/WebCore/JSVoidCallback.cpp',
+ '<(PRODUCT_DIR)/DerivedSources/WebCore/JSVoidCallback.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebGLActiveInfo.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebGLActiveInfo.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebGLBuffer.cpp',
@@ -8316,6 +8356,7 @@
'platform/graphics/chromium/TiledLayerChromium.h',
'platform/graphics/chromium/TreeSynchronizer.cpp',
'platform/graphics/chromium/TreeSynchronizer.h',
+ 'platform/graphics/chromium/UnthrottledTextureUploader.h',
'platform/graphics/chromium/VideoLayerChromium.cpp',
'platform/graphics/chromium/VideoLayerChromium.h',
'platform/graphics/chromium/cc/CCActiveAnimation.cpp',
@@ -8327,6 +8368,7 @@
'platform/graphics/chromium/cc/CCAnimationEvents.h',
'platform/graphics/chromium/cc/CCCheckerboardDrawQuad.cpp',
'platform/graphics/chromium/cc/CCCheckerboardDrawQuad.h',
+ 'platform/graphics/chromium/cc/CCCompletionEvent.h',
'platform/graphics/chromium/cc/CCDamageTracker.cpp',
'platform/graphics/chromium/cc/CCDamageTracker.h',
'platform/graphics/chromium/cc/CCDebugBorderDrawQuad.cpp',
@@ -8335,6 +8377,8 @@
'platform/graphics/chromium/cc/CCDebugRectHistory.h',
'platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp',
'platform/graphics/chromium/cc/CCDelayBasedTimeSource.h',
+ 'platform/graphics/chromium/cc/CCDirectRenderer.h',
+ 'platform/graphics/chromium/cc/CCDirectRenderer.cpp',
'platform/graphics/chromium/cc/CCDrawQuad.cpp',
'platform/graphics/chromium/cc/CCDrawQuad.h',
'platform/graphics/chromium/cc/CCFontAtlas.cpp',
@@ -8344,6 +8388,7 @@
'platform/graphics/chromium/cc/CCFrameRateCounter.cpp',
'platform/graphics/chromium/cc/CCFrameRateCounter.h',
'platform/graphics/chromium/cc/CCGestureCurve.h',
+ 'platform/graphics/chromium/cc/CCGraphicsContext.h',
'platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp',
'platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.h',
'platform/graphics/chromium/cc/CCIOSurfaceDrawQuad.cpp',
@@ -8390,6 +8435,7 @@
'platform/graphics/chromium/cc/CCQuadSink.h',
'platform/graphics/chromium/cc/CCQuadCuller.cpp',
'platform/graphics/chromium/cc/CCQuadCuller.h',
+ 'platform/graphics/chromium/cc/CCRenderer.h',
'platform/graphics/chromium/cc/CCRenderPass.cpp',
'platform/graphics/chromium/cc/CCRenderPass.h',
'platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp',
@@ -8398,6 +8444,7 @@
'platform/graphics/chromium/cc/CCRenderSurface.h',
'platform/graphics/chromium/cc/CCRenderSurfaceFilters.cpp',
'platform/graphics/chromium/cc/CCRenderSurfaceFilters.h',
+ 'platform/graphics/chromium/cc/CCRenderer.h',
'platform/graphics/chromium/cc/CCRenderingStats.h',
'platform/graphics/chromium/cc/CCResourceProvider.cpp',
'platform/graphics/chromium/cc/CCResourceProvider.h',
diff --git a/Source/WebCore/WebCore.order b/Source/WebCore/WebCore.order
index 9d9022ca5..0b2b17583 100644
--- a/Source/WebCore/WebCore.order
+++ b/Source/WebCore/WebCore.order
@@ -14468,7 +14468,6 @@ __ZN7WebCore44jsDocumentPrototypeFunctionQueryCommandValueEPN3JSC9ExecStateE
__ZN7WebCore8Document17queryCommandValueERKN3WTF6StringE
__ZNK7WebCore6Editor7Command5valueEPNS_5EventE
__ZN7WebCoreL17stateStyleWithCSSEPNS_5FrameEPNS_5EventE
-__ZN7WebCore15jsStringOrFalseEPN3JSC9ExecStateERKN3WTF6StringE
__ZN7WebCoreL19executeStyleWithCSSEPNS_5FrameEPNS_5EventENS_19EditorCommandSourceERKN3WTF6StringE
__ZNK7WebCore18HTMLDocumentParser17isExecutingScriptEv
__ZNK7WebCore5Range21compareBoundaryPointsENS0_10CompareHowEPKS0_Ri
diff --git a/Source/WebCore/WebCore.pri b/Source/WebCore/WebCore.pri
index 021933467..3390d4093 100644
--- a/Source/WebCore/WebCore.pri
+++ b/Source/WebCore/WebCore.pri
@@ -259,7 +259,11 @@ mac {
LIBS_PRIVATE += -framework Carbon -framework AppKit
}
-unix:!mac:*-g++*:QMAKE_CXXFLAGS += -ffunction-sections -fdata-sections
+# -ffunction-section conflicts with -pg option
+!contains(CONFIG, gprof) {
+ unix:!mac:*-g++*:QMAKE_CXXFLAGS += -ffunction-sections
+}
+unix:!mac:*-g++*:QMAKE_CXXFLAGS += -fdata-sections
unix:!mac:*-g++*:QMAKE_LFLAGS += -Wl,--gc-sections
linux*-g++*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
diff --git a/Source/WebCore/WebCore.vcproj/WebCore.vcproj b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
index e7acb1ac0..46e6aa72b 100755
--- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -4118,6 +4118,62 @@
>
</File>
<File
+ RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSDOMTransaction.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo_CFLite|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo_CFLite|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Production|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSDOMTransaction.h"
+ >
+ </File>
+ <File
RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSDOMURL.cpp"
>
<FileConfiguration
@@ -22615,6 +22671,62 @@
>
</File>
<File
+ RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSUndoManager.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo_CFLite|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo_CFLite|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Production|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSUndoManager.h"
+ >
+ </File>
+ <File
RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSValidityState.cpp"
>
<FileConfiguration
@@ -24730,6 +24842,10 @@
>
</File>
<File
+ RelativePath="..\Modules\filesystem\FileSystemFlags.h"
+ >
+ </File>
+ <File
RelativePath="..\Modules\filesystem\FileSystemType.h"
>
</File>
@@ -24786,10 +24902,6 @@
>
</File>
<File
- RelativePath="..\Modules\filesystem\WebKitFlags.h"
- >
- </File>
- <File
RelativePath="..\Modules\filesystem\WorkerContextFileSystem.cpp"
>
</File>
@@ -28419,6 +28531,14 @@
>
</File>
<File
+ RelativePath="..\platform\PlatformInstrumentation.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\PlatformInstrumentation.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\PlatformKeyboardEvent.h"
>
</File>
@@ -63778,6 +63898,14 @@
>
</File>
<File
+ RelativePath="..\html\shadow\SpinButtonElement.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\shadow\SpinButtonElement.h"
+ >
+ </File>
+ <File
RelativePath="..\html\shadow\TextControlInnerElements.cpp"
>
</File>
@@ -64066,7 +64194,7 @@
>
</File>
<File
- RelativePath="..\bindings\js\DOMWrapperWorld.cpp"
+ RelativePath="..\bindings\js\DOMTransaction.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -64118,11 +64246,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\DOMWrapperWorld.h"
+ RelativePath="..\bindings\js\DOMTransaction.h"
>
</File>
<File
- RelativePath="..\bindings\js\GCController.cpp"
+ RelativePath="..\bindings\js\DOMWrapperWorld.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -64174,11 +64302,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\GCController.h"
+ RelativePath="..\bindings\js\DOMWrapperWorld.h"
>
</File>
<File
- RelativePath="..\bindings\js\IDBBindingUtilities.cpp"
+ RelativePath="..\bindings\js\GCController.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -64230,11 +64358,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\IDBBindingUtilities.h"
+ RelativePath="..\bindings\js\GCController.h"
>
</File>
<File
- RelativePath="..\bindings\js\IDBCustomBindings.cpp"
+ RelativePath="..\bindings\js\IDBBindingUtilities.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -64286,7 +64414,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JavaScriptCallFrame.cpp"
+ RelativePath="..\bindings\js\IDBBindingUtilities.h"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\IDBCustomBindings.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -64338,11 +64470,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JavaScriptCallFrame.h"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSAttrCustom.cpp"
+ RelativePath="..\bindings\js\JavaScriptCallFrame.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -64394,11 +64522,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSBindingsAllInOne.cpp"
+ RelativePath="..\bindings\js\JavaScriptCallFrame.h"
>
</File>
<File
- RelativePath="..\bindings\js\JSBlobCustom.cpp"
+ RelativePath="..\bindings\js\JSAttrCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -64450,7 +64578,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSCallbackData.cpp"
+ RelativePath="..\bindings\js\JSBindingsAllInOne.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSBlobCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -64502,11 +64634,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSCallbackData.h"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSCanvasRenderingContext2DCustom.cpp"
+ RelativePath="..\bindings\js\JSCallbackData.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -64558,7 +64686,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSCanvasRenderingContextCustom.cpp"
+ RelativePath="..\bindings\js\JSCallbackData.h"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSCanvasRenderingContext2DCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -64610,7 +64742,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSCDATASectionCustom.cpp"
+ RelativePath="..\bindings\js\JSCanvasRenderingContextCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -64662,7 +64794,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSClipboardCustom.cpp"
+ RelativePath="..\bindings\js\JSCDATASectionCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -64714,7 +64846,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSConsoleCustom.cpp"
+ RelativePath="..\bindings\js\JSClipboardCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -64766,7 +64898,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSCoordinatesCustom.cpp"
+ RelativePath="..\bindings\js\JSConsoleCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -64818,7 +64950,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSCSSFontFaceRuleCustom.cpp"
+ RelativePath="..\bindings\js\JSCoordinatesCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -64870,7 +65002,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSCSSImportRuleCustom.cpp"
+ RelativePath="..\bindings\js\JSCSSFontFaceRuleCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -64922,7 +65054,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSCSSMediaRuleCustom.cpp"
+ RelativePath="..\bindings\js\JSCSSImportRuleCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -64974,7 +65106,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSCSSPageRuleCustom.cpp"
+ RelativePath="..\bindings\js\JSCSSMediaRuleCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -65026,7 +65158,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSCSSRuleCustom.cpp"
+ RelativePath="..\bindings\js\JSCSSPageRuleCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -65078,7 +65210,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSCSSRuleListCustom.cpp"
+ RelativePath="..\bindings\js\JSCSSRuleCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -65130,7 +65262,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSCSSStyleDeclarationCustom.cpp"
+ RelativePath="..\bindings\js\JSCSSRuleListCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -65182,11 +65314,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSCSSStyleDeclarationCustom.h"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSCSSStyleRuleCustom.cpp"
+ RelativePath="..\bindings\js\JSCSSStyleDeclarationCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -65238,7 +65366,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSCSSValueCustom.cpp"
+ RelativePath="..\bindings\js\JSCSSStyleDeclarationCustom.h"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSCSSStyleRuleCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -65290,7 +65422,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSCustomSQLStatementErrorCallback.cpp"
+ RelativePath="..\bindings\js\JSCSSValueCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -65342,7 +65474,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSCustomVoidCallback.cpp"
+ RelativePath="..\bindings\js\JSCustomSQLStatementErrorCallback.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -65394,10 +65526,6 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSCustomVoidCallback.h"
- >
- </File>
- <File
RelativePath="..\bindings\js\JSCustomXPathNSResolver.cpp"
>
<FileConfiguration
@@ -65718,14 +65846,6 @@
>
</File>
<File
- RelativePath="..\bindings\js\JSDirectoryEntryCustom.cpp"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSDirectoryEntrySyncCustom.cpp"
- >
- </File>
- <File
RelativePath="..\bindings\js\JSDocumentCustom.cpp"
>
<FileConfiguration
@@ -70158,6 +70278,58 @@
</FileConfiguration>
</File>
<File
+ RelativePath="..\bindings\js\JSUndoManagerCustom.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo_CFLite|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo_CFLite|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Production|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
RelativePath="..\bindings\js\JSWebKitAnimationCustom.cpp"
>
<FileConfiguration
@@ -75822,6 +75994,10 @@
>
</File>
<File
+ RelativePath="..\inspector\front-end\NativeBreakpointsSidebarPane.js"
+ >
+ </File>
+ <File
RelativePath="..\inspector\front-end\NavigatorOverlayController.js"
>
</File>
@@ -76102,6 +76278,10 @@
>
</File>
<File
+ RelativePath="..\inspector\front-end\SnippetJavaScriptSourceFrame.js"
+ >
+ </File>
+ <File
RelativePath="..\inspector\front-end\SnippetStorage.js"
>
</File>
@@ -76150,7 +76330,7 @@
>
</File>
<File
- RelativePath="..\inspector\front-end\StylesPanel.js"
+ RelativePath="..\inspector\front-end\StyleSheetOutlineDialog.js"
>
</File>
<File
@@ -76158,6 +76338,10 @@
>
</File>
<File
+ RelativePath="..\inspector\front-end\StyleSource.js"
+ >
+ </File>
+ <File
RelativePath="..\inspector\front-end\SummaryBar.js"
>
</File>
diff --git a/Source/WebCore/WebCore.vcproj/WebCoreTestSupport.vcproj b/Source/WebCore/WebCore.vcproj/WebCoreTestSupport.vcproj
index afc4deb2e..501f9da09 100644
--- a/Source/WebCore/WebCore.vcproj/WebCoreTestSupport.vcproj
+++ b/Source/WebCore/WebCore.vcproj/WebCoreTestSupport.vcproj
@@ -348,7 +348,7 @@
Name="DerivedSources"
>
<File
- RelativePath="$(ConfigurationBuildDir)\obj\WebCore\DerivedSources\JSFastMallocStatistics.cpp"
+ RelativePath="$(ConfigurationBuildDir)\obj\WebCore\DerivedSources\JSMallocStatistics.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -412,7 +412,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(ConfigurationBuildDir)\obj\WebCore\DerivedSources\JSFastMallocStatistics.h"
+ RelativePath="$(ConfigurationBuildDir)\obj\WebCore\DerivedSources\JSMallocStatistics.h"
>
</File>
<File
@@ -556,7 +556,7 @@
Name="testing"
>
<File
- RelativePath="..\testing\FastMallocStatistics.h"
+ RelativePath="..\testing\MallocStatistics.h"
>
</File>
<File
diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
index 6d08c313b..b12277159 100644
--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -398,8 +398,6 @@
1A2E6E590CC55213004A2062 /* SQLValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2E6E570CC55213004A2062 /* SQLValue.cpp */; };
1A2E6E5A0CC55213004A2062 /* SQLValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2E6E580CC55213004A2062 /* SQLValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
1A2E6E7A0CC556D5004A2062 /* SQLiteAuthorizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2E6E780CC556D5004A2062 /* SQLiteAuthorizer.cpp */; };
- 1A3417C90CECFF250049CBDE /* JSCustomVoidCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3417C70CECFF250049CBDE /* JSCustomVoidCallback.h */; };
- 1A3417CA0CECFF250049CBDE /* JSCustomVoidCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3417C80CECFF250049CBDE /* JSCustomVoidCallback.cpp */; };
1A35862C152522540022A659 /* ScrollingTreeMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A35862A152522540022A659 /* ScrollingTreeMac.mm */; };
1A3586DF15264C450022A659 /* RenderMultiColumnFlowThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3586DD15264C450022A659 /* RenderMultiColumnFlowThread.cpp */; };
1A3586E015264C450022A659 /* RenderMultiColumnFlowThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3586DE15264C450022A659 /* RenderMultiColumnFlowThread.h */; };
@@ -1212,6 +1210,8 @@
45099C411370A7800058D513 /* IconURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 45099C401370A7800058D513 /* IconURL.cpp */; };
450CEBF015073BBE002BB149 /* LabelableElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 450CEBEE15073BBE002BB149 /* LabelableElement.cpp */; };
450CEBF115073BBE002BB149 /* LabelableElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 450CEBEF15073BBE002BB149 /* LabelableElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 4512502215DCE37D002F84E2 /* SpinButtonElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4512502015DCE37D002F84E2 /* SpinButtonElement.cpp */; };
+ 4512502315DCE37D002F84E2 /* SpinButtonElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4512502115DCE37D002F84E2 /* SpinButtonElement.h */; };
453EB636159C570400001BB7 /* DateTimeFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 453EB634159C570400001BB7 /* DateTimeFormat.cpp */; };
453EB637159C570400001BB7 /* DateTimeFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 453EB635159C570400001BB7 /* DateTimeFormat.h */; settings = {ATTRIBUTES = (Private, ); }; };
458FE4091589DF0B005609E6 /* RenderSearchField.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 458FE4071589DF0B005609E6 /* RenderSearchField.cpp */; };
@@ -1237,6 +1237,8 @@
46F9D5DF0B0D60170028EE36 /* progressCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46F9D5DC0B0D60170028EE36 /* progressCursor.png */; };
490707E61219C04300D90E51 /* ANGLEWebKitBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 490707E41219C04300D90E51 /* ANGLEWebKitBridge.cpp */; };
490707E71219C04300D90E51 /* ANGLEWebKitBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 490707E51219C04300D90E51 /* ANGLEWebKitBridge.h */; };
+ 49182B5215DCE6F000548418 /* PlatformInstrumentation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49182B5015DCE6F000548418 /* PlatformInstrumentation.cpp */; };
+ 49182B5315DCE6F000548418 /* PlatformInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49182B5115DCE6F000548418 /* PlatformInstrumentation.h */; };
492863991253B8FC00F792D6 /* ResourceLoadInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 492863981253B8FC00F792D6 /* ResourceLoadInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
49291E4B134172C800E753DE /* ImageRenderingMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 49291E4A134172C800E753DE /* ImageRenderingMode.h */; };
493E5E0912D6420500020081 /* PlatformCALayerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 493E5E0812D6420500020081 /* PlatformCALayerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1801,6 +1803,7 @@
65DF326109D1E199000BE325 /* UserAgentStyleSheetsData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581AF09D14EE6000E61D7 /* UserAgentStyleSheetsData.cpp */; };
65E0E9441133C89F00B4CB10 /* JSDOMWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E0E9431133C89F00B4CB10 /* JSDOMWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
65FEA86909833ADE00BED4AB /* Page.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65FEA86809833ADE00BED4AB /* Page.cpp */; };
+ 6B3480940EEF50D400AC1B41 /* NativeImagePtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3480920EEF50D400AC1B41 /* NativeImagePtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
6E21C6C01126338500A7BE02 /* GraphicsContext3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E21C6BF1126338500A7BE02 /* GraphicsContext3D.cpp */; };
6E21C6C21126339900A7BE02 /* GraphicsContext3DCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E21C6C11126339900A7BE02 /* GraphicsContext3DCG.cpp */; };
6E3FAD3814733F4000E42306 /* JSWebGLCompressedTextureS3TC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E3FAD3614733F4000E42306 /* JSWebGLCompressedTextureS3TC.cpp */; };
@@ -1956,12 +1959,16 @@
7AF11A5A12E727490061F23C /* InspectorRuntimeAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AF11A5912E727490061F23C /* InspectorRuntimeAgent.h */; };
7AFD4A8B1131C2760035B883 /* ScriptBreakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AFD4A8A1131C2760035B883 /* ScriptBreakpoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
7AFD4FF4113277B60035B883 /* ScriptDebugListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AFD4FF3113277B60035B883 /* ScriptDebugListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 7B0992F515ACF1AD00ED6D20 /* JSUndoManagerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B0992F415ACF1AD00ED6D20 /* JSUndoManagerCustom.cpp */; };
7B1EA0CE1576C5B50060177D /* JSUndoManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B1EA0CC1576C5B50060177D /* JSUndoManager.cpp */; };
7B1EA0CF1576C5B50060177D /* JSUndoManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B1EA0CD1576C5B50060177D /* JSUndoManager.h */; };
+ 7B3537C515CB2CB50083AB69 /* JSDOMTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B3537C315CB2CB50083AB69 /* JSDOMTransaction.cpp */; };
+ 7B3537C615CB2CB50083AB69 /* JSDOMTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B3537C415CB2CB50083AB69 /* JSDOMTransaction.h */; };
7B9184D215758E420092AA93 /* UndoManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B9184CF15758E420092AA93 /* UndoManager.cpp */; };
7B9184D315758E420092AA93 /* UndoManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B9184D015758E420092AA93 /* UndoManager.h */; };
- 7C522D4B15B477E8009B7C95 /* InspectorOverlay.cpp */ = {isa = PBXBuildFile; fileRef = 7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */; };
- 7C522D4C15B478B2009B7C95 /* InspectorOverlay.h */ = {isa = PBXBuildFile; fileRef = 7C522D4A15B477E8009B7C95 /* InspectorOverlay.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 7BB35AEB15CCDDF400F2A643 /* DOMTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7BB35AE915CCDDF400F2A643 /* DOMTransaction.cpp */; };
+ 7BB35AEC15CCDDF400F2A643 /* DOMTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BB35AEA15CCDDF400F2A643 /* DOMTransaction.h */; };
+ 7C522D4B15B477E8009B7C95 /* InspectorOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */; };
7E33CD01127F340D00BE8F17 /* PurgePriority.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E33CD00127F340D00BE8F17 /* PurgePriority.h */; settings = {ATTRIBUTES = (Private, ); }; };
7E37EF2E1339208800B29250 /* SubresourceLoaderCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E37EF2D1339208800B29250 /* SubresourceLoaderCF.cpp */; };
7E99AF510B13846468FB01A5 /* WindowFocusAllowedIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E99AF520B13846468FB01A5 /* WindowFocusAllowedIndicator.cpp */; };
@@ -2944,7 +2951,6 @@
893C47BB1238A0A9002B3D86 /* JSFileWriterCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C47B91238A0A9002B3D86 /* JSFileWriterCallback.cpp */; };
893C47BC1238A0A9002B3D86 /* JSFileWriterCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 893C47BA1238A0A9002B3D86 /* JSFileWriterCallback.h */; };
893C47CC123EEBA2002B3D86 /* JSEntryCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C47CA123EEBA2002B3D86 /* JSEntryCustom.cpp */; };
- 893C47DF123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C47DE123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp */; };
893C48001248BD3A002B3D86 /* DirectoryEntrySync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C47F01248BD39002B3D86 /* DirectoryEntrySync.cpp */; };
893C48011248BD3A002B3D86 /* DirectoryEntrySync.h in Headers */ = {isa = PBXBuildFile; fileRef = 893C47F11248BD39002B3D86 /* DirectoryEntrySync.h */; };
893C48021248BD3A002B3D86 /* DirectoryReaderSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C47F21248BD39002B3D86 /* DirectoryReaderSync.cpp */; };
@@ -2960,7 +2966,6 @@
893C480D1248BD3A002B3D86 /* EntrySync.h in Headers */ = {isa = PBXBuildFile; fileRef = 893C47FD1248BD39002B3D86 /* EntrySync.h */; };
893C480E1248BD3A002B3D86 /* FileEntrySync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C47FE1248BD39002B3D86 /* FileEntrySync.cpp */; };
893C480F1248BD3A002B3D86 /* FileEntrySync.h in Headers */ = {isa = PBXBuildFile; fileRef = 893C47FF1248BD39002B3D86 /* FileEntrySync.h */; };
- 893C48211249535B002B3D86 /* JSDirectoryEntrySyncCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C48201249535B002B3D86 /* JSDirectoryEntrySyncCustom.cpp */; };
893C483212495472002B3D86 /* JSDirectoryEntrySync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C482612495472002B3D86 /* JSDirectoryEntrySync.cpp */; };
893C483312495472002B3D86 /* JSDirectoryEntrySync.h in Headers */ = {isa = PBXBuildFile; fileRef = 893C482712495472002B3D86 /* JSDirectoryEntrySync.h */; };
893C483412495472002B3D86 /* JSDirectoryReaderSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C482812495472002B3D86 /* JSDirectoryReaderSync.cpp */; };
@@ -2994,7 +2999,7 @@
89878563122CA064003AABDA /* FileSystemCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987854A122CA064003AABDA /* FileSystemCallback.h */; };
89878564122CA064003AABDA /* FileSystemCallbacks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8987854B122CA064003AABDA /* FileSystemCallbacks.cpp */; };
89878565122CA064003AABDA /* FileSystemCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987854C122CA064003AABDA /* FileSystemCallbacks.h */; };
- 89878566122CA064003AABDA /* WebKitFlags.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987854D122CA064003AABDA /* WebKitFlags.h */; };
+ 89878566122CA064003AABDA /* FileSystemFlags.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987854D122CA064003AABDA /* FileSystemFlags.h */; };
89878567122CA064003AABDA /* LocalFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8987854E122CA064003AABDA /* LocalFileSystem.cpp */; };
89878568122CA064003AABDA /* LocalFileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987854F122CA064003AABDA /* LocalFileSystem.h */; };
89878569122CA064003AABDA /* Metadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 89878550122CA064003AABDA /* Metadata.h */; };
@@ -3360,6 +3365,7 @@
93F9B7A10BA6032600854064 /* JSCDATASection.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F9B79F0BA6032600854064 /* JSCDATASection.h */; };
93FDAFCA0B11307400E2746F /* EditorInsertAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FDAFC90B11307400E2746F /* EditorInsertAction.h */; settings = {ATTRIBUTES = (Private, ); }; };
96ABA42314BCB80E00D56204 /* GraphicsContext3DOpenGLCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 96ABA42214BCB80E00D56204 /* GraphicsContext3DOpenGLCommon.cpp */; };
+ 9703E1BF15DC4E37001F24C8 /* JSVoidCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97E9EC8B15DC492F004F2E71 /* JSVoidCallback.cpp */; };
97059977107D975200A50A7C /* PolicyCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97059973107D975200A50A7C /* PolicyCallback.cpp */; };
97059978107D975200A50A7C /* PolicyCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 97059974107D975200A50A7C /* PolicyCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
97059979107D975200A50A7C /* PolicyChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97059975107D975200A50A7C /* PolicyChecker.cpp */; };
@@ -3797,8 +3803,8 @@
A72EA3BB1585CF55004FAA26 /* RefCountedSupplement.h in Headers */ = {isa = PBXBuildFile; fileRef = A72EA3BA1585CF55004FAA26 /* RefCountedSupplement.h */; settings = {ATTRIBUTES = (Private, ); }; };
A73F95FE12C97BFE0031AAF9 /* RoundedRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A73F95FC12C97BFE0031AAF9 /* RoundedRect.cpp */; };
A73F95FF12C97BFE0031AAF9 /* RoundedRect.h in Headers */ = {isa = PBXBuildFile; fileRef = A73F95FD12C97BFE0031AAF9 /* RoundedRect.h */; settings = {ATTRIBUTES = (Private, ); }; };
- A740B59514C935AB00A77FA4 /* JSFastMallocStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B4EA6914C9348400C8F5BF /* JSFastMallocStatistics.h */; };
- A740B59714C935AF00A77FA4 /* JSFastMallocStatistics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7B4EA6814C9348400C8F5BF /* JSFastMallocStatistics.cpp */; };
+ A740B59514C935AB00A77FA4 /* JSMallocStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B4EA6914C9348400C8F5BF /* JSMallocStatistics.h */; };
+ A740B59714C935AF00A77FA4 /* JSMallocStatistics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7B4EA6814C9348400C8F5BF /* JSMallocStatistics.cpp */; };
A740B5A514C935AB00A77FA4 /* JSInternalSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B4EA7914C9348400C8F5BF /* JSInternalSettings.h */; };
A740B5A714C935AF00A77FA4 /* JSInternalSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7B4EA7814C9348400C8F5BF /* JSInternalSettings.cpp */; };
A74BB76B13BDA86300FF7BF0 /* ExceptionCodePlaceholder.h in Headers */ = {isa = PBXBuildFile; fileRef = A74BB76A13BDA86300FF7BF0 /* ExceptionCodePlaceholder.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -4826,7 +4832,6 @@
B27535740B053814002CE64F /* IntRect.h in Headers */ = {isa = PBXBuildFile; fileRef = B27535460B053814002CE64F /* IntRect.h */; settings = {ATTRIBUTES = (Private, ); }; };
B27535750B053814002CE64F /* IntSize.h in Headers */ = {isa = PBXBuildFile; fileRef = B27535470B053814002CE64F /* IntSize.h */; settings = {ATTRIBUTES = (Private, ); }; };
B27535760B053814002CE64F /* IntSizeHash.h in Headers */ = {isa = PBXBuildFile; fileRef = B27535480B053814002CE64F /* IntSizeHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 6B3480940EEF50D400AC1B41 /* NativeImagePtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3480920EEF50D400AC1B41 /* NativeImagePtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
B27535770B053814002CE64F /* ColorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = B275354A0B053814002CE64F /* ColorMac.mm */; };
B27535780B053814002CE64F /* FloatPointMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = B275354B0B053814002CE64F /* FloatPointMac.mm */; };
B27535790B053814002CE64F /* FloatRectMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = B275354C0B053814002CE64F /* FloatRectMac.mm */; };
@@ -6499,7 +6504,6 @@
FDEA6247152102FC00479DF0 /* JSWaveTable.h in Headers */ = {isa = PBXBuildFile; fileRef = FDEA6245152102FC00479DF0 /* JSWaveTable.h */; };
FDEAAAF312B02EE400DCF33B /* JSAudioBufferSourceNodeCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDEAAAEF12B02EE400DCF33B /* JSAudioBufferSourceNodeCustom.cpp */; };
FDEAAAF412B02EE400DCF33B /* JSAudioContextCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDEAAAF012B02EE400DCF33B /* JSAudioContextCustom.cpp */; };
- FDEAAAF612B02EE400DCF33B /* JSConvolverNodeCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDEAAAF212B02EE400DCF33B /* JSConvolverNodeCustom.cpp */; };
FDEAAAFE12B02F4900DCF33B /* JSJavaScriptAudioNodeCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDEAAAFD12B02F4900DCF33B /* JSJavaScriptAudioNodeCustom.cpp */; };
FDF09DC81399B62200688E5B /* JSBiquadFilterNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDF09DC61399B62200688E5B /* JSBiquadFilterNode.cpp */; };
FDF09DC91399B62200688E5B /* JSBiquadFilterNode.h in Headers */ = {isa = PBXBuildFile; fileRef = FDF09DC71399B62200688E5B /* JSBiquadFilterNode.h */; };
@@ -7414,8 +7418,6 @@
1A2E6E570CC55213004A2062 /* SQLValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SQLValue.cpp; path = sql/SQLValue.cpp; sourceTree = "<group>"; };
1A2E6E580CC55213004A2062 /* SQLValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SQLValue.h; path = sql/SQLValue.h; sourceTree = "<group>"; };
1A2E6E780CC556D5004A2062 /* SQLiteAuthorizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SQLiteAuthorizer.cpp; path = sql/SQLiteAuthorizer.cpp; sourceTree = "<group>"; };
- 1A3417C70CECFF250049CBDE /* JSCustomVoidCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCustomVoidCallback.h; sourceTree = "<group>"; };
- 1A3417C80CECFF250049CBDE /* JSCustomVoidCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCustomVoidCallback.cpp; sourceTree = "<group>"; };
1A35862A152522540022A659 /* ScrollingTreeMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingTreeMac.mm; sourceTree = "<group>"; };
1A3586DD15264C450022A659 /* RenderMultiColumnFlowThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMultiColumnFlowThread.cpp; sourceTree = "<group>"; };
1A3586DE15264C450022A659 /* RenderMultiColumnFlowThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMultiColumnFlowThread.h; sourceTree = "<group>"; };
@@ -8317,6 +8319,8 @@
45099C401370A7800058D513 /* IconURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IconURL.cpp; sourceTree = "<group>"; };
450CEBEE15073BBE002BB149 /* LabelableElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LabelableElement.cpp; sourceTree = "<group>"; };
450CEBEF15073BBE002BB149 /* LabelableElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelableElement.h; sourceTree = "<group>"; };
+ 4512502015DCE37D002F84E2 /* SpinButtonElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpinButtonElement.cpp; sourceTree = "<group>"; };
+ 4512502115DCE37D002F84E2 /* SpinButtonElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpinButtonElement.h; sourceTree = "<group>"; };
453EB634159C570400001BB7 /* DateTimeFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateTimeFormat.cpp; sourceTree = "<group>"; };
453EB635159C570400001BB7 /* DateTimeFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateTimeFormat.h; sourceTree = "<group>"; };
458FE4071589DF0B005609E6 /* RenderSearchField.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSearchField.cpp; sourceTree = "<group>"; };
@@ -8342,6 +8346,8 @@
46F9D5DC0B0D60170028EE36 /* progressCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = progressCursor.png; sourceTree = "<group>"; };
490707E41219C04300D90E51 /* ANGLEWebKitBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ANGLEWebKitBridge.cpp; sourceTree = "<group>"; };
490707E51219C04300D90E51 /* ANGLEWebKitBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANGLEWebKitBridge.h; sourceTree = "<group>"; };
+ 49182B5015DCE6F000548418 /* PlatformInstrumentation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformInstrumentation.cpp; sourceTree = "<group>"; };
+ 49182B5115DCE6F000548418 /* PlatformInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformInstrumentation.h; sourceTree = "<group>"; };
492863981253B8FC00F792D6 /* ResourceLoadInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadInfo.h; sourceTree = "<group>"; };
49291E4A134172C800E753DE /* ImageRenderingMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageRenderingMode.h; sourceTree = "<group>"; };
493E5E0812D6420500020081 /* PlatformCALayerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlatformCALayerClient.h; path = ca/PlatformCALayerClient.h; sourceTree = "<group>"; };
@@ -8950,6 +8956,7 @@
65E0E9431133C89F00B4CB10 /* JSDOMWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMWrapper.h; sourceTree = "<group>"; };
65F80697054D9F86008BF776 /* BlockExceptions.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BlockExceptions.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
65FEA86809833ADE00BED4AB /* Page.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Page.cpp; sourceTree = "<group>"; };
+ 6B3480920EEF50D400AC1B41 /* NativeImagePtr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NativeImagePtr.h; sourceTree = "<group>"; };
6E21C6BF1126338500A7BE02 /* GraphicsContext3D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3D.cpp; sourceTree = "<group>"; };
6E21C6C11126339900A7BE02 /* GraphicsContext3DCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3DCG.cpp; sourceTree = "<group>"; };
6E3FAD3614733F4000E42306 /* JSWebGLCompressedTextureS3TC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLCompressedTextureS3TC.cpp; sourceTree = "<group>"; };
@@ -9127,11 +9134,17 @@
7AF11A5912E727490061F23C /* InspectorRuntimeAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorRuntimeAgent.h; sourceTree = "<group>"; };
7AFD4A8A1131C2760035B883 /* ScriptBreakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptBreakpoint.h; sourceTree = "<group>"; };
7AFD4FF3113277B60035B883 /* ScriptDebugListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptDebugListener.h; sourceTree = "<group>"; };
+ 7B0992F415ACF1AD00ED6D20 /* JSUndoManagerCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSUndoManagerCustom.cpp; sourceTree = "<group>"; };
7B1EA0CC1576C5B50060177D /* JSUndoManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSUndoManager.cpp; sourceTree = "<group>"; };
7B1EA0CD1576C5B50060177D /* JSUndoManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSUndoManager.h; sourceTree = "<group>"; };
+ 7B3537C315CB2CB50083AB69 /* JSDOMTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMTransaction.cpp; sourceTree = "<group>"; };
+ 7B3537C415CB2CB50083AB69 /* JSDOMTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMTransaction.h; sourceTree = "<group>"; };
+ 7B8C1FE615CCE3C2004B35DC /* DOMTransaction.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMTransaction.idl; sourceTree = "<group>"; };
7B9184CF15758E420092AA93 /* UndoManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UndoManager.cpp; sourceTree = "<group>"; };
7B9184D015758E420092AA93 /* UndoManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UndoManager.h; sourceTree = "<group>"; };
7B9184D115758E420092AA93 /* UndoManager.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = UndoManager.idl; sourceTree = "<group>"; };
+ 7BB35AE915CCDDF400F2A643 /* DOMTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMTransaction.cpp; sourceTree = "<group>"; };
+ 7BB35AEA15CCDDF400F2A643 /* DOMTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMTransaction.h; sourceTree = "<group>"; };
7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorOverlay.cpp; sourceTree = "<group>"; };
7C522D4A15B478B2009B7C95 /* InspectorOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorOverlay.h; sourceTree = "<group>"; };
7C60128060078BB70E367A95 /* DNSResolveQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNSResolveQueue.cpp; sourceTree = "<group>"; };
@@ -10072,7 +10085,6 @@
893C47B91238A0A9002B3D86 /* JSFileWriterCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileWriterCallback.cpp; sourceTree = "<group>"; };
893C47BA1238A0A9002B3D86 /* JSFileWriterCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileWriterCallback.h; sourceTree = "<group>"; };
893C47CA123EEBA2002B3D86 /* JSEntryCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEntryCustom.cpp; sourceTree = "<group>"; };
- 893C47DE123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDirectoryEntryCustom.cpp; sourceTree = "<group>"; };
893C47F01248BD39002B3D86 /* DirectoryEntrySync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DirectoryEntrySync.cpp; path = Modules/filesystem/DirectoryEntrySync.cpp; sourceTree = "<group>"; };
893C47F11248BD39002B3D86 /* DirectoryEntrySync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DirectoryEntrySync.h; path = Modules/filesystem/DirectoryEntrySync.h; sourceTree = "<group>"; };
893C47F21248BD39002B3D86 /* DirectoryReaderSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DirectoryReaderSync.cpp; path = Modules/filesystem/DirectoryReaderSync.cpp; sourceTree = "<group>"; };
@@ -10088,7 +10100,6 @@
893C47FD1248BD39002B3D86 /* EntrySync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EntrySync.h; path = Modules/filesystem/EntrySync.h; sourceTree = "<group>"; };
893C47FE1248BD39002B3D86 /* FileEntrySync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileEntrySync.cpp; path = Modules/filesystem/FileEntrySync.cpp; sourceTree = "<group>"; };
893C47FF1248BD39002B3D86 /* FileEntrySync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileEntrySync.h; path = Modules/filesystem/FileEntrySync.h; sourceTree = "<group>"; };
- 893C48201249535B002B3D86 /* JSDirectoryEntrySyncCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDirectoryEntrySyncCustom.cpp; sourceTree = "<group>"; };
893C482612495472002B3D86 /* JSDirectoryEntrySync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDirectoryEntrySync.cpp; sourceTree = "<group>"; };
893C482712495472002B3D86 /* JSDirectoryEntrySync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDirectoryEntrySync.h; sourceTree = "<group>"; };
893C482812495472002B3D86 /* JSDirectoryReaderSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDirectoryReaderSync.cpp; sourceTree = "<group>"; };
@@ -10122,7 +10133,7 @@
8987854A122CA064003AABDA /* FileSystemCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSystemCallback.h; path = Modules/filesystem/FileSystemCallback.h; sourceTree = "<group>"; };
8987854B122CA064003AABDA /* FileSystemCallbacks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileSystemCallbacks.cpp; path = Modules/filesystem/FileSystemCallbacks.cpp; sourceTree = "<group>"; };
8987854C122CA064003AABDA /* FileSystemCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSystemCallbacks.h; path = Modules/filesystem/FileSystemCallbacks.h; sourceTree = "<group>"; };
- 8987854D122CA064003AABDA /* WebKitFlags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebKitFlags.h; path = Modules/filesystem/WebKitFlags.h; sourceTree = "<group>"; };
+ 8987854D122CA064003AABDA /* FileSystemFlags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSystemFlags.h; path = Modules/filesystem/FileSystemFlags.h; sourceTree = "<group>"; };
8987854E122CA064003AABDA /* LocalFileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LocalFileSystem.cpp; path = Modules/filesystem/LocalFileSystem.cpp; sourceTree = "<group>"; };
8987854F122CA064003AABDA /* LocalFileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LocalFileSystem.h; path = Modules/filesystem/LocalFileSystem.h; sourceTree = "<group>"; };
89878550122CA064003AABDA /* Metadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Metadata.h; path = Modules/filesystem/Metadata.h; sourceTree = "<group>"; };
@@ -10839,6 +10850,8 @@
97DCE20010807C750057D394 /* HistoryController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HistoryController.h; sourceTree = "<group>"; };
97E4028D13A696ED00913D67 /* IconController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IconController.cpp; sourceTree = "<group>"; };
97E4028E13A696ED00913D67 /* IconController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IconController.h; sourceTree = "<group>"; };
+ 97E9EC8B15DC492F004F2E71 /* JSVoidCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVoidCallback.cpp; sourceTree = "<group>"; };
+ 97E9EC8C15DC492F004F2E71 /* JSVoidCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVoidCallback.h; sourceTree = "<group>"; };
97EF7DFD107E55B700D7C49C /* ScriptControllerBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptControllerBase.cpp; sourceTree = "<group>"; };
97F8E661151D4A3F00D2D181 /* WorkerContextNotifications.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WorkerContextNotifications.cpp; path = Modules/notifications/WorkerContextNotifications.cpp; sourceTree = "<group>"; };
97F8E662151D4A3F00D2D181 /* WorkerContextNotifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WorkerContextNotifications.h; path = Modules/notifications/WorkerContextNotifications.h; sourceTree = "<group>"; };
@@ -11020,16 +11033,16 @@
A7AD2F860EC89D07008AB002 /* LinkHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkHash.h; sourceTree = "<group>"; };
A7B070D0130A409C00A3763C /* FrameActionScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameActionScheduler.cpp; sourceTree = "<group>"; };
A7B070D1130A409C00A3763C /* FrameActionScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrameActionScheduler.h; sourceTree = "<group>"; };
- A7B4EA6814C9348400C8F5BF /* JSFastMallocStatistics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFastMallocStatistics.cpp; sourceTree = "<group>"; };
- A7B4EA6914C9348400C8F5BF /* JSFastMallocStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFastMallocStatistics.h; sourceTree = "<group>"; };
+ A7B4EA6814C9348400C8F5BF /* JSMallocStatistics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMallocStatistics.cpp; sourceTree = "<group>"; };
+ A7B4EA6914C9348400C8F5BF /* JSMallocStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMallocStatistics.h; sourceTree = "<group>"; };
A7B4EA7814C9348400C8F5BF /* JSInternalSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInternalSettings.cpp; sourceTree = "<group>"; };
A7B4EA7914C9348400C8F5BF /* JSInternalSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInternalSettings.h; sourceTree = "<group>"; };
A7B6E69D0B291A9600D0529F /* DragData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragData.h; sourceTree = "<group>"; };
A7B7749614CF6353004044BB /* HTMLContentElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLContentElement.idl; sourceTree = "<group>"; };
A7BBE26411AFB3F20005EA03 /* JSHTMLMeterElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLMeterElement.cpp; sourceTree = "<group>"; };
A7BBE26511AFB3F20005EA03 /* JSHTMLMeterElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLMeterElement.h; sourceTree = "<group>"; };
- A7BE7EDD14C9175A0014489D /* FastMallocStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FastMallocStatistics.h; sourceTree = "<group>"; };
- A7BE7EDE14C9175A0014489D /* FastMallocStatistics.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FastMallocStatistics.idl; sourceTree = "<group>"; };
+ A7BE7EDD14C9175A0014489D /* MallocStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MallocStatistics.h; sourceTree = "<group>"; };
+ A7BE7EDE14C9175A0014489D /* MallocStatistics.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MallocStatistics.idl; sourceTree = "<group>"; };
A7BF7EDC14C9175A0014489D /* InternalSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InternalSettings.cpp; sourceTree = "<group>"; };
A7BF7EDD14C9175A0014489D /* InternalSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InternalSettings.h; sourceTree = "<group>"; };
A7BF7EDE14C9175A0014489D /* InternalSettings.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = InternalSettings.idl; sourceTree = "<group>"; };
@@ -12064,7 +12077,6 @@
B27535460B053814002CE64F /* IntRect.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IntRect.h; sourceTree = "<group>"; };
B27535470B053814002CE64F /* IntSize.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IntSize.h; sourceTree = "<group>"; };
B27535480B053814002CE64F /* IntSizeHash.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IntSizeHash.h; sourceTree = "<group>"; };
- 6B3480920EEF50D400AC1B41 /* NativeImagePtr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NativeImagePtr.h; sourceTree = "<group>"; };
B275354A0B053814002CE64F /* ColorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = ColorMac.mm; sourceTree = "<group>"; };
B275354B0B053814002CE64F /* FloatPointMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = FloatPointMac.mm; sourceTree = "<group>"; };
B275354C0B053814002CE64F /* FloatRectMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = FloatRectMac.mm; sourceTree = "<group>"; };
@@ -13893,7 +13905,6 @@
FDEA6245152102FC00479DF0 /* JSWaveTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWaveTable.h; sourceTree = "<group>"; };
FDEAAAEF12B02EE400DCF33B /* JSAudioBufferSourceNodeCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAudioBufferSourceNodeCustom.cpp; sourceTree = "<group>"; };
FDEAAAF012B02EE400DCF33B /* JSAudioContextCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAudioContextCustom.cpp; sourceTree = "<group>"; };
- FDEAAAF212B02EE400DCF33B /* JSConvolverNodeCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSConvolverNodeCustom.cpp; sourceTree = "<group>"; };
FDEAAAFD12B02F4900DCF33B /* JSJavaScriptAudioNodeCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSJavaScriptAudioNodeCustom.cpp; sourceTree = "<group>"; };
FDF09DC61399B62200688E5B /* JSBiquadFilterNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBiquadFilterNode.cpp; sourceTree = "<group>"; };
FDF09DC71399B62200688E5B /* JSBiquadFilterNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBiquadFilterNode.h; sourceTree = "<group>"; };
@@ -14923,6 +14934,8 @@
A715E651134BBBEC00D8E713 /* ProgressShadowElement.h */,
4150F9F012B6E0E70008C860 /* SliderThumbElement.cpp */,
4150F9EF12B6E0E70008C860 /* SliderThumbElement.h */,
+ 4512502015DCE37D002F84E2 /* SpinButtonElement.cpp */,
+ 4512502115DCE37D002F84E2 /* SpinButtonElement.h */,
142B97C713138943008BEF4B /* TextControlInnerElements.cpp */,
142B97C813138943008BEF4B /* TextControlInnerElements.h */,
);
@@ -14933,14 +14946,14 @@
isa = PBXGroup;
children = (
41815C1B138319630057AAA4 /* js */,
- A7BE7EDD14C9175A0014489D /* FastMallocStatistics.h */,
- A7BE7EDE14C9175A0014489D /* FastMallocStatistics.idl */,
417DA4CF13734326007C57FB /* Internals.cpp */,
417DA4CE13734326007C57FB /* Internals.h */,
41813F9113818AD60057AAA4 /* Internals.idl */,
A7BF7EDC14C9175A0014489D /* InternalSettings.cpp */,
A7BF7EDD14C9175A0014489D /* InternalSettings.h */,
A7BF7EDE14C9175A0014489D /* InternalSettings.idl */,
+ A7BE7EDD14C9175A0014489D /* MallocStatistics.h */,
+ A7BE7EDE14C9175A0014489D /* MallocStatistics.idl */,
);
path = testing;
sourceTree = "<group>";
@@ -14948,12 +14961,12 @@
417DA71213735D90007C57FB /* Testing */ = {
isa = PBXGroup;
children = (
- A7B4EA6814C9348400C8F5BF /* JSFastMallocStatistics.cpp */,
- A7B4EA6914C9348400C8F5BF /* JSFastMallocStatistics.h */,
417DA71B13735DFA007C57FB /* JSInternals.cpp */,
417DA71C13735DFA007C57FB /* JSInternals.h */,
A7B4EA7814C9348400C8F5BF /* JSInternalSettings.cpp */,
A7B4EA7914C9348400C8F5BF /* JSInternalSettings.h */,
+ A7B4EA6814C9348400C8F5BF /* JSMallocStatistics.cpp */,
+ A7B4EA6914C9348400C8F5BF /* JSMallocStatistics.h */,
);
name = Testing;
sourceTree = "<group>";
@@ -15844,6 +15857,8 @@
7B7F686D1576BFA1003FABF2 /* Editing */ = {
isa = PBXGroup;
children = (
+ 7B3537C315CB2CB50083AB69 /* JSDOMTransaction.cpp */,
+ 7B3537C415CB2CB50083AB69 /* JSDOMTransaction.h */,
7B1EA0CC1576C5B50060177D /* JSUndoManager.cpp */,
7B1EA0CD1576C5B50060177D /* JSUndoManager.h */,
);
@@ -17088,6 +17103,7 @@
CECADFC3153778FF00E37068 /* DictationAlternative.h */,
CECADFC4153778FF00E37068 /* DictationCommand.cpp */,
CECADFC5153778FF00E37068 /* DictationCommand.h */,
+ 7B8C1FE615CCE3C2004B35DC /* DOMTransaction.idl */,
93309D93099E64910056E581 /* EditAction.h */,
93309D94099E64910056E581 /* EditCommand.cpp */,
93309D95099E64910056E581 /* EditCommand.h */,
@@ -17854,6 +17870,7 @@
E1AB1EBE14E9E3B200449E13 /* FileSystemCallback.idl */,
8987854B122CA064003AABDA /* FileSystemCallbacks.cpp */,
8987854C122CA064003AABDA /* FileSystemCallbacks.h */,
+ 8987854D122CA064003AABDA /* FileSystemFlags.h */,
89C7C2E0155804F4007D5A7B /* FileSystemType.h */,
976D6C6E122B8A3D001FD1F7 /* FileThread.cpp */,
976D6C6F122B8A3D001FD1F7 /* FileThread.h */,
@@ -17880,7 +17897,6 @@
976D6C5C122B8A3D001FD1F7 /* WebKitBlobBuilder.cpp */,
976D6C5D122B8A3D001FD1F7 /* WebKitBlobBuilder.h */,
E1AB1EC314E9E3E200449E13 /* WebKitBlobBuilder.idl */,
- 8987854D122CA064003AABDA /* WebKitFlags.h */,
);
name = fileapi;
sourceTree = "<group>";
@@ -18077,8 +18093,6 @@
A75E8B7F0E1DE2B0007F2481 /* filters */ = {
isa = PBXGroup;
children = (
- 50D88CB315BDFDAA001809F4 /* CustomFilterProgramInfo.cpp */,
- 50D88CB415BDFDAA001809F4 /* CustomFilterProgramInfo.h */,
49ECEB5C1499790D00CDD3A4 /* arm */,
50D4060F147D49DE00D30BB5 /* CustomFilterCompiledProgram.cpp */,
50D40610147D49DE00D30BB5 /* CustomFilterCompiledProgram.h */,
@@ -18093,6 +18107,8 @@
503D0CA714B5B08700F32F57 /* CustomFilterProgram.cpp */,
503D0CA814B5B08700F32F57 /* CustomFilterProgram.h */,
503D0CA914B5B08700F32F57 /* CustomFilterProgramClient.h */,
+ 50D88CB315BDFDAA001809F4 /* CustomFilterProgramInfo.cpp */,
+ 50D88CB415BDFDAA001809F4 /* CustomFilterProgramInfo.h */,
A1E1154313015C3D0054AC8C /* DistantLightSource.cpp */,
84730D5A1248F0B300D3A9C9 /* DistantLightSource.h */,
A75E8B800E1DE2D6007F2481 /* FEBlend.cpp */,
@@ -18381,6 +18397,8 @@
91089D3014C335CD005AFC49 /* JSUint8ClampedArray.h */,
15C77092100D3CA8005BA267 /* JSValidityState.cpp */,
15C77091100D3CA8005BA267 /* JSValidityState.h */,
+ 97E9EC8B15DC492F004F2E71 /* JSVoidCallback.cpp */,
+ 97E9EC8C15DC492F004F2E71 /* JSVoidCallback.h */,
A7D20F60107F406900A80392 /* JSWebGLActiveInfo.cpp */,
A7D20F61107F406900A80392 /* JSWebGLActiveInfo.h */,
49C7B9801042D2D30009D447 /* JSWebGLBuffer.cpp */,
@@ -20077,6 +20095,8 @@
316023EF1532C40C00D50FF4 /* Dictionary.h */,
BC53DA61114314BD000D817E /* DOMObjectHashTableMap.cpp */,
BC53DA5F1143141A000D817E /* DOMObjectHashTableMap.h */,
+ 7BB35AE915CCDDF400F2A643 /* DOMTransaction.cpp */,
+ 7BB35AEA15CCDDF400F2A643 /* DOMTransaction.h */,
BC53DA471143134D000D817E /* DOMWrapperWorld.cpp */,
BC53DA2D1143121E000D817E /* DOMWrapperWorld.h */,
1432E8480C51493F00B1500F /* GCController.cpp */,
@@ -20216,7 +20236,6 @@
93BA59B10F2AA5FE008E8E99 /* JSCDATASectionCustom.cpp */,
BCA83E510D7CE205003421A8 /* JSClipboardCustom.cpp */,
C0DFC86F0DB6841A003EAE7C /* JSConsoleCustom.cpp */,
- FDEAAAF212B02EE400DCF33B /* JSConvolverNodeCustom.cpp */,
FE700DD00F92D81A008E2BFE /* JSCoordinatesCustom.cpp */,
E1AD14901297337400ACA989 /* JSCSSFontFaceRuleCustom.cpp */,
E1AD147B1297307E00ACA989 /* JSCSSImportRuleCustom.cpp */,
@@ -20232,8 +20251,6 @@
33503CBF10179C1A003B47E1 /* JSDesktopNotificationsCustom.cpp */,
31FB1A6B120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp */,
590E1B4A11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp */,
- 893C47DE123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp */,
- 893C48201249535B002B3D86 /* JSDirectoryEntrySyncCustom.cpp */,
49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */,
2E0888E5114884E200AF4265 /* JSDOMFormDataCustom.cpp */,
22885E631301AE4C00526E68 /* JSDOMImplementationCustom.cpp */,
@@ -20325,6 +20342,7 @@
07846384145B1B8E00A58DF1 /* JSTrackCustom.h */,
07B5A30A14687B8400A81ECE /* JSTrackEventCustom.cpp */,
516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */,
+ 7B0992F415ACF1AD00ED6D20 /* JSUndoManagerCustom.cpp */,
49EED14C1051971A00099FAB /* JSWebGLRenderingContextCustom.cpp */,
319E68861327C911004AC91A /* JSWebKitAnimationCustom.cpp */,
3194623113022F65004BB3F8 /* JSWebKitAnimationListCustom.cpp */,
@@ -20588,8 +20606,6 @@
1449E286107D4DB400B5793F /* JSCallbackData.cpp */,
1449E24A107D4A8400B5793F /* JSCallbackData.h */,
51EC925D0CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.cpp */,
- 1A3417C80CECFF250049CBDE /* JSCustomVoidCallback.cpp */,
- 1A3417C70CECFF250049CBDE /* JSCustomVoidCallback.h */,
E10B93C20B73C291003ED890 /* JSCustomXPathNSResolver.cpp */,
E10B937B0B73C00A003ED890 /* JSCustomXPathNSResolver.h */,
93B70D4D09EB0C7C009D8468 /* JSEventListener.cpp */,
@@ -20723,6 +20739,8 @@
BC5C76291497FE1400BC4775 /* PlatformEvent.h */,
A723F77A1484CA4C008C6DBE /* PlatformExportMacros.h */,
BC9585DF12F0989500755821 /* PlatformGestureEvent.h */,
+ 49182B5015DCE6F000548418 /* PlatformInstrumentation.cpp */,
+ 49182B5115DCE6F000548418 /* PlatformInstrumentation.h */,
935C476609AC4D4300A6AAB4 /* PlatformKeyboardEvent.h */,
932871BF0B20DEB70049035A /* PlatformMenuDescription.h */,
935C476709AC4D4300A6AAB4 /* PlatformMouseEvent.h */,
@@ -22117,9 +22135,9 @@
files = (
417DA6DA13734E6E007C57FB /* Internals.h in Headers */,
A7BF7EE014C9175A0014489D /* InternalSettings.h in Headers */,
- A740B59514C935AB00A77FA4 /* JSFastMallocStatistics.h in Headers */,
417DA71E13735DFA007C57FB /* JSInternals.h in Headers */,
A740B5A514C935AB00A77FA4 /* JSInternalSettings.h in Headers */,
+ A740B59514C935AB00A77FA4 /* JSMallocStatistics.h in Headers */,
41815C1F138319830057AAA4 /* WebCoreTestSupport.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -22285,6 +22303,7 @@
51C0AA390F2AA10A001648C2 /* CachedFrame.h in Headers */,
51CBFC990D10E483002DBF51 /* CachedFramePlatformData.h in Headers */,
BCB16C1C0979C3BD00467741 /* CachedImage.h in Headers */,
+ 319FBD5F15D2F464009640A6 /* CachedImageClient.h in Headers */,
510184690B08602A004A825F /* CachedPage.h in Headers */,
D0EDA775143E303C0028E383 /* CachedRawResource.h in Headers */,
BCB16C200979C3BD00467741 /* CachedResource.h in Headers */,
@@ -22459,6 +22478,7 @@
509CC9FB14C069ED00BBECBD /* CustomFilterParameter.h in Headers */,
503D0CAB14B5B08700F32F57 /* CustomFilterProgram.h in Headers */,
503D0CAC14B5B08700F32F57 /* CustomFilterProgramClient.h in Headers */,
+ 50D88CB615BDFDAA001809F4 /* CustomFilterProgramInfo.h in Headers */,
A8CB413E0E8633FD0032C4F0 /* DashArray.h in Headers */,
A80E6D0B0A1989CA007FB8C5 /* DashboardRegion.h in Headers */,
97BC6A211505F081001B74AC /* Database.h in Headers */,
@@ -23108,6 +23128,7 @@
188604B40F2E654A000B6443 /* DOMTimer.h in Headers */,
05FD69E012845D4300B2BEB3 /* DOMTimeStamp.h in Headers */,
76FC2B0C12370DA0006A991A /* DOMTokenList.h in Headers */,
+ 7BB35AEC15CCDDF400F2A643 /* DOMTransaction.h in Headers */,
BC1A37BE097C715F0019F3D8 /* DOMTraversal.h in Headers */,
85526CD20AB0B7D9000302EA /* DOMTreeWalker.h in Headers */,
850B41C30AD9E7E700A6ED4F /* DOMTreeWalkerInternal.h in Headers */,
@@ -23270,6 +23291,7 @@
514B3F730C722047000530DF /* FileSystem.h in Headers */,
89878563122CA064003AABDA /* FileSystemCallback.h in Headers */,
89878565122CA064003AABDA /* FileSystemCallbacks.h in Headers */,
+ 89878566122CA064003AABDA /* FileSystemFlags.h in Headers */,
26C17A3E1491D2D400D12BA2 /* FileSystemIOS.h in Headers */,
89C7C2E1155804F4007D5A7B /* FileSystemType.h in Headers */,
976D6C8E122B8A3D001FD1F7 /* FileThread.h in Headers */,
@@ -23635,7 +23657,6 @@
7ACD88D414C08BD60084EDD2 /* InspectorIndexedDBAgent.h in Headers */,
20D629271253690B00081543 /* InspectorInstrumentation.h in Headers */,
7AA51DD6148506A900AD2752 /* InspectorMemoryAgent.h in Headers */,
- 7C522D4C15B478B2009B7C95 /* InspectorOverlay.h in Headers */,
4F6FDD651341DEDD001F8EE3 /* InspectorPageAgent.h in Headers */,
9F0D6B2F121BFEBA006C0288 /* InspectorProfilerAgent.h in Headers */,
82AB1776125C826700C5069D /* InspectorResourceAgent.h in Headers */,
@@ -23728,7 +23749,6 @@
14CF78A609F58CD800EB3665 /* JSCSSValue.h in Headers */,
A8D05FAC0A23B30F005E7203 /* JSCSSValueList.h in Headers */,
E4778B80115A581A00B5D372 /* JSCustomEvent.h in Headers */,
- 1A3417C90CECFF250049CBDE /* JSCustomVoidCallback.h in Headers */,
E10B937C0B73C00A003ED890 /* JSCustomXPathNSResolver.h in Headers */,
1AE82F900CAAFA9D002237AE /* JSDatabase.h in Headers */,
B59DD699119029E5007E9684 /* JSDatabaseCallback.h in Headers */,
@@ -23764,6 +23784,7 @@
C5137CF311A58378004ADB99 /* JSDOMStringList.h in Headers */,
BC64649811D82349006455B0 /* JSDOMStringMap.h in Headers */,
7694563D1214D97C0007CBAE /* JSDOMTokenList.h in Headers */,
+ 7B3537C615CB2CB50083AB69 /* JSDOMTransaction.h in Headers */,
2E37E00612DBC5A400A6B233 /* JSDOMURL.h in Headers */,
BC6932740D7E293900AE44D1 /* JSDOMWindowBase.h in Headers */,
652FBBBC0DE27CB60001D386 /* JSDOMWindowCustom.h in Headers */,
@@ -24438,6 +24459,7 @@
BCAA487014A052530088FAC4 /* PlatformEventFactoryMac.h in Headers */,
A723F77B1484CA4C008C6DBE /* PlatformExportMacros.h in Headers */,
BC9585E112F0989500755821 /* PlatformGestureEvent.h in Headers */,
+ 49182B5315DCE6F000548418 /* PlatformInstrumentation.h in Headers */,
935C476809AC4D4300A6AAB4 /* PlatformKeyboardEvent.h in Headers */,
0562F9611573F88F0031CA16 /* PlatformLayer.h in Headers */,
932871C00B20DEB70049035A /* PlatformMenuDescription.h in Headers */,
@@ -24790,6 +24812,7 @@
75415B0012958D5E003AD669 /* SpeechInputResultList.h in Headers */,
A78FE13C12366B1000ACE8D0 /* SpellChecker.h in Headers */,
B8DBDB4E130B0F8A00F5CDB1 /* SpellingCorrectionCommand.h in Headers */,
+ 4512502315DCE37D002F84E2 /* SpinButtonElement.h in Headers */,
93309E12099E64920056E581 /* SplitElementCommand.h in Headers */,
93309E14099E64920056E581 /* SplitTextNodeCommand.h in Headers */,
93309E16099E64920056E581 /* SplitTextNodeContainingElementCommand.h in Headers */,
@@ -25286,11 +25309,11 @@
31288E750E3005D6003619AE /* WebKitCSSKeyframesRule.h in Headers */,
498391590F1E776900C23782 /* WebKitCSSMatrix.h in Headers */,
A24BF77B15CC3BAF003191F2 /* WebKitCSSMixFunctionValue.h in Headers */,
+ A24BF77B15CC3BAF003191F2 /* WebKitCSSMixFunctionValue.h in Headers */,
8AA61D00144D595B00F37350 /* WebKitCSSRegionRule.h in Headers */,
29CD61DE146D02890068E82A /* WebKitCSSShaderValue.h in Headers */,
0562F9471573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.h in Headers */,
BC9ADD230CC4032600098C4C /* WebKitCSSTransformValue.h in Headers */,
- 89878566122CA064003AABDA /* WebKitFlags.h in Headers */,
12F35EB6158745A40035CB63 /* WebKitNamedFlowCollection.h in Headers */,
494BD7950F55C8EE00747828 /* WebKitPoint.h in Headers */,
31C0FF250E4CEB6E007D6FE5 /* WebKitTransitionEvent.h in Headers */,
@@ -25397,9 +25420,6 @@
E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
977E2E0F12F0FC9C00C13379 /* XSSAuditor.h in Headers */,
FD537353137B651800008DCE /* ZeroPole.h in Headers */,
- A24BF77B15CC3BAF003191F2 /* WebKitCSSMixFunctionValue.h in Headers */,
- 50D88CB615BDFDAA001809F4 /* CustomFilterProgramInfo.h in Headers */,
- 319FBD5F15D2F464009640A6 /* CachedImageClient.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -25572,11 +25592,19 @@
outputPaths = (
"$(DERIVED_FILE_DIR)/WebCore/inspector.html",
"$(DERIVED_FILE_DIR)/WebCore/inspector.js",
- "$(DERIVED_FILE_DIR)/WebCore/scriptFormatterWorker.js",
+ "$(DERIVED_FILE_DIR)/WebCore/ElementsPanel.js",
+ "$(DERIVED_FILE_DIR)/WebCore/ResourcesPanel.js",
+ "$(DERIVED_FILE_DIR)/WebCore/NetworkPanel.js",
+ "$(DERIVED_FILE_DIR)/WebCore/ScriptsPanel.js",
+ "$(DERIVED_FILE_DIR)/WebCore/TimelinePanel.js",
+ "$(DERIVED_FILE_DIR)/WebCore/ProfilesPanel.js",
+ "$(DERIVED_FILE_DIR)/WebCore/AuditsPanel.js",
+ "$(DERIVED_FILE_DIR)/WebCore/CodeMirrorTextEditor.js",
+ "$(DERIVED_FILE_DIR)/WebCore/ScriptFormatterWorker.js",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "# Don't do anything for Debug builds, so the Inspector is easier to debug.\n# Don't do anything for Production builds, since the Inspector isn't installed.\nif [[ ${CONFIGURATION:=Debug} == \"Debug\" || ${CONFIGURATION:=Production} == \"Production\" ]]; then\n exit\nfi\n\n# Combine all script resources in the inspector.html file.\n\"$SRCROOT/inspector/combine-javascript-resources.pl\" --input-html \"${SRCROOT}/inspector/front-end/inspector.html\" --generated-scripts-dir \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore\" --output-dir \"${DERIVED_FILE_DIR}/WebCore\" --output-script-name inspector.js\n\n# Inline script imports in ScriptFormatterWorker.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/ScriptFormatterWorker.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/scriptFormatterWorker.js\"\n\nif [ -d \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\" ]; then\n cd \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\n\n # Remove any top-level JavaScript files, since they will be replaced with the combined file.\n # Keep InspectorBackend*.js files so they can be used by other front-ends.\n find . -depth 1 -name \"*.js\" -not -name \"InspectorBackend*.js\" | xargs rm -rf\n\n # Copy the modified HTML file and the combined scripts.\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.html\" inspector.html\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.js\" inspector.js\n cp \"${DERIVED_FILE_DIR}/WebCore/scriptFormatterWorker.js\" scriptFormatterWorker.js\nfi\n";
+ shellScript = "# Don't do anything for Debug builds, so the Inspector is easier to debug.\n# Don't do anything for Production builds, since the Inspector isn't installed.\nif [[ ${CONFIGURATION:=Debug} == \"Debug\" || ${CONFIGURATION:=Production} == \"Production\" ]]; then\n exit\nfi\n\n# Combine all script resources in the inspector.html file.\n\"$SRCROOT/inspector/combine-javascript-resources.pl\" --input-html \"${SRCROOT}/inspector/front-end/inspector.html\" --generated-scripts-dir \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore\" --output-dir \"${DERIVED_FILE_DIR}/WebCore\" --output-script-name inspector.js\n\n# Inline script imports in ElementsPanel.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/ElementsPanel.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/ElementsPanel.js\"\n\n# Inline script imports in ResourcesPanel.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/ResourcesPanel.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/ResourcesPanel.js\"\n\n# Inline script imports in NetworkPanel.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/NetworkPanel.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/NetworkPanel.js\"\n\n# Inline script imports in ScriptsPanel.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/ScriptsPanel.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/ScriptsPanel.js\"\n\n# Inline script imports in TimelinePanel.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/TimelinePanel.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/TimelinePanel.js\"\n\n# Inline script imports in ProfilesPanel.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/ProfilesPanel.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/ProfilesPanel.js\"\n\n# Inline script imports in AuditsPanel.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/AuditsPanel.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/AuditsPanel.js\"\n\n# Inline script imports in CodeMirrorTextEditor.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/CodeMirrorTextEditor.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/CodeMirrorTextEditor.js\"\n\n# Inline script imports in ScriptFormatterWorker.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/ScriptFormatterWorker.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/ScriptFormatterWorker.js\"\n\nif [ -d \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\" ]; then\n cd \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\n\n # Remove any top-level JavaScript files, since they will be replaced with the combined file.\n # Keep InspectorBackend*.js files so they can be used by other front-ends.\n find . -depth 1 -name \"*.js\" -not -name \"InspectorBackend*.js\" | xargs rm -rf\n\n # Copy the modified HTML file and the combined scripts.\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.html\" inspector.html\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.js\" inspector.js\n cp \"${DERIVED_FILE_DIR}/WebCore/ElementsPanel.js\" ElementsPanel.js\n cp \"${DERIVED_FILE_DIR}/WebCore/ResourcesPanel.js\" ResourcesPanel.js\n cp \"${DERIVED_FILE_DIR}/WebCore/NetworkPanel.js\" NetworkPanel.js\n cp \"${DERIVED_FILE_DIR}/WebCore/ScriptsPanel.js\" ScriptsPanel.js\n cp \"${DERIVED_FILE_DIR}/WebCore/TimelinePanel.js\" TimelinePanel.js\n cp \"${DERIVED_FILE_DIR}/WebCore/ProfilesPanel.js\" ProfilesPanel.js\n cp \"${DERIVED_FILE_DIR}/WebCore/AuditsPanel.js\" AuditsPanel.js\n cp \"${DERIVED_FILE_DIR}/WebCore/CodeMirrorTextEditor.js\" CodeMirrorTextEditor.js\n cp \"${DERIVED_FILE_DIR}/WebCore/ScriptFormatterWorker.js\" ScriptFormatterWorker.js\nfi\n";
};
1C81BA330E97357C00266E07 /* Copy Inspector Resources */ = {
isa = PBXShellScriptBuildPhase;
@@ -25739,9 +25767,9 @@
files = (
417DA6D913734E6E007C57FB /* Internals.cpp in Sources */,
A7BF7EDF14C9175A0014489D /* InternalSettings.cpp in Sources */,
- A740B59714C935AF00A77FA4 /* JSFastMallocStatistics.cpp in Sources */,
417DA71D13735DFA007C57FB /* JSInternals.cpp in Sources */,
A740B5A714C935AF00A77FA4 /* JSInternalSettings.cpp in Sources */,
+ A740B59714C935AF00A77FA4 /* JSMallocStatistics.cpp in Sources */,
41815C1E138319830057AAA4 /* WebCoreTestSupport.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -26013,6 +26041,7 @@
50D405F9147D31F300D30BB5 /* CustomFilterMesh.cpp in Sources */,
50CC0A3914C6F5B10017AB51 /* CustomFilterOperation.cpp in Sources */,
503D0CAA14B5B08700F32F57 /* CustomFilterProgram.cpp in Sources */,
+ 50D88CB515BDFDAA001809F4 /* CustomFilterProgramInfo.cpp in Sources */,
97BC6A201505F081001B74AC /* Database.cpp in Sources */,
97BC6A231505F081001B74AC /* DatabaseAuthorizer.cpp in Sources */,
97BC6A271505F081001B74AC /* DatabaseContext.cpp in Sources */,
@@ -26370,6 +26399,7 @@
933A14AA0B7D1D0900A53FFD /* DOMTextEvent.mm in Sources */,
188604B30F2E654A000B6443 /* DOMTimer.cpp in Sources */,
76FC2B0B12370DA0006A991A /* DOMTokenList.cpp in Sources */,
+ 7BB35AEB15CCDDF400F2A643 /* DOMTransaction.cpp in Sources */,
85526CD30AB0B7DA000302EA /* DOMTreeWalker.mm in Sources */,
85C7F4920AAF79DC004014DD /* DOMUIEvent.mm in Sources */,
2E37DFDA12DBAFB800A6B233 /* DOMURL.cpp in Sources */,
@@ -26890,7 +26920,6 @@
BC98543D0CD3D98B00069BC1 /* JSConsole.cpp in Sources */,
C0DFC8700DB6841A003EAE7C /* JSConsoleCustom.cpp in Sources */,
FDA15EBD12B03F0B003A583A /* JSConvolverNode.cpp in Sources */,
- FDEAAAF612B02EE400DCF33B /* JSConvolverNodeCustom.cpp in Sources */,
FE6FD48D0F676E9300092873 /* JSCoordinates.cpp in Sources */,
FE700DD10F92D81A008E2BFE /* JSCoordinatesCustom.cpp in Sources */,
930705D809E0C9B700B17FE4 /* JSCounter.cpp in Sources */,
@@ -26919,7 +26948,6 @@
A8D05FAB0A23B30F005E7203 /* JSCSSValueList.cpp in Sources */,
E4778B7F115A581A00B5D372 /* JSCustomEvent.cpp in Sources */,
51EC92650CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.cpp in Sources */,
- 1A3417CA0CECFF250049CBDE /* JSCustomVoidCallback.cpp in Sources */,
E10B93C30B73C291003ED890 /* JSCustomXPathNSResolver.cpp in Sources */,
1AE82F8F0CAAFA9D002237AE /* JSDatabase.cpp in Sources */,
B59DD69A119029E5007E9684 /* JSDatabaseCallback.cpp in Sources */,
@@ -26936,9 +26964,7 @@
590E1B4B11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp in Sources */,
BCE438A2140C0DC0005E437E /* JSDictionary.cpp in Sources */,
8987858A122CA26A003AABDA /* JSDirectoryEntry.cpp in Sources */,
- 893C47DF123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp in Sources */,
893C483212495472002B3D86 /* JSDirectoryEntrySync.cpp in Sources */,
- 893C48211249535B002B3D86 /* JSDirectoryEntrySyncCustom.cpp in Sources */,
8987858C122CA26A003AABDA /* JSDirectoryReader.cpp in Sources */,
893C483412495472002B3D86 /* JSDirectoryReaderSync.cpp in Sources */,
659DDC8209E198BA001BF3C6 /* JSDocument.cpp in Sources */,
@@ -26971,6 +26997,7 @@
BC64649C11D8238C006455B0 /* JSDOMStringMapCustom.cpp in Sources */,
7694563C1214D97C0007CBAE /* JSDOMTokenList.cpp in Sources */,
14E0BC56136148A8002AD12E /* JSDOMTokenListCustom.cpp in Sources */,
+ 7B3537C515CB2CB50083AB69 /* JSDOMTransaction.cpp in Sources */,
2E37E00512DBC5A400A6B233 /* JSDOMURL.cpp in Sources */,
1403BA0C09EB18C700797C7F /* JSDOMWindow.cpp in Sources */,
BC6932730D7E293900AE44D1 /* JSDOMWindowBase.cpp in Sources */,
@@ -27434,7 +27461,9 @@
49EECF08105070C400099FAB /* JSUint8Array.cpp in Sources */,
91089D3314C33605005AFC49 /* JSUint8ClampedArray.cpp in Sources */,
7B1EA0CE1576C5B50060177D /* JSUndoManager.cpp in Sources */,
+ 7B0992F515ACF1AD00ED6D20 /* JSUndoManagerCustom.cpp in Sources */,
15C77094100D3CA8005BA267 /* JSValidityState.cpp in Sources */,
+ 9703E1BF15DC4E37001F24C8 /* JSVoidCallback.cpp in Sources */,
FD82D7F713D4C8BD004E4372 /* JSWaveShaperNode.cpp in Sources */,
FDEA6246152102FC00479DF0 /* JSWaveTable.cpp in Sources */,
A7D20F62107F406900A80392 /* JSWebGLActiveInfo.cpp in Sources */,
@@ -27695,6 +27724,7 @@
CDAA8D0A14D71B2E0061EA60 /* PlatformClockCM.mm in Sources */,
BC5C762A1497FE1400BC4775 /* PlatformEvent.cpp in Sources */,
BCAA486F14A052530088FAC4 /* PlatformEventFactoryMac.mm in Sources */,
+ 49182B5215DCE6F000548418 /* PlatformInstrumentation.cpp in Sources */,
41BF700F0FE86F61005E8DEC /* PlatformMessagePortChannel.cpp in Sources */,
C598902E14E9B0F800E8D18B /* PlatformPasteboardMac.mm in Sources */,
BC94D1080C274F88006BC617 /* PlatformScreenMac.mm in Sources */,
@@ -27983,6 +28013,7 @@
75415C29129A9920003AD669 /* SpeechInputResultList.cpp in Sources */,
A78FE13B12366B1000ACE8D0 /* SpellChecker.cpp in Sources */,
B8DBDB4D130B0F8A00F5CDB1 /* SpellingCorrectionCommand.cpp in Sources */,
+ 4512502215DCE37D002F84E2 /* SpinButtonElement.cpp in Sources */,
93309E11099E64920056E581 /* SplitElementCommand.cpp in Sources */,
93309E13099E64920056E581 /* SplitTextNodeCommand.cpp in Sources */,
93309E15099E64920056E581 /* SplitTextNodeContainingElementCommand.cpp in Sources */,
@@ -28470,7 +28501,6 @@
E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
977E2E0E12F0FC9C00C13379 /* XSSAuditor.cpp in Sources */,
FD537352137B651800008DCE /* ZeroPole.cpp in Sources */,
- 50D88CB515BDFDAA001809F4 /* CustomFilterProgramInfo.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/Source/WebCore/accessibility/AXObjectCache.cpp b/Source/WebCore/accessibility/AXObjectCache.cpp
index dad4c840f..6c08be21f 100644
--- a/Source/WebCore/accessibility/AXObjectCache.cpp
+++ b/Source/WebCore/accessibility/AXObjectCache.cpp
@@ -112,7 +112,7 @@ AccessibilityObject* AXObjectCache::focusedImageMapUIElement(HTMLAreaElement* ar
if (!imageElement)
return 0;
- AccessibilityObject* axRenderImage = areaElement->document()->axObjectCache()->getOrCreate(imageElement->renderer());
+ AccessibilityObject* axRenderImage = areaElement->document()->axObjectCache()->getOrCreate(imageElement);
if (!axRenderImage)
return 0;
@@ -144,12 +144,10 @@ AccessibilityObject* AXObjectCache::focusedUIElementForPage(const Page* page)
if (focusedNode->hasTagName(areaTag))
return focusedImageMapUIElement(static_cast<HTMLAreaElement*>(focusedNode));
- RenderObject* focusedNodeRenderer = focusedNode->renderer();
- if (!focusedNodeRenderer)
+ AccessibilityObject* obj = focusedNode->document()->axObjectCache()->getOrCreate(focusedNode);
+ if (!obj)
return 0;
- AccessibilityObject* obj = focusedNodeRenderer->document()->axObjectCache()->getOrCreate(focusedNodeRenderer);
-
if (obj->shouldFocusActiveDescendant()) {
if (AccessibilityObject* descendant = obj->activeDescendant())
obj = descendant;
@@ -193,16 +191,27 @@ AccessibilityObject* AXObjectCache::get(Node* node)
if (!node)
return 0;
- // Always prefer building the AccessibilityObject from the renderer if there is one.
- if (node->renderer())
- return get(node->renderer());
+ AXID renderID = node->renderer() ? m_renderObjectMapping.get(node->renderer()) : 0;
+ ASSERT(!HashTraits<AXID>::isDeletedValue(renderID));
- AXID axID = m_nodeObjectMapping.get(node);
- ASSERT(!HashTraits<AXID>::isDeletedValue(axID));
- if (!axID)
+ AXID nodeID = m_nodeObjectMapping.get(node);
+ ASSERT(!HashTraits<AXID>::isDeletedValue(nodeID));
+
+ if (node->renderer() && nodeID && !renderID) {
+ // This can happen if an AccessibilityNodeObject is created for a node that's not
+ // rendered, but later something changes and it gets a renderer (like if it's
+ // reparented).
+ remove(nodeID);
+ return 0;
+ }
+
+ if (renderID)
+ return m_objects.get(renderID).get();
+
+ if (!nodeID)
return 0;
- return m_objects.get(axID).get();
+ return m_objects.get(nodeID).get();
}
// FIXME: This probably belongs on Node.
@@ -512,24 +521,34 @@ void AXObjectCache::removeAXID(AccessibilityObject* object)
m_idsInUse.remove(objID);
}
+void AXObjectCache::contentChanged(Node* node)
+{
+ if (AccessibilityObject* object = getOrCreate(node))
+ object->contentChanged();
+}
+
void AXObjectCache::contentChanged(RenderObject* renderer)
{
- AccessibilityObject* object = getOrCreate(renderer);
- if (object)
+ if (AccessibilityObject* object = getOrCreate(renderer))
object->contentChanged();
}
+void AXObjectCache::updateCacheAfterNodeIsAttached(Node* node)
+{
+ // Calling get() will update the AX object if we had an AccessibilityNodeObject but now we need
+ // an AccessibilityRenderObject, because it was reparented to a location outside of a canvas.
+ get(node);
+}
+
+void AXObjectCache::childrenChanged(Node* node)
+{
+ if (AccessibilityObject* obj = get(node))
+ obj->childrenChanged();
+}
+
void AXObjectCache::childrenChanged(RenderObject* renderer)
{
- if (!renderer)
- return;
-
- AXID axID = m_renderObjectMapping.get(renderer);
- if (!axID)
- return;
-
- AccessibilityObject* obj = m_objects.get(axID).get();
- if (obj)
+ if (AccessibilityObject* obj = get(renderer))
obj->childrenChanged();
}
@@ -559,8 +578,6 @@ void AXObjectCache::notificationPostTimerFired(Timer<AXObjectCache>*)
void AXObjectCache::postNotification(RenderObject* renderer, AXNotification notification, bool postToElement, PostType postType)
{
- // Notifications for text input objects are sent to that object.
- // All others are sent to the top WebArea.
if (!renderer)
return;
@@ -578,6 +595,25 @@ void AXObjectCache::postNotification(RenderObject* renderer, AXNotification noti
postNotification(object.get(), renderer->document(), notification, postToElement, postType);
}
+void AXObjectCache::postNotification(Node* node, AXNotification notification, bool postToElement, PostType postType)
+{
+ if (!node)
+ return;
+
+ // Get an accessibility object that already exists. One should not be created here
+ // because a render update may be in progress and creating an AX object can re-trigger a layout
+ RefPtr<AccessibilityObject> object = get(node);
+ while (!object && node) {
+ node = node->parentNode();
+ object = get(node);
+ }
+
+ if (!node)
+ return;
+
+ postNotification(object.get(), node->document(), notification, postToElement, postType);
+}
+
void AXObjectCache::postNotification(AccessibilityObject* object, Document* document, AXNotification notification, bool postToElement, PostType postType)
{
if (object && !postToElement)
@@ -597,9 +633,16 @@ void AXObjectCache::postNotification(AccessibilityObject* object, Document* docu
postPlatformNotification(object, notification);
}
-void AXObjectCache::checkedStateChanged(RenderObject* renderer)
+void AXObjectCache::checkedStateChanged(Node* node)
{
- postNotification(renderer, AXObjectCache::AXCheckedStateChanged, true);
+ postNotification(node, AXObjectCache::AXCheckedStateChanged, true);
+}
+
+void AXObjectCache::selectedChildrenChanged(Node* node)
+{
+ // postToElement is false so that you can pass in any child of an element and it will go up the parent tree
+ // to find the container which should send out the notification.
+ postNotification(node, AXSelectedChildrenChanged, false);
}
void AXObjectCache::selectedChildrenChanged(RenderObject* renderer)
@@ -609,13 +652,13 @@ void AXObjectCache::selectedChildrenChanged(RenderObject* renderer)
postNotification(renderer, AXSelectedChildrenChanged, false);
}
-void AXObjectCache::nodeTextChangeNotification(RenderObject* renderer, AXTextChange textChange, unsigned offset, const String& text)
+void AXObjectCache::nodeTextChangeNotification(Node* node, AXTextChange textChange, unsigned offset, const String& text)
{
- if (!renderer)
+ if (!node)
return;
// Delegate on the right platform
- AccessibilityObject* obj = getOrCreate(renderer);
+ AccessibilityObject* obj = getOrCreate(node);
nodeTextChangePlatformNotification(obj, textChange, offset, text);
}
@@ -639,36 +682,26 @@ void AXObjectCache::handleScrollbarUpdate(ScrollView* view)
return;
// We don't want to create a scroll view from this method, only update an existing one.
- AccessibilityObject* scrollViewObject = get(view);
- if (scrollViewObject)
+ if (AccessibilityObject* scrollViewObject = get(view))
scrollViewObject->updateChildrenIfNecessary();
}
-void AXObjectCache::handleAriaExpandedChange(RenderObject *renderer)
+void AXObjectCache::handleAriaExpandedChange(Node* node)
{
- if (!renderer)
- return;
- AccessibilityObject* obj = getOrCreate(renderer);
- if (obj)
+ if (AccessibilityObject* obj = getOrCreate(node))
obj->handleAriaExpandedChanged();
}
-void AXObjectCache::handleActiveDescendantChanged(RenderObject* renderer)
+void AXObjectCache::handleActiveDescendantChanged(Node* node)
{
- if (!renderer)
- return;
- AccessibilityObject* obj = getOrCreate(renderer);
- if (obj)
+ if (AccessibilityObject* obj = getOrCreate(node))
obj->handleActiveDescendantChanged();
}
-void AXObjectCache::handleAriaRoleChanged(RenderObject* renderer)
+void AXObjectCache::handleAriaRoleChanged(Node* node)
{
- if (!renderer)
- return;
- AccessibilityObject* obj = getOrCreate(renderer);
- if (obj && obj->isAccessibilityRenderObject())
- static_cast<AccessibilityRenderObject*>(obj)->updateAccessibilityRole();
+ if (AccessibilityObject* obj = getOrCreate(node))
+ obj->updateAccessibilityRole();
}
VisiblePosition AXObjectCache::visiblePositionForTextMarkerData(TextMarkerData& textMarkerData)
@@ -717,13 +750,9 @@ void AXObjectCache::textMarkerDataForVisiblePosition(TextMarkerData& textMarkerD
return;
}
- // locate the renderer, which must exist for a visible dom node
- RenderObject* renderer = domNode->renderer();
- ASSERT(renderer);
-
- // find or create an accessibility object for this renderer
- AXObjectCache* cache = renderer->document()->axObjectCache();
- RefPtr<AccessibilityObject> obj = cache->getOrCreate(renderer);
+ // find or create an accessibility object for this node
+ AXObjectCache* cache = domNode->document()->axObjectCache();
+ RefPtr<AccessibilityObject> obj = cache->getOrCreate(domNode);
textMarkerData.axID = obj.get()->axObjectID();
textMarkerData.node = domNode;
@@ -751,7 +780,7 @@ bool AXObjectCache::nodeIsTextControl(const Node* node)
if (!node)
return false;
- const AccessibilityObject* axObject = getOrCreate(node->renderer());
+ const AccessibilityObject* axObject = getOrCreate(const_cast<Node*>(node));
return axObject && axObject->isTextControl();
}
diff --git a/Source/WebCore/accessibility/AXObjectCache.h b/Source/WebCore/accessibility/AXObjectCache.h
index 603fce0c5..1001cf2ae 100644
--- a/Source/WebCore/accessibility/AXObjectCache.h
+++ b/Source/WebCore/accessibility/AXObjectCache.h
@@ -87,17 +87,22 @@ public:
void detachWrapper(AccessibilityObject*);
void attachWrapper(AccessibilityObject*);
+ void childrenChanged(Node*);
void childrenChanged(RenderObject*);
- void checkedStateChanged(RenderObject*);
+ void checkedStateChanged(Node*);
+ void selectedChildrenChanged(Node*);
void selectedChildrenChanged(RenderObject*);
// Called by a node when text or a text equivalent (e.g. alt) attribute is changed.
+ void contentChanged(Node*);
void contentChanged(RenderObject*);
-
- void handleActiveDescendantChanged(RenderObject*);
- void handleAriaRoleChanged(RenderObject*);
- void handleFocusedUIElementChanged(RenderObject* oldFocusedRenderer, RenderObject* newFocusedRenderer);
+ // Called when a node has just been attached, so we can make sure we have the right subclass of AccessibilityObject.
+ void updateCacheAfterNodeIsAttached(Node*);
+
+ void handleActiveDescendantChanged(Node*);
+ void handleAriaRoleChanged(Node*);
+ void handleFocusedUIElementChanged(Node* oldFocusedNode, Node* newFocusedNode);
void handleScrolledToAnchor(const Node* anchorNode);
- void handleAriaExpandedChange(RenderObject*);
+ void handleAriaExpandedChange(Node*);
void handleScrollbarUpdate(ScrollView*);
#if HAVE(ACCESSIBILITY)
@@ -124,11 +129,6 @@ public:
AXID platformGenerateAXID() const;
AccessibilityObject* objectFromAXID(AXID id) const { return m_objects.get(id).get(); }
- // This is a weak reference cache for knowing if Nodes used by TextMarkers are valid.
- void setNodeInUse(Node* n) { m_textMarkerNodes.add(n); }
- void removeNodeForUse(Node* n) { m_textMarkerNodes.remove(n); }
- bool isNodeInUse(Node* n) { return m_textMarkerNodes.contains(n); }
-
// Text marker utilities.
void textMarkerDataForVisiblePosition(TextMarkerData&, const VisiblePosition&);
VisiblePosition visiblePositionForTextMarkerData(TextMarkerData&);
@@ -155,6 +155,7 @@ public:
};
void postNotification(RenderObject*, AXNotification, bool postToElement, PostType = PostAsynchronously);
+ void postNotification(Node*, AXNotification, bool postToElement, PostType = PostAsynchronously);
void postNotification(AccessibilityObject*, Document*, AXNotification, bool postToElement, PostType = PostAsynchronously);
enum AXTextChange {
@@ -162,7 +163,7 @@ public:
AXTextDeleted,
};
- void nodeTextChangeNotification(RenderObject*, AXTextChange, unsigned offset, const String&);
+ void nodeTextChangeNotification(Node*, AXTextChange, unsigned offset, const String&);
enum AXLoadingEvent {
AXLoadingStarted,
@@ -180,6 +181,11 @@ protected:
void nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned offset, const String&);
void frameLoadingEventPlatformNotification(AccessibilityObject*, AXLoadingEvent);
+ // This is a weak reference cache for knowing if Nodes used by TextMarkers are valid.
+ void setNodeInUse(Node* n) { m_textMarkerNodes.add(n); }
+ void removeNodeForUse(Node* n) { m_textMarkerNodes.remove(n); }
+ bool isNodeInUse(Node* n) { return m_textMarkerNodes.contains(n); }
+
private:
Document* m_document;
HashMap<AXID, RefPtr<AccessibilityObject> > m_objects;
@@ -220,28 +226,33 @@ inline Element* AXObjectCache::rootAXEditableElement(Node*) { return 0; }
inline bool nodeHasRole(Node*, const String&) { return false; }
inline const Element* AXObjectCache::rootAXEditableElement(const Node*) { return 0; }
inline void AXObjectCache::attachWrapper(AccessibilityObject*) { }
-inline void AXObjectCache::checkedStateChanged(RenderObject*) { }
+inline void AXObjectCache::checkedStateChanged(Node*) { }
inline void AXObjectCache::childrenChanged(RenderObject*) { }
+inline void AXObjectCache::childrenChanged(Node*) { }
inline void AXObjectCache::contentChanged(RenderObject*) { }
+inline void AXObjectCache::contentChanged(Node*) { }
+inline void AXObjectCache::updateCacheAfterNodeIsAttached(Node*) { }
inline void AXObjectCache::detachWrapper(AccessibilityObject*) { }
inline void AXObjectCache::frameLoadingEventNotification(Frame*, AXLoadingEvent) { }
inline void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject*, AXLoadingEvent) { }
-inline void AXObjectCache::handleActiveDescendantChanged(RenderObject*) { }
-inline void AXObjectCache::handleAriaExpandedChange(RenderObject*) { }
-inline void AXObjectCache::handleAriaRoleChanged(RenderObject*) { }
-inline void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject*) { }
+inline void AXObjectCache::handleActiveDescendantChanged(Node*) { }
+inline void AXObjectCache::handleAriaExpandedChange(Node*) { }
+inline void AXObjectCache::handleAriaRoleChanged(Node*) { }
+inline void AXObjectCache::handleFocusedUIElementChanged(Node*, Node*) { }
inline void AXObjectCache::handleScrollbarUpdate(ScrollView*) { }
inline void AXObjectCache::handleScrolledToAnchor(const Node*) { }
-inline void AXObjectCache::nodeTextChangeNotification(RenderObject*, AXTextChange, unsigned, const String&) { }
+inline void AXObjectCache::nodeTextChangeNotification(Node*, AXTextChange, unsigned, const String&) { }
inline void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned, const String&) { }
inline void AXObjectCache::postNotification(AccessibilityObject*, Document*, AXNotification, bool postToElement, PostType) { }
inline void AXObjectCache::postNotification(RenderObject*, AXNotification, bool postToElement, PostType) { }
+inline void AXObjectCache::postNotification(Node*, AXNotification, bool postToElement, PostType) { }
inline void AXObjectCache::postPlatformNotification(AccessibilityObject*, AXNotification) { }
inline void AXObjectCache::remove(AXID) { }
inline void AXObjectCache::remove(RenderObject*) { }
inline void AXObjectCache::remove(Node*) { }
inline void AXObjectCache::remove(Widget*) { }
inline void AXObjectCache::selectedChildrenChanged(RenderObject*) { }
+inline void AXObjectCache::selectedChildrenChanged(Node*) { }
#endif
}
diff --git a/Source/WebCore/accessibility/AccessibilityListBoxOption.cpp b/Source/WebCore/accessibility/AccessibilityListBoxOption.cpp
index 6cc10ff65..e66649af9 100644
--- a/Source/WebCore/accessibility/AccessibilityListBoxOption.cpp
+++ b/Source/WebCore/accessibility/AccessibilityListBoxOption.cpp
@@ -172,7 +172,7 @@ AccessibilityObject* AccessibilityListBoxOption::parentObject() const
if (!parentNode)
return 0;
- return m_optionElement->document()->axObjectCache()->getOrCreate(parentNode->renderer());
+ return m_optionElement->document()->axObjectCache()->getOrCreate(parentNode);
}
void AccessibilityListBoxOption::setSelected(bool selected)
diff --git a/Source/WebCore/accessibility/AccessibilityNodeObject.h b/Source/WebCore/accessibility/AccessibilityNodeObject.h
index b0e1f1fa8..e0a2cad8e 100644
--- a/Source/WebCore/accessibility/AccessibilityNodeObject.h
+++ b/Source/WebCore/accessibility/AccessibilityNodeObject.h
@@ -81,7 +81,7 @@ public:
virtual void detach();
virtual void childrenChanged();
- void updateAccessibilityRole();
+ virtual void updateAccessibilityRole();
virtual LayoutRect elementRect() const;
diff --git a/Source/WebCore/accessibility/AccessibilityObject.cpp b/Source/WebCore/accessibility/AccessibilityObject.cpp
index 793b54a60..737cc6bd1 100644
--- a/Source/WebCore/accessibility/AccessibilityObject.cpp
+++ b/Source/WebCore/accessibility/AccessibilityObject.cpp
@@ -384,7 +384,7 @@ static void appendAccessibilityObject(AccessibilityObject* object, Accessibility
if (!doc || !doc->renderer())
return;
- object = object->axObjectCache()->getOrCreate(doc->renderer());
+ object = object->axObjectCache()->getOrCreate(doc);
}
if (object)
@@ -779,7 +779,7 @@ static bool replacedNodeNeedsCharacter(Node* replacedNode)
return false;
// create an AX object, but skip it if it is not supposed to be seen
- AccessibilityObject* object = replacedNode->renderer()->document()->axObjectCache()->getOrCreate(replacedNode->renderer());
+ AccessibilityObject* object = replacedNode->renderer()->document()->axObjectCache()->getOrCreate(replacedNode);
if (object->accessibilityIsIgnored())
return false;
diff --git a/Source/WebCore/accessibility/AccessibilityObject.h b/Source/WebCore/accessibility/AccessibilityObject.h
index 264781a69..1e36a2ca7 100644
--- a/Source/WebCore/accessibility/AccessibilityObject.h
+++ b/Source/WebCore/accessibility/AccessibilityObject.h
@@ -557,6 +557,7 @@ public:
virtual void childrenChanged() { }
virtual void contentChanged() { }
+ virtual void updateAccessibilityRole() { }
const AccessibilityChildrenVector& children();
virtual void addChildren() { }
virtual bool canHaveChildren() const { return true; }
diff --git a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
index 3fff2fa42..5b63998e2 100644
--- a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -998,7 +998,7 @@ AccessibilityObject* AccessibilityRenderObject::menuForMenuButton() const
{
Element* menu = menuElementForMenuButton();
if (menu && menu->renderer())
- return axObjectCache()->getOrCreate(menu->renderer());
+ return axObjectCache()->getOrCreate(menu);
return 0;
}
@@ -1016,7 +1016,7 @@ AccessibilityObject* AccessibilityRenderObject::menuButtonForMenu() const
if (menuItem && menuItem->renderer()) {
// ARIA just has generic menu items. AppKit needs to know if this is a top level items like MenuBarButton or MenuBarItem
- AccessibilityObject* menuItemAX = axObjectCache()->getOrCreate(menuItem->renderer());
+ AccessibilityObject* menuItemAX = axObjectCache()->getOrCreate(menuItem);
if (menuItemAX->isMenuButton())
return menuItemAX;
}
@@ -1552,7 +1552,7 @@ LayoutRect AccessibilityRenderObject::checkboxOrRadioRect() const
if (!label || !label->renderer())
return boundingBoxRect();
- LayoutRect labelRect = axObjectCache()->getOrCreate(label->renderer())->elementRect();
+ LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementRect();
labelRect.unite(boundingBoxRect());
return labelRect;
}
@@ -1640,7 +1640,7 @@ void AccessibilityRenderObject::addRadioButtonGroupMembers(AccessibilityChildren
unsigned len = formElements.size();
for (unsigned i = 0; i < len; ++i) {
Node* associateElement = formElements[i].get();
- if (AccessibilityObject* object = axObjectCache()->getOrCreate(associateElement->renderer()))
+ if (AccessibilityObject* object = axObjectCache()->getOrCreate(associateElement))
linkedUIElements.append(object);
}
} else {
@@ -1650,7 +1650,7 @@ void AccessibilityRenderObject::addRadioButtonGroupMembers(AccessibilityChildren
if (list->item(i)->hasTagName(inputTag)) {
HTMLInputElement* associateElement = static_cast<HTMLInputElement*>(list->item(i));
if (associateElement->isRadioButton() && associateElement->name() == input->name()) {
- if (AccessibilityObject* object = axObjectCache()->getOrCreate(associateElement->renderer()))
+ if (AccessibilityObject* object = axObjectCache()->getOrCreate(associateElement))
linkedUIElements.append(object);
}
}
@@ -1703,7 +1703,7 @@ void AccessibilityRenderObject::ariaFlowToElements(AccessibilityChildrenVector&
unsigned count = elements.size();
for (unsigned k = 0; k < count; ++k) {
Element* element = elements[k];
- AccessibilityObject* flowToElement = cache->getOrCreate(element->renderer());
+ AccessibilityObject* flowToElement = cache->getOrCreate(element);
if (flowToElement)
flowTo.append(flowToElement);
}
@@ -1777,7 +1777,7 @@ AccessibilityObject* AccessibilityRenderObject::titleUIElement() const
return 0;
HTMLLabelElement* label = labelForElement(static_cast<Element*>(element));
if (label && label->renderer())
- return axObjectCache()->getOrCreate(label->renderer());
+ return axObjectCache()->getOrCreate(label);
return 0;
}
@@ -2271,7 +2271,7 @@ bool AccessibilityRenderObject::isTabItemSelected() const
unsigned count = elements.size();
for (unsigned k = 0; k < count; ++k) {
Element* element = elements[k];
- AccessibilityObject* tabPanel = axObjectCache()->getOrCreate(element->renderer());
+ AccessibilityObject* tabPanel = axObjectCache()->getOrCreate(element);
// A tab item should only control tab panels.
if (!tabPanel || tabPanel->roleValue() != TabPanelRole)
@@ -2470,7 +2470,7 @@ AccessibilityObject* AccessibilityRenderObject::accessibilityParentForImageMap(H
if (!imageElement)
return 0;
- return axObjectCache()->getOrCreate(imageElement->renderer());
+ return axObjectCache()->getOrCreate(imageElement);
}
void AccessibilityRenderObject::getDocumentLinks(AccessibilityChildrenVector& result)
@@ -2661,7 +2661,7 @@ bool AccessibilityRenderObject::nodeIsTextControl(const Node* node) const
if (!node)
return false;
- const AccessibilityObject* axObjectForNode = axObjectCache()->getOrCreate(node->renderer());
+ const AccessibilityObject* axObjectForNode = axObjectCache()->getOrCreate(const_cast<Node*>(node));
if (!axObjectForNode)
return false;
@@ -2998,7 +2998,7 @@ AccessibilityObject* AccessibilityRenderObject::activeDescendant() const
if (!target)
return 0;
- AccessibilityObject* obj = axObjectCache()->getOrCreate(target->renderer());
+ AccessibilityObject* obj = axObjectCache()->getOrCreate(target);
if (obj && obj->isAccessibilityRenderObject())
// an activedescendant is only useful if it has a renderer, because that's what's needed to post the notification
return obj;
@@ -3063,7 +3063,7 @@ AccessibilityObject* AccessibilityRenderObject::correspondingControlForLabelElem
if (!correspondingControl)
return 0;
- return axObjectCache()->getOrCreate(correspondingControl->renderer());
+ return axObjectCache()->getOrCreate(correspondingControl);
}
AccessibilityObject* AccessibilityRenderObject::correspondingLabelForControlElement() const
@@ -3075,7 +3075,7 @@ AccessibilityObject* AccessibilityRenderObject::correspondingLabelForControlElem
if (node && node->isHTMLElement()) {
HTMLLabelElement* label = labelForElement(static_cast<Element*>(node));
if (label)
- return axObjectCache()->getOrCreate(label->renderer());
+ return axObjectCache()->getOrCreate(label);
}
return 0;
diff --git a/Source/WebCore/accessibility/AccessibilityScrollView.cpp b/Source/WebCore/accessibility/AccessibilityScrollView.cpp
index dc3abb8dc..6d13aad06 100644
--- a/Source/WebCore/accessibility/AccessibilityScrollView.cpp
+++ b/Source/WebCore/accessibility/AccessibilityScrollView.cpp
@@ -160,7 +160,7 @@ AccessibilityObject* AccessibilityScrollView::webAreaObject() const
if (!doc || !doc->renderer())
return 0;
- return axObjectCache()->getOrCreate(doc->renderer());
+ return axObjectCache()->getOrCreate(doc);
}
AccessibilityObject* AccessibilityScrollView::accessibilityHitTest(const IntPoint& point) const
@@ -197,7 +197,7 @@ AccessibilityObject* AccessibilityScrollView::parentObject() const
HTMLFrameOwnerElement* owner = static_cast<FrameView*>(m_scrollView.get())->frame()->ownerElement();
if (owner && owner->renderer())
- return axObjectCache()->getOrCreate(owner->renderer());
+ return axObjectCache()->getOrCreate(owner);
return 0;
}
@@ -209,7 +209,7 @@ AccessibilityObject* AccessibilityScrollView::parentObjectIfExists() const
HTMLFrameOwnerElement* owner = static_cast<FrameView*>(m_scrollView.get())->frame()->ownerElement();
if (owner && owner->renderer())
- return axObjectCache()->get(owner->renderer());
+ return axObjectCache()->get(owner);
return 0;
}
diff --git a/Source/WebCore/accessibility/AccessibilitySpinButton.h b/Source/WebCore/accessibility/AccessibilitySpinButton.h
index 544572c24..54d58fea5 100644
--- a/Source/WebCore/accessibility/AccessibilitySpinButton.h
+++ b/Source/WebCore/accessibility/AccessibilitySpinButton.h
@@ -28,7 +28,7 @@
#include "AccessibilityMockObject.h"
-#include "TextControlInnerElements.h"
+#include "SpinButtonElement.h"
namespace WebCore {
diff --git a/Source/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp b/Source/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp
index f8afecf62..a95e04418 100644
--- a/Source/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp
+++ b/Source/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp
@@ -80,7 +80,7 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotific
// Calling handleFocusedUIElementChanged will focus the new active
// descendant and send the AXFocusedUIElementChanged notification.
- handleFocusedUIElementChanged(0, obj->document()->focusedNode()->renderer());
+ handleFocusedUIElementChanged(0, obj->document()->focusedNode());
break;
case AXAutocorrectionOccured:
case AXCheckedStateChanged:
@@ -113,12 +113,12 @@ void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject*,
{
}
-void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject* newFocusedRenderer)
+void AXObjectCache::handleFocusedUIElementChanged(Node*, Node* newFocusedNode)
{
- if (!newFocusedRenderer)
+ if (!newFocusedNode)
return;
- Page* page = newFocusedRenderer->document()->page();
+ Page* page = newFocusedNode->document()->page();
if (!page)
return;
diff --git a/Source/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp b/Source/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp
index db8ae236a..0054f1619 100644
--- a/Source/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp
+++ b/Source/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp
@@ -238,14 +238,14 @@ void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject* o
}
}
-void AXObjectCache::handleFocusedUIElementChanged(RenderObject* oldFocusedRender, RenderObject* newFocusedRender)
+void AXObjectCache::handleFocusedUIElementChanged(Node* oldFocusedNode, Node* newFocusedNode)
{
- RefPtr<AccessibilityObject> oldObject = getOrCreate(oldFocusedRender);
+ RefPtr<AccessibilityObject> oldObject = getOrCreate(oldFocusedNode);
if (oldObject) {
g_signal_emit_by_name(oldObject->wrapper(), "focus-event", false);
g_signal_emit_by_name(oldObject->wrapper(), "state-change", "focused", false);
}
- RefPtr<AccessibilityObject> newObject = getOrCreate(newFocusedRender);
+ RefPtr<AccessibilityObject> newObject = getOrCreate(newFocusedNode);
if (newObject) {
g_signal_emit_by_name(newObject->wrapper(), "focus-event", true);
g_signal_emit_by_name(newObject->wrapper(), "state-change", "focused", true);
diff --git a/Source/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp b/Source/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
index 101834986..39f48883e 100644
--- a/Source/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
+++ b/Source/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
@@ -103,7 +103,7 @@ void AccessibilityObject::setWrapper(AccessibilityObjectWrapper* wrapper)
bool AccessibilityObject::allowsTextRanges() const
{
// Check type for the AccessibilityObject.
- if (isTextControl() || isWebArea() || isGroup() || isLink() || isHeading() || isListItem())
+ if (isTextControl() || isWebArea() || isGroup() || isLink() || isHeading() || isListItem() || isTableCell())
return true;
// Check roles as the last fallback mechanism.
diff --git a/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceEditableText.cpp b/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceEditableText.cpp
index 6773440f4..04d6e6fa4 100644
--- a/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceEditableText.cpp
+++ b/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceEditableText.cpp
@@ -61,7 +61,8 @@ static void webkitAccessibleEditableTextSetTextContents(AtkEditableText* text, c
static void webkitAccessibleEditableTextInsertText(AtkEditableText* text, const gchar* string, gint length, gint* position)
{
- // FIXME: string nullcheck?
+ if (!string)
+ return;
AccessibilityObject* coreObject = core(text);
// FIXME: Not implemented in WebCore
@@ -75,7 +76,7 @@ static void webkitAccessibleEditableTextInsertText(AtkEditableText* text, const
coreObject->setSelectedVisiblePositionRange(coreObject->visiblePositionRangeForRange(PlainTextRange(*position, 0)));
coreObject->setFocused(true);
// FIXME: We should set position to the actual inserted text length, which may be less than that requested.
- if (document->frame()->editor()->insertTextWithoutSendingTextEvent(String::fromUTF8(string), false, 0))
+ if (document->frame()->editor()->insertTextWithoutSendingTextEvent(String::fromUTF8(string).substring(0, length), false, 0))
*position += length;
}
diff --git a/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceText.cpp b/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceText.cpp
index 6a7e744f5..c8df36474 100644
--- a/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceText.cpp
+++ b/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceText.cpp
@@ -79,7 +79,7 @@ static gchar* textForRenderer(RenderObject* renderer)
else {
// List item's markers will be treated in an special way
// later on this function, so ignore them here.
- if (object->isReplaced() && !renderer->isListItem())
+ if (object->isReplaced() && !object->isListMarker())
g_string_append_unichar(resultText, objectReplacementCharacter);
// We need to check children, if any, to consider when
diff --git a/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm b/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
index 3608d21b6..72d54fa8d 100644
--- a/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
+++ b/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
@@ -139,7 +139,7 @@ void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject*,
{
}
-void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject*)
+void AXObjectCache::handleFocusedUIElementChanged(Node*, Node*)
{
wkAccessibilityHandleFocusChanged();
}
diff --git a/Source/WebCore/accessibility/win/AXObjectCacheWin.cpp b/Source/WebCore/accessibility/win/AXObjectCacheWin.cpp
index 7ad7ae6ac..8db73debe 100644
--- a/Source/WebCore/accessibility/win/AXObjectCacheWin.cpp
+++ b/Source/WebCore/accessibility/win/AXObjectCacheWin.cpp
@@ -134,12 +134,12 @@ AXID AXObjectCache::platformGenerateAXID() const
return objID;
}
-void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject* newFocusedRenderer)
+void AXObjectCache::handleFocusedUIElementChanged(Node*, Node* newFocusedNode)
{
- if (!newFocusedRenderer)
+ if (!newFocusedNode)
return;
- Page* page = newFocusedRenderer->document()->page();
+ Page* page = newFocusedNode->document()->page();
if (!page || !page->chrome()->platformPageClient())
return;
diff --git a/Source/WebCore/bindings/cpp/WebDOMCustomVoidCallback.cpp b/Source/WebCore/bindings/cpp/WebDOMCustomVoidCallback.cpp
deleted file mode 100644
index d79eaaea9..000000000
--- a/Source/WebCore/bindings/cpp/WebDOMCustomVoidCallback.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2010 Kevin Ollivier <kevino@theolliviers.com>. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY 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 "WebDOMCustomVoidCallback.h"
-
-WebDOMCustomVoidCallback::WebDOMCustomVoidCallback()
-{
-}
-
-WebDOMCustomVoidCallback::~WebDOMCustomVoidCallback()
-{
-}
-
-void WebDOMCustomVoidCallback::handleEvent()
-{
-
-}
-
-WebCore::VoidCallback* toWebCore(const WebDOMCustomVoidCallback& callback)
-{
- return const_cast<WebCore::VoidCallback*>((WebCore::VoidCallback*)&callback);
-} \ No newline at end of file
diff --git a/Source/WebCore/bindings/cpp/WebDOMCustomVoidCallback.h b/Source/WebCore/bindings/cpp/WebDOMCustomVoidCallback.h
deleted file mode 100644
index 0fd8f96d4..000000000
--- a/Source/WebCore/bindings/cpp/WebDOMCustomVoidCallback.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) Kevin Ollivier <kevino@theolliviers.com>. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY 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 WebDOMCustomVoidCallback_h
-#define WebDOMCustomVoidCallback_h
-
-#include "VoidCallback.h"
-#include <wtf/PassRefPtr.h>
-
-// FIXME: This is just a stub to keep compilation working. We need to revisit
-// this when we add support for these callbacks to the WebDOM bindings.
-
-class WebDOMCustomVoidCallback : public WebCore::VoidCallback {
-public:
- static PassRefPtr<WebDOMCustomVoidCallback> create()
- {
- return adoptRef(new WebDOMCustomVoidCallback());
- }
-
- virtual ~WebDOMCustomVoidCallback();
-
- virtual void handleEvent();
-
-private:
- WebDOMCustomVoidCallback();
-};
-
-WebCore::VoidCallback* toWebCore(const WebDOMCustomVoidCallback&);
-
-#endif // WebDOMCustomVoidCallback_h
diff --git a/Source/WebCore/bindings/generic/BindingSecurity.cpp b/Source/WebCore/bindings/generic/BindingSecurity.cpp
index 87f4a574d..8dde685b5 100644
--- a/Source/WebCore/bindings/generic/BindingSecurity.cpp
+++ b/Source/WebCore/bindings/generic/BindingSecurity.cpp
@@ -51,17 +51,7 @@ static bool canAccessDocument(BindingState* state, Document* targetDocument, Sec
if (!active)
return false;
- // If the embedder executes JavaScript synchronously during the didCreateScriptContext callback,
- // in some cases the active SecurityOrigin will not yet be copied to the DOMWindow. For example,
- // Frame::setDocument can trigger didCreateScriptContext during ScriptController::updateDocument.
- //
- // FIXME: Remove this branch once we manage to delete DOMWindow::m_securityOrigin. Ideally, we'd
- // get the SecurityOrigin from the Document rather than the DOMWindow. In that case, there
- // shouldn't ever be a chance to execute script before the SecurityOrigin object is created.
- if (!active->securityOrigin())
- return false;
-
- if (active->securityOrigin()->canAccess(targetDocument->securityOrigin()))
+ if (active->document()->securityOrigin()->canAccess(targetDocument->securityOrigin()))
return true;
if (reportingOption == ReportSecurityError)
diff --git a/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp b/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
index 59ec0628d..da7849dda 100644
--- a/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
+++ b/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
@@ -225,12 +225,8 @@ bool RuntimeEnabledFeatures::isInputTypeMonthEnabled = true;
#endif
#if ENABLE(INPUT_TYPE_TIME)
-#if PLATFORM(CHROMIUM) && !OS(ANDROID)
-bool RuntimeEnabledFeatures::isInputTypeTimeEnabled = false;
-#else
bool RuntimeEnabledFeatures::isInputTypeTimeEnabled = true;
#endif
-#endif
#if ENABLE(INPUT_TYPE_WEEK)
#if PLATFORM(CHROMIUM) && !OS(ANDROID)
diff --git a/Source/WebCore/bindings/gobject/GNUmakefile.am b/Source/WebCore/bindings/gobject/GNUmakefile.am
index 8ef9663cb..2db3ad3e7 100644
--- a/Source/WebCore/bindings/gobject/GNUmakefile.am
+++ b/Source/WebCore/bindings/gobject/GNUmakefile.am
@@ -231,6 +231,8 @@ webkitgtk_gdom_built_sources += \
DerivedSources/webkit/WebKitDOMScreen.cpp \
DerivedSources/webkit/WebKitDOMScreenPrivate.h \
DerivedSources/webkit/WebKitDOMStorage.cpp \
+ DerivedSources/webkit/WebKitDOMStorageInfo.cpp \
+ DerivedSources/webkit/WebKitDOMStorageInfoPrivate.h \
DerivedSources/webkit/WebKitDOMStoragePrivate.h \
DerivedSources/webkit/WebKitDOMStyleMedia.cpp \
DerivedSources/webkit/WebKitDOMStyleMediaPrivate.h \
@@ -392,6 +394,7 @@ webkitgtk_built_h_api += \
DerivedSources/webkit/WebKitDOMDOMPluginArray.h \
DerivedSources/webkit/WebKitDOMDatabase.h \
DerivedSources/webkit/WebKitDOMStorage.h \
+ DerivedSources/webkit/WebKitDOMStorageInfo.h \
DerivedSources/webkit/WebKitDOMXPathExpression.h \
DerivedSources/webkit/WebKitDOMXPathNSResolver.h \
DerivedSources/webkit/WebKitDOMXPathResult.h \
diff --git a/Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp b/Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp
index b7d9c56de..68aa9fba2 100644
--- a/Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp
+++ b/Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp
@@ -25,6 +25,7 @@
#include "WebKitDOMHTMLInputElementPrivate.h"
#include "WebKitDOMHTMLTextAreaElement.h"
#include "WebKitDOMHTMLTextAreaElementPrivate.h"
+#include "WebKitDOMWebKitNamedFlow.h"
using namespace WebKit;
@@ -61,6 +62,13 @@ webkit_dom_html_element_set_class_name(WebKitDOMHTMLElement* element, const gcha
webkit_dom_element_set_class_name(WEBKIT_DOM_ELEMENT(element), value);
}
+gboolean
+webkit_dom_webkit_named_flow_get_overflow(WebKitDOMWebKitNamedFlow* flow)
+{
+ g_warning("The WebKitDOMWebKitNamedFlow::overflow property has been renamed to WebKitDOMWebKitNamedFlow::overset. Please update your code to use the new name.");
+ return webkit_dom_webkit_named_flow_get_overset(flow);
+}
+
void
webkit_dom_html_form_element_dispatch_form_change(WebKitDOMHTMLFormElement* self)
{
diff --git a/Source/WebCore/bindings/gobject/WebKitDOMCustom.h b/Source/WebCore/bindings/gobject/WebKitDOMCustom.h
index 8fb50839c..c81be3909 100644
--- a/Source/WebCore/bindings/gobject/WebKitDOMCustom.h
+++ b/Source/WebCore/bindings/gobject/WebKitDOMCustom.h
@@ -35,6 +35,7 @@ WEBKIT_API void webkit_dom_html_element_set_class_name(WebKitDOMHTMLElement* ele
WEBKIT_API WebKitDOMDOMTokenList* webkit_dom_html_element_get_class_list(WebKitDOMHTMLElement* element);
WEBKIT_API void webkit_dom_html_form_element_dispatch_form_change(WebKitDOMHTMLFormElement* self);
WEBKIT_API void webkit_dom_html_form_element_dispatch_form_input(WebKitDOMHTMLFormElement* self);
+WEBKIT_API gboolean webkit_dom_webkit_named_flow_get_overflow(WebKitDOMWebKitNamedFlow* flow);
G_END_DECLS
diff --git a/Source/WebCore/bindings/js/DOMTransaction.cpp b/Source/WebCore/bindings/js/DOMTransaction.cpp
new file mode 100644
index 000000000..f43822aa6
--- /dev/null
+++ b/Source/WebCore/bindings/js/DOMTransaction.cpp
@@ -0,0 +1,60 @@
+/*
+ * 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 GOOGLE 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 GOOGLE 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"
+
+#if ENABLE(UNDO_MANAGER)
+
+#include "DOMTransaction.h"
+
+namespace WebCore {
+
+DOMTransaction::DOMTransaction()
+ : m_undoManager(0)
+{
+}
+
+PassRefPtr<DOMTransaction> DOMTransaction::create()
+{
+ return adoptRef(new DOMTransaction());
+}
+
+void DOMTransaction::apply()
+{
+ // FIXME: implement JSC bindings
+}
+
+void DOMTransaction::unapply()
+{
+ // FIXME: implement JSC bindings
+}
+
+void DOMTransaction::reapply()
+{
+ // FIXME: implement JSC bindings
+}
+
+}
+
+#endif
diff --git a/Source/WebCore/bindings/js/DOMTransaction.h b/Source/WebCore/bindings/js/DOMTransaction.h
new file mode 100644
index 000000000..de05e3e5e
--- /dev/null
+++ b/Source/WebCore/bindings/js/DOMTransaction.h
@@ -0,0 +1,61 @@
+/*
+ * 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 GOOGLE 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 GOOGLE 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 DOMTransaction_h
+#define DOMTransaction_h
+
+#if ENABLE(UNDO_MANAGER)
+
+#include "UndoStep.h"
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class UndoManager;
+
+class DOMTransaction : public UndoStep {
+public:
+ static PassRefPtr<DOMTransaction> create();
+
+ void apply();
+ virtual void unapply() OVERRIDE;
+ virtual void reapply() OVERRIDE;
+
+ virtual EditAction editingAction() const OVERRIDE { return EditActionUnspecified; }
+ virtual bool isDOMTransaction() const OVERRIDE { return true; }
+
+ UndoManager* undoManager() const { return m_undoManager; }
+ void setUndoManager(UndoManager* undoManager) { m_undoManager = undoManager; }
+
+private:
+ DOMTransaction();
+
+ UndoManager* m_undoManager;
+};
+
+}
+
+#endif
+
+#endif
diff --git a/Source/WebCore/bindings/js/JSArrayBufferViewHelper.h b/Source/WebCore/bindings/js/JSArrayBufferViewHelper.h
index e02856482..ba212df0c 100644
--- a/Source/WebCore/bindings/js/JSArrayBufferViewHelper.h
+++ b/Source/WebCore/bindings/js/JSArrayBufferViewHelper.h
@@ -27,7 +27,6 @@
#ifndef JSArrayBufferViewHelper_h
#define JSArrayBufferViewHelper_h
-#include "ExceptionCode.h"
#include "JSArrayBuffer.h"
#include "JSArrayBufferView.h"
#include "JSDOMBinding.h"
@@ -41,6 +40,8 @@
namespace WebCore {
+static const char* tooLargeSize = "Size is too large (or is negative).";
+
template<class C, typename T>
bool copyTypedArrayBuffer(C* target, ArrayBufferView* source, unsigned sourceLength, unsigned offset)
{
@@ -115,7 +116,7 @@ bool setWebGLArrayWithTypedArrayArgument(JSC::ExecState* exec, C* impl)
uint32_t length = asObject(exec->argument(0))->get(exec, JSC::Identifier(exec, "length")).toUInt32(exec);
if (!(copyTypedArrayBuffer<C, T>(impl, array.get(), length, offset)))
- setDOMException(exec, INDEX_SIZE_ERR);
+ throwError(exec, createRangeError(exec, "Index is out of range."));
return true;
}
@@ -124,7 +125,7 @@ template<class C, typename T>
JSC::JSValue setWebGLArrayHelper(JSC::ExecState* exec, C* impl)
{
if (exec->argumentCount() < 1)
- return JSC::throwSyntaxError(exec);
+ return JSC::throwError(exec, createNotEnoughArgumentsError(exec));
if (setWebGLArrayWithTypedArrayArgument<C, T>(exec, impl))
// void set(in WebGL<>Array array, [Optional] in unsigned long offset);
@@ -138,7 +139,7 @@ JSC::JSValue setWebGLArrayHelper(JSC::ExecState* exec, C* impl)
offset = exec->argument(1).toInt32(exec);
uint32_t length = array->get(exec, JSC::Identifier(exec, "length")).toInt32(exec);
if (!impl->checkInboundData(offset, length))
- setDOMException(exec, INDEX_SIZE_ERR);
+ throwError(exec, createRangeError(exec, "Index is out of range."));
else {
for (uint32_t i = 0; i < length; i++) {
JSC::JSValue v = array->get(exec, i);
@@ -151,7 +152,7 @@ JSC::JSValue setWebGLArrayHelper(JSC::ExecState* exec, C* impl)
return JSC::jsUndefined();
}
- return JSC::throwSyntaxError(exec);
+ return JSC::throwTypeError(exec, "Invalid argument");
}
// Template function used by XXXArrayConstructors.
@@ -170,12 +171,12 @@ PassRefPtr<C> constructArrayBufferViewWithTypedArrayArgument(JSC::ExecState* exe
uint32_t length = asObject(exec->argument(0))->get(exec, JSC::Identifier(exec, "length")).toUInt32(exec);
RefPtr<C> array = C::createUninitialized(length);
if (!array) {
- setDOMException(exec, INDEX_SIZE_ERR);
+ throwError(exec, createRangeError(exec, tooLargeSize));
return array;
}
if (!(copyTypedArrayBuffer<C, T>(array.get(), source.get(), length, 0))) {
- setDOMException(exec, INDEX_SIZE_ERR);
+ throwError(exec, createRangeError(exec, tooLargeSize));
return array;
}
@@ -204,7 +205,7 @@ PassRefPtr<C> constructArrayBufferViewWithArrayBufferArgument(JSC::ExecState* ex
}
RefPtr<C> array = C::create(buffer, offset, length);
if (!array)
- setDOMException(exec, INDEX_SIZE_ERR);
+ throwError(exec, createRangeError(exec, tooLargeSize));
return array;
}
@@ -245,7 +246,7 @@ PassRefPtr<C> constructArrayBufferView(JSC::ExecState* exec)
uint32_t length = srcArray->get(exec, JSC::Identifier(exec, "length")).toUInt32(exec);
RefPtr<C> array = C::createUninitialized(length);
if (!array) {
- setDOMException(exec, INDEX_SIZE_ERR);
+ throwError(exec, createRangeError(exec, tooLargeSize));
return array;
}
@@ -261,7 +262,7 @@ PassRefPtr<C> constructArrayBufferView(JSC::ExecState* exec)
if (length >= 0)
result = C::create(static_cast<unsigned>(length));
if (!result)
- throwError(exec, createRangeError(exec, "ArrayBufferView size is not a small enough positive integer."));
+ throwError(exec, createRangeError(exec, tooLargeSize));
return result;
}
diff --git a/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp b/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
index 49a1993f2..33619b535 100644
--- a/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
+++ b/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
@@ -52,7 +52,6 @@
#include "JSConsoleCustom.cpp"
#include "JSCoordinatesCustom.cpp"
#include "JSCustomSQLStatementErrorCallback.cpp"
-#include "JSCustomVoidCallback.cpp"
#include "JSCustomXPathNSResolver.cpp"
#include "JSDictionary.cpp"
#include "JSDOMBinding.cpp"
@@ -149,6 +148,7 @@
#include "JSTrackCustom.cpp"
#include "JSTrackEventCustom.cpp"
#include "JSTreeWalkerCustom.cpp"
+#include "JSUndoManagerCustom.cpp"
#include "JSWebKitAnimationCustom.cpp"
#include "JSWebKitAnimationListCustom.cpp"
#include "JSWebKitCSSKeyframeRuleCustom.cpp"
diff --git a/Source/WebCore/bindings/js/JSBlobCustom.cpp b/Source/WebCore/bindings/js/JSBlobCustom.cpp
index 7384f73fc..6a9122c2e 100644
--- a/Source/WebCore/bindings/js/JSBlobCustom.cpp
+++ b/Source/WebCore/bindings/js/JSBlobCustom.cpp
@@ -136,7 +136,7 @@ EncodedJSValue JSC_HOST_CALL JSBlobConstructor::constructJSBlob(ExecState* exec)
}
}
- RefPtr<Blob> blob = blobBuilder->getBlob(type);
+ RefPtr<Blob> blob = blobBuilder->getBlob(type, BlobConstructedByConstructor);
return JSValue::encode(CREATE_DOM_WRAPPER(exec, jsConstructor->globalObject(), Blob, blob.get()));
}
diff --git a/Source/WebCore/bindings/js/JSCustomVoidCallback.cpp b/Source/WebCore/bindings/js/JSCustomVoidCallback.cpp
deleted file mode 100644
index 5d421badd..000000000
--- a/Source/WebCore/bindings/js/JSCustomVoidCallback.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY 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 "JSCustomVoidCallback.h"
-
-#include "Frame.h"
-#include "JSCallbackData.h"
-#include "JSDOMWindowCustom.h"
-#include "SecurityOrigin.h"
-#include <runtime/JSLock.h>
-#include <wtf/MainThread.h>
-
-namespace WebCore {
-
-using namespace JSC;
-
-JSCustomVoidCallback::JSCustomVoidCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
- : m_data(new JSCallbackData(callback, globalObject))
- , m_scriptExecutionContext(globalObject->scriptExecutionContext())
-{
-}
-
-JSCustomVoidCallback::~JSCustomVoidCallback()
-{
- if (m_scriptExecutionContext->isContextThread())
- delete m_data;
- else
- m_scriptExecutionContext->postTask(DeleteCallbackDataTask::create(m_data));
-#ifndef NDEBUG
- m_data = 0;
-#endif
-}
-
-void JSCustomVoidCallback::handleEvent()
-{
- ASSERT(m_data);
-
- RefPtr<JSCustomVoidCallback> protect(this);
-
- JSC::JSLockHolder lock(m_data->globalObject()->globalData());
- MarkedArgumentBuffer args;
- m_data->invokeCallback(args);
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/bindings/js/JSDOMBinding.cpp b/Source/WebCore/bindings/js/JSDOMBinding.cpp
index ba5c90ede..3ad7c3284 100644
--- a/Source/WebCore/bindings/js/JSDOMBinding.cpp
+++ b/Source/WebCore/bindings/js/JSDOMBinding.cpp
@@ -76,13 +76,6 @@ JSValue jsStringOrUndefined(ExecState* exec, const String& s)
return jsString(exec, s);
}
-JSValue jsStringOrFalse(ExecState* exec, const String& s)
-{
- if (s.isNull())
- return jsBoolean(false);
- return jsString(exec, s);
-}
-
JSValue jsString(ExecState* exec, const KURL& url)
{
return jsString(exec, url.string());
@@ -102,13 +95,6 @@ JSValue jsStringOrUndefined(ExecState* exec, const KURL& url)
return jsString(exec, url.string());
}
-JSValue jsStringOrFalse(ExecState* exec, const KURL& url)
-{
- if (url.isNull())
- return jsBoolean(false);
- return jsString(exec, url.string());
-}
-
AtomicStringImpl* findAtomicString(PropertyName propertyName)
{
StringImpl* impl = propertyName.publicName();
@@ -172,13 +158,12 @@ void reportException(ExecState* exec, JSValue exception)
if (ExceptionBase* exceptionBase = toExceptionBase(exception))
errorMessage = stringToUString(exceptionBase->message() + ": " + exceptionBase->description());
- ScriptExecutionContext* scriptExecutionContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
-
- // scriptExecutionContext can be null when the relevant global object is a stale inner window object.
- // It's harmless to return here without reporting the exception to the log and the debugger in this case.
- if (!scriptExecutionContext)
- return;
-
+ JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject());
+ if (JSDOMWindow* window = jsDynamicCast<JSDOMWindow*>(globalObject)) {
+ if (!window->impl()->isCurrentlyDisplayedInFrame())
+ return;
+ }
+ ScriptExecutionContext* scriptExecutionContext = globalObject->scriptExecutionContext();
scriptExecutionContext->reportException(ustringToString(errorMessage), lineNumber, ustringToString(exceptionSourceURL), 0);
}
@@ -238,7 +223,7 @@ bool shouldAllowAccessToFrame(ExecState* exec, Frame* frame, String& message)
return false;
bool result = BindingSecurity::shouldAllowAccessToFrame(exec, frame, DoNotReportSecurityError);
// FIXME: The following line of code should move somewhere that it can be shared with immediatelyReportUnsafeAccessTo.
- message = frame->domWindow()->crossDomainAccessErrorMessage(activeDOMWindow(exec));
+ message = frame->document()->domWindow()->crossDomainAccessErrorMessage(activeDOMWindow(exec));
return result;
}
@@ -246,7 +231,7 @@ void printErrorMessageForFrame(Frame* frame, const String& message)
{
if (!frame)
return;
- frame->domWindow()->printErrorMessage(message);
+ frame->document()->domWindow()->printErrorMessage(message);
}
JSValue objectToStringFunctionGetter(ExecState* exec, JSValue, PropertyName propertyName)
diff --git a/Source/WebCore/bindings/js/JSDOMBinding.h b/Source/WebCore/bindings/js/JSDOMBinding.h
index 991d8c188..1c8716e29 100644
--- a/Source/WebCore/bindings/js/JSDOMBinding.h
+++ b/Source/WebCore/bindings/js/JSDOMBinding.h
@@ -247,9 +247,6 @@ enum ParameterDefaultPolicy {
JSC::JSValue jsStringOrUndefined(JSC::ExecState*, const String&); // undefined if the string is null
JSC::JSValue jsStringOrUndefined(JSC::ExecState*, const KURL&); // undefined if the URL is null
- JSC::JSValue jsStringOrFalse(JSC::ExecState*, const String&); // boolean false if the string is null
- JSC::JSValue jsStringOrFalse(JSC::ExecState*, const KURL&); // boolean false if the URL is null
-
// See JavaScriptCore for explanation: Should be used for any string that is already owned by another
// object, to let the engine know that collecting the JSString wrapper is unlikely to save memory.
JSC::JSValue jsOwnedStringOrNull(JSC::ExecState*, const String&);
diff --git a/Source/WebCore/bindings/js/JSDOMWindowBase.cpp b/Source/WebCore/bindings/js/JSDOMWindowBase.cpp
index d4a06e563..4219f0c1d 100644
--- a/Source/WebCore/bindings/js/JSDOMWindowBase.cpp
+++ b/Source/WebCore/bindings/js/JSDOMWindowBase.cpp
@@ -108,8 +108,8 @@ bool JSDOMWindowBase::allowsAccessFrom(const JSGlobalObject* thisObject, ExecSta
if (originWindow == targetWindow)
return true;
- const SecurityOrigin* originSecurityOrigin = originWindow->impl()->securityOrigin();
- const SecurityOrigin* targetSecurityOrigin = targetWindow->impl()->securityOrigin();
+ const SecurityOrigin* originSecurityOrigin = originWindow->impl()->document()->securityOrigin();
+ const SecurityOrigin* targetSecurityOrigin = targetWindow->impl()->document()->securityOrigin();
if (originSecurityOrigin->canAccess(targetSecurityOrigin))
return true;
diff --git a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp b/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
index bb3d79125..2d75ac08c 100644
--- a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
+++ b/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
@@ -99,12 +99,12 @@ JSValue nonCachingStaticFunctionGetter(ExecState* exec, JSValue, PropertyName pr
static JSValue childFrameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
{
- return toJS(exec, jsCast<JSDOMWindow*>(asObject(slotBase))->impl()->frame()->tree()->scopedChild(propertyNameToAtomicString(propertyName))->domWindow());
+ return toJS(exec, jsCast<JSDOMWindow*>(asObject(slotBase))->impl()->frame()->tree()->scopedChild(propertyNameToAtomicString(propertyName))->document()->domWindow());
}
static JSValue indexGetter(ExecState* exec, JSValue slotBase, unsigned index)
{
- return toJS(exec, jsCast<JSDOMWindow*>(asObject(slotBase))->impl()->frame()->tree()->scopedChild(index)->domWindow());
+ return toJS(exec, jsCast<JSDOMWindow*>(asObject(slotBase))->impl()->frame()->tree()->scopedChild(index)->document()->domWindow());
}
static JSValue namedItemGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
diff --git a/Source/WebCore/bindings/js/JSDOMWindowCustom.h b/Source/WebCore/bindings/js/JSDOMWindowCustom.h
index 57e816680..ab563bf03 100644
--- a/Source/WebCore/bindings/js/JSDOMWindowCustom.h
+++ b/Source/WebCore/bindings/js/JSDOMWindowCustom.h
@@ -73,8 +73,8 @@ ALWAYS_INLINE bool JSDOMWindowBase::allowsAccessFromPrivate(const JSGlobalObject
if (originWindow == targetWindow)
return true;
- const SecurityOrigin* originSecurityOrigin = originWindow->impl()->securityOrigin();
- const SecurityOrigin* targetSecurityOrigin = targetWindow->impl()->securityOrigin();
+ const SecurityOrigin* originSecurityOrigin = originWindow->impl()->document()->securityOrigin();
+ const SecurityOrigin* targetSecurityOrigin = targetWindow->impl()->document()->securityOrigin();
return originSecurityOrigin->canAccess(targetSecurityOrigin);
}
diff --git a/Source/WebCore/bindings/js/JSDOMWrapper.h b/Source/WebCore/bindings/js/JSDOMWrapper.h
index f0a8a3a42..dd47c4737 100644
--- a/Source/WebCore/bindings/js/JSDOMWrapper.h
+++ b/Source/WebCore/bindings/js/JSDOMWrapper.h
@@ -31,25 +31,14 @@ class ScriptExecutionContext;
class JSDOMWrapper : public JSC::JSNonFinalObject {
public:
- JSDOMGlobalObject* globalObject() const
- {
- return JSC::jsCast<JSDOMGlobalObject*>(JSC::JSNonFinalObject::globalObject());
- }
-
- ScriptExecutionContext* scriptExecutionContext() const
- {
- // FIXME: Should never be 0, but can be due to bug 27640.
- return globalObject()->scriptExecutionContext();
- }
+ JSDOMGlobalObject* globalObject() const { return JSC::jsCast<JSDOMGlobalObject*>(JSC::JSNonFinalObject::globalObject()); }
+ ScriptExecutionContext* scriptExecutionContext() const { return globalObject()->scriptExecutionContext(); }
protected:
- explicit JSDOMWrapper(JSC::Structure* structure, JSC::JSGlobalObject* globalObject)
+ JSDOMWrapper(JSC::Structure* structure, JSC::JSGlobalObject* globalObject)
: JSNonFinalObject(globalObject->globalData(), structure)
{
- // FIXME: This ASSERT is valid, but fires in fast/dom/gc-6.html when trying to create
- // new JavaScript objects on detached windows due to DOMWindow::document()
- // needing to reach through the frame to get to the Document*. See bug 27640.
- // ASSERT(globalObject->scriptExecutionContext());
+ ASSERT(scriptExecutionContext());
}
};
diff --git a/Source/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp b/Source/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp
index 38c682311..9f4085003 100644
--- a/Source/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp
+++ b/Source/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp
@@ -34,9 +34,9 @@
#if ENABLE(LEGACY_NOTIFICATIONS)
#include "Document.h"
-#include "JSCustomVoidCallback.h"
#include "JSEventListener.h"
#include "JSNotificationCenter.h"
+#include "JSVoidCallback.h"
#include "NotificationCenter.h"
#include <runtime/Error.h>
@@ -61,9 +61,7 @@ JSValue JSNotificationCenter::requestPermission(ExecState* exec)
if (!exec->argument(0).isObject())
return throwTypeError(exec);
- PassRefPtr<JSCustomVoidCallback> callback = JSCustomVoidCallback::create(exec->argument(0).getObject(), toJSDOMGlobalObject(static_cast<Document*>(context), exec));
-
- impl()->requestPermission(callback);
+ impl()->requestPermission(JSVoidCallback::create(exec->argument(0).getObject(), toJSDOMGlobalObject(static_cast<Document*>(context), exec)));
return jsUndefined();
}
diff --git a/Source/WebCore/bindings/js/JSDictionary.cpp b/Source/WebCore/bindings/js/JSDictionary.cpp
index 4957ba11d..ec8948ccf 100644
--- a/Source/WebCore/bindings/js/JSDictionary.cpp
+++ b/Source/WebCore/bindings/js/JSDictionary.cpp
@@ -46,6 +46,7 @@ namespace WebCore {
JSDictionary::GetPropertyResult JSDictionary::tryGetProperty(const char* propertyName, JSValue& finalResult) const
{
+ ASSERT(isValid());
Identifier identifier(m_exec, propertyName);
PropertySlot slot(m_initializerObject.get());
@@ -196,6 +197,7 @@ void JSDictionary::convertValue(ExecState* exec, JSValue value, ArrayValue& resu
bool JSDictionary::getWithUndefinedOrNullCheck(const String& propertyName, String& result) const
{
+ ASSERT(isValid());
JSValue value;
if (tryGetProperty(propertyName.utf8().data(), value) != PropertyFound || value.isUndefinedOrNull())
return false;
diff --git a/Source/WebCore/bindings/js/JSDictionary.h b/Source/WebCore/bindings/js/JSDictionary.h
index 5cadb1413..febe92472 100644
--- a/Source/WebCore/bindings/js/JSDictionary.h
+++ b/Source/WebCore/bindings/js/JSDictionary.h
@@ -48,8 +48,9 @@ class JSDictionary {
public:
JSDictionary(JSC::ExecState* exec, JSC::JSObject* initializerObject)
: m_exec(exec)
- , m_initializerObject(exec->globalData(), initializerObject)
{
+ if (exec && initializerObject)
+ m_initializerObject = JSC::Strong<JSC::JSObject>(exec->globalData(), initializerObject);
}
// Returns false if any exceptions were thrown, regardless of whether the property was found.
diff --git a/Source/WebCore/bindings/js/JSDirectoryEntryCustom.cpp b/Source/WebCore/bindings/js/JSDirectoryEntryCustom.cpp
deleted file mode 100644
index 5100a6845..000000000
--- a/Source/WebCore/bindings/js/JSDirectoryEntryCustom.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(FILE_SYSTEM)
-
-#include "JSDirectoryEntry.h"
-
-#include "ExceptionCode.h"
-#include "JSDOMBinding.h"
-#include "JSEntryCallback.h"
-#include "JSErrorCallback.h"
-#include <runtime/Error.h>
-#include <wtf/Assertions.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue JSDirectoryEntry::getFile(ExecState* exec)
-{
- if (exec->argumentCount() < 1)
- return throwError(exec, createNotEnoughArgumentsError(exec));
-
- DirectoryEntry* imp = static_cast<DirectoryEntry*>(impl());
- const String& path = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
- if (exec->hadException())
- return jsUndefined();
-
- int argsCount = exec->argumentCount();
- if (argsCount <= 1) {
- imp->getFile(path);
- return jsUndefined();
- }
-
- RefPtr<WebKitFlags> flags;
- if (!exec->argument(1).isNull() && !exec->argument(1).isUndefined() && exec->argument(1).isObject()) {
- JSObject* object = exec->argument(1).getObject();
- flags = WebKitFlags::create();
- JSValue jsCreate = object->get(exec, Identifier(exec, "create"));
- flags->setCreate(jsCreate.toBoolean());
- JSValue jsExclusive = object->get(exec, Identifier(exec, "exclusive"));
- flags->setExclusive(jsExclusive.toBoolean());
- }
- if (exec->hadException())
- return jsUndefined();
- RefPtr<EntryCallback> successCallback;
- if (exec->argumentCount() > 2 && !exec->argument(2).isNull() && !exec->argument(2).isUndefined()) {
- if (!exec->argument(2).isObject()) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
- successCallback = JSEntryCallback::create(asObject(exec->argument(2)), globalObject());
- }
- RefPtr<ErrorCallback> errorCallback;
- if (exec->argumentCount() > 3 && !exec->argument(3).isNull() && !exec->argument(3).isUndefined()) {
- if (!exec->argument(3).isObject()) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
- errorCallback = JSErrorCallback::create(asObject(exec->argument(3)), globalObject());
- }
-
- imp->getFile(path, flags, successCallback, errorCallback);
- return jsUndefined();
-}
-
-JSValue JSDirectoryEntry::getDirectory(ExecState* exec)
-{
- if (exec->argumentCount() < 1)
- return throwError(exec, createNotEnoughArgumentsError(exec));
-
- DirectoryEntry* imp = static_cast<DirectoryEntry*>(impl());
- const String& path = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
- if (exec->hadException())
- return jsUndefined();
-
- int argsCount = exec->argumentCount();
- if (argsCount <= 1) {
- imp->getDirectory(path);
- return jsUndefined();
- }
-
- RefPtr<WebKitFlags> flags;
- if (!exec->argument(1).isNull() && !exec->argument(1).isUndefined() && exec->argument(1).isObject()) {
- JSObject* object = exec->argument(1).getObject();
- flags = WebKitFlags::create();
- JSValue jsCreate = object->get(exec, Identifier(exec, "create"));
- flags->setCreate(jsCreate.toBoolean());
- JSValue jsExclusive = object->get(exec, Identifier(exec, "exclusive"));
- flags->setExclusive(jsExclusive.toBoolean());
- }
- if (exec->hadException())
- return jsUndefined();
- RefPtr<EntryCallback> successCallback;
- if (exec->argumentCount() > 2 && !exec->argument(2).isNull() && !exec->argument(2).isUndefined()) {
- if (!exec->argument(2).isObject()) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
- successCallback = JSEntryCallback::create(asObject(exec->argument(2)), globalObject());
- }
- RefPtr<ErrorCallback> errorCallback;
- if (exec->argumentCount() > 3 && !exec->argument(3).isNull() && !exec->argument(3).isUndefined()) {
- if (!exec->argument(3).isObject()) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
- errorCallback = JSErrorCallback::create(asObject(exec->argument(3)), globalObject());
- }
-
- imp->getDirectory(path, flags, successCallback, errorCallback);
- return jsUndefined();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(FILE_SYSTEM)
diff --git a/Source/WebCore/bindings/js/JSDirectoryEntrySyncCustom.cpp b/Source/WebCore/bindings/js/JSDirectoryEntrySyncCustom.cpp
deleted file mode 100644
index 8d52af9a6..000000000
--- a/Source/WebCore/bindings/js/JSDirectoryEntrySyncCustom.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(FILE_SYSTEM)
-
-#include "JSDirectoryEntrySync.h"
-
-#include "JSDOMBinding.h"
-#include "JSEntryCallback.h"
-#include "JSErrorCallback.h"
-#include "JSFileEntrySync.h"
-#include <wtf/Assertions.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-static PassRefPtr<WebKitFlags> getFlags(ExecState* exec, const JSValue& argument)
-{
- if (argument.isNull() || argument.isUndefined() || !argument.isObject())
- return 0;
-
- RefPtr<WebKitFlags> flags;
- JSObject* object = argument.getObject();
- flags = WebKitFlags::create();
- JSValue jsCreate = object->get(exec, Identifier(exec, "create"));
- flags->setCreate(jsCreate.toBoolean());
- JSValue jsExclusive = object->get(exec, Identifier(exec, "exclusive"));
- flags->setExclusive(jsExclusive.toBoolean());
- return flags;
-}
-
-JSValue JSDirectoryEntrySync::getFile(ExecState* exec)
-{
- DirectoryEntrySync* imp = static_cast<DirectoryEntrySync*>(impl());
- const String& path = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
- if (exec->hadException())
- return jsUndefined();
-
- RefPtr<WebKitFlags> flags = getFlags(exec, exec->argument(1));
- if (exec->hadException())
- return jsUndefined();
-
- ExceptionCode ec = 0;
- JSC::JSValue result = toJS(exec, this->globalObject(), WTF::getPtr(imp->getFile(path, flags, ec)));
- setDOMException(exec, ec);
- return result;
-}
-
-JSValue JSDirectoryEntrySync::getDirectory(ExecState* exec)
-{
- DirectoryEntrySync* imp = static_cast<DirectoryEntrySync*>(impl());
- const String& path = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
- if (exec->hadException())
- return jsUndefined();
-
- RefPtr<WebKitFlags> flags = getFlags(exec, exec->argument(1));
- if (exec->hadException())
- return jsUndefined();
-
- ExceptionCode ec = 0;
- JSC::JSValue result = toJS(exec, this->globalObject(), WTF::getPtr(imp->getDirectory(path, flags, ec)));
- setDOMException(exec, ec);
- return result;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(FILE_SYSTEM)
diff --git a/Source/WebCore/bindings/js/JSDocumentCustom.cpp b/Source/WebCore/bindings/js/JSDocumentCustom.cpp
index b6de16225..647b4461e 100644
--- a/Source/WebCore/bindings/js/JSDocumentCustom.cpp
+++ b/Source/WebCore/bindings/js/JSDocumentCustom.cpp
@@ -54,7 +54,7 @@ JSValue JSDocument::location(ExecState* exec) const
if (!frame)
return jsNull();
- Location* location = frame->domWindow()->location();
+ Location* location = frame->document()->domWindow()->location();
if (JSDOMWrapper* wrapper = getCachedWrapper(currentWorld(exec), location))
return wrapper;
@@ -73,7 +73,7 @@ void JSDocument::setLocation(ExecState* exec, JSValue value)
if (exec->hadException())
return;
- if (Location* location = frame->domWindow()->location())
+ if (Location* location = frame->document()->domWindow()->location())
location->setHref(ustringToString(locationString), activeDOMWindow(exec), firstDOMWindow(exec));
}
diff --git a/Source/WebCore/bindings/js/JSEventListener.cpp b/Source/WebCore/bindings/js/JSEventListener.cpp
index 0a557f7d4..779e8d739 100644
--- a/Source/WebCore/bindings/js/JSEventListener.cpp
+++ b/Source/WebCore/bindings/js/JSEventListener.cpp
@@ -85,18 +85,12 @@ void JSEventListener::handleEvent(ScriptExecutionContext* scriptExecutionContext
if (!globalObject)
return;
- Frame* frame = 0;
if (scriptExecutionContext->isDocument()) {
JSDOMWindow* window = jsCast<JSDOMWindow*>(globalObject);
- frame = window->impl()->frame();
- if (!frame)
- return;
- // The window must still be active in its frame. See <https://bugs.webkit.org/show_bug.cgi?id=21921>.
- // FIXME: A better fix for this may be to change DOMWindow::frame() to not return a frame the detached window used to be in.
- if (frame->domWindow() != window->impl())
+ if (!window->impl()->isCurrentlyDisplayedInFrame())
return;
// FIXME: Is this check needed for other contexts?
- ScriptController* script = frame->script();
+ ScriptController* script = window->impl()->frame()->script();
if (!script->canExecuteScripts(AboutToExecuteScript) || script->isPaused())
return;
}
diff --git a/Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp b/Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
index 3f0935240..f0d93abda 100644
--- a/Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
+++ b/Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
@@ -203,6 +203,8 @@ static JSArray* getJSListenerFunctions(ExecState* exec, Document* document, cons
if (jsListener->isolatedWorld() != currentWorld(exec))
continue;
JSObject* function = jsListener->jsFunction(document);
+ if (!function)
+ continue;
JSObject* listenerEntry = constructEmptyObject(exec);
listenerEntry->putDirect(exec->globalData(), Identifier(exec, "listener"), function);
listenerEntry->putDirect(exec->globalData(), Identifier(exec, "useCapture"), jsBoolean(listenerInfo.eventListenerVector[i].useCapture));
diff --git a/Source/WebCore/bindings/js/JSUndoManagerCustom.cpp b/Source/WebCore/bindings/js/JSUndoManagerCustom.cpp
new file mode 100644
index 000000000..94cc0b60f
--- /dev/null
+++ b/Source/WebCore/bindings/js/JSUndoManagerCustom.cpp
@@ -0,0 +1,43 @@
+/*
+ * 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 GOOGLE 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 GOOGLE 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"
+
+#if ENABLE(UNDO_MANAGER)
+
+#include "JSUndoManager.h"
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue JSUndoManager::transact(ExecState*)
+{
+ // FIXME: implement JSC bindings
+ return jsUndefined();
+}
+
+}
+
+#endif
diff --git a/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp b/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp
index 9cf4e99ce..def79cf2c 100644
--- a/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp
+++ b/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp
@@ -80,7 +80,11 @@ void ScriptCachedFrameData::restore(Frame* frame)
if (JSDOMWindow* window = m_windows.get(world).get())
windowShell->setWindow(window->globalData(), window);
else {
- windowShell->setWindow(frame->domWindow());
+ DOMWindow* domWindow = frame->document()->domWindow();
+ if (windowShell->window()->impl() == domWindow)
+ continue;
+
+ windowShell->setWindow(domWindow);
if (Page* page = frame->page()) {
scriptController->attachDebugger(windowShell, page->debugger());
diff --git a/Source/WebCore/bindings/js/ScriptController.cpp b/Source/WebCore/bindings/js/ScriptController.cpp
index 7b0787201..da93984ed 100644
--- a/Source/WebCore/bindings/js/ScriptController.cpp
+++ b/Source/WebCore/bindings/js/ScriptController.cpp
@@ -36,6 +36,7 @@
#include "Page.h"
#include "PageGroup.h"
#include "PluginView.h"
+#include "ScriptCallStack.h"
#include "ScriptSourceCode.h"
#include "ScriptValue.h"
#include "ScriptableDocumentParser.h"
@@ -111,7 +112,7 @@ JSDOMWindowShell* ScriptController::createWindowShell(DOMWrapperWorld* world)
{
ASSERT(!m_windowShells.contains(world));
Structure* structure = JSDOMWindowShell::createStructure(*world->globalData(), jsNull());
- Strong<JSDOMWindowShell> windowShell(*world->globalData(), JSDOMWindowShell::create(m_frame->domWindow(), structure, world));
+ Strong<JSDOMWindowShell> windowShell(*world->globalData(), JSDOMWindowShell::create(m_frame->document()->domWindow(), structure, world));
Strong<JSDOMWindowShell> windowShell2(windowShell);
m_windowShells.add(world, windowShell);
world->didCreateWindowShell(this);
@@ -174,7 +175,7 @@ void ScriptController::getAllWorlds(Vector<RefPtr<DOMWrapperWorld> >& worlds)
static_cast<WebCoreJSClientData*>(JSDOMWindow::commonJSGlobalData()->clientData)->getAllWorlds(worlds);
}
-void ScriptController::clearWindowShell(bool goingIntoPageCache)
+void ScriptController::clearWindowShell(DOMWindow* newDOMWindow, bool goingIntoPageCache)
{
if (m_windowShells.isEmpty())
return;
@@ -184,11 +185,14 @@ void ScriptController::clearWindowShell(bool goingIntoPageCache)
for (ShellMap::iterator iter = m_windowShells.begin(); iter != m_windowShells.end(); ++iter) {
JSDOMWindowShell* windowShell = iter->second.get();
+ if (windowShell->window()->impl() == newDOMWindow)
+ continue;
+
// Clear the debugger from the current window before setting the new window.
attachDebugger(windowShell, 0);
windowShell->window()->willRemoveFromWindowShell();
- windowShell->setWindow(m_frame->domWindow());
+ windowShell->setWindow(newDOMWindow);
// An m_cacheableBindingRootObject persists between page navigations
// so needs to know about the new JSDOMWindow.
@@ -348,7 +352,7 @@ void ScriptController::collectIsolatedContexts(Vector<std::pair<JSC::ExecState*,
{
for (ShellMap::iterator iter = m_windowShells.begin(); iter != m_windowShells.end(); ++iter) {
JSC::ExecState* exec = iter->second->window()->globalExec();
- SecurityOrigin* origin = iter->second->window()->impl()->securityOrigin();
+ SecurityOrigin* origin = iter->second->window()->impl()->document()->securityOrigin();
result.append(std::pair<ScriptState*, SecurityOrigin*>(exec, origin));
}
}
diff --git a/Source/WebCore/bindings/js/ScriptController.h b/Source/WebCore/bindings/js/ScriptController.h
index 0ed986969..f76fde8fc 100644
--- a/Source/WebCore/bindings/js/ScriptController.h
+++ b/Source/WebCore/bindings/js/ScriptController.h
@@ -121,7 +121,7 @@ public:
const String* sourceURL() const { return m_sourceURL; } // 0 if we are not evaluating any script
- void clearWindowShell(bool goingIntoPageCache = false);
+ void clearWindowShell(DOMWindow* newDOMWindow, bool goingIntoPageCache);
void updateDocument();
void namedItemAdded(HTMLDocument*, const AtomicString&) { }
diff --git a/Source/WebCore/bindings/js/ScriptDebugServer.cpp b/Source/WebCore/bindings/js/ScriptDebugServer.cpp
index 51152fa6c..967b3d21f 100644
--- a/Source/WebCore/bindings/js/ScriptDebugServer.cpp
+++ b/Source/WebCore/bindings/js/ScriptDebugServer.cpp
@@ -187,9 +187,8 @@ bool ScriptDebugServer::hasBreakpoint(intptr_t sourceID, const TextPosition& pos
unsigned breaksCount = breaksVector.size();
unsigned i;
for (i = 0; i < breaksCount; i++) {
- int breakColumn = breaksVector.at(i).columnNumber;
int breakLine = breaksVector.at(i).lineNumber;
- if (lineNumber == breakLine && columnNumber == breakColumn) {
+ if (lineNumber == breakLine) {
hit = true;
break;
}
diff --git a/Source/WebCore/bindings/js/SerializedScriptValue.cpp b/Source/WebCore/bindings/js/SerializedScriptValue.cpp
index 2b47d4b62..9d5ca654d 100644
--- a/Source/WebCore/bindings/js/SerializedScriptValue.cpp
+++ b/Source/WebCore/bindings/js/SerializedScriptValue.cpp
@@ -582,13 +582,6 @@ private:
if (isArray(value))
return false;
-
- // Object cannot be serialized because the act of walking the object creates new objects
- if (value.isObject() && asObject(value)->inherits(&JSNavigator::s_info)) {
- fail();
- write(NullTag);
- return true;
- }
if (value.isObject()) {
JSObject* obj = asObject(value);
@@ -677,9 +670,7 @@ private:
return success;
}
- CallData unusedData;
- if (getCallData(value, unusedData) == CallTypeNone)
- return false;
+ return false;
}
// Any other types are expected to serialize as null.
write(NullTag);
@@ -898,6 +889,12 @@ SerializationReturnCode CloneSerializer::serialize(JSValue in)
JSObject* inObject = asObject(inValue);
if (!startObject(inObject))
break;
+ // At this point, all supported objects other than Object
+ // objects have been handled. If we reach this point and
+ // the input is not an Object object then we should throw
+ // a DataCloneError.
+ if (inObject->classInfo() != &JSFinalObject::s_info)
+ return DataCloneError;
inputObjectStack.append(inObject);
indexStack.append(0);
propertyStack.append(PropertyNameArray(m_exec));
@@ -1920,6 +1917,9 @@ void SerializedScriptValue::maybeThrowExceptionIfSerializationFailed(ExecState*
case ValidationError:
throwError(exec, createTypeError(exec, "Unable to deserialize data."));
break;
+ case DataCloneError:
+ setDOMException(exec, DATA_CLONE_ERR);
+ break;
case ExistingExceptionError:
break;
case UnspecifiedError:
diff --git a/Source/WebCore/bindings/js/SerializedScriptValue.h b/Source/WebCore/bindings/js/SerializedScriptValue.h
index 99ba1c196..ab99898b7 100644
--- a/Source/WebCore/bindings/js/SerializedScriptValue.h
+++ b/Source/WebCore/bindings/js/SerializedScriptValue.h
@@ -51,6 +51,7 @@ enum SerializationReturnCode {
InterruptedExecutionError,
ValidationError,
ExistingExceptionError,
+ DataCloneError,
UnspecifiedError
};
diff --git a/Source/WebCore/bindings/objc/DOMAbstractView.mm b/Source/WebCore/bindings/objc/DOMAbstractView.mm
index 0b79aa9c9..d2d3dd58d 100644
--- a/Source/WebCore/bindings/objc/DOMAbstractView.mm
+++ b/Source/WebCore/bindings/objc/DOMAbstractView.mm
@@ -50,7 +50,7 @@
{
if (!_internal)
return nil;
- return kit(IMPL->domWindow()->document());
+ return kit(IMPL->document());
}
@end
@@ -72,7 +72,7 @@ WebCore::DOMWindow* core(DOMAbstractView *wrapper)
return 0;
if (!wrapper->_internal)
return 0;
- return reinterpret_cast<WebCore::Frame*>(wrapper->_internal)->domWindow();
+ return reinterpret_cast<WebCore::Frame*>(wrapper->_internal)->document()->domWindow();
}
DOMAbstractView *kit(WebCore::DOMWindow* value)
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm b/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm
index 4a3cc0110..4bcef8e41 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm
@@ -144,7 +144,6 @@ sub GetClassName
return "WebDOMObject" if $name eq "DOMObject";
return "bool" if $name eq "boolean";
return $name if $codeGenerator->IsPrimitiveType($name);
- return "WebDOMCustomVoidCallback" if $name eq "VoidCallback";
return "WebDOM$name";
}
@@ -326,12 +325,7 @@ sub AddIncludesForType
$implIncludes{"SerializedScriptValue.h"} = 1;
return;
}
-
- if ($type eq "VoidCallback") {
- $implIncludes{"WebDOMCustomVoidCallback.h"} = 1;
- return;
- }
-
+
# Also include CSSImportRule so that the toWebKit methods for subclasses are found
if ($type eq "CSSRule") {
$implIncludes{"WebDOMCSSImportRule.h"} = 1;
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
index 60d96ccf5..4480575a7 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -193,7 +193,6 @@ sub GetCallbackClassName
{
my $className = shift;
- return "JSCustomVoidCallback" if $className eq "VoidCallback";
return "JS$className";
}
@@ -2816,7 +2815,9 @@ END
push(@implContent, " return true;\n\n");
push(@implContent, " RefPtr<$className> protect(this);\n\n");
push(@implContent, " JSLockHolder lock(m_data->globalObject()->globalData());\n\n");
- push(@implContent, " ExecState* exec = m_data->globalObject()->globalExec();\n");
+ if (@params) {
+ push(@implContent, " ExecState* exec = m_data->globalObject()->globalExec();\n");
+ }
push(@implContent, " MarkedArgumentBuffer args;\n");
foreach my $param (@params) {
@@ -3067,7 +3068,6 @@ sub JSValueToNative
}
AddToImplIncludes("HTMLOptionElement.h", $conditional) if $type eq "HTMLOptionElement";
- AddToImplIncludes("JSCustomVoidCallback.h", $conditional) if $type eq "VoidCallback";
AddToImplIncludes("Event.h", $conditional) if $type eq "Event";
my $arrayType = $codeGenerator->GetArrayType($type);
@@ -3118,7 +3118,6 @@ sub NativeToJSValue
if (defined $conv) {
return "jsStringOrNull(exec, $value)" if $conv eq "Null";
return "jsStringOrUndefined(exec, $value)" if $conv eq "Undefined";
- return "jsStringOrFalse(exec, $value)" if $conv eq "False";
die "Unknown value for TreatReturnedNullStringAs extended attribute";
}
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
index 0a9d9d72f..2c170e2c9 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -965,7 +965,7 @@ END
push(@implContentDecls, " $nativeType v = $getterString;\n");
}
push(@implContentDecls, " if (UNLIKELY(ec))\n");
- push(@implContentDecls, " return V8Proxy::setDOMException(ec, info.GetIsolate());\n");
+ push(@implContentDecls, " return setDOMException(ec, info.GetIsolate());\n");
if ($codeGenerator->ExtendedAttributeContains($attribute->signature->extendedAttributes->{"CallWith"}, "ScriptState")) {
push(@implContentDecls, " if (state.hadException())\n");
@@ -1147,7 +1147,7 @@ sub GenerateNormalAttrSetter
my $argType = GetTypeFromSignature($attribute->signature);
if (IsWrapperType($argType)) {
push(@implContentDecls, " if (!isUndefinedOrNull(value) && !V8${argType}::HasInstance(value)) {\n");
- push(@implContentDecls, " V8Proxy::throwTypeError(0, info.GetIsolate());\n");
+ push(@implContentDecls, " throwTypeError(0, info.GetIsolate());\n");
push(@implContentDecls, " return;\n");
push(@implContentDecls, " }\n");
}
@@ -1164,7 +1164,7 @@ END
AddToImplIncludes("ExceptionCode.h");
push(@implContentDecls, " $svgNativeType* wrapper = V8${implClassName}::toNative(info.Holder());\n");
push(@implContentDecls, " if (wrapper->isReadOnly()) {\n");
- push(@implContentDecls, " V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR, info.GetIsolate());\n");
+ push(@implContentDecls, " setDOMException(NO_MODIFICATION_ALLOWED_ERR, info.GetIsolate());\n");
push(@implContentDecls, " return;\n");
push(@implContentDecls, " }\n");
push(@implContentDecls, " $svgWrappedNativeType& impInstance = wrapper->propertyReference();\n");
@@ -1183,7 +1183,7 @@ END
my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
AddToImplIncludes("${namespace}.h");
push(@implContentDecls, " Element* imp = V8Element::toNative(info.Holder());\n");
- push(@implContentDecls, " AtomicString v = toAtomicWebCoreStringWithNullCheck(value);\n");
+ push(@implContentDecls, " AtomicString v = toWebCoreAtomicStringWithNullCheck(value);\n");
push(@implContentDecls, " imp->setAttribute(${namespace}::${contentAttributeName}Attr, v);\n");
push(@implContentDecls, "}\n\n");
push(@implContentDecls, "#endif // ${conditionalString}\n\n") if $conditionalString;
@@ -1273,7 +1273,7 @@ END
if ($useExceptions) {
push(@implContentDecls, " if (UNLIKELY(ec))\n");
- push(@implContentDecls, " V8Proxy::setDOMException(ec, info.GetIsolate());\n");
+ push(@implContentDecls, " setDOMException(ec, info.GetIsolate());\n");
}
if ($codeGenerator->ExtendedAttributeContains($attribute->signature->extendedAttributes->{"CallWith"}, "ScriptState")) {
@@ -1345,7 +1345,7 @@ static v8::Handle<v8::Value> ${functionName}EventListenerCallback(const v8::Argu
INC_STATS("DOM.${implClassName}.${functionName}EventListener()");
RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFind${lookupType});
if (listener) {
- V8${implClassName}::toNative(args.Holder())->${functionName}EventListener(v8ValueToAtomicWebCoreString(args[0]), listener${passRefPtrHandling}, args[2]->BooleanValue());
+ V8${implClassName}::toNative(args.Holder())->${functionName}EventListener(toWebCoreAtomicString(args[0]), listener${passRefPtrHandling}, args[2]->BooleanValue());
END
if ($requiresHiddenDependency) {
push(@implContentDecls, <<END);
@@ -1447,7 +1447,7 @@ END
push(@implContentDecls, " return ${name}$overload->{overloadIndex}Callback(args);\n");
}
push(@implContentDecls, <<END);
- return V8Proxy::throwTypeError(0, args.GetIsolate());
+ return throwTypeError(0, args.GetIsolate());
END
push(@implContentDecls, "}\n\n");
push(@implContentDecls, "#endif // ${conditionalString}\n\n") if $conditionalString;
@@ -1508,7 +1508,7 @@ END
AddToImplIncludes("ExceptionCode.h");
push(@implContentDecls, " $nativeClassName wrapper = V8${implClassName}::toNative(args.Holder());\n");
push(@implContentDecls, " if (wrapper->isReadOnly())\n");
- push(@implContentDecls, " return V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR, args.GetIsolate());\n");
+ push(@implContentDecls, " return setDOMException(NO_MODIFICATION_ALLOWED_ERR, args.GetIsolate());\n");
my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName);
push(@implContentDecls, " $svgWrappedNativeType& impInstance = wrapper->propertyReference();\n");
push(@implContentDecls, " $svgWrappedNativeType* imp = &impInstance;\n");
@@ -1564,7 +1564,7 @@ END
if ($raisesExceptions) {
push(@implContentDecls, " }\n");
push(@implContentDecls, " fail:\n");
- push(@implContentDecls, " return V8Proxy::setDOMException(ec, args.GetIsolate());\n");
+ push(@implContentDecls, " return setDOMException(ec, args.GetIsolate());\n");
}
push(@implContentDecls, "}\n\n");
@@ -1634,7 +1634,7 @@ sub GenerateArgumentsCountCheck
my $argumentsCountCheckString = "";
if ($numMandatoryParams >= 1) {
$argumentsCountCheckString .= " if (args.Length() < $numMandatoryParams)\n";
- $argumentsCountCheckString .= " return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());\n";
+ $argumentsCountCheckString .= " return throwNotEnoughArgumentsError(args.GetIsolate());\n";
}
return $argumentsCountCheckString;
}
@@ -1698,12 +1698,12 @@ sub GenerateParametersCheck
$parameterCheckString .= " RefPtr<" . $parameter->type . "> $parameterName;\n";
$parameterCheckString .= " if (args.Length() > $paramIndex && !args[$paramIndex]->IsNull() && !args[$paramIndex]->IsUndefined()) {\n";
$parameterCheckString .= " if (!args[$paramIndex]->IsFunction())\n";
- $parameterCheckString .= " return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());\n";
+ $parameterCheckString .= " return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());\n";
$parameterCheckString .= " $parameterName = ${className}::create(args[$paramIndex], getScriptExecutionContext());\n";
$parameterCheckString .= " }\n";
} else {
$parameterCheckString .= " if (args.Length() <= $paramIndex || !args[$paramIndex]->IsFunction())\n";
- $parameterCheckString .= " return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());\n";
+ $parameterCheckString .= " return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());\n";
$parameterCheckString .= " RefPtr<" . $parameter->type . "> $parameterName = ${className}::create(args[$paramIndex], getScriptExecutionContext());\n";
}
} elsif ($parameter->extendedAttributes->{"Clamp"}) {
@@ -1738,7 +1738,7 @@ sub GenerateParametersCheck
$parameterCheckString .= " ArrayBufferArray arrayBufferArray$TransferListName;\n";
$parameterCheckString .= " if (args.Length() > $transferListIndex) {\n";
$parameterCheckString .= " if (!extractTransferables(args[$transferListIndex], messagePortArray$TransferListName, arrayBufferArray$TransferListName, args.GetIsolate()))\n";
- $parameterCheckString .= " return V8Proxy::throwTypeError(\"Could not extract transferables\");\n";
+ $parameterCheckString .= " return throwTypeError(\"Could not extract transferables\");\n";
$parameterCheckString .= " }\n";
$useTransferList = 1;
}
@@ -1772,14 +1772,14 @@ sub GenerateParametersCheck
my $argType = GetTypeFromSignature($parameter);
if (IsWrapperType($argType)) {
$parameterCheckString .= " if (args.Length() > $paramIndex && !isUndefinedOrNull($argValue) && !V8${argType}::HasInstance($argValue))\n";
- $parameterCheckString .= " return V8Proxy::throwTypeError(0, args.GetIsolate());\n";
+ $parameterCheckString .= " return throwTypeError(0, args.GetIsolate());\n";
}
}
$parameterCheckString .= " EXCEPTION_BLOCK($nativeType, $parameterName, " .
JSValueToNative($parameter, "MAYBE_MISSING_PARAMETER(args, $paramIndex, $parameterDefaultPolicy)", "args.GetIsolate()") . ");\n";
if ($nativeType eq 'Dictionary') {
$parameterCheckString .= " if (!$parameterName.isUndefinedOrNull() && !$parameterName.isObject())\n";
- $parameterCheckString .= " return V8Proxy::throwTypeError(\"Not an object.\", args.GetIsolate());\n";
+ $parameterCheckString .= " return throwTypeError(\"Not an object.\", args.GetIsolate());\n";
}
}
@@ -1821,7 +1821,7 @@ v8::Handle<v8::Value> V8${implClassName}::constructorCallback(const v8::Argument
INC_STATS("DOM.${implClassName}.Constructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+ return throwTypeError("DOM object constructor cannot be called as a function.");
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
@@ -1846,7 +1846,7 @@ END
ScriptExecutionContext* context = getScriptExecutionContext();
if (!context)
- return V8Proxy::throwError(V8Proxy::ReferenceError, "${implClassName} constructor's associated context is not available", args.GetIsolate());
+ return throwError(ReferenceError, "${implClassName} constructor's associated context is not available", args.GetIsolate());
END
}
@@ -1886,7 +1886,7 @@ END
if ($raisesExceptions) {
push(@implContent, " fail:\n");
- push(@implContent, " return V8Proxy::setDOMException(ec, args.GetIsolate());\n");
+ push(@implContent, " return setDOMException(ec, args.GetIsolate());\n");
}
push(@implContent, "}\n");
@@ -1905,13 +1905,13 @@ v8::Handle<v8::Value> V8${implClassName}::constructorCallback(const v8::Argument
INC_STATS("DOM.${implClassName}.Constructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+ return throwTypeError("DOM object constructor cannot be called as a function.");
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, type, args[0]);
${implClassName}Init eventInit;
@@ -2014,14 +2014,14 @@ static v8::Handle<v8::Value> V8${implClassName}ConstructorCallback(const v8::Arg
INC_STATS("DOM.${implClassName}.Constructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+ return throwTypeError("DOM object constructor cannot be called as a function.");
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
Frame* frame = currentFrame(BindingState::instance());
if (!frame)
- return V8Proxy::throwError(V8Proxy::ReferenceError, "${implClassName} constructor associated frame is unavailable", args.GetIsolate());
+ return throwError(ReferenceError, "${implClassName} constructor associated frame is unavailable", args.GetIsolate());
Document* document = frame->document();
@@ -2080,7 +2080,7 @@ END
if ($raisesExceptions) {
push(@implContent, " fail:\n");
- push(@implContent, " return V8Proxy::setDOMException(ec, args.GetIsolate());\n");
+ push(@implContent, " return setDOMException(ec, args.GetIsolate());\n");
}
push(@implContent, "}\n");
@@ -2098,7 +2098,7 @@ v8::Persistent<v8::FunctionTemplate> V8${implClassName}Constructor::GetTemplate(
v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate();
instance->SetInternalFieldCount(V8${implClassName}::internalFieldCount);
- result->SetClassName(v8::String::New("${implClassName}"));
+ result->SetClassName(v8::String::NewSymbol("${implClassName}"));
result->Inherit(V8${implClassName}::GetTemplate());
cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New(result);
@@ -2298,7 +2298,7 @@ sub GenerateNonStandardFunction
push(@implContent, <<END);
// $commentInfo
- ${conditional}$template->SetAccessor(v8::String::New("$name"), ${interfaceName}V8Internal::${name}AttrGetter, ${interfaceName}V8Internal::${interfaceName}DomainSafeFunctionSetter, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($property_attributes));
+ ${conditional}$template->SetAccessor(v8::String::NewSymbol("$name"), ${interfaceName}V8Internal::${name}AttrGetter, ${interfaceName}V8Internal::${interfaceName}DomainSafeFunctionSetter, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($property_attributes));
END
return;
}
@@ -2329,7 +2329,7 @@ END
my $conditionalString = $codeGenerator->GenerateConditionalString($function->signature);
push(@implContent, "#if ${conditionalString}\n") if $conditionalString;
- push(@implContent, " ${conditional}$template->Set(v8::String::New(\"$name\"), v8::FunctionTemplate::New($callback, v8Undefined(), ${signature})$property_attributes);\n");
+ push(@implContent, " ${conditional}$template->Set(v8::String::NewSymbol(\"$name\"), v8::FunctionTemplate::New($callback, v8Undefined(), ${signature})$property_attributes);\n");
push(@implContent, "#endif // ${conditionalString}\n") if $conditionalString;
}
@@ -2951,9 +2951,9 @@ END
// For security reasons, these functions are on the instance instead
// of on the prototype object to ensure that they cannot be overwritten.
- instance->SetAccessor(v8::String::New("reload"), V8Location::reloadAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
- instance->SetAccessor(v8::String::New("replace"), V8Location::replaceAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
- instance->SetAccessor(v8::String::New("assign"), V8Location::assignAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
+ instance->SetAccessor(v8::String::NewSymbol("reload"), V8Location::reloadAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
+ instance->SetAccessor(v8::String::NewSymbol("replace"), V8Location::replaceAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
+ instance->SetAccessor(v8::String::NewSymbol("assign"), V8Location::assignAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
END
}
@@ -3040,7 +3040,7 @@ END
my $name = $runtimeFunc->signature->name;
my $callback = GetFunctionTemplateCallbackName($runtimeFunc, $interfaceName);
push(@implContent, <<END);
- proto->Set(v8::String::New("${name}"), v8::FunctionTemplate::New(${callback}, v8Undefined(), defaultSignature)->GetFunction());
+ proto->Set(v8::String::NewSymbol("${name}"), v8::FunctionTemplate::New(${callback}, v8Undefined(), defaultSignature)->GetFunction());
END
push(@implContent, " }\n");
push(@implContent, "#endif // ${conditionalString}\n") if $conditionalString;
@@ -3215,7 +3215,7 @@ sub GenerateCallbackImplementation
AddToImplIncludes("ScriptExecutionContext.h");
AddToImplIncludes("V8Binding.h");
- AddToImplIncludes("V8CustomVoidCallback.h");
+ AddToImplIncludes("V8Callback.h");
AddToImplIncludes("V8Proxy.h");
push(@implContent, "#include <wtf/Assertions.h>\n\n");
@@ -3535,7 +3535,7 @@ sub GenerateFunctionCallString()
} elsif ($codeGenerator->IsSVGTypeNeedingTearOff($parameter->type) and not $implClassName =~ /List$/) {
push @arguments, "$paramName->propertyReference()";
$result .= $indent . "if (!$paramName)\n";
- $result .= $indent . " return V8Proxy::setDOMException(WebCore::TYPE_MISMATCH_ERR, args.GetIsolate());\n";
+ $result .= $indent . " return setDOMException(WebCore::TYPE_MISMATCH_ERR, args.GetIsolate());\n";
} elsif ($parameter->type eq "SVGMatrix" and $implClassName eq "SVGTransformList") {
push @arguments, "$paramName.get()";
} else {
@@ -3746,7 +3746,6 @@ sub TypeCanFailConversion
AddToImplIncludes("ExceptionCode.h") if $type eq "Attr";
return 1 if $type eq "Attr";
- return 1 if $type eq "VoidCallback";
return 0;
}
@@ -3767,9 +3766,9 @@ sub JSValueToNative
return "toInt64($value)" if $type eq "unsigned long long" or $type eq "long long";
return "static_cast<Range::CompareHow>($value->Int32Value())" if $type eq "CompareHow";
return "toWebCoreDate($value)" if $type eq "Date";
- return "v8ValueToWebCoreDOMStringList($value)" if $type eq "DOMStringList";
+ return "toDOMStringList($value)" if $type eq "DOMStringList";
# FIXME: Add proper support for T[], T[]? and sequence<T>.
- return "v8ValueToWebCoreDOMStringList($value)" if $type eq "DOMString[]";
+ return "toDOMStringList($value)" if $type eq "DOMString[]";
if ($type eq "DOMString" or $type eq "DOMUserData") {
return $value;
@@ -4055,7 +4054,6 @@ sub NativeToJSValue
if (defined $conv) {
return "v8StringOrNull($value$getIsolateArg)" if $conv eq "Null";
return "v8StringOrUndefined($value$getIsolateArg)" if $conv eq "Undefined";
- return "v8StringOrFalse($value$getIsolateArg)" if $conv eq "False";
die "Unknown value for TreatReturnedNullStringAs extended attribute";
}
@@ -4181,7 +4179,6 @@ sub GetCallbackClassName
{
my $interfaceName = shift;
- return "V8CustomVoidCallback" if $interfaceName eq "VoidCallback";
return "V8$interfaceName";
}
diff --git a/Source/WebCore/bindings/scripts/IDLAttributes.txt b/Source/WebCore/bindings/scripts/IDLAttributes.txt
index 889e1075e..38de69d4e 100644
--- a/Source/WebCore/bindings/scripts/IDLAttributes.txt
+++ b/Source/WebCore/bindings/scripts/IDLAttributes.txt
@@ -104,7 +104,7 @@ Supplemental=*
SuppressToJSObject
TransferList=*
TreatNullAs=NullString
-TreatReturnedNullStringAs=False|Null|Undefined
+TreatReturnedNullStringAs=Null|Undefined
TreatUndefinedAs=NullString
TypedArray=*
URL
diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
index a93f968e4..aa81195bb 100644
--- a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
@@ -37,7 +37,6 @@
#include "WebDOMa.h"
#include "WebDOMb.h"
#include "WebDOMbool.h"
-#include "WebDOMc.h"
#include "WebDOMd.h"
#include "WebDOMe.h"
#include "WebExceptionHandler.h"
@@ -45,7 +44,6 @@
#include "a.h"
#include "b.h"
#include "bool.h"
-#include "c.h"
#include "d.h"
#include "e.h"
#include "wtf/text/AtomicString.h"
@@ -902,14 +900,6 @@ void WebDOMTestObj::convert2(const WebDOMb& )
impl()->convert2(toWebCore());
}
-void WebDOMTestObj::convert3(const WebDOMc& )
-{
- if (!impl())
- return;
-
- impl()->convert3(toWebCore());
-}
-
void WebDOMTestObj::convert4(const WebDOMd& )
{
if (!impl())
diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
index bd373d837..00f06002d 100644
--- a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
@@ -40,7 +40,6 @@ class WebDOMTestObj;
class WebDOMa;
class WebDOMb;
class WebDOMbool;
-class WebDOMc;
class WebDOMd;
class WebDOMe;
@@ -182,7 +181,6 @@ public:
#endif
void convert1(const WebDOMa& );
void convert2(const WebDOMb& );
- void convert3(const WebDOMc& );
void convert4(const WebDOMd& );
void convert5(const WebDOMe& );
WebDOMSVGPoint mutablePointFunction();
diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
index 5e2bde4a0..cefbc04a4 100644
--- a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
@@ -48,8 +48,6 @@
#include "webkit/WebKitDOMbPrivate.h"
#include "webkit/WebKitDOMbool.h"
#include "webkit/WebKitDOMboolPrivate.h"
-#include "webkit/WebKitDOMc.h"
-#include "webkit/WebKitDOMcPrivate.h"
#include "webkit/WebKitDOMd.h"
#include "webkit/WebKitDOMdPrivate.h"
#include "webkit/WebKitDOMe.h"
@@ -1360,21 +1358,6 @@ webkit_dom_test_obj_convert2(WebKitDOMTestObj* self, WebKitDOMb* )
}
void
-webkit_dom_test_obj_convert3(WebKitDOMTestObj* self, WebKitDOMc* )
-{
- g_return_if_fail(self);
- WebCore::JSMainThreadNullState state;
- WebCore::TestObj* item = WebKit::core(self);
- g_return_if_fail();
- WebCore::c* converted = 0;
- if () {
- converted = WebKit::core();
- g_return_if_fail(converted);
- }
- item->convert3(converted);
-}
-
-void
webkit_dom_test_obj_convert4(WebKitDOMTestObj* self, WebKitDOMd* )
{
g_return_if_fail(self);
diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
index b8d57de16..46b85d0be 100644
--- a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
@@ -420,17 +420,6 @@ WEBKIT_API void
webkit_dom_test_obj_convert2(WebKitDOMTestObj* self, WebKitDOMb* );
/**
- * webkit_dom_test_obj_convert3:
- * @self: A #WebKitDOMTestObj
- * @: A #WebKitDOMc
- *
- * Returns:
- *
-**/
-WEBKIT_API void
-webkit_dom_test_obj_convert3(WebKitDOMTestObj* self, WebKitDOMc* );
-
-/**
* webkit_dom_test_obj_convert4:
* @self: A #WebKitDOMTestObj
* @: A #WebKitDOMd
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp
index e7ba4c069..f84f915fd 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp
@@ -67,7 +67,6 @@ bool JSTestCallback::callbackWithNoParam()
JSLockHolder lock(m_data->globalObject()->globalData());
- ExecState* exec = m_data->globalObject()->globalExec();
MarkedArgumentBuffer args;
bool raisedException = false;
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
index c7f790aeb..18affcc79 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
@@ -41,7 +41,6 @@
#include "JSa.h"
#include "JSb.h"
#include "JSbool.h"
-#include "JSc.h"
#include "JSd.h"
#include "JSe.h"
#include "KURL.h"
@@ -314,7 +313,6 @@ static const HashTableValue JSTestObjPrototypeTableValues[] =
{ "getSVGDocument", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionGetSVGDocument), (intptr_t)0, NoIntrinsic },
{ "convert1", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert1), (intptr_t)1, NoIntrinsic },
{ "convert2", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert2), (intptr_t)1, NoIntrinsic },
- { "convert3", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert3), (intptr_t)1, NoIntrinsic },
{ "convert4", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert4), (intptr_t)1, NoIntrinsic },
{ "convert5", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert5), (intptr_t)1, NoIntrinsic },
{ "mutablePointFunction", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMutablePointFunction), (intptr_t)0, NoIntrinsic },
@@ -324,7 +322,7 @@ static const HashTableValue JSTestObjPrototypeTableValues[] =
{ 0, 0, 0, 0, NoIntrinsic }
};
-static const HashTable JSTestObjPrototypeTable = { 267, 255, JSTestObjPrototypeTableValues, 0 };
+static const HashTable JSTestObjPrototypeTable = { 266, 255, JSTestObjPrototypeTableValues, 0 };
const ClassInfo JSTestObjPrototype::s_info = { "TestObjectPrototype", &Base::s_info, &JSTestObjPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestObjPrototype) };
JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
@@ -2486,23 +2484,6 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert2(ExecState* exec)
return JSValue::encode(jsUndefined());
}
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert3(ExecState* exec)
-{
- JSValue thisValue = exec->hostThisValue();
- if (!thisValue.inherits(&JSTestObj::s_info))
- return throwVMTypeError(exec);
- JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
- ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
- TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- if (exec->argumentCount() < 1)
- return throwVMError(exec, createNotEnoughArgumentsError(exec));
- c* (toc(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
- if (exec->hadException())
- return JSValue::encode(jsUndefined());
- impl->convert3();
- return JSValue::encode(jsUndefined());
-}
-
EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert4(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
index ddcfe5d1a..76549d461 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
@@ -209,7 +209,6 @@ JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionStringArrayFunction(
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionGetSVGDocument(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert1(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert2(JSC::ExecState*);
-JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert3(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert4(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert5(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMutablePointFunction(JSC::ExecState*);
diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
index 42e54ca2f..3696811e7 100644
--- a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
@@ -40,7 +40,6 @@
@class DOMa;
@class DOMb;
@class DOMbool;
-@class DOMc;
@class DOMd;
@class DOMe;
@class NSString;
@@ -220,7 +219,6 @@ enum {
- (DOMSVGDocument *)getSVGDocument;
- (void)convert1:(DOMa *);
- (void)convert2:(DOMb *);
-- (void)convert3:(DOMc *);
- (void)convert4:(DOMd *);
- (void)convert5:(DOMe *);
- (DOMSVGPoint *)mutablePointFunction;
diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
index d08611cf6..4bd0401cd 100644
--- a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
@@ -47,7 +47,6 @@
#import "DOMaInternal.h"
#import "DOMbInternal.h"
#import "DOMboolInternal.h"
-#import "DOMcInternal.h"
#import "DOMdInternal.h"
#import "DOMeInternal.h"
#import "Dictionary.h"
@@ -72,7 +71,6 @@
#import "a.h"
#import "b.h"
#import "bool.h"
-#import "c.h"
#import "d.h"
#import "e.h"
#import <wtf/GetPtr.h>
@@ -1003,12 +1001,6 @@
IMPL->convert2(core());
}
-- (void)convert3:(DOMc *)
-{
- WebCore::JSMainThreadNullState state;
- IMPL->convert3(core());
-}
-
- (void)convert4:(DOMd *)
{
WebCore::JSMainThreadNullState state;
diff --git a/Source/WebCore/bindings/scripts/test/TestObj.idl b/Source/WebCore/bindings/scripts/test/TestObj.idl
index 2ca139a70..c53ccfd7c 100644
--- a/Source/WebCore/bindings/scripts/test/TestObj.idl
+++ b/Source/WebCore/bindings/scripts/test/TestObj.idl
@@ -226,7 +226,6 @@ module test {
void convert1(in [TreatReturnedNullStringAs=Null] a);
void convert2(in [TreatReturnedNullStringAs=Undefined] b);
- void convert3(in [TreatReturnedNullStringAs=False] c);
void convert4(in [TreatNullAs=NullString] d);
void convert5(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] e);
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp b/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp
index 7d4d75132..534a8decb 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp
@@ -53,7 +53,7 @@ static v8::Handle<v8::Value> fooCallback(const v8::Arguments& args)
{
INC_STATS("DOM.Float64Array.foo");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
Float64Array* imp = V8Float64Array::toNative(args.Holder());
EXCEPTION_BLOCK(Float32Array*, array, V8Float32Array::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8Float32Array::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
return toV8(imp->foo(array), args.GetIsolate());
@@ -107,7 +107,7 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8Float64ArrayTemplate(v8::
const int fooArgc = 1;
v8::Handle<v8::FunctionTemplate> fooArgv[fooArgc] = { V8Float32Array::GetRawTemplate() };
v8::Handle<v8::Signature> fooSignature = v8::Signature::New(desc, fooArgc, fooArgv);
- proto->Set(v8::String::New("foo"), v8::FunctionTemplate::New(Float64ArrayV8Internal::fooCallback, v8Undefined(), fooSignature));
+ proto->Set(v8::String::NewSymbol("foo"), v8::FunctionTemplate::New(Float64ArrayV8Internal::fooCallback, v8Undefined(), fooSignature));
// Custom toString template
desc->Set(getToStringName(), getToStringTemplate());
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp
index 4f8b84535..86b1fd2c8 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp
@@ -52,7 +52,7 @@ static v8::Handle<v8::Value> excitingFunctionCallback(const v8::Arguments& args)
{
INC_STATS("DOM.TestActiveDOMObject.excitingFunction");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(args.Holder());
if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame()))
return v8Undefined();
@@ -65,7 +65,7 @@ static v8::Handle<v8::Value> postMessageCallback(const v8::Arguments& args)
{
INC_STATS("DOM.TestActiveDOMObject.postMessage");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(args.Holder());
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, message, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
imp->postMessage(message);
@@ -134,10 +134,10 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestActiveDOMObjectTempla
const int excitingFunctionArgc = 1;
v8::Handle<v8::FunctionTemplate> excitingFunctionArgv[excitingFunctionArgc] = { V8Node::GetRawTemplate() };
v8::Handle<v8::Signature> excitingFunctionSignature = v8::Signature::New(desc, excitingFunctionArgc, excitingFunctionArgv);
- proto->Set(v8::String::New("excitingFunction"), v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::excitingFunctionCallback, v8Undefined(), excitingFunctionSignature));
+ proto->Set(v8::String::NewSymbol("excitingFunction"), v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::excitingFunctionCallback, v8Undefined(), excitingFunctionSignature));
// Function 'postMessage' (ExtAttr: 'DoNotCheckSecurity')
- proto->SetAccessor(v8::String::New("postMessage"), TestActiveDOMObjectV8Internal::postMessageAttrGetter, TestActiveDOMObjectV8Internal::TestActiveDOMObjectDomainSafeFunctionSetter, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
+ proto->SetAccessor(v8::String::NewSymbol("postMessage"), TestActiveDOMObjectV8Internal::postMessageAttrGetter, TestActiveDOMObjectV8Internal::TestActiveDOMObjectDomainSafeFunctionSetter, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
// Custom toString template
desc->Set(getToStringName(), getToStringTemplate());
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp
index 6afa83029..0f19bfc91 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp
@@ -25,10 +25,10 @@
#include "ScriptExecutionContext.h"
#include "V8Binding.h"
+#include "V8Callback.h"
#include "V8Class1.h"
#include "V8Class2.h"
#include "V8Class8.h"
-#include "V8CustomVoidCallback.h"
#include "V8DOMStringList.h"
#include "V8Proxy.h"
#include "V8ThisClass.h"
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp
index fecc40c86..888cae832 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp
@@ -43,7 +43,7 @@ static v8::Handle<v8::Value> anotherFunctionCallback(const v8::Arguments& args)
{
INC_STATS("DOM.TestCustomNamedGetter.anotherFunction");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestCustomNamedGetter* imp = V8TestCustomNamedGetter::toNative(args.Holder());
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, str, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
imp->anotherFunction(str);
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp
index 6e755a7cd..2376913a9 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp
@@ -67,13 +67,13 @@ v8::Handle<v8::Value> V8TestEventConstructor::constructorCallback(const v8::Argu
INC_STATS("DOM.TestEventConstructor.Constructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+ return throwTypeError("DOM object constructor cannot be called as a function.");
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, type, args[0]);
TestEventConstructorInit eventInit;
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp
index 87eea8bf0..cd2076c40 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp
@@ -46,7 +46,7 @@ static v8::Handle<v8::Value> itemCallback(const v8::Arguments& args)
{
INC_STATS("DOM.TestEventTarget.item");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestEventTarget* imp = V8TestEventTarget::toNative(args.Holder());
ExceptionCode ec = 0;
{
@@ -58,7 +58,7 @@ static v8::Handle<v8::Value> itemCallback(const v8::Arguments& args)
return toV8(imp->item(index), args.GetIsolate());
}
fail:
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
static v8::Handle<v8::Value> addEventListenerCallback(const v8::Arguments& args)
@@ -66,7 +66,7 @@ static v8::Handle<v8::Value> addEventListenerCallback(const v8::Arguments& args)
INC_STATS("DOM.TestEventTarget.addEventListener()");
RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOrCreate);
if (listener) {
- V8TestEventTarget::toNative(args.Holder())->addEventListener(v8ValueToAtomicWebCoreString(args[0]), listener, args[2]->BooleanValue());
+ V8TestEventTarget::toNative(args.Holder())->addEventListener(toWebCoreAtomicString(args[0]), listener, args[2]->BooleanValue());
createHiddenDependency(args.Holder(), args[1], V8TestEventTarget::eventListenerCacheIndex);
}
return v8Undefined();
@@ -77,7 +77,7 @@ static v8::Handle<v8::Value> removeEventListenerCallback(const v8::Arguments& ar
INC_STATS("DOM.TestEventTarget.removeEventListener()");
RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOnly);
if (listener) {
- V8TestEventTarget::toNative(args.Holder())->removeEventListener(v8ValueToAtomicWebCoreString(args[0]), listener.get(), args[2]->BooleanValue());
+ V8TestEventTarget::toNative(args.Holder())->removeEventListener(toWebCoreAtomicString(args[0]), listener.get(), args[2]->BooleanValue());
removeHiddenDependency(args.Holder(), args[1], V8TestEventTarget::eventListenerCacheIndex);
}
return v8Undefined();
@@ -87,7 +87,7 @@ static v8::Handle<v8::Value> dispatchEventCallback(const v8::Arguments& args)
{
INC_STATS("DOM.TestEventTarget.dispatchEvent");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestEventTarget* imp = V8TestEventTarget::toNative(args.Holder());
ExceptionCode ec = 0;
{
@@ -98,7 +98,7 @@ static v8::Handle<v8::Value> dispatchEventCallback(const v8::Arguments& args)
return v8Boolean(result, args.GetIsolate());
}
fail:
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
} // namespace TestEventTargetV8Internal
@@ -131,7 +131,7 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestEventTargetTemplate(v
const int dispatchEventArgc = 1;
v8::Handle<v8::FunctionTemplate> dispatchEventArgv[dispatchEventArgc] = { V8Event::GetRawTemplate() };
v8::Handle<v8::Signature> dispatchEventSignature = v8::Signature::New(desc, dispatchEventArgc, dispatchEventArgv);
- proto->Set(v8::String::New("dispatchEvent"), v8::FunctionTemplate::New(TestEventTargetV8Internal::dispatchEventCallback, v8Undefined(), dispatchEventSignature));
+ proto->Set(v8::String::NewSymbol("dispatchEvent"), v8::FunctionTemplate::New(TestEventTargetV8Internal::dispatchEventCallback, v8Undefined(), dispatchEventSignature));
// Custom toString template
desc->Set(getToStringName(), getToStringTemplate());
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
index 47e422840..aaacc81c1 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
@@ -156,7 +156,7 @@ static v8::Handle<v8::Value> supplementalMethod2Callback(const v8::Arguments& ar
{
INC_STATS("DOM.TestInterface.supplementalMethod2");
if (args.Length() < 2)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestInterface* imp = V8TestInterface::toNative(args.Holder());
ExceptionCode ec = 0;
{
@@ -171,7 +171,7 @@ static v8::Handle<v8::Value> supplementalMethod2Callback(const v8::Arguments& ar
return toV8(result.release(), args.GetIsolate());
}
fail:
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
#endif // ENABLE(Condition11) || ENABLE(Condition12)
@@ -247,12 +247,12 @@ v8::Handle<v8::Value> V8TestInterface::constructorCallback(const v8::Arguments&
INC_STATS("DOM.TestInterface.Constructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+ return throwTypeError("DOM object constructor cannot be called as a function.");
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
ExceptionCode ec = 0;
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, str1, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
@@ -260,7 +260,7 @@ v8::Handle<v8::Value> V8TestInterface::constructorCallback(const v8::Arguments&
ScriptExecutionContext* context = getScriptExecutionContext();
if (!context)
- return V8Proxy::throwError(V8Proxy::ReferenceError, "TestInterface constructor's associated context is not available", args.GetIsolate());
+ return throwError(ReferenceError, "TestInterface constructor's associated context is not available", args.GetIsolate());
RefPtr<TestInterface> impl = TestInterface::create(context, str1, str2, ec);
v8::Handle<v8::Object> wrapper = args.Holder();
@@ -271,7 +271,7 @@ v8::Handle<v8::Value> V8TestInterface::constructorCallback(const v8::Arguments&
V8DOMWrapper::setJSWrapperForActiveDOMObject(impl.release(), wrapper, args.GetIsolate());
return wrapper;
fail:
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestInterfaceTemplate(v8::Persistent<v8::FunctionTemplate> desc)
@@ -295,10 +295,10 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestInterfaceTemplate(v8:
v8::Handle<v8::FunctionTemplate> supplementalMethod2Argv[supplementalMethod2Argc] = { v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
v8::Handle<v8::Signature> supplementalMethod2Signature = v8::Signature::New(desc, supplementalMethod2Argc, supplementalMethod2Argv);
#if ENABLE(Condition11) || ENABLE(Condition12)
- proto->Set(v8::String::New("supplementalMethod2"), v8::FunctionTemplate::New(TestInterfaceV8Internal::supplementalMethod2Callback, v8Undefined(), supplementalMethod2Signature));
+ proto->Set(v8::String::NewSymbol("supplementalMethod2"), v8::FunctionTemplate::New(TestInterfaceV8Internal::supplementalMethod2Callback, v8Undefined(), supplementalMethod2Signature));
#endif // ENABLE(Condition11) || ENABLE(Condition12)
#if ENABLE(Condition11) || ENABLE(Condition12)
- desc->Set(v8::String::New("supplementalMethod4"), v8::FunctionTemplate::New(TestInterfaceV8Internal::supplementalMethod4Callback, v8Undefined(), v8::Local<v8::Signature>()));
+ desc->Set(v8::String::NewSymbol("supplementalMethod4"), v8::FunctionTemplate::New(TestInterfaceV8Internal::supplementalMethod4Callback, v8Undefined(), v8::Local<v8::Signature>()));
#endif // ENABLE(Condition11) || ENABLE(Condition12)
V8DOMConfiguration::batchConfigureConstants(desc, proto, TestInterfaceConsts, WTF_ARRAY_LENGTH(TestInterfaceConsts));
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
index 265f30879..4d3d95be0 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
@@ -44,7 +44,7 @@ static v8::Handle<v8::Value> methodCallback(const v8::Arguments& args)
{
INC_STATS("DOM.TestMediaQueryListListener.method");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestMediaQueryListListener* imp = V8TestMediaQueryListListener::toNative(args.Holder());
EXCEPTION_BLOCK(RefPtr<MediaQueryListListener>, listener, MediaQueryListListener::create(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
imp->method(listener);
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp
index 6e7c6e26b..78bd8d592 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp
@@ -49,14 +49,14 @@ static v8::Handle<v8::Value> V8TestNamedConstructorConstructorCallback(const v8:
INC_STATS("DOM.TestNamedConstructor.Constructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+ return throwTypeError("DOM object constructor cannot be called as a function.");
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
Frame* frame = currentFrame(BindingState::instance());
if (!frame)
- return V8Proxy::throwError(V8Proxy::ReferenceError, "TestNamedConstructor constructor associated frame is unavailable", args.GetIsolate());
+ return throwError(ReferenceError, "TestNamedConstructor constructor associated frame is unavailable", args.GetIsolate());
Document* document = frame->document();
@@ -65,7 +65,7 @@ static v8::Handle<v8::Value> V8TestNamedConstructorConstructorCallback(const v8:
toV8(document, args.GetIsolate());
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
ExceptionCode ec = 0;
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, str1, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
@@ -81,7 +81,7 @@ static v8::Handle<v8::Value> V8TestNamedConstructorConstructorCallback(const v8:
V8DOMWrapper::setJSWrapperForActiveDOMObject(impl.release(), wrapper, args.GetIsolate());
return wrapper;
fail:
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
v8::Persistent<v8::FunctionTemplate> V8TestNamedConstructorConstructor::GetTemplate()
@@ -95,7 +95,7 @@ v8::Persistent<v8::FunctionTemplate> V8TestNamedConstructorConstructor::GetTempl
v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate();
instance->SetInternalFieldCount(V8TestNamedConstructor::internalFieldCount);
- result->SetClassName(v8::String::New("TestNamedConstructor"));
+ result->SetClassName(v8::String::NewSymbol("TestNamedConstructor"));
result->Inherit(V8TestNamedConstructor::GetTemplate());
cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New(result);
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp
index d58508910..7b380a00a 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp
@@ -47,7 +47,7 @@ v8::Handle<v8::Value> V8TestNode::constructorCallback(const v8::Arguments& args)
INC_STATS("DOM.TestNode.Constructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+ return throwTypeError("DOM object constructor cannot be called as a function.");
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
index b3d775e81..edce97e7a 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
@@ -53,7 +53,6 @@
#include "V8any.h"
#include "V8b.h"
#include "V8bool.h"
-#include "V8c.h"
#include "V8d.h"
#include "V8e.h"
#include <wtf/Float32Array.h>
@@ -441,7 +440,7 @@ static v8::Handle<v8::Value> attrWithGetterExceptionAttrGetter(v8::Local<v8::Str
ExceptionCode ec = 0;
int v = imp->attrWithGetterException(ec);
if (UNLIKELY(ec))
- return V8Proxy::setDOMException(ec, info.GetIsolate());
+ return setDOMException(ec, info.GetIsolate());
return v8Integer(v, info.GetIsolate());
}
@@ -453,7 +452,7 @@ static void attrWithGetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Lo
ExceptionCode ec = 0;
imp->setAttrWithGetterException(v, ec);
if (UNLIKELY(ec))
- V8Proxy::setDOMException(ec, info.GetIsolate());
+ setDOMException(ec, info.GetIsolate());
return;
}
@@ -472,7 +471,7 @@ static void attrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Lo
ExceptionCode ec = 0;
imp->setAttrWithSetterException(v, ec);
if (UNLIKELY(ec))
- V8Proxy::setDOMException(ec, info.GetIsolate());
+ setDOMException(ec, info.GetIsolate());
return;
}
@@ -483,7 +482,7 @@ static v8::Handle<v8::Value> stringAttrWithGetterExceptionAttrGetter(v8::Local<v
ExceptionCode ec = 0;
String v = imp->stringAttrWithGetterException(ec);
if (UNLIKELY(ec))
- return V8Proxy::setDOMException(ec, info.GetIsolate());
+ return setDOMException(ec, info.GetIsolate());
return v8String(v, info.GetIsolate());
}
@@ -495,7 +494,7 @@ static void stringAttrWithGetterExceptionAttrSetter(v8::Local<v8::String> name,
ExceptionCode ec = 0;
imp->setStringAttrWithGetterException(v, ec);
if (UNLIKELY(ec))
- V8Proxy::setDOMException(ec, info.GetIsolate());
+ setDOMException(ec, info.GetIsolate());
return;
}
@@ -514,7 +513,7 @@ static void stringAttrWithSetterExceptionAttrSetter(v8::Local<v8::String> name,
ExceptionCode ec = 0;
imp->setStringAttrWithSetterException(v, ec);
if (UNLIKELY(ec))
- V8Proxy::setDOMException(ec, info.GetIsolate());
+ setDOMException(ec, info.GetIsolate());
return;
}
@@ -574,7 +573,7 @@ static v8::Handle<v8::Value> withScriptStateAttributeRaisesAttrGetter(v8::Local<
return v8Undefined();
RefPtr<TestObj> v = imp->withScriptStateAttributeRaises(state, ec);
if (UNLIKELY(ec))
- return V8Proxy::setDOMException(ec, info.GetIsolate());
+ return setDOMException(ec, info.GetIsolate());
if (state.hadException())
return throwError(state.exception(), info.GetIsolate());
return toV8(v.release(), info.GetIsolate());
@@ -591,7 +590,7 @@ static void withScriptStateAttributeRaisesAttrSetter(v8::Local<v8::String> name,
return;
imp->setWithScriptStateAttributeRaises(state, WTF::getPtr(v), ec);
if (UNLIKELY(ec))
- V8Proxy::setDOMException(ec, info.GetIsolate());
+ setDOMException(ec, info.GetIsolate());
if (state.hadException())
throwError(state.exception(), info.GetIsolate());
return;
@@ -607,7 +606,7 @@ static v8::Handle<v8::Value> withScriptExecutionContextAttributeRaisesAttrGetter
return v8Undefined();
RefPtr<TestObj> v = imp->withScriptExecutionContextAttributeRaises(scriptContext, ec);
if (UNLIKELY(ec))
- return V8Proxy::setDOMException(ec, info.GetIsolate());
+ return setDOMException(ec, info.GetIsolate());
return toV8(v.release(), info.GetIsolate());
}
@@ -622,7 +621,7 @@ static void withScriptExecutionContextAttributeRaisesAttrSetter(v8::Local<v8::St
return;
imp->setWithScriptExecutionContextAttributeRaises(scriptContext, WTF::getPtr(v), ec);
if (UNLIKELY(ec))
- V8Proxy::setDOMException(ec, info.GetIsolate());
+ setDOMException(ec, info.GetIsolate());
return;
}
@@ -669,7 +668,7 @@ static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateAttributeRa
return v8Undefined();
RefPtr<TestObj> v = imp->withScriptExecutionContextAndScriptStateAttributeRaises(state, scriptContext, ec);
if (UNLIKELY(ec))
- return V8Proxy::setDOMException(ec, info.GetIsolate());
+ return setDOMException(ec, info.GetIsolate());
if (state.hadException())
return throwError(state.exception(), info.GetIsolate());
return toV8(v.release(), info.GetIsolate());
@@ -689,7 +688,7 @@ static void withScriptExecutionContextAndScriptStateAttributeRaisesAttrSetter(v8
return;
imp->setWithScriptExecutionContextAndScriptStateAttributeRaises(state, scriptContext, WTF::getPtr(v), ec);
if (UNLIKELY(ec))
- V8Proxy::setDOMException(ec, info.GetIsolate());
+ setDOMException(ec, info.GetIsolate());
if (state.hadException())
throwError(state.exception(), info.GetIsolate());
return;
@@ -1080,7 +1079,7 @@ static v8::Handle<v8::Value> voidMethodWithArgsCallback(const v8::Arguments& arg
{
INC_STATS("DOM.TestObj.voidMethodWithArgs");
if (args.Length() < 3)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(long long, Arg, toInt64(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
@@ -1100,7 +1099,7 @@ static v8::Handle<v8::Value> MethodWithArgsCallback(const v8::Arguments& args)
{
INC_STATS("DOM.TestObj.MethodWithArgs");
if (args.Length() < 3)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(long long, Arg, toInt64(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
@@ -1119,7 +1118,7 @@ static v8::Handle<v8::Value> objMethodWithArgsCallback(const v8::Arguments& args
{
INC_STATS("DOM.TestObj.objMethodWithArgs");
if (args.Length() < 3)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(long long, Arg, toInt64(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
@@ -1131,7 +1130,7 @@ static v8::Handle<v8::Value> methodWithSequenceArgCallback(const v8::Arguments&
{
INC_STATS("DOM.TestObj.methodWithSequenceArg");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(Vector<ScriptProfile>, sequenceArg, toNativeArray<ScriptProfile>(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
imp->methodWithSequenceArg(sequenceArg);
@@ -1142,7 +1141,7 @@ static v8::Handle<v8::Value> methodReturningSequenceCallback(const v8::Arguments
{
INC_STATS("DOM.TestObj.methodReturningSequence");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(long long, Arg, toInt64(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
return v8Array(imp->methodReturningSequence(Arg), args.GetIsolate());
@@ -1152,7 +1151,7 @@ static v8::Handle<v8::Value> methodThatRequiresAllArgsAndThrowsCallback(const v8
{
INC_STATS("DOM.TestObj.methodThatRequiresAllArgsAndThrows");
if (args.Length() < 2)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
ExceptionCode ec = 0;
{
@@ -1164,14 +1163,14 @@ static v8::Handle<v8::Value> methodThatRequiresAllArgsAndThrowsCallback(const v8
return toV8(result.release(), args.GetIsolate());
}
fail:
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
static v8::Handle<v8::Value> serializedValueCallback(const v8::Arguments& args)
{
INC_STATS("DOM.TestObj.serializedValue");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
bool serializedArgDidThrow = false;
RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(args[0], 0, 0, serializedArgDidThrow, args.GetIsolate());
@@ -1185,7 +1184,7 @@ static v8::Handle<v8::Value> idbKeyCallback(const v8::Arguments& args)
{
INC_STATS("DOM.TestObj.idbKey");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(RefPtr<IDBKey>, key, createIDBKeyFromValue(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
imp->idbKey(key.get());
@@ -1196,18 +1195,18 @@ static v8::Handle<v8::Value> optionsObjectCallback(const v8::Arguments& args)
{
INC_STATS("DOM.TestObj.optionsObject");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(Dictionary, oo, Dictionary(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined), args.GetIsolate()));
if (!oo.isUndefinedOrNull() && !oo.isObject())
- return V8Proxy::throwTypeError("Not an object.", args.GetIsolate());
+ return throwTypeError("Not an object.", args.GetIsolate());
if (args.Length() <= 1) {
imp->optionsObject(oo);
return v8Undefined();
}
EXCEPTION_BLOCK(Dictionary, ooo, Dictionary(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined), args.GetIsolate()));
if (!ooo.isUndefinedOrNull() && !ooo.isObject())
- return V8Proxy::throwTypeError("Not an object.", args.GetIsolate());
+ return throwTypeError("Not an object.", args.GetIsolate());
imp->optionsObject(oo, ooo);
return v8Undefined();
}
@@ -1224,7 +1223,7 @@ static v8::Handle<v8::Value> methodWithExceptionCallback(const v8::Arguments& ar
return v8Undefined();
}
fail:
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
static v8::Handle<v8::Value> addEventListenerCallback(const v8::Arguments& args)
@@ -1232,7 +1231,7 @@ static v8::Handle<v8::Value> addEventListenerCallback(const v8::Arguments& args)
INC_STATS("DOM.TestObj.addEventListener()");
RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOrCreate);
if (listener) {
- V8TestObj::toNative(args.Holder())->addEventListener(v8ValueToAtomicWebCoreString(args[0]), listener, args[2]->BooleanValue());
+ V8TestObj::toNative(args.Holder())->addEventListener(toWebCoreAtomicString(args[0]), listener, args[2]->BooleanValue());
createHiddenDependency(args.Holder(), args[1], V8TestObj::eventListenerCacheIndex);
}
return v8Undefined();
@@ -1243,7 +1242,7 @@ static v8::Handle<v8::Value> removeEventListenerCallback(const v8::Arguments& ar
INC_STATS("DOM.TestObj.removeEventListener()");
RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOnly);
if (listener) {
- V8TestObj::toNative(args.Holder())->removeEventListener(v8ValueToAtomicWebCoreString(args[0]), listener.get(), args[2]->BooleanValue());
+ V8TestObj::toNative(args.Holder())->removeEventListener(toWebCoreAtomicString(args[0]), listener.get(), args[2]->BooleanValue());
removeHiddenDependency(args.Holder(), args[1], V8TestObj::eventListenerCacheIndex);
}
return v8Undefined();
@@ -1286,7 +1285,7 @@ static v8::Handle<v8::Value> withScriptStateVoidExceptionCallback(const v8::Argu
return v8Undefined();
}
fail:
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
static v8::Handle<v8::Value> withScriptStateObjExceptionCallback(const v8::Arguments& args)
@@ -1304,7 +1303,7 @@ static v8::Handle<v8::Value> withScriptStateObjExceptionCallback(const v8::Argum
return toV8(result.release(), args.GetIsolate());
}
fail:
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
static v8::Handle<v8::Value> withScriptExecutionContextCallback(const v8::Arguments& args)
@@ -1350,7 +1349,7 @@ static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateObjExceptio
return toV8(result.release(), args.GetIsolate());
}
fail:
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateWithSpacesCallback(const v8::Arguments& args)
@@ -1396,7 +1395,7 @@ static v8::Handle<v8::Value> methodWithNonOptionalArgAndOptionalArgCallback(cons
{
INC_STATS("DOM.TestObj.methodWithNonOptionalArgAndOptionalArg");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(int, nonOpt, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
if (args.Length() <= 1) {
@@ -1412,7 +1411,7 @@ static v8::Handle<v8::Value> methodWithNonOptionalArgAndTwoOptionalArgsCallback(
{
INC_STATS("DOM.TestObj.methodWithNonOptionalArgAndTwoOptionalArgs");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(int, nonOpt, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
if (args.Length() <= 1) {
@@ -1464,10 +1463,10 @@ static v8::Handle<v8::Value> methodWithCallbackArgCallback(const v8::Arguments&
{
INC_STATS("DOM.TestObj.methodWithCallbackArg");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
if (args.Length() <= 0 || !args[0]->IsFunction())
- return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
+ return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExecutionContext());
imp->methodWithCallbackArg(callback);
return v8Undefined();
@@ -1477,11 +1476,11 @@ static v8::Handle<v8::Value> methodWithNonCallbackArgAndCallbackArgCallback(cons
{
INC_STATS("DOM.TestObj.methodWithNonCallbackArgAndCallbackArg");
if (args.Length() < 2)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(int, nonCallback, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
if (args.Length() <= 1 || !args[1]->IsFunction())
- return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
+ return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
RefPtr<TestCallback> callback = V8TestCallback::create(args[1], getScriptExecutionContext());
imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback);
return v8Undefined();
@@ -1494,7 +1493,7 @@ static v8::Handle<v8::Value> methodWithCallbackAndOptionalArgCallback(const v8::
RefPtr<TestCallback> callback;
if (args.Length() > 0 && !args[0]->IsNull() && !args[0]->IsUndefined()) {
if (!args[0]->IsFunction())
- return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
+ return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
callback = V8TestCallback::create(args[0], getScriptExecutionContext());
}
imp->methodWithCallbackAndOptionalArg(callback);
@@ -1540,7 +1539,7 @@ static v8::Handle<v8::Value> overloadedMethod1Callback(const v8::Arguments& args
{
INC_STATS("DOM.TestObj.overloadedMethod1");
if (args.Length() < 2)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(TestObj*, objArg, V8TestObj::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
@@ -1552,7 +1551,7 @@ static v8::Handle<v8::Value> overloadedMethod2Callback(const v8::Arguments& args
{
INC_STATS("DOM.TestObj.overloadedMethod2");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(TestObj*, objArg, V8TestObj::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
if (args.Length() <= 1) {
@@ -1568,7 +1567,7 @@ static v8::Handle<v8::Value> overloadedMethod3Callback(const v8::Arguments& args
{
INC_STATS("DOM.TestObj.overloadedMethod3");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
imp->overloadedMethod(strArg);
@@ -1579,7 +1578,7 @@ static v8::Handle<v8::Value> overloadedMethod4Callback(const v8::Arguments& args
{
INC_STATS("DOM.TestObj.overloadedMethod4");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(long long, Arg, toInt64(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
imp->overloadedMethod(Arg);
@@ -1590,10 +1589,10 @@ static v8::Handle<v8::Value> overloadedMethod5Callback(const v8::Arguments& args
{
INC_STATS("DOM.TestObj.overloadedMethod5");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
if (args.Length() <= 0 || !args[0]->IsFunction())
- return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
+ return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExecutionContext());
imp->overloadedMethod(callback);
return v8Undefined();
@@ -1603,9 +1602,9 @@ static v8::Handle<v8::Value> overloadedMethod6Callback(const v8::Arguments& args
{
INC_STATS("DOM.TestObj.overloadedMethod6");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
- EXCEPTION_BLOCK(RefPtr<DOMStringList>, listArg, v8ValueToWebCoreDOMStringList(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
+ EXCEPTION_BLOCK(RefPtr<DOMStringList>, listArg, toDOMStringList(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
imp->overloadedMethod(listArg);
return v8Undefined();
}
@@ -1614,9 +1613,9 @@ static v8::Handle<v8::Value> overloadedMethod7Callback(const v8::Arguments& args
{
INC_STATS("DOM.TestObj.overloadedMethod7");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
- EXCEPTION_BLOCK(RefPtr<DOMStringList>, arrayArg, v8ValueToWebCoreDOMStringList(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
+ EXCEPTION_BLOCK(RefPtr<DOMStringList>, arrayArg, toDOMStringList(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
imp->overloadedMethod(arrayArg);
return v8Undefined();
}
@@ -1625,7 +1624,7 @@ static v8::Handle<v8::Value> overloadedMethod8Callback(const v8::Arguments& args
{
INC_STATS("DOM.TestObj.overloadedMethod8");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(TestObj*, objArg, V8TestObj::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
imp->overloadedMethod(objArg);
@@ -1636,9 +1635,9 @@ static v8::Handle<v8::Value> overloadedMethod9Callback(const v8::Arguments& args
{
INC_STATS("DOM.TestObj.overloadedMethod9");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
- EXCEPTION_BLOCK(RefPtr<DOMStringList>, arrayArg, v8ValueToWebCoreDOMStringList(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
+ EXCEPTION_BLOCK(RefPtr<DOMStringList>, arrayArg, toDOMStringList(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
imp->overloadedMethod(arrayArg);
return v8Undefined();
}
@@ -1647,7 +1646,7 @@ static v8::Handle<v8::Value> overloadedMethod10Callback(const v8::Arguments& arg
{
INC_STATS("DOM.TestObj.overloadedMethod10");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(Vector<unsigned long>, arrayArg, toNativeArray<unsigned long>(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
imp->overloadedMethod(arrayArg);
@@ -1677,7 +1676,7 @@ static v8::Handle<v8::Value> overloadedMethodCallback(const v8::Arguments& args)
return overloadedMethod9Callback(args);
if ((args.Length() == 1 && (args[0]->IsArray())))
return overloadedMethod10Callback(args);
- return V8Proxy::throwTypeError(0, args.GetIsolate());
+ return throwTypeError(0, args.GetIsolate());
}
static v8::Handle<v8::Value> classMethodCallback(const v8::Arguments& args)
@@ -1703,7 +1702,7 @@ static v8::Handle<v8::Value> overloadedMethod11Callback(const v8::Arguments& arg
{
INC_STATS("DOM.TestObj.overloadedMethod11");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
EXCEPTION_BLOCK(int, arg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
TestObj::overloadedMethod1(arg);
return v8Undefined();
@@ -1717,7 +1716,7 @@ static v8::Handle<v8::Value> overloadedMethod12Callback(const v8::Arguments& arg
{
INC_STATS("DOM.TestObj.overloadedMethod12");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, type, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
TestObj::overloadedMethod1(type);
return v8Undefined();
@@ -1734,7 +1733,7 @@ static v8::Handle<v8::Value> overloadedMethod1Callback(const v8::Arguments& args
return overloadedMethod11Callback(args);
if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsUndefined() || args[0]->IsString() || args[0]->IsObject())))
return overloadedMethod12Callback(args);
- return V8Proxy::throwTypeError(0, args.GetIsolate());
+ return throwTypeError(0, args.GetIsolate());
}
#endif // ENABLE(Condition1)
@@ -1743,7 +1742,7 @@ static v8::Handle<v8::Value> classMethodWithClampCallback(const v8::Arguments& a
{
INC_STATS("DOM.TestObj.classMethodWithClamp");
if (args.Length() < 2)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
unsigned short objArgsShort = 0;
EXCEPTION_BLOCK(double, objArgsShortNativeValue, args[0]->NumberValue());
@@ -1761,7 +1760,7 @@ static v8::Handle<v8::Value> enabledAtRuntimeMethod1Callback(const v8::Arguments
{
INC_STATS("DOM.TestObj.enabledAtRuntimeMethod1");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(long long, Arg, toInt64(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
imp->enabledAtRuntimeMethod1(Arg);
@@ -1772,7 +1771,7 @@ static v8::Handle<v8::Value> enabledAtRuntimeMethod2Callback(const v8::Arguments
{
INC_STATS("DOM.TestObj.enabledAtRuntimeMethod2");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(long long, Arg, toInt64(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
imp->enabledAtRuntimeMethod2(Arg);
@@ -1783,7 +1782,7 @@ static v8::Handle<v8::Value> enabledPerContextMethod1Callback(const v8::Argument
{
INC_STATS("DOM.TestObj.enabledPerContextMethod1");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(long long, Arg, toInt64(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
imp->enabledPerContextMethod1(Arg);
@@ -1794,7 +1793,7 @@ static v8::Handle<v8::Value> enabledPerContextMethod2Callback(const v8::Argument
{
INC_STATS("DOM.TestObj.enabledPerContextMethod2");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(long long, Arg, toInt64(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
imp->enabledPerContextMethod2(Arg);
@@ -1805,18 +1804,18 @@ static v8::Handle<v8::Value> stringArrayFunctionCallback(const v8::Arguments& ar
{
INC_STATS("DOM.TestObj.stringArrayFunction");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
ExceptionCode ec = 0;
{
- EXCEPTION_BLOCK(RefPtr<DOMStringList>, values, v8ValueToWebCoreDOMStringList(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
+ EXCEPTION_BLOCK(RefPtr<DOMStringList>, values, toDOMStringList(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
RefPtr<DOMStringList> result = imp->stringArrayFunction(values, ec);
if (UNLIKELY(ec))
goto fail;
return v8Array(result.release(), args.GetIsolate());
}
fail:
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
static v8::Handle<v8::Value> getSVGDocumentCallback(const v8::Arguments& args)
@@ -1833,14 +1832,14 @@ static v8::Handle<v8::Value> getSVGDocumentCallback(const v8::Arguments& args)
return toV8(result.release(), args.GetIsolate());
}
fail:
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
static v8::Handle<v8::Value> convert1Callback(const v8::Arguments& args)
{
INC_STATS("DOM.TestObj.convert1");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(a*, , V8a::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8a::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
imp->convert1();
@@ -1851,29 +1850,18 @@ static v8::Handle<v8::Value> convert2Callback(const v8::Arguments& args)
{
INC_STATS("DOM.TestObj.convert2");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(b*, , V8b::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8b::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
imp->convert2();
return v8Undefined();
}
-static v8::Handle<v8::Value> convert3Callback(const v8::Arguments& args)
-{
- INC_STATS("DOM.TestObj.convert3");
- if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
- TestObj* imp = V8TestObj::toNative(args.Holder());
- EXCEPTION_BLOCK(c*, , V8c::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8c::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
- imp->convert3();
- return v8Undefined();
-}
-
static v8::Handle<v8::Value> convert4Callback(const v8::Arguments& args)
{
INC_STATS("DOM.TestObj.convert4");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(d*, , V8d::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8d::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
imp->convert4();
@@ -1884,7 +1872,7 @@ static v8::Handle<v8::Value> convert5Callback(const v8::Arguments& args)
{
INC_STATS("DOM.TestObj.convert5");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
EXCEPTION_BLOCK(e*, , V8e::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8e::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
imp->convert5();
@@ -1917,7 +1905,7 @@ static v8::Handle<v8::Value> strictFunctionCallback(const v8::Arguments& args)
{
INC_STATS("DOM.TestObj.strictFunction");
if (args.Length() < 3)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestObj* imp = V8TestObj::toNative(args.Holder());
ExceptionCode ec = 0;
{
@@ -1930,7 +1918,7 @@ static v8::Handle<v8::Value> strictFunctionCallback(const v8::Arguments& args)
return toV8(result.release(), args.GetIsolate());
}
fail:
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
} // namespace TestObjV8Internal
@@ -2154,14 +2142,14 @@ v8::Handle<v8::Value> V8TestObj::constructorCallback(const v8::Arguments& args)
INC_STATS("DOM.TestObj.Constructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+ return throwTypeError("DOM object constructor cannot be called as a function.");
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
if (args.Length() <= 0 || !args[0]->IsFunction())
- return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
+ return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
RefPtr<TestCallback> testCallback = V8TestCallback::create(args[0], getScriptExecutionContext());
RefPtr<TestObj> impl = TestObj::create(testCallback);
@@ -2204,71 +2192,65 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persi
const int voidMethodWithArgsArgc = 3;
v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
v8::Handle<v8::Signature> voidMethodWithArgsSignature = v8::Signature::New(desc, voidMethodWithArgsArgc, voidMethodWithArgsArgv);
- proto->Set(v8::String::New("voidMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::voidMethodWithArgsCallback, v8Undefined(), voidMethodWithArgsSignature));
+ proto->Set(v8::String::NewSymbol("voidMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::voidMethodWithArgsCallback, v8Undefined(), voidMethodWithArgsSignature));
// Custom Signature 'MethodWithArgs'
const int MethodWithArgsArgc = 3;
v8::Handle<v8::FunctionTemplate> MethodWithArgsArgv[MethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
v8::Handle<v8::Signature> MethodWithArgsSignature = v8::Signature::New(desc, MethodWithArgsArgc, MethodWithArgsArgv);
- proto->Set(v8::String::New("MethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::MethodWithArgsCallback, v8Undefined(), MethodWithArgsSignature));
+ proto->Set(v8::String::NewSymbol("MethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::MethodWithArgsCallback, v8Undefined(), MethodWithArgsSignature));
// Custom Signature 'objMethodWithArgs'
const int objMethodWithArgsArgc = 3;
v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
v8::Handle<v8::Signature> objMethodWithArgsSignature = v8::Signature::New(desc, objMethodWithArgsArgc, objMethodWithArgsArgv);
- proto->Set(v8::String::New("objMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::objMethodWithArgsCallback, v8Undefined(), objMethodWithArgsSignature));
+ proto->Set(v8::String::NewSymbol("objMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::objMethodWithArgsCallback, v8Undefined(), objMethodWithArgsSignature));
// Custom Signature 'methodWithSequenceArg'
const int methodWithSequenceArgArgc = 1;
v8::Handle<v8::FunctionTemplate> methodWithSequenceArgArgv[methodWithSequenceArgArgc] = { V8sequence<ScriptProfile>::GetRawTemplate() };
v8::Handle<v8::Signature> methodWithSequenceArgSignature = v8::Signature::New(desc, methodWithSequenceArgArgc, methodWithSequenceArgArgv);
- proto->Set(v8::String::New("methodWithSequenceArg"), v8::FunctionTemplate::New(TestObjV8Internal::methodWithSequenceArgCallback, v8Undefined(), methodWithSequenceArgSignature));
+ proto->Set(v8::String::NewSymbol("methodWithSequenceArg"), v8::FunctionTemplate::New(TestObjV8Internal::methodWithSequenceArgCallback, v8Undefined(), methodWithSequenceArgSignature));
// Custom Signature 'methodThatRequiresAllArgsAndThrows'
const int methodThatRequiresAllArgsAndThrowsArgc = 2;
v8::Handle<v8::FunctionTemplate> methodThatRequiresAllArgsAndThrowsArgv[methodThatRequiresAllArgsAndThrowsArgc] = { v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
v8::Handle<v8::Signature> methodThatRequiresAllArgsAndThrowsSignature = v8::Signature::New(desc, methodThatRequiresAllArgsAndThrowsArgc, methodThatRequiresAllArgsAndThrowsArgv);
- proto->Set(v8::String::New("methodThatRequiresAllArgsAndThrows"), v8::FunctionTemplate::New(TestObjV8Internal::methodThatRequiresAllArgsAndThrowsCallback, v8Undefined(), methodThatRequiresAllArgsAndThrowsSignature));
- desc->Set(v8::String::New("classMethod"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodCallback, v8Undefined(), v8::Local<v8::Signature>()));
- desc->Set(v8::String::New("classMethodWithOptional"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodWithOptionalCallback, v8Undefined(), v8::Local<v8::Signature>()));
- desc->Set(v8::String::New("classMethod2"), v8::FunctionTemplate::New(V8TestObj::classMethod2Callback, v8Undefined(), v8::Local<v8::Signature>()));
+ proto->Set(v8::String::NewSymbol("methodThatRequiresAllArgsAndThrows"), v8::FunctionTemplate::New(TestObjV8Internal::methodThatRequiresAllArgsAndThrowsCallback, v8Undefined(), methodThatRequiresAllArgsAndThrowsSignature));
+ desc->Set(v8::String::NewSymbol("classMethod"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodCallback, v8Undefined(), v8::Local<v8::Signature>()));
+ desc->Set(v8::String::NewSymbol("classMethodWithOptional"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodWithOptionalCallback, v8Undefined(), v8::Local<v8::Signature>()));
+ desc->Set(v8::String::NewSymbol("classMethod2"), v8::FunctionTemplate::New(V8TestObj::classMethod2Callback, v8Undefined(), v8::Local<v8::Signature>()));
#if ENABLE(Condition1)
- desc->Set(v8::String::New("overloadedMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::overloadedMethod1Callback, v8Undefined(), v8::Local<v8::Signature>()));
+ desc->Set(v8::String::NewSymbol("overloadedMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::overloadedMethod1Callback, v8Undefined(), v8::Local<v8::Signature>()));
#endif // ENABLE(Condition1)
if (RuntimeEnabledFeatures::enabledAtRuntimeMethod1Enabled())
- proto->Set(v8::String::New("enabledAtRuntimeMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod1Callback, v8Undefined(), defaultSignature));
+ proto->Set(v8::String::NewSymbol("enabledAtRuntimeMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod1Callback, v8Undefined(), defaultSignature));
if (RuntimeEnabledFeatures::featureNameEnabled())
- proto->Set(v8::String::New("enabledAtRuntimeMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod2Callback, v8Undefined(), defaultSignature));
+ proto->Set(v8::String::NewSymbol("enabledAtRuntimeMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod2Callback, v8Undefined(), defaultSignature));
// Custom Signature 'convert1'
const int convert1Argc = 1;
v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8a::GetRawTemplate() };
v8::Handle<v8::Signature> convert1Signature = v8::Signature::New(desc, convert1Argc, convert1Argv);
- proto->Set(v8::String::New("convert1"), v8::FunctionTemplate::New(TestObjV8Internal::convert1Callback, v8Undefined(), convert1Signature));
+ proto->Set(v8::String::NewSymbol("convert1"), v8::FunctionTemplate::New(TestObjV8Internal::convert1Callback, v8Undefined(), convert1Signature));
// Custom Signature 'convert2'
const int convert2Argc = 1;
v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8b::GetRawTemplate() };
v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(desc, convert2Argc, convert2Argv);
- proto->Set(v8::String::New("convert2"), v8::FunctionTemplate::New(TestObjV8Internal::convert2Callback, v8Undefined(), convert2Signature));
-
- // Custom Signature 'convert3'
- const int convert3Argc = 1;
- v8::Handle<v8::FunctionTemplate> convert3Argv[convert3Argc] = { V8c::GetRawTemplate() };
- v8::Handle<v8::Signature> convert3Signature = v8::Signature::New(desc, convert3Argc, convert3Argv);
- proto->Set(v8::String::New("convert3"), v8::FunctionTemplate::New(TestObjV8Internal::convert3Callback, v8Undefined(), convert3Signature));
+ proto->Set(v8::String::NewSymbol("convert2"), v8::FunctionTemplate::New(TestObjV8Internal::convert2Callback, v8Undefined(), convert2Signature));
// Custom Signature 'convert4'
const int convert4Argc = 1;
v8::Handle<v8::FunctionTemplate> convert4Argv[convert4Argc] = { V8d::GetRawTemplate() };
v8::Handle<v8::Signature> convert4Signature = v8::Signature::New(desc, convert4Argc, convert4Argv);
- proto->Set(v8::String::New("convert4"), v8::FunctionTemplate::New(TestObjV8Internal::convert4Callback, v8Undefined(), convert4Signature));
+ proto->Set(v8::String::NewSymbol("convert4"), v8::FunctionTemplate::New(TestObjV8Internal::convert4Callback, v8Undefined(), convert4Signature));
// Custom Signature 'convert5'
const int convert5Argc = 1;
v8::Handle<v8::FunctionTemplate> convert5Argv[convert5Argc] = { V8e::GetRawTemplate() };
v8::Handle<v8::Signature> convert5Signature = v8::Signature::New(desc, convert5Argc, convert5Argv);
- proto->Set(v8::String::New("convert5"), v8::FunctionTemplate::New(TestObjV8Internal::convert5Callback, v8Undefined(), convert5Signature));
+ proto->Set(v8::String::NewSymbol("convert5"), v8::FunctionTemplate::New(TestObjV8Internal::convert5Callback, v8Undefined(), convert5Signature));
V8DOMConfiguration::batchConfigureConstants(desc, proto, TestObjConsts, WTF_ARRAY_LENGTH(TestObjConsts));
// Custom toString template
@@ -2328,10 +2310,10 @@ void V8TestObj::installPerContextProperties(v8::Handle<v8::Object> instance, Tes
v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate());
UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
if (ContextFeatures::enabledPerContextMethod1Enabled(impl->document())) {
- proto->Set(v8::String::New("enabledPerContextMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethod1Callback, v8Undefined(), defaultSignature)->GetFunction());
+ proto->Set(v8::String::NewSymbol("enabledPerContextMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethod1Callback, v8Undefined(), defaultSignature)->GetFunction());
}
if (ContextFeatures::featureNameEnabled(impl->document())) {
- proto->Set(v8::String::New("enabledPerContextMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethod2Callback, v8Undefined(), defaultSignature)->GetFunction());
+ proto->Set(v8::String::NewSymbol("enabledPerContextMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethod2Callback, v8Undefined(), defaultSignature)->GetFunction());
}
}
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
index a61c8aeca..71f0a378b 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
@@ -124,13 +124,13 @@ static v8::Handle<v8::Value> acceptTransferListCallback(const v8::Arguments& arg
{
INC_STATS("DOM.TestSerializedScriptValueInterface.acceptTransferList");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
TestSerializedScriptValueInterface* imp = V8TestSerializedScriptValueInterface::toNative(args.Holder());
MessagePortArray messagePortArrayTransferList;
ArrayBufferArray arrayBufferArrayTransferList;
if (args.Length() > 1) {
if (!extractTransferables(args[1], messagePortArrayTransferList, arrayBufferArrayTransferList, args.GetIsolate()))
- return V8Proxy::throwTypeError("Could not extract transferables");
+ return throwTypeError("Could not extract transferables");
}
bool dataDidThrow = false;
RefPtr<SerializedScriptValue> data = SerializedScriptValue::create(args[0], &messagePortArrayTransferList, &arrayBufferArrayTransferList, dataDidThrow, args.GetIsolate());
@@ -156,7 +156,7 @@ static v8::Handle<v8::Value> multiTransferListCallback(const v8::Arguments& args
ArrayBufferArray arrayBufferArrayTx;
if (args.Length() > 1) {
if (!extractTransferables(args[1], messagePortArrayTx, arrayBufferArrayTx, args.GetIsolate()))
- return V8Proxy::throwTypeError("Could not extract transferables");
+ return throwTypeError("Could not extract transferables");
}
bool firstDidThrow = false;
RefPtr<SerializedScriptValue> first = SerializedScriptValue::create(args[0], &messagePortArrayTx, &arrayBufferArrayTx, firstDidThrow, args.GetIsolate());
@@ -174,7 +174,7 @@ static v8::Handle<v8::Value> multiTransferListCallback(const v8::Arguments& args
ArrayBufferArray arrayBufferArrayTxx;
if (args.Length() > 3) {
if (!extractTransferables(args[3], messagePortArrayTxx, arrayBufferArrayTxx, args.GetIsolate()))
- return V8Proxy::throwTypeError("Could not extract transferables");
+ return throwTypeError("Could not extract transferables");
}
bool secondDidThrow = false;
RefPtr<SerializedScriptValue> second = SerializedScriptValue::create(args[2], &messagePortArrayTxx, &arrayBufferArrayTxx, secondDidThrow, args.GetIsolate());
@@ -213,18 +213,18 @@ v8::Handle<v8::Value> V8TestSerializedScriptValueInterface::constructorCallback(
INC_STATS("DOM.TestSerializedScriptValueInterface.Constructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+ return throwTypeError("DOM object constructor cannot be called as a function.");
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
if (args.Length() < 2)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, hello, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
MessagePortArray messagePortArrayTransferList;
ArrayBufferArray arrayBufferArrayTransferList;
if (args.Length() > 2) {
if (!extractTransferables(args[2], messagePortArrayTransferList, arrayBufferArrayTransferList, args.GetIsolate()))
- return V8Proxy::throwTypeError("Could not extract transferables");
+ return throwTypeError("Could not extract transferables");
}
bool dataDidThrow = false;
RefPtr<SerializedScriptValue> data = SerializedScriptValue::create(args[1], &messagePortArrayTransferList, &arrayBufferArrayTransferList, dataDidThrow, args.GetIsolate());
diff --git a/Source/WebCore/bindings/v8/BindingState.cpp b/Source/WebCore/bindings/v8/BindingState.cpp
index 8809e4d4f..a8e3e6933 100644
--- a/Source/WebCore/bindings/v8/BindingState.cpp
+++ b/Source/WebCore/bindings/v8/BindingState.cpp
@@ -31,9 +31,10 @@
#include "config.h"
#include "BindingState.h"
+#include "DOMWindow.h"
#include "Frame.h"
#include "ScriptController.h"
-#include "V8Proxy.h"
+#include "V8Binding.h"
#include <wtf/StdLibExtras.h>
namespace WebCore {
@@ -57,12 +58,12 @@ static v8::Handle<v8::Context> activeContext()
DOMWindow* activeDOMWindow(BindingState*)
{
- return V8Proxy::retrieveWindow(activeContext());
+ return toDOMWindow(activeContext());
}
DOMWindow* firstDOMWindow(BindingState*)
{
- return V8Proxy::retrieveWindow(v8::Context::GetEntered());
+ return toDOMWindow(v8::Context::GetEntered());
}
Frame* activeFrame(BindingState*)
@@ -70,7 +71,7 @@ Frame* activeFrame(BindingState*)
v8::Handle<v8::Context> context = activeContext();
if (context.IsEmpty())
return 0;
- return V8Proxy::retrieveFrame(context);
+ return toFrameIfNotDetached(context);
}
Frame* firstFrame(BindingState*)
@@ -78,7 +79,7 @@ Frame* firstFrame(BindingState*)
v8::Handle<v8::Context> context = v8::Context::GetEntered();
if (context.IsEmpty())
return 0;
- return V8Proxy::retrieveFrame(context);
+ return toFrameIfNotDetached(context);
}
Frame* currentFrame(BindingState*)
@@ -86,7 +87,15 @@ Frame* currentFrame(BindingState*)
v8::Handle<v8::Context> context = v8::Context::GetCurrent();
if (context.IsEmpty())
return 0;
- return V8Proxy::retrieveFrame(context);
+ return toFrameIfNotDetached(context);
+}
+
+Document* currentDocument(BindingState*)
+{
+ DOMWindow* current = toDOMWindow(v8::Context::GetCurrent());
+ if (!current)
+ return 0;
+ return current->document();
}
void immediatelyReportUnsafeAccessTo(BindingState*, Document* targetDocument)
diff --git a/Source/WebCore/bindings/v8/BindingState.h b/Source/WebCore/bindings/v8/BindingState.h
index d354be263..e2531ade4 100644
--- a/Source/WebCore/bindings/v8/BindingState.h
+++ b/Source/WebCore/bindings/v8/BindingState.h
@@ -53,6 +53,7 @@ Frame* firstFrame(BindingState*);
// FIXME: When implementing this function for JSC, we need to understand if there
// are any subtle differences between the currentFrame and the lexicalGlobalObject.
Frame* currentFrame(BindingState*);
+Document* currentDocument(BindingState*);
void immediatelyReportUnsafeAccessTo(BindingState*, Document* targetDocument);
diff --git a/Source/WebCore/bindings/v8/DOMTransaction.cpp b/Source/WebCore/bindings/v8/DOMTransaction.cpp
new file mode 100644
index 000000000..08919c267
--- /dev/null
+++ b/Source/WebCore/bindings/v8/DOMTransaction.cpp
@@ -0,0 +1,121 @@
+/*
+ * 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 GOOGLE 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 GOOGLE 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 "DOMTransaction.h"
+
+#if ENABLE(UNDO_MANAGER)
+
+#include "Frame.h"
+#include "UndoManager.h"
+#include "V8DOMTransaction.h"
+#include "V8HiddenPropertyName.h"
+#include "V8UndoManager.h"
+
+namespace WebCore {
+
+DOMTransaction::DOMTransaction(const WorldContextHandle& worldContext)
+ : m_worldContext(worldContext)
+ , m_undoManager(0)
+{
+}
+
+PassRefPtr<DOMTransaction> DOMTransaction::create(const WorldContextHandle& worldContext)
+{
+ return adoptRef(new DOMTransaction(worldContext));
+}
+
+void DOMTransaction::apply()
+{
+ m_isAutomatic = !getFunction("executeAutomatic").IsEmpty();
+ if (!m_isAutomatic)
+ callFunction("execute");
+}
+
+void DOMTransaction::unapply()
+{
+ if (!m_isAutomatic)
+ callFunction("undo");
+
+ if (m_undoManager)
+ m_undoManager->registerRedoStep(this);
+}
+
+void DOMTransaction::reapply()
+{
+ if (!m_isAutomatic)
+ callFunction("redo");
+
+ if (m_undoManager)
+ m_undoManager->registerUndoStep(this);
+}
+
+v8::Handle<v8::Function> DOMTransaction::getFunction(const char* propertyName)
+{
+ v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(toV8(this));
+ if (wrapper.IsEmpty())
+ return v8::Handle<v8::Function>();
+
+ v8::Local<v8::Value> data = wrapper->GetHiddenValue(V8HiddenPropertyName::domTransactionData());
+ if (data.IsEmpty() || !data->IsObject())
+ return v8::Handle<v8::Function>();
+
+ v8::Local<v8::Value> function = v8::Local<v8::Object>::Cast(data)->Get(v8::String::NewSymbol(propertyName));
+ if (function.IsEmpty() || !function->IsFunction())
+ return v8::Handle<v8::Function>();
+
+ return v8::Handle<v8::Function>::Cast(function);
+}
+
+void DOMTransaction::callFunction(const char* propertyName)
+{
+ if (!m_undoManager || !m_undoManager->undoScopeHost())
+ return;
+
+ Document* document = m_undoManager->undoScopeHost()->document();
+ if (!document)
+ return;
+
+ Frame* frame = document->frame();
+ if (!frame || !frame->script()->canExecuteScripts(AboutToExecuteScript))
+ return;
+
+ v8::Handle<v8::Function> function = getFunction(propertyName);
+ if (function.IsEmpty())
+ return;
+
+ v8::Local<v8::Context> v8Context = m_worldContext.adjustedContext(frame->script());
+ if (v8Context.IsEmpty())
+ return;
+
+ v8::Handle<v8::Object> receiver = v8::Handle<v8::Object>::Cast(toV8(m_undoManager));
+ if (receiver.IsEmpty())
+ return;
+ v8::Handle<v8::Value> parameters[0] = { };
+ frame->script()->callFunction(function, receiver, 0, parameters);
+}
+
+}
+
+#endif
diff --git a/Source/WebCore/bindings/v8/DOMTransaction.h b/Source/WebCore/bindings/v8/DOMTransaction.h
new file mode 100644
index 000000000..a967c5a58
--- /dev/null
+++ b/Source/WebCore/bindings/v8/DOMTransaction.h
@@ -0,0 +1,66 @@
+/*
+ * 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 GOOGLE 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 GOOGLE 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 DOMTransaction_h
+#define DOMTransaction_h
+
+#if ENABLE(UNDO_MANAGER)
+
+#include "UndoStep.h"
+#include "WorldContextHandle.h"
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class UndoManager;
+
+class DOMTransaction : public UndoStep {
+public:
+ static PassRefPtr<DOMTransaction> create(const WorldContextHandle&);
+
+ void apply();
+ virtual void unapply() OVERRIDE;
+ virtual void reapply() OVERRIDE;
+
+ virtual EditAction editingAction() const OVERRIDE { return EditActionUnspecified; }
+ virtual bool isDOMTransaction() const OVERRIDE { return true; }
+
+ UndoManager* undoManager() const { return m_undoManager; }
+ void setUndoManager(UndoManager* undoManager) { m_undoManager = undoManager; }
+
+private:
+ DOMTransaction(const WorldContextHandle&);
+ v8::Handle<v8::Function> getFunction(const char*);
+ void callFunction(const char*);
+
+ WorldContextHandle m_worldContext;
+ UndoManager* m_undoManager;
+ bool m_isAutomatic;
+};
+
+}
+
+#endif
+
+#endif
diff --git a/Source/WebCore/bindings/v8/DateExtension.cpp b/Source/WebCore/bindings/v8/DateExtension.cpp
index b58afec39..11a3b09c0 100644
--- a/Source/WebCore/bindings/v8/DateExtension.cpp
+++ b/Source/WebCore/bindings/v8/DateExtension.cpp
@@ -32,7 +32,7 @@
#include "DateExtension.h"
#include "V8HiddenPropertyName.h"
-#include "V8Proxy.h"
+#include "V8Binding.h"
#include "V8RecursionScope.h"
namespace WebCore {
@@ -118,7 +118,7 @@ v8::Handle<v8::Value> DateExtension::Setup(const v8::Arguments& args)
v8::Handle<v8::Value> DateExtension::OnSleepDetected(const v8::Arguments& args)
{
- return V8Proxy::throwError(V8Proxy::GeneralError, "Too much time spent in unload handler.", args.GetIsolate());
+ return throwError(GeneralError, "Too much time spent in unload handler.", args.GetIsolate());
}
} // namespace WebCore
diff --git a/Source/WebCore/bindings/v8/Dictionary.cpp b/Source/WebCore/bindings/v8/Dictionary.cpp
index 2625fa5b9..15da2ffe8 100644
--- a/Source/WebCore/bindings/v8/Dictionary.cpp
+++ b/Source/WebCore/bindings/v8/Dictionary.cpp
@@ -160,7 +160,7 @@ bool Dictionary::get(const String& key, String& value) const
// an empty string and returning true when we should be returning false.
// See fast/dom/Geolocation/script-tests/argument-types.js for a similar
// example.
- value = v8ValueToWebCoreString(v8Value);
+ value = toWebCoreString(v8Value);
return true;
}
@@ -285,7 +285,7 @@ bool Dictionary::get(const String& key, HashSet<AtomicString>& value) const
v8::Local<v8::Array> v8Array = v8::Local<v8::Array>::Cast(v8Value);
for (size_t i = 0; i < v8Array->Length(); ++i) {
v8::Local<v8::Value> indexedValue = v8Array->Get(v8Integer(i));
- value.add(v8ValueToWebCoreString(indexedValue));
+ value.add(toWebCoreString(indexedValue));
}
return true;
@@ -301,7 +301,7 @@ bool Dictionary::getWithUndefinedOrNullCheck(const String& key, String& value) c
// an empty string and returning true when we should be returning false.
// See fast/dom/Geolocation/script-tests/argument-types.js for a similar
// example.
- value = WebCore::isUndefinedOrNull(v8Value) ? String() : v8ValueToWebCoreString(v8Value);
+ value = WebCore::isUndefinedOrNull(v8Value) ? String() : toWebCoreString(v8Value);
return true;
}
@@ -446,7 +446,7 @@ bool Dictionary::get(const String& key, Vector<String>& value) const
v8::Local<v8::Array> v8Array = v8::Local<v8::Array>::Cast(v8Value);
for (size_t i = 0; i < v8Array->Length(); ++i) {
v8::Local<v8::Value> indexedValue = v8Array->Get(v8::Uint32::New(i));
- value.append(v8ValueToWebCoreString(indexedValue));
+ value.append(toWebCoreString(indexedValue));
}
return true;
@@ -485,8 +485,8 @@ bool Dictionary::getOwnPropertiesAsStringHashMap(WTF::HashMap<String, String>& h
continue;
v8::Local<v8::Value> value = options->Get(key);
- String stringKey = v8ValueToWebCoreString(key);
- String stringValue = v8ValueToWebCoreString(value);
+ String stringKey = toWebCoreString(key);
+ String stringValue = toWebCoreString(value);
if (!stringKey.isEmpty())
hashMap.set(stringKey, stringValue);
}
diff --git a/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp b/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp
index cc1eafb04..19fd91d90 100644
--- a/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp
+++ b/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp
@@ -47,7 +47,7 @@ static PassRefPtr<IDBKey> createIDBKeyFromValue(v8::Handle<v8::Value> value, Vec
if (value->IsNumber() && !isnan(value->NumberValue()))
return IDBKey::createNumber(value->NumberValue());
if (value->IsString())
- return IDBKey::createString(v8ValueToWebCoreString(value));
+ return IDBKey::createString(toWebCoreString(value));
if (value->IsDate() && !isnan(value->NumberValue()))
return IDBKey::createDate(value->NumberValue());
if (value->IsArray()) {
diff --git a/Source/WebCore/bindings/v8/NPV8Object.cpp b/Source/WebCore/bindings/v8/NPV8Object.cpp
index d0892bd65..af7d99e7e 100644
--- a/Source/WebCore/bindings/v8/NPV8Object.cpp
+++ b/Source/WebCore/bindings/v8/NPV8Object.cpp
@@ -60,6 +60,24 @@ WrapperTypeInfo* npObjectTypeInfo()
typedef Vector<V8NPObject*> V8NPObjectVector;
typedef HashMap<int, V8NPObjectVector> V8NPObjectMap;
+static v8::Local<v8::Context> toV8Context(NPP npp, NPObject* npObject)
+{
+ V8NPObject* object = reinterpret_cast<V8NPObject*>(npObject);
+ DOMWindow* window = object->rootObject;
+ if (!window || !window->isCurrentlyDisplayedInFrame())
+ return v8::Local<v8::Context>();
+ return ScriptController::mainWorldContext(object->rootObject->frame());
+}
+
+static V8Proxy* toV8Proxy(NPObject* npObject)
+{
+ V8NPObject* object = reinterpret_cast<V8NPObject*>(npObject);
+ Frame* frame = object->rootObject->frame();
+ if (!frame)
+ return 0;
+ return frame->script()->proxy();
+}
+
static V8NPObjectMap* staticV8NPObjectMap()
{
DEFINE_STATIC_LOCAL(V8NPObjectMap, v8npObjectMap, ());
@@ -226,13 +244,13 @@ bool _NPN_Invoke(NPP npp, NPObject* npObject, NPIdentifier methodName, const NPV
return false;
}
- V8Proxy* proxy = toV8Proxy(npObject);
- ASSERT(proxy);
+ Frame* frame = v8NpObject->rootObject->frame();
+ ASSERT(frame);
// Call the function object.
v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(functionObject);
OwnArrayPtr<v8::Handle<v8::Value> > argv = createValueListFromVariantArgs(arguments, argumentCount, npObject);
- v8::Local<v8::Value> resultObject = proxy->callFunction(function, v8NpObject->v8Object, argumentCount, argv.get());
+ v8::Local<v8::Value> resultObject = frame->script()->callFunction(function, v8NpObject->v8Object, argumentCount, argv.get());
// If we had an error, return false. The spec is a little unclear here, but says "Returns true if the method was
// successfully invoked". If we get an error return value, was that successfully invoked?
@@ -277,11 +295,11 @@ bool _NPN_InvokeDefault(NPP npp, NPObject* npObject, const NPVariant* arguments,
v8::Local<v8::Value> resultObject;
v8::Handle<v8::Function> function(v8::Function::Cast(*functionObject));
if (!function->IsNull()) {
- V8Proxy* proxy = toV8Proxy(npObject);
- ASSERT(proxy);
+ Frame* frame = v8NpObject->rootObject->frame();
+ ASSERT(frame);
OwnArrayPtr<v8::Handle<v8::Value> > argv = createValueListFromVariantArgs(arguments, argumentCount, npObject);
- resultObject = proxy->callFunction(function, functionObject, argumentCount, argv.get());
+ resultObject = frame->script()->callFunction(function, functionObject, argumentCount, argv.get());
}
// If we had an error, return false. The spec is a little unclear here, but says "Returns true if the method was
// successfully invoked". If we get an error return value, was that successfully invoked?
@@ -480,7 +498,7 @@ void _NPN_SetException(NPObject* npObject, const NPUTF8 *message)
if (!npObject || npObject->_class != npScriptObjectClass) {
// We won't be able to find a proper scope for this exception, so just throw it.
// This is consistent with JSC, which throws a global exception all the time.
- V8Proxy::throwError(V8Proxy::GeneralError, message);
+ throwError(GeneralError, message);
return;
}
v8::HandleScope handleScope;
@@ -491,7 +509,7 @@ void _NPN_SetException(NPObject* npObject, const NPUTF8 *message)
v8::Context::Scope scope(context);
ExceptionCatcher exceptionCatcher;
- V8Proxy::throwError(V8Proxy::GeneralError, message);
+ throwError(GeneralError, message);
}
bool _NPN_Enumerate(NPP npp, NPObject* npObject, NPIdentifier** identifier, uint32_t* count)
@@ -573,11 +591,10 @@ bool _NPN_Construct(NPP npp, NPObject* npObject, const NPVariant* arguments, uin
v8::Local<v8::Value> resultObject;
v8::Handle<v8::Function> ctor(v8::Function::Cast(*ctorObj));
if (!ctor->IsNull()) {
- V8Proxy* proxy = toV8Proxy(npObject);
- ASSERT(proxy);
-
+ Frame* frame = object->rootObject->frame();
+ ASSERT(frame);
OwnArrayPtr<v8::Handle<v8::Value> > argv = createValueListFromVariantArgs(arguments, argumentCount, npObject);
- resultObject = proxy->newInstance(ctor, argumentCount, argv.get());
+ resultObject = V8ObjectConstructor::newInstanceInDocument(ctor, argumentCount, argv.get(), frame ? frame->document() : 0);
}
if (resultObject.IsEmpty())
diff --git a/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp b/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp
index 6ccb0f0b2..04169fc3d 100755
--- a/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp
+++ b/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp
@@ -47,7 +47,7 @@
namespace WebCore {
-static Frame* retrieveFrame(v8::Handle<v8::Context> context)
+static Frame* retrieveFrameWithGlobalObjectCheck(v8::Handle<v8::Context> context)
{
if (context.IsEmpty())
return 0;
@@ -61,7 +61,7 @@ static Frame* retrieveFrame(v8::Handle<v8::Context> context)
if (global.IsEmpty())
return 0;
- return V8Proxy::retrieveFrame(context);
+ return toFrameIfNotDetached(context);
}
PageScriptDebugServer& PageScriptDebugServer::shared()
@@ -167,7 +167,7 @@ void PageScriptDebugServer::runScript(ScriptState* state, const String& scriptId
ScriptDebugListener* PageScriptDebugServer::getDebugListenerForContext(v8::Handle<v8::Context> context)
{
v8::HandleScope scope;
- Frame* frame = retrieveFrame(context);
+ Frame* frame = retrieveFrameWithGlobalObjectCheck(context);
if (!frame)
return 0;
return m_listenersMap.get(frame->page());
@@ -176,7 +176,7 @@ ScriptDebugListener* PageScriptDebugServer::getDebugListenerForContext(v8::Handl
void PageScriptDebugServer::runMessageLoopOnPause(v8::Handle<v8::Context> context)
{
v8::HandleScope scope;
- Frame* frame = retrieveFrame(context);
+ Frame* frame = retrieveFrameWithGlobalObjectCheck(context);
m_pausedPage = frame->page();
// Wait for continue or step command.
diff --git a/Source/WebCore/bindings/v8/ScheduledAction.cpp b/Source/WebCore/bindings/v8/ScheduledAction.cpp
index e71f02629..d56f677a0 100644
--- a/Source/WebCore/bindings/v8/ScheduledAction.cpp
+++ b/Source/WebCore/bindings/v8/ScheduledAction.cpp
@@ -40,6 +40,7 @@
#include "TraceEvent.h"
#endif
+#include "ScriptController.h"
#include "V8Binding.h"
#include "V8Proxy.h"
#include "V8RecursionScope.h"
@@ -102,7 +103,7 @@ void ScheduledAction::execute(ScriptExecutionContext* context)
return;
if (!frame->script()->canExecuteScripts(AboutToExecuteScript))
return;
- execute(frame->script()->proxy());
+ execute(frame->script());
}
#if ENABLE(WORKERS)
else {
@@ -112,9 +113,9 @@ void ScheduledAction::execute(ScriptExecutionContext* context)
#endif
}
-void ScheduledAction::execute(V8Proxy* proxy)
+void ScheduledAction::execute(ScriptController* script)
{
- ASSERT(proxy);
+ ASSERT(script->proxy());
v8::HandleScope handleScope;
v8::Handle<v8::Context> v8Context = v8::Local<v8::Context>::New(m_context.get());
@@ -129,9 +130,9 @@ void ScheduledAction::execute(V8Proxy* proxy)
// FIXME: Need to implement timeouts for preempting a long-running script.
if (!m_function.IsEmpty() && m_function->IsFunction())
- proxy->callFunction(v8::Persistent<v8::Function>::Cast(m_function), v8Context->Global(), m_argc, m_argv);
+ script->callFunction(v8::Persistent<v8::Function>::Cast(m_function), v8Context->Global(), m_argc, m_argv);
else
- proxy->evaluate(m_code, 0);
+ script->proxy()->evaluate(m_code, 0);
// The 'proxy' may be invalid at this point since JS could have released the owning Frame.
}
diff --git a/Source/WebCore/bindings/v8/ScheduledAction.h b/Source/WebCore/bindings/v8/ScheduledAction.h
index aefe7efa2..e3f3bb440 100644
--- a/Source/WebCore/bindings/v8/ScheduledAction.h
+++ b/Source/WebCore/bindings/v8/ScheduledAction.h
@@ -40,8 +40,8 @@
namespace WebCore {
+ class ScriptController;
class ScriptExecutionContext;
- class V8Proxy;
class WorkerContext;
class ScheduledAction {
@@ -59,7 +59,7 @@ namespace WebCore {
virtual void execute(ScriptExecutionContext*);
private:
- void execute(V8Proxy*);
+ void execute(ScriptController*);
#if ENABLE(WORKERS)
void execute(WorkerContext*);
#endif
diff --git a/Source/WebCore/bindings/v8/ScriptController.cpp b/Source/WebCore/bindings/v8/ScriptController.cpp
index a71380217..9955ca907 100644
--- a/Source/WebCore/bindings/v8/ScriptController.cpp
+++ b/Source/WebCore/bindings/v8/ScriptController.cpp
@@ -33,24 +33,25 @@
#include "ScriptController.h"
#include "BindingState.h"
-#include "Document.h"
-#include "ScriptCallStack.h"
-#include "ScriptCallStackFactory.h"
-#include "ScriptableDocumentParser.h"
#include "DOMWindow.h"
+#include "Document.h"
#include "Event.h"
#include "EventListener.h"
#include "EventNames.h"
#include "Frame.h"
#include "FrameLoaderClient.h"
+#include "InspectorInstrumentation.h"
+#include "NPObjectWrapper.h"
+#include "NPV8Object.h"
#include "Node.h"
#include "NotImplemented.h"
-#include "NPObjectWrapper.h"
#include "npruntime_impl.h"
#include "npruntime_priv.h"
-#include "NPV8Object.h"
#include "PlatformSupport.h"
+#include "ScriptCallStack.h"
+#include "ScriptCallStackFactory.h"
#include "ScriptSourceCode.h"
+#include "ScriptableDocumentParser.h"
#include "SecurityOrigin.h"
#include "Settings.h"
#include "UserGestureIndicator.h"
@@ -65,7 +66,13 @@
#include "V8RecursionScope.h"
#include "Widget.h"
#include <wtf/StdLibExtras.h>
+#include <wtf/StringExtras.h>
#include <wtf/text/CString.h>
+#include <wtf/text/StringBuilder.h>
+
+#if PLATFORM(CHROMIUM)
+#include "TraceEvent.h"
+#endif
namespace WebCore {
@@ -102,6 +109,7 @@ bool ScriptController::canAccessFromCurrentOrigin(Frame *frame)
ScriptController::ScriptController(Frame* frame)
: m_frame(frame)
, m_sourceURL(0)
+ , m_windowShell(V8DOMWindowShell::create(frame))
, m_paused(false)
, m_proxy(adoptPtr(new V8Proxy(frame)))
#if ENABLE(NETSCAPE_PLUGIN_API)
@@ -112,6 +120,7 @@ ScriptController::ScriptController(Frame* frame)
ScriptController::~ScriptController()
{
+ clearForClose();
}
void ScriptController::clearScriptObjects()
@@ -143,9 +152,33 @@ void ScriptController::clearScriptObjects()
#endif
}
+void ScriptController::resetIsolatedWorlds()
+{
+ for (IsolatedWorldMap::iterator iter = m_proxy->isolatedWorlds().begin();
+ iter != m_proxy->isolatedWorlds().end(); ++iter) {
+ iter->second->destroy();
+ }
+ m_proxy->isolatedWorlds().clear();
+ m_proxy->isolatedWorldSecurityOrigins().clear();
+}
+
+void ScriptController::clearForClose()
+{
+ resetIsolatedWorlds();
+ V8GCController::hintForCollectGarbage();
+ windowShell()->clearForClose();
+}
+
+void ScriptController::clearForNavigation()
+{
+ resetIsolatedWorlds();
+ V8GCController::hintForCollectGarbage();
+ windowShell()->clearForNavigation();
+}
+
void ScriptController::updateSecurityOrigin()
{
- m_proxy->windowShell()->updateSecurityOrigin();
+ windowShell()->updateSecurityOrigin();
}
void ScriptController::updatePlatformScriptObjects()
@@ -158,10 +191,75 @@ bool ScriptController::processingUserGesture()
return UserGestureIndicator::processingUserGesture();
}
+v8::Local<v8::Value> ScriptController::callFunction(v8::Handle<v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> args[])
+{
+ // Keep Frame (and therefore ScriptController and V8Proxy) alive.
+ RefPtr<Frame> protect(m_frame);
+ return ScriptController::callFunctionWithInstrumentation(m_frame ? m_frame->document() : 0, function, receiver, argc, args);
+}
+
+static v8::Local<v8::Value> handleMaxRecursionDepthExceeded()
+{
+ throwError(RangeError, "Maximum call stack size exceeded.");
+ return v8::Local<v8::Value>();
+}
+
+static inline void resourceInfo(const v8::Handle<v8::Function> function, String& resourceName, int& lineNumber)
+{
+ v8::ScriptOrigin origin = function->GetScriptOrigin();
+ if (origin.ResourceName().IsEmpty()) {
+ resourceName = "undefined";
+ lineNumber = 1;
+ } else {
+ resourceName = toWebCoreString(origin.ResourceName());
+ lineNumber = function->GetScriptLineNumber() + 1;
+ }
+}
+
+static inline String resourceString(const v8::Handle<v8::Function> function)
+{
+ String resourceName;
+ int lineNumber;
+ resourceInfo(function, resourceName, lineNumber);
+
+ StringBuilder builder;
+ builder.append(resourceName);
+ builder.append(':');
+ builder.append(String::number(lineNumber));
+ return builder.toString();
+}
+
+v8::Local<v8::Value> ScriptController::callFunctionWithInstrumentation(ScriptExecutionContext* context, v8::Handle<v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> args[])
+{
+ V8GCController::checkMemoryUsage();
+
+ if (V8RecursionScope::recursionLevel() >= kMaxRecursionDepth)
+ return handleMaxRecursionDepthExceeded();
+
+ InspectorInstrumentationCookie cookie;
+ if (InspectorInstrumentation::hasFrontends() && context) {
+ String resourceName;
+ int lineNumber;
+ resourceInfo(function, resourceName, lineNumber);
+ cookie = InspectorInstrumentation::willCallFunction(context, resourceName, lineNumber);
+ }
+
+ v8::Local<v8::Value> result;
+ {
+ TRACE_EVENT1("v8", "v8.callFunction", "callsite", resourceString(function).utf8());
+ V8RecursionScope recursionScope(context);
+ result = function->Call(receiver, argc, args);
+ }
+
+ InspectorInstrumentation::didCallFunction(cookie);
+ crashIfV8IsDead();
+ return result;
+}
+
ScriptValue ScriptController::callFunctionEvenIfScriptDisabled(v8::Handle<v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> argv[])
{
// FIXME: This should probably perform the same isPaused check that happens in ScriptController::executeScript.
- return ScriptValue(m_proxy->callFunction(function, receiver, argc, argv));
+ return ScriptValue(callFunction(function, receiver, argc, argv));
}
void ScriptController::evaluateInIsolatedWorld(unsigned worldID, const Vector<ScriptSourceCode>& sources, Vector<ScriptValue>* results)
@@ -172,7 +270,58 @@ void ScriptController::evaluateInIsolatedWorld(unsigned worldID, const Vector<Sc
void ScriptController::evaluateInIsolatedWorld(unsigned worldID, const Vector<ScriptSourceCode>& sources, int extensionGroup, Vector<ScriptValue>* results)
{
v8::HandleScope handleScope;
- v8::Local<v8::Array> v8Results = m_proxy->evaluateInIsolatedWorld(worldID, sources, extensionGroup);
+
+ // FIXME: This will need to get reorganized once we have a windowShell for the isolated world.
+ if (!windowShell()->initContextIfNeeded())
+ return;
+
+ v8::Local<v8::Array> v8Results;
+ {
+ v8::HandleScope evaluateHandleScope;
+ V8IsolatedContext* isolatedContext = 0;
+ if (worldID > 0) {
+ IsolatedWorldMap::iterator iter = m_proxy->isolatedWorlds().find(worldID);
+ if (iter != m_proxy->isolatedWorlds().end())
+ isolatedContext = iter->second;
+ else {
+ isolatedContext = new V8IsolatedContext(m_frame, extensionGroup, worldID);
+ if (isolatedContext->context().IsEmpty()) {
+ delete isolatedContext;
+ return;
+ }
+
+ // FIXME: We should change this to using window shells to match JSC.
+ m_proxy->isolatedWorlds().set(worldID, isolatedContext);
+ }
+
+ IsolatedWorldSecurityOriginMap::iterator securityOriginIter = m_proxy->isolatedWorldSecurityOrigins().find(worldID);
+ if (securityOriginIter != m_proxy->isolatedWorldSecurityOrigins().end())
+ isolatedContext->setSecurityOrigin(securityOriginIter->second);
+ } else {
+ isolatedContext = new V8IsolatedContext(m_frame, extensionGroup, worldID);
+ if (isolatedContext->context().IsEmpty()) {
+ delete isolatedContext;
+ return;
+ }
+ }
+
+ v8::Local<v8::Context> context = v8::Local<v8::Context>::New(isolatedContext->context());
+ v8::Context::Scope contextScope(context);
+ v8::Local<v8::Array> resultArray = v8::Array::New(sources.size());
+
+ for (size_t i = 0; i < sources.size(); ++i) {
+ v8::Local<v8::Value> evaluationResult = m_proxy->evaluate(sources[i], 0);
+ if (evaluationResult.IsEmpty())
+ evaluationResult = v8::Local<v8::Value>::New(v8::Undefined());
+ resultArray->Set(i, evaluationResult);
+ }
+
+ if (!worldID)
+ isolatedContext->destroy();
+
+ v8Results = evaluateHandleScope.Close(resultArray);
+ }
+
if (results && !v8Results.IsEmpty()) {
for (size_t i = 0; i < v8Results->Length(); ++i)
results->append(ScriptValue(v8Results->Get(i)));
@@ -196,7 +345,7 @@ ScriptValue ScriptController::evaluate(const ScriptSourceCode& sourceCode)
m_sourceURL = &sourceURL;
v8::HandleScope handleScope;
- v8::Handle<v8::Context> v8Context = V8Proxy::mainWorldContext(m_proxy->frame());
+ v8::Handle<v8::Context> v8Context = ScriptController::mainWorldContext(m_proxy->frame());
if (v8Context.IsEmpty())
return ScriptValue();
@@ -227,12 +376,26 @@ void ScriptController::finishedWithEvent(Event* event)
m_proxy->finishedWithEvent(event);
}
+v8::Local<v8::Context> ScriptController::mainWorldContext()
+{
+ windowShell()->initContextIfNeeded();
+ return v8::Local<v8::Context>::New(windowShell()->context());
+}
+
+v8::Local<v8::Context> ScriptController::mainWorldContext(Frame* frame)
+{
+ if (!frame)
+ return v8::Local<v8::Context>();
+
+ return frame->script()->mainWorldContext();
+}
+
// Create a V8 object with an interceptor of NPObjectPropertyGetter.
void ScriptController::bindToWindowObject(Frame* frame, const String& key, NPObject* object)
{
v8::HandleScope handleScope;
- v8::Handle<v8::Context> v8Context = V8Proxy::mainWorldContext(frame);
+ v8::Handle<v8::Context> v8Context = ScriptController::mainWorldContext(frame);
if (v8Context.IsEmpty())
return;
@@ -245,40 +408,15 @@ void ScriptController::bindToWindowObject(Frame* frame, const String& key, NPObj
global->Set(v8String(key), value);
}
-void ScriptController::collectGarbage()
-{
- v8::HandleScope handleScope;
-
- v8::Persistent<v8::Context> v8Context = v8::Context::New();
- if (v8Context.IsEmpty())
- return;
- {
- v8::Context::Scope scope(v8Context);
- v8::Local<v8::String> source = v8::String::New("if (gc) gc();");
- v8::Local<v8::String> name = v8::String::New("gc");
- v8::Handle<v8::Script> script = v8::Script::Compile(source, name);
- if (!script.IsEmpty()) {
- V8RecursionScope::MicrotaskSuppression scope;
- script->Run();
- }
- }
- v8Context.Dispose();
-}
-
-void ScriptController::lowMemoryNotification()
-{
- v8::V8::LowMemoryNotification();
-}
-
bool ScriptController::haveInterpreter() const
{
- return m_proxy->windowShell()->isContextInitialized();
+ return windowShell()->isContextInitialized();
}
void ScriptController::enableEval()
{
v8::HandleScope handleScope;
- v8::Handle<v8::Context> v8Context = proxy()->windowShell()->context();
+ v8::Handle<v8::Context> v8Context = windowShell()->context();
if (v8Context.IsEmpty())
return;
@@ -288,7 +426,7 @@ void ScriptController::enableEval()
void ScriptController::disableEval()
{
v8::HandleScope handleScope;
- v8::Handle<v8::Context> v8Context = proxy()->windowShell()->context();
+ v8::Handle<v8::Context> v8Context = windowShell()->context();
if (v8Context.IsEmpty())
return;
@@ -363,6 +501,23 @@ void ScriptController::evaluateInWorld(const ScriptSourceCode& source,
evaluateInIsolatedWorld(0, sources, 0);
}
+V8Extensions& ScriptController::registeredExtensions()
+{
+ DEFINE_STATIC_LOCAL(V8Extensions, extensions, ());
+ return extensions;
+}
+
+void ScriptController::registerExtensionIfNeeded(v8::Extension* extension)
+{
+ const V8Extensions& extensions = registeredExtensions();
+ for (size_t i = 0; i < extensions.size(); ++i) {
+ if (extensions[i] == extension)
+ return;
+ }
+ v8::RegisterExtension(extension);
+ registeredExtensions().append(extension);
+}
+
static NPObject* createNoScriptObject()
{
notImplemented();
@@ -372,12 +527,12 @@ static NPObject* createNoScriptObject()
static NPObject* createScriptObject(Frame* frame)
{
v8::HandleScope handleScope;
- v8::Handle<v8::Context> v8Context = V8Proxy::mainWorldContext(frame);
+ v8::Handle<v8::Context> v8Context = ScriptController::mainWorldContext(frame);
if (v8Context.IsEmpty())
return createNoScriptObject();
v8::Context::Scope scope(v8Context);
- DOMWindow* window = frame->domWindow();
+ DOMWindow* window = frame->document()->domWindow();
v8::Handle<v8::Value> global = toV8(window);
ASSERT(global->IsObject());
return npCreateV8ScriptObject(0, v8::Handle<v8::Object>::Cast(global), window);
@@ -412,12 +567,12 @@ NPObject* ScriptController::createScriptObjectForPluginElement(HTMLPlugInElement
return createNoScriptObject();
v8::HandleScope handleScope;
- v8::Handle<v8::Context> v8Context = V8Proxy::mainWorldContext(m_frame);
+ v8::Handle<v8::Context> v8Context = ScriptController::mainWorldContext(m_frame);
if (v8Context.IsEmpty())
return createNoScriptObject();
v8::Context::Scope scope(v8Context);
- DOMWindow* window = m_frame->domWindow();
+ DOMWindow* window = m_frame->document()->domWindow();
v8::Handle<v8::Value> v8plugin = toV8(static_cast<HTMLEmbedElement*>(plugin));
if (!v8plugin->IsObject())
return createNoScriptObject();
@@ -426,12 +581,12 @@ NPObject* ScriptController::createScriptObjectForPluginElement(HTMLPlugInElement
}
-void ScriptController::clearWindowShell(bool)
+void ScriptController::clearWindowShell(DOMWindow*, bool)
{
// V8 binding expects ScriptController::clearWindowShell only be called
// when a frame is loading a new page. V8Proxy::clearForNavigation
// creates a new context for the new page.
- m_proxy->clearForNavigation();
+ clearForNavigation();
}
#if ENABLE(INSPECTOR)
@@ -456,6 +611,38 @@ void ScriptController::collectIsolatedContexts(Vector<std::pair<ScriptState*, Se
}
#endif
+bool ScriptController::setContextDebugId(int debugId)
+{
+ ASSERT(debugId > 0);
+ v8::HandleScope scope;
+ v8::Handle<v8::Context> context = windowShell()->context();
+ if (context.IsEmpty())
+ return false;
+ if (!context->GetData()->IsUndefined())
+ return false;
+
+ v8::Context::Scope contextScope(context);
+
+ char buffer[32];
+ snprintf(buffer, sizeof(buffer), "page,%d", debugId);
+ buffer[31] = 0;
+ context->SetData(v8::String::New(buffer));
+
+ return true;
+}
+
+int ScriptController::contextDebugId(v8::Handle<v8::Context> context)
+{
+ v8::HandleScope scope;
+ if (!context->GetData()->IsString())
+ return -1;
+ v8::String::AsciiValue ascii(context->GetData());
+ char* comma = strnstr(*ascii, ",", ascii.length());
+ if (!comma)
+ return -1;
+ return atoi(comma + 1);
+}
+
void ScriptController::attachDebugger(void*)
{
notImplemented();
@@ -463,17 +650,17 @@ void ScriptController::attachDebugger(void*)
void ScriptController::updateDocument()
{
- m_proxy->windowShell()->updateDocument();
+ windowShell()->updateDocument();
}
void ScriptController::namedItemAdded(HTMLDocument* doc, const AtomicString& name)
{
- m_proxy->windowShell()->namedItemAdded(doc, name);
+ windowShell()->namedItemAdded(doc, name);
}
void ScriptController::namedItemRemoved(HTMLDocument* doc, const AtomicString& name)
{
- m_proxy->windowShell()->namedItemRemoved(doc, name);
+ windowShell()->namedItemRemoved(doc, name);
}
} // namespace WebCore
diff --git a/Source/WebCore/bindings/v8/ScriptController.h b/Source/WebCore/bindings/v8/ScriptController.h
index b3c22aca8..da6ef92db 100644
--- a/Source/WebCore/bindings/v8/ScriptController.h
+++ b/Source/WebCore/bindings/v8/ScriptController.h
@@ -51,12 +51,16 @@ namespace WebCore {
class DOMWrapperWorld;
class Event;
class Frame;
+class HTMLDocument;
class HTMLPlugInElement;
class PagePopupClient;
class ScriptSourceCode;
class ScriptState;
+class V8DOMWindowShell;
class Widget;
+typedef WTF::Vector<v8::Extension*> V8Extensions;
+
class ScriptController {
public:
ScriptController(Frame*);
@@ -65,10 +69,17 @@ public:
// FIXME: V8Proxy should either be folded into ScriptController
// or this accessor should be made JSProxy*
V8Proxy* proxy() { return m_proxy.get(); }
- V8DOMWindowShell* windowShell() { return m_proxy->windowShell(); }
+ V8DOMWindowShell* windowShell() const { return m_windowShell.get(); }
ScriptValue executeScript(const ScriptSourceCode&);
ScriptValue executeScript(const String& script, bool forceUserGesture = false);
+
+ // Call the function with the given receiver and arguments.
+ v8::Local<v8::Value> callFunction(v8::Handle<v8::Function>, v8::Handle<v8::Object>, int argc, v8::Handle<v8::Value> argv[]);
+
+ // Call the function with the given receiver and arguments and report times to DevTools.
+ static v8::Local<v8::Value> callFunctionWithInstrumentation(ScriptExecutionContext*, v8::Handle<v8::Function>, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> args[]);
+
ScriptValue callFunctionEvenIfScriptDisabled(v8::Handle<v8::Function>, v8::Handle<v8::Object>, int argc, v8::Handle<v8::Value> argv[]);
// Returns true if argument is a JavaScript URL.
@@ -82,6 +93,10 @@ public:
// as a string.
ScriptValue evaluate(const ScriptSourceCode&);
+ // Evaluate JavaScript in a new isolated world. The script gets its own
+ // global scope, its own prototypes for intrinsic JavaScript objects (String,
+ // Array, and so-on), and its own wrappers for all DOM nodes and DOM
+ // constructors.
void evaluateInIsolatedWorld(unsigned worldID, const Vector<ScriptSourceCode>& sources, Vector<ScriptValue>* results);
// Executes JavaScript in an isolated world. The script gets its own global scope,
@@ -107,11 +122,6 @@ public:
ScriptController* windowShell(DOMWrapperWorld*) { return this; }
ScriptController* existingWindowShell(DOMWrapperWorld*) { return this; }
- void collectGarbage();
-
- // Notify V8 that the system is running low on memory.
- void lowMemoryNotification();
-
// Creates a property of the global object of a frame.
void bindToWindowObject(Frame*, const String& key, NPObject*);
@@ -146,6 +156,11 @@ public:
// V8Proxy::retrieveFrameForEnteredContext() for more information.
static Frame* retrieveFrameForCurrentContext();
+ // Returns V8 Context of a frame. If none exists, creates
+ // a new context. It is potentially slow and consumes memory.
+ static v8::Local<v8::Context> mainWorldContext(Frame*);
+ v8::Local<v8::Context> mainWorldContext();
+
// Pass command-line flags to the JS engine.
static void setFlags(const char* string, int length);
@@ -160,7 +175,7 @@ public:
const String* sourceURL() const { return m_sourceURL; } // 0 if we are not evaluating any script.
- void clearWindowShell(bool = false);
+ void clearWindowShell(DOMWindow*, bool);
void updateDocument();
void namedItemAdded(HTMLDocument*, const AtomicString&);
@@ -171,6 +186,9 @@ public:
void updatePlatformScriptObjects();
void cleanupScriptObjectsForPlugin(Widget*);
+ void clearForNavigation();
+ void clearForClose();
+
NPObject* createScriptObjectForPluginElement(HTMLPlugInElement*);
NPObject* windowScriptNPObject();
@@ -178,10 +196,24 @@ public:
void evaluateInWorld(const ScriptSourceCode&, DOMWrapperWorld*);
static void getAllWorlds(Vector<RefPtr<DOMWrapperWorld> >& worlds);
+ // Registers a v8 extension to be available on webpages. Will only
+ // affect v8 contexts initialized after this call. Takes ownership of
+ // the v8::Extension object passed.
+ static void registerExtensionIfNeeded(v8::Extension*);
+ static V8Extensions& registeredExtensions();
+
+ bool setContextDebugId(int);
+ static int contextDebugId(v8::Handle<v8::Context>);
+
private:
+ void resetIsolatedWorlds();
+
Frame* m_frame;
const String* m_sourceURL;
+ // For the moment, we have one of these. Soon we will have one per DOMWrapperWorld.
+ RefPtr<V8DOMWindowShell> m_windowShell;
+
bool m_paused;
OwnPtr<V8Proxy> m_proxy;
@@ -200,6 +232,9 @@ private:
// pointer in this object is cleared out when the window object is
// destroyed.
NPObject* m_wrappedWindowScriptNPObject;
+
+ // All of the extensions registered with the context.
+ static V8Extensions m_extensions;
};
} // namespace WebCore
diff --git a/Source/WebCore/bindings/v8/ScriptDebugServer.cpp b/Source/WebCore/bindings/v8/ScriptDebugServer.cpp
index 77d68d017..1455aaec4 100644
--- a/Source/WebCore/bindings/v8/ScriptDebugServer.cpp
+++ b/Source/WebCore/bindings/v8/ScriptDebugServer.cpp
@@ -89,7 +89,7 @@ String ScriptDebugServer::setBreakpoint(const String& sourceID, const ScriptBrea
return "";
*actualLineNumber = args->Get(v8::String::New("lineNumber"))->Int32Value();
*actualColumnNumber = args->Get(v8::String::New("columnNumber"))->Int32Value();
- return v8ValueToWebCoreString(breakpointId->ToString());
+ return toWebCoreString(breakpointId->ToString());
}
void ScriptDebugServer::removeBreakpoint(const String& breakpointId)
diff --git a/Source/WebCore/bindings/v8/ScriptFunctionCall.cpp b/Source/WebCore/bindings/v8/ScriptFunctionCall.cpp
index a8aac0fa7..d9b200da5 100644
--- a/Source/WebCore/bindings/v8/ScriptFunctionCall.cpp
+++ b/Source/WebCore/bindings/v8/ScriptFunctionCall.cpp
@@ -31,12 +31,12 @@
#include "config.h"
#include "ScriptFunctionCall.h"
-#include "SafeAllocation.h"
+#include "ScriptController.h"
#include "ScriptScope.h"
#include "ScriptState.h"
#include "ScriptValue.h"
#include "V8Binding.h"
-#include "V8Proxy.h"
+#include "V8ObjectConstructor.h"
#include "V8RecursionScope.h"
#include "V8Utilities.h"
@@ -168,7 +168,7 @@ ScriptObject ScriptFunctionCall::construct(bool& hadException, bool reportExcept
for (size_t i = 0; i < m_arguments.size(); ++i)
args[i] = m_arguments[i].v8Value();
- v8::Local<v8::Object> result = SafeAllocation::newInstance(constructor, m_arguments.size(), args.get());
+ v8::Local<v8::Object> result = V8ObjectConstructor::newInstance(constructor, m_arguments.size(), args.get());
if (!scope.success()) {
hadException = true;
return ScriptObject();
@@ -202,7 +202,7 @@ ScriptValue ScriptCallback::call(bool& hadException)
for (size_t i = 0; i < m_arguments.size(); ++i)
args[i] = m_arguments[i].v8Value();
- v8::Handle<v8::Value> result = V8Proxy::instrumentedCallFunction(0 /* frame */, function, object, m_arguments.size(), args.get());
+ v8::Handle<v8::Value> result = ScriptController::callFunctionWithInstrumentation(0, function, object, m_arguments.size(), args.get());
if (exceptionCatcher.HasCaught()) {
hadException = true;
diff --git a/Source/WebCore/bindings/v8/ScriptGCEvent.cpp b/Source/WebCore/bindings/v8/ScriptGCEvent.cpp
index fc13a7e93..c18227de5 100644
--- a/Source/WebCore/bindings/v8/ScriptGCEvent.cpp
+++ b/Source/WebCore/bindings/v8/ScriptGCEvent.cpp
@@ -90,21 +90,21 @@ size_t ScriptGCEvent::getUsedHeapSize()
void ScriptGCEvent::gcPrologueCallback(v8::GCType type, v8::GCCallbackFlags flags)
{
GCEventData* gcEventData = isolateGCEventData();
- gcEventData->startTime = WTF::monotonicallyIncreasingTime();
- gcEventData->usedHeapSize = getUsedHeapSize();
+ gcEventData->setStartTime(WTF::monotonicallyIncreasingTime());
+ gcEventData->setUsedHeapSize(getUsedHeapSize());
}
void ScriptGCEvent::gcEpilogueCallback(v8::GCType type, v8::GCCallbackFlags flags)
{
GCEventData* gcEventData = isolateGCEventData();
- if (!gcEventData->usedHeapSize)
+ if (!gcEventData->usedHeapSize())
return;
double endTime = WTF::monotonicallyIncreasingTime();
size_t usedHeapSize = getUsedHeapSize();
- size_t collectedBytes = usedHeapSize > gcEventData->usedHeapSize ? 0 : gcEventData->usedHeapSize - usedHeapSize;
+ size_t collectedBytes = usedHeapSize > gcEventData->usedHeapSize() ? 0 : gcEventData->usedHeapSize() - usedHeapSize;
GCEventData::GCEventListeners& listeners = gcEventData->listeners();
for (GCEventData::GCEventListeners::iterator i = listeners.begin(); i != listeners.end(); ++i)
- (*i)->didGC(gcEventData->startTime, endTime, collectedBytes);
+ (*i)->didGC(gcEventData->startTime(), endTime, collectedBytes);
gcEventData->clear();
}
diff --git a/Source/WebCore/bindings/v8/ScriptGCEvent.h b/Source/WebCore/bindings/v8/ScriptGCEvent.h
index 3b6246356..2fcd0fa1f 100644
--- a/Source/WebCore/bindings/v8/ScriptGCEvent.h
+++ b/Source/WebCore/bindings/v8/ScriptGCEvent.h
@@ -49,10 +49,38 @@ struct HeapInfo {
size_t jsHeapSizeLimit;
};
-#if ENABLE(INSPECTOR)
-
class ScriptGCEventListener;
+class GCEventData {
+public:
+ typedef Vector<ScriptGCEventListener*> GCEventListeners;
+
+ GCEventData()
+ : m_startTime(0.0)
+ , m_usedHeapSize(0)
+ { }
+
+ void clear()
+ {
+ m_startTime = 0.0;
+ m_usedHeapSize = 0;
+ }
+
+ GCEventListeners& listeners() { return m_listeners; }
+
+ double startTime() { return m_startTime; }
+ void setStartTime(double startTime) { m_startTime = startTime; }
+ size_t usedHeapSize() { return m_usedHeapSize; }
+ void setUsedHeapSize(size_t usedHeapSize) { m_usedHeapSize = usedHeapSize; }
+
+private:
+ double m_startTime;
+ size_t m_usedHeapSize;
+ GCEventListeners m_listeners;
+};
+
+#if ENABLE(INSPECTOR)
+
class ScriptGCEvent
{
public:
diff --git a/Source/WebCore/bindings/v8/ScriptState.cpp b/Source/WebCore/bindings/v8/ScriptState.cpp
index e21c6cace..a975b14c5 100644
--- a/Source/WebCore/bindings/v8/ScriptState.cpp
+++ b/Source/WebCore/bindings/v8/ScriptState.cpp
@@ -145,8 +145,7 @@ void setEvalEnabled(ScriptState* scriptState, bool enabled)
ScriptState* mainWorldScriptState(Frame* frame)
{
v8::HandleScope handleScope;
- V8Proxy* proxy = frame->script()->proxy();
- return ScriptState::forContext(proxy->mainWorldContext());
+ return ScriptState::forContext(frame->script()->mainWorldContext());
}
ScriptState* scriptStateFromNode(DOMWrapperWorld*, Node* node)
diff --git a/Source/WebCore/bindings/v8/SerializedScriptValue.cpp b/Source/WebCore/bindings/v8/SerializedScriptValue.cpp
index a27532c7f..83bb8f0b3 100644
--- a/Source/WebCore/bindings/v8/SerializedScriptValue.cpp
+++ b/Source/WebCore/bindings/v8/SerializedScriptValue.cpp
@@ -2221,7 +2221,7 @@ PassOwnPtr<SerializedScriptValue::ArrayBufferContentsArray> SerializedScriptValu
{
for (size_t i = 0; i < arrayBuffers.size(); i++) {
if (arrayBuffers[i]->isNeutered()) {
- V8Proxy::setDOMException(INVALID_STATE_ERR, isolate);
+ setDOMException(INVALID_STATE_ERR, isolate);
didThrow = true;
return nullptr;
}
@@ -2239,7 +2239,7 @@ PassOwnPtr<SerializedScriptValue::ArrayBufferContentsArray> SerializedScriptValu
bool result = arrayBuffers[i]->transfer(contents->at(i), neuteredViews);
if (!result) {
- V8Proxy::setDOMException(INVALID_STATE_ERR, isolate);
+ setDOMException(INVALID_STATE_ERR, isolate);
didThrow = true;
return nullptr;
}
@@ -2277,11 +2277,11 @@ SerializedScriptValue::SerializedScriptValue(v8::Handle<v8::Value> value,
// If there was an input error, throw a new exception outside
// of the TryCatch scope.
didThrow = true;
- V8Proxy::setDOMException(DATA_CLONE_ERR, isolate);
+ setDOMException(DATA_CLONE_ERR, isolate);
return;
case Serializer::InvalidStateError:
didThrow = true;
- V8Proxy::setDOMException(INVALID_STATE_ERR, isolate);
+ setDOMException(INVALID_STATE_ERR, isolate);
return;
case Serializer::JSFailure:
// If there was a JS failure (but no exception), there's not
diff --git a/Source/WebCore/bindings/v8/V8AbstractEventListener.cpp b/Source/WebCore/bindings/v8/V8AbstractEventListener.cpp
index 17a0379ef..bc47766f9 100644
--- a/Source/WebCore/bindings/v8/V8AbstractEventListener.cpp
+++ b/Source/WebCore/bindings/v8/V8AbstractEventListener.cpp
@@ -181,7 +181,7 @@ void V8AbstractEventListener::invokeEventHandler(ScriptExecutionContext* context
if (event->type() == eventNames().beforeunloadEvent || event->type() == eventNames().unloadEvent)
DateExtension::get()->setAllowSleep(true);
- ASSERT(!V8Proxy::handleOutOfMemory() || returnValue.IsEmpty());
+ ASSERT(!handleOutOfMemory() || returnValue.IsEmpty());
if (returnValue.IsEmpty())
return;
diff --git a/Source/WebCore/bindings/v8/V8Binding.cpp b/Source/WebCore/bindings/v8/V8Binding.cpp
index a5e95a87b..649ceb9c1 100644
--- a/Source/WebCore/bindings/v8/V8Binding.cpp
+++ b/Source/WebCore/bindings/v8/V8Binding.cpp
@@ -34,12 +34,15 @@
#include "BindingVisitors.h"
#include "DOMStringList.h"
#include "Element.h"
+#include "Frame.h"
#include "MemoryInstrumentation.h"
#include "PlatformString.h"
#include "QualifiedName.h"
+#include "Settings.h"
#include "V8DOMStringList.h"
+#include "V8DOMWindow.h"
#include "V8Element.h"
-#include "V8Proxy.h"
+#include "V8ObjectConstructor.h"
#include <wtf/MathExtras.h>
#include <wtf/MainThread.h>
@@ -52,26 +55,30 @@
namespace WebCore {
-#if ENABLE(INSPECTOR)
-void V8PerIsolateData::visitExternalStrings(ExternalStringVisitor* visitor)
+v8::Handle<v8::Value> setDOMException(int exceptionCode, v8::Isolate* isolate)
{
- v8::HandleScope handleScope;
- class VisitorImpl : public v8::ExternalResourceVisitor {
- public:
- VisitorImpl(ExternalStringVisitor* visitor) : m_visitor(visitor) { }
- virtual ~VisitorImpl() { }
- virtual void VisitExternalString(v8::Handle<v8::String> string)
- {
- WebCoreStringResource* resource = static_cast<WebCoreStringResource*>(string->GetExternalStringResource());
- if (resource)
- resource->visitStrings(m_visitor);
- }
- private:
- ExternalStringVisitor* m_visitor;
- } v8Visitor(visitor);
- v8::V8::VisitExternalResources(&v8Visitor);
+ return V8ThrowException::setDOMException(exceptionCode, isolate);
+}
+
+v8::Handle<v8::Value> throwError(ErrorType errorType, const char* message, v8::Isolate* isolate)
+{
+ return V8ThrowException::throwError(errorType, message, isolate);
+}
+
+v8::Handle<v8::Value> throwError(v8::Local<v8::Value> exception, v8::Isolate* isolate)
+{
+ return V8ThrowException::throwError(exception, isolate);
+}
+
+v8::Handle<v8::Value> throwTypeError(const char* message, v8::Isolate* isolate)
+{
+ return V8ThrowException::throwTypeError(message, isolate);
+}
+
+v8::Handle<v8::Value> throwNotEnoughArgumentsError(v8::Isolate* isolate)
+{
+ return V8ThrowException::throwNotEnoughArgumentsError(isolate);
}
-#endif
static String v8NonStringValueToWebCoreString(v8::Handle<v8::Value> object)
{
@@ -102,14 +109,14 @@ static AtomicString v8NonStringValueToAtomicWebCoreString(v8::Handle<v8::Value>
return AtomicString(v8NonStringValueToWebCoreString(object));
}
-String v8ValueToWebCoreString(v8::Handle<v8::Value> value)
+String toWebCoreString(v8::Handle<v8::Value> value)
{
if (value->IsString())
return v8StringToWebCoreString<String>(v8::Handle<v8::String>::Cast(value), Externalize);
return v8NonStringValueToWebCoreString(value);
}
-AtomicString v8ValueToAtomicWebCoreString(v8::Handle<v8::Value> value)
+AtomicString toWebCoreAtomicString(v8::Handle<v8::Value> value)
{
if (value->IsString())
return v8StringToWebCoreString<AtomicString>(v8::Handle<v8::String>::Cast(value), Externalize);
@@ -312,7 +319,7 @@ String int32ToWebCoreString(int value)
v8::Persistent<v8::FunctionTemplate> createRawTemplate()
{
v8::HandleScope scope;
- v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(V8Proxy::checkNewLegal);
+ v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(V8ObjectConstructor::isValidConstructorMode);
return v8::Persistent<v8::FunctionTemplate>::New(result);
}
@@ -355,7 +362,7 @@ void StringCache::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
info.addHashMap(m_stringCache);
}
-PassRefPtr<DOMStringList> v8ValueToWebCoreDOMStringList(v8::Handle<v8::Value> value)
+PassRefPtr<DOMStringList> toDOMStringList(v8::Handle<v8::Value> value)
{
v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(value));
@@ -371,9 +378,71 @@ PassRefPtr<DOMStringList> v8ValueToWebCoreDOMStringList(v8::Handle<v8::Value> va
v8::Local<v8::Array> v8Array = v8::Local<v8::Array>::Cast(v8Value);
for (size_t i = 0; i < v8Array->Length(); ++i) {
v8::Local<v8::Value> indexedValue = v8Array->Get(v8Integer(i));
- ret->append(v8ValueToWebCoreString(indexedValue));
+ ret->append(toWebCoreString(indexedValue));
}
return ret.release();
}
+DOMWindow* toDOMWindow(v8::Handle<v8::Context> context)
+{
+ v8::Handle<v8::Object> global = context->Global();
+ ASSERT(!global.IsEmpty());
+ global = V8DOMWrapper::lookupDOMWrapper(V8DOMWindow::GetTemplate(), global);
+ ASSERT(!global.IsEmpty());
+ return V8DOMWindow::toNative(global);
+}
+
+Frame* toFrameIfNotDetached(v8::Handle<v8::Context> context)
+{
+ DOMWindow* window = toDOMWindow(context);
+ if (window->isCurrentlyDisplayedInFrame())
+ return window->frame();
+ // We return 0 here because |context| is detached from the Frame. If we
+ // did return |frame| we could get in trouble because the frame could be
+ // navigated to another security origin.
+ return 0;
+}
+
+V8PerContextData* perContextDataForCurrentWorld(Frame* frame)
+{
+ V8IsolatedContext* isolatedContext;
+ if (UNLIKELY(!!(isolatedContext = V8IsolatedContext::getEntered())))
+ return isolatedContext->perContextData();
+ return frame->script()->windowShell()->perContextData();
+}
+
+bool handleOutOfMemory()
+{
+ v8::Local<v8::Context> context = v8::Context::GetCurrent();
+
+ if (!context->HasOutOfMemoryException())
+ return false;
+
+ // Warning, error, disable JS for this frame?
+ Frame* frame = toFrameIfNotDetached(context);
+ if (!frame)
+ return true;
+
+ frame->script()->clearForClose();
+ frame->script()->windowShell()->destroyGlobal();
+
+#if PLATFORM(CHROMIUM)
+ PlatformSupport::notifyJSOutOfMemory(frame);
+#endif
+
+ if (Settings* settings = frame->settings())
+ settings->setScriptEnabled(false);
+
+ return true;
+}
+
+void crashIfV8IsDead()
+{
+ if (v8::V8::IsDead()) {
+ // FIXME: We temporarily deal with V8 internal error situations
+ // such as out-of-memory by crashing the renderer.
+ CRASH();
+ }
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/bindings/v8/V8Binding.h b/Source/WebCore/bindings/v8/V8Binding.h
index ca3afb649..a4c5f0b5d 100644
--- a/Source/WebCore/bindings/v8/V8Binding.h
+++ b/Source/WebCore/bindings/v8/V8Binding.h
@@ -32,19 +32,17 @@
#define V8Binding_h
#include "BindingSecurity.h"
-#include "DOMDataStore.h"
#include "Document.h"
-#include "PlatformString.h"
-#include "V8BindingHelpers.h"
#include "V8BindingMacros.h"
#include "V8DOMConfiguration.h"
+#include "V8DOMWindowShell.h"
#include "V8DOMWrapper.h"
-#include "V8GCController.h"
#include "V8HiddenPropertyName.h"
+#include "V8ObjectConstructor.h"
#include "V8PerIsolateData.h"
#include "V8Proxy.h"
+#include "V8ThrowException.h"
#include "V8ValueCache.h"
-#include <wtf/MathExtras.h>
#include <wtf/Noncopyable.h>
#include <wtf/text/AtomicString.h>
#include <v8.h>
@@ -52,57 +50,22 @@
namespace WebCore {
class DOMStringList;
- class EventListener;
- class EventTarget;
- class ExternalStringVisitor;
- class MemoryObjectInfo;
- class ScriptGCEventListener;
- class GCEventData {
- public:
- typedef Vector<ScriptGCEventListener*> GCEventListeners;
-
- GCEventData() : startTime(0.0), usedHeapSize(0) { }
- void clear()
- {
- startTime = 0.0;
- usedHeapSize = 0;
- }
- GCEventListeners& listeners() { return m_listeners; }
-
- // FIXME: Make these members private.
- double startTime;
- size_t usedHeapSize;
-
- private:
- GCEventListeners m_listeners;
- };
-
- class ConstructorMode {
- public:
- enum Mode {
- WrapExistingObject,
- CreateNewObject
- };
+ // Schedule a DOM exception to be thrown, if the exception code is different
+ // from zero.
+ v8::Handle<v8::Value> setDOMException(int, v8::Isolate*);
- ConstructorMode()
- {
- V8PerIsolateData* data = V8PerIsolateData::current();
- m_previous = data->m_constructorMode;
- data->m_constructorMode = WrapExistingObject;
- }
+ // Schedule a JavaScript error to be thrown.
+ v8::Handle<v8::Value> throwError(ErrorType, const char*, v8::Isolate* = 0);
- ~ConstructorMode()
- {
- V8PerIsolateData* data = V8PerIsolateData::current();
- data->m_constructorMode = m_previous;
- }
+ // Schedule a JavaScript error to be thrown.
+ v8::Handle<v8::Value> throwError(v8::Local<v8::Value>, v8::Isolate* = 0);
- static bool current() { return V8PerIsolateData::current()->m_constructorMode; }
+ // A helper for throwing JavaScript TypeError.
+ v8::Handle<v8::Value> throwTypeError(const char* = 0, v8::Isolate* = 0);
- private:
- bool m_previous;
- };
+ // A helper for throwing JavaScript TypeError for not enough arguments.
+ v8::Handle<v8::Value> throwNotEnoughArgumentsError(v8::Isolate*);
// Since v8::Null(isolate) crashes if we pass a null isolate,
// we need to use v8NullWithCheck(isolate) if an isolate can be null.
@@ -124,10 +87,10 @@ namespace WebCore {
// Convert v8 types to a WTF::String. If the V8 string is not already
// an external string then it is transformed into an external string at this
// point to avoid repeated conversions.
- String v8ValueToWebCoreString(v8::Handle<v8::Value>);
+ String toWebCoreString(v8::Handle<v8::Value>);
// Convert a V8 value to a WTF::AtomicString.
- AtomicString v8ValueToAtomicWebCoreString(v8::Handle<v8::Value>);
+ AtomicString toWebCoreAtomicString(v8::Handle<v8::Value>);
// Return a V8 external string that shares the underlying buffer with the given
// WebCore string. The reference counting mechanism is used to keep the
@@ -225,7 +188,7 @@ namespace WebCore {
struct NativeValueTraits<String> {
static inline String arrayNativeValue(const v8::Local<v8::Array>& array, size_t i)
{
- return v8ValueToWebCoreString(array->Get(i));
+ return toWebCoreString(array->Get(i));
}
};
@@ -267,7 +230,7 @@ namespace WebCore {
inline v8::Handle<v8::Value> toV8Sequence(v8::Handle<v8::Value> value, uint32_t& length)
{
if (!value->IsObject()) {
- V8Proxy::throwTypeError();
+ throwTypeError();
return v8Undefined();
}
@@ -277,7 +240,7 @@ namespace WebCore {
EXCEPTION_BLOCK(v8::Local<v8::Value>, lengthValue, object->Get(v8::String::New("length")));
if (lengthValue->IsUndefined() || lengthValue->IsNull()) {
- V8Proxy::throwTypeError();
+ throwTypeError();
return v8Undefined();
}
@@ -287,11 +250,6 @@ namespace WebCore {
return v8Value;
}
- // Enables caching v8 wrappers created for WTF::StringImpl. Currently this cache requires
- // all the calls (both to convert WTF::String to v8::String and to GC the handle)
- // to be performed on the main thread.
- void enableStringImplCache();
-
// Convert a value to a 32-bit integer. The conversion fails if the
// value cannot be converted to an integer or converts to nan or to an infinity.
int toInt32(v8::Handle<v8::Value> value, bool& ok);
@@ -324,17 +282,6 @@ namespace WebCore {
return static_cast<long long>(value->IntegerValue());
}
- // FIXME: Drop this in favor of the type specific v8ValueToWebCoreString when we rework the code generation.
- inline String toWebCoreString(v8::Handle<v8::Value> object)
- {
- return v8ValueToWebCoreString(object);
- }
-
- inline String toWebCoreString(const v8::Arguments& args, int index)
- {
- return v8ValueToWebCoreString(args[index]);
- }
-
// The string returned by this function is still owned by the argument
// and will be deallocated when the argument is deallocated.
inline const uint16_t* fromWebCoreString(const String& str)
@@ -379,12 +326,7 @@ namespace WebCore {
inline String toWebCoreStringWithNullCheck(v8::Handle<v8::Value> value)
{
- return value->IsNull() ? String() : v8ValueToWebCoreString(value);
- }
-
- inline AtomicString toAtomicWebCoreStringWithNullCheck(v8::Handle<v8::Value> value)
- {
- return value->IsNull() ? AtomicString() : v8ValueToAtomicWebCoreString(value);
+ return value->IsNull() ? String() : toWebCoreString(value);
}
inline String toWebCoreStringWithNullOrUndefinedCheck(v8::Handle<v8::Value> value)
@@ -392,9 +334,9 @@ namespace WebCore {
return (value->IsNull() || value->IsUndefined()) ? String() : toWebCoreString(value);
}
- inline v8::Handle<v8::String> v8UndetectableString(const String& str)
+ inline AtomicString toWebCoreAtomicStringWithNullCheck(v8::Handle<v8::Value> value)
{
- return v8::String::NewUndetectable(fromWebCoreString(str), str.length());
+ return value->IsNull() ? AtomicString() : toWebCoreAtomicString(value);
}
inline v8::Handle<v8::Value> v8StringOrNull(const String& str, v8::Isolate* isolate = 0)
@@ -407,11 +349,6 @@ namespace WebCore {
return str.isNull() ? v8::Handle<v8::Value>(v8::Undefined()) : v8::Handle<v8::Value>(v8String(str, isolate));
}
- inline v8::Handle<v8::Value> v8StringOrFalse(const String& str, v8::Isolate* isolate = 0)
- {
- return str.isNull() ? v8::Handle<v8::Value>(v8Boolean(false)) : v8::Handle<v8::Value>(v8String(str, isolate));
- }
-
inline double toWebCoreDate(v8::Handle<v8::Value> object)
{
return (object->IsDate() || object->IsNumber()) ? object->NumberValue() : std::numeric_limits<double>::quiet_NaN();
@@ -429,7 +366,23 @@ namespace WebCore {
String int32ToWebCoreString(int value);
- PassRefPtr<DOMStringList> v8ValueToWebCoreDOMStringList(v8::Handle<v8::Value>);
+ PassRefPtr<DOMStringList> toDOMStringList(v8::Handle<v8::Value>);
+
+ // Returns the window object associated with a context.
+ DOMWindow* toDOMWindow(v8::Handle<v8::Context>);
+
+ // Returns the frame object of the window object associated with
+ // a context, if the window is currently being displayed in the Frame.
+ Frame* toFrameIfNotDetached(v8::Handle<v8::Context>);
+
+ // Returns the PerContextData associated with a frame for the current isolated world.
+ V8PerContextData* perContextDataForCurrentWorld(Frame*);
+
+ // If the current context causes out of memory, JavaScript setting
+ // is disabled and it returns true.
+ bool handleOutOfMemory();
+
+ void crashIfV8IsDead();
class V8ParameterBase {
public:
diff --git a/Source/WebCore/bindings/v8/V8BindingHelpers.cpp b/Source/WebCore/bindings/v8/V8BindingHelpers.cpp
deleted file mode 100644
index eeb1a934c..000000000
--- a/Source/WebCore/bindings/v8/V8BindingHelpers.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-* Copyright (C) 2008, 2009 Google Inc. All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are
-* met:
-*
-* * Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-* * Redistributions in binary form must reproduce the above
-* copyright notice, this list of conditions and the following disclaimer
-* in the documentation and/or other materials provided with the
-* distribution.
-* * Neither the name of Google Inc. nor the names of its
-* contributors may be used to endorse or promote products derived from
-* this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "config.h"
-#include "V8BindingHelpers.h"
-
-#include "DOMWindow.h"
-#include "Frame.h"
-#include "NPV8Object.h"
-#include "V8Proxy.h"
-
-namespace WebCore {
-
-v8::Local<v8::Context> toV8Context(NPP npp, NPObject* npObject)
-{
- V8NPObject* object = reinterpret_cast<V8NPObject*>(npObject);
- DOMWindow* domWindow = object->rootObject;
- if (!domWindow || !domWindow->frame() || domWindow != domWindow->frame()->domWindow())
- return v8::Local<v8::Context>();
- return V8Proxy::mainWorldContext(object->rootObject->frame());
-}
-
-V8Proxy* toV8Proxy(NPObject* npObject)
-{
- V8NPObject* object = reinterpret_cast<V8NPObject*>(npObject);
- Frame* frame = object->rootObject->frame();
- if (!frame)
- return 0;
- return frame->script()->proxy();
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/bindings/v8/custom/V8CustomVoidCallback.cpp b/Source/WebCore/bindings/v8/V8Callback.cpp
index 896d1000c..54f572a55 100644
--- a/Source/WebCore/bindings/v8/custom/V8CustomVoidCallback.cpp
+++ b/Source/WebCore/bindings/v8/V8Callback.cpp
@@ -1,10 +1,10 @@
/*
- * Copyright (C) 2009 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 are
* met:
- *
+ *
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -14,7 +14,7 @@
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -29,40 +29,13 @@
*/
#include "config.h"
-#include "V8CustomVoidCallback.h"
+#include "V8Callback.h"
-#include "ScriptExecutionContext.h"
-#include "V8Binding.h"
-#include "V8Proxy.h"
+#include "Document.h"
+#include "ScriptController.h"
namespace WebCore {
-V8CustomVoidCallback::V8CustomVoidCallback(v8::Local<v8::Object> callback, ScriptExecutionContext *context)
- : m_callback(v8::Persistent<v8::Object>::New(callback))
- , m_scriptExecutionContext(context)
- , m_worldContext(UseCurrentWorld)
-{
-}
-
-V8CustomVoidCallback::~V8CustomVoidCallback()
-{
- m_callback.Dispose();
-}
-
-void V8CustomVoidCallback::handleEvent()
-{
- v8::HandleScope handleScope;
-
- v8::Handle<v8::Context> v8Context = toV8Context(m_scriptExecutionContext.get(), m_worldContext);
- if (v8Context.IsEmpty())
- return;
-
- v8::Context::Scope scope(v8Context);
-
- bool callbackReturnValue = false;
- invokeCallback(m_callback, 0, 0, callbackReturnValue, m_scriptExecutionContext.get());
-}
-
bool invokeCallback(v8::Persistent<v8::Object> callback, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue, ScriptExecutionContext* scriptExecutionContext)
{
return invokeCallback(callback, v8::Context::GetCurrent()->Global(), argc, argv, callbackReturnValue, scriptExecutionContext);
@@ -86,8 +59,7 @@ bool invokeCallback(v8::Persistent<v8::Object> callback, v8::Handle<v8::Object>
if (callbackFunction.IsEmpty())
return false;
- Frame* frame = scriptExecutionContext && scriptExecutionContext->isDocument() ? static_cast<Document*>(scriptExecutionContext)->frame() : 0;
- v8::Handle<v8::Value> result = V8Proxy::instrumentedCallFunction(frame, callbackFunction, thisObject, argc, argv);
+ v8::Handle<v8::Value> result = ScriptController::callFunctionWithInstrumentation(scriptExecutionContext, callbackFunction, thisObject, argc, argv);
callbackReturnValue = !result.IsEmpty() && result->BooleanValue();
return exceptionCatcher.HasCaught();
diff --git a/Source/WebCore/bindings/v8/V8BindingHelpers.h b/Source/WebCore/bindings/v8/V8Callback.h
index af5380cf8..9253647fc 100644
--- a/Source/WebCore/bindings/v8/V8BindingHelpers.h
+++ b/Source/WebCore/bindings/v8/V8Callback.h
@@ -1,5 +1,5 @@
/*
-* Copyright (C) 2006, 2007, 2008, 2009 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 are
@@ -28,20 +28,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef V8BindingHelpers_h
-#define V8BindingHelpers_h
+#ifndef V8Callback_h
+#define V8Callback_h
-#include "npruntime_internal.h"
#include <v8.h>
namespace WebCore {
-class V8Proxy;
+class ScriptExecutionContext;
-v8::Local<v8::Context> toV8Context(NPP, NPObject*);
-
-V8Proxy* toV8Proxy(NPObject*);
+bool invokeCallback(v8::Persistent<v8::Object> callback, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue, ScriptExecutionContext*);
+bool invokeCallback(v8::Persistent<v8::Object> callback, v8::Handle<v8::Object> thisObject, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue, ScriptExecutionContext*);
} // namespace WebCore
-#endif // V8BindingHelpers_h
+#endif // V8Callback_h
diff --git a/Source/WebCore/bindings/v8/V8Collection.cpp b/Source/WebCore/bindings/v8/V8Collection.cpp
index 8dcbcc1dd..a71dae34a 100644
--- a/Source/WebCore/bindings/v8/V8Collection.cpp
+++ b/Source/WebCore/bindings/v8/V8Collection.cpp
@@ -48,14 +48,14 @@ v8::Handle<v8::Value> toOptionsCollectionSetter(uint32_t index, v8::Handle<v8::V
// Check that the value is an HTMLOptionElement. If not, throw a TYPE_MISMATCH_ERR DOMException.
if (!V8HTMLOptionElement::HasInstance(value)) {
- V8Proxy::setDOMException(TYPE_MISMATCH_ERR, isolate);
+ setDOMException(TYPE_MISMATCH_ERR, isolate);
return value;
}
HTMLOptionElement* element = V8HTMLOptionElement::toNative(v8::Handle<v8::Object>::Cast(value));
base->setOption(index, element, ec);
- V8Proxy::setDOMException(ec, isolate);
+ setDOMException(ec, isolate);
return value;
}
diff --git a/Source/WebCore/bindings/v8/V8Collection.h b/Source/WebCore/bindings/v8/V8Collection.h
index ae542592a..281f8ec62 100644
--- a/Source/WebCore/bindings/v8/V8Collection.h
+++ b/Source/WebCore/bindings/v8/V8Collection.h
@@ -66,7 +66,7 @@ template<class Collection, class ItemType> static v8::Handle<v8::Value> getNamed
ASSERT(V8DOMWrapper::maybeDOMWrapper(object));
ASSERT(V8DOMWrapper::domWrapperType(object) != &V8Node::info);
Collection* collection = toNativeCollection<Collection>(object);
- AtomicString propertyName = toAtomicWebCoreStringWithNullCheck(name);
+ AtomicString propertyName = toWebCoreAtomicStringWithNullCheck(name);
return getV8Object<ItemType>(collection->namedItem(propertyName), isolate);
}
diff --git a/Source/WebCore/bindings/v8/V8DOMConfiguration.cpp b/Source/WebCore/bindings/v8/V8DOMConfiguration.cpp
index 6f0854f88..d6da3297a 100644
--- a/Source/WebCore/bindings/v8/V8DOMConfiguration.cpp
+++ b/Source/WebCore/bindings/v8/V8DOMConfiguration.cpp
@@ -49,8 +49,8 @@ void V8DOMConfiguration::batchConfigureConstants(v8::Handle<v8::FunctionTemplate
{
for (size_t i = 0; i < constantCount; ++i) {
const BatchedConstant* constant = &constants[i];
- functionDescriptor->Set(v8::String::New(constant->name), v8Integer(constant->value), v8::ReadOnly);
- prototype->Set(v8::String::New(constant->name), v8Integer(constant->value), v8::ReadOnly);
+ functionDescriptor->Set(v8::String::NewSymbol(constant->name), v8Integer(constant->value), v8::ReadOnly);
+ prototype->Set(v8::String::NewSymbol(constant->name), v8Integer(constant->value), v8::ReadOnly);
}
}
@@ -61,7 +61,7 @@ void V8DOMConfiguration::batchConfigureCallbacks(v8::Handle<v8::ObjectTemplate>
size_t callbackCount)
{
for (size_t i = 0; i < callbackCount; ++i)
- prototype->Set(v8::String::New(callbacks[i].name), v8::FunctionTemplate::New(callbacks[i].callback, v8Undefined(), signature), attributes);
+ prototype->Set(v8::String::NewSymbol(callbacks[i].name), v8::FunctionTemplate::New(callbacks[i].callback, v8Undefined(), signature), attributes);
}
v8::Local<v8::Signature> V8DOMConfiguration::configureTemplate(v8::Persistent<v8::FunctionTemplate> functionDescriptor,
@@ -73,7 +73,7 @@ v8::Local<v8::Signature> V8DOMConfiguration::configureTemplate(v8::Persistent<v8
const BatchedCallback* callbacks,
size_t callbackCount)
{
- functionDescriptor->SetClassName(v8::String::New(interfaceName));
+ functionDescriptor->SetClassName(v8::String::NewSymbol(interfaceName));
v8::Local<v8::ObjectTemplate> instance = functionDescriptor->InstanceTemplate();
instance->SetInternalFieldCount(fieldCount);
if (!parentClass.IsEmpty())
diff --git a/Source/WebCore/bindings/v8/V8DOMConfiguration.h b/Source/WebCore/bindings/v8/V8DOMConfiguration.h
index c37e697fe..6fb5f5e77 100644
--- a/Source/WebCore/bindings/v8/V8DOMConfiguration.h
+++ b/Source/WebCore/bindings/v8/V8DOMConfiguration.h
@@ -63,7 +63,7 @@ public:
v8::Handle<ObjectOrTemplate> prototype,
const BatchedAttribute& attribute)
{
- (attribute.onPrototype ? prototype : instance)->SetAccessor(v8::String::New(attribute.name),
+ (attribute.onPrototype ? prototype : instance)->SetAccessor(v8::String::NewSymbol(attribute.name),
attribute.getter,
attribute.setter,
v8::External::Wrap(attribute.data),
diff --git a/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp b/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
index 7f7903112..378ff2d5b 100644
--- a/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
+++ b/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
@@ -42,9 +42,9 @@
#include "PageGroup.h"
#include "PlatformSupport.h"
#include "RuntimeEnabledFeatures.h"
-#include "SafeAllocation.h"
#include "ScriptCallStack.h"
#include "ScriptCallStackFactory.h"
+#include "ScriptController.h"
#include "ScriptProfiler.h"
#include "SecurityOrigin.h"
#include "StorageNamespace.h"
@@ -59,6 +59,7 @@
#include "V8HiddenPropertyName.h"
#include "V8History.h"
#include "V8Location.h"
+#include "V8ObjectConstructor.h"
#include "V8PerContextData.h"
#include "V8Proxy.h"
#include "WorkerContextExecutionProxy.h"
@@ -334,7 +335,7 @@ bool V8DOMWindowShell::initContextIfNeeded()
return false;
}
- if (!installDOMWindow(v8Context, m_frame->domWindow())) {
+ if (!installDOMWindow(v8Context, m_frame->document()->domWindow())) {
disposeContextHandles();
return false;
}
@@ -370,16 +371,16 @@ v8::Persistent<v8::Context> V8DOMWindowShell::createNewContext(v8::Handle<v8::Ob
return result;
// Used to avoid sleep calls in unload handlers.
- V8Proxy::registerExtensionIfNeeded(DateExtension::get());
+ ScriptController::registerExtensionIfNeeded(DateExtension::get());
#if ENABLE(JAVASCRIPT_I18N_API)
// Enables experimental i18n API in V8.
if (RuntimeEnabledFeatures::javaScriptI18NAPIEnabled())
- V8Proxy::registerExtensionIfNeeded(v8_i18n::Extension::get());
+ ScriptController::registerExtensionIfNeeded(v8_i18n::Extension::get());
#endif
// Dynamically tell v8 about our extensions now.
- const V8Extensions& extensions = V8Proxy::extensions();
+ const V8Extensions& extensions = ScriptController::registeredExtensions();
OwnArrayPtr<const char*> extensionNames = adoptArrayPtr(new const char*[extensions.size()]);
int index = 0;
for (size_t i = 0; i < extensions.size(); ++i) {
@@ -410,7 +411,7 @@ bool V8DOMWindowShell::installDOMWindow(v8::Handle<v8::Context> context, DOMWind
{
// Create a new JS window object and use it as the prototype for the shadow global object.
v8::Handle<v8::Function> windowConstructor = V8DOMWrapper::constructorForType(&V8DOMWindow::info, window);
- v8::Local<v8::Object> jsWindow = SafeAllocation::newInstance(windowConstructor);
+ v8::Local<v8::Object> jsWindow = V8ObjectConstructor::newInstance(windowConstructor);
// Bail out if allocation failed.
if (jsWindow.IsEmpty())
return false;
@@ -488,6 +489,12 @@ void V8DOMWindowShell::updateDocumentWrapperCache()
}
ASSERT(documentWrapper->IsObject());
m_context->Global()->ForceSet(v8::String::New("document"), documentWrapper, static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete));
+
+ // We also stash a reference to the document on the real global object so that
+ // DOMWindow objects we obtain from JavaScript references are guaranteed to have
+ // live Document objects.
+ v8::Handle<v8::Object> v8RealGlobal = v8::Handle<v8::Object>::Cast(m_context->Global()->GetPrototype());
+ v8RealGlobal->SetHiddenValue(V8HiddenPropertyName::document(), documentWrapper);
}
void V8DOMWindowShell::clearDocumentWrapperCache()
@@ -556,7 +563,7 @@ void V8DOMWindowShell::updateDocument()
v8::Handle<v8::Value> getter(v8::Local<v8::String> property, const v8::AccessorInfo& info)
{
// FIXME(antonm): consider passing AtomicStringImpl directly.
- AtomicString name = v8ValueToAtomicWebCoreString(property);
+ AtomicString name = toWebCoreAtomicString(property);
HTMLDocument* htmlDocument = V8HTMLDocument::toNative(info.Holder());
ASSERT(htmlDocument);
v8::Handle<v8::Value> result = V8HTMLDocument::GetNamedProperty(htmlDocument, name, info.GetIsolate());
diff --git a/Source/WebCore/bindings/v8/V8DOMWrapper.cpp b/Source/WebCore/bindings/v8/V8DOMWrapper.cpp
index 922c96a8a..31ff31da3 100644
--- a/Source/WebCore/bindings/v8/V8DOMWrapper.cpp
+++ b/Source/WebCore/bindings/v8/V8DOMWrapper.cpp
@@ -37,7 +37,6 @@
#include "EventTargetInterfaces.h"
#include "Frame.h"
#include "FrameLoaderClient.h"
-#include "SafeAllocation.h"
#include "StylePropertySet.h"
#include "V8AbstractEventListener.h"
#include "V8Binding.h"
@@ -51,6 +50,7 @@
#include "V8NamedNodeMap.h"
#include "V8NodeFilterCondition.h"
#include "V8NodeList.h"
+#include "V8ObjectConstructor.h"
#include "V8PerContextData.h"
#include "V8Proxy.h"
#include "V8StyleSheet.h"
@@ -95,7 +95,7 @@ v8::Local<v8::Function> V8DOMWrapper::constructorForType(WrapperTypeInfo* type,
if (!frame)
return v8::Local<v8::Function>();
- if (V8PerContextData* contextData = V8Proxy::retrievePerContextData(frame))
+ if (V8PerContextData* contextData = perContextDataForCurrentWorld(frame))
return contextData->constructorForType(type);
return v8::Local<v8::Function>();
@@ -205,7 +205,7 @@ v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(V8Proxy* proxy, WrapperT
instance = contextData->createWrapperFromCache(type);
else {
v8::Local<v8::Function> function = type->getTemplate()->GetFunction();
- instance = SafeAllocation::newInstance(function);
+ instance = V8ObjectConstructor::newInstance(function);
}
if (!instance.IsEmpty()) {
diff --git a/Source/WebCore/bindings/v8/V8EventListener.cpp b/Source/WebCore/bindings/v8/V8EventListener.cpp
index 3d6ff74e3..a5eb85e83 100644
--- a/Source/WebCore/bindings/v8/V8EventListener.cpp
+++ b/Source/WebCore/bindings/v8/V8EventListener.cpp
@@ -93,7 +93,7 @@ v8::Local<v8::Value> V8EventListener::callListenerFunction(ScriptExecutionContex
if (!frame->script()->canExecuteScripts(AboutToExecuteScript))
return v8::Local<v8::Value>();
- return frame->script()->proxy()->callFunction(handlerFunction, receiver, 1, parameters);
+ return frame->script()->callFunction(handlerFunction, receiver, 1, parameters);
}
} // namespace WebCore
diff --git a/Source/WebCore/bindings/v8/V8GCController.cpp b/Source/WebCore/bindings/v8/V8GCController.cpp
index 4c3d57428..42380ca2a 100644
--- a/Source/WebCore/bindings/v8/V8GCController.cpp
+++ b/Source/WebCore/bindings/v8/V8GCController.cpp
@@ -48,6 +48,7 @@
#include "V8CSSStyleDeclaration.h"
#include "V8DOMImplementation.h"
#include "V8MessagePort.h"
+#include "V8RecursionScope.h"
#include "V8StyleSheet.h"
#include "V8StyleSheetList.h"
#include "WrapperTypeInfo.h"
@@ -519,5 +520,35 @@ void V8GCController::checkMemoryUsage()
#endif
}
+void V8GCController::hintForCollectGarbage()
+{
+ V8PerIsolateData* data = V8PerIsolateData::current();
+ if (!data->shouldCollectGarbageSoon())
+ return;
+ const int longIdlePauseInMS = 1000;
+ data->clearShouldCollectGarbageSoon();
+ v8::V8::ContextDisposedNotification();
+ v8::V8::IdleNotification(longIdlePauseInMS);
+}
+
+void V8GCController::collectGarbage()
+{
+ v8::HandleScope handleScope;
+
+ v8::Persistent<v8::Context> context = v8::Context::New();
+ if (context.IsEmpty())
+ return;
+ {
+ v8::Context::Scope scope(context);
+ v8::Local<v8::String> source = v8::String::New("if (gc) gc();");
+ v8::Local<v8::String> name = v8::String::New("gc");
+ v8::Handle<v8::Script> script = v8::Script::Compile(source, name);
+ if (!script.IsEmpty()) {
+ V8RecursionScope::MicrotaskSuppression scope;
+ script->Run();
+ }
+ }
+ context.Dispose();
+}
} // namespace WebCore
diff --git a/Source/WebCore/bindings/v8/V8GCController.h b/Source/WebCore/bindings/v8/V8GCController.h
index 9466c98bb..f5f9c3a3a 100644
--- a/Source/WebCore/bindings/v8/V8GCController.h
+++ b/Source/WebCore/bindings/v8/V8GCController.h
@@ -76,6 +76,8 @@ namespace WebCore {
static void gcEpilogue();
static void checkMemoryUsage();
+ static void hintForCollectGarbage();
+ static void collectGarbage();
private:
// Estimate of current working set.
diff --git a/Source/WebCore/bindings/v8/V8HiddenPropertyName.h b/Source/WebCore/bindings/v8/V8HiddenPropertyName.h
index 4bd2c41de..9ddfa30f5 100644
--- a/Source/WebCore/bindings/v8/V8HiddenPropertyName.h
+++ b/Source/WebCore/bindings/v8/V8HiddenPropertyName.h
@@ -36,17 +36,19 @@
namespace WebCore {
#define V8_HIDDEN_PROPERTIES(V) \
- V(listener) \
V(attributeListener) \
- V(scriptState) \
- V(sleepFunction) \
- V(toStringString) \
- V(event) \
- V(state) \
+ V(document) \
V(domStringMap) \
V(domTokenList) \
+ V(domTransactionData) \
+ V(event) \
+ V(listener) \
V(ownerNode) \
- V(textTracks)
+ V(scriptState) \
+ V(sleepFunction) \
+ V(state) \
+ V(textTracks) \
+ V(toStringString)
class V8HiddenPropertyName {
public:
diff --git a/Source/WebCore/bindings/v8/V8IsolatedContext.cpp b/Source/WebCore/bindings/v8/V8IsolatedContext.cpp
index a60013995..bd508946e 100644
--- a/Source/WebCore/bindings/v8/V8IsolatedContext.cpp
+++ b/Source/WebCore/bindings/v8/V8IsolatedContext.cpp
@@ -38,7 +38,6 @@
#include "SecurityOrigin.h"
#include "V8DOMWindow.h"
#include "V8PerContextData.h"
-#include "V8Proxy.h"
#include <wtf/StringExtras.h>
namespace WebCore {
@@ -65,25 +64,24 @@ static void setInjectedScriptContextDebugId(v8::Handle<v8::Context> targetContex
targetContext->SetData(v8::String::New(buffer));
}
-V8IsolatedContext::V8IsolatedContext(V8Proxy* proxy, int extensionGroup, int worldId)
+V8IsolatedContext::V8IsolatedContext(Frame* frame, int extensionGroup, int worldId)
: m_world(IsolatedWorld::create(worldId)),
- m_frame(proxy->frame())
+ m_frame(frame)
{
v8::HandleScope scope;
- v8::Handle<v8::Context> mainWorldContext = proxy->windowShell()->context();
+ v8::Handle<v8::Context> mainWorldContext = frame->script()->windowShell()->context();
if (mainWorldContext.IsEmpty())
return;
// FIXME: We should be creating a new V8DOMWindowShell here instead of riping out the context.
- m_context = SharedPersistent<v8::Context>::create(proxy->windowShell()->createNewContext(v8::Handle<v8::Object>(), extensionGroup, m_world->id()));
+ m_context = SharedPersistent<v8::Context>::create(frame->script()->windowShell()->createNewContext(v8::Handle<v8::Object>(), extensionGroup, m_world->id()));
if (m_context->get().IsEmpty())
return;
// Run code in the new context.
v8::Context::Scope contextScope(m_context->get());
- // Setup context id for JS debugger.
- setInjectedScriptContextDebugId(m_context->get(), proxy->contextDebugId(mainWorldContext));
+ setInjectedScriptContextDebugId(m_context->get(), ScriptController::contextDebugId(mainWorldContext));
getGlobalObject(m_context->get())->SetPointerInInternalField(V8DOMWindow::enteredIsolatedWorldIndex, this);
@@ -91,7 +89,7 @@ V8IsolatedContext::V8IsolatedContext(V8Proxy* proxy, int extensionGroup, int wor
m_perContextData->init();
// FIXME: This will go away once we have a windowShell for the isolated world.
- proxy->windowShell()->installDOMWindow(m_context->get(), m_frame->domWindow());
+ frame->script()->windowShell()->installDOMWindow(m_context->get(), m_frame->document()->domWindow());
// Using the default security token means that the canAccess is always
// called, which is slow.
diff --git a/Source/WebCore/bindings/v8/V8IsolatedContext.h b/Source/WebCore/bindings/v8/V8IsolatedContext.h
index ecd3f6e27..b191287cc 100644
--- a/Source/WebCore/bindings/v8/V8IsolatedContext.h
+++ b/Source/WebCore/bindings/v8/V8IsolatedContext.h
@@ -39,9 +39,9 @@
namespace WebCore {
+class Frame;
class SecurityOrigin;
class V8PerContextData;
-class V8Proxy;
// V8IsolatedContext
//
@@ -59,7 +59,7 @@ class V8IsolatedContext {
public:
// Creates an isolated world. To destroy it, call destroy().
// This will delete the isolated world when the context it owns is GC'd.
- V8IsolatedContext(V8Proxy*, int extensionGroup, int worldId);
+ V8IsolatedContext(Frame*, int extensionGroup, int worldId);
~V8IsolatedContext();
// Call this to destroy the isolated world. It will be deleted sometime
diff --git a/Source/WebCore/bindings/v8/V8LazyEventListener.cpp b/Source/WebCore/bindings/v8/V8LazyEventListener.cpp
index 9f5e41c5b..f10714669 100644
--- a/Source/WebCore/bindings/v8/V8LazyEventListener.cpp
+++ b/Source/WebCore/bindings/v8/V8LazyEventListener.cpp
@@ -100,7 +100,7 @@ v8::Local<v8::Value> V8LazyEventListener::callListenerFunction(ScriptExecutionCo
if (!frame->script()->canExecuteScripts(AboutToExecuteScript))
return v8::Local<v8::Value>();
- return frame->script()->proxy()->callFunction(handlerFunction, receiver, 1, parameters);
+ return frame->script()->callFunction(handlerFunction, receiver, 1, parameters);
}
static v8::Handle<v8::Value> V8LazyEventListenerToString(const v8::Arguments& args)
@@ -124,7 +124,7 @@ void V8LazyEventListener::prepareListenerObject(ScriptExecutionContext* context)
if (!frame->script()->canExecuteScripts(NotAboutToExecuteScript))
return;
// Use the outer scope to hold context.
- v8::Local<v8::Context> v8Context = worldContext().adjustedContext(frame->script()->proxy());
+ v8::Local<v8::Context> v8Context = worldContext().adjustedContext(frame->script());
// Bail out if we cannot get the context.
if (v8Context.IsEmpty())
return;
diff --git a/Source/WebCore/bindings/v8/V8NPObject.cpp b/Source/WebCore/bindings/v8/V8NPObject.cpp
index 3fee790f4..7bc073b83 100644
--- a/Source/WebCore/bindings/v8/V8NPObject.cpp
+++ b/Source/WebCore/bindings/v8/V8NPObject.cpp
@@ -34,13 +34,13 @@
#include "HTMLPlugInElement.h"
#include "NPV8Object.h"
-#include "SafeAllocation.h"
#include "V8Binding.h"
#include "V8DOMMap.h"
#include "V8HTMLAppletElement.h"
#include "V8HTMLEmbedElement.h"
#include "V8HTMLObjectElement.h"
#include "V8NPUtils.h"
+#include "V8ObjectConstructor.h"
#include "V8Proxy.h"
#include "npruntime_impl.h"
#include "npruntime_priv.h"
@@ -91,14 +91,14 @@ static v8::Handle<v8::Value> npObjectInvokeImpl(const v8::Arguments& args, Invok
// The holder object is not a subtype of HTMLPlugInElement, it must be an NPObject which has three
// internal fields.
if (args.Holder()->InternalFieldCount() != npObjectInternalFieldCount)
- return V8Proxy::throwError(V8Proxy::ReferenceError, "NPMethod called on non-NPObject", args.GetIsolate());
+ return throwError(ReferenceError, "NPMethod called on non-NPObject", args.GetIsolate());
npObject = v8ObjectToNPObject(args.Holder());
}
// Verify that our wrapper wasn't using a NPObject which has already been deleted.
if (!npObject || !_NPN_IsAlive(npObject))
- return V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted", args.GetIsolate());
+ return throwError(ReferenceError, "NPObject deleted", args.GetIsolate());
// Wrap up parameters.
int numArgs = args.Length();
@@ -132,7 +132,7 @@ static v8::Handle<v8::Value> npObjectInvokeImpl(const v8::Arguments& args, Invok
}
if (!retval)
- V8Proxy::throwError(V8Proxy::GeneralError, "Error calling method on NPObject.", args.GetIsolate());
+ throwError(GeneralError, "Error calling method on NPObject.", args.GetIsolate());
for (int i = 0; i < numArgs; i++)
_NPN_ReleaseVariantValue(&npArgs[i]);
@@ -189,12 +189,12 @@ static v8::Handle<v8::Value> npObjectGetProperty(v8::Local<v8::Object> self, NPI
// Verify that our wrapper wasn't using a NPObject which
// has already been deleted.
if (!npObject || !_NPN_IsAlive(npObject))
- return V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted", isolate);
+ return throwError(ReferenceError, "NPObject deleted", isolate);
if (npObject->_class->hasProperty && npObject->_class->getProperty && npObject->_class->hasProperty(npObject, identifier)) {
if (!_NPN_IsAlive(npObject))
- return V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted", isolate);
+ return throwError(ReferenceError, "NPObject deleted", isolate);
NPVariant result;
VOID_TO_NPVARIANT(result);
@@ -210,11 +210,11 @@ static v8::Handle<v8::Value> npObjectGetProperty(v8::Local<v8::Object> self, NPI
}
if (!_NPN_IsAlive(npObject))
- return V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted", isolate);
+ return throwError(ReferenceError, "NPObject deleted", isolate);
if (key->IsString() && npObject->_class->hasMethod && npObject->_class->hasMethod(npObject, identifier)) {
if (!_NPN_IsAlive(npObject))
- return V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted", isolate);
+ return throwError(ReferenceError, "NPObject deleted", isolate);
PrivateIdentifier* id = static_cast<PrivateIdentifier*>(identifier);
v8::Persistent<v8::FunctionTemplate> functionTemplate = staticTemplateMap().get(id);
@@ -272,13 +272,13 @@ static v8::Handle<v8::Value> npObjectSetProperty(v8::Local<v8::Object> self, NPI
// Verify that our wrapper wasn't using a NPObject which has already been deleted.
if (!npObject || !_NPN_IsAlive(npObject)) {
- V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted", isolate);
+ throwError(ReferenceError, "NPObject deleted", isolate);
return value; // Intercepted, but an exception was thrown.
}
if (npObject->_class->hasProperty && npObject->_class->setProperty && npObject->_class->hasProperty(npObject, identifier)) {
if (!_NPN_IsAlive(npObject))
- return V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted", isolate);
+ return throwError(ReferenceError, "NPObject deleted", isolate);
NPVariant npValue;
VOID_TO_NPVARIANT(npValue);
@@ -324,7 +324,7 @@ v8::Handle<v8::Array> npObjectPropertyEnumerator(const v8::AccessorInfo& info, b
// Verify that our wrapper wasn't using a NPObject which
// has already been deleted.
if (!npObject || !_NPN_IsAlive(npObject))
- V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted", info.GetIsolate());
+ throwError(ReferenceError, "NPObject deleted", info.GetIsolate());
if (NP_CLASS_STRUCT_VERSION_HAS_ENUM(npObject->_class) && npObject->_class->enumerate) {
uint32_t count;
@@ -407,7 +407,7 @@ v8::Local<v8::Object> createV8ObjectForNPObject(NPObject* object, NPObject* root
}
v8::Handle<v8::Function> v8Function = npObjectDesc->GetFunction();
- v8::Local<v8::Object> value = SafeAllocation::newInstance(v8Function);
+ v8::Local<v8::Object> value = V8ObjectConstructor::newInstance(v8Function);
// If we were unable to allocate the instance, we avoid wrapping and registering the NP object.
if (value.IsEmpty())
diff --git a/Source/WebCore/bindings/v8/V8NPUtils.cpp b/Source/WebCore/bindings/v8/V8NPUtils.cpp
index 5a626d9ce..13cd55ef6 100644
--- a/Source/WebCore/bindings/v8/V8NPUtils.cpp
+++ b/Source/WebCore/bindings/v8/V8NPUtils.cpp
@@ -69,7 +69,7 @@ void convertV8ObjectToNPVariant(v8::Local<v8::Value> object, NPObject* owner, NP
str->WriteUtf8(utf8Chars, length, 0, v8::String::HINT_MANY_WRITES_EXPECTED);
STRINGN_TO_NPVARIANT(utf8Chars, length-1, *result);
} else if (object->IsObject()) {
- DOMWindow* window = V8Proxy::retrieveWindow(v8::Context::GetCurrent());
+ DOMWindow* window = toDOMWindow(v8::Context::GetCurrent());
NPObject* npobject = npCreateV8ScriptObject(0, v8::Handle<v8::Object>::Cast(object), window);
if (npobject)
_NPN_RegisterObject(npobject, owner);
diff --git a/Source/WebCore/bindings/v8/V8NodeFilterCondition.cpp b/Source/WebCore/bindings/v8/V8NodeFilterCondition.cpp
index 70db47de2..bc52a38f3 100644
--- a/Source/WebCore/bindings/v8/V8NodeFilterCondition.cpp
+++ b/Source/WebCore/bindings/v8/V8NodeFilterCondition.cpp
@@ -33,9 +33,9 @@
#include "Node.h"
#include "NodeFilter.h"
+#include "ScriptController.h"
#include "ScriptState.h"
#include "V8Node.h"
-#include "V8Proxy.h"
#include <wtf/OwnArrayPtr.h>
@@ -73,7 +73,7 @@ short V8NodeFilterCondition::acceptNode(ScriptState* state, Node* node) const
else {
v8::Local<v8::Value> value = m_filter->ToObject()->Get(v8::String::New("acceptNode"));
if (!value->IsFunction()) {
- V8Proxy::throwTypeError("NodeFilter object does not have an acceptNode function");
+ throwTypeError("NodeFilter object does not have an acceptNode function");
return NodeFilter::FILTER_REJECT;
}
callback = v8::Handle<v8::Function>::Cast(value);
@@ -83,7 +83,7 @@ short V8NodeFilterCondition::acceptNode(ScriptState* state, Node* node) const
OwnArrayPtr<v8::Handle<v8::Value> > args = adoptArrayPtr(new v8::Handle<v8::Value>[1]);
args[0] = toV8(node);
- v8::Handle<v8::Value> result = V8Proxy::instrumentedCallFunction(0 /* frame */, callback, object, 1, args.get());
+ v8::Handle<v8::Value> result = ScriptController::callFunctionWithInstrumentation(0, callback, object, 1, args.get());
if (exceptionCatcher.HasCaught()) {
state->setException(exceptionCatcher.Exception());
diff --git a/Source/WebCore/bindings/v8/V8ObjectConstructor.cpp b/Source/WebCore/bindings/v8/V8ObjectConstructor.cpp
new file mode 100644
index 000000000..f7877450a
--- /dev/null
+++ b/Source/WebCore/bindings/v8/V8ObjectConstructor.cpp
@@ -0,0 +1,92 @@
+/*
+ * 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 "V8ObjectConstructor.h"
+
+#include "Frame.h"
+#include "V8Binding.h"
+#include "V8RecursionScope.h"
+
+#if PLATFORM(CHROMIUM)
+#include "TraceEvent.h"
+#endif
+
+namespace WebCore {
+
+v8::Local<v8::Object> V8ObjectConstructor::newInstance(v8::Handle<v8::Function> function)
+{
+ if (function.IsEmpty())
+ return v8::Local<v8::Object>();
+ ConstructorMode constructorMode;
+ V8RecursionScope::MicrotaskSuppression scope;
+ v8::Local<v8::Object> result = function->NewInstance();
+ crashIfV8IsDead();
+ return result;
+}
+
+v8::Local<v8::Object> V8ObjectConstructor::newInstance(v8::Handle<v8::ObjectTemplate> objectTemplate)
+{
+ if (objectTemplate.IsEmpty())
+ return v8::Local<v8::Object>();
+ ConstructorMode constructorMode;
+ V8RecursionScope::MicrotaskSuppression scope;
+ v8::Local<v8::Object> result = objectTemplate->NewInstance();
+ crashIfV8IsDead();
+ return result;
+}
+
+v8::Local<v8::Object> V8ObjectConstructor::newInstance(v8::Handle<v8::Function> function, int argc, v8::Handle<v8::Value> argv[])
+{
+ if (function.IsEmpty())
+ return v8::Local<v8::Object>();
+ ConstructorMode constructorMode;
+ V8RecursionScope::MicrotaskSuppression scope;
+ v8::Local<v8::Object> result = function->NewInstance(argc, argv);
+ crashIfV8IsDead();
+ return result;
+}
+
+v8::Local<v8::Object> V8ObjectConstructor::newInstanceInDocument(v8::Handle<v8::Function> function, int argc, v8::Handle<v8::Value> argv[], Document* document)
+{
+#if PLATFORM(CHROMIUM)
+ TRACE_EVENT0("v8", "v8.newInstance");
+#endif
+
+ // No artificial limitations on the depth of recursion, see comment in
+ // V8Proxy::callFunction.
+ V8RecursionScope recursionScope(document);
+ v8::Local<v8::Object> result = function->NewInstance(argc, argv);
+ crashIfV8IsDead();
+ return result;
+}
+
+v8::Handle<v8::Value> V8ObjectConstructor::isValidConstructorMode(const v8::Arguments& args)
+{
+ if (ConstructorMode::current() == ConstructorMode::CreateNewObject)
+ return throwTypeError("Illegal constructor", args.GetIsolate());
+ return args.This();
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/bindings/v8/SafeAllocation.h b/Source/WebCore/bindings/v8/V8ObjectConstructor.h
index c3b34aebf..1e401c731 100644
--- a/Source/WebCore/bindings/v8/SafeAllocation.h
+++ b/Source/WebCore/bindings/v8/V8ObjectConstructor.h
@@ -28,50 +28,53 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SafeAllocation_h
-#define SafeAllocation_h
+#ifndef V8ObjectConstructor_h
+#define V8ObjectConstructor_h
-#include "V8Binding.h"
-#include "V8RecursionScope.h"
+#include "V8PerIsolateData.h"
#include <v8.h>
namespace WebCore {
-class SafeAllocation {
+class Document;
+
+class ConstructorMode {
public:
- static inline v8::Local<v8::Object> newInstance(v8::Handle<v8::Function>);
- static inline v8::Local<v8::Object> newInstance(v8::Handle<v8::ObjectTemplate>);
- static inline v8::Local<v8::Object> newInstance(v8::Handle<v8::Function>, int argc, v8::Handle<v8::Value> argv[]);
-};
+ enum Mode {
+ WrapExistingObject,
+ CreateNewObject
+ };
+
+ ConstructorMode()
+ {
+ V8PerIsolateData* data = V8PerIsolateData::current();
+ m_previous = data->m_constructorMode;
+ data->m_constructorMode = WrapExistingObject;
+ }
+
+ ~ConstructorMode()
+ {
+ V8PerIsolateData* data = V8PerIsolateData::current();
+ data->m_constructorMode = m_previous;
+ }
-v8::Local<v8::Object> SafeAllocation::newInstance(v8::Handle<v8::Function> function)
-{
- if (function.IsEmpty())
- return v8::Local<v8::Object>();
- ConstructorMode constructorMode;
- V8RecursionScope::MicrotaskSuppression scope;
- return function->NewInstance();
-}
+ static bool current() { return V8PerIsolateData::current()->m_constructorMode; }
-v8::Local<v8::Object> SafeAllocation::newInstance(v8::Handle<v8::ObjectTemplate> objectTemplate)
-{
- if (objectTemplate.IsEmpty())
- return v8::Local<v8::Object>();
- ConstructorMode constructorMode;
- V8RecursionScope::MicrotaskSuppression scope;
- return objectTemplate->NewInstance();
-}
+private:
+ bool m_previous;
+};
+
+class V8ObjectConstructor {
+public:
+ static v8::Local<v8::Object> newInstance(v8::Handle<v8::Function>);
+ static v8::Local<v8::Object> newInstance(v8::Handle<v8::ObjectTemplate>);
+ static v8::Local<v8::Object> newInstance(v8::Handle<v8::Function>, int, v8::Handle<v8::Value> argv[]);
+ static v8::Local<v8::Object> newInstanceInDocument(v8::Handle<v8::Function>, int, v8::Handle<v8::Value> argv[], Document*);
-v8::Local<v8::Object> SafeAllocation::newInstance(v8::Handle<v8::Function> function, int argc, v8::Handle<v8::Value> argv[])
-{
- if (function.IsEmpty())
- return v8::Local<v8::Object>();
- ConstructorMode constructorMode;
- V8RecursionScope::MicrotaskSuppression scope;
- return function->NewInstance(argc, argv);
-}
+ static v8::Handle<v8::Value> isValidConstructorMode(const v8::Arguments&);
+};
} // namespace WebCore
-#endif // SafeAllocation_h
+#endif // V8ObjectConstructor_h
diff --git a/Source/WebCore/bindings/v8/V8PerContextData.cpp b/Source/WebCore/bindings/v8/V8PerContextData.cpp
index b2d750a7a..4b79535a7 100644
--- a/Source/WebCore/bindings/v8/V8PerContextData.cpp
+++ b/Source/WebCore/bindings/v8/V8PerContextData.cpp
@@ -31,7 +31,7 @@
#include "config.h"
#include "V8PerContextData.h"
-#include "SafeAllocation.h"
+#include "V8ObjectConstructor.h"
namespace WebCore {
@@ -92,7 +92,7 @@ v8::Local<v8::Object> V8PerContextData::createWrapperFromCacheSlowCase(WrapperTy
v8::Context::Scope scope(m_context);
v8::Local<v8::Function> function = constructorForType(type);
- v8::Local<v8::Object> instance = SafeAllocation::newInstance(function);
+ v8::Local<v8::Object> instance = V8ObjectConstructor::newInstance(function);
if (!instance.IsEmpty()) {
m_wrapperBoilerplates.set(type, v8::Persistent<v8::Object>::New(instance));
return instance->Clone();
diff --git a/Source/WebCore/bindings/v8/V8PerIsolateData.cpp b/Source/WebCore/bindings/v8/V8PerIsolateData.cpp
index b57026a66..16e4b0ede 100644
--- a/Source/WebCore/bindings/v8/V8PerIsolateData.cpp
+++ b/Source/WebCore/bindings/v8/V8PerIsolateData.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "V8PerIsolateData.h"
+#include "ScriptGCEvent.h"
#include "V8Binding.h"
namespace WebCore {
@@ -84,4 +85,25 @@ void V8PerIsolateData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) con
info.addInstrumentedMember(m_domDataList[i]);
}
+#if ENABLE(INSPECTOR)
+void V8PerIsolateData::visitExternalStrings(ExternalStringVisitor* visitor)
+{
+ v8::HandleScope handleScope;
+ class VisitorImpl : public v8::ExternalResourceVisitor {
+ public:
+ VisitorImpl(ExternalStringVisitor* visitor) : m_visitor(visitor) { }
+ virtual ~VisitorImpl() { }
+ virtual void VisitExternalString(v8::Handle<v8::String> string)
+ {
+ WebCoreStringResource* resource = static_cast<WebCoreStringResource*>(string->GetExternalStringResource());
+ if (resource)
+ resource->visitStrings(m_visitor);
+ }
+ private:
+ ExternalStringVisitor* m_visitor;
+ } v8Visitor(visitor);
+ v8::V8::VisitExternalResources(&v8Visitor);
+}
+#endif
+
} // namespace WebCore
diff --git a/Source/WebCore/bindings/v8/V8Proxy.cpp b/Source/WebCore/bindings/v8/V8Proxy.cpp
index 683292812..b1a0fa0a4 100644
--- a/Source/WebCore/bindings/v8/V8Proxy.cpp
+++ b/Source/WebCore/bindings/v8/V8Proxy.cpp
@@ -69,7 +69,6 @@
#include <wtf/StdLibExtras.h>
#include <wtf/StringExtras.h>
#include <wtf/UnusedParam.h>
-#include <wtf/text/StringBuilder.h>
#include <wtf/text/WTFString.h>
#if PLATFORM(CHROMIUM)
@@ -105,28 +104,20 @@ void V8Proxy::reportUnsafeAccessTo(Document* targetDocument)
sourceDocument->addConsoleMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, str, stackTrace.release());
}
-static void handleFatalErrorInV8()
-{
- // FIXME: We temporarily deal with V8 internal error situations
- // such as out-of-memory by crashing the renderer.
- CRASH();
-}
-
+// FIXME: This will be soon removed when we move runScript() to ScriptController.
static v8::Local<v8::Value> handleMaxRecursionDepthExceeded()
{
- V8Proxy::throwError(V8Proxy::RangeError, "Maximum call stack size exceeded.");
+ throwError(RangeError, "Maximum call stack size exceeded.");
return v8::Local<v8::Value>();
}
V8Proxy::V8Proxy(Frame* frame)
: m_frame(frame)
- , m_windowShell(V8DOMWindowShell::create(frame))
{
}
V8Proxy::~V8Proxy()
{
- clearForClose();
windowShell()->destroyGlobal();
}
@@ -141,83 +132,6 @@ v8::Handle<v8::Script> V8Proxy::compileScript(v8::Handle<v8::String> code, const
return script;
}
-bool V8Proxy::handleOutOfMemory()
-{
- v8::Local<v8::Context> context = v8::Context::GetCurrent();
-
- if (!context->HasOutOfMemoryException())
- return false;
-
- // Warning, error, disable JS for this frame?
- Frame* frame = V8Proxy::retrieveFrame(context);
- if (!frame)
- return true;
-
- frame->script()->proxy()->clearForClose();
- frame->script()->windowShell()->destroyGlobal();
-
-#if PLATFORM(CHROMIUM)
- PlatformSupport::notifyJSOutOfMemory(frame);
-#endif
-
- if (Settings* settings = frame->settings())
- settings->setScriptEnabled(false);
-
- return true;
-}
-
-v8::Local<v8::Array> V8Proxy::evaluateInIsolatedWorld(int worldID, const Vector<ScriptSourceCode>& sources, int extensionGroup)
-{
- // FIXME: This will need to get reorganized once we have a windowShell for the isolated world.
- if (!windowShell()->initContextIfNeeded())
- return v8::Local<v8::Array>();
-
- v8::HandleScope handleScope;
- V8IsolatedContext* isolatedContext = 0;
-
- if (worldID > 0) {
- IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(worldID);
- if (iter != m_isolatedWorlds.end()) {
- isolatedContext = iter->second;
- } else {
- isolatedContext = new V8IsolatedContext(this, extensionGroup, worldID);
- if (isolatedContext->context().IsEmpty()) {
- delete isolatedContext;
- return v8::Local<v8::Array>();
- }
-
- // FIXME: We should change this to using window shells to match JSC.
- m_isolatedWorlds.set(worldID, isolatedContext);
- }
-
- IsolatedWorldSecurityOriginMap::iterator securityOriginIter = m_isolatedWorldSecurityOrigins.find(worldID);
- if (securityOriginIter != m_isolatedWorldSecurityOrigins.end())
- isolatedContext->setSecurityOrigin(securityOriginIter->second);
- } else {
- isolatedContext = new V8IsolatedContext(this, extensionGroup, worldID);
- if (isolatedContext->context().IsEmpty()) {
- delete isolatedContext;
- return v8::Local<v8::Array>();
- }
- }
-
- v8::Local<v8::Context> context = v8::Local<v8::Context>::New(isolatedContext->context());
- v8::Context::Scope context_scope(context);
- v8::Local<v8::Array> results = v8::Array::New(sources.size());
-
- for (size_t i = 0; i < sources.size(); ++i) {
- v8::Local<v8::Value> evaluationResult = evaluate(sources[i], 0);
- if (evaluationResult.IsEmpty())
- evaluationResult = v8::Local<v8::Value>::New(v8::Undefined());
- results->Set(i, evaluationResult);
- }
-
- if (worldID == 0)
- isolatedContext->destroy();
-
- return handleScope.Close(results);
-}
-
PassOwnPtr<v8::ScriptData> V8Proxy::precompileScript(v8::Handle<v8::String> code, CachedScript* cachedScript)
{
// A pseudo-randomly chosen ID used to store and retrieve V8 ScriptData from
@@ -315,248 +229,24 @@ v8::Local<v8::Value> V8Proxy::runScript(v8::Handle<v8::Script> script)
if (result.IsEmpty())
return v8::Local<v8::Value>();
- if (v8::V8::IsDead())
- handleFatalErrorInV8();
-
- return result;
-}
-
-v8::Local<v8::Value> V8Proxy::callFunction(v8::Handle<v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> args[])
-{
- // Keep Frame (and therefore ScriptController and V8Proxy) alive.
- RefPtr<Frame> protect(frame());
- return V8Proxy::instrumentedCallFunction(frame(), function, receiver, argc, args);
-}
-
-static inline void resourceInfo(const v8::Handle<v8::Function> function, String& resourceName, int& lineNumber)
-{
- v8::ScriptOrigin origin = function->GetScriptOrigin();
- if (origin.ResourceName().IsEmpty()) {
- resourceName = "undefined";
- lineNumber = 1;
- } else {
- resourceName = toWebCoreString(origin.ResourceName());
- lineNumber = function->GetScriptLineNumber() + 1;
- }
-}
-
-static inline String resourceString(const v8::Handle<v8::Function> function)
-{
- String resourceName;
- int lineNumber;
- resourceInfo(function, resourceName, lineNumber);
-
- StringBuilder builder;
- builder.append(resourceName);
- builder.append(':');
- builder.append(String::number(lineNumber));
- return builder.toString();
-}
-
-v8::Local<v8::Value> V8Proxy::instrumentedCallFunction(Frame* frame, v8::Handle<v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> args[])
-{
- V8GCController::checkMemoryUsage();
-
- if (V8RecursionScope::recursionLevel() >= kMaxRecursionDepth)
- return handleMaxRecursionDepthExceeded();
-
- ScriptExecutionContext* context = frame ? frame->document() : 0;
-
- InspectorInstrumentationCookie cookie;
- if (InspectorInstrumentation::hasFrontends() && context) {
- String resourceName;
- int lineNumber;
- resourceInfo(function, resourceName, lineNumber);
- cookie = InspectorInstrumentation::willCallFunction(context, resourceName, lineNumber);
- }
-
- v8::Local<v8::Value> result;
- {
-#if PLATFORM(CHROMIUM)
- TRACE_EVENT1("v8", "v8.callFunction", "callsite", resourceString(function).utf8());
-#endif
- V8RecursionScope recursionScope(context);
- result = function->Call(receiver, argc, args);
- }
-
- InspectorInstrumentation::didCallFunction(cookie);
-
- if (v8::V8::IsDead())
- handleFatalErrorInV8();
-
- return result;
-}
-
-v8::Local<v8::Value> V8Proxy::newInstance(v8::Handle<v8::Function> constructor, int argc, v8::Handle<v8::Value> args[])
-{
-#if PLATFORM(CHROMIUM)
- TRACE_EVENT0("v8", "v8.newInstance");
-#endif
-
- // No artificial limitations on the depth of recursion, see comment in
- // V8Proxy::callFunction.
- v8::Local<v8::Value> result;
- {
- V8RecursionScope recursionScope(frame() ? frame()->document() : 0);
- result = constructor->NewInstance(argc, args);
- }
-
- if (v8::V8::IsDead())
- handleFatalErrorInV8();
-
+ crashIfV8IsDead();
return result;
}
-DOMWindow* V8Proxy::retrieveWindow(v8::Handle<v8::Context> context)
-{
- v8::Handle<v8::Object> global = context->Global();
- ASSERT(!global.IsEmpty());
- global = V8DOMWrapper::lookupDOMWrapper(V8DOMWindow::GetTemplate(), global);
- ASSERT(!global.IsEmpty());
- return V8DOMWindow::toNative(global);
-}
-
-Frame* V8Proxy::retrieveFrame(v8::Handle<v8::Context> context)
-{
- DOMWindow* window = retrieveWindow(context);
- Frame* frame = window->frame();
- if (frame && frame->domWindow() == window)
- return frame;
- // We return 0 here because |context| is detached from the Frame. If we
- // did return |frame| we could get in trouble because the frame could be
- // navigated to another security origin.
- return 0;
-}
-
-V8PerContextData* V8Proxy::retrievePerContextData(Frame* frame)
-{
- V8IsolatedContext* isolatedContext;
- if (UNLIKELY(!!(isolatedContext = V8IsolatedContext::getEntered())))
- return isolatedContext->perContextData();
- return frame->script()->windowShell()->perContextData();
-}
-
-void V8Proxy::resetIsolatedWorlds()
-{
- for (IsolatedWorldMap::iterator iter = m_isolatedWorlds.begin();
- iter != m_isolatedWorlds.end(); ++iter) {
- iter->second->destroy();
- }
- m_isolatedWorlds.clear();
- m_isolatedWorldSecurityOrigins.clear();
-}
-
-void V8Proxy::hintForGCIfNecessary()
-{
- V8PerIsolateData* data = V8PerIsolateData::current();
- if (data->shouldCollectGarbageSoon()) {
- const int longIdlePauseInMs = 1000;
- data->clearShouldCollectGarbageSoon();
- v8::V8::ContextDisposedNotification();
- v8::V8::IdleNotification(longIdlePauseInMs);
- }
-}
-
-void V8Proxy::clearForClose()
-{
- resetIsolatedWorlds();
- hintForGCIfNecessary();
- windowShell()->clearForClose();
-}
-
-void V8Proxy::clearForNavigation()
-{
- resetIsolatedWorlds();
- hintForGCIfNecessary();
- windowShell()->clearForNavigation();
-}
-
-static v8::Handle<v8::Value> DOMExceptionStackGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
-{
- ASSERT(info.Data()->IsObject());
- return info.Data()->ToObject()->Get(v8String("stack", info.GetIsolate()));
-}
-
-static void DOMExceptionStackSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
-{
- ASSERT(info.Data()->IsObject());
- info.Data()->ToObject()->Set(v8String("stack", info.GetIsolate()), value);
-}
-
-#define TRY_TO_CREATE_EXCEPTION(interfaceName) \
- case interfaceName##Type: \
- exception = toV8(interfaceName::create(description), isolate); \
- break;
-
-v8::Handle<v8::Value> V8Proxy::setDOMException(int ec, v8::Isolate* isolate)
-{
- if (ec <= 0 || v8::V8::IsExecutionTerminating())
- return v8Undefined();
-
- if (ec == NATIVE_TYPE_ERR) {
- const char* message = 0;
- return throwTypeError(message, isolate);
- }
-
- ExceptionCodeDescription description(ec);
-
- v8::Handle<v8::Value> exception;
- switch (description.type) {
- DOM_EXCEPTION_INTERFACES_FOR_EACH(TRY_TO_CREATE_EXCEPTION)
- }
-
- if (exception.IsEmpty())
- return v8Undefined();
-
- // Attach an Error object to the DOMException. This is then lazily used to get the stack value.
- v8::Handle<v8::Value> error = v8::Exception::Error(v8String(description.description, isolate));
- ASSERT(!error.IsEmpty());
- ASSERT(exception->IsObject());
- exception->ToObject()->SetAccessor(v8String("stack", isolate), DOMExceptionStackGetter, DOMExceptionStackSetter, error);
-
- return v8::ThrowException(exception);
-}
-
-#undef TRY_TO_CREATE_EXCEPTION
-
-v8::Handle<v8::Value> V8Proxy::throwError(ErrorType type, const char* message, v8::Isolate* isolate)
-{
- switch (type) {
- case RangeError:
- return v8::ThrowException(v8::Exception::RangeError(v8String(message, isolate)));
- case ReferenceError:
- return v8::ThrowException(v8::Exception::ReferenceError(v8String(message, isolate)));
- case SyntaxError:
- return v8::ThrowException(v8::Exception::SyntaxError(v8String(message, isolate)));
- case TypeError:
- return v8::ThrowException(v8::Exception::TypeError(v8String(message, isolate)));
- case GeneralError:
- return v8::ThrowException(v8::Exception::Error(v8String(message, isolate)));
- default:
- ASSERT_NOT_REACHED();
- return v8Undefined();
- }
-}
-
-v8::Handle<v8::Value> V8Proxy::throwTypeError(const char* message, v8::Isolate* isolate)
+V8DOMWindowShell* V8Proxy::windowShell() const
{
- return throwError(TypeError, (message ? message : "Type error"), isolate);
-}
-
-v8::Handle<v8::Value> V8Proxy::throwNotEnoughArgumentsError(v8::Isolate* isolate)
-{
- return throwError(TypeError, "Not enough arguments", isolate);
+ return frame()->script()->windowShell();
}
v8::Local<v8::Context> V8Proxy::context(Frame* frame)
{
- v8::Local<v8::Context> context = V8Proxy::mainWorldContext(frame);
+ v8::Local<v8::Context> context = ScriptController::mainWorldContext(frame);
if (context.IsEmpty())
return v8::Local<v8::Context>();
if (V8IsolatedContext* isolatedContext = V8IsolatedContext::getEntered()) {
context = v8::Local<v8::Context>::New(isolatedContext->context());
- if (frame != V8Proxy::retrieveFrame(context))
+ if (frame != toFrameIfNotDetached(context))
return v8::Local<v8::Context>();
}
@@ -567,17 +257,11 @@ v8::Local<v8::Context> V8Proxy::context()
{
if (V8IsolatedContext* isolatedContext = V8IsolatedContext::getEntered()) {
RefPtr<SharedPersistent<v8::Context> > context = isolatedContext->sharedContext();
- if (m_frame != V8Proxy::retrieveFrame(context->get()))
+ if (m_frame != toFrameIfNotDetached(context->get()))
return v8::Local<v8::Context>();
return v8::Local<v8::Context>::New(context->get());
}
- return mainWorldContext();
-}
-
-v8::Local<v8::Context> V8Proxy::mainWorldContext()
-{
- windowShell()->initContextIfNeeded();
- return v8::Local<v8::Context>::New(windowShell()->context());
+ return frame()->script()->mainWorldContext();
}
v8::Local<v8::Context> V8Proxy::isolatedWorldContext(int worldId)
@@ -593,7 +277,7 @@ bool V8Proxy::matchesCurrentContext()
v8::Handle<v8::Context> context;
if (V8IsolatedContext* isolatedContext = V8IsolatedContext::getEntered()) {
context = isolatedContext->sharedContext()->get();
- if (m_frame != V8Proxy::retrieveFrame(context))
+ if (m_frame != toFrameIfNotDetached(context))
return false;
} else {
windowShell()->initContextIfNeeded();
@@ -602,75 +286,11 @@ bool V8Proxy::matchesCurrentContext()
return context == context->GetCurrent();
}
-v8::Local<v8::Context> V8Proxy::mainWorldContext(Frame* frame)
-{
- if (!frame)
- return v8::Local<v8::Context>();
-
- return frame->script()->proxy()->mainWorldContext();
-}
-
-v8::Handle<v8::Value> V8Proxy::checkNewLegal(const v8::Arguments& args)
-{
- if (ConstructorMode::current() == ConstructorMode::CreateNewObject)
- return throwError(TypeError, "Illegal constructor", args.GetIsolate());
-
- return args.This();
-}
-
-V8Extensions& V8Proxy::extensions()
-{
- DEFINE_STATIC_LOCAL(V8Extensions, extensions, ());
- return extensions;
-}
-
-void V8Proxy::registerExtensionIfNeeded(v8::Extension* extension)
-{
- const V8Extensions& registeredExtensions = extensions();
- for (size_t i = 0; i < registeredExtensions.size(); ++i) {
- if (registeredExtensions[i] == extension)
- return;
- }
- v8::RegisterExtension(extension);
- extensions().append(extension);
-}
-
-bool V8Proxy::setContextDebugId(int debugId)
-{
- ASSERT(debugId > 0);
- v8::HandleScope scope;
- v8::Handle<v8::Context> context = windowShell()->context();
- if (context.IsEmpty())
- return false;
- if (!context->GetData()->IsUndefined())
- return false;
-
- v8::Context::Scope contextScope(context);
-
- char buffer[32];
- snprintf(buffer, sizeof(buffer), "page,%d", debugId);
- context->SetData(v8::String::New(buffer));
-
- return true;
-}
-
-int V8Proxy::contextDebugId(v8::Handle<v8::Context> context)
-{
- v8::HandleScope scope;
- if (!context->GetData()->IsString())
- return -1;
- v8::String::AsciiValue ascii(context->GetData());
- char* comma = strnstr(*ascii, ",", ascii.length());
- if (!comma)
- return -1;
- return atoi(comma + 1);
-}
-
v8::Local<v8::Context> toV8Context(ScriptExecutionContext* context, const WorldContextHandle& worldContext)
{
if (context->isDocument()) {
if (Frame* frame = static_cast<Document*>(context)->frame())
- return worldContext.adjustedContext(frame->script()->proxy());
+ return worldContext.adjustedContext(frame->script());
#if ENABLE(WORKERS)
} else if (context->isWorkerContext()) {
if (WorkerContextExecutionProxy* proxy = static_cast<WorkerContext*>(context)->script()->proxy())
diff --git a/Source/WebCore/bindings/v8/V8Proxy.h b/Source/WebCore/bindings/v8/V8Proxy.h
index d2e6ded31..1e3d67b46 100644
--- a/Source/WebCore/bindings/v8/V8Proxy.h
+++ b/Source/WebCore/bindings/v8/V8Proxy.h
@@ -35,7 +35,6 @@
#include "SharedPersistent.h"
#include "StatsCounter.h"
#include "V8AbstractEventListener.h"
-#include "V8DOMWindowShell.h"
#include "V8DOMWrapper.h"
#include "V8GCController.h"
#include "V8Utilities.h"
@@ -62,16 +61,14 @@ namespace WebCore {
class ScriptExecutionContext;
class ScriptSourceCode;
class SecurityOrigin;
- class V8PerContextData;
+ class V8DOMWindowShell;
class V8EventListener;
class V8IsolatedContext;
+ class V8PerContextData;
class WorldContextHandle;
const int kMaxRecursionDepth = 22;
- // The list of extensions that are registered for use with V8.
- typedef WTF::Vector<v8::Extension*> V8Extensions;
-
// Note: although the pointer is raw, the instance is kept alive by a strong
// reference to the v8 context it contains, which is not made weak until we
// call world->destroy().
@@ -84,32 +81,14 @@ namespace WebCore {
class V8Proxy {
public:
- // The types of javascript errors that can be thrown.
- enum ErrorType {
- RangeError,
- ReferenceError,
- SyntaxError,
- TypeError,
- GeneralError
- };
-
explicit V8Proxy(Frame*);
~V8Proxy();
- Frame* frame() { return m_frame; }
-
- void clearForNavigation();
- void clearForClose();
+ Frame* frame() const { return m_frame; }
void finishedWithEvent(Event*) { }
- // Evaluate JavaScript in a new isolated world. The script gets its own
- // global scope, its own prototypes for intrinsic JavaScript objects (String,
- // Array, and so-on), and its own wrappers for all DOM nodes and DOM
- // constructors.
- v8::Local<v8::Array> evaluateInIsolatedWorld(int worldID, const Vector<ScriptSourceCode>& sources, int extensionGroup);
-
// Evaluate a script file in the current execution environment.
// The caller must hold an execution context.
// If cannot evalute the script, it returns an error.
@@ -118,64 +97,23 @@ namespace WebCore {
// Run an already compiled script.
v8::Local<v8::Value> runScript(v8::Handle<v8::Script>);
- // Call the function with the given receiver and arguments.
- v8::Local<v8::Value> callFunction(v8::Handle<v8::Function>, v8::Handle<v8::Object>, int argc, v8::Handle<v8::Value> argv[]);
-
- // call the function with the given receiver and arguments and report times to DevTools.
- static v8::Local<v8::Value> instrumentedCallFunction(Frame*, v8::Handle<v8::Function>, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> args[]);
-
// Call the function as constructor with the given arguments.
v8::Local<v8::Value> newInstance(v8::Handle<v8::Function>, int argc, v8::Handle<v8::Value> argv[]);
- // Returns the window object associated with a context.
- static DOMWindow* retrieveWindow(v8::Handle<v8::Context>);
-
- // Returns the frame object of the window object associated with
- // a context.
- static Frame* retrieveFrame(v8::Handle<v8::Context>);
-
- static V8PerContextData* retrievePerContextData(Frame*);
-
// Returns V8 Context of a frame. If none exists, creates
// a new context. It is potentially slow and consumes memory.
static v8::Local<v8::Context> context(Frame*);
- static v8::Local<v8::Context> mainWorldContext(Frame*);
-
- // If the current context causes out of memory, JavaScript setting
- // is disabled and it returns true.
- static bool handleOutOfMemory();
-
- static v8::Handle<v8::Value> checkNewLegal(const v8::Arguments&);
static v8::Handle<v8::Script> compileScript(v8::Handle<v8::String> code, const String& fileName, const TextPosition& scriptStartPosition, v8::ScriptData* = 0);
- // If the exception code is different from zero, a DOM exception is
- // schedule to be thrown.
- static v8::Handle<v8::Value> setDOMException(int exceptionCode, v8::Isolate*);
-
- // Schedule an error object to be thrown.
- static v8::Handle<v8::Value> throwError(ErrorType, const char* message, v8::Isolate* = 0);
-
- // Helpers for throwing syntax and type errors with predefined messages.
- static v8::Handle<v8::Value> throwTypeError(const char* = 0, v8::Isolate* = 0);
- static v8::Handle<v8::Value> throwNotEnoughArgumentsError(v8::Isolate*);
-
v8::Local<v8::Context> context();
- v8::Local<v8::Context> mainWorldContext();
v8::Local<v8::Context> isolatedWorldContext(int worldId);
bool matchesCurrentContext();
// FIXME: This should eventually take DOMWrapperWorld argument!
- V8DOMWindowShell* windowShell() const { return m_windowShell.get(); }
-
- bool setContextDebugId(int id);
- static int contextDebugId(v8::Handle<v8::Context>);
-
- // Registers a v8 extension to be available on webpages. Will only
- // affect v8 contexts initialized after this call. Takes ownership of
- // the v8::Extension object passed.
- static void registerExtensionIfNeeded(v8::Extension*);
- static V8Extensions& extensions();
+ // FIXME: This method will be soon removed, as all methods that access windowShell()
+ // will be moved to ScriptController.
+ V8DOMWindowShell* windowShell() const;
static void reportUnsafeAccessTo(Document* targetDocument);
@@ -186,20 +124,10 @@ namespace WebCore {
IsolatedWorldSecurityOriginMap& isolatedWorldSecurityOrigins() { return m_isolatedWorldSecurityOrigins; }
private:
- void resetIsolatedWorlds();
-
- void hintForGCIfNecessary();
-
PassOwnPtr<v8::ScriptData> precompileScript(v8::Handle<v8::String>, CachedScript*);
Frame* m_frame;
- // For the moment, we have one of these. Soon we will have one per DOMWrapperWorld.
- RefPtr<V8DOMWindowShell> m_windowShell;
-
- // All of the extensions registered with the context.
- static V8Extensions m_extensions;
-
// The isolated worlds we are tracking for this frame. We hold them alive
// here so that they can be used again by future calls to
// evaluateInIsolatedWorld().
@@ -209,13 +137,6 @@ namespace WebCore {
};
v8::Local<v8::Context> toV8Context(ScriptExecutionContext*, const WorldContextHandle& worldContext);
-
- inline v8::Handle<v8::Primitive> throwError(v8::Local<v8::Value> exception, v8::Isolate* isolate = 0)
- {
- if (!v8::V8::IsExecutionTerminating())
- v8::ThrowException(exception);
- return v8::Undefined();
- }
}
#endif // V8Proxy_h
diff --git a/Source/WebCore/bindings/v8/V8RecursionScope.h b/Source/WebCore/bindings/v8/V8RecursionScope.h
index 6e5f53f1d..78b3f2b75 100644
--- a/Source/WebCore/bindings/v8/V8RecursionScope.h
+++ b/Source/WebCore/bindings/v8/V8RecursionScope.h
@@ -32,7 +32,7 @@
#define V8RecursionScope_h
#include "ScriptExecutionContext.h"
-#include "V8Binding.h"
+#include "V8PerIsolateData.h"
#include <wtf/Noncopyable.h>
namespace WebCore {
diff --git a/Source/WebCore/bindings/v8/V8ThrowException.cpp b/Source/WebCore/bindings/v8/V8ThrowException.cpp
new file mode 100644
index 000000000..6988b28e5
--- /dev/null
+++ b/Source/WebCore/bindings/v8/V8ThrowException.cpp
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 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 "V8ThrowException.h"
+
+#include "ExceptionHeaders.h"
+#include "ExceptionInterfaces.h"
+#include "V8Binding.h"
+
+namespace WebCore {
+
+static v8::Handle<v8::Value> domExceptionStackGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ ASSERT(info.Data()->IsObject());
+ return info.Data()->ToObject()->Get(v8String("stack", info.GetIsolate()));
+}
+
+static void domExceptionStackSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ ASSERT(info.Data()->IsObject());
+ info.Data()->ToObject()->Set(v8String("stack", info.GetIsolate()), value);
+}
+
+#define TRY_TO_CREATE_EXCEPTION(interfaceName) \
+ case interfaceName##Type: \
+ exception = toV8(interfaceName::create(description), isolate); \
+ break;
+
+v8::Handle<v8::Value> V8ThrowException::setDOMException(int ec, v8::Isolate* isolate)
+{
+ if (ec <= 0 || v8::V8::IsExecutionTerminating())
+ return v8Undefined();
+
+ if (ec == NATIVE_TYPE_ERR)
+ return V8ThrowException::throwTypeError(0, isolate);
+
+ ExceptionCodeDescription description(ec);
+
+ v8::Handle<v8::Value> exception;
+ switch (description.type) {
+ DOM_EXCEPTION_INTERFACES_FOR_EACH(TRY_TO_CREATE_EXCEPTION)
+ }
+
+ if (exception.IsEmpty())
+ return v8Undefined();
+
+ // Attach an Error object to the DOMException. This is then lazily used to get the stack value.
+ v8::Handle<v8::Value> error = v8::Exception::Error(v8String(description.description, isolate));
+ ASSERT(!error.IsEmpty());
+ ASSERT(exception->IsObject());
+ exception->ToObject()->SetAccessor(v8String("stack", isolate), domExceptionStackGetter, domExceptionStackSetter, error);
+
+ return v8::ThrowException(exception);
+}
+
+#undef TRY_TO_CREATE_EXCEPTION
+
+v8::Handle<v8::Value> V8ThrowException::throwError(ErrorType type, const char* message, v8::Isolate* isolate)
+{
+ switch (type) {
+ case RangeError:
+ return v8::ThrowException(v8::Exception::RangeError(v8String(message, isolate)));
+ case ReferenceError:
+ return v8::ThrowException(v8::Exception::ReferenceError(v8String(message, isolate)));
+ case SyntaxError:
+ return v8::ThrowException(v8::Exception::SyntaxError(v8String(message, isolate)));
+ case TypeError:
+ return v8::ThrowException(v8::Exception::TypeError(v8String(message, isolate)));
+ case GeneralError:
+ return v8::ThrowException(v8::Exception::Error(v8String(message, isolate)));
+ default:
+ ASSERT_NOT_REACHED();
+ return v8Undefined();
+ }
+}
+
+v8::Handle<v8::Value> V8ThrowException::throwTypeError(const char* message, v8::Isolate* isolate)
+{
+ return V8ThrowException::throwError(TypeError, (message ? message : "Type error"), isolate);
+}
+
+v8::Handle<v8::Value> V8ThrowException::throwNotEnoughArgumentsError(v8::Isolate* isolate)
+{
+ return V8ThrowException::throwError(TypeError, "Not enough arguments", isolate);
+}
+
+v8::Handle<v8::Value> V8ThrowException::throwError(v8::Local<v8::Value> exception, v8::Isolate* isolate)
+{
+ if (!v8::V8::IsExecutionTerminating())
+ v8::ThrowException(exception);
+ return v8::Undefined();
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/bindings/v8/V8ThrowException.h b/Source/WebCore/bindings/v8/V8ThrowException.h
new file mode 100644
index 000000000..4f53d2282
--- /dev/null
+++ b/Source/WebCore/bindings/v8/V8ThrowException.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 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 V8ThrowException_h
+#define V8ThrowException_h
+
+#include <v8.h>
+
+namespace WebCore {
+
+enum ErrorType {
+ RangeError,
+ ReferenceError,
+ SyntaxError,
+ TypeError,
+ GeneralError
+};
+
+class V8ThrowException {
+public:
+ static v8::Handle<v8::Value> setDOMException(int, v8::Isolate*);
+
+ static v8::Handle<v8::Value> throwError(ErrorType, const char*, v8::Isolate* = 0);
+ static v8::Handle<v8::Value> throwError(v8::Local<v8::Value>, v8::Isolate* = 0);
+
+ static v8::Handle<v8::Value> throwTypeError(const char* = 0, v8::Isolate* = 0);
+ static v8::Handle<v8::Value> throwNotEnoughArgumentsError(v8::Isolate*);
+};
+
+} // namespace WebCore
+
+#endif // V8ThrowException_h
diff --git a/Source/WebCore/bindings/v8/V8Utilities.cpp b/Source/WebCore/bindings/v8/V8Utilities.cpp
index 0f48b5876..4cfe531ea 100644
--- a/Source/WebCore/bindings/v8/V8Utilities.cpp
+++ b/Source/WebCore/bindings/v8/V8Utilities.cpp
@@ -35,7 +35,6 @@
#include "Document.h"
#include "ExceptionCode.h"
#include "Frame.h"
-#include "GenericBinding.h"
#include "MessagePort.h"
#include "ScriptExecutionContext.h"
#include "ScriptState.h"
@@ -44,10 +43,8 @@
#include "V8MessagePort.h"
#include "V8Proxy.h"
#include "WorkerContext.h"
-#include "WorkerContextExecutionProxy.h"
#include <v8.h>
#include <wtf/ArrayBuffer.h>
-#include <wtf/Assertions.h>
namespace WebCore {
@@ -107,7 +104,7 @@ bool extractTransferables(v8::Local<v8::Value> value, MessagePortArray& ports, A
v8::Local<v8::Value> transferrable = transferrables->Get(i);
// Validation of non-null objects, per HTML5 spec 10.3.3.
if (isUndefinedOrNull(transferrable)) {
- V8Proxy::setDOMException(DATA_CLONE_ERR, isolate);
+ setDOMException(DATA_CLONE_ERR, isolate);
return false;
}
// Validation of Objects implementing an interface, per WebIDL spec 4.1.15.
@@ -116,7 +113,7 @@ bool extractTransferables(v8::Local<v8::Value> value, MessagePortArray& ports, A
else if (V8ArrayBuffer::HasInstance(transferrable))
arrayBuffers.append(V8ArrayBuffer::toNative(v8::Handle<v8::Object>::Cast(transferrable)));
else {
- V8Proxy::throwTypeError();
+ throwTypeError();
return false;
}
}
@@ -130,7 +127,7 @@ bool getMessagePortArray(v8::Local<v8::Value> value, MessagePortArray& ports, v8
if (!result)
return false;
if (arrayBuffers.size() > 0) {
- V8Proxy::throwTypeError("MessagePortArray argument must contain only MessagePorts");
+ throwTypeError("MessagePortArray argument must contain only MessagePorts");
return false;
}
return true;
@@ -168,16 +165,6 @@ void transferHiddenDependency(v8::Handle<v8::Object> object,
createHiddenDependency(object, newValue, cacheIndex);
}
-Frame* callingOrEnteredFrame()
-{
- return activeFrame(BindingState::instance());
-}
-
-KURL completeURL(const String& relativeURL)
-{
- return completeURL(BindingState::instance(), relativeURL);
-}
-
ScriptExecutionContext* getScriptExecutionContext()
{
#if ENABLE(WORKERS)
@@ -185,15 +172,12 @@ ScriptExecutionContext* getScriptExecutionContext()
return controller->workerContext();
#endif
- if (Frame* frame = currentFrame(BindingState::instance()))
- return frame->document()->scriptExecutionContext();
-
- return 0;
+ return currentDocument(BindingState::instance());
}
void setTypeMismatchException(v8::Isolate* isolate)
{
- V8Proxy::setDOMException(TYPE_MISMATCH_ERR, isolate);
+ setDOMException(TYPE_MISMATCH_ERR, isolate);
}
} // namespace WebCore
diff --git a/Source/WebCore/bindings/v8/V8Utilities.h b/Source/WebCore/bindings/v8/V8Utilities.h
index 75f4e86da..d473a3940 100644
--- a/Source/WebCore/bindings/v8/V8Utilities.h
+++ b/Source/WebCore/bindings/v8/V8Utilities.h
@@ -34,8 +34,6 @@
#include <wtf/Forward.h>
#include <v8.h>
-#include "OwnHandle.h"
-
namespace WTF {
class ArrayBuffer;
}
@@ -43,11 +41,8 @@ class ArrayBuffer;
namespace WebCore {
class EventListener;
- class Frame;
- class KURL;
class MessagePort;
class ScriptExecutionContext;
- class ScriptState;
// Use an array to hold dependents. It works like a ref-counted scheme. A value can be added more than once to the DOM object.
void createHiddenDependency(v8::Handle<v8::Object>, v8::Local<v8::Value>, int cacheIndex);
@@ -56,8 +51,6 @@ namespace WebCore {
// Combo create/remove, for generated event-handler-setter bindings:
void transferHiddenDependency(v8::Handle<v8::Object>, EventListener* oldValue, v8::Local<v8::Value> newValue, int cacheIndex);
- KURL completeURL(const String& relativeURL);
-
ScriptExecutionContext* getScriptExecutionContext();
void setTypeMismatchException(v8::Isolate*);
diff --git a/Source/WebCore/bindings/v8/V8WindowErrorHandler.cpp b/Source/WebCore/bindings/v8/V8WindowErrorHandler.cpp
index aef7d1235..f118c35e4 100644
--- a/Source/WebCore/bindings/v8/V8WindowErrorHandler.cpp
+++ b/Source/WebCore/bindings/v8/V8WindowErrorHandler.cpp
@@ -34,8 +34,8 @@
#include "EventNames.h"
#include "ErrorEvent.h"
+#include "ScriptController.h"
#include "V8Binding.h"
-#include "V8Proxy.h"
namespace WebCore {
@@ -58,7 +58,7 @@ v8::Local<v8::Value> V8WindowErrorHandler::callListenerFunction(ScriptExecutionC
v8::Handle<v8::Value> parameters[3] = { v8String(errorEvent->message()), v8String(errorEvent->filename()), v8Integer(errorEvent->lineno()) };
v8::TryCatch tryCatch;
tryCatch.SetVerbose(true);
- returnValue = V8Proxy::instrumentedCallFunction(0 /* frame */, callFunction, thisValue, 3, parameters);
+ returnValue = ScriptController::callFunctionWithInstrumentation(0, callFunction, thisValue, 3, parameters);
}
return returnValue;
}
diff --git a/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp b/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
index 752aaa7a2..07a36796b 100644
--- a/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
+++ b/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
@@ -37,7 +37,6 @@
#include "DedicatedWorkerContext.h"
#include "Event.h"
-#include "SafeAllocation.h"
#include "ScriptCallStack.h"
#include "SharedWorker.h"
#include "SharedWorkerContext.h"
@@ -45,6 +44,7 @@
#include "V8DOMMap.h"
#include "V8DOMWindowShell.h"
#include "V8DedicatedWorkerContext.h"
+#include "V8ObjectConstructor.h"
#include "V8PerContextData.h"
#include "V8Proxy.h"
#include "V8RecursionScope.h"
@@ -173,7 +173,7 @@ bool WorkerContextExecutionProxy::initContextIfNeeded()
contextType = &V8SharedWorkerContext::info;
#endif
v8::Handle<v8::Function> workerContextConstructor = m_perContextData->constructorForType(contextType);
- v8::Local<v8::Object> jsWorkerContext = SafeAllocation::newInstance(workerContextConstructor);
+ v8::Local<v8::Object> jsWorkerContext = V8ObjectConstructor::newInstance(workerContextConstructor);
// Bail out if allocation failed.
if (jsWorkerContext.IsEmpty()) {
dispose();
@@ -228,7 +228,7 @@ ScriptValue WorkerContextExecutionProxy::evaluate(const String& script, const St
state->lineNumber = message->GetLineNumber();
state->sourceURL = toWebCoreString(message->GetScriptResourceName());
if (m_workerContext->sanitizeScriptError(state->errorMessage, state->lineNumber, state->sourceURL))
- state->exception = V8Proxy::throwError(V8Proxy::GeneralError, state->errorMessage.utf8().data());
+ state->exception = throwError(GeneralError, state->errorMessage.utf8().data());
else
state->exception = ScriptValue(exceptionCatcher.Exception());
@@ -253,7 +253,7 @@ v8::Local<v8::Value> WorkerContextExecutionProxy::runScript(v8::Handle<v8::Scrip
script = V8Proxy::compileScript(code, "", TextPosition::minimumPosition());
}
- if (V8Proxy::handleOutOfMemory())
+ if (handleOutOfMemory())
ASSERT(script.IsEmpty());
if (script.IsEmpty())
diff --git a/Source/WebCore/bindings/v8/WorldContextHandle.cpp b/Source/WebCore/bindings/v8/WorldContextHandle.cpp
index 8456a3e5f..488f3b527 100644
--- a/Source/WebCore/bindings/v8/WorldContextHandle.cpp
+++ b/Source/WebCore/bindings/v8/WorldContextHandle.cpp
@@ -31,8 +31,8 @@
#include "config.h"
#include "WorldContextHandle.h"
+#include "ScriptController.h"
#include "V8IsolatedContext.h"
-#include "V8Proxy.h"
namespace WebCore {
@@ -46,10 +46,10 @@ WorldContextHandle::WorldContextHandle(WorldToUse worldToUse)
m_context = context->sharedContext();
}
-v8::Local<v8::Context> WorldContextHandle::adjustedContext(V8Proxy* proxy) const
+v8::Local<v8::Context> WorldContextHandle::adjustedContext(ScriptController* script) const
{
if (m_worldToUse == UseMainWorld || !m_context || m_context->get().IsEmpty())
- return proxy->mainWorldContext();
+ return script->mainWorldContext();
return v8::Local<v8::Context>::New(m_context->get());
}
diff --git a/Source/WebCore/bindings/v8/WorldContextHandle.h b/Source/WebCore/bindings/v8/WorldContextHandle.h
index ad0983ec4..5574742ae 100644
--- a/Source/WebCore/bindings/v8/WorldContextHandle.h
+++ b/Source/WebCore/bindings/v8/WorldContextHandle.h
@@ -38,14 +38,14 @@
namespace WebCore {
-class V8Proxy;
+class ScriptController;
enum WorldToUse { UseMainWorld, UseCurrentWorld };
class WorldContextHandle {
public:
WorldContextHandle(WorldToUse);
- v8::Local<v8::Context> adjustedContext(V8Proxy*) const;
+ v8::Local<v8::Context> adjustedContext(ScriptController*) const;
private:
WorldToUse m_worldToUse;
diff --git a/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp b/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp
index e71825d70..adbeacdf8 100644
--- a/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp
@@ -43,7 +43,7 @@ v8::Handle<v8::Value> V8ArrayBuffer::constructorCallback(const v8::Arguments& ar
INC_STATS("DOM.ArrayBuffer.Constructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
+ return throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
@@ -70,7 +70,7 @@ v8::Handle<v8::Value> V8ArrayBuffer::constructorCallback(const v8::Arguments& ar
if (length >= 0)
buffer = ArrayBuffer::create(static_cast<unsigned>(length), 1);
if (!buffer.get())
- return V8Proxy::throwError(V8Proxy::RangeError, "ArrayBuffer size is not a small enough positive integer.", args.GetIsolate());
+ return throwError(RangeError, "ArrayBuffer size is not a small enough positive integer.", args.GetIsolate());
// Transform the holder into a wrapper object for the array.
v8::Handle<v8::Object> wrapper = args.Holder();
V8DOMWrapper::setDOMWrapper(wrapper, &info, buffer.get());
diff --git a/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h b/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h
index 277c978d0..93b242a05 100644
--- a/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h
+++ b/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h
@@ -40,6 +40,9 @@
namespace WebCore {
+static const char* tooLargeSize = "Size is too large (or is negative).";
+static const char* outOfRangeLengthAndOffset = "Index is out of range.";
+
// Copy the elements from the source array to the typed destination array.
// Returns true if it succeeded, otherwise returns false.
bool copyElements(v8::Handle<v8::Object> destArray, v8::Handle<v8::Object> srcArray, uint32_t length, uint32_t offset, v8::Isolate*);
@@ -63,40 +66,38 @@ v8::Handle<v8::Value> constructWebGLArrayWithArrayBufferArgument(const v8::Argum
{
ArrayBuffer* buf = V8ArrayBuffer::toNative(args[0]->ToObject());
if (!buf)
- return V8Proxy::throwTypeError("Could not convert argument 0 to a ArrayBuffer", args.GetIsolate());
+ return throwTypeError("Could not convert argument 0 to a ArrayBuffer", args.GetIsolate());
bool ok;
uint32_t offset = 0;
int argLen = args.Length();
if (argLen > 1) {
offset = toUInt32(args[1], ok);
if (!ok)
- return V8Proxy::throwTypeError("Could not convert argument 1 to a number", args.GetIsolate());
+ return throwTypeError("Could not convert argument 1 to a number", args.GetIsolate());
}
uint32_t length = 0;
if (argLen > 2) {
length = toUInt32(args[2], ok);
if (!ok)
- return V8Proxy::throwTypeError("Could not convert argument 2 to a number", args.GetIsolate());
+ return throwTypeError("Could not convert argument 2 to a number", args.GetIsolate());
} else {
if ((buf->byteLength() - offset) % sizeof(ElementType))
- return V8Proxy::throwError(V8Proxy::RangeError, "ArrayBuffer length minus the byteOffset is not a multiple of the element size.", args.GetIsolate());
+ return throwError(RangeError, "ArrayBuffer length minus the byteOffset is not a multiple of the element size.", args.GetIsolate());
length = (buf->byteLength() - offset) / sizeof(ElementType);
}
RefPtr<ArrayClass> array = ArrayClass::create(buf, offset, length);
if (!array)
- return V8Proxy::setDOMException(INDEX_SIZE_ERR, args.GetIsolate());
+ return throwError(RangeError, tooLargeSize, args.GetIsolate());
return wrapArrayBufferView(args, type, array, arrayType, hasIndexer);
}
-static const char* notSmallEnoughSize = "ArrayBufferView size is not a small enough positive integer.";
-
// Template function used by the ArrayBufferView*Constructor callbacks.
template<class ArrayClass, class JavaScriptWrapperArrayType, class ElementType>
v8::Handle<v8::Value> constructWebGLArray(const v8::Arguments& args, WrapperTypeInfo* type, v8::ExternalArrayType arrayType)
{
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
+ return throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
@@ -130,7 +131,7 @@ v8::Handle<v8::Value> constructWebGLArray(const v8::Arguments& args, WrapperType
if (args[0]->IsNull()) {
// Invalid first argument
- return V8Proxy::throwTypeError(0, args.GetIsolate());
+ return throwTypeError(0, args.GetIsolate());
}
// See whether the first argument is a ArrayBuffer.
@@ -144,7 +145,7 @@ v8::Handle<v8::Value> constructWebGLArray(const v8::Arguments& args, WrapperType
uint32_t length = source->length();
RefPtr<ArrayClass> array = ArrayClass::createUninitialized(length);
if (!array.get())
- return V8Proxy::throwError(V8Proxy::RangeError, notSmallEnoughSize, args.GetIsolate());
+ return throwError(RangeError, tooLargeSize, args.GetIsolate());
memcpy(array->baseAddress(), source->baseAddress(), length * sizeof(ElementType));
@@ -158,7 +159,7 @@ v8::Handle<v8::Value> constructWebGLArray(const v8::Arguments& args, WrapperType
if (args[0]->IsObject()) {
srcArray = args[0]->ToObject();
if (srcArray.IsEmpty())
- return V8Proxy::throwTypeError("Could not convert argument 0 to an array", args.GetIsolate());
+ return throwTypeError("Could not convert argument 0 to an array", args.GetIsolate());
len = toUInt32(srcArray->Get(v8::String::New("length")));
doInstantiation = true;
} else {
@@ -179,7 +180,7 @@ v8::Handle<v8::Value> constructWebGLArray(const v8::Arguments& args, WrapperType
}
if (!array.get())
- return V8Proxy::throwError(V8Proxy::RangeError, notSmallEnoughSize, args.GetIsolate());
+ return throwError(RangeError, tooLargeSize, args.GetIsolate());
// Transform the holder into a wrapper object for the array.
@@ -204,7 +205,7 @@ template <class CPlusPlusArrayType, class JavaScriptWrapperArrayType>
v8::Handle<v8::Value> setWebGLArrayHelper(const v8::Arguments& args)
{
if (args.Length() < 1)
- return V8Proxy::setDOMException(SYNTAX_ERR, args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
CPlusPlusArrayType* impl = JavaScriptWrapperArrayType::toNative(args.Holder());
@@ -215,7 +216,7 @@ v8::Handle<v8::Value> setWebGLArrayHelper(const v8::Arguments& args)
if (args.Length() == 2)
offset = toUInt32(args[1]);
if (!impl->set(src, offset))
- return V8Proxy::setDOMException(INDEX_SIZE_ERR, args.GetIsolate());
+ return throwError(RangeError, outOfRangeLengthAndOffset, args.GetIsolate());
return v8::Undefined();
}
@@ -226,12 +227,8 @@ v8::Handle<v8::Value> setWebGLArrayHelper(const v8::Arguments& args)
if (args.Length() == 2)
offset = toUInt32(args[1]);
uint32_t length = toUInt32(array->Get(v8::String::New("length")));
- if (offset > impl->length()
- || offset + length > impl->length()
- || offset + length < offset) {
- // Out of range offset or overflow
- return V8Proxy::setDOMException(INDEX_SIZE_ERR, args.GetIsolate());
- }
+ if (!impl->checkInboundData(offset, length))
+ return throwError(RangeError, outOfRangeLengthAndOffset, args.GetIsolate());
bool copied = copyElements(args.Holder(), array, length, offset, args.GetIsolate());
if (!copied) {
for (uint32_t i = 0; i < length; i++)
@@ -240,7 +237,7 @@ v8::Handle<v8::Value> setWebGLArrayHelper(const v8::Arguments& args)
return v8::Undefined();
}
- return V8Proxy::setDOMException(SYNTAX_ERR, args.GetIsolate());
+ return throwTypeError("Invalid argument", args.GetIsolate());
}
}
diff --git a/Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp b/Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp
index cf212d349..0fd9506d7 100644
--- a/Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp
@@ -47,13 +47,13 @@ void V8AudioBufferSourceNode::bufferAccessorSetter(v8::Local<v8::String> name, v
if (V8AudioBuffer::HasInstance(value)) {
buffer = V8AudioBuffer::toNative(value->ToObject());
if (buffer && !imp->setBuffer(buffer)) {
- V8Proxy::throwTypeError("AudioBuffer unsupported number of channels", info.GetIsolate());
+ throwTypeError("AudioBuffer unsupported number of channels", info.GetIsolate());
return;
}
}
if (!buffer) {
- V8Proxy::throwTypeError("Value is not of type AudioBuffer", info.GetIsolate());
+ throwTypeError("Value is not of type AudioBuffer", info.GetIsolate());
return;
}
}
diff --git a/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp b/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp
index 2ee81eb27..13d0d2699 100644
--- a/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp
@@ -45,18 +45,18 @@ v8::Handle<v8::Value> V8AudioContext::constructorCallback(const v8::Arguments& a
INC_STATS("DOM.AudioContext.Contructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("AudioContext constructor cannot be called as a function.", args.GetIsolate());
+ return throwTypeError("AudioContext constructor cannot be called as a function.", args.GetIsolate());
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
Frame* frame = currentFrame(BindingState::instance());
if (!frame)
- return V8Proxy::throwError(V8Proxy::ReferenceError, "AudioContext constructor associated frame is unavailable", args.GetIsolate());
+ return throwError(ReferenceError, "AudioContext constructor associated frame is unavailable", args.GetIsolate());
Document* document = frame->document();
if (!document)
- return V8Proxy::throwError(V8Proxy::ReferenceError, "AudioContext constructor associated document is unavailable", args.GetIsolate());
+ return throwError(ReferenceError, "AudioContext constructor associated document is unavailable", args.GetIsolate());
RefPtr<AudioContext> audioContext;
@@ -65,37 +65,37 @@ v8::Handle<v8::Value> V8AudioContext::constructorCallback(const v8::Arguments& a
ExceptionCode ec = 0;
audioContext = AudioContext::create(document, ec);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
if (!audioContext.get())
- return V8Proxy::throwError(V8Proxy::SyntaxError, "audio resources unavailable for AudioContext construction", args.GetIsolate());
+ return throwError(SyntaxError, "audio resources unavailable for AudioContext construction", args.GetIsolate());
} else {
// Constructor for offline (render-target) AudioContext which renders into an AudioBuffer.
// new AudioContext(in unsigned long numberOfChannels, in unsigned long numberOfFrames, in float sampleRate);
if (args.Length() < 3)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
bool ok = false;
int32_t numberOfChannels = toInt32(args[0], ok);
if (!ok || numberOfChannels <= 0 || numberOfChannels > 10)
- return V8Proxy::throwError(V8Proxy::SyntaxError, "Invalid number of channels", args.GetIsolate());
+ return throwError(SyntaxError, "Invalid number of channels", args.GetIsolate());
int32_t numberOfFrames = toInt32(args[1], ok);
if (!ok || numberOfFrames <= 0)
- return V8Proxy::throwError(V8Proxy::SyntaxError, "Invalid number of frames", args.GetIsolate());
+ return throwError(SyntaxError, "Invalid number of frames", args.GetIsolate());
float sampleRate = toFloat(args[2]);
if (sampleRate <= 0)
- return V8Proxy::throwError(V8Proxy::SyntaxError, "Invalid sample rate", args.GetIsolate());
+ return throwError(SyntaxError, "Invalid sample rate", args.GetIsolate());
ExceptionCode ec = 0;
audioContext = AudioContext::createOfflineContext(document, numberOfChannels, numberOfFrames, sampleRate, ec);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
if (!audioContext.get())
- return V8Proxy::throwError(V8Proxy::SyntaxError, "Error creating AudioContext", args.GetIsolate());
+ return throwError(SyntaxError, "Error creating AudioContext", args.GetIsolate());
// Transform the holder into a wrapper object for the audio context.
V8DOMWrapper::setDOMWrapper(args.Holder(), &info, audioContext.get());
diff --git a/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp b/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp
index df01e7634..6ebcc2d64 100644
--- a/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp
@@ -60,7 +60,7 @@ v8::Handle<v8::Value> V8Blob::constructorCallback(const v8::Arguments& args)
INC_STATS("DOM.Blob.Constructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
+ return throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
@@ -68,7 +68,7 @@ v8::Handle<v8::Value> V8Blob::constructorCallback(const v8::Arguments& args)
// Get the script execution context.
ScriptExecutionContext* context = getScriptExecutionContext();
if (!context)
- return V8Proxy::throwError(V8Proxy::ReferenceError, "Blob constructor associated document is unavailable", args.GetIsolate());
+ return throwError(ReferenceError, "Blob constructor associated document is unavailable", args.GetIsolate());
if (!args.Length()) {
RefPtr<Blob> blob = Blob::create();
@@ -77,14 +77,14 @@ v8::Handle<v8::Value> V8Blob::constructorCallback(const v8::Arguments& args)
v8::Local<v8::Value> firstArg = args[0];
if (!firstArg->IsArray())
- return V8Proxy::throwTypeError("First argument of the constructor is not of type Array", args.GetIsolate());
+ return throwTypeError("First argument of the constructor is not of type Array", args.GetIsolate());
String type;
String endings = "transparent";
if (args.Length() > 1) {
if (!args[1]->IsObject())
- return V8Proxy::throwTypeError("Second argument of the constructor is not of type Object", args.GetIsolate());
+ return throwTypeError("Second argument of the constructor is not of type Object", args.GetIsolate());
EXCEPTION_BLOCK(Dictionary, dictionary, Dictionary(args[1], args.GetIsolate()));
@@ -95,7 +95,7 @@ v8::Handle<v8::Value> V8Blob::constructorCallback(const v8::Arguments& args)
if (containsEndings) {
if (endings != "transparent" && endings != "native")
- return V8Proxy::throwTypeError("The endings property must be either \"transparent\" or \"native\"", args.GetIsolate());
+ return throwTypeError("The endings property must be either \"transparent\" or \"native\"", args.GetIsolate());
}
v8::TryCatch tryCatchType;
@@ -103,7 +103,7 @@ v8::Handle<v8::Value> V8Blob::constructorCallback(const v8::Arguments& args)
if (tryCatchType.HasCaught())
return throwError(tryCatchType.Exception(), args.GetIsolate());
if (!type.containsOnlyASCII())
- return V8Proxy::throwError(V8Proxy::SyntaxError, "type must consist of ASCII characters", args.GetIsolate());
+ return throwError(SyntaxError, "type must consist of ASCII characters", args.GetIsolate());
type.makeLower();
}
@@ -138,7 +138,7 @@ v8::Handle<v8::Value> V8Blob::constructorCallback(const v8::Arguments& args)
}
}
- RefPtr<Blob> blob = blobBuilder->getBlob(type);
+ RefPtr<Blob> blob = blobBuilder->getBlob(type, BlobConstructedByConstructor);
return toV8(blob.get(), args.GetIsolate());
}
diff --git a/Source/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp b/Source/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp
index 03d452378..007bd9ab7 100644
--- a/Source/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp
@@ -238,7 +238,7 @@ v8::Handle<v8::Value> V8CSSStyleDeclaration::namedPropertySetter(v8::Local<v8::S
imp->setPropertyInternal(static_cast<CSSPropertyID>(propInfo->propID), propertyValue, false, ec);
if (ec)
- V8Proxy::setDOMException(ec, info.GetIsolate());
+ setDOMException(ec, info.GetIsolate());
return value;
}
diff --git a/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp b/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp
index 80030128d..875f64e68 100644
--- a/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp
@@ -73,7 +73,7 @@ v8::Handle<v8::Value> V8Clipboard::clearDataCallback(const v8::Arguments& args)
}
if (args.Length() != 1)
- return V8Proxy::throwError(V8Proxy::SyntaxError, "clearData: Invalid number of arguments", args.GetIsolate());
+ return throwError(SyntaxError, "clearData: Invalid number of arguments", args.GetIsolate());
String type = toWebCoreString(args[0]);
clipboard->clearData(type);
@@ -89,7 +89,7 @@ v8::Handle<v8::Value> V8Clipboard::setDragImageCallback(const v8::Arguments& arg
return v8::Undefined();
if (args.Length() != 3)
- return V8Proxy::throwError(V8Proxy::SyntaxError, "setDragImage: Invalid number of arguments", args.GetIsolate());
+ return throwError(SyntaxError, "setDragImage: Invalid number of arguments", args.GetIsolate());
int x = toInt32(args[1]);
int y = toInt32(args[2]);
@@ -99,7 +99,7 @@ v8::Handle<v8::Value> V8Clipboard::setDragImageCallback(const v8::Arguments& arg
node = V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0]));
if (!node || !node->isElementNode())
- return V8Proxy::throwTypeError("setDragImageFromElement: Invalid first argument", args.GetIsolate());
+ return throwTypeError("setDragImageFromElement: Invalid first argument", args.GetIsolate());
if (static_cast<Element*>(node)->hasLocalName(HTMLNames::imgTag) && !node->inDocument())
clipboard->setDragImage(static_cast<HTMLImageElement*>(node)->cachedImage(), IntPoint(x, y));
diff --git a/Source/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp b/Source/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp
index 9ee27fb72..fb790b10a 100644
--- a/Source/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp
@@ -35,7 +35,7 @@
#include "V8SQLStatementErrorCallback.h"
#include "ScriptExecutionContext.h"
-#include "V8CustomVoidCallback.h"
+#include "V8Callback.h"
#include "V8Proxy.h"
#include "V8SQLError.h"
#include "V8SQLTransaction.h"
diff --git a/Source/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.cpp b/Source/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.cpp
index 0b5db9862..8eddc6bd8 100644
--- a/Source/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.cpp
@@ -31,9 +31,9 @@
#include "V8CustomXPathNSResolver.h"
#include "ScriptCallStack.h"
+#include "ScriptController.h"
#include "ScriptExecutionContext.h"
#include "V8Binding.h"
-#include "V8Proxy.h"
#include "V8Utilities.h"
#include <wtf/text/WTFString.h>
@@ -79,7 +79,7 @@ String V8CustomXPathNSResolver::lookupNamespaceURI(const String& prefix)
v8::Handle<v8::Value> argv[argc] = { v8String(prefix) };
v8::Handle<v8::Function> function = lookupNamespaceURIFunc.IsEmpty() ? v8::Handle<v8::Function>::Cast(m_resolver) : lookupNamespaceURIFunc;
- v8::Handle<v8::Value> retval = V8Proxy::instrumentedCallFunction(0 /* frame */, function, m_resolver, argc, argv);
+ v8::Handle<v8::Value> retval = ScriptController::callFunctionWithInstrumentation(0, function, m_resolver, argc, argv);
// Eat exceptions from namespace resolver and return an empty string. This will most likely cause NAMESPACE_ERR.
if (try_catch.HasCaught())
diff --git a/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp
index ec202cce4..ae7e9072f 100644
--- a/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp
@@ -45,7 +45,7 @@ v8::Handle<v8::Value> V8DOMFormData::constructorCallback(const v8::Arguments& ar
INC_STATS("DOM.FormData.Constructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
+ return throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
@@ -66,7 +66,7 @@ v8::Handle<v8::Value> V8DOMFormData::appendCallback(const v8::Arguments& args)
INC_STATS("DOM.FormData.append()");
if (args.Length() < 2)
- return V8Proxy::throwError(V8Proxy::SyntaxError, "Not enough arguments", args.GetIsolate());
+ return throwError(SyntaxError, "Not enough arguments", args.GetIsolate());
DOMFormData* domFormData = V8DOMFormData::toNative(args.Holder());
diff --git a/Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp
index 119282229..de68a839e 100644
--- a/Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp
@@ -80,7 +80,7 @@ v8::Handle<v8::Value> V8DOMStringMap::namedPropertySetter(v8::Local<v8::String>
ExceptionCode ec = 0;
V8DOMStringMap::toNative(info.Holder())->setItem(toWebCoreString(name), toWebCoreString(value), ec);
if (ec)
- return V8Proxy::setDOMException(ec, info.GetIsolate());
+ return setDOMException(ec, info.GetIsolate());
return value;
}
diff --git a/Source/WebCore/bindings/v8/custom/V8DOMTransactionCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DOMTransactionCustom.cpp
new file mode 100644
index 000000000..313bc8b98
--- /dev/null
+++ b/Source/WebCore/bindings/v8/custom/V8DOMTransactionCustom.cpp
@@ -0,0 +1,50 @@
+/*
+ * 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 GOOGLE 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 GOOGLE 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"
+
+#if ENABLE(UNDO_MANAGER)
+
+#include "V8DOMTransaction.h"
+
+#include "DOMTransaction.h"
+
+namespace WebCore {
+
+void V8DOMTransaction::visitDOMWrapper(DOMDataStore* store, void* object, v8::Persistent<v8::Object> wrapper)
+{
+ DOMTransaction* transaction = static_cast<DOMTransaction*>(object);
+ UndoManager* undoManager = transaction->undoManager();
+ if (!undoManager)
+ return;
+ v8::Persistent<v8::Object> undoManagerWrapper = store->domObjectMap().get(undoManager);
+ if (!undoManagerWrapper.IsEmpty()) {
+ v8::Persistent<v8::Value> value = wrapper;
+ v8::V8::AddImplicitReferences(undoManagerWrapper, &value, 1);
+ }
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index 3fe880a78..b8aa4face 100644
--- a/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -79,7 +79,7 @@ v8::Handle<v8::Value> WindowSetTimeoutImpl(const v8::Arguments& args, bool singl
ScriptExecutionContext* scriptContext = static_cast<ScriptExecutionContext*>(imp->document());
if (!scriptContext)
- return V8Proxy::setDOMException(INVALID_ACCESS_ERR, args.GetIsolate());
+ return setDOMException(INVALID_ACCESS_ERR, args.GetIsolate());
v8::Handle<v8::Value> function = args[0];
WTF::String functionString;
@@ -303,7 +303,7 @@ static v8::Handle<v8::Value> handlePostMessageCallback(const v8::Arguments& args
// If called directly by WebCore we don't have a calling context.
if (!source)
- return V8Proxy::throwTypeError(0, args.GetIsolate());
+ return throwTypeError(0, args.GetIsolate());
// This function has variable arguments and can be:
// Per current spec:
@@ -345,7 +345,7 @@ static v8::Handle<v8::Value> handlePostMessageCallback(const v8::Arguments& args
ExceptionCode ec = 0;
window->postMessage(message.release(), &portArray, targetOrigin, source, ec);
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
v8::Handle<v8::Value> V8DOMWindow::postMessageCallback(const v8::Arguments& args)
@@ -479,7 +479,7 @@ v8::Handle<v8::Value> V8DOMWindow::indexedPropertyGetter(uint32_t index, const v
Frame* child = frame->tree()->scopedChild(index);
if (child)
- return toV8(child->domWindow(), info.GetIsolate());
+ return toV8(child->document()->domWindow(), info.GetIsolate());
return v8Undefined();
}
@@ -499,10 +499,10 @@ v8::Handle<v8::Value> V8DOMWindow::namedPropertyGetter(v8::Local<v8::String> nam
return v8Undefined();
// Search sub-frames.
- AtomicString propName = v8ValueToAtomicWebCoreString(name);
+ AtomicString propName = toWebCoreAtomicString(name);
Frame* child = frame->tree()->scopedChild(propName);
if (child)
- return toV8(child->domWindow(), info.GetIsolate());
+ return toV8(child->document()->domWindow(), info.GetIsolate());
// Search IDL functions defined in the prototype
if (!info.Holder()->GetRealNamedProperty(name).IsEmpty())
diff --git a/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp
index 037d4b357..afb207c76 100755
--- a/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp
@@ -38,7 +38,7 @@ v8::Handle<v8::Value> V8DataView::constructorCallback(const v8::Arguments& args)
INC_STATS("DOM.DataView.Constructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function", args.GetIsolate());
+ return throwTypeError("DOM object constructor cannot be called as a function", args.GetIsolate());
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
@@ -53,7 +53,7 @@ v8::Handle<v8::Value> V8DataView::constructorCallback(const v8::Arguments& args)
return wrapper;
}
if (args[0]->IsNull() || !V8ArrayBuffer::HasInstance(args[0]))
- return V8Proxy::throwTypeError(0, args.GetIsolate());
+ return throwTypeError(0, args.GetIsolate());
return constructWebGLArrayWithArrayBufferArgument<DataView, char>(args, &info, v8::kExternalByteArray, false);
}
@@ -68,14 +68,14 @@ v8::Handle<v8::Value> V8DataView::getInt8Callback(const v8::Arguments& args)
{
INC_STATS("DOM.DataView.getInt8");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
DataView* imp = V8DataView::toNative(args.Holder());
ExceptionCode ec = 0;
EXCEPTION_BLOCK(unsigned, byteOffset, toUInt32(args[0]));
int8_t result = imp->getInt8(byteOffset, ec);
if (UNLIKELY(ec))
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return v8Integer(result, args.GetIsolate());
}
@@ -83,14 +83,14 @@ v8::Handle<v8::Value> V8DataView::getUint8Callback(const v8::Arguments& args)
{
INC_STATS("DOM.DataView.getUint8");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
DataView* imp = V8DataView::toNative(args.Holder());
ExceptionCode ec = 0;
EXCEPTION_BLOCK(unsigned, byteOffset, toUInt32(args[0]));
uint8_t result = imp->getUint8(byteOffset, ec);
if (UNLIKELY(ec))
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return v8Integer(result, args.GetIsolate());
}
@@ -98,7 +98,7 @@ v8::Handle<v8::Value> V8DataView::setInt8Callback(const v8::Arguments& args)
{
INC_STATS("DOM.DataView.setInt8");
if (args.Length() < 2)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
DataView* imp = V8DataView::toNative(args.Holder());
ExceptionCode ec = 0;
@@ -106,7 +106,7 @@ v8::Handle<v8::Value> V8DataView::setInt8Callback(const v8::Arguments& args)
EXCEPTION_BLOCK(int, value, toInt32(args[1]));
imp->setInt8(byteOffset, static_cast<int8_t>(value), ec);
if (UNLIKELY(ec))
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return v8Undefined();
}
@@ -114,7 +114,7 @@ v8::Handle<v8::Value> V8DataView::setUint8Callback(const v8::Arguments& args)
{
INC_STATS("DOM.DataView.setUint8");
if (args.Length() < 2)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
DataView* imp = V8DataView::toNative(args.Holder());
ExceptionCode ec = 0;
@@ -122,7 +122,7 @@ v8::Handle<v8::Value> V8DataView::setUint8Callback(const v8::Arguments& args)
EXCEPTION_BLOCK(int, value, toInt32(args[1]));
imp->setUint8(byteOffset, static_cast<uint8_t>(value), ec);
if (UNLIKELY(ec))
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return v8Undefined();
}
diff --git a/Source/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp
index c3334fc8f..0cb6eca44 100644
--- a/Source/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp
@@ -63,7 +63,7 @@ static v8::Handle<v8::Value> handlePostMessageCallback(const v8::Arguments& args
return v8::Undefined();
ExceptionCode ec = 0;
workerContext->postMessage(message.release(), &ports, ec);
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
v8::Handle<v8::Value> V8DedicatedWorkerContext::postMessageCallback(const v8::Arguments& args)
diff --git a/Source/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp
deleted file mode 100644
index c76f3205d..000000000
--- a/Source/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "V8DirectoryEntry.h"
-
-#if ENABLE(FILE_SYSTEM)
-
-#include "DirectoryEntry.h"
-#include "ExceptionCode.h"
-#include "V8Binding.h"
-#include "V8EntryCallback.h"
-#include "V8ErrorCallback.h"
-#include "V8Proxy.h"
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-
-namespace WebCore {
-
-v8::Handle<v8::Value> V8DirectoryEntry::getDirectoryCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.DirectoryEntry.getDirectory");
- DirectoryEntry* imp = V8DirectoryEntry::toNative(args.Holder());
-
- if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
-
- STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, path, args[0]);
- if (args.Length() <= 1) {
- imp->getDirectory(path);
- return v8Undefined();
- }
- RefPtr<WebKitFlags> flags;
- if (!isUndefinedOrNull(args[1]) && args[1]->IsObject()) {
- EXCEPTION_BLOCK(v8::Handle<v8::Object>, object, v8::Handle<v8::Object>::Cast(args[1]));
- flags = WebKitFlags::create();
- v8::Local<v8::Value> v8Create = object->Get(v8::String::New("create"));
- if (!v8Create.IsEmpty() && !isUndefinedOrNull(v8Create)) {
- EXCEPTION_BLOCK(bool, isCreate, v8Create->BooleanValue());
- flags->setCreate(isCreate);
- }
- v8::Local<v8::Value> v8Exclusive = object->Get(v8::String::New("exclusive"));
- if (!v8Exclusive.IsEmpty() && !isUndefinedOrNull(v8Exclusive)) {
- EXCEPTION_BLOCK(bool, isExclusive, v8Exclusive->BooleanValue());
- flags->setExclusive(isExclusive);
- }
- }
- RefPtr<EntryCallback> successCallback;
- if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) {
- if (!args[2]->IsObject())
- return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
- successCallback = V8EntryCallback::create(args[2], getScriptExecutionContext());
- }
- RefPtr<ErrorCallback> errorCallback;
- if (args.Length() > 3 && !args[3]->IsNull() && !args[3]->IsUndefined()) {
- if (!args[3]->IsObject())
- return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
- errorCallback = V8ErrorCallback::create(args[3], getScriptExecutionContext());
- }
- imp->getDirectory(path, flags, successCallback, errorCallback);
- return v8Undefined();
-}
-
-v8::Handle<v8::Value> V8DirectoryEntry::getFileCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.DirectoryEntry.getFile");
- DirectoryEntry* imp = V8DirectoryEntry::toNative(args.Holder());
-
- if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
-
- STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, path, args[0]);
- if (args.Length() <= 1) {
- imp->getFile(path);
- return v8Undefined();
- }
- RefPtr<WebKitFlags> flags;
- if (!isUndefinedOrNull(args[1]) && args[1]->IsObject()) {
- EXCEPTION_BLOCK(v8::Handle<v8::Object>, object, v8::Handle<v8::Object>::Cast(args[1]));
- flags = WebKitFlags::create();
- v8::Local<v8::Value> v8Create = object->Get(v8::String::New("create"));
- if (!v8Create.IsEmpty() && !isUndefinedOrNull(v8Create)) {
- EXCEPTION_BLOCK(bool, isCreate, v8Create->BooleanValue());
- flags->setCreate(isCreate);
- }
- v8::Local<v8::Value> v8Exclusive = object->Get(v8::String::New("exclusive"));
- if (!v8Exclusive.IsEmpty() && !isUndefinedOrNull(v8Exclusive)) {
- EXCEPTION_BLOCK(bool, isExclusive, v8Exclusive->BooleanValue());
- flags->setExclusive(isExclusive);
- }
- }
- RefPtr<EntryCallback> successCallback;
- if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) {
- if (!args[2]->IsObject())
- return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
- successCallback = V8EntryCallback::create(args[2], getScriptExecutionContext());
- }
- RefPtr<ErrorCallback> errorCallback;
- if (args.Length() > 3 && !args[3]->IsNull() && !args[3]->IsUndefined()) {
- if (!args[3]->IsObject())
- return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
- errorCallback = V8ErrorCallback::create(args[3], getScriptExecutionContext());
- }
- imp->getFile(path, flags, successCallback, errorCallback);
- return v8Undefined();
-}
-
-
-
-} // namespace WebCore
-
-#endif // ENABLE(FILE_SYSTEM)
diff --git a/Source/WebCore/bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp
deleted file mode 100644
index 646c29d23..000000000
--- a/Source/WebCore/bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "V8DirectoryEntrySync.h"
-
-#if ENABLE(FILE_SYSTEM)
-
-#include "DirectoryEntrySync.h"
-#include "ExceptionCode.h"
-#include "V8Binding.h"
-#include "V8EntryCallback.h"
-#include "V8ErrorCallback.h"
-#include "V8FileEntrySync.h"
-#include "V8Proxy.h"
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-
-namespace WebCore {
-
-static bool extractBooleanValue(const v8::Handle<v8::Object>& object, const char* name, ExceptionCode& ec) {
- ec = 0;
- v8::Local<v8::Value> value = object->Get(v8::String::New(name));
- if (!value.IsEmpty() && !isUndefinedOrNull(value)) {
- v8::TryCatch block;
- bool nativeValue = value->BooleanValue();
- if (block.HasCaught()) {
- ec = TYPE_MISMATCH_ERR;
- return false;
- }
- return nativeValue;
- }
- return false;
-}
-
-static PassRefPtr<WebKitFlags> getFlags(const v8::Local<v8::Value>& arg, ExceptionCode& ec)
-{
- ec = 0;
- if (isUndefinedOrNull(arg) || !arg->IsObject())
- return 0;
-
- v8::Handle<v8::Object> object;
- {
- v8::TryCatch block;
- object = v8::Handle<v8::Object>::Cast(arg);
- if (block.HasCaught()) {
- ec = TYPE_MISMATCH_ERR;
- return 0;
- }
- }
-
- bool isCreate = extractBooleanValue(object, "create", ec);
- if (ec)
- return 0;
- bool isExclusive = extractBooleanValue(object, "exclusive", ec);
- if (ec)
- return 0;
-
- RefPtr<WebKitFlags> flags = WebKitFlags::create();
- flags->setCreate(isCreate);
- flags->setExclusive(isExclusive);
-
- return flags;
-}
-
-v8::Handle<v8::Value> V8DirectoryEntrySync::getDirectoryCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.DirectoryEntrySync.getDirectory");
- DirectoryEntrySync* imp = V8DirectoryEntrySync::toNative(args.Holder());
- ExceptionCode ec = 0;
- STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, path, args[0]);
- RefPtr<WebKitFlags> flags = getFlags(args[1], ec);
- if (UNLIKELY(ec))
- return V8Proxy::setDOMException(ec, args.GetIsolate());
- RefPtr<DirectoryEntrySync> result = imp->getDirectory(path, flags, ec);
- if (UNLIKELY(ec))
- return V8Proxy::setDOMException(ec, args.GetIsolate());
- return toV8(result.release(), args.GetIsolate());
-}
-
-v8::Handle<v8::Value> V8DirectoryEntrySync::getFileCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.DirectoryEntrySync.getFile");
- DirectoryEntrySync* imp = V8DirectoryEntrySync::toNative(args.Holder());
- ExceptionCode ec = 0;
- STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, path, args[0]);
- RefPtr<WebKitFlags> flags = getFlags(args[1], ec);
- if (UNLIKELY(ec))
- return V8Proxy::setDOMException(ec, args.GetIsolate());
- RefPtr<FileEntrySync> result = imp->getFile(path, flags, ec);
- if (UNLIKELY(ec))
- return V8Proxy::setDOMException(ec, args.GetIsolate());
- return toV8(result.release(), args.GetIsolate());
-}
-
-
-
-} // namespace WebCore
-
-#endif // ENABLE(FILE_SYSTEM)
diff --git a/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
index 15907a52f..ce72b602a 100644
--- a/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
@@ -78,7 +78,7 @@ v8::Handle<v8::Value> V8Document::evaluateCallback(const v8::Arguments& args)
RefPtr<XPathNSResolver> resolver = V8DOMWrapper::getXPathNSResolver(args[2]);
if (!resolver && !args[2]->IsNull() && !args[2]->IsUndefined())
- return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
+ return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
int type = toInt32(args[3]);
RefPtr<XPathResult> inResult;
@@ -91,7 +91,7 @@ v8::Handle<v8::Value> V8Document::evaluateCallback(const v8::Arguments& args)
return throwError(exceptionCatcher.Exception(), args.GetIsolate());
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return toV8(result.release(), args.GetIsolate());
}
diff --git a/Source/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp
index b2d81e84c..7613a14b1 100644
--- a/Source/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp
@@ -40,7 +40,7 @@ v8::Handle<v8::Value> V8Document::locationAccessorGetter(v8::Local<v8::String> n
if (!document->frame())
return v8::Null(info.GetIsolate());
- DOMWindow* window = document->frame()->domWindow();
+ DOMWindow* window = document->domWindow();
return toV8(window->location(), info.GetIsolate());
}
@@ -60,7 +60,7 @@ void V8Document::locationAccessorSetter(v8::Local<v8::String> name, v8::Local<v8
if (!first)
return;
- DOMWindow* window = document->frame()->domWindow();
+ DOMWindow* window = document->domWindow();
if (Location* location = window->location())
location->setHref(toWebCoreString(value), active, first);
}
diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp
index 532e257ac..6bcdc71c9 100644
--- a/Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp
@@ -81,7 +81,7 @@ v8::Handle<v8::Value> V8HTMLAllCollection::namedPropertyGetter(v8::Local<v8::Str
return v8Undefined();
HTMLAllCollection* imp = V8HTMLAllCollection::toNative(info.Holder());
- return getNamedItems(imp, v8ValueToAtomicWebCoreString(name), info.GetIsolate());
+ return getNamedItems(imp, toWebCoreAtomicString(name), info.GetIsolate());
}
v8::Handle<v8::Value> V8HTMLAllCollection::itemCallback(const v8::Arguments& args)
diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
index 942602d06..f9e36cb6b 100644
--- a/Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
@@ -127,7 +127,7 @@ v8::Handle<v8::Value> V8HTMLCanvasElement::toDataURLCallback(const v8::Arguments
}
String result = canvas->toDataURL(type, qualityPtr, ec);
- V8Proxy::setDOMException(ec, args.GetIsolate());
+ setDOMException(ec, args.GetIsolate());
return v8StringOrUndefined(result, args.GetIsolate());
}
diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp
index 3802bb3ec..eb0fd25d2 100644
--- a/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp
@@ -70,7 +70,7 @@ v8::Handle<v8::Value> V8HTMLCollection::namedPropertyGetter(v8::Local<v8::String
return v8Undefined();
HTMLCollection* imp = V8HTMLCollection::toNative(info.Holder());
- return getNamedItems(imp, v8ValueToAtomicWebCoreString(name), info.GetIsolate());
+ return getNamedItems(imp, toWebCoreAtomicString(name), info.GetIsolate());
}
v8::Handle<v8::Value> V8HTMLCollection::namedItemCallback(const v8::Arguments& args)
diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
index 0d421f96d..fb801a761 100644
--- a/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
@@ -94,7 +94,7 @@ v8::Handle<v8::Value> V8HTMLDocument::GetNamedProperty(HTMLDocument* htmlDocumen
Node* node = items->item(0);
Frame* frame = 0;
if (node->hasTagName(HTMLNames::iframeTag) && (frame = static_cast<HTMLIFrameElement*>(node)->contentFrame()))
- return toV8(frame->domWindow(), isolate);
+ return toV8(frame->document()->domWindow(), isolate);
return toV8(node, isolate);
}
@@ -151,13 +151,13 @@ v8::Handle<v8::Value> V8HTMLDocument::openCallback(const v8::Arguments& args)
v8::Local<v8::Value> function = global->Get(v8::String::New("open"));
// If the open property is not a function throw a type error.
if (!function->IsFunction())
- return V8Proxy::throwTypeError("open is not a function", args.GetIsolate());
+ return throwTypeError("open is not a function", args.GetIsolate());
// Wrap up the arguments and call the function.
OwnArrayPtr<v8::Local<v8::Value> > params = adoptArrayPtr(new v8::Local<v8::Value>[args.Length()]);
for (int i = 0; i < args.Length(); i++)
params[i] = args[i];
- return frame->script()->proxy()->callFunction(v8::Local<v8::Function>::Cast(function), global, args.Length(), params.get());
+ return frame->script()->callFunction(v8::Local<v8::Function>::Cast(function), global, args.Length(), params.get());
}
}
diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLElementCustom.cpp
index b9c0b06e4..5824098d2 100644
--- a/Source/WebCore/bindings/v8/custom/V8HTMLElementCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8HTMLElementCustom.cpp
@@ -60,7 +60,7 @@ void V8HTMLElement::itemValueAccessorSetter(v8::Local<v8::String> name, v8::Loca
ExceptionCode ec = 0;
impl->setItemValue(toWebCoreString(value), ec);
if (ec)
- V8Proxy::setDOMException(ec, info.GetIsolate());
+ setDOMException(ec, info.GetIsolate());
}
#endif
diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLFormElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLFormElementCustom.cpp
index bec020d95..c650649df 100644
--- a/Source/WebCore/bindings/v8/custom/V8HTMLFormElementCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8HTMLFormElementCustom.cpp
@@ -56,7 +56,7 @@ v8::Handle<v8::Value> V8HTMLFormElement::namedPropertyGetter(v8::Local<v8::Strin
{
INC_STATS("DOM.HTMLFormElement.NamedPropertyGetter");
HTMLFormElement* imp = V8HTMLFormElement::toNative(info.Holder());
- AtomicString v = v8ValueToAtomicWebCoreString(name);
+ AtomicString v = toWebCoreAtomicString(name);
// Call getNamedElements twice, first time check if it has a value
// and let HTMLFormElement update its cache.
diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp
index 519e015f7..0a9693aba 100644
--- a/Source/WebCore/bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp
@@ -49,15 +49,17 @@ v8::Handle<v8::Value> V8HTMLFrameSetElement::namedPropertyGetter(v8::Local<v8::S
{
INC_STATS("DOM.HTMLFrameSetElement.NamedPropertyGetter");
HTMLFrameSetElement* imp = V8HTMLFrameSetElement::toNative(info.Holder());
- Node* frameNode = imp->children()->namedItem(v8ValueToAtomicWebCoreString(name));
- if (frameNode && frameNode->hasTagName(HTMLNames::frameTag)) {
- Document* doc = static_cast<HTMLFrameElement*>(frameNode)->contentDocument();
- if (!doc)
- return v8::Undefined();
- if (Frame* frame = doc->frame())
- return toV8(frame->domWindow(), info.GetIsolate());
- }
- return v8Undefined();
+ Node* frameNode = imp->children()->namedItem(toWebCoreAtomicString(name));
+ if (!frameNode)
+ return v8Undefined();
+ if (!frameNode->hasTagName(HTMLNames::frameTag))
+ return v8Undefined();
+ Document* document = static_cast<HTMLFrameElement*>(frameNode)->contentDocument();
+ if (!document)
+ return v8Undefined();
+ if (!document->frame())
+ return v8Undefined();
+ return toV8(document->domWindow(), info.GetIsolate());
}
} // namespace WebCore
diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
index c06d77a7e..81110b785 100644
--- a/Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
@@ -51,18 +51,18 @@ static v8::Handle<v8::Value> v8HTMLImageElementConstructorCallback(const v8::Arg
INC_STATS("DOM.HTMLImageElement.Contructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
+ return throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
Frame* frame = currentFrame(BindingState::instance());
if (!frame)
- return V8Proxy::throwError(V8Proxy::ReferenceError, "Image constructor associated frame is unavailable", args.GetIsolate());
+ return throwError(ReferenceError, "Image constructor associated frame is unavailable", args.GetIsolate());
Document* document = frame->document();
if (!document)
- return V8Proxy::throwError(V8Proxy::ReferenceError, "Image constructor associated document is unavailable", args.GetIsolate());
+ return throwError(ReferenceError, "Image constructor associated document is unavailable", args.GetIsolate());
// Make sure the document is added to the DOM Node map. Otherwise, the HTMLImageElement instance
// may end up being the only node in the map and get garbage-ccollected prematurely.
diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp
index 03ead6584..63825a9b2 100644
--- a/Source/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp
@@ -45,7 +45,7 @@ v8::Handle<v8::Value> V8HTMLInputElement::selectionStartAccessorGetter(v8::Local
HTMLInputElement* imp = V8HTMLInputElement::toNative(holder);
if (!imp->canHaveSelection())
- return V8Proxy::throwTypeError("Accessing selectionStart on an input element that cannot have a selection.", info.GetIsolate());
+ return throwTypeError("Accessing selectionStart on an input element that cannot have a selection.", info.GetIsolate());
int v = imp->selectionStart();
return v8Integer(v, info.GetIsolate());
@@ -58,7 +58,7 @@ void V8HTMLInputElement::selectionStartAccessorSetter(v8::Local<v8::String> name
HTMLInputElement* imp = V8HTMLInputElement::toNative(holder);
if (!imp->canHaveSelection()) {
- V8Proxy::throwTypeError("Accessing selectionStart on an input element that cannot have a selection.", info.GetIsolate());
+ throwTypeError("Accessing selectionStart on an input element that cannot have a selection.", info.GetIsolate());
return;
}
imp->setSelectionStart(value->Int32Value());
@@ -71,7 +71,7 @@ v8::Handle<v8::Value> V8HTMLInputElement::selectionEndAccessorGetter(v8::Local<v
HTMLInputElement* imp = V8HTMLInputElement::toNative(holder);
if (!imp->canHaveSelection())
- return V8Proxy::throwTypeError("Accessing selectionEnd on an input element that cannot have a selection.", info.GetIsolate());
+ return throwTypeError("Accessing selectionEnd on an input element that cannot have a selection.", info.GetIsolate());
int v = imp->selectionEnd();
return v8Integer(v, info.GetIsolate());
@@ -84,7 +84,7 @@ void V8HTMLInputElement::selectionEndAccessorSetter(v8::Local<v8::String> name,
HTMLInputElement* imp = V8HTMLInputElement::toNative(holder);
if (!imp->canHaveSelection()) {
- V8Proxy::throwTypeError("Accessing selectionEnd on an input element that cannot have a selection.", info.GetIsolate());
+ throwTypeError("Accessing selectionEnd on an input element that cannot have a selection.", info.GetIsolate());
return;
}
@@ -98,7 +98,7 @@ v8::Handle<v8::Value> V8HTMLInputElement::selectionDirectionAccessorGetter(v8::L
HTMLInputElement* imp = V8HTMLInputElement::toNative(holder);
if (!imp->canHaveSelection())
- return V8Proxy::throwTypeError("Accessing selectionDirection on an input element that cannot have a selection.", info.GetIsolate());
+ return throwTypeError("Accessing selectionDirection on an input element that cannot have a selection.", info.GetIsolate());
return v8String(imp->selectionDirection(), info.GetIsolate());
}
@@ -110,7 +110,7 @@ void V8HTMLInputElement::selectionDirectionAccessorSetter(v8::Local<v8::String>
HTMLInputElement* imp = V8HTMLInputElement::toNative(holder);
if (!imp->canHaveSelection()) {
- V8Proxy::throwTypeError("Accessing selectionDirection on an input element that cannot have a selection.", info.GetIsolate());
+ throwTypeError("Accessing selectionDirection on an input element that cannot have a selection.", info.GetIsolate());
return;
}
@@ -124,7 +124,7 @@ v8::Handle<v8::Value> V8HTMLInputElement::setSelectionRangeCallback(const v8::Ar
HTMLInputElement* imp = V8HTMLInputElement::toNative(holder);
if (!imp->canHaveSelection())
- return V8Proxy::throwTypeError("Calling setSelectionRange on an input element that cannot have a selection.", args.GetIsolate());
+ return throwTypeError("Calling setSelectionRange on an input element that cannot have a selection.", args.GetIsolate());
int start = args[0]->Int32Value();
int end = args[1]->Int32Value();
diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp
index 327feff3f..ddb517202 100644
--- a/Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp
@@ -43,7 +43,7 @@ void V8HTMLMediaElement::controllerAccessorSetter(v8::Local<v8::String> name, v8
controller = V8MediaController::toNative(value->ToObject());
if (!controller) {
- V8Proxy::throwTypeError("Value is not of type MediaController", info.GetIsolate());
+ throwTypeError("Value is not of type MediaController", info.GetIsolate());
return;
}
diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp
index 9030b512d..8ee991d67 100644
--- a/Source/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp
@@ -56,7 +56,7 @@ v8::Handle<v8::Value> V8HTMLOptionsCollection::addCallback(const v8::Arguments&
{
INC_STATS("DOM.HTMLOptionsCollection.add()");
if (!V8HTMLOptionElement::HasInstance(args[0]))
- return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
+ return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(args.Holder());
HTMLOptionElement* option = V8HTMLOptionElement::toNative(v8::Handle<v8::Object>(v8::Handle<v8::Object>::Cast(args[0])));
@@ -78,7 +78,7 @@ v8::Handle<v8::Value> V8HTMLOptionsCollection::addCallback(const v8::Arguments&
}
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return v8::Undefined();
}
@@ -109,7 +109,7 @@ void V8HTMLOptionsCollection::lengthAccessorSetter(v8::Local<v8::String> name, v
if (!ec)
imp->setLength(newLength, ec);
- V8Proxy::setDOMException(ec, info.GetIsolate());
+ setDOMException(ec, info.GetIsolate());
}
v8::Handle<v8::Value> V8HTMLOptionsCollection::indexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info)
diff --git a/Source/WebCore/bindings/v8/custom/V8HistoryCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HistoryCustom.cpp
index 6f4cd687a..acdb74972 100644
--- a/Source/WebCore/bindings/v8/custom/V8HistoryCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8HistoryCustom.cpp
@@ -81,7 +81,7 @@ v8::Handle<v8::Value> V8History::pushStateCallback(const v8::Arguments& args)
History* history = V8History::toNative(args.Holder());
history->stateObjectAdded(historyState.release(), title, url, History::StateObjectPush, ec);
args.Holder()->DeleteHiddenValue(V8HiddenPropertyName::state());
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
v8::Handle<v8::Value> V8History::replaceStateCallback(const v8::Arguments& args)
@@ -106,7 +106,7 @@ v8::Handle<v8::Value> V8History::replaceStateCallback(const v8::Arguments& args)
History* history = V8History::toNative(args.Holder());
history->stateObjectAdded(historyState.release(), title, url, History::StateObjectReplace, ec);
args.Holder()->DeleteHiddenValue(V8HiddenPropertyName::state());
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
bool V8History::indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value>)
diff --git a/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp b/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
index f7794ae95..4dd181b88 100644
--- a/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
@@ -84,7 +84,7 @@ v8::Handle<v8::Value> V8InjectedScriptHost::inspectedObjectCallback(const v8::Ar
return v8::Undefined();
if (!args[0]->IsInt32())
- return V8Proxy::throwTypeError("argument has to be an integer", args.GetIsolate());
+ return throwTypeError("argument has to be an integer", args.GetIsolate());
InjectedScriptHost* host = V8InjectedScriptHost::toNative(args.Holder());
InjectedScriptHost::InspectableObject* object = host->inspectedObject(args[0]->ToInt32()->Value());
@@ -207,7 +207,15 @@ static v8::Handle<v8::Array> getJSListenerFunctions(Document* document, const Ev
// Hide listeners from other contexts.
if (context != v8::Context::GetCurrent())
continue;
- v8::Local<v8::Object> function = v8Listener->getListenerObject(document);
+ v8::Local<v8::Object> function;
+ {
+ // getListenerObject() may cause JS in the event attribute to get compiled, potentially unsuccessfully.
+ v8::TryCatch block;
+ function = v8Listener->getListenerObject(document);
+ if (block.HasCaught())
+ continue;
+ }
+ ASSERT(!function.IsEmpty());
v8::Local<v8::Object> listenerEntry = v8::Object::New();
listenerEntry->Set(v8::String::New("listener"), function);
listenerEntry->Set(v8::String::New("useCapture"), v8::Boolean::New(listenerInfo.eventListenerVector[i].useCapture));
diff --git a/Source/WebCore/bindings/v8/custom/V8InjectedScriptManager.cpp b/Source/WebCore/bindings/v8/custom/V8InjectedScriptManager.cpp
index fbd8d3ad9..3bd2d4e56 100644
--- a/Source/WebCore/bindings/v8/custom/V8InjectedScriptManager.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8InjectedScriptManager.cpp
@@ -35,7 +35,6 @@
#include "BindingState.h"
#include "DOMWindow.h"
#include "InjectedScriptHost.h"
-#include "SafeAllocation.h"
#include "ScriptObject.h"
#include "V8Binding.h"
#include "V8DOMWindow.h"
@@ -59,7 +58,7 @@ static v8::Local<v8::Object> createInjectedScriptHostV8Wrapper(InjectedScriptHos
// Return if allocation failed.
return v8::Local<v8::Object>();
}
- v8::Local<v8::Object> instance = SafeAllocation::newInstance(function);
+ v8::Local<v8::Object> instance = V8ObjectConstructor::newInstance(function);
if (instance.IsEmpty()) {
// Avoid setting the wrapper if allocation failed.
return v8::Local<v8::Object>();
diff --git a/Source/WebCore/bindings/v8/custom/V8IntentConstructor.cpp b/Source/WebCore/bindings/v8/custom/V8IntentConstructor.cpp
index 164e691cc..848a91656 100644
--- a/Source/WebCore/bindings/v8/custom/V8IntentConstructor.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8IntentConstructor.cpp
@@ -47,12 +47,12 @@ v8::Handle<v8::Value> V8Intent::constructorCallback(const v8::Arguments& args)
INC_STATS("DOM.Intent.Constructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
+ return throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
if (args.Length() == 1) {
// Use the dictionary constructor. This block will return if the
// argument isn't a valid Dictionary.
@@ -60,7 +60,7 @@ v8::Handle<v8::Value> V8Intent::constructorCallback(const v8::Arguments& args)
ExceptionCode ec = 0;
RefPtr<Intent> impl = Intent::create(ScriptState::current(), options, ec);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
v8::Handle<v8::Object> wrapper = args.Holder();
V8DOMWrapper::setDOMWrapper(wrapper, &info, impl.get());
@@ -75,16 +75,16 @@ v8::Handle<v8::Value> V8Intent::constructorCallback(const v8::Arguments& args)
ArrayBufferArray arrayBufferArrayTransferList;
if (args.Length() > 3) {
if (!extractTransferables(args[3], messagePortArrayTransferList, arrayBufferArrayTransferList, args.GetIsolate()))
- return V8Proxy::throwTypeError("Could not extract transferables", args.GetIsolate());
+ return throwTypeError("Could not extract transferables", args.GetIsolate());
}
bool dataDidThrow = false;
RefPtr<SerializedScriptValue> data = SerializedScriptValue::create(args[2], &messagePortArrayTransferList, &arrayBufferArrayTransferList, dataDidThrow);
if (dataDidThrow)
- return V8Proxy::setDOMException(DATA_CLONE_ERR, args.GetIsolate());
+ return setDOMException(DATA_CLONE_ERR, args.GetIsolate());
RefPtr<Intent> impl = Intent::create(action, type, data, messagePortArrayTransferList, ec);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
v8::Handle<v8::Object> wrapper = args.Holder();
V8DOMWrapper::setDOMWrapper(wrapper, &info, impl.get());
diff --git a/Source/WebCore/bindings/v8/custom/V8LocationCustom.cpp b/Source/WebCore/bindings/v8/custom/V8LocationCustom.cpp
index 5192563d7..df9f38527 100644
--- a/Source/WebCore/bindings/v8/custom/V8LocationCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8LocationCustom.cpp
@@ -130,7 +130,7 @@ void V8Location::protocolAccessorSetter(v8::Local<v8::String> name, v8::Local<v8
ExceptionCode ec = 0;
impl->setProtocol(protocol, activeDOMWindow(state), firstDOMWindow(state), ec);
if (UNLIKELY(ec))
- V8Proxy::setDOMException(ec, info.GetIsolate());
+ setDOMException(ec, info.GetIsolate());
}
void V8Location::searchAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
diff --git a/Source/WebCore/bindings/v8/custom/V8MessageChannelConstructor.cpp b/Source/WebCore/bindings/v8/custom/V8MessageChannelConstructor.cpp
index 70131dcc3..ae355694d 100644
--- a/Source/WebCore/bindings/v8/custom/V8MessageChannelConstructor.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8MessageChannelConstructor.cpp
@@ -51,7 +51,7 @@ v8::Handle<v8::Value> V8MessageChannel::constructorCallback(const v8::Arguments&
// FIXME: The logic here is almost exact duplicate of V8::constructDOMObject.
// Consider refactoring to reduce duplication.
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
+ return throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
diff --git a/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp b/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp
index 6afd87231..2c0209a46 100644
--- a/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp
@@ -110,12 +110,12 @@ v8::Handle<v8::Value> V8MessageEvent::initMessageEventCallback(const v8::Argumen
{
INC_STATS("DOM.MessageEvent.initMessageEvent");
MessageEvent* event = V8MessageEvent::toNative(args.Holder());
- String typeArg = v8ValueToWebCoreString(args[0]);
+ String typeArg = toWebCoreString(args[0]);
bool canBubbleArg = args[1]->BooleanValue();
bool cancelableArg = args[2]->BooleanValue();
ScriptValue dataArg = ScriptValue(args[3]);
- String originArg = v8ValueToWebCoreString(args[4]);
- String lastEventIdArg = v8ValueToWebCoreString(args[5]);
+ String originArg = toWebCoreString(args[4]);
+ String lastEventIdArg = toWebCoreString(args[5]);
DOMWindow* sourceArg = 0;
if (args[6]->IsObject()) {
diff --git a/Source/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp b/Source/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp
index aa94c339b..7fe8faae2 100644
--- a/Source/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp
@@ -62,7 +62,7 @@ static v8::Handle<v8::Value> handlePostMessageCallback(const v8::Arguments& args
return v8::Undefined();
ExceptionCode ec = 0;
messagePort->postMessage(message.release(), &portArray, ec);
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
v8::Handle<v8::Value> V8MessagePort::postMessageCallback(const v8::Arguments& args)
diff --git a/Source/WebCore/bindings/v8/custom/V8MutationCallbackCustom.cpp b/Source/WebCore/bindings/v8/custom/V8MutationCallbackCustom.cpp
index 9280b216c..7f3095d63 100644
--- a/Source/WebCore/bindings/v8/custom/V8MutationCallbackCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8MutationCallbackCustom.cpp
@@ -36,7 +36,7 @@
#include "ScriptExecutionContext.h"
#include "V8Binding.h"
-#include "V8CustomVoidCallback.h"
+#include "V8Callback.h"
#include "V8MutationObserver.h"
#include "V8MutationRecord.h"
#include "V8Proxy.h"
diff --git a/Source/WebCore/bindings/v8/custom/V8MutationObserverCustom.cpp b/Source/WebCore/bindings/v8/custom/V8MutationObserverCustom.cpp
index 66e88f641..7c9e5250a 100644
--- a/Source/WebCore/bindings/v8/custom/V8MutationObserverCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8MutationObserverCustom.cpp
@@ -49,21 +49,21 @@ v8::Handle<v8::Value> V8MutationObserver::constructorCallback(const v8::Argument
INC_STATS("DOM.MutationObserver.Constructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
+ return throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
v8::Local<v8::Value> arg = args[0];
if (!arg->IsObject())
- return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
+ return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
ScriptExecutionContext* context = getScriptExecutionContext();
if (!context)
- return V8Proxy::throwError(V8Proxy::ReferenceError, "MutationObserver constructor's associated frame unavailable", args.GetIsolate());
+ return throwError(ReferenceError, "MutationObserver constructor's associated frame unavailable", args.GetIsolate());
RefPtr<MutationCallback> callback = V8MutationCallback::create(arg, context);
RefPtr<MutationObserver> observer = MutationObserver::create(callback.release());
diff --git a/Source/WebCore/bindings/v8/custom/V8NodeCustom.cpp b/Source/WebCore/bindings/v8/custom/V8NodeCustom.cpp
index ce2dfa313..3aba2f967 100644
--- a/Source/WebCore/bindings/v8/custom/V8NodeCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8NodeCustom.cpp
@@ -72,7 +72,7 @@ v8::Handle<v8::Value> V8Node::insertBeforeCallback(const v8::Arguments& args)
Node* refChild = V8Node::HasInstance(args[1]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
bool success = imp->insertBefore(newChild, refChild, ec, true);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
if (success)
return args[0];
return v8::Null(args.GetIsolate());
@@ -89,7 +89,7 @@ v8::Handle<v8::Value> V8Node::replaceChildCallback(const v8::Arguments& args)
Node* oldChild = V8Node::HasInstance(args[1]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
bool success = imp->replaceChild(newChild, oldChild, ec, true);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
if (success)
return args[1];
return v8::Null(args.GetIsolate());
@@ -104,7 +104,7 @@ v8::Handle<v8::Value> V8Node::removeChildCallback(const v8::Arguments& args)
Node* oldChild = V8Node::HasInstance(args[0]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
bool success = imp->removeChild(oldChild, ec);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
if (success)
return args[0];
return v8::Null(args.GetIsolate());
@@ -120,7 +120,7 @@ v8::Handle<v8::Value> V8Node::appendChildCallback(const v8::Arguments& args)
Node* newChild = V8Node::HasInstance(args[0]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
bool success = imp->appendChild(newChild, ec, true );
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
if (success)
return args[0];
return v8::Null(args.GetIsolate());
diff --git a/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp b/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp
index 681fe49d1..595b484ed 100644
--- a/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp
@@ -46,7 +46,7 @@ v8::Handle<v8::Value> V8NodeList::namedPropertyGetter(v8::Local<v8::String> name
{
INC_STATS("DOM.NodeList.NamedPropertyGetter");
NodeList* list = V8NodeList::toNative(info.Holder());
- AtomicString key = v8ValueToAtomicWebCoreString(name);
+ AtomicString key = toWebCoreAtomicString(name);
// Length property cannot be overridden.
DEFINE_STATIC_LOCAL(const AtomicString, length, ("length"));
diff --git a/Source/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp b/Source/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp
index 1890f1e34..7626a0b46 100644
--- a/Source/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp
@@ -38,11 +38,11 @@
#include "Notification.h"
#include "NotificationCenter.h"
#include "V8Binding.h"
-#include "V8CustomVoidCallback.h"
#include "V8EventListener.h"
#include "V8Notification.h"
#include "V8Proxy.h"
#include "V8Utilities.h"
+#include "V8VoidCallback.h"
#include "WorkerContext.h"
namespace WebCore {
@@ -57,7 +57,7 @@ v8::Handle<v8::Value> V8NotificationCenter::createHTMLNotificationCallback(const
RefPtr<Notification> notification = notificationCenter->createHTMLNotification(url, ec);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
notification->ref();
return toV8(notification.get(), args.GetIsolate());
@@ -72,7 +72,7 @@ v8::Handle<v8::Value> V8NotificationCenter::createNotificationCallback(const v8:
RefPtr<Notification> notification = notificationCenter->createNotification(toWebCoreString(args[0]), toWebCoreString(args[1]), toWebCoreString(args[2]), ec);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
notification->ref();
return toV8(notification.get(), args.GetIsolate());
@@ -86,18 +86,18 @@ v8::Handle<v8::Value> V8NotificationCenter::requestPermissionCallback(const v8::
// Make sure that script execution context is valid.
if (!context)
- return V8Proxy::setDOMException(INVALID_STATE_ERR, args.GetIsolate());
+ return setDOMException(INVALID_STATE_ERR, args.GetIsolate());
// Requesting permission is only valid from a page context.
if (context->isWorkerContext())
- return V8Proxy::setDOMException(NOT_SUPPORTED_ERR, args.GetIsolate());
+ return setDOMException(NOT_SUPPORTED_ERR, args.GetIsolate());
- RefPtr<V8CustomVoidCallback> callback;
+ RefPtr<V8VoidCallback> callback;
if (args.Length() > 0) {
if (!args[0]->IsObject())
- return V8Proxy::throwTypeError("Callback must be of valid type.", args.GetIsolate());
+ return throwTypeError("Callback must be of valid type.", args.GetIsolate());
- callback = V8CustomVoidCallback::create(args[0], context);
+ callback = V8VoidCallback::create(args[0], context);
}
notificationCenter->requestPermission(callback.release());
diff --git a/Source/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp b/Source/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp
index 743956958..a7c40419b 100644
--- a/Source/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp
@@ -44,16 +44,16 @@ v8::Handle<v8::Value> V8SQLResultSetRowList::itemCallback(const v8::Arguments& a
INC_STATS("DOM.SQLResultSetRowList.item()");
if (!args.Length())
- return V8Proxy::throwError(V8Proxy::SyntaxError, "Item index is required.", args.GetIsolate());
+ return throwError(SyntaxError, "Item index is required.", args.GetIsolate());
if (!args[0]->IsNumber())
- return V8Proxy::throwTypeError("Item index must be a number.", args.GetIsolate());
+ return throwTypeError("Item index must be a number.", args.GetIsolate());
SQLResultSetRowList* rowList = V8SQLResultSetRowList::toNative(args.Holder());
unsigned long index = args[0]->IntegerValue();
if (index >= rowList->length())
- return V8Proxy::throwError(V8Proxy::RangeError, "Item index is out of range.", args.GetIsolate());
+ return throwError(RangeError, "Item index is out of range.", args.GetIsolate());
v8::Local<v8::Object> item = v8::Object::New();
unsigned numColumns = rowList->columnNames().size();
diff --git a/Source/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp b/Source/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp
index bbc931406..c6622eb43 100644
--- a/Source/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp
@@ -52,7 +52,7 @@ v8::Handle<v8::Value> V8SQLTransaction::executeSqlCallback(const v8::Arguments&
INC_STATS("DOM.SQLTransaction.executeSql()");
if (args.Length() == 0)
- return V8Proxy::setDOMException(SYNTAX_ERR, args.GetIsolate());
+ return setDOMException(SYNTAX_ERR, args.GetIsolate());
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, statement, args[0]);
@@ -60,7 +60,7 @@ v8::Handle<v8::Value> V8SQLTransaction::executeSqlCallback(const v8::Arguments&
if (args.Length() > 1 && !isUndefinedOrNull(args[1])) {
if (!args[1]->IsObject())
- return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
+ return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
uint32_t sqlArgsLength = 0;
v8::Local<v8::Object> sqlArgsObject = args[1]->ToObject();
@@ -96,20 +96,20 @@ v8::Handle<v8::Value> V8SQLTransaction::executeSqlCallback(const v8::Arguments&
RefPtr<SQLStatementCallback> callback;
if (args.Length() > 2 && !isUndefinedOrNull(args[2])) {
if (!args[2]->IsObject())
- return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
+ return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
callback = V8SQLStatementCallback::create(args[2], scriptExecutionContext);
}
RefPtr<SQLStatementErrorCallback> errorCallback;
if (args.Length() > 3 && !isUndefinedOrNull(args[3])) {
if (!args[3]->IsObject())
- return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
+ return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
errorCallback = V8SQLStatementErrorCallback::create(args[3], scriptExecutionContext);
}
ExceptionCode ec = 0;
transaction->executeSQL(statement, sqlValues, callback, errorCallback, ec);
- V8Proxy::setDOMException(ec, args.GetIsolate());
+ setDOMException(ec, args.GetIsolate());
return v8::Undefined();
}
diff --git a/Source/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp b/Source/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp
index 37eb64ac8..f6e99d206 100644
--- a/Source/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp
@@ -52,7 +52,7 @@ v8::Handle<v8::Value> V8SQLTransactionSync::executeSqlCallback(const v8::Argumen
INC_STATS("DOM.SQLTransactionSync.executeSql()");
if (!args.Length())
- return V8Proxy::setDOMException(SYNTAX_ERR, args.GetIsolate());
+ return setDOMException(SYNTAX_ERR, args.GetIsolate());
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, statement, args[0]);
@@ -60,7 +60,7 @@ v8::Handle<v8::Value> V8SQLTransactionSync::executeSqlCallback(const v8::Argumen
if (args.Length() > 1 && !isUndefinedOrNull(args[1])) {
if (!args[1]->IsObject())
- return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
+ return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
uint32_t sqlArgsLength = 0;
v8::Local<v8::Object> sqlArgsObject = args[1]->ToObject();
@@ -91,7 +91,7 @@ v8::Handle<v8::Value> V8SQLTransactionSync::executeSqlCallback(const v8::Argumen
ExceptionCode ec = 0;
v8::Handle<v8::Value> result = toV8(transaction->executeSQL(statement, sqlValues, ec), args.GetIsolate());
- V8Proxy::setDOMException(ec, args.GetIsolate());
+ setDOMException(ec, args.GetIsolate());
return result;
}
diff --git a/Source/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp b/Source/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
index a8aa0a22e..f494adcb0 100644
--- a/Source/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
@@ -49,7 +49,7 @@ v8::Handle<v8::Value> V8SVGLength::valueAccessorGetter(v8::Local<v8::String> nam
SVGLengthContext lengthContext(wrapper->contextElement());
float value = imp.value(lengthContext, ec);
if (UNLIKELY(ec))
- return V8Proxy::setDOMException(ec, info.GetIsolate());
+ return setDOMException(ec, info.GetIsolate());
return v8::Number::New(value);
}
@@ -58,12 +58,12 @@ void V8SVGLength::valueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::
INC_STATS("DOM.SVGLength.value._set");
SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(info.Holder());
if (wrapper->isReadOnly()) {
- V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR, info.GetIsolate());
+ setDOMException(NO_MODIFICATION_ALLOWED_ERR, info.GetIsolate());
return;
}
if (!isUndefinedOrNull(value) && !value->IsNumber() && !value->IsBoolean()) {
- V8Proxy::throwTypeError(0, info.GetIsolate());
+ throwTypeError(0, info.GetIsolate());
return;
}
@@ -72,7 +72,7 @@ void V8SVGLength::valueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::
SVGLengthContext lengthContext(wrapper->contextElement());
imp.setValue(static_cast<float>(value->NumberValue()), lengthContext, ec);
if (UNLIKELY(ec))
- V8Proxy::setDOMException(ec, info.GetIsolate());
+ setDOMException(ec, info.GetIsolate());
else
wrapper->commitChange();
}
@@ -82,10 +82,10 @@ v8::Handle<v8::Value> V8SVGLength::convertToSpecifiedUnitsCallback(const v8::Arg
INC_STATS("DOM.SVGLength.convertToSpecifiedUnits");
SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(args.Holder());
if (wrapper->isReadOnly())
- return V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR, args.GetIsolate());
+ return setDOMException(NO_MODIFICATION_ALLOWED_ERR, args.GetIsolate());
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
SVGLength& imp = wrapper->propertyReference();
ExceptionCode ec = 0;
@@ -93,7 +93,7 @@ v8::Handle<v8::Value> V8SVGLength::convertToSpecifiedUnitsCallback(const v8::Arg
SVGLengthContext lengthContext(wrapper->contextElement());
imp.convertToSpecifiedUnits(unitType, lengthContext, ec);
if (UNLIKELY(ec))
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
wrapper->commitChange();
return v8Undefined();
diff --git a/Source/WebCore/bindings/v8/custom/V8ScriptProfileCustom.cpp b/Source/WebCore/bindings/v8/custom/V8ScriptProfileCustom.cpp
index 226a85ad3..2963980b8 100644
--- a/Source/WebCore/bindings/v8/custom/V8ScriptProfileCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8ScriptProfileCustom.cpp
@@ -32,7 +32,6 @@
#if ENABLE(JAVASCRIPT_DEBUGGER)
#include "V8ScriptProfile.h"
-#include "SafeAllocation.h"
#include "ScriptProfile.h"
#include "V8Binding.h"
#include "V8Proxy.h"
@@ -50,7 +49,7 @@ v8::Handle<v8::Value> toV8(ScriptProfile* impl, v8::Isolate* isolate)
// Return if allocation failed.
return v8Undefined();
}
- v8::Local<v8::Object> instance = SafeAllocation::newInstance(function);
+ v8::Local<v8::Object> instance = V8ObjectConstructor::newInstance(function);
if (instance.IsEmpty()) {
// Avoid setting the wrapper if allocation failed.
return v8Undefined();
diff --git a/Source/WebCore/bindings/v8/custom/V8ScriptProfileNodeCustom.cpp b/Source/WebCore/bindings/v8/custom/V8ScriptProfileNodeCustom.cpp
index f295ae04e..845c92471 100644
--- a/Source/WebCore/bindings/v8/custom/V8ScriptProfileNodeCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8ScriptProfileNodeCustom.cpp
@@ -32,7 +32,6 @@
#if ENABLE(JAVASCRIPT_DEBUGGER)
#include "V8ScriptProfileNode.h"
-#include "SafeAllocation.h"
#include "ScriptProfileNode.h"
#include "V8Binding.h"
#include "V8Proxy.h"
@@ -57,7 +56,7 @@ v8::Handle<v8::Value> toV8(ScriptProfileNode* impl, v8::Isolate* isolate)
// Return if allocation failed.
return v8Undefined();
}
- v8::Local<v8::Object> instance = SafeAllocation::newInstance(function);
+ v8::Local<v8::Object> instance = V8ObjectConstructor::newInstance(function);
if (instance.IsEmpty()) {
// Avoid setting the wrapper if allocation failed.
return v8::Local<v8::Object>();
diff --git a/Source/WebCore/bindings/v8/custom/V8StorageCustom.cpp b/Source/WebCore/bindings/v8/custom/V8StorageCustom.cpp
index b79cdbdb8..5c4dc02d4 100644
--- a/Source/WebCore/bindings/v8/custom/V8StorageCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8StorageCustom.cpp
@@ -108,7 +108,7 @@ static v8::Handle<v8::Value> storageSetter(v8::Local<v8::String> v8Name, v8::Loc
ExceptionCode ec = 0;
storage->setItem(name, value, ec);
if (ec)
- return V8Proxy::setDOMException(ec, info.GetIsolate());
+ return setDOMException(ec, info.GetIsolate());
return v8Value;
}
diff --git a/Source/WebCore/bindings/v8/custom/V8UndoManagerCustom.cpp b/Source/WebCore/bindings/v8/custom/V8UndoManagerCustom.cpp
new file mode 100644
index 000000000..c7088bb02
--- /dev/null
+++ b/Source/WebCore/bindings/v8/custom/V8UndoManagerCustom.cpp
@@ -0,0 +1,65 @@
+/*
+ * 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 GOOGLE 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 GOOGLE 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"
+
+#if ENABLE(UNDO_MANAGER)
+
+#include "V8UndoManager.h"
+
+#include "DOMTransaction.h"
+#include "ExceptionCode.h"
+#include "V8DOMTransaction.h"
+#include "V8HiddenPropertyName.h"
+
+namespace WebCore {
+
+v8::Handle<v8::Value> V8UndoManager::transactCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.UndoManager.transact");
+ if (args.Length() < 1)
+ return throwNotEnoughArgumentsError(args.GetIsolate());
+ UndoManager* imp = V8UndoManager::toNative(args.Holder());
+
+ EXCEPTION_BLOCK(v8::Local<v8::Value>, dictionary, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
+ if (dictionary.IsEmpty() || !dictionary->IsObject())
+ return throwTypeError("The first argument is not of type DOMTransaction.", args.GetIsolate());
+
+ EXCEPTION_BLOCK(bool, merge, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)->BooleanValue());
+
+ RefPtr<DOMTransaction> transaction = DOMTransaction::create(WorldContextHandle(UseCurrentWorld));
+ v8::Handle<v8::Object> transactionWrapper = v8::Handle<v8::Object>::Cast(toV8(transaction.get()));
+
+ transactionWrapper->SetHiddenValue(V8HiddenPropertyName::domTransactionData(), dictionary);
+
+ ExceptionCode ec = 0;
+ imp->transact(transaction, merge, ec);
+ if (ec)
+ return setDOMException(ec, args.GetIsolate());
+ return v8Undefined();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(UNDO_MANAGER)
diff --git a/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp b/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
index 35a62db3c..3904ba16a 100644
--- a/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
@@ -221,7 +221,7 @@ enum ObjectType {
static v8::Handle<v8::Value> getObjectParameter(const v8::Arguments& args, ObjectType objectType)
{
if (args.Length() != 2)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
ExceptionCode ec = 0;
WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
@@ -247,7 +247,7 @@ static v8::Handle<v8::Value> getObjectParameter(const v8::Arguments& args, Objec
break;
}
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return toV8Object(info, args.GetIsolate());
}
@@ -271,17 +271,17 @@ v8::Handle<v8::Value> V8WebGLRenderingContext::getAttachedShadersCallback(const
INC_STATS("DOM.WebGLRenderingContext.getAttachedShaders()");
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
ExceptionCode ec = 0;
WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0]))
- return V8Proxy::throwTypeError(0, args.GetIsolate());
+ return throwTypeError(0, args.GetIsolate());
WebGLProgram* program = V8WebGLProgram::HasInstance(args[0]) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
Vector<RefPtr<WebGLShader> > shaders;
bool succeed = context->getAttachedShaders(program, shaders, ec);
if (ec) {
- V8Proxy::setDOMException(ec, args.GetIsolate());
+ setDOMException(ec, args.GetIsolate());
return v8::Null(args.GetIsolate());
}
if (!succeed)
@@ -303,7 +303,7 @@ v8::Handle<v8::Value> V8WebGLRenderingContext::getExtensionCallback(const v8::Ar
INC_STATS("DOM.WebGLRenderingContext.getExtensionCallback()");
WebGLRenderingContext* imp = V8WebGLRenderingContext::toNative(args.Holder());
if (args.Length() < 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, name, args[0]);
WebGLExtension* extension = imp->getExtension(name);
return toV8Object(extension, args.Holder(), args.GetIsolate());
@@ -314,7 +314,7 @@ v8::Handle<v8::Value> V8WebGLRenderingContext::getFramebufferAttachmentParameter
INC_STATS("DOM.WebGLRenderingContext.getFramebufferAttachmentParameter()");
if (args.Length() != 3)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
ExceptionCode ec = 0;
WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
@@ -323,7 +323,7 @@ v8::Handle<v8::Value> V8WebGLRenderingContext::getFramebufferAttachmentParameter
unsigned pname = toInt32(args[2]);
WebGLGetInfo info = context->getFramebufferAttachmentParameter(target, attachment, pname, ec);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return toV8Object(info, args.GetIsolate());
}
@@ -332,14 +332,14 @@ v8::Handle<v8::Value> V8WebGLRenderingContext::getParameterCallback(const v8::Ar
INC_STATS("DOM.WebGLRenderingContext.getParameter()");
if (args.Length() != 1)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
ExceptionCode ec = 0;
WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
unsigned pname = toInt32(args[0]);
WebGLGetInfo info = context->getParameter(pname, ec);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return toV8Object(info, args.GetIsolate());
}
@@ -348,17 +348,17 @@ v8::Handle<v8::Value> V8WebGLRenderingContext::getProgramParameterCallback(const
INC_STATS("DOM.WebGLRenderingContext.getProgramParameter()");
if (args.Length() != 2)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
ExceptionCode ec = 0;
WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0]))
- return V8Proxy::throwTypeError(0, args.GetIsolate());
+ return throwTypeError(0, args.GetIsolate());
WebGLProgram* program = V8WebGLProgram::HasInstance(args[0]) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
unsigned pname = toInt32(args[1]);
WebGLGetInfo info = context->getProgramParameter(program, pname, ec);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return toV8Object(info, args.GetIsolate());
}
@@ -373,17 +373,17 @@ v8::Handle<v8::Value> V8WebGLRenderingContext::getShaderParameterCallback(const
INC_STATS("DOM.WebGLRenderingContext.getShaderParameter()");
if (args.Length() != 2)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
ExceptionCode ec = 0;
WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLShader::HasInstance(args[0]))
- return V8Proxy::throwTypeError(0, args.GetIsolate());
+ return throwTypeError(0, args.GetIsolate());
WebGLShader* shader = V8WebGLShader::HasInstance(args[0]) ? V8WebGLShader::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
unsigned pname = toInt32(args[1]);
WebGLGetInfo info = context->getShaderParameter(shader, pname, ec);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return toV8Object(info, args.GetIsolate());
}
@@ -412,22 +412,22 @@ v8::Handle<v8::Value> V8WebGLRenderingContext::getUniformCallback(const v8::Argu
INC_STATS("DOM.WebGLRenderingContext.getUniform()");
if (args.Length() != 2)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
ExceptionCode ec = 0;
WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0]))
- return V8Proxy::throwTypeError(0, args.GetIsolate());
+ return throwTypeError(0, args.GetIsolate());
WebGLProgram* program = V8WebGLProgram::HasInstance(args[0]) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
if (args.Length() > 1 && !isUndefinedOrNull(args[1]) && !V8WebGLUniformLocation::HasInstance(args[1]))
- return V8Proxy::throwTypeError(0, args.GetIsolate());
+ return throwTypeError(0, args.GetIsolate());
bool ok = false;
WebGLUniformLocation* location = toWebGLUniformLocation(args[1], ok);
WebGLGetInfo info = context->getUniform(program, location, ec);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return toV8Object(info, args.GetIsolate());
}
@@ -477,7 +477,7 @@ static v8::Handle<v8::Value> vertexAttribAndUniformHelperf(const v8::Arguments&
// * glVertexAttrib4fv(GLint index, Float32Array data);
if (args.Length() != 2)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
bool ok = false;
int index = -1;
@@ -487,7 +487,7 @@ static v8::Handle<v8::Value> vertexAttribAndUniformHelperf(const v8::Arguments&
index = toInt32(args[0]);
else {
if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0]))
- return V8Proxy::throwTypeError(0, args.GetIsolate());
+ return throwTypeError(0, args.GetIsolate());
location = toWebGLUniformLocation(args[0], ok);
}
@@ -509,19 +509,19 @@ static v8::Handle<v8::Value> vertexAttribAndUniformHelperf(const v8::Arguments&
default: ASSERT_NOT_REACHED(); break;
}
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return v8::Undefined();
}
if (args[1].IsEmpty() || !args[1]->IsArray())
- return V8Proxy::throwTypeError(0, args.GetIsolate());
+ return throwTypeError(0, args.GetIsolate());
v8::Handle<v8::Array> array =
v8::Local<v8::Array>::Cast(args[1]);
uint32_t len = array->Length();
float* data = jsArrayToFloatArray(array, len);
if (!data) {
// FIXME: consider different / better exception type.
- return V8Proxy::setDOMException(SYNTAX_ERR, args.GetIsolate());
+ return setDOMException(SYNTAX_ERR, args.GetIsolate());
}
ExceptionCode ec = 0;
switch (functionToCall) {
@@ -537,7 +537,7 @@ static v8::Handle<v8::Value> vertexAttribAndUniformHelperf(const v8::Arguments&
}
fastFree(data);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return v8::Undefined();
}
@@ -554,11 +554,11 @@ static v8::Handle<v8::Value> uniformHelperi(const v8::Arguments& args,
// * glUniform4iv(GLUniformLocation location, Int32Array data);
if (args.Length() != 2)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0]))
- return V8Proxy::throwTypeError(0, args.GetIsolate());
+ return throwTypeError(0, args.GetIsolate());
bool ok = false;
WebGLUniformLocation* location = toWebGLUniformLocation(args[0], ok);
@@ -574,19 +574,19 @@ static v8::Handle<v8::Value> uniformHelperi(const v8::Arguments& args,
default: ASSERT_NOT_REACHED(); break;
}
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return v8::Undefined();
}
if (args[1].IsEmpty() || !args[1]->IsArray())
- return V8Proxy::throwTypeError(0, args.GetIsolate());
+ return throwTypeError(0, args.GetIsolate());
v8::Handle<v8::Array> array =
v8::Local<v8::Array>::Cast(args[1]);
uint32_t len = array->Length();
int* data = jsArrayToIntArray(array, len);
if (!data) {
// FIXME: consider different / better exception type.
- return V8Proxy::setDOMException(SYNTAX_ERR, args.GetIsolate());
+ return setDOMException(SYNTAX_ERR, args.GetIsolate());
}
ExceptionCode ec = 0;
switch (functionToCall) {
@@ -598,7 +598,7 @@ static v8::Handle<v8::Value> uniformHelperi(const v8::Arguments& args,
}
fastFree(data);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return v8::Undefined();
}
@@ -663,12 +663,12 @@ static v8::Handle<v8::Value> uniformMatrixHelper(const v8::Arguments& args,
//
// FIXME: need to change to accept Float32Array as well.
if (args.Length() != 3)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0]))
- return V8Proxy::throwTypeError(0, args.GetIsolate());
+ return throwTypeError(0, args.GetIsolate());
bool ok = false;
WebGLUniformLocation* location = toWebGLUniformLocation(args[0], ok);
@@ -684,19 +684,19 @@ static v8::Handle<v8::Value> uniformMatrixHelper(const v8::Arguments& args,
default: ASSERT_NOT_REACHED(); break;
}
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return v8::Undefined();
}
if (args[2].IsEmpty() || !args[2]->IsArray())
- return V8Proxy::throwTypeError(0, args.GetIsolate());
+ return throwTypeError(0, args.GetIsolate());
v8::Handle<v8::Array> array =
v8::Local<v8::Array>::Cast(args[2]);
uint32_t len = array->Length();
float* data = jsArrayToFloatArray(array, len);
if (!data) {
// FIXME: consider different / better exception type.
- return V8Proxy::setDOMException(SYNTAX_ERR, args.GetIsolate());
+ return setDOMException(SYNTAX_ERR, args.GetIsolate());
}
ExceptionCode ec = 0;
switch (matrixSize) {
@@ -707,7 +707,7 @@ static v8::Handle<v8::Value> uniformMatrixHelper(const v8::Arguments& args,
}
fastFree(data);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return v8::Undefined();
}
diff --git a/Source/WebCore/bindings/v8/custom/V8WebKitPointConstructor.cpp b/Source/WebCore/bindings/v8/custom/V8WebKitPointConstructor.cpp
index c84452c7c..de4022a8b 100644
--- a/Source/WebCore/bindings/v8/custom/V8WebKitPointConstructor.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8WebKitPointConstructor.cpp
@@ -45,7 +45,7 @@ v8::Handle<v8::Value> V8WebKitPoint::constructorCallback(const v8::Arguments& ar
INC_STATS("DOM.WebKitPoint.Constructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
+ return throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
diff --git a/Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp b/Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
index 1f09a8860..3d44b5292 100644
--- a/Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
@@ -57,25 +57,25 @@ v8::Handle<v8::Value> V8WebSocket::constructorCallback(const v8::Arguments& args
INC_STATS("DOM.WebSocket.Constructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
+ return throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
if (args.Length() == 0)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
v8::TryCatch tryCatch;
v8::Handle<v8::String> urlstring = args[0]->ToString();
if (tryCatch.HasCaught())
return throwError(tryCatch.Exception(), args.GetIsolate());
if (urlstring.IsEmpty())
- return V8Proxy::throwError(V8Proxy::SyntaxError, "Empty URL", args.GetIsolate());
+ return throwError(SyntaxError, "Empty URL", args.GetIsolate());
// Get the script execution context.
ScriptExecutionContext* context = getScriptExecutionContext();
if (!context)
- return V8Proxy::throwError(V8Proxy::ReferenceError, "WebSocket constructor's associated frame is not available", args.GetIsolate());
+ return throwError(ReferenceError, "WebSocket constructor's associated frame is not available", args.GetIsolate());
const KURL& url = context->completeURL(toWebCoreString(urlstring));
@@ -106,7 +106,7 @@ v8::Handle<v8::Value> V8WebSocket::constructorCallback(const v8::Arguments& args
}
}
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
v8::Handle<v8::Object> wrapper = args.Holder();
V8DOMWrapper::setDOMWrapper(wrapper, &info, webSocket.get());
@@ -119,7 +119,7 @@ v8::Handle<v8::Value> V8WebSocket::sendCallback(const v8::Arguments& args)
INC_STATS("DOM.WebSocket.send()");
if (!args.Length())
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
WebSocket* webSocket = V8WebSocket::toNative(args.Holder());
v8::Handle<v8::Value> message = args[0];
@@ -145,7 +145,7 @@ v8::Handle<v8::Value> V8WebSocket::sendCallback(const v8::Arguments& args)
result = webSocket->send(toWebCoreString(stringMessage), ec);
}
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return v8Boolean(result, args.GetIsolate());
}
diff --git a/Source/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp b/Source/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
index 1f7da07a4..57232578c 100644
--- a/Source/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
@@ -106,7 +106,7 @@ v8::Handle<v8::Value> V8WorkerContext::importScriptsCallback(const v8::Arguments
workerContext->importScripts(urls, ec);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return v8::Undefined();
}
diff --git a/Source/WebCore/bindings/v8/custom/V8WorkerCustom.cpp b/Source/WebCore/bindings/v8/custom/V8WorkerCustom.cpp
index 07ff2d042..945c29ec0 100644
--- a/Source/WebCore/bindings/v8/custom/V8WorkerCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8WorkerCustom.cpp
@@ -68,7 +68,7 @@ static v8::Handle<v8::Value> handlePostMessageCallback(const v8::Arguments& args
return v8::Undefined();
ExceptionCode ec = 0;
worker->postMessage(message.release(), &ports, ec);
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
}
v8::Handle<v8::Value> V8Worker::postMessageCallback(const v8::Arguments& args)
diff --git a/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp b/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp
index 9e87209b2..7bd673082 100644
--- a/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp
@@ -48,7 +48,7 @@ v8::Handle<v8::Value> V8XMLHttpRequest::constructorCallback(const v8::Arguments&
INC_STATS("DOM.XMLHttpRequest.Constructor");
if (!args.IsConstructCall())
- return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
+ return throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
return args.Holder();
@@ -57,7 +57,7 @@ v8::Handle<v8::Value> V8XMLHttpRequest::constructorCallback(const v8::Arguments&
// Allocate a XMLHttpRequest object as its internal field.
ScriptExecutionContext* context = getScriptExecutionContext();
if (!context)
- return V8Proxy::throwError(V8Proxy::ReferenceError, "XMLHttpRequest constructor's associated context is not available", args.GetIsolate());
+ return throwError(ReferenceError, "XMLHttpRequest constructor's associated context is not available", args.GetIsolate());
RefPtr<SecurityOrigin> securityOrigin;
if (V8IsolatedContext* isolatedContext = V8IsolatedContext::getEntered())
diff --git a/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp b/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
index 4bb57004c..f89e3c97d 100644
--- a/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
@@ -57,7 +57,7 @@ v8::Handle<v8::Value> V8XMLHttpRequest::responseTextAccessorGetter(v8::Local<v8:
ExceptionCode ec = 0;
const String& text = xmlHttpRequest->responseText(ec);
if (ec)
- return V8Proxy::setDOMException(ec, info.GetIsolate());
+ return setDOMException(ec, info.GetIsolate());
return v8String(text, info.GetIsolate());
}
@@ -76,7 +76,7 @@ v8::Handle<v8::Value> V8XMLHttpRequest::responseAccessorGetter(v8::Local<v8::Str
ExceptionCode ec = 0;
Document* document = xmlHttpRequest->responseXML(ec);
if (ec)
- return V8Proxy::setDOMException(ec, info.GetIsolate());
+ return setDOMException(ec, info.GetIsolate());
return toV8(document, info.GetIsolate());
}
@@ -85,7 +85,7 @@ v8::Handle<v8::Value> V8XMLHttpRequest::responseAccessorGetter(v8::Local<v8::Str
ExceptionCode ec = 0;
Blob* blob = xmlHttpRequest->responseBlob(ec);
if (ec)
- return V8Proxy::setDOMException(ec, info.GetIsolate());
+ return setDOMException(ec, info.GetIsolate());
return toV8(blob, info.GetIsolate());
}
@@ -94,7 +94,7 @@ v8::Handle<v8::Value> V8XMLHttpRequest::responseAccessorGetter(v8::Local<v8::Str
ExceptionCode ec = 0;
ArrayBuffer* arrayBuffer = xmlHttpRequest->responseArrayBuffer(ec);
if (ec)
- return V8Proxy::setDOMException(ec, info.GetIsolate());
+ return setDOMException(ec, info.GetIsolate());
return toV8(arrayBuffer, info.GetIsolate());
}
}
@@ -112,7 +112,7 @@ v8::Handle<v8::Value> V8XMLHttpRequest::openCallback(const v8::Arguments& args)
// open(method, url, async, user, passwd)
if (args.Length() < 2)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+ return throwNotEnoughArgumentsError(args.GetIsolate());
XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(args.Holder());
@@ -143,7 +143,7 @@ v8::Handle<v8::Value> V8XMLHttpRequest::openCallback(const v8::Arguments& args)
xmlHttpRequest->open(method, url, ec);
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return v8::Undefined();
}
@@ -200,7 +200,7 @@ v8::Handle<v8::Value> V8XMLHttpRequest::sendCallback(const v8::Arguments& args)
}
if (ec)
- return V8Proxy::setDOMException(ec, args.GetIsolate());
+ return setDOMException(ec, args.GetIsolate());
return v8::Undefined();
}
diff --git a/Source/WebCore/bridge/qt/qt_class.cpp b/Source/WebCore/bridge/qt/qt_class.cpp
index ee22a6861..e24676a29 100644
--- a/Source/WebCore/bridge/qt/qt_class.cpp
+++ b/Source/WebCore/bridge/qt/qt_class.cpp
@@ -20,6 +20,7 @@
#include "config.h"
#include "qt_class.h"
+#include "APICast.h"
#include "Identifier.h"
#include "qt_instance.h"
#include "qt_runtime.h"
@@ -69,44 +70,55 @@ const char* QtClass::name() const
JSValue QtClass::fallbackObject(ExecState* exec, Instance* inst, PropertyName identifier)
{
QtInstance* qtinst = static_cast<QtInstance*>(inst);
+ JSContextRef context = toRef(exec);
+ JSValueRef exception = 0;
UString ustring(identifier.publicName());
const QByteArray name = QString(reinterpret_cast<const QChar*>(ustring.characters()), ustring.length()).toLatin1();
// First see if we have a cache hit
- JSObject* val = qtinst->m_methods.value(name).get();
- if (val)
- return val;
+ if (QtRuntimeMethod* method = qtinst->m_methods.value(name)) {
+ JSValue obj = toJS(method->jsObjectRef(context, &exception));
+ if (exception)
+ return throwError(exec, toJS(exec, exception));
+ return obj;
+ }
// Nope, create an entry
const QByteArray normal = QMetaObject::normalizedSignature(name.constData());
// See if there is an exact match
int index = -1;
+ QMetaMethod metaMethod;
if (normal.contains('(') && (index = m_metaObject->indexOfMethod(normal)) != -1) {
- QMetaMethod m = m_metaObject->method(index);
- if (m.access() != QMetaMethod::Private) {
- QtRuntimeMetaMethod* val = QtRuntimeMetaMethod::create(exec, ustring, static_cast<QtInstance*>(inst), index, normal, false);
- qtinst->m_methods.insert(name, val);
- return val;
- }
+ metaMethod = m_metaObject->method(index);
+ if (metaMethod.access() == QMetaMethod::Private)
+ index = -1;
}
// Nope.. try a basename match
- const int count = m_metaObject->methodCount();
- for (index = count - 1; index >= 0; --index) {
- const QMetaMethod m = m_metaObject->method(index);
- if (m.access() == QMetaMethod::Private)
- continue;
-
- if (normal == m.name()) {
- QtRuntimeMetaMethod* val = QtRuntimeMetaMethod::create(exec, ustring, static_cast<QtInstance*>(inst), index, normal, false);
- qtinst->m_methods.insert(name, val);
- return val;
+ if (index == -1) {
+ const int count = m_metaObject->methodCount();
+ for (index = count - 1; index >= 0; --index) {
+ metaMethod = m_metaObject->method(index);
+ if (metaMethod.access() == QMetaMethod::Private)
+ continue;
+
+ if (metaMethod.name() == normal)
+ break;
}
}
- return jsUndefined();
+ if (index == -1)
+ return jsUndefined();
+
+ int flags = metaMethod.methodType() == QMetaMethod::Signal ? QtRuntimeMethod::MethodIsSignal : 0;
+ QtRuntimeMethod* method = new QtRuntimeMethod(context, static_cast<QtInstance*>(inst)->getObject(), normal, index, flags, qtinst);
+ qtinst->m_methods.insert(name, method);
+ JSValue obj = toJS(method->jsObjectRef(context, &exception));
+ if (exception)
+ return throwError(exec, toJS(exec, exception));
+ return obj;
}
// This functionality is handled by the fallback case above...
diff --git a/Source/WebCore/bridge/qt/qt_instance.cpp b/Source/WebCore/bridge/qt/qt_instance.cpp
index 7852512d3..d36cf1cdb 100644
--- a/Source/WebCore/bridge/qt/qt_instance.cpp
+++ b/Source/WebCore/bridge/qt/qt_instance.cpp
@@ -40,6 +40,63 @@
namespace JSC {
namespace Bindings {
+static void unusedWeakObjectMapCallback(JSWeakObjectMapRef, void*)
+{
+}
+
+WeakMapImpl::WeakMapImpl(JSContextGroupRef group)
+{
+ m_context = JSGlobalContextCreateInGroup(group, 0);
+ // Deleted by GC when m_context's globalObject gets collected.
+ m_map = JSWeakObjectMapCreate(m_context, 0, unusedWeakObjectMapCallback);
+}
+
+WeakMapImpl::~WeakMapImpl()
+{
+ JSGlobalContextRelease(m_context);
+ m_context = 0;
+ m_map = 0;
+}
+
+typedef HashMap<JSContextGroupRef, RefPtr<WeakMapImpl> > WeakMapSet;
+static WeakMapSet weakMaps;
+
+WeakMap::~WeakMap()
+{
+ // If this is the last WeakMap instance left, then we should remove
+ // the cached WeakMapImpl from the global weakMaps, too.
+ if (m_impl && m_impl->refCount() == 2) {
+ weakMaps.remove(JSContextGetGroup(m_impl->m_context));
+ ASSERT(m_impl->hasOneRef());
+ }
+}
+
+void WeakMap::set(JSContextRef context, void *key, JSObjectRef object)
+{
+ if (!m_impl) {
+ JSContextGroupRef group = JSContextGetGroup(context);
+ WeakMapSet::AddResult entry = weakMaps.add(group, 0);
+ if (entry.isNewEntry)
+ entry.iterator->second = adoptRef(new WeakMapImpl(group));
+ m_impl = entry.iterator->second;
+ }
+ JSWeakObjectMapSet(m_impl->m_context, m_impl->m_map, key, object);
+}
+
+JSObjectRef WeakMap::get(void* key)
+{
+ if (!m_impl)
+ return 0;
+ return JSWeakObjectMapGet(m_impl->m_context, m_impl->m_map, key);
+}
+
+void WeakMap::remove(void *key)
+{
+ if (!m_impl)
+ return;
+ JSWeakObjectMapRemove(m_impl->m_context, m_impl->m_map, key);
+}
+
// Cache QtInstances
typedef QMultiHash<void*, QtInstance*> QObjectInstanceMap;
static QObjectInstanceMap cachedInstances;
@@ -94,7 +151,7 @@ QtInstance::~QtInstance()
cachedInstances.remove(m_hashkey);
- // clean up (unprotect from gc) the JSValues we've created
+ qDeleteAll(m_methods);
m_methods.clear();
qDeleteAll(m_fields);
@@ -147,16 +204,6 @@ void QtInstance::put(JSObject* object, ExecState* exec, PropertyName propertyNam
JSObject::put(object, exec, propertyName, value, slot);
}
-void QtInstance::removeUnusedMethods()
-{
- for (QHash<QByteArray, QtWeakObjectReference>::Iterator it = m_methods.begin(), end = m_methods.end(); it != end; ) {
- if (!it.value().get())
- it = m_methods.erase(it);
- else
- ++it;
- }
-}
-
QtInstance* QtInstance::getInstance(JSObject* object)
{
if (!object)
@@ -179,6 +226,7 @@ Class* QtInstance::getClass() const
RuntimeObject* QtInstance::newRuntimeObject(ExecState* exec)
{
JSLockHolder lock(exec);
+ qDeleteAll(m_methods);
m_methods.clear();
return QtRuntimeObject::create(exec, exec->lexicalGlobalObject(), this);
}
diff --git a/Source/WebCore/bridge/qt/qt_instance.h b/Source/WebCore/bridge/qt/qt_instance.h
index cc42aedc6..e5d2a93aa 100644
--- a/Source/WebCore/bridge/qt/qt_instance.h
+++ b/Source/WebCore/bridge/qt/qt_instance.h
@@ -21,6 +21,7 @@
#define qt_instance_h
#include "BridgeJSC.h"
+#include "JSWeakObjectMapRefPrivate.h"
#include <QPointer>
#include "Weak.h"
#include "runtime_root.h"
@@ -33,7 +34,28 @@ namespace Bindings {
class QtClass;
class QtField;
-class QtRuntimeMetaMethod;
+class QtRuntimeMethod;
+
+class WeakMapImpl : public RefCounted<WeakMapImpl> {
+public:
+ WeakMapImpl(JSContextGroupRef);
+ ~WeakMapImpl();
+
+ JSGlobalContextRef m_context;
+ JSWeakObjectMapRef m_map;
+};
+
+class WeakMap {
+public:
+ ~WeakMap();
+
+ void set(JSContextRef, void* key, JSObjectRef);
+ JSObjectRef get(void* key);
+ void remove(void* key);
+
+private:
+ RefPtr<WeakMapImpl> m_impl;
+};
class QtInstance : public Instance {
public:
@@ -71,44 +93,9 @@ public:
virtual bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
virtual void put(JSObject*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
- void removeUnusedMethods();
-
static QtInstance* getInstance(JSObject*);
private:
-
- class QtWeakObjectReference {
- public:
- QtWeakObjectReference(JSObject* reference)
- : m_reference(reference)
- {
- }
-
- QtWeakObjectReference(const QtWeakObjectReference& source)
- : m_reference(source.m_reference.get())
- {
- }
-
- QtWeakObjectReference()
- : m_reference()
- {
- }
-
- QtWeakObjectReference& operator=(const QtWeakObjectReference& source)
- {
- m_reference = PassWeak<JSObject>(source.m_reference.get());
- return *this;
- }
-
- JSObject* get() const
- {
- return m_reference.get();
- }
-
- private:
- Weak<JSObject> m_reference;
- };
-
static PassRefPtr<QtInstance> create(QObject *instance, PassRefPtr<RootObject> rootObject, ValueOwnership ownership)
{
return adoptRef(new QtInstance(instance, rootObject, ownership));
@@ -116,11 +103,13 @@ private:
friend class QtClass;
friend class QtField;
+ friend class QtRuntimeMethod;
QtInstance(QObject*, PassRefPtr<RootObject>, ValueOwnership); // Factory produced only..
mutable QtClass* m_class;
QPointer<QObject> m_object;
QObject* m_hashkey;
- mutable QHash<QByteArray, QtWeakObjectReference> m_methods;
+ mutable QHash<QByteArray, QtRuntimeMethod*> m_methods;
+ WeakMap m_cachedMethods;
mutable QHash<QString, QtField*> m_fields;
ValueOwnership m_ownership;
};
diff --git a/Source/WebCore/bridge/qt/qt_runtime.cpp b/Source/WebCore/bridge/qt/qt_runtime.cpp
index 0f47643d8..4592dfb6e 100644
--- a/Source/WebCore/bridge/qt/qt_runtime.cpp
+++ b/Source/WebCore/bridge/qt/qt_runtime.cpp
@@ -783,7 +783,7 @@ JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, con
qConvDebug() << "convertQVariantToValue: metatype:" << type << ", isnull: " << variant.isNull();
if (variant.isNull() &&
- type != QMetaType::QObjectStar &&
+ !QMetaType::typeFlags(type).testFlag(QMetaType::PointerToQObject) &&
type != QMetaType::VoidStar &&
type != QMetaType::QString) {
return jsNull();
@@ -844,7 +844,7 @@ JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, con
return toJS(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), wtfByteArray.get());
}
- if (type == QMetaType::QObjectStar || variant.canConvert<QObject*>()) {
+ if (QMetaType::typeFlags(type).testFlag(QMetaType::PointerToQObject)) {
QObject* obj = variant.value<QObject*>();
if (!obj)
return jsNull();
@@ -912,61 +912,6 @@ JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, con
return jsString(exec, ustring);
}
-// ===============
-
-// Qt-like macros
-#define QW_D(Class) Class##Data* d = d_func()
-#define QW_DS(Class,Instance) Class##Data* d = Instance->d_func()
-
-const ClassInfo QtRuntimeMethod::s_info = { "QtRuntimeMethod", &InternalFunction::s_info, 0, 0, CREATE_METHOD_TABLE(QtRuntimeMethod) };
-
-QtRuntimeMethod::QtRuntimeMethod(QtRuntimeMethodData* dd, ExecState* exec, Structure* structure, const UString& identifier)
- : InternalFunction(exec->lexicalGlobalObject(), structure)
- , d_ptr(dd)
-{
-}
-
-void QtRuntimeMethod::finishCreation(ExecState* exec, const UString& identifier, PassRefPtr<QtInstance> instance)
-{
- Base::finishCreation(exec->globalData(), identifier);
- QW_D(QtRuntimeMethod);
- d->m_instance = instance;
- d->m_finalizer = PassWeak<QtRuntimeMethod>(this, d);
-}
-
-QtRuntimeMethod::~QtRuntimeMethod()
-{
- delete d_ptr;
-}
-
-void QtRuntimeMethod::destroy(JSCell* cell)
-{
- static_cast<QtRuntimeMethod*>(cell)->QtRuntimeMethod::~QtRuntimeMethod();
-}
-
-// ===============
-
-QtRuntimeMethodData::~QtRuntimeMethodData()
-{
-}
-
-void QtRuntimeMethodData::finalize(Handle<Unknown>, void*)
-{
- m_instance->removeUnusedMethods();
-}
-
-QtRuntimeMetaMethodData::~QtRuntimeMetaMethodData()
-{
-
-}
-
-QtRuntimeConnectionMethodData::~QtRuntimeConnectionMethodData()
-{
-
-}
-
-// ===============
-
// Type conversion metadata (from QtScript originally)
class QtMethodMatchType
{
@@ -1334,369 +1279,255 @@ static int findSignalIndex(const QMetaObject* meta, int initialIndex, QByteArray
return index;
}
-const ClassInfo QtRuntimeMetaMethod::s_info = { "QtRuntimeMethod", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(QtRuntimeMetaMethod) };
-
-QtRuntimeMetaMethod::QtRuntimeMetaMethod(ExecState* exec, Structure* structure, const UString& identifier)
- : QtRuntimeMethod (new QtRuntimeMetaMethodData(), exec, structure, identifier)
+static JSClassRef prototypeForSignalsAndSlots()
{
+ static JSClassDefinition classDef = {
+ 0, kJSClassAttributeNoAutomaticPrototype, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ static JSClassRef cls = JSClassCreate(&classDef);
+ return cls;
}
-void QtRuntimeMetaMethod::finishCreation(ExecState* exec, const UString& identifier, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature, bool allowPrivate)
+QtRuntimeMethod::QtRuntimeMethod(JSContextRef ctx, QObject* object, const QByteArray& identifier, int index, int flags, QtInstance* instance)
+ : m_object(object)
+ , m_identifier(identifier)
+ , m_index(index)
+ , m_flags(flags)
+ , m_instance(instance)
{
- Base::finishCreation(exec, identifier, instance);
- QW_D(QtRuntimeMetaMethod);
- d->m_signature = signature;
- d->m_index = index;
- d->m_allowPrivate = allowPrivate;
}
-void QtRuntimeMetaMethod::visitChildren(JSCell* cell, SlotVisitor& visitor)
+QtRuntimeMethod::~QtRuntimeMethod()
{
- QtRuntimeMetaMethod* thisObject = jsCast<QtRuntimeMetaMethod*>(cell);
- QtRuntimeMethod::visitChildren(thisObject, visitor);
- QtRuntimeMetaMethodData* d = thisObject->d_func();
- if (d->m_connect)
- visitor.append(&d->m_connect);
- if (d->m_disconnect)
- visitor.append(&d->m_disconnect);
+ if (JSObjectRef cachedWrapper = m_instance->m_cachedMethods.get(this))
+ JSObjectSetPrivate(cachedWrapper, 0);
+ m_instance->m_cachedMethods.remove(this);
}
-EncodedJSValue QtRuntimeMetaMethod::call(ExecState* exec)
+JSValueRef QtRuntimeMethod::call(JSContextRef context, JSObjectRef function, JSObjectRef /*thisObject*/, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- QtRuntimeMetaMethodData* d = static_cast<QtRuntimeMetaMethod *>(exec->callee())->d_func();
-
- // We're limited to 10 args
- if (exec->argumentCount() > 10)
- return JSValue::encode(jsUndefined());
+ QtRuntimeMethod* d = toRuntimeMethod(context, function);
+ if (!d) {
+ setException(context, exception, QStringLiteral("cannot call function of deleted runtime method"));
+ return JSValueMakeUndefined(context);
+ }
+ QObject* obj = d->m_object;
- // We have to pick a method that matches..
- JSLockHolder lock(exec);
+ if (!obj) {
+ setException(context, exception, QStringLiteral("cannot call function of deleted QObject"));
+ return JSValueMakeUndefined(context);
+ }
- QObject *obj = d->m_instance->getObject();
- if (obj) {
- const int argumentCount = static_cast<int>(exec->argumentCount());
- Vector<JSValueRef, 10> args(argumentCount);
- for (int i = 0; i < argumentCount; ++i)
- args[i] = toRef(exec, exec->argument(i));
+ // Allow for maximum of 10 arguments and size stack arrays accordingly.
+ if (argumentCount > 10)
+ return JSValueMakeUndefined(context);
- QVarLengthArray<QVariant, 10> vargs;
- void *qargs[11];
+ QVarLengthArray<QVariant, 10> vargs;
+ void* qargs[11];
- int methodIndex;
- JSValueRef exception = 0;
- if ((methodIndex = findMethodIndex(toRef(exec), obj->metaObject(), d->m_signature, argumentCount, args.data(), d->m_allowPrivate, vargs, (void **)qargs, &exception)) != -1) {
- if (QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, methodIndex, qargs) >= 0)
- return JSValue::encode(jsUndefined());
+ int methodIndex = findMethodIndex(context, obj->metaObject(), d->m_identifier, argumentCount, arguments,
+ (d->m_flags & AllowPrivate), vargs, (void **)qargs, exception);
- if (vargs.size() > 0 && vargs[0].isValid())
- return JSValue::encode(convertQVariantToValue(exec, d->m_instance->rootObject(), vargs[0]));
- }
+ if (QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, methodIndex, qargs) >= 0)
+ return JSValueMakeUndefined(context);
- if (exception)
- return throwVMError(exec, toJS(exec, exception));
- } else {
- return throwVMError(exec, createError(exec, "cannot call function of deleted QObject"));
- }
+ if (vargs.size() > 0 && vargs[0].isValid())
+ return toRef(toJS(context), convertQVariantToValue(toJS(context), d->m_instance->rootObject(), vargs[0]));
- // void functions return undefined
- return JSValue::encode(jsUndefined());
+ return JSValueMakeUndefined(context);
}
-CallType QtRuntimeMetaMethod::getCallData(JSCell*, CallData& callData)
+JSValueRef QtRuntimeMethod::connect(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- callData.native.function = call;
- return CallTypeHost;
+ return connectOrDisconnect(context, function, thisObject, argumentCount, arguments, exception, true);
}
-bool QtRuntimeMetaMethod::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
+JSValueRef QtRuntimeMethod::disconnect(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- QtRuntimeMetaMethod* thisObject = jsCast<QtRuntimeMetaMethod*>(cell);
- if (propertyName == Identifier(exec, "connect")) {
- slot.setCustom(thisObject, thisObject->connectGetter);
- return true;
- }
- if (propertyName == Identifier(exec, "disconnect")) {
- slot.setCustom(thisObject, thisObject->disconnectGetter);
- return true;
- }
- if (propertyName == exec->propertyNames().length) {
- slot.setCustom(thisObject, thisObject->lengthGetter);
- return true;
- }
-
- return QtRuntimeMethod::getOwnPropertySlot(thisObject, exec, propertyName, slot);
+ return connectOrDisconnect(context, function, thisObject, argumentCount, arguments, exception, false);
}
-bool QtRuntimeMetaMethod::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
+JSObjectRef QtRuntimeMethod::jsObjectRef(JSContextRef context, JSValueRef* exception)
{
- QtRuntimeMetaMethod* thisObject = jsCast<QtRuntimeMetaMethod*>(object);
- if (propertyName == Identifier(exec, "connect")) {
- PropertySlot slot;
- slot.setCustom(thisObject, connectGetter);
- descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly | DontEnum);
- return true;
- }
+ if (JSObjectRef cachedWrapper = m_instance->m_cachedMethods.get(this))
+ return cachedWrapper;
- if (propertyName == Identifier(exec, "disconnect")) {
- PropertySlot slot;
- slot.setCustom(thisObject, disconnectGetter);
- descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly | DontEnum);
- return true;
- }
+ static JSStringRef connectStr = JSStringCreateWithUTF8CString("connect");
+ static JSStringRef disconnectStr = JSStringCreateWithUTF8CString("disconnect");
+ JSRetainPtr<JSStringRef> actualNameStr(Adopt, JSStringCreateWithUTF8CString(m_identifier.constData()));
- if (propertyName == exec->propertyNames().length) {
- PropertySlot slot;
- slot.setCustom(thisObject, lengthGetter);
- descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly | DontEnum);
- return true;
- }
+ JSObjectRef object = JSObjectMakeFunctionWithCallback(context, actualNameStr.get(), call);
- return QtRuntimeMethod::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
-}
+ JSObjectRef generalFunctionProto = JSValueToObject(context, JSObjectGetPrototype(context, object), 0);
+ JSObjectRef runtimeMethodProto = JSObjectMake(context, prototypeForSignalsAndSlots(), this);
+ JSObjectSetPrototype(context, runtimeMethodProto, generalFunctionProto);
-void QtRuntimeMetaMethod::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
-{
- if (mode == IncludeDontEnumProperties) {
- propertyNames.add(Identifier(exec, "connect"));
- propertyNames.add(Identifier(exec, "disconnect"));
- propertyNames.add(exec->propertyNames().length);
- }
+ JSObjectSetPrototype(context, object, runtimeMethodProto);
- QtRuntimeMethod::getOwnPropertyNames(object, exec, propertyNames, mode);
-}
+ JSObjectRef connectFunction = JSObjectMakeFunctionWithCallback(context, connectStr, connect);
+ JSObjectSetPrototype(context, connectFunction, runtimeMethodProto);
-JSValue QtRuntimeMetaMethod::lengthGetter(ExecState*, JSValue, PropertyName)
-{
- // QtScript always returns 0
- return jsNumber(0);
-}
+ JSObjectRef disconnectFunction = JSObjectMakeFunctionWithCallback(context, disconnectStr, disconnect);
+ JSObjectSetPrototype(context, disconnectFunction, runtimeMethodProto);
-JSValue QtRuntimeMetaMethod::connectGetter(ExecState* exec, JSValue slotBase, PropertyName ident)
-{
- QtRuntimeMetaMethod* thisObj = static_cast<QtRuntimeMetaMethod*>(asObject(slotBase));
- QW_DS(QtRuntimeMetaMethod, thisObj);
-
- if (!d->m_connect)
- d->m_connect.set(exec->globalData(), thisObj, QtRuntimeConnectionMethod::create(exec, ident.publicName(), true, d->m_instance, d->m_index, d->m_signature));
- return d->m_connect.get();
-}
+ const JSPropertyAttributes attributes = kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete;
+ JSObjectSetProperty(context, object, connectStr, connectFunction, attributes, exception);
+ JSObjectSetProperty(context, object, disconnectStr, disconnectFunction, attributes, exception);
-JSValue QtRuntimeMetaMethod::disconnectGetter(ExecState* exec, JSValue slotBase, PropertyName ident)
-{
- QtRuntimeMetaMethod* thisObj = static_cast<QtRuntimeMetaMethod*>(asObject(slotBase));
- QW_DS(QtRuntimeMetaMethod, thisObj);
+ m_instance->m_cachedMethods.set(context, this, object);
- if (!d->m_disconnect)
- d->m_disconnect.set(exec->globalData(), thisObj, QtRuntimeConnectionMethod::create(exec, ident.publicName(), false, d->m_instance, d->m_index, d->m_signature));
- return d->m_disconnect.get();
+ return object;
}
-// ===============
-
-QMultiMap<QObject*, QtConnectionObject*> QtRuntimeConnectionMethod::connections;
-
-const ClassInfo QtRuntimeConnectionMethod::s_info = { "QtRuntimeMethod", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(QtRuntimeConnectionMethod) };
-
-QtRuntimeConnectionMethod::QtRuntimeConnectionMethod(ExecState* exec, Structure* structure, const UString& identifier)
- : QtRuntimeMethod (new QtRuntimeConnectionMethodData(), exec, structure, identifier)
+QtRuntimeMethod* QtRuntimeMethod::toRuntimeMethod(JSContextRef context, JSObjectRef object)
{
+ JSObjectRef proto = JSValueToObject(context, JSObjectGetPrototype(context, object), 0);
+ if (!proto)
+ return 0;
+ if (!JSValueIsObjectOfClass(context, proto, prototypeForSignalsAndSlots()))
+ return 0;
+ return static_cast<QtRuntimeMethod*>(JSObjectGetPrivate(proto));
}
-void QtRuntimeConnectionMethod::finishCreation(ExecState* exec, const UString& identifier, bool isConnect, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature)
+JSValueRef QtRuntimeMethod::connectOrDisconnect(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception, bool connect)
{
- Base::finishCreation(exec, identifier, instance);
- QW_D(QtRuntimeConnectionMethod);
-
- d->m_signature = signature;
- d->m_index = index;
- d->m_isConnect = isConnect;
-}
+ QtRuntimeMethod* d = toRuntimeMethod(context, thisObject);
+ if (!d)
+ d = toRuntimeMethod(context, function);
+ if (!d) {
+ QString errorStr = QStringLiteral("QtMetaMethod.%1: Cannot connect to/from deleted QObject").arg(connect ? QStringLiteral("connect") : QStringLiteral("disconnect"));
+ setException(context, exception, errorStr);
+ return JSValueMakeUndefined(context);
+ }
-EncodedJSValue QtRuntimeConnectionMethod::call(ExecState* exec)
-{
- QtRuntimeConnectionMethodData* d = static_cast<QtRuntimeConnectionMethod *>(exec->callee())->d_func();
+ QString functionName = connect ? QStringLiteral("connect") : QStringLiteral("disconnect");
- JSLockHolder lock(exec);
+ if (!argumentCount) {
+ QString errorStr = QStringLiteral("QtMetaMethod.%1: no arguments given").arg(connect ? QStringLiteral("connect") : QStringLiteral("disconnect"));
+ setException(context, exception, errorStr);
+ return JSValueMakeUndefined(context);
+ }
- QObject* sender = d->m_instance->getObject();
+ if ((!(d->m_flags & QtRuntimeMethod::MethodIsSignal))) {
+ setException(context, exception, QStringLiteral("QtMetaMethod.%3: %1::%2() is not a signal").arg(QString::fromUtf8(d->m_object.data()->metaObject()->className())).arg(QString::fromAscii(d->m_identifier)).arg(functionName));
+ return JSValueMakeUndefined(context);
+ }
- if (sender) {
+ QObject* sender = d->m_object.data();
- JSObject* thisObject = exec->lexicalGlobalObject()->methodTable()->toThisObject(exec->lexicalGlobalObject(), exec);
- JSObject* funcObject = 0;
+ if (!sender) {
+ setException(context, exception, QStringLiteral("cannot call function of deleted QObject"));
+ return JSValueMakeUndefined(context);
+ }
- // QtScript checks signalness first, arguments second
- int signalIndex = -1;
+ int signalIndex = findSignalIndex(sender->metaObject(), d->m_index, d->m_identifier);
- // Make sure the initial index is a signal
- QMetaMethod m = sender->metaObject()->method(d->m_index);
- if (m.methodType() == QMetaMethod::Signal)
- signalIndex = findSignalIndex(sender->metaObject(), d->m_index, d->m_signature);
+ JSObjectRef targetObject = 0;
+ JSObjectRef targetFunction = 0;
- if (signalIndex != -1) {
- if (exec->argumentCount() == 1) {
- funcObject = exec->argument(0).toObject(exec);
- CallData callData;
- if (funcObject->methodTable()->getCallData(funcObject, callData) == CallTypeNone) {
- if (d->m_isConnect)
- return throwVMError(exec, createTypeError(exec, "QtMetaMethod.connect: target is not a function"));
- else
- return throwVMError(exec, createTypeError(exec, "QtMetaMethod.disconnect: target is not a function"));
- }
- } else if (exec->argumentCount() >= 2) {
- if (exec->argument(0).isObject()) {
- thisObject = exec->argument(0).toObject(exec);
-
- // Get the actual function to call
- JSObject *asObj = exec->argument(1).toObject(exec);
- CallData callData;
- if (asObj->methodTable()->getCallData(asObj, callData) != CallTypeNone) {
- // Function version
- funcObject = asObj;
- } else {
- // Convert it to a string
- UString funcName = exec->argument(1).toString(exec)->value(exec);
- Identifier funcIdent(exec, funcName);
-
- // ### DropAllLocks
- // This is resolved at this point in QtScript
- JSValue val = thisObject->get(exec, funcIdent);
- JSObject* asFuncObj = val.toObject(exec);
-
- if (asFuncObj->methodTable()->getCallData(asFuncObj, callData) != CallTypeNone) {
- funcObject = asFuncObj;
- } else {
- if (d->m_isConnect)
- return throwVMError(exec, createTypeError(exec, "QtMetaMethod.connect: target is not a function"));
- else
- return throwVMError(exec, createTypeError(exec, "QtMetaMethod.disconnect: target is not a function"));
- }
- }
- } else {
- if (d->m_isConnect)
- return throwVMError(exec, createTypeError(exec, "QtMetaMethod.connect: thisObject is not an object"));
- else
- return throwVMError(exec, createTypeError(exec, "QtMetaMethod.disconnect: thisObject is not an object"));
+ if (argumentCount == 1) {
+ if (!JSValueIsObject(context, arguments[0])) {
+ setException(context, exception, QStringLiteral("QtMetaMethod.%1: target is not a function").arg(functionName));
+ return JSValueMakeUndefined(context);
+ }
+ targetFunction = JSValueToObject(context, arguments[0], exception);
+
+ // object.signal.connect(someFunction);
+ if (JSObjectIsFunction(context, targetFunction)) {
+ // object.signal.connect(otherObject.slot);
+ if (QtRuntimeMethod* targetMethod = toRuntimeMethod(context, targetFunction))
+ targetObject = toRef(QtInstance::getQtInstance(targetMethod->m_object.data(), d->m_instance->rootObject(), QtInstance::QtOwnership)->createRuntimeObject(toJS(context)));
+ } else
+ targetFunction = 0;
+ } else {
+ // object.signal.connect(object, someFunction);
+ targetObject = JSValueToObject(context, arguments[0], exception);
+ if (JSValueIsObject(context, arguments[1])) {
+ JSObjectRef obj = JSValueToObject(context, arguments[1], exception);
+ if (JSObjectIsFunction(context, obj))
+ targetFunction = obj;
+ }
+ if (!targetFunction) {
+ // Maybe the second argument is a string
+ JSValueRef conversionException = 0;
+ JSRetainPtr<JSStringRef> functionName(Adopt, JSValueToStringCopy(context, arguments[1], &conversionException));
+ if (functionName && !conversionException) {
+ JSValueRef functionProperty = JSObjectGetProperty(context, targetObject, functionName.get(), &conversionException);
+ if (!conversionException && functionProperty && JSValueIsObject(context, functionProperty)) {
+ targetFunction = JSValueToObject(context, functionProperty, 0);
+ if (!JSObjectIsFunction(context, targetFunction))
+ targetFunction = 0;
}
- } else {
- if (d->m_isConnect)
- return throwVMError(exec, createError(exec, "QtMetaMethod.connect: no arguments given"));
- else
- return throwVMError(exec, createError(exec, "QtMetaMethod.disconnect: no arguments given"));
}
+ }
+ }
- if (d->m_isConnect) {
- // to connect, we need:
- // target object [from ctor]
- // target signal index etc. [from ctor]
- // receiver function [from arguments]
- // receiver this object [from arguments]
-
- QtConnectionObject* conn = QtConnectionObject::createWithInternalJSC(exec, d->m_instance, signalIndex, thisObject, funcObject);
- bool ok = QMetaObject::connect(sender, signalIndex, conn, conn->metaObject()->methodOffset());
- if (!ok) {
- delete conn;
- QString msg = QString(QLatin1String("QtMetaMethod.connect: failed to connect to %1::%2()"))
- .arg(QLatin1String(sender->metaObject()->className()))
- .arg(QLatin1String(d->m_signature));
- return throwVMError(exec, createError(exec, msg.toLatin1().constData()));
- }
- else {
- // Store connection
- connections.insert(sender, conn);
- }
- } else {
- // Now to find our previous connection object. Hmm.
- QList<QtConnectionObject*> conns = connections.values(sender);
- bool ret = false;
-
- JSContextRef context = ::toRef(exec);
- JSObjectRef receiver = ::toRef(thisObject);
- JSObjectRef receiverFunction = ::toRef(funcObject);
-
- foreach(QtConnectionObject* conn, conns) {
- // Is this the right connection?
- if (conn->match(context, sender, signalIndex, receiver, receiverFunction)) {
- // Yep, disconnect it
- QMetaObject::disconnect(sender, signalIndex, conn, conn->metaObject()->methodOffset());
- delete conn; // this will also remove it from the map
- ret = true;
- break;
- }
- }
+ // object.signal.connect(someObject);
+ if (!targetFunction) {
+ QString message = QStringLiteral("QtMetaMethod.%1: target is not a function");
+ if (connect)
+ message = message.arg(QStringLiteral("connect"));
+ else
+ message = message.arg(QStringLiteral("disconnect"));
+ setException(context, exception, message);
+ return JSValueMakeUndefined(context);
+ }
- if (!ret) {
- QString msg = QString(QLatin1String("QtMetaMethod.disconnect: failed to disconnect from %1::%2()"))
- .arg(QLatin1String(sender->metaObject()->className()))
- .arg(QLatin1String(d->m_signature));
- return throwVMError(exec, createError(exec, msg.toLatin1().constData()));
- }
- }
- } else {
- QString msg = QString(QLatin1String("QtMetaMethod.%1: %2::%3() is not a signal"))
- .arg(QLatin1String(d->m_isConnect ? "connect": "disconnect"))
+ if (connect) {
+ // to connect, we need:
+ // target object [from ctor]
+ // target signal index etc. [from ctor]
+ // receiver function [from arguments]
+ // receiver this object [from arguments]
+
+ QtConnectionObject* conn = new QtConnectionObject(context, QtInstance::getQtInstance(sender, d->m_instance->rootObject(), QtInstance::QtOwnership), signalIndex, targetObject, targetFunction);
+ bool ok = QMetaObject::connect(sender, signalIndex, conn, conn->metaObject()->methodOffset());
+ if (!ok) {
+ delete conn;
+ QString msg = QString(QLatin1String("QtMetaMethod.connect: failed to connect to %1::%2()"))
.arg(QLatin1String(sender->metaObject()->className()))
- .arg(QLatin1String(d->m_signature));
- return throwVMError(exec, createTypeError(exec, msg.toLatin1().constData()));
+ .arg(QLatin1String(d->m_identifier));
+ setException(context, exception, msg);
+ return JSValueMakeUndefined(context);
}
- } else {
- return throwVMError(exec, createError(exec, "cannot call function of deleted QObject"));
- }
- return JSValue::encode(jsUndefined());
-}
+ // Store connection
+ QtConnectionObject::connections.insert(sender, conn);
-CallType QtRuntimeConnectionMethod::getCallData(JSCell*, CallData& callData)
-{
- callData.native.function = call;
- return CallTypeHost;
-}
-
-bool QtRuntimeConnectionMethod::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
-{
- QtRuntimeConnectionMethod* thisObject = jsCast<QtRuntimeConnectionMethod*>(cell);
- if (propertyName == exec->propertyNames().length) {
- slot.setCustom(thisObject, thisObject->lengthGetter);
- return true;
+ return JSValueMakeUndefined(context);
}
- return QtRuntimeMethod::getOwnPropertySlot(thisObject, exec, propertyName, slot);
-}
-
-bool QtRuntimeConnectionMethod::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
-{
- QtRuntimeConnectionMethod* thisObject = jsCast<QtRuntimeConnectionMethod*>(object);
- if (propertyName == exec->propertyNames().length) {
- PropertySlot slot;
- slot.setCustom(thisObject, lengthGetter);
- descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly | DontEnum);
- return true;
- }
+ // Now to find our previous connection object.
+ QList<QtConnectionObject*> conns = QtConnectionObject::connections.values(sender);
- return QtRuntimeMethod::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
-}
+ foreach (QtConnectionObject* conn, conns) {
+ // Is this the right connection?
+ if (!conn->match(context, sender, signalIndex, targetObject, targetFunction))
+ continue;
-void QtRuntimeConnectionMethod::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
-{
- if (mode == IncludeDontEnumProperties)
- propertyNames.add(exec->propertyNames().length);
+ // Yep, disconnect it
+ QMetaObject::disconnect(sender, signalIndex, conn, conn->metaObject()->methodOffset());
+ delete conn; // this will also remove it from the map
+ return JSValueMakeUndefined(context);
+ }
- QtRuntimeMethod::getOwnPropertyNames(object, exec, propertyNames, mode);
-}
+ QString msg = QStringLiteral("QtMetaMethod.disconnect: failed to disconnect from %1::%2()")
+ .arg(QLatin1String(sender->metaObject()->className()))
+ .arg(QLatin1String(d->m_identifier));
-JSValue QtRuntimeConnectionMethod::lengthGetter(ExecState*, JSValue, PropertyName)
-{
- // we have one formal argument, and one optional
- return jsNumber(1);
+ setException(context, exception, msg);
+ return JSValueMakeUndefined(context);
}
// ===============
+QMultiMap<QObject*, QtConnectionObject*> QtConnectionObject::connections;
+
QtConnectionObject::QtConnectionObject(JSContextRef context, PassRefPtr<QtInstance> senderInstance, int signalIndex, JSObjectRef receiver, JSObjectRef receiverFunction)
: QObject(senderInstance->getObject())
, m_context(JSContextGetGlobalContext(context))
- , m_senderInstance(senderInstance)
- , m_originalSender(m_senderInstance->getObject())
+ , m_rootObject(senderInstance->rootObject())
, m_signalIndex(signalIndex)
, m_receiver(receiver)
, m_receiverFunction(receiverFunction)
@@ -1708,9 +1539,7 @@ QtConnectionObject::QtConnectionObject(JSContextRef context, PassRefPtr<QtInstan
QtConnectionObject::~QtConnectionObject()
{
- // We can safely use m_originalSender because connection object will never outlive the sender,
- // which is its QObject parent.
- QtRuntimeConnectionMethod::connections.remove(m_originalSender, this);
+ connections.remove(parent(), this);
if (m_receiver)
JSValueUnprotect(m_context, m_receiver);
@@ -1806,14 +1635,7 @@ int QtConnectionObject::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
void QtConnectionObject::execute(void** argv)
{
- QObject* sender = m_senderInstance->getObject();
- if (!sender) {
- qWarning() << "sender deleted, cannot deliver signal";
- return;
- }
-
- ASSERT(sender == m_originalSender);
-
+ QObject* sender = parent();
const QMetaObject* meta = sender->metaObject();
const QMetaMethod method = meta->method(m_signalIndex);
@@ -1825,11 +1647,10 @@ void QtConnectionObject::execute(void** argv)
// TODO: remove once conversion functions use JSC API.
ExecState* exec = ::toJS(m_context);
- RefPtr<RootObject> rootObject = m_senderInstance->rootObject();
for (int i = 0; i < argc; i++) {
int argType = method.parameterType(i);
- args[i] = ::toRef(exec, convertQVariantToValue(exec, rootObject, QVariant(argType, argv[i+1])));
+ args[i] = ::toRef(exec, convertQVariantToValue(exec, m_rootObject, QVariant(argType, argv[i+1])));
}
JSObjectCallAsFunction(m_context, m_receiverFunction, m_receiver, argc, args.data(), 0);
@@ -1837,18 +1658,13 @@ void QtConnectionObject::execute(void** argv)
bool QtConnectionObject::match(JSContextRef context, QObject* sender, int signalIndex, JSObjectRef receiver, JSObjectRef receiverFunction)
{
- if (sender != m_originalSender || signalIndex != m_signalIndex)
+ if (sender != parent() || signalIndex != m_signalIndex)
return false;
JSValueRef* ignoredException = 0;
const bool receiverMatch = (!receiver && !m_receiver) || (receiver && m_receiver && JSValueIsEqual(context, receiver, m_receiver, ignoredException));
return receiverMatch && JSValueIsEqual(context, receiverFunction, m_receiverFunction, ignoredException);
}
-QtConnectionObject* QtConnectionObject::createWithInternalJSC(ExecState* exec, PassRefPtr<QtInstance> senderInstance, int signalIndex, JSObject* receiver, JSObject* receiverFunction)
-{
- return new QtConnectionObject(::toRef(exec), senderInstance, signalIndex, ::toRef(receiver), ::toRef(receiverFunction));
-}
-
// ===============
template <typename T> QtArray<T>::QtArray(QList<T> list, QMetaType::Type type, PassRefPtr<RootObject> rootObject)
diff --git a/Source/WebCore/bridge/qt/qt_runtime.h b/Source/WebCore/bridge/qt/qt_runtime.h
index b2fd66d43..2450fc56e 100644
--- a/Source/WebCore/bridge/qt/qt_runtime.h
+++ b/Source/WebCore/bridge/qt/qt_runtime.h
@@ -95,143 +95,33 @@ private:
QMetaType::Type m_type;
};
-// Based on RuntimeMethod
-
-// Extra data classes (to avoid the CELL_SIZE limit on JS objects)
-class QtRuntimeMethod;
-class QtRuntimeMethodData : public WeakHandleOwner {
- public:
- virtual ~QtRuntimeMethodData();
- RefPtr<QtInstance> m_instance;
- Weak<QtRuntimeMethod> m_finalizer;
-
- private:
- void finalize(Handle<Unknown>, void*);
-};
-
-class QtRuntimeConnectionMethod;
-class QtRuntimeMetaMethodData : public QtRuntimeMethodData {
- public:
- ~QtRuntimeMetaMethodData();
- QByteArray m_signature;
- bool m_allowPrivate;
- int m_index;
- WriteBarrier<QtRuntimeConnectionMethod> m_connect;
- WriteBarrier<QtRuntimeConnectionMethod> m_disconnect;
-};
-
-class QtRuntimeConnectionMethodData : public QtRuntimeMethodData {
- public:
- ~QtRuntimeConnectionMethodData();
- QByteArray m_signature;
- int m_index;
- bool m_isConnect;
-};
-
-// Common base class (doesn't really do anything interesting)
-class QtRuntimeMethod : public InternalFunction {
+class QtRuntimeMethod {
public:
- typedef InternalFunction Base;
+ enum MethodFlags {
+ MethodIsSignal = 1,
+ AllowPrivate = 2
+ };
+ QtRuntimeMethod(JSContextRef, QObject*, const QByteArray& identifier, int signalIndex, int flags, QtInstance*);
~QtRuntimeMethod();
- static void destroy(JSCell*);
-
- static const ClassInfo s_info;
-
- static FunctionPrototype* createPrototype(ExecState*, JSGlobalObject* globalObject)
- {
- return globalObject->functionPrototype();
- }
-
- static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
- {
- return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info);
- }
-
-protected:
- void finishCreation(ExecState*, const UString&, PassRefPtr<QtInstance>);
- static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | InternalFunction::StructureFlags | OverridesVisitChildren;
-
- QtRuntimeMethodData *d_func() const {return d_ptr;}
- QtRuntimeMethod(QtRuntimeMethodData *dd, ExecState *, Structure*, const UString& name);
- QtRuntimeMethodData *d_ptr;
-};
-class QtRuntimeMetaMethod : public QtRuntimeMethod {
-public:
- typedef QtRuntimeMethod Base;
-
- static QtRuntimeMetaMethod* create(ExecState* exec, const UString& name, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature, bool allowPrivate)
- {
- Structure* domStructure = WebCore::deprecatedGetDOMStructure<QtRuntimeMetaMethod>(exec);
- QtRuntimeMetaMethod* method = new (allocateCell<QtRuntimeMetaMethod>(*exec->heap())) QtRuntimeMetaMethod(exec, domStructure, name);
- method->finishCreation(exec, name, instance, index, signature, allowPrivate);
- return method;
- }
-
- static bool getOwnPropertySlot(JSCell*, ExecState *, PropertyName, PropertySlot&);
- static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
- static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
-
- static void visitChildren(JSCell*, SlotVisitor&);
-
- static const ClassInfo s_info;
-
- static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
- {
- return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info);
- }
-
-protected:
- QtRuntimeMetaMethodData* d_func() const {return reinterpret_cast<QtRuntimeMetaMethodData*>(d_ptr);}
+ static JSValueRef call(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
+ static JSValueRef connect(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
+ static JSValueRef disconnect(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
-private:
- QtRuntimeMetaMethod(ExecState*, Structure*, const UString&);
- void finishCreation(ExecState*, const UString&, PassRefPtr<QtInstance>, int index, const QByteArray& signature, bool allowPrivate);
-
- static CallType getCallData(JSCell*, CallData&);
- static EncodedJSValue JSC_HOST_CALL call(ExecState* exec);
- static JSValue lengthGetter(ExecState*, JSValue, PropertyName);
- static JSValue connectGetter(ExecState*, JSValue, PropertyName);
- static JSValue disconnectGetter(ExecState*, JSValue, PropertyName);
-};
+ JSObjectRef jsObjectRef(JSContextRef, JSValueRef* exception);
-class QtConnectionObject;
-class QtRuntimeConnectionMethod : public QtRuntimeMethod {
-public:
- typedef QtRuntimeMethod Base;
-
- static QtRuntimeConnectionMethod* create(ExecState* exec, const UString& name, bool isConnect, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature)
- {
- Structure* domStructure = WebCore::deprecatedGetDOMStructure<QtRuntimeConnectionMethod>(exec);
- QtRuntimeConnectionMethod* method = new (allocateCell<QtRuntimeConnectionMethod>(*exec->heap())) QtRuntimeConnectionMethod(exec, domStructure, name);
- method->finishCreation(exec, name, isConnect, instance, index, signature);
- return method;
- }
-
- static bool getOwnPropertySlot(JSCell*, ExecState *, PropertyName, PropertySlot&);
- static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
- static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
-
- static const ClassInfo s_info;
-
- static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
- {
- return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info);
- }
-
-protected:
- QtRuntimeConnectionMethodData* d_func() const {return reinterpret_cast<QtRuntimeConnectionMethodData*>(d_ptr);}
+ const QByteArray& name() { return m_identifier; }
private:
- QtRuntimeConnectionMethod(ExecState*, Structure*, const UString&);
- void finishCreation(ExecState*, const UString&, bool isConnect, PassRefPtr<QtInstance>, int index, const QByteArray& signature);
-
- static CallType getCallData(JSCell*, CallData&);
- static EncodedJSValue JSC_HOST_CALL call(ExecState* exec);
- static JSValue lengthGetter(ExecState*, JSValue, PropertyName);
- static QMultiMap<QObject *, QtConnectionObject *> connections;
- friend class QtConnectionObject;
+ static QtRuntimeMethod* toRuntimeMethod(JSContextRef, JSObjectRef);
+
+ static JSValueRef connectOrDisconnect(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception, bool connect);
+ QPointer<QObject> m_object;
+ QByteArray m_identifier;
+ int m_index;
+ int m_flags;
+ QtInstance* m_instance;
};
// A QtConnectionObject represents a connection created inside JS. It will connect its own execute() slot
@@ -247,19 +137,16 @@ public:
bool match(JSContextRef, QObject* sender, int signalIndex, JSObjectRef thisObject, JSObjectRef funcObject);
- // Note: for callers using JSC internals, remove once we don't need anymore.
- static QtConnectionObject* createWithInternalJSC(ExecState*, PassRefPtr<QtInstance> senderInstance, int signalIndex, JSObject* receiver, JSObject* receiverFunction);
-
private:
JSGlobalContextRef m_context;
- RefPtr<QtInstance> m_senderInstance;
-
- // We use this as key in active connections multimap.
- QObject* m_originalSender;
+ RefPtr<RootObject> m_rootObject;
int m_signalIndex;
JSObjectRef m_receiver;
JSObjectRef m_receiverFunction;
+
+ friend class QtRuntimeMethod;
+ static QMultiMap<QObject*, QtConnectionObject*> connections;
};
diff --git a/Source/WebCore/bridge/testqtbindings.cpp b/Source/WebCore/bridge/testqtbindings.cpp
index 609f5cb38..a4f4d5a14 100644
--- a/Source/WebCore/bridge/testqtbindings.cpp
+++ b/Source/WebCore/bridge/testqtbindings.cpp
@@ -65,7 +65,7 @@ public:
QString string;
int integer;
-public slots:
+public Q_SLOTS:
void foo() { qDebug() << "foo invoked"; }
};
diff --git a/Source/WebCore/config.h b/Source/WebCore/config.h
index 94af14716..f23bf3e0f 100644
--- a/Source/WebCore/config.h
+++ b/Source/WebCore/config.h
@@ -88,14 +88,7 @@
#include <wx/defs.h>
#endif
-// this breaks compilation of <QFontDatabase>, at least, so turn it off for now
-// Also generates errors on wx on Windows, presumably because these functions
-// are used from wx headers. On GTK+ for Mac many GTK+ files include <libintl.h>
-// or <glib/gi18n-lib.h>, which in turn include <xlocale/_ctype.h> which uses
-// isacii().
-#if !PLATFORM(QT) && !PLATFORM(WX) && !PLATFORM(CHROMIUM) && !(OS(DARWIN) && PLATFORM(GTK)) && !OS(QNX) && !defined(_LIBCPP_VERSION)
#include <wtf/DisallowCType.h>
-#endif
#if COMPILER(MSVC)
#define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
index 7a050682d..902536762 100644
--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -57,6 +57,7 @@
#include "StylePropertyShorthand.h"
#include "WebKitCSSTransformValue.h"
#include "WebKitFontFamilyNames.h"
+#include <wtf/text/StringBuilder.h>
#if ENABLE(CSS_EXCLUSIONS)
#include "CSSWrapShapes.h"
@@ -176,7 +177,10 @@ static const CSSPropertyID computedProperties[] = {
CSSPropertyTabSize,
CSSPropertyTextAlign,
CSSPropertyTextDecoration,
+#if ENABLE(CSS3_TEXT_DECORATION)
CSSPropertyWebkitTextDecorationLine,
+ CSSPropertyWebkitTextDecorationStyle,
+#endif // CSS3_TEXT_DECORATION
CSSPropertyTextIndent,
CSSPropertyTextRendering,
CSSPropertyTextShadow,
@@ -209,6 +213,9 @@ static const CSSPropertyID computedProperties[] = {
CSSPropertyWebkitBackgroundComposite,
CSSPropertyWebkitBackgroundOrigin,
CSSPropertyWebkitBackgroundSize,
+#if ENABLE(CSS_COMPOSITING)
+ CSSPropertyWebkitBlendMode,
+#endif
CSSPropertyWebkitBorderFit,
CSSPropertyWebkitBorderHorizontalSpacing,
CSSPropertyWebkitBorderImage,
@@ -707,12 +714,21 @@ static LayoutRect sizingBox(RenderObject* renderer)
return box->style()->boxSizing() == BORDER_BOX ? box->borderBoxRect() : box->computedCSSContentBoxRect();
}
+static IntRect pixelSnappedSizingBox(RenderObject* renderer)
+{
+ if (!renderer->isBox())
+ return IntRect();
+
+ RenderBox* box = toRenderBox(renderer);
+ return box->style()->boxSizing() == BORDER_BOX ? box->pixelSnappedBorderBoxRect() : pixelSnappedIntRect(box->computedCSSContentBoxRect());
+}
+
static PassRefPtr<CSSValue> computedTransform(RenderObject* renderer, const RenderStyle* style)
{
if (!renderer || style->transform().operations().isEmpty())
return cssValuePool().createIdentifierValue(CSSValueNone);
- LayoutRect box = sizingBox(renderer);
+ IntRect box = pixelSnappedSizingBox(renderer);
TransformationMatrix transform;
style->applyTransform(transform, box.size(), RenderStyle::ExcludeTransformOrigin);
@@ -1061,18 +1077,18 @@ void CSSComputedStyleDeclaration::deref()
String CSSComputedStyleDeclaration::cssText() const
{
- String result("");
+ StringBuilder result;
for (unsigned i = 0; i < numComputedProperties; i++) {
if (i)
- result += " ";
- result += getPropertyName(computedProperties[i]);
- result += ": ";
- result += getPropertyValue(computedProperties[i]);
- result += ";";
+ result.append(' ');
+ result.append(getPropertyName(computedProperties[i]));
+ result.append(": ", 2);
+ result.append(getPropertyValue(computedProperties[i]));
+ result.append(';');
}
- return result;
+ return result.toString();
}
void CSSComputedStyleDeclaration::setCssText(const String&, ExceptionCode& ec)
@@ -1164,31 +1180,6 @@ static PassRefPtr<CSSPrimitiveValue> valueForFamily(const AtomicString& family)
return cssValuePool().createValue(family.string(), CSSPrimitiveValue::CSS_STRING);
}
-static PassRefPtr<CSSValue> renderUnicodeBidiFlagsToCSSValue(EUnicodeBidi unicodeBidi)
-{
- switch (unicodeBidi) {
- case UBNormal:
- return cssValuePool().createIdentifierValue(CSSValueNormal);
- case Embed:
- return cssValuePool().createIdentifierValue(CSSValueEmbed);
- case Plaintext:
- return cssValuePool().createIdentifierValue(CSSValueWebkitPlaintext);
- case Override:
- return cssValuePool().createIdentifierValue(CSSValueBidiOverride);
- case Isolate:
- return cssValuePool().createIdentifierValue(CSSValueWebkitIsolate);
- case OverrideIsolate:
- {
- RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
- list->append(cssValuePool().createIdentifierValue(CSSValueBidiOverride));
- list->append(cssValuePool().createIdentifierValue(CSSValueWebkitIsolate));
- return list;
- }
- }
- ASSERT_NOT_REACHED();
- return 0;
-}
-
static PassRefPtr<CSSValue> renderTextDecorationFlagsToCSSValue(int textDecoration)
{
// Blink value is ignored.
@@ -1205,6 +1196,27 @@ static PassRefPtr<CSSValue> renderTextDecorationFlagsToCSSValue(int textDecorati
return list;
}
+#if ENABLE(CSS3_TEXT_DECORATION)
+static PassRefPtr<CSSValue> renderTextDecorationStyleFlagsToCSSValue(TextDecorationStyle textDecorationStyle)
+{
+ switch (textDecorationStyle) {
+ case TextDecorationStyleSolid:
+ return cssValuePool().createIdentifierValue(CSSValueSolid);
+ case TextDecorationStyleDouble:
+ return cssValuePool().createIdentifierValue(CSSValueDouble);
+ case TextDecorationStyleDotted:
+ return cssValuePool().createIdentifierValue(CSSValueDotted);
+ case TextDecorationStyleDashed:
+ return cssValuePool().createIdentifierValue(CSSValueDashed);
+ case TextDecorationStyleWavy:
+ return cssValuePool().createIdentifierValue(CSSValueWavy);
+ }
+
+ ASSERT_NOT_REACHED();
+ return cssValuePool().createExplicitInitialValue();
+}
+#endif // CSS3_TEXT_DECORATION
+
static PassRefPtr<CSSValue> fillRepeatToCSSValue(EFillRepeat xRepeat, EFillRepeat yRepeat)
{
// For backwards compatibility, if both values are equal, just return one of them. And
@@ -1948,8 +1960,13 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
case CSSPropertyTextAlign:
return cssValuePool().createValue(style->textAlign());
case CSSPropertyTextDecoration:
+ return renderTextDecorationFlagsToCSSValue(style->textDecoration());
+#if ENABLE(CSS3_TEXT_DECORATION)
case CSSPropertyWebkitTextDecorationLine:
return renderTextDecorationFlagsToCSSValue(style->textDecoration());
+ case CSSPropertyWebkitTextDecorationStyle:
+ return renderTextDecorationStyleFlagsToCSSValue(style->textDecorationStyle());
+#endif // CSS3_TEXT_DECORATION
case CSSPropertyWebkitTextDecorationsInEffect:
return renderTextDecorationFlagsToCSSValue(style->textDecorationsInEffect());
case CSSPropertyWebkitTextFillColor:
@@ -2003,7 +2020,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
case CSSPropertyTop:
return getPositionOffsetValue(style.get(), CSSPropertyTop, m_node->document()->renderView());
case CSSPropertyUnicodeBidi:
- return renderUnicodeBidiFlagsToCSSValue(style->unicodeBidi());
+ return cssValuePool().createValue(style->unicodeBidi());
case CSSPropertyVerticalAlign:
switch (style->verticalAlign()) {
case BASELINE:
@@ -2341,7 +2358,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
else if (animation->animationMode() == Animation::AnimateAll)
propertyValue = cssValuePool().createIdentifierValue(CSSValueAll);
else
- propertyValue = cssValuePool().createValue(getPropertyName(animation->property()), CSSPrimitiveValue::CSS_STRING);
+ propertyValue = cssValuePool().createValue(getPropertyNameString(animation->property()), CSSPrimitiveValue::CSS_STRING);
list->append(propertyValue);
}
} else
@@ -2410,6 +2427,10 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
case CSSPropertyWebkitFilter:
return valueForFilter(style.get());
#endif
+#if ENABLE(CSS_COMPOSITING)
+ case CSSPropertyWebkitBlendMode:
+ return cssValuePool().createValue(style->blendMode());
+#endif
case CSSPropertyBackground:
return getBackgroundShorthandValue();
case CSSPropertyBorder: {
@@ -2617,7 +2638,7 @@ String CSSComputedStyleDeclaration::item(unsigned i) const
if (i >= length())
return "";
- return getPropertyName(computedProperties[i]);
+ return getPropertyNameString(computedProperties[i]);
}
bool CSSComputedStyleDeclaration::cssPropertyMatches(const CSSProperty* property) const
diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp
index aa08c18e7..4a2e38bb9 100644
--- a/Source/WebCore/css/CSSParser.cpp
+++ b/Source/WebCore/css/CSSParser.cpp
@@ -674,6 +674,15 @@ static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int
if (valueID == CSSValueVisible || valueID == CSSValueHidden)
return true;
break;
+#if ENABLE(CSS_COMPOSITING)
+ case CSSPropertyWebkitBlendMode:
+ if (valueID == CSSValueNormal || valueID == CSSValueMultiply || valueID == CSSValueScreen || valueID == CSSValueOverlay
+ || valueID == CSSValueDarken || valueID == CSSValueLighten || valueID == CSSValueColorDodge || valueID == CSSValueColorBurn
+ || valueID == CSSValueHardLight || valueID == CSSValueSoftLight || valueID == CSSValueDifference || valueID == CSSValueExclusion
+ || valueID == CSSValueHue || valueID == CSSValueSaturation || valueID == CSSValueColor || valueID == CSSValueLuminosity)
+ return true;
+ break;
+#endif
case CSSPropertyWebkitBorderFit:
if (valueID == CSSValueBorder || valueID == CSSValueLines)
return true;
@@ -918,6 +927,9 @@ static inline bool isKeywordPropertyID(CSSPropertyID propertyId)
case CSSPropertyTextUnderlineStyle:
case CSSPropertyVisibility:
case CSSPropertyWebkitAppearance:
+#if ENABLE(CSS_COMPOSITING)
+ case CSSPropertyWebkitBlendMode:
+#endif
case CSSPropertyWebkitBackfaceVisibility:
case CSSPropertyWebkitBorderAfterStyle:
case CSSPropertyWebkitBorderBeforeStyle:
@@ -1041,7 +1053,7 @@ static bool parseTransformArguments(WebKitCSSTransformValue* transformValue, Cha
return true;
}
-static bool parseTransformValue(StylePropertySet* properties, CSSPropertyID propertyID, const String& string, bool important)
+static bool parseTranslateTransformValue(StylePropertySet* properties, CSSPropertyID propertyID, const String& string, bool important)
{
if (propertyID != CSSPropertyWebkitTransform)
return false;
@@ -1126,7 +1138,7 @@ 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))
+ if (parseTranslateTransformValue(declaration, propertyID, string, important))
return true;
CSSParserContext context(cssParserMode);
@@ -1719,30 +1731,14 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
else
return parseQuotes(propId, important);
break;
- case CSSPropertyUnicodeBidi: // normal | embed | (bidi-override || isolate) | plaintext | inherit
+ case CSSPropertyUnicodeBidi: // normal | embed | bidi-override | isolate | isolate-override | plaintext | inherit
if (id == CSSValueNormal
|| id == CSSValueEmbed
+ || id == CSSValueBidiOverride
+ || id == CSSValueWebkitIsolate
+ || id == CSSValueWebkitIsolateOverride
|| id == CSSValueWebkitPlaintext)
validPrimitive = true;
- else {
- RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
- bool isValid = true;
- while (isValid && value) {
- switch (value->id) {
- case CSSValueBidiOverride:
- case CSSValueWebkitIsolate:
- list->append(cssValuePool().createIdentifierValue(value->id));
- break;
- default:
- isValid = false;
- }
- value = m_valueList->next();
- }
- if (list->length() && isValid) {
- parsedValue = list.release();
- m_valueList->next();
- }
- }
break;
case CSSPropertyContent: // [ <string> | <uri> | <counter> | attr(X) | open-quote |
@@ -2104,10 +2100,18 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
// none | [ underline || overline || line-through || blink ] | inherit
return parseTextDecoration(propId, important);
+#if ENABLE(CSS3_TEXT_DECORATION)
case CSSPropertyWebkitTextDecorationLine:
// none | [ underline || overline || line-through ] | inherit
return parseTextDecoration(propId, important);
+ case CSSPropertyWebkitTextDecorationStyle:
+ // solid | double | dotted | dashed | wavy
+ if (id == CSSValueSolid || id == CSSValueDouble || id == CSSValueDotted || id == CSSValueDashed || id == CSSValueWavy)
+ validPrimitive = true;
+ break;
+#endif // CSS3_TEXT_DECORATION
+
case CSSPropertyZoom: // normal | reset | document | <number> | <percentage> | inherit
if (id == CSSValueNormal || id == CSSValueReset || id == CSSValueDocument)
validPrimitive = true;
@@ -2255,6 +2259,11 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
}
break;
#endif
+#if ENABLE(CSS_COMPOSITING)
+ case CSSPropertyWebkitBlendMode:
+ validPrimitive = true;
+ break;
+#endif
#if ENABLE(CSS3_FLEXBOX)
case CSSPropertyWebkitFlex: {
ShorthandScope scope(this, propId);
@@ -2320,7 +2329,7 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
if (id == CSSValueNone)
validPrimitive = true;
else {
- RefPtr<CSSValue> transformValue = parseTransform(m_valueList.get());
+ RefPtr<CSSValue> transformValue = parseTransform();
if (transformValue) {
addProperty(propId, transformValue.release(), important);
return true;
@@ -7266,75 +7275,87 @@ private:
CSSParser::Units m_unit;
};
-PassRefPtr<CSSValueList> CSSParser::parseTransform(CSSParserValueList* valueList)
+PassRefPtr<CSSValueList> CSSParser::parseTransform()
{
- if (!valueList)
+ if (!m_valueList)
return 0;
- // The transform is a list of functional primitives that specify transform operations.
- // We collect a list of WebKitCSSTransformValues, where each value specifies a single operation.
RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
- for (CSSParserValue* value = valueList->current(); value; value = valueList->next()) {
- if (value->unit != CSSParserValue::Function || !value->function)
+ for (CSSParserValue* value = m_valueList->current(); value; value = m_valueList->next()) {
+ RefPtr<CSSValue> parsedTransformValue = parseTransformValue(value);
+ if (!parsedTransformValue)
return 0;
- // Every primitive requires at least one argument.
- CSSParserValueList* args = value->function->args.get();
- if (!args)
- return 0;
+ list->append(parsedTransformValue.release());
+ }
- // See if the specified primitive is one we understand.
- TransformOperationInfo info(value->function->name);
- if (info.unknown())
- return 0;
+ return list.release();
+}
+
- if (!info.hasCorrectArgCount(args->size()))
- return 0;
+PassRefPtr<CSSValue> CSSParser::parseTransformValue(CSSParserValue *value)
+{
+ if (value->unit != CSSParserValue::Function || !value->function)
+ return 0;
- // Create the new WebKitCSSTransformValue for this operation and add it to our list.
- RefPtr<WebKitCSSTransformValue> transformValue = WebKitCSSTransformValue::create(info.type());
- list->append(transformValue);
+ // Every primitive requires at least one argument.
+ CSSParserValueList* args = value->function->args.get();
+ if (!args)
+ return 0;
- // Snag our values.
- CSSParserValue* a = args->current();
- unsigned argNumber = 0;
- while (a) {
- CSSParser::Units unit = info.unit();
+ // See if the specified primitive is one we understand.
+ TransformOperationInfo info(value->function->name);
+ if (info.unknown())
+ return 0;
- if (info.type() == WebKitCSSTransformValue::Rotate3DTransformOperation && argNumber == 3) {
- // 4th param of rotate3d() is an angle rather than a bare number, validate it as such
- if (!validUnit(a, FAngle, CSSStrictMode))
- return 0;
- } else if (info.type() == WebKitCSSTransformValue::Translate3DTransformOperation && argNumber == 2) {
- // 3rd param of translate3d() cannot be a percentage
- if (!validUnit(a, FLength, CSSStrictMode))
- return 0;
- } else if (info.type() == WebKitCSSTransformValue::TranslateZTransformOperation && argNumber == 0) {
- // 1st param of translateZ() cannot be a percentage
- if (!validUnit(a, FLength, CSSStrictMode))
- return 0;
- } else if (info.type() == WebKitCSSTransformValue::PerspectiveTransformOperation && argNumber == 0) {
- // 1st param of perspective() must be a non-negative number (deprecated) or length.
- if (!validUnit(a, FNumber | FLength | FNonNeg, CSSStrictMode))
- return 0;
- } else if (!validUnit(a, unit, CSSStrictMode))
- return 0;
+ if (!info.hasCorrectArgCount(args->size()))
+ return 0;
+
+ // The transform is a list of functional primitives that specify transform operations.
+ // We collect a list of WebKitCSSTransformValues, where each value specifies a single operation.
- // Add the value to the current transform operation.
- transformValue->append(createPrimitiveNumericValue(a));
+ // Create the new WebKitCSSTransformValue for this operation and add it to our list.
+ RefPtr<WebKitCSSTransformValue> transformValue = WebKitCSSTransformValue::create(info.type());
- a = args->next();
- if (!a)
- break;
- if (a->unit != CSSParserValue::Operator || a->iValue != ',')
+ // Snag our values.
+ CSSParserValue* a = args->current();
+ unsigned argNumber = 0;
+ while (a) {
+ CSSParser::Units unit = info.unit();
+
+ if (info.type() == WebKitCSSTransformValue::Rotate3DTransformOperation && argNumber == 3) {
+ // 4th param of rotate3d() is an angle rather than a bare number, validate it as such
+ if (!validUnit(a, FAngle, CSSStrictMode))
return 0;
- a = args->next();
+ } else if (info.type() == WebKitCSSTransformValue::Translate3DTransformOperation && argNumber == 2) {
+ // 3rd param of translate3d() cannot be a percentage
+ if (!validUnit(a, FLength, CSSStrictMode))
+ return 0;
+ } else if (info.type() == WebKitCSSTransformValue::TranslateZTransformOperation && !argNumber) {
+ // 1st param of translateZ() cannot be a percentage
+ if (!validUnit(a, FLength, CSSStrictMode))
+ return 0;
+ } else if (info.type() == WebKitCSSTransformValue::PerspectiveTransformOperation && !argNumber) {
+ // 1st param of perspective() must be a non-negative number (deprecated) or length.
+ if (!validUnit(a, FNumber | FLength | FNonNeg, CSSStrictMode))
+ return 0;
+ } else if (!validUnit(a, unit, CSSStrictMode))
+ return 0;
- argNumber++;
- }
+ // Add the value to the current transform operation.
+ transformValue->append(createPrimitiveNumericValue(a));
+
+ a = args->next();
+ if (!a)
+ break;
+ if (a->unit != CSSParserValue::Operator || a->iValue != ',')
+ return 0;
+ a = args->next();
+
+ argNumber++;
}
- return list.release();
+ return transformValue.release();
}
bool CSSParser::isBlendMode(int ident)
@@ -7556,26 +7577,36 @@ PassRefPtr<WebKitCSSFilterValue> CSSParser::parseCustomFilter(CSSParserValue* va
if (!(arg = argsList->current()))
return 0;
- // TODO: Implement other parameters types parsing.
- // textures: https://bugs.webkit.org/show_bug.cgi?id=71442
- // 3d-transforms: https://bugs.webkit.org/show_bug.cgi?id=71443
- // mat2, mat3, mat4: https://bugs.webkit.org/show_bug.cgi?id=71444
- RefPtr<CSSValueList> paramValueList = CSSValueList::createSpaceSeparated();
- while ((arg = argsList->current())) {
- // If we hit a comma it means we finished this parameter's values.
- if (isComma(arg))
- break;
- if (!validUnit(arg, FNumber, CSSStrictMode))
+ RefPtr<CSSValue> parameterValue;
+
+ if (arg->unit == CSSParserValue::Function && arg->function)
+ // TODO: Implement other parameters types parsing.
+ // textures: https://bugs.webkit.org/show_bug.cgi?id=71442
+ // mat2, mat3, mat4: https://bugs.webkit.org/show_bug.cgi?id=71444
+ // array: https://bugs.webkit.org/show_bug.cgi?id=94226
+ // 3d-transform shall be the last to be checked
+ parameterValue = parseCustomFilterTransform(argsList);
+ else {
+ RefPtr<CSSValueList> paramValueList = CSSValueList::createSpaceSeparated();
+ while ((arg = argsList->current())) {
+ // If we hit a comma it means we finished this parameter's values.
+ if (isComma(arg))
+ break;
+ if (!validUnit(arg, FNumber, CSSStrictMode))
+ return 0;
+ paramValueList->append(cssValuePool().createValue(arg->fValue, CSSPrimitiveValue::CSS_NUMBER));
+ argsList->next();
+ }
+ if (!paramValueList->length() || paramValueList->length() > 4)
return 0;
- paramValueList->append(cssValuePool().createValue(arg->fValue, CSSPrimitiveValue::CSS_NUMBER));
- argsList->next();
+ parameterValue = paramValueList.release();
}
- if (!paramValueList->length() || paramValueList->length() > 4)
+
+ if (!parameterValue || !acceptCommaOperator(argsList))
return 0;
- parameter->append(paramValueList.release());
+
+ parameter->append(parameterValue.release());
paramList->append(parameter.release());
- if (!acceptCommaOperator(argsList))
- return 0;
}
if (paramList->length())
@@ -7583,6 +7614,27 @@ PassRefPtr<WebKitCSSFilterValue> CSSParser::parseCustomFilter(CSSParserValue* va
return filterValue;
}
+
+PassRefPtr<CSSValueList> CSSParser::parseCustomFilterTransform(CSSParserValueList* valueList)
+{
+ if (!valueList)
+ return 0;
+
+ // CSS Shaders' custom() transforms are space separated and comma terminated.
+ RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ for (CSSParserValue* value = valueList->current(); value; value = valueList->next()) {
+ if (isComma(value))
+ break;
+
+ RefPtr<CSSValue> parsedTransformValue = parseTransformValue(value);
+ if (!parsedTransformValue)
+ return 0;
+
+ list->append(parsedTransformValue.release());
+ }
+
+ return list.release();
+}
#endif
PassRefPtr<WebKitCSSFilterValue> CSSParser::parseBuiltinFilterArguments(CSSParserValueList* args, WebKitCSSFilterValue::FilterOperationType filterType)
@@ -7916,6 +7968,7 @@ bool CSSParser::parsePerspectiveOrigin(CSSPropertyID propId, CSSPropertyID& prop
void CSSParser::addTextDecorationProperty(CSSPropertyID propId, PassRefPtr<CSSValue> value, bool important)
{
+#if ENABLE(CSS3_TEXT_DECORATION)
// The text-decoration-line property takes priority over text-decoration, unless the latter has important priority set.
if (propId == CSSPropertyTextDecoration && !important && m_currentShorthand == CSSPropertyInvalid) {
for (unsigned i = 0; i < m_parsedProperties->size(); ++i) {
@@ -7923,6 +7976,7 @@ void CSSParser::addTextDecorationProperty(CSSPropertyID propId, PassRefPtr<CSSVa
return;
}
}
+#endif // CSS3_TEXT_DECORATION
addProperty(propId, value, important);
}
@@ -7940,9 +7994,11 @@ bool CSSParser::parseTextDecoration(CSSPropertyID propId, bool important)
while (isValid && value) {
switch (value->id) {
case CSSValueBlink:
+#if ENABLE(CSS3_TEXT_DECORATION)
// Blink value is not accepted by -webkit-text-decoration-line.
isValid = propId != CSSPropertyWebkitTextDecorationLine;
break;
+#endif // CSS3_TEXT_DECORATION
case CSSValueUnderline:
case CSSValueOverline:
case CSSValueLineThrough:
diff --git a/Source/WebCore/css/CSSParser.h b/Source/WebCore/css/CSSParser.h
index 5a1ed97b8..aec1f6635 100644
--- a/Source/WebCore/css/CSSParser.h
+++ b/Source/WebCore/css/CSSParser.h
@@ -219,13 +219,15 @@ public:
#if ENABLE(CSS_SHADERS)
PassRefPtr<WebKitCSSMixFunctionValue> parseMixFunction(CSSParserValue*);
PassRefPtr<WebKitCSSFilterValue> parseCustomFilter(CSSParserValue*);
+ PassRefPtr<CSSValueList> parseCustomFilterTransform(CSSParserValueList*);
#endif
#endif
static bool isBlendMode(int ident);
static bool isCompositeOperator(int ident);
- PassRefPtr<CSSValueList> parseTransform(CSSParserValueList*);
+ PassRefPtr<CSSValueList> parseTransform();
+ PassRefPtr<CSSValue> parseTransformValue(CSSParserValue*);
bool parseTransformOrigin(CSSPropertyID propId, CSSPropertyID& propId1, CSSPropertyID& propId2, CSSPropertyID& propId3, RefPtr<CSSValue>&, RefPtr<CSSValue>&, RefPtr<CSSValue>&);
bool parsePerspectiveOrigin(CSSPropertyID propId, CSSPropertyID& propId1, CSSPropertyID& propId2, RefPtr<CSSValue>&, RefPtr<CSSValue>&);
@@ -247,8 +249,6 @@ public:
bool parseFontVariantLigatures(bool important);
- int yyparse();
-
CSSParserSelector* createFloatingSelector();
PassOwnPtr<CSSParserSelector> sinkFloatingSelector(CSSParserSelector*);
diff --git a/Source/WebCore/css/CSSPrimitiveValue.cpp b/Source/WebCore/css/CSSPrimitiveValue.cpp
index 65ca80427..bbd6700d3 100644
--- a/Source/WebCore/css/CSSPrimitiveValue.cpp
+++ b/Source/WebCore/css/CSSPrimitiveValue.cpp
@@ -207,15 +207,7 @@ static const AtomicString& valueOrPropertyName(int valueOrPropertyID)
return keywordString;
}
- if (valueOrPropertyID >= firstCSSProperty && valueOrPropertyID < firstCSSProperty + numCSSProperties) {
- static AtomicString* propertyStrings = new AtomicString[numCSSProperties]; // Leaked intentionally.
- AtomicString& propertyString = propertyStrings[valueOrPropertyID - firstCSSProperty];
- if (propertyString.isNull())
- propertyString = getPropertyName(static_cast<CSSPropertyID>(valueOrPropertyID));
- return propertyString;
- }
-
- return nullAtom;
+ return getPropertyNameAtomicString(static_cast<CSSPropertyID>(valueOrPropertyID));
}
CSSPrimitiveValue::CSSPrimitiveValue(int ident)
@@ -945,12 +937,9 @@ String CSSPrimitiveValue::customCssText() const
text = valueOrPropertyName(m_value.ident);
break;
case CSS_ATTR: {
- DEFINE_STATIC_LOCAL(const String, attrParen, ("attr("));
-
StringBuilder result;
result.reserveCapacity(6 + m_value.string->length());
-
- result.append(attrParen);
+ result.appendLiteral("attr(");
result.append(m_value.string);
result.append(')');
@@ -963,22 +952,21 @@ String CSSPrimitiveValue::customCssText() const
text += ")";
break;
case CSS_COUNTER: {
- DEFINE_STATIC_LOCAL(const String, counterParen, ("counter("));
- DEFINE_STATIC_LOCAL(const String, countersParen, ("counters("));
- DEFINE_STATIC_LOCAL(const String, commaSpace, (", "));
-
StringBuilder result;
String separator = m_value.counter->separator();
- result.append(separator.isEmpty() ? counterParen : countersParen);
+ if (separator.isEmpty())
+ result.appendLiteral("counter(");
+ else
+ result.appendLiteral("counters(");
result.append(m_value.counter->identifier());
if (!separator.isEmpty()) {
- result.append(commaSpace);
+ result.appendLiteral(", ");
result.append(quoteCSSStringIfNeeded(separator));
}
String listStyle = m_value.counter->listStyle();
if (!listStyle.isEmpty()) {
- result.append(commaSpace);
+ result.appendLiteral(", ");
result.append(listStyle);
}
result.append(')');
@@ -987,26 +975,8 @@ String CSSPrimitiveValue::customCssText() const
break;
}
case CSS_RECT: {
- DEFINE_STATIC_LOCAL(const String, rectParen, ("rect("));
-
Rect* rectVal = getRectValue();
- StringBuilder result;
- result.reserveCapacity(32);
- result.append(rectParen);
-
- result.append(rectVal->top()->cssText());
- result.append(' ');
-
- result.append(rectVal->right()->cssText());
- result.append(' ');
-
- result.append(rectVal->bottom()->cssText());
- result.append(' ');
-
- result.append(rectVal->left()->cssText());
- result.append(')');
-
- text = result.toString();
+ text = "rect(" + rectVal->top()->cssText() + ' ' + rectVal->right()->cssText() + ' ' + rectVal->bottom()->cssText() + ' ' + rectVal->left()->cssText() + ')';
break;
}
case CSS_QUAD: {
diff --git a/Source/WebCore/css/CSSPrimitiveValueMappings.h b/Source/WebCore/css/CSSPrimitiveValueMappings.h
index 6a337602b..14cef2595 100644
--- a/Source/WebCore/css/CSSPrimitiveValueMappings.h
+++ b/Source/WebCore/css/CSSPrimitiveValueMappings.h
@@ -192,10 +192,10 @@ template<> inline CSSPrimitiveValue::operator PrintColorAdjust() const
return PrintColorAdjustEconomy;
case CSSValueExact:
return PrintColorAdjustExact;
- default:
- ASSERT_NOT_REACHED();
- return PrintColorAdjustEconomy;
}
+
+ ASSERT_NOT_REACHED();
+ return PrintColorAdjustEconomy;
}
@@ -330,10 +330,10 @@ template<> inline CSSPrimitiveValue::operator CompositeOperator() const
return CompositePlusDarker;
case CSSValuePlusLighter:
return CompositePlusLighter;
- default:
- ASSERT_NOT_REACHED();
- return CompositeClear;
}
+
+ ASSERT_NOT_REACHED();
+ return CompositeClear;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ControlPart e)
@@ -553,10 +553,10 @@ template<> inline CSSPrimitiveValue::operator EBackfaceVisibility() const
return BackfaceVisibilityVisible;
case CSSValueHidden:
return BackfaceVisibilityHidden;
- default:
- ASSERT_NOT_REACHED();
- return BackfaceVisibilityHidden;
}
+
+ ASSERT_NOT_REACHED();
+ return BackfaceVisibilityHidden;
}
@@ -586,10 +586,10 @@ template<> inline CSSPrimitiveValue::operator EFillAttachment() const
return LocalBackgroundAttachment;
case CSSValueFixed:
return FixedBackgroundAttachment;
- default:
- ASSERT_NOT_REACHED();
- return ScrollBackgroundAttachment;
}
+
+ ASSERT_NOT_REACHED();
+ return ScrollBackgroundAttachment;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFillBox e)
@@ -627,10 +627,10 @@ template<> inline CSSPrimitiveValue::operator EFillBox() const
case CSSValueText:
case CSSValueWebkitText:
return TextFillBox;
- default:
- ASSERT_NOT_REACHED();
- return BorderFillBox;
}
+
+ ASSERT_NOT_REACHED();
+ return BorderFillBox;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFillRepeat e)
@@ -664,10 +664,10 @@ template<> inline CSSPrimitiveValue::operator EFillRepeat() const
return RoundFill;
case CSSValueSpace:
return SpaceFill;
- default:
- ASSERT_NOT_REACHED();
- return RepeatFill;
}
+
+ ASSERT_NOT_REACHED();
+ return RepeatFill;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxPack e)
@@ -701,10 +701,10 @@ template<> inline CSSPrimitiveValue::operator EBoxPack() const
return Center;
case CSSValueJustify:
return Justify;
- default:
- ASSERT_NOT_REACHED();
- return Justify;
}
+
+ ASSERT_NOT_REACHED();
+ return Justify;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxAlignment e)
@@ -743,10 +743,10 @@ template<> inline CSSPrimitiveValue::operator EBoxAlignment() const
return BCENTER;
case CSSValueBaseline:
return BBASELINE;
- default:
- ASSERT_NOT_REACHED();
- return BSTRETCH;
}
+
+ ASSERT_NOT_REACHED();
+ return BSTRETCH;
}
#if ENABLE(CSS_BOX_DECORATION_BREAK)
@@ -771,10 +771,10 @@ template<> inline CSSPrimitiveValue::operator EBoxDecorationBreak() const
return DSLICE;
case CSSValueClone:
return DCLONE;
- default:
- ASSERT_NOT_REACHED();
- return DSLICE;
}
+
+ ASSERT_NOT_REACHED();
+ return DSLICE;
}
#endif
@@ -799,10 +799,10 @@ template<> inline CSSPrimitiveValue::operator EBoxSizing() const
return BORDER_BOX;
case CSSValueContentBox:
return CONTENT_BOX;
- default:
- ASSERT_NOT_REACHED();
- return BORDER_BOX;
}
+
+ ASSERT_NOT_REACHED();
+ return BORDER_BOX;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxDirection e)
@@ -826,10 +826,10 @@ template<> inline CSSPrimitiveValue::operator EBoxDirection() const
return BNORMAL;
case CSSValueReverse:
return BREVERSE;
- default:
- ASSERT_NOT_REACHED();
- return BNORMAL;
}
+
+ ASSERT_NOT_REACHED();
+ return BNORMAL;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxLines e)
@@ -853,10 +853,10 @@ template<> inline CSSPrimitiveValue::operator EBoxLines() const
return SINGLE;
case CSSValueMultiple:
return MULTIPLE;
- default:
- ASSERT_NOT_REACHED();
- return SINGLE;
}
+
+ ASSERT_NOT_REACHED();
+ return SINGLE;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxOrient e)
@@ -882,10 +882,10 @@ template<> inline CSSPrimitiveValue::operator EBoxOrient() const
case CSSValueVertical:
case CSSValueBlockAxis:
return VERTICAL;
- default:
- ASSERT_NOT_REACHED();
- return HORIZONTAL;
}
+
+ ASSERT_NOT_REACHED();
+ return HORIZONTAL;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ECaptionSide e)
@@ -919,10 +919,10 @@ template<> inline CSSPrimitiveValue::operator ECaptionSide() const
return CAPTOP;
case CSSValueBottom:
return CAPBOTTOM;
- default:
- ASSERT_NOT_REACHED();
- return CAPTOP;
}
+
+ ASSERT_NOT_REACHED();
+ return CAPTOP;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EClear e)
@@ -956,10 +956,10 @@ template<> inline CSSPrimitiveValue::operator EClear() const
return CRIGHT;
case CSSValueBoth:
return CBOTH;
- default:
- ASSERT_NOT_REACHED();
- return CNONE;
}
+
+ ASSERT_NOT_REACHED();
+ return CNONE;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ECursor e)
@@ -1197,10 +1197,10 @@ template<> inline CSSPrimitiveValue::operator EEmptyCell() const
return SHOW;
case CSSValueHide:
return HIDE;
- default:
- ASSERT_NOT_REACHED();
- return SHOW;
}
+
+ ASSERT_NOT_REACHED();
+ return SHOW;
}
#if ENABLE(CSS3_FLEXBOX)
@@ -1246,10 +1246,10 @@ template<> inline CSSPrimitiveValue::operator EAlignItems() const
return AlignStretch;
case CSSValueBaseline:
return AlignBaseline;
- default:
- ASSERT_NOT_REACHED();
- return AlignFlexStart;
}
+
+ ASSERT_NOT_REACHED();
+ return AlignFlexStart;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EJustifyContent e)
@@ -1288,10 +1288,10 @@ template<> inline CSSPrimitiveValue::operator EJustifyContent() const
return JustifySpaceBetween;
case CSSValueSpaceAround:
return JustifySpaceAround;
- default:
- ASSERT_NOT_REACHED();
- return JustifyFlexStart;
}
+
+ ASSERT_NOT_REACHED();
+ return JustifyFlexStart;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFlexDirection e)
@@ -1325,10 +1325,10 @@ template<> inline CSSPrimitiveValue::operator EFlexDirection() const
return FlowColumn;
case CSSValueColumnReverse:
return FlowColumnReverse;
- default:
- ASSERT_NOT_REACHED();
- return FlowRow;
}
+
+ ASSERT_NOT_REACHED();
+ return FlowRow;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EAlignContent e)
@@ -1372,10 +1372,10 @@ template<> inline CSSPrimitiveValue::operator EAlignContent() const
return AlignContentSpaceAround;
case CSSValueStretch:
return AlignContentStretch;
- default:
- ASSERT_NOT_REACHED();
- return AlignContentStretch;
}
+
+ ASSERT_NOT_REACHED();
+ return AlignContentStretch;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFlexWrap e)
@@ -1404,10 +1404,10 @@ template<> inline CSSPrimitiveValue::operator EFlexWrap() const
return FlexWrap;
case CSSValueWrapReverse:
return FlexWrapReverse;
- default:
- ASSERT_NOT_REACHED();
- return FlexWrapNone;
}
+
+ ASSERT_NOT_REACHED();
+ return FlexWrapNone;
}
#endif
@@ -1439,10 +1439,10 @@ template<> inline CSSPrimitiveValue::operator EFloat() const
case CSSValueNone:
case CSSValueCenter: // Non-standard CSS value
return NoFloat;
- default:
- ASSERT_NOT_REACHED();
- return NoFloat;
}
+
+ ASSERT_NOT_REACHED();
+ return NoFloat;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EKHTMLLineBreak e)
@@ -1466,10 +1466,10 @@ template<> inline CSSPrimitiveValue::operator EKHTMLLineBreak() const
return AFTER_WHITE_SPACE;
case CSSValueNormal:
return LBNORMAL;
- default:
- ASSERT_NOT_REACHED();
- return LBNORMAL;
}
+
+ ASSERT_NOT_REACHED();
+ return LBNORMAL;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EListStylePosition e)
@@ -1493,10 +1493,10 @@ template<> inline CSSPrimitiveValue::operator EListStylePosition() const
return OUTSIDE;
case CSSValueInside:
return INSIDE;
- default:
- ASSERT_NOT_REACHED();
- return OUTSIDE;
}
+
+ ASSERT_NOT_REACHED();
+ return OUTSIDE;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EListStyleType e)
@@ -1786,10 +1786,10 @@ template<> inline CSSPrimitiveValue::operator EMarginCollapse() const
return MSEPARATE;
case CSSValueDiscard:
return MDISCARD;
- default:
- ASSERT_NOT_REACHED();
- return MCOLLAPSE;
}
+
+ ASSERT_NOT_REACHED();
+ return MCOLLAPSE;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMarqueeBehavior e)
@@ -1823,10 +1823,10 @@ template<> inline CSSPrimitiveValue::operator EMarqueeBehavior() const
return MSLIDE;
case CSSValueAlternate:
return MALTERNATE;
- default:
- ASSERT_NOT_REACHED();
- return MNONE;
}
+
+ ASSERT_NOT_REACHED();
+ return MNONE;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(RegionOverflow e)
@@ -1850,10 +1850,10 @@ template<> inline CSSPrimitiveValue::operator RegionOverflow() const
return AutoRegionOverflow;
case CSSValueBreak:
return BreakRegionOverflow;
- default:
- ASSERT_NOT_REACHED();
- return AutoRegionOverflow;
}
+
+ ASSERT_NOT_REACHED();
+ return AutoRegionOverflow;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMarqueeDirection e)
@@ -1904,10 +1904,10 @@ template<> inline CSSPrimitiveValue::operator EMarqueeDirection() const
return MLEFT;
case CSSValueRight:
return MRIGHT;
- default:
- ASSERT_NOT_REACHED();
- return MAUTO;
}
+
+ ASSERT_NOT_REACHED();
+ return MAUTO;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ENBSPMode e)
@@ -1931,10 +1931,10 @@ template<> inline CSSPrimitiveValue::operator ENBSPMode() const
return SPACE;
case CSSValueNormal:
return NBNORMAL;
- default:
- ASSERT_NOT_REACHED();
- return NBNORMAL;
}
+
+ ASSERT_NOT_REACHED();
+ return NBNORMAL;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EOverflow e)
@@ -1978,10 +1978,10 @@ template<> inline CSSPrimitiveValue::operator EOverflow() const
return OMARQUEE;
case CSSValueOverlay:
return OOVERLAY;
- default:
- ASSERT_NOT_REACHED();
- return OVISIBLE;
}
+
+ ASSERT_NOT_REACHED();
+ return OVISIBLE;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPageBreak e)
@@ -2012,10 +2012,10 @@ template<> inline CSSPrimitiveValue::operator EPageBreak() const
return PBALWAYS; // CSS2.1: "Conforming user agents may map left/right to always."
case CSSValueAvoid:
return PBAVOID;
- default:
- ASSERT_NOT_REACHED();
- return PBAUTO;
}
+
+ ASSERT_NOT_REACHED();
+ return PBAUTO;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPosition e)
@@ -2058,10 +2058,10 @@ template<> inline CSSPrimitiveValue::operator EPosition() const
case CSSValueWebkitSticky:
return StickyPosition;
#endif
- default:
- ASSERT_NOT_REACHED();
- return StaticPosition;
}
+
+ ASSERT_NOT_REACHED();
+ return StaticPosition;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EResize e)
@@ -2098,10 +2098,10 @@ template<> inline CSSPrimitiveValue::operator EResize() const
return RESIZE_NONE;
case CSSValueNone:
return RESIZE_NONE;
- default:
- ASSERT_NOT_REACHED();
- return RESIZE_NONE;
}
+
+ ASSERT_NOT_REACHED();
+ return RESIZE_NONE;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETableLayout e)
@@ -2125,10 +2125,10 @@ template<> inline CSSPrimitiveValue::operator ETableLayout() const
return TFIXED;
case CSSValueAuto:
return TAUTO;
- default:
- ASSERT_NOT_REACHED();
- return TAUTO;
}
+
+ ASSERT_NOT_REACHED();
+ return TAUTO;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextAlign e)
@@ -2192,11 +2192,32 @@ template<> inline CSSPrimitiveValue::operator ETextDecoration() const
return LINE_THROUGH;
case CSSValueBlink:
return BLINK;
- default:
- ASSERT_NOT_REACHED();
- return TDNONE;
}
+
+ ASSERT_NOT_REACHED();
+ return TDNONE;
+}
+
+#if ENABLE(CSS3_TEXT_DECORATION)
+template<> inline CSSPrimitiveValue::operator TextDecorationStyle() const
+{
+ switch (m_value.ident) {
+ case CSSValueSolid:
+ return TextDecorationStyleSolid;
+ case CSSValueDouble:
+ return TextDecorationStyleDouble;
+ case CSSValueDotted:
+ return TextDecorationStyleDotted;
+ case CSSValueDashed:
+ return TextDecorationStyleDashed;
+ case CSSValueWavy:
+ return TextDecorationStyleWavy;
+ }
+
+ ASSERT_NOT_REACHED();
+ return TextDecorationStyleSolid;
}
+#endif // CSS3_TEXT_DECORATION
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextSecurity e)
: CSSValue(PrimitiveClass)
@@ -2229,10 +2250,10 @@ template<> inline CSSPrimitiveValue::operator ETextSecurity() const
return TSCIRCLE;
case CSSValueSquare:
return TSSQUARE;
- default:
- ASSERT_NOT_REACHED();
- return TSNONE;
}
+
+ ASSERT_NOT_REACHED();
+ return TSNONE;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextTransform e)
@@ -2266,9 +2287,35 @@ template<> inline CSSPrimitiveValue::operator ETextTransform() const
return LOWERCASE;
case CSSValueNone:
return TTNONE;
- default:
- ASSERT_NOT_REACHED();
- return TTNONE;
+ }
+
+ ASSERT_NOT_REACHED();
+ return TTNONE;
+}
+
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUnicodeBidi e)
+ : CSSValue(PrimitiveClass)
+{
+ m_primitiveUnitType = CSS_IDENT;
+ switch (e) {
+ case UBNormal:
+ m_value.ident = CSSValueNormal;
+ break;
+ case Embed:
+ m_value.ident = CSSValueEmbed;
+ break;
+ case Override:
+ m_value.ident = CSSValueBidiOverride;
+ break;
+ case Isolate:
+ m_value.ident = CSSValueWebkitIsolate;
+ break;
+ case IsolateOverride:
+ m_value.ident = CSSValueWebkitIsolateOverride;
+ break;
+ case Plaintext:
+ m_value.ident = CSSValueWebkitPlaintext;
+ break;
}
}
@@ -2283,12 +2330,14 @@ template<> inline CSSPrimitiveValue::operator EUnicodeBidi() const
return Override;
case CSSValueWebkitIsolate:
return Isolate;
+ case CSSValueWebkitIsolateOverride:
+ return IsolateOverride;
case CSSValueWebkitPlaintext:
return Plaintext;
- default:
- ASSERT_NOT_REACHED();
- return UBNormal;
}
+
+ ASSERT_NOT_REACHED();
+ return UBNormal;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserDrag e)
@@ -2317,10 +2366,10 @@ template<> inline CSSPrimitiveValue::operator EUserDrag() const
return DRAG_NONE;
case CSSValueElement:
return DRAG_ELEMENT;
- default:
- ASSERT_NOT_REACHED();
- return DRAG_AUTO;
}
+
+ ASSERT_NOT_REACHED();
+ return DRAG_AUTO;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserModify e)
@@ -2349,10 +2398,10 @@ template<> inline CSSPrimitiveValue::operator EUserModify() const
return READ_WRITE;
case CSSValueReadWritePlaintextOnly:
return READ_WRITE_PLAINTEXT_ONLY;
- default:
- ASSERT_NOT_REACHED();
- return READ_ONLY;
}
+
+ ASSERT_NOT_REACHED();
+ return READ_ONLY;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserSelect e)
@@ -2383,10 +2432,10 @@ template<> inline CSSPrimitiveValue::operator EUserSelect() const
return SELECT_TEXT;
case CSSValueAll:
return SELECT_ALL;
- default:
- ASSERT_NOT_REACHED();
- return SELECT_TEXT;
}
+
+ ASSERT_NOT_REACHED();
+ return SELECT_TEXT;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EVerticalAlign a)
@@ -2447,10 +2496,10 @@ template<> inline CSSPrimitiveValue::operator EVerticalAlign() const
return SUPER;
case CSSValueWebkitBaselineMiddle:
return BASELINE_MIDDLE;
- default:
- ASSERT_NOT_REACHED();
- return TOP;
}
+
+ ASSERT_NOT_REACHED();
+ return TOP;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EVisibility e)
@@ -2479,10 +2528,10 @@ template<> inline CSSPrimitiveValue::operator EVisibility() const
return VISIBLE;
case CSSValueCollapse:
return COLLAPSE;
- default:
- ASSERT_NOT_REACHED();
- return VISIBLE;
}
+
+ ASSERT_NOT_REACHED();
+ return VISIBLE;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWhiteSpace e)
@@ -2526,10 +2575,10 @@ template<> inline CSSPrimitiveValue::operator EWhiteSpace() const
return PRE_LINE;
case CSSValueNormal:
return NORMAL;
- default:
- ASSERT_NOT_REACHED();
- return NORMAL;
}
+
+ ASSERT_NOT_REACHED();
+ return NORMAL;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWordBreak e)
@@ -2558,10 +2607,10 @@ template<> inline CSSPrimitiveValue::operator EWordBreak() const
return BreakWordBreak;
case CSSValueNormal:
return NormalWordBreak;
- default:
- ASSERT_NOT_REACHED();
- return NormalWordBreak;
}
+
+ ASSERT_NOT_REACHED();
+ return NormalWordBreak;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWordWrap e)
@@ -2585,10 +2634,10 @@ template<> inline CSSPrimitiveValue::operator EWordWrap() const
return BreakWordWrap;
case CSSValueNormal:
return NormalWordWrap;
- default:
- ASSERT_NOT_REACHED();
- return NormalWordWrap;
}
+
+ ASSERT_NOT_REACHED();
+ return NormalWordWrap;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextDirection e)
@@ -2612,10 +2661,10 @@ template<> inline CSSPrimitiveValue::operator TextDirection() const
return LTR;
case CSSValueRtl:
return RTL;
- default:
- ASSERT_NOT_REACHED();
- return LTR;
}
+
+ ASSERT_NOT_REACHED();
+ return LTR;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WritingMode e)
@@ -2649,10 +2698,10 @@ template<> inline CSSPrimitiveValue::operator WritingMode() const
return LeftToRightWritingMode;
case CSSValueHorizontalBt:
return BottomToTopWritingMode;
- default:
- ASSERT_NOT_REACHED();
- return TopToBottomWritingMode;
}
+
+ ASSERT_NOT_REACHED();
+ return TopToBottomWritingMode;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextCombine e)
@@ -2676,10 +2725,10 @@ template<> inline CSSPrimitiveValue::operator TextCombine() const
return TextCombineNone;
case CSSValueHorizontal:
return TextCombineHorizontal;
- default:
- ASSERT_NOT_REACHED();
- return TextCombineNone;
}
+
+ ASSERT_NOT_REACHED();
+ return TextCombineNone;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextEmphasisPosition position)
@@ -2703,10 +2752,10 @@ template<> inline CSSPrimitiveValue::operator TextEmphasisPosition() const
return TextEmphasisPositionOver;
case CSSValueUnder:
return TextEmphasisPositionUnder;
- default:
- ASSERT_NOT_REACHED();
- return TextEmphasisPositionOver;
}
+
+ ASSERT_NOT_REACHED();
+ return TextEmphasisPositionOver;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextOverflow overflow)
@@ -2730,10 +2779,10 @@ template<> inline CSSPrimitiveValue::operator TextOverflow() const
return TextOverflowClip;
case CSSValueEllipsis:
return TextOverflowEllipsis;
- default:
- ASSERT_NOT_REACHED();
- return TextOverflowClip;
}
+
+ ASSERT_NOT_REACHED();
+ return TextOverflowClip;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextEmphasisFill fill)
@@ -2757,10 +2806,10 @@ template<> inline CSSPrimitiveValue::operator TextEmphasisFill() const
return TextEmphasisFillFilled;
case CSSValueOpen:
return TextEmphasisFillOpen;
- default:
- ASSERT_NOT_REACHED();
- return TextEmphasisFillFilled;
}
+
+ ASSERT_NOT_REACHED();
+ return TextEmphasisFillFilled;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextEmphasisMark mark)
@@ -2807,10 +2856,10 @@ template<> inline CSSPrimitiveValue::operator TextEmphasisMark() const
return TextEmphasisMarkTriangle;
case CSSValueSesame:
return TextEmphasisMarkSesame;
- default:
- ASSERT_NOT_REACHED();
- return TextEmphasisMarkNone;
}
+
+ ASSERT_NOT_REACHED();
+ return TextEmphasisMarkNone;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextOrientation e)
@@ -2834,10 +2883,10 @@ template<> inline CSSPrimitiveValue::operator TextOrientation() const
return TextOrientationVerticalRight;
case CSSValueUpright:
return TextOrientationUpright;
- default:
- ASSERT_NOT_REACHED();
- return TextOrientationVerticalRight;
}
+
+ ASSERT_NOT_REACHED();
+ return TextOrientationVerticalRight;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPointerEvents e)
@@ -2901,10 +2950,10 @@ template<> inline CSSPrimitiveValue::operator EPointerEvents() const
return PE_FILL;
case CSSValueStroke:
return PE_STROKE;
- default:
- ASSERT_NOT_REACHED();
- return PE_ALL;
}
+
+ ASSERT_NOT_REACHED();
+ return PE_ALL;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontDescription::Kerning kerning)
@@ -3142,10 +3191,10 @@ template<> inline CSSPrimitiveValue::operator TextRenderingMode() const
return OptimizeLegibility;
case CSSValueGeometricprecision:
return GeometricPrecision;
- default:
- ASSERT_NOT_REACHED();
- return AutoTextRendering;
}
+
+ ASSERT_NOT_REACHED();
+ return AutoTextRendering;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColorSpace space)
@@ -3174,10 +3223,10 @@ template<> inline CSSPrimitiveValue::operator ColorSpace() const
return ColorSpaceDeviceRGB;
case CSSValueSrgb:
return ColorSpaceSRGB;
- default:
- ASSERT_NOT_REACHED();
- return ColorSpaceDeviceRGB;
}
+
+ ASSERT_NOT_REACHED();
+ return ColorSpaceDeviceRGB;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Hyphens hyphens)
@@ -3206,10 +3255,10 @@ template<> inline CSSPrimitiveValue::operator Hyphens() const
return HyphensManual;
case CSSValueAuto:
return HyphensAuto;
- default:
- ASSERT_NOT_REACHED();
- return HyphensAuto;
}
+
+ ASSERT_NOT_REACHED();
+ return HyphensAuto;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineSnap gridSnap)
@@ -3238,10 +3287,10 @@ template<> inline CSSPrimitiveValue::operator LineSnap() const
return LineSnapBaseline;
case CSSValueContain:
return LineSnapContain;
- default:
- ASSERT_NOT_REACHED();
- return LineSnapNone;
}
+
+ ASSERT_NOT_REACHED();
+ return LineSnapNone;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineAlign lineAlign)
@@ -3265,10 +3314,10 @@ template<> inline CSSPrimitiveValue::operator LineAlign() const
return LineAlignNone;
case CSSValueEdges:
return LineAlignEdges;
- default:
- ASSERT_NOT_REACHED();
- return LineAlignNone;
}
+
+ ASSERT_NOT_REACHED();
+ return LineAlignNone;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ESpeak e)
@@ -3304,10 +3353,10 @@ template<> inline CSSPrimitiveValue::operator Order() const
return LogicalOrder;
case CSSValueVisual:
return VisualOrder;
- default:
- ASSERT_NOT_REACHED();
- return LogicalOrder;
}
+
+ ASSERT_NOT_REACHED();
+ return LogicalOrder;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Order e)
@@ -3339,10 +3388,10 @@ template<> inline CSSPrimitiveValue::operator ESpeak() const
return SpeakLiteralPunctuation;
case CSSValueNoPunctuation:
return SpeakNoPunctuation;
- default:
- ASSERT_NOT_REACHED();
- return SpeakNormal;
}
+
+ ASSERT_NOT_REACHED();
+ return SpeakNormal;
}
#if ENABLE(CSS_SHADERS)
@@ -3377,10 +3426,10 @@ template<> inline CSSPrimitiveValue::operator CustomFilterOperation::MeshBoxType
return CustomFilterOperation::PADDING_BOX;
case CSSValueContentBox:
return CustomFilterOperation::CONTENT_BOX;
- default:
- ASSERT_NOT_REACHED();
- return CustomFilterOperation::FILTER_BOX;
}
+
+ ASSERT_NOT_REACHED();
+ return CustomFilterOperation::FILTER_BOX;
}
#endif // ENABLE(CSS_SHADERS)
@@ -3475,10 +3524,10 @@ template<> inline CSSPrimitiveValue::operator BlendMode() const
return BlendModeColor;
case CSSValueLuminosity:
return BlendModeLuminosity;
- default:
- ASSERT_NOT_REACHED();
- return BlendModeNormal;
}
+
+ ASSERT_NOT_REACHED();
+ return BlendModeNormal;
}
#if ENABLE(SVG)
@@ -3509,10 +3558,10 @@ template<> inline CSSPrimitiveValue::operator LineCap() const
return RoundCap;
case CSSValueSquare:
return SquareCap;
- default:
- ASSERT_NOT_REACHED();
- return ButtCap;
}
+
+ ASSERT_NOT_REACHED();
+ return ButtCap;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineJoin e)
@@ -3541,10 +3590,10 @@ template<> inline CSSPrimitiveValue::operator LineJoin() const
return RoundJoin;
case CSSValueBevel:
return BevelJoin;
- default:
- ASSERT_NOT_REACHED();
- return MiterJoin;
}
+
+ ASSERT_NOT_REACHED();
+ return MiterJoin;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WindRule e)
@@ -3568,10 +3617,10 @@ template<> inline CSSPrimitiveValue::operator WindRule() const
return RULE_NONZERO;
case CSSValueEvenodd:
return RULE_EVENODD;
- default:
- ASSERT_NOT_REACHED();
- return RULE_NONZERO;
}
+
+ ASSERT_NOT_REACHED();
+ return RULE_NONZERO;
}
@@ -3646,10 +3695,10 @@ template<> inline CSSPrimitiveValue::operator EAlignmentBaseline() const
return AB_HANGING;
case CSSValueMathematical:
return AB_MATHEMATICAL;
- default:
- ASSERT_NOT_REACHED();
- return AB_AUTO;
}
+
+ ASSERT_NOT_REACHED();
+ return AB_AUTO;
}
#endif
@@ -3675,10 +3724,10 @@ template<> inline CSSPrimitiveValue::operator EBorderCollapse() const
return BSEPARATE;
case CSSValueCollapse:
return BCOLLAPSE;
- default:
- ASSERT_NOT_REACHED();
- return BSEPARATE;
}
+
+ ASSERT_NOT_REACHED();
+ return BSEPARATE;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBorderFit e)
@@ -3702,10 +3751,10 @@ template<> inline CSSPrimitiveValue::operator EBorderFit() const
return BorderFitBorder;
case CSSValueLines:
return BorderFitLines;
- default:
- ASSERT_NOT_REACHED();
- return BorderFitLines;
}
+
+ ASSERT_NOT_REACHED();
+ return BorderFitLines;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EImageRendering e)
@@ -3739,10 +3788,10 @@ template<> inline CSSPrimitiveValue::operator EImageRendering() const
return ImageRenderingOptimizeQuality;
case CSSValueWebkitOptimizeContrast:
return ImageRenderingOptimizeContrast;
- default:
- ASSERT_NOT_REACHED();
- return ImageRenderingAuto;
}
+
+ ASSERT_NOT_REACHED();
+ return ImageRenderingAuto;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETransformStyle3D e)
@@ -3766,10 +3815,10 @@ template<> inline CSSPrimitiveValue::operator ETransformStyle3D() const
return TransformStyle3DFlat;
case CSSValuePreserve3d:
return TransformStyle3DPreserve3D;
- default:
- ASSERT_NOT_REACHED();
- return TransformStyle3DFlat;
}
+
+ ASSERT_NOT_REACHED();
+ return TransformStyle3DFlat;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColumnAxis e)
@@ -3798,10 +3847,10 @@ template<> inline CSSPrimitiveValue::operator ColumnAxis() const
return VerticalColumnAxis;
case CSSValueAuto:
return AutoColumnAxis;
- default:
- ASSERT_NOT_REACHED();
- return AutoColumnAxis;
}
+
+ ASSERT_NOT_REACHED();
+ return AutoColumnAxis;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColumnProgression e)
@@ -3825,10 +3874,10 @@ template<> inline CSSPrimitiveValue::operator ColumnProgression() const
return NormalColumnProgression;
case CSSValueReverse:
return ReverseColumnProgression;
- default:
- ASSERT_NOT_REACHED();
- return NormalColumnProgression;
}
+
+ ASSERT_NOT_REACHED();
+ return NormalColumnProgression;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WrapFlow wrapFlow)
@@ -3872,10 +3921,10 @@ template<> inline CSSPrimitiveValue::operator WrapFlow() const
return WrapFlowMaximum;
case CSSValueClear:
return WrapFlowClear;
- default:
- ASSERT_NOT_REACHED();
- return WrapFlowAuto;
}
+
+ ASSERT_NOT_REACHED();
+ return WrapFlowAuto;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WrapThrough wrapThrough)
@@ -3899,10 +3948,10 @@ template<> inline CSSPrimitiveValue::operator WrapThrough() const
return WrapThroughWrap;
case CSSValueNone:
return WrapThroughNone;
- default:
- ASSERT_NOT_REACHED();
- return WrapThroughWrap;
}
+
+ ASSERT_NOT_REACHED();
+ return WrapThroughWrap;
}
enum LengthConversion {
@@ -3965,10 +4014,10 @@ template<> inline CSSPrimitiveValue::operator EColorInterpolation() const
return CI_LINEARRGB;
case CSSValueAuto:
return CI_AUTO;
- default:
- ASSERT_NOT_REACHED();
- return CI_AUTO;
}
+
+ ASSERT_NOT_REACHED();
+ return CI_AUTO;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EColorRendering e)
@@ -3997,10 +4046,10 @@ template<> inline CSSPrimitiveValue::operator EColorRendering() const
return CR_OPTIMIZEQUALITY;
case CSSValueAuto:
return CR_AUTO;
- default:
- ASSERT_NOT_REACHED();
- return CR_AUTO;
}
+
+ ASSERT_NOT_REACHED();
+ return CR_AUTO;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EDominantBaseline e)
@@ -4074,10 +4123,10 @@ template<> inline CSSPrimitiveValue::operator EDominantBaseline() const
return DB_TEXT_AFTER_EDGE;
case CSSValueTextBeforeEdge:
return DB_TEXT_BEFORE_EDGE;
- default:
- ASSERT_NOT_REACHED();
- return DB_AUTO;
}
+
+ ASSERT_NOT_REACHED();
+ return DB_AUTO;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EShapeRendering e)
@@ -4111,10 +4160,10 @@ template<> inline CSSPrimitiveValue::operator EShapeRendering() const
return SR_CRISPEDGES;
case CSSValueGeometricprecision:
return SR_GEOMETRICPRECISION;
- default:
- ASSERT_NOT_REACHED();
- return SR_AUTO;
}
+
+ ASSERT_NOT_REACHED();
+ return SR_AUTO;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextAnchor e)
@@ -4143,10 +4192,10 @@ template<> inline CSSPrimitiveValue::operator ETextAnchor() const
return TA_MIDDLE;
case CSSValueEnd:
return TA_END;
- default:
- ASSERT_NOT_REACHED();
- return TA_START;
}
+
+ ASSERT_NOT_REACHED();
+ return TA_START;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(SVGWritingMode e)
@@ -4190,10 +4239,10 @@ template<> inline CSSPrimitiveValue::operator SVGWritingMode() const
return WM_TBRL;
case CSSValueTb:
return WM_TB;
- default:
- ASSERT_NOT_REACHED();
- return WM_LRTB;
}
+
+ ASSERT_NOT_REACHED();
+ return WM_LRTB;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EVectorEffect e)
@@ -4217,10 +4266,10 @@ template<> inline CSSPrimitiveValue::operator EVectorEffect() const
return VE_NONE;
case CSSValueNonScalingStroke:
return VE_NON_SCALING_STROKE;
- default:
- ASSERT_NOT_REACHED();
- return VE_NONE;
}
+
+ ASSERT_NOT_REACHED();
+ return VE_NONE;
}
#endif // ENABLE(SVG)
@@ -4266,10 +4315,10 @@ template<> inline CSSPrimitiveValue::operator ImageOrientationEnum() const
return OriginBottomRight;
case 3:
return OriginLeftBottom;
- default:
- ASSERT_NOT_REACHED();
- return OriginTopLeft;
}
+
+ ASSERT_NOT_REACHED();
+ return OriginTopLeft;
}
#endif // ENABLE(CSS_IMAGE_ORIENTATION)
diff --git a/Source/WebCore/css/CSSProperty.cpp b/Source/WebCore/css/CSSProperty.cpp
index 0b87cea30..9bc8966c1 100644
--- a/Source/WebCore/css/CSSProperty.cpp
+++ b/Source/WebCore/css/CSSProperty.cpp
@@ -48,7 +48,7 @@ String CSSProperty::cssName() const
return "-webkit-var-" + static_cast<CSSVariableValue*>(value())->name();
}
#endif
- return String(getPropertyName(id()));
+ return getPropertyNameString(id());
}
String CSSProperty::cssText() const
@@ -340,7 +340,9 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID)
case CSSPropertyWebkitPrintColorAdjust:
case CSSPropertyWebkitRtlOrdering:
case CSSPropertyWebkitTextCombine:
+#if ENABLE(CSS3_TEXT_DECORATION)
case CSSPropertyWebkitTextDecorationLine:
+#endif // CSS3_TEXT_DECORATION
case CSSPropertyWebkitTextDecorationsInEffect:
case CSSPropertyWebkitTextEmphasis:
case CSSPropertyWebkitTextEmphasisColor:
@@ -567,6 +569,9 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID)
#if ENABLE(CSS_FILTERS)
case CSSPropertyWebkitFilter:
#endif
+#if ENABLE(CSS_COMPOSITING)
+ case CSSPropertyWebkitBlendMode:
+#endif
#if ENABLE(CSS3_FLEXBOX)
case CSSPropertyWebkitAlignContent:
case CSSPropertyWebkitAlignItems:
@@ -635,6 +640,9 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID)
case CSSPropertyWebkitPerspectiveOrigin:
case CSSPropertyWebkitPerspectiveOriginX:
case CSSPropertyWebkitPerspectiveOriginY:
+#if ENABLE(CSS3_TEXT_DECORATION)
+ case CSSPropertyWebkitTextDecorationStyle:
+#endif // CSS3_TEXT_DECORATION
case CSSPropertyWebkitTransform:
case CSSPropertyWebkitTransformOrigin:
case CSSPropertyWebkitTransformOriginX:
diff --git a/Source/WebCore/css/CSSPropertyNames.in b/Source/WebCore/css/CSSPropertyNames.in
index 0ee20df2b..685f350ad 100644
--- a/Source/WebCore/css/CSSPropertyNames.in
+++ b/Source/WebCore/css/CSSPropertyNames.in
@@ -266,6 +266,9 @@ z-index
#if defined(ENABLE_CSS_FILTERS) && ENABLE_CSS_FILTERS
-webkit-filter
#endif
+#if defined(ENABLE_CSS_COMPOSITING) && ENABLE_CSS_COMPOSITING
+-webkit-blend-mode
+#endif
#if defined(ENABLE_CSS3_FLEXBOX) && ENABLE_CSS3_FLEXBOX
-webkit-align-content
-webkit-align-items
@@ -351,7 +354,10 @@ z-index
-webkit-rtl-ordering
-webkit-text-combine
-epub-text-combine = -webkit-text-combine
+#if defined(ENABLE_CSS3_TEXT_DECORATION) && ENABLE_CSS3_TEXT_DECORATION
-webkit-text-decoration-line
+-webkit-text-decoration-style
+#endif
-webkit-text-decorations-in-effect
-webkit-text-emphasis
-epub-text-emphasis = -webkit-text-emphasis
diff --git a/Source/WebCore/css/CSSSelector.cpp b/Source/WebCore/css/CSSSelector.cpp
index 13479b640..eabee493a 100644
--- a/Source/WebCore/css/CSSSelector.cpp
+++ b/Source/WebCore/css/CSSSelector.cpp
@@ -217,79 +217,79 @@ PseudoId CSSSelector::pseudoId(PseudoType type)
static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap()
{
- DEFINE_STATIC_LOCAL(AtomicString, active, ("active"));
- DEFINE_STATIC_LOCAL(AtomicString, after, ("after"));
- DEFINE_STATIC_LOCAL(AtomicString, any, ("-webkit-any("));
- DEFINE_STATIC_LOCAL(AtomicString, anyLink, ("-webkit-any-link"));
- DEFINE_STATIC_LOCAL(AtomicString, autofill, ("-webkit-autofill"));
- DEFINE_STATIC_LOCAL(AtomicString, before, ("before"));
- DEFINE_STATIC_LOCAL(AtomicString, checked, ("checked"));
- DEFINE_STATIC_LOCAL(AtomicString, defaultString, ("default"));
- DEFINE_STATIC_LOCAL(AtomicString, disabled, ("disabled"));
- DEFINE_STATIC_LOCAL(AtomicString, readOnly, ("read-only"));
- DEFINE_STATIC_LOCAL(AtomicString, readWrite, ("read-write"));
- DEFINE_STATIC_LOCAL(AtomicString, valid, ("valid"));
- DEFINE_STATIC_LOCAL(AtomicString, invalid, ("invalid"));
- DEFINE_STATIC_LOCAL(AtomicString, drag, ("-webkit-drag"));
- DEFINE_STATIC_LOCAL(AtomicString, dragAlias, ("-khtml-drag")); // was documented with this name in Apple documentation, so keep an alia
- DEFINE_STATIC_LOCAL(AtomicString, empty, ("empty"));
- DEFINE_STATIC_LOCAL(AtomicString, enabled, ("enabled"));
- DEFINE_STATIC_LOCAL(AtomicString, firstChild, ("first-child"));
- DEFINE_STATIC_LOCAL(AtomicString, firstLetter, ("first-letter"));
- DEFINE_STATIC_LOCAL(AtomicString, firstLine, ("first-line"));
- DEFINE_STATIC_LOCAL(AtomicString, firstOfType, ("first-of-type"));
- DEFINE_STATIC_LOCAL(AtomicString, fullPageMedia, ("-webkit-full-page-media"));
- DEFINE_STATIC_LOCAL(AtomicString, nthChild, ("nth-child("));
- DEFINE_STATIC_LOCAL(AtomicString, nthOfType, ("nth-of-type("));
- DEFINE_STATIC_LOCAL(AtomicString, nthLastChild, ("nth-last-child("));
- DEFINE_STATIC_LOCAL(AtomicString, nthLastOfType, ("nth-last-of-type("));
- DEFINE_STATIC_LOCAL(AtomicString, focus, ("focus"));
- DEFINE_STATIC_LOCAL(AtomicString, hover, ("hover"));
- DEFINE_STATIC_LOCAL(AtomicString, indeterminate, ("indeterminate"));
- DEFINE_STATIC_LOCAL(AtomicString, lastChild, ("last-child"));
- DEFINE_STATIC_LOCAL(AtomicString, lastOfType, ("last-of-type"));
- DEFINE_STATIC_LOCAL(AtomicString, link, ("link"));
- DEFINE_STATIC_LOCAL(AtomicString, lang, ("lang("));
- DEFINE_STATIC_LOCAL(AtomicString, notStr, ("not("));
- DEFINE_STATIC_LOCAL(AtomicString, onlyChild, ("only-child"));
- DEFINE_STATIC_LOCAL(AtomicString, onlyOfType, ("only-of-type"));
- DEFINE_STATIC_LOCAL(AtomicString, optional, ("optional"));
- DEFINE_STATIC_LOCAL(AtomicString, required, ("required"));
- DEFINE_STATIC_LOCAL(AtomicString, resizer, ("-webkit-resizer"));
- DEFINE_STATIC_LOCAL(AtomicString, root, ("root"));
- DEFINE_STATIC_LOCAL(AtomicString, scrollbar, ("-webkit-scrollbar"));
- DEFINE_STATIC_LOCAL(AtomicString, scrollbarButton, ("-webkit-scrollbar-button"));
- DEFINE_STATIC_LOCAL(AtomicString, scrollbarCorner, ("-webkit-scrollbar-corner"));
- DEFINE_STATIC_LOCAL(AtomicString, scrollbarThumb, ("-webkit-scrollbar-thumb"));
- DEFINE_STATIC_LOCAL(AtomicString, scrollbarTrack, ("-webkit-scrollbar-track"));
- DEFINE_STATIC_LOCAL(AtomicString, scrollbarTrackPiece, ("-webkit-scrollbar-track-piece"));
- DEFINE_STATIC_LOCAL(AtomicString, selection, ("selection"));
- DEFINE_STATIC_LOCAL(AtomicString, scope, ("scope"));
- DEFINE_STATIC_LOCAL(AtomicString, target, ("target"));
- DEFINE_STATIC_LOCAL(AtomicString, visited, ("visited"));
- DEFINE_STATIC_LOCAL(AtomicString, windowInactive, ("window-inactive"));
- DEFINE_STATIC_LOCAL(AtomicString, decrement, ("decrement"));
- DEFINE_STATIC_LOCAL(AtomicString, increment, ("increment"));
- DEFINE_STATIC_LOCAL(AtomicString, start, ("start"));
- DEFINE_STATIC_LOCAL(AtomicString, end, ("end"));
- DEFINE_STATIC_LOCAL(AtomicString, horizontal, ("horizontal"));
- DEFINE_STATIC_LOCAL(AtomicString, vertical, ("vertical"));
- DEFINE_STATIC_LOCAL(AtomicString, doubleButton, ("double-button"));
- DEFINE_STATIC_LOCAL(AtomicString, singleButton, ("single-button"));
- DEFINE_STATIC_LOCAL(AtomicString, noButton, ("no-button"));
- DEFINE_STATIC_LOCAL(AtomicString, cornerPresent, ("corner-present"));
+ DEFINE_STATIC_LOCAL(AtomicString, active, ("active", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, after, ("after", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, any, ("-webkit-any(", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, anyLink, ("-webkit-any-link", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, autofill, ("-webkit-autofill", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, before, ("before", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, checked, ("checked", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, defaultString, ("default", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, disabled, ("disabled", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, readOnly, ("read-only", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, readWrite, ("read-write", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, valid, ("valid", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, invalid, ("invalid", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, drag, ("-webkit-drag", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, dragAlias, ("-khtml-drag", AtomicString::ConstructFromLiteral)); // was documented with this name in Apple documentation, so keep an alia
+ DEFINE_STATIC_LOCAL(AtomicString, empty, ("empty", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, enabled, ("enabled", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, firstChild, ("first-child", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, firstLetter, ("first-letter", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, firstLine, ("first-line", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, firstOfType, ("first-of-type", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, fullPageMedia, ("-webkit-full-page-media", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, nthChild, ("nth-child(", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, nthOfType, ("nth-of-type(", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, nthLastChild, ("nth-last-child(", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, nthLastOfType, ("nth-last-of-type(", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, focus, ("focus", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, hover, ("hover", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, indeterminate, ("indeterminate", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, lastChild, ("last-child", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, lastOfType, ("last-of-type", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, link, ("link", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, lang, ("lang(", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, notStr, ("not(", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, onlyChild, ("only-child", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, onlyOfType, ("only-of-type", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, optional, ("optional", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, required, ("required", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, resizer, ("-webkit-resizer", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, root, ("root", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, scrollbar, ("-webkit-scrollbar", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, scrollbarButton, ("-webkit-scrollbar-button", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, scrollbarCorner, ("-webkit-scrollbar-corner", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, scrollbarThumb, ("-webkit-scrollbar-thumb", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, scrollbarTrack, ("-webkit-scrollbar-track", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, scrollbarTrackPiece, ("-webkit-scrollbar-track-piece", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, selection, ("selection", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, scope, ("scope", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, target, ("target", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, visited, ("visited", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, windowInactive, ("window-inactive", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, decrement, ("decrement", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, increment, ("increment", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, start, ("start", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, end, ("end", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, horizontal, ("horizontal", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, vertical, ("vertical", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, doubleButton, ("double-button", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, singleButton, ("single-button", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, noButton, ("no-button", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, cornerPresent, ("corner-present", AtomicString::ConstructFromLiteral));
// Paged Media pseudo-classes
- DEFINE_STATIC_LOCAL(AtomicString, firstPage, ("first"));
- DEFINE_STATIC_LOCAL(AtomicString, leftPage, ("left"));
- DEFINE_STATIC_LOCAL(AtomicString, rightPage, ("right"));
+ DEFINE_STATIC_LOCAL(AtomicString, firstPage, ("first", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, leftPage, ("left", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, rightPage, ("right", AtomicString::ConstructFromLiteral));
#if ENABLE(FULLSCREEN_API)
- DEFINE_STATIC_LOCAL(AtomicString, fullScreen, ("-webkit-full-screen"));
- DEFINE_STATIC_LOCAL(AtomicString, fullScreenDocument, ("-webkit-full-screen-document"));
- DEFINE_STATIC_LOCAL(AtomicString, fullScreenAncestor, ("-webkit-full-screen-ancestor"));
- DEFINE_STATIC_LOCAL(AtomicString, animatingFullScreenTransition, ("-webkit-animating-full-screen-transition"));
+ DEFINE_STATIC_LOCAL(AtomicString, fullScreen, ("-webkit-full-screen", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, fullScreenDocument, ("-webkit-full-screen-document", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, fullScreenAncestor, ("-webkit-full-screen-ancestor", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, animatingFullScreenTransition, ("-webkit-animating-full-screen-transition", AtomicString::ConstructFromLiteral));
#endif
- DEFINE_STATIC_LOCAL(AtomicString, inRange, ("in-range"));
- DEFINE_STATIC_LOCAL(AtomicString, outOfRange, ("out-of-range"));
+ DEFINE_STATIC_LOCAL(AtomicString, inRange, ("in-range", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, outOfRange, ("out-of-range", AtomicString::ConstructFromLiteral));
static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoType = 0;
if (!nameToPseudoType) {
diff --git a/Source/WebCore/css/CSSStyleSheet.cpp b/Source/WebCore/css/CSSStyleSheet.cpp
index 523a895f5..f16f8bbb3 100644
--- a/Source/WebCore/css/CSSStyleSheet.cpp
+++ b/Source/WebCore/css/CSSStyleSheet.cpp
@@ -85,18 +85,19 @@ PassRefPtr<CSSStyleSheet> CSSStyleSheet::create(PassRefPtr<StyleSheetContents> s
PassRefPtr<CSSStyleSheet> CSSStyleSheet::create(PassRefPtr<StyleSheetContents> sheet, Node* ownerNode)
{
- return adoptRef(new CSSStyleSheet(sheet, ownerNode));
+ return adoptRef(new CSSStyleSheet(sheet, ownerNode, false));
}
PassRefPtr<CSSStyleSheet> CSSStyleSheet::createInline(Node* ownerNode, const KURL& baseURL, const String& encoding)
{
CSSParserContext parserContext(ownerNode->document(), baseURL, encoding);
- RefPtr<StyleSheetContents> sheet = StyleSheetContents::create(baseURL.string(), baseURL, parserContext);
- return adoptRef(new CSSStyleSheet(sheet.release(), ownerNode));
+ RefPtr<StyleSheetContents> sheet = StyleSheetContents::create(baseURL.string(), parserContext);
+ return adoptRef(new CSSStyleSheet(sheet.release(), ownerNode, true));
}
CSSStyleSheet::CSSStyleSheet(PassRefPtr<StyleSheetContents> contents, CSSImportRule* ownerRule)
: m_contents(contents)
+ , m_isInlineStylesheet(false)
, m_isDisabled(false)
, m_ownerNode(0)
, m_ownerRule(ownerRule)
@@ -104,8 +105,9 @@ CSSStyleSheet::CSSStyleSheet(PassRefPtr<StyleSheetContents> contents, CSSImportR
m_contents->registerClient(this);
}
-CSSStyleSheet::CSSStyleSheet(PassRefPtr<StyleSheetContents> contents, Node* ownerNode)
+CSSStyleSheet::CSSStyleSheet(PassRefPtr<StyleSheetContents> contents, Node* ownerNode, bool isInlineStylesheet)
: m_contents(contents)
+ , m_isInlineStylesheet(isInlineStylesheet)
, m_isDisabled(false)
, m_ownerNode(ownerNode)
, m_ownerRule(0)
@@ -227,11 +229,24 @@ CSSRule* CSSStyleSheet::item(unsigned index)
return cssRule.get();
}
-PassRefPtr<CSSRuleList> CSSStyleSheet::rules()
+bool CSSStyleSheet::canAccessRules() const
{
- KURL url = m_contents->finalURL();
+ if (m_isInlineStylesheet)
+ return true;
+ KURL baseURL = m_contents->baseURL();
+ if (baseURL.isEmpty())
+ return true;
Document* document = ownerDocument();
- if (!url.isEmpty() && document && !document->securityOrigin()->canRequest(url))
+ if (!document)
+ return true;
+ if (document->securityOrigin()->canRequest(baseURL))
+ return true;
+ return false;
+}
+
+PassRefPtr<CSSRuleList> CSSStyleSheet::rules()
+{
+ if (!canAccessRules())
return 0;
// IE behavior.
RefPtr<StaticCSSRuleList> nonCharsetRules = StaticCSSRuleList::create();
@@ -310,9 +325,7 @@ int CSSStyleSheet::addRule(const String& selector, const String& style, Exceptio
PassRefPtr<CSSRuleList> CSSStyleSheet::cssRules()
{
- KURL url = m_contents->finalURL();
- Document* document = ownerDocument();
- if (!url.isEmpty() && document && !document->securityOrigin()->canRequest(url))
+ if (!canAccessRules())
return 0;
if (!m_ruleListCSSOMWrapper)
m_ruleListCSSOMWrapper = adoptPtr(new StyleSheetCSSRuleList(this));
diff --git a/Source/WebCore/css/CSSStyleSheet.h b/Source/WebCore/css/CSSStyleSheet.h
index f38472dca..44915140c 100644
--- a/Source/WebCore/css/CSSStyleSheet.h
+++ b/Source/WebCore/css/CSSStyleSheet.h
@@ -110,12 +110,15 @@ public:
private:
CSSStyleSheet(PassRefPtr<StyleSheetContents>, CSSImportRule* ownerRule);
- CSSStyleSheet(PassRefPtr<StyleSheetContents>, Node* ownerNode);
+ CSSStyleSheet(PassRefPtr<StyleSheetContents>, Node* ownerNode, bool isInlineStylesheet);
virtual bool isCSSStyleSheet() const { return true; }
virtual String type() const { return "text/css"; }
+
+ bool canAccessRules() const;
RefPtr<StyleSheetContents> m_contents;
+ bool m_isInlineStylesheet;
bool m_isDisabled;
String m_title;
RefPtr<MediaQuerySet> m_mediaQueries;
diff --git a/Source/WebCore/css/CSSValueKeywords.in b/Source/WebCore/css/CSSValueKeywords.in
index 4af25f80c..853c77fc9 100644
--- a/Source/WebCore/css/CSSValueKeywords.in
+++ b/Source/WebCore/css/CSSValueKeywords.in
@@ -422,6 +422,7 @@ hide
higher
invert
-webkit-isolate
+-webkit-isolate-override
-webkit-plaintext
landscape
ledger
@@ -452,6 +453,9 @@ static
thick
thin
underline
+#if defined(ENABLE_CSS3_TEXT_DECORATION) && ENABLE_CSS3_TEXT_DECORATION
+wavy
+#endif
-webkit-nowrap
// CSS3 Values
@@ -926,7 +930,7 @@ edges
coarse
fine
-#if defined(ENABLE_CSS_FILTERS) && ENABLE_CSS_FILTERS
+#if (defined(ENABLE_CSS_FILTERS) && ENABLE_CSS_FILTERS) || (defined(ENABLE_CSS_COMPOSITING) && ENABLE_CSS_COMPOSITING)
// -webkit-filter
#if defined(ENABLE_CSS_SHADERS) && ENABLE_CSS_SHADERS
// values for the custom() function
diff --git a/Source/WebCore/css/CSSValueList.cpp b/Source/WebCore/css/CSSValueList.cpp
index 0b7ac7380..b120fa242 100644
--- a/Source/WebCore/css/CSSValueList.cpp
+++ b/Source/WebCore/css/CSSValueList.cpp
@@ -41,27 +41,17 @@ CSSValueList::CSSValueList(ValueListSeparator listSeparator)
m_valueListSeparator = listSeparator;
}
-CSSValueList::CSSValueList(CSSParserValueList* list)
+CSSValueList::CSSValueList(CSSParserValueList* parserValues)
: CSSValue(ValueListClass)
{
m_valueListSeparator = SpaceSeparator;
- if (list) {
- size_t size = list->size();
- for (unsigned i = 0; i < size; ++i)
- append(list->valueAt(i)->createCSSValue());
+ if (parserValues) {
+ m_values.reserveInitialCapacity(parserValues->size());
+ for (unsigned i = 0; i < parserValues->size(); ++i)
+ m_values.uncheckedAppend(parserValues->valueAt(i)->createCSSValue());
}
}
-void CSSValueList::append(PassRefPtr<CSSValue> val)
-{
- m_values.append(val);
-}
-
-void CSSValueList::prepend(PassRefPtr<CSSValue> val)
-{
- m_values.prepend(val);
-}
-
bool CSSValueList::removeAll(CSSValue* val)
{
bool found = false;
diff --git a/Source/WebCore/css/CSSValueList.h b/Source/WebCore/css/CSSValueList.h
index e988d6c2e..e6a9ebdc3 100644
--- a/Source/WebCore/css/CSSValueList.h
+++ b/Source/WebCore/css/CSSValueList.h
@@ -52,8 +52,8 @@ public:
CSSValue* item(size_t index) { return index < m_values.size() ? m_values[index].get() : 0; }
CSSValue* itemWithoutBoundsCheck(size_t index) { return m_values[index].get(); }
- void append(PassRefPtr<CSSValue>);
- void prepend(PassRefPtr<CSSValue>);
+ void append(PassRefPtr<CSSValue> value) { m_values.append(value); }
+ void prepend(PassRefPtr<CSSValue> value) { m_values.prepend(value); }
bool removeAll(CSSValue*);
bool hasValue(CSSValue*) const;
PassRefPtr<CSSValueList> copy();
diff --git a/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp b/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp
index 0c555804e..dee9ad345 100644
--- a/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp
+++ b/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp
@@ -127,7 +127,7 @@ void PropertySetCSSStyleDeclaration::ref()
}
void PropertySetCSSStyleDeclaration::deref()
-{
+{
m_propertySet->deref();
}
@@ -148,7 +148,7 @@ String PropertySetCSSStyleDeclaration::item(unsigned i) const
{
if (i >= m_propertySet->propertyCount())
return "";
- return getPropertyName(m_propertySet->propertyAt(i).id());
+ return m_propertySet->propertyAt(i).cssName();
}
String PropertySetCSSStyleDeclaration::cssText() const
@@ -206,7 +206,7 @@ String PropertySetCSSStyleDeclaration::getPropertyShorthand(const String& proper
CSSPropertyID shorthandID = m_propertySet->getPropertyShorthand(propertyID);
if (!shorthandID)
return String();
- return getPropertyName(shorthandID);
+ return getPropertyNameString(shorthandID);
}
bool PropertySetCSSStyleDeclaration::isPropertyImplicit(const String& propertyName)
diff --git a/Source/WebCore/css/StyleBuilder.cpp b/Source/WebCore/css/StyleBuilder.cpp
index 25c134990..486a4dbb8 100644
--- a/Source/WebCore/css/StyleBuilder.cpp
+++ b/Source/WebCore/css/StyleBuilder.cpp
@@ -45,7 +45,6 @@
#include <wtf/UnusedParam.h>
#if ENABLE(CSS_EXCLUSIONS)
-#include "CSSWrapShapes.h"
#include "WrapShapeFunctions.h"
#include "WrapShapes.h"
#endif
@@ -720,7 +719,7 @@ public:
bool parentIsAbsoluteSize = false;
float size = 0;
- if (styleResolver->hasParentNode()) {
+ if (styleResolver->parentStyle()) {
parentSize = styleResolver->parentStyle()->fontDescription().specifiedSize();
parentIsAbsoluteSize = styleResolver->parentStyle()->fontDescription().isAbsoluteSize();
}
@@ -1171,36 +1170,6 @@ public:
}
};
-class ApplyPropertyUnicodeBidi {
-public:
- static void applyValue(StyleResolver* styleResolver, CSSValue* value)
- {
- if (value->isValueList()) {
- EUnicodeBidi rendererUnicodeBidi = RenderStyle::initialUnicodeBidi();
- for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
- CSSValue* item = i.value();
- ASSERT(item->isPrimitiveValue());
- EUnicodeBidi currentValue = *static_cast<CSSPrimitiveValue*>(item);
- ASSERT(currentValue == Override || currentValue == Isolate);
- if (currentValue != rendererUnicodeBidi && rendererUnicodeBidi != RenderStyle::initialUnicodeBidi())
- rendererUnicodeBidi = OverrideIsolate;
- else
- rendererUnicodeBidi = currentValue;
- }
- styleResolver->style()->setUnicodeBidi(rendererUnicodeBidi);
- }
- if (!value->isPrimitiveValue())
- return;
- CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
- styleResolver->style()->setUnicodeBidi(*primitiveValue);
- }
- static PropertyHandler createHandler()
- {
- PropertyHandler handler = ApplyPropertyDefaultBase<EUnicodeBidi, &RenderStyle::unicodeBidi, EUnicodeBidi, &RenderStyle::setUnicodeBidi, EUnicodeBidi, &RenderStyle::initialUnicodeBidi>::createHandler();
- return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
- }
-};
-
class ApplyPropertyLineHeight {
public:
static void applyValue(StyleResolver* styleResolver, CSSValue* value)
@@ -1212,7 +1181,7 @@ public:
Length lineHeight;
if (primitiveValue->getIdent() == CSSValueNormal)
- lineHeight = Length(-100.0, Percent);
+ lineHeight = RenderStyle::initialLineHeight();
else if (primitiveValue->isLength()) {
double multiplier = styleResolver->style()->effectiveZoom();
if (styleResolver->style()->textSizeAdjust()) {
@@ -1234,7 +1203,7 @@ public:
}
static PropertyHandler createHandler()
{
- PropertyHandler handler = ApplyPropertyDefaultBase<Length, &RenderStyle::lineHeight, Length, &RenderStyle::setLineHeight, Length, &RenderStyle::initialLineHeight>::createHandler();
+ PropertyHandler handler = ApplyPropertyDefaultBase<Length, &RenderStyle::specifiedLineHeight, Length, &RenderStyle::setLineHeight, Length, &RenderStyle::initialLineHeight>::createHandler();
return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
}
};
@@ -1933,13 +1902,16 @@ StyleBuilder::StyleBuilder()
setPropertyHandler(CSSPropertyTabSize, ApplyPropertyDefault<unsigned, &RenderStyle::tabSize, unsigned, &RenderStyle::setTabSize, unsigned, &RenderStyle::initialTabSize>::createHandler());
setPropertyHandler(CSSPropertyTextAlign, ApplyPropertyTextAlign::createHandler());
setPropertyHandler(CSSPropertyTextDecoration, ApplyPropertyTextDecoration::createHandler());
+#if ENABLE(CSS3_TEXT_DECORATION)
setPropertyHandler(CSSPropertyWebkitTextDecorationLine, ApplyPropertyTextDecoration::createHandler());
+ setPropertyHandler(CSSPropertyWebkitTextDecorationStyle, ApplyPropertyDefault<TextDecorationStyle, &RenderStyle::textDecorationStyle, TextDecorationStyle, &RenderStyle::setTextDecorationStyle, TextDecorationStyle, &RenderStyle::initialTextDecorationStyle>::createHandler());
+#endif // CSS3_TEXT_DECORATION
setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyLength<&RenderStyle::textIndent, &RenderStyle::setTextIndent, &RenderStyle::initialTextIndent>::createHandler());
setPropertyHandler(CSSPropertyTextOverflow, ApplyPropertyDefault<TextOverflow, &RenderStyle::textOverflow, TextOverflow, &RenderStyle::setTextOverflow, TextOverflow, &RenderStyle::initialTextOverflow>::createHandler());
setPropertyHandler(CSSPropertyTextRendering, ApplyPropertyFont<TextRenderingMode, &FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering>::createHandler());
setPropertyHandler(CSSPropertyTextTransform, ApplyPropertyDefault<ETextTransform, &RenderStyle::textTransform, ETextTransform, &RenderStyle::setTextTransform, ETextTransform, &RenderStyle::initialTextTransform>::createHandler());
setPropertyHandler(CSSPropertyTop, ApplyPropertyLength<&RenderStyle::top, &RenderStyle::setTop, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
- setPropertyHandler(CSSPropertyUnicodeBidi, ApplyPropertyUnicodeBidi::createHandler());
+ setPropertyHandler(CSSPropertyUnicodeBidi, ApplyPropertyDefault<EUnicodeBidi, &RenderStyle::unicodeBidi, EUnicodeBidi, &RenderStyle::setUnicodeBidi, EUnicodeBidi, &RenderStyle::initialUnicodeBidi>::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, &CSSToStyleMap::mapAnimationDelay, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
@@ -2092,6 +2064,9 @@ StyleBuilder::StyleBuilder()
setPropertyHandler(CSSPropertyWordWrap, ApplyPropertyDefault<EWordWrap, &RenderStyle::wordWrap, EWordWrap, &RenderStyle::setWordWrap, EWordWrap, &RenderStyle::initialWordWrap>::createHandler());
setPropertyHandler(CSSPropertyZIndex, ApplyPropertyAuto<int, &RenderStyle::zIndex, &RenderStyle::setZIndex, &RenderStyle::hasAutoZIndex, &RenderStyle::setHasAutoZIndex>::createHandler());
setPropertyHandler(CSSPropertyZoom, ApplyPropertyZoom::createHandler());
+#if ENABLE(CSS_COMPOSITING)
+ setPropertyHandler(CSSPropertyWebkitBlendMode, ApplyPropertyDefault<BlendMode, &RenderStyle::blendMode, BlendMode, &RenderStyle::setBlendMode, BlendMode, &RenderStyle::initialBlendMode>::createHandler());
+#endif
}
diff --git a/Source/WebCore/css/StylePropertySet.cpp b/Source/WebCore/css/StylePropertySet.cpp
index a48728ae6..adc7fc85c 100644
--- a/Source/WebCore/css/StylePropertySet.cpp
+++ b/Source/WebCore/css/StylePropertySet.cpp
@@ -50,9 +50,14 @@ static PropertySetCSSOMWrapperMap& propertySetCSSOMWrapperMap()
return propertySetCSSOMWrapperMapInstance;
}
+static size_t immutableStylePropertySetSize(unsigned count)
+{
+ return sizeof(StylePropertySet) - sizeof(void*) + sizeof(CSSProperty) * count;
+}
+
PassRefPtr<StylePropertySet> StylePropertySet::createImmutable(const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode)
{
- void* slot = WTF::fastMalloc(sizeof(StylePropertySet) - sizeof(void*) + sizeof(CSSProperty) * count);
+ void* slot = WTF::fastMalloc(immutableStylePropertySetSize(count));
return adoptRef(new (slot) StylePropertySet(properties, count, cssParserMode, /* makeMutable */ false));
}
@@ -1091,11 +1096,11 @@ unsigned StylePropertySet::averageSizeInBytes()
void StylePropertySet::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
{
- MemoryClassInfo info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
+ size_t actualSize = m_isMutable ? sizeof(StylePropertySet) : immutableStylePropertySetSize(m_arraySize);
+ MemoryClassInfo info(memoryObjectInfo, this, MemoryInstrumentation::CSS, actualSize);
if (m_isMutable)
info.addVectorPtr(m_mutablePropertyVector);
- else
- info.addRawBuffer(m_properties, m_arraySize * sizeof(CSSProperty));
+
unsigned count = propertyCount();
for (unsigned i = 0; i < count; ++i)
info.addInstrumentedMember(propertyAt(i));
diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp
index ff9213aa8..ea5950e54 100644
--- a/Source/WebCore/css/StyleResolver.cpp
+++ b/Source/WebCore/css/StyleResolver.cpp
@@ -1908,6 +1908,7 @@ void StyleResolver::keyframeStylesForAnimation(Element* e, const RenderStyle* el
PassRefPtr<RenderStyle> StyleResolver::pseudoStyleForElement(PseudoId pseudo, Element* e, RenderStyle* parentStyle)
{
+ ASSERT(m_parentStyle);
if (!e)
return 0;
@@ -1915,9 +1916,7 @@ PassRefPtr<RenderStyle> StyleResolver::pseudoStyleForElement(PseudoId pseudo, El
initForStyleResolve(e, parentStyle, pseudo);
m_style = RenderStyle::create();
-
- if (m_parentStyle)
- m_style->inheritFrom(m_parentStyle);
+ m_style->inheritFrom(m_parentStyle);
// Since we don't use pseudo-elements in any of our quirk/print user agent rules, don't waste time walking
// those rules.
@@ -2068,8 +2067,19 @@ static bool doesNotInheritTextDecoration(RenderStyle* style, Element* e)
|| style->isFloating() || style->isOutOfFlowPositioned();
}
+static bool isDisplayFlexibleBox(EDisplay display)
+{
+#if ENABLE(CSS3_FLEXBOX)
+ return display == FLEX || display == INLINE_FLEX;
+#else
+ return false;
+#endif
+}
+
void StyleResolver::adjustRenderStyle(RenderStyle* style, RenderStyle* parentStyle, Element *e)
{
+ ASSERT(parentStyle);
+
// Cache our original display.
style->setOriginalDisplay(style->display());
@@ -2129,7 +2139,7 @@ void StyleResolver::adjustRenderStyle(RenderStyle* style, RenderStyle* parentSty
// FIXME: Don't support this mutation for pseudo styles like first-letter or first-line, since it's not completely
// clear how that should work.
- if (style->display() == INLINE && style->styleType() == NOPSEUDO && parentStyle && style->writingMode() != parentStyle->writingMode())
+ if (style->display() == INLINE && style->styleType() == NOPSEUDO && style->writingMode() != parentStyle->writingMode())
style->setDisplay(INLINE_BLOCK);
// After performing the display mutation, check table rows. We do not honor position:relative on
@@ -2153,14 +2163,14 @@ void StyleResolver::adjustRenderStyle(RenderStyle* style, RenderStyle* parentSty
if (style->writingMode() != TopToBottomWritingMode && (style->display() == BOX || style->display() == INLINE_BOX))
style->setWritingMode(TopToBottomWritingMode);
- if (e && e->parentNode() && e->parentNode()->renderer() && e->parentNode()->renderer()->isFlexibleBox()) {
+ if (isDisplayFlexibleBox(parentStyle->display())) {
style->setFloating(NoFloat);
style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloating(), m_checker.strictParsing()));
}
}
// Make sure our z-index value is only applied if the object is positioned.
- if (style->position() == StaticPosition)
+ if (style->position() == StaticPosition && !isDisplayFlexibleBox(parentStyle->display()))
style->setHasAutoZIndex();
// Auto z-index becomes 0 for the root element and transparent objects. This prevents
@@ -3659,7 +3669,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
case CSSPropertyFont:
if (isInherit) {
FontDescription fontDescription = m_parentStyle->fontDescription();
- m_style->setLineHeight(m_parentStyle->lineHeight());
+ m_style->setLineHeight(m_parentStyle->specifiedLineHeight());
m_lineHeightValue = 0;
setFontDescription(fontDescription);
} else if (isInitial) {
@@ -4403,7 +4413,10 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
#endif
case CSSPropertyWebkitRtlOrdering:
case CSSPropertyWebkitTextCombine:
+#if ENABLE(CSS3_TEXT_DECORATION)
case CSSPropertyWebkitTextDecorationLine:
+ case CSSPropertyWebkitTextDecorationStyle:
+#endif // CSS3_TEXT_DECORATION
case CSSPropertyWebkitTextEmphasisColor:
case CSSPropertyWebkitTextEmphasisPosition:
case CSSPropertyWebkitTextEmphasisStyle:
diff --git a/Source/WebCore/css/StyleResolver.h b/Source/WebCore/css/StyleResolver.h
index 46f909ad2..4e9fe9148 100644
--- a/Source/WebCore/css/StyleResolver.h
+++ b/Source/WebCore/css/StyleResolver.h
@@ -141,7 +141,7 @@ public:
void keyframeStylesForAnimation(Element*, const RenderStyle*, KeyframeList&);
- PassRefPtr<RenderStyle> pseudoStyleForElement(PseudoId, Element*, RenderStyle* parentStyle = 0);
+ PassRefPtr<RenderStyle> pseudoStyleForElement(PseudoId, Element*, RenderStyle* parentStyle);
PassRefPtr<RenderStyle> styleForPage(int pageIndex);
diff --git a/Source/WebCore/css/StyleRuleImport.cpp b/Source/WebCore/css/StyleRuleImport.cpp
index 70ee9c3df..24942521d 100644
--- a/Source/WebCore/css/StyleRuleImport.cpp
+++ b/Source/WebCore/css/StyleRuleImport.cpp
@@ -68,7 +68,7 @@ void StyleRuleImport::setCSSStyleSheet(const String& href, const KURL& baseURL,
if (!baseURL.isNull())
context.baseURL = baseURL;
- m_styleSheet = StyleSheetContents::create(this, href, baseURL, context);
+ m_styleSheet = StyleSheetContents::create(this, href, context);
Document* document = m_parentStyleSheet ? m_parentStyleSheet->singleOwnerDocument() : 0;
m_styleSheet->parseAuthorStyleSheet(cachedStyleSheet, document ? document->securityOrigin() : 0);
@@ -98,21 +98,24 @@ void StyleRuleImport::requestStyleSheet()
if (!cachedResourceLoader)
return;
- String absHref = m_strHref;
- if (!m_parentStyleSheet->finalURL().isNull())
+ KURL absURL;
+ if (!m_parentStyleSheet->baseURL().isNull())
// use parent styleheet's URL as the base URL
- absHref = KURL(m_parentStyleSheet->finalURL(), m_strHref).string();
+ absURL = KURL(m_parentStyleSheet->baseURL(), m_strHref);
+ else
+ absURL = document->completeURL(m_strHref);
// Check for a cycle in our import chain. If we encounter a stylesheet
// in our parent chain with the same URL, then just bail.
StyleSheetContents* rootSheet = m_parentStyleSheet;
for (StyleSheetContents* sheet = m_parentStyleSheet; sheet; sheet = sheet->parentStyleSheet()) {
- if (absHref == sheet->finalURL().string() || absHref == sheet->originalURL())
+ if (equalIgnoringFragmentIdentifier(absURL, sheet->baseURL())
+ || equalIgnoringFragmentIdentifier(absURL, document->completeURL(sheet->originalURL())))
return;
rootSheet = sheet;
}
- ResourceRequest request(document->completeURL(absHref));
+ ResourceRequest request(absURL);
if (m_parentStyleSheet->isUserStyleSheet())
m_cachedSheet = cachedResourceLoader->requestUserCSSStyleSheet(request, m_parentStyleSheet->charset());
else
diff --git a/Source/WebCore/css/StyleSheetContents.cpp b/Source/WebCore/css/StyleSheetContents.cpp
index 292debb94..96b4e54fa 100644
--- a/Source/WebCore/css/StyleSheetContents.cpp
+++ b/Source/WebCore/css/StyleSheetContents.cpp
@@ -54,10 +54,9 @@ unsigned StyleSheetContents::estimatedSizeInBytes() const
return size;
}
-StyleSheetContents::StyleSheetContents(StyleRuleImport* ownerRule, const String& originalURL, const KURL& finalURL, const CSSParserContext& context)
+StyleSheetContents::StyleSheetContents(StyleRuleImport* ownerRule, const String& originalURL, const CSSParserContext& context)
: m_ownerRule(ownerRule)
, m_originalURL(originalURL)
- , m_finalURL(finalURL)
, m_loadCompleted(false)
, m_isUserStyleSheet(ownerRule && ownerRule->parentStyleSheet() && ownerRule->parentStyleSheet()->isUserStyleSheet())
, m_hasSyntacticallyValidCSSHeader(true)
@@ -73,7 +72,6 @@ StyleSheetContents::StyleSheetContents(const StyleSheetContents& o)
: RefCounted<StyleSheetContents>()
, m_ownerRule(0)
, m_originalURL(o.m_originalURL)
- , m_finalURL(o.m_finalURL)
, m_encodingFromCharsetRule(o.m_encodingFromCharsetRule)
, m_importRules(o.m_importRules.size())
, m_childRules(o.m_childRules.size())
@@ -250,7 +248,10 @@ void StyleSheetContents::parserAddNamespace(const AtomicString& prefix, const At
{
if (uri.isNull() || prefix.isNull())
return;
- m_namespaces.add(prefix, uri);
+ PrefixNamespaceURIMap::AddResult result = m_namespaces.add(prefix, uri);
+ if (result.isNewEntry)
+ return;
+ result.iterator->second = uri;
}
const AtomicString& StyleSheetContents::determineNamespace(const AtomicString& prefix)
@@ -280,7 +281,7 @@ void StyleSheetContents::parseAuthorStyleSheet(const CachedCSSStyleSheet* cached
// to at least start with a syntactically valid CSS rule.
// This prevents an attacker playing games by injecting CSS strings into HTML, XML, JSON, etc. etc.
if (!hasValidMIMEType && !hasSyntacticallyValidCSSHeader()) {
- bool isCrossOriginCSS = !securityOrigin || !securityOrigin->canRequest(finalURL());
+ bool isCrossOriginCSS = !securityOrigin || !securityOrigin->canRequest(baseURL());
if (isCrossOriginCSS) {
clearRules();
return;
@@ -292,7 +293,7 @@ void StyleSheetContents::parseAuthorStyleSheet(const CachedCSSStyleSheet* cached
DEFINE_STATIC_LOCAL(const String, mediaWikiKHTMLFixesStyleSheet, ("/* KHTML fix stylesheet */\n/* work around the horizontal scrollbars */\n#column-content { margin-left: 0; }\n\n"));
// There are two variants of KHTMLFixes.css. One is equal to mediaWikiKHTMLFixesStyleSheet,
// while the other lacks the second trailing newline.
- if (finalURL().string().endsWith(slashKHTMLFixesDotCss) && !sheetText.isNull() && mediaWikiKHTMLFixesStyleSheet.startsWith(sheetText)
+ if (baseURL().string().endsWith(slashKHTMLFixesDotCss) && !sheetText.isNull() && mediaWikiKHTMLFixesStyleSheet.startsWith(sheetText)
&& sheetText.length() >= mediaWikiKHTMLFixesStyleSheet.length() - 1)
clearRules();
}
@@ -486,7 +487,6 @@ void StyleSheetContents::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) c
{
MemoryClassInfo info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
info.addMember(m_originalURL);
- info.addMember(m_finalURL);
info.addMember(m_encodingFromCharsetRule);
info.addVector(m_importRules);
info.addInstrumentedVector(m_childRules);
diff --git a/Source/WebCore/css/StyleSheetContents.h b/Source/WebCore/css/StyleSheetContents.h
index b1ddb8ccb..af0b294d5 100644
--- a/Source/WebCore/css/StyleSheetContents.h
+++ b/Source/WebCore/css/StyleSheetContents.h
@@ -44,15 +44,15 @@ class StyleSheetContents : public RefCounted<StyleSheetContents> {
public:
static PassRefPtr<StyleSheetContents> create(const CSSParserContext& context = CSSParserContext(CSSStrictMode))
{
- return adoptRef(new StyleSheetContents(0, String(), KURL(), context));
+ return adoptRef(new StyleSheetContents(0, String(), context));
}
- static PassRefPtr<StyleSheetContents> create(const String& originalURL, const KURL& finalURL, const CSSParserContext& context)
+ static PassRefPtr<StyleSheetContents> create(const String& originalURL, const CSSParserContext& context)
{
- return adoptRef(new StyleSheetContents(0, originalURL, finalURL, context));
+ return adoptRef(new StyleSheetContents(0, originalURL, context));
}
- static PassRefPtr<StyleSheetContents> create(StyleRuleImport* ownerRule, const String& originalURL, const KURL& finalURL, const CSSParserContext& context)
+ static PassRefPtr<StyleSheetContents> create(StyleRuleImport* ownerRule, const String& originalURL, const CSSParserContext& context)
{
- return adoptRef(new StyleSheetContents(ownerRule, originalURL, finalURL, context));
+ return adoptRef(new StyleSheetContents(ownerRule, originalURL, context));
}
~StyleSheetContents();
@@ -112,8 +112,6 @@ public:
// this style sheet. This property probably isn't useful for much except
// the JavaScript binding (which needs to use this value for security).
String originalURL() const { return m_originalURL; }
-
- const KURL& finalURL() const { return m_finalURL; }
const KURL& baseURL() const { return m_parserContext.baseURL; }
unsigned ruleCount() const;
@@ -142,7 +140,7 @@ public:
void reportMemoryUsage(MemoryObjectInfo*) const;
private:
- StyleSheetContents(StyleRuleImport* ownerRule, const String& originalURL, const KURL& baseURL, const CSSParserContext&);
+ StyleSheetContents(StyleRuleImport* ownerRule, const String& originalURL, const CSSParserContext&);
StyleSheetContents(const StyleSheetContents&);
void clearCharsetRule();
@@ -150,7 +148,6 @@ private:
StyleRuleImport* m_ownerRule;
String m_originalURL;
- KURL m_finalURL;
String m_encodingFromCharsetRule;
Vector<RefPtr<StyleRuleImport> > m_importRules;
diff --git a/Source/WebCore/css/html.css b/Source/WebCore/css/html.css
index 43b65a139..d60ca0ed5 100644
--- a/Source/WebCore/css/html.css
+++ b/Source/WebCore/css/html.css
@@ -490,8 +490,7 @@ input::-webkit-datetime-edit {
input::-webkit-datetime-edit-ampm-field {
-webkit-user-modify: read-only !important;
border: none;
- width: 2em;
- padding: 2px;
+ padding: 0.15em;
}
input::-webkit-datetime-edit-hour-field {
@@ -499,8 +498,7 @@ input::-webkit-datetime-edit-hour-field {
display: inline-block;
border: none;
text-align: center;
- width: 1.2em;
- padding: 2px;
+ padding: 0.15em;
}
input::-webkit-datetime-edit-millisecond-field {
@@ -508,8 +506,7 @@ input::-webkit-datetime-edit-millisecond-field {
display: inline-block;
border: none;
text-align: center;
- width: 1.8em;
- padding: 2px;
+ padding: 0.15em;
}
input::-webkit-datetime-edit-minute-field {
@@ -517,8 +514,7 @@ input::-webkit-datetime-edit-minute-field {
display: inline-block;
border: none;
text-align: center;
- width: 1.2em;
- padding: 2px;
+ padding: 0.15em;
}
/* This selector is used when step >= 3600 second but format contains minute field. */
@@ -531,14 +527,17 @@ input::-webkit-datetime-edit-second-field {
display: inline-block;
border: none;
text-align: center;
- width: 1.2em;
- padding: 2px;
+ padding: 0.15em;
}
/* This selector is used when step >= 60 second but format contains second field. */
input::-webkit-datetime-edit-second-field[readonly] {
color: GrayText;
}
+
+input[type="time"]::-webkit-inner-spin-button {
+ margin-left: 0.2em;
+}
#endif
input::-webkit-inner-spin-button {
@@ -894,12 +893,20 @@ output {
meter {
-webkit-appearance: meter;
-webkit-box-sizing: border-box;
- display: inline-box;
+ display: inline-block;
height: 1em;
width: 5em;
vertical-align: -0.2em;
}
+meter::-webkit-meter-inner-element {
+ -webkit-appearance: inherit;
+ -webkit-box-sizing: inherit;
+ -webkit-user-modify: read-only !important;
+ height: 100%;
+ width: 100%;
+}
+
meter::-webkit-meter-bar {
background: -webkit-gradient(linear, left top, left bottom, from(#ddd), to(#ddd), color-stop(0.20, #eee), color-stop(0.45, #ccc), color-stop(0.55, #ccc));
height: 100%;
diff --git a/Source/WebCore/css/makeprop.pl b/Source/WebCore/css/makeprop.pl
index a5bfb0649..773435687 100644
--- a/Source/WebCore/css/makeprop.pl
+++ b/Source/WebCore/css/makeprop.pl
@@ -70,9 +70,19 @@ print GPERF << "EOF";
#include <string.h>
#include <wtf/ASCIICType.h>
+#include <wtf/text/AtomicString.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
+EOF
+
+print GPERF "const char* const propertyNameStrings[numCSSProperties] = {\n";
+foreach my $name (@names) {
+ print GPERF " \"$name\",\n";
+}
+print GPERF "};\n\n";
+
+print GPERF << "EOF";
%}
%struct-type
struct Property;
@@ -120,7 +130,30 @@ const char* getPropertyName(CSSPropertyID id)
return propertyNameStrings[index];
}
-WTF::String getJSPropertyName(CSSPropertyID id)
+const AtomicString& getPropertyNameAtomicString(CSSPropertyID id)
+{
+ if (id < firstCSSProperty)
+ return nullAtom;
+ int index = id - firstCSSProperty;
+ if (index >= numCSSProperties)
+ return nullAtom;
+
+ static AtomicString* propertyStrings = new AtomicString[numCSSProperties]; // Intentionally never destroyed.
+ AtomicString& propertyString = propertyStrings[index];
+ if (propertyString.isNull()) {
+ const char* propertyName = propertyNameStrings[index];
+ propertyString = AtomicString(propertyName, strlen(propertyName), AtomicString::ConstructFromLiteral);
+ }
+ return propertyString;
+}
+
+String getPropertyNameString(CSSPropertyID id)
+{
+ // We share the StringImpl with the AtomicStrings.
+ return getPropertyNameAtomicString(id).string();
+}
+
+String getJSPropertyName(CSSPropertyID id)
{
char result[maxCSSPropertyNameLength + 1];
const char* cssPropertyName = getPropertyName(id);
@@ -157,6 +190,7 @@ print HEADER << "EOF";
#include <wtf/HashTraits.h>
namespace WTF {
+class AtomicString;
class String;
}
@@ -190,15 +224,11 @@ print HEADER "const int numCSSProperties = $num;\n";
print HEADER "const int lastCSSProperty = $last;\n";
print HEADER "const size_t maxCSSPropertyNameLength = $maxLen;\n";
-print HEADER "const char* const propertyNameStrings[$num] = {\n";
-foreach my $name (@names) {
- print HEADER "\"$name\",\n";
-}
-print HEADER "};\n";
-
print HEADER << "EOF";
const char* getPropertyName(CSSPropertyID);
+const WTF::AtomicString& getPropertyNameAtomicString(CSSPropertyID id);
+WTF::String getPropertyNameString(CSSPropertyID id);
WTF::String getJSPropertyName(CSSPropertyID);
inline CSSPropertyID convertToCSSPropertyID(int value)
diff --git a/Source/WebCore/css/themeWin.css b/Source/WebCore/css/themeWin.css
index 52be43eed..3dd1ccaad 100644
--- a/Source/WebCore/css/themeWin.css
+++ b/Source/WebCore/css/themeWin.css
@@ -43,7 +43,9 @@ input[type="number"],
input[type="password"],
input[type="tel"],
input[type="text"],
+#if !defined(ENABLE_INPUT_TYPE_TIME_MULTIPLE_FIELDS) || !ENABLE_INPUT_TYPE_TIME_MULTIPLE_FIELDS
input[type="time"],
+#endif
input[type="url"],
input[type="week"] {
padding:1px 0;
diff --git a/Source/WebCore/dom/Attr.cpp b/Source/WebCore/dom/Attr.cpp
index 95c3fe052..d6e29bd18 100644
--- a/Source/WebCore/dom/Attr.cpp
+++ b/Source/WebCore/dom/Attr.cpp
@@ -138,7 +138,7 @@ void Attr::setNodeValue(const String& v, ExceptionCode& ec)
setValue(v, ec);
}
-PassRefPtr<Node> Attr::cloneNode(bool /*deep*/)
+PassRefPtr<Node> Attr::cloneNode(bool /*deep*/, ExceptionCode&)
{
RefPtr<Attr> clone = adoptRef(new Attr(document(), qualifiedName(), value()));
cloneChildNodes(clone.get());
diff --git a/Source/WebCore/dom/Attr.h b/Source/WebCore/dom/Attr.h
index 8e760aa25..86b3c4a60 100644
--- a/Source/WebCore/dom/Attr.h
+++ b/Source/WebCore/dom/Attr.h
@@ -81,7 +81,7 @@ private:
virtual String nodeValue() const OVERRIDE { return value(); }
virtual void setNodeValue(const String&, ExceptionCode&);
- virtual PassRefPtr<Node> cloneNode(bool deep);
+ virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&);
virtual bool isAttributeNode() const { return true; }
virtual bool childTypeAllowed(NodeType) const;
diff --git a/Source/WebCore/dom/Attribute.h b/Source/WebCore/dom/Attribute.h
index db38a79ba..7174bbaad 100644
--- a/Source/WebCore/dom/Attribute.h
+++ b/Source/WebCore/dom/Attribute.h
@@ -67,6 +67,13 @@ public:
// elements may have placed the Attribute in a hash by name.
void parserSetName(const QualifiedName& name) { m_name = name; }
+ void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+ {
+ MemoryClassInfo info(memoryObjectInfo, this, MemoryInstrumentation::DOM);
+ info.addInstrumentedMember(m_name);
+ info.addMember(m_value);
+ }
+
private:
QualifiedName m_name;
AtomicString m_value;
diff --git a/Source/WebCore/dom/CDATASection.cpp b/Source/WebCore/dom/CDATASection.cpp
index 33a3acc58..2b39e8083 100644
--- a/Source/WebCore/dom/CDATASection.cpp
+++ b/Source/WebCore/dom/CDATASection.cpp
@@ -46,7 +46,7 @@ Node::NodeType CDATASection::nodeType() const
return CDATA_SECTION_NODE;
}
-PassRefPtr<Node> CDATASection::cloneNode(bool /*deep*/)
+PassRefPtr<Node> CDATASection::cloneNode(bool /*deep*/, ExceptionCode&)
{
return create(document(), data());
}
diff --git a/Source/WebCore/dom/CDATASection.h b/Source/WebCore/dom/CDATASection.h
index d7aca9d69..4c26573f7 100644
--- a/Source/WebCore/dom/CDATASection.h
+++ b/Source/WebCore/dom/CDATASection.h
@@ -36,7 +36,7 @@ private:
virtual String nodeName() const;
virtual NodeType nodeType() const;
- virtual PassRefPtr<Node> cloneNode(bool deep);
+ virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&);
virtual bool childTypeAllowed(NodeType) const;
virtual PassRefPtr<Text> virtualCreate(const String&);
};
diff --git a/Source/WebCore/dom/Comment.cpp b/Source/WebCore/dom/Comment.cpp
index c2f0582ec..900bcd173 100644
--- a/Source/WebCore/dom/Comment.cpp
+++ b/Source/WebCore/dom/Comment.cpp
@@ -46,7 +46,7 @@ Node::NodeType Comment::nodeType() const
return COMMENT_NODE;
}
-PassRefPtr<Node> Comment::cloneNode(bool /*deep*/)
+PassRefPtr<Node> Comment::cloneNode(bool /*deep*/, ExceptionCode&)
{
return create(document(), data());
}
diff --git a/Source/WebCore/dom/Comment.h b/Source/WebCore/dom/Comment.h
index 9db1f31fd..e83445120 100644
--- a/Source/WebCore/dom/Comment.h
+++ b/Source/WebCore/dom/Comment.h
@@ -36,7 +36,7 @@ private:
virtual String nodeName() const;
virtual NodeType nodeType() const;
- virtual PassRefPtr<Node> cloneNode(bool deep);
+ virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&);
virtual bool childTypeAllowed(NodeType) const;
};
diff --git a/Source/WebCore/dom/ContainerNodeAlgorithms.h b/Source/WebCore/dom/ContainerNodeAlgorithms.h
index b5dfa4fa6..163295541 100644
--- a/Source/WebCore/dom/ContainerNodeAlgorithms.h
+++ b/Source/WebCore/dom/ContainerNodeAlgorithms.h
@@ -46,6 +46,7 @@ private:
void notifyNodeInsertedIntoTree(ContainerNode*);
ContainerNode* m_insertionPoint;
+ Vector< RefPtr<Node> > m_postInsertionNotificationTargets;
};
class ChildNodeRemovalNotifier {
@@ -192,13 +193,10 @@ inline void ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument(Node* nod
{
ASSERT(m_insertionPoint->inDocument());
RefPtr<Node> protect(node);
- Node::InsertionNotificationRequest request = node->insertedInto(m_insertionPoint);
-
+ if (Node::InsertionShouldCallDidNotifySubtreeInsertions == node->insertedInto(m_insertionPoint))
+ m_postInsertionNotificationTargets.append(node);
if (node->isContainerNode())
notifyDescendantInsertedIntoDocument(toContainerNode(node));
-
- if (request == Node::InsertionShouldCallDidNotifyDescendantInsertions)
- node->didNotifyDescendantInsertions(m_insertionPoint);
}
inline void ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree(ContainerNode* node)
@@ -206,11 +204,9 @@ inline void ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree(ContainerNode
ASSERT(!m_insertionPoint->inDocument());
forbidEventDispatch();
- Node::InsertionNotificationRequest request = node->insertedInto(m_insertionPoint);
-
+ if (Node::InsertionShouldCallDidNotifySubtreeInsertions == node->insertedInto(m_insertionPoint))
+ m_postInsertionNotificationTargets.append(node);
notifyDescendantInsertedIntoTree(node);
- if (request == Node::InsertionShouldCallDidNotifyDescendantInsertions)
- node->didNotifyDescendantInsertions(m_insertionPoint);
allowEventDispatch();
}
@@ -235,6 +231,9 @@ inline void ChildNodeInsertionNotifier::notify(Node* node)
notifyNodeInsertedIntoDocument(node);
else if (node->isContainerNode())
notifyNodeInsertedIntoTree(toContainerNode(node));
+
+ for (size_t i = 0; i < m_postInsertionNotificationTargets.size(); ++i)
+ m_postInsertionNotificationTargets[i]->didNotifySubtreeInsertions(m_insertionPoint);
}
@@ -260,9 +259,10 @@ inline void ChildNodeRemovalNotifier::notifyNodeRemovedFromTree(ContainerNode* n
inline void ChildNodeRemovalNotifier::notify(Node* node)
{
- if (node->inDocument())
+ if (node->inDocument()) {
notifyNodeRemovedFromDocument(node);
- else if (node->isContainerNode())
+ node->document()->notifyRemovePendingSheetIfNeeded();
+ } else if (node->isContainerNode())
notifyNodeRemovedFromTree(toContainerNode(node));
}
diff --git a/Source/WebCore/dom/ContextDestructionObserver.cpp b/Source/WebCore/dom/ContextDestructionObserver.cpp
index 2fdd556e3..a557dc7c0 100644
--- a/Source/WebCore/dom/ContextDestructionObserver.cpp
+++ b/Source/WebCore/dom/ContextDestructionObserver.cpp
@@ -32,22 +32,29 @@
namespace WebCore {
ContextDestructionObserver::ContextDestructionObserver(ScriptExecutionContext* scriptExecutionContext)
- : m_scriptExecutionContext(scriptExecutionContext)
+ : m_scriptExecutionContext(0)
{
- if (!m_scriptExecutionContext)
- return;
-
- ASSERT(m_scriptExecutionContext->isContextThread());
- m_scriptExecutionContext->didCreateDestructionObserver(this);
+ observeContext(scriptExecutionContext);
}
ContextDestructionObserver::~ContextDestructionObserver()
{
- if (!m_scriptExecutionContext)
- return;
+ observeContext(0);
+}
+
+void ContextDestructionObserver::observeContext(ScriptExecutionContext* scriptExecutionContext)
+{
+ if (m_scriptExecutionContext) {
+ ASSERT(m_scriptExecutionContext->isContextThread());
+ m_scriptExecutionContext->willDestroyDestructionObserver(this);
+ }
+
+ m_scriptExecutionContext = scriptExecutionContext;
- ASSERT(m_scriptExecutionContext->isContextThread());
- m_scriptExecutionContext->willDestroyDestructionObserver(this);
+ if (m_scriptExecutionContext) {
+ ASSERT(m_scriptExecutionContext->isContextThread());
+ m_scriptExecutionContext->didCreateDestructionObserver(this);
+ }
}
void ContextDestructionObserver::contextDestroyed()
diff --git a/Source/WebCore/dom/ContextDestructionObserver.h b/Source/WebCore/dom/ContextDestructionObserver.h
index 19a7a94b4..ca956abc8 100644
--- a/Source/WebCore/dom/ContextDestructionObserver.h
+++ b/Source/WebCore/dom/ContextDestructionObserver.h
@@ -40,6 +40,7 @@ public:
protected:
virtual ~ContextDestructionObserver();
+ void observeContext(ScriptExecutionContext*);
ScriptExecutionContext* m_scriptExecutionContext;
};
diff --git a/Source/WebCore/dom/ContextFeatures.cpp b/Source/WebCore/dom/ContextFeatures.cpp
index 0f2273029..13bbb38e1 100644
--- a/Source/WebCore/dom/ContextFeatures.cpp
+++ b/Source/WebCore/dom/ContextFeatures.cpp
@@ -111,6 +111,14 @@ bool ContextFeatures::htmlNotificationsEnabled(Document* document)
#endif
}
+bool ContextFeatures::mutationEventsEnabled(Document* document)
+{
+ ASSERT(document);
+ if (!document)
+ return true;
+ return document->contextFeatures()->isEnabled(document, MutationEvents, true);
+}
+
void provideContextFeaturesTo(Page* page, ContextFeaturesClient* client)
{
RefCountedSupplement<Page, ContextFeatures>::provideTo(page, ContextFeatures::supplementName(), ContextFeatures::create(client));
diff --git a/Source/WebCore/dom/ContextFeatures.h b/Source/WebCore/dom/ContextFeatures.h
index b32fbbf6e..34d53c881 100644
--- a/Source/WebCore/dom/ContextFeatures.h
+++ b/Source/WebCore/dom/ContextFeatures.h
@@ -44,6 +44,7 @@ public:
StyleScoped,
PagePopup,
HTMLNotifications,
+ MutationEvents,
FeatureTypeSize // Should be the last entry.
};
@@ -56,6 +57,7 @@ public:
static bool styleScopedEnabled(Document*);
static bool pagePopupEnabled(Document*);
static bool htmlNotificationsEnabled(Document*);
+ static bool mutationEventsEnabled(Document*);
bool isEnabled(Document*, FeatureType, bool) const;
void urlDidChange(Document*);
diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp
index f4304c607..b0f387a25 100644
--- a/Source/WebCore/dom/Document.cpp
+++ b/Source/WebCore/dom/Document.cpp
@@ -5,7 +5,7 @@
* (C) 2006 Alexey Proskuryakov (ap@webkit.org)
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All rights reserved.
* Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
- * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
* Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
*
@@ -385,7 +385,7 @@ static void printNavigationErrorMessage(Frame* frame, const KURL& activeURL)
frame->document()->url().string() + " from frame with URL " + activeURL.string() + ".\n";
// FIXME: should we print to the console of the document performing the navigation instead?
- frame->domWindow()->printErrorMessage(message);
+ frame->document()->domWindow()->printErrorMessage(message);
}
static HashSet<Document*>* documentsThatNeedStyleRecalc = 0;
@@ -553,6 +553,7 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML)
m_hasDirtyStyleResolver = false;
m_pendingStylesheets = 0;
m_ignorePendingStylesheets = false;
+ m_needsNotifyRemoveAllPendingStylesheet = false;
m_hasNodesWithPlaceholderStyle = false;
m_pendingSheetLayout = NoLayoutWithPendingSheets;
@@ -612,6 +613,10 @@ Document::~Document()
ASSERT(!m_parentTreeScope);
ASSERT(!m_guardRefCount);
+ // FIXME: Should we reset m_domWindow when we detach from the Frame?
+ if (m_domWindow)
+ m_domWindow->resetUnlessSuspendedForPageCache();
+
m_scriptRunner.clear();
histogramMutationEventUsage(m_listenerTypes);
@@ -662,11 +667,6 @@ Document::~Document()
clearStyleResolver(); // We need to destory CSSFontSelector before destroying m_cachedResourceLoader.
m_cachedResourceLoader.clear();
-#if ENABLE(UNDO_MANAGER)
- if (m_undoManager)
- m_undoManager->disconnect();
-#endif
-
// We must call clearRareData() here since a Document class inherits TreeScope
// as well as Node. See a comment on TreeScope.h for the reason.
if (hasRareData())
@@ -2162,7 +2162,7 @@ void Document::detach()
if (render)
render->destroy();
-
+
// This is required, as our Frame might delete itself as soon as it detaches
// us. However, this violates Node::detach() semantics, as it's never
// possible to re-attach. Eventually Document::detach() should be renamed,
@@ -3285,7 +3285,7 @@ bool Document::canReplaceChild(Node* newChild, Node* oldChild)
return true;
}
-PassRefPtr<Node> Document::cloneNode(bool /*deep*/)
+PassRefPtr<Node> Document::cloneNode(bool /*deep*/, ExceptionCode&)
{
// Spec says cloning Document nodes is "implementation dependent"
// so we do not support it...
@@ -3314,7 +3314,7 @@ void Document::setSelectedStylesheetSet(const String& aString)
}
// This method is called whenever a top-level stylesheet has finished loading.
-void Document::removePendingSheet()
+void Document::removePendingSheet(RemovePendingSheetNotificationType notification)
{
// Make sure we knew this sheet was pending, and that our count isn't out of sync.
ASSERT(m_pendingStylesheets > 0);
@@ -3329,6 +3329,18 @@ void Document::removePendingSheet()
if (m_pendingStylesheets)
return;
+ if (notification == RemovePendingSheetNotifyLater) {
+ setNeedsNotifyRemoveAllPendingStylesheet();
+ return;
+ }
+
+ didRemoveAllPendingStylesheet();
+}
+
+void Document::didRemoveAllPendingStylesheet()
+{
+ m_needsNotifyRemoveAllPendingStylesheet = false;
+
styleResolverChanged(RecalcStyleIfNeeded);
if (ScriptableDocumentParser* parser = scriptableDocumentParser())
@@ -3338,6 +3350,7 @@ void Document::removePendingSheet()
view()->scrollToFragment(m_url);
}
+
void Document::evaluateMediaQueryList()
{
if (m_mediaQueryMatcher)
@@ -3854,17 +3867,8 @@ bool Document::setFocusedNode(PassRefPtr<Node> prpNewFocusedNode)
}
#if PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(CHROMIUM)
- if (!focusChangeBlocked && m_focusedNode && AXObjectCache::accessibilityEnabled()) {
- RenderObject* oldFocusedRenderer = 0;
- RenderObject* newFocusedRenderer = 0;
-
- if (oldFocusedNode)
- oldFocusedRenderer = oldFocusedNode->renderer();
- if (newFocusedNode)
- newFocusedRenderer = newFocusedNode->renderer();
-
- axObjectCache()->handleFocusedUIElementChanged(oldFocusedRenderer, newFocusedRenderer);
- }
+ if (!focusChangeBlocked && m_focusedNode && AXObjectCache::accessibilityEnabled())
+ axObjectCache()->handleFocusedUIElementChanged(oldFocusedNode.get(), newFocusedNode.get());
#endif
if (!focusChangeBlocked)
page()->chrome()->focusedNodeChanged(m_focusedNode.get());
@@ -4036,18 +4040,28 @@ void Document::textNodeSplit(Text* oldNode)
// FIXME: This should update markers for spelling and grammar checking.
}
-// FIXME: eventually, this should return a DOMWindow stored in the document.
-DOMWindow* Document::domWindow() const
+void Document::createDOMWindow()
{
- if (!frame())
- return 0;
+ ASSERT(m_frame);
+ ASSERT(!m_domWindow);
- // The m_frame pointer is not (not always?) zeroed out when the document is put into b/f cache, so the frame can hold an unrelated document/window pair.
- // FIXME: We should always zero out the frame pointer on navigation to avoid accidentally accessing the new frame content.
- if (m_frame->document() != this)
- return 0;
+ m_domWindow = DOMWindow::create(this);
+
+ ASSERT(m_domWindow->document() == this);
+ ASSERT(m_domWindow->frame() == m_frame);
+}
+
+void Document::takeDOMWindowFrom(Document* document)
+{
+ ASSERT(m_frame);
+ ASSERT(!m_domWindow);
+ ASSERT(document->domWindow());
+
+ m_domWindow = document->m_domWindow.release();
+ m_domWindow->didSecureTransitionTo(this);
- return frame()->domWindow();
+ ASSERT(m_domWindow->document() == this);
+ ASSERT(m_domWindow->frame() == m_frame);
}
void Document::setWindowAttributeEventListener(const AtomicString& eventType, PassRefPtr<EventListener> listener)
@@ -4107,22 +4121,28 @@ PassRefPtr<Event> Document::createEvent(const String& eventType, ExceptionCode&
return 0;
}
+void Document::addMutationEventListenerTypeIfEnabled(ListenerType listenerType)
+{
+ if (ContextFeatures::mutationEventsEnabled(this))
+ addListenerType(listenerType);
+}
+
void Document::addListenerTypeIfNeeded(const AtomicString& eventType)
{
if (eventType == eventNames().DOMSubtreeModifiedEvent)
- addListenerType(DOMSUBTREEMODIFIED_LISTENER);
+ addMutationEventListenerTypeIfEnabled(DOMSUBTREEMODIFIED_LISTENER);
else if (eventType == eventNames().DOMNodeInsertedEvent)
- addListenerType(DOMNODEINSERTED_LISTENER);
+ addMutationEventListenerTypeIfEnabled(DOMNODEINSERTED_LISTENER);
else if (eventType == eventNames().DOMNodeRemovedEvent)
- addListenerType(DOMNODEREMOVED_LISTENER);
+ addMutationEventListenerTypeIfEnabled(DOMNODEREMOVED_LISTENER);
else if (eventType == eventNames().DOMNodeRemovedFromDocumentEvent)
- addListenerType(DOMNODEREMOVEDFROMDOCUMENT_LISTENER);
+ addMutationEventListenerTypeIfEnabled(DOMNODEREMOVEDFROMDOCUMENT_LISTENER);
else if (eventType == eventNames().DOMNodeInsertedIntoDocumentEvent)
- addListenerType(DOMNODEINSERTEDINTODOCUMENT_LISTENER);
+ addMutationEventListenerTypeIfEnabled(DOMNODEINSERTEDINTODOCUMENT_LISTENER);
else if (eventType == eventNames().DOMAttrModifiedEvent)
- addListenerType(DOMATTRMODIFIED_LISTENER);
+ addMutationEventListenerTypeIfEnabled(DOMATTRMODIFIED_LISTENER);
else if (eventType == eventNames().DOMCharacterDataModifiedEvent)
- addListenerType(DOMCHARACTERDATAMODIFIED_LISTENER);
+ addMutationEventListenerTypeIfEnabled(DOMCHARACTERDATAMODIFIED_LISTENER);
else if (eventType == eventNames().overflowchangedEvent)
addListenerType(OVERFLOWCHANGED_LISTENER);
else if (eventType == eventNames().webkitAnimationStartEvent)
@@ -4135,16 +4155,6 @@ void Document::addListenerTypeIfNeeded(const AtomicString& eventType)
addListenerType(TRANSITIONEND_LISTENER);
else if (eventType == eventNames().beforeloadEvent)
addListenerType(BEFORELOAD_LISTENER);
-#if ENABLE(TOUCH_EVENTS)
- else if (eventType == eventNames().touchstartEvent
- || eventType == eventNames().touchmoveEvent
- || eventType == eventNames().touchendEvent
- || eventType == eventNames().touchcancelEvent) {
- addListenerType(TOUCH_LISTENER);
- if (Page* page = this->page())
- page->chrome()->client()->needTouchEvents(true);
- }
-#endif
else if (eventType == eventNames().scrollEvent)
addListenerType(SCROLL_LISTENER);
}
@@ -5072,9 +5082,6 @@ void Document::didUpdateSecurityOrigin()
{
if (!m_frame)
return;
- // FIXME: We should remove DOMWindow::m_securityOrigin so that we don't need to keep them in sync.
- // See <https://bugs.webkit.org/show_bug.cgi?id=75793>.
- m_frame->domWindow()->setSecurityOrigin(securityOrigin());
m_frame->script()->updateSecurityOrigin();
}
@@ -5543,15 +5550,14 @@ void Document::webkitExitFullscreen()
// 2. Queue a task to fire an event named fullscreenchange with its bubbles attribute set to true
// on doc.
- Node* target = currentDoc->m_fullScreenElement.get();
- if (!target)
- target = currentDoc;
addDocumentToFullScreenChangeEventQueue(currentDoc);
// 3. If doc's fullscreen element stack is empty and doc's browsing context has a browsing context
// container, set doc to that browsing context container's node document.
- if (!newTop && currentDoc->ownerElement())
+ if (!newTop && currentDoc->ownerElement()) {
currentDoc = currentDoc->ownerElement()->document();
+ continue;
+ }
// 4. Otherwise, set doc to null.
currentDoc = 0;
@@ -5664,7 +5670,13 @@ void Document::webkitDidExitFullScreenForElement(Element*)
m_fullScreenElement = 0;
scheduleForcedStyleRecalc();
- m_fullScreenChangeDelayTimer.startOneShot(0);
+ // When webkitCancelFullScreen is called, we call webkitExitFullScreen on the topDocument(). That
+ // means that the events will be queued there. So if we have no events here, start the timer on
+ // the exiting document.
+ Document* exitingDocument = this;
+ if (m_fullScreenChangeEventTargetQueue.isEmpty() && m_fullScreenErrorEventTargetQueue.isEmpty())
+ exitingDocument = topDocument();
+ exitingDocument->m_fullScreenChangeDelayTimer.startOneShot(0);
}
void Document::setFullScreenRenderer(RenderFullScreen* renderer)
@@ -5735,8 +5747,9 @@ void Document::fullScreenChangeDelayTimerFired(Timer<Document>*)
if (!node)
node = documentElement();
- // If the element was removed from our tree, also message the documentElement.
- if (!contains(node.get()))
+ // If the element was removed from our tree, also message the documentElement. Since we may
+ // have a document hierarchy, check that node isn't in another document.
+ if (!contains(node.get()) && !node->inDocument())
changeQueue.append(documentElement());
node->dispatchEvent(Event::create(eventNames().webkitfullscreenchangeEvent, true, false));
@@ -5750,8 +5763,9 @@ void Document::fullScreenChangeDelayTimerFired(Timer<Document>*)
if (!node)
node = documentElement();
- // If the node was removed from our tree, also message the documentElement.
- if (!contains(node.get()))
+ // If the element was removed from our tree, also message the documentElement. Since we may
+ // have a document hierarchy, check that node isn't in another document.
+ if (!contains(node.get()) && !node->inDocument())
errorQueue.append(documentElement());
node->dispatchEvent(Event::create(eventNames().webkitfullscreenerrorEvent, true, false));
@@ -5968,7 +5982,6 @@ void Document::didRemoveTouchEventHandler()
if (m_touchEventHandlerCount)
return;
- m_listenerTypes &= ~TOUCH_LISTENER;
Page* page = this->page();
if (!page)
return;
@@ -6142,7 +6155,7 @@ void Document::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
PassRefPtr<UndoManager> Document::undoManager()
{
if (!m_undoManager)
- m_undoManager = UndoManager::create(this);
+ m_undoManager = UndoManager::create(this, this);
return m_undoManager;
}
#endif
diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h
index c6767f864..a0419aa39 100644
--- a/Source/WebCore/dom/Document.h
+++ b/Source/WebCore/dom/Document.h
@@ -480,7 +480,13 @@ public:
/**
* Updates the pending sheet count and then calls updateActiveStylesheets.
*/
- void removePendingSheet();
+ enum RemovePendingSheetNotificationType {
+ RemovePendingSheetNotifyImmediately,
+ RemovePendingSheetNotifyLater
+ };
+
+ void removePendingSheet(RemovePendingSheetNotificationType = RemovePendingSheetNotifyImmediately);
+ void notifyRemovePendingSheetIfNeeded();
/**
* This method returns true if all top-level stylesheets have loaded (including
@@ -766,8 +772,12 @@ public:
void textNodesMerged(Text* oldNode, unsigned offset);
void textNodeSplit(Text* oldNode);
+ void createDOMWindow();
+ void takeDOMWindowFrom(Document*);
+
+ DOMWindow* domWindow() const { return m_domWindow.get(); }
+ // In DOM Level 2, the Document's DOMWindow is called the defaultView.
DOMWindow* defaultView() const { return domWindow(); }
- DOMWindow* domWindow() const;
// Helper functions for forwarding DOMWindow event related tasks to the DOMWindow if it exists.
void setWindowAttributeEventListener(const AtomicString& eventType, PassRefPtr<EventListener>);
@@ -793,12 +803,10 @@ public:
ANIMATIONITERATION_LISTENER = 0x400,
TRANSITIONEND_LISTENER = 0x800,
BEFORELOAD_LISTENER = 0x1000,
- TOUCH_LISTENER = 0x2000,
- SCROLL_LISTENER = 0x4000
+ SCROLL_LISTENER = 0x2000
};
bool hasListenerType(ListenerType listenerType) const { return (m_listenerTypes & listenerType); }
- void addListenerType(ListenerType listenerType) { m_listenerTypes = m_listenerTypes | listenerType; }
void addListenerTypeIfNeeded(const AtomicString& eventType);
#if ENABLE(MUTATION_OBSERVERS)
@@ -1198,7 +1206,7 @@ private:
virtual String nodeName() const;
virtual NodeType nodeType() const;
virtual bool childTypeAllowed(NodeType) const;
- virtual PassRefPtr<Node> cloneNode(bool deep);
+ virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&);
virtual bool canReplaceChild(Node* newChild, Node* oldChild);
virtual void refScriptExecutionContext() { ref(); }
@@ -1226,6 +1234,8 @@ private:
void collectActiveStylesheets(Vector<RefPtr<StyleSheet> >&);
bool testAddedStylesheetRequiresStyleRecalc(StyleSheetContents*);
void analyzeStylesheetChange(StyleResolverUpdateFlag, const Vector<RefPtr<StyleSheet> >& newStylesheets, bool& requiresStyleResolverReset, bool& requiresFullStyleRecalc);
+ void didRemoveAllPendingStylesheet();
+ void setNeedsNotifyRemoveAllPendingStylesheet() { m_needsNotifyRemoveAllPendingStylesheet = true; }
void seamlessParentUpdatedStylesheets();
void notifySeamlessChildDocumentsOfStylesheetUpdate() const;
@@ -1257,6 +1267,9 @@ private:
void setVisualUpdatesAllowed(bool);
void visualUpdatesSuppressionTimerFired(Timer<Document>*);
+ void addListenerType(ListenerType listenerType) { m_listenerTypes |= listenerType; }
+ void addMutationEventListenerTypeIfEnabled(ListenerType);
+
int m_guardRefCount;
OwnPtr<StyleResolver> m_styleResolver;
@@ -1265,6 +1278,8 @@ private:
Vector<OwnPtr<FontData> > m_customFonts;
Frame* m_frame;
+ RefPtr<DOMWindow> m_domWindow;
+
OwnPtr<CachedResourceLoader> m_cachedResourceLoader;
RefPtr<DocumentParser> m_parser;
RefPtr<ContextFeatures> m_contextFeatures;
@@ -1301,7 +1316,8 @@ private:
// But sometimes you need to ignore pending stylesheet count to
// force an immediate layout when requested by JS.
- bool m_ignorePendingStylesheets;
+ bool m_ignorePendingStylesheets : 1;
+ bool m_needsNotifyRemoveAllPendingStylesheet : 1;
// If we do ignore the pending stylesheet count, then we need to add a boolean
// to track that this happened so that we can do a full repaint when the stylesheets
@@ -1555,6 +1571,12 @@ private:
#endif
};
+inline void Document::notifyRemovePendingSheetIfNeeded()
+{
+ if (m_needsNotifyRemoveAllPendingStylesheet)
+ didRemoveAllPendingStylesheet();
+}
+
// Put these methods here, because they require the Document definition, but we really want to inline them.
inline bool Node::isDocumentNode() const
diff --git a/Source/WebCore/dom/DocumentFragment.cpp b/Source/WebCore/dom/DocumentFragment.cpp
index f7cfadfcc..77ebc2bdf 100644
--- a/Source/WebCore/dom/DocumentFragment.cpp
+++ b/Source/WebCore/dom/DocumentFragment.cpp
@@ -68,7 +68,7 @@ bool DocumentFragment::childTypeAllowed(NodeType type) const
}
}
-PassRefPtr<Node> DocumentFragment::cloneNode(bool deep)
+PassRefPtr<Node> DocumentFragment::cloneNode(bool deep, ExceptionCode&)
{
RefPtr<DocumentFragment> clone = create(document());
if (deep)
diff --git a/Source/WebCore/dom/DocumentFragment.h b/Source/WebCore/dom/DocumentFragment.h
index 3af5f1b28..cefe1388b 100644
--- a/Source/WebCore/dom/DocumentFragment.h
+++ b/Source/WebCore/dom/DocumentFragment.h
@@ -44,7 +44,7 @@ protected:
private:
virtual NodeType nodeType() const;
- virtual PassRefPtr<Node> cloneNode(bool deep);
+ virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&);
virtual bool childTypeAllowed(NodeType) const;
};
diff --git a/Source/WebCore/dom/DocumentType.cpp b/Source/WebCore/dom/DocumentType.cpp
index cd1d48534..29b5c7d44 100644
--- a/Source/WebCore/dom/DocumentType.cpp
+++ b/Source/WebCore/dom/DocumentType.cpp
@@ -51,7 +51,7 @@ Node::NodeType DocumentType::nodeType() const
return DOCUMENT_TYPE_NODE;
}
-PassRefPtr<Node> DocumentType::cloneNode(bool /*deep*/)
+PassRefPtr<Node> DocumentType::cloneNode(bool /*deep*/, ExceptionCode&)
{
return create(document(), m_name, m_publicId, m_systemId);
}
diff --git a/Source/WebCore/dom/DocumentType.h b/Source/WebCore/dom/DocumentType.h
index 6c6412459..65416164c 100644
--- a/Source/WebCore/dom/DocumentType.h
+++ b/Source/WebCore/dom/DocumentType.h
@@ -52,7 +52,7 @@ private:
virtual KURL baseURI() const;
virtual String nodeName() const;
virtual NodeType nodeType() const;
- virtual PassRefPtr<Node> cloneNode(bool deep);
+ virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&);
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
virtual void removedFrom(ContainerNode*) OVERRIDE;
diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp
index 287780268..53d6a2982 100644
--- a/Source/WebCore/dom/Element.cpp
+++ b/Source/WebCore/dom/Element.cpp
@@ -146,6 +146,13 @@ Element::~Element()
ASSERT(m_attributeData);
m_attributeData->detachAttrObjectsFromElement(this);
}
+
+#if ENABLE(UNDO_MANAGER)
+ if (hasRareData() && elementRareData()->m_undoManager) {
+ elementRareData()->m_undoManager->disconnect();
+ elementRareData()->m_undoManager.clear();
+ }
+#endif
}
inline ElementRareData* Element::elementRareData() const
@@ -169,7 +176,7 @@ DEFINE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER(Element, error);
DEFINE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER(Element, focus);
DEFINE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER(Element, load);
-PassRefPtr<Node> Element::cloneNode(bool deep)
+PassRefPtr<Node> Element::cloneNode(bool deep, ExceptionCode&)
{
return deep ? cloneElementWithChildren() : cloneElementWithoutChildren();
}
@@ -724,26 +731,26 @@ void Element::attributeChanged(const Attribute& attribute)
const QualifiedName& attrName = attribute.name();
if (attrName == aria_activedescendantAttr) {
// any change to aria-activedescendant attribute triggers accessibility focus change, but document focus remains intact
- document()->axObjectCache()->handleActiveDescendantChanged(renderer());
+ document()->axObjectCache()->handleActiveDescendantChanged(this);
} else if (attrName == roleAttr) {
// the role attribute can change at any time, and the AccessibilityObject must pick up these changes
- document()->axObjectCache()->handleAriaRoleChanged(renderer());
+ document()->axObjectCache()->handleAriaRoleChanged(this);
} else if (attrName == aria_valuenowAttr) {
// If the valuenow attribute changes, AX clients need to be notified.
- document()->axObjectCache()->postNotification(renderer(), AXObjectCache::AXValueChanged, true);
+ document()->axObjectCache()->postNotification(this, AXObjectCache::AXValueChanged, true);
} else if (attrName == aria_labelAttr || attrName == aria_labeledbyAttr || attrName == altAttr || attrName == titleAttr) {
// If the content of an element changes due to an attribute change, notify accessibility.
- document()->axObjectCache()->contentChanged(renderer());
+ document()->axObjectCache()->contentChanged(this);
} else if (attrName == aria_checkedAttr)
- document()->axObjectCache()->checkedStateChanged(renderer());
+ document()->axObjectCache()->checkedStateChanged(this);
else if (attrName == aria_selectedAttr)
- document()->axObjectCache()->selectedChildrenChanged(renderer());
+ document()->axObjectCache()->selectedChildrenChanged(this);
else if (attrName == aria_expandedAttr)
- document()->axObjectCache()->handleAriaExpandedChange(renderer());
+ document()->axObjectCache()->handleAriaExpandedChange(this);
else if (attrName == aria_hiddenAttr)
- document()->axObjectCache()->childrenChanged(renderer());
+ document()->axObjectCache()->childrenChanged(this);
else if (attrName == aria_invalidAttr)
- document()->axObjectCache()->postNotification(renderer(), AXObjectCache::AXInvalidStatusChanged, true);
+ document()->axObjectCache()->postNotification(this, AXObjectCache::AXInvalidStatusChanged, true);
}
// Returns true is the given attribute is an event handler.
@@ -2237,7 +2244,7 @@ PassRefPtr<UndoManager> Element::undoManager()
}
ElementRareData* data = ensureElementRareData();
if (!data->m_undoManager)
- data->m_undoManager = UndoManager::create(this);
+ data->m_undoManager = UndoManager::create(document(), this);
return data->m_undoManager;
}
@@ -2249,7 +2256,6 @@ void Element::disconnectUndoManager()
UndoManager* undoManager = data->m_undoManager.get();
if (!undoManager)
return;
- undoManager->clearUndoRedo();
undoManager->disconnect();
data->m_undoManager.clear();
}
diff --git a/Source/WebCore/dom/Element.h b/Source/WebCore/dom/Element.h
index d056a9d43..d9385486f 100644
--- a/Source/WebCore/dom/Element.h
+++ b/Source/WebCore/dom/Element.h
@@ -501,7 +501,7 @@ private:
// cloneNode is private so that non-virtual cloneElementWithChildren and cloneElementWithoutChildren
// are used instead.
- virtual PassRefPtr<Node> cloneNode(bool deep);
+ virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&);
virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren();
QualifiedName m_tagName;
diff --git a/Source/WebCore/dom/ElementAttributeData.cpp b/Source/WebCore/dom/ElementAttributeData.cpp
index bddc6e027..b743c5e3b 100644
--- a/Source/WebCore/dom/ElementAttributeData.cpp
+++ b/Source/WebCore/dom/ElementAttributeData.cpp
@@ -295,6 +295,8 @@ void ElementAttributeData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo)
info.addVectorPtr(m_mutableAttributeVector);
else
info.addRawBuffer(m_attributes, m_arraySize * sizeof(Attribute));
+ for (unsigned i = 0, len = length(); i < len; i++)
+ info.addInstrumentedMember(*attributeItem(i));
}
size_t ElementAttributeData::getAttributeItemIndexSlowCase(const AtomicString& name, bool shouldIgnoreAttributeCase) const
diff --git a/Source/WebCore/dom/ElementAttributeData.h b/Source/WebCore/dom/ElementAttributeData.h
index 691f7332c..b96b95b54 100644
--- a/Source/WebCore/dom/ElementAttributeData.h
+++ b/Source/WebCore/dom/ElementAttributeData.h
@@ -79,7 +79,6 @@ public:
// These functions do no error checking.
void addAttribute(const Attribute&, Element*, SynchronizationOfLazyAttribute = NotInSynchronizationOfLazyAttribute);
- void removeAttribute(const QualifiedName&, Element*);
void removeAttribute(size_t index, Element*, SynchronizationOfLazyAttribute = NotInSynchronizationOfLazyAttribute);
PassRefPtr<Attr> takeAttribute(size_t index, Element*);
@@ -135,15 +134,6 @@ inline size_t ElementAttributeData::length() const
return m_arraySize;
}
-inline void ElementAttributeData::removeAttribute(const QualifiedName& name, Element* element)
-{
- size_t index = getAttributeItemIndex(name);
- if (index == notFound)
- return;
-
- removeAttribute(index, element);
-}
-
inline Attribute* ElementAttributeData::getAttributeItem(const AtomicString& name, bool shouldIgnoreAttributeCase)
{
size_t index = getAttributeItemIndex(name, shouldIgnoreAttributeCase);
diff --git a/Source/WebCore/dom/EntityReference.cpp b/Source/WebCore/dom/EntityReference.cpp
index 72944ec52..fb9e2478c 100644
--- a/Source/WebCore/dom/EntityReference.cpp
+++ b/Source/WebCore/dom/EntityReference.cpp
@@ -46,7 +46,7 @@ Node::NodeType EntityReference::nodeType() const
return ENTITY_REFERENCE_NODE;
}
-PassRefPtr<Node> EntityReference::cloneNode(bool)
+PassRefPtr<Node> EntityReference::cloneNode(bool, ExceptionCode&)
{
return create(document(), m_entityName);
}
diff --git a/Source/WebCore/dom/EntityReference.h b/Source/WebCore/dom/EntityReference.h
index 7a6f6c36b..49f80161a 100644
--- a/Source/WebCore/dom/EntityReference.h
+++ b/Source/WebCore/dom/EntityReference.h
@@ -35,7 +35,7 @@ private:
virtual String nodeName() const;
virtual NodeType nodeType() const;
- virtual PassRefPtr<Node> cloneNode(bool deep);
+ virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&);
String m_entityName;
};
diff --git a/Source/WebCore/dom/EventDispatcher.cpp b/Source/WebCore/dom/EventDispatcher.cpp
index e1a60f3d4..e58390c5e 100644
--- a/Source/WebCore/dom/EventDispatcher.cpp
+++ b/Source/WebCore/dom/EventDispatcher.cpp
@@ -151,39 +151,6 @@ inline static EventTarget* eventTargetRespectingSVGTargetRules(Node* referenceNo
return referenceNode;
}
-void EventDispatcher::dispatchScopedEvent(Node* node, PassRefPtr<EventDispatchMediator> mediator)
-{
- // We need to set the target here because it can go away by the time we actually fire the event.
- mediator->event()->setTarget(eventTargetRespectingSVGTargetRules(node));
- ScopedEventQueue::instance()->enqueueEventDispatchMediator(mediator);
-}
-
-void EventDispatcher::dispatchSimulatedClick(Node* node, PassRefPtr<Event> underlyingEvent, bool sendMouseEvents, bool showPressedLook)
-{
- if (node->disabled())
- return;
-
- if (!gNodesDispatchingSimulatedClicks)
- gNodesDispatchingSimulatedClicks = new HashSet<Node*>;
- else if (gNodesDispatchingSimulatedClicks->contains(node))
- return;
-
- gNodesDispatchingSimulatedClicks->add(node);
-
- // send mousedown and mouseup before the click, if requested
- if (sendMouseEvents)
- EventDispatcher(node).dispatchEvent(SimulatedMouseEvent::create(eventNames().mousedownEvent, node->document()->defaultView(), underlyingEvent));
- node->setActive(true, showPressedLook);
- if (sendMouseEvents)
- EventDispatcher(node).dispatchEvent(SimulatedMouseEvent::create(eventNames().mouseupEvent, node->document()->defaultView(), underlyingEvent));
- node->setActive(false);
-
- // always send click
- EventDispatcher(node).dispatchEvent(SimulatedMouseEvent::create(eventNames().clickEvent, node->document()->defaultView(), underlyingEvent));
-
- gNodesDispatchingSimulatedClicks->remove(node);
-}
-
void EventDispatcher::adjustRelatedTarget(Event* event, PassRefPtr<EventTarget> prpRelatedTarget)
{
if (!prpRelatedTarget)
@@ -238,6 +205,39 @@ void EventDispatcher::ensureEventAncestors(Event* event)
}
}
+void EventDispatcher::dispatchScopedEvent(Node* node, PassRefPtr<EventDispatchMediator> mediator)
+{
+ // We need to set the target here because it can go away by the time we actually fire the event.
+ mediator->event()->setTarget(eventTargetRespectingSVGTargetRules(node));
+ ScopedEventQueue::instance()->enqueueEventDispatchMediator(mediator);
+}
+
+void EventDispatcher::dispatchSimulatedClick(Node* node, PassRefPtr<Event> underlyingEvent, bool sendMouseEvents, bool showPressedLook)
+{
+ if (node->disabled())
+ return;
+
+ if (!gNodesDispatchingSimulatedClicks)
+ gNodesDispatchingSimulatedClicks = new HashSet<Node*>;
+ else if (gNodesDispatchingSimulatedClicks->contains(node))
+ return;
+
+ gNodesDispatchingSimulatedClicks->add(node);
+
+ // send mousedown and mouseup before the click, if requested
+ if (sendMouseEvents)
+ EventDispatcher(node).dispatchEvent(SimulatedMouseEvent::create(eventNames().mousedownEvent, node->document()->defaultView(), underlyingEvent));
+ node->setActive(true, showPressedLook);
+ if (sendMouseEvents)
+ EventDispatcher(node).dispatchEvent(SimulatedMouseEvent::create(eventNames().mouseupEvent, node->document()->defaultView(), underlyingEvent));
+ node->setActive(false);
+
+ // always send click
+ EventDispatcher(node).dispatchEvent(SimulatedMouseEvent::create(eventNames().clickEvent, node->document()->defaultView(), underlyingEvent));
+
+ gNodesDispatchingSimulatedClicks->remove(node);
+}
+
bool EventDispatcher::dispatchEvent(PassRefPtr<Event> prpEvent)
{
#ifndef NDEBUG
@@ -395,6 +395,8 @@ EventDispatchBehavior EventDispatcher::determineDispatchBehavior(Event* event, S
if (inTheSameScope(shadowRoot, target)
&& (eventType == eventNames().abortEvent
|| eventType == eventNames().changeEvent
+ || eventType == eventNames().errorEvent
+ || eventType == eventNames().loadEvent
|| eventType == eventNames().resetEvent
|| eventType == eventNames().resizeEvent
|| eventType == eventNames().scrollEvent
diff --git a/Source/WebCore/dom/EventNames.h b/Source/WebCore/dom/EventNames.h
index 6d0a10573..a2faec128 100644
--- a/Source/WebCore/dom/EventNames.h
+++ b/Source/WebCore/dom/EventNames.h
@@ -115,6 +115,7 @@ namespace WebCore {
macro(textInput) \
macro(unload) \
macro(updateready) \
+ macro(upgradeneeded) \
macro(versionchange) \
macro(webkitvisibilitychange) \
macro(write) \
diff --git a/Source/WebCore/dom/EventNames.in b/Source/WebCore/dom/EventNames.in
index 5da57ffc6..22aaa7b07 100644
--- a/Source/WebCore/dom/EventNames.in
+++ b/Source/WebCore/dom/EventNames.in
@@ -39,6 +39,7 @@ StorageEvent
SVGEvents interfaceName=Event, conditional=SVG
SVGZoomEvent conditional=SVG
SVGZoomEvents interfaceName=SVGZoomEvent, conditional=SVG
+IDBUpgradeNeededEvent conditional=INDEXED_DATABASE
IDBVersionChangeEvent conditional=INDEXED_DATABASE
TouchEvent conditional=TOUCH_EVENTS, runtimeConditional=touchEnabled
DeviceMotionEvent conditional=DEVICE_ORIENTATION
diff --git a/Source/WebCore/dom/EventTargetFactory.in b/Source/WebCore/dom/EventTargetFactory.in
index 6d972c396..791bd4eda 100644
--- a/Source/WebCore/dom/EventTargetFactory.in
+++ b/Source/WebCore/dom/EventTargetFactory.in
@@ -9,6 +9,7 @@ EventSource
FileReader conditional=BLOB
FileWriter conditional=FILE_SYSTEM
IDBDatabase conditional=INDEXED_DATABASE
+IDBOpenDBRequest conditional=INDEXED_DATABASE
IDBRequest conditional=INDEXED_DATABASE
IDBTransaction conditional=INDEXED_DATABASE
IDBVersionChangeRequest conditional=INDEXED_DATABASE
diff --git a/Source/WebCore/dom/MemoryInstrumentation.cpp b/Source/WebCore/dom/MemoryInstrumentation.cpp
index 8a0175356..a9fefcaca 100644
--- a/Source/WebCore/dom/MemoryInstrumentation.cpp
+++ b/Source/WebCore/dom/MemoryInstrumentation.cpp
@@ -58,4 +58,9 @@ void MemoryInstrumentation::addObject(const KURL& url, ObjectType objectType)
addObject(url.innerURL(), objectType);
}
+void MemoryInstrumentation::addInstrumentedObjectImpl(const AtomicString* const& string, ObjectType objectType, OwningType)
+{
+ addObject(static_cast<const String&>(*string), objectType);
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/dom/MemoryInstrumentation.h b/Source/WebCore/dom/MemoryInstrumentation.h
index 33f2e6e8a..c0c2d375a 100644
--- a/Source/WebCore/dom/MemoryInstrumentation.h
+++ b/Source/WebCore/dom/MemoryInstrumentation.h
@@ -137,6 +137,10 @@ private:
static void addObject(MemoryInstrumentation* instrumentation, const T* const& t, ObjectType ownerObjectType) { instrumentation->addObjectImpl(t, ownerObjectType, byPointer); }
};
+ // FIXME: get rid of addObject(String)
+ void addInstrumentedObjectImpl(const String* const& string, ObjectType objectType, OwningType) { addObject(*string, objectType); }
+ void addInstrumentedObjectImpl(const StringImpl* const& string, ObjectType objectType, OwningType) { addObject(string, objectType); }
+ void addInstrumentedObjectImpl(const AtomicString* const&, ObjectType, OwningType);
template <typename T> void addInstrumentedObjectImpl(const T* const&, ObjectType, OwningType);
template <typename T> void addInstrumentedObjectImpl(const DataRef<T>* const&, ObjectType, OwningType);
template <typename T> void addInstrumentedObjectImpl(const OwnPtr<T>* const&, ObjectType, OwningType);
@@ -164,10 +168,10 @@ public:
private:
friend class MemoryClassInfo;
- template <typename T> void reportObjectInfo(MemoryInstrumentation::ObjectType objectType)
+ template <typename T> void reportObjectInfo(MemoryInstrumentation::ObjectType objectType, size_t actualSize)
{
if (!m_objectSize) {
- m_objectSize = sizeof(T);
+ m_objectSize = actualSize ? actualSize : sizeof(T);
if (objectType != MemoryInstrumentation::Other)
m_objectType = objectType;
}
@@ -181,11 +185,11 @@ private:
class MemoryClassInfo {
public:
template <typename T>
- MemoryClassInfo(MemoryObjectInfo* memoryObjectInfo, const T*, MemoryInstrumentation::ObjectType objectType)
+ MemoryClassInfo(MemoryObjectInfo* memoryObjectInfo, const T*, MemoryInstrumentation::ObjectType objectType, size_t actualSize = 0)
: m_memoryObjectInfo(memoryObjectInfo)
, m_memoryInstrumentation(memoryObjectInfo->memoryInstrumentation())
{
- m_memoryObjectInfo->reportObjectInfo<T>(objectType);
+ m_memoryObjectInfo->reportObjectInfo<T>(objectType, actualSize);
m_objectType = memoryObjectInfo->objectType();
}
diff --git a/Source/WebCore/dom/MessagePort.idl b/Source/WebCore/dom/MessagePort.idl
index f318f7987..9f393b437 100644
--- a/Source/WebCore/dom/MessagePort.idl
+++ b/Source/WebCore/dom/MessagePort.idl
@@ -37,9 +37,9 @@ module events {
// We need to have something as an ObjC binding, because MessagePort is used in MessageEvent, which already has one,
// but we don't want to actually expose the API while it is in flux.
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- [Custom] void postMessage(in DOMString message, in [Optional] Array messagePorts)
+ [Custom] void postMessage(in any message, in [Optional] Array messagePorts)
raises(DOMException);
- [Custom] void webkitPostMessage(in DOMString message, in [Optional] Array transfer)
+ [Custom] void webkitPostMessage(in any message, in [Optional] Array transfer)
raises(DOMException);
void start();
void close();
diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp
index 3841e0cdd..a3a1c22f2 100644
--- a/Source/WebCore/dom/Node.cpp
+++ b/Source/WebCore/dom/Node.cpp
@@ -414,7 +414,7 @@ Node::~Node()
Document* doc = m_document;
if (AXObjectCache::accessibilityEnabled() && doc && doc->axObjectCacheExists())
- doc->axObjectCache()->removeNodeForUse(this);
+ doc->axObjectCache()->remove(this);
if (m_previous)
m_previous->setNextSibling(0);
@@ -919,13 +919,6 @@ bool Node::isFocusable() const
if (!inDocument() || !supportsFocus())
return false;
- if (renderer())
- ASSERT(!renderer()->needsLayout());
- else
- // If the node is in a display:none tree it might say it needs style recalc but
- // the whole document is actually up to date.
- ASSERT(!document()->childNeedsStyleRecalc());
-
// Elements in canvas fallback content are not rendered, but they are allowed to be
// focusable as long as their canvas is displayed and visible.
if (isElementNode() && toElement(this)->isInCanvasSubtree()) {
@@ -936,6 +929,13 @@ bool Node::isFocusable() const
return e->renderer() && e->renderer()->style()->visibility() == VISIBLE;
}
+ if (renderer())
+ ASSERT(!renderer()->needsLayout());
+ else
+ // If the node is in a display:none tree it might say it needs style recalc but
+ // the whole document is actually up to date.
+ ASSERT(!document()->childNeedsStyleRecalc());
+
// FIXME: Even if we are not visible, we might have a child that is visible.
// Hyatt wants to fix that some day with a "has visible content" flag or the like.
if (!renderer() || renderer()->style()->visibility() != VISIBLE)
@@ -1283,6 +1283,10 @@ void Node::attach()
setAttached();
clearNeedsStyleRecalc();
+
+ Document* doc = m_document;
+ if (AXObjectCache::accessibilityEnabled() && doc && doc->axObjectCacheExists())
+ doc->axObjectCache()->updateCacheAfterNodeIsAttached(this);
}
#ifndef NDEBUG
diff --git a/Source/WebCore/dom/Node.h b/Source/WebCore/dom/Node.h
index 141ce96bb..439aa936a 100644
--- a/Source/WebCore/dom/Node.h
+++ b/Source/WebCore/dom/Node.h
@@ -27,6 +27,7 @@
#include "EditingBoundary.h"
#include "EventTarget.h"
+#include "ExceptionCodePlaceholder.h"
#include "KURLHash.h"
#include "LayoutTypes.h"
#include "MutationObserver.h"
@@ -186,7 +187,8 @@ public:
void remove(ExceptionCode&);
bool hasChildNodes() const { return firstChild(); }
- virtual PassRefPtr<Node> cloneNode(bool deep) = 0;
+ virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&) = 0;
+ PassRefPtr<Node> cloneNode(bool deep) { return cloneNode(deep, ASSERT_NO_EXCEPTION); }
const AtomicString& localName() const { return virtualLocalName(); }
const AtomicString& namespaceURI() const { return virtualNamespaceURI(); }
const AtomicString& prefix() const { return virtualPrefix(); }
@@ -545,11 +547,11 @@ public:
//
enum InsertionNotificationRequest {
InsertionDone,
- InsertionShouldCallDidNotifyDescendantInsertions
+ InsertionShouldCallDidNotifySubtreeInsertions
};
virtual InsertionNotificationRequest insertedInto(ContainerNode* insertionPoint);
- virtual void didNotifyDescendantInsertions(ContainerNode*) { }
+ virtual void didNotifySubtreeInsertions(ContainerNode*) { }
// Notifies the node that it is no longer part of the tree.
//
diff --git a/Source/WebCore/dom/Node.idl b/Source/WebCore/dom/Node.idl
index fc4a882ab..85feaee12 100644
--- a/Source/WebCore/dom/Node.idl
+++ b/Source/WebCore/dom/Node.idl
@@ -79,7 +79,9 @@ module core {
raises(DOMException);
boolean hasChildNodes();
- Node cloneNode(in [Optional=DefaultIsUndefined] boolean deep);
+ Node cloneNode(in [Optional=DefaultIsUndefined] boolean deep)
+ raises(DOMException);
+
void normalize();
// Introduced in DOM Level 2:
diff --git a/Source/WebCore/dom/NodeRenderingContext.cpp b/Source/WebCore/dom/NodeRenderingContext.cpp
index 84bdf90eb..c8e23502d 100644
--- a/Source/WebCore/dom/NodeRenderingContext.cpp
+++ b/Source/WebCore/dom/NodeRenderingContext.cpp
@@ -49,9 +49,6 @@ namespace WebCore {
using namespace HTMLNames;
-static RenderObject* firstRendererOf(Node*);
-static RenderObject* lastRendererOf(Node*);
-
NodeRenderingContext::NodeRenderingContext(Node* node)
: m_node(node)
, m_style(0)
@@ -82,93 +79,6 @@ PassRefPtr<RenderStyle> NodeRenderingContext::releaseStyle()
return m_style.release();
}
-static inline RenderObject* nextRendererOfInsertionPoint(InsertionPoint* parent, Node* current)
-{
- size_t start = parent->indexOf(current);
- if (notFound == start)
- return 0;
-
- for (size_t i = start + 1; i < parent->size(); ++i) {
- if (RenderObject* renderer = parent->at(i)->renderer())
- return renderer;
- }
-
- return 0;
-}
-
-static inline RenderObject* previousRendererOfInsertionPoint(InsertionPoint* parent, Node* current)
-{
- RenderObject* lastRenderer = 0;
-
- for (size_t i = 0; i < parent->size(); ++i) {
- if (parent->at(i) == current)
- break;
- if (RenderObject* renderer = parent->at(i)->renderer())
- lastRenderer = renderer;
- }
-
- return lastRenderer;
-}
-
-static inline RenderObject* firstRendererOfInsertionPoint(InsertionPoint* parent)
-{
- size_t size = parent->size();
- for (size_t i = 0; i < size; ++i) {
- if (RenderObject* renderer = parent->at(i)->renderer())
- return renderer;
- }
-
- return firstRendererOf(parent->firstChild());
-}
-
-static inline RenderObject* lastRendererOfInsertionPoint(InsertionPoint* parent)
-{
- size_t size = parent->size();
- for (size_t i = 0; i < size; ++i) {
- if (RenderObject* renderer = parent->at(size - 1 - i)->renderer())
- return renderer;
- }
-
- return lastRendererOf(parent->lastChild());
-}
-
-static inline RenderObject* firstRendererOf(Node* node)
-{
- for (; node; node = node->nextSibling()) {
- if (node->renderer()) {
- // Do not return elements that are attached to a different flow-thread.
- if (node->renderer()->style() && !node->renderer()->style()->flowThread().isEmpty())
- continue;
- return node->renderer();
- }
-
- if (isInsertionPoint(node) && toInsertionPoint(node)->isActive()) {
- if (RenderObject* first = firstRendererOfInsertionPoint(toInsertionPoint(node)))
- return first;
- }
- }
-
- return 0;
-}
-
-static inline RenderObject* lastRendererOf(Node* node)
-{
- for (; node; node = node->previousSibling()) {
- if (node->renderer()) {
- // Do not return elements that are attached to a different flow-thread.
- if (node->renderer()->style() && !node->renderer()->style()->flowThread().isEmpty())
- continue;
- return node->renderer();
- }
- if (isInsertionPoint(node) && toInsertionPoint(node)->isActive()) {
- if (RenderObject* last = lastRendererOfInsertionPoint(toInsertionPoint(node)))
- return last;
- }
- }
-
- return 0;
-}
-
RenderObject* NodeRenderingContext::nextRenderer() const
{
if (RenderObject* renderer = m_node->renderer())
@@ -177,18 +87,26 @@ RenderObject* NodeRenderingContext::nextRenderer() const
if (m_parentFlowRenderer)
return m_parentFlowRenderer->nextRendererForNode(m_node);
- if (m_parentDetails.insertionPoint()) {
- if (RenderObject* found = nextRendererOfInsertionPoint(m_parentDetails.insertionPoint(), m_node))
- return found;
- return NodeRenderingContext(m_parentDetails.insertionPoint()).nextRenderer();
- }
-
// Avoid an O(N^2) problem with this function by not checking for
// nextRenderer() when the parent element hasn't attached yet.
- if (m_node->parentOrHostNode() && !m_node->parentOrHostNode()->attached())
+ if (m_parentDetails.node() && !m_parentDetails.node()->attached())
return 0;
- return firstRendererOf(m_node->nextSibling());
+ ComposedShadowTreeWalker walker(m_node);
+ do {
+ walker.nextSibling();
+ if (!walker.get())
+ return 0;
+ if (RenderObject* renderer = walker.get()->renderer()) {
+ // Do not return elements that are attached to a different flow-thread.
+ if (renderer->style() && !renderer->style()->flowThread().isEmpty())
+ continue;
+ return renderer;
+ }
+ } while (true);
+
+ ASSERT_NOT_REACHED();
+ return 0;
}
RenderObject* NodeRenderingContext::previousRenderer() const
@@ -199,15 +117,24 @@ RenderObject* NodeRenderingContext::previousRenderer() const
if (m_parentFlowRenderer)
return m_parentFlowRenderer->previousRendererForNode(m_node);
- if (m_parentDetails.insertionPoint()) {
- if (RenderObject* found = previousRendererOfInsertionPoint(m_parentDetails.insertionPoint(), m_node))
- return found;
- return NodeRenderingContext(m_parentDetails.insertionPoint()).previousRenderer();
- }
-
// FIXME: We should have the same O(N^2) avoidance as nextRenderer does
// however, when I tried adding it, several tests failed.
- return lastRendererOf(m_node->previousSibling());
+
+ ComposedShadowTreeWalker walker(m_node);
+ do {
+ walker.previousSibling();
+ if (!walker.get())
+ return 0;
+ if (RenderObject* renderer = walker.get()->renderer()) {
+ // Do not return elements that are attached to a different flow-thread.
+ if (renderer->style() && !renderer->style()->flowThread().isEmpty())
+ continue;
+ return renderer;
+ }
+ } while (true);
+
+ ASSERT_NOT_REACHED();
+ return 0;
}
RenderObject* NodeRenderingContext::parentRenderer() const
diff --git a/Source/WebCore/dom/Notation.cpp b/Source/WebCore/dom/Notation.cpp
index f62e630aa..39592115f 100644
--- a/Source/WebCore/dom/Notation.cpp
+++ b/Source/WebCore/dom/Notation.cpp
@@ -43,7 +43,7 @@ Node::NodeType Notation::nodeType() const
return NOTATION_NODE;
}
-PassRefPtr<Node> Notation::cloneNode(bool /*deep*/)
+PassRefPtr<Node> Notation::cloneNode(bool /*deep*/, ExceptionCode&)
{
// Spec says cloning Notation nodes is "implementation dependent". We do not support it.
return 0;
diff --git a/Source/WebCore/dom/Notation.h b/Source/WebCore/dom/Notation.h
index b2155ba05..886077688 100644
--- a/Source/WebCore/dom/Notation.h
+++ b/Source/WebCore/dom/Notation.h
@@ -38,7 +38,7 @@ private:
virtual String nodeName() const;
virtual NodeType nodeType() const;
- virtual PassRefPtr<Node> cloneNode(bool deep);
+ virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&);
virtual bool childTypeAllowed(NodeType) const;
String m_name;
diff --git a/Source/WebCore/dom/ProcessingInstruction.cpp b/Source/WebCore/dom/ProcessingInstruction.cpp
index 6bba56c0b..87a0198f7 100644
--- a/Source/WebCore/dom/ProcessingInstruction.cpp
+++ b/Source/WebCore/dom/ProcessingInstruction.cpp
@@ -97,7 +97,7 @@ void ProcessingInstruction::setNodeValue(const String& nodeValue, ExceptionCode&
setData(nodeValue, ec);
}
-PassRefPtr<Node> ProcessingInstruction::cloneNode(bool /*deep*/)
+PassRefPtr<Node> ProcessingInstruction::cloneNode(bool /*deep*/, ExceptionCode&)
{
// FIXME: Is it a problem that this does not copy m_localHref?
// What about other data members?
@@ -214,7 +214,7 @@ void ProcessingInstruction::setCSSStyleSheet(const String& href, const KURL& bas
ASSERT(m_isCSS);
CSSParserContext parserContext(document(), baseURL, charset);
- RefPtr<StyleSheetContents> newSheet = StyleSheetContents::create(href, baseURL, parserContext);
+ RefPtr<StyleSheetContents> newSheet = StyleSheetContents::create(href, parserContext);
RefPtr<CSSStyleSheet> cssSheet = CSSStyleSheet::create(newSheet, this);
cssSheet->setDisabled(m_alternate);
diff --git a/Source/WebCore/dom/ProcessingInstruction.h b/Source/WebCore/dom/ProcessingInstruction.h
index e331e21df..0960d1574 100644
--- a/Source/WebCore/dom/ProcessingInstruction.h
+++ b/Source/WebCore/dom/ProcessingInstruction.h
@@ -60,7 +60,7 @@ private:
virtual NodeType nodeType() const;
virtual String nodeValue() const;
virtual void setNodeValue(const String&, ExceptionCode&);
- virtual PassRefPtr<Node> cloneNode(bool deep);
+ virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&);
virtual bool offsetInCharacters() const;
virtual int maxCharacterOffset() const;
diff --git a/Source/WebCore/dom/Range.cpp b/Source/WebCore/dom/Range.cpp
index e943cf5d9..c4e435a6f 100644
--- a/Source/WebCore/dom/Range.cpp
+++ b/Source/WebCore/dom/Range.cpp
@@ -1942,7 +1942,6 @@ void Range::getBorderAndTextQuads(Vector<FloatQuad>& quads) const
}
}
-
FloatRect Range::boundingRect() const
{
if (!m_start.container())
diff --git a/Source/WebCore/dom/Range.h b/Source/WebCore/dom/Range.h
index b84bd6145..dffaefc67 100644
--- a/Source/WebCore/dom/Range.h
+++ b/Source/WebCore/dom/Range.h
@@ -112,16 +112,16 @@ public:
ShadowRoot* shadowRoot() const;
- IntRect boundingBox() const;
-
enum RangeInFixedPosition {
NotFixedPosition,
PartiallyFixedPosition,
EntirelyFixedPosition
};
-
+
// Not transform-friendly
void textRects(Vector<IntRect>&, bool useSelectionHeight = false, RangeInFixedPosition* = 0) const;
+ IntRect boundingBox() const;
+
// Transform-friendly
void textQuads(Vector<FloatQuad>&, bool useSelectionHeight = false, RangeInFixedPosition* = 0) const;
void getBorderAndTextQuads(Vector<FloatQuad>&) const;
diff --git a/Source/WebCore/dom/ScriptElement.cpp b/Source/WebCore/dom/ScriptElement.cpp
index 9c1654e1f..62e82306c 100644
--- a/Source/WebCore/dom/ScriptElement.cpp
+++ b/Source/WebCore/dom/ScriptElement.cpp
@@ -38,6 +38,7 @@
#include "IgnoreDestructiveWriteCountIncrementer.h"
#include "MIMETypeRegistry.h"
#include "Page.h"
+#include "ScriptCallStack.h"
#include "ScriptRunner.h"
#include "ScriptSourceCode.h"
#include "ScriptValue.h"
diff --git a/Source/WebCore/dom/ScriptExecutionContext.h b/Source/WebCore/dom/ScriptExecutionContext.h
index 238fa6d2b..e7468038c 100644
--- a/Source/WebCore/dom/ScriptExecutionContext.h
+++ b/Source/WebCore/dom/ScriptExecutionContext.h
@@ -31,7 +31,6 @@
#include "ActiveDOMObject.h"
#include "ConsoleTypes.h"
#include "KURL.h"
-#include "ScriptCallStack.h"
#include "SecurityContext.h"
#include "Supplementable.h"
#include <wtf/Forward.h>
@@ -54,6 +53,7 @@ class EventListener;
class EventQueue;
class EventTarget;
class MessagePort;
+class ScriptCallStack;
#if ENABLE(BLOB)
class PublicURLManager;
diff --git a/Source/WebCore/dom/ScriptedAnimationController.cpp b/Source/WebCore/dom/ScriptedAnimationController.cpp
index 974483dd4..628f1092b 100644
--- a/Source/WebCore/dom/ScriptedAnimationController.cpp
+++ b/Source/WebCore/dom/ScriptedAnimationController.cpp
@@ -83,7 +83,7 @@ void ScriptedAnimationController::resume()
ScriptedAnimationController::CallbackId ScriptedAnimationController::registerCallback(PassRefPtr<RequestAnimationFrameCallback> callback)
{
- ScriptedAnimationController::CallbackId id = m_nextCallbackId++;
+ ScriptedAnimationController::CallbackId id = ++m_nextCallbackId;
callback->m_firedOrCancelled = false;
callback->m_id = id;
m_callbacks.append(callback);
diff --git a/Source/WebCore/dom/ShadowRoot.cpp b/Source/WebCore/dom/ShadowRoot.cpp
index b9c481c18..1aadc5126 100644
--- a/Source/WebCore/dom/ShadowRoot.cpp
+++ b/Source/WebCore/dom/ShadowRoot.cpp
@@ -139,9 +139,10 @@ String ShadowRoot::nodeName() const
return "#shadow-root";
}
-PassRefPtr<Node> ShadowRoot::cloneNode(bool)
+PassRefPtr<Node> ShadowRoot::cloneNode(bool, ExceptionCode& ec)
{
// ShadowRoot should not be arbitrarily cloned.
+ ec = DATA_CLONE_ERR;
return 0;
}
diff --git a/Source/WebCore/dom/ShadowRoot.h b/Source/WebCore/dom/ShadowRoot.h
index d9b425c60..1c9f02cc0 100644
--- a/Source/WebCore/dom/ShadowRoot.h
+++ b/Source/WebCore/dom/ShadowRoot.h
@@ -97,7 +97,7 @@ private:
explicit ShadowRoot(Document*);
virtual ~ShadowRoot();
virtual String nodeName() const;
- virtual PassRefPtr<Node> cloneNode(bool deep);
+ virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&);
virtual bool childTypeAllowed(NodeType) const;
virtual void childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) OVERRIDE;
diff --git a/Source/WebCore/dom/Text.cpp b/Source/WebCore/dom/Text.cpp
index a00aaeb53..9945f94aa 100644
--- a/Source/WebCore/dom/Text.cpp
+++ b/Source/WebCore/dom/Text.cpp
@@ -184,7 +184,7 @@ Node::NodeType Text::nodeType() const
return TEXT_NODE;
}
-PassRefPtr<Node> Text::cloneNode(bool /*deep*/)
+PassRefPtr<Node> Text::cloneNode(bool /*deep*/, ExceptionCode&)
{
return create(document(), data());
}
diff --git a/Source/WebCore/dom/Text.h b/Source/WebCore/dom/Text.h
index daf382240..8e97e290b 100644
--- a/Source/WebCore/dom/Text.h
+++ b/Source/WebCore/dom/Text.h
@@ -58,7 +58,7 @@ protected:
private:
virtual String nodeName() const;
virtual NodeType nodeType() const;
- virtual PassRefPtr<Node> cloneNode(bool deep);
+ virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&);
virtual bool rendererIsNeeded(const NodeRenderingContext&);
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
virtual bool childTypeAllowed(NodeType) const;
diff --git a/Source/WebCore/dom/ViewportArguments.cpp b/Source/WebCore/dom/ViewportArguments.cpp
index dc22e6e1f..4da905029 100644
--- a/Source/WebCore/dom/ViewportArguments.cpp
+++ b/Source/WebCore/dom/ViewportArguments.cpp
@@ -363,7 +363,7 @@ void reportViewportWarning(Document* document, ViewportErrorCode errorCode, cons
if (!replacement2.isNull())
message.replace("%replacement2", replacement2);
- frame->domWindow()->console()->addMessage(HTMLMessageSource, LogMessageType, viewportErrorMessageLevel(errorCode), message, document->url().string(), parserLineNumber(document));
+ document->domWindow()->console()->addMessage(HTMLMessageSource, LogMessageType, viewportErrorMessageLevel(errorCode), message, document->url().string(), parserLineNumber(document));
}
} // namespace WebCore
diff --git a/Source/WebCore/editing/AlternativeTextController.cpp b/Source/WebCore/editing/AlternativeTextController.cpp
index d4a0e43b7..5dcfbd383 100644
--- a/Source/WebCore/editing/AlternativeTextController.cpp
+++ b/Source/WebCore/editing/AlternativeTextController.cpp
@@ -704,7 +704,7 @@ bool AlternativeTextController::insertDictatedText(const String& text, const Vec
if (FrameView* view = m_frame->view())
view->resetDeferredRepaintDelay();
- RefPtr<TextEvent> event = TextEvent::createForDictation(m_frame->domWindow(), text, dictationAlternatives);
+ RefPtr<TextEvent> event = TextEvent::createForDictation(m_frame->document()->domWindow(), text, dictationAlternatives);
event->setUnderlyingEvent(triggeringEvent);
ExceptionCode ec;
diff --git a/Source/WebCore/editing/AppendNodeCommand.cpp b/Source/WebCore/editing/AppendNodeCommand.cpp
index eedb4b593..4db5e1a69 100644
--- a/Source/WebCore/editing/AppendNodeCommand.cpp
+++ b/Source/WebCore/editing/AppendNodeCommand.cpp
@@ -51,7 +51,7 @@ static void sendAXTextChangedIgnoringLineBreaks(Node* node, AXObjectCache::AXTex
if (nodeValue == "\n")
return;
- node->document()->axObjectCache()->nodeTextChangeNotification(node->renderer(), textChange, 0, nodeValue);
+ node->document()->axObjectCache()->nodeTextChangeNotification(node, textChange, 0, nodeValue);
}
void AppendNodeCommand::doApply()
diff --git a/Source/WebCore/editing/CompositeEditCommand.h b/Source/WebCore/editing/CompositeEditCommand.h
index 519dabc71..e5baea641 100644
--- a/Source/WebCore/editing/CompositeEditCommand.h
+++ b/Source/WebCore/editing/CompositeEditCommand.h
@@ -45,6 +45,9 @@ public:
virtual void unapply() OVERRIDE;
virtual void reapply() OVERRIDE;
EditAction editingAction() const OVERRIDE { return m_editAction; }
+#if ENABLE(UNDO_MANAGER)
+ virtual bool isDOMTransaction() const OVERRIDE { return false; }
+#endif
void append(SimpleEditCommand*);
bool wasCreateLinkCommand() const { return m_editAction == EditActionCreateLink; }
diff --git a/Source/WebCore/editing/DOMTransaction.idl b/Source/WebCore/editing/DOMTransaction.idl
new file mode 100644
index 000000000..8087ffecc
--- /dev/null
+++ b/Source/WebCore/editing/DOMTransaction.idl
@@ -0,0 +1,33 @@
+/*
+ * 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 GOOGLE 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 GOOGLE 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.
+ */
+
+module core {
+
+ interface [
+ Conditional=UNDO_MANAGER,
+ V8CustomIsReachable
+ ] DOMTransaction {
+ };
+
+}
diff --git a/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp b/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp
index 786d61fcc..5708c86ac 100644
--- a/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp
+++ b/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp
@@ -57,7 +57,7 @@ void DeleteFromTextNodeCommand::doApply()
// Need to notify this before actually deleting the text
if (AXObjectCache::accessibilityEnabled())
- document()->axObjectCache()->nodeTextChangeNotification(m_node->renderer(), AXObjectCache::AXTextDeleted, m_offset, m_text);
+ document()->axObjectCache()->nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextDeleted, m_offset, m_text);
m_node->deleteData(m_offset, m_count, ec);
}
@@ -73,7 +73,7 @@ void DeleteFromTextNodeCommand::doUnapply()
m_node->insertData(m_offset, m_text, ec);
if (AXObjectCache::accessibilityEnabled())
- document()->axObjectCache()->nodeTextChangeNotification(m_node->renderer(), AXObjectCache::AXTextInserted, m_offset, m_text);
+ document()->axObjectCache()->nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextInserted, m_offset, m_text);
}
#ifndef NDEBUG
diff --git a/Source/WebCore/editing/DeleteSelectionCommand.cpp b/Source/WebCore/editing/DeleteSelectionCommand.cpp
index 2e059c840..66deae7be 100644
--- a/Source/WebCore/editing/DeleteSelectionCommand.cpp
+++ b/Source/WebCore/editing/DeleteSelectionCommand.cpp
@@ -416,6 +416,22 @@ void DeleteSelectionCommand::deleteTextFromNode(PassRefPtr<Text> node, unsigned
CompositeEditCommand::deleteTextFromNode(node, offset, count);
}
+void DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss()
+{
+ RefPtr<Range> range = m_selectionToDelete.toNormalizedRange();
+ RefPtr<Node> node = range->firstNode();
+ while (node && node != range->pastLastNode()) {
+ RefPtr<Node> nextNode = node->traverseNextNode();
+ if ((node->hasTagName(styleTag) && !(toElement(node.get())->hasAttribute(scopedAttr))) || node->hasTagName(linkTag)) {
+ nextNode = node->traverseNextSibling();
+ RefPtr<ContainerNode> rootEditableElement = node->rootEditableElement();
+ removeNode(node);
+ appendNode(node, rootEditableElement);
+ }
+ node = nextNode;
+ }
+}
+
void DeleteSelectionCommand::handleGeneralDelete()
{
if (m_upstreamStart.isNull())
@@ -423,6 +439,8 @@ void DeleteSelectionCommand::handleGeneralDelete()
int startOffset = m_upstreamStart.deprecatedEditingOffset();
Node* startNode = m_upstreamStart.deprecatedNode();
+
+ makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss();
// Never remove the start block unless it's a table, in which case we won't merge content in.
if (startNode == m_startBlock && startOffset == 0 && canHaveChildrenForEditing(startNode) && !startNode->hasTagName(tableTag)) {
diff --git a/Source/WebCore/editing/DeleteSelectionCommand.h b/Source/WebCore/editing/DeleteSelectionCommand.h
index 4d3db5f35..829a57b95 100644
--- a/Source/WebCore/editing/DeleteSelectionCommand.h
+++ b/Source/WebCore/editing/DeleteSelectionCommand.h
@@ -65,6 +65,7 @@ private:
void calculateEndingPosition();
void calculateTypingStyleAfterDelete();
void clearTransientState();
+ void makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss();
virtual void removeNode(PassRefPtr<Node>);
virtual void deleteTextFromNode(PassRefPtr<Text>, unsigned, unsigned);
void removeRedundantBlocks();
diff --git a/Source/WebCore/editing/Editor.cpp b/Source/WebCore/editing/Editor.cpp
index 20b6af967..8342af9f2 100644
--- a/Source/WebCore/editing/Editor.cpp
+++ b/Source/WebCore/editing/Editor.cpp
@@ -86,6 +86,7 @@
#include "TextEvent.h"
#include "TextIterator.h"
#include "TypingCommand.h"
+#include "UndoManager.h"
#include "UserTypingGestureIndicator.h"
#include "htmlediting.h"
#include "markup.h"
@@ -346,7 +347,7 @@ void Editor::pasteAsPlainText(const String& pastingText, bool smartReplace)
if (!target)
return;
ExceptionCode ec = 0;
- target->dispatchEvent(TextEvent::createForPlainTextPaste(m_frame->domWindow(), pastingText, smartReplace), ec);
+ target->dispatchEvent(TextEvent::createForPlainTextPaste(m_frame->document()->domWindow(), pastingText, smartReplace), ec);
}
void Editor::pasteAsFragment(PassRefPtr<DocumentFragment> pastingFragment, bool smartReplace, bool matchStyle)
@@ -355,7 +356,7 @@ void Editor::pasteAsFragment(PassRefPtr<DocumentFragment> pastingFragment, bool
if (!target)
return;
ExceptionCode ec = 0;
- target->dispatchEvent(TextEvent::createForFragmentPaste(m_frame->domWindow(), pastingFragment, smartReplace, matchStyle), ec);
+ target->dispatchEvent(TextEvent::createForFragmentPaste(m_frame->document()->domWindow(), pastingFragment, smartReplace, matchStyle), ec);
}
void Editor::pasteAsPlainTextBypassingDHTML()
@@ -494,7 +495,7 @@ void Editor::respondToChangedContents(const VisibleSelection& endingSelection)
if (AXObjectCache::accessibilityEnabled()) {
Node* node = endingSelection.start().deprecatedNode();
if (node)
- m_frame->document()->axObjectCache()->postNotification(node->renderer(), AXObjectCache::AXValueChanged, false);
+ m_frame->document()->axObjectCache()->postNotification(node, AXObjectCache::AXValueChanged, false);
}
updateMarkersForWordsAffectedByEditing(true);
@@ -802,8 +803,12 @@ void Editor::appliedEditing(PassRefPtr<CompositeEditCommand> cmd)
// Only register a new undo command if the command passed in is
// different from the last command
m_lastEditCommand = cmd;
+#if !ENABLE(UNDO_MANAGER)
if (client())
client()->registerUndoStep(m_lastEditCommand->ensureComposition());
+#else
+ m_frame->document()->undoManager()->registerUndoStep(m_lastEditCommand->ensureComposition());
+#endif
}
respondToChangedContents(newSelection);
@@ -820,8 +825,12 @@ void Editor::unappliedEditing(PassRefPtr<EditCommandComposition> cmd)
m_alternativeTextController->respondToUnappliedEditing(cmd.get());
m_lastEditCommand = 0;
+#if !ENABLE(UNDO_MANAGER)
if (client())
client()->registerRedoStep(cmd);
+#else
+ m_frame->document()->undoManager()->registerRedoStep(cmd);
+#endif
respondToChangedContents(newSelection);
}
@@ -835,8 +844,12 @@ void Editor::reappliedEditing(PassRefPtr<EditCommandComposition> cmd)
changeSelectionAfterCommand(newSelection, FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle);
m_lastEditCommand = 0;
+#if !ENABLE(UNDO_MANAGER)
if (client())
client()->registerUndoStep(cmd);
+#else
+ m_frame->document()->undoManager()->registerUndoStep(cmd);
+#endif
respondToChangedContents(newSelection);
}
@@ -1244,24 +1257,40 @@ void Editor::clearUndoRedoOperations()
bool Editor::canUndo()
{
+#if !ENABLE(UNDO_MANAGER)
return client() && client()->canUndo();
+#else
+ return m_frame->document()->undoManager()->canUndo();
+#endif
}
void Editor::undo()
{
+#if !ENABLE(UNDO_MANAGER)
if (client())
client()->undo();
+#else
+ m_frame->document()->undoManager()->undo();
+#endif
}
bool Editor::canRedo()
{
+#if !ENABLE(UNDO_MANAGER)
return client() && client()->canRedo();
+#else
+ return m_frame->document()->undoManager()->canRedo();
+#endif
}
void Editor::redo()
{
+#if !ENABLE(UNDO_MANAGER)
if (client())
client()->redo();
+#else
+ m_frame->document()->undoManager()->redo();
+#endif
}
void Editor::didBeginEditing()
@@ -1363,7 +1392,7 @@ void Editor::setComposition(const String& text, SetCompositionMode mode)
// the DOM Event specification.
Node* target = m_frame->document()->focusedNode();
if (target) {
- RefPtr<CompositionEvent> event = CompositionEvent::create(eventNames().compositionendEvent, m_frame->domWindow(), text);
+ RefPtr<CompositionEvent> event = CompositionEvent::create(eventNames().compositionendEvent, m_frame->document()->domWindow(), text);
ExceptionCode ec = 0;
target->dispatchEvent(event, ec);
}
@@ -1426,14 +1455,14 @@ void Editor::setComposition(const String& text, const Vector<CompositionUnderlin
// We should send a compositionstart event only when the given text is not empty because this
// function doesn't create a composition node when the text is empty.
if (!text.isEmpty()) {
- target->dispatchEvent(CompositionEvent::create(eventNames().compositionstartEvent, m_frame->domWindow(), text));
- event = CompositionEvent::create(eventNames().compositionupdateEvent, m_frame->domWindow(), text);
+ target->dispatchEvent(CompositionEvent::create(eventNames().compositionstartEvent, m_frame->document()->domWindow(), text));
+ event = CompositionEvent::create(eventNames().compositionupdateEvent, m_frame->document()->domWindow(), text);
}
} else {
if (!text.isEmpty())
- event = CompositionEvent::create(eventNames().compositionupdateEvent, m_frame->domWindow(), text);
+ event = CompositionEvent::create(eventNames().compositionupdateEvent, m_frame->document()->domWindow(), text);
else
- event = CompositionEvent::create(eventNames().compositionendEvent, m_frame->domWindow(), text);
+ event = CompositionEvent::create(eventNames().compositionendEvent, m_frame->document()->domWindow(), text);
}
ExceptionCode ec = 0;
if (event.get())
@@ -2130,7 +2159,7 @@ void Editor::markAndReplaceFor(PassRefPtr<SpellCheckRequest> request, const Vect
if (AXObjectCache::accessibilityEnabled()) {
if (Element* root = m_frame->selection()->selection().rootEditableElement())
- m_frame->document()->axObjectCache()->postNotification(root->renderer(), AXObjectCache::AXAutocorrectionOccured, true);
+ m_frame->document()->axObjectCache()->postNotification(root, AXObjectCache::AXAutocorrectionOccured, true);
}
selectionChanged = true;
diff --git a/Source/WebCore/editing/FrameSelection.cpp b/Source/WebCore/editing/FrameSelection.cpp
index 9ccaa962f..f766c3cdf 100644
--- a/Source/WebCore/editing/FrameSelection.cpp
+++ b/Source/WebCore/editing/FrameSelection.cpp
@@ -124,6 +124,14 @@ Element* FrameSelection::rootEditableElementOrDocumentElement() const
return selectionRoot ? selectionRoot : m_frame->document()->documentElement();
}
+Element* FrameSelection::rootEditableElementRespectingShadowTree() const
+{
+ Element* selectionRoot = m_selection.rootEditableElement();
+ if (selectionRoot && selectionRoot->isInShadowTree())
+ selectionRoot = selectionRoot->shadowHost();
+ return selectionRoot;
+}
+
void FrameSelection::moveTo(const VisiblePosition &pos, EUserTriggered userTriggered, CursorAlignOnScroll align)
{
SetSelectionOptions options = CloseTyping | ClearTypingStyle | userTriggered;
diff --git a/Source/WebCore/editing/FrameSelection.h b/Source/WebCore/editing/FrameSelection.h
index 4a5819448..a0ce05991 100644
--- a/Source/WebCore/editing/FrameSelection.h
+++ b/Source/WebCore/editing/FrameSelection.h
@@ -135,6 +135,8 @@ public:
Element* rootEditableElement() const { return m_selection.rootEditableElement(); }
Element* rootEditableElementOrDocumentElement() const;
+ Element* rootEditableElementRespectingShadowTree() const;
+
bool rendererIsEditable() const { return m_selection.rendererIsEditable(); }
bool isContentEditable() const { return m_selection.isContentEditable(); }
bool isContentRichlyEditable() const { return m_selection.isContentRichlyEditable(); }
diff --git a/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp b/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp
index e0965e0f6..a888f4cb7 100644
--- a/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp
+++ b/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp
@@ -60,7 +60,7 @@ void InsertIntoTextNodeCommand::doApply()
m_node->insertData(m_offset, m_text, ec);
if (AXObjectCache::accessibilityEnabled())
- document()->axObjectCache()->nodeTextChangeNotification(m_node->renderer(), AXObjectCache::AXTextInserted, m_offset, m_text);
+ document()->axObjectCache()->nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextInserted, m_offset, m_text);
}
void InsertIntoTextNodeCommand::doUnapply()
@@ -70,7 +70,7 @@ void InsertIntoTextNodeCommand::doUnapply()
// Need to notify this before actually deleting the text
if (AXObjectCache::accessibilityEnabled())
- document()->axObjectCache()->nodeTextChangeNotification(m_node->renderer(), AXObjectCache::AXTextDeleted, m_offset, m_text);
+ document()->axObjectCache()->nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextDeleted, m_offset, m_text);
ExceptionCode ec;
m_node->deleteData(m_offset, m_text.length(), ec);
diff --git a/Source/WebCore/editing/InsertNodeBeforeCommand.cpp b/Source/WebCore/editing/InsertNodeBeforeCommand.cpp
index 93213cc23..bef401142 100644
--- a/Source/WebCore/editing/InsertNodeBeforeCommand.cpp
+++ b/Source/WebCore/editing/InsertNodeBeforeCommand.cpp
@@ -55,7 +55,7 @@ void InsertNodeBeforeCommand::doApply()
parent->insertBefore(m_insertChild.get(), m_refChild.get(), ec);
if (AXObjectCache::accessibilityEnabled())
- document()->axObjectCache()->nodeTextChangeNotification(m_insertChild->renderer(), AXObjectCache::AXTextInserted, 0, m_insertChild->nodeValue());
+ document()->axObjectCache()->nodeTextChangeNotification(m_insertChild.get(), AXObjectCache::AXTextInserted, 0, m_insertChild->nodeValue());
}
void InsertNodeBeforeCommand::doUnapply()
@@ -65,7 +65,7 @@ void InsertNodeBeforeCommand::doUnapply()
// Need to notify this before actually deleting the text
if (AXObjectCache::accessibilityEnabled())
- document()->axObjectCache()->nodeTextChangeNotification(m_insertChild->renderer(), AXObjectCache::AXTextDeleted, 0, m_insertChild->nodeValue());
+ document()->axObjectCache()->nodeTextChangeNotification(m_insertChild.get(), AXObjectCache::AXTextDeleted, 0, m_insertChild->nodeValue());
ExceptionCode ec;
m_insertChild->remove(ec);
diff --git a/Source/WebCore/editing/MarkupAccumulator.cpp b/Source/WebCore/editing/MarkupAccumulator.cpp
index 3ca48cf8a..ca3c249a3 100644
--- a/Source/WebCore/editing/MarkupAccumulator.cpp
+++ b/Source/WebCore/editing/MarkupAccumulator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved.
* Copyright (C) 2009, 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -303,11 +303,9 @@ void MarkupAccumulator::appendText(StringBuilder& result, Text* text)
void MarkupAccumulator::appendComment(StringBuilder& result, const String& comment)
{
// FIXME: Comment content is not escaped, but XMLSerializer (and possibly other callers) should raise an exception if it includes "-->".
- static const char commentBegin[] = "<!--";
- result.append(commentBegin, sizeof(commentBegin) - 1);
+ result.appendLiteral("<!--");
result.append(comment);
- static const char commentEnd[] = "-->";
- result.append(commentEnd, sizeof(commentEnd) - 1);
+ result.appendLiteral("-->");
}
void MarkupAccumulator::appendXMLDeclaration(StringBuilder& result, const Document* document)
@@ -315,29 +313,22 @@ void MarkupAccumulator::appendXMLDeclaration(StringBuilder& result, const Docume
if (!document->hasXMLDeclaration())
return;
- static const char xmlDeclStart[] = "<?xml version=\"";
- result.append(xmlDeclStart, sizeof(xmlDeclStart) - 1);
+ result.appendLiteral("<?xml version=\"");
result.append(document->xmlVersion());
const String& encoding = document->xmlEncoding();
if (!encoding.isEmpty()) {
- static const char xmlEncoding[] = "\" encoding=\"";
- result.append(xmlEncoding, sizeof(xmlEncoding) - 1);
+ result.appendLiteral("\" encoding=\"");
result.append(encoding);
}
if (document->xmlStandaloneStatus() != Document::StandaloneUnspecified) {
- static const char xmlStandalone[] = "\" standalone=\"";
- result.append(xmlStandalone, sizeof(xmlStandalone) - 1);
- if (document->xmlStandalone()) {
- static const char standaloneYes[] = "yes";
- result.append(standaloneYes, sizeof(standaloneYes) - 1);
- } else {
- static const char standaloneNo[] = "no";
- result.append(standaloneNo, sizeof(standaloneNo) - 1);
- }
+ result.appendLiteral("\" standalone=\"");
+ if (document->xmlStandalone())
+ result.appendLiteral("yes");
+ else
+ result.appendLiteral("no");
}
- static const char xmlDeclEnd[] = "\"?>";
- result.append(xmlDeclEnd, sizeof(xmlDeclEnd) - 1);
+ result.appendLiteral("\"?>");
}
void MarkupAccumulator::appendDocumentType(StringBuilder& result, const DocumentType* n)
@@ -345,12 +336,10 @@ void MarkupAccumulator::appendDocumentType(StringBuilder& result, const Document
if (n->name().isEmpty())
return;
- static const char doctypeString[] = "<!DOCTYPE ";
- result.append(doctypeString, sizeof(doctypeString) - 1);
+ result.appendLiteral("<!DOCTYPE ");
result.append(n->name());
if (!n->publicId().isEmpty()) {
- static const char publicString[] = " PUBLIC \"";
- result.append(publicString, sizeof(publicString) - 1);
+ result.appendLiteral(" PUBLIC \"");
result.append(n->publicId());
result.append('"');
if (!n->systemId().isEmpty()) {
@@ -360,8 +349,7 @@ void MarkupAccumulator::appendDocumentType(StringBuilder& result, const Document
result.append('"');
}
} else if (!n->systemId().isEmpty()) {
- static const char systemString[] = " SYSTEM \"";
- result.append(systemString, sizeof(systemString) - 1);
+ result.appendLiteral(" SYSTEM \"");
result.append(n->systemId());
result.append('"');
}
@@ -467,11 +455,9 @@ void MarkupAccumulator::appendAttribute(StringBuilder& result, Element* element,
void MarkupAccumulator::appendCDATASection(StringBuilder& result, const String& section)
{
// FIXME: CDATA content is not escaped, but XMLSerializer (and possibly other callers) should raise an exception if it includes "]]>".
- static const char cdataBegin[] = "<![CDATA[";
- result.append(cdataBegin, sizeof(cdataBegin) - 1);
+ result.appendLiteral("<![CDATA[");
result.append(section);
- static const char cdataEnd[] = "]]>";
- result.append(cdataEnd, sizeof(cdataEnd) - 1);
+ result.appendLiteral("]]>");
}
void MarkupAccumulator::appendStartMarkup(StringBuilder& result, const Node* node, Namespaces* namespaces)
diff --git a/Source/WebCore/editing/UndoManager.cpp b/Source/WebCore/editing/UndoManager.cpp
index 55c550992..49106fd08 100644
--- a/Source/WebCore/editing/UndoManager.cpp
+++ b/Source/WebCore/editing/UndoManager.cpp
@@ -33,74 +33,169 @@
#if ENABLE(UNDO_MANAGER)
+#include "DOMTransaction.h"
#include "Element.h"
-#include "Node.h"
namespace WebCore {
-PassRefPtr<UndoManager> UndoManager::create(Node* host)
+PassRefPtr<UndoManager> UndoManager::create(ScriptExecutionContext* context, Node* host)
{
- return adoptRef(new UndoManager(host));
+ RefPtr<UndoManager> undoManager = adoptRef(new UndoManager(context, host));
+ undoManager->suspendIfNeeded();
+ return undoManager.release();
}
-UndoManager::UndoManager(Node* host)
- : m_undoScopeHost(host)
+UndoManager::UndoManager(ScriptExecutionContext* context, Node* host)
+ : ActiveDOMObject(context, this)
+ , m_undoScopeHost(host)
+ , m_isInProgress(false)
{
}
+static void clearStack(UndoManagerStack& stack)
+{
+ for (size_t i = 0; i < stack.size(); ++i) {
+ const UndoManagerEntry& entry = *stack[i];
+ for (size_t j = 0; j < entry.size(); ++j) {
+ UndoStep* step = entry[j].get();
+ if (step->isDOMTransaction())
+ static_cast<DOMTransaction*>(step)->setUndoManager(0);
+ }
+ }
+ stack.clear();
+}
+
void UndoManager::disconnect()
{
m_undoScopeHost = 0;
+ clearStack(m_undoStack);
+ clearStack(m_redoStack);
+}
+
+void UndoManager::stop()
+{
+ disconnect();
+}
+
+UndoManager::~UndoManager()
+{
+ disconnect();
}
-void UndoManager::transact(const Dictionary&, bool, ExceptionCode& ec)
+static inline PassOwnPtr<UndoManagerEntry> createUndoManagerEntry()
{
- if (!isConnected()) {
+ return adoptPtr(new UndoManagerEntry);
+}
+
+void UndoManager::transact(PassRefPtr<DOMTransaction> transaction, bool merge, ExceptionCode& ec)
+{
+ if (m_isInProgress || !isConnected()) {
ec = INVALID_ACCESS_ERR;
return;
}
- RefPtr<UndoStep> step;
- m_undoStack.append(step);
+ clearRedo(ASSERT_NO_EXCEPTION);
+ transaction->setUndoManager(this);
+
+ m_isInProgress = true;
+ RefPtr<UndoManager> protect(this);
+ transaction->apply();
+ m_isInProgress = false;
+
+ if (!m_undoScopeHost)
+ return;
+ if (!merge || m_undoStack.isEmpty())
+ m_undoStack.append(createUndoManagerEntry());
+ m_undoStack.last()->append(transaction);
}
void UndoManager::undo(ExceptionCode& ec)
{
- if (!isConnected()) {
+ if (m_isInProgress || !isConnected()) {
ec = INVALID_ACCESS_ERR;
return;
}
+ if (m_undoStack.isEmpty())
+ return;
+ m_inProgressEntry = createUndoManagerEntry();
+
+ m_isInProgress = true;
+ RefPtr<UndoManager> protect(this);
+ UndoManagerEntry entry = *m_undoStack.last();
+ for (size_t i = entry.size(); i > 0; --i)
+ entry[i - 1]->unapply();
+ m_isInProgress = false;
+
+ if (!m_undoScopeHost) {
+ m_inProgressEntry.clear();
+ return;
+ }
+ m_redoStack.append(m_inProgressEntry.release());
+ m_undoStack.removeLast();
}
void UndoManager::redo(ExceptionCode& ec)
{
- if (!isConnected()) {
+ if (m_isInProgress || !isConnected()) {
ec = INVALID_ACCESS_ERR;
return;
}
+ if (m_redoStack.isEmpty())
+ return;
+ m_inProgressEntry = createUndoManagerEntry();
+
+ m_isInProgress = true;
+ RefPtr<UndoManager> protect(this);
+ UndoManagerEntry entry = *m_redoStack.last();
+ for (size_t i = entry.size(); i > 0; --i)
+ entry[i - 1]->reapply();
+ m_isInProgress = false;
+
+ if (!m_undoScopeHost) {
+ m_inProgressEntry.clear();
+ return;
+ }
+ m_undoStack.append(m_inProgressEntry.release());
+ m_redoStack.removeLast();
+}
+
+void UndoManager::registerUndoStep(PassRefPtr<UndoStep> step)
+{
+ if (!m_isInProgress) {
+ OwnPtr<UndoManagerEntry> entry = createUndoManagerEntry();
+ entry->append(step);
+ m_undoStack.append(entry.release());
+
+ clearRedo(ASSERT_NO_EXCEPTION);
+ } else
+ m_inProgressEntry->append(step);
+}
+
+void UndoManager::registerRedoStep(PassRefPtr<UndoStep> step)
+{
+ if (!m_isInProgress) {
+ OwnPtr<UndoManagerEntry> entry = createUndoManagerEntry();
+ entry->append(step);
+ m_redoStack.append(entry.release());
+ } else
+ m_inProgressEntry->append(step);
}
void UndoManager::clearUndo(ExceptionCode& ec)
{
- if (!isConnected()) {
+ if (m_isInProgress || !isConnected()) {
ec = INVALID_ACCESS_ERR;
return;
}
- m_undoStack.clear();
+ clearStack(m_undoStack);
}
void UndoManager::clearRedo(ExceptionCode& ec)
{
- if (!isConnected()) {
+ if (m_isInProgress || !isConnected()) {
ec = INVALID_ACCESS_ERR;
return;
}
- m_redoStack.clear();
-}
-
-void UndoManager::clearUndoRedo()
-{
- m_undoStack.clear();
- m_redoStack.clear();
+ clearStack(m_redoStack);
}
bool UndoManager::isConnected()
diff --git a/Source/WebCore/editing/UndoManager.h b/Source/WebCore/editing/UndoManager.h
index c318c9eca..abb9930cb 100644
--- a/Source/WebCore/editing/UndoManager.h
+++ b/Source/WebCore/editing/UndoManager.h
@@ -33,8 +33,11 @@
#if ENABLE(UNDO_MANAGER)
-#include "ExceptionCode.h"
+#include "ActiveDOMObject.h"
+#include "ExceptionCodePlaceholder.h"
#include "UndoStep.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
@@ -42,32 +45,48 @@
namespace WebCore {
-class Dictionary;
+class DOMTransaction;
class Node;
-class UndoManager : public RefCounted<UndoManager> {
+typedef Vector<RefPtr<UndoStep> > UndoManagerEntry;
+typedef Vector<OwnPtr<UndoManagerEntry> > UndoManagerStack;
+
+class UndoManager : public RefCounted<UndoManager>, public ActiveDOMObject {
public:
- static PassRefPtr<UndoManager> create(Node* host);
+ static PassRefPtr<UndoManager> create(ScriptExecutionContext*, Node* host);
void disconnect();
+ virtual void stop() OVERRIDE;
+ virtual ~UndoManager();
- void transact(const Dictionary& transaction, bool merge, ExceptionCode&);
+ void transact(PassRefPtr<DOMTransaction>, bool merge, ExceptionCode&);
- void undo(ExceptionCode&);
- void redo(ExceptionCode&);
+ void undo(ExceptionCode& = ASSERT_NO_EXCEPTION);
+ void redo(ExceptionCode& = ASSERT_NO_EXCEPTION);
unsigned length() const { return m_undoStack.size() + m_redoStack.size(); }
+ unsigned position() const { return m_redoStack.size(); }
void clearUndo(ExceptionCode&);
void clearRedo(ExceptionCode&);
- void clearUndoRedo();
+
+ bool canUndo() const { return !m_undoStack.isEmpty(); }
+ bool canRedo() const { return !m_redoStack.isEmpty(); }
+
+ void registerUndoStep(PassRefPtr<UndoStep>);
+ void registerRedoStep(PassRefPtr<UndoStep>);
+
+ Node* undoScopeHost() const { return m_undoScopeHost; }
+ Node* ownerNode() const { return m_undoScopeHost; }
private:
- explicit UndoManager(Node* host);
+ explicit UndoManager(ScriptExecutionContext*, Node* host);
bool isConnected();
Node* m_undoScopeHost;
- Vector<RefPtr<UndoStep> > m_undoStack;
- Vector<RefPtr<UndoStep> > m_redoStack;
+ UndoManagerStack m_undoStack;
+ UndoManagerStack m_redoStack;
+ bool m_isInProgress;
+ OwnPtr<UndoManagerEntry> m_inProgressEntry;
};
}
diff --git a/Source/WebCore/editing/UndoManager.idl b/Source/WebCore/editing/UndoManager.idl
index b4d0f8133..e65677b6f 100644
--- a/Source/WebCore/editing/UndoManager.idl
+++ b/Source/WebCore/editing/UndoManager.idl
@@ -31,10 +31,10 @@
module core {
interface [
- Conditional=UNDO_MANAGER
+ Conditional=UNDO_MANAGER,
+ V8GenerateIsReachable=ImplOwnerNodeRoot
] UndoManager {
- void transact(in Dictionary transaction, in boolean merge)
- raises(DOMException);
+ [Custom] void transact(in Dictionary transaction, in boolean merge);
void undo()
raises(DOMException);
@@ -42,6 +42,7 @@ module core {
raises(DOMException);
readonly attribute unsigned long length;
+ readonly attribute unsigned long position;
void clearUndo()
raises(DOMException);
diff --git a/Source/WebCore/editing/UndoStep.h b/Source/WebCore/editing/UndoStep.h
index ed202b427..86738d6dc 100644
--- a/Source/WebCore/editing/UndoStep.h
+++ b/Source/WebCore/editing/UndoStep.h
@@ -43,6 +43,9 @@ public:
virtual void unapply() = 0;
virtual void reapply() = 0;
virtual EditAction editingAction() const = 0;
+#if ENABLE(UNDO_MANAGER)
+ virtual bool isDOMTransaction() const = 0;
+#endif
};
}
diff --git a/Source/WebCore/editing/chromium/FrameSelectionChromium.cpp b/Source/WebCore/editing/chromium/FrameSelectionChromium.cpp
index 6bea6eec6..eb201f7b0 100644
--- a/Source/WebCore/editing/chromium/FrameSelectionChromium.cpp
+++ b/Source/WebCore/editing/chromium/FrameSelectionChromium.cpp
@@ -42,7 +42,7 @@ void FrameSelection::notifyAccessibilityForSelectionChange()
// FIXME: Support editable text in chromium.
if (AXObjectCache::accessibilityEnabled() && m_selection.start().isNotNull() && m_selection.end().isNotNull()) {
Document* document = m_frame->document();
- document->axObjectCache()->postNotification(m_selection.start().deprecatedNode()->renderer(), AXObjectCache::AXSelectedTextChanged, false);
+ document->axObjectCache()->postNotification(m_selection.start().deprecatedNode(), AXObjectCache::AXSelectedTextChanged, false);
}
}
diff --git a/Source/WebCore/fileapi/Blob.cpp b/Source/WebCore/fileapi/Blob.cpp
index d1dcb51ab..431f1764b 100644
--- a/Source/WebCore/fileapi/Blob.cpp
+++ b/Source/WebCore/fileapi/Blob.cpp
@@ -34,6 +34,7 @@
#include "BlobURL.h"
#include "File.h"
#include "HistogramSupport.h"
+#include "ScriptCallStack.h"
#include "ScriptExecutionContext.h"
#include "ThreadableBlobRegistry.h"
@@ -137,9 +138,14 @@ PassRefPtr<Blob> Blob::sliceInternal(long long start, long long end, const Strin
long long length = end - start;
OwnPtr<BlobData> blobData = BlobData::create();
blobData->setContentType(contentType);
- if (isFile())
+ if (isFile()) {
+#if ENABLE(FILE_SYSTEM)
+ if (!toFile(this)->fileSystemURL().isEmpty())
+ blobData->appendURL(toFile(this)->fileSystemURL(), start, length, modificationTime);
+ else
+#endif
blobData->appendFile(toFile(this)->path(), start, length, modificationTime);
- else
+ } else
blobData->appendBlob(m_internalURL, start, length);
return Blob::create(blobData.release(), length);
diff --git a/Source/WebCore/fileapi/File.cpp b/Source/WebCore/fileapi/File.cpp
index 087895710..692bde1ac 100644
--- a/Source/WebCore/fileapi/File.cpp
+++ b/Source/WebCore/fileapi/File.cpp
@@ -75,6 +75,14 @@ static PassOwnPtr<BlobData> createBlobDataForFileWithMetadata(const String& file
blobData->appendFile(metadata.platformPath, 0, metadata.length, metadata.modificationTime);
return blobData.release();
}
+
+static PassOwnPtr<BlobData> createBlobDataForFileSystemURL(const KURL& fileSystemURL, const FileMetadata& metadata)
+{
+ OwnPtr<BlobData> blobData = BlobData::create();
+ blobData->setContentType(getContentTypeFromFileName(fileSystemURL.path(), File::WellKnownContentTypes));
+ blobData->appendURL(fileSystemURL, 0, metadata.length, metadata.modificationTime);
+ return blobData.release();
+}
#endif
#if ENABLE(DIRECTORY_UPLOAD)
@@ -131,6 +139,14 @@ File::File(const String& name, const FileMetadata& metadata)
, m_snapshotModificationTime(metadata.modificationTime)
{
}
+
+File::File(const KURL& fileSystemURL, const FileMetadata& metadata)
+ : Blob(createBlobDataForFileSystemURL(fileSystemURL, metadata), metadata.length)
+ , m_fileSystemURL(fileSystemURL)
+ , m_snapshotSize(metadata.length)
+ , m_snapshotModificationTime(metadata.modificationTime)
+{
+}
#endif
double File::lastModifiedDate() const
diff --git a/Source/WebCore/fileapi/File.h b/Source/WebCore/fileapi/File.h
index 864c4388a..b915902d4 100644
--- a/Source/WebCore/fileapi/File.h
+++ b/Source/WebCore/fileapi/File.h
@@ -68,6 +68,13 @@ public:
{
return adoptRef(new File(name, metadata));
}
+
+ static PassRefPtr<File> createForFileSystemFile(const KURL& url, const FileMetadata& metadata)
+ {
+ return adoptRef(new File(url, metadata));
+ }
+
+ KURL fileSystemURL() const { return m_fileSystemURL; }
#endif
// Create a file with a name exposed to the author (via File.name and associated DOM properties) that differs from the one provided in the path.
@@ -104,6 +111,7 @@ private:
# if ENABLE(FILE_SYSTEM)
File(const String& name, const FileMetadata&);
+ File(const KURL& fileSystemURL, const FileMetadata&);
// Returns true if this has a valid snapshot metadata (i.e. m_snapshotSize >= 0).
bool hasValidSnapshotMetadata() const { return m_snapshotSize >= 0; }
@@ -113,6 +121,8 @@ private:
String m_name;
#if ENABLE(FILE_SYSTEM)
+ KURL m_fileSystemURL;
+
// If m_snapshotSize is negative (initialized to -1 by default), the snapshot metadata is invalid and we retrieve the latest metadata synchronously in size(), lastModifiedTime() and webkitSlice().
// Otherwise, the snapshot metadata are used directly in those methods.
const long long m_snapshotSize;
diff --git a/Source/WebCore/fileapi/WebKitBlobBuilder.cpp b/Source/WebCore/fileapi/WebKitBlobBuilder.cpp
index 5c54c4b6f..c08e5fab7 100644
--- a/Source/WebCore/fileapi/WebKitBlobBuilder.cpp
+++ b/Source/WebCore/fileapi/WebKitBlobBuilder.cpp
@@ -37,6 +37,7 @@
#include "File.h"
#include "HistogramSupport.h"
#include "LineEnding.h"
+#include "ScriptCallStack.h"
#include "ScriptExecutionContext.h"
#include "TextEncoding.h"
#include <wtf/ArrayBuffer.h>
@@ -141,6 +142,11 @@ void WebKitBlobBuilder::append(Blob* blob)
file->captureSnapshot(snapshotSize, snapshotModificationTime);
m_size += snapshotSize;
+#if ENABLE(FILE_SYSTEM)
+ if (!file->fileSystemURL().isEmpty())
+ m_items.append(BlobDataItem(file->fileSystemURL(), 0, snapshotSize, snapshotModificationTime));
+ else
+#endif
m_items.append(BlobDataItem(file->path(), 0, snapshotSize, snapshotModificationTime));
} else {
long long blobSize = static_cast<long long>(blob->size());
@@ -149,7 +155,6 @@ void WebKitBlobBuilder::append(Blob* blob)
}
}
-
void WebKitBlobBuilder::appendBytesData(const void* data, size_t length)
{
Vector<char>& buffer = getBuffer();
@@ -158,8 +163,10 @@ void WebKitBlobBuilder::appendBytesData(const void* data, size_t length)
m_size += buffer.size() - oldSize;
}
-PassRefPtr<Blob> WebKitBlobBuilder::getBlob(const String& contentType)
+PassRefPtr<Blob> WebKitBlobBuilder::getBlob(const String& contentType, BlobConstructionReason constructionReason)
{
+ HistogramSupport::histogramEnumeration("WebCore.BlobBuilder.getBlob", constructionReason, BlobConstructionReasonMax);
+
OwnPtr<BlobData> blobData = BlobData::create();
blobData->setContentType(contentType);
blobData->swapItems(m_items);
diff --git a/Source/WebCore/fileapi/WebKitBlobBuilder.h b/Source/WebCore/fileapi/WebKitBlobBuilder.h
index c0b5e128b..b869defb2 100644
--- a/Source/WebCore/fileapi/WebKitBlobBuilder.h
+++ b/Source/WebCore/fileapi/WebKitBlobBuilder.h
@@ -43,6 +43,12 @@ class TextEncoding;
typedef int ExceptionCode;
+enum BlobConstructionReason {
+ BlobConstructedByBlobBuilder,
+ BlobConstructedByConstructor,
+ BlobConstructionReasonMax,
+};
+
class WebKitBlobBuilder : public RefCounted<WebKitBlobBuilder> {
public:
// Called when BlobBuilder is instantiated in JS API. We show deprecate warning message.
@@ -59,7 +65,7 @@ public:
void append(ArrayBufferView*);
#endif
- PassRefPtr<Blob> getBlob(const String& contentType = String());
+ PassRefPtr<Blob> getBlob(const String& contentType = String(), BlobConstructionReason = BlobConstructedByBlobBuilder);
private:
WebKitBlobBuilder();
diff --git a/Source/WebCore/history/CachedFrame.cpp b/Source/WebCore/history/CachedFrame.cpp
index 87d4af1ad..926dbc8cf 100644
--- a/Source/WebCore/history/CachedFrame.cpp
+++ b/Source/WebCore/history/CachedFrame.cpp
@@ -134,7 +134,7 @@ void CachedFrameBase::restore()
m_document->enqueuePopstateEvent(historyItem && historyItem->stateObject() ? historyItem->stateObject() : SerializedScriptValue::nullValue());
#if ENABLE(TOUCH_EVENTS)
- if (m_document->hasListenerType(Document::TOUCH_LISTENER))
+ if (m_document->touchEventHandlerCount())
m_document->page()->chrome()->client()->needTouchEvents(true);
#endif
@@ -174,9 +174,7 @@ CachedFrame::CachedFrame(Frame* frame)
m_document->suspendActiveDOMObjects(ActiveDOMObject::DocumentWillBecomeInactive);
m_cachedFrameScriptData = adoptPtr(new ScriptCachedFrameData(frame));
- m_domWindow = frame->domWindow();
- ASSERT(m_domWindow);
- m_domWindow->suspendForPageCache();
+ m_document->domWindow()->suspendForPageCache();
frame->loader()->client()->savePlatformDataToCachedFrame(this);
@@ -250,7 +248,7 @@ void CachedFrame::destroy()
ASSERT(m_view);
ASSERT(m_document->frame() == m_view->frame());
- m_domWindow->willDestroyCachedFrame();
+ m_document->domWindow()->willDestroyCachedFrame();
if (!m_isMainFrame) {
m_view->frame()->detachFromPage();
diff --git a/Source/WebCore/history/CachedFrame.h b/Source/WebCore/history/CachedFrame.h
index a16f89323..463fa7f8b 100644
--- a/Source/WebCore/history/CachedFrame.h
+++ b/Source/WebCore/history/CachedFrame.h
@@ -51,7 +51,6 @@ public:
Document* document() const { return m_document.get(); }
FrameView* view() const { return m_view.get(); }
const KURL& url() const { return m_url; }
- DOMWindow* domWindow() const { return m_domWindow.get(); }
bool isMainFrame() { return m_isMainFrame; }
protected:
@@ -60,7 +59,6 @@ protected:
RefPtr<Document> m_document;
RefPtr<DocumentLoader> m_documentLoader;
- RefPtr<DOMWindow> m_domWindow;
RefPtr<FrameView> m_view;
RefPtr<Node> m_mousePressNode;
KURL m_url;
diff --git a/Source/WebCore/history/PageCache.cpp b/Source/WebCore/history/PageCache.cpp
index 8c379eb24..e7eebdc43 100644
--- a/Source/WebCore/history/PageCache.cpp
+++ b/Source/WebCore/history/PageCache.cpp
@@ -137,7 +137,7 @@ static unsigned logCanCacheFrameDecision(Frame* frame, int indentLevel)
PCLOG(" -Frame is HTTPS, and cache control prohibits caching or storing");
rejectReasons |= 1 << IsHttpsAndCacheControlled;
}
- if (frame->domWindow() && frame->domWindow()->hasEventListeners(eventNames().unloadEvent)) {
+ if (frame->document()->domWindow() && frame->document()->domWindow()->hasEventListeners(eventNames().unloadEvent)) {
PCLOG(" -Frame has an unload event listener");
rejectReasons |= 1 << HasUnloadListener;
}
@@ -343,7 +343,7 @@ bool PageCache::canCachePageContainingThisFrame(Frame* frame)
&& !(documentLoader->substituteData().isValid() && !documentLoader->substituteData().failingURL().isEmpty())
&& (!frameLoader->subframeLoader()->containsPlugins() || frame->page()->settings()->pageCacheSupportsPlugins())
&& (!document->url().protocolIs("https") || (!documentLoader->response().cacheControlContainsNoCache() && !documentLoader->response().cacheControlContainsNoStore()))
- && (!frame->domWindow() || !frame->domWindow()->hasEventListeners(eventNames().unloadEvent))
+ && (!document->domWindow() || !document->domWindow()->hasEventListeners(eventNames().unloadEvent))
#if ENABLE(SQL_DATABASE)
&& !DatabaseContext::hasOpenDatabases(document)
#endif
diff --git a/Source/WebCore/html/BaseDateAndTimeInputType.cpp b/Source/WebCore/html/BaseDateAndTimeInputType.cpp
index 921fcdba7..4b7f93cf0 100644
--- a/Source/WebCore/html/BaseDateAndTimeInputType.cpp
+++ b/Source/WebCore/html/BaseDateAndTimeInputType.cpp
@@ -103,12 +103,6 @@ void BaseDateAndTimeInputType::handleKeydownEvent(KeyboardEvent* event)
TextFieldInputType::handleKeydownEvent(event);
}
-void BaseDateAndTimeInputType::handleWheelEvent(WheelEvent* event)
-{
- if (shouldHaveSpinButton())
- handleWheelEventForSpinButton(event);
-}
-
Decimal BaseDateAndTimeInputType::parseToNumber(const String& source, const Decimal& defaultValue) const
{
DateComponents date;
diff --git a/Source/WebCore/html/BaseDateAndTimeInputType.h b/Source/WebCore/html/BaseDateAndTimeInputType.h
index af335fa42..a49910fde 100644
--- a/Source/WebCore/html/BaseDateAndTimeInputType.h
+++ b/Source/WebCore/html/BaseDateAndTimeInputType.h
@@ -44,6 +44,7 @@ protected:
virtual void handleKeydownEvent(KeyboardEvent*) OVERRIDE;
virtual Decimal parseToNumber(const String&, const Decimal&) const OVERRIDE;
virtual bool parseToDateComponents(const String&, DateComponents*) const OVERRIDE;
+ virtual String serialize(const Decimal&) const OVERRIDE;
String serializeWithComponents(const DateComponents&) const;
private:
@@ -58,8 +59,6 @@ private:
virtual bool typeMismatch() const OVERRIDE;
virtual Decimal defaultValueForStepUp() const OVERRIDE;
virtual bool isSteppable() const OVERRIDE;
- virtual void handleWheelEvent(WheelEvent*) OVERRIDE;
- virtual String serialize(const Decimal&) const OVERRIDE;
virtual String serializeWithMilliseconds(double) const;
virtual String localizeValue(const String&) const OVERRIDE;
virtual String visibleValue() const OVERRIDE;
diff --git a/Source/WebCore/html/DateInputType.cpp b/Source/WebCore/html/DateInputType.cpp
index 962046a42..4c9529c52 100644
--- a/Source/WebCore/html/DateInputType.cpp
+++ b/Source/WebCore/html/DateInputType.cpp
@@ -51,6 +51,9 @@ static const int dateStepScaleFactor = 86400000;
inline DateInputType::DateInputType(HTMLInputElement* element)
: BaseDateAndTimeInputType(element)
+#if ENABLE(CALENDAR_PICKER)
+ , m_pickerElement(0)
+#endif
{
}
@@ -102,14 +105,15 @@ bool DateInputType::isDateField() const
void DateInputType::createShadowSubtree()
{
BaseDateAndTimeInputType::createShadowSubtree();
- m_pickerElement = CalendarPickerElement::create(element()->document());
- containerElement()->insertBefore(m_pickerElement.get(), innerBlockElement()->nextSibling(), ASSERT_NO_EXCEPTION);
+ RefPtr<CalendarPickerElement> pickerElement = CalendarPickerElement::create(element()->document());
+ m_pickerElement = pickerElement.get();
+ containerElement()->insertBefore(m_pickerElement, innerBlockElement()->nextSibling(), ASSERT_NO_EXCEPTION);
}
void DateInputType::destroyShadowSubtree()
{
TextFieldInputType::destroyShadowSubtree();
- m_pickerElement.clear();
+ m_pickerElement = 0;
}
bool DateInputType::needsContainer() const
diff --git a/Source/WebCore/html/DateInputType.h b/Source/WebCore/html/DateInputType.h
index 2fadc47b4..d48049daa 100644
--- a/Source/WebCore/html/DateInputType.h
+++ b/Source/WebCore/html/DateInputType.h
@@ -65,7 +65,7 @@ private:
virtual bool needsContainer() const OVERRIDE;
virtual bool shouldHaveSpinButton() const OVERRIDE;
- RefPtr<CalendarPickerElement> m_pickerElement;
+ CalendarPickerElement* m_pickerElement;
#endif
};
diff --git a/Source/WebCore/html/FileInputType.cpp b/Source/WebCore/html/FileInputType.cpp
index d08fe2451..f7896bab8 100644
--- a/Source/WebCore/html/FileInputType.cpp
+++ b/Source/WebCore/html/FileInputType.cpp
@@ -96,6 +96,18 @@ PassOwnPtr<InputType> FileInputType::create(HTMLInputElement* element)
return adoptPtr(new FileInputType(element));
}
+Vector<FileChooserFileInfo> FileInputType::filesFromFormControlState(const FormControlState& state)
+{
+ Vector<FileChooserFileInfo> files;
+ for (size_t i = 0; i < state.valueSize(); i += 2) {
+ if (!state[i + 1].isEmpty())
+ files.append(FileChooserFileInfo(state[i], state[i + 1]));
+ else
+ files.append(FileChooserFileInfo(state[i]));
+ }
+ return files;
+}
+
const AtomicString& FileInputType::formControlType() const
{
return InputTypeNames::file();
@@ -118,14 +130,7 @@ void FileInputType::restoreFormControlState(const FormControlState& state)
{
if (state.valueSize() % 2)
return;
- Vector<FileChooserFileInfo> files;
- for (size_t i = 0; i < state.valueSize(); i += 2) {
- if (!state[i + 1].isEmpty())
- files.append(FileChooserFileInfo(state[i], state[i + 1]));
- else
- files.append(FileChooserFileInfo(state[i]));
- }
- filesChosen(files);
+ filesChosen(filesFromFormControlState(state));
}
bool FileInputType::appendFormData(FormDataList& encoding, bool multipart) const
diff --git a/Source/WebCore/html/FileInputType.h b/Source/WebCore/html/FileInputType.h
index 903639ec0..10acde702 100644
--- a/Source/WebCore/html/FileInputType.h
+++ b/Source/WebCore/html/FileInputType.h
@@ -45,6 +45,7 @@ class FileList;
class FileInputType : public BaseClickableWithKeyInputType, private FileChooserClient, private FileIconLoaderClient {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
+ static Vector<FileChooserFileInfo> filesFromFormControlState(const FormControlState&);
private:
FileInputType(HTMLInputElement*);
diff --git a/Source/WebCore/html/FormController.cpp b/Source/WebCore/html/FormController.cpp
index 5e39fe229..e35eff19e 100644
--- a/Source/WebCore/html/FormController.cpp
+++ b/Source/WebCore/html/FormController.cpp
@@ -21,8 +21,10 @@
#include "config.h"
#include "FormController.h"
+#include "FileChooser.h"
#include "HTMLFormControlElementWithState.h"
#include "HTMLFormElement.h"
+#include "HTMLInputElement.h"
#include <wtf/text/StringBuilder.h>
namespace WebCore {
@@ -180,6 +182,8 @@ public:
void appendControlState(const AtomicString& name, const AtomicString& type, const FormControlState&);
FormControlState takeControlState(const AtomicString& name, const AtomicString& type);
+ Vector<String> getReferencedFilePaths() const;
+
private:
SavedFormState() : m_controlStateCount(0) { }
@@ -263,6 +267,23 @@ FormControlState SavedFormState::takeControlState(const AtomicString& name, cons
return state;
}
+Vector<String> SavedFormState::getReferencedFilePaths() const
+{
+ Vector<String> toReturn;
+ for (FormElementStateMap::const_iterator it = m_stateForNewFormElements.begin(); it != m_stateForNewFormElements.end(); ++it) {
+ const FormElementKey& key = it->first;
+ if (AtomicString(key.type()) != AtomicString("file"))
+ continue;
+ const Deque<FormControlState>& queue = it->second;
+ for (Deque<FormControlState>::const_iterator queIterator = queue.begin(); queIterator != queue.end(); ++queIterator) {
+ const Vector<FileChooserFileInfo>& selectedFiles = HTMLInputElement::filesFromFileInputFormControlState(*queIterator);
+ for (size_t i = 0; i < selectedFiles.size(); ++i)
+ toReturn.append(selectedFiles[i].path);
+ }
+ }
+ return toReturn;
+}
+
// ----------------------------------------------------------------------------
class FormKeyGenerator {
@@ -408,23 +429,7 @@ Vector<String> FormController::formElementsState() const
void FormController::setStateForNewFormElements(const Vector<String>& stateVector)
{
- m_formElementsWithState.clear();
-
- size_t i = 0;
- if (stateVector.size() < 1 || stateVector[i++] != formStateSignature())
- return;
-
- while (i + 1 < stateVector.size()) {
- AtomicString formKey = stateVector[i++];
- OwnPtr<SavedFormState> state = SavedFormState::deserialize(stateVector, i);
- if (!state) {
- i = 0;
- break;
- }
- m_savedFormStateMap.add(formKey.impl(), state.release());
- }
- if (i != stateVector.size())
- m_savedFormStateMap.clear();
+ formStatesFromStateVector(stateVector, m_savedFormStateMap);
}
FormControlState FormController::takeStateForFormElement(const HTMLFormControlElementWithState& control)
@@ -442,6 +447,27 @@ FormControlState FormController::takeStateForFormElement(const HTMLFormControlEl
return state;
}
+void FormController::formStatesFromStateVector(const Vector<String>& stateVector, SavedFormStateMap& map)
+{
+ map.clear();
+
+ size_t i = 0;
+ if (stateVector.size() < 1 || stateVector[i++] != formStateSignature())
+ return;
+
+ while (i + 1 < stateVector.size()) {
+ AtomicString formKey = stateVector[i++];
+ OwnPtr<SavedFormState> state = SavedFormState::deserialize(stateVector, i);
+ if (!state) {
+ i = 0;
+ break;
+ }
+ map.add(formKey.impl(), state.release());
+ }
+ if (i != stateVector.size())
+ map.clear();
+}
+
void FormController::willDeleteForm(HTMLFormElement* form)
{
if (m_formKeyGenerator)
@@ -479,5 +505,14 @@ void FormController::restoreControlStateIn(HTMLFormElement& form)
}
}
-} // namespace WebCore
+Vector<String> FormController::getReferencedFilePaths(const Vector<String>& stateVector)
+{
+ Vector<String> toReturn;
+ SavedFormStateMap map;
+ formStatesFromStateVector(stateVector, map);
+ for (SavedFormStateMap::const_iterator it = map.begin(); it != map.end(); ++it)
+ toReturn.append(it->second->getReferencedFilePaths());
+ return toReturn;
+}
+} // namespace WebCore
diff --git a/Source/WebCore/html/FormController.h b/Source/WebCore/html/FormController.h
index 5d3748d0e..0402b2cd1 100644
--- a/Source/WebCore/html/FormController.h
+++ b/Source/WebCore/html/FormController.h
@@ -92,6 +92,8 @@ public:
void restoreControlStateFor(HTMLFormControlElementWithState&);
void restoreControlStateIn(HTMLFormElement&);
+ static Vector<String> getReferencedFilePaths(const Vector<String>& stateVector);
+
private:
typedef ListHashSet<HTMLFormControlElementWithState*, 64> FormElementListHashSet;
typedef HashMap<RefPtr<AtomicStringImpl>, OwnPtr<SavedFormState> > SavedFormStateMap;
@@ -99,6 +101,7 @@ private:
FormController();
static PassOwnPtr<SavedFormStateMap> createSavedFormStateMap(const FormElementListHashSet&);
FormControlState takeStateForFormElement(const HTMLFormControlElementWithState&);
+ static void formStatesFromStateVector(const Vector<String>&, SavedFormStateMap&);
CheckedRadioButtons m_checkedRadioButtons;
FormElementListHashSet m_formElementsWithState;
diff --git a/Source/WebCore/html/HTMLAllCollection.idl b/Source/WebCore/html/HTMLAllCollection.idl
index 50e189c65..f9c093da0 100644
--- a/Source/WebCore/html/HTMLAllCollection.idl
+++ b/Source/WebCore/html/HTMLAllCollection.idl
@@ -36,7 +36,6 @@ module html {
readonly attribute unsigned long length;
[Custom] Node item(in [Optional=DefaultIsUndefined] unsigned long index);
[Custom] Node namedItem(in DOMString name);
-
// FIXME: This should return an HTMLAllCollection.
NodeList tags(in DOMString name);
};
diff --git a/Source/WebCore/html/HTMLBodyElement.cpp b/Source/WebCore/html/HTMLBodyElement.cpp
index 846e331e0..85cdf38b1 100644
--- a/Source/WebCore/html/HTMLBodyElement.cpp
+++ b/Source/WebCore/html/HTMLBodyElement.cpp
@@ -156,11 +156,11 @@ Node::InsertionNotificationRequest HTMLBodyElement::insertedInto(ContainerNode*
{
HTMLElement::insertedInto(insertionPoint);
if (insertionPoint->inDocument())
- return InsertionShouldCallDidNotifyDescendantInsertions;
+ return InsertionShouldCallDidNotifySubtreeInsertions;
return InsertionDone;
}
-void HTMLBodyElement::didNotifyDescendantInsertions(ContainerNode* insertionPoint)
+void HTMLBodyElement::didNotifySubtreeInsertions(ContainerNode* insertionPoint)
{
ASSERT_UNUSED(insertionPoint, insertionPoint->inDocument());
ASSERT(document());
diff --git a/Source/WebCore/html/HTMLBodyElement.h b/Source/WebCore/html/HTMLBodyElement.h
index 22ac19c76..422ad3066 100644
--- a/Source/WebCore/html/HTMLBodyElement.h
+++ b/Source/WebCore/html/HTMLBodyElement.h
@@ -75,7 +75,7 @@ private:
virtual void collectStyleForAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
- virtual void didNotifyDescendantInsertions(ContainerNode*) OVERRIDE;
+ virtual void didNotifySubtreeInsertions(ContainerNode*) OVERRIDE;
virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
diff --git a/Source/WebCore/html/HTMLFormElement.cpp b/Source/WebCore/html/HTMLFormElement.cpp
index 9b2a5915c..947f4d92b 100644
--- a/Source/WebCore/html/HTMLFormElement.cpp
+++ b/Source/WebCore/html/HTMLFormElement.cpp
@@ -136,8 +136,6 @@ bool HTMLFormElement::rendererIsNeeded(const NodeRenderingContext& context)
Node::InsertionNotificationRequest HTMLFormElement::insertedInto(ContainerNode* insertionPoint)
{
HTMLElement::insertedInto(insertionPoint);
- if (insertionPoint->inDocument())
- return InsertionShouldCallDidNotifyDescendantInsertions;
return InsertionDone;
}
@@ -252,7 +250,7 @@ bool HTMLFormElement::validateInteractively(Event* event)
}
}
// Warn about all of unfocusable controls.
- if (Frame* frame = document()->frame()) {
+ if (document()->frame()) {
for (unsigned i = 0; i < unhandledInvalidControls.size(); ++i) {
FormAssociatedElement* unhandledAssociatedElement = unhandledInvalidControls[i].get();
HTMLElement* unhandled = toHTMLElement(unhandledAssociatedElement);
@@ -260,7 +258,7 @@ bool HTMLFormElement::validateInteractively(Event* event)
continue;
String message("An invalid form control with name='%name' is not focusable.");
message.replace("%name", unhandledAssociatedElement->name());
- frame->domWindow()->console()->addMessage(HTMLMessageSource, LogMessageType, ErrorMessageLevel, message, document()->url().string());
+ document()->domWindow()->console()->addMessage(HTMLMessageSource, LogMessageType, ErrorMessageLevel, message, document()->url().string());
}
}
return false;
diff --git a/Source/WebCore/html/HTMLFrameElementBase.cpp b/Source/WebCore/html/HTMLFrameElementBase.cpp
index d12e7b434..3a93a1abd 100644
--- a/Source/WebCore/html/HTMLFrameElementBase.cpp
+++ b/Source/WebCore/html/HTMLFrameElementBase.cpp
@@ -157,11 +157,11 @@ Node::InsertionNotificationRequest HTMLFrameElementBase::insertedInto(ContainerN
{
HTMLFrameOwnerElement::insertedInto(insertionPoint);
if (insertionPoint->inDocument())
- return InsertionShouldCallDidNotifyDescendantInsertions;
+ return InsertionShouldCallDidNotifySubtreeInsertions;
return InsertionDone;
}
-void HTMLFrameElementBase::didNotifyDescendantInsertions(ContainerNode* insertionPoint)
+void HTMLFrameElementBase::didNotifySubtreeInsertions(ContainerNode* insertionPoint)
{
ASSERT_UNUSED(insertionPoint, insertionPoint->inDocument());
diff --git a/Source/WebCore/html/HTMLFrameElementBase.h b/Source/WebCore/html/HTMLFrameElementBase.h
index 0f84df36e..a4163ea11 100644
--- a/Source/WebCore/html/HTMLFrameElementBase.h
+++ b/Source/WebCore/html/HTMLFrameElementBase.h
@@ -51,7 +51,7 @@ protected:
virtual void parseAttribute(const Attribute&) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
- virtual void didNotifyDescendantInsertions(ContainerNode*) OVERRIDE;
+ virtual void didNotifySubtreeInsertions(ContainerNode*) OVERRIDE;
virtual void attach();
private:
diff --git a/Source/WebCore/html/HTMLFrameOwnerElement.cpp b/Source/WebCore/html/HTMLFrameOwnerElement.cpp
index 6b706602d..560f38b96 100644
--- a/Source/WebCore/html/HTMLFrameOwnerElement.cpp
+++ b/Source/WebCore/html/HTMLFrameOwnerElement.cpp
@@ -73,7 +73,7 @@ Document* HTMLFrameOwnerElement::contentDocument() const
DOMWindow* HTMLFrameOwnerElement::contentWindow() const
{
- return m_contentFrame ? m_contentFrame->domWindow() : 0;
+ return m_contentFrame ? m_contentFrame->document()->domWindow() : 0;
}
void HTMLFrameOwnerElement::setSandboxFlags(SandboxFlags flags)
diff --git a/Source/WebCore/html/HTMLImageElement.cpp b/Source/WebCore/html/HTMLImageElement.cpp
index e3138e6e0..ba0fd99c6 100644
--- a/Source/WebCore/html/HTMLImageElement.cpp
+++ b/Source/WebCore/html/HTMLImageElement.cpp
@@ -202,6 +202,14 @@ RenderObject* HTMLImageElement::createRenderer(RenderArena* arena, RenderStyle*
return createRendererForImage(this, arena);
}
+bool HTMLImageElement::canStartSelection() const
+{
+ if (shadow())
+ return HTMLElement::canStartSelection();
+
+ return false;
+}
+
void HTMLImageElement::attach()
{
HTMLElement::attach();
diff --git a/Source/WebCore/html/HTMLImageElement.h b/Source/WebCore/html/HTMLImageElement.h
index 07a297372..ae8e7cb3d 100644
--- a/Source/WebCore/html/HTMLImageElement.h
+++ b/Source/WebCore/html/HTMLImageElement.h
@@ -110,7 +110,7 @@ private:
virtual void attach();
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
- virtual bool canStartSelection() const { return false; }
+ virtual bool canStartSelection() const;
virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
diff --git a/Source/WebCore/html/HTMLImageLoader.cpp b/Source/WebCore/html/HTMLImageLoader.cpp
index 46a652780..96f570d53 100644
--- a/Source/WebCore/html/HTMLImageLoader.cpp
+++ b/Source/WebCore/html/HTMLImageLoader.cpp
@@ -56,7 +56,7 @@ void HTMLImageLoader::dispatchLoadEvent()
bool errorOccurred = image()->errorOccurred();
if (!errorOccurred && image()->response().httpStatusCode() >= 400)
errorOccurred = client()->sourceElement()->hasTagName(HTMLNames::objectTag); // An <object> considers a 404 to be an error and should fire onerror.
- client()->imageElement()->dispatchEvent(Event::create(errorOccurred ? eventNames().errorEvent : eventNames().loadEvent, false, false));
+ client()->eventTarget()->dispatchEvent(Event::create(errorOccurred ? eventNames().errorEvent : eventNames().loadEvent, false, false));
}
String HTMLImageLoader::sourceURI(const AtomicString& attr) const
diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp
index e07067c66..461e39d51 100644
--- a/Source/WebCore/html/HTMLInputElement.cpp
+++ b/Source/WebCore/html/HTMLInputElement.cpp
@@ -36,6 +36,7 @@
#include "Document.h"
#include "EventNames.h"
#include "ExceptionCode.h"
+#include "FileInputType.h"
#include "FileList.h"
#include "FormController.h"
#include "Frame.h"
@@ -56,7 +57,6 @@
#include "SearchInputType.h"
#include "ShadowRoot.h"
#include "ScriptEventListener.h"
-#include "WheelEvent.h"
#include <wtf/MathExtras.h>
#include <wtf/StdLibExtras.h>
@@ -160,6 +160,11 @@ const AtomicString& HTMLInputElement::name() const
return m_name.isNull() ? emptyAtom : m_name;
}
+Vector<FileChooserFileInfo> HTMLInputElement::filesFromFileInputFormControlState(const FormControlState& state)
+{
+ return FileInputType::filesFromFormControlState(state);
+}
+
HTMLElement* HTMLInputElement::containerElement() const
{
return m_inputType->containerElement();
@@ -439,10 +444,9 @@ void HTMLInputElement::updateType()
#if ENABLE(TOUCH_EVENTS)
bool hasTouchEventHandler = m_inputType->hasTouchEventHandler();
if (hasTouchEventHandler != m_hasTouchEventHandler) {
- if (hasTouchEventHandler) {
+ if (hasTouchEventHandler)
document()->didAddTouchEventHandler();
- document()->addListenerType(Document::TOUCH_LISTENER);
- } else
+ else
document()->didRemoveTouchEventHandler();
m_hasTouchEventHandler = hasTouchEventHandler;
}
@@ -850,7 +854,7 @@ void HTMLInputElement::setChecked(bool nowChecked, TextFieldEventBehavior eventB
// RenderTextView), but it's not possible to do it at the moment
// because of the way the code is structured.
if (renderer() && AXObjectCache::accessibilityEnabled())
- renderer()->document()->axObjectCache()->checkedStateChanged(renderer());
+ renderer()->document()->axObjectCache()->checkedStateChanged(this);
// Only send a change event for items in the document (avoid firing during
// parsing) and don't send a change event for a radio button that's getting
@@ -1155,12 +1159,6 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
if (evt->isBeforeTextInsertedEvent())
m_inputType->handleBeforeTextInsertedEvent(static_cast<BeforeTextInsertedEvent*>(evt));
- if (evt->hasInterface(eventNames().interfaceForWheelEvent)) {
- m_inputType->handleWheelEvent(static_cast<WheelEvent*>(evt));
- if (evt->defaultHandled())
- return;
- }
-
if (evt->isMouseEvent() && evt->type() == eventNames().mousedownEvent) {
m_inputType->handleMouseDownEvent(static_cast<MouseEvent*>(evt));
if (evt->defaultHandled())
diff --git a/Source/WebCore/html/HTMLInputElement.h b/Source/WebCore/html/HTMLInputElement.h
index dc32159f2..8a0e4d4b7 100644
--- a/Source/WebCore/html/HTMLInputElement.h
+++ b/Source/WebCore/html/HTMLInputElement.h
@@ -25,6 +25,7 @@
#ifndef HTMLInputElement_h
#define HTMLInputElement_h
+#include "FileChooser.h"
#include "HTMLTextFormControlElement.h"
#include "ImageLoaderClient.h"
#include "StepRange.h"
@@ -277,6 +278,8 @@ public:
virtual const AtomicString& name() const OVERRIDE;
+ static Vector<FileChooserFileInfo> filesFromFileInputFormControlState(const FormControlState&);
+
protected:
HTMLInputElement(const QualifiedName&, Document*, HTMLFormElement*, bool createdByParser);
void createShadowSubtree();
diff --git a/Source/WebCore/html/HTMLLinkElement.cpp b/Source/WebCore/html/HTMLLinkElement.cpp
index 096ecca48..d2868b610 100644
--- a/Source/WebCore/html/HTMLLinkElement.cpp
+++ b/Source/WebCore/html/HTMLLinkElement.cpp
@@ -278,7 +278,7 @@ void HTMLLinkElement::removedFrom(ContainerNode* insertionPoint)
clearSheet();
if (styleSheetIsLoading())
- removePendingSheet();
+ removePendingSheet(RemovePendingSheetNotifyLater);
if (document()->renderer())
document()->styleResolverChanged(DeferRecalcStyle);
@@ -317,7 +317,7 @@ void HTMLLinkElement::setCSSStyleSheet(const String& href, const KURL& baseURL,
}
#endif
- RefPtr<StyleSheetContents> styleSheet = StyleSheetContents::create(href, baseURL, parserContext);
+ RefPtr<StyleSheetContents> styleSheet = StyleSheetContents::create(href, parserContext);
m_sheet = CSSStyleSheet::create(styleSheet, this);
m_sheet->setMediaQueries(MediaQuerySet::createAllowingDescriptionSyntax(m_media));
@@ -458,7 +458,7 @@ void HTMLLinkElement::addPendingSheet(PendingSheetType type)
document()->addPendingSheet();
}
-void HTMLLinkElement::removePendingSheet()
+void HTMLLinkElement::removePendingSheet(RemovePendingSheetNotificationType notification)
{
PendingSheetType type = m_pendingSheetType;
m_pendingSheetType = None;
@@ -470,7 +470,11 @@ void HTMLLinkElement::removePendingSheet()
document()->styleResolverChanged(RecalcStyleImmediately);
return;
}
- document()->removePendingSheet();
+
+ document()->removePendingSheet(
+ notification == RemovePendingSheetNotifyImmediately
+ ? Document::RemovePendingSheetNotifyImmediately
+ : Document::RemovePendingSheetNotifyLater);
}
DOMSettableTokenList* HTMLLinkElement::sizes() const
diff --git a/Source/WebCore/html/HTMLLinkElement.h b/Source/WebCore/html/HTMLLinkElement.h
index e330e73d1..0b6c6c997 100644
--- a/Source/WebCore/html/HTMLLinkElement.h
+++ b/Source/WebCore/html/HTMLLinkElement.h
@@ -105,7 +105,13 @@ private:
enum PendingSheetType { None, NonBlocking, Blocking };
void addPendingSheet(PendingSheetType);
- void removePendingSheet();
+
+ enum RemovePendingSheetNotificationType {
+ RemovePendingSheetNotifyImmediately,
+ RemovePendingSheetNotifyLater
+ };
+
+ void removePendingSheet(RemovePendingSheetNotificationType = RemovePendingSheetNotifyImmediately);
#if ENABLE(MICRODATA)
virtual String itemValueText() const OVERRIDE;
diff --git a/Source/WebCore/html/HTMLMediaElement.h b/Source/WebCore/html/HTMLMediaElement.h
index bdc614989..da102a6d2 100644
--- a/Source/WebCore/html/HTMLMediaElement.h
+++ b/Source/WebCore/html/HTMLMediaElement.h
@@ -174,7 +174,6 @@ public:
#if ENABLE(MEDIA_SOURCE)
// Media Source.
- const KURL& webkitMediaSourceURL() const { return m_mediaSourceURL; }
void setSourceState(const String&);
#endif
diff --git a/Source/WebCore/html/HTMLMediaElement.idl b/Source/WebCore/html/HTMLMediaElement.idl
index 9d0ae8a77..b6a0a636f 100644
--- a/Source/WebCore/html/HTMLMediaElement.idl
+++ b/Source/WebCore/html/HTMLMediaElement.idl
@@ -95,11 +95,6 @@ module html {
readonly attribute [Conditional=MEDIA_STATISTICS] unsigned long webkitAudioDecodedByteCount;
readonly attribute [Conditional=MEDIA_STATISTICS] unsigned long webkitVideoDecodedByteCount;
-#if defined(ENABLE_MEDIA_SOURCE) && ENABLE_MEDIA_SOURCE
- // URL passed to src attribute to enable the media source logic.
- readonly attribute [V8EnabledAtRuntime=mediaSource, URL] DOMString webkitMediaSourceURL;
-#endif
-
#if defined(ENABLE_ENCRYPTED_MEDIA) && ENABLE_ENCRYPTED_MEDIA
[V8EnabledAtRuntime=encryptedMedia] void webkitGenerateKeyRequest(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, in [Optional] Uint8Array initData)
raises (DOMException);
diff --git a/Source/WebCore/html/HTMLMeterElement.cpp b/Source/WebCore/html/HTMLMeterElement.cpp
index 290de5b07..dbf46c15f 100644
--- a/Source/WebCore/html/HTMLMeterElement.cpp
+++ b/Source/WebCore/html/HTMLMeterElement.cpp
@@ -31,7 +31,9 @@
#include "HTMLNames.h"
#include "HTMLParserIdioms.h"
#include "MeterShadowElement.h"
+#include "Page.h"
#include "RenderMeter.h"
+#include "RenderTheme.h"
#include "ShadowRoot.h"
#include <wtf/StdLibExtras.h>
@@ -41,6 +43,7 @@ using namespace HTMLNames;
HTMLMeterElement::HTMLMeterElement(const QualifiedName& tagName, Document* document)
: LabelableElement(tagName, document)
+ , m_hasAuthorShadowRoot(false)
{
ASSERT(hasTagName(meterTag));
}
@@ -56,8 +59,11 @@ PassRefPtr<HTMLMeterElement> HTMLMeterElement::create(const QualifiedName& tagNa
return meter;
}
-RenderObject* HTMLMeterElement::createRenderer(RenderArena* arena, RenderStyle*)
+RenderObject* HTMLMeterElement::createRenderer(RenderArena* arena, RenderStyle* style)
{
+ if (hasAuthorShadowRoot() || !document()->page()->theme()->supportsMeter(style->appearance()))
+ return RenderObject::createObject(this, style);
+
return new (arena) RenderMeter(this);
}
@@ -79,6 +85,12 @@ void HTMLMeterElement::parseAttribute(const Attribute& attribute)
LabelableElement::parseAttribute(attribute);
}
+void HTMLMeterElement::attach()
+{
+ m_value->setWidthPercentage(valueRatio()*100);
+ LabelableElement::attach();
+}
+
double HTMLMeterElement::min() const
{
return parseToDoubleForNumberType(getAttribute(minAttr), 0);
@@ -214,22 +226,40 @@ double HTMLMeterElement::valueRatio() const
void HTMLMeterElement::didElementStateChange()
{
m_value->setWidthPercentage(valueRatio()*100);
- if (RenderObject* render = renderer())
+ if (RenderMeter* render = renderMeter())
render->updateFromElement();
}
+void HTMLMeterElement::willAddAuthorShadowRoot()
+{
+ m_hasAuthorShadowRoot = true;
+}
+
+RenderMeter* HTMLMeterElement::renderMeter() const
+{
+ if (renderer() && renderer()->isMeter())
+ return static_cast<RenderMeter*>(renderer());
+
+ RenderObject* renderObject = userAgentShadowRoot()->firstChild()->renderer();
+ ASSERT(!renderObject || renderObject->isMeter());
+ return static_cast<RenderMeter*>(renderObject);
+}
+
void HTMLMeterElement::createShadowSubtree()
{
- ASSERT(!shadow());
+ ASSERT(!userAgentShadowRoot());
+
+ RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot, ASSERT_NO_EXCEPTION);
+
+ RefPtr<MeterInnerElement> inner = MeterInnerElement::create(document());
+ root->appendChild(inner);
RefPtr<MeterBarElement> bar = MeterBarElement::create(document());
m_value = MeterValueElement::create(document());
m_value->setWidthPercentage(0);
- ExceptionCode ec = 0;
- bar->appendChild(m_value, ec);
+ bar->appendChild(m_value, ASSERT_NO_EXCEPTION);
- RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot);
- root->appendChild(bar, ec);
+ inner->appendChild(bar, ASSERT_NO_EXCEPTION);
}
} // namespace
diff --git a/Source/WebCore/html/HTMLMeterElement.h b/Source/WebCore/html/HTMLMeterElement.h
index 188309157..8e63c64a8 100644
--- a/Source/WebCore/html/HTMLMeterElement.h
+++ b/Source/WebCore/html/HTMLMeterElement.h
@@ -27,6 +27,7 @@
namespace WebCore {
class MeterValueElement;
+class RenderMeter;
class HTMLMeterElement : public LabelableElement {
public:
@@ -38,6 +39,8 @@ public:
GaugeRegionEvenLessGood
};
+ bool hasAuthorShadowRoot() const { return m_hasAuthorShadowRoot; }
+
double min() const;
void setMin(double, ExceptionCode&);
@@ -65,6 +68,9 @@ private:
HTMLMeterElement(const QualifiedName&, Document*);
virtual ~HTMLMeterElement();
+ virtual void willAddAuthorShadowRoot() OVERRIDE;
+ RenderMeter* renderMeter() const;
+
virtual bool supportLabels() const OVERRIDE { return true; }
virtual bool supportsFocus() const;
@@ -74,12 +80,26 @@ private:
virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const OVERRIDE;
virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void attach() OVERRIDE;
+
void didElementStateChange();
void createShadowSubtree();
RefPtr<MeterValueElement> m_value;
+ bool m_hasAuthorShadowRoot;
};
+inline bool isHTMLMeterElement(Node* node)
+{
+ return node->hasTagName(HTMLNames::meterTag);
+}
+
+inline HTMLMeterElement* toHTMLMeterElement(Node* node)
+{
+ ASSERT(!node || isHTMLMeterElement(node));
+ return static_cast<HTMLMeterElement*>(node);
+}
+
} // namespace
#endif
diff --git a/Source/WebCore/html/HTMLProgressElement.cpp b/Source/WebCore/html/HTMLProgressElement.cpp
index 48b5b886e..18402fc42 100644
--- a/Source/WebCore/html/HTMLProgressElement.cpp
+++ b/Source/WebCore/html/HTMLProgressElement.cpp
@@ -43,6 +43,7 @@ const double HTMLProgressElement::InvalidPosition = -2;
HTMLProgressElement::HTMLProgressElement(const QualifiedName& tagName, Document* document)
: LabelableElement(tagName, document)
+ , m_value(0)
, m_hasAuthorShadowRoot(false)
{
ASSERT(hasTagName(progressTag));
@@ -164,6 +165,7 @@ void HTMLProgressElement::didElementStateChange()
void HTMLProgressElement::createShadowSubtree()
{
ASSERT(!userAgentShadowRoot());
+ ASSERT(!m_value);
RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot, ASSERT_NO_EXCEPTION);
@@ -171,7 +173,8 @@ void HTMLProgressElement::createShadowSubtree()
root->appendChild(inner);
RefPtr<ProgressBarElement> bar = ProgressBarElement::create(document());
- m_value = ProgressValueElement::create(document());
+ RefPtr<ProgressValueElement> value = ProgressValueElement::create(document());
+ m_value = value.get();
bar->appendChild(m_value, ASSERT_NO_EXCEPTION);
inner->appendChild(bar, ASSERT_NO_EXCEPTION);
diff --git a/Source/WebCore/html/HTMLProgressElement.h b/Source/WebCore/html/HTMLProgressElement.h
index 6660d9d85..46204faa1 100644
--- a/Source/WebCore/html/HTMLProgressElement.h
+++ b/Source/WebCore/html/HTMLProgressElement.h
@@ -71,7 +71,7 @@ private:
void didElementStateChange();
void createShadowSubtree();
- RefPtr<ProgressValueElement> m_value;
+ ProgressValueElement* m_value;
bool m_hasAuthorShadowRoot;
};
diff --git a/Source/WebCore/html/HTMLSelectElement.cpp b/Source/WebCore/html/HTMLSelectElement.cpp
index 98c99b830..9261d52b6 100644
--- a/Source/WebCore/html/HTMLSelectElement.cpp
+++ b/Source/WebCore/html/HTMLSelectElement.cpp
@@ -378,7 +378,7 @@ void HTMLSelectElement::childrenChanged(bool changedByParser, Node* beforeChange
HTMLFormControlElementWithState::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
if (AXObjectCache::accessibilityEnabled() && renderer())
- renderer()->document()->axObjectCache()->childrenChanged(renderer());
+ renderer()->document()->axObjectCache()->childrenChanged(this);
}
void HTMLSelectElement::optionElementChildrenChanged()
@@ -387,7 +387,7 @@ void HTMLSelectElement::optionElementChildrenChanged()
setNeedsValidityCheck();
if (AXObjectCache::accessibilityEnabled() && renderer())
- renderer()->document()->axObjectCache()->childrenChanged(renderer());
+ renderer()->document()->axObjectCache()->childrenChanged(this);
}
void HTMLSelectElement::accessKeyAction(bool sendMouseEvents)
@@ -1591,20 +1591,4 @@ unsigned HTMLSelectElement::length() const
return options;
}
-#ifndef NDEBUG
-
-HTMLSelectElement* toHTMLSelectElement(Node* node)
-{
- ASSERT(!node || node->hasTagName(selectTag));
- return static_cast<HTMLSelectElement*>(node);
-}
-
-const HTMLSelectElement* toHTMLSelectElement(const Node* node)
-{
- ASSERT(!node || node->hasTagName(selectTag));
- return static_cast<const HTMLSelectElement*>(node);
-}
-
-#endif
-
} // namespace
diff --git a/Source/WebCore/html/HTMLSelectElement.h b/Source/WebCore/html/HTMLSelectElement.h
index f9c55d8f7..474c15a64 100644
--- a/Source/WebCore/html/HTMLSelectElement.h
+++ b/Source/WebCore/html/HTMLSelectElement.h
@@ -197,25 +197,24 @@ private:
mutable bool m_shouldRecalcListItems;
};
-HTMLSelectElement* toHTMLSelectElement(Node*);
-const HTMLSelectElement* toHTMLSelectElement(const Node*);
-void toHTMLSelectElement(const HTMLSelectElement*); // This overload will catch anyone doing an unnecessary cast.
-
-#ifdef NDEBUG
-
-// The debug versions of these, with assertions, are not inlined.
+inline bool isHTMLSelectElement(const Node* node)
+{
+ return node->hasTagName(HTMLNames::selectTag);
+}
inline HTMLSelectElement* toHTMLSelectElement(Node* node)
{
+ ASSERT(!node || isHTMLSelectElement(node));
return static_cast<HTMLSelectElement*>(node);
}
inline const HTMLSelectElement* toHTMLSelectElement(const Node* node)
{
+ ASSERT(!node || isHTMLSelectElement(node));
return static_cast<const HTMLSelectElement*>(node);
}
-#endif
+void toHTMLSelectElement(const HTMLSelectElement*); // This overload will catch anyone doing an unnecessary cast.
} // namespace
diff --git a/Source/WebCore/html/HTMLTableCellElement.cpp b/Source/WebCore/html/HTMLTableCellElement.cpp
index 294607d77..02c1a2fee 100644
--- a/Source/WebCore/html/HTMLTableCellElement.cpp
+++ b/Source/WebCore/html/HTMLTableCellElement.cpp
@@ -67,6 +67,9 @@ int HTMLTableCellElement::rowSpan() const
int HTMLTableCellElement::cellIndex() const
{
int index = 0;
+ if (!parentElement() || !parentElement()->hasTagName(trTag))
+ return -1;
+
for (const Node * node = previousSibling(); node; node = node->previousSibling()) {
if (node->hasTagName(tdTag) || node->hasTagName(thTag))
index++;
diff --git a/Source/WebCore/html/HTMLTextFormControlElement.cpp b/Source/WebCore/html/HTMLTextFormControlElement.cpp
index 9092de709..2ec5f09b1 100644
--- a/Source/WebCore/html/HTMLTextFormControlElement.cpp
+++ b/Source/WebCore/html/HTMLTextFormControlElement.cpp
@@ -484,7 +484,7 @@ void HTMLTextFormControlElement::setInnerTextValue(const String& value)
bool textIsChanged = value != innerTextValue();
if (textIsChanged || !innerTextElement()->hasChildNodes()) {
if (textIsChanged && document() && renderer() && AXObjectCache::accessibilityEnabled())
- document()->axObjectCache()->postNotification(renderer(), AXObjectCache::AXValueChanged, false);
+ document()->axObjectCache()->postNotification(this, AXObjectCache::AXValueChanged, false);
ExceptionCode ec = 0;
innerTextElement()->setInnerText(value, ec);
diff --git a/Source/WebCore/html/HTMLTrackElement.cpp b/Source/WebCore/html/HTMLTrackElement.cpp
index a0c20bfa7..b31662c8b 100644
--- a/Source/WebCore/html/HTMLTrackElement.cpp
+++ b/Source/WebCore/html/HTMLTrackElement.cpp
@@ -34,6 +34,7 @@
#include "HTMLNames.h"
#include "Logging.h"
#include "RuntimeEnabledFeatures.h"
+#include "ScriptCallStack.h"
#include "ScriptEventListener.h"
using namespace std;
diff --git a/Source/WebCore/html/HTMLViewSourceDocument.cpp b/Source/WebCore/html/HTMLViewSourceDocument.cpp
index 9317d2d1d..80cdd69cd 100644
--- a/Source/WebCore/html/HTMLViewSourceDocument.cpp
+++ b/Source/WebCore/html/HTMLViewSourceDocument.cpp
@@ -158,7 +158,7 @@ void HTMLViewSourceDocument::processTagToken(const String& source, HTMLToken& to
index = addRange(source, index, iter->m_valueRange.m_start - token.startIndex(), "");
bool isLink = name == srcAttr || name == hrefAttr;
- index = addRange(source, index, iter->m_valueRange.m_end - token.startIndex(), "webkit-html-attribute-value", isLink, tagName == aTag);
+ index = addRange(source, index, iter->m_valueRange.m_end - token.startIndex(), "webkit-html-attribute-value", isLink, tagName == aTag, value);
++iter;
}
@@ -262,7 +262,7 @@ void HTMLViewSourceDocument::addText(const String& text, const AtomicString& cla
}
}
-int HTMLViewSourceDocument::addRange(const String& source, int start, int end, const String& className, bool isLink, bool isAnchor)
+int HTMLViewSourceDocument::addRange(const String& source, int start, int end, const String& className, bool isLink, bool isAnchor, const String& link)
{
ASSERT(start <= end);
if (start == end)
@@ -271,7 +271,7 @@ int HTMLViewSourceDocument::addRange(const String& source, int start, int end, c
String text = source.substring(start, end - start);
if (!className.isEmpty()) {
if (isLink)
- m_current = addLink(text, isAnchor);
+ m_current = addLink(link, isAnchor);
else
m_current = addSpanWithClassName(className);
}
diff --git a/Source/WebCore/html/HTMLViewSourceDocument.h b/Source/WebCore/html/HTMLViewSourceDocument.h
index 73c966ecf..c5c66828e 100644
--- a/Source/WebCore/html/HTMLViewSourceDocument.h
+++ b/Source/WebCore/html/HTMLViewSourceDocument.h
@@ -58,7 +58,7 @@ private:
void addLine(const AtomicString& className);
void finishLine();
void addText(const String& text, const AtomicString& className);
- int addRange(const String& source, int start, int end, const String& className, bool isLink = false, bool isAnchor = false);
+ int addRange(const String& source, int start, int end, const String& className, bool isLink = false, bool isAnchor = false, const String& link = String());
PassRefPtr<Element> addLink(const AtomicString& url, bool isAnchor);
PassRefPtr<Element> addBase(const AtomicString& href);
diff --git a/Source/WebCore/html/InputType.cpp b/Source/WebCore/html/InputType.cpp
index 674572e21..dba902eba 100644
--- a/Source/WebCore/html/InputType.cpp
+++ b/Source/WebCore/html/InputType.cpp
@@ -423,10 +423,6 @@ void InputType::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*)
{
}
-void InputType::handleWheelEvent(WheelEvent*)
-{
-}
-
#if ENABLE(TOUCH_EVENTS)
void InputType::handleTouchEvent(TouchEvent*)
{
@@ -972,7 +968,7 @@ void InputType::applyStep(int count, AnyStepHandling anyStepHandling, TextFieldE
setValueAsDecimal(newValue, eventBehavior, ec);
if (AXObjectCache::accessibilityEnabled())
- element()->document()->axObjectCache()->postNotification(element()->renderer(), AXObjectCache::AXValueChanged, true);
+ element()->document()->axObjectCache()->postNotification(element(), AXObjectCache::AXValueChanged, true);
}
bool InputType::getAllowedValueStep(Decimal* step) const
@@ -1108,141 +1104,141 @@ namespace InputTypeNames {
const AtomicString& button()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("button"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("button", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& checkbox()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("checkbox"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("checkbox", AtomicString::ConstructFromLiteral));
return name;
}
#if ENABLE(INPUT_TYPE_COLOR)
const AtomicString& color()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("color"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("color", AtomicString::ConstructFromLiteral));
return name;
}
#endif
const AtomicString& date()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("date"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("date", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& datetime()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("datetime"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("datetime", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& datetimelocal()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("datetime-local"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("datetime-local", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& email()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("email"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("email", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& file()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("file"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("file", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& hidden()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("hidden"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("hidden", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& image()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("image"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("image", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& month()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("month"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("month", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& number()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("number"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("number", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& password()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("password"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("password", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& radio()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("radio"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("radio", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& range()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("range"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("range", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& reset()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("reset"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("reset", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& search()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("search"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("search", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& submit()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("submit"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("submit", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& telephone()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("tel"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("tel", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& text()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("text"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("text", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& time()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("time"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("time", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& url()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("url"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("url", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& week()
{
- DEFINE_STATIC_LOCAL(AtomicString, name, ("week"));
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("week", AtomicString::ConstructFromLiteral));
return name;
}
diff --git a/Source/WebCore/html/InputType.h b/Source/WebCore/html/InputType.h
index a73ddba27..6159f7796 100644
--- a/Source/WebCore/html/InputType.h
+++ b/Source/WebCore/html/InputType.h
@@ -62,7 +62,6 @@ class RenderArena;
class RenderObject;
class RenderStyle;
class TouchEvent;
-class WheelEvent;
typedef int ExceptionCode;
@@ -194,7 +193,6 @@ public:
virtual void handleKeypressEvent(KeyboardEvent*);
virtual void handleKeyupEvent(KeyboardEvent*);
virtual void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*);
- virtual void handleWheelEvent(WheelEvent*);
#if ENABLE(TOUCH_EVENTS)
virtual void handleTouchEvent(TouchEvent*);
#endif
diff --git a/Source/WebCore/html/NumberInputType.cpp b/Source/WebCore/html/NumberInputType.cpp
index 82f12d1fd..0d66d5676 100644
--- a/Source/WebCore/html/NumberInputType.cpp
+++ b/Source/WebCore/html/NumberInputType.cpp
@@ -200,11 +200,6 @@ void NumberInputType::handleKeydownEvent(KeyboardEvent* event)
TextFieldInputType::handleKeydownEvent(event);
}
-void NumberInputType::handleWheelEvent(WheelEvent* event)
-{
- handleWheelEventForSpinButton(event);
-}
-
Decimal NumberInputType::parseToNumber(const String& src, const Decimal& defaultValue) const
{
return parseToDecimalForNumberType(src, defaultValue);
diff --git a/Source/WebCore/html/NumberInputType.h b/Source/WebCore/html/NumberInputType.h
index fe16e5fa0..073432780 100644
--- a/Source/WebCore/html/NumberInputType.h
+++ b/Source/WebCore/html/NumberInputType.h
@@ -51,7 +51,6 @@ private:
virtual bool isSteppable() const OVERRIDE;
virtual StepRange createStepRange(AnyStepHandling) const OVERRIDE;
virtual void handleKeydownEvent(KeyboardEvent*) OVERRIDE;
- virtual void handleWheelEvent(WheelEvent*) OVERRIDE;
virtual Decimal parseToNumber(const String&, const Decimal&) const OVERRIDE;
virtual String serialize(const Decimal&) const OVERRIDE;
virtual void handleBlurEvent() OVERRIDE;
diff --git a/Source/WebCore/html/PluginDocument.cpp b/Source/WebCore/html/PluginDocument.cpp
index c5a571fb1..496449281 100644
--- a/Source/WebCore/html/PluginDocument.cpp
+++ b/Source/WebCore/html/PluginDocument.cpp
@@ -168,6 +168,8 @@ void PluginDocument::detach()
{
// Release the plugin node so that we don't have a circular reference.
m_pluginNode = 0;
+ if (FrameLoader* loader = frame()->loader())
+ loader->client()->redirectDataToPlugin(0);
HTMLDocument::detach();
}
diff --git a/Source/WebCore/html/RangeInputType.cpp b/Source/WebCore/html/RangeInputType.cpp
index ae696e6df..f2cce17e4 100644
--- a/Source/WebCore/html/RangeInputType.cpp
+++ b/Source/WebCore/html/RangeInputType.cpp
@@ -239,7 +239,7 @@ void RangeInputType::handleKeydownEvent(KeyboardEvent* event)
setValueAsDecimal(newValue, eventBehavior, ec);
if (AXObjectCache::accessibilityEnabled())
- element()->document()->axObjectCache()->postNotification(element()->renderer(), AXObjectCache::AXValueChanged, true);
+ element()->document()->axObjectCache()->postNotification(element(), AXObjectCache::AXValueChanged, true);
element()->dispatchFormControlChangeEvent();
}
diff --git a/Source/WebCore/html/SearchInputType.cpp b/Source/WebCore/html/SearchInputType.cpp
index 958878ced..09f079b79 100644
--- a/Source/WebCore/html/SearchInputType.cpp
+++ b/Source/WebCore/html/SearchInputType.cpp
@@ -45,6 +45,8 @@ using namespace HTMLNames;
inline SearchInputType::SearchInputType(HTMLInputElement* element)
: BaseTextInputType(element)
+ , m_resultsButton(0)
+ , m_cancelButton(0)
, m_searchEventTimer(this, &SearchInputType::searchEventTimerFired)
{
}
@@ -97,21 +99,23 @@ void SearchInputType::createShadowSubtree()
ASSERT(textWrapper);
ExceptionCode ec = 0;
- m_resultsButton = SearchFieldResultsButtonElement::create(element()->document());
+ RefPtr<SearchFieldResultsButtonElement> resultsButton = SearchFieldResultsButtonElement::create(element()->document());
+ m_resultsButton = resultsButton.get();
container->insertBefore(m_resultsButton, textWrapper, ec);
- m_cancelButton = SearchFieldCancelButtonElement::create(element()->document());
+ RefPtr<SearchFieldCancelButtonElement> cancelButton = SearchFieldCancelButtonElement::create(element()->document());
+ m_cancelButton = cancelButton.get();
container->insertBefore(m_cancelButton, textWrapper->nextSibling(), ec);
}
HTMLElement* SearchInputType::resultsButtonElement() const
{
- return m_resultsButton.get();
+ return m_resultsButton;
}
HTMLElement* SearchInputType::cancelButtonElement() const
{
- return m_cancelButton.get();
+ return m_cancelButton;
}
void SearchInputType::handleKeydownEvent(KeyboardEvent* event)
@@ -135,8 +139,8 @@ void SearchInputType::handleKeydownEvent(KeyboardEvent* event)
void SearchInputType::destroyShadowSubtree()
{
TextFieldInputType::destroyShadowSubtree();
- m_resultsButton.clear();
- m_cancelButton.clear();
+ m_resultsButton = 0;
+ m_cancelButton = 0;
}
void SearchInputType::startSearchEventTimer()
@@ -172,7 +176,7 @@ bool SearchInputType::searchEventsShouldBeDispatched() const
void SearchInputType::subtreeHasChanged()
{
- if (m_cancelButton.get())
+ if (m_cancelButton)
toRenderSearchField(element()->renderer())->updateCancelButtonVisibility();
// If the incremental attribute is set, then dispatch the search event
diff --git a/Source/WebCore/html/SearchInputType.h b/Source/WebCore/html/SearchInputType.h
index ece35a259..44bd1b7c0 100644
--- a/Source/WebCore/html/SearchInputType.h
+++ b/Source/WebCore/html/SearchInputType.h
@@ -64,8 +64,8 @@ private:
bool searchEventsShouldBeDispatched() const;
void startSearchEventTimer();
- RefPtr<HTMLElement> m_resultsButton;
- RefPtr<HTMLElement> m_cancelButton;
+ HTMLElement* m_resultsButton;
+ HTMLElement* m_cancelButton;
Timer<SearchInputType> m_searchEventTimer;
};
diff --git a/Source/WebCore/html/TextFieldInputType.cpp b/Source/WebCore/html/TextFieldInputType.cpp
index f114eeb5e..692121e5c 100644
--- a/Source/WebCore/html/TextFieldInputType.cpp
+++ b/Source/WebCore/html/TextFieldInputType.cpp
@@ -64,7 +64,7 @@ TextFieldInputType::TextFieldInputType(HTMLInputElement* element)
TextFieldInputType::~TextFieldInputType()
{
if (m_innerSpinButton)
- m_innerSpinButton->removeStepActionHandler();
+ m_innerSpinButton->removeSpinButtonOwner();
}
bool TextFieldInputType::isKeyboardFocusable(KeyboardEvent*) const
@@ -163,21 +163,14 @@ void TextFieldInputType::handleKeydownEventForSpinButton(KeyboardEvent* event)
event->setDefaultHandled();
}
-void TextFieldInputType::handleWheelEventForSpinButton(WheelEvent* event)
-{
- if (element()->disabled() || element()->readOnly() || !element()->focused())
- return;
- if (event->wheelDeltaY() > 0)
- spinButtonStepUp();
- else if (event->wheelDeltaY() < 0)
- spinButtonStepDown();
- else
- return;
- event->setDefaultHandled();
-}
-
void TextFieldInputType::forwardEvent(Event* event)
{
+ if (m_innerSpinButton) {
+ m_innerSpinButton->forwardEvent(event);
+ if (event->defaultHandled())
+ return;
+ }
+
if (element()->renderer() && (event->isMouseEvent() || event->isDragEvent() || event->hasInterface(eventNames().interfaceForWheelEvent) || event->type() == eventNames().blurEvent || event->type() == eventNames().focusEvent)) {
RenderTextControlSingleLine* renderTextControl = toRenderTextControlSingleLine(element()->renderer());
if (event->type() == eventNames().blurEvent) {
@@ -319,7 +312,7 @@ void TextFieldInputType::destroyShadowSubtree()
m_speechButton.clear();
#endif
if (m_innerSpinButton)
- m_innerSpinButton->removeStepActionHandler();
+ m_innerSpinButton->removeSpinButtonOwner();
m_innerSpinButton.clear();
m_container.clear();
}
@@ -463,4 +456,21 @@ void TextFieldInputType::updateInnerTextValue()
}
}
+void TextFieldInputType::focusAndSelectSpinButtonOwner()
+{
+ RefPtr<HTMLInputElement> input(element());
+ input->focus();
+ input->select();
+}
+
+bool TextFieldInputType::shouldSpinButtonRespondToMouseEvents()
+{
+ return !element()->disabled() && !element()->readOnly();
+}
+
+bool TextFieldInputType::shouldSpinButtonRespondToWheelEvents()
+{
+ return shouldSpinButtonRespondToMouseEvents() && element()->focused();
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/html/TextFieldInputType.h b/Source/WebCore/html/TextFieldInputType.h
index be6c666e4..a693cfefb 100644
--- a/Source/WebCore/html/TextFieldInputType.h
+++ b/Source/WebCore/html/TextFieldInputType.h
@@ -32,23 +32,22 @@
#define TextFieldInputType_h
#include "InputType.h"
+#include "SpinButtonElement.h"
#include "TextControlInnerElements.h"
namespace WebCore {
class FormDataList;
-class SpinButtonElement;
// The class represents types of which UI contain text fields.
// It supports not only the types for BaseTextInputType but also type=number.
-class TextFieldInputType : public InputType, private SpinButtonElement::StepActionHandler {
+class TextFieldInputType : public InputType, private SpinButtonElement::SpinButtonOwner {
protected:
TextFieldInputType(HTMLInputElement*);
virtual ~TextFieldInputType();
virtual bool canSetSuggestedValue() OVERRIDE;
virtual void handleKeydownEvent(KeyboardEvent*) OVERRIDE;
void handleKeydownEventForSpinButton(KeyboardEvent*);
- void handleWheelEventForSpinButton(WheelEvent*);
virtual HTMLElement* containerElement() const OVERRIDE;
virtual HTMLElement* innerBlockElement() const OVERRIDE;
@@ -86,7 +85,10 @@ private:
virtual bool appendFormData(FormDataList&, bool multipart) const OVERRIDE;
virtual void attach() OVERRIDE;
- // SpinButtonElement::StepActionHandler functions.
+ // SpinButtonElement::SpinButtonOwner functions.
+ virtual void focusAndSelectSpinButtonOwner() OVERRIDE;
+ virtual bool shouldSpinButtonRespondToMouseEvents() OVERRIDE;
+ virtual bool shouldSpinButtonRespondToWheelEvents() OVERRIDE;
virtual void spinButtonStepDown() OVERRIDE;
virtual void spinButtonStepUp() OVERRIDE;
diff --git a/Source/WebCore/html/TimeInputType.cpp b/Source/WebCore/html/TimeInputType.cpp
index 052b88756..798aeff9f 100644
--- a/Source/WebCore/html/TimeInputType.cpp
+++ b/Source/WebCore/html/TimeInputType.cpp
@@ -40,6 +40,11 @@
#include <wtf/PassOwnPtr.h>
#if ENABLE(INPUT_TYPE_TIME)
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
+#include "ElementShadow.h"
+#include "KeyboardEvent.h"
+#include "ShadowRoot.h"
+#endif
namespace WebCore {
@@ -108,6 +113,189 @@ bool TimeInputType::isTimeField() const
return true;
}
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
+
+TimeInputType::DateTimeEditControlOwnerImpl::DateTimeEditControlOwnerImpl(TimeInputType& timeInputType)
+ : m_timeInputType(timeInputType)
+{
+}
+
+TimeInputType::DateTimeEditControlOwnerImpl::~DateTimeEditControlOwnerImpl()
+{
+}
+
+void TimeInputType::DateTimeEditControlOwnerImpl::editControlMouseFocus()
+{
+ m_timeInputType.element()->focus();
+}
+
+void TimeInputType::DateTimeEditControlOwnerImpl::editControlValueChanged()
+{
+ RefPtr<HTMLInputElement> input(m_timeInputType.element());
+ input->setValueInternal(m_timeInputType.serialize(Decimal::fromDouble(m_timeInputType.m_dateTimeEditElement->valueAsDouble())), DispatchNoEvent);
+ input->setNeedsStyleRecalc();
+ input->dispatchFormControlInputEvent();
+ input->dispatchFormControlChangeEvent();
+}
+
+void TimeInputType::DateTimeEditControlOwnerImpl::focusAndSelectEditControlOwner()
+{
+ RefPtr<HTMLInputElement> input(m_timeInputType.element());
+ input->focus();
+ input->select();
+}
+
+bool TimeInputType::DateTimeEditControlOwnerImpl::isEditControlOwnerDisabled() const
+{
+ return m_timeInputType.element()->readOnly();
+}
+
+bool TimeInputType::DateTimeEditControlOwnerImpl::isEditControlOwnerFocused() const
+{
+ return m_timeInputType.element()->focused();
+}
+
+bool TimeInputType::DateTimeEditControlOwnerImpl::isEditControlOwnerReadOnly() const
+{
+ return m_timeInputType.element()->disabled();
+}
+
+TimeInputType::TimeInputType(HTMLInputElement* element)
+ : BaseDateAndTimeInputType(element)
+ , m_dateTimeEditElement(0)
+ , m_dateTimeEditControlOwnerImpl(*this)
+{
+}
+
+TimeInputType::~TimeInputType()
+{
+ if (m_dateTimeEditElement)
+ m_dateTimeEditElement->removeEditControlOwner();
+}
+
+RenderObject* TimeInputType::createRenderer(RenderArena* arena, RenderStyle* style) const
+{
+ return InputType::createRenderer(arena, style);
+}
+
+void TimeInputType::createShadowSubtree()
+{
+ ASSERT(element()->shadow());
+
+ const StepRange stepRange(createStepRange(AnyIsDefaultStep));
+ RefPtr<DateTimeEditElement> dateTimeEditElement(DateTimeEditElement::create(element()->document(), m_dateTimeEditControlOwnerImpl, stepRange));
+ m_dateTimeEditElement = dateTimeEditElement.get();
+ element()->userAgentShadowRoot()->appendChild(m_dateTimeEditElement);
+ updateInnerTextValue();
+}
+
+void TimeInputType::destroyShadowSubtree()
+{
+ if (m_dateTimeEditElement) {
+ m_dateTimeEditElement->removeEditControlOwner();
+ m_dateTimeEditElement = 0;
+ }
+ BaseDateAndTimeInputType::destroyShadowSubtree();
+}
+
+void TimeInputType::forwardEvent(Event* event)
+{
+ if (m_dateTimeEditElement)
+ m_dateTimeEditElement->defaultEventHandler(event);
+}
+
+void TimeInputType::disabledAttributeChanged()
+{
+ if (m_dateTimeEditElement)
+ m_dateTimeEditElement->disabledStateChanged();
+}
+
+void TimeInputType::handleKeydownEvent(KeyboardEvent* event)
+{
+ forwardEvent(event);
+}
+
+void TimeInputType::handleDOMActivateEvent(Event* event)
+{
+ if (element()->disabled() || element()->readOnly() || !element()->renderer())
+ return;
+
+ if (m_dateTimeEditElement)
+ m_dateTimeEditElement->focus();
+
+ event->setDefaultHandled();
+}
+
+bool TimeInputType::isKeyboardFocusable(KeyboardEvent*) const
+{
+ return element()->isTextFormControlFocusable();
+}
+
+bool TimeInputType::isMouseFocusable() const
+{
+ return element()->isTextFormControlFocusable();
+}
+
+void TimeInputType::minOrMaxAttributeChanged()
+{
+ updateEditElementLayout();
+}
+
+void TimeInputType::readonlyAttributeChanged()
+{
+ if (m_dateTimeEditElement)
+ m_dateTimeEditElement->readOnlyStateChanged();
+}
+
+bool TimeInputType::isTextField() const
+{
+ return false;
+}
+
+void TimeInputType::setValue(const String& sanitizedValue, bool valueChanged, TextFieldEventBehavior eventBehavior)
+{
+ InputType::setValue(sanitizedValue, valueChanged, eventBehavior);
+ if (valueChanged)
+ updateInnerTextValue();
+}
+
+bool TimeInputType::shouldUseInputMethod() const
+{
+ return false;
+}
+
+void TimeInputType::stepAttributeChanged()
+{
+ updateEditElementLayout();
+}
+
+void TimeInputType::updateEditElementLayout()
+{
+ if (m_dateTimeEditElement)
+ m_dateTimeEditElement->layout(createStepRange(AnyIsDefaultStep));
+}
+
+void TimeInputType::updateInnerTextValue()
+{
+ if (!m_dateTimeEditElement)
+ return;
+
+ DateComponents date;
+ if (parseToDateComponents(element()->value(), &date))
+ m_dateTimeEditElement->setValueAsDate(date);
+ else {
+ const StepRange stepRange(createStepRange(AnyIsDefaultStep));
+ setMillisecondToDateComponents(stepRange.minimum().toDouble(), &date);
+ m_dateTimeEditElement->setEmptyValue(date);
+ }
+}
+#else
+TimeInputType::TimeInputType(HTMLInputElement* element)
+ : BaseDateAndTimeInputType(element)
+{
+}
+#endif
+
} // namespace WebCore
#endif
diff --git a/Source/WebCore/html/TimeInputType.h b/Source/WebCore/html/TimeInputType.h
index c9d5b0cdd..8dc6e7740 100644
--- a/Source/WebCore/html/TimeInputType.h
+++ b/Source/WebCore/html/TimeInputType.h
@@ -35,14 +35,22 @@
#if ENABLE(INPUT_TYPE_TIME)
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
+#include "DateTimeEditElement.h"
+#endif
+
namespace WebCore {
class TimeInputType : public BaseDateAndTimeInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
+ virtual ~TimeInputType();
+#endif
+
private:
- TimeInputType(HTMLInputElement* element) : BaseDateAndTimeInputType(element) { }
+ TimeInputType(HTMLInputElement*);
virtual const AtomicString& formControlType() const OVERRIDE;
virtual DateComponents::Type dateType() const OVERRIDE;
virtual Decimal defaultValueForStepUp() const OVERRIDE;
@@ -50,6 +58,51 @@ private:
virtual bool parseToDateComponentsInternal(const UChar*, unsigned length, DateComponents*) const OVERRIDE;
virtual bool setMillisecondToDateComponents(double, DateComponents*) const OVERRIDE;
virtual bool isTimeField() const OVERRIDE;
+
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
+ class DateTimeEditControlOwnerImpl : public DateTimeEditElement::EditControlOwner {
+ WTF_MAKE_NONCOPYABLE(DateTimeEditControlOwnerImpl);
+
+ public:
+ DateTimeEditControlOwnerImpl(TimeInputType&);
+ virtual ~DateTimeEditControlOwnerImpl();
+
+ private:
+ virtual void editControlMouseFocus() OVERRIDE FINAL;
+ virtual void editControlValueChanged() OVERRIDE FINAL;
+ virtual void focusAndSelectEditControlOwner() OVERRIDE FINAL;
+ virtual bool isEditControlOwnerDisabled() const OVERRIDE FINAL;
+ virtual bool isEditControlOwnerFocused() const OVERRIDE FINAL;
+ virtual bool isEditControlOwnerReadOnly() const OVERRIDE FINAL;
+
+ TimeInputType& m_timeInputType;
+ };
+
+ friend class DateTimeEditControlOwnerImpl;
+
+ void updateEditElementLayout();
+
+ // InputType functions
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const OVERRIDE FINAL;
+ virtual void createShadowSubtree() OVERRIDE FINAL;
+ virtual void destroyShadowSubtree() OVERRIDE FINAL;
+ virtual void disabledAttributeChanged() OVERRIDE FINAL;
+ virtual void forwardEvent(Event*) OVERRIDE FINAL;
+ virtual void handleDOMActivateEvent(Event*) OVERRIDE FINAL;
+ virtual void handleKeydownEvent(KeyboardEvent*) OVERRIDE FINAL;
+ virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE FINAL;
+ virtual bool isMouseFocusable() const OVERRIDE FINAL;
+ virtual bool isTextField() const OVERRIDE FINAL;
+ virtual void minOrMaxAttributeChanged() OVERRIDE FINAL;
+ virtual void readonlyAttributeChanged() OVERRIDE FINAL;
+ virtual void setValue(const String&, bool valueChanged, TextFieldEventBehavior) OVERRIDE FINAL;
+ virtual bool shouldUseInputMethod() const OVERRIDE FINAL;
+ virtual void stepAttributeChanged() OVERRIDE FINAL;
+ virtual void updateInnerTextValue() OVERRIDE FINAL;
+
+ DateTimeEditElement* m_dateTimeEditElement;
+ DateTimeEditControlOwnerImpl m_dateTimeEditControlOwnerImpl;
+#endif
};
} // namespace WebCore
diff --git a/Source/WebCore/html/VoidCallback.h b/Source/WebCore/html/VoidCallback.h
index c220411fe..3ee383f0f 100644
--- a/Source/WebCore/html/VoidCallback.h
+++ b/Source/WebCore/html/VoidCallback.h
@@ -33,11 +33,7 @@ namespace WebCore {
class VoidCallback : public RefCounted<VoidCallback> {
public:
virtual ~VoidCallback() { }
-
- virtual void handleEvent() = 0;
-
-protected:
- VoidCallback() {}
+ virtual bool handleEvent() = 0;
};
} // namespace WebCore
diff --git a/Source/WebCore/html/VoidCallback.idl b/Source/WebCore/html/VoidCallback.idl
index d0f159b83..f1b0779e4 100644
--- a/Source/WebCore/html/VoidCallback.idl
+++ b/Source/WebCore/html/VoidCallback.idl
@@ -25,9 +25,8 @@
module html {
interface [
- JSCustomToNativeObject,
- OmitConstructor
+ Callback
] VoidCallback {
- void handleEvent();
+ boolean handleEvent();
};
}
diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index 722c9c53d..8afa1e7b1 100644
--- a/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -5,6 +5,7 @@
* Copyright (C) 2008 Eric Seidel <eric@webkit.org>
* Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
* Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. 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
@@ -82,6 +83,8 @@ namespace WebCore {
using namespace HTMLNames;
+static const int defaultFontSize = 10;
+static const char* const defaultFontFamily = "sans-serif";
static const char* const defaultFont = "10px sans-serif";
static bool isOriginClean(CachedImage* cachedImage, SecurityOrigin* securityOrigin)
@@ -1986,7 +1989,34 @@ void CanvasRenderingContext2D::putImageData(ImageData* data, ImageBuffer::Coordi
String CanvasRenderingContext2D::font() const
{
- return state().m_unparsedFont;
+ if (!state().m_realizedFont)
+ return defaultFont;
+
+ String serializedFont;
+ const FontDescription& fontDescription = state().m_font.fontDescription();
+
+ if (fontDescription.italic())
+ serializedFont += "italic ";
+ if (fontDescription.smallCaps() == FontSmallCapsOn)
+ serializedFont += "small-caps ";
+
+ serializedFont += String::number(fontDescription.computedPixelSize()) + "px";
+
+ const FontFamily& firstFontFamily = fontDescription.family();
+ for (const FontFamily* fontFamily = &firstFontFamily; fontFamily; fontFamily = fontFamily->next()) {
+ if (fontFamily != &firstFontFamily)
+ serializedFont += ",";
+
+ String family = fontFamily->family();
+ if (family.startsWith("-webkit-"))
+ family = family.substring(8);
+ if (family.contains(' '))
+ family = makeString('"', family, '"');
+
+ serializedFont += " " + family;
+ }
+
+ return serializedFont;
}
void CanvasRenderingContext2D::setFont(const String& newFont)
@@ -2009,6 +2039,18 @@ void CanvasRenderingContext2D::setFont(const String& newFont)
RefPtr<RenderStyle> newStyle = RenderStyle::create();
if (RenderStyle* computedStyle = canvas()->computedStyle())
newStyle->setFontDescription(computedStyle->fontDescription());
+ else {
+ FontFamily fontFamily;
+ fontFamily.setFamily(defaultFontFamily);
+
+ FontDescription defaultFontDescription;
+ defaultFontDescription.setFamily(fontFamily);
+ defaultFontDescription.setSpecifiedSize(defaultFontSize);
+ defaultFontDescription.setComputedSize(defaultFontSize);
+
+ newStyle->setFontDescription(defaultFontDescription);
+ }
+
newStyle->font().update(newStyle->font().fontSelector());
// Now map the font property longhands into the style.
@@ -2104,6 +2146,16 @@ PassRefPtr<TextMetrics> CanvasRenderingContext2D::measureText(const String& text
return metrics.release();
}
+static void replaceCharacterInString(String& text, WTF::CharacterMatchFunctionPtr matchFunction, const String& replacement)
+{
+ const size_t replacementLength = replacement.length();
+ size_t index = 0;
+ while ((index = text.find(matchFunction, index)) != notFound) {
+ text.replace(index, 1, replacement);
+ index += replacementLength;
+ }
+}
+
void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, float y, bool fill, float maxWidth, bool useMaxWidth)
{
GraphicsContext* c = drawingContext();
@@ -2120,6 +2172,9 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
const Font& font = accessFont();
const FontMetrics& fontMetrics = font.fontMetrics();
+ // According to spec, all the space characters must be replaced with U+0020 SPACE characters.
+ String normalizedText = text;
+ replaceCharacterInString(normalizedText, isSpaceOrNewline, " ");
// FIXME: Need to turn off font smoothing.
@@ -2128,7 +2183,7 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
bool isRTL = direction == RTL;
bool override = computedStyle ? isOverride(computedStyle->unicodeBidi()) : false;
- TextRun textRun(text, 0, 0, TextRun::AllowTrailingExpansion, direction, override, true, TextRun::NoRounding);
+ TextRun textRun(normalizedText, 0, 0, TextRun::AllowTrailingExpansion, direction, override, true, TextRun::NoRounding);
// Draw the item text at the correct point.
FloatPoint location(x, y);
switch (state().m_textBaseline) {
@@ -2149,7 +2204,7 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
break;
}
- float fontWidth = font.width(TextRun(text, 0, 0, TextRun::AllowTrailingExpansion, direction, override));
+ float fontWidth = font.width(TextRun(normalizedText, 0, 0, TextRun::AllowTrailingExpansion, direction, override));
useMaxWidth = (useMaxWidth && maxWidth < fontWidth);
float width = useMaxWidth ? maxWidth : fontWidth;
diff --git a/Source/WebCore/html/canvas/OESVertexArrayObject.cpp b/Source/WebCore/html/canvas/OESVertexArrayObject.cpp
index cea525c39..d9a39560d 100644
--- a/Source/WebCore/html/canvas/OESVertexArrayObject.cpp
+++ b/Source/WebCore/html/canvas/OESVertexArrayObject.cpp
@@ -69,6 +69,9 @@ void OESVertexArrayObject::deleteVertexArrayOES(WebGLVertexArrayObjectOES* array
if (!arrayObject || m_context->isContextLost())
return;
+ if (!arrayObject->isDefaultObject() && arrayObject == m_context->m_boundVertexArrayObject)
+ m_context->setBoundVertexArrayObject(0);
+
arrayObject->deleteObject(m_context->graphicsContext3D());
}
@@ -90,7 +93,7 @@ void OESVertexArrayObject::bindVertexArrayOES(WebGLVertexArrayObjectOES* arrayOb
if (m_context->isContextLost())
return;
- if (arrayObject && !arrayObject->validate(0, context())) {
+ if (arrayObject && (arrayObject->isDeleted() || !arrayObject->validate(0, context()))) {
m_context->graphicsContext3D()->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
@@ -103,7 +106,6 @@ void OESVertexArrayObject::bindVertexArrayOES(WebGLVertexArrayObjectOES* arrayOb
m_context->setBoundVertexArrayObject(arrayObject);
} else {
extensions->bindVertexArrayOES(0);
-
m_context->setBoundVertexArrayObject(0);
}
diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
index 1ee6215fd..fe0fe6da0 100644
--- a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -419,6 +419,10 @@ PassOwnPtr<WebGLRenderingContext> WebGLRenderingContext::create(HTMLCanvasElemen
return nullptr;
}
+ Extensions3D* extensions = context->getExtensions();
+ if (extensions->supports("GL_EXT_debug_marker"))
+ extensions->pushGroupMarkerEXT("WebGLRenderingContext");
+
return adoptPtr(new WebGLRenderingContext(canvas, context, attributes));
}
@@ -5169,13 +5173,14 @@ void WebGLRenderingContext::printWarningToConsole(const String& message)
{
if (!canvas())
return;
+ // FIXME: This giant cascade of null checks seems a bit paranoid.
Document* document = canvas()->document();
if (!document)
return;
Frame* frame = document->frame();
if (!frame)
return;
- DOMWindow* window = frame->domWindow();
+ DOMWindow* window = document->domWindow();
if (!window)
return;
Console* console = window->console();
diff --git a/Source/WebCore/html/parser/HTMLDocumentParser.cpp b/Source/WebCore/html/parser/HTMLDocumentParser.cpp
index 88646e4f5..935f5d057 100644
--- a/Source/WebCore/html/parser/HTMLDocumentParser.cpp
+++ b/Source/WebCore/html/parser/HTMLDocumentParser.cpp
@@ -535,11 +535,6 @@ void HTMLDocumentParser::executeScriptsWaitingForStylesheets()
resumeParsingAfterScriptExecution();
}
-ScriptController* HTMLDocumentParser::script() const
-{
- return document()->frame() ? document()->frame()->script() : 0;
-}
-
void HTMLDocumentParser::parseDocumentFragment(const String& source, DocumentFragment* fragment, Element* contextElement, FragmentScriptingPermission scriptingPermission)
{
RefPtr<HTMLDocumentParser> parser = HTMLDocumentParser::create(fragment, contextElement, scriptingPermission);
diff --git a/Source/WebCore/html/parser/HTMLDocumentParser.h b/Source/WebCore/html/parser/HTMLDocumentParser.h
index 4e26c5726..ce108f4b9 100644
--- a/Source/WebCore/html/parser/HTMLDocumentParser.h
+++ b/Source/WebCore/html/parser/HTMLDocumentParser.h
@@ -137,8 +137,6 @@ private:
bool inPumpSession() const { return m_pumpSessionNestingLevel > 0; }
bool shouldDelayEnd() const { return inPumpSession() || isWaitingForScripts() || isScheduledForResume() || isExecutingScript(); }
- ScriptController* script() const;
-
HTMLInputStream m_input;
// We hold m_token here because it might be partially complete.
diff --git a/Source/WebCore/html/parser/HTMLTokenizer.cpp b/Source/WebCore/html/parser/HTMLTokenizer.cpp
index f1e10852a..ca5d5b064 100644
--- a/Source/WebCore/html/parser/HTMLTokenizer.cpp
+++ b/Source/WebCore/html/parser/HTMLTokenizer.cpp
@@ -474,6 +474,7 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
} else if (cc == '>') {
if (isAppropriateEndTag()) {
m_temporaryBuffer.append(cc);
+ m_token->setConvertTo8BitIfPossible();
return flushEmitAndResumeIn(source, HTMLTokenizerState::DataState);
}
}
@@ -543,6 +544,7 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
} else if (cc == '>') {
if (isAppropriateEndTag()) {
m_temporaryBuffer.append(cc);
+ m_token->setConvertTo8BitIfPossible();
return flushEmitAndResumeIn(source, HTMLTokenizerState::DataState);
}
}
diff --git a/Source/WebCore/html/parser/HTMLTreeBuilder.cpp b/Source/WebCore/html/parser/HTMLTreeBuilder.cpp
index a7f14519e..9e91b5381 100644
--- a/Source/WebCore/html/parser/HTMLTreeBuilder.cpp
+++ b/Source/WebCore/html/parser/HTMLTreeBuilder.cpp
@@ -249,6 +249,7 @@ public:
explicit ExternalCharacterTokenBuffer(AtomicHTMLToken* token)
: m_current(token->characters().data())
, m_end(m_current + token->characters().size())
+ , m_isAll8BitData(token->isAll8BitData())
{
ASSERT(!isEmpty());
}
@@ -256,6 +257,7 @@ public:
explicit ExternalCharacterTokenBuffer(const String& string)
: m_current(string.characters())
, m_end(m_current + string.length())
+ , m_isAll8BitData(string.length() && string.is8Bit())
{
ASSERT(!isEmpty());
}
@@ -267,6 +269,8 @@ public:
bool isEmpty() const { return m_current == m_end; }
+ bool isAll8BitData() const { return m_isAll8BitData; }
+
void skipAtMostOneLeadingNewline()
{
ASSERT(!isEmpty());
@@ -294,7 +298,12 @@ public:
ASSERT(!isEmpty());
const UChar* start = m_current;
m_current = m_end;
- return String(start, m_current - start);
+ size_t length = m_current - start;
+
+ if (isAll8BitData())
+ return String::make8BitFrom16BitSource(start, length);
+
+ return String(start, length);
}
void giveRemainingTo(StringBuilder& recipient)
@@ -344,6 +353,7 @@ private:
const UChar* m_current;
const UChar* m_end;
+ bool m_isAll8BitData;
};
diff --git a/Source/WebCore/html/parser/XSSAuditor.cpp b/Source/WebCore/html/parser/XSSAuditor.cpp
index 3350574c8..7c816475a 100644
--- a/Source/WebCore/html/parser/XSSAuditor.cpp
+++ b/Source/WebCore/html/parser/XSSAuditor.cpp
@@ -458,7 +458,7 @@ bool XSSAuditor::eraseAttributeIfInjected(HTMLToken& token, const QualifiedName&
if (findAttributeWithName(token, attributeName, indexOfAttribute)) {
const HTMLToken::Attribute& attribute = token.attributes().at(indexOfAttribute);
if (isContainedInRequest(decodedSnippetForAttribute(token, attribute, treatment))) {
- if (attributeName == srcAttr && isSameOriginResource(String(attribute.m_value.data(), attribute.m_value.size())))
+ if (attributeName == srcAttr && isLikelySafeResource(String(attribute.m_value.data(), attribute.m_value.size())))
return false;
if (attributeName == http_equivAttr && !isDangerousHTTPEquiv(String(attribute.m_value.data(), attribute.m_value.size())))
return false;
@@ -603,16 +603,20 @@ bool XSSAuditor::isContainedInRequest(const String& decodedSnippet)
return m_decodedHTTPBody.find(decodedSnippet, 0, false) != notFound;
}
-bool XSSAuditor::isSameOriginResource(const String& url)
+bool XSSAuditor::isLikelySafeResource(const String& url)
{
- // If the resource is loaded from the same URL as the enclosing page, it's
+ // If the resource is loaded from the same host as the enclosing page, it's
// probably not an XSS attack, so we reduce false positives by allowing the
- // request. If the resource has a query string, we're more suspicious,
- // however, because that's pretty rare and the attacker might be able to
- // trick a server-side script into doing something dangerous with the query
- // string.
- KURL resourceURL(m_parser->document()->url(), url);
- return (m_parser->document()->url().host() == resourceURL.host() && resourceURL.query().isEmpty());
+ // request, ignoring scheme and port considerations. If the resource has a
+ // query string, we're more suspicious, however, because that's pretty rare
+ // and the attacker might be able to trick a server-side script into doing
+ // something dangerous with the query string.
+ const KURL& documentURL = m_parser->document()->url();
+ if (documentURL.host().isEmpty())
+ return false;
+
+ KURL resourceURL(documentURL, url);
+ return (documentURL.host() == resourceURL.host() && resourceURL.query().isEmpty());
}
} // namespace WebCore
diff --git a/Source/WebCore/html/parser/XSSAuditor.h b/Source/WebCore/html/parser/XSSAuditor.h
index 910bac35b..7e8155828 100644
--- a/Source/WebCore/html/parser/XSSAuditor.h
+++ b/Source/WebCore/html/parser/XSSAuditor.h
@@ -79,7 +79,7 @@ private:
String decodedSnippetForJavaScript(const HTMLToken&);
bool isContainedInRequest(const String&);
- bool isSameOriginResource(const String& url);
+ bool isLikelySafeResource(const String& url);
HTMLDocumentParser* m_parser;
bool m_isEnabled;
diff --git a/Source/WebCore/html/shadow/CalendarPickerElement.cpp b/Source/WebCore/html/shadow/CalendarPickerElement.cpp
index e70151df6..f3244de6b 100644
--- a/Source/WebCore/html/shadow/CalendarPickerElement.cpp
+++ b/Source/WebCore/html/shadow/CalendarPickerElement.cpp
@@ -45,6 +45,7 @@
#include "LocalizedDate.h"
#include "LocalizedStrings.h"
#include "Page.h"
+#include "PickerCommon.h"
#include "RenderDetailsMarker.h"
#include "RenderTheme.h"
#include <wtf/text/StringBuilder.h>
@@ -165,6 +166,7 @@ void CalendarPickerElement::writeDocument(DocumentWriter& writer)
stepString = "1";
addString("<!DOCTYPE html><head><meta charset='UTF-8'><style>\n", writer);
+ writer.addData(pickerCommonCss, sizeof(pickerCommonCss));
writer.addData(calendarPickerCss, sizeof(calendarPickerCss));
if (document()->page()) {
CString extraStyle = document()->page()->theme()->extraCalendarPickerStyleSheet();
@@ -188,6 +190,7 @@ void CalendarPickerElement::writeDocument(DocumentWriter& writer)
addProperty("isRTL", dir == RightToLeft || dir == RightToLeftArabic, writer);
addString("}\n", writer);
+ writer.addData(pickerCommonJs, sizeof(pickerCommonJs));
writer.addData(calendarPickerJs, sizeof(calendarPickerJs));
addString("</script></body>\n", writer);
}
diff --git a/Source/WebCore/html/shadow/DateTimeEditElement.cpp b/Source/WebCore/html/shadow/DateTimeEditElement.cpp
index 0ed1dacc3..3a64b9914 100644
--- a/Source/WebCore/html/shadow/DateTimeEditElement.cpp
+++ b/Source/WebCore/html/shadow/DateTimeEditElement.cpp
@@ -202,7 +202,7 @@ DateTimeEditElement::~DateTimeEditElement()
m_fields[fieldIndex]->removeEventHandler();
if (m_spinButton)
- m_spinButton->removeStepActionHandler();
+ m_spinButton->removeSpinButtonOwner();
}
void DateTimeEditElement::addField(PassRefPtr<DateTimeFieldElement> field)
@@ -230,6 +230,13 @@ DateTimeFieldElement* DateTimeEditElement::fieldAt(size_t fieldIndex) const
return fieldIndex < m_fields.size() ? m_fields[fieldIndex] : 0;
}
+void DateTimeEditElement::focusAndSelectSpinButtonOwner()
+{
+ if (!m_editControlOwner)
+ return;
+ m_editControlOwner->focusAndSelectEditControlOwner();
+}
+
void DateTimeEditElement::focusFieldAt(size_t newFocusFieldIndex)
{
if (m_focusFieldIndex == newFocusFieldIndex)
@@ -418,6 +425,12 @@ void DateTimeEditElement::defaultEventHandler(Event* event)
if (!focusField)
return;
+ if (m_spinButton) {
+ m_spinButton->forwardEvent(event);
+ if (event->defaultHandled())
+ return;
+ }
+
focusField->defaultEventHandler(event);
}
@@ -433,6 +446,19 @@ void DateTimeEditElement::setEmptyValue(const DateComponents& dateForReadOnlyFie
m_fields[fieldIndex]->setEmptyValue(dateForReadOnlyField, DateTimeFieldElement::DispatchNoEvent);
}
+bool DateTimeEditElement::shouldSpinButtonRespondToMouseEvents()
+{
+ return !isDisabled() && !isReadOnly();
+}
+
+bool DateTimeEditElement::shouldSpinButtonRespondToWheelEvents()
+{
+ if (!shouldSpinButtonRespondToMouseEvents())
+ return false;
+
+ return !m_editControlOwner || m_editControlOwner->isEditControlOwnerFocused();
+}
+
void DateTimeEditElement::spinButtonStepDown()
{
if (DateTimeFieldElement* const focusField = fieldAt(m_focusFieldIndex))
diff --git a/Source/WebCore/html/shadow/DateTimeEditElement.h b/Source/WebCore/html/shadow/DateTimeEditElement.h
index 462faa4a6..c6016febf 100644
--- a/Source/WebCore/html/shadow/DateTimeEditElement.h
+++ b/Source/WebCore/html/shadow/DateTimeEditElement.h
@@ -28,7 +28,7 @@
#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
#include "DateTimeFieldElement.h"
-#include "TextControlInnerElements.h"
+#include "SpinButtonElement.h"
namespace WebCore {
@@ -42,7 +42,7 @@ class StepRange;
// representing date and time, such as
// - Year, Month, Day Of Month
// - Hour, Minute, Second, Millisecond, AM/PM
-class DateTimeEditElement : public HTMLDivElement, public DateTimeFieldElement::FieldEventHandler, private SpinButtonElement::StepActionHandler {
+class DateTimeEditElement : public HTMLDivElement, public DateTimeFieldElement::FieldEventHandler, private SpinButtonElement::SpinButtonOwner {
WTF_MAKE_NONCOPYABLE(DateTimeEditElement);
public:
@@ -51,9 +51,11 @@ public:
class EditControlOwner {
public:
virtual ~EditControlOwner();
+ virtual void focusAndSelectEditControlOwner() = 0;
virtual void editControlMouseFocus() = 0;
virtual void editControlValueChanged() = 0;
virtual bool isEditControlOwnerDisabled() const = 0;
+ virtual bool isEditControlOwnerFocused() const = 0;
virtual bool isEditControlOwnerReadOnly() const = 0;
};
@@ -101,7 +103,10 @@ private:
virtual void fieldValueChanged() OVERRIDE FINAL;
virtual void focusOnNextField() OVERRIDE FINAL;
- // SpinButtonElement::StepActionHandler functions.
+ // SpinButtonElement::SpinButtonOwner functions.
+ virtual void focusAndSelectSpinButtonOwner() OVERRIDE FINAL;
+ virtual bool shouldSpinButtonRespondToMouseEvents() OVERRIDE FINAL;
+ virtual bool shouldSpinButtonRespondToWheelEvents() OVERRIDE FINAL;
virtual void spinButtonStepDown() OVERRIDE FINAL;
virtual void spinButtonStepUp() OVERRIDE FINAL;
diff --git a/Source/WebCore/html/shadow/ImageInnerElement.h b/Source/WebCore/html/shadow/ImageInnerElement.h
index 3d61b239e..553d44385 100644
--- a/Source/WebCore/html/shadow/ImageInnerElement.h
+++ b/Source/WebCore/html/shadow/ImageInnerElement.h
@@ -54,6 +54,8 @@ private:
virtual void attach() OVERRIDE;
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE;
+ virtual bool canStartSelection() const { return false; }
+
virtual const AtomicString& shadowPseudoId() const OVERRIDE;
};
diff --git a/Source/WebCore/html/shadow/MediaControlRootElement.cpp b/Source/WebCore/html/shadow/MediaControlRootElement.cpp
index 0ebd0ae3c..ef541baa3 100644
--- a/Source/WebCore/html/shadow/MediaControlRootElement.cpp
+++ b/Source/WebCore/html/shadow/MediaControlRootElement.cpp
@@ -480,6 +480,9 @@ void MediaControlRootElement::changedVolume()
{
if (m_volumeSlider)
m_volumeSlider->setVolume(m_mediaController->volume());
+
+ if (m_fullScreenVolumeSlider)
+ m_fullScreenVolumeSlider->setVolume(m_mediaController->volume());
}
void MediaControlRootElement::enteredFullscreen()
diff --git a/Source/WebCore/html/shadow/MeterShadowElement.cpp b/Source/WebCore/html/shadow/MeterShadowElement.cpp
index 3101bd124..441f01397 100644
--- a/Source/WebCore/html/shadow/MeterShadowElement.cpp
+++ b/Source/WebCore/html/shadow/MeterShadowElement.cpp
@@ -37,6 +37,7 @@
#include "HTMLNames.h"
#include "RenderMeter.h"
#include "RenderTheme.h"
+#include "ShadowRoot.h"
#include "StylePropertySet.h"
namespace WebCore {
@@ -50,15 +51,38 @@ MeterShadowElement::MeterShadowElement(Document* document)
HTMLMeterElement* MeterShadowElement::meterElement() const
{
- Element* element = shadowHost();
- ASSERT(!element || element->hasTagName(meterTag));
- return static_cast<HTMLMeterElement*>(element);
+ return toHTMLMeterElement(shadowHost());
}
bool MeterShadowElement::rendererIsNeeded(const NodeRenderingContext& context)
{
- RenderMeter* meterRenderer = toRenderMeter(meterElement()->renderer());
- return meterRenderer && !meterRenderer->theme()->supportsMeter(meterRenderer->style()->appearance()) && HTMLDivElement::rendererIsNeeded(context);
+ RenderObject* render = meterElement()->renderer();
+ return render && !render->theme()->supportsMeter(render->style()->appearance()) && HTMLDivElement::rendererIsNeeded(context);
+}
+
+MeterInnerElement::MeterInnerElement(Document* document)
+ : MeterShadowElement(document)
+{
+}
+
+bool MeterInnerElement::rendererIsNeeded(const NodeRenderingContext& context)
+{
+ if (meterElement()->hasAuthorShadowRoot())
+ return HTMLDivElement::rendererIsNeeded(context);
+
+ RenderObject* render = meterElement()->renderer();
+ return render && !render->theme()->supportsMeter(render->style()->appearance()) && HTMLDivElement::rendererIsNeeded(context);
+}
+
+RenderObject* MeterInnerElement::createRenderer(RenderArena* arena, RenderStyle*)
+{
+ return new (arena) RenderMeter(this);
+}
+
+const AtomicString& MeterInnerElement::shadowPseudoId() const
+{
+ DEFINE_STATIC_LOCAL(AtomicString, pseudId, ("-webkit-meter-inner-element"));
+ return pseudId;
}
const AtomicString& MeterBarElement::shadowPseudoId() const
@@ -67,7 +91,6 @@ const AtomicString& MeterBarElement::shadowPseudoId() const
return pseudId;
}
-
const AtomicString& MeterValueElement::shadowPseudoId() const
{
DEFINE_STATIC_LOCAL(AtomicString, optimumPseudId, ("-webkit-meter-optimum-value"));
diff --git a/Source/WebCore/html/shadow/MeterShadowElement.h b/Source/WebCore/html/shadow/MeterShadowElement.h
index 6b8bf62ae..b67e0c129 100644
--- a/Source/WebCore/html/shadow/MeterShadowElement.h
+++ b/Source/WebCore/html/shadow/MeterShadowElement.h
@@ -38,6 +38,7 @@
namespace WebCore {
class HTMLMeterElement;
+class RenderMeter;
class MeterShadowElement : public HTMLDivElement {
public:
@@ -48,6 +49,22 @@ private:
virtual bool rendererIsNeeded(const NodeRenderingContext&);
};
+class MeterInnerElement : public MeterShadowElement {
+public:
+ MeterInnerElement(Document*);
+ static PassRefPtr<MeterInnerElement> create(Document*);
+
+private:
+ virtual bool rendererIsNeeded(const NodeRenderingContext&) OVERRIDE;
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE;
+ virtual const AtomicString& shadowPseudoId() const OVERRIDE;
+};
+
+inline PassRefPtr<MeterInnerElement> MeterInnerElement::create(Document* document)
+{
+ return adoptRef(new MeterInnerElement(document));
+}
+
class MeterBarElement : public MeterShadowElement {
public:
MeterBarElement(Document* document)
@@ -64,7 +81,6 @@ inline PassRefPtr<MeterBarElement> MeterBarElement::create(Document* document)
return adoptRef(new MeterBarElement(document));
}
-
class MeterValueElement : public MeterShadowElement {
public:
MeterValueElement(Document* document)
diff --git a/Source/WebCore/html/shadow/SliderThumbElement.cpp b/Source/WebCore/html/shadow/SliderThumbElement.cpp
index baca86c7b..f8685279e 100644
--- a/Source/WebCore/html/shadow/SliderThumbElement.cpp
+++ b/Source/WebCore/html/shadow/SliderThumbElement.cpp
@@ -83,6 +83,16 @@ SliderThumbElement* sliderThumbElementOf(Node* node)
return toSliderThumbElement(thumb);
}
+HTMLElement* sliderTrackElementOf(Node* node)
+{
+ ASSERT(node);
+ ShadowRoot* shadow = node->toInputElement()->userAgentShadowRoot();
+ ASSERT(shadow);
+ Node* track = shadow->firstChild()->firstChild();
+ ASSERT(track);
+ return toHTMLElement(track);
+}
+
// --------------------------------
RenderSliderThumb::RenderSliderThumb(Node* node)
@@ -240,8 +250,9 @@ void SliderThumbElement::dragFrom(const LayoutPoint& point)
void SliderThumbElement::setPositionFromPoint(const LayoutPoint& point)
{
HTMLInputElement* input = hostInput();
+ HTMLElement* trackElement = sliderTrackElementOf(input);
- if (!input->renderer() || !renderer())
+ if (!input->renderer() || !renderer() || !trackElement->renderer())
return;
input->setTextAsOfLastFormControlChangeEvent(input->value());
@@ -256,13 +267,15 @@ void SliderThumbElement::setPositionFromPoint(const LayoutPoint& point)
// FIXME: This should probably respect transforms.
LayoutPoint absoluteThumbOrigin = renderBox()->absoluteBoundingBoxRectIgnoringTransforms().location();
LayoutPoint absoluteSliderContentOrigin = roundedLayoutPoint(input->renderer()->localToAbsolute());
+ IntRect trackBoundingBox = trackElement->renderer()->absoluteBoundingBoxRectIgnoringTransforms();
+ IntRect inputBoundingBox = input->renderer()->absoluteBoundingBoxRectIgnoringTransforms();
if (isVertical) {
- trackSize = input->renderBox()->contentHeight() - renderBox()->height();
- position = offset.y() - renderBox()->height() / 2;
+ trackSize = trackElement->renderBox()->contentHeight();
+ position = offset.y() - renderBox()->height() / 2 - trackBoundingBox.y() + inputBoundingBox.y();
currentPosition = absoluteThumbOrigin.y() - absoluteSliderContentOrigin.y();
} else {
- trackSize = input->renderBox()->contentWidth() - renderBox()->width();
- position = offset.x() - renderBox()->width() / 2;
+ trackSize = trackElement->renderBox()->contentWidth();
+ position = offset.x() - renderBox()->width() / 2 - trackBoundingBox.x() + inputBoundingBox.x();
currentPosition = absoluteThumbOrigin.x() - absoluteSliderContentOrigin.x();
}
position = max<LayoutUnit>(0, min(position, trackSize));
diff --git a/Source/WebCore/html/shadow/SliderThumbElement.h b/Source/WebCore/html/shadow/SliderThumbElement.h
index 04e41c7bf..b8912c272 100644
--- a/Source/WebCore/html/shadow/SliderThumbElement.h
+++ b/Source/WebCore/html/shadow/SliderThumbElement.h
@@ -100,6 +100,7 @@ inline SliderThumbElement* toSliderThumbElement(Node* node)
// This always return a valid pointer.
// An assertion fails if the specified node is not a range input.
SliderThumbElement* sliderThumbElementOf(Node*);
+HTMLElement* sliderTrackElementOf(Node*);
// --------------------------------
diff --git a/Source/WebCore/html/shadow/SpinButtonElement.cpp b/Source/WebCore/html/shadow/SpinButtonElement.cpp
new file mode 100644
index 000000000..e5247c4f3
--- /dev/null
+++ b/Source/WebCore/html/shadow/SpinButtonElement.cpp
@@ -0,0 +1,244 @@
+/*
+ * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "SpinButtonElement.h"
+
+#include "EventHandler.h"
+#include "EventNames.h"
+#include "Frame.h"
+#include "HTMLNames.h"
+#include "MouseEvent.h"
+#include "RenderBox.h"
+#include "ScrollbarTheme.h"
+#include "WheelEvent.h"
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+inline SpinButtonElement::SpinButtonElement(Document* document, SpinButtonOwner& spinButtonOwner)
+ : HTMLDivElement(divTag, document)
+ , m_spinButtonOwner(&spinButtonOwner)
+ , m_capturing(false)
+ , m_upDownState(Indeterminate)
+ , m_pressStartingState(Indeterminate)
+ , m_repeatingTimer(this, &SpinButtonElement::repeatingTimerFired)
+{
+}
+
+PassRefPtr<SpinButtonElement> SpinButtonElement::create(Document* document, SpinButtonOwner& spinButtonOwner)
+{
+ return adoptRef(new SpinButtonElement(document, spinButtonOwner));
+}
+
+const AtomicString& SpinButtonElement::shadowPseudoId() const
+{
+ DEFINE_STATIC_LOCAL(AtomicString, innerPseudoId, ("-webkit-inner-spin-button"));
+ return innerPseudoId;
+}
+
+void SpinButtonElement::detach()
+{
+ releaseCapture();
+ HTMLDivElement::detach();
+}
+
+void SpinButtonElement::defaultEventHandler(Event* event)
+{
+ if (!event->isMouseEvent()) {
+ if (!event->defaultHandled())
+ HTMLDivElement::defaultEventHandler(event);
+ return;
+ }
+
+ RenderBox* box = renderBox();
+ if (!box) {
+ if (!event->defaultHandled())
+ HTMLDivElement::defaultEventHandler(event);
+ return;
+ }
+
+ if (!shouldRespondToMouseEvents()) {
+ if (!event->defaultHandled())
+ HTMLDivElement::defaultEventHandler(event);
+ return;
+ }
+
+ MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
+ IntPoint local = roundedIntPoint(box->absoluteToLocal(mouseEvent->absoluteLocation(), false, true));
+ if (mouseEvent->type() == eventNames().mousedownEvent && mouseEvent->button() == LeftButton) {
+ if (box->pixelSnappedBorderBoxRect().contains(local)) {
+ // The following functions of HTMLInputElement may run JavaScript
+ // code which detaches this shadow node. We need to take a reference
+ // and check renderer() after such function calls.
+ RefPtr<Node> protector(this);
+ if (m_spinButtonOwner)
+ m_spinButtonOwner->focusAndSelectSpinButtonOwner();
+ if (renderer()) {
+ if (m_upDownState != Indeterminate) {
+ doStepAction(m_upDownState == Up ? 1 : -1);
+ if (renderer())
+ startRepeatingTimer();
+ }
+ }
+ event->setDefaultHandled();
+ }
+ } else if (mouseEvent->type() == eventNames().mouseupEvent && mouseEvent->button() == LeftButton)
+ stopRepeatingTimer();
+ else if (event->type() == eventNames().mousemoveEvent) {
+ if (box->pixelSnappedBorderBoxRect().contains(local)) {
+ if (!m_capturing) {
+ if (Frame* frame = document()->frame()) {
+ frame->eventHandler()->setCapturingMouseEventsNode(this);
+ m_capturing = true;
+ }
+ }
+ UpDownState oldUpDownState = m_upDownState;
+ m_upDownState = local.y() < box->height() / 2 ? Up : Down;
+ if (m_upDownState != oldUpDownState)
+ renderer()->repaint();
+ } else {
+ releaseCapture();
+ m_upDownState = Indeterminate;
+ }
+ }
+
+ if (!event->defaultHandled())
+ HTMLDivElement::defaultEventHandler(event);
+}
+
+void SpinButtonElement::forwardEvent(Event* event)
+{
+ if (!renderBox())
+ return;
+
+ if (!event->hasInterface(eventNames().interfaceForWheelEvent))
+ return;
+
+ if (!m_spinButtonOwner)
+ return;
+
+ if (!m_spinButtonOwner->shouldSpinButtonRespondToWheelEvents())
+ return;
+
+ doStepAction(static_cast<WheelEvent*>(event)->wheelDeltaY());
+ event->setDefaultHandled();
+}
+
+bool SpinButtonElement::willRespondToMouseMoveEvents()
+{
+ if (renderBox() && shouldRespondToMouseEvents())
+ return true;
+
+ return HTMLDivElement::willRespondToMouseMoveEvents();
+}
+
+bool SpinButtonElement::willRespondToMouseClickEvents()
+{
+ if (renderBox() && shouldRespondToMouseEvents())
+ return true;
+
+ return HTMLDivElement::willRespondToMouseClickEvents();
+}
+
+void SpinButtonElement::doStepAction(int amount)
+{
+ if (!m_spinButtonOwner)
+ return;
+
+ if (amount > 0)
+ m_spinButtonOwner->spinButtonStepUp();
+ else if (amount < 0)
+ m_spinButtonOwner->spinButtonStepDown();
+}
+
+void SpinButtonElement::releaseCapture()
+{
+ stopRepeatingTimer();
+ if (m_capturing) {
+ if (Frame* frame = document()->frame()) {
+ frame->eventHandler()->setCapturingMouseEventsNode(0);
+ m_capturing = false;
+ }
+ }
+}
+
+bool SpinButtonElement::shouldMatchReadOnlySelector() const
+{
+ return shadowHost()->shouldMatchReadOnlySelector();
+}
+
+bool SpinButtonElement::shouldMatchReadWriteSelector() const
+{
+ return shadowHost()->shouldMatchReadWriteSelector();
+}
+
+void SpinButtonElement::startRepeatingTimer()
+{
+ m_pressStartingState = m_upDownState;
+ ScrollbarTheme* theme = ScrollbarTheme::theme();
+ m_repeatingTimer.start(theme->initialAutoscrollTimerDelay(), theme->autoscrollTimerDelay());
+}
+
+void SpinButtonElement::stopRepeatingTimer()
+{
+ m_repeatingTimer.stop();
+}
+
+void SpinButtonElement::step(int amount)
+{
+ if (!shouldRespondToMouseEvents())
+ return;
+ // On Mac OS, NSStepper updates the value for the button under the mouse
+ // cursor regardless of the button pressed at the beginning. So the
+ // following check is not needed for Mac OS.
+#if !OS(MAC_OS_X)
+ if (m_upDownState != m_pressStartingState)
+ return;
+#endif
+ doStepAction(amount);
+}
+
+void SpinButtonElement::repeatingTimerFired(Timer<SpinButtonElement>*)
+{
+ if (m_upDownState != Indeterminate)
+ step(m_upDownState == Up ? 1 : -1);
+}
+
+void SpinButtonElement::setHovered(bool flag)
+{
+ if (!flag)
+ m_upDownState = Indeterminate;
+ HTMLDivElement::setHovered(flag);
+}
+
+bool SpinButtonElement::shouldRespondToMouseEvents()
+{
+ return !m_spinButtonOwner || m_spinButtonOwner->shouldSpinButtonRespondToMouseEvents();
+}
+
+}
diff --git a/Source/WebCore/html/shadow/SpinButtonElement.h b/Source/WebCore/html/shadow/SpinButtonElement.h
new file mode 100644
index 000000000..3251f37d3
--- /dev/null
+++ b/Source/WebCore/html/shadow/SpinButtonElement.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SpinButtonElement_h
+#define SpinButtonElement_h
+
+#include "HTMLDivElement.h"
+#include "Timer.h"
+
+namespace WebCore {
+
+class SpinButtonElement : public HTMLDivElement {
+public:
+ enum UpDownState {
+ Indeterminate, // Hovered, but the event is not handled.
+ Down,
+ Up,
+ };
+
+ class SpinButtonOwner {
+ public:
+ virtual ~SpinButtonOwner() { }
+ virtual void focusAndSelectSpinButtonOwner() = 0;
+ virtual bool shouldSpinButtonRespondToMouseEvents() = 0;
+ virtual bool shouldSpinButtonRespondToWheelEvents() = 0;
+ virtual void spinButtonStepDown() = 0;
+ virtual void spinButtonStepUp() = 0;
+ };
+
+ // The owner of SpinButtonElement must call removeSpinButtonOwner
+ // because SpinButtonElement can be outlive SpinButtonOwner
+ // implementation, e.g. during event handling.
+ static PassRefPtr<SpinButtonElement> create(Document*, SpinButtonOwner&);
+ UpDownState upDownState() const { return m_upDownState; }
+ virtual void releaseCapture();
+ void removeSpinButtonOwner() { m_spinButtonOwner = 0; }
+
+ void step(int amount);
+
+ virtual bool willRespondToMouseMoveEvents() OVERRIDE;
+ virtual bool willRespondToMouseClickEvents() OVERRIDE;
+
+ void forwardEvent(Event*);
+
+private:
+ SpinButtonElement(Document*, SpinButtonOwner&);
+
+ virtual const AtomicString& shadowPseudoId() const;
+ virtual void detach();
+ virtual bool isSpinButtonElement() const { return true; }
+ virtual bool isEnabledFormControl() const { return shadowHost()->isEnabledFormControl(); }
+ virtual bool shouldMatchReadOnlySelector() const OVERRIDE;
+ virtual bool shouldMatchReadWriteSelector() const OVERRIDE;
+ virtual void defaultEventHandler(Event*);
+ void doStepAction(int);
+ void startRepeatingTimer();
+ void stopRepeatingTimer();
+ void repeatingTimerFired(Timer<SpinButtonElement>*);
+ virtual void setHovered(bool = true);
+ bool shouldRespondToMouseEvents();
+ virtual bool isMouseFocusable() const { return false; }
+
+ SpinButtonOwner* m_spinButtonOwner;
+ bool m_capturing;
+ UpDownState m_upDownState;
+ UpDownState m_pressStartingState;
+ Timer<SpinButtonElement> m_repeatingTimer;
+};
+
+} // namespace
+
+#endif
diff --git a/Source/WebCore/html/shadow/TextControlInnerElements.cpp b/Source/WebCore/html/shadow/TextControlInnerElements.cpp
index e06d56f2f..c58f176f7 100644
--- a/Source/WebCore/html/shadow/TextControlInnerElements.cpp
+++ b/Source/WebCore/html/shadow/TextControlInnerElements.cpp
@@ -40,7 +40,6 @@
#include "RenderSearchField.h"
#include "RenderView.h"
#include "ScriptController.h"
-#include "ScrollbarTheme.h"
#include "SpeechInput.h"
#include "SpeechInputEvent.h"
#include "TextEvent.h"
@@ -101,13 +100,7 @@ void TextControlInnerTextElement::defaultEventHandler(Event* event)
RenderObject* TextControlInnerTextElement::createRenderer(RenderArena* arena, RenderStyle*)
{
- bool multiLine = false;
- Element* shadowAncestor = shadowHost();
- if (shadowAncestor && shadowAncestor->renderer()) {
- ASSERT(shadowAncestor->renderer()->isTextField() || shadowAncestor->renderer()->isTextArea());
- multiLine = shadowAncestor->renderer()->isTextArea();
- }
- return new (arena) RenderTextControlInnerBlock(this, multiLine);
+ return new (arena) RenderTextControlInnerBlock(this);
}
PassRefPtr<RenderStyle> TextControlInnerTextElement::customStyleForRenderer()
@@ -250,191 +243,6 @@ bool SearchFieldCancelButtonElement::willRespondToMouseClickEvents()
// ----------------------------
-inline SpinButtonElement::SpinButtonElement(Document* document, StepActionHandler& stepActionHandler)
- : HTMLDivElement(divTag, document)
- , m_stepActionHandler(&stepActionHandler)
- , m_capturing(false)
- , m_upDownState(Indeterminate)
- , m_pressStartingState(Indeterminate)
- , m_repeatingTimer(this, &SpinButtonElement::repeatingTimerFired)
-{
-}
-
-PassRefPtr<SpinButtonElement> SpinButtonElement::create(Document* document, StepActionHandler& stepActionHandler)
-{
- return adoptRef(new SpinButtonElement(document, stepActionHandler));
-}
-
-const AtomicString& SpinButtonElement::shadowPseudoId() const
-{
- DEFINE_STATIC_LOCAL(AtomicString, innerPseudoId, ("-webkit-inner-spin-button"));
- return innerPseudoId;
-}
-
-void SpinButtonElement::detach()
-{
- releaseCapture();
- HTMLDivElement::detach();
-}
-
-void SpinButtonElement::defaultEventHandler(Event* event)
-{
- if (!event->isMouseEvent()) {
- if (!event->defaultHandled())
- HTMLDivElement::defaultEventHandler(event);
- return;
- }
-
- RenderBox* box = renderBox();
- if (!box) {
- if (!event->defaultHandled())
- HTMLDivElement::defaultEventHandler(event);
- return;
- }
-
- RefPtr<HTMLInputElement> input(static_cast<HTMLInputElement*>(shadowHost()));
- if (input->disabled() || input->readOnly()) {
- if (!event->defaultHandled())
- HTMLDivElement::defaultEventHandler(event);
- return;
- }
-
- MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
- IntPoint local = roundedIntPoint(box->absoluteToLocal(mouseEvent->absoluteLocation(), false, true));
- if (mouseEvent->type() == eventNames().mousedownEvent && mouseEvent->button() == LeftButton) {
- if (box->pixelSnappedBorderBoxRect().contains(local)) {
- // The following functions of HTMLInputElement may run JavaScript
- // code which detaches this shadow node. We need to take a reference
- // and check renderer() after such function calls.
- RefPtr<Node> protector(this);
- input->focus();
- input->select();
- if (renderer()) {
- if (m_upDownState != Indeterminate) {
- doStepAction(m_upDownState == Up ? 1 : -1);
- if (renderer())
- startRepeatingTimer();
- }
- }
- event->setDefaultHandled();
- }
- } else if (mouseEvent->type() == eventNames().mouseupEvent && mouseEvent->button() == LeftButton)
- stopRepeatingTimer();
- else if (event->type() == eventNames().mousemoveEvent) {
- if (box->pixelSnappedBorderBoxRect().contains(local)) {
- if (!m_capturing) {
- if (Frame* frame = document()->frame()) {
- frame->eventHandler()->setCapturingMouseEventsNode(this);
- m_capturing = true;
- }
- }
- UpDownState oldUpDownState = m_upDownState;
- m_upDownState = local.y() < box->height() / 2 ? Up : Down;
- if (m_upDownState != oldUpDownState)
- renderer()->repaint();
- } else {
- releaseCapture();
- m_upDownState = Indeterminate;
- }
- }
-
- if (!event->defaultHandled())
- HTMLDivElement::defaultEventHandler(event);
-}
-
-bool SpinButtonElement::willRespondToMouseMoveEvents()
-{
- const HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowHost());
- if (renderBox() && !input->disabled() && !input->readOnly())
- return true;
-
- return HTMLDivElement::willRespondToMouseMoveEvents();
-}
-
-bool SpinButtonElement::willRespondToMouseClickEvents()
-{
- const HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowHost());
- if (renderBox() && !input->disabled() && !input->readOnly())
- return true;
-
- return HTMLDivElement::willRespondToMouseClickEvents();
-}
-
-void SpinButtonElement::doStepAction(int amount)
-{
- if (!m_stepActionHandler)
- return;
-
- if (amount > 0)
- m_stepActionHandler->spinButtonStepUp();
- else if (amount < 0)
- m_stepActionHandler->spinButtonStepDown();
-}
-
-void SpinButtonElement::releaseCapture()
-{
- stopRepeatingTimer();
- if (m_capturing) {
- if (Frame* frame = document()->frame()) {
- frame->eventHandler()->setCapturingMouseEventsNode(0);
- m_capturing = false;
- }
- }
-}
-
-bool SpinButtonElement::shouldMatchReadOnlySelector() const
-{
- return shadowHost()->shouldMatchReadOnlySelector();
-}
-
-bool SpinButtonElement::shouldMatchReadWriteSelector() const
-{
- return shadowHost()->shouldMatchReadWriteSelector();
-}
-
-void SpinButtonElement::startRepeatingTimer()
-{
- m_pressStartingState = m_upDownState;
- ScrollbarTheme* theme = ScrollbarTheme::theme();
- m_repeatingTimer.start(theme->initialAutoscrollTimerDelay(), theme->autoscrollTimerDelay());
-}
-
-void SpinButtonElement::stopRepeatingTimer()
-{
- m_repeatingTimer.stop();
-}
-
-void SpinButtonElement::step(int amount)
-{
- HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowHost());
- if (input->disabled() || input->readOnly())
- return;
- // On Mac OS, NSStepper updates the value for the button under the mouse
- // cursor regardless of the button pressed at the beginning. So the
- // following check is not needed for Mac OS.
-#if !OS(MAC_OS_X)
- if (m_upDownState != m_pressStartingState)
- return;
-#endif
- doStepAction(amount);
-}
-
-void SpinButtonElement::repeatingTimerFired(Timer<SpinButtonElement>*)
-{
- if (m_upDownState != Indeterminate)
- step(m_upDownState == Up ? 1 : -1);
-}
-
-void SpinButtonElement::setHovered(bool flag)
-{
- if (!flag)
- m_upDownState = Indeterminate;
- HTMLDivElement::setHovered(flag);
-}
-
-
-// ----------------------------
-
#if ENABLE(INPUT_SPEECH)
inline InputFieldSpeechButtonElement::InputFieldSpeechButtonElement(Document* document)
@@ -616,8 +424,7 @@ void InputFieldSpeechButtonElement::startSpeechInput()
RefPtr<HTMLInputElement> input = static_cast<HTMLInputElement*>(shadowHost());
AtomicString language = input->computeInheritedLanguage();
String grammar = input->getAttribute(webkitgrammarAttr);
- // FIXME: this should probably respect transforms
- IntRect rect = pixelSnappedIntRect(renderer()->view()->frameView()->contentsToWindow(renderer()->absoluteBoundingBoxRectIgnoringTransforms()));
+ IntRect rect = document()->view()->contentsToRootView(getPixelSnappedRect());
if (speechInput()->startRecognition(m_listenerId, rect, language, grammar, document()->securityOrigin()))
setState(Recording);
}
diff --git a/Source/WebCore/html/shadow/TextControlInnerElements.h b/Source/WebCore/html/shadow/TextControlInnerElements.h
index 6336dcb63..8acd7708f 100644
--- a/Source/WebCore/html/shadow/TextControlInnerElements.h
+++ b/Source/WebCore/html/shadow/TextControlInnerElements.h
@@ -29,7 +29,6 @@
#include "HTMLDivElement.h"
#include "SpeechInputListener.h"
-#include "Timer.h"
#include <wtf/Forward.h>
namespace WebCore {
@@ -90,58 +89,6 @@ private:
bool m_capturing;
};
-class SpinButtonElement : public HTMLDivElement {
-public:
- enum UpDownState {
- Indeterminate, // Hovered, but the event is not handled.
- Down,
- Up,
- };
-
- class StepActionHandler {
- public:
- virtual ~StepActionHandler() { }
- virtual void spinButtonStepDown() = 0;
- virtual void spinButtonStepUp() = 0;
- };
-
- // The owner of SpinButtonElement must call removeStepActionHandler
- // because SpinButtonElement can be outlive StepActionHandler
- // implementation, e.g. during event handling.
- static PassRefPtr<SpinButtonElement> create(Document*, StepActionHandler&);
- UpDownState upDownState() const { return m_upDownState; }
- virtual void releaseCapture();
- void removeStepActionHandler() { m_stepActionHandler = 0; }
-
- void step(int amount);
-
- virtual bool willRespondToMouseMoveEvents() OVERRIDE;
- virtual bool willRespondToMouseClickEvents() OVERRIDE;
-
-private:
- SpinButtonElement(Document*, StepActionHandler&);
-
- virtual const AtomicString& shadowPseudoId() const;
- virtual void detach();
- virtual bool isSpinButtonElement() const { return true; }
- virtual bool isEnabledFormControl() const { return shadowHost()->isEnabledFormControl(); }
- virtual bool shouldMatchReadOnlySelector() const OVERRIDE;
- virtual bool shouldMatchReadWriteSelector() const OVERRIDE;
- virtual void defaultEventHandler(Event*);
- void doStepAction(int);
- void startRepeatingTimer();
- void stopRepeatingTimer();
- void repeatingTimerFired(Timer<SpinButtonElement>*);
- virtual void setHovered(bool = true);
- virtual bool isMouseFocusable() const { return false; }
-
- StepActionHandler* m_stepActionHandler;
- bool m_capturing;
- UpDownState m_upDownState;
- UpDownState m_pressStartingState;
- Timer<SpinButtonElement> m_repeatingTimer;
-};
-
#if ENABLE(INPUT_SPEECH)
class InputFieldSpeechButtonElement
diff --git a/Source/WebCore/inspector/Inspector.json b/Source/WebCore/inspector/Inspector.json
index 3e9117700..4e644dc56 100644
--- a/Source/WebCore/inspector/Inspector.json
+++ b/Source/WebCore/inspector/Inspector.json
@@ -2242,7 +2242,6 @@
"name": "getMatchedStylesForNode",
"parameters": [
{ "name": "nodeId", "$ref": "DOM.NodeId" },
- { "name": "forcedPseudoClasses", "type": "array", "items": { "type": "string", "enum": ["active", "focus", "hover", "visited"] }, "optional": true, "description": "Element pseudo classes to force when computing applicable style rules." },
{ "name": "includePseudo", "type": "boolean", "optional": true, "description": "Whether to include pseudo styles (default: true)." },
{ "name": "includeInherited", "type": "boolean", "optional": true, "description": "Whether to include inherited styles (default: true)." }
],
@@ -2267,8 +2266,7 @@
{
"name": "getComputedStyleForNode",
"parameters": [
- { "name": "nodeId", "$ref": "DOM.NodeId" },
- { "name": "forcedPseudoClasses", "type": "array", "items": { "type": "string", "enum": ["active", "focus", "hover", "visited"] }, "optional": true, "description": "Element pseudo classes to force when computing applicable style rules." }
+ { "name": "nodeId", "$ref": "DOM.NodeId" }
],
"returns": [
{ "name": "computedStyle", "type": "array", "items": { "$ref": "CSSComputedStyleProperty" }, "description": "Computed style for the specified DOM node." }
@@ -2365,6 +2363,14 @@
"description": "Returns all supported CSS property names."
},
{
+ "name": "forcePseudoState",
+ "parameters": [
+ { "name": "nodeId", "$ref": "DOM.NodeId", "description": "The element id for which to force the pseudo state." },
+ { "name": "forcedPseudoClasses", "type": "array", "items": { "type": "string", "enum": ["active", "focus", "hover", "visited"] }, "description": "Element pseudo classes to force when computing the element's style." }
+ ],
+ "description": "Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser."
+ },
+ {
"name": "startSelectorProfiler"
},
{
diff --git a/Source/WebCore/inspector/InspectorCSSAgent.cpp b/Source/WebCore/inspector/InspectorCSSAgent.cpp
index 88aa0047a..9d62698de 100644
--- a/Source/WebCore/inspector/InspectorCSSAgent.cpp
+++ b/Source/WebCore/inspector/InspectorCSSAgent.cpp
@@ -583,34 +583,12 @@ bool InspectorCSSAgent::forcePseudoState(Element* element, CSSSelector::PseudoTy
}
}
-void InspectorCSSAgent::recalcStyleForPseudoStateIfNeeded(Element* element, InspectorArray* forcedPseudoClasses)
-{
- int nodeId = m_domAgent->boundNodeId(element);
- if (!nodeId)
- return;
-
- unsigned forcedPseudoState = computePseudoClassMask(forcedPseudoClasses);
- NodeIdToForcedPseudoState::iterator it = m_nodeIdToForcedPseudoState.find(nodeId);
- unsigned currentForcedPseudoState = it == m_nodeIdToForcedPseudoState.end() ? 0 : it->second;
- bool needStyleRecalc = forcedPseudoState != currentForcedPseudoState;
- if (!needStyleRecalc)
- return;
-
- if (forcedPseudoState)
- m_nodeIdToForcedPseudoState.set(nodeId, forcedPseudoState);
- else
- m_nodeIdToForcedPseudoState.remove(nodeId);
- element->ownerDocument()->styleResolverChanged(RecalcStyleImmediately);
-}
-
-void InspectorCSSAgent::getMatchedStylesForNode(ErrorString* errorString, int nodeId, const RefPtr<InspectorArray>* forcedPseudoClasses, const bool* includePseudo, const bool* includeInherited, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSRule> >& matchedCSSRules, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::PseudoIdRules> >& pseudoIdRules, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::InheritedStyleEntry> >& inheritedEntries)
+void InspectorCSSAgent::getMatchedStylesForNode(ErrorString* errorString, int nodeId, const bool* includePseudo, const bool* includeInherited, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSRule> >& matchedCSSRules, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::PseudoIdRules> >& pseudoIdRules, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::InheritedStyleEntry> >& inheritedEntries)
{
Element* element = elementForId(errorString, nodeId);
if (!element)
return;
- recalcStyleForPseudoStateIfNeeded(element, forcedPseudoClasses ? forcedPseudoClasses->get() : 0);
-
// Matched rules.
StyleResolver* styleResolver = element->ownerDocument()->styleResolver();
RefPtr<CSSRuleList> matchedRules = styleResolver->styleRulesForElement(element, StyleResolver::AllCSSRules);
@@ -670,14 +648,12 @@ void InspectorCSSAgent::getInlineStylesForNode(ErrorString* errorString, int nod
attributesStyle = attributes ? attributes.release() : 0;
}
-void InspectorCSSAgent::getComputedStyleForNode(ErrorString* errorString, int nodeId, const RefPtr<InspectorArray>* forcedPseudoClasses, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> >& style)
+void InspectorCSSAgent::getComputedStyleForNode(ErrorString* errorString, int nodeId, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> >& style)
{
Element* element = elementForId(errorString, nodeId);
if (!element)
return;
- recalcStyleForPseudoStateIfNeeded(element, forcedPseudoClasses ? forcedPseudoClasses->get() : 0);
-
RefPtr<CSSComputedStyleDeclaration> computedStyleInfo = CSSComputedStyleDeclaration::create(element, true);
RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(InspectorCSSId(), computedStyleInfo, 0);
style = inspectorStyle->buildArrayForComputedStyle();
@@ -807,7 +783,7 @@ void InspectorCSSAgent::getSupportedCSSProperties(ErrorString*, RefPtr<TypeBuild
for (int i = firstCSSProperty; i <= lastCSSProperty; ++i) {
CSSPropertyID id = convertToCSSPropertyID(i);
RefPtr<TypeBuilder::CSS::CSSPropertyInfo> property = TypeBuilder::CSS::CSSPropertyInfo::create()
- .setName(getPropertyName(id));
+ .setName(getPropertyNameString(id));
const StylePropertyShorthand& shorthand = shorthandForProperty(id);
if (!shorthand.length()) {
@@ -817,7 +793,7 @@ void InspectorCSSAgent::getSupportedCSSProperties(ErrorString*, RefPtr<TypeBuild
RefPtr<TypeBuilder::Array<String> > longhands = TypeBuilder::Array<String>::create();
for (unsigned j = 0; j < shorthand.length(); ++j) {
CSSPropertyID longhandID = shorthand.properties()[j];
- longhands->addItem(getPropertyName(longhandID));
+ longhands->addItem(getPropertyNameString(longhandID));
}
property->setLonghands(longhands);
properties->addItem(property.release());
@@ -825,6 +801,26 @@ void InspectorCSSAgent::getSupportedCSSProperties(ErrorString*, RefPtr<TypeBuild
cssProperties = properties.release();
}
+void InspectorCSSAgent::forcePseudoState(ErrorString* errorString, int nodeId, const RefPtr<InspectorArray>& forcedPseudoClasses)
+{
+ Element* element = m_domAgent->assertElement(errorString, nodeId);
+ if (!element)
+ return;
+
+ unsigned forcedPseudoState = computePseudoClassMask(forcedPseudoClasses.get());
+ NodeIdToForcedPseudoState::iterator it = m_nodeIdToForcedPseudoState.find(nodeId);
+ unsigned currentForcedPseudoState = it == m_nodeIdToForcedPseudoState.end() ? 0 : it->second;
+ bool needStyleRecalc = forcedPseudoState != currentForcedPseudoState;
+ if (!needStyleRecalc)
+ return;
+
+ if (forcedPseudoState)
+ m_nodeIdToForcedPseudoState.set(nodeId, forcedPseudoState);
+ else
+ m_nodeIdToForcedPseudoState.remove(nodeId);
+ element->ownerDocument()->styleResolverChanged(RecalcStyleImmediately);
+}
+
void InspectorCSSAgent::getNamedFlowCollection(ErrorString* errorString, int documentNodeId, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::NamedFlow> >& result)
{
Document* document = m_domAgent->assertDocument(errorString, documentNodeId);
diff --git a/Source/WebCore/inspector/InspectorCSSAgent.h b/Source/WebCore/inspector/InspectorCSSAgent.h
index 8778050dd..2b82b4c7e 100644
--- a/Source/WebCore/inspector/InspectorCSSAgent.h
+++ b/Source/WebCore/inspector/InspectorCSSAgent.h
@@ -101,9 +101,9 @@ public:
void didCreateNamedFlow(Document*, const AtomicString& name);
void didRemoveNamedFlow(Document*, const AtomicString& name);
- virtual void getComputedStyleForNode(ErrorString*, int nodeId, const RefPtr<InspectorArray>* forcedPseudoClasses, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> >&);
+ virtual void getComputedStyleForNode(ErrorString*, int nodeId, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> >&);
virtual void getInlineStylesForNode(ErrorString*, int nodeId, RefPtr<TypeBuilder::CSS::CSSStyle>& inlineStyle, RefPtr<TypeBuilder::CSS::CSSStyle>& attributes);
- virtual void getMatchedStylesForNode(ErrorString*, int nodeId, const RefPtr<InspectorArray>* forcedPseudoClasses, const bool* includePseudo, const bool* includeInherited, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSRule> >& matchedCSSRules, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::PseudoIdRules> >& pseudoRules, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::InheritedStyleEntry> >& inheritedEntries);
+ virtual void getMatchedStylesForNode(ErrorString*, int nodeId, const bool* includePseudo, const bool* includeInherited, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSRule> >& matchedCSSRules, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::PseudoIdRules> >& pseudoRules, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::InheritedStyleEntry> >& inheritedEntries);
virtual void getAllStyleSheets(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSStyleSheetHeader> >& styleSheetInfos);
virtual void getStyleSheet(ErrorString*, const String& styleSheetId, RefPtr<TypeBuilder::CSS::CSSStyleSheetBody>& result);
virtual void getStyleSheetText(ErrorString*, const String& styleSheetId, String* result);
@@ -113,6 +113,7 @@ public:
virtual void setRuleSelector(ErrorString*, const RefPtr<InspectorObject>& ruleId, const String& selector, RefPtr<TypeBuilder::CSS::CSSRule>& result);
virtual void addRule(ErrorString*, int contextNodeId, const String& selector, RefPtr<TypeBuilder::CSS::CSSRule>& result);
virtual void getSupportedCSSProperties(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSPropertyInfo> >& result);
+ virtual void forcePseudoState(ErrorString*, int nodeId, const RefPtr<InspectorArray>& forcedPseudoClasses);
virtual void getNamedFlowCollection(ErrorString*, int documentNodeId, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::NamedFlow> >& result);
virtual void getFlowByName(ErrorString*, int documentNodeId, const String& flowName, RefPtr<TypeBuilder::CSS::NamedFlow>& result);
@@ -141,7 +142,6 @@ private:
typedef HashMap<RefPtr<Document>, RefPtr<InspectorStyleSheet> > DocumentToViaInspectorStyleSheet; // "via inspector" stylesheets
typedef HashMap<int, unsigned> NodeIdToForcedPseudoState;
- void recalcStyleForPseudoStateIfNeeded(Element*, InspectorArray* forcedPseudoClasses);
InspectorStyleSheetForInlineStyle* asInspectorStyleSheet(Element* element);
Element* elementForId(ErrorString*, int nodeId);
void collectStyleSheets(CSSStyleSheet*, TypeBuilder::Array<WebCore::TypeBuilder::CSS::CSSStyleSheetHeader>*);
diff --git a/Source/WebCore/inspector/InspectorDOMAgent.h b/Source/WebCore/inspector/InspectorDOMAgent.h
index aedf77920..2f61a0a74 100644
--- a/Source/WebCore/inspector/InspectorDOMAgent.h
+++ b/Source/WebCore/inspector/InspectorDOMAgent.h
@@ -193,6 +193,7 @@ public:
static bool isWhitespace(Node*);
Node* assertNode(ErrorString*, int nodeId);
+ Element* assertElement(ErrorString*, int nodeId);
Document* assertDocument(ErrorString*, int nodeId);
// Methods called from other agents.
@@ -209,7 +210,6 @@ private:
int bind(Node*, NodeToIdMap*);
void unbind(Node*, NodeToIdMap*);
- Element* assertElement(ErrorString*, int nodeId);
Node* assertEditableNode(ErrorString*, int nodeId);
Element* assertEditableElement(ErrorString*, int nodeId);
diff --git a/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp b/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp
index 93999d1fb..90a0a9e60 100644
--- a/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp
+++ b/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp
@@ -156,7 +156,7 @@ String InspectorDOMStorageAgent::storageId(Storage* storage)
ASSERT(storage);
Frame* frame = storage->frame();
ExceptionCode ec = 0;
- bool isLocalStorage = (frame->domWindow()->localStorage(ec) == storage && !ec);
+ bool isLocalStorage = (frame->document()->domWindow()->localStorage(ec) == storage && !ec);
return storageId(frame->document()->securityOrigin(), isLocalStorage);
}
diff --git a/Source/WebCore/inspector/InspectorDatabaseAgent.cpp b/Source/WebCore/inspector/InspectorDatabaseAgent.cpp
index ccb003c3f..98c9363ae 100644
--- a/Source/WebCore/inspector/InspectorDatabaseAgent.cpp
+++ b/Source/WebCore/inspector/InspectorDatabaseAgent.cpp
@@ -215,7 +215,7 @@ public:
virtual ~TransactionSuccessCallback() { }
- virtual void handleEvent() { }
+ virtual bool handleEvent() { return false; }
private:
TransactionSuccessCallback() { }
diff --git a/Source/WebCore/inspector/InspectorFileSystemAgent.cpp b/Source/WebCore/inspector/InspectorFileSystemAgent.cpp
index 1b7df9580..d60b02c44 100644
--- a/Source/WebCore/inspector/InspectorFileSystemAgent.cpp
+++ b/Source/WebCore/inspector/InspectorFileSystemAgent.cpp
@@ -155,7 +155,7 @@ private:
bool didHitError(FileError*);
bool didGetEntry(Entry*);
- void reportResult(FileError::ErrorCode errorCode, PassRefPtr<TypeBuilder::FileSystem::Entry> entry)
+ void reportResult(FileError::ErrorCode errorCode, PassRefPtr<TypeBuilder::FileSystem::Entry> entry = 0)
{
if (!m_frontendProvider || !m_frontendProvider->frontend())
return;
@@ -175,7 +175,7 @@ private:
bool FileSystemRootRequest::didHitError(FileError* error)
{
- reportResult(error->code(), 0);
+ reportResult(error->code());
return true;
}
@@ -208,7 +208,7 @@ public:
virtual ~DirectoryContentRequest()
{
- reportResult(FileError::ABORT_ERR, 0);
+ reportResult(FileError::ABORT_ERR);
}
void start(ScriptExecutionContext*);
@@ -216,14 +216,14 @@ public:
private:
bool didHitError(FileError* error)
{
- reportResult(error->code(), 0);
+ reportResult(error->code());
return true;
}
bool didGetEntry(Entry*);
bool didReadDirectoryEntries(EntryArray*);
- void reportResult(FileError::ErrorCode errorCode, PassRefPtr<Array<TypeBuilder::FileSystem::Entry> > entries)
+ void reportResult(FileError::ErrorCode errorCode, PassRefPtr<Array<TypeBuilder::FileSystem::Entry> > entries = 0)
{
if (!m_frontendProvider || !m_frontendProvider->frontend())
return;
@@ -252,7 +252,7 @@ void DirectoryContentRequest::start(ScriptExecutionContext* scriptExecutionConte
FileSystemType type;
String path;
if (!DOMFileSystemBase::crackFileSystemURL(m_url, type, path)) {
- reportResult(FileError::SYNTAX_ERR, 0);
+ reportResult(FileError::SYNTAX_ERR);
return;
}
@@ -266,7 +266,7 @@ void DirectoryContentRequest::start(ScriptExecutionContext* scriptExecutionConte
bool DirectoryContentRequest::didGetEntry(Entry* entry)
{
if (!entry->isDirectory()) {
- reportResult(FileError::TYPE_MISMATCH_ERR, 0);
+ reportResult(FileError::TYPE_MISMATCH_ERR);
return true;
}
@@ -279,7 +279,7 @@ bool DirectoryContentRequest::didGetEntry(Entry* entry)
void DirectoryContentRequest::readDirectoryEntries()
{
if (!m_directoryReader->filesystem()->scriptExecutionContext()) {
- reportResult(FileError::ABORT_ERR, 0);
+ reportResult(FileError::ABORT_ERR);
return;
}
@@ -340,20 +340,22 @@ public:
virtual ~MetadataRequest()
{
- reportResult(FileError::ABORT_ERR, 0);
+ reportResult(FileError::ABORT_ERR);
}
+ void start(ScriptExecutionContext*);
+
+private:
bool didHitError(FileError* error)
{
- reportResult(error->code(), 0);
+ reportResult(error->code());
return true;
}
- void start(ScriptExecutionContext*);
bool didGetEntry(Entry*);
bool didGetMetadata(Metadata*);
- void reportResult(FileError::ErrorCode errorCode, PassRefPtr<TypeBuilder::FileSystem::Metadata> metadata)
+ void reportResult(FileError::ErrorCode errorCode, PassRefPtr<TypeBuilder::FileSystem::Metadata> metadata = 0)
{
if (!m_frontendProvider || !m_frontendProvider->frontend())
return;
@@ -361,7 +363,6 @@ public:
m_frontendProvider = 0;
}
-private:
MetadataRequest(PassRefPtr<FrontendProvider> frontendProvider, int requestId, const String& url)
: m_frontendProvider(frontendProvider)
, m_requestId(requestId)
@@ -389,7 +390,7 @@ void MetadataRequest::start(ScriptExecutionContext* scriptExecutionContext)
bool MetadataRequest::didGetEntry(Entry* entry)
{
if (!entry->filesystem()->scriptExecutionContext()) {
- reportResult(FileError::ABORT_ERR, 0);
+ reportResult(FileError::ABORT_ERR);
return true;
}
@@ -420,12 +421,11 @@ public:
virtual ~FileContentRequest()
{
- reportResult(FileError::ABORT_ERR, 0, 0);
+ reportResult(FileError::ABORT_ERR);
}
void start(ScriptExecutionContext*);
-
virtual bool operator==(const EventListener& other) OVERRIDE
{
return this == &other;
@@ -442,7 +442,7 @@ public:
private:
bool didHitError(FileError* error)
{
- reportResult(error->code(), 0, 0);
+ reportResult(error->code());
return true;
}
@@ -450,7 +450,7 @@ private:
bool didGetFile(File*);
void didRead();
- void reportResult(FileError::ErrorCode errorCode, const String* result, const String* charset)
+ void reportResult(FileError::ErrorCode errorCode, const String* result = 0, const String* charset = 0)
{
if (!m_frontendProvider || !m_frontendProvider->frontend())
return;
@@ -487,7 +487,7 @@ void FileContentRequest::start(ScriptExecutionContext* scriptExecutionContext)
FileSystemType type;
String path;
if (!DOMFileSystemBase::crackFileSystemURL(m_url, type, path)) {
- reportResult(FileError::SYNTAX_ERR, 0, 0);
+ reportResult(FileError::SYNTAX_ERR);
return;
}
@@ -501,12 +501,12 @@ void FileContentRequest::start(ScriptExecutionContext* scriptExecutionContext)
bool FileContentRequest::didGetEntry(Entry* entry)
{
if (entry->isDirectory()) {
- reportResult(FileError::TYPE_MISMATCH_ERR, 0, 0);
+ reportResult(FileError::TYPE_MISMATCH_ERR);
return true;
}
if (!entry->filesystem()->scriptExecutionContext()) {
- reportResult(FileError::ABORT_ERR, 0, 0);
+ reportResult(FileError::ABORT_ERR);
return true;
}
@@ -548,7 +548,7 @@ void FileContentRequest::didRead()
reportResult(static_cast<FileError::ErrorCode>(0), &result, &m_charset);
}
-}
+} // anonymous namespace
// static
PassOwnPtr<InspectorFileSystemAgent> InspectorFileSystemAgent::create(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InspectorState* state)
diff --git a/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp b/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
index c584b1e9f..e15b30d9e 100644
--- a/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
+++ b/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
@@ -108,13 +108,13 @@ public:
virtual void onError(PassRefPtr<IDBDatabaseError>) OVERRIDE { }
virtual void onSuccess(PassRefPtr<DOMStringList>) OVERRIDE { }
- virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>) OVERRIDE { }
+ virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey>, PassRefPtr<SerializedScriptValue>) OVERRIDE { }
virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>) OVERRIDE { }
virtual void onSuccess(PassRefPtr<IDBKey>) OVERRIDE { }
virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>) OVERRIDE { }
virtual void onSuccess(PassRefPtr<SerializedScriptValue>) OVERRIDE { }
virtual void onSuccess(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, const IDBKeyPath&) OVERRIDE { }
- virtual void onSuccessWithContinuation() OVERRIDE { }
+ virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey>, PassRefPtr<SerializedScriptValue>) OVERRIDE { }
virtual void onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<SerializedScriptValue> >&) OVERRIDE { }
virtual void onBlocked() OVERRIDE { }
};
@@ -129,6 +129,7 @@ public:
virtual ~InspectorIDBDatabaseCallbacks() { }
virtual void onVersionChange(const String& version) { }
+ virtual void onVersionChange(int64_t oldVersion, int64_t newVersion) { }
private:
InspectorIDBDatabaseCallbacks() { }
};
@@ -237,7 +238,7 @@ private:
void ExecutableWithDatabase::start(IDBFactoryBackendInterface* idbFactory, SecurityOrigin* securityOrigin, ScriptExecutionContext* context, const String& databaseName)
{
RefPtr<OpenDatabaseCallback> callback = OpenDatabaseCallback::create(this);
- idbFactory->open(databaseName, callback.get(), securityOrigin, context, String());
+ idbFactory->open(databaseName, IDBDatabaseMetadata::NoIntVersion, callback.get(), securityOrigin, context, String());
}
static PassRefPtr<IDBTransactionBackendInterface> transactionForDatabase(IDBDatabaseBackendInterface* idbDatabase, const String& objectStoreName)
@@ -490,13 +491,13 @@ public:
end(false);
}
- virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface> idbCursor)
+ virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface> idbCursor, PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue> value)
{
m_idbCursor = idbCursor;
- onSuccessWithContinuation();
+ onSuccess(key, primaryKey, value);
}
- virtual void onSuccessWithContinuation()
+ virtual void onSuccess(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue> value)
{
if (m_skipCount) {
--m_skipCount;
@@ -509,9 +510,6 @@ public:
return;
}
- RefPtr<IDBKey> key = m_idbCursor->key();
- RefPtr<IDBKey> primaryKey = m_idbCursor->primaryKey();
- RefPtr<SerializedScriptValue> value = m_idbCursor->value();
RefPtr<TypeBuilder::Runtime::RemoteObject> wrappedValue = m_injectedScript.wrapSerializedObject(value.get(), String());
RefPtr<DataEntry> dataEntry = DataEntry::create()
.setKey(keyFromIDBKey(key.get()))
diff --git a/Source/WebCore/inspector/InspectorInstrumentation.cpp b/Source/WebCore/inspector/InspectorInstrumentation.cpp
index faea068d2..7ea314c56 100644
--- a/Source/WebCore/inspector/InspectorInstrumentation.cpp
+++ b/Source/WebCore/inspector/InspectorInstrumentation.cpp
@@ -69,7 +69,6 @@
#include "WorkerThread.h"
#include "XMLHttpRequest.h"
#include <wtf/StdLibExtras.h>
-#include <wtf/ThreadSpecific.h>
#include <wtf/text/CString.h>
namespace WebCore {
@@ -674,7 +673,7 @@ InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceResp
return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId);
}
-void InspectorInstrumentation::didReceiveResourceResponseImpl(const InspectorInstrumentationCookie& cookie, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response)
+void InspectorInstrumentation::didReceiveResourceResponseImpl(const InspectorInstrumentationCookie& cookie, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
{
if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
timelineAgent->didReceiveResourceResponse();
@@ -684,7 +683,7 @@ void InspectorInstrumentation::didReceiveResourceResponseImpl(const InspectorIns
if (!instrumentingAgents)
return;
if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorResourceAgent())
- resourceAgent->didReceiveResponse(identifier, loader, response);
+ resourceAgent->didReceiveResponse(identifier, loader, response, resourceLoader);
if (InspectorConsoleAgent* consoleAgent = instrumentingAgents->inspectorConsoleAgent())
consoleAgent->didReceiveResponse(identifier, response); // This should come AFTER resource notification, front-end relies on this.
}
@@ -692,7 +691,7 @@ void InspectorInstrumentation::didReceiveResourceResponseImpl(const InspectorIns
void InspectorInstrumentation::didReceiveResourceResponseButCanceledImpl(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
{
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(frame, identifier, r);
- InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, loader, r);
+ InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, loader, r, 0);
}
void InspectorInstrumentation::continueAfterXFrameOptionsDeniedImpl(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
@@ -1154,22 +1153,6 @@ void InspectorInstrumentation::didFireAnimationFrameImpl(const InspectorInstrume
timelineAgent->didFireAnimationFrame();
}
-InspectorTimelineAgent* InspectorInstrumentation::timelineAgentForOrphanEvents()
-{
- return *threadSpecificTimelineAgentForOrphanEvents();
-}
-
-void InspectorInstrumentation::setTimelineAgentForOrphanEvents(InspectorTimelineAgent* inspectorTimelineAgent)
-{
- *threadSpecificTimelineAgentForOrphanEvents() = inspectorTimelineAgent;
-}
-
-WTF::ThreadSpecific<InspectorTimelineAgent*>& InspectorInstrumentation::threadSpecificTimelineAgentForOrphanEvents()
-{
- AtomicallyInitializedStatic(WTF::ThreadSpecific<InspectorTimelineAgent*>*, instance = new WTF::ThreadSpecific<InspectorTimelineAgent*>());
- return *instance;
-}
-
void InspectorInstrumentation::registerInstrumentingAgents(InstrumentingAgents* instrumentingAgents)
{
if (!instrumentingAgentsSet)
diff --git a/Source/WebCore/inspector/InspectorInstrumentation.h b/Source/WebCore/inspector/InspectorInstrumentation.h
index 116d76c2b..e4a79ed38 100644
--- a/Source/WebCore/inspector/InspectorInstrumentation.h
+++ b/Source/WebCore/inspector/InspectorInstrumentation.h
@@ -172,7 +172,7 @@ public:
static InspectorInstrumentationCookie willReceiveResourceData(Frame*, unsigned long identifier, int length);
static void didReceiveResourceData(const InspectorInstrumentationCookie&);
static InspectorInstrumentationCookie willReceiveResourceResponse(Frame*, unsigned long identifier, const ResourceResponse&);
- static void didReceiveResourceResponse(const InspectorInstrumentationCookie&, unsigned long identifier, DocumentLoader*, const ResourceResponse&);
+ static void didReceiveResourceResponse(const InspectorInstrumentationCookie&, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
static void continueAfterXFrameOptionsDenied(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&);
static void continueWithPolicyDownload(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&);
static void continueWithPolicyIgnore(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&);
@@ -255,8 +255,6 @@ public:
static bool hasFrontends() { return s_frontendCounter; }
static bool hasFrontendForScriptContext(ScriptExecutionContext*);
static bool collectingHTMLParseErrors(Page*);
- static InspectorTimelineAgent* timelineAgentForOrphanEvents();
- static void setTimelineAgentForOrphanEvents(InspectorTimelineAgent*);
#else
static bool hasFrontends() { return false; }
static bool hasFrontendForScriptContext(ScriptExecutionContext*) { return false; }
@@ -274,8 +272,6 @@ public:
private:
#if ENABLE(INSPECTOR)
- static WTF::ThreadSpecific<InspectorTimelineAgent*>& threadSpecificTimelineAgentForOrphanEvents();
-
static void didClearWindowObjectInWorldImpl(InstrumentingAgents*, Frame*, DOMWrapperWorld*);
static bool isDebuggerPausedImpl(InstrumentingAgents*);
@@ -351,7 +347,7 @@ private:
static InspectorInstrumentationCookie willReceiveResourceDataImpl(InstrumentingAgents*, unsigned long identifier, Frame*, int length);
static void didReceiveResourceDataImpl(const InspectorInstrumentationCookie&);
static InspectorInstrumentationCookie willReceiveResourceResponseImpl(InstrumentingAgents*, unsigned long identifier, const ResourceResponse&, Frame*);
- static void didReceiveResourceResponseImpl(const InspectorInstrumentationCookie&, unsigned long identifier, DocumentLoader*, const ResourceResponse&);
+ static void didReceiveResourceResponseImpl(const InspectorInstrumentationCookie&, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
static void didReceiveResourceResponseButCanceledImpl(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&);
static void continueAfterXFrameOptionsDeniedImpl(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&);
static void continueWithPolicyDownloadImpl(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&);
@@ -1082,11 +1078,11 @@ inline InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResou
return InspectorInstrumentationCookie();
}
-inline void InspectorInstrumentation::didReceiveResourceResponse(const InspectorInstrumentationCookie& cookie, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response)
+inline void InspectorInstrumentation::didReceiveResourceResponse(const InspectorInstrumentationCookie& cookie, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
{
#if ENABLE(INSPECTOR)
// Call this unconditionally so that we're able to log to console with no front-end attached.
- didReceiveResourceResponseImpl(cookie, identifier, loader, response);
+ didReceiveResourceResponseImpl(cookie, identifier, loader, response, resourceLoader);
#endif
}
diff --git a/Source/WebCore/inspector/InspectorProfilerAgent.cpp b/Source/WebCore/inspector/InspectorProfilerAgent.cpp
index 38687ecba..997dd4a09 100644
--- a/Source/WebCore/inspector/InspectorProfilerAgent.cpp
+++ b/Source/WebCore/inspector/InspectorProfilerAgent.cpp
@@ -321,7 +321,7 @@ void InspectorProfilerAgent::resetState()
void InspectorProfilerAgent::resetFrontendProfiles()
{
- if (m_frontend
+ if (m_frontend && enabled()
&& m_profiles.begin() == m_profiles.end()
&& m_snapshots.begin() == m_snapshots.end())
m_frontend->resetProfiles();
diff --git a/Source/WebCore/inspector/InspectorResourceAgent.cpp b/Source/WebCore/inspector/InspectorResourceAgent.cpp
index 65148b221..9d929c9a1 100644
--- a/Source/WebCore/inspector/InspectorResourceAgent.cpp
+++ b/Source/WebCore/inspector/InspectorResourceAgent.cpp
@@ -54,11 +54,13 @@
#include "Page.h"
#include "ProgressTracker.h"
#include "ResourceError.h"
+#include "ResourceLoader.h"
#include "ResourceRequest.h"
#include "ResourceResponse.h"
#include "ScriptCallStack.h"
#include "ScriptCallStackFactory.h"
#include "ScriptableDocumentParser.h"
+#include "SubresourceLoader.h"
#include "WebSocketFrame.h"
#include "WebSocketHandshakeRequest.h"
#include "WebSocketHandshakeResponse.h"
@@ -221,8 +223,8 @@ void InspectorResourceAgent::willSendRequest(unsigned long identifier, DocumentL
request.setReportRawHeaders(true);
if (m_state->getBoolean(ResourceAgentState::cacheDisabled)) {
- request.setCachePolicy(ReloadIgnoringCacheData);
request.setHTTPHeaderField("Pragma", "no-cache");
+ request.setCachePolicy(ReloadIgnoringCacheData);
request.setHTTPHeaderField("Cache-Control", "no-cache");
}
@@ -235,15 +237,20 @@ void InspectorResourceAgent::markResourceAsCached(unsigned long identifier)
m_frontend->requestServedFromCache(IdentifiersFactory::requestId(identifier));
}
-void InspectorResourceAgent::didReceiveResponse(unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response)
+void InspectorResourceAgent::didReceiveResponse(unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
{
String requestId = IdentifiersFactory::requestId(identifier);
RefPtr<TypeBuilder::Network::Response> resourceResponse = buildObjectForResourceResponse(response, loader);
InspectorPageAgent::ResourceType type = InspectorPageAgent::OtherResource;
long cachedResourceSize = 0;
+ bool isNotModified = response.httpStatusCode() == 304;
if (loader) {
- CachedResource* cachedResource = InspectorPageAgent::cachedResource(loader->frame(), response.url());
+ CachedResource* cachedResource = 0;
+ if (resourceLoader && resourceLoader->isSubresourceLoader() && !isNotModified)
+ cachedResource = static_cast<SubresourceLoader*>(resourceLoader)->cachedResource();
+ if (!cachedResource)
+ cachedResource = InspectorPageAgent::cachedResource(loader->frame(), response.url());
if (cachedResource) {
type = InspectorPageAgent::cachedResourceType(*cachedResource);
cachedResourceSize = cachedResource->encodedSize();
@@ -268,7 +275,7 @@ void InspectorResourceAgent::didReceiveResponse(unsigned long identifier, Docume
m_frontend->responseReceived(requestId, m_pageAgent->frameId(loader->frame()), m_pageAgent->loaderId(loader), currentTime(), InspectorPageAgent::resourceTypeJson(type), resourceResponse);
// If we revalidated the resource and got Not modified, send content length following didReceiveResponse
// as there will be no calls to didReceiveData from the network stack.
- if (cachedResourceSize && response.httpStatusCode() == 304)
+ if (cachedResourceSize && isNotModified)
didReceiveData(identifier, 0, cachedResourceSize, 0);
}
diff --git a/Source/WebCore/inspector/InspectorResourceAgent.h b/Source/WebCore/inspector/InspectorResourceAgent.h
index 67ca478e0..5c9fbe262 100644
--- a/Source/WebCore/inspector/InspectorResourceAgent.h
+++ b/Source/WebCore/inspector/InspectorResourceAgent.h
@@ -62,6 +62,7 @@ class KURL;
class NetworkResourcesData;
class Page;
class ResourceError;
+class ResourceLoader;
class ResourceRequest;
class ResourceResponse;
class SharedBuffer;
@@ -91,7 +92,7 @@ public:
void willSendRequest(unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
void markResourceAsCached(unsigned long identifier);
- void didReceiveResponse(unsigned long identifier, DocumentLoader* laoder, const ResourceResponse&);
+ void didReceiveResponse(unsigned long identifier, DocumentLoader* laoder, const ResourceResponse&, ResourceLoader*);
void didReceiveData(unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
void didFinishLoading(unsigned long identifier, DocumentLoader*, double finishTime);
void didFailLoading(unsigned long identifier, DocumentLoader*, const ResourceError&);
diff --git a/Source/WebCore/inspector/InspectorStyleSheet.cpp b/Source/WebCore/inspector/InspectorStyleSheet.cpp
index 6a3de096c..730e36bb8 100644
--- a/Source/WebCore/inspector/InspectorStyleSheet.cpp
+++ b/Source/WebCore/inspector/InspectorStyleSheet.cpp
@@ -231,7 +231,7 @@ static void fillMediaListChain(CSSRule* rule, Array<TypeBuilder::CSS::CSSMedia>*
mediaList = 0;
if (parentStyleSheet) {
- sourceURL = parentStyleSheet->contents()->finalURL();
+ sourceURL = parentStyleSheet->contents()->baseURL();
if (sourceURL.isEmpty())
sourceURL = InspectorDOMAgent::documentURLString(parentStyleSheet->ownerDocument());
} else
@@ -250,8 +250,8 @@ static void fillMediaListChain(CSSRule* rule, Array<TypeBuilder::CSS::CSSMedia>*
Document* doc = styleSheet->ownerDocument();
if (doc)
sourceURL = doc->url();
- else if (!styleSheet->contents()->finalURL().isEmpty())
- sourceURL = styleSheet->contents()->finalURL();
+ else if (!styleSheet->contents()->baseURL().isEmpty())
+ sourceURL = styleSheet->contents()->baseURL();
else
sourceURL = "";
mediaArray->addItem(buildMediaObject(mediaList, styleSheet->ownerNode() ? MediaListSourceLinkedSheet : MediaListSourceInlineSheet, sourceURL));
@@ -528,7 +528,7 @@ PassRefPtr<TypeBuilder::CSS::CSSStyle> InspectorStyle::styleWithProperties() con
bool shouldInactivate = false;
CSSPropertyID propertyId = cssPropertyID(name);
// Canonicalize property names to treat non-prefixed and vendor-prefixed property names the same (opacity vs. -webkit-opacity).
- String canonicalPropertyName = propertyId ? String(getPropertyName(propertyId)) : name;
+ String canonicalPropertyName = propertyId ? getPropertyNameString(propertyId) : name;
HashMap<String, RefPtr<TypeBuilder::CSS::CSSProperty> >::iterator activeIt = propertyNameToPreviousActiveProperty.find(canonicalPropertyName);
if (activeIt != propertyNameToPreviousActiveProperty.end()) {
if (propertyEntry.parsedOk)
@@ -707,8 +707,8 @@ PassRefPtr<InspectorStyleSheet> InspectorStyleSheet::create(InspectorPageAgent*
// static
String InspectorStyleSheet::styleSheetURL(CSSStyleSheet* pageStyleSheet)
{
- if (pageStyleSheet && !pageStyleSheet->contents()->finalURL().isEmpty())
- return pageStyleSheet->contents()->finalURL().string();
+ if (pageStyleSheet && !pageStyleSheet->contents()->baseURL().isEmpty())
+ return pageStyleSheet->contents()->baseURL().string();
return emptyString();
}
diff --git a/Source/WebCore/inspector/InspectorTimelineAgent.cpp b/Source/WebCore/inspector/InspectorTimelineAgent.cpp
index 8cc343912..68ff5e5ea 100644
--- a/Source/WebCore/inspector/InspectorTimelineAgent.cpp
+++ b/Source/WebCore/inspector/InspectorTimelineAgent.cpp
@@ -68,6 +68,8 @@ static const char BeginFrame[] = "BeginFrame";
static const char Layout[] = "Layout";
static const char RecalculateStyles[] = "RecalculateStyles";
static const char Paint[] = "Paint";
+static const char DecodeImage[] = "DecodeImage";
+static const char ResizeImage[] = "ResizeImage";
static const char CompositeLayers[] = "CompositeLayers";
static const char ParseHTML[] = "ParseHTML";
@@ -255,6 +257,26 @@ void InspectorTimelineAgent::didPaint()
didCompleteCurrentRecord(TimelineRecordType::Paint);
}
+void InspectorTimelineAgent::willDecodeImage(const String& imageType)
+{
+ pushCurrentRecord(TimelineRecordFactory::createDecodeImageData(imageType), TimelineRecordType::DecodeImage, true, 0);
+}
+
+void InspectorTimelineAgent::didDecodeImage()
+{
+ didCompleteCurrentRecord(TimelineRecordType::DecodeImage);
+}
+
+void InspectorTimelineAgent::willResizeImage(bool shouldCache)
+{
+ pushCurrentRecord(TimelineRecordFactory::createResizeImageData(shouldCache), TimelineRecordType::ResizeImage, true, 0);
+}
+
+void InspectorTimelineAgent::didResizeImage()
+{
+ didCompleteCurrentRecord(TimelineRecordType::ResizeImage);
+}
+
void InspectorTimelineAgent::willComposite()
{
pushCurrentRecord(InspectorObject::create(), TimelineRecordType::CompositeLayers, false, 0);
@@ -486,9 +508,9 @@ void InspectorTimelineAgent::didCompleteCurrentRecord(const String& type)
// An empty stack could merely mean that the timeline agent was turned on in the middle of
// an event. Don't treat as an error.
if (!m_recordStack.isEmpty()) {
- if (m_orphanEventsEnabledStackMark == m_recordStack.size()) {
- m_orphanEventsEnabledStackMark = 0;
- InspectorInstrumentation::setTimelineAgentForOrphanEvents(0);
+ if (m_platformInstrumentationClientInstalledAtStackDepth == m_recordStack.size()) {
+ m_platformInstrumentationClientInstalledAtStackDepth = 0;
+ PlatformInstrumentation::setClient(0);
}
pushGCEventRecords();
@@ -509,7 +531,7 @@ InspectorTimelineAgent::InspectorTimelineAgent(InstrumentingAgents* instrumentin
, m_timestampOffset(0)
, m_id(1)
, m_maxCallStackDepth(5)
- , m_orphanEventsEnabledStackMark(0)
+ , m_platformInstrumentationClientInstalledAtStackDepth(0)
, m_inspectorType(type)
, m_client(client)
{
@@ -527,7 +549,7 @@ void InspectorTimelineAgent::appendRecord(PassRefPtr<InspectorObject> data, cons
addRecordToTimeline(record.release(), type, frameId);
}
-void InspectorTimelineAgent::pushCurrentRecord(PassRefPtr<InspectorObject> data, const String& type, bool captureCallStack, Frame* frame, bool hasOrphanDetails)
+void InspectorTimelineAgent::pushCurrentRecord(PassRefPtr<InspectorObject> data, const String& type, bool captureCallStack, Frame* frame, bool hasLowLevelDetails)
{
pushGCEventRecords();
commitFrameRecord();
@@ -536,9 +558,9 @@ void InspectorTimelineAgent::pushCurrentRecord(PassRefPtr<InspectorObject> data,
if (frame && m_pageAgent)
frameId = m_pageAgent->frameId(frame);
m_recordStack.append(TimelineRecordEntry(record.release(), data, InspectorArray::create(), type, frameId));
- if (hasOrphanDetails && !m_orphanEventsEnabledStackMark && !InspectorInstrumentation::timelineAgentForOrphanEvents()) {
- m_orphanEventsEnabledStackMark = m_recordStack.size();
- InspectorInstrumentation::setTimelineAgentForOrphanEvents(this);
+ if (hasLowLevelDetails && !m_platformInstrumentationClientInstalledAtStackDepth && !PlatformInstrumentation::hasClient()) {
+ m_platformInstrumentationClientInstalledAtStackDepth = m_recordStack.size();
+ PlatformInstrumentation::setClient(this);
}
}
@@ -553,6 +575,10 @@ void InspectorTimelineAgent::commitFrameRecord()
void InspectorTimelineAgent::clearRecordStack()
{
+ if (m_platformInstrumentationClientInstalledAtStackDepth) {
+ m_platformInstrumentationClientInstalledAtStackDepth = 0;
+ PlatformInstrumentation::setClient(0);
+ }
m_pendingFrameRecord.clear();
m_recordStack.clear();
m_id++;
diff --git a/Source/WebCore/inspector/InspectorTimelineAgent.h b/Source/WebCore/inspector/InspectorTimelineAgent.h
index 0b4b90e84..61e8ddc00 100644
--- a/Source/WebCore/inspector/InspectorTimelineAgent.h
+++ b/Source/WebCore/inspector/InspectorTimelineAgent.h
@@ -1,5 +1,5 @@
/*
-* Copyright (C) 2009 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 are
@@ -37,6 +37,7 @@
#include "InspectorFrontend.h"
#include "InspectorValues.h"
#include "LayoutTypes.h"
+#include "PlatformInstrumentation.h"
#include "ScriptGCEvent.h"
#include "ScriptGCEventListener.h"
#include <wtf/PassOwnPtr.h>
@@ -56,7 +57,11 @@ class ResourceResponse;
typedef String ErrorString;
-class InspectorTimelineAgent : public InspectorBaseAgent<InspectorTimelineAgent>, ScriptGCEventListener, public InspectorBackendDispatcher::TimelineCommandHandler {
+class InspectorTimelineAgent
+ : public InspectorBaseAgent<InspectorTimelineAgent>,
+ public ScriptGCEventListener,
+ public InspectorBackendDispatcher::TimelineCommandHandler,
+ public PlatformInstrumentationClient {
WTF_MAKE_NONCOPYABLE(InspectorTimelineAgent);
public:
enum InspectorType { PageInspector, WorkerInspector };
@@ -146,6 +151,12 @@ public:
void willProcessTask();
void didProcessTask();
+ // PlatformInstrumentationClient methods.
+ virtual void willDecodeImage(const String& imageType) OVERRIDE;
+ virtual void didDecodeImage() OVERRIDE;
+ virtual void willResizeImage(bool shouldCache) OVERRIDE;
+ virtual void didResizeImage() OVERRIDE;
+
private:
struct TimelineRecordEntry {
TimelineRecordEntry(PassRefPtr<InspectorObject> record, PassRefPtr<InspectorObject> data, PassRefPtr<InspectorArray> children, const String& type, const String& frameId)
@@ -161,7 +172,7 @@ private:
InspectorTimelineAgent(InstrumentingAgents*, InspectorPageAgent*, InspectorState*, InspectorType, InspectorClient*);
- void pushCurrentRecord(PassRefPtr<InspectorObject>, const String& type, bool captureCallStack, Frame*, bool hasOrphanDetails = false);
+ void pushCurrentRecord(PassRefPtr<InspectorObject>, const String& type, bool captureCallStack, Frame*, bool hasLowLevelDetails = false);
void setHeapSizeStatistics(InspectorObject* record);
void didCompleteCurrentRecord(const String& type);
@@ -196,7 +207,7 @@ private:
typedef Vector<GCEvent> GCEvents;
GCEvents m_gcEvents;
int m_maxCallStackDepth;
- unsigned m_orphanEventsEnabledStackMark;
+ unsigned m_platformInstrumentationClientInstalledAtStackDepth;
RefPtr<InspectorObject> m_pendingFrameRecord;
InspectorType m_inspectorType;
InspectorClient* m_client;
diff --git a/Source/WebCore/inspector/TimelineRecordFactory.cpp b/Source/WebCore/inspector/TimelineRecordFactory.cpp
index 6f3b4aacf..e8527b60b 100644
--- a/Source/WebCore/inspector/TimelineRecordFactory.cpp
+++ b/Source/WebCore/inspector/TimelineRecordFactory.cpp
@@ -179,6 +179,20 @@ PassRefPtr<InspectorObject> TimelineRecordFactory::createPaintData(const LayoutR
return data.release();
}
+PassRefPtr<InspectorObject> TimelineRecordFactory::createDecodeImageData(const String& imageType)
+{
+ RefPtr<InspectorObject> data = InspectorObject::create();
+ data->setString("imageType", imageType);
+ return data.release();
+}
+
+PassRefPtr<InspectorObject> TimelineRecordFactory::createResizeImageData(bool shouldCache)
+{
+ RefPtr<InspectorObject> data = InspectorObject::create();
+ data->setBoolean("cached", shouldCache);
+ return data.release();
+}
+
PassRefPtr<InspectorObject> TimelineRecordFactory::createParseHTMLData(unsigned int length, unsigned int startLine)
{
RefPtr<InspectorObject> data = InspectorObject::create();
diff --git a/Source/WebCore/inspector/TimelineRecordFactory.h b/Source/WebCore/inspector/TimelineRecordFactory.h
index 555f232af..69c104bd2 100644
--- a/Source/WebCore/inspector/TimelineRecordFactory.h
+++ b/Source/WebCore/inspector/TimelineRecordFactory.h
@@ -77,6 +77,10 @@ namespace WebCore {
static PassRefPtr<InspectorObject> createPaintData(const LayoutRect&);
+ static PassRefPtr<InspectorObject> createDecodeImageData(const String& imageType);
+
+ static PassRefPtr<InspectorObject> createResizeImageData(bool shouldCache);
+
static PassRefPtr<InspectorObject> createParseHTMLData(unsigned int length, unsigned int startLine);
static PassRefPtr<InspectorObject> createAnimationFrameData(int callbackId);
diff --git a/Source/WebCore/inspector/compile-front-end.py b/Source/WebCore/inspector/compile-front-end.py
index e6b498eeb..cb1dc922e 100755
--- a/Source/WebCore/inspector/compile-front-end.py
+++ b/Source/WebCore/inspector/compile-front-end.py
@@ -88,14 +88,15 @@ modules = [
"Linkifier.js",
"NetworkLog.js",
"Placard.js",
+ "PresentationConsoleMessageHelper.js",
"SASSSourceMapping.js",
"Script.js",
"ScriptFormatter.js",
"ScriptSnippetModel.js",
"SnippetStorage.js",
"SourceMapping.js",
+ "StyleSource.js",
"TimelineManager.js",
- "TimelineModel.js",
"RawSourceCode.js",
"RemoteObject.js",
"Resource.js",
@@ -159,32 +160,30 @@ modules = [
"dependencies": ["sdk", "ui"],
"sources": [
"ConsoleMessage.js",
- "BreakpointsSidebarPane.js",
"DOMBreakpointsSidebarPane.js",
"DOMPresentationUtils.js",
"ElementsTreeOutline.js",
- "EventListenersSidebarPane.js",
- "FilteredItemSelectionDialog.js",
"GoToLineDialog.js",
+ "NativeBreakpointsSidebarPane.js",
"NavigatorOverlayController.js",
"NavigatorView.js",
"JavaScriptContextManager.js",
"JavaScriptSource.js",
"ObjectPopoverHelper.js",
"ObjectPropertiesSection.js",
- "PropertiesSidebarPane.js",
"SourceFrame.js",
"TimelineGrid.js",
- "UISourceCodeFrame.js",
]
},
{
"target_name": "elements",
"dependencies": ["components"],
"sources": [
- "StylesSidebarPane.js",
- "MetricsSidebarPane.js",
"ElementsPanel.js",
+ "EventListenersSidebarPane.js",
+ "MetricsSidebarPane.js",
+ "PropertiesSidebarPane.js",
+ "StylesSidebarPane.js",
]
},
{
@@ -227,17 +226,20 @@ modules = [
"target_name": "scripts",
"dependencies": ["components"],
"sources": [
+ "BreakpointsSidebarPane.js",
"CallStackSidebarPane.js",
- "ScopeChainSidebarPane.js",
+ "FilteredItemSelectionDialog.js",
"JavaScriptSourceFrame.js",
- "PresentationConsoleMessageHelper.js",
"RevisionHistoryView.js",
+ "ScopeChainSidebarPane.js",
"ScriptsNavigator.js",
"ScriptsPanel.js",
"ScriptsSearchScope.js",
+ "SnippetJavaScriptSourceFrame.js",
+ "StyleSheetOutlineDialog.js",
"TabbedEditorContainer.js",
+ "UISourceCodeFrame.js",
"WatchExpressionsSidebarPane.js",
- "WorkerManager.js",
"WorkersSidebarPane.js",
]
},
@@ -254,6 +256,7 @@ modules = [
"dependencies": ["components"],
"sources": [
"MemoryStatistics.js",
+ "TimelineModel.js",
"TimelineOverviewPane.js",
"TimelinePanel.js",
"TimelinePresentationModel.js",
@@ -273,13 +276,6 @@ modules = [
]
},
{
- "target_name": "styles",
- "dependencies": ["components"],
- "sources": [
- "StylesPanel.js",
- ]
- },
- {
"target_name": "extensions",
"dependencies": ["components"],
"sources": [
@@ -296,6 +292,7 @@ modules = [
"dependencies": ["components", "extensions"],
"sources": [
"SettingsScreen.js",
+ "WorkerManager.js",
]
},
{
diff --git a/Source/WebCore/inspector/front-end/AdvancedSearchController.js b/Source/WebCore/inspector/front-end/AdvancedSearchController.js
index b98ab9045..695059375 100644
--- a/Source/WebCore/inspector/front-end/AdvancedSearchController.js
+++ b/Source/WebCore/inspector/front-end/AdvancedSearchController.js
@@ -56,7 +56,7 @@ WebInspector.AdvancedSearchController.prototype = {
{
if (WebInspector.KeyboardShortcut.makeKeyFromEvent(event) === this._shortcut.key) {
if (!this._searchView || !this._searchView.isShowing() || this._searchView._search !== document.activeElement) {
- WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.scripts);
+ WebInspector.showPanel("scripts");
this.show();
} else
this.close();
@@ -222,6 +222,8 @@ WebInspector.SearchView = function(controller)
WebInspector.SearchView.maxQueriesCount = 20;
WebInspector.SearchView.prototype = {
+ __proto__: WebInspector.View.prototype,
+
/**
* @return {Array.<Element>}
*/
@@ -388,7 +390,7 @@ WebInspector.SearchView.prototype = {
}
}
-WebInspector.SearchView.prototype.__proto__ = WebInspector.View.prototype;
+//WebInspector.SearchView.prototype.__proto__ = WebInspector.View.prototype;
/**
* @constructor
diff --git a/Source/WebCore/inspector/front-end/AuditRules.js b/Source/WebCore/inspector/front-end/AuditRules.js
index a6459b208..9cdd98222 100644
--- a/Source/WebCore/inspector/front-end/AuditRules.js
+++ b/Source/WebCore/inspector/front-end/AuditRules.js
@@ -786,9 +786,9 @@ WebInspector.AuditRules.ImageDimensionsRule.prototype = {
doneCallback();
for (var i = 0; nodeIds && i < nodeIds.length; ++i) {
- WebInspector.cssModel.getMatchedStylesAsync(nodeIds[i], undefined, false, false, matchedCallback);
+ WebInspector.cssModel.getMatchedStylesAsync(nodeIds[i], false, false, matchedCallback);
WebInspector.cssModel.getInlineStylesAsync(nodeIds[i], inlineCallback);
- WebInspector.cssModel.getComputedStyleAsync(nodeIds[i], undefined, imageStylesReady.bind(null, nodeIds[i], targetResult, i === nodeIds.length - 1));
+ WebInspector.cssModel.getComputedStyleAsync(nodeIds[i], imageStylesReady.bind(null, nodeIds[i], targetResult, i === nodeIds.length - 1));
}
}
diff --git a/Source/WebCore/inspector/front-end/AuditsPanel.js b/Source/WebCore/inspector/front-end/AuditsPanel.js
index b834a0b0f..056813756 100644
--- a/Source/WebCore/inspector/front-end/AuditsPanel.js
+++ b/Source/WebCore/inspector/front-end/AuditsPanel.js
@@ -43,7 +43,7 @@ WebInspector.AuditsPanel = function()
this.sidebarTree.appendChild(this.auditsTreeElement);
this.auditsTreeElement.listItemElement.addStyleClass("hidden");
- this.auditsItemTreeElement = new WebInspector.AuditsSidebarTreeElement();
+ this.auditsItemTreeElement = new WebInspector.AuditsSidebarTreeElement(this);
this.auditsTreeElement.appendChild(this.auditsItemTreeElement);
this.auditResultsTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("RESULTS"), {}, true);
@@ -65,11 +65,6 @@ WebInspector.AuditsPanel = function()
}
WebInspector.AuditsPanel.prototype = {
- get toolbarItemLabel()
- {
- return WebInspector.UIString("Audits");
- },
-
get statusBarItems()
{
return [this.clearResultsButton.element];
@@ -151,7 +146,7 @@ WebInspector.AuditsPanel.prototype = {
ordinal++;
}
- var resultTreeElement = new WebInspector.AuditResultSidebarTreeElement(results, mainResourceURL, ordinal);
+ var resultTreeElement = new WebInspector.AuditResultSidebarTreeElement(this, results, mainResourceURL, ordinal);
this.auditResultsTreeElement.appendChild(resultTreeElement);
resultTreeElement.revealAndSelect();
if (!this._progressMonitor.canceled && launcherCallback)
@@ -526,11 +521,12 @@ WebInspector.AuditProgressMonitor.prototype = {
/**
* @constructor
* @extends {WebInspector.SidebarTreeElement}
+ * @param {WebInspector.AuditsPanel} panel
*/
-WebInspector.AuditsSidebarTreeElement = function()
+WebInspector.AuditsSidebarTreeElement = function(panel)
{
+ this._panel = panel;
this.small = false;
-
WebInspector.SidebarTreeElement.call(this, "audits-sidebar-tree-item", WebInspector.UIString("Audits"), "", null, false);
}
@@ -542,7 +538,7 @@ WebInspector.AuditsSidebarTreeElement.prototype = {
onselect: function()
{
- WebInspector.panels.audits.showLauncherView();
+ this._panel.showLauncherView();
},
get selectable()
@@ -561,19 +557,20 @@ WebInspector.AuditsSidebarTreeElement.prototype.__proto__ = WebInspector.Sidebar
/**
* @constructor
* @extends {WebInspector.SidebarTreeElement}
+ * @param {WebInspector.AuditsPanel} panel
*/
-WebInspector.AuditResultSidebarTreeElement = function(results, mainResourceURL, ordinal)
+WebInspector.AuditResultSidebarTreeElement = function(panel, results, mainResourceURL, ordinal)
{
+ this._panel = panel;
this.results = results;
this.mainResourceURL = mainResourceURL;
-
WebInspector.SidebarTreeElement.call(this, "audit-result-sidebar-tree-item", String.sprintf("%s (%d)", mainResourceURL, ordinal), "", {}, false);
}
WebInspector.AuditResultSidebarTreeElement.prototype = {
onselect: function()
{
- WebInspector.panels.audits.showResults(this.results);
+ this._panel.showResults(this.results);
},
get selectable()
@@ -589,3 +586,9 @@ WebInspector.AuditRules = {};
// Contributed audit categories should go into this namespace.
WebInspector.AuditCategories = {};
+
+importScript("AuditCategories.js");
+importScript("AuditFormatters.js");
+importScript("AuditLauncherView.js");
+importScript("AuditResultView.js");
+importScript("AuditRules.js");
diff --git a/Source/WebCore/inspector/front-end/BreakpointManager.js b/Source/WebCore/inspector/front-end/BreakpointManager.js
index 42ff318db..88b63573e 100644
--- a/Source/WebCore/inspector/front-end/BreakpointManager.js
+++ b/Source/WebCore/inspector/front-end/BreakpointManager.js
@@ -33,11 +33,13 @@
* @extends {WebInspector.Object}
* @param {WebInspector.Setting} breakpointStorage
* @param {WebInspector.DebuggerModel} debuggerModel
+ * @param {WebInspector.Workspace} workspace
*/
-WebInspector.BreakpointManager = function(breakpointStorage, debuggerModel)
+WebInspector.BreakpointManager = function(breakpointStorage, debuggerModel, workspace)
{
this._storage = new WebInspector.BreakpointManager.Storage(this, breakpointStorage);
this._debuggerModel = debuggerModel;
+ this._workspace = workspace;
this._breakpoints = [];
this._breakpointForDebuggerId = {};
@@ -45,7 +47,8 @@ WebInspector.BreakpointManager = function(breakpointStorage, debuggerModel)
this._sourceFilesWithRestoredBreakpoints = {};
this._debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointResolved, this._breakpointResolved, this);
- this._debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this);
+ this._workspace.addEventListener(WebInspector.Workspace.Events.WorkspaceReset, this._workspaceReset, this);
+ this._workspace.addEventListener(WebInspector.UISourceCodeProvider.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this);
}
WebInspector.BreakpointManager.Events = {
@@ -76,6 +79,16 @@ WebInspector.BreakpointManager.prototype = {
},
/**
+ * @param {WebInspector.Event} event
+ */
+ _uiSourceCodeAdded: function(event)
+ {
+ var uiSourceCode = /** @type {WebInspector.UISourceCode} */ event.data;
+ if (uiSourceCode instanceof WebInspector.JavaScriptSource)
+ this.restoreBreakpoints(uiSourceCode);
+ },
+
+ /**
* @param {WebInspector.UISourceCode} uiSourceCode
* @param {number} lineNumber
* @param {string} condition
@@ -170,7 +183,7 @@ WebInspector.BreakpointManager.prototype = {
this._sourceFilesWithRestoredBreakpoints = {};
},
- _debuggerReset: function()
+ _workspaceReset: function()
{
var breakpoints = this._breakpoints.slice();
for (var i = 0; i < breakpoints.length; ++i) {
diff --git a/Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js b/Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js
index 3ac718f7c..0c2cf344b 100644
--- a/Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js
+++ b/Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js
@@ -248,59 +248,6 @@ WebInspector.JavaScriptBreakpointsSidebarPane.prototype.__proto__ = WebInspector
/**
* @constructor
- * @extends {WebInspector.SidebarPane}
- */
-WebInspector.NativeBreakpointsSidebarPane = function(title)
-{
- WebInspector.SidebarPane.call(this, title);
-
- this.listElement = document.createElement("ol");
- this.listElement.className = "breakpoint-list";
-
- this.emptyElement = document.createElement("div");
- this.emptyElement.className = "info";
- this.emptyElement.textContent = WebInspector.UIString("No Breakpoints");
-
- this.bodyElement.appendChild(this.emptyElement);
-}
-
-WebInspector.NativeBreakpointsSidebarPane.prototype = {
- _addListElement: function(element, beforeElement)
- {
- if (beforeElement)
- this.listElement.insertBefore(element, beforeElement);
- else {
- if (!this.listElement.firstChild) {
- this.bodyElement.removeChild(this.emptyElement);
- this.bodyElement.appendChild(this.listElement);
- }
- this.listElement.appendChild(element);
- }
- },
-
- _removeListElement: function(element)
- {
- this.listElement.removeChild(element);
- if (!this.listElement.firstChild) {
- this.bodyElement.removeChild(this.listElement);
- this.bodyElement.appendChild(this.emptyElement);
- }
- },
-
- _reset: function()
- {
- this.listElement.removeChildren();
- if (this.listElement.parentElement) {
- this.bodyElement.removeChild(this.listElement);
- this.bodyElement.appendChild(this.emptyElement);
- }
- }
-}
-
-WebInspector.NativeBreakpointsSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;
-
-/**
- * @constructor
* @extends {WebInspector.NativeBreakpointsSidebarPane}
*/
WebInspector.XHRBreakpointsSidebarPane = function()
diff --git a/Source/WebCore/inspector/front-end/CPUProfileView.js b/Source/WebCore/inspector/front-end/CPUProfileView.js
index 301532830..641553cd7 100644
--- a/Source/WebCore/inspector/front-end/CPUProfileView.js
+++ b/Source/WebCore/inspector/front-end/CPUProfileView.js
@@ -54,17 +54,18 @@ WebInspector.CPUProfileView = function(profile)
this.dataGrid.element.addEventListener("mousedown", this._mouseDownInDataGrid.bind(this), true);
this.dataGrid.show(this.element);
- this.viewSelectElement = document.createElement("select");
- this.viewSelectElement.className = "status-bar-item";
- this.viewSelectElement.addEventListener("change", this._changeView.bind(this), false);
+ this.viewSelectComboBox = new WebInspector.StatusBarComboBox(this._changeView.bind(this));
var heavyViewOption = document.createElement("option");
heavyViewOption.label = WebInspector.UIString("Heavy (Bottom Up)");
+ heavyViewOption.value = WebInspector.CPUProfileView._TypeHeavy;
var treeViewOption = document.createElement("option");
treeViewOption.label = WebInspector.UIString("Tree (Top Down)");
- this.viewSelectElement.appendChild(heavyViewOption);
- this.viewSelectElement.appendChild(treeViewOption);
- this.viewSelectElement.selectedIndex = this._viewType.get() === WebInspector.CPUProfileView._TypeHeavy ? 0 : 1;
+ treeViewOption.value = WebInspector.CPUProfileView._TypeTree;
+
+ this.viewSelectComboBox.addOption(heavyViewOption);
+ this.viewSelectComboBox.addOption(treeViewOption);
+ this.viewSelectComboBox.select(this._viewType.get() === WebInspector.CPUProfileView._TypeHeavy ? heavyViewOption : treeViewOption);
this.percentButton = new WebInspector.StatusBarButton("", "percent-time-status-bar-item");
this.percentButton.addEventListener("click", this._percentClicked, this);
@@ -109,7 +110,7 @@ WebInspector.CPUProfileView._TypeHeavy = "Heavy";
WebInspector.CPUProfileView.prototype = {
get statusBarItems()
{
- return [this.viewSelectElement, this.percentButton.element, this.focusButton.element, this.excludeButton.element, this.resetButton.element];
+ return [this.viewSelectComboBox.element, this.percentButton.element, this.focusButton.element, this.excludeButton.element, this.resetButton.element];
},
get bottomUpProfileDataGridTree()
@@ -385,11 +386,13 @@ WebInspector.CPUProfileView.prototype = {
if (!this.profile)
return;
- if (this.viewSelectElement.selectedIndex == 1) {
+ switch (this.viewSelectComboBox.selectedOption().value) {
+ case WebInspector.CPUProfileView._TypeTree:
this.profileDataGridTree = this.topDownProfileDataGridTree;
this._sortProfile();
this._viewType.set(WebInspector.CPUProfileView._TypeTree);
- } else if (this.viewSelectElement.selectedIndex == 0) {
+ break;
+ case WebInspector.CPUProfileView._TypeHeavy:
this.profileDataGridTree = this.bottomUpProfileDataGridTree;
this._sortProfile();
this._viewType.set(WebInspector.CPUProfileView._TypeHeavy);
@@ -647,8 +650,9 @@ WebInspector.CPUProfileHeader.prototype = {
/**
* @override
+ * @param {WebInspector.ProfilesPanel} profilesPanel
*/
- createView: function()
+ createView: function(profilesPanel)
{
return new WebInspector.CPUProfileView(this);
}
diff --git a/Source/WebCore/inspector/front-end/CSSSelectorProfileView.js b/Source/WebCore/inspector/front-end/CSSSelectorProfileView.js
index 6b9d00728..70993a2ea 100644
--- a/Source/WebCore/inspector/front-end/CSSSelectorProfileView.js
+++ b/Source/WebCore/inspector/front-end/CSSSelectorProfileView.js
@@ -286,15 +286,16 @@ WebInspector.CSSSelectorProfileType.prototype = {
/**
* @override
+ * @param {WebInspector.ProfilesPanel} profilesPanel
* @return {boolean}
*/
- buttonClicked: function()
+ buttonClicked: function(profilesPanel)
{
if (this._recording) {
- this._stopRecordingProfile();
+ this._stopRecordingProfile(profilesPanel);
return false;
} else {
- this._startRecordingProfile();
+ this._startRecordingProfile(profilesPanel);
return true;
}
},
@@ -319,14 +320,20 @@ WebInspector.CSSSelectorProfileType.prototype = {
this._recording = isProfiling;
},
- _startRecordingProfile: function()
+ /**
+ * @param {WebInspector.ProfilesPanel} profilesPanel
+ */
+ _startRecordingProfile: function(profilesPanel)
{
this._recording = true;
CSSAgent.startSelectorProfiler();
- WebInspector.panels.profiles.setRecordingProfile(WebInspector.CSSSelectorProfileType.TypeId, true);
+ profilesPanel.setRecordingProfile(WebInspector.CSSSelectorProfileType.TypeId, true);
},
- _stopRecordingProfile: function()
+ /**
+ * @param {WebInspector.ProfilesPanel} profilesPanel
+ */
+ _stopRecordingProfile: function(profilesPanel)
{
/**
* @param {?Protocol.Error} error
@@ -340,8 +347,8 @@ WebInspector.CSSSelectorProfileType.prototype = {
var uid = this._profileUid++;
var title = WebInspector.UIString("Profile %d", uid) + String.sprintf(" (%s)", Number.secondsToString(profile.totalTime / 1000));
var profileHeader = new WebInspector.CSSProfileHeader(this, title, uid, profile);
- WebInspector.panels.profiles.addProfileHeader(profileHeader);
- WebInspector.panels.profiles.setRecordingProfile(WebInspector.CSSSelectorProfileType.TypeId, false);
+ profilesPanel.addProfileHeader(profileHeader);
+ profilesPanel.setRecordingProfile(WebInspector.CSSSelectorProfileType.TypeId, false);
}
this._recording = false;
@@ -388,8 +395,9 @@ WebInspector.CSSProfileHeader.prototype = {
/**
* @override
+ * @param {WebInspector.ProfilesPanel} profilesPanel
*/
- createView: function()
+ createView: function(profilesPanel)
{
var profile = /** @type {CSSAgent.SelectorProfile} */this._protocolData;
return new WebInspector.CSSSelectorProfileView(profile);
diff --git a/Source/WebCore/inspector/front-end/CSSStyleModel.js b/Source/WebCore/inspector/front-end/CSSStyleModel.js
index 0af619f88..820695bf8 100644
--- a/Source/WebCore/inspector/front-end/CSSStyleModel.js
+++ b/Source/WebCore/inspector/front-end/CSSStyleModel.js
@@ -64,12 +64,11 @@ WebInspector.CSSStyleModel.Events = {
WebInspector.CSSStyleModel.prototype = {
/**
* @param {DOMAgent.NodeId} nodeId
- * @param {?Array.<string>|undefined} forcedPseudoClasses
* @param {boolean} needPseudo
* @param {boolean} needInherited
* @param {function(?*)} userCallback
*/
- getMatchedStylesAsync: function(nodeId, forcedPseudoClasses, needPseudo, needInherited, userCallback)
+ getMatchedStylesAsync: function(nodeId, needPseudo, needInherited, userCallback)
{
/**
* @param {function(?*)} userCallback
@@ -115,15 +114,14 @@ WebInspector.CSSStyleModel.prototype = {
userCallback(result);
}
- CSSAgent.getMatchedStylesForNode(nodeId, forcedPseudoClasses || [], needPseudo, needInherited, callback.bind(null, userCallback));
+ CSSAgent.getMatchedStylesForNode(nodeId, needPseudo, needInherited, callback.bind(null, userCallback));
},
/**
* @param {DOMAgent.NodeId} nodeId
- * @param {?Array.<string>|undefined} forcedPseudoClasses
* @param {function(?WebInspector.CSSStyleDeclaration)} userCallback
*/
- getComputedStyleAsync: function(nodeId, forcedPseudoClasses, userCallback)
+ getComputedStyleAsync: function(nodeId, userCallback)
{
/**
* @param {function(?WebInspector.CSSStyleDeclaration)} userCallback
@@ -136,7 +134,7 @@ WebInspector.CSSStyleModel.prototype = {
userCallback(WebInspector.CSSStyleDeclaration.parseComputedStylePayload(computedPayload));
}
- CSSAgent.getComputedStyleForNode(nodeId, forcedPseudoClasses || [], callback.bind(null, userCallback));
+ CSSAgent.getComputedStyleForNode(nodeId, callback.bind(null, userCallback));
},
/**
@@ -164,6 +162,16 @@ WebInspector.CSSStyleModel.prototype = {
/**
* @param {DOMAgent.NodeId} nodeId
+ * @param {?Array.<string>|undefined} forcedPseudoClasses
+ * @param {function()=} userCallback
+ */
+ forcePseudoState: function(nodeId, forcedPseudoClasses, userCallback)
+ {
+ CSSAgent.forcePseudoState(nodeId, forcedPseudoClasses || [], userCallback);
+ },
+
+ /**
+ * @param {DOMAgent.NodeId} nodeId
* @param {function(?Array.<WebInspector.NamedFlow>)} userCallback
*/
getNamedFlowCollectionAsync: function(nodeId, userCallback)
diff --git a/Source/WebCore/inspector/front-end/CodeMirrorTextEditor.js b/Source/WebCore/inspector/front-end/CodeMirrorTextEditor.js
index 88efd38ae..c9fded13b 100644
--- a/Source/WebCore/inspector/front-end/CodeMirrorTextEditor.js
+++ b/Source/WebCore/inspector/front-end/CodeMirrorTextEditor.js
@@ -28,6 +28,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+importScript("cm/codemirror.js");
+importScript("cm/css.js");
+importScript("cm/javascript.js");
+importScript("cm/xml.js");
+importScript("cm/htmlmixed.js");
+
/**
* @constructor
* @extends {WebInspector.View}
@@ -41,7 +47,6 @@ WebInspector.CodeMirrorTextEditor = function(url, delegate)
this._delegate = delegate;
this._url = url;
- this._loadLibraries();
this.registerRequiredCSS("codemirror.css");
this.registerRequiredCSS("cmdevtools.css");
@@ -49,6 +54,7 @@ WebInspector.CodeMirrorTextEditor = function(url, delegate)
lineNumbers: true,
fixedGutter: true,
onChange: this._onChange.bind(this),
+ onGutterClick: this._onGutterClick.bind(this)
});
this._lastRange = this.range();
@@ -114,20 +120,62 @@ WebInspector.CodeMirrorTextEditor.prototype = {
this._codeMirror.scrollTo(coords.x, coords.y);
},
+ _onGutterClick: function(instance, lineNumber, event)
+ {
+ this.dispatchEventToListeners(WebInspector.TextEditor.Events.GutterClick, { lineNumber: lineNumber, event: event });
+ },
+
+ /**
+ * @param {number} lineNumber
+ * @param {boolean} disabled
+ * @param {boolean} conditional
+ */
+ addBreakpoint: function(lineNumber, disabled, conditional)
+ {
+ var className = "cm-breakpoint" + (disabled ? " cm-breakpoint-disabled" : "") + (conditional ? " cm-breakpoint-conditional" : "");
+ this._codeMirror.setMarker(lineNumber, null, className);
+ },
+
/**
* @param {number} lineNumber
- * @param {string|Element} decoration
*/
- addDecoration: function(lineNumber, decoration)
+ removeBreakpoint: function(lineNumber)
{
+ this._codeMirror.clearMarker(lineNumber);
},
/**
* @param {number} lineNumber
- * @param {string|Element} decoration
*/
- removeDecoration: function(lineNumber, decoration)
+ setExecutionLine: function(lineNumber)
{
+ this._executionLine = this._codeMirror.getLineHandle(lineNumber)
+ this._codeMirror.setLineClass(this._executionLine, null, "cm-execution-line");
+ },
+
+ clearExecutionLine: function()
+ {
+ if (this._executionLine)
+ this._codeMirror.setLineClass(this._executionLine, null, null);
+ delete this._executionLine;
+ },
+
+ /**
+ * @param {number} lineNumber
+ * @param {Element} element
+ */
+ addDecoration: function(lineNumber, element)
+ {
+ // TODO implement so that it doesn't hide context code
+ },
+
+ /**
+ * @param {number} lineNumber
+ * @param {Element} element
+ */
+ removeDecoration: function(lineNumber, element)
+ {
+ // TODO implement so that it doesn't hide context code
},
/**
@@ -144,13 +192,21 @@ WebInspector.CodeMirrorTextEditor.prototype = {
*/
highlightLine: function(lineNumber)
{
- var line = this._codeMirror.getLine(lineNumber);
- var mark = this._codeMirror.markText({ line: lineNumber, ch: 0 }, { line: lineNumber, ch: line.length }, "CodeMirror-searching");
- setTimeout(mark.clear.bind(mark), 1000);
+ this.clearLineHighlight();
+ this._highlightedLine = this._codeMirror.getLineHandle(lineNumber);
+ this._codeMirror.setLineClass(this._highlightedLine, null, "cm-highlight");
+ this._clearHighlightTimeout = setTimeout(this.clearLineHighlight.bind(this), 2000);
},
clearLineHighlight: function()
{
+ if (this._clearHighlightTimeout)
+ clearTimeout(this._clearHighlightTimeout);
+ delete this._clearHighlightTimeout;
+
+ if (this._highlightedLine)
+ this._codeMirror.setLineClass(this._highlightedLine, null, null);
+ delete this._highlightedLine;
},
/**
@@ -180,22 +236,17 @@ WebInspector.CodeMirrorTextEditor.prototype = {
*/
editRange: function(range, text)
{
- this._delegate.beforeTextChanged();
-
var pos = this._toPos(range);
this._codeMirror.replaceRange(text, pos.start, pos.end);
var newRange = this._toRange(pos.start, this._codeMirror.posFromIndex(this._codeMirror.indexFromPos(pos.start) + text.length));
-
- this._delegate.afterTextChanged(range, newRange);
-
+ this._delegate.onTextChanged(range, newRange);
return newRange;
},
_onChange: function()
{
- this._delegate.beforeTextChanged();
var newRange = this.range();
- this._delegate.afterTextChanged(this._lastRange, newRange);
+ this._delegate.onTextChanged(this._lastRange, newRange);
this._lastRange = newRange;
},
@@ -312,7 +363,7 @@ WebInspector.CodeMirrorTextEditor.prototype = {
removeAttribute: function(line, name)
{
var handle = this._codeMirror.getLineHandle(line);
- if (handle.attributes)
+ if (handle && handle.attributes)
delete handle.attributes[name];
},
@@ -327,27 +378,6 @@ WebInspector.CodeMirrorTextEditor.prototype = {
_toRange: function(start, end)
{
return new WebInspector.TextRange(start.line, start.ch, end.line, end.ch);
- },
-
- _loadLibraries: function()
- {
- if (window.CodeMirror)
- return;
-
- function loadLibrary(file)
- {
- var xhr = new XMLHttpRequest();
- xhr.open("GET", file, false);
- xhr.send(null);
- console.log(xhr.responseText);
- window.eval(xhr.responseText);
- }
-
- loadLibrary("codemirror.js");
- loadLibrary("css.js");
- loadLibrary("javascript.js");
- loadLibrary("xml.js");
- loadLibrary("htmlmixed.js");
}
}
diff --git a/Source/WebCore/inspector/front-end/Color.js b/Source/WebCore/inspector/front-end/Color.js
index b5227503f..9500c636c 100644
--- a/Source/WebCore/inspector/front-end/Color.js
+++ b/Source/WebCore/inspector/front-end/Color.js
@@ -811,3 +811,14 @@ WebInspector.Color.PageHighlight = {
Margin: WebInspector.Color.fromRGBA(246, 178, 107, .66),
MarginLight: WebInspector.Color.fromRGBA(246, 178, 107, .5)
}
+
+WebInspector.Color.Format = {
+ Original: "original",
+ Nickname: "nickname",
+ HEX: "hex",
+ ShortHEX: "shorthex",
+ RGB: "rgb",
+ RGBA: "rgba",
+ HSL: "hsl",
+ HSLA: "hsla"
+}
diff --git a/Source/WebCore/inspector/front-end/ConsoleMessage.js b/Source/WebCore/inspector/front-end/ConsoleMessage.js
index 52a2ca8a6..95e217b80 100644
--- a/Source/WebCore/inspector/front-end/ConsoleMessage.js
+++ b/Source/WebCore/inspector/front-end/ConsoleMessage.js
@@ -42,10 +42,10 @@
* @param {number=} repeatCount
* @param {Array.<RuntimeAgent.RemoteObject>=} parameters
* @param {ConsoleAgent.StackTrace=} stackTrace
- * @param {WebInspector.NetworkRequest=} request
+ * @param {NetworkAgent.RequestId=} requestId
* @param {boolean=} isOutdated
*/
-WebInspector.ConsoleMessageImpl = function(source, level, message, linkifier, type, url, line, repeatCount, parameters, stackTrace, request, isOutdated)
+WebInspector.ConsoleMessageImpl = function(source, level, message, linkifier, type, url, line, repeatCount, parameters, stackTrace, requestId, isOutdated)
{
WebInspector.ConsoleMessage.call(this, source, level, url, line, repeatCount);
@@ -54,7 +54,7 @@ WebInspector.ConsoleMessageImpl = function(source, level, message, linkifier, ty
this._messageText = message;
this._parameters = parameters;
this._stackTrace = stackTrace;
- this._request = request;
+ this._request = requestId ? WebInspector.networkLog.requestForId(requestId) : null;
this._isOutdated = isOutdated;
this._customFormatters = {
@@ -715,7 +715,7 @@ WebInspector.ConsoleMessageImpl.prototype = {
*/
clone: function()
{
- return WebInspector.ConsoleMessage.create(this.source, this.level, this._messageText, this.type, this.url, this.line, this.repeatCount, this._parameters, this._stackTrace, this._request, this._isOutdated);
+ return WebInspector.ConsoleMessage.create(this.source, this.level, this._messageText, this.type, this.url, this.line, this.repeatCount, this._parameters, this._stackTrace, this._requestId, this._isOutdated);
}
}
diff --git a/Source/WebCore/inspector/front-end/ConsoleModel.js b/Source/WebCore/inspector/front-end/ConsoleModel.js
index 5be5a02c5..2e2abdd1a 100644
--- a/Source/WebCore/inspector/front-end/ConsoleModel.js
+++ b/Source/WebCore/inspector/front-end/ConsoleModel.js
@@ -202,11 +202,11 @@ WebInspector.ConsoleMessage.prototype = {
* @param {number=} repeatCount
* @param {Array.<RuntimeAgent.RemoteObject>=} parameters
* @param {ConsoleAgent.StackTrace=} stackTrace
- * @param {WebInspector.NetworkRequest=} request
+ * @param {NetworkAgent.RequestId=} requestId
* @param {boolean=} isOutdated
* @return {WebInspector.ConsoleMessage}
*/
-WebInspector.ConsoleMessage.create = function(source, level, message, type, url, line, repeatCount, parameters, stackTrace, request, isOutdated)
+WebInspector.ConsoleMessage.create = function(source, level, message, type, url, line, repeatCount, parameters, stackTrace, requestId, isOutdated)
{
}
@@ -267,7 +267,7 @@ WebInspector.ConsoleDispatcher.prototype = {
payload.repeatCount,
payload.parameters,
payload.stackTrace,
- payload.networkRequestId ? WebInspector.networkRequestById(payload.networkRequestId) : undefined,
+ payload.networkRequestId,
this._console._enablingConsole);
this._console.addMessage(consoleMessage);
},
diff --git a/Source/WebCore/inspector/front-end/ConsolePanel.js b/Source/WebCore/inspector/front-end/ConsolePanel.js
index b7af2a951..8012b19c1 100644
--- a/Source/WebCore/inspector/front-end/ConsolePanel.js
+++ b/Source/WebCore/inspector/front-end/ConsolePanel.js
@@ -40,11 +40,6 @@ WebInspector.ConsolePanel = function()
}
WebInspector.ConsolePanel.prototype = {
- get toolbarItemLabel()
- {
- return WebInspector.UIString("Console");
- },
-
get statusBarItems()
{
return this._view.statusBarItems;
diff --git a/Source/WebCore/inspector/front-end/ConsoleView.js b/Source/WebCore/inspector/front-end/ConsoleView.js
index a81cef191..70ef8e4f6 100644
--- a/Source/WebCore/inspector/front-end/ConsoleView.js
+++ b/Source/WebCore/inspector/front-end/ConsoleView.js
@@ -954,7 +954,7 @@ WebInspector.ConsoleGroup.prototype = {
*/
WebInspector.consoleView = null;
-WebInspector.ConsoleMessage.create = function(source, level, message, type, url, line, repeatCount, parameters, stackTrace, request, isOutdated)
+WebInspector.ConsoleMessage.create = function(source, level, message, type, url, line, repeatCount, parameters, stackTrace, requestId, isOutdated)
{
- return new WebInspector.ConsoleMessageImpl(source, level, message, WebInspector.consoleView._linkifier, type, url, line, repeatCount, parameters, stackTrace, request, isOutdated);
+ return new WebInspector.ConsoleMessageImpl(source, level, message, WebInspector.consoleView._linkifier, type, url, line, repeatCount, parameters, stackTrace, requestId, isOutdated);
}
diff --git a/Source/WebCore/inspector/front-end/DOMAgent.js b/Source/WebCore/inspector/front-end/DOMAgent.js
index 0bb07f94f..eedebe573 100644
--- a/Source/WebCore/inspector/front-end/DOMAgent.js
+++ b/Source/WebCore/inspector/front-end/DOMAgent.js
@@ -825,6 +825,14 @@ WebInspector.DOMAgent.prototype = {
},
/**
+ * @return {WebInspector.DOMDocument?}
+ */
+ existingDocument: function()
+ {
+ return this._document;
+ },
+
+ /**
* @param {RuntimeAgent.RemoteObjectId} objectId
* @param {function(?DOMAgent.NodeId)=} callback
*/
diff --git a/Source/WebCore/inspector/front-end/DOMStorage.js b/Source/WebCore/inspector/front-end/DOMStorage.js
index 0c966935c..cdb32f415 100644
--- a/Source/WebCore/inspector/front-end/DOMStorage.js
+++ b/Source/WebCore/inspector/front-end/DOMStorage.js
@@ -102,7 +102,7 @@ WebInspector.DOMStorageDispatcher.prototype = {
payload.id,
payload.origin,
payload.isLocalStorage);
- WebInspector.panels.resources.addDOMStorage(domStorage);
+ WebInspector.panel("resources").addDOMStorage(domStorage);
},
/**
@@ -110,6 +110,6 @@ WebInspector.DOMStorageDispatcher.prototype = {
*/
domStorageUpdated: function(storageId)
{
- WebInspector.panels.resources.domStorageUpdated(storageId);
+ WebInspector.panel("resources").domStorageUpdated(storageId);
}
}
diff --git a/Source/WebCore/inspector/front-end/Database.js b/Source/WebCore/inspector/front-end/Database.js
index 7fa41a978..6e94adb48 100644
--- a/Source/WebCore/inspector/front-end/Database.js
+++ b/Source/WebCore/inspector/front-end/Database.js
@@ -140,7 +140,7 @@ WebInspector.DatabaseDispatcher.prototype = {
payload.domain,
payload.name,
payload.version);
- WebInspector.panels.resources.addDatabase(database);
+ WebInspector.panel("resources").addDatabase(database);
},
/**
diff --git a/Source/WebCore/inspector/front-end/DebuggerModel.js b/Source/WebCore/inspector/front-end/DebuggerModel.js
index df95843ba..8c6c8e0a8 100644
--- a/Source/WebCore/inspector/front-end/DebuggerModel.js
+++ b/Source/WebCore/inspector/front-end/DebuggerModel.js
@@ -34,6 +34,8 @@
*/
WebInspector.DebuggerModel = function()
{
+ InspectorBackend.registerDebuggerDispatcher(new WebInspector.DebuggerDispatcher(this));
+
this._debuggerPausedDetails = null;
/**
* @type {Object.<string, WebInspector.Script>}
@@ -44,9 +46,20 @@ WebInspector.DebuggerModel = function()
this._canSetScriptSource = false;
this._breakpointsActive = true;
- InspectorBackend.registerDebuggerDispatcher(new WebInspector.DebuggerDispatcher(this));
+ WebInspector.settings.pauseOnExceptionStateString = WebInspector.settings.createSetting("pauseOnExceptionStateString", WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions);
+ WebInspector.settings.pauseOnExceptionStateString.addChangeListener(this._pauseOnExceptionStateChanged, this);
+
+ if (!Capabilities.debuggerCausesRecompilation || WebInspector.settings.debuggerEnabled.get())
+ this.enableDebugger();
}
+// Keep these in sync with WebCore::ScriptDebugServer
+WebInspector.DebuggerModel.PauseOnExceptionsState = {
+ DontPauseOnExceptions : "none",
+ PauseOnAllExceptions : "all",
+ PauseOnUncaughtExceptions: "uncaught"
+};
+
/**
* @constructor
* @implements {WebInspector.RawLocation}
@@ -85,8 +98,19 @@ WebInspector.DebuggerModel.BreakReason = {
}
WebInspector.DebuggerModel.prototype = {
+ /**
+ * @return {boolean}
+ */
+ debuggerEnabled: function()
+ {
+ return !!this._debuggerEnabled;
+ },
+
enableDebugger: function()
{
+ if (this._debuggerEnabled)
+ return;
+
function callback(error, result)
{
this._canSetScriptSource = result;
@@ -97,6 +121,9 @@ WebInspector.DebuggerModel.prototype = {
disableDebugger: function()
{
+ if (!this._debuggerEnabled)
+ return;
+
DebuggerAgent.disable(this._debuggerWasDisabled.bind(this));
},
@@ -110,11 +137,19 @@ WebInspector.DebuggerModel.prototype = {
_debuggerWasEnabled: function()
{
+ this._debuggerEnabled = true;
+ this._pauseOnExceptionStateChanged();
this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerWasEnabled);
},
+ _pauseOnExceptionStateChanged: function()
+ {
+ DebuggerAgent.setPauseOnExceptions(WebInspector.settings.pauseOnExceptionStateString.get());
+ },
+
_debuggerWasDisabled: function()
{
+ this._debuggerEnabled = false;
this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerWasDisabled);
},
diff --git a/Source/WebCore/inspector/front-end/DefaultTextEditor.js b/Source/WebCore/inspector/front-end/DefaultTextEditor.js
index d67b156a6..2196166ad 100644
--- a/Source/WebCore/inspector/front-end/DefaultTextEditor.js
+++ b/Source/WebCore/inspector/front-end/DefaultTextEditor.js
@@ -61,6 +61,8 @@ WebInspector.DefaultTextEditor = function(url, delegate)
this._mainPanel.element.addEventListener("scroll", this._handleScrollChanged.bind(this), false);
this._mainPanel._container.addEventListener("focus", this._handleFocused.bind(this), false);
+ this._gutterPanel.element.addEventListener("mousedown", this._onMouseDown.bind(this), true);
+
this.element.appendChild(this._mainPanel.element);
this.element.appendChild(this._gutterPanel.element);
@@ -135,24 +137,83 @@ WebInspector.DefaultTextEditor.prototype = {
this._mainPanel.revealLine(lineNumber);
},
+ _onMouseDown: function(event)
+ {
+ var target = event.target.enclosingNodeOrSelfWithClass("webkit-line-number");
+ if (!target)
+ return;
+ this.dispatchEventToListeners(WebInspector.TextEditor.Events.GutterClick, { lineNumber: target.lineNumber, event: event });
+ },
+
/**
* @param {number} lineNumber
- * @param {string|Element} decoration
+ * @param {boolean} disabled
+ * @param {boolean} conditional
*/
- addDecoration: function(lineNumber, decoration)
+ addBreakpoint: function(lineNumber, disabled, conditional)
{
- this._mainPanel.addDecoration(lineNumber, decoration);
- this._gutterPanel.addDecoration(lineNumber, decoration);
+ this.beginUpdates();
+ this._gutterPanel.addDecoration(lineNumber, "webkit-breakpoint");
+ if (disabled)
+ this._gutterPanel.addDecoration(lineNumber, "webkit-breakpoint-disabled");
+ else
+ this._gutterPanel.removeDecoration(lineNumber, "webkit-breakpoint-disabled");
+ if (conditional)
+ this._gutterPanel.addDecoration(lineNumber, "webkit-breakpoint-conditional");
+ else
+ this._gutterPanel.removeDecoration(lineNumber, "webkit-breakpoint-conditional");
+ this.endUpdates();
},
/**
* @param {number} lineNumber
- * @param {string|Element} decoration
*/
- removeDecoration: function(lineNumber, decoration)
+ removeBreakpoint: function(lineNumber)
{
- this._mainPanel.removeDecoration(lineNumber, decoration);
- this._gutterPanel.removeDecoration(lineNumber, decoration);
+ this.beginUpdates();
+ this._gutterPanel.removeDecoration(lineNumber, "webkit-breakpoint");
+ this._gutterPanel.removeDecoration(lineNumber, "webkit-breakpoint-disabled");
+ this._gutterPanel.removeDecoration(lineNumber, "webkit-breakpoint-conditional");
+ this.endUpdates();
+ },
+
+ /**
+ * @param {number} lineNumber
+ */
+ setExecutionLine: function(lineNumber)
+ {
+ this._executionLineNumber = lineNumber;
+ this._mainPanel.addDecoration(lineNumber, "webkit-execution-line");
+ this._gutterPanel.addDecoration(lineNumber, "webkit-execution-line");
+ },
+
+ clearExecutionLine: function()
+ {
+ if (typeof this._executionLineNumber === "number") {
+ this._mainPanel.removeDecoration(this._executionLineNumber, "webkit-execution-line");
+ this._gutterPanel.removeDecoration(this._executionLineNumber, "webkit-execution-line");
+ }
+ delete this._executionLineNumber;
+ },
+
+ /**
+ * @param {number} lineNumber
+ * @param {Element} element
+ */
+ addDecoration: function(lineNumber, element)
+ {
+ this._mainPanel.addDecoration(lineNumber, element);
+ this._gutterPanel.addDecoration(lineNumber, element);
+ },
+
+ /**
+ * @param {number} lineNumber
+ * @param {Element} element
+ */
+ removeDecoration: function(lineNumber, element)
+ {
+ this._mainPanel.removeDecoration(lineNumber, element);
+ this._gutterPanel.removeDecoration(lineNumber, element);
},
/**
@@ -251,7 +312,6 @@ WebInspector.DefaultTextEditor.prototype = {
_enterInternalTextChangeMode: function()
{
this._internalTextChangeMode = true;
- this._delegate.beforeTextChanged();
},
/**
@@ -261,7 +321,7 @@ WebInspector.DefaultTextEditor.prototype = {
_exitInternalTextChangeMode: function(oldRange, newRange)
{
this._internalTextChangeMode = false;
- this._delegate.afterTextChanged(oldRange, newRange);
+ this._delegate.onTextChanged(oldRange, newRange);
},
_updatePanelOffsets: function()
@@ -325,8 +385,6 @@ WebInspector.DefaultTextEditor.prototype = {
var modifiers = WebInspector.KeyboardShortcut.Modifiers;
this._shortcuts = {};
- var commitEditing = this._commitEditing.bind(this);
- this._shortcuts[WebInspector.KeyboardShortcut.makeKey("s", modifiers.CtrlOrMeta)] = commitEditing;
var handleEnterKey = this._mainPanel.handleEnterKey.bind(this._mainPanel);
this._shortcuts[WebInspector.KeyboardShortcut.makeKey(keys.Enter.code, WebInspector.KeyboardShortcut.Modifiers.None)] = handleEnterKey;
@@ -366,17 +424,6 @@ WebInspector.DefaultTextEditor.prototype = {
contextMenu.show(event);
},
- _commitEditing: function()
- {
- if (this.readOnly())
- return false;
-
- this._delegate.commitEditing();
- if (this._url && WebInspector.fileManager.isURLSaved(this._url))
- WebInspector.fileManager.save(this._url, this._textModel.text(), false);
- return true;
- },
-
_handleScrollChanged: function(event)
{
var visibleFrom = this._mainPanel.element.scrollTop;
diff --git a/Source/WebCore/inspector/front-end/ElementsPanel.js b/Source/WebCore/inspector/front-end/ElementsPanel.js
index 7f2f86be0..9746b985a 100644
--- a/Source/WebCore/inspector/front-end/ElementsPanel.js
+++ b/Source/WebCore/inspector/front-end/ElementsPanel.js
@@ -28,6 +28,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+importScript("EventListenersSidebarPane.js");
+importScript("MetricsSidebarPane.js");
+importScript("PropertiesSidebarPane.js");
+importScript("StylesSidebarPane.js");
+
/**
* @constructor
* @extends {WebInspector.Panel}
@@ -90,25 +95,20 @@ WebInspector.ElementsPanel = function()
this.sidebarPanes[pane].onattach();
}
- this.nodeSearchButton = new WebInspector.StatusBarButton(WebInspector.UIString("Select an element in the page to inspect it."), "node-search-status-bar-item");
- this.nodeSearchButton.addEventListener("click", this.toggleSearchingForNode, this);
-
this._registerShortcuts();
- this._popoverHelper = new WebInspector.PopoverHelper(document.body, this._getPopoverAnchor.bind(this), this._showPopover.bind(this));
+ this._popoverHelper = new WebInspector.PopoverHelper(this.element, this._getPopoverAnchor.bind(this), this._showPopover.bind(this));
this._popoverHelper.setTimeout(0);
WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.NodeRemoved, this._nodeRemoved, this);
- WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.DocumentUpdated, this._documentUpdated, this);
+ WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.DocumentUpdated, this._documentUpdatedEvent, this);
WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.InspectElementRequested, this._inspectElementRequested, this);
+
+ if (WebInspector.domAgent.existingDocument())
+ this._documentUpdated(WebInspector.domAgent.existingDocument());
}
WebInspector.ElementsPanel.prototype = {
- get toolbarItemLabel()
- {
- return WebInspector.UIString("Elements");
- },
-
get statusBarItems()
{
return [this.crumbsElement];
@@ -145,7 +145,6 @@ WebInspector.ElementsPanel.prototype = {
willHide: function()
{
WebInspector.domAgent.hideDOMNodeHighlight();
- this.setSearchingForNode(false);
this.treeOutline.setVisible(false);
this._popoverHelper.hidePopover();
@@ -177,22 +176,23 @@ WebInspector.ElementsPanel.prototype = {
if (!node)
return;
- var pseudoClasses = node.getUserProperty("pseudoState");
+ var pseudoClasses = node.getUserProperty(WebInspector.ElementsTreeOutline.PseudoStateDecorator.PropertyName);
if (enable) {
pseudoClasses = pseudoClasses || [];
if (pseudoClasses.indexOf(pseudoClass) >= 0)
return;
pseudoClasses.push(pseudoClass);
- node.setUserProperty("pseudoState", pseudoClasses);
+ node.setUserProperty(WebInspector.ElementsTreeOutline.PseudoStateDecorator.PropertyName, pseudoClasses);
} else {
if (!pseudoClasses || pseudoClasses.indexOf(pseudoClass) < 0)
return;
pseudoClasses.remove(pseudoClass);
if (!pseudoClasses.length)
- node.removeUserProperty("pseudoState");
+ node.removeUserProperty(WebInspector.ElementsTreeOutline.PseudoStateDecorator.PropertyName);
}
this.treeOutline.updateOpenCloseTags(node);
+ WebInspector.cssModel.forcePseudoState(node.id, node.getUserProperty(WebInspector.ElementsTreeOutline.PseudoStateDecorator.PropertyName));
this._metricsPaneEdited();
this._stylesPaneEdited();
},
@@ -211,6 +211,7 @@ WebInspector.ElementsPanel.prototype = {
ConsoleAgent.addInspectedNode(selectedNode.id);
this._lastValidSelectedNode = selectedNode;
}
+ WebInspector.notifications.dispatchEventToListeners(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged);
},
_updateSidebars: function()
@@ -229,10 +230,13 @@ WebInspector.ElementsPanel.prototype = {
delete this.currentQuery;
},
- _documentUpdated: function(event)
+ _documentUpdatedEvent: function(event)
{
- var inspectedRootDocument = event.data;
+ this._documentUpdated(event.data);
+ },
+ _documentUpdated: function(inspectedRootDocument)
+ {
this._reset();
this.searchCanceled();
@@ -426,70 +430,22 @@ WebInspector.ElementsPanel.prototype = {
*/
_showPopover: function(anchor, popover)
{
- var listItem = anchor.enclosingNodeOrSelfWithNodeNameInArray(["li"]);
+ var listItem = anchor.enclosingNodeOrSelfWithNodeName("li");
if (listItem && listItem.treeElement)
- this._loadDimensionsForNode(listItem.treeElement, dimensionsCallback);
+ this._loadDimensionsForNode(listItem.treeElement, WebInspector.buildImagePreviewContents.bind(WebInspector, anchor.href, true, showPopover));
else
- dimensionsCallback();
+ WebInspector.buildImagePreviewContents(anchor.href, true, showPopover);
/**
- * @param {Object=} dimensions
+ * @param {Element=} contents
*/
- function dimensionsCallback(dimensions)
+ function showPopover(contents)
{
- var imageElement = document.createElement("img");
- imageElement.addEventListener("load", showPopover.bind(null, imageElement, dimensions), false);
- var resource = WebInspector.resourceTreeModel.resourceForURL(anchor.href);
- if (!resource)
+ if (!contents)
return;
-
- resource.populateImageSource(imageElement);
- }
-
- /**
- * @param {Object=} dimensions
- */
- function showPopover(imageElement, dimensions)
- {
- var contents = buildPopoverContents(imageElement, dimensions);
popover.setCanShrink(false);
popover.show(contents, anchor);
}
-
- /**
- * @param {Object=} nodeDimensions
- */
- function buildPopoverContents(imageElement, nodeDimensions)
- {
- const maxImageWidth = 100;
- const maxImageHeight = 100;
- var container = document.createElement("table");
- container.className = "image-preview-container";
- var naturalWidth = nodeDimensions ? nodeDimensions.naturalWidth : imageElement.naturalWidth;
- var naturalHeight = nodeDimensions ? nodeDimensions.naturalHeight : imageElement.naturalHeight;
- var offsetWidth = nodeDimensions ? nodeDimensions.offsetWidth : naturalWidth;
- var offsetHeight = nodeDimensions ? nodeDimensions.offsetHeight : naturalHeight;
- var description;
- if (offsetHeight === naturalHeight && offsetWidth === naturalWidth)
- description = WebInspector.UIString("%d \xd7 %d pixels", offsetWidth, offsetHeight);
- else
- description = WebInspector.UIString("%d \xd7 %d pixels (Natural: %d \xd7 %d pixels)", offsetWidth, offsetHeight, naturalWidth, naturalHeight);
-
- if (naturalWidth > naturalHeight) {
- if (naturalWidth > maxImageWidth) {
- imageElement.style.width = maxImageWidth + "px";
- imageElement.style.height = (naturalHeight * maxImageWidth / naturalWidth) + "px";
- }
- } else {
- if (naturalHeight > maxImageHeight) {
- imageElement.style.width = (naturalWidth * maxImageHeight / naturalHeight) + "px";
- imageElement.style.height = maxImageHeight + "px";
- }
- }
- container.createChild("tr").createChild("td", "image-container").appendChild(imageElement);
- container.createChild("tr").createChild("td").createChild("span", "description").textContent = description;
- return container;
- }
},
jumpToNextSearchResult: function()
@@ -1072,22 +1028,6 @@ WebInspector.ElementsPanel.prototype = {
handleShortcut: function(event)
{
- // Cmd/Control + Shift + C should be a shortcut to clicking the Node Search Button.
- // This shortcut matches Firebug.
- if (event.keyIdentifier === "U+0043") { // C key
- if (WebInspector.isMac())
- var isNodeSearchKey = event.metaKey && !event.ctrlKey && !event.altKey && event.shiftKey;
- else
- var isNodeSearchKey = event.ctrlKey && !event.metaKey && !event.altKey && event.shiftKey;
-
- if (isNodeSearchKey) {
- this.toggleSearchingForNode();
- event.handled = true;
- return;
- }
- return;
- }
-
if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && !event.shiftKey && event.keyIdentifier === "U+005A") { // Z key
WebInspector.domAgent.undo(this._updateSidebars.bind(this));
event.handled = true;
@@ -1136,28 +1076,6 @@ WebInspector.ElementsPanel.prototype = {
WebInspector.domAgent.highlightDOMNodeForTwoSeconds(nodeId);
this.selectDOMNode(node, true);
- if (this.nodeSearchButton.toggled) {
- InspectorFrontendHost.bringToFront();
- this.nodeSearchButton.toggled = false;
- }
- },
-
- setSearchingForNode: function(enabled)
- {
- /**
- * @param {?Protocol.Error} error
- */
- function callback(error)
- {
- if (!error)
- this.nodeSearchButton.toggled = enabled;
- }
- WebInspector.domAgent.setInspectModeEnabled(enabled, callback.bind(this));
- },
-
- toggleSearchingForNode: function()
- {
- this.setSearchingForNode(!this.nodeSearchButton.toggled);
}
}
diff --git a/Source/WebCore/inspector/front-end/ElementsTreeOutline.js b/Source/WebCore/inspector/front-end/ElementsTreeOutline.js
index 341303103..18cab8ae4 100644
--- a/Source/WebCore/inspector/front-end/ElementsTreeOutline.js
+++ b/Source/WebCore/inspector/front-end/ElementsTreeOutline.js
@@ -1172,7 +1172,6 @@ WebInspector.ElementsTreeElement.prototype = {
const pseudoClasses = ["active", "hover", "focus", "visited"];
var node = this.representedObject;
var forcedPseudoState = (node ? node.getUserProperty("pseudoState") : null) || [];
- var elementsPanel = WebInspector.panels.elements;
for (var i = 0; i < pseudoClasses.length; ++i) {
var pseudoClassForced = forcedPseudoState.indexOf(pseudoClasses[i]) >= 0;
subMenu.appendCheckboxItem(":" + pseudoClasses[i], this.treeOutline._setPseudoClassCallback.bind(null, node.id, pseudoClasses[i], !pseudoClassForced), pseudoClassForced, false);
diff --git a/Source/WebCore/inspector/front-end/ExtensionPanel.js b/Source/WebCore/inspector/front-end/ExtensionPanel.js
index 1c696536d..46cdb117f 100644
--- a/Source/WebCore/inspector/front-end/ExtensionPanel.js
+++ b/Source/WebCore/inspector/front-end/ExtensionPanel.js
@@ -32,31 +32,18 @@
* @constructor
* @extends {WebInspector.Panel}
* @param {string} id
- * @param {string} label
* @param {string} pageURL
- * @param {string} iconURL
*/
-WebInspector.ExtensionPanel = function(id, label, pageURL, iconURL)
+WebInspector.ExtensionPanel = function(id, pageURL)
{
WebInspector.Panel.call(this, id);
this.setHideOnDetach();
- this._toolbarItemLabel = label;
this._statusBarItems = [];
-
- if (iconURL) {
- this._addStyleRule(".toolbar-item." + id + " .toolbar-icon", "background-image: url(" + iconURL + ");");
- this._addStyleRule(".toolbar-small .toolbar-item." + id + " .toolbar-icon", "background-position-x: -32px;");
- }
var extensionView = new WebInspector.ExtensionView(id, pageURL, "extension panel");
extensionView.show(this.element);
}
WebInspector.ExtensionPanel.prototype = {
- get toolbarItemLabel()
- {
- return this._toolbarItemLabel;
- },
-
defaultFocusedElement: function()
{
return this.sidebarTreeElement || this.element;
@@ -100,13 +87,6 @@ WebInspector.ExtensionPanel.prototype = {
{
WebInspector.extensionServer.notifySearchAction(this.name, WebInspector.extensionAPI.panels.SearchAction.PreviousSearchResult);
WebInspector.Panel.prototype.jumpToPreviousSearchResult.call(this);
- },
-
- _addStyleRule: function(selector, body)
- {
- var style = document.createElement("style");
- style.textContent = selector + " { " + body + " }";
- document.head.appendChild(style);
}
}
diff --git a/Source/WebCore/inspector/front-end/ExtensionServer.js b/Source/WebCore/inspector/front-end/ExtensionServer.js
index ce0157f9f..f9e763ab0 100644
--- a/Source/WebCore/inspector/front-end/ExtensionServer.js
+++ b/Source/WebCore/inspector/front-end/ExtensionServer.js
@@ -197,11 +197,10 @@ WebInspector.ExtensionServer.prototype = {
return this._status.E_EXISTS(id);
var page = this._expandResourcePath(port._extensionOrigin, message.page);
- var icon = this._expandResourcePath(port._extensionOrigin, message.icon)
- var panel = new WebInspector.ExtensionPanel(id, message.title, page, icon);
- this._clientObjects[id] = panel;
- WebInspector.panels[id] = panel;
- WebInspector.addPanel(panel);
+ var panelDescriptor = new WebInspector.PanelDescriptor(id, message.title, undefined, undefined, new WebInspector.ExtensionPanel(id, page));
+ panelDescriptor.setIconURL(this._expandResourcePath(port._extensionOrigin, message.icon));
+ this._clientObjects[id] = panelDescriptor.panel();
+ WebInspector.inspectorView.addPanel(panelDescriptor);
return this._status.OK();
},
@@ -233,7 +232,7 @@ WebInspector.ExtensionServer.prototype = {
_onCreateSidebarPane: function(message)
{
- var panel = WebInspector.panels[message.panel];
+ var panel = WebInspector.panel(message.panel);
if (!panel)
return this._status.E_NOTFOUND(message.panel);
if (!panel.sidebarElement || !panel.sidebarPanes)
@@ -532,10 +531,10 @@ WebInspector.ExtensionServer.prototype = {
_onAddAuditCategory: function(message, port)
{
var category = new WebInspector.ExtensionAuditCategory(port._extensionOrigin, message.id, message.displayName, message.resultCount);
- if (WebInspector.panels.audits.getCategory(category.id))
+ if (WebInspector.panel("audits").getCategory(category.id))
return this._status.E_EXISTS(category.id);
this._clientObjects[message.id] = category;
- WebInspector.panels.audits.addCategory(category);
+ WebInspector.panel("audits").addCategory(category);
},
_onAddAuditResult: function(message)
@@ -575,12 +574,10 @@ WebInspector.ExtensionServer.prototype = {
WebInspector.workspace,
WebInspector.UISourceCodeProvider.Events.UISourceCodeAdded,
this._notifyResourceAdded);
- if (WebInspector.panels.elements) {
- this._registerAutosubscriptionHandler(WebInspector.extensionAPI.Events.ElementsPanelObjectSelected,
- WebInspector.panels.elements.treeOutline,
- WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged,
- this._notifyElementsSelectionChanged);
- }
+ this._registerAutosubscriptionHandler(WebInspector.extensionAPI.Events.ElementsPanelObjectSelected,
+ WebInspector.notifications,
+ WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged,
+ this._notifyElementsSelectionChanged);
this._registerAutosubscriptionHandler(WebInspector.extensionAPI.Events.ResourceContentCommitted,
WebInspector.workspace,
WebInspector.Workspace.Events.UISourceCodeContentCommitted,
diff --git a/Source/WebCore/inspector/front-end/FileContentView.js b/Source/WebCore/inspector/front-end/FileContentView.js
index 98cf2661a..c074128ee 100644
--- a/Source/WebCore/inspector/front-end/FileContentView.js
+++ b/Source/WebCore/inspector/front-end/FileContentView.js
@@ -47,7 +47,7 @@ WebInspector.FileContentView.prototype = {
{
if (!this._innerView) {
if (this._file.isTextFile)
- this._innerView = new WebInspector.EmptyView(WebInspector.UIString("Loading..."));
+ this._innerView = new WebInspector.EmptyView("");
else
this._innerView = new WebInspector.EmptyView(WebInspector.UIString("Binary File"));
this.refresh();
diff --git a/Source/WebCore/inspector/front-end/FilteredItemSelectionDialog.js b/Source/WebCore/inspector/front-end/FilteredItemSelectionDialog.js
index 1d0a22fbe..f027765e4 100644
--- a/Source/WebCore/inspector/front-end/FilteredItemSelectionDialog.js
+++ b/Source/WebCore/inspector/front-end/FilteredItemSelectionDialog.js
@@ -622,11 +622,6 @@ WebInspector.OpenResourceDialog = function(panel, uiSourceCodeProvider)
this._uiSourceCodes.sort(compareFunction);
}
-WebInspector.OpenResourceDialog.createShortcut = function()
-{
- return WebInspector.KeyboardShortcut.makeDescriptor("o", WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta);
-}
-
WebInspector.OpenResourceDialog.prototype = {
/**
* @param {number} itemIndex
diff --git a/Source/WebCore/inspector/front-end/HandlerRegistry.js b/Source/WebCore/inspector/front-end/HandlerRegistry.js
index 3a7758756..e13f56d9c 100644
--- a/Source/WebCore/inspector/front-end/HandlerRegistry.js
+++ b/Source/WebCore/inspector/front-end/HandlerRegistry.js
@@ -127,6 +127,13 @@ WebInspector.HandlerRegistry.prototype = {
function save(forceSaveAs)
{
+ if (contentProvider instanceof WebInspector.UISourceCode) {
+ var uiSourceCode = /** @type {WebInspector.UISourceCode} */ contentProvider;
+ if (uiSourceCode.isDirty()) {
+ doSave(forceSaveAs, uiSourceCode.workingCopy());
+ return;
+ }
+ }
contentProvider.requestContent(doSave.bind(this, forceSaveAs));
}
diff --git a/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js b/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js
index 40b5e3057..3a22b8bac 100644
--- a/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js
+++ b/Source/WebCore/inspector/front-end/HeapSnapshotDataGrids.js
@@ -97,9 +97,11 @@ WebInspector.HeapSnapshotSortableDataGrid.prototype = {
},
/**
+ * @param {WebInspector.ProfilesPanel} profilesPanel
* @param {WebInspector.ContextMenu} contextMenu
+ * @param {Event} event
*/
- populateContextMenu: function(contextMenu, event)
+ populateContextMenu: function(profilesPanel, contextMenu, event)
{
var td = event.target.enclosingNodeOrSelfWithNodeName("td");
if (!td)
@@ -108,13 +110,13 @@ WebInspector.HeapSnapshotSortableDataGrid.prototype = {
if (node instanceof WebInspector.HeapSnapshotInstanceNode || node instanceof WebInspector.HeapSnapshotObjectNode) {
function revealInDominatorsView()
{
- WebInspector.panels.profiles.showObject(node.snapshotNodeId, "Dominators");
+ profilesPanel.showObject(node.snapshotNodeId, "Dominators");
}
contextMenu.appendItem(WebInspector.UIString("Reveal in Dominators View"), revealInDominatorsView.bind(this));
} else if (node instanceof WebInspector.HeapSnapshotDominatorObjectNode) {
function revealInSummaryView()
{
- WebInspector.panels.profiles.showObject(node.snapshotNodeId, "Summary");
+ profilesPanel.showObject(node.snapshotNodeId, "Summary");
}
contextMenu.appendItem(WebInspector.UIString("Reveal in Summary View"), revealInSummaryView.bind(this));
}
diff --git a/Source/WebCore/inspector/front-end/HeapSnapshotView.js b/Source/WebCore/inspector/front-end/HeapSnapshotView.js
index 5c4df23f2..a26a6592a 100644
--- a/Source/WebCore/inspector/front-end/HeapSnapshotView.js
+++ b/Source/WebCore/inspector/front-end/HeapSnapshotView.js
@@ -31,6 +31,7 @@
/**
* @constructor
* @extends {WebInspector.View}
+ * @param {WebInspector.ProfilesPanel} parent
*/
WebInspector.HeapSnapshotView = function(parent, profile)
{
@@ -407,7 +408,7 @@ WebInspector.HeapSnapshotView.prototype = {
_profiles: function()
{
- return WebInspector.panels.profiles.getProfiles(WebInspector.HeapSnapshotProfileType.TypeId);
+ return this.parent.getProfiles(WebInspector.HeapSnapshotProfileType.TypeId);
},
processLoadedSnapshot: function(profile, snapshot)
@@ -420,10 +421,11 @@ WebInspector.HeapSnapshotView.prototype = {
/**
* @param {WebInspector.ContextMenu} contextMenu
+ * @param {Event} event
*/
populateContextMenu: function(contextMenu, event)
{
- this.dataGrid.populateContextMenu(contextMenu, event);
+ this.dataGrid.populateContextMenu(this.parent, contextMenu, event);
},
_selectionChanged: function(event)
@@ -720,8 +722,6 @@ WebInspector.HeapSnapshotView.prototype = {
WebInspector.HeapSnapshotView.prototype.__proto__ = WebInspector.View.prototype;
-WebInspector.settings.showHeapSnapshotObjectsHiddenProperties = WebInspector.settings.createSetting("showHeaSnapshotObjectsHiddenProperties", false);
-
/**
* @constructor
* @extends {WebInspector.ProfileType}
@@ -741,11 +741,12 @@ WebInspector.HeapSnapshotProfileType.prototype = {
/**
* @override
+ * @param {WebInspector.ProfilesPanel} profilesPanel
* @return {boolean}
*/
- buttonClicked: function()
+ buttonClicked: function(profilesPanel)
{
- WebInspector.panels.profiles.takeHeapSnapshot();
+ profilesPanel.takeHeapSnapshot();
return false;
},
@@ -846,10 +847,11 @@ WebInspector.HeapProfileHeader.prototype = {
/**
* @override
+ * @param {WebInspector.ProfilesPanel} profilesPanel
*/
- createView: function()
+ createView: function(profilesPanel)
{
- return new WebInspector.HeapSnapshotView(WebInspector.panels.profiles, this);
+ return new WebInspector.HeapSnapshotView(profilesPanel, this);
},
snapshotProxy: function()
diff --git a/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js b/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js
index 7ef847980..90a254ab5 100644
--- a/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js
+++ b/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js
@@ -33,46 +33,45 @@ InspectorFrontendAPI = {
isDebuggingEnabled: function()
{
- return WebInspector.panels.scripts.debuggingEnabled;
+ return WebInspector.debuggerModel.debuggerEnabled();
},
setDebuggingEnabled: function(enabled)
{
if (enabled) {
- WebInspector.panels.scripts.enableDebugging();
- WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.scripts);
+ WebInspector.debuggerModel.enableDebugger();
+ WebInspector.showPanel("scripts");
} else
- WebInspector.panels.scripts.disableDebugging();
+ WebInspector.debuggerModel.disableDebugger();
},
isTimelineProfilingEnabled: function()
{
- return WebInspector.panels.timeline.timelineProfilingEnabled;
+ return WebInspector.panels.timeline && WebInspector.panels.timeline.timelineProfilingEnabled;
},
setTimelineProfilingEnabled: function(enabled)
{
- WebInspector.panels.timeline.setTimelineProfilingEnabled(enabled);
+ WebInspector.panel("timeline").setTimelineProfilingEnabled(enabled);
},
isProfilingJavaScript: function()
{
- return WebInspector.CPUProfileType.instance && WebInspector.CPUProfileType.instance.isRecordingProfile();
+ return WebInspector.panels.profiles && WebInspector.CPUProfileType.instance && WebInspector.CPUProfileType.instance.isRecordingProfile();
},
startProfilingJavaScript: function()
{
- WebInspector.panels.profiles.enableProfiler();
- WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.profiles);
+ WebInspector.showPanel("profiles").enableProfiler();
if (WebInspector.CPUProfileType.instance)
WebInspector.CPUProfileType.instance.startRecordingProfile();
},
stopProfilingJavaScript: function()
{
+ WebInspector.showPanel("profiles");
if (WebInspector.CPUProfileType.instance)
WebInspector.CPUProfileType.instance.stopRecordingProfile();
- WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.profiles);
},
setAttachedWindow: function(attached)
@@ -82,7 +81,7 @@ InspectorFrontendAPI = {
showConsole: function()
{
- WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.console);
+ WebInspector.showPanel("console");
},
showMainResourceForFrame: function(frameId)
@@ -92,7 +91,7 @@ InspectorFrontendAPI = {
showResources: function()
{
- WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.resources);
+ WebInspector.showPanel("resources");
},
setDockingUnavailable: function(unavailable)
@@ -102,7 +101,7 @@ InspectorFrontendAPI = {
enterInspectElementMode: function()
{
- WebInspector.toggleSearchingForNode();
+ WebInspector.panel("elements").toggleSearchingForNode();
},
savedURL: function(url)
@@ -120,9 +119,14 @@ InspectorFrontendAPI = {
WebInspector.setToolbarColors(backgroundColor, color);
},
+ evaluateForTest: function(callId, script)
+ {
+ WebInspector.evaluateForTestInFrontend(callId, script);
+ },
+
dispatch: function(signature)
{
- if (WebInspector.panels) {
+ if (InspectorFrontendAPI._isLoaded) {
var methodName = signature.shift();
return InspectorFrontendAPI[methodName].apply(InspectorFrontendAPI, signature);
}
@@ -131,8 +135,20 @@ InspectorFrontendAPI = {
loadCompleted: function()
{
+ InspectorFrontendAPI._isLoaded = true;
for (var i = 0; i < InspectorFrontendAPI._pendingCommands.length; ++i)
InspectorFrontendAPI.dispatch(InspectorFrontendAPI._pendingCommands[i]);
InspectorFrontendAPI._pendingCommands = [];
+ if (window.opener)
+ window.opener.postMessage(["loadCompleted"], "*");
+ }
+}
+
+if (window.opener) {
+ function onMessageFromOpener(event)
+ {
+ if (event.source === window.opener)
+ InspectorFrontendAPI.dispatch(event.data);
}
+ window.addEventListener("message", onMessageFromOpener, true);
}
diff --git a/Source/WebCore/inspector/front-end/InspectorView.js b/Source/WebCore/inspector/front-end/InspectorView.js
index c6601c7f1..d49b04e33 100644
--- a/Source/WebCore/inspector/front-end/InspectorView.js
+++ b/Source/WebCore/inspector/front-end/InspectorView.js
@@ -43,6 +43,7 @@ WebInspector.InspectorView = function()
document.addEventListener("keydown", this._keyDown.bind(this), false);
document.addEventListener("keypress", this._keyPress.bind(this), false);
this._panelOrder = [];
+ this._panelDescriptors = {};
// Windows and Mac have two different definitions of '[' and ']', so accept both of each.
this._openBracketIdentifiers = ["U+005B", "U+00DB"].keySet();
@@ -52,14 +53,42 @@ WebInspector.InspectorView = function()
}
WebInspector.InspectorView.Events = {
- PanelSelected: "panel-selected"
+ PanelSelected: "PanelSelected"
}
WebInspector.InspectorView.prototype = {
- addPanel: function(panel)
+ /**
+ * @param {WebInspector.PanelDescriptor} panelDescriptor
+ */
+ addPanel: function(panelDescriptor)
+ {
+ this._panelOrder.push(panelDescriptor.name());
+ this._panelDescriptors[panelDescriptor.name()] = panelDescriptor;
+ WebInspector.toolbar.addPanel(panelDescriptor);
+ },
+
+ /**
+ * @param {string} panelName
+ * @return {?WebInspector.Panel}
+ */
+ panel: function(panelName)
+ {
+ var panelDescriptor = this._panelDescriptors[panelName];
+ if (!panelDescriptor && this._panelOrder.length)
+ panelDescriptor = this._panelDescriptors[this._panelOrder[0]];
+ return panelDescriptor ? panelDescriptor.panel() : null;
+ },
+
+ /**
+ * @param {string} panelName
+ * @return {?WebInspector.Panel}
+ */
+ showPanel: function(panelName)
{
- this._panelOrder.push(panel);
- WebInspector.toolbar.addPanel(panel);
+ var panel = this.panel(panelName);
+ if (panel)
+ this.setCurrentPanel(panel);
+ return panel;
},
currentPanel: function()
@@ -116,9 +145,9 @@ WebInspector.InspectorView.prototype = {
if (this._openBracketIdentifiers.hasOwnProperty(event.keyIdentifier)) {
var isRotateLeft = WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && !event.shiftKey && !event.altKey;
if (isRotateLeft) {
- var index = this._panelOrder.indexOf(this.currentPanel());
+ var index = this._panelOrder.indexOf(this.currentPanel().name);
index = (index === 0) ? this._panelOrder.length - 1 : index - 1;
- this._panelOrder[index].toolbarItem.click();
+ this.showPanel(this._panelOrder[index]);
event.consume(true);
return;
}
@@ -134,9 +163,9 @@ WebInspector.InspectorView.prototype = {
if (this._closeBracketIdentifiers.hasOwnProperty(event.keyIdentifier)) {
var isRotateRight = WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && !event.shiftKey && !event.altKey;
if (isRotateRight) {
- var index = this._panelOrder.indexOf(this.currentPanel());
+ var index = this._panelOrder.indexOf(this.currentPanel().name);
index = (index + 1) % this._panelOrder.length;
- this._panelOrder[index].toolbarItem.click();
+ this.showPanel(this._panelOrder[index]);
event.consume(true);
return;
}
diff --git a/Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js b/Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js
index 7c0ae8cd4..ae12bae61 100644
--- a/Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js
+++ b/Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js
@@ -49,9 +49,10 @@ WebInspector.JavaScriptSourceFrame = function(scriptsPanel, javaScriptSource)
this._popoverHelper = new WebInspector.ObjectPopoverHelper(this.textEditor.element,
this._getPopoverAnchor.bind(this), this._resolveObjectForPopover.bind(this), this._onHidePopover.bind(this), true);
- this.textEditor.element.addEventListener("mousedown", this._onMouseDown.bind(this), true);
this.textEditor.element.addEventListener("keydown", this._onKeyDown.bind(this), true);
+ this.textEditor.addEventListener(WebInspector.TextEditor.Events.GutterClick, this._handleGutterClick.bind(this), this);
+
this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.BreakpointAdded, this._breakpointAdded, this);
this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.BreakpointRemoved, this._breakpointRemoved, this);
@@ -92,6 +93,7 @@ WebInspector.JavaScriptSourceFrame.prototype = {
this._isCommittingEditing = true;
this._javaScriptSource.commitWorkingCopy(this._didEditContent.bind(this));
+ delete this._isCommittingEditing;
},
/**
@@ -147,23 +149,16 @@ WebInspector.JavaScriptSourceFrame.prototype = {
contextMenu.appendApplicableItems(this._javaScriptSource);
},
- afterTextChanged: function(oldRange, newRange)
+ onTextChanged: function(oldRange, newRange)
{
- WebInspector.SourceFrame.prototype.afterTextChanged.call(this, oldRange, newRange);
+ WebInspector.SourceFrame.prototype.onTextChanged.call(this, oldRange, newRange);
+ this._removeBreakpointsBeforeEditing();
this._javaScriptSource.setWorkingCopy(this._textEditor.text());
this._restoreBreakpointsAfterEditing();
},
- beforeTextChanged: function()
- {
- WebInspector.SourceFrame.prototype.beforeTextChanged.call(this);
- this._removeBreakpointsBeforeEditing();
- },
-
_didEditContent: function(error)
{
- delete this._isCommittingEditing;
-
if (error) {
WebInspector.log(error, WebInspector.ConsoleMessage.MessageLevel.Error, true);
return;
@@ -174,15 +169,22 @@ WebInspector.JavaScriptSourceFrame.prototype = {
_removeBreakpointsBeforeEditing: function()
{
- if (!this._javaScriptSource.isDirty() || this._javaScriptSource.supportsEnabledBreakpointsWhileEditing()) {
+ var supportsBreakpointsOnEdit = this._javaScriptSource.supportsEnabledBreakpointsWhileEditing();
+ if (!this._javaScriptSource.isDirty() || supportsBreakpointsOnEdit) {
// Disable all breakpoints in the model, store them as muted breakpoints.
var breakpointLocations = this._breakpointManager.breakpointLocationsForUISourceCode(this._javaScriptSource);
var lineNumbers = {};
+ this._preserveDecorations = true;
for (var i = 0; i < breakpointLocations.length; ++i) {
var breakpoint = breakpointLocations[i].breakpoint;
breakpointLocations[i].breakpoint.remove();
- // Re-adding decoration only.
- this._addBreakpointDecoration(breakpointLocations[i].uiLocation.lineNumber, breakpoint.condition(), breakpoint.enabled(), true);
+ }
+ delete this._preserveDecorations;
+
+ for (var lineNumber = 0; lineNumber < this._textEditor.linesCount; ++lineNumber) {
+ var breakpointDecoration = this._textEditor.getAttribute(lineNumber, "breakpoint");
+ if (breakpointDecoration)
+ this._addBreakpointDecoration(lineNumber, breakpointDecoration.condition, breakpointDecoration.enabled, !supportsBreakpointsOnEdit);
}
this.clearExecutionLine();
}
@@ -335,43 +337,16 @@ WebInspector.JavaScriptSourceFrame.prototype = {
};
this.textEditor.setAttribute(lineNumber, "breakpoint", breakpoint);
- this.textEditor.beginUpdates();
- this.textEditor.addDecoration(lineNumber, "webkit-breakpoint");
- if (!enabled || (mutedWhileEditing && !this._javaScriptSource.supportsEnabledBreakpointsWhileEditing()))
- this.textEditor.addDecoration(lineNumber, "webkit-breakpoint-disabled");
- else
- this.textEditor.removeDecoration(lineNumber, "webkit-breakpoint-disabled");
- if (!!condition)
- this.textEditor.addDecoration(lineNumber, "webkit-breakpoint-conditional");
- else
- this.textEditor.removeDecoration(lineNumber, "webkit-breakpoint-conditional");
- this.textEditor.endUpdates();
+ var disabled = !enabled || (mutedWhileEditing && !this._javaScriptSource.supportsEnabledBreakpointsWhileEditing());
+ this.textEditor.addBreakpoint(lineNumber, disabled, !!condition);
},
_removeBreakpointDecoration: function(lineNumber)
{
- this.textEditor.removeAttribute(lineNumber, "breakpoint");
- this.textEditor.beginUpdates();
- this.textEditor.removeDecoration(lineNumber, "webkit-breakpoint");
- this.textEditor.removeDecoration(lineNumber, "webkit-breakpoint-disabled");
- this.textEditor.removeDecoration(lineNumber, "webkit-breakpoint-conditional");
- this.textEditor.endUpdates();
- },
-
- _onMouseDown: function(event)
- {
- if (this._javaScriptSource.isDirty() && !this._javaScriptSource.supportsEnabledBreakpointsWhileEditing())
- return;
-
- if (event.button != 0 || event.altKey || event.ctrlKey || event.metaKey)
+ if (this._preserveDecorations)
return;
- var target = event.target.enclosingNodeOrSelfWithClass("webkit-line-number");
- if (!target)
- return;
- var lineNumber = target.lineNumber;
-
- this._toggleBreakpoint(lineNumber, event.shiftKey);
- event.preventDefault();
+ this.textEditor.removeAttribute(lineNumber, "breakpoint");
+ this.textEditor.removeBreakpoint(lineNumber);
},
_onKeyDown: function(event)
@@ -438,7 +413,7 @@ WebInspector.JavaScriptSourceFrame.prototype = {
{
this._executionLineNumber = lineNumber;
if (this.loaded) {
- this.textEditor.addDecoration(lineNumber, "webkit-execution-line");
+ this.textEditor.setExecutionLine(lineNumber);
this.revealLine(this._executionLineNumber);
if (this.canEditSource())
this.setSelection(WebInspector.TextRange.createFromLocation(lineNumber, 0));
@@ -448,7 +423,7 @@ WebInspector.JavaScriptSourceFrame.prototype = {
clearExecutionLine: function()
{
if (this.loaded && typeof this._executionLineNumber === "number")
- this.textEditor.removeDecoration(this._executionLineNumber, "webkit-execution-line");
+ this.textEditor.clearExecutionLine();
delete this._executionLineNumber;
},
@@ -535,6 +510,24 @@ WebInspector.JavaScriptSourceFrame.prototype = {
},
/**
+ * @param {Event} event
+ */
+ _handleGutterClick: function(event)
+ {
+ if (this._javaScriptSource.isDirty() && !this._javaScriptSource.supportsEnabledBreakpointsWhileEditing())
+ return;
+
+ var lineNumber = event.data.lineNumber;
+ var eventObject = /** @type {Event} */ event.data.event;
+
+ if (eventObject.button != 0 || eventObject.altKey || eventObject.ctrlKey || eventObject.metaKey)
+ return;
+
+ this._toggleBreakpoint(lineNumber, eventObject.shiftKey);
+ eventObject.consume(true);
+ },
+
+ /**
* @param {number} lineNumber
* @param {boolean} onlyDisable
*/
diff --git a/Source/WebCore/inspector/front-end/MetricsSidebarPane.js b/Source/WebCore/inspector/front-end/MetricsSidebarPane.js
index fd952ac39..b1d8ab36e 100644
--- a/Source/WebCore/inspector/front-end/MetricsSidebarPane.js
+++ b/Source/WebCore/inspector/front-end/MetricsSidebarPane.js
@@ -72,7 +72,7 @@ WebInspector.MetricsSidebarPane.prototype = {
return;
this._updateMetrics(style);
}
- WebInspector.cssModel.getComputedStyleAsync(node.id, WebInspector.panels.elements.sidebarPanes.styles.forcedPseudoClasses, callback.bind(this));
+ WebInspector.cssModel.getComputedStyleAsync(node.id, callback.bind(this));
function inlineStyleCallback(style)
{
diff --git a/Source/WebCore/inspector/front-end/NativeBreakpointsSidebarPane.js b/Source/WebCore/inspector/front-end/NativeBreakpointsSidebarPane.js
new file mode 100644
index 000000000..e6154745a
--- /dev/null
+++ b/Source/WebCore/inspector/front-end/NativeBreakpointsSidebarPane.js
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @constructor
+ * @extends {WebInspector.SidebarPane}
+ */
+WebInspector.NativeBreakpointsSidebarPane = function(title)
+{
+ WebInspector.SidebarPane.call(this, title);
+
+ this.listElement = document.createElement("ol");
+ this.listElement.className = "breakpoint-list";
+
+ this.emptyElement = document.createElement("div");
+ this.emptyElement.className = "info";
+ this.emptyElement.textContent = WebInspector.UIString("No Breakpoints");
+
+ this.bodyElement.appendChild(this.emptyElement);
+}
+
+WebInspector.NativeBreakpointsSidebarPane.prototype = {
+ _addListElement: function(element, beforeElement)
+ {
+ if (beforeElement)
+ this.listElement.insertBefore(element, beforeElement);
+ else {
+ if (!this.listElement.firstChild) {
+ this.bodyElement.removeChild(this.emptyElement);
+ this.bodyElement.appendChild(this.listElement);
+ }
+ this.listElement.appendChild(element);
+ }
+ },
+
+ _removeListElement: function(element)
+ {
+ this.listElement.removeChild(element);
+ if (!this.listElement.firstChild) {
+ this.bodyElement.removeChild(this.listElement);
+ this.bodyElement.appendChild(this.emptyElement);
+ }
+ },
+
+ _reset: function()
+ {
+ this.listElement.removeChildren();
+ if (this.listElement.parentElement) {
+ this.bodyElement.removeChild(this.listElement);
+ this.bodyElement.appendChild(this.emptyElement);
+ }
+ }
+}
+
+WebInspector.NativeBreakpointsSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;
diff --git a/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js b/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js
index b4dd51d50..1b0ce1e06 100644
--- a/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js
+++ b/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js
@@ -82,11 +82,11 @@ WebInspector.NativeMemoryProfileType.prototype = {
/**
* @override
+ * @param {WebInspector.ProfilesPanel} profilesPanel
* @return {boolean}
*/
- buttonClicked: function()
+ buttonClicked: function(profilesPanel)
{
- var profilesPanel = WebInspector.panels.profiles;
var profileHeader = new WebInspector.NativeMemoryProfileHeader(this, WebInspector.UIString("Snapshot %d", this._nextProfileUid), this._nextProfileUid);
++this._nextProfileUid;
profileHeader.isTemporary = true;
@@ -178,8 +178,9 @@ WebInspector.NativeMemoryProfileHeader.prototype = {
/**
* @override
+ * @param {WebInspector.ProfilesPanel} profilesPanel
*/
- createView: function()
+ createView: function(profilesPanel)
{
return new WebInspector.NativeMemorySnapshotView(this);
}
diff --git a/Source/WebCore/inspector/front-end/NetworkLog.js b/Source/WebCore/inspector/front-end/NetworkLog.js
index 8bf6422ce..9a4b2c7bb 100644
--- a/Source/WebCore/inspector/front-end/NetworkLog.js
+++ b/Source/WebCore/inspector/front-end/NetworkLog.js
@@ -34,6 +34,7 @@
WebInspector.NetworkLog = function()
{
this._requests = [];
+ this._requestForId = {};
WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestStarted, this._onRequestStarted, this);
WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._onMainFrameNavigated, this);
WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.OnLoad, this._onLoad, this);
@@ -85,6 +86,7 @@ WebInspector.NetworkLog.prototype = {
{
var request = /** @type {WebInspector.NetworkRequest} */ event.data;
this._requests.push(request);
+ this._requestForId[request.requestId] = request;
request.__page = this._currentPageLoad;
},
@@ -104,6 +106,15 @@ WebInspector.NetworkLog.prototype = {
{
if (this._currentPageLoad)
this._currentPageLoad.loadTime = event.data;
+ },
+
+ /**
+ * @param {NetworkAgent.RequestId} requestId
+ * @return {?WebInspector.NetworkRequest}
+ */
+ requestForId: function(requestId)
+ {
+ return this._requestForId[requestId];
}
}
diff --git a/Source/WebCore/inspector/front-end/NetworkManager.js b/Source/WebCore/inspector/front-end/NetworkManager.js
index ecf6a5986..ddfd953e4 100644
--- a/Source/WebCore/inspector/front-end/NetworkManager.js
+++ b/Source/WebCore/inspector/front-end/NetworkManager.js
@@ -197,7 +197,7 @@ WebInspector.NetworkDispatcher.prototype = {
1,
[],
null,
- networkRequest));
+ networkRequest.requestId));
}
},
diff --git a/Source/WebCore/inspector/front-end/NetworkPanel.js b/Source/WebCore/inspector/front-end/NetworkPanel.js
index 2efc1dadf..697fd0d24 100644
--- a/Source/WebCore/inspector/front-end/NetworkPanel.js
+++ b/Source/WebCore/inspector/front-end/NetworkPanel.js
@@ -28,6 +28,20 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+importScript("RequestView.js");
+importScript("ResourceView.js");
+importScript("FontView.js");
+importScript("ImageView.js");
+importScript("NetworkItemView.js");
+importScript("RequestCookiesView.js");
+importScript("RequestHeadersView.js");
+importScript("RequestHTMLView.js");
+importScript("RequestJSONView.js");
+importScript("RequestPreviewView.js");
+importScript("RequestResponseView.js");
+importScript("RequestTimingView.js");
+importScript("ResourceWebSocketFrameView.js");
+
/**
* @constructor
* @extends {WebInspector.View}
@@ -48,6 +62,8 @@ WebInspector.NetworkLogView = function()
this._mainRequestDOMContentTime = -1;
this._hiddenCategories = {};
this._matchedRequests = [];
+ this._filteredOutRequests = new Map();
+
this._matchedRequestsMap = {};
this._currentMatchedRequestIndex = -1;
@@ -75,6 +91,8 @@ WebInspector.NetworkLogView = function()
this._canClearBrowserCookies = result;
}
NetworkAgent.canClearBrowserCookies(onCanClearBrowserCookies.bind(this));
+
+ WebInspector.networkLog.requests.forEach(this._appendRequest.bind(this));
}
WebInspector.NetworkLogView.prototype = {
@@ -384,7 +402,7 @@ WebInspector.NetworkLogView.prototype = {
var request = this._requests[i];
var requestTransferSize = (request.cached || !request.transferSize) ? 0 : request.transferSize;
transferSize += requestTransferSize;
- if (!this._hiddenCategories.all || !this._hiddenCategories[request.type.name()]) {
+ if ((!this._hiddenCategories.all || !this._hiddenCategories[request.type.name()]) && !this._filteredOutRequests.get(request)) {
selectedRequestsNumber++;
selectedTransferSize += requestTransferSize;
}
@@ -394,7 +412,7 @@ WebInspector.NetworkLogView.prototype = {
maxTime = request.endTime;
}
var text = "";
- if (this._hiddenCategories.all) {
+ if (selectedRequestsNumber !== requestsNumber) {
text += String.sprintf(WebInspector.UIString("%d / %d requests"), selectedRequestsNumber, requestsNumber);
text += " \u2758 " + String.sprintf(WebInspector.UIString("%s / %s transferred"), Number.bytesToString(selectedTransferSize), Number.bytesToString(transferSize));
} else {
@@ -1067,7 +1085,7 @@ WebInspector.NetworkLogView.prototype = {
{
this._matchedRequests = [];
this._matchedRequestsMap = {};
- this._highlightNthMatchedRequest(-1, false);
+ this._removeAllHighlights();
},
_updateSearchMatchedListAfterRequestIdChanged: function(oldRequestId, newRequestId)
@@ -1091,37 +1109,57 @@ WebInspector.NetworkLogView.prototype = {
if (this._currentMatchedRequestIndex !== -1 && this._currentMatchedRequestIndex !== matchedRequestIndex)
return;
- this._highlightNthMatchedRequest(matchedRequestIndex, false);
+ this._highlightNthMatchedRequestForSearch(matchedRequestIndex, false);
},
- _highlightNthMatchedRequest: function(matchedRequestIndex, reveal)
+ _removeAllHighlights: function()
{
if (this._highlightedSubstringChanges) {
- WebInspector.revertDomChanges(this._highlightedSubstringChanges);
+ for (var i = 0; i < this._highlightedSubstringChanges.length; ++i)
+ WebInspector.revertDomChanges(this._highlightedSubstringChanges[i]);
this._highlightedSubstringChanges = null;
}
-
- if (matchedRequestIndex === -1) {
- this._currentMatchedRequestIndex = matchedRequestIndex;
- return;
+ },
+
+ /**
+ * @param {Array.<WebInspector.NetworkRequest>} requests
+ * @param {boolean} reveal
+ * @param {RegExp=} regExp
+ */
+ _highlightMatchedRequests: function(requests, reveal, regExp)
+ {
+ this._highlightedSubstringChanges = [];
+ for (var i = 0; i < requests.length; ++i) {
+ var request = requests[i];
+ var node = this._requestGridNode(request);
+ if (node) {
+ var nameMatched = request.displayName && request.displayName.match(regExp);
+ var pathMatched = request.parsedURL.path && request.folder.match(regExp);
+ if (!nameMatched && pathMatched && !this._largerRequestsButton.toggled)
+ this._toggleLargerRequests();
+ var highlightedSubstringChanges = node._highlightMatchedSubstring(regExp);
+ this._highlightedSubstringChanges.push(highlightedSubstringChanges);
+ if (reveal)
+ node.reveal();
+ }
}
+ },
- var request = this._requestsById[this._matchedRequests[matchedRequestIndex]];
+ /**
+ * @param {number} matchedRequestIndex
+ * @param {boolean} reveal
+ */
+ _highlightNthMatchedRequestForSearch: function(matchedRequestIndex, reveal)
+ {
+ var request = this.requestById(this._matchedRequests[matchedRequestIndex]);
if (!request)
return;
-
- var nameMatched = request.displayName && request.displayName.match(this._searchRegExp);
- var pathMatched = request.parsedURL.path && request.folder.match(this._searchRegExp);
- if (!nameMatched && pathMatched && !this._largerRequestsButton.toggled)
- this._toggleLargerRequests();
-
+ this._removeAllHighlights();
+ this._highlightMatchedRequests([request], reveal, this._searchRegExp);
var node = this._requestGridNode(request);
- if (node) {
- this._highlightedSubstringChanges = node._highlightMatchedSubstring(this._searchRegExp);
- if (reveal)
- node.reveal();
+ if (node)
this._currentMatchedRequestIndex = matchedRequestIndex;
- }
+
this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.SearchIndexUpdated, this._currentMatchedRequestIndex);
},
@@ -1133,7 +1171,6 @@ WebInspector.NetworkLogView.prototype = {
currentMatchedRequestId = this._matchedRequests[this._currentMatchedRequestIndex];
this._searchRegExp = createPlainTextSearchRegex(searchQuery, "i");
-
this._clearSearchMatchedList();
var childNodes = this._dataGrid.dataTableBody.childNodes;
@@ -1143,27 +1180,51 @@ WebInspector.NetworkLogView.prototype = {
var dataGridNode = this._dataGrid.dataGridNodeFromNode(requestNodes[i]);
if (dataGridNode.isFilteredOut())
continue;
-
if (this._matchRequest(dataGridNode._request) !== -1 && dataGridNode._request.requestId === currentMatchedRequestId)
newMatchedRequestIndex = this._matchedRequests.length - 1;
}
this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.SearchCountUpdated, this._matchedRequests.length);
- this._highlightNthMatchedRequest(newMatchedRequestIndex, false);
+ this._highlightNthMatchedRequestForSearch(newMatchedRequestIndex, false);
},
+ /**
+ * @param {string} query
+ */
+ performFilter: function(query) {
+ this._filteredOutRequests.clear();
+ var filterRegExp = createPlainTextSearchRegex(query, "i");
+ var shownRequests = [];
+ for (var i = 0; i < this._dataGrid.rootNode().children.length; ++i) {
+ var node = this._dataGrid.rootNode().children[i];
+ node.element.removeStyleClass("filtered-out");
+ var nameMatched = node._request.displayName && node._request.displayName.match(filterRegExp);
+ var pathMatched = node._request.parsedURL.path && node._request.folder.match(filterRegExp);
+ if (!nameMatched && !pathMatched) {
+ node.element.addStyleClass("filtered-out");
+ this._filteredOutRequests.put(this._requests[i], true);
+ } else
+ shownRequests.push(node._request);
+ }
+ this._removeAllHighlights();
+ if (query)
+ this._highlightMatchedRequests(shownRequests, false, filterRegExp);
+ this._updateSummaryBar();
+ this._updateOffscreenRows();
+ },
+
jumpToPreviousSearchResult: function()
{
if (!this._matchedRequests.length)
return;
- this._highlightNthMatchedRequest((this._currentMatchedRequestIndex + this._matchedRequests.length - 1) % this._matchedRequests.length, true);
+ this._highlightNthMatchedRequestForSearch((this._currentMatchedRequestIndex + this._matchedRequests.length - 1) % this._matchedRequests.length, true);
},
jumpToNextSearchResult: function()
{
if (!this._matchedRequests.length)
return;
- this._highlightNthMatchedRequest((this._currentMatchedRequestIndex + 1) % this._matchedRequests.length, true);
+ this._highlightNthMatchedRequestForSearch((this._currentMatchedRequestIndex + 1) % this._matchedRequests.length, true);
},
searchCanceled: function()
@@ -1251,11 +1312,6 @@ WebInspector.NetworkPanel = function()
}
WebInspector.NetworkPanel.prototype = {
- get toolbarItemLabel()
- {
- return WebInspector.UIString("Network");
- },
-
get statusBarItems()
{
return this._networkLogView.statusBarItems;
@@ -1405,11 +1461,21 @@ WebInspector.NetworkPanel.prototype = {
this._networkLogView.switchToBriefView();
},
+ /**
+ * @param {string} searchQuery
+ */
performSearch: function(searchQuery)
{
this._networkLogView.performSearch(searchQuery);
},
-
+
+ /**
+ * @param {string} query
+ */
+ performFilter: function(query){
+ this._networkLogView.performFilter(query);
+ },
+
jumpToPreviousSearchResult: function()
{
this._networkLogView.jumpToPreviousSearchResult();
@@ -1722,6 +1788,8 @@ WebInspector.NetworkDataGridNode.prototype = {
isFilteredOut: function()
{
+ if (this._parentView._filteredOutRequests.get(this._request))
+ return true;
if (!this._parentView._hiddenCategories.all)
return false;
return this._request.type.name() in this._parentView._hiddenCategories;
@@ -1736,8 +1804,9 @@ WebInspector.NetworkDataGridNode.prototype = {
_highlightMatchedSubstring: function(regexp)
{
var domChanges = [];
- var matchInfo = this._nameCell.textContent.match(regexp);
- WebInspector.highlightSearchResult(this._nameCell, matchInfo.index, matchInfo[0].length, domChanges);
+ var matchInfo = this._element.textContent.match(regexp);
+ if (matchInfo)
+ WebInspector.highlightSearchResult(this._nameCell, matchInfo.index, matchInfo[0].length, domChanges);
return domChanges;
},
diff --git a/Source/WebCore/inspector/front-end/ObjectPropertiesSection.js b/Source/WebCore/inspector/front-end/ObjectPropertiesSection.js
index 1adad3de2..ea3b44853 100644
--- a/Source/WebCore/inspector/front-end/ObjectPropertiesSection.js
+++ b/Source/WebCore/inspector/front-end/ObjectPropertiesSection.js
@@ -316,7 +316,7 @@ WebInspector.ObjectPropertyTreeElement.prototype = {
console.error(error);
return;
}
- WebInspector.panels.scripts.showFunctionDefinition(response.location);
+ WebInspector.panel("scripts").showFunctionDefinition(response.location);
}
function revealFunction()
diff --git a/Source/WebCore/inspector/front-end/Panel.js b/Source/WebCore/inspector/front-end/Panel.js
index f65f5ea30..e0f965b07 100644
--- a/Source/WebCore/inspector/front-end/Panel.js
+++ b/Source/WebCore/inspector/front-end/Panel.js
@@ -33,6 +33,7 @@
WebInspector.Panel = function(name)
{
WebInspector.View.call(this);
+ WebInspector.panels[name] = this;
this.element.addStyleClass("panel");
this.element.addStyleClass(name);
@@ -47,15 +48,6 @@ WebInspector.Panel = function(name)
WebInspector.Panel.counterRightMargin = 25;
WebInspector.Panel.prototype = {
- get toolbarItem()
- {
- if (this._toolbarItem)
- return this._toolbarItem;
-
- this._toolbarItem = WebInspector.Toolbar.createPanelToolbarItem(this);
- return this._toolbarItem;
- },
-
get name()
{
return this._panelName;
@@ -76,9 +68,6 @@ WebInspector.Panel.prototype = {
document.getElementById("panel-status-bar").appendChild(this._statusBarItemContainer);
}
- if ("_toolbarItem" in this)
- this._toolbarItem.addStyleClass("toggled-on");
-
this.focus();
},
@@ -87,8 +76,6 @@ WebInspector.Panel.prototype = {
if (this._statusBarItemContainer && this._statusBarItemContainer.parentNode)
this._statusBarItemContainer.parentNode.removeChild(this._statusBarItemContainer);
delete this._statusBarItemContainer;
- if ("_toolbarItem" in this)
- this._toolbarItem.removeStyleClass("toggled-on");
},
reset: function()
@@ -193,10 +180,6 @@ WebInspector.Panel.prototype = {
// Should be implemented by ancestors.
- get toolbarItemLabel()
- {
- },
-
get statusBarItems()
{
},
@@ -252,3 +235,67 @@ WebInspector.Panel.prototype = {
}
WebInspector.Panel.prototype.__proto__ = WebInspector.View.prototype;
+
+/**
+ * @constructor
+ * @param {string} name
+ * @param {string} title
+ * @param {string=} className
+ * @param {string=} scriptName
+ * @param {WebInspector.Panel=} panel
+ */
+WebInspector.PanelDescriptor = function(name, title, className, scriptName, panel)
+{
+ this._name = name;
+ this._title = title;
+ this._className = className;
+ this._scriptName = scriptName;
+ this._panel = panel;
+}
+
+WebInspector.PanelDescriptor.prototype = {
+ /**
+ * @return {string}
+ */
+ name: function()
+ {
+ return this._name;
+ },
+
+ /**
+ * @return {string}
+ */
+ title: function()
+ {
+ return this._title;
+ },
+
+ /**
+ * @return {string}
+ */
+ iconURL: function()
+ {
+ return this._iconURL;
+ },
+
+ /**
+ * @param {string} iconURL
+ */
+ setIconURL: function(iconURL)
+ {
+ this._iconURL = iconURL;
+ },
+
+ /**
+ * @return {WebInspector.Panel}
+ */
+ panel: function()
+ {
+ if (this._panel)
+ return this._panel;
+ if (this._scriptName)
+ importScript(this._scriptName);
+ this._panel = new WebInspector[this._className];
+ return this._panel;
+ }
+}
diff --git a/Source/WebCore/inspector/front-end/ProfilesPanel.js b/Source/WebCore/inspector/front-end/ProfilesPanel.js
index 8f1b6cfd0..785bbb1e4 100644
--- a/Source/WebCore/inspector/front-end/ProfilesPanel.js
+++ b/Source/WebCore/inspector/front-end/ProfilesPanel.js
@@ -38,8 +38,6 @@ WebInspector.ProfileType = function(id, name)
this.treeElement = null;
}
-WebInspector.ProfileType.URLRegExp = /webkit-profile:\/\/(.+)\/(.+)#([0-9]+)/;
-
WebInspector.ProfileType.prototype = {
get buttonTooltip()
{
@@ -62,9 +60,10 @@ WebInspector.ProfileType.prototype = {
},
/**
+ * @param {WebInspector.ProfilesPanel} profilesPanel
* @return {boolean}
*/
- buttonClicked: function()
+ buttonClicked: function(profilesPanel)
{
return false;
},
@@ -98,14 +97,6 @@ WebInspector.ProfileType.prototype = {
}
}
-WebInspector.registerLinkifierPlugin(function(title)
-{
- var profileStringMatches = WebInspector.ProfileType.URLRegExp.exec(title);
- if (profileStringMatches)
- title = WebInspector.panels.profiles.displayTitleForProfileLink(profileStringMatches[2], profileStringMatches[1]);
- return title;
-});
-
/**
* @constructor
* @param {WebInspector.ProfileType} profileType
@@ -149,11 +140,14 @@ WebInspector.ProfileHeader.prototype = {
view: function()
{
if (!this._view)
- this._view = this.createView();
+ this._view = this.createView(WebInspector.ProfilesPanel._instance);
return this._view;
},
- createView: function()
+ /**
+ * @param {WebInspector.ProfilesPanel} profilesPanel
+ */
+ createView: function(profilesPanel)
{
throw new Error("Not implemented.");
},
@@ -193,6 +187,7 @@ WebInspector.ProfileHeader.prototype = {
WebInspector.ProfilesPanel = function()
{
WebInspector.Panel.call(this, "profiles");
+ WebInspector.ProfilesPanel._instance = this;
this.registerRequiredCSS("panelEnablerView.css");
this.registerRequiredCSS("heapProfiler.css");
this.registerRequiredCSS("profilesPanel.css");
@@ -214,20 +209,25 @@ WebInspector.ProfilesPanel = function()
this.profileViews.id = "profile-views";
this.splitView.mainElement.appendChild(this.profileViews);
- this.enableToggleButton = new WebInspector.StatusBarButton("", "enable-toggle-status-bar-item");
- this.enableToggleButton.addEventListener("click", this._toggleProfiling, this);
- if (!Capabilities.profilerCausesRecompilation)
- this.enableToggleButton.element.addStyleClass("hidden");
+ this._statusBarButtons = [];
+ this.enableToggleButton = new WebInspector.StatusBarButton("", "enable-toggle-status-bar-item");
+ if (Capabilities.profilerCausesRecompilation) {
+ this._statusBarButtons.push(this.enableToggleButton);
+ this.enableToggleButton.addEventListener("click", this._toggleProfiling, this);
+ }
this.recordButton = new WebInspector.StatusBarButton("", "record-profile-status-bar-item");
this.recordButton.addEventListener("click", this.toggleRecordButton, this);
+ this._statusBarButtons.push(this.recordButton);
this.clearResultsButton = new WebInspector.StatusBarButton(WebInspector.UIString("Clear all profiles."), "clear-status-bar-item");
this.clearResultsButton.addEventListener("click", this._clearProfiles, this);
+ this._statusBarButtons.push(this.clearResultsButton);
if (WebInspector.experimentsSettings.liveNativeMemoryChart.isEnabled()) {
this.garbageCollectButton = new WebInspector.StatusBarButton(WebInspector.UIString("Collect Garbage"), "garbage-collect-status-bar-item");
this.garbageCollectButton.addEventListener("click", this._garbageCollectButtonClicked, this);
+ this._statusBarButtons.push(this.garbageCollectButton);
}
this.profileViewStatusBarItemsContainer = document.createElement("div");
@@ -250,9 +250,6 @@ WebInspector.ProfilesPanel = function()
InspectorBackend.registerProfilerDispatcher(new WebInspector.ProfilerDispatcher(this));
- if (!Capabilities.profilerCausesRecompilation || WebInspector.settings.profilerEnabled.get())
- ProfilerAgent.enable(this._profilerWasEnabled.bind(this));
-
this._createFileSelectorElement();
this.element.addEventListener("contextmenu", this._handleContextMenuEvent.bind(this), true);
@@ -289,22 +286,14 @@ WebInspector.ProfilesPanel.prototype = {
this._createFileSelectorElement();
},
- get toolbarItemLabel()
- {
- return WebInspector.UIString("Profiles");
- },
-
get statusBarItems()
{
- var statusBarItems = [this.enableToggleButton.element, this.recordButton.element, this.clearResultsButton.element, this.profileViewStatusBarItemsContainer];
- if (WebInspector.experimentsSettings.liveNativeMemoryChart.isEnabled())
- statusBarItems.splice(3, 0, this.garbageCollectButton.element);
- return statusBarItems;
+ return this._statusBarButtons.select("element").concat([this.profileViewStatusBarItemsContainer]);
},
toggleRecordButton: function()
{
- var isProfiling = this._selectedProfileType.buttonClicked();
+ var isProfiling = this._selectedProfileType.buttonClicked(this);
this.recordButton.toggled = isProfiling;
this.recordButton.title = this._selectedProfileType.buttonTooltip;
if (isProfiling)
@@ -703,7 +692,7 @@ WebInspector.ProfilesPanel.prototype = {
*/
showProfileForURL: function(url)
{
- var match = url.match(WebInspector.ProfileType.URLRegExp);
+ var match = url.match(WebInspector.ProfileURLRegExp);
if (!match)
return;
this.showProfile(this._profilesIdMap[this._makeKey(Number(match[3]), match[1])]);
@@ -1023,9 +1012,13 @@ WebInspector.ProfilesPanel.prototype = {
sidebarResized: function(event)
{
- var width = event.data;
- // Min width = <number of buttons on the left> * 31
- this.profileViewStatusBarItemsContainer.style.left = Math.max(5 * 31, width) + "px";
+ this.onResize();
+ },
+
+ onResize: function()
+ {
+ var minFloatingStatusBarItemsOffset = document.getElementById("panel-status-bar").totalOffsetLeft() + this._statusBarButtons.length * WebInspector.StatusBarButton.width;
+ this.profileViewStatusBarItemsContainer.style.left = Math.max(minFloatingStatusBarItemsOffset, this.splitView.sidebarWidth()) + "px";
},
/**
@@ -1103,14 +1096,14 @@ WebInspector.RevealInHeapSnapshotContextMenuProvider.prototype = {
*/
populateContextMenu: function(section, contextMenu)
{
- if (WebInspector.inspectorView.currentPanel() !== WebInspector.panels.profiles)
+ if (WebInspector.inspectorView.currentPanel() !== WebInspector.ProfilesPanel._instance)
return;
var objectId = section.object.objectId;
if (!objectId)
return;
- var heapProfiles = WebInspector.panels.profiles.getProfiles(WebInspector.HeapSnapshotProfileType.TypeId);
+ var heapProfiles = WebInspector.ProfilesPanel._instance.getProfiles(WebInspector.HeapSnapshotProfileType.TypeId);
if (!heapProfiles.length)
return;
@@ -1121,10 +1114,10 @@ WebInspector.RevealInHeapSnapshotContextMenuProvider.prototype = {
function didReceiveHeapObjectId(viewName, error, result)
{
- if (WebInspector.inspectorView.currentPanel() !== WebInspector.panels.profiles)
+ if (WebInspector.inspectorView.currentPanel() !== WebInspector.ProfilesPanel._instance)
return;
if (!error)
- WebInspector.panels.profiles.showObject(result, viewName);
+ WebInspector.ProfilesPanel._instance.showObject(result, viewName);
}
contextMenu.appendItem(WebInspector.UIString("Reveal in Dominators View"), revealInView.bind(this, "Dominators"));
@@ -1264,7 +1257,9 @@ WebInspector.ProfileSidebarTreeElement.prototype = {
var contextMenu = new WebInspector.ContextMenu();
if (profile.canSaveToFile())
contextMenu.appendItem(WebInspector.UIString("Save profile\u2026"), profile.saveToFile.bind(profile));
- contextMenu.appendItem(WebInspector.UIString("Load profile\u2026"), WebInspector.panels.profiles._fileSelectorElement.click.bind(WebInspector.panels.profiles._fileSelectorElement));
+ // FIXME: use context menu provider
+ var profilesPanel = WebInspector.ProfilesPanel._instance;
+ contextMenu.appendItem(WebInspector.UIString("Load profile\u2026"), profilesPanel._fileSelectorElement.click.bind(profilesPanel._fileSelectorElement));
contextMenu.appendItem(WebInspector.UIString("Delete profile"), this.ondelete.bind(this));
contextMenu.show(event);
}
@@ -1287,7 +1282,7 @@ WebInspector.ProfileGroupSidebarTreeElement.prototype = {
onselect: function()
{
if (this.children.length > 0)
- WebInspector.panels.profiles.showProfile(this.children[this.children.length - 1].profile);
+ WebInspector.ProfilesPanel._instance.showProfile(this.children[this.children.length - 1].profile);
}
}
@@ -1318,3 +1313,18 @@ WebInspector.ProfilesSidebarTreeElement.prototype = {
}
WebInspector.ProfilesSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
+
+importScript("ProfileDataGridTree.js");
+importScript("BottomUpProfileDataGridTree.js");
+importScript("CPUProfileView.js");
+importScript("CSSSelectorProfileView.js");
+importScript("HeapSnapshot.js");
+importScript("HeapSnapshotDataGrids.js");
+importScript("HeapSnapshotGridNodes.js");
+importScript("HeapSnapshotLoader.js");
+importScript("HeapSnapshotProxy.js");
+importScript("HeapSnapshotView.js");
+importScript("HeapSnapshotWorkerDispatcher.js");
+importScript("NativeMemorySnapshotView.js");
+importScript("ProfileLauncherView.js");
+importScript("TopDownProfileDataGridTree.js");
diff --git a/Source/WebCore/inspector/front-end/ResourceTreeModel.js b/Source/WebCore/inspector/front-end/ResourceTreeModel.js
index 36165714d..ca25c959f 100644
--- a/Source/WebCore/inspector/front-end/ResourceTreeModel.js
+++ b/Source/WebCore/inspector/front-end/ResourceTreeModel.js
@@ -89,6 +89,11 @@ WebInspector.ResourceTreeModel.prototype = {
this._cachedResourcesProcessed = true;
},
+ cachedResourcesLoaded: function()
+ {
+ return this._cachedResourcesProcessed;
+ },
+
_dispatchInspectedURLChanged: function()
{
InspectorFrontendHost.inspectedURLChanged(WebInspector.inspectedPageURL);
diff --git a/Source/WebCore/inspector/front-end/ResourcesPanel.js b/Source/WebCore/inspector/front-end/ResourcesPanel.js
index 85d3c2226..22aebced5 100644
--- a/Source/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/Source/WebCore/inspector/front-end/ResourcesPanel.js
@@ -27,6 +27,15 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+importScript("ApplicationCacheItemsView.js");
+importScript("DOMStorageItemsView.js");
+importScript("DatabaseQueryView.js");
+importScript("DatabaseTableView.js");
+importScript("DirectoryContentView.js");
+importScript("IndexedDBViews.js");
+importScript("FileContentView.js");
+importScript("FileSystemView.js");
+
/**
* @constructor
* @extends {WebInspector.Panel}
@@ -96,14 +105,11 @@ WebInspector.ResourcesPanel = function(database)
WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.OnLoad, this._onLoadEventFired, this);
WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded, this._cachedResourcesLoaded, this);
WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.WillLoadCachedResources, this._resetWithFrames, this);
+ if (WebInspector.resourceTreeModel.cachedResourcesLoaded())
+ this._cachedResourcesLoaded();
}
WebInspector.ResourcesPanel.prototype = {
- get toolbarItemLabel()
- {
- return WebInspector.UIString("Resources");
- },
-
get statusBarItems()
{
return [this.storageViewStatusBarItemsContainer];
diff --git a/Source/WebCore/inspector/front-end/ScriptSnippetModel.js b/Source/WebCore/inspector/front-end/ScriptSnippetModel.js
index 77426ab9d..392448dfa 100644
--- a/Source/WebCore/inspector/front-end/ScriptSnippetModel.js
+++ b/Source/WebCore/inspector/front-end/ScriptSnippetModel.js
@@ -199,9 +199,7 @@ WebInspector.ScriptSnippetModel.prototype = {
var consoleMessage = WebInspector.ConsoleMessage.create(
WebInspector.ConsoleMessage.MessageSource.JS,
WebInspector.ConsoleMessage.MessageLevel.Error,
- syntaxErrorMessage || "",
- WebInspector.ConsoleMessage.MessageType.Log,
- "", 0, 1, null, null, null);
+ syntaxErrorMessage || "");
WebInspector.console.addMessage(consoleMessage);
return;
}
@@ -364,7 +362,8 @@ WebInspector.ScriptSnippetModel.prototype = {
var removedUISourceCodes = this._releasedUISourceCodes();
this._uiSourceCodeForScriptId = {};
this._scriptForUISourceCode = new Map();
- this._loadSnippets();
+ this._snippetJavaScriptSourceForSnippetId = {};
+ setTimeout(this._loadSnippets.bind(this), 0);
}
}
@@ -548,35 +547,3 @@ WebInspector.SnippetContentProvider.prototype.__proto__ = WebInspector.StaticCon
* @type {?WebInspector.ScriptSnippetModel}
*/
WebInspector.scriptSnippetModel = null;
-
-/**
- * @constructor
- * @extends {WebInspector.JavaScriptSourceFrame}
- * @param {WebInspector.ScriptsPanel} scriptsPanel
- * @param {WebInspector.SnippetJavaScriptSource} snippetJavaScriptSource
- */
-WebInspector.SnippetJavaScriptSourceFrame = function(scriptsPanel, snippetJavaScriptSource)
-{
- WebInspector.JavaScriptSourceFrame.call(this, scriptsPanel, snippetJavaScriptSource);
-
- this._snippetJavaScriptSource = snippetJavaScriptSource;
- this._runButton = new WebInspector.StatusBarButton(WebInspector.UIString("Run"), "evaluate-snippet-status-bar-item");
- this._runButton.addEventListener("click", this._runButtonClicked, this);
-}
-
-WebInspector.SnippetJavaScriptSourceFrame.prototype = {
- /**
- * @return {Array.<Element>}
- */
- statusBarItems: function()
- {
- return [this._runButton.element];
- },
-
- _runButtonClicked: function()
- {
- this._snippetJavaScriptSource.evaluate();
- }
-}
-
-WebInspector.SnippetJavaScriptSourceFrame.prototype.__proto__ = WebInspector.JavaScriptSourceFrame.prototype;
diff --git a/Source/WebCore/inspector/front-end/ScriptsPanel.js b/Source/WebCore/inspector/front-end/ScriptsPanel.js
index c003f9cf8..e8cacb187 100644
--- a/Source/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/Source/WebCore/inspector/front-end/ScriptsPanel.js
@@ -24,6 +24,21 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+importScript("BreakpointsSidebarPane.js");
+importScript("CallStackSidebarPane.js");
+importScript("FilteredItemSelectionDialog.js");
+importScript("JavaScriptSourceFrame.js");
+importScript("RevisionHistoryView.js");
+importScript("ScopeChainSidebarPane.js");
+importScript("ScriptsNavigator.js");
+importScript("ScriptsSearchScope.js");
+importScript("SnippetJavaScriptSourceFrame.js");
+importScript("StyleSheetOutlineDialog.js");
+importScript("TabbedEditorContainer.js");
+importScript("UISourceCodeFrame.js");
+importScript("WatchExpressionsSidebarPane.js");
+importScript("WorkersSidebarPane.js");
+
/**
* @constructor
* @implements {WebInspector.TabbedEditorContainerDelegate}
@@ -36,7 +51,6 @@ WebInspector.ScriptsPanel = function(workspaceForTest)
WebInspector.Panel.call(this, "scripts");
this.registerRequiredCSS("scriptsPanel.css");
- WebInspector.settings.pauseOnExceptionStateString = WebInspector.settings.createSetting("pauseOnExceptionStateString", WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions);
WebInspector.settings.navigatorWasOnceHidden = WebInspector.settings.createSetting("navigatorWasOnceHidden", false);
WebInspector.settings.debuggerSidebarHidden = WebInspector.settings.createSetting("debuggerSidebarHidden", false);
@@ -136,10 +150,10 @@ WebInspector.ScriptsPanel = function(workspaceForTest)
var panelEnablerButton = WebInspector.UIString("Enable Debugging");
this.panelEnablerView = new WebInspector.PanelEnablerView("scripts", panelEnablerHeading, panelEnablerDisclaimer, panelEnablerButton);
- this.panelEnablerView.addEventListener("enable clicked", this.enableDebugging, this);
+ this.panelEnablerView.addEventListener("enable clicked", this._enableDebugging, this);
this.enableToggleButton = new WebInspector.StatusBarButton("", "enable-toggle-status-bar-item");
- this.enableToggleButton.addEventListener("click", this.toggleDebugging, this);
+ this.enableToggleButton.addEventListener("click", this._toggleDebugging, this);
if (!Capabilities.debuggerCausesRecompilation)
this.enableToggleButton.element.addStyleClass("hidden");
@@ -153,12 +167,15 @@ WebInspector.ScriptsPanel = function(workspaceForTest)
this._scriptViewStatusBarItemsContainer = document.createElement("div");
this._scriptViewStatusBarItemsContainer.style.display = "inline-block";
- this._debuggerEnabled = !Capabilities.debuggerCausesRecompilation;
this._installDebuggerSidebarController();
this._sourceFramesByUISourceCode = new Map();
- this._reset(false);
+ this._updateDebuggerButtons();
+ this._pauseOnExceptionStateChanged();
+ if (WebInspector.debuggerModel.isPaused())
+ this._debuggerPaused();
+ WebInspector.settings.pauseOnExceptionStateString.addChangeListener(this._pauseOnExceptionStateChanged, this);
WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasEnabled, this._debuggerWasEnabled, this);
WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasDisabled, this._debuggerWasDisabled, this);
WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this);
@@ -168,32 +185,20 @@ WebInspector.ScriptsPanel = function(workspaceForTest)
WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ExecutionLineChanged, this._executionLineChanged, this);
WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointsActiveStateChanged, this._breakpointsActiveStateChanged, this);
- this._workspace.addEventListener(WebInspector.UISourceCodeProvider.Events.UISourceCodeAdded, this._handleUISourceCodeAdded, this);
+ var uiSourceCodes = this._workspace.uiSourceCodes();
+ for (var i = 0; i < uiSourceCodes.length; ++i)
+ this._addUISourceCode(uiSourceCodes[i]);
+
+ this._workspace.addEventListener(WebInspector.UISourceCodeProvider.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this);
this._workspace.addEventListener(WebInspector.UISourceCodeProvider.Events.UISourceCodeReplaced, this._uiSourceCodeReplaced, this);
this._workspace.addEventListener(WebInspector.UISourceCodeProvider.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this);
- this._workspace.addEventListener(WebInspector.Workspace.Events.WorkspaceReset, this._reset.bind(this, false), this);
-
- var enableDebugger = !Capabilities.debuggerCausesRecompilation || WebInspector.settings.debuggerEnabled.get();
- if (enableDebugger)
- WebInspector.debuggerModel.enableDebugger();
+ this._workspace.addEventListener(WebInspector.Workspace.Events.WorkspaceReset, this._reset.bind(this), this);
WebInspector.advancedSearchController.registerSearchScope(new WebInspector.ScriptsSearchScope(this._workspace));
WebInspector.ContextMenu.registerProvider(this);
}
-// Keep these in sync with WebCore::ScriptDebugServer
-WebInspector.ScriptsPanel.PauseOnExceptionsState = {
- DontPauseOnExceptions : "none",
- PauseOnAllExceptions : "all",
- PauseOnUncaughtExceptions: "uncaught"
-};
-
WebInspector.ScriptsPanel.prototype = {
- get toolbarItemLabel()
- {
- return WebInspector.UIString("Sources");
- },
-
get statusBarItems()
{
return [this.enableToggleButton.element, this._pauseOnExceptionButton.element, this._toggleFormatSourceButton.element, this._scriptViewStatusBarItemsContainer];
@@ -227,26 +232,9 @@ WebInspector.ScriptsPanel.prototype = {
/**
* @param {WebInspector.Event} event
*/
- _handleUISourceCodeAdded: function(event)
+ _uiSourceCodeAdded: function(event)
{
var uiSourceCode = /** @type {WebInspector.UISourceCode} */ event.data;
- if (this._toggleFormatSourceButton.toggled)
- uiSourceCode.setFormatted(true);
- this._uiSourceCodeAdded(uiSourceCode);
- },
-
- _loadUISourceCodes: function()
- {
- var uiSourceCodes = this._workspace.uiSourceCodes();
- for (var i = 0; i < uiSourceCodes.length; ++i)
- this._uiSourceCodeAdded(uiSourceCodes[i]);
- },
-
- /**
- * @param {WebInspector.UISourceCode} uiSourceCode
- */
- _uiSourceCodeAdded: function(uiSourceCode)
- {
this._addUISourceCode(uiSourceCode);
},
@@ -255,6 +243,9 @@ WebInspector.ScriptsPanel.prototype = {
*/
_addUISourceCode: function(uiSourceCode)
{
+ if (this._toggleFormatSourceButton.toggled)
+ uiSourceCode.setFormatted(true);
+
this._navigator.addUISourceCode(uiSourceCode);
this._editorContainer.addUISourceCode(uiSourceCode);
},
@@ -272,9 +263,9 @@ WebInspector.ScriptsPanel.prototype = {
this.sidebarPanes.scopechain.update(WebInspector.debuggerModel.selectedCallFrame());
},
- _debuggerPaused: function(event)
+ _debuggerPaused: function()
{
- var details = /** @type {WebInspector.DebuggerPausedDetails} */ event.data;
+ var details = WebInspector.debuggerModel.debuggerPausedDetails();
this._paused = true;
this._waitingToPause = false;
@@ -332,25 +323,15 @@ WebInspector.ScriptsPanel.prototype = {
_debuggerWasEnabled: function()
{
- this._setPauseOnExceptions(WebInspector.settings.pauseOnExceptionStateString.get());
-
- if (this._debuggerEnabled)
- return;
-
- this._debuggerEnabled = true;
- this._reset(true);
+ this._updateDebuggerButtons();
},
_debuggerWasDisabled: function()
{
- if (!this._debuggerEnabled)
- return;
-
- this._debuggerEnabled = false;
- this._reset(true);
+ this._reset();
},
- _reset: function(preserveItems)
+ _reset: function()
{
delete this.currentQuery;
this.searchCanceled();
@@ -367,8 +348,6 @@ WebInspector.ScriptsPanel.prototype = {
var uiSourceCodes = this._workspace.uiSourceCodes();
for (var i = 0; i < uiSourceCodes.length; ++i)
this._removeSourceFrame(uiSourceCodes[i]);
-
- this._loadUISourceCodes();
},
get visibleView()
@@ -390,7 +369,7 @@ WebInspector.ScriptsPanel.prototype = {
canShowAnchorLocation: function(anchor)
{
- if (this._debuggerEnabled && anchor.uiSourceCode)
+ if (WebInspector.debuggerModel.debuggerEnabled() && anchor.uiSourceCode)
return true;
var uiSourceCodes = this._workspace.uiSourceCodes();
for (var i = 0; i < uiSourceCodes.length; ++i) {
@@ -588,29 +567,24 @@ WebInspector.ScriptsPanel.prototype = {
sourceFrame.focus();
},
- _setPauseOnExceptions: function(pauseOnExceptionsState)
+ _pauseOnExceptionStateChanged: function()
{
- pauseOnExceptionsState = pauseOnExceptionsState || WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions;
- function callback(error)
- {
- if (error)
- return;
- if (pauseOnExceptionsState == WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions)
- this._pauseOnExceptionButton.title = WebInspector.UIString("Don't pause on exceptions.\nClick to Pause on all exceptions.");
- else if (pauseOnExceptionsState == WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnAllExceptions)
- this._pauseOnExceptionButton.title = WebInspector.UIString("Pause on all exceptions.\nClick to Pause on uncaught exceptions.");
- else if (pauseOnExceptionsState == WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions)
- this._pauseOnExceptionButton.title = WebInspector.UIString("Pause on uncaught exceptions.\nClick to Not pause on exceptions.");
-
- this._pauseOnExceptionButton.state = pauseOnExceptionsState;
- WebInspector.settings.pauseOnExceptionStateString.set(pauseOnExceptionsState);
+ switch (WebInspector.settings.pauseOnExceptionStateString.get()) {
+ case WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions:
+ this._pauseOnExceptionButton.title = WebInspector.UIString("Don't pause on exceptions.\nClick to Pause on all exceptions.");
+ break;
+ case WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions:
+ this._pauseOnExceptionButton.title = WebInspector.UIString("Pause on all exceptions.\nClick to Pause on uncaught exceptions.");
+ break;
+ case WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions:
+ this._pauseOnExceptionButton.title = WebInspector.UIString("Pause on uncaught exceptions.\nClick to Not pause on exceptions.");
+ break;
}
- DebuggerAgent.setPauseOnExceptions(pauseOnExceptionsState, callback.bind(this));
},
_updateDebuggerButtons: function()
{
- if (this._debuggerEnabled) {
+ if (WebInspector.debuggerModel.debuggerEnabled()) {
this.enableToggleButton.title = WebInspector.UIString("Debugging enabled. Click to disable.");
this.enableToggleButton.toggled = true;
this._pauseOnExceptionButton.visible = true;
@@ -661,32 +635,18 @@ WebInspector.ScriptsPanel.prototype = {
this._updateDebuggerButtons();
},
- get debuggingEnabled()
- {
- return this._debuggerEnabled;
- },
-
- enableDebugging: function()
- {
- if (this._debuggerEnabled)
- return;
- this.toggleDebugging(this.panelEnablerView.alwaysEnabled);
- },
-
- disableDebugging: function()
+ _enableDebugging: function()
{
- if (!this._debuggerEnabled)
- return;
- this.toggleDebugging(this.panelEnablerView.alwaysEnabled);
+ this._toggleDebugging(this.panelEnablerView.alwaysEnabled);
},
- toggleDebugging: function(optionalAlways)
+ _toggleDebugging: function(optionalAlways)
{
this._paused = false;
this._waitingToPause = false;
this._stepping = false;
- if (this._debuggerEnabled) {
+ if (WebInspector.debuggerModel.debuggerEnabled()) {
WebInspector.settings.debuggerEnabled.set(false);
WebInspector.debuggerModel.disableDebugger();
} else {
@@ -698,11 +658,11 @@ WebInspector.ScriptsPanel.prototype = {
_togglePauseOnExceptions: function()
{
var nextStateMap = {};
- var stateEnum = WebInspector.ScriptsPanel.PauseOnExceptionsState;
+ var stateEnum = WebInspector.DebuggerModel.PauseOnExceptionsState;
nextStateMap[stateEnum.DontPauseOnExceptions] = stateEnum.PauseOnAllExceptions;
nextStateMap[stateEnum.PauseOnAllExceptions] = stateEnum.PauseOnUncaughtExceptions;
nextStateMap[stateEnum.PauseOnUncaughtExceptions] = stateEnum.DontPauseOnExceptions;
- this._setPauseOnExceptions(nextStateMap[this._pauseOnExceptionButton.state]);
+ WebInspector.settings.pauseOnExceptionStateString.set(nextStateMap[this._pauseOnExceptionButton.state]);
},
_togglePause: function()
@@ -1132,7 +1092,6 @@ WebInspector.ScriptsPanel.prototype = {
showGoToSourceDialog: function()
{
- WebInspector.inspectorView.setCurrentPanel(this);
WebInspector.OpenResourceDialog.show(this, this._workspace, this.editorView.mainElement);
}
}
diff --git a/Source/WebCore/inspector/front-end/SearchController.js b/Source/WebCore/inspector/front-end/SearchController.js
index d18e280e1..372034d96 100644
--- a/Source/WebCore/inspector/front-end/SearchController.js
+++ b/Source/WebCore/inspector/front-end/SearchController.js
@@ -42,11 +42,18 @@ WebInspector.SearchController = function()
this._secondRowElement = this._element.createChild("tr", "hidden");
// Column 1
- this._searchControlElement = this._firstRowElement.createChild("td").createChild("span", "toolbar-search-control");
+ var searchControlElementColumn = this._firstRowElement.createChild("td");
+ this._searchControlElement = searchControlElementColumn.createChild("span", "toolbar-search-control");
this._searchInputElement = this._searchControlElement.createChild("input", "search-replace");
this._searchInputElement.id = "search-input-field";
this._searchInputElement.placeholder = WebInspector.UIString("Find");
+ this._filterControlElement = searchControlElementColumn.createChild("span", "toolbar-search-control");
+ this._filterControlElement.addStyleClass("hidden");
+ this._filterInputElement = this._filterControlElement.createChild("input", "filter");
+ this._filterInputElement.id = "filter-input-field";
+ this._filterInputElement.placeholder = WebInspector.UIString("Filter");
+
this._matchesElement = this._searchControlElement.createChild("label", "search-results-matches");
this._matchesElement.setAttribute("for", "search-input-field");
@@ -62,7 +69,9 @@ WebInspector.SearchController = function()
this._searchInputElement.addEventListener("mousedown", this._onSearchFieldManualFocus.bind(this), false); // when the search field is manually selected
this._searchInputElement.addEventListener("keydown", this._onKeyDown.bind(this), true);
- this._searchInputElement.addEventListener("input", this._onInput.bind(this), false);
+ this._filterInputElement.addEventListener("keydown", this._onKeyDown.bind(this), true);
+ this._filterInputElement.addEventListener("input", this._onFilterInput.bind(this), false);
+ this._searchInputElement.addEventListener("input", this._onSearchInput.bind(this), false);
this._replaceInputElement = this._secondRowElement.createChild("td").createChild("input", "search-replace toolbar-replace-control");
this._replaceInputElement.addEventListener("keydown", this._onKeyDown.bind(this), true);
@@ -104,6 +113,18 @@ WebInspector.SearchController = function()
this._replaceLabelElement.setAttribute("for", "search-replace-trigger");
// Column 5
+ this._filterCheckboxContainer = this._firstRowElement.createChild("td").createChild("span");
+
+ this._filterCheckboxElement = this._filterCheckboxContainer.createChild("input");
+ this._filterCheckboxElement.type = "checkbox";
+ this._filterCheckboxElement.id = "filter-trigger";
+ this._filterCheckboxElement.addEventListener("click", this._filterCheckboxClick.bind(this), false);
+
+ this._filterLabelElement = this._filterCheckboxContainer.createChild("label");
+ this._filterLabelElement.textContent = WebInspector.UIString("Filter");
+ this._filterLabelElement.setAttribute("for", "filter-trigger");
+
+ // Column 6
var cancelButtonElement = this._firstRowElement.createChild("td").createChild("button");
cancelButtonElement.textContent = WebInspector.UIString("Cancel");
cancelButtonElement.tabIndex = -1;
@@ -132,6 +153,10 @@ WebInspector.SearchController.prototype = {
{
if (!this._searchIsVisible)
return;
+ if (this._filterCheckboxElement.checked) {
+ this._filterCheckboxElement.checked = false;
+ this._switchFilterToSearch();
+ }
delete this._searchIsVisible;
WebInspector.inspectorView.setFooterElement(null);
this.resetSearch();
@@ -223,11 +248,40 @@ WebInspector.SearchController.prototype = {
{
WebInspector.inspectorView.setFooterElement(this._element);
this._updateReplaceVisibility();
+ this._updateFilterVisibility();
this._searchInputElement.focus();
this._searchInputElement.select();
this._searchIsVisible = true;
},
+ _switchFilterToSearch: function()
+ {
+ this._filterControlElement.addStyleClass("hidden");
+ this._searchControlElement.removeStyleClass("hidden");
+ this._searchInputElement.focus();
+ this._searchInputElement.select();
+ this._searchInputElement.value = this._filterInputElement.value;
+ this.resetFilter();
+ },
+
+ _switchSearchToFilter: function()
+ {
+ this._filterControlElement.removeStyleClass("hidden");
+ this._searchControlElement.addStyleClass("hidden");
+ this._filterInputElement.focus();
+ this._filterInputElement.select();
+ this._filterInputElement.value = this._searchInputElement.value;
+ this.resetSearch();
+ },
+
+ _updateFilterVisibility: function()
+ {
+ if (typeof WebInspector.inspectorView.currentPanel().performFilter === "function")
+ this._filterCheckboxContainer.removeStyleClass("hidden");
+ else
+ this._filterCheckboxContainer.addStyleClass("hidden");
+ },
+
_updateReplaceVisibility: function()
{
var panel = WebInspector.inspectorView.currentPanel();
@@ -265,11 +319,6 @@ WebInspector.SearchController.prototype = {
}
},
- _onInput: function(event)
- {
- this._performSearch(event.target.value, false, false);
- },
-
_onNextButtonSearch: function(event)
{
// Simulate next search on search-navigation-button click.
@@ -364,6 +413,41 @@ WebInspector.SearchController.prototype = {
{
var currentPanel = WebInspector.inspectorView.currentPanel();
currentPanel.replaceAllWith(this._searchInputElement.value, this._replaceInputElement.value);
+ },
+
+ _filterCheckboxClick: function()
+ {
+ if (this._filterCheckboxElement.checked) {
+ this._switchSearchToFilter();
+ this._performFilter(this._filterInputElement.value);
+ } else {
+ this._switchFilterToSearch();
+ this._performSearch(this._searchInputElement.value, false, false);
+ }
+ },
+
+ /**
+ * @param {string} query
+ */
+ _performFilter: function(query)
+ {
+ if (typeof WebInspector.inspectorView.currentPanel().performFilter === "function")
+ WebInspector.inspectorView.currentPanel().performFilter(query);
+ },
+
+ _onFilterInput: function(event)
+ {
+ this._performFilter(event.target.value);
+ },
+
+ _onSearchInput: function(event)
+ {
+ this._performSearch(event.target.value, false, false);
+ },
+
+ resetFilter: function()
+ {
+ this._performFilter("");
}
}
diff --git a/Source/WebCore/inspector/front-end/Settings.js b/Source/WebCore/inspector/front-end/Settings.js
index f2c45335b..2c8bf6880 100644
--- a/Source/WebCore/inspector/front-end/Settings.js
+++ b/Source/WebCore/inspector/front-end/Settings.js
@@ -42,7 +42,6 @@ var Preferences = {
localizeUI: true,
exposeDisableCache: false,
applicationTitle: "Web Inspector - %s",
- showHeapSnapshotObjectsHiddenProperties: false,
showDockToRight: false,
exposeFileSystemInspection: false
}
@@ -101,6 +100,7 @@ WebInspector.Settings = function()
this.javaScriptDisabled = this.createSetting("javaScriptDisabled", false);
this.geolocationOverride = this.createSetting("geolocationOverride", "");
this.deviceOrientationOverride = this.createSetting("deviceOrientationOverride", "");
+ this.showHeapSnapshotObjectsHiddenProperties = this.createSetting("showHeaSnapshotObjectsHiddenProperties", false);
// If there are too many breakpoints in a storage, it is likely due to a recent bug that caused
// periodical breakpoints duplication leading to inspector slowness.
diff --git a/Source/WebCore/inspector/front-end/SettingsScreen.js b/Source/WebCore/inspector/front-end/SettingsScreen.js
index 51d4b6253..eb67a756f 100644
--- a/Source/WebCore/inspector/front-end/SettingsScreen.js
+++ b/Source/WebCore/inspector/front-end/SettingsScreen.js
@@ -259,13 +259,13 @@ WebInspector.GenericSettingsTab = function()
WebInspector.settings.javaScriptDisabled.addChangeListener(this._javaScriptDisabledChanged, this);
this._disableJSCheckbox = disableJSElement.getElementsByTagName("input")[0];
this._updateScriptDisabledCheckbox();
-
+
p = this._appendSection(WebInspector.UIString("Elements"));
p.appendChild(this._createRadioSetting(WebInspector.UIString("Color format"), [
- [ WebInspector.StylesSidebarPane.ColorFormat.Original, WebInspector.UIString("As authored") ],
- [ WebInspector.StylesSidebarPane.ColorFormat.HEX, "HEX: #DAC0DE" ],
- [ WebInspector.StylesSidebarPane.ColorFormat.RGB, "RGB: rgb(128, 255, 255)" ],
- [ WebInspector.StylesSidebarPane.ColorFormat.HSL, "HSL: hsl(300, 80%, 90%)" ] ], WebInspector.settings.colorFormat));
+ [ WebInspector.Color.Format.Original, WebInspector.UIString("As authored") ],
+ [ WebInspector.Color.Format.HEX, "HEX: #DAC0DE" ],
+ [ WebInspector.Color.Format.RGB, "RGB: rgb(128, 255, 255)" ],
+ [ WebInspector.Color.Format.HSL, "HSL: hsl(300, 80%, 90%)" ] ], WebInspector.settings.colorFormat));
p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show user agent styles"), WebInspector.settings.showUserAgentStyles));
p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Word wrap"), WebInspector.settings.domWordWrap));
@@ -399,6 +399,7 @@ WebInspector.UserAgentSettingsTab.prototype = {
["BlackBerry \u2014 PlayBook 2.1", "Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML, like Gecko) Version/7.2.1.0 Safari/536.2+", "1024x600x1"],
["BlackBerry \u2014 9900", "Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0.187 Mobile Safari/534.11+", "640x480x1"],
+ ["BlackBerry \u2014 BB10", "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.1+ (KHTML, like Gecko) Version/10.0.0.1337 Mobile Safari/537.1+", "768x1280x1"],
["MeeGo \u2014 Nokia N9", "Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13", "480x854x1"],
diff --git a/Source/WebCore/inspector/front-end/SnippetJavaScriptSourceFrame.js b/Source/WebCore/inspector/front-end/SnippetJavaScriptSourceFrame.js
new file mode 100644
index 000000000..587dd7bb1
--- /dev/null
+++ b/Source/WebCore/inspector/front-end/SnippetJavaScriptSourceFrame.js
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @constructor
+ * @extends {WebInspector.JavaScriptSourceFrame}
+ * @param {WebInspector.ScriptsPanel} scriptsPanel
+ * @param {WebInspector.SnippetJavaScriptSource} snippetJavaScriptSource
+ */
+WebInspector.SnippetJavaScriptSourceFrame = function(scriptsPanel, snippetJavaScriptSource)
+{
+ WebInspector.JavaScriptSourceFrame.call(this, scriptsPanel, snippetJavaScriptSource);
+
+ this._snippetJavaScriptSource = snippetJavaScriptSource;
+ this._runButton = new WebInspector.StatusBarButton(WebInspector.UIString("Run"), "evaluate-snippet-status-bar-item");
+ this._runButton.addEventListener("click", this._runButtonClicked, this);
+}
+
+WebInspector.SnippetJavaScriptSourceFrame.prototype = {
+ /**
+ * @return {Array.<Element>}
+ */
+ statusBarItems: function()
+ {
+ return [this._runButton.element];
+ },
+
+ _runButtonClicked: function()
+ {
+ this._snippetJavaScriptSource.evaluate();
+ }
+}
+
+WebInspector.SnippetJavaScriptSourceFrame.prototype.__proto__ = WebInspector.JavaScriptSourceFrame.prototype;
diff --git a/Source/WebCore/inspector/front-end/SourceFrame.js b/Source/WebCore/inspector/front-end/SourceFrame.js
index a0ffcfafb..2f498f3a0 100644
--- a/Source/WebCore/inspector/front-end/SourceFrame.js
+++ b/Source/WebCore/inspector/front-end/SourceFrame.js
@@ -43,9 +43,10 @@ WebInspector.SourceFrame = function(contentProvider)
var textEditorDelegate = new WebInspector.TextEditorDelegateForSourceFrame(this);
- if (WebInspector.experimentsSettings.codemirror.isEnabled())
+ if (WebInspector.experimentsSettings.codemirror.isEnabled()) {
+ importScript("CodeMirrorTextEditor.js");
this._textEditor = new WebInspector.CodeMirrorTextEditor(this._url, textEditorDelegate);
- else
+ } else
this._textEditor = new WebInspector.DefaultTextEditor(this._url, textEditorDelegate);
this._currentSearchResultIndex = -1;
@@ -56,6 +57,10 @@ WebInspector.SourceFrame = function(contentProvider)
this._messageBubbles = {};
this._textEditor.setReadOnly(!this.canEditSource());
+
+ this._shortcuts = {};
+ this._shortcuts[WebInspector.KeyboardShortcut.makeKey("s", WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta)] = this._commitEditing.bind(this);
+ this.element.addEventListener("keydown", this._handleKeyDown.bind(this), false);
}
/**
@@ -273,17 +278,13 @@ WebInspector.SourceFrame.prototype = {
this._innerSetSelectionIfNeeded();
},
- beforeTextChanged: function()
+ onTextChanged: function(oldRange, newRange)
{
if (!this._isReplacing)
WebInspector.searchController.cancelSearch();
this.clearMessages();
},
- afterTextChanged: function(oldRange, newRange)
- {
- },
-
/**
* @param {?string} content
* @param {boolean} contentEncoded
@@ -629,6 +630,26 @@ WebInspector.SourceFrame.prototype = {
scrollChanged: function(lineNumber)
{
this.dispatchEventToListeners(WebInspector.SourceFrame.Events.ScrollChanged, lineNumber);
+ },
+
+ _handleKeyDown: function(e)
+ {
+ var shortcutKey = WebInspector.KeyboardShortcut.makeKeyFromEvent(e);
+ var handler = this._shortcuts[shortcutKey];
+ if (handler && handler())
+ e.consume(true);
+ },
+
+ _commitEditing: function()
+ {
+ if (this._textEditor.readOnly())
+ return false;
+
+ var content = this._textEditor.text();
+ this.commitEditing(content);
+ if (this._url && WebInspector.fileManager.isURLSaved(this._url))
+ WebInspector.fileManager.save(this._url, content, false);
+ return true;
}
}
@@ -645,19 +666,9 @@ WebInspector.TextEditorDelegateForSourceFrame = function(sourceFrame)
}
WebInspector.TextEditorDelegateForSourceFrame.prototype = {
- beforeTextChanged: function()
- {
- this._sourceFrame.beforeTextChanged();
- },
-
- afterTextChanged: function(oldRange, newRange)
- {
- this._sourceFrame.afterTextChanged(oldRange, newRange);
- },
-
- commitEditing: function()
+ onTextChanged: function(oldRange, newRange)
{
- this._sourceFrame.commitEditing(this._sourceFrame._textEditor.text());
+ this._sourceFrame.onTextChanged(oldRange, newRange);
},
/**
diff --git a/Source/WebCore/inspector/front-end/Spectrum.js b/Source/WebCore/inspector/front-end/Spectrum.js
index 2afff1b85..0c8ce544c 100644
--- a/Source/WebCore/inspector/front-end/Spectrum.js
+++ b/Source/WebCore/inspector/front-end/Spectrum.js
@@ -289,7 +289,7 @@ WebInspector.Spectrum.prototype = {
get outputColorFormat()
{
- var cf = WebInspector.StylesSidebarPane.ColorFormat;
+ var cf = WebInspector.Color.Format;
var format = this._originalFormat;
if (this.hsv[3] === 1) {
diff --git a/Source/WebCore/inspector/front-end/SplitView.js b/Source/WebCore/inspector/front-end/SplitView.js
index 142c7e3b4..467899cfa 100644
--- a/Source/WebCore/inspector/front-end/SplitView.js
+++ b/Source/WebCore/inspector/front-end/SplitView.js
@@ -223,6 +223,11 @@ WebInspector.SplitView.prototype = {
this.saveSidebarWidth();
},
+ sidebarWidth: function()
+ {
+ return this._sidebarWidth;
+ },
+
/**
* @param {number} width
*/
diff --git a/Source/WebCore/inspector/front-end/StatusBarButton.js b/Source/WebCore/inspector/front-end/StatusBarButton.js
index f3554fad2..9194302d5 100644
--- a/Source/WebCore/inspector/front-end/StatusBarButton.js
+++ b/Source/WebCore/inspector/front-end/StatusBarButton.js
@@ -61,6 +61,8 @@ WebInspector.StatusBarButton = function(title, className, states)
this._visible = true;
}
+WebInspector.StatusBarButton.width = 31;
+
WebInspector.StatusBarButton.prototype = {
_clicked: function()
{
@@ -289,5 +291,13 @@ WebInspector.StatusBarComboBox.prototype = {
if (this._selectElement.selectedIndex >= 0)
return this._selectElement[this._selectElement.selectedIndex];
return null;
+ },
+
+ /**
+ * @param {Element} option
+ */
+ select: function(option)
+ {
+ this._selectElement.selectedIndex = Array.prototype.indexOf.call(this._selectElement, option);
}
}
diff --git a/Source/WebCore/inspector/front-end/StyleSheetOutlineDialog.js b/Source/WebCore/inspector/front-end/StyleSheetOutlineDialog.js
new file mode 100644
index 000000000..c251072b2
--- /dev/null
+++ b/Source/WebCore/inspector/front-end/StyleSheetOutlineDialog.js
@@ -0,0 +1,154 @@
+/*
+ * 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 GOOGLE 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 GOOGLE 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.
+ */
+
+/**
+ * @constructor
+ * @implements {WebInspector.SelectionDialogContentProvider}
+ * @param {WebInspector.View} view
+ * @param {WebInspector.StyleSource} styleSource
+ */
+WebInspector.StyleSheetOutlineDialog = function(view, styleSource)
+{
+ WebInspector.SelectionDialogContentProvider.call(this);
+
+ this._rules = [];
+ this._view = view;
+ this._styleSource = styleSource;
+}
+
+/**
+ * @param {WebInspector.View} view
+ * @param {WebInspector.StyleSource} styleSource
+ */
+WebInspector.StyleSheetOutlineDialog.show = function(view, styleSource)
+{
+ if (WebInspector.Dialog.currentInstance())
+ return null;
+ var delegate = new WebInspector.StyleSheetOutlineDialog(view, styleSource);
+ var filteredItemSelectionDialog = new WebInspector.FilteredItemSelectionDialog(delegate);
+ WebInspector.Dialog.show(view.element, filteredItemSelectionDialog);
+}
+
+WebInspector.StyleSheetOutlineDialog.prototype = {
+ /**
+ * @param {number} itemIndex
+ * @return {string}
+ */
+ itemTitleAt: function(itemIndex)
+ {
+ return this._rules[itemIndex].selectorText;
+ },
+
+ /*
+ * @param {number} itemIndex
+ * @return {string}
+ */
+ itemSubtitleAt: function(itemIndex)
+ {
+ return "";
+ },
+
+ /**
+ * @param {number} itemIndex
+ * @return {string}
+ */
+ itemKeyAt: function(itemIndex)
+ {
+ return this._rules[itemIndex].selectorText;
+ },
+
+ /**
+ * @return {number}
+ */
+ itemsCount: function()
+ {
+ return this._rules.length;
+ },
+
+ /**
+ * @param {function(number, number, number, number)} callback
+ */
+ requestItems: function(callback)
+ {
+ function didGetAllStyleSheets(error, infos)
+ {
+ if (error) {
+ callback(0, 0, 0, 0);
+ return;
+ }
+
+ for (var i = 0; i < infos.length; ++i) {
+ var info = infos[i];
+ if (info.sourceURL === this._styleSource.contentURL()) {
+ WebInspector.CSSStyleSheet.createForId(info.styleSheetId, didGetStyleSheet.bind(this));
+ return;
+ }
+ }
+ callback(0, 0, 0, 0);
+ }
+
+ CSSAgent.getAllStyleSheets(didGetAllStyleSheets.bind(this));
+
+ /**
+ * @param {?WebInspector.CSSStyleSheet} styleSheet
+ */
+ function didGetStyleSheet(styleSheet)
+ {
+ if (!styleSheet) {
+ callback(0, 0, 0, 0);
+ return;
+ }
+
+ this._rules = styleSheet.rules;
+ callback(0, this._rules.length, 0, 1);
+ }
+ },
+
+ /**
+ * @param {number} itemIndex
+ * @param {string} promptValue
+ */
+ selectItem: function(itemIndex, promptValue)
+ {
+ var lineNumber = this._rules[itemIndex].sourceLine;
+ if (!isNaN(lineNumber) && lineNumber >= 0)
+ this._view.highlightLine(lineNumber);
+ this._view.focus();
+ },
+
+ /**
+ * @param {string} query
+ * @return {string}
+ */
+ rewriteQuery: function(query)
+ {
+ return query;
+ }
+}
+
+WebInspector.StyleSheetOutlineDialog.prototype.__proto__ = WebInspector.SelectionDialogContentProvider.prototype;
diff --git a/Source/WebCore/inspector/front-end/StylesPanel.js b/Source/WebCore/inspector/front-end/StyleSource.js
index c41dc7faf..6e3873a91 100644
--- a/Source/WebCore/inspector/front-end/StylesPanel.js
+++ b/Source/WebCore/inspector/front-end/StyleSource.js
@@ -179,147 +179,3 @@ WebInspector.StyleSource.prototype = {
}
WebInspector.StyleSource.prototype.__proto__ = WebInspector.UISourceCode.prototype;
-
-/**
- * @constructor
- * @extends {WebInspector.UISourceCode}
- * @param {CSSAgent.StyleSheetId} styleSheetId
- * @param {string} url
- * @param {string} content
- */
-WebInspector.InspectorStyleSource = function(styleSheetId, url, content)
-{
- WebInspector.UISourceCode.call(this, "<inspector style>", null, new WebInspector.StaticContentProvider(WebInspector.resourceTypes.Stylesheet, content));
-}
-
-WebInspector.InspectorStyleSource.prototype = {
-}
-
-WebInspector.InspectorStyleSource.prototype.__proto__ = WebInspector.UISourceCode.prototype;
-
-/**
- * @constructor
- * @implements {WebInspector.SelectionDialogContentProvider}
- * @param {WebInspector.View} view
- * @param {WebInspector.StyleSource} styleSource
- */
-WebInspector.StyleSheetOutlineDialog = function(view, styleSource)
-{
- WebInspector.SelectionDialogContentProvider.call(this);
-
- this._rules = [];
- this._view = view;
- this._styleSource = styleSource;
-}
-
-/**
- * @param {WebInspector.View} view
- * @param {WebInspector.StyleSource} styleSource
- */
-WebInspector.StyleSheetOutlineDialog.show = function(view, styleSource)
-{
- if (WebInspector.Dialog.currentInstance())
- return null;
- var delegate = new WebInspector.StyleSheetOutlineDialog(view, styleSource);
- var filteredItemSelectionDialog = new WebInspector.FilteredItemSelectionDialog(delegate);
- WebInspector.Dialog.show(view.element, filteredItemSelectionDialog);
-}
-
-WebInspector.StyleSheetOutlineDialog.prototype = {
- /**
- * @param {number} itemIndex
- * @return {string}
- */
- itemTitleAt: function(itemIndex)
- {
- return this._rules[itemIndex].selectorText;
- },
-
- /*
- * @param {number} itemIndex
- * @return {string}
- */
- itemSubtitleAt: function(itemIndex)
- {
- return "";
- },
-
- /**
- * @param {number} itemIndex
- * @return {string}
- */
- itemKeyAt: function(itemIndex)
- {
- return this._rules[itemIndex].selectorText;
- },
-
- /**
- * @return {number}
- */
- itemsCount: function()
- {
- return this._rules.length;
- },
-
- /**
- * @param {function(number, number, number, number)} callback
- */
- requestItems: function(callback)
- {
- function didGetAllStyleSheets(error, infos)
- {
- if (error) {
- callback(0, 0, 0, 0);
- return;
- }
-
- for (var i = 0; i < infos.length; ++i) {
- var info = infos[i];
- if (info.sourceURL === this._styleSource.contentURL()) {
- WebInspector.CSSStyleSheet.createForId(info.styleSheetId, didGetStyleSheet.bind(this));
- return;
- }
- }
- callback(0, 0, 0, 0);
- }
-
- CSSAgent.getAllStyleSheets(didGetAllStyleSheets.bind(this));
-
- /**
- * @param {?WebInspector.CSSStyleSheet} styleSheet
- */
- function didGetStyleSheet(styleSheet)
- {
- if (!styleSheet) {
- callback(0, 0, 0, 0);
- return;
- }
-
- this._rules = styleSheet.rules;
- callback(0, this._rules.length, 0, 1);
- }
- },
-
- /**
- * @param {number} itemIndex
- * @param {string} promptValue
- */
- selectItem: function(itemIndex, promptValue)
- {
- var lineNumber = this._rules[itemIndex].sourceLine;
- if (!isNaN(lineNumber) && lineNumber >= 0)
- this._view.highlightLine(lineNumber);
- this._view.focus();
- },
-
- /**
- * @param {string} query
- * @return {string}
- */
- rewriteQuery: function(query)
- {
- return query;
- }
-}
-
-WebInspector.StyleSheetOutlineDialog.prototype.__proto__ = WebInspector.SelectionDialogContentProvider.prototype;
diff --git a/Source/WebCore/inspector/front-end/StylesSidebarPane.js b/Source/WebCore/inspector/front-end/StylesSidebarPane.js
index 7415f1cd6..0b58b6cd8 100644
--- a/Source/WebCore/inspector/front-end/StylesSidebarPane.js
+++ b/Source/WebCore/inspector/front-end/StylesSidebarPane.js
@@ -41,22 +41,22 @@ WebInspector.StylesSidebarPane = function(computedStylePane, setPseudoClassCallb
this.settingsSelectElement.className = "select-settings";
var option = document.createElement("option");
- option.value = WebInspector.StylesSidebarPane.ColorFormat.Original;
+ option.value = WebInspector.Color.Format.Original;
option.label = WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "As authored" : "As Authored");
this.settingsSelectElement.appendChild(option);
option = document.createElement("option");
- option.value = WebInspector.StylesSidebarPane.ColorFormat.HEX;
+ option.value = WebInspector.Color.Format.HEX;
option.label = WebInspector.UIString("Hex Colors");
this.settingsSelectElement.appendChild(option);
option = document.createElement("option");
- option.value = WebInspector.StylesSidebarPane.ColorFormat.RGB;
+ option.value = WebInspector.Color.Format.RGB;
option.label = WebInspector.UIString("RGB Colors");
this.settingsSelectElement.appendChild(option);
option = document.createElement("option");
- option.value = WebInspector.StylesSidebarPane.ColorFormat.HSL;
+ option.value = WebInspector.Color.Format.HSL;
option.label = WebInspector.UIString("HSL Colors");
this.settingsSelectElement.appendChild(option);
@@ -103,17 +103,6 @@ WebInspector.StylesSidebarPane = function(computedStylePane, setPseudoClassCallb
WebInspector.settings.showUserAgentStyles.addChangeListener(this._showUserAgentStylesSettingChanged.bind(this));
}
-WebInspector.StylesSidebarPane.ColorFormat = {
- Original: "original",
- Nickname: "nickname",
- HEX: "hex",
- ShortHEX: "shorthex",
- RGB: "rgb",
- RGBA: "rgba",
- HSL: "hsl",
- HSLA: "hsla"
-}
-
// Keep in sync with RenderStyleConstants.h PseudoId enum. Array below contains pseudo id names for corresponding enum indexes.
// First item is empty due to its artificial NOPSEUDO nature in the enum.
// FIXME: find a way of generating this mapping or getting it from combination of RenderStyleConstants and CSSSelector.cpp at
@@ -150,7 +139,7 @@ WebInspector.StylesSidebarPane.prototype = {
contextMenu.show(event);
},
- get forcedPseudoClasses()
+ get _forcedPseudoClasses()
{
return this.node ? (this.node.getUserProperty("pseudoState") || undefined) : undefined;
},
@@ -160,7 +149,7 @@ WebInspector.StylesSidebarPane.prototype = {
if (!this.node)
return;
- var nodePseudoState = this.forcedPseudoClasses;
+ var nodePseudoState = this._forcedPseudoClasses;
if (!nodePseudoState)
nodePseudoState = [];
@@ -236,7 +225,7 @@ WebInspector.StylesSidebarPane.prototype = {
if (this._computedStylePane.expanded || forceFetchComputedStyle) {
this._refreshUpdateInProgress = true;
- WebInspector.cssModel.getComputedStyleAsync(node.id, this.forcedPseudoClasses, computedStyleCallback.bind(this));
+ WebInspector.cssModel.getComputedStyleAsync(node.id, computedStyleCallback.bind(this));
} else {
this._innerRefreshUpdate(node, null, editedSection);
if (userCallback)
@@ -294,9 +283,9 @@ WebInspector.StylesSidebarPane.prototype = {
}
if (this._computedStylePane.expanded)
- WebInspector.cssModel.getComputedStyleAsync(node.id, this.forcedPseudoClasses, computedCallback.bind(this));
+ WebInspector.cssModel.getComputedStyleAsync(node.id, computedCallback.bind(this));
WebInspector.cssModel.getInlineStylesAsync(node.id, inlineCallback.bind(this));
- WebInspector.cssModel.getMatchedStylesAsync(node.id, this.forcedPseudoClasses, true, true, stylesCallback.bind(this));
+ WebInspector.cssModel.getMatchedStylesAsync(node.id, true, true, stylesCallback.bind(this));
},
/**
@@ -1332,12 +1321,12 @@ WebInspector.StylePropertiesSection.prototype = {
this.rule = newRule;
this.styleRule = { section: this, style: newRule.style, selectorText: newRule.selectorText, media: newRule.media, sourceURL: newRule.sourceURL, rule: newRule };
- this.pane.update();
+ this._parentPane.update();
this._moveEditorFromSelector(moveDirection);
}
- var selectedNode = WebInspector.panels.elements.selectedDOMNode();
+ var selectedNode = this._parentPane.node;
WebInspector.cssModel.setRuleSelector(this.rule.id, selectedNode ? selectedNode.id : 0, newContent, successCallback.bind(this), this._moveEditorFromSelector.bind(this, moveDirection));
},
@@ -1693,7 +1682,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
valueElement.className = "value";
this.valueElement = valueElement;
- var cf = WebInspector.StylesSidebarPane.ColorFormat;
+ var cf = WebInspector.Color.Format;
if (value) {
var self = this;
@@ -1729,8 +1718,8 @@ WebInspector.StylePropertyTreeElement.prototype = {
container.appendChild(document.createTextNode("url("));
if (self._styleRule.sourceURL)
hrefUrl = WebInspector.completeURL(self._styleRule.sourceURL, hrefUrl);
- else if (WebInspector.panels.elements.selectedDOMNode())
- hrefUrl = WebInspector.resourceURLForRelatedNode(WebInspector.panels.elements.selectedDOMNode(), hrefUrl);
+ else if (this._parentPane.node)
+ hrefUrl = WebInspector.resourceURLForRelatedNode(this._parentPane.node, hrefUrl);
var hasResource = !!WebInspector.resourceForURL(hrefUrl);
// FIXME: WebInspector.linkifyURLAsNode() should really use baseURI.
container.appendChild(WebInspector.linkifyURLAsNode(hrefUrl, url, undefined, !hasResource));
@@ -1904,7 +1893,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
var colorRegex = /((?:rgb|hsl)a?\([^)]+\)|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3}|\b\w+\b(?!-))/g;
var colorProcessor = processValue.bind(window, colorRegex, processColor, null);
- valueElement.appendChild(processValue(/url\(\s*([^)\s]+)\s*\)/g, linkifyURL, WebInspector.CSSKeywordCompletions.isColorAwareProperty(self.name) ? colorProcessor : null, value));
+ valueElement.appendChild(processValue(/url\(\s*([^)\s]+)\s*\)/g, linkifyURL.bind(this), WebInspector.CSSKeywordCompletions.isColorAwareProperty(self.name) ? colorProcessor : null, value));
}
this.listItemElement.removeChildren();
@@ -2439,7 +2428,6 @@ WebInspector.StylePropertyTreeElement.prototype = {
return;
var section = this.treeOutline.section;
- var elementsPanel = WebInspector.panels.elements;
styleText = styleText.replace(/\s/g, " ").trim(); // Replace &nbsp; with whitespace.
var styleTextLength = styleText.length;
if (!styleTextLength && updateInterface && !isRevert && this._newProperty && !this._hasBeenModifiedIncrementally()) {
@@ -2537,6 +2525,15 @@ WebInspector.StylesSidebarPane.CSSPropertyPrompt.prototype = {
WebInspector.TextPrompt.prototype.onKeyDown.call(this, event);
},
+ onMouseWheel: function(event)
+ {
+ if (this._handleNameOrValueUpDown(event)) {
+ event.consume(true);
+ return;
+ }
+ WebInspector.TextPrompt.prototype.onMouseWheel.call(this, event);
+ },
+
tabKeyPressed: function()
{
this.acceptAutoComplete();
diff --git a/Source/WebCore/inspector/front-end/TabbedEditorContainer.js b/Source/WebCore/inspector/front-end/TabbedEditorContainer.js
index 0657e90af..ad0576813 100644
--- a/Source/WebCore/inspector/front-end/TabbedEditorContainer.js
+++ b/Source/WebCore/inspector/front-end/TabbedEditorContainer.js
@@ -278,9 +278,7 @@ WebInspector.TabbedEditorContainer.prototype = {
this._tabbedPane.appendTab(tabId, title, view, tooltip, userGesture);
- uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.TitleChanged, this._uiSourceCodeTitleChanged, this);
- uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged, this._uiSourceCodeWorkingCopyChanged, this);
- uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.ContentChanged, this._uiSourceCodeContentChanged, this);
+ this._addUISourceCodeListeners(uiSourceCode);
return tabId;
},
@@ -292,15 +290,15 @@ WebInspector.TabbedEditorContainer.prototype = {
var tabId = /** @type {string} */ event.data.tabId;
var userGesture = /** @type {boolean} */ event.data.isUserGesture;
- this._removeScrollAndSelectionListeners();
var uiSourceCode = this._files[tabId];
+ if (this._currentFile === uiSourceCode) {
+ this._removeScrollAndSelectionListeners();
+ delete this._currentFile;
+ }
this._tabIds.remove(uiSourceCode);
delete this._files[tabId];
- delete this._currentFile;
- uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.TitleChanged, this._uiSourceCodeTitleChanged, this);
- uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged, this._uiSourceCodeWorkingCopyChanged, this);
- uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.ContentChanged, this._uiSourceCodeContentChanged, this);
+ this._removeUISourceCodeListeners(uiSourceCode);
this.dispatchEventToListeners(WebInspector.TabbedEditorContainer.Events.EditorClosed, uiSourceCode);
@@ -339,6 +337,29 @@ WebInspector.TabbedEditorContainer.prototype = {
this._tabbedPane.changeTabTitle(tabId, this._titleForFile(uiSourceCode));
this._tabbedPane.changeTabView(tabId, this._delegate.viewForFile(uiSourceCode));
this._tabbedPane.changeTabTooltip(tabId, this._tooltipForFile(uiSourceCode));
+
+ this._removeUISourceCodeListeners(oldUISourceCode);
+ this._addUISourceCodeListeners(uiSourceCode);
+ },
+
+ /**
+ * @param {WebInspector.UISourceCode} uiSourceCode
+ */
+ _addUISourceCodeListeners: function(uiSourceCode)
+ {
+ uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.TitleChanged, this._uiSourceCodeTitleChanged, this);
+ uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged, this._uiSourceCodeWorkingCopyChanged, this);
+ uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.ContentChanged, this._uiSourceCodeContentChanged, this);
+ },
+
+ /**
+ * @param {WebInspector.UISourceCode} uiSourceCode
+ */
+ _removeUISourceCodeListeners: function(uiSourceCode)
+ {
+ uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.TitleChanged, this._uiSourceCodeTitleChanged, this);
+ uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged, this._uiSourceCodeWorkingCopyChanged, this);
+ uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.ContentChanged, this._uiSourceCodeContentChanged, this);
},
/**
diff --git a/Source/WebCore/inspector/front-end/TestController.js b/Source/WebCore/inspector/front-end/TestController.js
index 20e9c4a75..5a7d9993d 100644
--- a/Source/WebCore/inspector/front-end/TestController.js
+++ b/Source/WebCore/inspector/front-end/TestController.js
@@ -48,6 +48,7 @@ WebInspector.evaluateForTestInFrontend = function(callId, script)
function invokeMethod()
{
try {
+ script = script + "//@ sourceURL=evaluateInWebInspector" + callId + ".js";
var result = window.eval(script);
WebInspector.TestController.prototype.notifyDone(callId, result);
} catch (e) {
diff --git a/Source/WebCore/inspector/front-end/TextEditor.js b/Source/WebCore/inspector/front-end/TextEditor.js
index b93e4e260..4be8f0d81 100644
--- a/Source/WebCore/inspector/front-end/TextEditor.js
+++ b/Source/WebCore/inspector/front-end/TextEditor.js
@@ -34,6 +34,10 @@
*/
WebInspector.TextEditor = function() { };
+WebInspector.TextEditor.Events = {
+ GutterClick: "gutterClick"
+};
+
WebInspector.TextEditor.prototype = {
/**
@@ -63,15 +67,34 @@ WebInspector.TextEditor.prototype = {
/**
* @param {number} lineNumber
- * @param {string|Element} decoration
+ * @param {boolean} disabled
+ * @param {boolean} conditional
+ */
+ addBreakpoint: function(lineNumber, disabled, conditional) { },
+
+ /**
+ * @param {number} lineNumber
+ */
+ removeBreakpoint: function(lineNumber) { },
+
+ /**
+ * @param {number} lineNumber
+ */
+ setExecutionLine: function(lineNumber) { },
+
+ clearExecutionLine: function() { },
+
+ /**
+ * @param {number} lineNumber
+ * @param {Element} element
*/
- addDecoration: function(lineNumber, decoration) { },
+ addDecoration: function(lineNumber, element) { },
/**
* @param {number} lineNumber
- * @param {string|Element} decoration
+ * @param {Element} element
*/
- removeDecoration: function(lineNumber, decoration) { },
+ removeDecoration: function(lineNumber, element) { },
/**
* @param {WebInspector.TextRange} range
@@ -187,15 +210,11 @@ WebInspector.TextEditorDelegate = function()
}
WebInspector.TextEditorDelegate.prototype = {
- beforeTextChanged: function() { },
-
/**
* @param {WebInspector.TextRange} oldRange
* @param {WebInspector.TextRange} newRange
*/
- afterTextChanged: function(oldRange, newRange) { },
-
- commitEditing: function() { },
+ onTextChanged: function(oldRange, newRange) { },
/**
* @param {WebInspector.TextRange} textRange
diff --git a/Source/WebCore/inspector/front-end/TextPrompt.js b/Source/WebCore/inspector/front-end/TextPrompt.js
index 84bbe05d2..c40df4f0c 100644
--- a/Source/WebCore/inspector/front-end/TextPrompt.js
+++ b/Source/WebCore/inspector/front-end/TextPrompt.js
@@ -105,6 +105,7 @@ WebInspector.TextPrompt.prototype = {
this._element = element;
this._boundOnKeyDown = this.onKeyDown.bind(this);
+ this._boundOnMouseWheel = this.onMouseWheel.bind(this);
this._boundSelectStart = this._selectStart.bind(this);
this._proxyElement = element.ownerDocument.createElement("span");
this._proxyElement.style.display = this._proxyElementDisplay;
@@ -112,6 +113,7 @@ WebInspector.TextPrompt.prototype = {
this.proxyElement.appendChild(element);
this._element.addStyleClass("text-prompt");
this._element.addEventListener("keydown", this._boundOnKeyDown, false);
+ this._element.addEventListener("mousewheel", this._boundOnMouseWheel, false);
this._element.addEventListener("selectstart", this._boundSelectStart, false);
if (typeof this._suggestBoxClassName === "string")
@@ -127,6 +129,7 @@ WebInspector.TextPrompt.prototype = {
this.proxyElement.parentElement.removeChild(this.proxyElement);
this._element.removeStyleClass("text-prompt");
this._element.removeEventListener("keydown", this._boundOnKeyDown, false);
+ this._element.removeEventListener("mousewheel", this._boundOnMouseWheel, false);
this._element.removeEventListener("selectstart", this._boundSelectStart, false);
delete this._proxyElement;
WebInspector.restoreFocusFromElement(this._element);
@@ -220,6 +223,11 @@ WebInspector.TextPrompt.prototype = {
return false;
},
+ onMouseWheel: function(event)
+ {
+ // Subclasses can implement.
+ },
+
onKeyDown: function(event)
{
var handled = false;
diff --git a/Source/WebCore/inspector/front-end/TimelineModel.js b/Source/WebCore/inspector/front-end/TimelineModel.js
index 91f9f95d2..77a5b39f8 100644
--- a/Source/WebCore/inspector/front-end/TimelineModel.js
+++ b/Source/WebCore/inspector/front-end/TimelineModel.js
@@ -52,6 +52,8 @@ WebInspector.TimelineModel.RecordType = {
Layout: "Layout",
RecalculateStyles: "RecalculateStyles",
Paint: "Paint",
+ DecodeImage: "DecodeImage",
+ ResizeImage: "ResizeImage",
CompositeLayers: "CompositeLayers",
ParseHTML: "ParseHTML",
diff --git a/Source/WebCore/inspector/front-end/TimelinePanel.js b/Source/WebCore/inspector/front-end/TimelinePanel.js
index bf09bcf94..b6ec0dde9 100644
--- a/Source/WebCore/inspector/front-end/TimelinePanel.js
+++ b/Source/WebCore/inspector/front-end/TimelinePanel.js
@@ -28,6 +28,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+importScript("MemoryStatistics.js");
+importScript("TimelineModel.js");
+importScript("TimelineOverviewPane.js");
+importScript("TimelinePresentationModel.js");
+importScript("TimelineFrameController.js");
+
/**
* @constructor
* @extends {WebInspector.Panel}
@@ -195,11 +201,6 @@ WebInspector.TimelinePanel.prototype = {
return this._calculator;
},
- get toolbarItemLabel()
- {
- return WebInspector.UIString("Timeline");
- },
-
get statusBarItems()
{
return this._statusBarButtons.select("element").concat([
@@ -572,8 +573,6 @@ WebInspector.TimelinePanel.prototype = {
this._sidebarBackgroundElement.style.width = width + "px";
this.onResize();
this._overviewPane.sidebarResized(width);
- // Min width = <number of buttons on the left> * 31
- this._miscStatusBarItems.style.left = Math.max((this._statusBarButtons.length + 3) * 31, width) + "px";
this._memoryStatistics.setSidebarWidth(width);
this._timelineGrid.gridHeaderElement.style.left = width + "px";
},
@@ -585,6 +584,8 @@ WebInspector.TimelinePanel.prototype = {
this._graphRowsElementWidth = this._graphRowsElement.offsetWidth;
this._timelineGrid.gridHeaderElement.style.width = this._itemsGraphsElement.offsetWidth + "px";
this._containerElementHeight = this._containerElement.clientHeight;
+ var minFloatingStatusBarItemsOffset = document.getElementById("panel-status-bar").totalOffsetLeft() + this._statusBarButtons.length * WebInspector.StatusBarButton.width;
+ this._miscStatusBarItems.style.left = Math.max(minFloatingStatusBarItemsOffset, this.splitView.sidebarWidth()) + "px";
},
_clearPanel: function()
@@ -944,7 +945,12 @@ WebInspector.TimelinePanel.prototype = {
popover.show(WebInspector.TimelinePresentationModel.generatePopupContentForFrame(frame), anchor);
} else {
if (anchor.row && anchor.row._record)
- popover.show(anchor.row._record.generatePopupContent(), anchor);
+ anchor.row._record.generatePopupContent(showCallback);
+ }
+
+ function showCallback(popupContent)
+ {
+ popover.show(popupContent, anchor);
}
},
diff --git a/Source/WebCore/inspector/front-end/TimelinePresentationModel.js b/Source/WebCore/inspector/front-end/TimelinePresentationModel.js
index beb30073d..8ebc1123d 100644
--- a/Source/WebCore/inspector/front-end/TimelinePresentationModel.js
+++ b/Source/WebCore/inspector/front-end/TimelinePresentationModel.js
@@ -75,6 +75,8 @@ WebInspector.TimelinePresentationModel.initRecordStyles_ = function()
recordStyles[recordTypes.Layout] = { title: WebInspector.UIString("Layout"), category: categories["rendering"] };
recordStyles[recordTypes.RecalculateStyles] = { title: WebInspector.UIString("Recalculate Style"), category: categories["rendering"] };
recordStyles[recordTypes.Paint] = { title: WebInspector.UIString("Paint"), category: categories["painting"] };
+ recordStyles[recordTypes.DecodeImage] = { title: WebInspector.UIString("Image Decode"), category: categories["painting"] };
+ recordStyles[recordTypes.ResizeImage] = { title: WebInspector.UIString("Image Resize"), category: categories["painting"] };
recordStyles[recordTypes.CompositeLayers] = { title: WebInspector.UIString("Composite Layers"), category: categories["painting"] };
recordStyles[recordTypes.ParseHTML] = { title: WebInspector.UIString("Parse"), category: categories["loading"] };
recordStyles[recordTypes.TimerInstall] = { title: WebInspector.UIString("Install Timer"), category: categories["scripting"] };
@@ -169,6 +171,27 @@ WebInspector.TimelinePresentationModel.forAllRecords = function(recordsArray, pr
}
/**
+ * @param {string=} recordType
+ * @return {boolean}
+ */
+WebInspector.TimelinePresentationModel.needsPreviewElement = function(recordType)
+{
+ if (!recordType)
+ return false;
+ const recordTypes = WebInspector.TimelineModel.RecordType;
+ switch (recordType) {
+ case recordTypes.ScheduleResourceRequest:
+ case recordTypes.ResourceSendRequest:
+ case recordTypes.ResourceReceiveResponse:
+ case recordTypes.ResourceReceivedData:
+ case recordTypes.ResourceFinish:
+ return true;
+ default:
+ return false;
+ }
+}
+
+/**
* @param {string} recordType
* @param {string=} title
*/
@@ -635,10 +658,24 @@ WebInspector.TimelinePresentationModel.Record.prototype = {
return this.startTime <= time && time <= this.endTime;
},
- generatePopupContent: function()
+ /**
+ * @param {function(Element)} callback
+ */
+ generatePopupContent: function(callback)
{
- var contentHelper = new WebInspector.TimelinePresentationModel.PopupContentHelper(this.title);
+ if (WebInspector.TimelinePresentationModel.needsPreviewElement(this.type))
+ WebInspector.buildImagePreviewContents(this.url, false, this._generatePopupContentWithImagePreview.bind(this, callback));
+ else
+ this._generatePopupContentWithImagePreview(callback);
+ },
+ /**
+ * @param {function(Element)} callback
+ * @param {Element=} previewElement
+ */
+ _generatePopupContentWithImagePreview: function(callback, previewElement)
+ {
+ var contentHelper = new WebInspector.TimelinePresentationModel.PopupContentHelper(this.title);
var text = WebInspector.UIString("%s (at %s)", Number.secondsToString(this._lastChildEndTime - this.startTime, true),
Number.secondsToString(this._startTimeOffset));
contentHelper._appendTextRow(WebInspector.UIString("Duration"), text);
@@ -676,6 +713,8 @@ WebInspector.TimelinePresentationModel.Record.prototype = {
case recordTypes.ResourceReceivedData:
case recordTypes.ResourceFinish:
contentHelper._appendElementRow(WebInspector.UIString("Resource"), this._linkifyLocation(this.url));
+ if (previewElement)
+ contentHelper._appendElementRow(WebInspector.UIString("Preview"), previewElement);
if (this.data["requestMethod"])
contentHelper._appendTextRow(WebInspector.UIString("Request Method"), this.data["requestMethod"]);
if (typeof this.data["statusCode"] === "number")
@@ -718,7 +757,7 @@ WebInspector.TimelinePresentationModel.Record.prototype = {
if (this.stackTrace)
contentHelper._appendStackTrace(WebInspector.UIString("Call Stack"), this.stackTrace, this._linkifyCallFrame.bind(this));
- return contentHelper._contentTable;
+ callback(contentHelper._contentTable);
},
_refreshDetails: function()
@@ -751,6 +790,10 @@ WebInspector.TimelinePresentationModel.Record.prototype = {
return this.data ? this.data["type"] : null;
case WebInspector.TimelineModel.RecordType.Paint:
return this.data["width"] + "\u2009\u00d7\u2009" + this.data["height"];
+ case WebInspector.TimelineModel.RecordType.DecodeImage:
+ return this.data["imageType"];
+ case WebInspector.TimelineModel.RecordType.ResizeImage:
+ return this.data["cached"] ? WebInspector.UIString("cached") : WebInspector.UIString("non-cached");
case WebInspector.TimelineModel.RecordType.TimerInstall:
case WebInspector.TimelineModel.RecordType.TimerRemove:
return this._linkifyTopCallFrame(this.data["timerId"]);
@@ -854,6 +897,7 @@ WebInspector.TimelinePresentationModel._generateAggregatedInfo = function(aggreg
/**
* @constructor
+ * @param {string} title
*/
WebInspector.TimelinePresentationModel.PopupContentHelper = function(title)
{
diff --git a/Source/WebCore/inspector/front-end/Toolbar.js b/Source/WebCore/inspector/front-end/Toolbar.js
index 372ff67ac..9a5e4a258 100644
--- a/Source/WebCore/inspector/front-end/Toolbar.js
+++ b/Source/WebCore/inspector/front-end/Toolbar.js
@@ -42,16 +42,18 @@ WebInspector.Toolbar = function()
document.getElementById("close-button-left").addEventListener("click", this._onClose, true);
document.getElementById("close-button-right").addEventListener("click", this._onClose, true);
+ this._coalescingLevel = 0;
}
WebInspector.Toolbar.prototype = {
- set compact(compact)
+ /**
+ * @param {boolean} enabled
+ */
+ setCoalescingUpdate: function(enabled)
{
- if (compact)
- this.element.addStyleClass("toolbar-small");
- else
- this.element.removeStyleClass("toolbar-small");
- this._updateDropdownButtonAndHideDropdown();
+ this._coalescingLevel += enabled ? 1 : -1;
+ if (!this._coalescingLevel)
+ this._updateDropdownButtonAndHideDropdown();
},
resize: function()
@@ -59,13 +61,53 @@ WebInspector.Toolbar.prototype = {
this._updateDropdownButtonAndHideDropdown();
},
- addPanel: function(panel)
+ /**
+ * @param {WebInspector.PanelDescriptor} panelDescriptor
+ */
+ addPanel: function(panelDescriptor)
{
- this.element.appendChild(panel.toolbarItem);
+ this.element.appendChild(this._createPanelToolbarItem(panelDescriptor));
this.resize();
},
/**
+ * @param {WebInspector.PanelDescriptor} panelDescriptor
+ * @return {Element}
+ */
+ _createPanelToolbarItem: function(panelDescriptor)
+ {
+ var toolbarItem = document.createElement("button");
+ toolbarItem.className = "toolbar-item toggleable";
+ toolbarItem.panelDescriptor = panelDescriptor;
+ toolbarItem.addStyleClass(panelDescriptor.name());
+
+ function onToolbarItemClicked()
+ {
+ this._updateDropdownButtonAndHideDropdown();
+ WebInspector.inspectorView.setCurrentPanel(panelDescriptor.panel());
+ }
+ toolbarItem.addEventListener("click", onToolbarItemClicked.bind(this), false);
+
+ function panelSelected()
+ {
+ if (WebInspector.inspectorView.currentPanel() && panelDescriptor.name() === WebInspector.inspectorView.currentPanel().name)
+ toolbarItem.addStyleClass("toggled-on");
+ else
+ toolbarItem.removeStyleClass("toggled-on");
+ }
+ WebInspector.inspectorView.addEventListener(WebInspector.InspectorView.Events.PanelSelected, panelSelected);
+
+ var iconElement = toolbarItem.createChild("div", "toolbar-icon");
+ toolbarItem.createChild("div", "toolbar-label").textContent = panelDescriptor.title();
+ if (panelDescriptor.iconURL()) {
+ iconElement.addStyleClass("custom-toolbar-icon");
+ iconElement.style.backgroundImage = "url(" + panelDescriptor.iconURL() + ")";
+ }
+ panelSelected();
+ return toolbarItem;
+ },
+
+ /**
* @return {boolean}
*/
_toolbarDragStart: function(event)
@@ -122,7 +164,7 @@ WebInspector.Toolbar.prototype = {
if (!this._dropdown) {
if (!visible)
return;
- this._dropdown = new WebInspector.ToolbarDropdown();
+ this._dropdown = new WebInspector.ToolbarDropdown(this);
}
if (visible)
this._dropdown.show();
@@ -137,6 +179,8 @@ WebInspector.Toolbar.prototype = {
_updateDropdownButtonAndHideDropdown: function()
{
+ if (this._coalescingLevel)
+ return;
this._setDropdownVisible(false);
var toolbar = document.getElementById("toolbar");
@@ -147,36 +191,13 @@ WebInspector.Toolbar.prototype = {
}
}
-WebInspector.Toolbar.createPanelToolbarItem = function(panel)
-{
- var toolbarItem = document.createElement("button");
- toolbarItem.className = "toolbar-item toggleable";
- toolbarItem.panel = panel;
- toolbarItem.addStyleClass(panel._panelName);
- function onToolbarItemClicked()
- {
- WebInspector.toolbar._updateDropdownButtonAndHideDropdown();
- WebInspector.inspectorView.setCurrentPanel(panel);
- }
- toolbarItem.addEventListener("click", onToolbarItemClicked, false);
-
- var iconElement = toolbarItem.createChild("div", "toolbar-icon");
-
- if ("toolbarItemLabel" in panel)
- toolbarItem.createChild("div", "toolbar-label").textContent = panel.toolbarItemLabel;
-
- if (panel === WebInspector.inspectorView.currentPanel())
- toolbarItem.addStyleClass("toggled-on");
-
- return toolbarItem;
-}
-
/**
* @constructor
+ * @param {WebInspector.Toolbar} toolbar
*/
-WebInspector.ToolbarDropdown = function()
+WebInspector.ToolbarDropdown = function(toolbar)
{
- this._toolbar = document.getElementById("toolbar");
+ this._toolbar = toolbar;
this._arrow = document.getElementById("toolbar-dropdown-arrow");
this.element = document.createElement("div");
this.element.id = "toolbar-dropdown";
@@ -198,7 +219,7 @@ WebInspector.ToolbarDropdown.prototype = {
this.element.style.top = top + "px";
this.element.style.left = this._arrow.totalOffsetLeft() + "px";
this._contentElement.style.maxHeight = window.innerHeight - top - 20 + "px";
- this._toolbar.appendChild(this.element);
+ this._toolbar.element.appendChild(this.element);
},
hide: function()
@@ -217,11 +238,11 @@ WebInspector.ToolbarDropdown.prototype = {
_populate: function()
{
- var toolbarItems = this._toolbar.querySelectorAll(".toolbar-item.toggleable");
+ var toolbarItems = this._toolbar.element.querySelectorAll(".toolbar-item.toggleable");
for (var i = 0; i < toolbarItems.length; ++i) {
if (toolbarItems[i].offsetTop > 0)
- this._contentElement.appendChild(WebInspector.Toolbar.createPanelToolbarItem(toolbarItems[i].panel));
+ this._contentElement.appendChild(this._toolbar._createPanelToolbarItem(toolbarItems[i].panelDescriptor));
}
},
diff --git a/Source/WebCore/inspector/front-end/UISourceCode.js b/Source/WebCore/inspector/front-end/UISourceCode.js
index eb08c8d65..17aaaa0b1 100644
--- a/Source/WebCore/inspector/front-end/UISourceCode.js
+++ b/Source/WebCore/inspector/front-end/UISourceCode.js
@@ -65,9 +65,6 @@ WebInspector.UISourceCode = function(url, resource, contentProvider, sourceMappi
this.history = [];
this._restoreRevisionHistory();
this._formatterMapping = new WebInspector.IdentityFormatterSourceMapping();
-
- // FIXME: postpone formattedChanged call to after the mapping has been established.
- setTimeout(this.formattedChanged.bind(this), 0);
}
WebInspector.UISourceCode.Events = {
diff --git a/Source/WebCore/inspector/front-end/UISourceCodeFrame.js b/Source/WebCore/inspector/front-end/UISourceCodeFrame.js
index 4a39f2155..e93b4f8a7 100644
--- a/Source/WebCore/inspector/front-end/UISourceCodeFrame.js
+++ b/Source/WebCore/inspector/front-end/UISourceCodeFrame.js
@@ -57,9 +57,10 @@ WebInspector.UISourceCodeFrame.prototype = {
this._isCommittingEditing = true;
this._uiSourceCode.commitWorkingCopy(this._didEditContent.bind(this));
+ delete this._isCommittingEditing;
},
- afterTextChanged: function(oldRange, newRange)
+ onTextChanged: function(oldRange, newRange)
{
this._uiSourceCode.setWorkingCopy(this._textEditor.text());
},
@@ -70,7 +71,6 @@ WebInspector.UISourceCodeFrame.prototype = {
WebInspector.log(error, WebInspector.ConsoleMessage.MessageLevel.Error, true);
return;
}
- delete this._isCommittingEditing;
},
/**
diff --git a/Source/WebCore/inspector/front-end/UIUtils.js b/Source/WebCore/inspector/front-end/UIUtils.js
index 7f93f0d22..44ceb41d9 100644
--- a/Source/WebCore/inspector/front-end/UIUtils.js
+++ b/Source/WebCore/inspector/front-end/UIUtils.js
@@ -308,22 +308,48 @@ WebInspector.CSSNumberRegex = /^(-?(?:\d+(?:\.\d+)?|\.\d+))$/;
WebInspector.StyleValueDelimiters = " \xA0\t\n\"':;,/()";
+
+/**
+ * @param {Event} event
+ * @return {?string}
+ */
+WebInspector._valueModificationDirection = function(event)
+{
+ var direction = null;
+ if (event.type === "mousewheel") {
+ if (event.wheelDeltaY > 0)
+ direction = "Up";
+ else if (event.wheelDeltaY < 0)
+ direction = "Down";
+ } else {
+ if (event.keyIdentifier === "Up" || event.keyIdentifier === "PageUp")
+ direction = "Up";
+ else if (event.keyIdentifier === "Down" || event.keyIdentifier === "PageDown")
+ direction = "Down";
+ }
+ return direction;
+}
+
/**
* @param {string} hexString
* @param {Event} event
*/
WebInspector._modifiedHexValue = function(hexString, event)
{
+ var direction = WebInspector._valueModificationDirection(event);
+ if (!direction)
+ return hexString;
+
var number = parseInt(hexString, 16);
if (isNaN(number) || !isFinite(number))
return hexString;
var maxValue = Math.pow(16, hexString.length) - 1;
- var arrowKeyPressed = (event.keyIdentifier === "Up" || event.keyIdentifier === "Down");
-
+ var arrowKeyOrMouseWheelEvent = (event.keyIdentifier === "Up" || event.keyIdentifier === "Down" || event.type === "mousewheel");
var delta;
- if (arrowKeyPressed)
- delta = (event.keyIdentifier === "Up") ? 1 : -1;
+
+ if (arrowKeyOrMouseWheelEvent)
+ delta = (direction === "Up") ? 1 : -1;
else
delta = (event.keyIdentifier === "PageUp") ? 16 : -16;
@@ -349,19 +375,23 @@ WebInspector._modifiedHexValue = function(hexString, event)
*/
WebInspector._modifiedFloatNumber = function(number, event)
{
- var arrowKeyPressed = (event.keyIdentifier === "Up" || event.keyIdentifier === "Down");
+ var direction = WebInspector._valueModificationDirection(event);
+ if (!direction)
+ return number;
+
+ var arrowKeyOrMouseWheelEvent = (event.keyIdentifier === "Up" || event.keyIdentifier === "Down" || event.type === "mousewheel");
// Jump by 10 when shift is down or jump by 0.1 when Alt/Option is down.
// Also jump by 10 for page up and down, or by 100 if shift is held with a page key.
var changeAmount = 1;
- if (event.shiftKey && !arrowKeyPressed)
+ if (event.shiftKey && !arrowKeyOrMouseWheelEvent)
changeAmount = 100;
- else if (event.shiftKey || !arrowKeyPressed)
+ else if (event.shiftKey || !arrowKeyOrMouseWheelEvent)
changeAmount = 10;
else if (event.altKey)
changeAmount = 0.1;
- if (event.keyIdentifier === "Down" || event.keyIdentifier === "PageDown")
+ if (direction === "Down")
changeAmount *= -1;
// Make the new number and constrain it to a precision of 6, this matches numbers the engine returns.
@@ -382,9 +412,9 @@ WebInspector._modifiedFloatNumber = function(number, event)
*/
WebInspector.handleElementValueModifications = function(event, element, finishHandler, suggestionHandler, customNumberHandler)
{
- var arrowKeyPressed = (event.keyIdentifier === "Up" || event.keyIdentifier === "Down");
+ var arrowKeyOrMouseWheelEvent = (event.keyIdentifier === "Up" || event.keyIdentifier === "Down" || event.type === "mousewheel");
var pageKeyPressed = (event.keyIdentifier === "PageUp" || event.keyIdentifier === "PageDown");
- if (!arrowKeyPressed && !pageKeyPressed)
+ if (!arrowKeyOrMouseWheelEvent && !pageKeyPressed)
return false;
var selection = window.getSelection();
@@ -1009,6 +1039,54 @@ WebInspector.revertDomChanges = function(domChanges)
}
/**
+ * @param {string} imageURL
+ * @param {boolean} showDimensions
+ * @param {function(Element=)} userCallback
+ * @param {Object=} precomputedDimensions
+ */
+WebInspector.buildImagePreviewContents = function(imageURL, showDimensions, userCallback, precomputedDimensions)
+{
+ var resource = WebInspector.resourceTreeModel.resourceForURL(imageURL);
+ if (!resource) {
+ userCallback();
+ return;
+ }
+
+ var imageElement = document.createElement("img");
+ imageElement.addEventListener("load", buildContent, false);
+ imageElement.addEventListener("error", errorCallback, false);
+ resource.populateImageSource(imageElement);
+
+ function errorCallback()
+ {
+ // Drop the event parameter when invoking userCallback.
+ userCallback();
+ }
+
+ function buildContent()
+ {
+ var container = document.createElement("table");
+ container.className = "image-preview-container";
+ var naturalWidth = precomputedDimensions ? precomputedDimensions.naturalWidth : imageElement.naturalWidth;
+ var naturalHeight = precomputedDimensions ? precomputedDimensions.naturalHeight : imageElement.naturalHeight;
+ var offsetWidth = precomputedDimensions ? precomputedDimensions.offsetWidth : naturalWidth;
+ var offsetHeight = precomputedDimensions ? precomputedDimensions.offsetHeight : naturalHeight;
+ var description;
+ if (showDimensions) {
+ if (offsetHeight === naturalHeight && offsetWidth === naturalWidth)
+ description = WebInspector.UIString("%d \xd7 %d pixels", offsetWidth, offsetHeight);
+ else
+ description = WebInspector.UIString("%d \xd7 %d pixels (Natural: %d \xd7 %d pixels)", offsetWidth, offsetHeight, naturalWidth, naturalHeight);
+ }
+
+ container.createChild("tr").createChild("td", "image-container").appendChild(imageElement);
+ if (description)
+ container.createChild("tr").createChild("td").createChild("span", "description").textContent = description;
+ userCallback(container);
+ }
+}
+
+/**
* @param {WebInspector.ContextMenu} contextMenu
* @param {Node} contextNode
* @param {Event} event
diff --git a/Source/WebCore/inspector/front-end/WebKit.qrc b/Source/WebCore/inspector/front-end/WebKit.qrc
index 6e745be6f..dde4e13a0 100644
--- a/Source/WebCore/inspector/front-end/WebKit.qrc
+++ b/Source/WebCore/inspector/front-end/WebKit.qrc
@@ -102,6 +102,7 @@
<file>Linkifier.js</file>
<file>MemoryStatistics.js</file>
<file>MetricsSidebarPane.js</file>
+ <file>NativeBreakpointsSidebarPane.js</file>
<file>NativeMemorySnapshotView.js</file>
<file>NavigatorOverlayController.js</file>
<file>NavigatorView.js</file>
@@ -161,6 +162,7 @@
<file>SidebarOverlay.js</file>
<file>SidebarPane.js</file>
<file>SidebarTreeElement.js</file>
+ <file>SnippetJavaScriptSourceFrame.js</file>
<file>SnippetStorage.js</file>
<file>SoftContextMenu.js</file>
<file>SourceCSSTokenizer.js</file>
@@ -172,7 +174,8 @@
<file>Spectrum.js</file>
<file>SplitView.js</file>
<file>StatusBarButton.js</file>
- <file>StylesPanel.js</file>
+ <file>StyleSheetOutlineDialog.js</file>
+ <file>StyleSource.js</file>
<file>StylesSidebarPane.js</file>
<file>TabbedEditorContainer.js</file>
<file>TabbedPane.js</file>
diff --git a/Source/WebCore/inspector/front-end/cmdevtools.css b/Source/WebCore/inspector/front-end/cmdevtools.css
index 9f330b15c..c4b83c113 100644
--- a/Source/WebCore/inspector/front-end/cmdevtools.css
+++ b/Source/WebCore/inspector/front-end/cmdevtools.css
@@ -1,9 +1,33 @@
+.CodeMirror {
+ line-height: 1.2em !important;
+}
.CodeMirror-scroll {
height: 100% !important;
}
-.CodeMirror {
- line-height: 1.2em !important;
+.cm-highlight {
+ -webkit-animation: "fadeout" 2s 0s;
+}
+@-webkit-keyframes fadeout {
+ from {background-color: rgb(255, 255, 120); }
+ to { background-color: white; }
+}
+.cm-breakpoint {
+ color: white !important;
+ margin-right: -8px !important;
+ margin-left: -6px !important;
+ border-width: 0 8px 0px 2px !important;
+ -webkit-border-image: url(Images/breakpointBorder.png) 1 14 1 2;
+}
+.cm-breakpoint-disabled {
+ opacity: 0.5;
+}
+.cm-breakpoint-conditional {
+ -webkit-border-image: url(Images/breakpointConditionalBorder.png) 1 14 1 2;
+}
+.cm-execution-line {
+ background-color: rgb(171, 191, 254) !important;
+ outline: 1px solid rgb(64, 115, 244);
}
.cm-s-web-inspector-js span.cm-keyword {color: rgb(170, 13, 145);}
@@ -26,3 +50,34 @@
.cm-s-web-inspector-html span.cm-tag {color: rgb(136, 18, 128);}
.cm-s-web-inspector-html span.cm-attribute {color: rgb(153, 69, 0);}
.cm-s-web-inspector-html span.cm-link {color: #00e;}
+
+.webkit-html-message-bubble {
+ -webkit-box-shadow: black 0px 2px 5px;
+ -webkit-border-radius: 9px;
+ -webkit-border-fit: lines;
+ font-size: 10px;
+ font-family: Lucida Grande, sans-serif;
+ font-weight: bold;
+ margin: 0px 10px;
+ padding: 0 7px 1px;
+ z-index: 5;
+}
+.webkit-html-warning-message {
+ background-color: rgb(100%, 62%, 42%);
+ border: 2px solid rgb(100%, 52%, 21%);
+}
+.webkit-html-error-message {
+ background-color: rgb(100%, 42%, 42%);
+ border: 2px solid rgb(100%, 31%, 31%);
+}
+.webkit-html-message-line {
+ padding-left: 23px;
+ text-indent: -20px;
+}
+.webkit-html-message-line-hover {
+ padding-left: 23px;
+ text-indent: -20px;
+ white-space: auto;
+ text-overflow: auto;
+ overflow: auto;
+}
diff --git a/Source/WebCore/inspector/front-end/elementsPanel.css b/Source/WebCore/inspector/front-end/elementsPanel.css
index 27bd3d814..7389a8dab 100644
--- a/Source/WebCore/inspector/front-end/elementsPanel.css
+++ b/Source/WebCore/inspector/front-end/elementsPanel.css
@@ -566,11 +566,12 @@
.image-preview-container {
background: transparent;
text-align: center;
- padding-left: 11px;
}
.image-preview-container img {
margin: 2px auto;
+ max-width: 100px;
+ max-height: 100px;
background-image: url(Images/checker.png);
-webkit-user-select: text;
-webkit-user-drag: auto;
diff --git a/Source/WebCore/inspector/front-end/externs.js b/Source/WebCore/inspector/front-end/externs.js
index 4b2f80754..ac508bf70 100644
--- a/Source/WebCore/inspector/front-end/externs.js
+++ b/Source/WebCore/inspector/front-end/externs.js
@@ -96,6 +96,13 @@ Array.prototype.partition = function(comparator, left, right, pivotIndex) {}
*/
Array.prototype.qselect = function(k, comparator) {}
+/**
+ * @this {Array.<*>}
+ * @param {string} field
+ * @return {Array.<*>}
+ */
+Array.prototype.select = function(field) {}
+
DOMApplicationCache.prototype.UNCACHED = 0;
DOMApplicationCache.prototype.IDLE = 1;
DOMApplicationCache.prototype.CHECKING = 2;
@@ -112,14 +119,6 @@ InspectorBackend.runAfterPendingDispatches = function(message) {}
// FIXME: remove everything below.
var WebInspector = {}
-
-/**
- * @param {NetworkAgent.RequestId} requestId
- * @return {?WebInspector.NetworkRequest}
- */
-WebInspector.networkRequestById = function(requestId)
-{
-}
WebInspector.panels = {};
@@ -239,3 +238,5 @@ difflib.SequenceMatcher.prototype.get_opcodes = function() { return []; }
/** @constructor */
WebInspector.CodeMirrorTextEditor = function(url, delegate) { }
+
+WebInspector.ProfileURLRegExp = "";
diff --git a/Source/WebCore/inspector/front-end/inspector.css b/Source/WebCore/inspector/front-end/inspector.css
index 2e27c0b4c..0f69372cd 100644
--- a/Source/WebCore/inspector/front-end/inspector.css
+++ b/Source/WebCore/inspector/front-end/inspector.css
@@ -111,18 +111,22 @@ body.compact.inactive #toolbar {
background-image: url(Images/toolbarIcons.png);
}
-.toolbar-small .toolbar-icon {
+body.compact .toolbar-icon {
width: 24px;
height: 24px;
vertical-align: middle;
background-image: url(Images/toolbarIconsSmall.png);
}
+body.compact .toolbar-icon.custom-toolbar-icon {
+ background-position-x: -32px;
+}
+
.toolbar-item:active .toolbar-icon {
background-position-y: 32px;
}
-.toolbar-small .toolbar-item:active .toolbar-icon {
+body.compact .toolbar-item:active .toolbar-icon {
background-position-y: 24px;
}
@@ -136,7 +140,7 @@ body.compact.inactive #toolbar {
text-shadow: none;
}
-.toolbar-small .toolbar-label {
+body.compact .toolbar-label {
display: inline-block;
margin-left: 3px;
position: relative;
@@ -271,6 +275,14 @@ body.detached.platform-mac-snowleopard #toolbar-dropdown {
width: 165px;
}
+.filter {
+ -webkit-appearance: none;
+ border: 0;
+ padding: 0 2px;
+ margin: 0;
+ width: 251px;
+}
+
.search-replace:focus {
outline: none;
}
@@ -314,8 +326,8 @@ body.detached.platform-mac-snowleopard #toolbar-dropdown {
.toolbar-search button {
border: 1px solid rgb(163, 163, 163);
- border-radius: 12px;
- margin: 0 6px;
+ border-radius: 8px;
+ margin: 0 0px;
font-size: 11px;
background-image: -webkit-linear-gradient(rgb(241, 241, 241), rgb(220, 220, 220));
width: 100%;
@@ -383,7 +395,7 @@ body.detached.platform-mac-snowleopard #toolbar-dropdown {
background-position-x: -32px;
}
-.toolbar-small .toolbar-item.resources .toolbar-icon {
+body.compact .toolbar-item.resources .toolbar-icon {
background-position-x: -24px;
}
@@ -391,7 +403,7 @@ body.detached.platform-mac-snowleopard #toolbar-dropdown {
background-position-x: -64px;
}
-.toolbar-small .toolbar-item.network .toolbar-icon {
+body.compact .toolbar-item.network .toolbar-icon {
background-position-x: -48px;
}
@@ -399,7 +411,7 @@ body.detached.platform-mac-snowleopard #toolbar-dropdown {
background-position-x: -96px;
}
-.toolbar-small .toolbar-item.scripts .toolbar-icon {
+body.compact .toolbar-item.scripts .toolbar-icon {
background-position-x: -72px;
}
@@ -407,7 +419,7 @@ body.detached.platform-mac-snowleopard #toolbar-dropdown {
background-position-x: -128px;
}
-.toolbar-small .toolbar-item.timeline .toolbar-icon {
+body.compact .toolbar-item.timeline .toolbar-icon {
background-position-x: -96px;
}
@@ -415,7 +427,7 @@ body.detached.platform-mac-snowleopard #toolbar-dropdown {
background-position-x: -160px;
}
-.toolbar-small .toolbar-item.profiles .toolbar-icon {
+body.compact .toolbar-item.profiles .toolbar-icon {
background-position-x: -120px;
}
@@ -423,7 +435,7 @@ body.detached.platform-mac-snowleopard #toolbar-dropdown {
background-position-x: -192px;
}
-.toolbar-small .toolbar-item.audits .toolbar-icon {
+body.compact .toolbar-item.audits .toolbar-icon {
background-position-x: -144px;
}
@@ -431,7 +443,7 @@ body.detached.platform-mac-snowleopard #toolbar-dropdown {
background-position-x: -224px;
}
-.toolbar-small .toolbar-item.console .toolbar-icon {
+body.compact .toolbar-item.console .toolbar-icon {
background-position-x: -168px;
}
@@ -2573,7 +2585,9 @@ body.platform-mac .search-drawer-header input[type="checkbox"].search-config-che
}
#bottom-status-bar-container {
- -webkit-flex: 1 0;
+ -webkit-flex: 1 1 0;
+ width: 0;
+ overflow: hidden;
}
.search-status-bar-item {
diff --git a/Source/WebCore/inspector/front-end/inspector.html b/Source/WebCore/inspector/front-end/inspector.html
index 70ea41524..7785f7d1f 100644
--- a/Source/WebCore/inspector/front-end/inspector.html
+++ b/Source/WebCore/inspector/front-end/inspector.html
@@ -65,7 +65,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="Panel.js"></script>
<script type="text/javascript" src="InspectorView.js"></script>
<script type="text/javascript" src="AdvancedSearchController.js"></script>
- <script type="text/javascript" src="TimelineGrid.js"></script>
+ <script type="text/javascript" src="TimelineGrid.js"></script>
<script type="text/javascript" src="ContentProvider.js"></script>
<script type="text/javascript" src="Resource.js"></script>
<script type="text/javascript" src="NetworkRequest.js"></script>
@@ -78,19 +78,15 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="ResourceUtils.js"></script>
<script type="text/javascript" src="ResourceType.js"></script>
<script type="text/javascript" src="TimelineManager.js"></script>
- <script type="text/javascript" src="TimelineModel.js"></script>
<script type="text/javascript" src="UserAgentSupport.js"></script>
<script type="text/javascript" src="Database.js"></script>
<script type="text/javascript" src="DOMStorage.js"></script>
- <script type="text/javascript" src="DOMStorageItemsView.js"></script>
<script type="text/javascript" src="DataGrid.js"></script>
<script type="text/javascript" src="ShowMoreDataGridNode.js"></script>
<script type="text/javascript" src="CookiesTable.js"></script>
<script type="text/javascript" src="CookieItemsView.js"></script>
<script type="text/javascript" src="ApplicationCacheModel.js"></script>
- <script type="text/javascript" src="ApplicationCacheItemsView.js"></script>
<script type="text/javascript" src="IndexedDBModel.js"></script>
- <script type="text/javascript" src="IndexedDBViews.js"></script>
<script type="text/javascript" src="Spectrum.js"></script>
<script type="text/javascript" src="SidebarPane.js"></script>
<script type="text/javascript" src="ElementsTreeOutline.js"></script>
@@ -101,60 +97,24 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="RemoteObject.js"></script>
<script type="text/javascript" src="ObjectPropertiesSection.js"></script>
<script type="text/javascript" src="ObjectPopoverHelper.js"></script>
- <script type="text/javascript" src="BreakpointsSidebarPane.js"></script>
+ <script type="text/javascript" src="NativeBreakpointsSidebarPane.js"></script>
<script type="text/javascript" src="DOMBreakpointsSidebarPane.js"></script>
- <script type="text/javascript" src="CallStackSidebarPane.js"></script>
- <script type="text/javascript" src="ScopeChainSidebarPane.js"></script>
- <script type="text/javascript" src="WatchExpressionsSidebarPane.js"></script>
- <script type="text/javascript" src="WorkersSidebarPane.js"></script>
- <script type="text/javascript" src="MetricsSidebarPane.js"></script>
- <script type="text/javascript" src="PropertiesSidebarPane.js"></script>
- <script type="text/javascript" src="EventListenersSidebarPane.js"></script>
<script type="text/javascript" src="Color.js"></script>
<script type="text/javascript" src="CSSCompletions.js"></script>
<script type="text/javascript" src="CSSKeywordCompletions.js"></script>
- <script type="text/javascript" src="StylesSidebarPane.js"></script>
<script type="text/javascript" src="PanelEnablerView.js"></script>
<script type="text/javascript" src="StatusBarButton.js"></script>
- <script type="text/javascript" src="ElementsPanel.js"></script>
- <script type="text/javascript" src="NetworkPanel.js"></script>
<script type="text/javascript" src="TextEditor.js"></script>
<script type="text/javascript" src="DefaultTextEditor.js"></script>
- <script type="text/javascript" src="CodeMirrorTextEditor.js"></script>
<script type="text/javascript" src="SourceFrame.js"></script>
- <script type="text/javascript" src="UISourceCodeFrame.js"></script>
- <script type="text/javascript" src="ResourceView.js"></script>
- <script type="text/javascript" src="RequestView.js"></script>
- <script type="text/javascript" src="JavaScriptSourceFrame.js"></script>
<script type="text/javascript" src="SplitView.js"></script>
- <script type="text/javascript" src="TabbedEditorContainer.js"></script>
- <script type="text/javascript" src="ScriptsPanel.js"></script>
- <script type="text/javascript" src="RevisionHistoryView.js"></script>
- <script type="text/javascript" src="ScriptsNavigator.js"></script>
- <script type="text/javascript" src="ResourcesPanel.js"></script>
- <script type="text/javascript" src="ProfilesPanel.js"></script>
<script type="text/javascript" src="ConsolePanel.js"></script>
<script type="text/javascript" src="ExtensionAPI.js"></script>
<script type="text/javascript" src="ExtensionAuditCategory.js"></script>
<script type="text/javascript" src="ExtensionServer.js"></script>
<script type="text/javascript" src="ExtensionView.js"></script>
<script type="text/javascript" src="ExtensionPanel.js"></script>
- <script type="text/javascript" src="AuditsPanel.js"></script>
- <script type="text/javascript" src="AuditResultView.js"></script>
- <script type="text/javascript" src="AuditLauncherView.js"></script>
- <script type="text/javascript" src="AuditRules.js"></script>
- <script type="text/javascript" src="AuditCategories.js"></script>
- <script type="text/javascript" src="AuditFormatters.js"></script>
- <script type="text/javascript" src="NetworkItemView.js"></script>
<script type="text/javascript" src="EmptyView.js"></script>
- <script type="text/javascript" src="RequestHeadersView.js"></script>
- <script type="text/javascript" src="RequestCookiesView.js"></script>
- <script type="text/javascript" src="RequestTimingView.js"></script>
- <script type="text/javascript" src="RequestJSONView.js"></script>
- <script type="text/javascript" src="RequestHTMLView.js"></script>
- <script type="text/javascript" src="RequestResponseView.js"></script>
- <script type="text/javascript" src="RequestPreviewView.js"></script>
- <script type="text/javascript" src="ResourceWebSocketFrameView.js"></script>
<script type="text/javascript" src="ScriptFormatter.js"></script>
<script type="text/javascript" src="DOMSyntaxHighlighter.js"></script>
<script type="text/javascript" src="TextEditorModel.js"></script>
@@ -163,29 +123,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="SourceCSSTokenizer.js"></script>
<script type="text/javascript" src="SourceHTMLTokenizer.js"></script>
<script type="text/javascript" src="SourceJavaScriptTokenizer.js"></script>
- <script type="text/javascript" src="DirectoryContentView.js"></script>
- <script type="text/javascript" src="FileContentView.js"></script>
<script type="text/javascript" src="FileSystemModel.js"></script>
- <script type="text/javascript" src="FileSystemView.js"></script>
<script type="text/javascript" src="FileUtils.js"></script>
- <script type="text/javascript" src="FontView.js"></script>
- <script type="text/javascript" src="ImageView.js"></script>
- <script type="text/javascript" src="DatabaseTableView.js"></script>
- <script type="text/javascript" src="DatabaseQueryView.js"></script>
- <script type="text/javascript" src="ProfileLauncherView.js"></script>
- <script type="text/javascript" src="ProfileDataGridTree.js"></script>
- <script type="text/javascript" src="BottomUpProfileDataGridTree.js"></script>
- <script type="text/javascript" src="TopDownProfileDataGridTree.js"></script>
- <script type="text/javascript" src="CPUProfileView.js"></script>
- <script type="text/javascript" src="CSSSelectorProfileView.js"></script>
- <script type="text/javascript" src="HeapSnapshot.js"></script>
- <script type="text/javascript" src="HeapSnapshotProxy.js"></script>
- <script type="text/javascript" src="HeapSnapshotWorkerDispatcher.js"></script>
- <script type="text/javascript" src="HeapSnapshotGridNodes.js"></script>
- <script type="text/javascript" src="HeapSnapshotLoader.js"></script>
- <script type="text/javascript" src="HeapSnapshotDataGrids.js"></script>
- <script type="text/javascript" src="HeapSnapshotView.js"></script>
- <script type="text/javascript" src="NativeMemorySnapshotView.js"></script>
<script type="text/javascript" src="DebuggerModel.js"></script>
<script type="text/javascript" src="SourceMapping.js"></script>
<script type="text/javascript" src="UISourceCode.js"></script>
@@ -201,16 +140,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="ResourceScriptMapping.js"></script>
<script type="text/javascript" src="CompilerScriptMapping.js"></script>
<script type="text/javascript" src="SASSSourceMapping.js"></script>
- <script type="text/javascript" src="ScriptsSearchScope.js"></script>
<script type="text/javascript" src="DOMAgent.js"></script>
- <script type="text/javascript" src="TimelinePresentationModel.js"></script>
- <script type="text/javascript" src="TimelinePanel.js"></script>
- <script type="text/javascript" src="TimelineOverviewPane.js"></script>
- <script type="text/javascript" src="TimelineFrameController.js"></script>
<script type="text/javascript" src="TestController.js"></script>
<script type="text/javascript" src="Dialog.js"></script>
<script type="text/javascript" src="GoToLineDialog.js"></script>
- <script type="text/javascript" src="FilteredItemSelectionDialog.js"></script>
<script type="text/javascript" src="SidebarOverlay.js"></script>
<script type="text/javascript" src="SettingsScreen.js"></script>
<script type="text/javascript" src="ShortcutsScreen.js"></script>
@@ -222,11 +155,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="UserMetrics.js"></script>
<script type="text/javascript" src="JavaScriptContextManager.js"></script>
<script type="text/javascript" src="HandlerRegistry.js"></script>
- <script type="text/javascript" src="MemoryStatistics.js"></script>
<script type="text/javascript" src="SnippetStorage.js"></script>
<script type="text/javascript" src="ScriptSnippetModel.js"></script>
- <script type="text/javascript" src="StylesPanel.js"></script>
<script type="text/javascript" src="ProgressBar.js"></script>
+ <script type="text/javascript" src="StyleSource.js"></script>
</head>
<body class="detached" id="-webkit-web-inspector">
<div id="toolbar">
diff --git a/Source/WebCore/inspector/front-end/inspector.js b/Source/WebCore/inspector/front-end/inspector.js
index a39246bb8..91ee54f03 100644
--- a/Source/WebCore/inspector/front-end/inspector.js
+++ b/Source/WebCore/inspector/front-end/inspector.js
@@ -29,7 +29,7 @@
*/
var WebInspector = {
- _createPanels: function()
+ _panelDescriptors: function()
{
this.panels = {};
WebInspector.inspectorView = new WebInspector.InspectorView();
@@ -37,35 +37,36 @@ var WebInspector = {
WebInspector.inspectorView.show(parentElement);
WebInspector.inspectorView.addEventListener(WebInspector.InspectorView.Events.PanelSelected, this._panelSelected, this);
+ var elements = new WebInspector.PanelDescriptor("elements", WebInspector.UIString("Elements"), "ElementsPanel", "ElementsPanel.js");
+ var resources = new WebInspector.PanelDescriptor("resources", WebInspector.UIString("Resources"), "ResourcesPanel", "ResourcesPanel.js");
+ var network = new WebInspector.PanelDescriptor("network", WebInspector.UIString("Network"), "NetworkPanel", "NetworkPanel.js");
+ var scripts = new WebInspector.PanelDescriptor("scripts", WebInspector.UIString("Sources"), "ScriptsPanel", "ScriptsPanel.js");
+ var timeline = new WebInspector.PanelDescriptor("timeline", WebInspector.UIString("Timeline"), "TimelinePanel", "TimelinePanel.js");
+ var profiles = new WebInspector.PanelDescriptor("profiles", WebInspector.UIString("Profiles"), "ProfilesPanel", "ProfilesPanel.js");
+ var audits = new WebInspector.PanelDescriptor("audits", WebInspector.UIString("Audits"), "AuditsPanel", "AuditsPanel.js");
+ var console = new WebInspector.PanelDescriptor("console", WebInspector.UIString("Console"), "ConsolePanel");
+ var allDescriptors = [elements, resources, network, scripts, timeline, profiles, audits, console];
+
+ var panelDescriptors = [];
if (WebInspector.WorkerManager.isWorkerFrontend()) {
- this.panels.scripts = new WebInspector.ScriptsPanel();
- this.panels.timeline = new WebInspector.TimelinePanel();
- this.panels.profiles = new WebInspector.ProfilesPanel();
- this.panels.console = new WebInspector.ConsolePanel();
- return;
+ panelDescriptors.push(scripts);
+ panelDescriptors.push(timeline);
+ panelDescriptors.push(profiles);
+ panelDescriptors.push(console);
+ return panelDescriptors;
}
+ var allDescriptors = [elements, resources, network, scripts, timeline, profiles, audits, console];
var hiddenPanels = (InspectorFrontendHost.hiddenPanels() || "").split(',');
- if (hiddenPanels.indexOf("elements") === -1)
- this.panels.elements = new WebInspector.ElementsPanel();
- if (hiddenPanels.indexOf("resources") === -1)
- this.panels.resources = new WebInspector.ResourcesPanel();
- if (hiddenPanels.indexOf("network") === -1)
- this.panels.network = new WebInspector.NetworkPanel();
- if (hiddenPanels.indexOf("scripts") === -1)
- this.panels.scripts = new WebInspector.ScriptsPanel();
- if (hiddenPanels.indexOf("timeline") === -1)
- this.panels.timeline = new WebInspector.TimelinePanel();
- if (hiddenPanels.indexOf("profiles") === -1)
- this.panels.profiles = new WebInspector.ProfilesPanel();
- if (hiddenPanels.indexOf("audits") === -1)
- this.panels.audits = new WebInspector.AuditsPanel();
- if (hiddenPanels.indexOf("console") === -1)
- this.panels.console = new WebInspector.ConsolePanel();
+ for (var i = 0; i < allDescriptors.length; ++i) {
+ if (hiddenPanels.indexOf(allDescriptors[i].name) === -1)
+ panelDescriptors.push(allDescriptors[i]);
+ }
+ return panelDescriptors;
},
_panelSelected: function()
{
- this._toggleConsoleButton.disabled = WebInspector.inspectorView.currentPanel() === WebInspector.panels.console;
+ this._toggleConsoleButton.disabled = WebInspector.inspectorView.currentPanel().name === "console";
},
_createGlobalStatusBarItems: function()
@@ -83,8 +84,12 @@ var WebInspector = {
this._toggleConsoleButton.addEventListener("click", this._toggleConsoleButtonClicked.bind(this), false);
mainStatusBar.insertBefore(this._toggleConsoleButton.element, bottomStatusBarContainer);
- if (this.panels.elements)
- mainStatusBar.insertBefore(this.panels.elements.nodeSearchButton.element, bottomStatusBarContainer);
+ if (!WebInspector.WorkerManager.isWorkerFrontend()) {
+ this._nodeSearchButton = new WebInspector.StatusBarButton(WebInspector.UIString("Select an element in the page to inspect it."), "node-search-status-bar-item");
+ this._nodeSearchButton.addEventListener("click", this._toggleSearchingForNode, this);
+ mainStatusBar.insertBefore(this._nodeSearchButton.element, bottomStatusBarContainer);
+ }
+
mainStatusBar.appendChild(this.settingsController.statusBarItem);
},
@@ -251,14 +256,7 @@ var WebInspector = {
body.addStyleClass("compact");
else
body.removeStyleClass("compact");
-
- // This may be called before doLoadedDone, hence the bulk of inspector objects may
- // not be created yet.
- if (WebInspector.toolbar)
- WebInspector.toolbar.compact = x;
-
- if (WebInspector.drawer)
- WebInspector.drawer.resize();
+ WebInspector.windowResize();
},
_updateErrorAndWarningCounts: function()
@@ -321,15 +319,6 @@ var WebInspector = {
errorWarningElement.title = null;
},
- /**
- * @param {NetworkAgent.RequestId} requestId
- * @return {?WebInspector.NetworkRequest}
- */
- networkRequestById: function(requestId)
- {
- return this.panels.network.requestById(requestId);
- },
-
get inspectedPageDomain()
{
var parsedURL = WebInspector.inspectedPageURL && WebInspector.inspectedPageURL.asParsedURL();
@@ -365,6 +354,36 @@ var WebInspector = {
{
WebInspector.settings.zoomLevel.set(this._zoomLevel);
InspectorFrontendHost.setZoomFactor(Math.pow(1.2, this._zoomLevel));
+ },
+
+ _toggleSearchingForNode: function()
+ {
+ var enabled = !this._nodeSearchButton.toggled;
+ /**
+ * @param {?Protocol.Error} error
+ */
+ function callback(error)
+ {
+ if (!error)
+ this._nodeSearchButton.toggled = enabled;
+ }
+ WebInspector.domAgent.setInspectModeEnabled(enabled, callback.bind(this));
+ },
+
+ _profilesLinkifier: function(title)
+ {
+ var profileStringMatches = WebInspector.ProfileURLRegExp.exec(title);
+ if (profileStringMatches) {
+ var profilesPanel = /** @ type {WebInspector.ProfilesPanel} */ WebInspector.panel("profiles");
+ title = WebInspector.ProfilesPanel._instance.displayTitleForProfileLink(profileStringMatches[2], profileStringMatches[1]);
+ }
+ return title;
+ },
+
+ _debuggerPaused: function()
+ {
+ // Create scripts panel upon demand.
+ WebInspector.panel("scripts");
}
}
@@ -439,6 +458,8 @@ WebInspector.doLoadedDone = function()
PageAgent.canOverrideDeviceMetrics(WebInspector._initializeCapability.bind(WebInspector, "canOverrideDeviceMetrics", null));
PageAgent.canOverrideGeolocation(WebInspector._initializeCapability.bind(WebInspector, "canOverrideGeolocation", null));
PageAgent.canOverrideDeviceOrientation(WebInspector._initializeCapability.bind(WebInspector, "canOverrideDeviceOrientation", WebInspector._doLoadedDoneWithCapabilities.bind(WebInspector)));
+ if ("debugLoad" in WebInspector.queryParamsObject)
+ WebInspector._doLoadedDoneWithCapabilities();
}
WebInspector._doLoadedDoneWithCapabilities = function()
@@ -455,9 +476,6 @@ WebInspector._doLoadedDoneWithCapabilities = function()
this.console.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._updateErrorAndWarningCounts, this);
this.console.addEventListener(WebInspector.ConsoleModel.Events.RepeatCountUpdated, this._updateErrorAndWarningCounts, this);
- this.debuggerModel = new WebInspector.DebuggerModel();
- this.breakpointManager = new WebInspector.BreakpointManager(WebInspector.settings.breakpoints, this.debuggerModel);
-
WebInspector.CSSCompletions.requestCSSNameCompletions();
this.drawer = new WebInspector.Drawer();
@@ -465,6 +483,8 @@ WebInspector._doLoadedDoneWithCapabilities = function()
this.networkManager = new WebInspector.NetworkManager();
this.resourceTreeModel = new WebInspector.ResourceTreeModel(this.networkManager);
+ this.debuggerModel = new WebInspector.DebuggerModel();
+ this.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this);
this.networkLog = new WebInspector.NetworkLog();
this.domAgent = new WebInspector.DOMAgent();
this.javaScriptContextManager = new WebInspector.JavaScriptContextManager(this.resourceTreeModel, this.consoleView);
@@ -495,17 +515,21 @@ WebInspector._doLoadedDoneWithCapabilities = function()
this.openAnchorLocationRegistry.registerHandler(autoselectPanel, function() { return false; });
this.workspace = new WebInspector.Workspace();
+ this.breakpointManager = new WebInspector.BreakpointManager(WebInspector.settings.breakpoints, this.debuggerModel, this.workspace);
- this._createPanels();
this._createGlobalStatusBarItems();
- this.toolbar = new WebInspector.Toolbar();
WebInspector._installDockToRight();
- for (var panelName in this.panels)
- this.addPanel(this.panels[panelName]);
+ this.toolbar = new WebInspector.Toolbar();
+ this.toolbar.setCoalescingUpdate(true);
+ var panelDescriptors = this._panelDescriptors();
+ for (var i = 0; i < panelDescriptors.length; ++i)
+ WebInspector.inspectorView.addPanel(panelDescriptors[i]);
+ this.toolbar.setCoalescingUpdate(false);
this.addMainEventListeners(document);
+ WebInspector.registerLinkifierPlugin(this._profilesLinkifier.bind(this));
window.addEventListener("resize", this.windowResize.bind(this), true);
@@ -527,6 +551,9 @@ WebInspector._doLoadedDoneWithCapabilities = function()
DatabaseAgent.enable();
DOMStorageAgent.enable();
+ if (!Capabilities.profilerCausesRecompilation || WebInspector.settings.profilerEnabled.get())
+ ProfilerAgent.enable();
+
if (WebInspector.settings.showPaintRects.get())
PageAgent.setShowPaintRects(true);
@@ -569,11 +596,6 @@ WebInspector._installDockToRight = function()
}
}
-WebInspector.addPanel = function(panel)
-{
- WebInspector.inspectorView.addPanel(panel);
-}
-
var windowLoaded = function()
{
var localizedStringsURL = InspectorFrontendHost.localizedStringsURL();
@@ -620,10 +642,14 @@ WebInspector.dispatchMessageFromBackend = function(messageObject)
WebInspector.windowResize = function(event)
{
- WebInspector.inspectorView.doResize();
- WebInspector.drawer.resize();
- WebInspector.toolbar.resize();
- WebInspector.settingsController.resize();
+ if (WebInspector.inspectorView)
+ WebInspector.inspectorView.doResize();
+ if (WebInspector.drawer)
+ WebInspector.drawer.resize();
+ if (WebInspector.toolbar)
+ WebInspector.toolbar.resize();
+ if (WebInspector.settingsController)
+ WebInspector.settingsController.resize();
}
WebInspector.setDockingUnavailable = function(unavailable)
@@ -655,7 +681,7 @@ WebInspector.documentClick = function(event)
if (WebInspector.isBeingEdited(event.target) || WebInspector._showAnchorLocation(anchor))
return;
- const profileMatch = WebInspector.ProfileType.URLRegExp.exec(anchor.href);
+ const profileMatch = WebInspector.ProfileURLRegExp.exec(anchor.href);
if (profileMatch) {
WebInspector.showProfileForURL(anchor.href);
return;
@@ -665,7 +691,7 @@ WebInspector.documentClick = function(event)
if (parsedURL && parsedURL.scheme === "webkit-link-action") {
if (parsedURL.host === "show-panel") {
var panel = parsedURL.path.substring(1);
- if (WebInspector.panels[panel])
+ if (WebInspector.panel(panel))
WebInspector.showPanel(panel);
}
return;
@@ -691,10 +717,9 @@ WebInspector.documentClick = function(event)
WebInspector.openResource = function(resourceURL, inResourcesPanel)
{
var resource = WebInspector.resourceForURL(resourceURL);
- if (inResourcesPanel && resource) {
- WebInspector.showPanel("resources");
- WebInspector.panels.resources.showResource(resource);
- } else
+ if (inResourcesPanel && resource)
+ WebInspector.showPanel("resources").showResource(resource);
+ else
InspectorFrontendHost.openInNewTab(resourceURL);
}
@@ -720,7 +745,7 @@ WebInspector._registerShortcuts = function()
var advancedSearchShortcut = WebInspector.AdvancedSearchController.createShortcut();
section.addKey(advancedSearchShortcut.name, WebInspector.UIString("Search across all sources"));
- var openResourceShortcut = WebInspector.OpenResourceDialog.createShortcut();
+ var openResourceShortcut = WebInspector.KeyboardShortcut.makeDescriptor("o", WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta);
section.addKey(openResourceShortcut.name, WebInspector.UIString("Go to source"));
if (WebInspector.isMac()) {
@@ -770,7 +795,7 @@ WebInspector.documentKeyDown = function(event)
switch (event.keyIdentifier) {
case "U+004F": // O key
if (!event.shiftKey && !event.altKey && WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)) {
- WebInspector.panels.scripts.showGoToSourceDialog();
+ WebInspector.showPanel("scripts").showGoToSourceDialog();
event.consume(true);
}
break;
@@ -814,6 +839,22 @@ WebInspector.documentKeyDown = function(event)
}
break;
}
+
+ // Cmd/Control + Shift + C should be a shortcut to clicking the Node Search Button.
+ // This shortcut matches Firebug.
+ if (event.keyIdentifier === "U+0043") { // C key
+ if (WebInspector.isMac())
+ var isNodeSearchKey = event.metaKey && !event.ctrlKey && !event.altKey && event.shiftKey;
+ else
+ var isNodeSearchKey = event.ctrlKey && !event.metaKey && !event.altKey && event.shiftKey;
+
+ if (isNodeSearchKey) {
+ this._toggleSearchingForNode();
+ event.consume(true);
+ return;
+ }
+ return;
+ }
}
WebInspector.postDocumentKeyDown = function(event)
@@ -853,14 +894,6 @@ WebInspector.contextMenuEventFired = function(event)
event.preventDefault();
}
-WebInspector.toggleSearchingForNode = function()
-{
- if (this.panels.elements) {
- this.showPanel("elements");
- this.panels.elements.toggleSearchingForNode();
- }
-}
-
WebInspector.showConsole = function()
{
if (WebInspector._toggleConsoleButton && !WebInspector._toggleConsoleButton.toggled) {
@@ -872,13 +905,12 @@ WebInspector.showConsole = function()
WebInspector.showPanel = function(panel)
{
- if (!(panel in this.panels)) {
- if (WebInspector.WorkerManager.isWorkerFrontend())
- panel = "scripts";
- else
- panel = "elements";
- }
- WebInspector.inspectorView.setCurrentPanel(this.panels[panel]);
+ return WebInspector.inspectorView.showPanel(panel);
+}
+
+WebInspector.panel = function(panel)
+{
+ return WebInspector.inspectorView.panel(panel);
}
WebInspector.bringToFront = function()
@@ -965,45 +997,45 @@ WebInspector.inspect = function(payload, hints)
{
var object = WebInspector.RemoteObject.fromPayload(payload);
if (object.subtype === "node") {
- // Request node from backend and focus it.
- WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.elements);
- object.pushNodeToFrontend(WebInspector.updateFocusedNode.bind(WebInspector), object.release.bind(object));
+ function callback(nodeId)
+ {
+ WebInspector._updateFocusedNode(nodeId);
+ object.release();
+ }
+ object.pushNodeToFrontend(callback);
return;
}
- if (hints.databaseId) {
- WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.resources);
- WebInspector.panels.resources.selectDatabase(hints.databaseId);
- } else if (hints.domStorageId) {
- WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.resources);
- WebInspector.panels.resources.selectDOMStorage(hints.domStorageId);
- }
+ if (hints.databaseId)
+ WebInspector.showPanel("resources").selectDatabase(hints.databaseId);
+ else if (hints.domStorageId)
+ WebInspector.showPanel("resources").selectDOMStorage(hints.domStorageId);
object.release();
}
-WebInspector.updateFocusedNode = function(nodeId)
+WebInspector._updateFocusedNode = function(nodeId)
{
- this.panels.elements.revealAndSelectNode(nodeId);
+ if (WebInspector._nodeSearchButton.toggled) {
+ InspectorFrontendHost.bringToFront();
+ WebInspector._nodeSearchButton.toggled = false;
+ }
+ WebInspector.showPanel("elements").revealAndSelectNode(nodeId);
}
WebInspector._showAnchorLocation = function(anchor)
{
if (WebInspector.openAnchorLocationRegistry.dispatch({ url: anchor.href, lineNumber: anchor.lineNumber}))
return true;
- var preferredPanels = [];
- if (this.panels[anchor.preferredPanel])
- preferredPanels.push(this.panels[anchor.preferredPanel]);
- if (this.panels.scripts)
- preferredPanels.push(this.panels.scripts);
- if (this.panels.resources)
- preferredPanels.push(this.panels.resources);
- if (this.panels.network)
- preferredPanels.push(this.panels.network);
- for (var i = 0; i < preferredPanels.length; ++i) {
- if (WebInspector._showAnchorLocationInPanel(anchor, preferredPanels[i]))
- return true;
- }
+ var preferredPanel = this.panels[anchor.preferredPanel];
+ if (preferredPanel && WebInspector._showAnchorLocationInPanel(anchor, preferredPanel))
+ return true;
+ if (WebInspector._showAnchorLocationInPanel(anchor, this.panel("scripts")))
+ return true;
+ if (WebInspector._showAnchorLocationInPanel(anchor, this.panel("resources")))
+ return true;
+ if (WebInspector._showAnchorLocationInPanel(anchor, this.panel("network")))
+ return true;
return false;
}
@@ -1031,8 +1063,7 @@ WebInspector.showPanelForAnchorNavigation = function(panel)
WebInspector.showProfileForURL = function(url)
{
- WebInspector.showPanel("profiles");
- WebInspector.panels.profiles.showProfileForURL(url);
+ WebInspector.showPanel("profiles").showProfileForURL(url);
}
WebInspector.evaluateInConsole = function(expression, showResultOnly)
@@ -1056,9 +1087,4 @@ WebInspector.frontendReused = function()
this.resourceTreeModel.frontendReused();
}
-WebInspector._toolbarItemClicked = function(event)
-{
- var toolbarItem = event.currentTarget;
- WebInspector.inspectorView.setCurrentPanel(toolbarItem.panel);
-}
-
+WebInspector.ProfileURLRegExp = /webkit-profile:\/\/(.+)\/(.+)#([0-9]+)/;
diff --git a/Source/WebCore/inspector/front-end/networkLogView.css b/Source/WebCore/inspector/front-end/networkLogView.css
index f454194e1..d1c10d2bb 100644
--- a/Source/WebCore/inspector/front-end/networkLogView.css
+++ b/Source/WebCore/inspector/front-end/networkLogView.css
@@ -470,15 +470,15 @@
display: none;
}
-.network-log-grid.data-grid.filter-all table.data tr.revealed.network-item,
-.network-log-grid.data-grid.filter-document table.data tr.revealed.network-type-document,
-.network-log-grid.data-grid.filter-stylesheet table.data tr.revealed.network-type-stylesheet,
-.network-log-grid.data-grid.filter-image table.data tr.revealed.network-type-image,
-.network-log-grid.data-grid.filter-script table.data tr.revealed.network-type-script,
-.network-log-grid.data-grid.filter-xhr table.data tr.revealed.network-type-xhr,
-.network-log-grid.data-grid.filter-font table.data tr.revealed.network-type-font,
-.network-log-grid.data-grid.filter-websocket table.data tr.revealed.network-type-websocket,
-.network-log-grid.data-grid.filter-other table.data tr.revealed.network-type-other {
+.network-log-grid.data-grid.filter-all table.data tr.revealed.network-item:not(.filtered-out),
+.network-log-grid.data-grid.filter-document table.data tr.revealed.network-type-document:not(.filtered-out),
+.network-log-grid.data-grid.filter-stylesheet table.data tr.revealed.network-type-stylesheet:not(.filtered-out),
+.network-log-grid.data-grid.filter-image table.data tr.revealed.network-type-image:not(.filtered-out),
+.network-log-grid.data-grid.filter-script table.data tr.revealed.network-type-script:not(.filtered-out),
+.network-log-grid.data-grid.filter-xhr table.data tr.revealed.network-type-xhr:not(.filtered-out),
+.network-log-grid.data-grid.filter-font table.data tr.revealed.network-type-font:not(.filtered-out),
+.network-log-grid.data-grid.filter-websocket table.data tr.revealed.network-type-websocket:not(.filtered-out),
+.network-log-grid.data-grid.filter-other table.data tr.revealed.network-type-other:not(.filtered-out) {
display: table-row;
}
diff --git a/Source/WebCore/inspector/front-end/test-runner.html b/Source/WebCore/inspector/front-end/test-runner.html
new file mode 100644
index 000000000..3edf2c580
--- /dev/null
+++ b/Source/WebCore/inspector/front-end/test-runner.html
@@ -0,0 +1,365 @@
+<html>
+<script src="jsdifflib.js"></script>
+<script src="utilities.js"></script>
+<script src="DOMExtension.js"></script>
+<script src="treeoutline.js"></script>
+
+<link rel="stylesheet" type="text/css" href="inspector.css">
+<style>
+:focus {
+ outline: none;
+}
+
+.failed {
+ color: red;
+}
+
+.timeout {
+ color: brown;
+}
+
+iframe {
+ width: 0;
+ height: 0;
+ opacity: 0;
+}
+
+</style>
+
+<script>
+
+var layoutTestsServer = "http://localhost:8002/";
+var scannerServer = "http://localhost:8002/";
+var remoteDebuggingServer = "http://localhost:9222/";
+
+var tests = [];
+var skipList = [
+ // HALT
+ "inspector/console/console-api-on-call-frame.html",
+
+ // FAILED
+ "inspector/console/console-dir-global.html",
+ "inspector/console/console-log-toString-object.html",
+ "inspector/console/console-uncaught-exception-in-eval.html",
+ "inspector/elements/edit-dom-actions.html",
+ "inspector/elements/highlight-node-scaled.html",
+ "inspector/elements/highlight-node-scroll.html",
+ "inspector/elements/highlight-node.html",
+ "inspector/elements/highlight-svg-root.html",
+ "inspector/network-status-non-http.html",
+ "inspector/storage-panel-dom-storage-update.html",
+ "inspector/styles/inject-stylesheet.html",
+ "inspector/styles/protocol-css-regions-commands.html",
+ "inspector/styles/region-style-crash.html",
+ "inspector/styles/styles-disable-then-enable-overriden-ua.html",
+ "inspector/styles/styles-url-linkify.html",
+ "inspector/styles/vendor-prefixes.html",
+ "inspector/timeline/timeline-event-dispatch.html",
+ "inspector/timeline/timeline-frames.html",
+ "inspector/timeline/timeline-network-resource.html",
+ "inspector/timeline/timeline-paint.html",
+ "inspector/timeline/timeline-receive-response-event.html",
+
+ // TIMEOUT
+ "inspector/profiler/cpu-profiler-profiling-without-inspector.html",
+ "inspector/profiler/heap-snapshot-inspect-dom-wrapper.html",
+ "inspector/timeline/timeline-network-received-data.html",
+];
+var treeOutline = null;
+
+function run(debug)
+{
+ if (window.runner && debug) {
+ window.runner.continueDebugging();
+ return;
+ }
+
+ if (window.testScannerIframe)
+ document.body.removeChild(window.testScannerIframe);
+
+ if (window.runner)
+ window.runner.cleanup();
+
+ window.testScannerIframe = document.createElement("iframe");
+ window.testScannerIframe.src = scannerServer + "LayoutTests/http/tests/inspector/resources/test-scanner.html";
+ document.body.appendChild(window.testScannerIframe);
+ window.debug = debug;
+}
+
+function runTests()
+{
+ document.getElementById("outline").removeChildren();
+ treeOutline = new TreeOutline(document.getElementById("outline"));
+
+ document.getElementById("pass").textContent = 0;
+ document.getElementById("skip").textContent = 0;
+ document.getElementById("fail").textContent = 0;
+ document.getElementById("timeout").textContent = 0;
+ document.getElementById("remaining").textContent = tests.length;
+
+ runNextTest();
+}
+
+function interrupt()
+{
+ tests = [];
+}
+
+function runNextTest(lastResult)
+{
+ if (lastResult) {
+ var element = document.getElementById(lastResult);
+ element.textContent = parseInt(element.textContent) + 1;
+
+ element = document.getElementById("remaining");
+ element.textContent = parseInt(element.textContent) - 1;
+ if (window.debug) {
+ document.getElementById("debug").textContent = "Debug";
+ return;
+ }
+ }
+
+ var test;
+ var filter = document.getElementById("filter").value;
+ while (test = tests.shift()) {
+ if (!filter || test[0].match(filter)) {
+ new StandaloneTestRunner(layoutTestsServer + test[0], test[1], runNextTest.bind(null));
+ return;
+ }
+ }
+}
+
+function StandaloneTestRunner(testPath, expected, next)
+{
+ this._testPath = testPath;
+ this._next = next;
+ this._expected = expected;
+ this._pendingMessages = [];
+
+ this._treeElement = new TreeElement(testPath);
+ treeOutline.appendChild(this._treeElement);
+
+ for (var i = 0; !window.debug && i < skipList.length; ++i) {
+ if (testPath.indexOf(skipList[i]) !== -1) {
+ this._treeElement.title = testPath + ": SKIPPED";
+ this._next("skip");
+ return;
+ }
+ }
+ window.runner = this;
+ this._testPage = window.open("about:blank", "inspected", "width=800,height=600");
+
+ window.remoteDebuggingHandshake = this._remoteDebuggingHandshake.bind(this);
+ var script = document.createElement("script");
+ script.src = remoteDebuggingServer + "json?jsonp=remoteDebuggingHandshake";
+ document.head.appendChild(script);
+}
+
+StandaloneTestRunner.FrontendLocation = "inspector.html";
+
+StandaloneTestRunner.prototype = {
+ _remoteDebuggingHandshake: function(data)
+ {
+ for (var i = 0; i < data.length; ++i) {
+ if (data[i].url !== "about:blank")
+ continue;
+ this._debuggerURL = data[i].webSocketDebuggerUrl.replace("://", "=");
+ this._navigateTestPage();
+ break;
+ }
+ },
+
+ _navigateTestPage: function()
+ {
+ this._testPage.location.href = this._testPath;
+ var width = localStorage.getItem('inspectorWidth') || 600;
+ var height = localStorage.getItem('inspectorHeight') || 400;
+ var features = "width=" + Math.max(width , 600) + ",height=" + Math.max(height, 400);
+ this._inspectorWindowLoading = window.open(StandaloneTestRunner.FrontendLocation + "?" + this._debuggerURL, "inspector", features);
+
+ window.addEventListener('unload', this.cleanup.bind(this));
+
+ if (!window.debug)
+ this._watchDog = setTimeout(this._timeout.bind(this), 10000);
+ },
+
+ loadCompleted: function()
+ {
+ if (!window.debug) {
+ this._loadCompleted(this);
+ return;
+ }
+ document.getElementById("debug").textContent = "Continue";
+ },
+
+ continueDebugging: function()
+ {
+ this._loadCompleted();
+ },
+
+ _loadCompleted: function()
+ {
+ this._inspectorWindow = this._inspectorWindowLoading;
+ for (var i = 0; i < this._pendingMessages.length; ++i)
+ this._inspectorWindow.postMessage(this._pendingMessages[i], "*");
+ this._pendingMessages = [];
+ },
+
+ closeWebInspector: function()
+ {
+ if (!window.debug)
+ this._inspectorWindow.close();
+ },
+
+ notifyDone: function(actual)
+ {
+ if (this._done)
+ return;
+ this._done = true;
+
+ if (!window.debug)
+ this.cleanup()
+
+ clearTimeout(this._watchDog);
+
+ this._treeElement.onselect = this.onTreeElementSelect.bind(this);
+
+ // TODO pavel is the RHS || condition wanted?
+ if (actual === this._expected || actual === this._expected + "\n") {
+ this._treeElement.title = this._testPath + ": SUCCESS";
+ this._next("pass");
+ return;
+ }
+
+ this._treeElement.title = this._testPath + ": FAILED";
+ this._treeElement.listItemElement.addStyleClass("failed");
+
+ var baseLines = difflib.stringAsLines(this._expected);
+ var newLines = difflib.stringAsLines(actual);
+ var sm = new difflib.SequenceMatcher(baseLines, newLines);
+ var opcodes = sm.get_opcodes();
+ var lastWasSeparator = false;
+
+ for (var idx = 0; idx < opcodes.length; idx++) {
+ var code = opcodes[idx];
+ var change = code[0];
+ var b = code[1];
+ var be = code[2];
+ var n = code[3];
+ var ne = code[4];
+ var rowCount = Math.max(be - b, ne - n);
+ var topRows = [];
+ var bottomRows = [];
+ for (var i = 0; i < rowCount; i++) {
+ if (change === "delete" || (change === "replace" && b < be)) {
+ var lineNumber = b++;
+ this._treeElement.appendChild(new TreeElement("- [" + lineNumber + "] " + baseLines[lineNumber]));
+ }
+
+ if (change === "insert" || (change === "replace" && n < ne)) {
+ var lineNumber = n++;
+ this._treeElement.appendChild(new TreeElement("+ [" + lineNumber + "] " + newLines[lineNumber]));
+ }
+
+ if (change === "equal") {
+ b++;
+ n++;
+ }
+ }
+ }
+
+ this._next("fail");
+ },
+
+ evaluateInWebInspector: function(callId, script)
+ {
+ if (this._inspectorWindow)
+ this._inspectorWindow.postMessage(["evaluateForTest", callId, script], "*");
+ else
+ this._pendingMessages.push(["evaluateForTest", callId, script]);
+ },
+
+ _timeout: function()
+ {
+ this._treeElement.title = this._testPath + ": TIMEOUT";
+ this._treeElement.listItemElement.addStyleClass("timeout");
+ this._done = true;
+ this.cleanup();
+ this._next("timeout");
+ },
+
+ cleanup: function ()
+ {
+ localStorage.setItem('inspectorWidth', this._inspectorWindowLoading.outerWidth);
+ localStorage.setItem('inspectorHeight', this._inspectorWindowLoading.outerHeight);
+ this._inspectorWindowLoading.close();
+ this._testPage.close();
+ delete window.runner;
+ },
+
+ onTreeElementSelect: function ()
+ {
+ var baseEndSentinel = '/inspector/';
+ var baseChars = this._testPath.indexOf(baseEndSentinel) + baseEndSentinel.length;
+ if (baseChars > 0)
+ document.getElementById("filter").value = this._testPath.substr(baseChars);
+ },
+
+ display: function() { }
+}
+
+function onMessageFromTestPage(event)
+{
+ var signature = event.data;
+ var method = signature.shift();
+ if (method === "tests") {
+ tests = signature[0];
+ runTests();
+ return;
+ }
+
+ if (window.runner)
+ window.runner[method].apply(window.runner, signature);
+}
+
+function onload()
+{
+ var queryParamsObject = {};
+ var queryParams = window.location.search;
+ if (!queryParams)
+ return;
+ var params = queryParams.substring(1).split("&");
+ for (var i = 0; i < params.length; ++i) {
+ var pair = params[i].split("=");
+ queryParamsObject[pair[0]] = pair[1];
+ }
+ if ("filter" in queryParamsObject)
+ document.getElementById("filter").value = queryParamsObject["filter"];
+}
+
+window.addEventListener("message", onMessageFromTestPage, true);
+
+</script>
+<body onload="onload()">
+This is a standalone test suite for inspector front-end. Here is how you run it:
+<ul>
+<li>Check out WebKit source tree: git clone http://git.chromium.org/external/Webkit.git</li>
+<li>Run "Tools/Scripts/new-run-webkit-httpd --root=. --port=8002 --server=start"</li>
+<li>Run Chrome Canary (ToT Chromium) with following flags: "--remote-debugging-port=9222 --user-data-dir=testProfile http://localhost:8002/Source/WebCore/inspector/front-end/test-runner.html</li>
+</ul>
+
+<button onclick="run()">Run</button>
+<button id="debug" onclick="run(true)">Debug</button>
+<button onclick="interrupt()">Interrupt</button>
+Filter: <input id="filter" type="text" size="40"></input><small><i>Click on results to load filter</i></small><br>
+
+<span>Passed: <span id="pass">0</span></span>
+<span>Failed: <span id="fail">0</span></span>
+<span>Timeout: <span id="timeout">0</span></span>
+<span>Skipped: <span id="skip">0</span></span>
+<span>Remaining: <span id="remaining">0</span><br>
+
+<ol id="outline" style="font-size: 12px !important" class="source-code outline-disclosure"></ol>
+
+</body>
+</html>
diff --git a/Source/WebCore/inspector/front-end/timelinePanel.css b/Source/WebCore/inspector/front-end/timelinePanel.css
index 56c63ea6c..f5381bcc4 100644
--- a/Source/WebCore/inspector/front-end/timelinePanel.css
+++ b/Source/WebCore/inspector/front-end/timelinePanel.css
@@ -654,3 +654,21 @@
background-color: rgba(255, 255, 255, 0.75);
z-index: 350;
}
+
+.image-preview-container {
+ background: transparent;
+ text-align: left;
+ border-spacing: 0;
+}
+
+.image-preview-container img {
+ max-width: 100px;
+ max-height: 100px;
+ background-image: url(Images/checker.png);
+ -webkit-user-select: text;
+ -webkit-user-drag: auto;
+}
+
+.image-container {
+ padding: 0;
+}
diff --git a/Source/WebCore/inspector/front-end/utilities.js b/Source/WebCore/inspector/front-end/utilities.js
index 46898bf31..f215ce157 100644
--- a/Source/WebCore/inspector/front-end/utilities.js
+++ b/Source/WebCore/inspector/front-end/utilities.js
@@ -781,3 +781,19 @@ StringPool.prototype = {
}
}
}
+
+var _importedScripts = {};
+
+/**
+ * @param {string} scriptName
+ */
+function importScript(scriptName)
+{
+ if (_importedScripts[scriptName])
+ return;
+ _importedScripts[scriptName] = true;
+ var xhr = new XMLHttpRequest();
+ xhr.open("GET", scriptName, false);
+ xhr.send(null);
+ window.eval(xhr.responseText + "\n//@ sourceURL=" + scriptName);
+}
diff --git a/Source/WebCore/inspector/inline-javascript-imports.py b/Source/WebCore/inspector/inline-javascript-imports.py
index 5f1d9e464..e0a194f09 100755
--- a/Source/WebCore/inspector/inline-javascript-imports.py
+++ b/Source/WebCore/inspector/inline-javascript-imports.py
@@ -65,7 +65,7 @@ def main(argv):
importFile.close()
return importScript
- outputScript = re.sub(r'importScripts\([\'"]([^\'"]+)[\'"]\)', replace, inputScript)
+ outputScript = re.sub(r'importScripts?\([\'"]([^\'"]+)[\'"]\)', replace, inputScript)
outputFile = open(outputFileName, 'w')
outputFile.write(outputScript)
diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp
index 32ff28c32..3be9bb653 100644
--- a/Source/WebCore/loader/DocumentLoader.cpp
+++ b/Source/WebCore/loader/DocumentLoader.cpp
@@ -363,11 +363,18 @@ void DocumentLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
info.addInstrumentedHashSet(m_subresourceLoaders);
info.addInstrumentedHashSet(m_multipartSubresourceLoaders);
info.addInstrumentedHashSet(m_plugInStreamLoaders);
+ info.addInstrumentedMember(m_substituteData);
info.addMember(m_pageTitle.string());
info.addMember(m_overrideEncoding);
info.addVector(m_responses);
+ info.addInstrumentedMember(m_originalRequest);
+ info.addInstrumentedMember(m_originalRequestCopy);
+ info.addInstrumentedMember(m_request);
+ info.addInstrumentedMember(m_response);
+ info.addInstrumentedMember(m_lastCheckedRequest);
+ info.addInstrumentedVector(m_responses);
info.addHashMap(m_pendingSubstituteResources);
- info.addHashSet(m_resourcesClientKnowsAbout);
+ info.addInstrumentedHashSet(m_resourcesClientKnowsAbout);
info.addVector(m_resourcesLoadedFromMemoryCacheForClientNotification);
info.addMember(m_clientRedirectSourceForHistory);
info.addInstrumentedMember(m_mainResourceData);
@@ -421,9 +428,7 @@ void DocumentLoader::checkLoadComplete()
if (!m_frame || isLoading())
return;
ASSERT(this == frameLoader()->activeDocumentLoader());
-
- if (DOMWindow* window = m_frame->existingDOMWindow())
- window->finishedLoading();
+ m_frame->document()->domWindow()->finishedLoading();
}
void DocumentLoader::setFrame(Frame* frame)
diff --git a/Source/WebCore/loader/DocumentThreadableLoader.cpp b/Source/WebCore/loader/DocumentThreadableLoader.cpp
index 56609a675..a0c6489cb 100644
--- a/Source/WebCore/loader/DocumentThreadableLoader.cpp
+++ b/Source/WebCore/loader/DocumentThreadableLoader.cpp
@@ -249,7 +249,7 @@ void DocumentThreadableLoader::didReceiveResponse(unsigned long identifier, cons
if (m_preflightRequestIdentifier) {
DocumentLoader* loader = m_document->frame()->loader()->documentLoader();
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(m_document->frame(), m_preflightRequestIdentifier, response);
- InspectorInstrumentation::didReceiveResourceResponse(cookie, m_preflightRequestIdentifier, loader, response);
+ InspectorInstrumentation::didReceiveResourceResponse(cookie, m_preflightRequestIdentifier, loader, response, 0);
}
#endif
diff --git a/Source/WebCore/loader/DocumentWriter.cpp b/Source/WebCore/loader/DocumentWriter.cpp
index 3174afc40..1a16eec56 100644
--- a/Source/WebCore/loader/DocumentWriter.cpp
+++ b/Source/WebCore/loader/DocumentWriter.cpp
@@ -125,10 +125,16 @@ void DocumentWriter::begin(const KURL& urlReference, bool dispatch, Document* ow
// FIXME: Do we need to consult the content security policy here about blocked plug-ins?
- bool resetScripting = !(m_frame->loader()->stateMachine()->isDisplayingInitialEmptyDocument() && m_frame->document()->isSecureTransitionTo(url));
- m_frame->loader()->clear(resetScripting, resetScripting);
+ bool shouldReuseDefaultView = m_frame->loader()->stateMachine()->isDisplayingInitialEmptyDocument() && m_frame->document()->isSecureTransitionTo(url);
+ if (shouldReuseDefaultView)
+ document->takeDOMWindowFrom(m_frame->document());
+ else
+ document->createDOMWindow();
+
+ m_frame->loader()->clear(document.get(), !shouldReuseDefaultView, !shouldReuseDefaultView);
clear();
- if (resetScripting)
+
+ if (!shouldReuseDefaultView)
m_frame->script()->updatePlatformScriptObjects();
m_frame->loader()->setOutgoingReferrer(url);
@@ -141,9 +147,6 @@ void DocumentWriter::begin(const KURL& urlReference, bool dispatch, Document* ow
document->setSecurityOrigin(ownerDocument->securityOrigin());
}
- m_frame->domWindow()->setURL(document->url());
- m_frame->domWindow()->setSecurityOrigin(document->securityOrigin());
-
m_frame->loader()->didBeginDocument(dispatch);
document->implicitOpen();
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp
index 0dcb3b24f..23e9b6cc9 100644
--- a/Source/WebCore/loader/FrameLoader.cpp
+++ b/Source/WebCore/loader/FrameLoader.cpp
@@ -303,6 +303,8 @@ void FrameLoader::submitForm(PassRefPtr<FormSubmission> submission)
return;
if (protocolIsJavaScript(submission->action())) {
+ if (!m_frame->document()->contentSecurityPolicy()->allowFormAction(KURL(submission->action())))
+ return;
m_isExecutingJavaScriptFormAction = true;
m_frame->script()->executeIfJavaScriptURL(submission->action(), DoNotReplaceDocumentIfJavaScriptURL);
m_isExecutingJavaScriptFormAction = false;
@@ -334,9 +336,9 @@ void FrameLoader::submitForm(PassRefPtr<FormSubmission> submission)
// needed any more now that we reset m_submittedFormURL on each mouse or key down event.
if (m_frame->tree()->isDescendantOf(targetFrame)) {
- if (m_submittedFormURL == submission->action())
+ if (m_submittedFormURL == submission->requestURL())
return;
- m_submittedFormURL = submission->action();
+ m_submittedFormURL = submission->requestURL();
}
submission->data()->generateFiles(m_frame->document());
@@ -357,10 +359,10 @@ void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy)
Node* currentFocusedNode = m_frame->document()->focusedNode();
if (currentFocusedNode)
currentFocusedNode->aboutToUnload();
- if (m_frame->domWindow() && m_pageDismissalEventBeingDispatched == NoDismissal) {
+ if (m_pageDismissalEventBeingDispatched == NoDismissal) {
if (unloadEventPolicy == UnloadEventPolicyUnloadAndPageHide) {
m_pageDismissalEventBeingDispatched = PageHideDismissal;
- m_frame->domWindow()->dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, m_frame->document()->inPageCache()), m_frame->document());
+ m_frame->document()->domWindow()->dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, m_frame->document()->inPageCache()), m_frame->document());
}
if (!m_frame->document()->inPageCache()) {
RefPtr<Event> unloadEvent(Event::create(eventNames().unloadEvent, false, false));
@@ -373,10 +375,10 @@ void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy)
DocumentLoadTiming* timing = documentLoader->timing();
ASSERT(timing->navigationStart());
timing->markUnloadEventStart();
- m_frame->domWindow()->dispatchEvent(unloadEvent, m_frame->domWindow()->document());
+ m_frame->document()->domWindow()->dispatchEvent(unloadEvent, m_frame->document());
timing->markUnloadEventEnd();
} else
- m_frame->domWindow()->dispatchEvent(unloadEvent, m_frame->domWindow()->document());
+ m_frame->document()->domWindow()->dispatchEvent(unloadEvent, m_frame->document());
}
}
m_pageDismissalEventBeingDispatched = NoDismissal;
@@ -464,10 +466,9 @@ bool FrameLoader::didOpenURL()
// its frame is not in a consistent state for rendering, so avoid setJSStatusBarText
// since it may cause clients to attempt to render the frame.
if (!m_stateMachine.creatingInitialEmptyDocument()) {
- if (DOMWindow* window = m_frame->existingDOMWindow()) {
- window->setStatus(String());
- window->setDefaultStatus(String());
- }
+ DOMWindow* window = m_frame->document()->domWindow();
+ window->setStatus(String());
+ window->setDefaultStatus(String());
}
started();
@@ -499,11 +500,11 @@ void FrameLoader::cancelAndClear()
if (!m_isComplete)
closeURL();
- clear(false);
+ clear(m_frame->document(), false);
m_frame->script()->updatePlatformScriptObjects();
}
-void FrameLoader::clear(bool clearWindowProperties, bool clearScriptObjects, bool clearFrameView)
+void FrameLoader::clear(Document* newDocument, bool clearWindowProperties, bool clearScriptObjects, bool clearFrameView)
{
m_frame->editor()->clear();
@@ -522,8 +523,9 @@ void FrameLoader::clear(bool clearWindowProperties, bool clearScriptObjects, boo
// Do this after detaching the document so that the unload event works.
if (clearWindowProperties) {
- m_frame->clearDOMWindow();
- m_frame->script()->clearWindowShell(m_frame->document()->inPageCache());
+ InspectorInstrumentation::frameWindowDiscarded(m_frame, m_frame->document()->domWindow());
+ m_frame->document()->domWindow()->resetUnlessSuspendedForPageCache();
+ m_frame->script()->clearWindowShell(newDocument->domWindow(), m_frame->document()->inPageCache());
}
m_frame->selection()->clear();
@@ -885,7 +887,7 @@ bool FrameLoader::checkIfDisplayInsecureContent(SecurityOrigin* context, const K
String message = (allowed ? emptyString() : "[blocked] ") + "The page at " +
m_frame->document()->url().string() + " displayed insecure content from " + url.string() + ".\n";
- m_frame->domWindow()->console()->addMessage(HTMLMessageSource, LogMessageType, WarningMessageLevel, message);
+ m_frame->document()->domWindow()->console()->addMessage(HTMLMessageSource, LogMessageType, WarningMessageLevel, message);
if (allowed)
m_client->didDisplayInsecureContent();
@@ -903,7 +905,7 @@ bool FrameLoader::checkIfRunInsecureContent(SecurityOrigin* context, const KURL&
String message = (allowed ? emptyString() : "[blocked] ") + "The page at " +
m_frame->document()->url().string() + " ran insecure content from " + url.string() + ".\n";
- m_frame->domWindow()->console()->addMessage(HTMLMessageSource, LogMessageType, WarningMessageLevel, message);
+ m_frame->document()->domWindow()->console()->addMessage(HTMLMessageSource, LogMessageType, WarningMessageLevel, message);
if (allowed)
m_client->didRunInsecureContent(context, url);
@@ -911,6 +913,14 @@ bool FrameLoader::checkIfRunInsecureContent(SecurityOrigin* context, const KURL&
return allowed;
}
+bool FrameLoader::checkIfFormActionAllowedByCSP(const KURL& url) const
+{
+ if (m_submittedFormURL.isEmpty())
+ return true;
+
+ return m_frame->document()->contentSecurityPolicy()->allowFormAction(url);
+}
+
Frame* FrameLoader::opener()
{
return m_opener;
@@ -924,10 +934,8 @@ void FrameLoader::setOpener(Frame* opener)
opener->loader()->m_openedFrames.add(m_frame);
m_opener = opener;
- if (m_frame->document()) {
+ if (m_frame->document())
m_frame->document()->initSecurityContext();
- m_frame->domWindow()->setSecurityOrigin(m_frame->document()->securityOrigin());
- }
}
// FIXME: This does not belong in FrameLoader!
@@ -1372,7 +1380,7 @@ void FrameLoader::reportLocalLoadFailed(Frame* frame, const String& url)
if (!frame)
return;
- frame->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Not allowed to load local resource: " + url);
+ frame->document()->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Not allowed to load local resource: " + url);
}
const ResourceRequest& FrameLoader::initialRequest() const
@@ -1903,10 +1911,9 @@ void FrameLoader::prepareForCachedPageRestore()
// Delete old status bar messages (if it _was_ activated on last URL).
if (m_frame->script()->canExecuteScripts(NotAboutToExecuteScript)) {
- if (DOMWindow* window = m_frame->existingDOMWindow()) {
- window->setStatus(String());
- window->setDefaultStatus(String());
- }
+ DOMWindow* window = m_frame->document()->domWindow();
+ window->setStatus(String());
+ window->setDefaultStatus(String());
}
}
@@ -1924,10 +1931,12 @@ void FrameLoader::open(CachedFrameBase& cachedFrame)
url.setPath("/");
started();
- clear(true, true, cachedFrame.isMainFrame());
-
Document* document = cachedFrame.document();
ASSERT(document);
+ ASSERT(document->domWindow());
+
+ clear(document, true, true, cachedFrame.isMainFrame());
+
document->setInPageCache(false);
m_needsClear = true;
@@ -1947,10 +1956,7 @@ void FrameLoader::open(CachedFrameBase& cachedFrame)
m_frame->setView(view);
m_frame->setDocument(document);
- m_frame->setDOMWindow(cachedFrame.domWindow());
- m_frame->domWindow()->resumeFromPageCache();
- m_frame->domWindow()->setURL(document->url());
- m_frame->domWindow()->setSecurityOrigin(document->securityOrigin());
+ document->domWindow()->resumeFromPageCache();
updateFirstPartyForCookies();
@@ -2694,7 +2700,7 @@ bool FrameLoader::shouldClose()
bool FrameLoader::fireBeforeUnloadEvent(Chrome* chrome)
{
- DOMWindow* domWindow = m_frame->existingDOMWindow();
+ DOMWindow* domWindow = m_frame->document()->domWindow();
if (!domWindow)
return true;
diff --git a/Source/WebCore/loader/FrameLoader.h b/Source/WebCore/loader/FrameLoader.h
index e12cf3017..4a17ab248 100644
--- a/Source/WebCore/loader/FrameLoader.h
+++ b/Source/WebCore/loader/FrameLoader.h
@@ -131,7 +131,8 @@ public:
void stopLoading(UnloadEventPolicy);
bool closeURL();
void cancelAndClear();
- void clear(bool clearWindowProperties = true, bool clearScriptObjects = true, bool clearFrameView = true);
+ // FIXME: clear() is trying to do too many things. We should break it down into smaller functions (ideally with fewer raw Boolean parameters).
+ void clear(Document* newDocument, bool clearWindowProperties = true, bool clearScriptObjects = true, bool clearFrameView = true);
bool isLoading() const;
bool frameHasLoaded() const;
@@ -221,6 +222,8 @@ public:
bool checkIfDisplayInsecureContent(SecurityOrigin* context, const KURL&);
bool checkIfRunInsecureContent(SecurityOrigin* context, const KURL&);
+ bool checkIfFormActionAllowedByCSP(const KURL&) const;
+
Frame* opener();
void setOpener(Frame*);
diff --git a/Source/WebCore/loader/ImageLoaderClient.h b/Source/WebCore/loader/ImageLoaderClient.h
index f08344bb6..4ed1e6564 100644
--- a/Source/WebCore/loader/ImageLoaderClient.h
+++ b/Source/WebCore/loader/ImageLoaderClient.h
@@ -42,6 +42,7 @@ public:
virtual Element* sourceElement() = 0;
virtual Element* imageElement() = 0;
+ Element* eventTarget() { return sourceElement(); }
virtual void refSourceElement() = 0;
virtual void derefSourceElement() = 0;
diff --git a/Source/WebCore/loader/MainResourceLoader.cpp b/Source/WebCore/loader/MainResourceLoader.cpp
index 74aa3afc1..0836d8cc0 100644
--- a/Source/WebCore/loader/MainResourceLoader.cpp
+++ b/Source/WebCore/loader/MainResourceLoader.cpp
@@ -204,6 +204,11 @@ void MainResourceLoader::willSendRequest(ResourceRequest& newRequest, const Reso
// reference to this object; one example of this is 3266216.
RefPtr<MainResourceLoader> protect(this);
+ if (!frameLoader()->checkIfFormActionAllowedByCSP(newRequest.url())) {
+ cancel();
+ return;
+ }
+
ASSERT(documentLoader()->timing()->fetchStart());
if (!redirectResponse.isNull()) {
// If the redirecting url is not allowed to display content from the target origin,
@@ -367,7 +372,7 @@ void MainResourceLoader::didReceiveResponse(const ResourceResponse& r)
if (m_frame->loader()->shouldInterruptLoadForXFrameOptions(content, r.url())) {
InspectorInstrumentation::continueAfterXFrameOptionsDenied(m_frame.get(), documentLoader(), identifier(), r);
DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to display document because display forbidden by X-Frame-Options.\n"));
- m_frame->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, consoleMessage);
+ m_frame->document()->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, consoleMessage);
cancel();
return;
diff --git a/Source/WebCore/loader/ResourceLoadNotifier.cpp b/Source/WebCore/loader/ResourceLoadNotifier.cpp
index b7d568668..c7349a1ed 100644
--- a/Source/WebCore/loader/ResourceLoadNotifier.cpp
+++ b/Source/WebCore/loader/ResourceLoadNotifier.cpp
@@ -71,7 +71,7 @@ void ResourceLoadNotifier::didReceiveResponse(ResourceLoader* loader, const Reso
if (Page* page = m_frame->page())
page->progress()->incrementProgress(loader->identifier(), r);
- dispatchDidReceiveResponse(loader->documentLoader(), loader->identifier(), r);
+ dispatchDidReceiveResponse(loader->documentLoader(), loader->identifier(), r, loader);
}
void ResourceLoadNotifier::didReceiveData(ResourceLoader* loader, const char* data, int dataLength, int encodedDataLength)
@@ -123,11 +123,11 @@ void ResourceLoadNotifier::dispatchWillSendRequest(DocumentLoader* loader, unsig
request.setReportLoadTiming(true);
}
-void ResourceLoadNotifier::dispatchDidReceiveResponse(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
+void ResourceLoadNotifier::dispatchDidReceiveResponse(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r, ResourceLoader* resourceLoader)
{
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(m_frame, identifier, r);
m_frame->loader()->client()->dispatchDidReceiveResponse(loader, identifier, r);
- InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, loader, r);
+ InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, loader, r, resourceLoader);
}
void ResourceLoadNotifier::dispatchDidReceiveData(DocumentLoader* loader, unsigned long identifier, const char* data, int dataLength, int encodedDataLength)
diff --git a/Source/WebCore/loader/ResourceLoadNotifier.h b/Source/WebCore/loader/ResourceLoadNotifier.h
index 597291fdf..a2c30b2f9 100644
--- a/Source/WebCore/loader/ResourceLoadNotifier.h
+++ b/Source/WebCore/loader/ResourceLoadNotifier.h
@@ -59,7 +59,7 @@ public:
void assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&);
void dispatchWillSendRequest(DocumentLoader*, unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse);
- void dispatchDidReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse&);
+ void dispatchDidReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse&, ResourceLoader* = 0);
void dispatchDidReceiveData(DocumentLoader*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier, double finishTime);
diff --git a/Source/WebCore/loader/ResourceLoader.cpp b/Source/WebCore/loader/ResourceLoader.cpp
index 0175b16b8..2307515a3 100644
--- a/Source/WebCore/loader/ResourceLoader.cpp
+++ b/Source/WebCore/loader/ResourceLoader.cpp
@@ -214,6 +214,11 @@ void ResourceLoader::clearResourceData()
m_resourceData->clear();
}
+bool ResourceLoader::isSubresourceLoader()
+{
+ return false;
+}
+
void ResourceLoader::willSendRequest(ResourceRequest& request, const ResourceResponse& redirectResponse)
{
// Protect this in this delegate method since the additional processing can do
diff --git a/Source/WebCore/loader/ResourceLoader.h b/Source/WebCore/loader/ResourceLoader.h
index dbf1ab11d..c8158e3fa 100644
--- a/Source/WebCore/loader/ResourceLoader.h
+++ b/Source/WebCore/loader/ResourceLoader.h
@@ -75,6 +75,7 @@ namespace WebCore {
virtual void addData(const char*, int, bool allAtOnce);
virtual PassRefPtr<SharedBuffer> resourceData();
void clearResourceData();
+ virtual bool isSubresourceLoader();
virtual void willSendRequest(ResourceRequest&, const ResourceResponse& redirectResponse);
virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent);
diff --git a/Source/WebCore/loader/SubframeLoader.cpp b/Source/WebCore/loader/SubframeLoader.cpp
index 410bfe368..d7eb00141 100644
--- a/Source/WebCore/loader/SubframeLoader.cpp
+++ b/Source/WebCore/loader/SubframeLoader.cpp
@@ -126,7 +126,11 @@ bool SubframeLoader::pluginIsLoadable(HTMLPlugInImageElement* pluginElement, con
return false;
}
- if (!document()->contentSecurityPolicy()->allowObjectFromSource(url)) {
+ String declaredMimeType = document()->isPluginDocument() && document()->ownerElement() ?
+ document()->ownerElement()->fastGetAttribute(HTMLNames::typeAttr) :
+ pluginElement->fastGetAttribute(HTMLNames::typeAttr);
+ if (!document()->contentSecurityPolicy()->allowObjectFromSource(url)
+ || !document()->contentSecurityPolicy()->allowPluginType(mimeType, declaredMimeType, url)) {
RenderEmbeddedObject* renderer = pluginElement->renderEmbeddedObject();
renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::PluginBlockedByContentSecurityPolicy);
return false;
@@ -293,7 +297,9 @@ PassRefPtr<Widget> SubframeLoader::createJavaAppletWidget(const IntSize& size, H
return 0;
}
- if (!element->document()->contentSecurityPolicy()->allowObjectFromSource(codeBaseURL))
+ const char javaAppletMimeType[] = "application/x-java-applet";
+ if (!element->document()->contentSecurityPolicy()->allowObjectFromSource(codeBaseURL)
+ || !element->document()->contentSecurityPolicy()->allowPluginType(javaAppletMimeType, javaAppletMimeType, codeBaseURL))
return 0;
}
diff --git a/Source/WebCore/loader/SubresourceLoader.cpp b/Source/WebCore/loader/SubresourceLoader.cpp
index eaf1f5a81..c61fa31f0 100644
--- a/Source/WebCore/loader/SubresourceLoader.cpp
+++ b/Source/WebCore/loader/SubresourceLoader.cpp
@@ -122,6 +122,11 @@ PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, CachedReso
return subloader.release();
}
+CachedResource* SubresourceLoader::cachedResource()
+{
+ return m_resource;
+}
+
void SubresourceLoader::cancelIfNotFinishing()
{
if (m_state != Initialized)
@@ -150,6 +155,11 @@ bool SubresourceLoader::init(const ResourceRequest& request)
return true;
}
+bool SubresourceLoader::isSubresourceLoader()
+{
+ return true;
+}
+
void SubresourceLoader::willSendRequest(ResourceRequest& newRequest, const ResourceResponse& redirectResponse)
{
// Store the previous URL because the call to ResourceLoader::willSendRequest will modify it.
diff --git a/Source/WebCore/loader/SubresourceLoader.h b/Source/WebCore/loader/SubresourceLoader.h
index a2de2cb41..7532750b6 100644
--- a/Source/WebCore/loader/SubresourceLoader.h
+++ b/Source/WebCore/loader/SubresourceLoader.h
@@ -46,6 +46,8 @@ public:
static PassRefPtr<SubresourceLoader> create(Frame*, CachedResource*, const ResourceRequest&, const ResourceLoaderOptions&);
void cancelIfNotFinishing();
+ virtual bool isSubresourceLoader();
+ CachedResource* cachedResource();
virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
diff --git a/Source/WebCore/loader/TextTrackLoader.cpp b/Source/WebCore/loader/TextTrackLoader.cpp
index 7cb9c6906..8355a4a4c 100644
--- a/Source/WebCore/loader/TextTrackLoader.cpp
+++ b/Source/WebCore/loader/TextTrackLoader.cpp
@@ -35,6 +35,7 @@
#include "Document.h"
#include "Logging.h"
#include "ResourceHandle.h"
+#include "ScriptCallStack.h"
#include "SecurityOrigin.h"
#include "SharedBuffer.h"
#include "WebVTTParser.h"
diff --git a/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp b/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
index 4e42938bb..92082c56b 100644
--- a/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
+++ b/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
@@ -469,7 +469,7 @@ void ApplicationCacheGroup::abort(Frame* frame)
if (m_completionType != None)
return;
- frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, TipMessageLevel, "Application Cache download process was aborted.");
+ frame->document()->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, TipMessageLevel, "Application Cache download process was aborted.");
cacheUpdateFailed();
}
@@ -498,7 +498,9 @@ PassRefPtr<ResourceHandle> ApplicationCacheGroup::createResourceHandle(const KUR
target = ResourceRequest::targetTypeFromMimeType(mimeType);
}
if (target == ResourceRequest::TargetIsUnspecified) {
- String mimeType = mimeTypeFromDataURL(url);
+ String mimeType;
+ if (url.protocolIsData())
+ mimeType = mimeTypeFromDataURL(url);
if (!mimeType.isEmpty())
target = ResourceRequest::targetTypeFromMimeType(mimeType);
}
@@ -522,7 +524,7 @@ void ApplicationCacheGroup::didReceiveResponse(ResourceHandle* handle, const Res
#if ENABLE(INSPECTOR)
DocumentLoader* loader = (handle == m_manifestHandle) ? 0 : m_frame->loader()->documentLoader();
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(m_frame, m_currentResourceIdentifier, response);
- InspectorInstrumentation::didReceiveResourceResponse(cookie, m_currentResourceIdentifier, loader, response);
+ InspectorInstrumentation::didReceiveResourceResponse(cookie, m_currentResourceIdentifier, loader, response, 0);
#endif
if (handle == m_manifestHandle) {
@@ -561,7 +563,7 @@ void ApplicationCacheGroup::didReceiveResponse(ResourceHandle* handle, const Res
if (response.httpStatusCode() / 100 != 2 || response.url() != m_currentHandle->firstRequest().url()) {
if ((type & ApplicationCacheResource::Explicit) || (type & ApplicationCacheResource::Fallback)) {
- m_frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache update failed, because " + m_currentHandle->firstRequest().url().string() +
+ m_frame->document()->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache update failed, because " + m_currentHandle->firstRequest().url().string() +
((response.httpStatusCode() / 100 != 2) ? " could not be fetched." : " was redirected."));
// Note that cacheUpdateFailed() can cause the cache group to be deleted.
cacheUpdateFailed();
@@ -638,7 +640,7 @@ void ApplicationCacheGroup::didFinishLoading(ResourceHandle* handle, double fini
// FIXME: Should we break earlier and prevent redownloading on later page loads?
if (m_originQuotaExceededPreviously && m_availableSpaceInQuota < m_cacheBeingUpdated->estimatedSizeInStorage()) {
m_currentResource = 0;
- m_frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache update failed, because size quota was exceeded.");
+ m_frame->document()->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache update failed, because size quota was exceeded.");
cacheUpdateFailed();
return;
}
@@ -671,7 +673,7 @@ void ApplicationCacheGroup::didFail(ResourceHandle* handle, const ResourceError&
m_pendingEntries.remove(url);
if ((type & ApplicationCacheResource::Explicit) || (type & ApplicationCacheResource::Fallback)) {
- m_frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache update failed, because " + url.string() + " could not be fetched.");
+ m_frame->document()->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache update failed, because " + url.string() + " could not be fetched.");
// Note that cacheUpdateFailed() can cause the cache group to be deleted.
cacheUpdateFailed();
} else {
@@ -700,13 +702,13 @@ void ApplicationCacheGroup::didReceiveManifestResponse(const ResourceResponse& r
return;
if (response.httpStatusCode() / 100 != 2) {
- m_frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache manifest could not be fetched.");
+ m_frame->document()->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache manifest could not be fetched.");
cacheUpdateFailed();
return;
}
if (response.url() != m_manifestHandle->firstRequest().url()) {
- m_frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache manifest could not be fetched, because a redirection was attempted.");
+ m_frame->document()->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache manifest could not be fetched, because a redirection was attempted.");
cacheUpdateFailed();
return;
}
@@ -726,7 +728,7 @@ void ApplicationCacheGroup::didFinishLoadingManifest()
if (!isUpgradeAttempt && !m_manifestResource) {
// The server returned 304 Not Modified even though we didn't send a conditional request.
- m_frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache manifest could not be fetched because of an unexpected 304 Not Modified server response.");
+ m_frame->document()->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache manifest could not be fetched because of an unexpected 304 Not Modified server response.");
cacheUpdateFailed();
return;
}
@@ -752,7 +754,7 @@ void ApplicationCacheGroup::didFinishLoadingManifest()
Manifest manifest;
if (!parseManifest(m_manifestURL, m_manifestResource->data()->data(), m_manifestResource->data()->size(), manifest)) {
// At the time of this writing, lack of "CACHE MANIFEST" signature is the only reason for parseManifest to fail.
- m_frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache manifest could not be parsed. Does it start with CACHE MANIFEST?");
+ m_frame->document()->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache manifest could not be parsed. Does it start with CACHE MANIFEST?");
cacheUpdateFailed();
return;
}
@@ -941,7 +943,7 @@ void ApplicationCacheGroup::checkIfLoadIsComplete()
// We ran out of space for this origin. Fall down to the normal error handling
// after recording this state.
m_originQuotaExceededPreviously = true;
- m_frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache update failed, because size quota was exceeded.");
+ m_frame->document()->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache update failed, because size quota was exceeded.");
}
if (failureReason == ApplicationCacheStorage::TotalQuotaReached && !m_calledReachedMaxAppCacheSize) {
diff --git a/Source/WebCore/loader/cache/CachedImage.cpp b/Source/WebCore/loader/cache/CachedImage.cpp
index 72647c6b7..11588a0db 100644
--- a/Source/WebCore/loader/cache/CachedImage.cpp
+++ b/Source/WebCore/loader/cache/CachedImage.cpp
@@ -245,8 +245,14 @@ IntSize CachedImage::imageSizeForRenderer(const RenderObject* renderer, float mu
if (m_image->isSVGImage()) {
SVGImageCache::SizeAndScales sizeAndScales = m_svgImageCache->requestedSizeAndScales(renderer);
if (!sizeAndScales.size.isEmpty()) {
- imageSize.setWidth(sizeAndScales.size.width() / sizeAndScales.zoom);
- imageSize.setHeight(sizeAndScales.size.height() / sizeAndScales.zoom);
+ float scale = sizeAndScales.scale;
+ if (!scale) {
+ Page* page = renderer->document()->page();
+ scale = page->deviceScaleFactor() * page->pageScaleFactor();
+ }
+
+ imageSize.setWidth(scale * sizeAndScales.size.width() / sizeAndScales.zoom);
+ imageSize.setHeight(scale * sizeAndScales.size.height() / sizeAndScales.zoom);
}
}
#endif
diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp
index 69ffb928f..7b5646538 100644
--- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp
+++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp
@@ -616,7 +616,7 @@ void CachedResourceLoader::printAccessDeniedMessage(const KURL& url) const
message = "Unsafe attempt to load URL " + url.string() + " from frame with URL " + m_document->url().string() + ". Domains, protocols and ports must match.\n";
// FIXME: provide line number and source URL.
- frame()->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, message);
+ frame()->document()->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, message);
}
void CachedResourceLoader::setAutoLoadImages(bool enable)
diff --git a/Source/WebCore/page/ContentSecurityPolicy.cpp b/Source/WebCore/page/ContentSecurityPolicy.cpp
index 55faf8738..74bec7bca 100644
--- a/Source/WebCore/page/ContentSecurityPolicy.cpp
+++ b/Source/WebCore/page/ContentSecurityPolicy.cpp
@@ -40,6 +40,7 @@
#include "ScriptCallStack.h"
#include "SecurityOrigin.h"
#include "TextEncoding.h"
+#include <wtf/HashSet.h>
#include <wtf/text/TextPosition.h>
#include <wtf/text/WTFString.h>
@@ -60,6 +61,11 @@ bool isDirectiveValueCharacter(UChar c)
return isASCIISpace(c) || (c >= 0x21 && c <= 0x7e); // Whitespace + VCHAR
}
+bool isNonceCharacter(UChar c)
+{
+ return (c >= 0x21 && c <= 0x7e) && c != ',' && c != ';'; // VCHAR - ',' - ';'
+}
+
bool isSourceCharacter(UChar c)
{
return !isASCIISpace(c);
@@ -85,6 +91,11 @@ bool isNotColonOrSlash(UChar c)
return c != ':' && c != '/';
}
+bool isMediaTypeCharacter(UChar c)
+{
+ return !isASCIISpace(c) && c != '/';
+}
+
} // namespace
static bool skipExactly(const UChar*& position, const UChar* end, UChar delimiter)
@@ -525,27 +536,162 @@ void CSPSourceList::addSourceUnsafeEval()
class CSPDirective {
public:
CSPDirective(const String& name, const String& value, ContentSecurityPolicy* policy)
- : m_sourceList(policy, name)
+ : m_name(name)
, m_text(name + ' ' + value)
- , m_selfURL(policy->url())
+ , m_policy(policy)
+ {
+ }
+
+ const String& text() const { return m_text; }
+
+protected:
+ const ContentSecurityPolicy* policy() const { return m_policy; }
+
+private:
+ String m_name;
+ String m_text;
+ ContentSecurityPolicy* m_policy;
+};
+
+class NonceDirective : public CSPDirective {
+public:
+ NonceDirective(const String& name, const String& value, ContentSecurityPolicy* policy)
+ : CSPDirective(name, value, policy)
+ {
+ parse(value);
+ }
+
+ bool allows(const String& nonce) const
+ {
+ return (!m_scriptNonce.isEmpty() && nonce.stripWhiteSpace() == m_scriptNonce);
+ }
+
+private:
+ void parse(const String& value)
+ {
+ String nonce;
+ const UChar* position = value.characters();
+ const UChar* end = position + value.length();
+
+ skipWhile<isASCIISpace>(position, end);
+ const UChar* nonceBegin = position;
+ if (position == end) {
+ policy()->reportInvalidNonce(String());
+ m_scriptNonce = "";
+ return;
+ }
+ skipWhile<isNonceCharacter>(position, end);
+ if (nonceBegin < position)
+ nonce = String(nonceBegin, position - nonceBegin);
+
+ // Trim off trailing whitespace: If we're not at the end of the string, log
+ // an error.
+ skipWhile<isASCIISpace>(position, end);
+ if (position < end) {
+ policy()->reportInvalidNonce(value);
+ m_scriptNonce = "";
+ } else
+ m_scriptNonce = nonce;
+ }
+
+ String m_scriptNonce;
+};
+
+class MediaListDirective : public CSPDirective {
+public:
+ MediaListDirective(const String& name, const String& value, ContentSecurityPolicy* policy)
+ : CSPDirective(name, value, policy)
+ {
+ parse(value);
+ }
+
+ bool allows(const String& type)
+ {
+ return m_pluginTypes.contains(type);
+ }
+
+private:
+ void parse(const String& value)
+ {
+ const UChar* begin = value.characters();
+ const UChar* position = begin;
+ const UChar* end = begin + value.length();
+
+ // 'plugin-types ____;' OR 'plugin-types;'
+ if (value.isEmpty()) {
+ policy()->reportInvalidPluginTypes(value);
+ return;
+ }
+
+ while (position < end) {
+ // _____ OR _____mime1/mime1
+ // ^ ^
+ skipWhile<isASCIISpace>(position, end);
+ if (position == end)
+ return;
+
+ // mime1/mime1 mime2/mime2
+ // ^
+ begin = position;
+ if (!skipExactly<isMediaTypeCharacter>(position, end)) {
+ skipWhile<isNotASCIISpace>(position, end);
+ policy()->reportInvalidPluginTypes(String(begin, position - begin));
+ continue;
+ }
+ skipWhile<isMediaTypeCharacter>(position, end);
+
+ // mime1/mime1 mime2/mime2
+ // ^
+ if (!skipExactly(position, end, '/')) {
+ skipWhile<isNotASCIISpace>(position, end);
+ policy()->reportInvalidPluginTypes(String(begin, position - begin));
+ continue;
+ }
+
+ // mime1/mime1 mime2/mime2
+ // ^
+ if (!skipExactly<isMediaTypeCharacter>(position, end)) {
+ skipWhile<isNotASCIISpace>(position, end);
+ policy()->reportInvalidPluginTypes(String(begin, position - begin));
+ continue;
+ }
+ skipWhile<isMediaTypeCharacter>(position, end);
+
+ // mime1/mime1 mime2/mime2 OR mime1/mime1 OR mime1/mime1/error
+ // ^ ^ ^
+ if (position < end && isNotASCIISpace(*position)) {
+ skipWhile<isNotASCIISpace>(position, end);
+ policy()->reportInvalidPluginTypes(String(begin, position - begin));
+ continue;
+ }
+ m_pluginTypes.add(String(begin, position - begin));
+
+ ASSERT(position == end || isASCIISpace(*position));
+ }
+ }
+
+ HashSet<String> m_pluginTypes;
+};
+
+class SourceListDirective : public CSPDirective {
+public:
+ SourceListDirective(const String& name, const String& value, ContentSecurityPolicy* policy)
+ : CSPDirective(name, value, policy)
+ , m_sourceList(policy, name)
{
m_sourceList.parse(value);
}
bool allows(const KURL& url)
{
- return m_sourceList.matches(url.isEmpty() ? m_selfURL : url);
+ return m_sourceList.matches(url.isEmpty() ? policy()->url() : url);
}
bool allowInline() const { return m_sourceList.allowInline(); }
bool allowEval() const { return m_sourceList.allowEval(); }
- const String& text() { return m_text; }
-
private:
CSPSourceList m_sourceList;
- String m_text;
- KURL m_selfURL;
};
class CSPDirectiveList {
@@ -561,6 +707,7 @@ public:
bool allowInlineStyle(const String& contextURL, const WTF::OrdinalNumber& contextLine, ContentSecurityPolicy::ReportingStatus) const;
bool allowEval(PassRefPtr<ScriptCallStack>, ContentSecurityPolicy::ReportingStatus) const;
bool allowScriptNonce(const String& nonce, const String& contextURL, const WTF::OrdinalNumber& contextLine, const KURL&) const;
+ bool allowPluginType(const String& type, const String& typeAttribute, const KURL&, ContentSecurityPolicy::ReportingStatus) const;
bool allowScriptFromSource(const KURL&, ContentSecurityPolicy::ReportingStatus) const;
bool allowObjectFromSource(const KURL&, ContentSecurityPolicy::ReportingStatus) const;
@@ -570,6 +717,7 @@ public:
bool allowFontFromSource(const KURL&, ContentSecurityPolicy::ReportingStatus) const;
bool allowMediaFromSource(const KURL&, ContentSecurityPolicy::ReportingStatus) const;
bool allowConnectToSource(const KURL&, ContentSecurityPolicy::ReportingStatus) const;
+ bool allowFormAction(const KURL&, ContentSecurityPolicy::ReportingStatus) const;
void gatherReportURIs(DOMStringList&) const;
@@ -581,23 +729,27 @@ private:
bool parseDirective(const UChar* begin, const UChar* end, String& name, String& value);
void parseReportURI(const String& name, const String& value);
void parseScriptNonce(const String& name, const String& value);
+ void parsePluginTypes(const String& name, const String& value);
void addDirective(const String& name, const String& value);
void applySandboxPolicy(const String& name, const String& sandboxPolicy);
- void setCSPDirective(const String& name, const String& value, OwnPtr<CSPDirective>&);
+ template <class CSPDirectiveType>
+ void setCSPDirective(const String& name, const String& value, OwnPtr<CSPDirectiveType>&);
- CSPDirective* operativeDirective(CSPDirective*) const;
+ SourceListDirective* operativeDirective(SourceListDirective*) const;
void reportViolation(const String& directiveText, const String& consoleMessage, const KURL& blockedURL = KURL(), const String& contextURL = String(), const WTF::OrdinalNumber& contextLine = WTF::OrdinalNumber::beforeFirst(), PassRefPtr<ScriptCallStack> = 0) const;
- bool checkEval(CSPDirective*) const;
- bool checkInline(CSPDirective*) const;
- bool checkNonce(const String&) const;
- bool checkSource(CSPDirective*, const KURL&) const;
+ bool checkEval(SourceListDirective*) const;
+ bool checkInline(SourceListDirective*) const;
+ bool checkNonce(NonceDirective*, const String&) const;
+ bool checkSource(SourceListDirective*, const KURL&) const;
+ bool checkMediaType(MediaListDirective*, const String& type, const String& typeAttribute) const;
- bool checkEvalAndReportViolation(CSPDirective*, const String& consoleMessage, const String& contextURL = String(), const WTF::OrdinalNumber& contextLine = WTF::OrdinalNumber::beforeFirst(), PassRefPtr<ScriptCallStack> = 0) const;
- bool checkInlineAndReportViolation(CSPDirective*, const String& consoleMessage, const String& contextURL, const WTF::OrdinalNumber& contextLine) const;
- bool checkNonceAndReportViolation(const String& nonce, const String& consoleMessage, const String& contextURL, const WTF::OrdinalNumber& contextLine) const;
- bool checkSourceAndReportViolation(CSPDirective*, const KURL&, const String& type) const;
+ bool checkEvalAndReportViolation(SourceListDirective*, const String& consoleMessage, const String& contextURL = String(), const WTF::OrdinalNumber& contextLine = WTF::OrdinalNumber::beforeFirst(), PassRefPtr<ScriptCallStack> = 0) const;
+ bool checkInlineAndReportViolation(SourceListDirective*, const String& consoleMessage, const String& contextURL, const WTF::OrdinalNumber& contextLine) const;
+ bool checkNonceAndReportViolation(NonceDirective*, const String& nonce, const String& consoleMessage, const String& contextURL, const WTF::OrdinalNumber& contextLine) const;
+ bool checkSourceAndReportViolation(SourceListDirective*, const KURL&, const String& type) const;
+ bool checkMediaTypeAndReportViolation(MediaListDirective*, const String& type, const String& typeAttribute, const String& consoleMessage) const;
bool denyIfEnforcingPolicy() const { return m_reportOnly; }
@@ -607,18 +759,20 @@ private:
bool m_reportOnly;
bool m_haveSandboxPolicy;
- OwnPtr<CSPDirective> m_defaultSrc;
- OwnPtr<CSPDirective> m_scriptSrc;
- OwnPtr<CSPDirective> m_objectSrc;
- OwnPtr<CSPDirective> m_frameSrc;
- OwnPtr<CSPDirective> m_imgSrc;
- OwnPtr<CSPDirective> m_styleSrc;
- OwnPtr<CSPDirective> m_fontSrc;
- OwnPtr<CSPDirective> m_mediaSrc;
- OwnPtr<CSPDirective> m_connectSrc;
+ OwnPtr<MediaListDirective> m_pluginTypes;
+ OwnPtr<NonceDirective> m_scriptNonce;
+ OwnPtr<SourceListDirective> m_connectSrc;
+ OwnPtr<SourceListDirective> m_defaultSrc;
+ OwnPtr<SourceListDirective> m_fontSrc;
+ OwnPtr<SourceListDirective> m_formAction;
+ OwnPtr<SourceListDirective> m_frameSrc;
+ OwnPtr<SourceListDirective> m_imgSrc;
+ OwnPtr<SourceListDirective> m_mediaSrc;
+ OwnPtr<SourceListDirective> m_objectSrc;
+ OwnPtr<SourceListDirective> m_scriptSrc;
+ OwnPtr<SourceListDirective> m_styleSrc;
Vector<KURL> m_reportURIs;
- String m_scriptNonce;
};
CSPDirectiveList::CSPDirectiveList(ContentSecurityPolicy* policy)
@@ -652,34 +806,41 @@ void CSPDirectiveList::reportViolation(const String& directiveText, const String
m_policy->reportViolation(directiveText, message, blockedURL, m_reportURIs, m_header, contextURL, contextLine, callStack);
}
-bool CSPDirectiveList::checkEval(CSPDirective* directive) const
+bool CSPDirectiveList::checkEval(SourceListDirective* directive) const
{
return !directive || directive->allowEval();
}
-bool CSPDirectiveList::checkInline(CSPDirective* directive) const
+bool CSPDirectiveList::checkInline(SourceListDirective* directive) const
{
return !directive || directive->allowInline();
}
-bool CSPDirectiveList::checkNonce(const String& nonce) const
+bool CSPDirectiveList::checkNonce(NonceDirective* directive, const String& nonce) const
{
- return (m_scriptNonce.isNull()
- || (!m_scriptNonce.isEmpty()
- && nonce.stripWhiteSpace() == m_scriptNonce));
+ return !directive || directive->allows(nonce);
}
-bool CSPDirectiveList::checkSource(CSPDirective* directive, const KURL& url) const
+bool CSPDirectiveList::checkSource(SourceListDirective* directive, const KURL& url) const
{
return !directive || directive->allows(url);
}
-CSPDirective* CSPDirectiveList::operativeDirective(CSPDirective* directive) const
+bool CSPDirectiveList::checkMediaType(MediaListDirective* directive, const String& type, const String& typeAttribute) const
+{
+ if (!directive)
+ return true;
+ if (typeAttribute.isEmpty() || typeAttribute.stripWhiteSpace() != type)
+ return false;
+ return directive->allows(type);
+}
+
+SourceListDirective* CSPDirectiveList::operativeDirective(SourceListDirective* directive) const
{
return directive ? directive : m_defaultSrc.get();
}
-bool CSPDirectiveList::checkEvalAndReportViolation(CSPDirective* directive, const String& consoleMessage, const String& contextURL, const WTF::OrdinalNumber& contextLine, PassRefPtr<ScriptCallStack> callStack) const
+bool CSPDirectiveList::checkEvalAndReportViolation(SourceListDirective* directive, const String& consoleMessage, const String& contextURL, const WTF::OrdinalNumber& contextLine, PassRefPtr<ScriptCallStack> callStack) const
{
if (checkEval(directive))
return true;
@@ -687,15 +848,28 @@ bool CSPDirectiveList::checkEvalAndReportViolation(CSPDirective* directive, cons
return denyIfEnforcingPolicy();
}
-bool CSPDirectiveList::checkNonceAndReportViolation(const String& nonce, const String& consoleMessage, const String& contextURL, const WTF::OrdinalNumber& contextLine) const
+bool CSPDirectiveList::checkNonceAndReportViolation(NonceDirective* directive, const String& nonce, const String& consoleMessage, const String& contextURL, const WTF::OrdinalNumber& contextLine) const
{
- if (checkNonce(nonce))
+ if (checkNonce(directive, nonce))
return true;
- reportViolation(m_scriptNonce, consoleMessage + "\"script-nonce " + m_scriptNonce + "\".\n", KURL(), contextURL, contextLine);
+ reportViolation(directive->text(), consoleMessage + "\"" + directive->text() + "\".\n", KURL(), contextURL, contextLine);
+ return denyIfEnforcingPolicy();
+}
+
+bool CSPDirectiveList::checkMediaTypeAndReportViolation(MediaListDirective* directive, const String& type, const String& typeAttribute, const String& consoleMessage) const
+{
+ if (checkMediaType(directive, type, typeAttribute))
+ return true;
+
+ String message = makeString(consoleMessage, "\'", directive->text(), "\'.");
+ if (typeAttribute.isEmpty())
+ message = message + " When enforcing the 'plugin-types' directive, the plugin's media type must be explicitly declared with a 'type' attribute on the containing element (e.g. '<object type=\"[TYPE GOES HERE]\" ...>').";
+
+ reportViolation(directive->text(), message + "\n", KURL());
return denyIfEnforcingPolicy();
}
-bool CSPDirectiveList::checkInlineAndReportViolation(CSPDirective* directive, const String& consoleMessage, const String& contextURL, const WTF::OrdinalNumber& contextLine) const
+bool CSPDirectiveList::checkInlineAndReportViolation(SourceListDirective* directive, const String& consoleMessage, const String& contextURL, const WTF::OrdinalNumber& contextLine) const
{
if (checkInline(directive))
return true;
@@ -703,12 +877,18 @@ bool CSPDirectiveList::checkInlineAndReportViolation(CSPDirective* directive, co
return denyIfEnforcingPolicy();
}
-bool CSPDirectiveList::checkSourceAndReportViolation(CSPDirective* directive, const KURL& url, const String& type) const
+bool CSPDirectiveList::checkSourceAndReportViolation(SourceListDirective* directive, const KURL& url, const String& type) const
{
if (checkSource(directive, url))
return true;
- String verb = type == "connect" ? "connect to" : "load the";
- reportViolation(directive->text(), "Refused to " + verb + " " + type + " '" + url.string() + "' because it violates the following Content Security Policy directive: \"" + directive->text() + "\".\n", url);
+
+ String prefix = makeString("Refused to load the ", type, " '");
+ if (type == "connect")
+ prefix = "Refused to connect to '";
+ if (type == "form")
+ prefix = "Refused to send form data to '";
+
+ reportViolation(directive->text(), makeString(prefix, url.string(), "' because it violates the following Content Security Policy directive: \"", directive->text(), "\".\n"), url);
return denyIfEnforcingPolicy();
}
@@ -717,10 +897,10 @@ bool CSPDirectiveList::allowJavaScriptURLs(const String& contextURL, const WTF::
DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to execute JavaScript URL because it violates the following Content Security Policy directive: "));
if (reportingStatus == ContentSecurityPolicy::SendReport) {
return (checkInlineAndReportViolation(operativeDirective(m_scriptSrc.get()), consoleMessage, contextURL, contextLine)
- && checkNonceAndReportViolation(String(), consoleMessage, contextURL, contextLine));
+ && checkNonceAndReportViolation(m_scriptNonce.get(), String(), consoleMessage, contextURL, contextLine));
} else {
return (checkInline(operativeDirective(m_scriptSrc.get()))
- && checkNonce(String()));
+ && checkNonce(m_scriptNonce.get(), String()));
}
}
@@ -729,10 +909,10 @@ bool CSPDirectiveList::allowInlineEventHandlers(const String& contextURL, const
DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to execute inline event handler because it violates the following Content Security Policy directive: "));
if (reportingStatus == ContentSecurityPolicy::SendReport) {
return (checkInlineAndReportViolation(operativeDirective(m_scriptSrc.get()), consoleMessage, contextURL, contextLine)
- && checkNonceAndReportViolation(String(), consoleMessage, contextURL, contextLine));
+ && checkNonceAndReportViolation(m_scriptNonce.get(), String(), consoleMessage, contextURL, contextLine));
} else {
return (checkInline(operativeDirective(m_scriptSrc.get()))
- && checkNonce(String()));
+ && checkNonce(m_scriptNonce.get(), String()));
}
}
@@ -764,8 +944,15 @@ bool CSPDirectiveList::allowScriptNonce(const String& nonce, const String& conte
{
DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to execute script because it violates the following Content Security Policy directive: "));
if (url.isEmpty())
- return checkNonceAndReportViolation(nonce, consoleMessage, contextURL, contextLine);
- return checkNonceAndReportViolation(nonce, "Refused to load '" + url.string() + "' because it violates the following Content Security Policy directive: ", contextURL, contextLine);
+ return checkNonceAndReportViolation(m_scriptNonce.get(), nonce, consoleMessage, contextURL, contextLine);
+ return checkNonceAndReportViolation(m_scriptNonce.get(), nonce, "Refused to load '" + url.string() + "' because it violates the following Content Security Policy directive: ", contextURL, contextLine);
+}
+
+bool CSPDirectiveList::allowPluginType(const String& type, const String& typeAttribute, const KURL& url, ContentSecurityPolicy::ReportingStatus reportingStatus) const
+{
+ return reportingStatus == ContentSecurityPolicy::SendReport ?
+ checkMediaTypeAndReportViolation(m_pluginTypes.get(), type, typeAttribute, "Refused to load '" + url.string() + "' (MIME type '" + typeAttribute + "') because it violates the following Content Security Policy Directive: ") :
+ checkMediaType(m_pluginTypes.get(), type, typeAttribute);
}
bool CSPDirectiveList::allowScriptFromSource(const KURL& url, ContentSecurityPolicy::ReportingStatus reportingStatus) const
@@ -842,6 +1029,14 @@ void CSPDirectiveList::gatherReportURIs(DOMStringList& list) const
list.append(m_reportURIs[i].string());
}
+bool CSPDirectiveList::allowFormAction(const KURL& url, ContentSecurityPolicy::ReportingStatus reportingStatus) const
+{
+ DEFINE_STATIC_LOCAL(String, type, ("form"));
+ return reportingStatus == ContentSecurityPolicy::SendReport ?
+ checkSourceAndReportViolation(m_formAction.get(), url, type) :
+ checkSource(m_formAction.get(), url);
+}
+
// policy = directive-list
// directive-list = [ directive *( ";" [ directive ] ) ]
//
@@ -943,45 +1138,15 @@ void CSPDirectiveList::parseReportURI(const String& name, const String& value)
}
}
-void CSPDirectiveList::parseScriptNonce(const String& name, const String& value)
-{
- if (!m_scriptNonce.isNull()) {
- m_policy->reportDuplicateDirective(name);
- return;
- }
- String nonce;
- const UChar* position = value.characters();
- const UChar* end = position + value.length();
-
- skipWhile<isASCIISpace>(position, end);
- const UChar* nonceBegin = position;
- if (position == end) {
- m_policy->reportInvalidNonce(String());
- m_scriptNonce = "";
- return;
- }
- skipWhile<isNotASCIISpace>(position, end);
- if (nonceBegin < position)
- nonce = String(nonceBegin, position - nonceBegin);
-
- // Trim off trailing whitespace: If we're not at the end of the string, log
- // an error.
- skipWhile<isASCIISpace>(position, end);
- if (position < end) {
- m_policy->reportInvalidNonce(value);
- m_scriptNonce = "";
- } else
- m_scriptNonce = nonce;
-}
-
-void CSPDirectiveList::setCSPDirective(const String& name, const String& value, OwnPtr<CSPDirective>& directive)
+template<class CSPDirectiveType>
+void CSPDirectiveList::setCSPDirective(const String& name, const String& value, OwnPtr<CSPDirectiveType>& directive)
{
if (directive) {
m_policy->reportDuplicateDirective(name);
return;
}
- directive = adoptPtr(new CSPDirective(name, value, m_policy));
+ directive = adoptPtr(new CSPDirectiveType(name, value, m_policy));
}
void CSPDirectiveList::applySandboxPolicy(const String& name, const String& sandboxPolicy)
@@ -998,9 +1163,6 @@ void CSPDirectiveList::addDirective(const String& name, const String& value)
{
DEFINE_STATIC_LOCAL(String, defaultSrc, ("default-src"));
DEFINE_STATIC_LOCAL(String, scriptSrc, ("script-src"));
-#if ENABLE(CSP_NEXT)
- DEFINE_STATIC_LOCAL(String, scriptNonce, ("script-nonce"));
-#endif
DEFINE_STATIC_LOCAL(String, objectSrc, ("object-src"));
DEFINE_STATIC_LOCAL(String, frameSrc, ("frame-src"));
DEFINE_STATIC_LOCAL(String, imgSrc, ("img-src"));
@@ -1010,34 +1172,43 @@ void CSPDirectiveList::addDirective(const String& name, const String& value)
DEFINE_STATIC_LOCAL(String, connectSrc, ("connect-src"));
DEFINE_STATIC_LOCAL(String, sandbox, ("sandbox"));
DEFINE_STATIC_LOCAL(String, reportURI, ("report-uri"));
+#if ENABLE(CSP_NEXT)
+ DEFINE_STATIC_LOCAL(String, formAction, ("form-action"));
+ DEFINE_STATIC_LOCAL(String, pluginTypes, ("plugin-types"));
+ DEFINE_STATIC_LOCAL(String, scriptNonce, ("script-nonce"));
+#endif
ASSERT(!name.isEmpty());
if (equalIgnoringCase(name, defaultSrc))
- setCSPDirective(name, value, m_defaultSrc);
+ setCSPDirective<SourceListDirective>(name, value, m_defaultSrc);
else if (equalIgnoringCase(name, scriptSrc))
- setCSPDirective(name, value, m_scriptSrc);
+ setCSPDirective<SourceListDirective>(name, value, m_scriptSrc);
else if (equalIgnoringCase(name, objectSrc))
- setCSPDirective(name, value, m_objectSrc);
+ setCSPDirective<SourceListDirective>(name, value, m_objectSrc);
else if (equalIgnoringCase(name, frameSrc))
- setCSPDirective(name, value, m_frameSrc);
+ setCSPDirective<SourceListDirective>(name, value, m_frameSrc);
else if (equalIgnoringCase(name, imgSrc))
- setCSPDirective(name, value, m_imgSrc);
+ setCSPDirective<SourceListDirective>(name, value, m_imgSrc);
else if (equalIgnoringCase(name, styleSrc))
- setCSPDirective(name, value, m_styleSrc);
+ setCSPDirective<SourceListDirective>(name, value, m_styleSrc);
else if (equalIgnoringCase(name, fontSrc))
- setCSPDirective(name, value, m_fontSrc);
+ setCSPDirective<SourceListDirective>(name, value, m_fontSrc);
else if (equalIgnoringCase(name, mediaSrc))
- setCSPDirective(name, value, m_mediaSrc);
+ setCSPDirective<SourceListDirective>(name, value, m_mediaSrc);
else if (equalIgnoringCase(name, connectSrc))
- setCSPDirective(name, value, m_connectSrc);
+ setCSPDirective<SourceListDirective>(name, value, m_connectSrc);
else if (equalIgnoringCase(name, sandbox))
applySandboxPolicy(name, value);
else if (equalIgnoringCase(name, reportURI))
parseReportURI(name, value);
#if ENABLE(CSP_NEXT)
+ else if (equalIgnoringCase(name, formAction))
+ setCSPDirective<SourceListDirective>(name, value, m_formAction);
+ else if (equalIgnoringCase(name, pluginTypes))
+ setCSPDirective<MediaListDirective>(name, value, m_pluginTypes);
else if (equalIgnoringCase(name, scriptNonce))
- parseScriptNonce(name, value);
+ setCSPDirective<NonceDirective>(name, value, m_scriptNonce);
#endif
else
m_policy->reportUnrecognizedDirective(name);
@@ -1175,6 +1346,15 @@ bool ContentSecurityPolicy::allowScriptNonce(const String& nonce, const String&
return isAllowedByAllWithNonce<&CSPDirectiveList::allowScriptNonce>(m_policies, nonce, contextURL, contextLine, url);
}
+bool ContentSecurityPolicy::allowPluginType(const String& type, const String& typeAttribute, const KURL& url, ContentSecurityPolicy::ReportingStatus reportingStatus) const
+{
+ for (size_t i = 0; i < m_policies.size(); ++i) {
+ if (!m_policies[i].get()->allowPluginType(type, typeAttribute, url, reportingStatus))
+ return false;
+ }
+ return true;
+}
+
bool ContentSecurityPolicy::allowScriptFromSource(const KURL& url, ContentSecurityPolicy::ReportingStatus reportingStatus) const
{
return isAllowedByAllWithURL<&CSPDirectiveList::allowScriptFromSource>(m_policies, url, reportingStatus);
@@ -1215,6 +1395,11 @@ bool ContentSecurityPolicy::allowConnectToSource(const KURL& url, ContentSecurit
return isAllowedByAllWithURL<&CSPDirectiveList::allowConnectToSource>(m_policies, url, reportingStatus);
}
+bool ContentSecurityPolicy::allowFormAction(const KURL& url, ContentSecurityPolicy::ReportingStatus reportingStatus) const
+{
+ return isAllowedByAllWithURL<&CSPDirectiveList::allowFormAction>(m_policies, url, reportingStatus);
+}
+
bool ContentSecurityPolicy::isActive() const
{
return !m_policies.isEmpty();
@@ -1304,6 +1489,16 @@ void ContentSecurityPolicy::reportDuplicateDirective(const String& name) const
logToConsole(message);
}
+void ContentSecurityPolicy::reportInvalidPluginTypes(const String& pluginType) const
+{
+ String message;
+ if (pluginType.isNull())
+ message = "'plugin-types' Content Security Policy directive is empty; all plugins will be blocked.\n";
+ else
+ message = makeString("Invalid plugin type in 'plugin-types' Content Security Policy directive: '", pluginType, "'.\n");
+ logToConsole(message);
+}
+
void ContentSecurityPolicy::reportInvalidNonce(const String& nonce) const
{
String message = makeString("Ignoring invalid Content Security Policy script nonce: '", nonce, "'.\n");
diff --git a/Source/WebCore/page/ContentSecurityPolicy.h b/Source/WebCore/page/ContentSecurityPolicy.h
index 51f3869a2..3c390516a 100644
--- a/Source/WebCore/page/ContentSecurityPolicy.h
+++ b/Source/WebCore/page/ContentSecurityPolicy.h
@@ -81,6 +81,7 @@ public:
bool allowInlineStyle(const String& contextURL, const WTF::OrdinalNumber& contextLine, ReportingStatus = SendReport) const;
bool allowEval(PassRefPtr<ScriptCallStack>, ReportingStatus = SendReport) const;
bool allowScriptNonce(const String& nonce, const String& contextURL, const WTF::OrdinalNumber& contextLine, const KURL& = KURL()) const;
+ bool allowPluginType(const String& type, const String& typeAttribute, const KURL&, ReportingStatus = SendReport) const;
bool allowScriptFromSource(const KURL&, ReportingStatus = SendReport) const;
bool allowObjectFromSource(const KURL&, ReportingStatus = SendReport) const;
@@ -90,6 +91,7 @@ public:
bool allowFontFromSource(const KURL&, ReportingStatus = SendReport) const;
bool allowMediaFromSource(const KURL&, ReportingStatus = SendReport) const;
bool allowConnectToSource(const KURL&, ReportingStatus = SendReport) const;
+ bool allowFormAction(const KURL&, ReportingStatus = SendReport) const;
void setOverrideAllowInlineStyle(bool);
@@ -99,6 +101,7 @@ public:
void reportDuplicateDirective(const String&) const;
void reportIgnoredPathComponent(const String& directiveName, const String& completeSource, const String& path) const;
void reportInvalidNonce(const String&) const;
+ void reportInvalidPluginTypes(const String&) const;
void reportInvalidSourceExpression(const String& directiveName, const String& source) const;
void reportUnrecognizedDirective(const String&) const;
void reportViolation(const String& directiveText, const String& consoleMessage, const KURL& blockedURL, const Vector<KURL>& reportURIs, const String& header, const String& contextURL = String(), const WTF::OrdinalNumber& contextLine = WTF::OrdinalNumber::beforeFirst(), PassRefPtr<ScriptCallStack> = 0) const;
diff --git a/Source/WebCore/page/DOMSecurityPolicy.cpp b/Source/WebCore/page/DOMSecurityPolicy.cpp
index ca504839a..00c76ee00 100644
--- a/Source/WebCore/page/DOMSecurityPolicy.cpp
+++ b/Source/WebCore/page/DOMSecurityPolicy.cpp
@@ -30,6 +30,7 @@
#include "ContextDestructionObserver.h"
#include "DOMStringList.h"
#include "Frame.h"
+#include "ScriptCallStack.h"
#include "ScriptExecutionContext.h"
#include <wtf/text/TextPosition.h>
#include <wtf/text/WTFString.h>
@@ -47,6 +48,15 @@ bool isPolicyActiveInContext(ScriptExecutionContext* context)
return context->contentSecurityPolicy()->isActive();
}
+template<bool (ContentSecurityPolicy::*allowWithType)(const String&, const String&, const KURL&, ContentSecurityPolicy::ReportingStatus) const>
+bool isAllowedWithType(ScriptExecutionContext* context, const String& type)
+{
+ if (!isPolicyActiveInContext(context))
+ return true;
+
+ return (context->contentSecurityPolicy()->*allowWithType)(type, type, KURL(), ContentSecurityPolicy::SuppressReport);
+}
+
template<bool (ContentSecurityPolicy::*allowWithURL)(const KURL&, ContentSecurityPolicy::ReportingStatus) const>
bool isAllowedWithURL(ScriptExecutionContext* context, const String& url)
{
@@ -66,7 +76,7 @@ bool isAllowed(ScriptExecutionContext* context)
if (!isPolicyActiveInContext(context))
return true;
- return (context->contentSecurityPolicy()->*allowWithContext)(KURL(), WTF::OrdinalNumber::beforeFirst(), ContentSecurityPolicy::SuppressReport);
+ return (context->contentSecurityPolicy()->*allowWithContext)(String(), WTF::OrdinalNumber::beforeFirst(), ContentSecurityPolicy::SuppressReport);
}
} // namespace
@@ -124,6 +134,11 @@ bool DOMSecurityPolicy::allowsFontFrom(const String& url) const
return isAllowedWithURL<&ContentSecurityPolicy::allowFontFromSource>(scriptExecutionContext(), url);
}
+bool DOMSecurityPolicy::allowsFormAction(const String& url) const
+{
+ return isAllowedWithURL<&ContentSecurityPolicy::allowFormAction>(scriptExecutionContext(), url);
+}
+
bool DOMSecurityPolicy::allowsFrameFrom(const String& url) const
{
return isAllowedWithURL<&ContentSecurityPolicy::allowChildFrameFromSource>(scriptExecutionContext(), url);
@@ -144,6 +159,11 @@ bool DOMSecurityPolicy::allowsObjectFrom(const String& url) const
return isAllowedWithURL<&ContentSecurityPolicy::allowObjectFromSource>(scriptExecutionContext(), url);
}
+bool DOMSecurityPolicy::allowsPluginType(const String& type) const
+{
+ return isAllowedWithType<&ContentSecurityPolicy::allowPluginType>(scriptExecutionContext(), type);
+}
+
bool DOMSecurityPolicy::allowsScriptFrom(const String& url) const
{
return isAllowedWithURL<&ContentSecurityPolicy::allowScriptFromSource>(scriptExecutionContext(), url);
diff --git a/Source/WebCore/page/DOMSecurityPolicy.h b/Source/WebCore/page/DOMSecurityPolicy.h
index ce8f4e7f7..97dbae11a 100644
--- a/Source/WebCore/page/DOMSecurityPolicy.h
+++ b/Source/WebCore/page/DOMSecurityPolicy.h
@@ -55,10 +55,12 @@ public:
bool allowsConnectionTo(const String& url) const;
bool allowsFontFrom(const String& url) const;
+ bool allowsFormAction(const String& url) const;
bool allowsFrameFrom(const String& url) const;
bool allowsImageFrom(const String& url) const;
bool allowsMediaFrom(const String& url) const;
bool allowsObjectFrom(const String& url) const;
+ bool allowsPluginType(const String& type) const;
bool allowsScriptFrom(const String& url) const;
bool allowsStyleFrom(const String& url) const;
diff --git a/Source/WebCore/page/DOMSecurityPolicy.idl b/Source/WebCore/page/DOMSecurityPolicy.idl
index fce11b2ee..46077a00f 100644
--- a/Source/WebCore/page/DOMSecurityPolicy.idl
+++ b/Source/WebCore/page/DOMSecurityPolicy.idl
@@ -35,10 +35,12 @@ module core {
boolean allowsConnectionTo(in DOMString url);
boolean allowsFontFrom(in DOMString url);
+ boolean allowsFormAction(in DOMString url);
boolean allowsFrameFrom(in DOMString url);
boolean allowsImageFrom(in DOMString url);
boolean allowsMediaFrom(in DOMString url);
boolean allowsObjectFrom(in DOMString url);
+ boolean allowsPluginType(in DOMString type);
boolean allowsScriptFrom(in DOMString url);
boolean allowsStyleFrom(in DOMString url);
diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp
index 448150363..d787a65bd 100644
--- a/Source/WebCore/page/DOMWindow.cpp
+++ b/Source/WebCore/page/DOMWindow.cpp
@@ -391,11 +391,19 @@ bool DOMWindow::canShowModalDialogNow(const Frame* frame)
return page->chrome()->canRunModalNow();
}
-DOMWindow::DOMWindow(Frame* frame)
- : FrameDestructionObserver(frame)
+DOMWindow::DOMWindow(Document* document)
+ : ContextDestructionObserver(document)
+ , FrameDestructionObserver(document->frame())
, m_shouldPrintWhenFinishedLoading(false)
, m_suspendedForPageCache(false)
{
+ ASSERT(frame());
+ ASSERT(DOMWindow::document());
+}
+
+void DOMWindow::didSecureTransitionTo(Document* document)
+{
+ observeContext(document);
}
DOMWindow::~DOMWindow()
@@ -429,9 +437,9 @@ DOMWindow::~DOMWindow()
else
willDestroyDocumentInFrame();
- // As the ASSERTs above indicate, this clear should only be necesary if this DOMWindow is suspended for the page cache.
+ // As the ASSERTs above indicate, this reset should only be necessary if this DOMWindow is suspended for the page cache.
// But we don't want to risk any of these objects hanging around after we've been destroyed.
- clearDOMWindowProperties();
+ resetDOMWindowProperties();
removeAllUnloadEventListeners(this);
removeAllBeforeUnloadEventListeners(this);
@@ -444,7 +452,7 @@ const AtomicString& DOMWindow::interfaceName() const
ScriptExecutionContext* DOMWindow::scriptExecutionContext() const
{
- return document();
+ return ContextDestructionObserver::scriptExecutionContext();
}
DOMWindow* DOMWindow::toDOMWindow()
@@ -457,11 +465,6 @@ PassRefPtr<MediaQueryList> DOMWindow::matchMedia(const String& media)
return document() ? document()->mediaQueryMatcher()->matchMedia(media) : 0;
}
-void DOMWindow::setSecurityOrigin(SecurityOrigin* securityOrigin)
-{
- m_securityOrigin = securityOrigin;
-}
-
Page* DOMWindow::page()
{
return frame() ? frame()->page() : 0;
@@ -471,7 +474,7 @@ void DOMWindow::frameDestroyed()
{
willDestroyDocumentInFrame();
FrameDestructionObserver::frameDestroyed();
- clearDOMWindowProperties();
+ resetDOMWindowProperties();
}
void DOMWindow::willDetachPage()
@@ -519,16 +522,12 @@ void DOMWindow::unregisterProperty(DOMWindowProperty* property)
m_properties.remove(property);
}
-void DOMWindow::clear()
+void DOMWindow::resetUnlessSuspendedForPageCache()
{
- // The main frame will always try to clear its DOMWindow when a new load is committed, even if that
- // DOMWindow is suspended in the page cache.
- // In those cases we need to make sure we don't actually clear it.
if (m_suspendedForPageCache)
return;
-
willDestroyDocumentInFrame();
- clearDOMWindowProperties();
+ resetDOMWindowProperties();
}
void DOMWindow::suspendForPageCache()
@@ -564,7 +563,7 @@ void DOMWindow::reconnectDOMWindowProperties()
properties[i]->reconnectFrameFromPageCache(m_frame);
}
-void DOMWindow::clearDOMWindowProperties()
+void DOMWindow::resetDOMWindowProperties()
{
m_properties.clear();
@@ -591,7 +590,7 @@ void DOMWindow::clearDOMWindowProperties()
bool DOMWindow::isCurrentlyDisplayedInFrame() const
{
- return m_frame && m_frame->domWindow() == this;
+ return m_frame && m_frame->document()->domWindow() == this;
}
#if ENABLE(ORIENTATION_EVENTS)
@@ -1257,7 +1256,7 @@ DOMWindow* DOMWindow::self() const
if (!m_frame)
return 0;
- return m_frame->domWindow();
+ return m_frame->document()->domWindow();
}
DOMWindow* DOMWindow::opener() const
@@ -1269,7 +1268,7 @@ DOMWindow* DOMWindow::opener() const
if (!opener)
return 0;
- return opener->domWindow();
+ return opener->document()->domWindow();
}
DOMWindow* DOMWindow::parent() const
@@ -1279,9 +1278,9 @@ DOMWindow* DOMWindow::parent() const
Frame* parent = m_frame->tree()->parent();
if (parent)
- return parent->domWindow();
+ return parent->document()->domWindow();
- return m_frame->domWindow();
+ return m_frame->document()->domWindow();
}
DOMWindow* DOMWindow::top() const
@@ -1293,17 +1292,14 @@ DOMWindow* DOMWindow::top() const
if (!page)
return 0;
- return m_frame->tree()->top()->domWindow();
+ return m_frame->tree()->top()->document()->domWindow();
}
Document* DOMWindow::document() const
{
- if (!isCurrentlyDisplayedInFrame())
- return 0;
-
- // FIXME: This function shouldn't need a frame to work.
- ASSERT(m_frame->document());
- return m_frame->document();
+ ScriptExecutionContext* context = ContextDestructionObserver::scriptExecutionContext();
+ ASSERT(!context || context->isDocument());
+ return static_cast<Document*>(context);
}
PassRefPtr<StyleMedia> DOMWindow::styleMedia() const
@@ -1580,10 +1576,10 @@ bool DOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<Event
else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadListeners(this))
addBeforeUnloadEventListener(this);
#if ENABLE(DEVICE_ORIENTATION)
- else if (eventType == eventNames().devicemotionEvent) {
+ else if (eventType == eventNames().devicemotionEvent && RuntimeEnabledFeatures::deviceMotionEnabled()) {
if (DeviceMotionController* controller = DeviceMotionController::from(page()))
controller->addListener(this);
- } else if (eventType == eventNames().deviceorientationEvent) {
+ } else if (eventType == eventNames().deviceorientationEvent && RuntimeEnabledFeatures::deviceOrientationEnabled()) {
if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
controller->addListener(this);
}
@@ -1755,14 +1751,14 @@ void DOMWindow::printErrorMessage(const String& message)
String DOMWindow::crossDomainAccessErrorMessage(DOMWindow* activeWindow)
{
- const KURL& activeWindowURL = activeWindow->url();
+ const KURL& activeWindowURL = activeWindow->document()->url();
if (activeWindowURL.isNull())
return String();
// FIXME: This error message should contain more specifics of why the same origin check has failed.
// Perhaps we should involve the security origin object in composing it.
// FIXME: This message, and other console messages, have extra newlines. Should remove them.
- return "Unsafe JavaScript attempt to access frame with URL " + m_url.string() + " from frame with URL " + activeWindowURL.string() + ". Domains, protocols and ports must match.\n";
+ return "Unsafe JavaScript attempt to access frame with URL " + document()->url().string() + " from frame with URL " + activeWindowURL.string() + ". Domains, protocols and ports must match.\n";
}
bool DOMWindow::isInsecureScriptAccess(DOMWindow* activeWindow, const String& urlString)
@@ -1781,7 +1777,7 @@ bool DOMWindow::isInsecureScriptAccess(DOMWindow* activeWindow, const String& ur
// FIXME: The name canAccess seems to be a roundabout way to ask "can execute script".
// Can we name the SecurityOrigin function better to make this more clear?
- if (activeWindow->securityOrigin()->canAccess(securityOrigin()))
+ if (activeWindow->document()->securityOrigin()->canAccess(document()->securityOrigin()))
return false;
}
@@ -1806,7 +1802,7 @@ Frame* DOMWindow::createWindow(const String& urlString, const AtomicString& fram
ResourceRequest request(completedURL, referrer);
FrameLoader::addHTTPOriginIfNeeded(request, firstFrame->loader()->outgoingOrigin());
- FrameLoadRequest frameRequest(activeWindow->securityOrigin(), request, frameName);
+ FrameLoadRequest frameRequest(activeWindow->document()->securityOrigin(), request, frameName);
// We pass the opener frame for the lookupFrame in case the active frame is different from
// the opener frame, and the name references a frame relative to the opener frame.
@@ -1818,17 +1814,17 @@ Frame* DOMWindow::createWindow(const String& urlString, const AtomicString& fram
newFrame->loader()->setOpener(openerFrame);
newFrame->page()->setOpenedByDOM();
- if (newFrame->domWindow()->isInsecureScriptAccess(activeWindow, completedURL))
+ if (newFrame->document()->domWindow()->isInsecureScriptAccess(activeWindow, completedURL))
return newFrame;
if (function)
- function(newFrame->domWindow(), functionContext);
+ function(newFrame->document()->domWindow(), functionContext);
if (created)
- newFrame->loader()->changeLocation(activeWindow->securityOrigin(), completedURL, referrer, false, false);
+ newFrame->loader()->changeLocation(activeWindow->document()->securityOrigin(), completedURL, referrer, false, false);
else if (!urlString.isEmpty()) {
bool lockHistory = !ScriptController::processingUserGesture();
- newFrame->navigationScheduler()->scheduleLocationChange(activeWindow->securityOrigin(), completedURL.string(), referrer, lockHistory, false);
+ newFrame->navigationScheduler()->scheduleLocationChange(activeWindow->document()->securityOrigin(), completedURL.string(), referrer, lockHistory, false);
}
return newFrame;
@@ -1870,11 +1866,11 @@ PassRefPtr<DOMWindow> DOMWindow::open(const String& urlString, const AtomicStrin
KURL completedURL = firstFrame->document()->completeURL(urlString);
- if (targetFrame->domWindow()->isInsecureScriptAccess(activeWindow, completedURL))
- return targetFrame->domWindow();
+ if (targetFrame->document()->domWindow()->isInsecureScriptAccess(activeWindow, completedURL))
+ return targetFrame->document()->domWindow();
if (urlString.isEmpty())
- return targetFrame->domWindow();
+ return targetFrame->document()->domWindow();
// For whatever reason, Firefox uses the first window rather than the active window to
// determine the outgoing referrer. We replicate that behavior here.
@@ -1885,7 +1881,7 @@ PassRefPtr<DOMWindow> DOMWindow::open(const String& urlString, const AtomicStrin
firstFrame->loader()->outgoingReferrer(),
lockHistory,
false);
- return targetFrame->domWindow();
+ return targetFrame->document()->domWindow();
}
WindowFeatures windowFeatures(windowFeaturesString);
@@ -1899,7 +1895,7 @@ PassRefPtr<DOMWindow> DOMWindow::open(const String& urlString, const AtomicStrin
windowFeatures.width = windowRect.width();
Frame* result = createWindow(urlString, frameName, windowFeatures, activeWindow, firstFrame, m_frame);
- return result ? result->domWindow() : 0;
+ return result ? result->document()->domWindow() : 0;
}
void DOMWindow::showModalDialog(const String& urlString, const String& dialogFeaturesString,
diff --git a/Source/WebCore/page/DOMWindow.h b/Source/WebCore/page/DOMWindow.h
index 0b7ff93f0..87396185c 100644
--- a/Source/WebCore/page/DOMWindow.h
+++ b/Source/WebCore/page/DOMWindow.h
@@ -27,6 +27,7 @@
#ifndef DOMWindow_h
#define DOMWindow_h
+#include "ContextDestructionObserver.h"
#include "EventTarget.h"
#include "FrameDestructionObserver.h"
#include "KURL.h"
@@ -81,11 +82,25 @@ namespace WebCore {
enum SetLocationLocking { LockHistoryBasedOnGestureState, LockHistoryAndBackForwardList };
- class DOMWindow : public RefCounted<DOMWindow>, public EventTarget, public FrameDestructionObserver, public Supplementable<DOMWindow> {
+ // FIXME: DOMWindow shouldn't subclass FrameDestructionObserver and instead should get to Frame via its Document.
+ class DOMWindow : public RefCounted<DOMWindow>
+ , public EventTarget
+ , public ContextDestructionObserver
+ , public FrameDestructionObserver
+ , public Supplementable<DOMWindow> {
public:
- static PassRefPtr<DOMWindow> create(Frame* frame) { return adoptRef(new DOMWindow(frame)); }
+ static PassRefPtr<DOMWindow> create(Document* document) { return adoptRef(new DOMWindow(document)); }
virtual ~DOMWindow();
+ // In some rare cases, we'll re-used a DOMWindow for a new Document. For example,
+ // when a script calls window.open("..."), the browser gives JavaScript a window
+ // synchronously but kicks off the load in the window asynchronously. Web sites
+ // expect that modifications that they make to the window object synchronously
+ // won't be blown away when the network load commits. To make that happen, we
+ // "securely transition" the existing DOMWindow to the Document that results from
+ // the network load. See also SecurityContext::isSecureTransitionTo.
+ void didSecureTransitionTo(Document*);
+
virtual const AtomicString& interfaceName() const;
virtual ScriptExecutionContext* scriptExecutionContext() const;
@@ -94,18 +109,12 @@ namespace WebCore {
void registerProperty(DOMWindowProperty*);
void unregisterProperty(DOMWindowProperty*);
- void clear();
+ void resetUnlessSuspendedForPageCache();
void suspendForPageCache();
void resumeFromPageCache();
PassRefPtr<MediaQueryList> matchMedia(const String&);
- void setSecurityOrigin(SecurityOrigin*);
- SecurityOrigin* securityOrigin() const { return m_securityOrigin.get(); }
-
- void setURL(const KURL& url) { m_url = url; }
- KURL url() const { return m_url; }
-
unsigned pendingUnloadEventListeners() const;
static bool dispatchAllPendingBeforeUnloadEvents();
@@ -396,7 +405,7 @@ namespace WebCore {
void willDestroyCachedFrame();
private:
- explicit DOMWindow(Frame*);
+ explicit DOMWindow(Document*);
Page* page();
@@ -413,14 +422,11 @@ namespace WebCore {
PrepareDialogFunction = 0, void* functionContext = 0);
bool isInsecureScriptAccess(DOMWindow* activeWindow, const String& urlString);
- void clearDOMWindowProperties();
+ void resetDOMWindowProperties();
void disconnectDOMWindowProperties();
void reconnectDOMWindowProperties();
void willDestroyDocumentInFrame();
- RefPtr<SecurityOrigin> m_securityOrigin;
- KURL m_url;
-
bool m_shouldPrintWhenFinishedLoading;
bool m_suspendedForPageCache;
diff --git a/Source/WebCore/page/DOMWindowProperty.cpp b/Source/WebCore/page/DOMWindowProperty.cpp
index ad0469806..6f109f1ed 100644
--- a/Source/WebCore/page/DOMWindowProperty.cpp
+++ b/Source/WebCore/page/DOMWindowProperty.cpp
@@ -28,6 +28,7 @@
#include "DOMWindowProperty.h"
#include "DOMWindow.h"
+#include "Document.h"
#include "Frame.h"
namespace WebCore {
@@ -40,7 +41,7 @@ DOMWindowProperty::DOMWindowProperty(Frame* frame)
// See fast/dom/navigator-detached-no-crash.html for the recipe.
// We should fix that. <rdar://problem/11567132>
if (m_frame) {
- m_associatedDOMWindow = m_frame->domWindow();
+ m_associatedDOMWindow = m_frame->document()->domWindow();
m_associatedDOMWindow->registerProperty(this);
}
}
@@ -70,7 +71,7 @@ void DOMWindowProperty::reconnectFrameFromPageCache(Frame* frame)
// been disconnected from its Frame in the first place and it should still have an associated DOMWindow.
ASSERT(frame);
ASSERT(!m_frame);
- ASSERT(frame->domWindow() == m_associatedDOMWindow);
+ ASSERT(frame->document()->domWindow() == m_associatedDOMWindow);
m_frame = frame;
}
diff --git a/Source/WebCore/page/DragController.cpp b/Source/WebCore/page/DragController.cpp
index b8205751b..c744c189e 100644
--- a/Source/WebCore/page/DragController.cpp
+++ b/Source/WebCore/page/DragController.cpp
@@ -423,7 +423,7 @@ bool DragController::dispatchTextInputEventFor(Frame* innerFrame, DragData* drag
String text = m_page->dragCaretController()->isContentRichlyEditable() ? "" : dragData->asPlainText(innerFrame);
Node* target = innerFrame->editor()->findEventTargetFrom(m_page->dragCaretController()->caretPosition());
ExceptionCode ec = 0;
- return target->dispatchEvent(TextEvent::createForDrop(innerFrame->domWindow(), text), ec);
+ return target->dispatchEvent(TextEvent::createForDrop(innerFrame->document()->domWindow(), text), ec);
}
bool DragController::concludeEditDrag(DragData* dragData)
diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp
index 7a078e852..04f636eae 100644
--- a/Source/WebCore/page/EventHandler.cpp
+++ b/Source/WebCore/page/EventHandler.cpp
@@ -417,7 +417,7 @@ bool EventHandler::updateSelectionForMouseDownDispatchingSelectStart(Node* targe
void EventHandler::selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults& result)
{
- Node* innerNode = targetNode(result);
+ Node* innerNode = result.targetNode();
VisibleSelection newSelection;
if (innerNode && innerNode->renderer() && m_mouseDownMayStartSelect) {
@@ -439,7 +439,7 @@ void EventHandler::selectClosestWordOrLinkFromMouseEvent(const MouseEventWithHit
if (!result.hitTestResult().isLiveLink())
return selectClosestWordFromMouseEvent(result);
- Node* innerNode = targetNode(result);
+ Node* innerNode = result.targetNode();
if (innerNode && innerNode->renderer() && m_mouseDownMayStartSelect) {
VisibleSelection newSelection;
@@ -475,7 +475,7 @@ bool EventHandler::handleMousePressEventTripleClick(const MouseEventWithHitTestR
if (event.event().button() != LeftButton)
return false;
- Node* innerNode = targetNode(event);
+ Node* innerNode = event.targetNode();
if (!(innerNode && innerNode->renderer() && m_mouseDownMayStartSelect))
return false;
@@ -498,7 +498,7 @@ static int textDistance(const Position& start, const Position& end)
bool EventHandler::handleMousePressEventSingleClick(const MouseEventWithHitTestResults& event)
{
m_frame->document()->updateLayoutIgnorePendingStylesheets();
- Node* innerNode = targetNode(event);
+ Node* innerNode = event.targetNode();
if (!(innerNode && innerNode->renderer() && m_mouseDownMayStartSelect))
return false;
@@ -580,7 +580,7 @@ bool EventHandler::handleMousePressEvent(const MouseEventWithHitTestResults& eve
// If we got the event back, that must mean it wasn't prevented,
// so it's allowed to start a drag or selection.
- m_mouseDownMayStartSelect = canMouseDownStartSelect(targetNode(event));
+ m_mouseDownMayStartSelect = canMouseDownStartSelect(event.targetNode());
#if ENABLE(DRAG_SUPPORT)
// Careful that the drag starting logic stays in sync with eventMayStartDrag()
@@ -610,7 +610,7 @@ bool EventHandler::handleMousePressEvent(const MouseEventWithHitTestResults& eve
if (singleClick)
focusDocumentView();
- Node* innerNode = targetNode(event);
+ Node* innerNode = event.targetNode();
m_mousePressNode = innerNode;
#if ENABLE(DRAG_SUPPORT)
@@ -667,7 +667,7 @@ bool EventHandler::handleMouseDraggedEvent(const MouseEventWithHitTestResults& e
if (!m_mousePressed)
return false;
- Node* targetNode = EventHandler::targetNode(event);
+ Node* targetNode = event.targetNode();
if (event.event().button() != LeftButton || !targetNode)
return false;
@@ -782,7 +782,7 @@ void EventHandler::updateSelectionForMouseDrag(const HitTestResult& hitTestResul
if (!m_mouseDownMayStartSelect)
return;
- Node* target = targetNode(hitTestResult);
+ Node* target = hitTestResult.targetNode();
if (!target)
return;
@@ -875,7 +875,7 @@ bool EventHandler::handleMouseReleaseEvent(const MouseEventWithHitTestResults& e
&& m_frame->selection()->isRange()
&& event.event().button() != RightButton) {
VisibleSelection newSelection;
- Node* node = targetNode(event);
+ Node* node = event.targetNode();
bool caretBrowsing = m_frame->settings() && m_frame->settings()->caretBrowsingEnabled();
if (node && (caretBrowsing || node->rendererIsEditable()) && node->renderer()) {
VisiblePosition pos = node->renderer()->positionForPoint(event.localPoint());
@@ -1250,7 +1250,7 @@ Frame* EventHandler::subframeForHitTestResult(const MouseEventWithHitTestResults
{
if (!hitTestResult.isOverWidget())
return 0;
- return subframeForTargetNode(targetNode(hitTestResult));
+ return subframeForTargetNode(hitTestResult.targetNode());
}
Frame* EventHandler::subframeForTargetNode(Node* node)
@@ -1291,7 +1291,7 @@ OptionalCursor EventHandler::selectCursor(const MouseEventWithHitTestResults& ev
if (page->mainFrame()->eventHandler()->m_panScrollInProgress)
return NoCursorChange;
- Node* node = targetNode(event);
+ Node* node = event.targetNode();
RenderObject* renderer = node ? node->renderer() : 0;
RenderStyle* style = renderer ? renderer->style() : 0;
bool horizontalText = !style || style->isHorizontalWritingMode();
@@ -1461,27 +1461,6 @@ static LayoutPoint documentPointForWindowPoint(Frame* frame, const IntPoint& win
return view ? view->windowToContents(windowPoint) : windowPoint;
}
-Node* EventHandler::targetNode(const MouseEventWithHitTestResults& event)
-{
- return targetNode(event.hitTestResult());
-}
-
-Node* EventHandler::targetNode(const HitTestResult& hitTestResult)
-{
- Node* node = hitTestResult.innerNode();
- if (!node)
- return 0;
- if (node->inDocument())
- return node;
-
- Element* element = node->parentElement();
- if (element && element->inDocument())
- return element;
-
- return node;
-
-}
-
bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
{
RefPtr<FrameView> protector(m_frame->view());
@@ -1527,12 +1506,12 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
LayoutPoint documentPoint = documentPointForWindowPoint(m_frame, mouseEvent.position());
MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(request, documentPoint, mouseEvent);
- if (!targetNode(mev)) {
+ if (!mev.targetNode()) {
invalidateClick();
return false;
}
- m_mousePressNode = targetNode(mev);
+ m_mousePressNode = mev.targetNode();
Frame* subframe = subframeForHitTestResult(mev);
if (subframe && passMousePressEventToSubframe(mev, subframe)) {
@@ -1540,7 +1519,7 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
// the m_mousePressed flag, which may happen if an AppKit widget entered a modal event loop.
m_capturesDragging = subframe->eventHandler()->capturesDragging();
if (m_mousePressed && m_capturesDragging) {
- m_capturingMouseEventsNode = targetNode(mev);
+ m_capturingMouseEventsNode = mev.targetNode();
m_eventHandlerWillResetCapturingMouseEventsNode = true;
}
invalidateClick();
@@ -1562,7 +1541,7 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
#endif
m_clickCount = mouseEvent.clickCount();
- m_clickNode = targetNode(mev);
+ m_clickNode = mev.targetNode();
if (FrameView* view = m_frame->view()) {
RenderLayer* layer = m_clickNode->renderer() ? m_clickNode->renderer()->enclosingLayer() : 0;
@@ -1578,7 +1557,7 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
m_frame->selection()->setCaretBlinkingSuspended(true);
- bool swallowEvent = dispatchMouseEvent(eventNames().mousedownEvent, targetNode(mev), true, m_clickCount, mouseEvent, true);
+ bool swallowEvent = dispatchMouseEvent(eventNames().mousedownEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
m_capturesDragging = !swallowEvent || mev.scrollbar();
// If the hit testing originally determined the event was in a scrollbar, refetch the MouseEventWithHitTestResults
@@ -1604,7 +1583,7 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
// If a mouse event handler changes the input element type to one that has a widget associated,
// we'd like to EventHandler::handleMousePressEvent to pass the event to the widget and thus the
// event target node can't still be the shadow node.
- if (targetNode(mev)->isShadowRoot() && toShadowRoot(targetNode(mev))->host()->hasTagName(inputTag)) {
+ if (mev.targetNode()->isShadowRoot() && toShadowRoot(mev.targetNode())->host()->hasTagName(inputTag)) {
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);
mev = m_frame->document()->prepareMouseEvent(request, documentPoint, mouseEvent);
}
@@ -1646,9 +1625,9 @@ bool EventHandler::handleMouseDoubleClickEvent(const PlatformMouseEvent& mouseEv
return true;
m_clickCount = mouseEvent.clickCount();
- bool swallowMouseUpEvent = dispatchMouseEvent(eventNames().mouseupEvent, targetNode(mev), true, m_clickCount, mouseEvent, false);
+ bool swallowMouseUpEvent = dispatchMouseEvent(eventNames().mouseupEvent, mev.targetNode(), true, m_clickCount, mouseEvent, false);
- bool swallowClickEvent = mouseEvent.button() != RightButton && targetNode(mev) == m_clickNode && dispatchMouseEvent(eventNames().clickEvent, targetNode(mev), true, m_clickCount, mouseEvent, true);
+ bool swallowClickEvent = mouseEvent.button() != RightButton && mev.targetNode() == m_clickNode && dispatchMouseEvent(eventNames().clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
if (m_lastScrollbarUnderMouse)
swallowMouseUpEvent = m_lastScrollbarUnderMouse->mouseUp(mouseEvent);
@@ -1797,7 +1776,7 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi
if (newSubframe) {
// Update over/out state before passing the event to the subframe.
- updateMouseEventTargetNode(targetNode(mev), mouseEvent, true);
+ updateMouseEventTargetNode(mev.targetNode(), mouseEvent, true);
// Event dispatch in updateMouseEventTargetNode may have caused the subframe of the target
// node to be detached from its FrameView, in which case the event should not be passed.
@@ -1818,7 +1797,7 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi
if (swallowEvent)
return true;
- swallowEvent = dispatchMouseEvent(eventNames().mousemoveEvent, targetNode(mev), false, 0, mouseEvent, true);
+ swallowEvent = dispatchMouseEvent(eventNames().mousemoveEvent, mev.targetNode(), false, 0, mouseEvent, true);
#if ENABLE(DRAG_SUPPORT)
if (!swallowEvent)
swallowEvent = handleMouseDraggedEvent(mev);
@@ -1880,14 +1859,14 @@ bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent)
if (subframe && passMouseReleaseEventToSubframe(mev, subframe))
return true;
- bool swallowMouseUpEvent = dispatchMouseEvent(eventNames().mouseupEvent, targetNode(mev), true, m_clickCount, mouseEvent, false);
+ bool swallowMouseUpEvent = dispatchMouseEvent(eventNames().mouseupEvent, mev.targetNode(), true, m_clickCount, mouseEvent, false);
- Node* clickTarget = targetNode(mev);
+ Node* clickTarget = mev.targetNode();
if (clickTarget)
clickTarget = clickTarget->shadowAncestorNode();
Node* adjustedClickNode = m_clickNode ? m_clickNode->shadowAncestorNode() : 0;
- bool swallowClickEvent = m_clickCount > 0 && mouseEvent.button() != RightButton && clickTarget == adjustedClickNode && dispatchMouseEvent(eventNames().clickEvent, targetNode(mev), true, m_clickCount, mouseEvent, true);
+ bool swallowClickEvent = m_clickCount > 0 && mouseEvent.button() != RightButton && clickTarget == adjustedClickNode && dispatchMouseEvent(eventNames().clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
if (m_resizeLayer) {
m_resizeLayer->setInResizeMode(false);
@@ -1987,7 +1966,7 @@ bool EventHandler::updateDragAndDrop(const PlatformMouseEvent& event, Clipboard*
MouseEventWithHitTestResults mev = prepareMouseEvent(request, event);
// Drag events should never go to text nodes (following IE, and proper mouseover/out dispatch)
- RefPtr<Node> newTarget = targetNode(mev);
+ RefPtr<Node> newTarget = mev.targetNode();
if (newTarget && newTarget->isTextNode())
newTarget = newTarget->parentNode();
@@ -2425,7 +2404,7 @@ bool EventHandler::handleGestureEvent(const PlatformGestureEvent& gestureEvent)
if (!eventTarget) {
HitTestResult result = hitTestResultAtPoint(gestureEvent.position(), false, false, DontHitTestScrollbars, HitTestRequest::ReadOnly | HitTestRequest::Active);
- eventTarget = targetNode(result);
+ eventTarget = result.targetNode();
}
if (eventTarget) {
@@ -2543,6 +2522,17 @@ bool EventHandler::bestClickableNodeForTouchPoint(const IntPoint& touchCenter, c
return success;
}
+bool EventHandler::bestContextMenuNodeForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode)
+{
+ HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active;
+ IntPoint hitTestPoint = m_frame->view()->windowToContents(touchCenter);
+ 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 findBestContextMenuCandidate(targetNode, targetPoint, touchCenter, touchRect, *nodeList.get());
+}
+
bool EventHandler::bestZoomableAreaForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntRect& targetArea, Node*& targetNode)
{
HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active;
@@ -2557,7 +2547,17 @@ bool EventHandler::bestZoomableAreaForTouchPoint(const IntPoint& touchCenter, co
bool EventHandler::adjustGesturePosition(const PlatformGestureEvent& gestureEvent, IntPoint& adjustedPoint)
{
Node* targetNode = 0;
- bestClickableNodeForTouchPoint(gestureEvent.position(), IntSize(gestureEvent.area().width() / 2, gestureEvent.area().height() / 2), adjustedPoint, targetNode);
+ switch (gestureEvent.type()) {
+ case PlatformEvent::GestureTap:
+ bestClickableNodeForTouchPoint(gestureEvent.position(), IntSize(gestureEvent.area().width() / 2, gestureEvent.area().height() / 2), adjustedPoint, targetNode);
+ break;
+ case PlatformEvent::GestureLongPress:
+ bestContextMenuNodeForTouchPoint(gestureEvent.position(), IntSize(gestureEvent.area().width() / 2, gestureEvent.area().height() / 2), adjustedPoint, targetNode);
+ break;
+ default:
+ // FIXME: Implement handling for other types as needed.
+ ASSERT_NOT_REACHED();
+ }
return targetNode;
}
#endif
@@ -2580,12 +2580,12 @@ bool EventHandler::sendContextMenuEvent(const PlatformMouseEvent& event)
// FIXME: In the editable case, word selection sometimes selects content that isn't underneath the mouse.
// If the selection is non-editable, we do word selection to make it easier to use the contextual menu items
// available for text selections. But only if we're above text.
- && (m_frame->selection()->isContentEditable() || (targetNode(mev) && targetNode(mev)->isTextNode()))) {
+ && (m_frame->selection()->isContentEditable() || (mev.targetNode() && mev.targetNode()->isTextNode()))) {
m_mouseDownMayStartSelect = true; // context menu events are always allowed to perform a selection
selectClosestWordOrLinkFromMouseEvent(mev);
}
- swallowEvent = dispatchMouseEvent(eventNames().contextmenuEvent, targetNode(mev), true, 0, event, false);
+ swallowEvent = dispatchMouseEvent(eventNames().contextmenuEvent, mev.targetNode(), true, 0, event, false);
return swallowEvent;
}
@@ -2742,6 +2742,9 @@ void EventHandler::fakeMouseMoveEventTimerFired(Timer<EventHandler>* timer)
if (!view)
return;
+ if (!m_frame->page() || !m_frame->page()->isOnscreen() || !m_frame->page()->focusController()->isActive())
+ return;
+
bool shiftKey;
bool ctrlKey;
bool altKey;
@@ -3289,7 +3292,7 @@ bool EventHandler::handleTextInputEvent(const String& text, Event* underlyingEve
if (FrameView* view = m_frame->view())
view->resetDeferredRepaintDelay();
- RefPtr<TextEvent> event = TextEvent::create(m_frame->domWindow(), text, inputType);
+ RefPtr<TextEvent> event = TextEvent::create(m_frame->document()->domWindow(), text, inputType);
event->setUnderlyingEvent(underlyingEvent);
ExceptionCode ec;
@@ -3587,7 +3590,7 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
Document* doc = node->document();
if (!doc)
continue;
- if (!doc->hasListenerType(Document::TOUCH_LISTENER))
+ if (!doc->touchEventHandlerCount())
continue;
m_originatingTouchPointTargets.set(touchPointTargetKey, node);
@@ -3607,7 +3610,7 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
Document* doc = touchTarget->toNode()->document();
if (!doc)
continue;
- if (!doc->hasListenerType(Document::TOUCH_LISTENER))
+ if (!doc->touchEventHandlerCount())
continue;
Frame* targetFrame = doc->frame();
if (!targetFrame)
diff --git a/Source/WebCore/page/EventHandler.h b/Source/WebCore/page/EventHandler.h
index 29dd9ce38..ac0ff0b1f 100644
--- a/Source/WebCore/page/EventHandler.h
+++ b/Source/WebCore/page/EventHandler.h
@@ -169,10 +169,9 @@ public:
#if ENABLE(TOUCH_ADJUSTMENT)
bool bestClickableNodeForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode);
+ bool bestContextMenuNodeForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode);
bool bestZoomableAreaForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntRect& targetArea, Node*& targetNode);
- // FIXME: Add a gesture type parameter so that different candidate selection criteria may be used for
- // different gesture types. Currently TouchAdjustment::nodeRespondsToTapGesture is used for all types.
bool adjustGesturePosition(const PlatformGestureEvent&, IntPoint& adjustedPoint);
#endif
@@ -230,8 +229,6 @@ public:
bool handleTouchEvent(const PlatformTouchEvent&);
#endif
- static Node* targetNode(const HitTestResult&);
-
private:
#if ENABLE(DRAG_SUPPORT)
static DragState& dragState();
@@ -247,8 +244,6 @@ private:
bool handleMouseDoubleClickEvent(const PlatformMouseEvent&);
- static Node* targetNode(const MouseEventWithHitTestResults&);
-
bool handleMousePressEvent(const MouseEventWithHitTestResults&);
bool handleMousePressEventSingleClick(const MouseEventWithHitTestResults&);
bool handleMousePressEventDoubleClick(const MouseEventWithHitTestResults&);
diff --git a/Source/WebCore/page/FocusController.cpp b/Source/WebCore/page/FocusController.cpp
index bf9512bd2..41e9ffdd5 100644
--- a/Source/WebCore/page/FocusController.cpp
+++ b/Source/WebCore/page/FocusController.cpp
@@ -285,7 +285,7 @@ bool FocusController::setInitialFocus(FocusDirection direction, KeyboardEvent* e
// into the web area again, even if focus did not change within WebCore. PostNotification is called instead
// of handleFocusedUIElementChanged, because this will send the notification even if the element is the same.
if (AXObjectCache::accessibilityEnabled())
- focusedOrMainFrame()->document()->axObjectCache()->postNotification(focusedOrMainFrame()->document()->renderer(), AXObjectCache::AXFocusedUIElementChanged, true);
+ focusedOrMainFrame()->document()->axObjectCache()->postNotification(focusedOrMainFrame()->document(), AXObjectCache::AXFocusedUIElementChanged, true);
return didAdvanceFocus;
}
diff --git a/Source/WebCore/page/Frame.cpp b/Source/WebCore/page/Frame.cpp
index 098810dcd..1874ddef2 100644
--- a/Source/WebCore/page/Frame.cpp
+++ b/Source/WebCore/page/Frame.cpp
@@ -288,13 +288,16 @@ void Frame::setView(PassRefPtr<FrameView> view)
void Frame::setDocument(PassRefPtr<Document> newDoc)
{
- ASSERT(!newDoc || newDoc->frame());
+ ASSERT(!newDoc || newDoc->frame() == this);
if (m_doc && m_doc->attached() && !m_doc->inPageCache()) {
// FIXME: We don't call willRemove here. Why is that OK?
m_doc->detach();
}
m_doc = newDoc;
+ ASSERT(!m_doc || m_doc->domWindow());
+ ASSERT(!m_doc || m_doc->domWindow()->frame() == this);
+
selection()->updateSecureKeyboardEntryIfActive();
if (m_doc && !m_doc->attached())
@@ -309,7 +312,7 @@ void Frame::setDocument(PassRefPtr<Document> newDoc)
if (m_page && m_page->mainFrame() == this) {
notifyChromeClientWheelEventHandlerCountChanged();
#if ENABLE(TOUCH_EVENTS)
- if (m_doc && m_doc->hasListenerType(Document::TOUCH_LISTENER))
+ if (m_doc && m_doc->touchEventHandlerCount())
m_page->chrome()->client()->needTouchEvents(true);
#endif
}
@@ -601,15 +604,6 @@ void Frame::injectUserScriptsForWorld(DOMWrapperWorld* world, const UserScriptVe
}
}
-void Frame::clearDOMWindow()
-{
- if (m_domWindow) {
- InspectorInstrumentation::frameWindowDiscarded(this, m_domWindow.get());
- m_domWindow->clear();
- }
- m_domWindow = 0;
-}
-
RenderView* Frame::contentRenderer() const
{
Document* doc = document();
@@ -669,15 +663,6 @@ void Frame::clearTimers()
clearTimers(m_view.get(), document());
}
-void Frame::setDOMWindow(DOMWindow* domWindow)
-{
- if (m_domWindow) {
- InspectorInstrumentation::frameWindowDiscarded(this, m_domWindow.get());
- m_domWindow->clear();
- }
- m_domWindow = domWindow;
-}
-
#if ENABLE(PAGE_VISIBILITY_API)
void Frame::dispatchVisibilityStateChangeEvent()
{
@@ -695,14 +680,6 @@ void Frame::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
info.addInstrumentedMember(m_loader);
}
-DOMWindow* Frame::domWindow() const
-{
- if (!m_domWindow)
- m_domWindow = DOMWindow::create(const_cast<Frame*>(this));
-
- return m_domWindow.get();
-}
-
void Frame::willDetachPage()
{
if (Frame* parent = tree()->parent())
diff --git a/Source/WebCore/page/Frame.h b/Source/WebCore/page/Frame.h
index 00c04a358..3a52956a4 100644
--- a/Source/WebCore/page/Frame.h
+++ b/Source/WebCore/page/Frame.h
@@ -128,13 +128,6 @@ namespace WebCore {
String layerTreeAsText(bool showDebugInfo = false) const;
- // Unlike most accessors in this class, domWindow() always creates a new DOMWindow if m_domWindow is null.
- // Callers that don't need a new DOMWindow to be created should use existingDOMWindow().
- DOMWindow* domWindow() const;
- DOMWindow* existingDOMWindow() { return m_domWindow.get(); }
- void setDOMWindow(DOMWindow*);
- void clearDOMWindow();
-
static Frame* frameForWidget(const Widget*);
Settings* settings() const; // can be NULL
@@ -214,8 +207,6 @@ namespace WebCore {
mutable FrameLoader m_loader;
mutable NavigationScheduler m_navigationScheduler;
- mutable RefPtr<DOMWindow> m_domWindow;
-
HTMLFrameOwnerElement* m_ownerElement;
RefPtr<FrameView> m_view;
RefPtr<Document> m_doc;
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp
index cc53d99b0..4482fe245 100644
--- a/Source/WebCore/page/FrameView.cpp
+++ b/Source/WebCore/page/FrameView.cpp
@@ -2932,7 +2932,7 @@ FrameView* FrameView::parentFrameView() const
return 0;
}
-bool FrameView::isInChildFrameWithFrameFlattening()
+bool FrameView::isInChildFrameWithFrameFlattening() const
{
if (!parent() || !m_frame->ownerElement())
return false;
@@ -3146,7 +3146,7 @@ void FrameView::setNodeToDraw(Node* node)
m_nodeToDraw = node;
}
-void FrameView::paintContentsForSnapshot(GraphicsContext* context, const IntRect& imageRect, SelectionInSnaphot shouldPaintSelection)
+void FrameView::paintContentsForSnapshot(GraphicsContext* context, const IntRect& imageRect, SelectionInSnaphot shouldPaintSelection, CoordinateSpaceForSnapshot coordinateSpace)
{
updateLayoutAndStyleIfNeededRecursive();
@@ -3164,7 +3164,13 @@ void FrameView::paintContentsForSnapshot(GraphicsContext* context, const IntRect
}
}
- paintContents(context, imageRect);
+ if (coordinateSpace == DocumentCoordinates)
+ paintContents(context, imageRect);
+ else {
+ // A snapshot in ViewCoordinates will include a scrollbar, and the snapshot will contain
+ // whatever content the document is currently scrolled to.
+ paint(context, imageRect);
+ }
// Restore selection.
if (shouldPaintSelection == ExcludeSelection) {
diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h
index 5ef006471..87c108b48 100644
--- a/Source/WebCore/page/FrameView.h
+++ b/Source/WebCore/page/FrameView.h
@@ -247,7 +247,8 @@ public:
void setNodeToDraw(Node*);
enum SelectionInSnaphot { IncludeSelection, ExcludeSelection };
- void paintContentsForSnapshot(GraphicsContext*, const IntRect& imageRect, SelectionInSnaphot shouldPaintSelection);
+ enum CoordinateSpaceForSnapshot { DocumentCoordinates, ViewCoordinates };
+ void paintContentsForSnapshot(GraphicsContext*, const IntRect& imageRect, SelectionInSnaphot shouldPaintSelection, CoordinateSpaceForSnapshot);
virtual void paintOverhangAreas(GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect);
virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
@@ -255,6 +256,8 @@ public:
Color documentBackgroundColor() const;
+ bool isInChildFrameWithFrameFlattening() const;
+
static double currentPaintTimeStamp() { return sCurrentPaintTimeStamp; } // returns 0 if not painting
void updateLayoutAndStyleIfNeededRecursive();
@@ -429,7 +432,6 @@ private:
FrameView* parentFrameView() const;
- bool isInChildFrameWithFrameFlattening();
bool doLayoutWithFrameFlattening(bool allowSubtree);
virtual AXObjectCache* axObjectCache() const;
diff --git a/Source/WebCore/page/GestureTapHighlighter.cpp b/Source/WebCore/page/GestureTapHighlighter.cpp
index 7bd5db985..bb8f423bc 100644
--- a/Source/WebCore/page/GestureTapHighlighter.cpp
+++ b/Source/WebCore/page/GestureTapHighlighter.cpp
@@ -198,10 +198,15 @@ Path absolutePathForRenderer(RenderObject* const o)
RenderObject* currentRenderer = o;
// Check ancestor layers for overflow clip and intersect them.
- while (layer) {
- RenderObject* layerRenderer = layer->renderer();
+ for (; layer; layer = layer->parent()) {
+ RenderBoxModelObject* layerRenderer = layer->renderer();
if (layerRenderer->hasOverflowClip() && layerRenderer != currentRenderer) {
+ bool containerSkipped = false;
+ // Skip ancestor layers that are not containers for the current renderer.
+ currentRenderer->container(layerRenderer, &containerSkipped);
+ if (containerSkipped)
+ continue;
ringRect.move(currentRenderer->offsetFromAncestorContainer(layerRenderer));
currentRenderer = layerRenderer;
@@ -211,7 +216,6 @@ Path absolutePathForRenderer(RenderObject* const o)
if (ringRect.isEmpty())
break;
}
- layer = layer->parent();
}
if (ringRect.isEmpty()) {
diff --git a/Source/WebCore/page/Location.cpp b/Source/WebCore/page/Location.cpp
index df6ea8df5..36b35c4de 100644
--- a/Source/WebCore/page/Location.cpp
+++ b/Source/WebCore/page/Location.cpp
@@ -241,7 +241,7 @@ void Location::replace(const String& url, DOMWindow* activeWindow, DOMWindow* fi
if (!m_frame)
return;
// Note: We call DOMWindow::setLocation directly here because replace() always operates on the current frame.
- m_frame->domWindow()->setLocation(url, activeWindow, firstWindow, LockHistoryAndBackForwardList);
+ m_frame->document()->domWindow()->setLocation(url, activeWindow, firstWindow, LockHistoryAndBackForwardList);
}
void Location::reload(DOMWindow* activeWindow)
@@ -251,8 +251,8 @@ void Location::reload(DOMWindow* activeWindow)
// FIXME: It's not clear this cross-origin security check is valuable.
// We allow one page to change the location of another. Why block attempts to reload?
// Other location operations simply block use of JavaScript URLs cross origin.
- DOMWindow* targetWindow = m_frame->domWindow();
- if (!activeWindow->securityOrigin()->canAccess(targetWindow->securityOrigin())) {
+ DOMWindow* targetWindow = m_frame->document()->domWindow();
+ if (!activeWindow->document()->securityOrigin()->canAccess(m_frame->document()->securityOrigin())) {
targetWindow->printErrorMessage(targetWindow->crossDomainAccessErrorMessage(activeWindow));
return;
}
@@ -268,7 +268,7 @@ void Location::setLocation(const String& url, DOMWindow* activeWindow, DOMWindow
Frame* frame = m_frame->loader()->findFrameForNavigation(String(), activeWindow->document());
if (!frame)
return;
- frame->domWindow()->setLocation(url, activeWindow, firstWindow);
+ frame->document()->domWindow()->setLocation(url, activeWindow, firstWindow);
}
} // namespace WebCore
diff --git a/Source/WebCore/page/MouseEventWithHitTestResults.h b/Source/WebCore/page/MouseEventWithHitTestResults.h
index 1182e9040..e20790032 100644
--- a/Source/WebCore/page/MouseEventWithHitTestResults.h
+++ b/Source/WebCore/page/MouseEventWithHitTestResults.h
@@ -38,6 +38,7 @@ public:
Scrollbar* scrollbar() const { return m_hitTestResult.scrollbar(); }
bool isOverLink() const;
bool isOverWidget() const { return m_hitTestResult.isOverWidget(); }
+ Node* targetNode() const { return m_hitTestResult.targetNode(); }
private:
PlatformMouseEvent m_event;
diff --git a/Source/WebCore/page/PagePopupController.cpp b/Source/WebCore/page/PagePopupController.cpp
index 824f6dfaa..8ee36536b 100644
--- a/Source/WebCore/page/PagePopupController.cpp
+++ b/Source/WebCore/page/PagePopupController.cpp
@@ -32,6 +32,7 @@
#include "PagePopupController.h"
#if ENABLE(PAGE_POPUP)
+#include "LocalizedNumber.h"
#include "PagePopupClient.h"
namespace WebCore {
@@ -52,5 +53,10 @@ void PagePopupController::setValueAndClosePopup(int numValue, const String& stri
m_popupClient->setValueAndClosePopup(numValue, stringValue);
}
+String PagePopupController::localizeNumberString(const String& numberString)
+{
+ return convertToLocalizedNumber(numberString);
+}
+
}
#endif
diff --git a/Source/WebCore/page/PagePopupController.h b/Source/WebCore/page/PagePopupController.h
index 1ec728766..d0dd5c164 100644
--- a/Source/WebCore/page/PagePopupController.h
+++ b/Source/WebCore/page/PagePopupController.h
@@ -44,6 +44,7 @@ class PagePopupController : public RefCounted<PagePopupController> {
public:
static PassRefPtr<PagePopupController> create(PagePopupClient*);
void setValueAndClosePopup(int numValue, const String& stringValue);
+ String localizeNumberString(const String&);
private:
explicit PagePopupController(PagePopupClient*);
diff --git a/Source/WebCore/page/PagePopupController.idl b/Source/WebCore/page/PagePopupController.idl
index 6e0a49dab..d0669efe5 100644
--- a/Source/WebCore/page/PagePopupController.idl
+++ b/Source/WebCore/page/PagePopupController.idl
@@ -33,5 +33,6 @@ module window {
Conditional=PAGE_POPUP
] PagePopupController {
void setValueAndClosePopup(in long numberValue, in DOMString stringValue);
+ DOMString localizeNumberString(in DOMString numberString);
};
}
diff --git a/Source/WebCore/page/SecurityOrigin.cpp b/Source/WebCore/page/SecurityOrigin.cpp
index 6f7e344ae..bb79e55e8 100644
--- a/Source/WebCore/page/SecurityOrigin.cpp
+++ b/Source/WebCore/page/SecurityOrigin.cpp
@@ -391,11 +391,15 @@ bool SecurityOrigin::canDisplay(const KURL& url) const
return true;
}
-bool SecurityOrigin::canAccessLocalStorage(const SecurityOrigin* topOrigin) const
+bool SecurityOrigin::canAccessStorage(const SecurityOrigin* topOrigin) const
{
if (isUnique())
return false;
+ // FIXME: This check should be replaced with an ASSERT once we can guarantee that topOrigin is not null.
+ if (!topOrigin)
+ return true;
+
if (m_blockThirdPartyStorage && topOrigin->isThirdParty(this))
return false;
diff --git a/Source/WebCore/page/SecurityOrigin.h b/Source/WebCore/page/SecurityOrigin.h
index 93b868160..fb8e036db 100644
--- a/Source/WebCore/page/SecurityOrigin.h
+++ b/Source/WebCore/page/SecurityOrigin.h
@@ -123,8 +123,8 @@ public:
void blockThirdPartyStorage() { m_blockThirdPartyStorage = true; }
- bool canAccessDatabase() const { return !isUnique(); }
- bool canAccessLocalStorage(const SecurityOrigin* topOrigin) const;
+ bool canAccessDatabase(const SecurityOrigin* topOrigin = 0) const { return canAccessStorage(topOrigin); };
+ bool canAccessLocalStorage(const SecurityOrigin* topOrigin) const { return canAccessStorage(topOrigin); };
bool canAccessCookies() const { return !isUnique(); }
bool canAccessPasswordManager() const { return !isUnique(); }
bool canAccessFileSystem() const { return !isUnique(); }
@@ -192,6 +192,7 @@ private:
// FIXME: Rename this function to something more semantic.
bool passesFileCheck(const SecurityOrigin*) const;
bool isThirdParty(const SecurityOrigin*) const;
+ bool canAccessStorage(const SecurityOrigin*) const;
String m_protocol;
String m_host;
diff --git a/Source/WebCore/page/SpeechInputClient.h b/Source/WebCore/page/SpeechInputClient.h
index e26f979f8..6992fba43 100644
--- a/Source/WebCore/page/SpeechInputClient.h
+++ b/Source/WebCore/page/SpeechInputClient.h
@@ -51,7 +51,8 @@ public:
// The client does not take ownership of the pointer.
virtual void setListener(SpeechInputListener*) = 0;
- // Starts speech recognition and audio recording.
+ // Starts speech recognition and audio recording. elementRect is the position
+ // of the element where the user clicked in the RootView coordinate system.
virtual bool startRecognition(int requestId, const IntRect& elementRect, const AtomicString& language, const String& grammar, SecurityOrigin*) = 0;
// Stops audio recording and performs recognition with the audio recorded until now
diff --git a/Source/WebCore/page/TouchAdjustment.cpp b/Source/WebCore/page/TouchAdjustment.cpp
index 6abadcfb2..42fe2c135 100644
--- a/Source/WebCore/page/TouchAdjustment.cpp
+++ b/Source/WebCore/page/TouchAdjustment.cpp
@@ -88,6 +88,32 @@ bool nodeIsZoomTarget(Node* node)
return node->renderer()->isBox();
}
+bool providesContextMenuItems(Node* node)
+{
+ // This function tries to match the nodes that receive special context-menu items in
+ // ContextMenuController::populate(), and should be kept uptodate with those.
+ if (node->isContentEditable())
+ return true;
+ if (node->isLink())
+ return true;
+ if (node->renderer()->isImage())
+ return true;
+ if (node->renderer()->isMedia())
+ return true;
+ if (node->renderer()->canBeSelectionLeaf()) {
+ // If the context menu gesture will trigger a selection all selectable nodes are targets.
+ // FIXME: To improve the adjusted point, each individual word should be a separate subtarget,
+ // see for example FatFingers::checkForText() in WebKit/blackberry.
+ if (node->renderer()->frame()->editor()->behavior().shouldSelectOnContextualMenuClick())
+ return true;
+ // FIXME: A selected text might only be partially selected, and we should only append
+ // the selected subtargets of it in appendSubtargetsForNodeToList().
+ if (node->renderer()->selectionState() != RenderObject::SelectionNone)
+ return true;
+ }
+ return false;
+}
+
static inline void appendSubtargetsForNodeToList(Node* node, SubtargetGeometryList& subtargets)
{
// Since the node is a result of a hit test, we are already ensured it has a renderer.
@@ -386,6 +412,14 @@ bool findBestClickableCandidate(Node*& targetNode, IntPoint &targetPoint, const
return TouchAdjustment::findNodeWithLowestDistanceMetric(targetNode, targetPoint, targetArea, touchHotspot, touchArea, subtargets, TouchAdjustment::hybridDistanceFunction);
}
+bool findBestContextMenuCandidate(Node*& targetNode, IntPoint &targetPoint, const IntPoint &touchHotspot, const IntRect &touchArea, const NodeList& nodeList)
+{
+ IntRect targetArea;
+ TouchAdjustment::SubtargetGeometryList subtargets;
+ TouchAdjustment::compileSubtargetList(nodeList, subtargets, TouchAdjustment::providesContextMenuItems);
+ return TouchAdjustment::findNodeWithLowestDistanceMetric(targetNode, targetPoint, targetArea, touchHotspot, touchArea, subtargets, TouchAdjustment::hybridDistanceFunction);
+}
+
bool findBestZoomableArea(Node*& targetNode, IntRect& targetArea, const IntPoint& touchHotspot, const IntRect& touchArea, const NodeList& nodeList)
{
IntPoint targetPoint;
diff --git a/Source/WebCore/page/TouchAdjustment.h b/Source/WebCore/page/TouchAdjustment.h
index bd4cb9593..498bbd864 100644
--- a/Source/WebCore/page/TouchAdjustment.h
+++ b/Source/WebCore/page/TouchAdjustment.h
@@ -29,6 +29,7 @@
namespace WebCore {
bool findBestClickableCandidate(Node*& targetNode, IntPoint& targetPoint, const IntPoint& touchHotspot, const IntRect& touchArea, const NodeList&);
+bool findBestContextMenuCandidate(Node*& targetNode, IntPoint& targetPoint, const IntPoint& touchHotspot, const IntRect& touchArea, const NodeList&);
bool findBestZoomableArea(Node*& targetNode, IntRect& targetArea, const IntPoint& touchHotspot, const IntRect& touchArea, const NodeList&);
// FIXME: Implement the similar functions for other gestures here as well.
diff --git a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp b/Source/WebCore/page/animation/CSSPropertyAnimation.cpp
index 45b90a397..f2a81cb0c 100644
--- a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp
+++ b/Source/WebCore/page/animation/CSSPropertyAnimation.cpp
@@ -1087,7 +1087,16 @@ void CSSPropertyAnimation::ensurePropertyMap()
gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyWebkitMaskPositionY, &RenderStyle::maskLayers, &RenderStyle::accessMaskLayers));
gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyWebkitMaskSize, &RenderStyle::maskLayers, &RenderStyle::accessMaskLayers));
- gPropertyWrappers->append(new PropertyWrapper<int>(CSSPropertyFontSize, &RenderStyle::fontSize, &RenderStyle::setBlendedFontSize));
+ gPropertyWrappers->append(new PropertyWrapper<float>(CSSPropertyFontSize,
+ // Must pass a specified size to setFontSize if Text Autosizing is enabled, but a computed size
+ // if text zoom is enabled (if neither is enabled it's irrelevant as they're probably the same).
+ // FIXME: Find some way to assert that text zoom isn't activated when Text Autosizing is compiled in.
+#if ENABLE(TEXT_AUTOSIZING)
+ &RenderStyle::specifiedFontSize,
+#else
+ &RenderStyle::computedFontSize,
+#endif
+ &RenderStyle::setFontSize));
gPropertyWrappers->append(new PropertyWrapper<unsigned short>(CSSPropertyWebkitColumnRuleWidth, &RenderStyle::columnRuleWidth, &RenderStyle::setColumnRuleWidth));
gPropertyWrappers->append(new PropertyWrapper<float>(CSSPropertyWebkitColumnGap, &RenderStyle::columnGap, &RenderStyle::setColumnGap));
gPropertyWrappers->append(new PropertyWrapper<unsigned short>(CSSPropertyWebkitColumnCount, &RenderStyle::columnCount, &RenderStyle::setColumnCount));
@@ -1095,7 +1104,7 @@ void CSSPropertyAnimation::ensurePropertyMap()
gPropertyWrappers->append(new PropertyWrapper<short>(CSSPropertyWebkitBorderHorizontalSpacing, &RenderStyle::horizontalBorderSpacing, &RenderStyle::setHorizontalBorderSpacing));
gPropertyWrappers->append(new PropertyWrapper<short>(CSSPropertyWebkitBorderVerticalSpacing, &RenderStyle::verticalBorderSpacing, &RenderStyle::setVerticalBorderSpacing));
gPropertyWrappers->append(new PropertyWrapper<int>(CSSPropertyZIndex, &RenderStyle::zIndex, &RenderStyle::setZIndex));
- gPropertyWrappers->append(new PropertyWrapper<Length>(CSSPropertyLineHeight, &RenderStyle::lineHeight, &RenderStyle::setLineHeight));
+ gPropertyWrappers->append(new PropertyWrapper<Length>(CSSPropertyLineHeight, &RenderStyle::specifiedLineHeight, &RenderStyle::setLineHeight));
gPropertyWrappers->append(new PropertyWrapper<int>(CSSPropertyOutlineOffset, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset));
gPropertyWrappers->append(new PropertyWrapper<unsigned short>(CSSPropertyOutlineWidth, &RenderStyle::outlineWidth, &RenderStyle::setOutlineWidth));
gPropertyWrappers->append(new PropertyWrapper<int>(CSSPropertyLetterSpacing, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing));
diff --git a/Source/WebCore/page/animation/ImplicitAnimation.cpp b/Source/WebCore/page/animation/ImplicitAnimation.cpp
index f71a1536f..497ca3f54 100644
--- a/Source/WebCore/page/animation/ImplicitAnimation.cpp
+++ b/Source/WebCore/page/animation/ImplicitAnimation.cpp
@@ -161,7 +161,7 @@ bool ImplicitAnimation::sendTransitionEvent(const AtomicString& eventType, doubl
Document::ListenerType listenerType = Document::TRANSITIONEND_LISTENER;
if (shouldSendEventForListener(listenerType)) {
- String propertyName = getPropertyName(m_animatingProperty);
+ String propertyName = getPropertyNameString(m_animatingProperty);
// Dispatch the event
RefPtr<Element> element = 0;
diff --git a/Source/WebCore/page/chromium/EventHandlerChromium.cpp b/Source/WebCore/page/chromium/EventHandlerChromium.cpp
index 05080f629..112b0e5bd 100644
--- a/Source/WebCore/page/chromium/EventHandlerChromium.cpp
+++ b/Source/WebCore/page/chromium/EventHandlerChromium.cpp
@@ -61,7 +61,7 @@ bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& m
IntPoint p = m_frame->view()->windowToContents(mev.event().position());
if (m_frame->selection()->contains(p)) {
VisiblePosition visiblePos(
- targetNode(mev)->renderer()->positionForPoint(mev.localPoint()));
+ mev.targetNode()->renderer()->positionForPoint(mev.localPoint()));
VisibleSelection newSelection(visiblePos);
if (m_frame->selection()->shouldChangeSelection(newSelection))
m_frame->selection()->setSelection(newSelection);
@@ -103,9 +103,9 @@ bool EventHandler::passWheelEventToWidget(const PlatformWheelEvent& wheelEvent,
bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
{
// Figure out which view to send the event to.
- if (!targetNode(event) || !targetNode(event)->renderer() || !targetNode(event)->renderer()->isWidget())
+ if (!event.targetNode() || !event.targetNode()->renderer() || !event.targetNode()->renderer()->isWidget())
return false;
- return passMouseDownEventToWidget(toRenderWidget(targetNode(event)->renderer())->widget());
+ return passMouseDownEventToWidget(toRenderWidget(event.targetNode()->renderer())->widget());
}
bool EventHandler::passMouseDownEventToWidget(Widget* widget)
diff --git a/Source/WebCore/page/efl/EventHandlerEfl.cpp b/Source/WebCore/page/efl/EventHandlerEfl.cpp
index bdd37603d..a585908e1 100644
--- a/Source/WebCore/page/efl/EventHandlerEfl.cpp
+++ b/Source/WebCore/page/efl/EventHandlerEfl.cpp
@@ -63,7 +63,7 @@ void EventHandler::focusDocumentView()
bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
{
- RenderObject* target = targetNode(event) ? targetNode(event)->renderer() : 0;
+ RenderObject* target = event.targetNode() ? event.targetNode()->renderer() : 0;
if (!target || !target->isWidget())
return false;
diff --git a/Source/WebCore/page/gtk/EventHandlerGtk.cpp b/Source/WebCore/page/gtk/EventHandlerGtk.cpp
index 7e83eb610..368cfe019 100644
--- a/Source/WebCore/page/gtk/EventHandlerGtk.cpp
+++ b/Source/WebCore/page/gtk/EventHandlerGtk.cpp
@@ -59,7 +59,7 @@ void EventHandler::focusDocumentView()
bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
{
// Figure out which view to send the event to.
- RenderObject* target = targetNode(event) ? targetNode(event)->renderer() : 0;
+ RenderObject* target = event.targetNode() ? event.targetNode()->renderer() : 0;
if (!target || !target->isWidget())
return false;
return passMouseDownEventToWidget(toRenderWidget(target)->widget());
diff --git a/Source/WebCore/page/mac/EventHandlerMac.mm b/Source/WebCore/page/mac/EventHandlerMac.mm
index dfee044ab..76245dab6 100644
--- a/Source/WebCore/page/mac/EventHandlerMac.mm
+++ b/Source/WebCore/page/mac/EventHandlerMac.mm
@@ -138,7 +138,7 @@ void EventHandler::focusDocumentView()
bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
{
// Figure out which view to send the event to.
- RenderObject* target = targetNode(event) ? targetNode(event)->renderer() : 0;
+ RenderObject* target = event.targetNode() ? event.targetNode()->renderer() : 0;
if (!target || !target->isWidget())
return false;
@@ -352,7 +352,7 @@ bool EventHandler::passSubframeEventToSubframe(MouseEventWithHitTestResults& eve
return true;
case NSLeftMouseDown: {
- Node* node = targetNode(event);
+ Node* node = event.targetNode();
if (!node)
return false;
RenderObject* renderer = node->renderer();
diff --git a/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp b/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp
index 1db759404..e256bde1a 100644
--- a/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp
+++ b/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp
@@ -29,12 +29,12 @@
#include "Frame.h"
#include "FrameView.h"
+#include "Page.h"
#include "Region.h"
#include "RenderLayerCompositor.h"
#include "RenderView.h"
#include "ScrollbarThemeComposite.h"
#include "WebScrollbarThemeGeometryNative.h"
-#include <public/WebScrollableLayer.h>
#include <public/WebScrollbar.h>
#include <public/WebScrollbarLayer.h>
#include <public/WebScrollbarThemeGeometry.h>
@@ -42,7 +42,6 @@
using WebKit::WebLayer;
using WebKit::WebRect;
-using WebKit::WebScrollableLayer;
using WebKit::WebScrollbarLayer;
using WebKit::WebVector;
@@ -51,36 +50,39 @@ namespace WebCore {
class ScrollingCoordinatorPrivate {
WTF_MAKE_NONCOPYABLE(ScrollingCoordinatorPrivate);
public:
- ScrollingCoordinatorPrivate() { }
+ ScrollingCoordinatorPrivate()
+ : m_scrollLayer(0)
+ {
+ }
+
~ScrollingCoordinatorPrivate() { }
- void setScrollLayer(WebScrollableLayer layer)
+ void setScrollLayer(WebLayer* layer)
{
m_scrollLayer = layer;
- if (!m_horizontalScrollbarLayer.isNull())
- m_horizontalScrollbarLayer.setScrollLayer(layer);
- if (!m_verticalScrollbarLayer.isNull())
- m_verticalScrollbarLayer.setScrollLayer(layer);
+ if (m_horizontalScrollbarLayer)
+ m_horizontalScrollbarLayer->setScrollLayer(layer);
+ if (m_verticalScrollbarLayer)
+ m_verticalScrollbarLayer->setScrollLayer(layer);
}
- void setHorizontalScrollbarLayer(WebScrollbarLayer layer)
+ void setHorizontalScrollbarLayer(PassOwnPtr<WebScrollbarLayer> layer)
{
m_horizontalScrollbarLayer = layer;
}
- void setVerticalScrollbarLayer(WebScrollbarLayer layer)
+ void setVerticalScrollbarLayer(PassOwnPtr<WebScrollbarLayer> layer)
{
m_verticalScrollbarLayer = layer;
}
- bool hasScrollLayer() const { return !m_scrollLayer.isNull(); }
- WebScrollableLayer scrollLayer() const { return m_scrollLayer; }
+ WebLayer* scrollLayer() const { return m_scrollLayer; }
private:
- WebScrollableLayer m_scrollLayer;
- WebScrollbarLayer m_horizontalScrollbarLayer;
- WebScrollbarLayer m_verticalScrollbarLayer;
+ WebLayer* m_scrollLayer;
+ OwnPtr<WebScrollbarLayer> m_horizontalScrollbarLayer;
+ OwnPtr<WebScrollbarLayer> m_verticalScrollbarLayer;
};
PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
@@ -112,15 +114,20 @@ static GraphicsLayer* scrollLayerForFrameView(FrameView* frameView)
#endif
}
-static WebScrollbarLayer createScrollbarLayer(Scrollbar* scrollbar, WebScrollableLayer scrollLayer, GraphicsLayer* scrollbarGraphicsLayer, FrameView* frameView)
+static WebLayer* scrollableLayerForGraphicsLayer(GraphicsLayer* layer)
+{
+ return layer->platformLayer();
+}
+
+static PassOwnPtr<WebScrollbarLayer> createScrollbarLayer(Scrollbar* scrollbar, WebLayer* scrollLayer, GraphicsLayer* scrollbarGraphicsLayer, FrameView* frameView)
{
ASSERT(scrollbar);
ASSERT(scrollbarGraphicsLayer);
- if (scrollLayer.isNull()) {
+ if (!scrollLayer) {
// FIXME: sometimes we get called before setScrollLayer, workaround by finding the scroll layout ourselves.
- scrollLayer = scrollLayerForFrameView(frameView)->platformLayer()->to<WebScrollableLayer>();
- ASSERT(!scrollLayer.isNull());
+ scrollLayer = scrollableLayerForGraphicsLayer(scrollLayerForFrameView(frameView));
+ ASSERT(scrollLayer);
}
// Root layer non-overlay scrollbars should be marked opaque to disable
@@ -138,7 +145,7 @@ static WebScrollbarLayer createScrollbarLayer(Scrollbar* scrollbar, WebScrollabl
if (!platformSupported || scrollbar->isCustomScrollbar()) {
scrollbarGraphicsLayer->setContentsToMedia(0);
scrollbarGraphicsLayer->setDrawsContent(true);
- return WebScrollbarLayer();
+ return nullptr;
}
// All Chromium scrollbar themes derive from ScrollbarThemeComposite.
@@ -146,14 +153,14 @@ static WebScrollbarLayer createScrollbarLayer(Scrollbar* scrollbar, WebScrollabl
WebKit::WebScrollbarThemePainter painter(themeComposite, scrollbar);
OwnPtr<WebKit::WebScrollbarThemeGeometry> geometry(WebKit::WebScrollbarThemeGeometryNative::create(themeComposite));
- WebScrollbarLayer scrollbarLayer = WebScrollbarLayer::create(scrollbar, painter, geometry.release());
- scrollbarLayer.setScrollLayer(scrollLayer);
+ OwnPtr<WebScrollbarLayer> scrollbarLayer = adoptPtr(WebScrollbarLayer::create(scrollbar, painter, geometry.release()));
+ scrollbarLayer->setScrollLayer(scrollLayer);
- scrollbarGraphicsLayer->setContentsToMedia(&scrollbarLayer);
+ scrollbarGraphicsLayer->setContentsToMedia(scrollbarLayer->layer());
scrollbarGraphicsLayer->setDrawsContent(false);
- scrollbarLayer.setOpaque(scrollbarGraphicsLayer->contentsOpaque());
+ scrollbarLayer->layer()->setOpaque(scrollbarGraphicsLayer->contentsOpaque());
- return scrollbarLayer;
+ return scrollbarLayer.release();
}
void ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange(FrameView* frameView, GraphicsLayer* horizontalScrollbarLayer)
@@ -161,6 +168,7 @@ void ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange(FrameView*
if (!horizontalScrollbarLayer || !coordinatesScrollingForFrameView(frameView))
return;
+ setScrollLayer(scrollLayerForFrameView(m_page->mainFrame()->view()));
m_private->setHorizontalScrollbarLayer(createScrollbarLayer(frameView->horizontalScrollbar(), m_private->scrollLayer(), horizontalScrollbarLayer, frameView));
}
@@ -169,25 +177,25 @@ void ScrollingCoordinator::frameViewVerticalScrollbarLayerDidChange(FrameView* f
if (!verticalScrollbarLayer || !coordinatesScrollingForFrameView(frameView))
return;
+ setScrollLayer(scrollLayerForFrameView(m_page->mainFrame()->view()));
m_private->setVerticalScrollbarLayer(createScrollbarLayer(frameView->verticalScrollbar(), m_private->scrollLayer(), verticalScrollbarLayer, frameView));
}
void ScrollingCoordinator::setScrollLayer(GraphicsLayer* scrollLayer)
{
- WebScrollableLayer layer;
- if (scrollLayer)
- layer = scrollLayer->platformLayer()->to<WebScrollableLayer>();
- m_private->setScrollLayer(layer);
+ m_private->setScrollLayer(scrollLayer ? scrollableLayerForGraphicsLayer(scrollLayer) : 0);
}
void ScrollingCoordinator::setNonFastScrollableRegion(const Region& region)
{
- if (m_private->hasScrollLayer()) {
+ // We won't necessarily get a setScrollLayer() call before this one, so grab the root ourselves.
+ setScrollLayer(scrollLayerForFrameView(m_page->mainFrame()->view()));
+ if (m_private->scrollLayer()) {
Vector<IntRect> rects = region.rects();
WebVector<WebRect> webRects(rects.size());
for (size_t i = 0; i < rects.size(); ++i)
webRects[i] = rects[i];
- m_private->scrollLayer().setNonFastScrollableRegion(webRects);
+ m_private->scrollLayer()->setNonFastScrollableRegion(webRects);
}
}
@@ -198,14 +206,18 @@ void ScrollingCoordinator::setScrollParameters(const ScrollParameters&)
void ScrollingCoordinator::setWheelEventHandlerCount(unsigned wheelEventHandlerCount)
{
- if (m_private->hasScrollLayer())
- m_private->scrollLayer().setHaveWheelEventHandlers(wheelEventHandlerCount > 0);
+ // We won't necessarily get a setScrollLayer() call before this one, so grab the root ourselves.
+ setScrollLayer(scrollLayerForFrameView(m_page->mainFrame()->view()));
+ if (m_private->scrollLayer())
+ m_private->scrollLayer()->setHaveWheelEventHandlers(wheelEventHandlerCount > 0);
}
void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(bool should)
{
- if (m_private->hasScrollLayer())
- m_private->scrollLayer().setShouldScrollOnMainThread(should);
+ // We won't necessarily get a setScrollLayer() call before this one, so grab the root ourselves.
+ setScrollLayer(scrollLayerForFrameView(m_page->mainFrame()->view()));
+ if (m_private->scrollLayer())
+ m_private->scrollLayer()->setShouldScrollOnMainThread(should);
}
bool ScrollingCoordinator::supportsFixedPositionLayers() const
@@ -215,14 +227,14 @@ bool ScrollingCoordinator::supportsFixedPositionLayers() const
void ScrollingCoordinator::setLayerIsContainerForFixedPositionLayers(GraphicsLayer* layer, bool enable)
{
- if (WebLayer* platformLayer = layer->platformLayer())
- platformLayer->to<WebScrollableLayer>().setIsContainerForFixedPositionLayers(enable);
+ if (WebLayer* scrollableLayer = scrollableLayerForGraphicsLayer(layer))
+ scrollableLayer->setIsContainerForFixedPositionLayers(enable);
}
void ScrollingCoordinator::setLayerIsFixedToContainerLayer(GraphicsLayer* layer, bool enable)
{
- if (WebLayer* platformLayer = layer->platformLayer())
- platformLayer->to<WebScrollableLayer>().setFixedToContainerLayer(enable);
+ if (WebLayer* scrollableLayer = scrollableLayerForGraphicsLayer(layer))
+ scrollableLayer->setFixedToContainerLayer(enable);
}
}
diff --git a/Source/WebCore/page/wx/EventHandlerWx.cpp b/Source/WebCore/page/wx/EventHandlerWx.cpp
index 06b603698..167cc930a 100644
--- a/Source/WebCore/page/wx/EventHandlerWx.cpp
+++ b/Source/WebCore/page/wx/EventHandlerWx.cpp
@@ -63,10 +63,10 @@ bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults&
bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
{
// Figure out which view to send the event to.
- if (!targetNode(event) || !targetNode(event)->renderer() || !targetNode(event)->renderer()->isWidget())
+ if (!event.targetNode() || !event.targetNode()->renderer() || !event.targetNode()->renderer()->isWidget())
return false;
- return passMouseDownEventToWidget(toRenderWidget(targetNode(event)->renderer())->widget());
+ return passMouseDownEventToWidget(toRenderWidget(event.targetNode()->renderer())->widget());
}
bool EventHandler::passWidgetMouseDownEventToWidget(RenderWidget* renderWidget)
diff --git a/Source/WebCore/platform/FractionalLayoutUnit.h b/Source/WebCore/platform/FractionalLayoutUnit.h
index d81aef24b..f6daceac7 100644
--- a/Source/WebCore/platform/FractionalLayoutUnit.h
+++ b/Source/WebCore/platform/FractionalLayoutUnit.h
@@ -114,10 +114,20 @@ public:
int toInt() const { return m_value / kFixedPointDenominator; }
float toFloat() const { return static_cast<float>(m_value) / kFixedPointDenominator; }
double toDouble() const { return static_cast<double>(m_value) / kFixedPointDenominator; }
+ float ceilToFloat() const
+ {
+ float floatValue = toFloat();
+ if (static_cast<int>(floatValue * kFixedPointDenominator) == m_value)
+ return floatValue;
+ if (floatValue > 0)
+ return nextafterf(floatValue, std::numeric_limits<float>::max());
+ return nextafterf(floatValue, std::numeric_limits<float>::min());
+ }
#else
int toInt() const { return m_value; }
float toFloat() const { return static_cast<float>(m_value); }
double toDouble() const { return static_cast<double>(m_value); }
+ float ceilToFloat() const { return toFloat(); }
#endif
unsigned toUnsigned() const { REPORT_OVERFLOW(m_value >= 0); return toInt(); }
@@ -183,7 +193,11 @@ public:
#endif
}
+#if ENABLE(SUBPIXEL_LAYOUT)
static float epsilon() { return 1.0f / kFixedPointDenominator; }
+#else
+ static int epsilon() { return 0; }
+#endif
static const FractionalLayoutUnit max()
{
FractionalLayoutUnit m;
diff --git a/Source/WebCore/platform/PlatformInstrumentation.cpp b/Source/WebCore/platform/PlatformInstrumentation.cpp
new file mode 100644
index 000000000..6704eda3d
--- /dev/null
+++ b/Source/WebCore/platform/PlatformInstrumentation.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "PlatformInstrumentation.h"
+
+namespace WebCore {
+
+PlatformInstrumentationClient* PlatformInstrumentation::m_client;
+
+PlatformInstrumentationClient::~PlatformInstrumentationClient()
+{
+}
+
+void PlatformInstrumentation::setClient(PlatformInstrumentationClient* client)
+{
+ m_client = client;
+}
+
+}
diff --git a/Source/WebCore/platform/PlatformInstrumentation.h b/Source/WebCore/platform/PlatformInstrumentation.h
new file mode 100644
index 000000000..1f95577e6
--- /dev/null
+++ b/Source/WebCore/platform/PlatformInstrumentation.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PlatformInstrumentation_h
+#define PlatformInstrumentation_h
+
+#include <wtf/text/WTFString.h>
+
+#if PLATFORM(CHROMIUM)
+#include "TraceEvent.h"
+#endif
+
+namespace WebCore {
+
+class PlatformInstrumentationClient {
+public:
+ virtual ~PlatformInstrumentationClient();
+
+ virtual void willDecodeImage(const String& imageType) = 0;
+ virtual void didDecodeImage() = 0;
+ virtual void willResizeImage(bool shouldCache) = 0;
+ virtual void didResizeImage() = 0;
+};
+
+class PlatformInstrumentation {
+public:
+ static void setClient(PlatformInstrumentationClient*);
+ static bool hasClient() { return m_client; }
+
+ static void willDecodeImage(const String& imageType);
+ static void didDecodeImage();
+ static void willResizeImage(bool shouldCache);
+ static void didResizeImage();
+
+private:
+ static PlatformInstrumentationClient* m_client;
+};
+
+#define FAST_RETURN_IF_NO_CLIENT() if (!m_client) return;
+
+inline void PlatformInstrumentation::willDecodeImage(const String& imageType)
+{
+#if PLATFORM(CHROMIUM)
+ TRACE_EVENT_BEGIN1("webkit", "Image Decode", "imageType", TRACE_STR_COPY(imageType.ascii().data()));
+#endif
+ FAST_RETURN_IF_NO_CLIENT();
+ m_client->willDecodeImage(imageType);
+}
+
+inline void PlatformInstrumentation::didDecodeImage()
+{
+#if PLATFORM(CHROMIUM)
+ TRACE_EVENT_END0("webkit", "Image Decode");
+#endif
+ FAST_RETURN_IF_NO_CLIENT();
+ m_client->didDecodeImage();
+}
+
+inline void PlatformInstrumentation::willResizeImage(bool shouldCache)
+{
+#if PLATFORM(CHROMIUM)
+ TRACE_EVENT_BEGIN1("webkit", "Image Resize", "cached", shouldCache);
+#endif
+ FAST_RETURN_IF_NO_CLIENT();
+ m_client->willResizeImage(shouldCache);
+}
+
+inline void PlatformInstrumentation::didResizeImage()
+{
+#if PLATFORM(CHROMIUM)
+ TRACE_EVENT_END0("webkit", "Image Resize");
+#endif
+ FAST_RETURN_IF_NO_CLIENT();
+ m_client->didResizeImage();
+}
+
+} // namespace WebCore
+
+#endif // PlatformInstrumentation_h
diff --git a/Source/WebCore/platform/PlatformKeyboardEvent.h b/Source/WebCore/platform/PlatformKeyboardEvent.h
index 06e4f7ec5..47ceaf31a 100644
--- a/Source/WebCore/platform/PlatformKeyboardEvent.h
+++ b/Source/WebCore/platform/PlatformKeyboardEvent.h
@@ -28,6 +28,9 @@
#define PlatformKeyboardEvent_h
#include "PlatformEvent.h"
+#if OS(WINDOWS)
+#include "WindowsExtras.h"
+#endif
#include <wtf/text/WTFString.h>
#if PLATFORM(MAC)
@@ -35,12 +38,6 @@
OBJC_CLASS NSEvent;
#endif
-#if PLATFORM(WIN)
-typedef struct HWND__ *HWND;
-typedef unsigned WPARAM;
-typedef long LPARAM;
-#endif
-
#if PLATFORM(GTK)
typedef struct _GdkEventKey GdkEventKey;
#include "CompositionResults.h"
diff --git a/Source/WebCore/platform/PlatformMouseEvent.h b/Source/WebCore/platform/PlatformMouseEvent.h
index 12c4eb535..3f8a81643 100644
--- a/Source/WebCore/platform/PlatformMouseEvent.h
+++ b/Source/WebCore/platform/PlatformMouseEvent.h
@@ -28,6 +28,9 @@
#include "IntPoint.h"
#include "PlatformEvent.h"
+#if OS(WINDOWS)
+#include "WindowsExtras.h"
+#endif
#if PLATFORM(GTK)
typedef struct _GdkEventButton GdkEventButton;
@@ -40,13 +43,6 @@ typedef struct _Evas_Event_Mouse_Up Evas_Event_Mouse_Up;
typedef struct _Evas_Event_Mouse_Move Evas_Event_Mouse_Move;
#endif
-#if PLATFORM(WIN)
-typedef struct HWND__* HWND;
-typedef unsigned UINT;
-typedef unsigned WPARAM;
-typedef long LPARAM;
-#endif
-
#if PLATFORM(WX)
class wxMouseEvent;
#endif
diff --git a/Source/WebCore/platform/PlatformWheelEvent.h b/Source/WebCore/platform/PlatformWheelEvent.h
index 8e08884f5..3083edade 100644
--- a/Source/WebCore/platform/PlatformWheelEvent.h
+++ b/Source/WebCore/platform/PlatformWheelEvent.h
@@ -28,6 +28,9 @@
#include "IntPoint.h"
#include "PlatformEvent.h"
+#if OS(WINDOWS)
+#include "WindowsExtras.h"
+#endif
#if PLATFORM(GTK)
typedef struct _GdkEventScroll GdkEventScroll;
@@ -37,12 +40,6 @@ typedef struct _GdkEventScroll GdkEventScroll;
typedef struct _Evas_Event_Mouse_Wheel Evas_Event_Mouse_Wheel;
#endif
-#if PLATFORM(WIN)
-typedef struct HWND__* HWND;
-typedef unsigned WPARAM;
-typedef long LPARAM;
-#endif
-
#if PLATFORM(WX)
class wxMouseEvent;
class wxPoint;
diff --git a/Source/WebCore/platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.cpp b/Source/WebCore/platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.cpp
index 770843585..ced560207 100644
--- a/Source/WebCore/platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.cpp
+++ b/Source/WebCore/platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.cpp
@@ -44,6 +44,7 @@
#endif
#include <BlackBerryPlatformExecutableMessage.h>
+#include <BlackBerryPlatformNavigatorHandler.h>
using BlackBerry::Platform::MessageClient;
using BlackBerry::Platform::TypedReplyBuffer;
@@ -83,6 +84,18 @@ CookieDatabaseBackingStore::~CookieDatabaseBackingStore()
#endif
}
+void CookieDatabaseBackingStore::onThreadFinished()
+{
+ CookieLog("CookieManager - flushing cookies to backingStore...");
+ // This is called from shutdown, so we need to be sure the OS doesn't kill us before the db write finishes.
+ // Once should be enough since this extends terimination by 2 seconds.
+ BlackBerry::Platform::NavigatorHandler::sendExtendTerminate();
+ sendChangesToDatabaseSynchronously();
+ CookieLog("CookieManager - finished flushing cookies to backingStore.");
+
+ MessageClient::onThreadFinished();
+}
+
void CookieDatabaseBackingStore::upgradeTableIfNeeded(const String& databaseFields, const String& primaryKeyFields)
{
ASSERT(isCurrentThread());
@@ -409,7 +422,10 @@ void CookieDatabaseBackingStore::sendChangesToDatabaseSynchronously()
if (m_dbTimer.started())
m_dbTimer.stop();
}
- dispatchSyncMessage(createMethodCallMessage(&CookieDatabaseBackingStore::invokeSendChangesToDatabase, this));
+ if (isCurrentThread())
+ invokeSendChangesToDatabase();
+ else
+ dispatchSyncMessage(createMethodCallMessage(&CookieDatabaseBackingStore::invokeSendChangesToDatabase, this));
}
void CookieDatabaseBackingStore::sendChangesToDatabase(int nextInterval)
diff --git a/Source/WebCore/platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.h b/Source/WebCore/platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.h
index b9b7decdd..986d28f8c 100644
--- a/Source/WebCore/platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.h
+++ b/Source/WebCore/platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.h
@@ -61,6 +61,9 @@ public:
void sendChangesToDatabaseSynchronously();
+ // MessageClient methods
+ virtual void onThreadFinished();
+
// ThreadTimerClient methods
virtual bool willFireTimer() { return true; }
virtual int getPulseCode() const { return pulseCode(); }
diff --git a/Source/WebCore/platform/blackberry/CookieManager.cpp b/Source/WebCore/platform/blackberry/CookieManager.cpp
index 286223f32..50a510dc3 100644
--- a/Source/WebCore/platform/blackberry/CookieManager.cpp
+++ b/Source/WebCore/platform/blackberry/CookieManager.cpp
@@ -70,11 +70,6 @@ static const unsigned s_maxCookieCountPerHost = 60;
static const unsigned s_cookiesToDeleteWhenLimitReached = 60;
static const unsigned s_delayToStartCookieCleanup = 10;
-static void flushCookiesOnExit(void)
-{
- cookieManager().flushCookiesToBackingStore();
-}
-
CookieManager& cookieManager()
{
static CookieManager *cookieManager = 0;
@@ -84,8 +79,6 @@ CookieManager& cookieManager()
cookieManager->m_cookieBackingStore->open(cookieManager->cookieJar());
cookieManager->getBackingStoreCookies();
CookieLog("CookieManager - Backingstore load complete.\n");
-
- atexit(&flushCookiesOnExit);
}
return *cookieManager;
}
@@ -574,14 +567,4 @@ void CookieManager::cookieLimitCleanUp(Timer<CookieManager>* timer)
CookieLimitLog("CookieManager - Cookie clean up complete.");
}
-void CookieManager::flushCookiesToBackingStore()
-{
- CookieLog("CookieManager - flushCookiesToBackingStore starting.\n");
- // This is called from shutdown, so we need to be sure the OS doesn't kill us before the db write finishes.
- // Once should be enough since this extends terimination by 2 seconds.
- BlackBerry::Platform::NavigatorHandler::sendExtendTerminate();
- m_cookieBackingStore->sendChangesToDatabaseSynchronously();
- CookieLog("CookieManager - flushCookiesToBackingStore finished.\n");
-}
-
} // namespace WebCore
diff --git a/Source/WebCore/platform/blackberry/CookieManager.h b/Source/WebCore/platform/blackberry/CookieManager.h
index b03409d10..eab4478b2 100644
--- a/Source/WebCore/platform/blackberry/CookieManager.h
+++ b/Source/WebCore/platform/blackberry/CookieManager.h
@@ -104,8 +104,6 @@ public:
// Returns all cookies that are associated with the specified URL as raw cookies.
void getRawCookies(Vector<ParsedCookie*>& stackOfCookies, const KURL& requestURL, CookieFilter = WithHttpOnlyCookies) const;
- void flushCookiesToBackingStore();
-
private:
friend CookieManager& cookieManager();
diff --git a/Source/WebCore/platform/blackberry/ReadOnlyLatin1String.h b/Source/WebCore/platform/blackberry/ReadOnlyLatin1String.h
new file mode 100644
index 000000000..613dbda86
--- /dev/null
+++ b/Source/WebCore/platform/blackberry/ReadOnlyLatin1String.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef ReadOnlyLatin1String_h
+#define ReadOnlyLatin1String_h
+
+#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class ReadOnlyLatin1String {
+public:
+ explicit ReadOnlyLatin1String(const String& string)
+ {
+ if (string.is8Bit())
+ m_string = string;
+ else {
+ ASSERT(string.containsOnlyLatin1());
+ m_cstring = string.latin1();
+ }
+ }
+
+ const char* data() const { return m_string.isNull() ? m_cstring.data() : reinterpret_cast<const char*>(m_string.characters8()); }
+
+ size_t length() const { return m_string.isNull() ? m_cstring.length() : m_string.length(); }
+
+private:
+ String m_string;
+ CString m_cstring;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp b/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp
index 26928accb..3bbb2318b 100644
--- a/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp
+++ b/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp
@@ -763,8 +763,12 @@ bool RenderThemeBlackBerry::paintSliderThumb(RenderObject* object, const PaintIn
void RenderThemeBlackBerry::adjustMediaControlStyle(StyleResolver*, RenderStyle* style, Element* element) const
{
float fullScreenMultiplier = determineFullScreenMultiplier(element);
+ HTMLMediaElement* mediaElement = toParentMediaElement(element);
+ if (!mediaElement)
+ return;
// We use multiples of mediaControlsHeight to make all objects scale evenly
+ Length zero(0, Fixed);
Length controlsHeight(mediaControlsHeight * fullScreenMultiplier, Fixed);
Length timeWidth(mediaControlsHeight * 3 / 2 * fullScreenMultiplier, Fixed);
Length volumeHeight(mediaControlsHeight * 4 * fullScreenMultiplier, Fixed);
@@ -784,7 +788,7 @@ void RenderThemeBlackBerry::adjustMediaControlStyle(StyleResolver*, RenderStyle*
style->setWidth(timeWidth);
style->setHeight(controlsHeight);
style->setPaddingRight(padding);
- style->setBlendedFontSize(fontSize);
+ style->setFontSize(static_cast<int>(fontSize));
break;
case MediaVolumeSliderContainerPart:
style->setWidth(controlsHeight);
@@ -794,6 +798,28 @@ void RenderThemeBlackBerry::adjustMediaControlStyle(StyleResolver*, RenderStyle*
default:
break;
}
+
+ if (!isfinite(mediaElement->duration())) {
+ // Live streams have infinite duration with no timeline. Force the mute
+ // and fullscreen buttons to the right. This is needed when webkit does
+ // not render the timeline container because it has a webkit-box-flex
+ // of 1 and normally allows those buttons to be on the right.
+ switch (style->appearance()) {
+ case MediaEnterFullscreenButtonPart:
+ case MediaExitFullscreenButtonPart:
+ style->setPosition(AbsolutePosition);
+ style->setBottom(zero);
+ style->setRight(controlsHeight);
+ break;
+ case MediaMuteButtonPart:
+ style->setPosition(AbsolutePosition);
+ style->setBottom(zero);
+ style->setRight(zero);
+ break;
+ default:
+ break;
+ }
+ }
}
void RenderThemeBlackBerry::adjustSliderTrackStyle(StyleResolver*, RenderStyle* style, Element* element) const
diff --git a/Source/WebCore/platform/blackberry/TemporaryLinkStubs.cpp b/Source/WebCore/platform/blackberry/TemporaryLinkStubs.cpp
index 0e08e2668..70f0a2b54 100644
--- a/Source/WebCore/platform/blackberry/TemporaryLinkStubs.cpp
+++ b/Source/WebCore/platform/blackberry/TemporaryLinkStubs.cpp
@@ -24,11 +24,6 @@
namespace WebCore {
-void prefetchDNS(String const&)
-{
- notImplemented();
-}
-
void setCookieStoragePrivateBrowsingEnabled(bool)
{
notImplemented();
diff --git a/Source/WebCore/platform/chromium/PopupContainer.cpp b/Source/WebCore/platform/chromium/PopupContainer.cpp
index b806b3c55..3deb95a92 100644
--- a/Source/WebCore/platform/chromium/PopupContainer.cpp
+++ b/Source/WebCore/platform/chromium/PopupContainer.cpp
@@ -117,6 +117,58 @@ PopupContainer::~PopupContainer()
removeChild(m_listBox.get());
}
+IntRect PopupContainer::layoutAndCalculateWidgetRectInternal(IntRect widgetRectInScreen, int targetControlHeight, const FloatRect& windowRect, const FloatRect& screen, bool isRTL, const int rtlOffset, PopupContent* listBox, bool& needToResizeView)
+{
+ ASSERT(listBox);
+ if (windowRect.x() >= screen.x() && windowRect.maxX() <= screen.maxX() && (widgetRectInScreen.x() < screen.x() || widgetRectInScreen.maxX() > screen.maxX())) {
+ // First, inverse the popup alignment if it does not fit the screen -
+ // this might fix things (or make them better).
+ IntRect inverseWidgetRectInScreen = widgetRectInScreen;
+ inverseWidgetRectInScreen.setX(inverseWidgetRectInScreen.x() + (isRTL ? -rtlOffset : rtlOffset));
+ IntRect enclosingScreen = enclosingIntRect(screen);
+ unsigned originalCutoff = std::max(enclosingScreen.x() - widgetRectInScreen.x(), 0) + std::max(widgetRectInScreen.maxX() - enclosingScreen.maxX(), 0);
+ unsigned inverseCutoff = std::max(enclosingScreen.x() - inverseWidgetRectInScreen.x(), 0) + std::max(inverseWidgetRectInScreen.maxX() - enclosingScreen.maxX(), 0);
+
+ // Accept the inverse popup alignment if the trimmed content gets
+ // shorter than that in the original alignment case.
+ if (inverseCutoff < originalCutoff)
+ widgetRectInScreen = inverseWidgetRectInScreen;
+
+ if (widgetRectInScreen.x() < screen.x()) {
+ widgetRectInScreen.setWidth(widgetRectInScreen.maxX() - screen.x());
+ widgetRectInScreen.setX(screen.x());
+ listBox->setMaxWidthAndLayout(std::max(widgetRectInScreen.width() - kBorderSize * 2, 0));
+ } else if (widgetRectInScreen.maxX() > screen.maxX()) {
+ widgetRectInScreen.setWidth(screen.maxX() - widgetRectInScreen.x());
+ listBox->setMaxWidthAndLayout(std::max(widgetRectInScreen.width() - kBorderSize * 2, 0));
+ }
+ }
+
+ // Calculate Y axis size.
+ if (widgetRectInScreen.maxY() > static_cast<int>(screen.maxY())) {
+ if (widgetRectInScreen.y() - widgetRectInScreen.height() - targetControlHeight > 0) {
+ // There is enough room to open upwards.
+ widgetRectInScreen.move(0, -(widgetRectInScreen.height() + targetControlHeight));
+ } else {
+ // Figure whether upwards or downwards has more room and set the
+ // maximum number of items.
+ int spaceAbove = widgetRectInScreen.y() - targetControlHeight;
+ int spaceBelow = screen.maxY() - widgetRectInScreen.y();
+ if (spaceAbove > spaceBelow)
+ listBox->setMaxHeight(spaceAbove);
+ else
+ listBox->setMaxHeight(spaceBelow);
+ listBox->layout();
+ needToResizeView = true;
+ widgetRectInScreen.setHeight(listBox->popupContentHeight() + kBorderSize * 2);
+ // Move WebWidget upwards if necessary.
+ if (spaceAbove > spaceBelow)
+ widgetRectInScreen.move(0, -(widgetRectInScreen.height() + targetControlHeight));
+ }
+ }
+ return widgetRectInScreen;
+}
+
IntRect PopupContainer::layoutAndCalculateWidgetRect(int targetControlHeight, const IntPoint& popupInitialCoordinate)
{
// Reset the max width and height to their default values, they will be recomputed below
@@ -148,51 +200,11 @@ IntRect PopupContainer::layoutAndCalculateWidgetRect(int targetControlHeight, co
// to clip the window width to the screen width.
// When clipping, we also need to set a maximum width for the list box.
FloatRect windowRect = chromeClient->windowRect();
- if (windowRect.x() >= screen.x() && windowRect.maxX() <= screen.maxX() && (widgetRectInScreen.x() < screen.x() || widgetRectInScreen.maxX() > screen.maxX())) {
- // First, inverse the popup alignment if it does not fit the screen - this might fix things (or make them better).
- IntRect inverseWidgetRectInScreen = chromeClient->rootViewToScreen(IntRect(popupInitialCoordinate.x() + (isRTL ? 0 : rtlOffset), popupInitialCoordinate.y(), targetSize.width(), targetSize.height()));
- IntRect enclosingScreen = enclosingIntRect(screen);
- unsigned originalCutoff = max(enclosingScreen.x() - widgetRectInScreen.x(), 0) + max(widgetRectInScreen.maxX() - enclosingScreen.maxX(), 0);
- unsigned inverseCutoff = max(enclosingScreen.x() - inverseWidgetRectInScreen.x(), 0) + max(inverseWidgetRectInScreen.maxX() - enclosingScreen.maxX(), 0);
-
- // Accept the inverse popup alignment if the trimmed content gets shorter than that in the original alignment case.
- if (inverseCutoff < originalCutoff)
- widgetRectInScreen = inverseWidgetRectInScreen;
-
- if (widgetRectInScreen.x() < screen.x()) {
- unsigned widgetRight = widgetRectInScreen.maxX();
- widgetRectInScreen.setWidth(widgetRectInScreen.maxX() - screen.x());
- widgetRectInScreen.setX(widgetRight - widgetRectInScreen.width());
- listBox()->setMaxWidthAndLayout(max(widgetRectInScreen.width() - kBorderSize * 2, 0));
- } else if (widgetRectInScreen.maxX() > screen.maxX()) {
- widgetRectInScreen.setWidth(screen.maxX() - widgetRectInScreen.x());
- listBox()->setMaxWidthAndLayout(max(widgetRectInScreen.width() - kBorderSize * 2, 0));
- }
- }
- // Calculate Y axis size.
- if (widgetRectInScreen.maxY() > static_cast<int>(screen.maxY())) {
- if (widgetRectInScreen.y() - widgetRectInScreen.height() - targetControlHeight > 0) {
- // There is enough room to open upwards.
- widgetRectInScreen.move(0, -(widgetRectInScreen.height() + targetControlHeight));
- } else {
- // Figure whether upwards or downwards has more room and set the
- // maximum number of items.
- int spaceAbove = widgetRectInScreen.y() - targetControlHeight;
- int spaceBelow = screen.maxY() - widgetRectInScreen.y();
- if (spaceAbove > spaceBelow)
- m_listBox->setMaxHeight(spaceAbove);
- else
- m_listBox->setMaxHeight(spaceBelow);
- layoutAndGetRTLOffset();
- // Container height may have changed in layoutAndGetRTLOffset(),
- // so set the WebWidget height to the container height.
- widgetRectInScreen.setHeight(height());
- // Move WebWidget upwards if necessary.
- if (spaceAbove > spaceBelow)
- widgetRectInScreen.move(0, -(widgetRectInScreen.height() + targetControlHeight));
- }
- }
+ bool needToResizeView = false;
+ widgetRectInScreen = layoutAndCalculateWidgetRectInternal(widgetRectInScreen, targetControlHeight, windowRect, screen, isRTL, rtlOffset, m_listBox.get(), needToResizeView);
+ if (needToResizeView)
+ fitToListBox();
}
return widgetRectInScreen;
@@ -235,23 +247,26 @@ void PopupContainer::notifyPopupHidden()
chromeClientChromium()->popupClosed(this);
}
-int PopupContainer::layoutAndGetRTLOffset()
+void PopupContainer::fitToListBox()
{
- m_listBox->layout();
-
// Place the listbox within our border.
m_listBox->move(kBorderSize, kBorderSize);
// Size ourselves to contain listbox + border.
- int listBoxWidth = m_listBox->width() + kBorderSize * 2;
- resize(listBoxWidth, m_listBox->height() + kBorderSize * 2);
+ resize(m_listBox->width() + kBorderSize * 2, m_listBox->height() + kBorderSize * 2);
invalidate();
+}
+
+int PopupContainer::layoutAndGetRTLOffset()
+{
+ m_listBox->layout();
+ fitToListBox();
// Compute the starting x-axis for a normal RTL or right-aligned LTR dropdown. For those,
// the right edge of dropdown box should be aligned with the right edge of <select>/<input> element box,
// and the dropdown box should be expanded to the left if more space is needed.
// m_originalFrameRect.width() is the width of the target <select>/<input> element.
- return m_originalFrameRect.width() - listBoxWidth;
+ return m_originalFrameRect.width() - (m_listBox->width() + kBorderSize * 2);
}
bool PopupContainer::handleMouseDownEvent(const PlatformMouseEvent& event)
diff --git a/Source/WebCore/platform/chromium/PopupContainer.h b/Source/WebCore/platform/chromium/PopupContainer.h
index 0c7d1843d..78d6eb880 100644
--- a/Source/WebCore/platform/chromium/PopupContainer.h
+++ b/Source/WebCore/platform/chromium/PopupContainer.h
@@ -118,6 +118,10 @@ public:
// While hovering popup menu window, we want to show tool tip message.
String getSelectedItemToolTip();
+ // This is public for testing.
+ static IntRect layoutAndCalculateWidgetRectInternal(IntRect widgetRectInScreen, int targetControlHeight, const FloatRect& windowRect, const FloatRect& screen, bool isRTL, const int rtlOffset, PopupContent*, bool& needToResizeView);
+
+
private:
friend class WTF::RefCounted<PopupContainer>;
@@ -130,6 +134,8 @@ private:
// Layout and calculate popup widget size and location and returns it as IntRect.
IntRect layoutAndCalculateWidgetRect(int targetControlHeight, const IntPoint& popupInitialCoordinate);
+ void fitToListBox();
+
// Returns the ChromeClient of the page this popup is associated with.
ChromeClientChromium* chromeClientChromium();
diff --git a/Source/WebCore/platform/chromium/PopupListBox.cpp b/Source/WebCore/platform/chromium/PopupListBox.cpp
index 895c2aeef..c75a2ff3d 100644
--- a/Source/WebCore/platform/chromium/PopupListBox.cpp
+++ b/Source/WebCore/platform/chromium/PopupListBox.cpp
@@ -908,4 +908,9 @@ bool PopupListBox::isPointInBounds(const IntPoint& point)
return numItems() && IntRect(0, 0, width(), height()).contains(point);
}
+int PopupListBox::popupContentHeight() const
+{
+ return height();
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/platform/chromium/PopupListBox.h b/Source/WebCore/platform/chromium/PopupListBox.h
index dc8e3bf8d..522376ec3 100644
--- a/Source/WebCore/platform/chromium/PopupListBox.h
+++ b/Source/WebCore/platform/chromium/PopupListBox.h
@@ -85,6 +85,15 @@ struct PopupContainerSettings {
bool deviceSupportsTouch;
};
+class PopupContent {
+public:
+ virtual void layout() = 0;
+ virtual void setMaxHeight(int) = 0;
+ virtual void setMaxWidthAndLayout(int) = 0;
+ virtual int popupContentHeight() const = 0;
+ virtual ~PopupContent() { };
+};
+
// A container for the data for each menu item (e.g. represented by <option>
// or <optgroup> in a <select> widget) and is used by PopupListBox.
struct PopupItem {
@@ -110,7 +119,7 @@ struct PopupItem {
// This class uses WebCore code to paint and handle events for a drop-down list
// box ("combobox" on Windows).
-class PopupListBox : public FramelessScrollView {
+class PopupListBox : public FramelessScrollView, public PopupContent {
public:
static PassRefPtr<PopupListBox> create(PopupMenuClient* client, const PopupContainerSettings& settings)
{
@@ -164,7 +173,7 @@ public:
void setBaseWidth(int width) { m_baseWidth = std::min(m_maxWindowWidth, width); }
// Computes the size of widget and children.
- void layout();
+ virtual void layout() OVERRIDE;
// Returns whether the popup wants to process events for the passed key.
bool isInterestedInEventForKey(int keyCode);
@@ -172,23 +181,25 @@ public:
// Gets the height of a row.
int getRowHeight(int index);
- void setMaxHeight(int maxHeight) { m_maxHeight = maxHeight; }
+ virtual void setMaxHeight(int maxHeight) OVERRIDE { m_maxHeight = maxHeight; }
void setMaxWidth(int maxWidth) { m_maxWindowWidth = maxWidth; }
- void setMaxWidthAndLayout(int);
+ virtual void setMaxWidthAndLayout(int) OVERRIDE;
void disconnectClient() { m_popupClient = 0; }
const Vector<PopupItem*>& items() const { return m_items; }
+ virtual int popupContentHeight() const OVERRIDE;
+
private:
friend class PopupContainer;
friend class RefCounted<PopupListBox>;
PopupListBox(PopupMenuClient*, const PopupContainerSettings&);
- ~PopupListBox()
+ virtual ~PopupListBox()
{
clear();
}
diff --git a/Source/WebCore/platform/chromium/ThemeChromiumMac.h b/Source/WebCore/platform/chromium/ThemeChromiumMac.h
deleted file mode 100644
index 5580d1d5f..000000000
--- a/Source/WebCore/platform/chromium/ThemeChromiumMac.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
- * Copyright (C) 2009 Google Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ThemeChromiumMac_h
-#define ThemeChromiumMac_h
-
-#include "Theme.h"
-
-// This file (and its associated .mm file) is a clone of ThemeMac.h. See
-// the .mm file for details.
-
-namespace WebCore {
-
-class ThemeChromiumMac : public Theme {
-public:
- ThemeChromiumMac() { }
- virtual ~ThemeChromiumMac() { }
-
- virtual int baselinePositionAdjustment(ControlPart) const;
-
- virtual FontDescription controlFont(ControlPart, const Font&, float zoomFactor) const;
-
- virtual LengthSize controlSize(ControlPart, const Font&, const LengthSize&, float zoomFactor) const;
- virtual LengthSize minimumControlSize(ControlPart, const Font&, float zoomFactor) const;
-
- virtual LengthBox controlPadding(ControlPart, const Font&, const LengthBox& zoomedBox, float zoomFactor) const;
- virtual LengthBox controlBorder(ControlPart, const Font&, const LengthBox& zoomedBox, float zoomFactor) const;
-
- virtual bool controlRequiresPreWhiteSpace(ControlPart part) const { return part == PushButtonPart; }
-
- virtual void paint(ControlPart, ControlStates, GraphicsContext*, const IntRect&, float zoomFactor, ScrollView*) const;
- virtual void inflateControlPaintRect(ControlPart, ControlStates, IntRect&, float zoomFactor) const;
-};
-
-} // namespace WebCore
-
-#endif // ThemeChromiumMac_h
diff --git a/Source/WebCore/platform/chromium/ThemeChromiumMac.mm b/Source/WebCore/platform/chromium/ThemeChromiumMac.mm
deleted file mode 100644
index e718d054a..000000000
--- a/Source/WebCore/platform/chromium/ThemeChromiumMac.mm
+++ /dev/null
@@ -1,819 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
- * Copyright (C) 2009 Google Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "ThemeChromiumMac.h"
-
-#import "BlockExceptions.h"
-#import "GraphicsContext.h"
-#import "LocalCurrentGraphicsContext.h"
-#import "ScrollView.h"
-#import "WebCoreSystemInterface.h"
-#import <Carbon/Carbon.h>
-#import <objc/runtime.h>
-#include "PlatformContextSkia.h"
-#include "skia/ext/skia_utils_mac.h"
-#include <wtf/StdLibExtras.h>
-
-using namespace std;
-
-// This file (and its associated .h file) is a clone of ThemeMac.mm.
-// Because the original file is designed to run in-process inside a Cocoa view,
-// we must maintain a fork. Please maintain this file by performing parallel
-// changes to it.
-//
-// The only changes from ThemeMac should be:
-// - The classname change from ThemeMac to ThemeChromiumMac.
-// - The import of FlippedView() and its use as the parent view for cell
-// rendering.
-// - In updateStates() the code to update the cells' inactive state.
-// - In paintButton() the code to save/restore the window's default button cell.
-// - The Snow Leopard focus ring bug fix and its use around every call to
-// -[NSButtonCell drawWithFrame:inView:].
-//
-// For all other differences, if it was introduced in this file, then the
-// maintainer forgot to include it in the list; otherwise it is an update that
-// should have been applied to this file but was not.
-
-// FIXME: Default buttons really should be more like push buttons and not like buttons.
-
-// --- START fix for Snow Leopard focus ring bug ---
-
-// There is a bug in the Cocoa focus ring drawing code. The code calls +[NSView
-// focusView] (to get the currently focused view) and then calls an NSRect-
-// returning method on that view to obtain a clipping rect. However, if there is
-// no focused view (as there won't be if the destination is a context), the rect
-// returned from the method invocation on nil is garbage.
-//
-// The garbage fortunately does not clip the focus ring on Leopard, but
-// unfortunately does so on Snow Leopard. Therefore, if a runtime test shows
-// that focus ring drawing fails, we swizzle NSView to ensure it returns a valid
-// view with a valid clipping rectangle.
-//
-// FIXME: After the referenced bug is fixed on all supported platforms, remove
-// this code.
-//
-// References:
-// <http://crbug.com/27493>
-// <rdar://problem/7604051> (<http://openradar.appspot.com/7604051>)
-
-@interface TCMVisibleView : NSView
-
-@end
-
-@implementation TCMVisibleView
-
-- (struct CGRect)_focusRingVisibleRect
-{
- return CGRectZero;
-}
-
-- (id)_focusRingClipAncestor
-{
- return self;
-}
-
-@end
-
-@interface NSView (TCMInterposing)
-+ (NSView *)TCMInterposing_focusView;
-@end
-
-namespace FocusIndicationFix {
-
-bool currentOSHasSetFocusRingStyleInBitmapBug()
-{
- UInt32 pixel = 0;
- UInt32* pixelPlane = &pixel;
- UInt32** pixelPlanes = &pixelPlane;
- NSBitmapImageRep *bitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:(UInt8**)pixelPlanes
- pixelsWide:1
- pixelsHigh:1
- bitsPerSample:8
- samplesPerPixel:4
- hasAlpha:YES
- isPlanar:NO
- colorSpaceName:NSCalibratedRGBColorSpace
- bitmapFormat:NSAlphaFirstBitmapFormat
- bytesPerRow:4
- bitsPerPixel:32];
- [NSGraphicsContext saveGraphicsState];
- [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:bitmap]];
- NSSetFocusRingStyle(NSFocusRingOnly);
- NSRectFill(NSMakeRect(0, 0, 1, 1));
- [NSGraphicsContext restoreGraphicsState];
- [bitmap release];
-
- return !pixel;
-}
-
-bool swizzleFocusView()
-{
- if (!currentOSHasSetFocusRingStyleInBitmapBug())
- return false;
-
- Class nsview = [NSView class];
- Method m1 = class_getClassMethod(nsview, @selector(focusView));
- Method m2 = class_getClassMethod(nsview, @selector(TCMInterposing_focusView));
- if (m1 && m2) {
- method_exchangeImplementations(m1, m2);
- return true;
- }
-
- return false;
-}
-
-static bool interpose = false;
-
-// A class to restrict the amount of time spent messing with interposing. It
-// only stacks one-deep.
-class ScopedFixer {
-public:
- ScopedFixer()
- {
- static bool swizzled = swizzleFocusView();
- interpose = swizzled;
- }
-
- ~ScopedFixer()
- {
- interpose = false;
- }
-};
-
-} // namespace FocusIndicationFix
-
-@implementation NSView (TCMInterposing)
-
-+ (NSView *)TCMInterposing_focusView
-{
- NSView *view = [self TCMInterposing_focusView]; // call original (was swizzled)
- if (!view && FocusIndicationFix::interpose) {
- static TCMVisibleView* fixedView = [[TCMVisibleView alloc] init];
- view = fixedView;
- }
-
- return view;
-}
-
-@end
-
-// --- END fix for Snow Leopard focus ring bug ---
-
-namespace WebCore {
-
-// Pick up utility function from RenderThemeChromiumMac.
-extern NSView* FlippedView();
-
-enum {
- topMargin,
- rightMargin,
- bottomMargin,
- leftMargin
-};
-
-Theme* platformTheme()
-{
- DEFINE_STATIC_LOCAL(ThemeChromiumMac, themeMac, ());
- return &themeMac;
-}
-
-// Helper functions used by a bunch of different control parts.
-
-static NSControlSize controlSizeForFont(const Font& font)
-{
- int fontSize = font.pixelSize();
- if (fontSize >= 16)
- return NSRegularControlSize;
- if (fontSize >= 11)
- return NSSmallControlSize;
- return NSMiniControlSize;
-}
-
-static LengthSize sizeFromNSControlSize(NSControlSize nsControlSize, const LengthSize& zoomedSize, float zoomFactor, const IntSize* sizes)
-{
- IntSize controlSize = sizes[nsControlSize];
- if (zoomFactor != 1.0f)
- controlSize = IntSize(controlSize.width() * zoomFactor, controlSize.height() * zoomFactor);
- LengthSize result = zoomedSize;
- if (zoomedSize.width().isIntrinsicOrAuto() && controlSize.width() > 0)
- result.setWidth(Length(controlSize.width(), Fixed));
- if (zoomedSize.height().isIntrinsicOrAuto() && controlSize.height() > 0)
- result.setHeight(Length(controlSize.height(), Fixed));
- return result;
-}
-
-static LengthSize sizeFromFont(const Font& font, const LengthSize& zoomedSize, float zoomFactor, const IntSize* sizes)
-{
- return sizeFromNSControlSize(controlSizeForFont(font), zoomedSize, zoomFactor, sizes);
-}
-
-static ControlSize controlSizeFromPixelSize(const IntSize* sizes, const IntSize& minZoomedSize, float zoomFactor)
-{
- if (minZoomedSize.width() >= static_cast<int>(sizes[NSRegularControlSize].width() * zoomFactor) &&
- minZoomedSize.height() >= static_cast<int>(sizes[NSRegularControlSize].height() * zoomFactor))
- return NSRegularControlSize;
- if (minZoomedSize.width() >= static_cast<int>(sizes[NSSmallControlSize].width() * zoomFactor) &&
- minZoomedSize.height() >= static_cast<int>(sizes[NSSmallControlSize].height() * zoomFactor))
- return NSSmallControlSize;
- return NSMiniControlSize;
-}
-
-static void setControlSize(NSCell* cell, const IntSize* sizes, const IntSize& minZoomedSize, float zoomFactor)
-{
- ControlSize size = controlSizeFromPixelSize(sizes, minZoomedSize, zoomFactor);
- if (size != [cell controlSize]) // Only update if we have to, since AppKit does work even if the size is the same.
- [cell setControlSize:(NSControlSize)size];
-}
-
-static void updateStates(NSCell* cell, ControlStates states)
-{
- // Hover state is not supported by Aqua.
-
- // Pressed state
- bool oldPressed = [cell isHighlighted];
- bool pressed = states & PressedState;
- if (pressed != oldPressed)
- [cell setHighlighted:pressed];
-
- // Enabled state
- bool oldEnabled = [cell isEnabled];
- bool enabled = states & EnabledState;
- if (enabled != oldEnabled)
- [cell setEnabled:enabled];
-
- // Focused state
- bool oldFocused = [cell showsFirstResponder];
- bool focused = states & FocusState;
- if (focused != oldFocused)
- [cell setShowsFirstResponder:focused];
-
- // Checked and Indeterminate
- bool oldIndeterminate = [cell state] == NSMixedState;
- bool indeterminate = (states & IndeterminateState);
- bool checked = states & CheckedState;
- bool oldChecked = [cell state] == NSOnState;
- if (oldIndeterminate != indeterminate || checked != oldChecked)
- [cell setState:indeterminate ? NSMixedState : (checked ? NSOnState : NSOffState)];
-
- // Window Inactive state
- NSControlTint oldTint = [cell controlTint];
- bool windowInactive = (states & WindowInactiveState);
- NSControlTint tint = windowInactive ? static_cast<NSControlTint>(NSClearControlTint)
- : [NSColor currentControlTint];
- if (tint != oldTint)
- [cell setControlTint:tint];
-}
-
-static ThemeDrawState convertControlStatesToThemeDrawState(ThemeButtonKind kind, ControlStates states)
-{
- if (states & ReadOnlyState)
- return kThemeStateUnavailableInactive;
- if (!(states & EnabledState))
- return kThemeStateUnavailableInactive;
-
- // Do not process PressedState if !EnabledState or ReadOnlyState.
- if (states & PressedState) {
- if (kind == kThemeIncDecButton || kind == kThemeIncDecButtonSmall || kind == kThemeIncDecButtonMini)
- return states & SpinUpState ? kThemeStatePressedUp : kThemeStatePressedDown;
- return kThemeStatePressed;
- }
- return kThemeStateActive;
-}
-
-static IntRect inflateRect(const IntRect& zoomedRect, const IntSize& zoomedSize, const int* margins, float zoomFactor)
-{
- // Only do the inflation if the available width/height are too small. Otherwise try to
- // fit the glow/check space into the available box's width/height.
- int widthDelta = zoomedRect.width() - (zoomedSize.width() + margins[leftMargin] * zoomFactor + margins[rightMargin] * zoomFactor);
- int heightDelta = zoomedRect.height() - (zoomedSize.height() + margins[topMargin] * zoomFactor + margins[bottomMargin] * zoomFactor);
- IntRect result(zoomedRect);
- if (widthDelta < 0) {
- result.setX(result.x() - margins[leftMargin] * zoomFactor);
- result.setWidth(result.width() - widthDelta);
- }
- if (heightDelta < 0) {
- result.setY(result.y() - margins[topMargin] * zoomFactor);
- result.setHeight(result.height() - heightDelta);
- }
- return result;
-}
-
-// Checkboxes
-
-static const IntSize* checkboxSizes()
-{
- static const IntSize sizes[3] = { IntSize(14, 14), IntSize(12, 12), IntSize(10, 10) };
- return sizes;
-}
-
-static const int* checkboxMargins(NSControlSize controlSize)
-{
- static const int margins[3][4] =
- {
- { 3, 4, 4, 2 },
- { 4, 3, 3, 3 },
- { 4, 3, 3, 3 },
- };
- return margins[controlSize];
-}
-
-static LengthSize checkboxSize(const Font& font, const LengthSize& zoomedSize, float zoomFactor)
-{
- // If the width and height are both specified, then we have nothing to do.
- if (!zoomedSize.width().isIntrinsicOrAuto() && !zoomedSize.height().isIntrinsicOrAuto())
- return zoomedSize;
-
- // Use the font size to determine the intrinsic width of the control.
- return sizeFromFont(font, zoomedSize, zoomFactor, checkboxSizes());
-}
-
-static NSButtonCell *checkbox(ControlStates states, const IntRect& zoomedRect, float zoomFactor)
-{
- static NSButtonCell *checkboxCell;
- if (!checkboxCell) {
- checkboxCell = [[NSButtonCell alloc] init];
- [checkboxCell setButtonType:NSSwitchButton];
- [checkboxCell setTitle:nil];
- [checkboxCell setAllowsMixedState:YES];
- [checkboxCell setFocusRingType:NSFocusRingTypeExterior];
- }
-
- // Set the control size based off the rectangle we're painting into.
- setControlSize(checkboxCell, checkboxSizes(), zoomedRect.size(), zoomFactor);
-
- // Update the various states we respond to.
- updateStates(checkboxCell, states);
-
- return checkboxCell;
-}
-
-// FIXME: Share more code with radio buttons.
-static void paintCheckbox(ControlStates states, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView* scrollView)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
-
- // Determine the width and height needed for the control and prepare the cell for painting.
- NSButtonCell *checkboxCell = checkbox(states, zoomedRect, zoomFactor);
- LocalCurrentGraphicsContext localContext(context);
-
- context->save();
-
- NSControlSize controlSize = [checkboxCell controlSize];
- IntSize zoomedSize = checkboxSizes()[controlSize];
- zoomedSize.setWidth(zoomedSize.width() * zoomFactor);
- zoomedSize.setHeight(zoomedSize.height() * zoomFactor);
- IntRect inflatedRect = inflateRect(zoomedRect, zoomedSize, checkboxMargins(controlSize), zoomFactor);
-
- if (zoomFactor != 1.0f) {
- inflatedRect.setWidth(inflatedRect.width() / zoomFactor);
- inflatedRect.setHeight(inflatedRect.height() / zoomFactor);
- context->translate(inflatedRect.x(), inflatedRect.y());
- context->scale(FloatSize(zoomFactor, zoomFactor));
- context->translate(-inflatedRect.x(), -inflatedRect.y());
- }
-
- {
- FocusIndicationFix::ScopedFixer fix;
- [checkboxCell drawWithFrame:NSRect(inflatedRect) inView:FlippedView()];
- }
- [checkboxCell setControlView:nil];
-
- context->restore();
-
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-// Radio Buttons
-
-static const IntSize* radioSizes()
-{
- static const IntSize sizes[3] = { IntSize(14, 15), IntSize(12, 13), IntSize(10, 10) };
- return sizes;
-}
-
-static const int* radioMargins(NSControlSize controlSize)
-{
- static const int margins[3][4] =
- {
- { 2, 2, 4, 2 },
- { 3, 2, 3, 2 },
- { 1, 0, 2, 0 },
- };
- return margins[controlSize];
-}
-
-static LengthSize radioSize(const Font& font, const LengthSize& zoomedSize, float zoomFactor)
-{
- // If the width and height are both specified, then we have nothing to do.
- if (!zoomedSize.width().isIntrinsicOrAuto() && !zoomedSize.height().isIntrinsicOrAuto())
- return zoomedSize;
-
- // Use the font size to determine the intrinsic width of the control.
- return sizeFromFont(font, zoomedSize, zoomFactor, radioSizes());
-}
-
-static NSButtonCell *radio(ControlStates states, const IntRect& zoomedRect, float zoomFactor)
-{
- static NSButtonCell *radioCell;
- if (!radioCell) {
- radioCell = [[NSButtonCell alloc] init];
- [radioCell setButtonType:NSRadioButton];
- [radioCell setTitle:nil];
- [radioCell setFocusRingType:NSFocusRingTypeExterior];
- }
-
- // Set the control size based off the rectangle we're painting into.
- setControlSize(radioCell, radioSizes(), zoomedRect.size(), zoomFactor);
-
- // Update the various states we respond to.
- updateStates(radioCell, states);
-
- return radioCell;
-}
-
-static void paintRadio(ControlStates states, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView* scrollView)
-{
- // Determine the width and height needed for the control and prepare the cell for painting.
- NSButtonCell *radioCell = radio(states, zoomedRect, zoomFactor);
- LocalCurrentGraphicsContext localContext(context);
-
- context->save();
-
- NSControlSize controlSize = [radioCell controlSize];
- IntSize zoomedSize = radioSizes()[controlSize];
- zoomedSize.setWidth(zoomedSize.width() * zoomFactor);
- zoomedSize.setHeight(zoomedSize.height() * zoomFactor);
- IntRect inflatedRect = inflateRect(zoomedRect, zoomedSize, radioMargins(controlSize), zoomFactor);
-
- if (zoomFactor != 1.0f) {
- inflatedRect.setWidth(inflatedRect.width() / zoomFactor);
- inflatedRect.setHeight(inflatedRect.height() / zoomFactor);
- context->translate(inflatedRect.x(), inflatedRect.y());
- context->scale(FloatSize(zoomFactor, zoomFactor));
- context->translate(-inflatedRect.x(), -inflatedRect.y());
- }
-
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- {
- FocusIndicationFix::ScopedFixer fix;
- [radioCell drawWithFrame:NSRect(inflatedRect) inView:FlippedView()];
- }
- [radioCell setControlView:nil];
- END_BLOCK_OBJC_EXCEPTIONS
-
- context->restore();
-}
-
-// Buttons
-
-// Buttons really only constrain height. They respect width.
-static const IntSize* buttonSizes()
-{
- static const IntSize sizes[3] = { IntSize(0, 21), IntSize(0, 18), IntSize(0, 15) };
- return sizes;
-}
-
-static const int* buttonMargins(NSControlSize controlSize)
-{
- static const int margins[3][4] =
- {
- { 4, 6, 7, 6 },
- { 4, 5, 6, 5 },
- { 0, 1, 1, 1 },
- };
- return margins[controlSize];
-}
-
-static void setupButtonCell(NSButtonCell *&buttonCell, ControlPart part, ControlStates states, const IntRect& zoomedRect, float zoomFactor)
-{
- if (!buttonCell) {
- buttonCell = [[NSButtonCell alloc] init];
- [buttonCell setTitle:nil];
- [buttonCell setButtonType:NSMomentaryPushInButton];
- if (states & DefaultState)
- [buttonCell setKeyEquivalent:@"\r"];
- }
-
- // Set the control size based off the rectangle we're painting into.
- const IntSize* sizes = buttonSizes();
- if (part == SquareButtonPart || zoomedRect.height() > buttonSizes()[NSRegularControlSize].height() * zoomFactor) {
- // Use the square button
- if ([buttonCell bezelStyle] != NSShadowlessSquareBezelStyle)
- [buttonCell setBezelStyle:NSShadowlessSquareBezelStyle];
- } else if ([buttonCell bezelStyle] != NSRoundedBezelStyle)
- [buttonCell setBezelStyle:NSRoundedBezelStyle];
-
- setControlSize(buttonCell, sizes, zoomedRect.size(), zoomFactor);
-
- // Update the various states we respond to.
- updateStates(buttonCell, states);
-}
-
-static NSButtonCell *button(ControlPart part, ControlStates states, const IntRect& zoomedRect, float zoomFactor)
-{
- bool isDefault = states & DefaultState;
- static NSButtonCell *cells[2];
- setupButtonCell(cells[isDefault], part, states, zoomedRect, zoomFactor);
- return cells[isDefault];
-}
-
-static void paintButton(ControlPart part, ControlStates states, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView* scrollView)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
-
- // Determine the width and height needed for the control and prepare the cell for painting.
- NSButtonCell *buttonCell = button(part, states, zoomedRect, zoomFactor);
- LocalCurrentGraphicsContext localContext(context);
-
- NSControlSize controlSize = [buttonCell controlSize];
- IntSize zoomedSize = buttonSizes()[controlSize];
- zoomedSize.setWidth(zoomedRect.width()); // Buttons don't ever constrain width, so the zoomed width can just be honored.
- zoomedSize.setHeight(zoomedSize.height() * zoomFactor);
- IntRect inflatedRect = zoomedRect;
- if ([buttonCell bezelStyle] == NSRoundedBezelStyle) {
- // Center the button within the available space.
- if (inflatedRect.height() > zoomedSize.height()) {
- inflatedRect.setY(inflatedRect.y() + (inflatedRect.height() - zoomedSize.height()) / 2);
- inflatedRect.setHeight(zoomedSize.height());
- }
-
- // Now inflate it to account for the shadow.
- inflatedRect = inflateRect(inflatedRect, zoomedSize, buttonMargins(controlSize), zoomFactor);
-
- if (zoomFactor != 1.0f) {
- inflatedRect.setWidth(inflatedRect.width() / zoomFactor);
- inflatedRect.setHeight(inflatedRect.height() / zoomFactor);
- context->translate(inflatedRect.x(), inflatedRect.y());
- context->scale(FloatSize(zoomFactor, zoomFactor));
- context->translate(-inflatedRect.x(), -inflatedRect.y());
- }
- }
-
- {
- LocalCurrentGraphicsContext localContext(context);
- FocusIndicationFix::ScopedFixer fix;
- [buttonCell drawWithFrame:NSRect(inflatedRect) inView:FlippedView()];
- }
- [buttonCell setControlView:nil];
-
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-// Stepper
-
-static const IntSize* stepperSizes()
-{
- static const IntSize sizes[3] = { IntSize(19, 27), IntSize(15, 22), IntSize(13, 15) };
- return sizes;
-}
-
-// We don't use controlSizeForFont() for steppers because the stepper height
-// should be equal to or less than the corresponding text field height,
-static NSControlSize stepperControlSizeForFont(const Font& font)
-{
- int fontSize = font.pixelSize();
- if (fontSize >= 18)
- return NSRegularControlSize;
- if (fontSize >= 13)
- return NSSmallControlSize;
- return NSMiniControlSize;
-}
-
-static void paintStepper(ControlStates states, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView*)
-{
- // We don't use NSStepperCell because there are no ways to draw an
- // NSStepperCell with the up button highlighted.
-
- HIThemeButtonDrawInfo drawInfo;
- drawInfo.version = 0;
- drawInfo.state = convertControlStatesToThemeDrawState(kThemeIncDecButton, states);
- drawInfo.adornment = kThemeAdornmentDefault;
- ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomedRect.size(), zoomFactor);
- if (controlSize == NSSmallControlSize)
- drawInfo.kind = kThemeIncDecButtonSmall;
- else if (controlSize == NSMiniControlSize)
- drawInfo.kind = kThemeIncDecButtonMini;
- else
- drawInfo.kind = kThemeIncDecButton;
-
- IntRect rect(zoomedRect);
- context->save();
- if (zoomFactor != 1.0f) {
- rect.setWidth(rect.width() / zoomFactor);
- rect.setHeight(rect.height() / zoomFactor);
- context->translate(rect.x(), rect.y());
- context->scale(FloatSize(zoomFactor, zoomFactor));
- context->translate(-rect.x(), -rect.y());
- }
- CGRect bounds(rect);
- CGRect backgroundBounds;
- HIThemeGetButtonBackgroundBounds(&bounds, &drawInfo, &backgroundBounds);
- // Center the stepper rectangle in the specified area.
- backgroundBounds.origin.x = bounds.origin.x + (bounds.size.width - backgroundBounds.size.width) / 2;
- if (backgroundBounds.size.height < bounds.size.height) {
- int heightDiff = clampToInteger(bounds.size.height - backgroundBounds.size.height);
- backgroundBounds.origin.y = bounds.origin.y + (heightDiff / 2) + 1;
- }
- gfx::SkiaBitLocker bitLocker(context->platformContext()->canvas());
- CGContextRef cgContext = bitLocker.cgContext();
- HIThemeDrawButton(&backgroundBounds, &drawInfo, cgContext, kHIThemeOrientationNormal, 0);
- context->restore();
-}
-
-// Theme overrides
-
-int ThemeChromiumMac::baselinePositionAdjustment(ControlPart part) const
-{
- if (part == CheckboxPart || part == RadioPart)
- return -2;
- return Theme::baselinePositionAdjustment(part);
-}
-
-FontDescription ThemeChromiumMac::controlFont(ControlPart part, const Font& font, float zoomFactor) const
-{
- switch (part) {
- case PushButtonPart: {
- FontDescription fontDescription;
- fontDescription.setIsAbsoluteSize(true);
- fontDescription.setGenericFamily(FontDescription::SerifFamily);
-
- NSFont* nsFont = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:controlSizeForFont(font)]];
- fontDescription.firstFamily().setFamily([nsFont familyName]);
- fontDescription.setComputedSize([nsFont pointSize] * zoomFactor);
- fontDescription.setSpecifiedSize([nsFont pointSize] * zoomFactor);
- return fontDescription;
- }
- default:
- return Theme::controlFont(part, font, zoomFactor);
- }
-}
-
-LengthSize ThemeChromiumMac::controlSize(ControlPart part, const Font& font, const LengthSize& zoomedSize, float zoomFactor) const
-{
- switch (part) {
- case CheckboxPart:
- return checkboxSize(font, zoomedSize, zoomFactor);
- case RadioPart:
- return radioSize(font, zoomedSize, zoomFactor);
- case PushButtonPart:
- // Height is reset to auto so that specified heights can be ignored.
- return sizeFromFont(font, LengthSize(zoomedSize.width(), Length()), zoomFactor, buttonSizes());
- case InnerSpinButtonPart:
- if (!zoomedSize.width().isIntrinsicOrAuto() && !zoomedSize.height().isIntrinsicOrAuto())
- return zoomedSize;
- return sizeFromNSControlSize(stepperControlSizeForFont(font), zoomedSize, zoomFactor, stepperSizes());
- default:
- return zoomedSize;
- }
-}
-
-LengthSize ThemeChromiumMac::minimumControlSize(ControlPart part, const Font& font, float zoomFactor) const
-{
- switch (part) {
- case SquareButtonPart:
- case DefaultButtonPart:
- case ButtonPart:
- return LengthSize(Length(0, Fixed), Length(static_cast<int>(15 * zoomFactor), Fixed));
- case InnerSpinButtonPart: {
- IntSize base = stepperSizes()[NSMiniControlSize];
- return LengthSize(Length(static_cast<int>(base.width() * zoomFactor), Fixed),
- Length(static_cast<int>(base.height() * zoomFactor), Fixed));
- }
- default:
- return Theme::minimumControlSize(part, font, zoomFactor);
- }
-}
-
-LengthBox ThemeChromiumMac::controlBorder(ControlPart part, const Font& font, const LengthBox& zoomedBox, float zoomFactor) const
-{
- switch (part) {
- case SquareButtonPart:
- case DefaultButtonPart:
- case ButtonPart:
- return LengthBox(0, zoomedBox.right().value(), 0, zoomedBox.left().value());
- default:
- return Theme::controlBorder(part, font, zoomedBox, zoomFactor);
- }
-}
-
-LengthBox ThemeChromiumMac::controlPadding(ControlPart part, const Font& font, const LengthBox& zoomedBox, float zoomFactor) const
-{
- switch (part) {
- case PushButtonPart: {
- // Just use 8px. AppKit wants to use 11px for mini buttons, but that padding is just too large
- // for real-world Web sites (creating a huge necessary minimum width for buttons whose space is
- // by definition constrained, since we select mini only for small cramped environments.
- // This also guarantees the HTML <button> will match our rendering by default, since we're using a consistent
- // padding.
- const int padding = 8 * zoomFactor;
- return LengthBox(0, padding, 0, padding);
- }
- default:
- return Theme::controlPadding(part, font, zoomedBox, zoomFactor);
- }
-}
-
-void ThemeChromiumMac::inflateControlPaintRect(ControlPart part, ControlStates states, IntRect& zoomedRect, float zoomFactor) const
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- switch (part) {
- case CheckboxPart: {
- // We inflate the rect as needed to account for padding included in the cell to accommodate the checkbox
- // shadow" and the check. We don't consider this part of the bounds of the control in WebKit.
- NSCell *cell = checkbox(states, zoomedRect, zoomFactor);
- NSControlSize controlSize = [cell controlSize];
- IntSize zoomedSize = checkboxSizes()[controlSize];
- zoomedSize.setHeight(zoomedSize.height() * zoomFactor);
- zoomedSize.setWidth(zoomedSize.width() * zoomFactor);
- zoomedRect = inflateRect(zoomedRect, zoomedSize, checkboxMargins(controlSize), zoomFactor);
- break;
- }
- case RadioPart: {
- // We inflate the rect as needed to account for padding included in the cell to accommodate the radio button
- // shadow". We don't consider this part of the bounds of the control in WebKit.
- NSCell *cell = radio(states, zoomedRect, zoomFactor);
- NSControlSize controlSize = [cell controlSize];
- IntSize zoomedSize = radioSizes()[controlSize];
- zoomedSize.setHeight(zoomedSize.height() * zoomFactor);
- zoomedSize.setWidth(zoomedSize.width() * zoomFactor);
- zoomedRect = inflateRect(zoomedRect, zoomedSize, radioMargins(controlSize), zoomFactor);
- break;
- }
- case PushButtonPart:
- case DefaultButtonPart:
- case ButtonPart: {
- NSButtonCell *cell = button(part, states, zoomedRect, zoomFactor);
- NSControlSize controlSize = [cell controlSize];
-
- // We inflate the rect as needed to account for the Aqua button's shadow.
- if ([cell bezelStyle] == NSRoundedBezelStyle) {
- IntSize zoomedSize = buttonSizes()[controlSize];
- zoomedSize.setHeight(zoomedSize.height() * zoomFactor);
- zoomedSize.setWidth(zoomedRect.width()); // Buttons don't ever constrain width, so the zoomed width can just be honored.
- zoomedRect = inflateRect(zoomedRect, zoomedSize, buttonMargins(controlSize), zoomFactor);
- }
- break;
- }
- case InnerSpinButtonPart: {
- static const int stepperMargin[4] = { 0, 0, 0, 0 };
- ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomedRect.size(), zoomFactor);
- IntSize zoomedSize = stepperSizes()[controlSize];
- zoomedSize.setHeight(zoomedSize.height() * zoomFactor);
- zoomedSize.setWidth(zoomedSize.width() * zoomFactor);
- zoomedRect = inflateRect(zoomedRect, zoomedSize, stepperMargin, zoomFactor);
- break;
- }
- default:
- break;
- }
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void ThemeChromiumMac::paint(ControlPart part, ControlStates states, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView* scrollView) const
-{
- switch (part) {
- case CheckboxPart:
- paintCheckbox(states, context, zoomedRect, zoomFactor, scrollView);
- break;
- case RadioPart:
- paintRadio(states, context, zoomedRect, zoomFactor, scrollView);
- break;
- case PushButtonPart:
- case DefaultButtonPart:
- case ButtonPart:
- case SquareButtonPart:
- paintButton(part, states, context, zoomedRect, zoomFactor, scrollView);
- break;
- case InnerSpinButtonPart:
- paintStepper(states, context, zoomedRect, zoomFactor, scrollView);
- break;
- default:
- break;
- }
-}
-
-}
diff --git a/Source/WebCore/platform/chromium/support/CCThreadImpl.cpp b/Source/WebCore/platform/chromium/support/CCThreadImpl.cpp
index a81df1b09..cce19525c 100644
--- a/Source/WebCore/platform/chromium/support/CCThreadImpl.cpp
+++ b/Source/WebCore/platform/chromium/support/CCThreadImpl.cpp
@@ -25,7 +25,7 @@
#include "config.h"
#include "CCThreadImpl.h"
-#include "cc/CCCompletionEvent.h"
+#include "CCCompletionEvent.h"
#include <public/Platform.h>
#include <public/WebThread.h>
diff --git a/Source/WebCore/platform/chromium/support/CCThreadImpl.h b/Source/WebCore/platform/chromium/support/CCThreadImpl.h
index d69b8015a..308ba8029 100644
--- a/Source/WebCore/platform/chromium/support/CCThreadImpl.h
+++ b/Source/WebCore/platform/chromium/support/CCThreadImpl.h
@@ -22,7 +22,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "cc/CCThread.h"
+#include "CCThread.h"
#include <wtf/OwnPtr.h>
#include <wtf/Threading.h>
diff --git a/Source/WebCore/platform/chromium/support/Extensions3DChromium.cpp b/Source/WebCore/platform/chromium/support/Extensions3DChromium.cpp
index bfc145dde..9412274c7 100644
--- a/Source/WebCore/platform/chromium/support/Extensions3DChromium.cpp
+++ b/Source/WebCore/platform/chromium/support/Extensions3DChromium.cpp
@@ -31,6 +31,7 @@
#include "GraphicsContext3DPrivate.h"
#include "NotImplemented.h"
#include <public/WebGraphicsContext3D.h>
+#include <wtf/text/CString.h>
namespace WebCore {
@@ -197,5 +198,19 @@ void Extensions3DChromium::getnUniformivEXT(GC3Duint program, int location, GC3D
notImplemented();
}
+void Extensions3DChromium::insertEventMarkerEXT(const String& marker)
+{
+ m_private->webContext()->insertEventMarkerEXT(marker.utf8().data());
+}
+
+void Extensions3DChromium::pushGroupMarkerEXT(const String& marker)
+{
+ m_private->webContext()->pushGroupMarkerEXT(marker.utf8().data());
+}
+
+void Extensions3DChromium::popGroupMarkerEXT(void)
+{
+ m_private->webContext()->popGroupMarkerEXT();
+}
} // namespace WebCore
diff --git a/Source/WebCore/platform/chromium/support/WebCompositorImpl.cpp b/Source/WebCore/platform/chromium/support/WebCompositorImpl.cpp
index e757c4076..a0bd1c8b7 100644
--- a/Source/WebCore/platform/chromium/support/WebCompositorImpl.cpp
+++ b/Source/WebCore/platform/chromium/support/WebCompositorImpl.cpp
@@ -27,10 +27,10 @@
#include "WebCompositorImpl.h"
+#include "CCLayerTreeHost.h"
+#include "CCProxy.h"
+#include "CCSettings.h"
#include "CCThreadImpl.h"
-#include "cc/CCLayerTreeHost.h"
-#include "cc/CCProxy.h"
-#include "cc/CCSettings.h"
#include <public/Platform.h>
#include <wtf/ThreadingPrimitives.h>
diff --git a/Source/WebCore/platform/chromium/support/WebHTTPBody.cpp b/Source/WebCore/platform/chromium/support/WebHTTPBody.cpp
index 40b0fcd26..420625031 100644
--- a/Source/WebCore/platform/chromium/support/WebHTTPBody.cpp
+++ b/Source/WebCore/platform/chromium/support/WebHTTPBody.cpp
@@ -79,6 +79,7 @@ bool WebHTTPBody::elementAt(size_t index, Element& result) const
result.fileStart = 0;
result.fileLength = 0;
result.modificationTime = invalidFileTime();
+ result.url = KURL();
result.blobURL = KURL();
switch (element.m_type) {
@@ -98,7 +99,17 @@ bool WebHTTPBody::elementAt(size_t index, Element& result) const
#if ENABLE(BLOB)
case FormDataElement::encodedBlob:
result.type = Element::TypeBlob;
- result.blobURL = element.m_blobURL;
+ result.url = element.m_url;
+ result.blobURL = element.m_url; // FIXME: deprecate this.
+ break;
+#endif
+#if ENABLE(FILE_SYSTEM)
+ case FormDataElement::encodedURL:
+ result.type = Element::TypeURL;
+ result.url = element.m_url;
+ result.fileStart = element.m_fileStart;
+ result.fileLength = element.m_fileLength;
+ result.modificationTime = element.m_expectedFileModificationTime;
break;
#endif
default:
@@ -131,9 +142,20 @@ void WebHTTPBody::appendFileRange(const WebString& filePath, long long fileStart
#endif
}
+void WebHTTPBody::appendURLRange(const WebURL& url, long long start, long long length, double modificationTime)
+{
+#if ENABLE(FILE_SYSTEM)
+ // Currently we only support filesystem URL.
+ ASSERT(KURL(url).protocolIs("filesystem"));
+ ensureMutable();
+ m_private->appendURLRange(url, start, length, modificationTime);
+#endif
+}
+
void WebHTTPBody::appendBlob(const WebURL& blobURL)
{
#if ENABLE(BLOB)
+ ASSERT(KURL(blobURL).protocolIs("blob"));
ensureMutable();
m_private->appendBlob(blobURL);
#endif
diff --git a/Source/WebCore/platform/efl/RenderThemeEfl.cpp b/Source/WebCore/platform/efl/RenderThemeEfl.cpp
index 8edc2aafa..e07dd8409 100644
--- a/Source/WebCore/platform/efl/RenderThemeEfl.cpp
+++ b/Source/WebCore/platform/efl/RenderThemeEfl.cpp
@@ -42,6 +42,7 @@
#include <Ecore_Evas.h>
#include <Edje.h>
+#include <new>
#include <wtf/text/CString.h>
#include <wtf/text/WTFString.h>
@@ -332,11 +333,12 @@ bool RenderThemeEfl::paintThemePart(RenderObject* object, FormType type, const P
RenderSlider* renderSlider = toRenderSlider(object);
HTMLInputElement* input = renderSlider->node()->toInputElement();
- Edje_Message_Float_Set* msg;
double valueRange = input->maximum() - input->minimum();
- msg = static_cast<Edje_Message_Float_Set*>(alloca(sizeof(Edje_Message_Float_Set) + sizeof(float)));
+ OwnArrayPtr<char> buffer = adoptArrayPtr(new char[sizeof(Edje_Message_Float_Set) + sizeof(double)]);
+ Edje_Message_Float_Set* msg = new(buffer.get()) Edje_Message_Float_Set;
msg->count = 2;
+
if (valueRange > 0)
msg->val[0] = static_cast<float>((input->valueAsNumber() - input->minimum()) / valueRange);
else
@@ -346,15 +348,14 @@ bool RenderThemeEfl::paintThemePart(RenderObject* object, FormType type, const P
#if ENABLE(PROGRESS_ELEMENT)
} else if (type == ProgressBar) {
RenderProgress* renderProgress = toRenderProgress(object);
- Edje_Message_Float_Set* msg;
- int max;
- double value;
- msg = static_cast<Edje_Message_Float_Set*>(alloca(sizeof(Edje_Message_Float_Set) + sizeof(float)));
- max = rect.width();
- value = renderProgress->position();
+ int max = rect.width();
+ double value = renderProgress->position();
+ OwnArrayPtr<char> buffer = adoptArrayPtr(new char[sizeof(Edje_Message_Float_Set) + sizeof(double)]);
+ Edje_Message_Float_Set* msg = new(buffer.get()) Edje_Message_Float_Set;
msg->count = 2;
+
if (object->style()->direction() == RTL)
msg->val[0] = (1.0 - value) * max;
else
@@ -452,8 +453,7 @@ void RenderThemeEfl::createEdje()
else if (!edje_object_file_set(m_edje, m_themePath.utf8().data(), "webkit/base")) {
Edje_Load_Error err = edje_object_load_error_get(m_edje);
const char* errmsg = edje_load_error_str(err);
- EINA_LOG_ERR("Could not load 'webkit/base' from theme %s: %s",
- m_themePath.utf8().data(), errmsg);
+ EINA_LOG_ERR("Could not set file: %s", errmsg);
evas_object_del(m_edje);
m_edje = 0;
} else {
@@ -1240,7 +1240,7 @@ bool RenderThemeEfl::paintMediaSliderTrack(RenderObject* object, const PaintInfo
IntPoint sliderTopRight = sliderTopLeft;
sliderTopRight.move(0, rangeRect.height());
- context->fillRect(FloatRect(rect), m_mediaPanelColor, ColorSpaceDeviceRGB);
+ context->fillRect(FloatRect(rangeRect), m_mediaPanelColor, ColorSpaceDeviceRGB);
}
context->restore();
return true;
diff --git a/Source/WebCore/platform/efl/ScrollbarEfl.cpp b/Source/WebCore/platform/efl/ScrollbarEfl.cpp
index ce7f7bf4b..1aaf4cf5d 100644
--- a/Source/WebCore/platform/efl/ScrollbarEfl.cpp
+++ b/Source/WebCore/platform/efl/ScrollbarEfl.cpp
@@ -36,6 +36,7 @@
#include <Ecore.h>
#include <Edje.h>
#include <Evas.h>
+#include <new>
#include <string>
#include <wtf/text/CString.h>
@@ -171,8 +172,8 @@ void ScrollbarEfl::updateThumbPositionAndProportion()
m_lastTotalSize = tSize;
m_lastVisibleSize = vSize;
- char buffer[sizeof(Edje_Message_Float_Set) + sizeof(double)];
- Edje_Message_Float_Set* message = reinterpret_cast<Edje_Message_Float_Set*>(buffer);
+ OwnArrayPtr<char> buffer = adoptArrayPtr(new char[sizeof(Edje_Message_Float_Set) + sizeof(double)]);
+ Edje_Message_Float_Set* message = new(buffer.get()) Edje_Message_Float_Set;
message->count = 2;
if (tSize - vSize > 0)
diff --git a/Source/WebCore/platform/graphics/BitmapImage.h b/Source/WebCore/platform/graphics/BitmapImage.h
index 05212804e..693d41f6d 100644
--- a/Source/WebCore/platform/graphics/BitmapImage.h
+++ b/Source/WebCore/platform/graphics/BitmapImage.h
@@ -170,11 +170,9 @@ public:
#endif
virtual NativeImagePtr nativeImageForCurrentFrame();
- bool frameHasAlphaAtIndex(size_t);
virtual bool currentFrameHasAlpha();
ImageOrientation currentFrameOrientation();
- ImageOrientation frameOrientationAtIndex(size_t);
#if !ASSERT_DISABLED
virtual bool notSolidColor();
@@ -214,6 +212,8 @@ protected:
NativeImagePtr frameAtIndex(size_t);
bool frameIsCompleteAtIndex(size_t);
float frameDurationAtIndex(size_t);
+ bool frameHasAlphaAtIndex(size_t);
+ ImageOrientation frameOrientationAtIndex(size_t);
// Decodes and caches a frame. Never accessed except internally.
void cacheFrame(size_t index);
diff --git a/Source/WebCore/platform/graphics/Extensions3D.h b/Source/WebCore/platform/graphics/Extensions3D.h
index 05f30fd47..5f28afb3b 100644
--- a/Source/WebCore/platform/graphics/Extensions3D.h
+++ b/Source/WebCore/platform/graphics/Extensions3D.h
@@ -66,6 +66,7 @@ public:
// GL_OES_compressed_ETC1_RGB8_texture
// GL_IMG_texture_compression_pvrtc
// EXT_texture_filter_anisotropic
+ // GL_EXT_debug_marker
// GL_CHROMIUM_copy_texture
// GL_CHROMIUM_flipy
@@ -182,6 +183,11 @@ public:
virtual void readnPixelsEXT(int x, int y, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, GC3Dsizei bufSize, void *data) = 0;
virtual void getnUniformfvEXT(GC3Duint program, int location, GC3Dsizei bufSize, float *params) = 0;
virtual void getnUniformivEXT(GC3Duint program, int location, GC3Dsizei bufSize, int *params) = 0;
+
+ // GL_EXT_debug_marker
+ virtual void insertEventMarkerEXT(const String&) = 0;
+ virtual void pushGroupMarkerEXT(const String&) = 0;
+ virtual void popGroupMarkerEXT(void) = 0;
};
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/Font.cpp b/Source/WebCore/platform/graphics/Font.cpp
index 2994698a5..db07f0a98 100644
--- a/Source/WebCore/platform/graphics/Font.cpp
+++ b/Source/WebCore/platform/graphics/Font.cpp
@@ -259,11 +259,6 @@ Font::CodePath Font::codePath(const TextRun& run) const
return Simple;
#endif
-#if PLATFORM(QT) && !HAVE(QRAWFONT)
- if (run.expansion() || run.rtl() || isSmallCaps() || wordSpacing() || letterSpacing())
- return Complex;
-#endif
-
if (m_fontDescription.featureSettings() && m_fontDescription.featureSettings()->size() > 0)
return Complex;
diff --git a/Source/WebCore/platform/graphics/Font.h b/Source/WebCore/platform/graphics/Font.h
index b3b61babb..5e38a9633 100644
--- a/Source/WebCore/platform/graphics/Font.h
+++ b/Source/WebCore/platform/graphics/Font.h
@@ -36,14 +36,10 @@
#include <wtf/unicode/CharacterNames.h>
#if PLATFORM(QT)
-#if HAVE(QRAWFONT)
#include <QRawFont>
QT_BEGIN_NAMESPACE
class QTextLayout;
QT_END_NAMESPACE
-#else
-#include <QFont>
-#endif
#endif
namespace WebCore {
@@ -184,11 +180,7 @@ public:
static unsigned expansionOpportunityCount(const UChar*, size_t length, TextDirection, bool& isAfterExpansion);
#if PLATFORM(QT)
-#if HAVE(QRAWFONT)
QRawFont rawFont() const;
-#else
- QFont font() const;
-#endif
QFont syntheticFont() const;
#endif
@@ -268,7 +260,8 @@ private:
{
return m_fontList && m_fontList->loadingCustomFonts();
}
-#if PLATFORM(QT) && HAVE(QRAWFONT)
+
+#if PLATFORM(QT)
void initFormatForTextLayout(QTextLayout*) const;
#endif
diff --git a/Source/WebCore/platform/graphics/GraphicsContext.cpp b/Source/WebCore/platform/graphics/GraphicsContext.cpp
index caef7ad2e..b0ee15668 100644
--- a/Source/WebCore/platform/graphics/GraphicsContext.cpp
+++ b/Source/WebCore/platform/graphics/GraphicsContext.cpp
@@ -376,7 +376,7 @@ bool GraphicsContext::paintingDisabled() const
return m_state.paintingDisabled;
}
-#if !OS(WINCE) || (PLATFORM(QT) && !HAVE(QRAWFONT))
+#if !OS(WINCE)
void GraphicsContext::drawText(const Font& font, const TextRun& run, const FloatPoint& point, int from, int to)
{
if (paintingDisabled())
diff --git a/Source/WebCore/platform/graphics/GraphicsContext3D.cpp b/Source/WebCore/platform/graphics/GraphicsContext3D.cpp
index 38b089268..bc899472c 100644
--- a/Source/WebCore/platform/graphics/GraphicsContext3D.cpp
+++ b/Source/WebCore/platform/graphics/GraphicsContext3D.cpp
@@ -116,7 +116,9 @@ bool GraphicsContext3D::computeFormatAndTypeParameters(GC3Denum format,
*componentsPerPixel = 1;
*bytesPerComponent = sizeof(GC3Dushort);
break;
+#if !PLATFORM(BLACKBERRY)
case GraphicsContext3D::UNSIGNED_INT_24_8:
+#endif
case GraphicsContext3D::UNSIGNED_INT:
*bytesPerComponent = sizeof(GC3Duint);
break;
diff --git a/Source/WebCore/platform/graphics/GraphicsContext3D.h b/Source/WebCore/platform/graphics/GraphicsContext3D.h
index e1373f091..f5e6f1f2f 100644
--- a/Source/WebCore/platform/graphics/GraphicsContext3D.h
+++ b/Source/WebCore/platform/graphics/GraphicsContext3D.h
@@ -74,7 +74,7 @@ typedef QSurface* PlatformGraphicsSurface3D;
typedef void* PlatformGraphicsContext3D;
#endif
-#if PLATFORM(CHROMIUM) && USE(SKIA)
+#if (PLATFORM(CHROMIUM) || PLATFORM(BLACKBERRY)) && USE(SKIA)
class GrContext;
#endif
@@ -483,7 +483,7 @@ public:
PlatformGraphicsContext3D platformGraphicsContext3D() const { return m_contextObj; }
Platform3DObject platformTexture() const { return m_compositorTexture; }
CALayer* platformLayer() const { return reinterpret_cast<CALayer*>(m_webGLLayer.get()); }
-#elif PLATFORM(CHROMIUM)
+#elif PLATFORM(CHROMIUM) || PLATFORM(BLACKBERRY)
PlatformGraphicsContext3D platformGraphicsContext3D() const;
Platform3DObject platformTexture() const;
#if USE(SKIA)
@@ -519,7 +519,7 @@ public:
#endif
bool makeContextCurrent();
-#if PLATFORM(MAC) || PLATFORM(CHROMIUM) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL)
+#if PLATFORM(MAC) || PLATFORM(CHROMIUM) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(BLACKBERRY)
// With multisampling on, blit from multisampleFBO to regular FBO.
void prepareTexture();
#endif
@@ -813,6 +813,10 @@ public:
PassRefPtr<ImageData> paintRenderingResultsToImageData(DrawingBuffer*);
bool paintCompositedResultsToCanvas(ImageBuffer*);
+#if PLATFORM(BLACKBERRY)
+ bool paintsIntoCanvasBuffer() const;
+#endif
+
// Support for buffer creation and deletion
Platform3DObject createBuffer();
Platform3DObject createFramebuffer();
@@ -915,7 +919,7 @@ public:
AlphaOp alphaOp,
void* destinationData);
-#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL)
+#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(BLACKBERRY)
// Take into account the user's requested context creation attributes,
// in particular stencil and antialias, and determine which could or
// could not be honored based on the capabilities of the OpenGL
@@ -954,11 +958,15 @@ public:
#endif
#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(BLACKBERRY)
- typedef struct {
+ struct ShaderSourceEntry {
String source;
String log;
bool isValid;
- } ShaderSourceEntry;
+ ShaderSourceEntry()
+ : isValid(0)
+ {
+ }
+ };
HashMap<Platform3DObject, ShaderSourceEntry> m_shaderSourceMap;
ANGLEWebKitBridge m_compiler;
diff --git a/Source/WebCore/platform/graphics/MediaPlayer.cpp b/Source/WebCore/platform/graphics/MediaPlayer.cpp
index 28c784c03..42e308bb5 100644
--- a/Source/WebCore/platform/graphics/MediaPlayer.cpp
+++ b/Source/WebCore/platform/graphics/MediaPlayer.cpp
@@ -155,6 +155,7 @@ public:
virtual bool sourceAppend(const String&, const unsigned char*, unsigned) { return false; }
virtual bool sourceAbort(const String&) { return false; }
virtual void sourceEndOfStream(MediaPlayer::EndOfStreamStatus) { }
+ virtual bool sourceSetTimestampOffset(const String&, double) { return false; }
#endif
#if ENABLE(ENCRYPTED_MEDIA)
@@ -492,6 +493,11 @@ void MediaPlayer::sourceEndOfStream(MediaPlayer::EndOfStreamStatus status)
{
return m_private->sourceEndOfStream(status);
}
+
+bool MediaPlayer::sourceSetTimestampOffset(const String& id, double offset)
+{
+ return m_private->sourceSetTimestampOffset(id, offset);
+}
#endif
#if ENABLE(ENCRYPTED_MEDIA)
diff --git a/Source/WebCore/platform/graphics/MediaPlayer.h b/Source/WebCore/platform/graphics/MediaPlayer.h
index c86827b8a..de692227c 100644
--- a/Source/WebCore/platform/graphics/MediaPlayer.h
+++ b/Source/WebCore/platform/graphics/MediaPlayer.h
@@ -256,6 +256,7 @@ public:
bool sourceAbort(const String& id);
enum EndOfStreamStatus { EosNoError, EosNetworkError, EosDecodeError };
void sourceEndOfStream(EndOfStreamStatus);
+ bool sourceSetTimestampOffset(const String& id, double offset);
#endif
#if ENABLE(ENCRYPTED_MEDIA)
diff --git a/Source/WebCore/platform/graphics/MediaPlayerPrivate.h b/Source/WebCore/platform/graphics/MediaPlayerPrivate.h
index 58f1606d6..28d2d9e07 100644
--- a/Source/WebCore/platform/graphics/MediaPlayerPrivate.h
+++ b/Source/WebCore/platform/graphics/MediaPlayerPrivate.h
@@ -174,6 +174,7 @@ public:
virtual bool sourceAppend(const String& id, const unsigned char* data, unsigned length) { return false; }
virtual bool sourceAbort(const String& id) { return false; }
virtual void sourceEndOfStream(MediaPlayer::EndOfStreamStatus) { };
+ virtual bool sourceSetTimestampOffset(const String& id, double offset) { return false; }
#endif
#if ENABLE(ENCRYPTED_MEDIA)
diff --git a/Source/WebCore/platform/graphics/SimpleFontData.cpp b/Source/WebCore/platform/graphics/SimpleFontData.cpp
index 7951425c8..1232e47f9 100644
--- a/Source/WebCore/platform/graphics/SimpleFontData.cpp
+++ b/Source/WebCore/platform/graphics/SimpleFontData.cpp
@@ -69,7 +69,6 @@ SimpleFontData::SimpleFontData(PassOwnPtr<AdditionalFontData> fontData, float fo
m_fontData->initializeFontData(this, fontSize);
}
-#if !(PLATFORM(QT) && !HAVE(QRAWFONT))
// Estimates of avgCharWidth and maxCharWidth for platforms that don't support accessing these values from the font.
void SimpleFontData::initCharWidths()
{
@@ -130,7 +129,6 @@ void SimpleFontData::platformGlyphInit()
m_missingGlyphData.fontData = this;
m_missingGlyphData.glyph = 0;
}
-#endif
SimpleFontData::~SimpleFontData()
{
@@ -148,13 +146,11 @@ const SimpleFontData* SimpleFontData::fontDataForCharacter(UChar32) const
return this;
}
-#if !(PLATFORM(QT) && !HAVE(QRAWFONT))
Glyph SimpleFontData::glyphForCharacter(UChar32 character) const
{
GlyphPageTreeNode* node = GlyphPageTreeNode::getRootChild(this, character / GlyphPage::size);
return node->page() ? node->page()->glyphAt(character % GlyphPage::size) : 0;
}
-#endif
bool SimpleFontData::isSegmented() const
{
diff --git a/Source/WebCore/platform/graphics/SimpleFontData.h b/Source/WebCore/platform/graphics/SimpleFontData.h
index 0a389cd92..c0b044d2c 100644
--- a/Source/WebCore/platform/graphics/SimpleFontData.h
+++ b/Source/WebCore/platform/graphics/SimpleFontData.h
@@ -53,12 +53,8 @@
#endif
#if PLATFORM(QT)
-#if !HAVE(QRAWFONT)
-#include <QFont>
-#else
#include <QRawFont>
#endif
-#endif
namespace WebCore {
@@ -186,11 +182,7 @@ public:
#endif
#if PLATFORM(QT)
-#if !HAVE(QRAWFONT)
- QFont getQtFont() const { return m_platformData.font(); }
-#else
QRawFont getQtRawFont() const { return m_platformData.rawFont(); }
-#endif // !HAVE(QRAWFONT)
#endif
#if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX))
@@ -295,7 +287,6 @@ private:
#endif
};
-#if !(PLATFORM(QT) && !HAVE(QRAWFONT))
ALWAYS_INLINE FloatRect SimpleFontData::boundsForGlyph(Glyph glyph) const
{
if (isZeroWidthSpaceGlyph(glyph))
@@ -332,7 +323,6 @@ ALWAYS_INLINE float SimpleFontData::widthForGlyph(Glyph glyph) const
m_glyphToWidthMap.setMetricsForGlyph(glyph, width);
return width;
}
-#endif // HAVE(QRAWFONT)
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/WidthIterator.cpp b/Source/WebCore/platform/graphics/WidthIterator.cpp
index 8d975b7b3..b23d4c9a4 100644
--- a/Source/WebCore/platform/graphics/WidthIterator.cpp
+++ b/Source/WebCore/platform/graphics/WidthIterator.cpp
@@ -185,7 +185,8 @@ unsigned WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer)
// Account for word spacing.
// We apply additional space between "words" by adding width to the space character.
- if (treatAsSpace && textIterator.currentCharacter() && !Font::treatAsSpace(textIterator.characters()[-1]) && m_font->wordSpacing())
+ // Word-spacing affects each space (U+0020) and non-breaking space (U+00A0).
+ if ((character == noBreakSpace || character == ' ') && textIterator.currentCharacter() && m_font->wordSpacing())
width += m_font->wordSpacing();
} else
m_isAfterExpansion = false;
diff --git a/Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.cpp b/Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.cpp
index be558864e..dfcf9b998 100644
--- a/Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.cpp
+++ b/Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.cpp
@@ -28,61 +28,46 @@
namespace WebCore {
CanvasLayerWebKitThread::CanvasLayerWebKitThread(SkGpuDevice* device)
- : LayerWebKitThread(CanvasLayer, 0)
+ : EGLImageLayerWebKitThread(CanvasLayer)
{
setDevice(device);
}
CanvasLayerWebKitThread::~CanvasLayerWebKitThread()
{
- if (m_texID) {
- SharedGraphicsContext3D::get()->makeContextCurrent();
- glDeleteTextures(1, &m_texID);
- }
+ if (SharedGraphicsContext3D::get()->makeContextCurrent())
+ deleteFrontBuffer();
}
void CanvasLayerWebKitThread::setDevice(SkGpuDevice* device)
{
m_device = device;
- setLayerProgramShader(LayerProgramShaderRGBA);
setNeedsDisplay();
}
-void CanvasLayerWebKitThread::setNeedsDisplay()
-{
- m_needsDisplay = true;
- setNeedsCommit();
-}
-
void CanvasLayerWebKitThread::updateTextureContentsIfNeeded()
{
- if (!m_needsDisplay || !m_device)
+ if (!m_device)
return;
- m_needsDisplay = false;
- m_device->makeRenderTargetCurrent();
+ if (!SharedGraphicsContext3D::get()->makeContextCurrent())
+ return;
- GLint previousTexture;
- glGetIntegerv(GL_TEXTURE_BINDING_2D, &previousTexture);
+ GrRenderTarget* renderTarget = reinterpret_cast<GrRenderTarget*>(m_device->accessRenderTarget());
+ if (!renderTarget)
+ return;
- if (!m_texID) {
- glGenTextures(1, &m_texID);
- glBindTexture(GL_TEXTURE_2D, m_texID);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_device->width(), m_device->height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
+ GrTexture* texture = renderTarget->asTexture();
+ if (!texture)
+ return;
- createFrontBufferLock();
- }
+ updateFrontBuffer(IntSize(m_device->width(), m_device->height()), texture->getTextureHandle());
+}
- pthread_mutex_lock(m_frontBufferLock);
- glBindTexture(GL_TEXTURE_2D, m_texID);
- glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, m_device->width(), m_device->height(), 0);
- glFinish(); // This might be implicit in the CopyTexImage2D, but explicit Finish is required on some architectures
- glBindTexture(GL_TEXTURE_2D, previousTexture);
- pthread_mutex_unlock(m_frontBufferLock);
+void CanvasLayerWebKitThread::deleteTextures()
+{
+ if (SharedGraphicsContext3D::get()->makeContextCurrent())
+ deleteFrontBuffer();
}
}
diff --git a/Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.h b/Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.h
index eac6b8238..62e62b2e3 100644
--- a/Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.h
+++ b/Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.h
@@ -21,7 +21,7 @@
#if USE(ACCELERATED_COMPOSITING) && ENABLE(ACCELERATED_2D_CANVAS)
-#include "LayerWebKitThread.h"
+#include "EGLImageLayerWebKitThread.h"
class SkGpuDevice;
@@ -29,7 +29,7 @@ namespace WebCore {
class HTMLCanvasElement;
-class CanvasLayerWebKitThread : public LayerWebKitThread {
+class CanvasLayerWebKitThread : public EGLImageLayerWebKitThread {
public:
static PassRefPtr<CanvasLayerWebKitThread> create(SkGpuDevice* device)
{
@@ -40,18 +40,17 @@ public:
void setDevice(SkGpuDevice*);
- virtual void setNeedsDisplay();
-
protected:
virtual void updateTextureContentsIfNeeded();
+ virtual void deleteTextures();
private:
CanvasLayerWebKitThread(SkGpuDevice*);
- bool m_needsDisplay;
+
SkGpuDevice* m_device;
};
-}
+} // namespace WebCore
#endif // USE(ACCELERATED_COMPOSITING) && ENABLE(ACCELERATED_2D_CANVAS)
diff --git a/Source/WebCore/platform/graphics/blackberry/EGLImageLayerCompositingThreadClient.cpp b/Source/WebCore/platform/graphics/blackberry/EGLImageLayerCompositingThreadClient.cpp
new file mode 100644
index 000000000..e54aeada3
--- /dev/null
+++ b/Source/WebCore/platform/graphics/blackberry/EGLImageLayerCompositingThreadClient.cpp
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "EGLImageLayerCompositingThreadClient.h"
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "LayerCompositingThread.h"
+#include <BlackBerryPlatformGraphics.h>
+#include <BlackBerryPlatformLog.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+namespace WebCore {
+
+static PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES = 0;
+static PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR = 0;
+
+EGLImageLayerCompositingThreadClient::~EGLImageLayerCompositingThreadClient()
+{
+ // Someone should have called deleteTextures() by now
+ ASSERT(!m_texture && !m_image);
+}
+
+void EGLImageLayerCompositingThreadClient::uploadTexturesIfNeeded(LayerCompositingThread*)
+{
+ if (!m_imageChanged)
+ return;
+
+ if (!glEGLImageTargetTexture2DOES) {
+ glEGLImageTargetTexture2DOES = reinterpret_cast<PFNGLEGLIMAGETARGETTEXTURE2DOESPROC>(eglGetProcAddress("glEGLImageTargetTexture2DOES"));
+ ASSERT(glEGLImageTargetTexture2DOES);
+ if (!glEGLImageTargetTexture2DOES) {
+ using namespace BlackBerry::Platform;
+ logAlways(LogLevelWarn, "eglGetProcAddress for glEGLImageTargetTexture2DOES FAILED");
+ m_imageChanged = false;
+ return;
+ }
+ }
+
+ if (m_image) {
+ if (!m_texture) {
+ m_texture = Texture::create();
+ m_texture->protect();
+ }
+
+ // Connect to the new image
+ glBindTexture(GL_TEXTURE_2D, m_texture->textureId());
+ glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, m_image);
+ } else if (m_texture) {
+ m_texture->unprotect();
+ m_texture.clear();
+ }
+
+ m_imageChanged = false;
+}
+
+void EGLImageLayerCompositingThreadClient::drawTextures(LayerCompositingThread* layer, double /*scale*/, int positionLocation, int texCoordLocation)
+{
+ static float upsideDown[4 * 2] = { 0, 1, 0, 0, 1, 0, 1, 1 };
+
+ if (!m_texture)
+ return;
+
+ glVertexAttribPointer(positionLocation, 2, GL_FLOAT, GL_FALSE, 0, &layer->getTransformedBounds());
+ glVertexAttribPointer(texCoordLocation, 2, GL_FLOAT, GL_FALSE, 0, upsideDown);
+ glBindTexture(GL_TEXTURE_2D, m_texture->textureId());
+ glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+}
+
+void EGLImageLayerCompositingThreadClient::deleteTextures(LayerCompositingThread*)
+{
+ if (m_texture) {
+ m_texture->unprotect();
+ m_texture.clear();
+ }
+
+ if (!m_image)
+ return;
+
+ // If the image is still with us, it was never destroyed by the EGLImageLayerWebKitThread.
+ if (!eglDestroyImageKHR)
+ eglDestroyImageKHR = reinterpret_cast<PFNEGLDESTROYIMAGEKHRPROC>(eglGetProcAddress("eglDestroyImageKHR"));
+
+ ASSERT(eglDestroyImageKHR);
+ if (eglDestroyImageKHR)
+ eglDestroyImageKHR(BlackBerry::Platform::Graphics::eglDisplay(), m_image);
+
+ m_image = 0;
+}
+
+void EGLImageLayerCompositingThreadClient::bindContentsTexture(LayerCompositingThread*)
+{
+ glBindTexture(GL_TEXTURE_2D, m_texture->textureId());
+}
+
+void EGLImageLayerCompositingThreadClient::setImage(void* image)
+{
+ if (m_image == image)
+ return;
+
+ m_image = image;
+ m_imageChanged = true;
+}
+
+} // namespace WebCore
+
+#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebCore/platform/graphics/blackberry/EGLImageLayerCompositingThreadClient.h b/Source/WebCore/platform/graphics/blackberry/EGLImageLayerCompositingThreadClient.h
new file mode 100644
index 000000000..967c130a6
--- /dev/null
+++ b/Source/WebCore/platform/graphics/blackberry/EGLImageLayerCompositingThreadClient.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef EGLImageLayerCompositingThreadClient_h
+#define EGLImageLayerCompositingThreadClient_h
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "LayerCompositingThreadClient.h"
+#include "Texture.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+#include <wtf/ThreadSafeRefCounted.h>
+
+namespace WebCore {
+
+class LayerCompositingThread;
+
+class EGLImageLayerCompositingThreadClient : public ThreadSafeRefCounted<EGLImageLayerCompositingThreadClient>, public LayerCompositingThreadClient {
+public:
+ static PassRefPtr<EGLImageLayerCompositingThreadClient> create()
+ {
+ return adoptRef(new EGLImageLayerCompositingThreadClient());
+ }
+
+ virtual ~EGLImageLayerCompositingThreadClient();
+
+ virtual void layerCompositingThreadDestroyed(LayerCompositingThread*)
+ {
+ deref(); // Matched by ref() in constructor
+ }
+
+ virtual void layerVisibilityChanged(LayerCompositingThread*, bool visible) { }
+
+ virtual void uploadTexturesIfNeeded(LayerCompositingThread*);
+ virtual void drawTextures(LayerCompositingThread*, double scale, int positionLocation, int texCoordLocation);
+ virtual void deleteTextures(LayerCompositingThread*);
+
+ virtual void bindContentsTexture(LayerCompositingThread*);
+
+ // The image must not be deleted while in our custody, however after changing image you are free to delete the old one.
+ void setImage(void*);
+
+private:
+ EGLImageLayerCompositingThreadClient()
+ : m_image(0)
+ , m_imageChanged(false)
+ {
+ ref(); // Matched by deref() in layerCompositingThreadDestroyed()
+ }
+
+ void* m_image;
+ bool m_imageChanged;
+ RefPtr<Texture> m_texture;
+};
+
+} // namespace WebCore
+
+#endif // USE(ACCELERATED_COMPOSITING)
+
+#endif // EGLImageLayerCompositingThreadClient_h
diff --git a/Source/WebCore/platform/graphics/blackberry/EGLImageLayerWebKitThread.cpp b/Source/WebCore/platform/graphics/blackberry/EGLImageLayerWebKitThread.cpp
new file mode 100644
index 000000000..34b5037fa
--- /dev/null
+++ b/Source/WebCore/platform/graphics/blackberry/EGLImageLayerWebKitThread.cpp
@@ -0,0 +1,295 @@
+/*
+ * Copyright (C) 2010, 2011, 2012 Research In Motion Limited. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "EGLImageLayerWebKitThread.h"
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "LayerCompositingThread.h"
+#include "LayerRenderer.h"
+#include "SharedGraphicsContext3D.h"
+#include <BlackBerryPlatformGLES2ContextState.h>
+#include <BlackBerryPlatformGraphics.h>
+#include <BlackBerryPlatformLog.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+#include <GLES2/gl2.h>
+
+using BlackBerry::Platform::Graphics::GLES2Program;
+using BlackBerry::Platform::Graphics::GLES2ContextState;
+
+namespace WebCore {
+
+static PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR = 0;
+static PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR = 0;
+
+EGLImageLayerWebKitThread::EGLImageLayerWebKitThread(LayerType type)
+ : LayerWebKitThread(type, 0)
+ , m_client(EGLImageLayerCompositingThreadClient::create())
+ , m_needsDisplay(false)
+ , m_frontBufferTexture(0)
+ , m_fbo(0)
+ , m_shader(0)
+ , m_image(0)
+{
+ layerCompositingThread()->setClient(m_client.get());
+ setLayerProgramShader(LayerProgramShaderRGBA);
+}
+
+EGLImageLayerWebKitThread::~EGLImageLayerWebKitThread()
+{
+ // The subclass is responsible for calling deleteFrontBuffer()
+ // before we get this far.
+ ASSERT(!m_frontBufferTexture);
+ ASSERT(!m_fbo);
+ ASSERT(!m_shader);
+ ASSERT(!m_image);
+}
+
+void EGLImageLayerWebKitThread::setNeedsDisplay()
+{
+ m_needsDisplay = true;
+ setNeedsCommit();
+}
+
+void EGLImageLayerWebKitThread::updateFrontBuffer(const IntSize& size, unsigned backBufferTexture)
+{
+ if (!m_needsDisplay)
+ return;
+
+ if (size.isEmpty()) {
+ if (size != m_size) {
+ deleteFrontBuffer();
+ if (m_image)
+ m_garbage.append(m_image);
+ m_image = 0;
+ m_size = size;
+ }
+
+ m_needsDisplay = false;
+ return;
+ }
+
+ if (!eglCreateImageKHR) {
+ eglCreateImageKHR = reinterpret_cast<PFNEGLCREATEIMAGEKHRPROC>(eglGetProcAddress("eglCreateImageKHR"));
+ eglDestroyImageKHR = reinterpret_cast<PFNEGLDESTROYIMAGEKHRPROC>(eglGetProcAddress("eglDestroyImageKHR"));
+ }
+
+ ASSERT(eglCreateImageKHR && eglDestroyImageKHR);
+ if (!eglCreateImageKHR || !eglDestroyImageKHR) {
+ using namespace BlackBerry::Platform;
+ logAlways(LogLevelWarn, "eglGetProcAddress for eglCreate/DestroyImageKHR FAILED");
+ m_needsDisplay = false;
+ return;
+ }
+
+ GLenum currentActiveTexture = 0;
+ glGetIntegerv(GL_ACTIVE_TEXTURE, reinterpret_cast<GLint*>(&currentActiveTexture));
+ glActiveTexture(GL_TEXTURE0);
+
+ {
+ GLES2ContextState::TextureAndFBOStateSaver textureAndFBOStateSaver;
+
+ if (!createImageIfNeeded(size))
+ return;
+
+ m_needsDisplay = false;
+
+ blitToFrontBuffer(backBufferTexture);
+ }
+
+ glActiveTexture(currentActiveTexture);
+}
+
+void EGLImageLayerWebKitThread::deleteFrontBuffer()
+{
+ glDeleteTextures(1, &m_frontBufferTexture);
+ m_frontBufferTexture = 0;
+ glDeleteFramebuffers(1, &m_fbo);
+ m_fbo = 0;
+ glDeleteShader(m_shader);
+ m_shader = 0;
+
+ // The image is in our EGLImageLayerCompositingThreadClient's custody
+ // at this point, and that object is responsible for deleting it.
+ m_image = 0;
+
+ // If anyone tries to render us after this, we're certainly going to need display.
+ m_needsDisplay = true;
+}
+
+void EGLImageLayerWebKitThread::commitPendingTextureUploads()
+{
+ // This call is serialized with the compositing thread, so it's safe to update the
+ // image and destroy any old images.
+
+ m_client->setImage(m_image);
+
+ // Destroy the garbage images in a thread-safe way
+ for (size_t i = 0; i < m_garbage.size(); ++i)
+ eglDestroyImageKHR(BlackBerry::Platform::Graphics::eglDisplay(), m_garbage[i]);
+}
+
+bool EGLImageLayerWebKitThread::createImageIfNeeded(const IntSize& size)
+{
+ // We use a texture rather than a renderbuffer as the basis of the FBO and EGLImage,
+ // since the EGLImage will be used as a texture on the compositing thread in the end.
+
+ if (!m_frontBufferTexture) {
+ glGenTextures(1, &m_frontBufferTexture);
+ glBindTexture(GL_TEXTURE_2D, m_frontBufferTexture);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ }
+
+ if (!m_fbo)
+ glGenFramebuffers(1, &m_fbo);
+
+ if (!m_image || size != m_size) {
+ IntSize fboSize = size;
+
+ // Imagination-specific fix
+ static bool isImaginationHardware = std::strstr(reinterpret_cast<const char*>(glGetString(GL_RENDERER)), "PowerVR SGX");
+ if (isImaginationHardware)
+ fboSize = fboSize.expandedTo(IntSize(16, 16));
+
+ glBindTexture(GL_TEXTURE_2D, m_frontBufferTexture);
+ glBindFramebuffer(GL_FRAMEBUFFER, m_fbo);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, fboSize.width(), fboSize.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_frontBufferTexture, 0);
+
+ if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
+ return false;
+ if (glGetError() != GL_NO_ERROR)
+ return false;
+
+ // The sibling is orphaned after glTexImage2D, recreate the image.
+ if (m_image)
+ m_garbage.append(m_image);
+ m_image = eglCreateImageKHR(BlackBerry::Platform::Graphics::eglDisplay(), eglGetCurrentContext(),
+ EGL_GL_TEXTURE_2D_KHR, (EGLClientBuffer)m_frontBufferTexture, 0);
+ if (!m_image)
+ return false;
+
+ m_size = size;
+ }
+
+ return true;
+}
+
+void EGLImageLayerWebKitThread::createShaderIfNeeded()
+{
+ // Shaders for drawing the layer contents.
+ static char vertexShaderString[] =
+ "attribute vec4 a_position; \n"
+ "attribute vec2 a_texCoord; \n"
+ "varying vec2 v_texCoord; \n"
+ "void main() \n"
+ "{ \n"
+ " gl_Position = a_position; \n"
+ " v_texCoord = a_texCoord; \n"
+ "} \n";
+
+ static char fragmentShaderStringRGBA[] =
+ "varying mediump vec2 v_texCoord; \n"
+ "uniform lowp sampler2D s_texture; \n"
+ "void main() \n"
+ "{ \n"
+ " gl_FragColor = texture2D(s_texture, v_texCoord); \n"
+ "} \n";
+
+ if (!m_shader) {
+ m_shader = LayerRenderer::loadShaderProgram(vertexShaderString, fragmentShaderStringRGBA);
+ if (!m_shader)
+ return;
+ glBindAttribLocation(m_shader, GLES2Program::PositionAttributeIndex, "a_position");
+ glBindAttribLocation(m_shader, GLES2Program::TexCoordAttributeIndex, "a_texCoord");
+ glLinkProgram(m_shader);
+ unsigned samplerLocation = glGetUniformLocation(m_shader, "s_texture");
+ glUseProgram(m_shader);
+ glUniform1i(samplerLocation, 0);
+ }
+}
+
+void EGLImageLayerWebKitThread::blitToFrontBuffer(unsigned backBufferTexture)
+{
+ if (!backBufferTexture)
+ return;
+
+ GLuint currentProgram = 0;
+ glGetIntegerv(GL_CURRENT_PROGRAM, reinterpret_cast<GLint*>(&currentProgram));
+
+ createShaderIfNeeded();
+
+ GLuint currentArrayBufferBinding = 0, currentElementArrayBufferBinding = 0;
+ GLint currentViewport[4] = { 0, 0, 0, 0 };
+ glGetIntegerv(GL_ARRAY_BUFFER_BINDING, reinterpret_cast<GLint*>(&currentArrayBufferBinding));
+ glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, reinterpret_cast<GLint*>(&currentElementArrayBufferBinding));
+ glGetIntegerv(GL_VIEWPORT, &currentViewport[0]);
+
+ GLES2ContextState::GlobalFlagStateSaver flagStateSaver(GLES2ContextState::GlobalFlagState::DontRestoreBlendFunc);
+
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_STENCIL_TEST);
+ glDisable(GL_SCISSOR_TEST);
+ glDisable(GL_CULL_FACE);
+ glDisable(GL_BLEND);
+
+ glViewport(0, 0, m_size.width(), m_size.height());
+ glBindFramebuffer(GL_FRAMEBUFFER, m_fbo);
+ glUseProgram(m_shader);
+ glBindTexture(GL_TEXTURE_2D, backBufferTexture);
+
+ {
+ GLES2ContextState::VertexAttributeStateSaver vertexAttribStateSaver;
+
+ static float texcoords[4 * 2] = { 0, 0, 0, 1, 1, 1, 1, 0 };
+ static float vertices[] = { -1, -1, -1, 1, 1, 1, 1, -1 };
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
+ glEnableVertexAttribArray(GLES2Program::PositionAttributeIndex);
+ glEnableVertexAttribArray(GLES2Program::TexCoordAttributeIndex);
+ glVertexAttribPointer(GLES2Program::PositionAttributeIndex, 2, GL_FLOAT, GL_FALSE, 0, vertices);
+ glVertexAttribPointer(GLES2Program::TexCoordAttributeIndex, 2, GL_FLOAT, GL_FALSE, 0, texcoords);
+ glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+
+ // If we don't flush, the EGLImage may never update its appearance
+ glFlush();
+
+ glDisableVertexAttribArray(GLES2Program::PositionAttributeIndex);
+ glDisableVertexAttribArray(GLES2Program::TexCoordAttributeIndex);
+
+ glBindBuffer(GL_ARRAY_BUFFER, currentArrayBufferBinding);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, currentElementArrayBufferBinding);
+ }
+
+ // The previous program might have been deleted by refcount destruction
+ // with another one now in use. Don't try to restore it later.
+ if (currentProgram && !glIsProgram(currentProgram))
+ currentProgram = 0;
+
+ glUseProgram(currentProgram);
+ glViewport(currentViewport[0], currentViewport[1], currentViewport[2], currentViewport[3]);
+}
+
+}
+
+#endif // USE(ACCELERATED_COMPOSITING) && ENABLE(ACCELERATED_2D_CANVAS)
diff --git a/Source/WebCore/platform/graphics/blackberry/EGLImageLayerWebKitThread.h b/Source/WebCore/platform/graphics/blackberry/EGLImageLayerWebKitThread.h
new file mode 100644
index 000000000..f2561fca4
--- /dev/null
+++ b/Source/WebCore/platform/graphics/blackberry/EGLImageLayerWebKitThread.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2010, 2011, 2012 Research In Motion Limited. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef EGLImageLayerWebKitThread_h
+#define EGLImageLayerWebKitThread_h
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "EGLImageLayerCompositingThreadClient.h"
+#include "LayerWebKitThread.h"
+
+namespace WebCore {
+
+// Base class for EGLImage based layers
+// The subclass must reimplement updateTextureContentsIfNeeded() to call updateFrontBuffer
+// with the appropriate parameters, and make sure to call deleteFrontBuffer() from its
+// destructor.
+class EGLImageLayerWebKitThread : public LayerWebKitThread {
+public:
+ virtual ~EGLImageLayerWebKitThread();
+
+ virtual void setNeedsDisplay();
+
+protected:
+ EGLImageLayerWebKitThread(LayerType);
+
+ virtual void updateTextureContentsIfNeeded() = 0;
+ virtual void commitPendingTextureUploads();
+ virtual void deleteTextures() = 0;
+
+ // The context must be current before you call any of these
+ void updateFrontBuffer(const IntSize&, unsigned backBufferTexture);
+ void deleteFrontBuffer();
+
+private:
+ bool createImageIfNeeded(const IntSize&);
+ void createShaderIfNeeded();
+ void blitToFrontBuffer(unsigned backBufferTexture);
+
+ RefPtr<EGLImageLayerCompositingThreadClient> m_client;
+ bool m_needsDisplay;
+ unsigned m_frontBufferTexture;
+ unsigned m_fbo;
+ unsigned m_shader;
+ void* m_image;
+ Vector<void*> m_garbage;
+ IntSize m_size;
+};
+
+}
+
+#endif // USE(ACCELERATED_COMPOSITING)
+
+#endif // EGLImageLayerWebKitThread_h
diff --git a/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp b/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp
index 234e68f5d..f1081ef76 100644
--- a/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp
+++ b/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp
@@ -133,6 +133,18 @@ GraphicsContext3D::~GraphicsContext3D()
BlackBerry::Platform::Graphics::destroyWebGLContext(m_context);
}
+void GraphicsContext3D::prepareTexture()
+{
+ if (m_layerComposited)
+ return;
+
+ makeContextCurrent();
+ if (m_attrs.antialias)
+ resolveMultisamplingIfNecessary();
+
+ m_layerComposited = true;
+}
+
bool GraphicsContext3D::reshapeFBOs(const IntSize& size)
{
// A BlackBerry-specific implementation of reshapeFBOs is necessary because it contains:
@@ -344,7 +356,7 @@ bool GraphicsContext3D::isErrorGeneratedOnOutOfBoundsAccesses() const
Platform3DObject GraphicsContext3D::platformTexture() const
{
- return m_compositingLayer->getTextureID();
+ return m_texture;
}
PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D() const
diff --git a/Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp b/Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp
index fbfef2076..545f30fa0 100644
--- a/Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp
+++ b/Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp
@@ -53,6 +53,10 @@
#include "LayerWebKitThread.h"
#include "NotImplemented.h"
+#if DEBUG_LAYER_ANIMATION
+#include <wtf/text/CString.h>
+#endif
+
namespace WebCore {
static void setLayerBorderColor(LayerWebKitThread& layer, const Color& color)
@@ -105,6 +109,8 @@ void GraphicsLayerBlackBerry::willBeDestroyed()
m_contentsLayer->setOwner(0);
if (m_transformLayer)
m_transformLayer->setOwner(0);
+
+ GraphicsLayer::willBeDestroyed();
}
void GraphicsLayerBlackBerry::setName(const String& inName)
@@ -444,7 +450,7 @@ bool GraphicsLayerBlackBerry::addAnimation(const KeyframeValueList& values, cons
RefPtr<LayerAnimation> layerAnimation = LayerAnimation::create(values, boxSize, animation, animationName, timeOffset);
#if DEBUG_LAYER_ANIMATION
- fprintf(stderr, "LayerAnimation 0x%08x: Adding animation %s for property %d\n", layerAnimation.get(), animationName.latin1().data(), values.property());
+ fprintf(stderr, "LayerAnimation 0x%08x: Adding animation %s for property %d\n", (int)layerAnimation.get(), animationName.latin1().data(), values.property());
#endif
m_runningAnimations.append(layerAnimation);
@@ -460,7 +466,7 @@ void GraphicsLayerBlackBerry::pauseAnimation(const String& animationName, double
while (RefPtr<LayerAnimation> animation = removeAnimationByName(animationName, m_runningAnimations)) {
#if DEBUG_LAYER_ANIMATION
- fprintf(stderr, "LayerAnimation 0x%08x: Pausing animation %s\n", animation.get(), animation->name().latin1().data());
+ fprintf(stderr, "LayerAnimation 0x%08x: Pausing animation %s\n", (int)animation.get(), animation->name().latin1().data());
#endif
// LayerAnimation is readonly. Create a new animation with the same data except for timeOffset.
@@ -473,7 +479,7 @@ void GraphicsLayerBlackBerry::pauseAnimation(const String& animationName, double
m_suspendedAnimations.append(animation);
#if DEBUG_LAYER_ANIMATION
- fprintf(stderr, "LayerAnimation 0x%08x: Paused animation %s\n", animation.get(), animation->name().latin1().data());
+ fprintf(stderr, "LayerAnimation 0x%08x: Paused animation %s\n", (int)animation.get(), animation->name().latin1().data());
#endif
};
diff --git a/Source/WebCore/platform/graphics/blackberry/InstrumentedPlatformCanvas.h b/Source/WebCore/platform/graphics/blackberry/InstrumentedPlatformCanvas.h
index 927b5990d..94a16cbc9 100644
--- a/Source/WebCore/platform/graphics/blackberry/InstrumentedPlatformCanvas.h
+++ b/Source/WebCore/platform/graphics/blackberry/InstrumentedPlatformCanvas.h
@@ -36,12 +36,12 @@ namespace WebCore {
class InstrumentedPlatformCanvas : public SkCanvas {
public:
- InstrumentedPlatformCanvas(int width, int height)
- : m_size(width, height)
+ InstrumentedPlatformCanvas(const SkBitmap& bitmap)
+ : m_size(bitmap.width(), bitmap.height())
, m_isSolidColor(true)
, m_solidColor(0, 0, 0, 0)
{
- setDevice(new SkDevice(SkBitmap::kARGB_8888_Config, width, height))->unref();
+ setDevice(new SkDevice(bitmap))->unref();
}
virtual ~InstrumentedPlatformCanvas() { }
diff --git a/Source/WebCore/platform/graphics/blackberry/LayerAnimation.h b/Source/WebCore/platform/graphics/blackberry/LayerAnimation.h
index c486fe58d..2c61b213e 100644
--- a/Source/WebCore/platform/graphics/blackberry/LayerAnimation.h
+++ b/Source/WebCore/platform/graphics/blackberry/LayerAnimation.h
@@ -34,17 +34,8 @@ class Animation;
class LayerCompositingThread;
class TransformationMatrix;
-// This class uses non-threadsafe refcounting in the WebCore::Animation and
-// WebCore::String members, so using threadsafe refcounting here would be a big
-// cover-up. Instead, you must be careful to use ref/deref this class only on
-// the WebKit thread, or when the WebKit and compositing threads are in sync.
-class LayerAnimation : public RefCounted<LayerAnimation> {
+class LayerAnimation : public ThreadSafeRefCounted<LayerAnimation> {
public:
- // WebKit thread only
- // Because the refcounting done in constructor and destructor is not thread safe,
- // the LayerAnimation must be created or destroyed on the WebKit thread, or when
- // the WebKit and compositing threads are in sync.
- // Also, the name property is using a String which has non-threadsafe refcounting.
// The setStartTime method is not threadsafe and must only be called on a newly
// created LayerAnimation before sending it off to the compositing thread.
static PassRefPtr<LayerAnimation> create(const KeyframeValueList& values, const IntSize& boxSize, const Animation* animation, const String& name, double timeOffset)
@@ -65,7 +56,13 @@ public:
{
}
- const String& name() const { return m_name; }
+ String name() const
+ {
+ if (m_name.isEmpty())
+ return String("");
+ return String(m_name);
+ }
+
void setStartTime(double time) { m_startTime = time; }
// These functions are thread safe (immutable state).
@@ -77,14 +74,10 @@ public:
double timeOffset() const { return m_timeOffset; }
double startTime() const { return m_startTime; }
size_t valueCount() const { return m_values.size(); }
-
- // NOTE: Don't try to ref a TimingFunction, that's not a threadsafe operation.
const TimingFunction* timingFunction() const { return m_timingFunction.get(); }
double duration() const { return m_duration; }
int iterationCount() const { return m_iterationCount; }
Animation::AnimationDirection direction() const { return m_direction; }
-
- // NOTE: Don't try to clone() an AnimationValue, that's not a threadsafe operation since it mutates refcounts.
const AnimationValue* valueAt(size_t i) const { return m_values.at(i); }
bool finished() const { return m_finished; }
@@ -97,7 +90,6 @@ private:
: m_id(reinterpret_cast<int>(animation))
, m_values(values)
, m_boxSize(boxSize)
- , m_name(name)
, m_timeOffset(timeOffset)
, m_startTime(0)
, m_timingFunction(0)
@@ -110,14 +102,14 @@ private:
m_timingFunction = animation->timingFunction();
validateTransformLists();
+ setName(name);
}
LayerAnimation(const LayerAnimation& other)
- : RefCounted<LayerAnimation>()
+ : ThreadSafeRefCounted<LayerAnimation>()
, m_id(other.m_id)
, m_values(other.m_values)
, m_boxSize(other.m_boxSize)
- , m_name(other.m_name)
, m_timeOffset(other.m_timeOffset)
, m_startTime(other.m_startTime)
, m_transformFunctionListValid(other.m_transformFunctionListValid)
@@ -127,17 +119,26 @@ private:
, m_direction(other.m_direction)
, m_finished(false)
{
+ setName(other.name());
}
void validateTransformLists();
+ void setName(const String& name)
+ {
+ unsigned length = name.length();
+ m_name.resize(length);
+ if (length)
+ memcpy(m_name.data(), name.characters(), sizeof(UChar) * length);
+ }
+
int m_id;
// NOTE: Don't expose the KeyframeValueList directly, since its copy
// constructor mutates refcounts and thus is not thread safe.
KeyframeValueList m_values;
IntSize m_boxSize;
- String m_name;
+ Vector<UChar> m_name; // Must not use String member when deriving from ThreadSafeRefCounted
double m_timeOffset;
double m_startTime;
bool m_transformFunctionListValid;
diff --git a/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.cpp b/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.cpp
index cef2e5d7b..8f3a2bb56 100644
--- a/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.cpp
+++ b/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.cpp
@@ -249,33 +249,6 @@ void LayerCompositingThread::drawTextures(double scale, int positionLocation, in
return;
}
#endif
-#if ENABLE(WEBGL)
- if (layerType() == LayerData::WebGLLayer) {
- m_layerRenderer->addLayerToReleaseTextureResourcesList(this);
- pthread_mutex_lock(m_frontBufferLock);
- glVertexAttribPointer(positionLocation, 2, GL_FLOAT, GL_FALSE, 0, &m_transformedBounds);
- float canvasWidthRatio = 1.0f;
- float canvasHeightRatio = 1.0f;
- float upsideDown[4 * 2] = { 0, 1, 0, 1 - canvasHeightRatio, canvasWidthRatio, 1 - canvasHeightRatio, canvasWidthRatio, 1 };
- // Flip the texture Y axis because OpenGL and Skia have different origins
- glVertexAttribPointer(texCoordLocation, 2, GL_FLOAT, GL_FALSE, 0, upsideDown);
- glBindTexture(GL_TEXTURE_2D, m_texID);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- // FIXME: If the canvas/texture is larger than 2048x2048, then we'll die here
- return;
- }
-#endif
- if (m_texID) {
- m_layerRenderer->addLayerToReleaseTextureResourcesList(this);
- pthread_mutex_lock(m_frontBufferLock);
-
- glBindTexture(GL_TEXTURE_2D, m_texID);
- glVertexAttribPointer(positionLocation, 2, GL_FLOAT, GL_FALSE, 0, &m_transformedBounds);
- float upsideDown[4 * 2] = { 0, 1, 0, 0, 1, 0, 1, 1 };
- glVertexAttribPointer(texCoordLocation, 2, GL_FLOAT, GL_FALSE, 0, upsideDown);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- return;
- }
if (m_client)
m_client->drawTextures(this, scale, positionLocation, texCoordLocation);
@@ -325,8 +298,6 @@ void LayerCompositingThread::releaseTextureResources()
m_pluginBuffer = 0;
m_pluginView->unlockFrontBuffer();
}
- if (m_frontBufferLock && (m_texID || layerType() == LayerData::WebGLLayer))
- pthread_mutex_unlock(m_frontBufferLock);
}
void LayerCompositingThread::setPluginView(PluginView* pluginView)
@@ -357,21 +328,6 @@ void LayerCompositingThread::setMediaPlayer(MediaPlayer* mediaPlayer)
}
#endif
-void LayerCompositingThread::clearAnimations()
-{
- // Animations don't use thread safe refcounting, and must only be
- // touched when the two threads are in sync.
- if (!isCompositingThread()) {
- dispatchSyncCompositingMessage(BlackBerry::Platform::createMethodCallMessage(
- &LayerCompositingThread::clearAnimations,
- this));
- return;
- }
-
- m_runningAnimations.clear();
- m_suspendedAnimations.clear();
-}
-
void LayerCompositingThread::removeSublayer(LayerCompositingThread* sublayer)
{
ASSERT(isCompositingThread());
diff --git a/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.h b/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.h
index b7223b14d..fed7ebae5 100644
--- a/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.h
+++ b/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.h
@@ -73,7 +73,7 @@ public:
bool isBoundsSet() const { return m_boundsSet; }
IntSize bounds() const { return m_bounds; }
- void setBounds(const IntSize&) { m_bounds = bounds; m_boundsSet = true; }
+ void setBounds(const IntSize& bounds) { m_bounds = bounds; m_boundsSet = true; }
bool isTransformSet() const { return m_transformSet; }
const TransformationMatrix& transform() const { return m_transform; }
@@ -81,7 +81,7 @@ public:
bool isOpacitySet() const { return m_opacitySet; }
float opacity() const { return m_opacity; }
- void setOpacity(float) { m_opacity = opacity; m_opacitySet = true; }
+ void setOpacity(float opacity) { m_opacity = opacity; m_opacitySet = true; }
bool isBoundsOriginSet() const { return m_boundsOriginSet; }
FloatPoint boundsOrigin() const { return m_boundsOrigin; }
@@ -126,12 +126,13 @@ class LayerCompositingThread : public ThreadSafeRefCounted<LayerCompositingThrea
public:
static PassRefPtr<LayerCompositingThread> create(LayerType, LayerCompositingThreadClient*);
+ void setClient(LayerCompositingThreadClient* client) { m_client = client; }
+
// Thread safe
void setPluginView(PluginView*);
#if ENABLE(VIDEO)
void setMediaPlayer(MediaPlayer*);
#endif
- void clearAnimations();
// Not thread safe
diff --git a/Source/WebCore/platform/graphics/blackberry/LayerData.h b/Source/WebCore/platform/graphics/blackberry/LayerData.h
index 4eb11e31f..de4b51fd1 100644
--- a/Source/WebCore/platform/graphics/blackberry/LayerData.h
+++ b/Source/WebCore/platform/graphics/blackberry/LayerData.h
@@ -92,8 +92,6 @@ public:
#if ENABLE(VIDEO)
, m_mediaPlayer(0)
#endif
- , m_texID(0)
- , m_frontBufferLock(0)
, m_suspendTime(0)
, m_doubleSided(true)
, m_masksToBounds(false)
@@ -152,9 +150,6 @@ public:
bool preserves3D() const { return m_preserves3D; }
- unsigned getTextureID() const { return m_texID; }
- void setTextureID(unsigned int value) { m_texID = value; }
-
bool needsTexture() const { return m_layerType == WebGLLayer || m_layerType == CanvasLayer || m_needsTexture; }
LayerProgramShader layerProgramShader() const { return m_layerProgramShader; }
@@ -219,10 +214,6 @@ protected:
#endif
IntRect m_holePunchRect;
- unsigned m_texID;
-
- pthread_mutex_t* m_frontBufferLock;
-
double m_suspendTime;
unsigned m_doubleSided : 1;
diff --git a/Source/WebCore/platform/graphics/blackberry/LayerFilterRenderer.cpp b/Source/WebCore/platform/graphics/blackberry/LayerFilterRenderer.cpp
index 8797c10f3..3da499ffa 100644
--- a/Source/WebCore/platform/graphics/blackberry/LayerFilterRenderer.cpp
+++ b/Source/WebCore/platform/graphics/blackberry/LayerFilterRenderer.cpp
@@ -133,7 +133,7 @@ PassRefPtr<LayerFilterRendererAction> LayerFilterRendererAction::create(int prog
}
LayerFilterRendererAction::LayerFilterRendererAction(int c_programId)
- , m_programId(c_programId)
+ : m_programId(c_programId)
, m_pushSnapshot(false)
, m_popSnapshot(false)
{
diff --git a/Source/WebCore/platform/graphics/blackberry/LayerFilterRenderer.h b/Source/WebCore/platform/graphics/blackberry/LayerFilterRenderer.h
index 1c1f06e03..7ca93e470 100644
--- a/Source/WebCore/platform/graphics/blackberry/LayerFilterRenderer.h
+++ b/Source/WebCore/platform/graphics/blackberry/LayerFilterRenderer.h
@@ -95,7 +95,6 @@ public:
static PassRefPtr<LayerFilterRendererAction> create(int programId);
// A vector of actions must have an even count, so if you have an odd count, add a passthrough event at the end.
// See the ping-pong note in LayerFilterRenderer::applyActions.
- ~LayerFilterRendererAction();
bool shouldPushSnapshot() const { return m_pushSnapshot; }
void setPushSnapshot() { m_pushSnapshot = true; }
diff --git a/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.cpp b/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.cpp
index e9d3dff42..4545cab17 100644
--- a/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.cpp
+++ b/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.cpp
@@ -76,11 +76,6 @@ LayerWebKitThread::LayerWebKitThread(LayerType type, GraphicsLayerBlackBerry* ow
LayerWebKitThread::~LayerWebKitThread()
{
- m_layerCompositingThread->clearAnimations();
-
- if (m_frontBufferLock)
- pthread_mutex_destroy(m_frontBufferLock);
-
if (m_tiler)
m_tiler->layerWebKitThreadDestroyed();
@@ -115,7 +110,14 @@ SkBitmap LayerWebKitThread::paintContents(const IntRect& contentsRect, double sc
if (drawsContent()) { // Layer contents must be drawn into a canvas.
IntRect untransformedContentsRect = contentsRect;
- canvas = adoptPtr(new InstrumentedPlatformCanvas(contentsRect.width(), contentsRect.height()));
+ SkBitmap canvasBitmap;
+ canvasBitmap.setConfig(SkBitmap::kARGB_8888_Config, contentsRect.width(), contentsRect.height());
+ if (!canvasBitmap.allocPixels())
+ return SkBitmap();
+ canvasBitmap.setIsOpaque(false);
+ canvasBitmap.eraseColor(0);
+
+ canvas = adoptPtr(new InstrumentedPlatformCanvas(canvasBitmap));
PlatformContextSkia skiaContext(canvas.get());
GraphicsContext graphicsContext(&skiaContext);
@@ -164,18 +166,16 @@ bool LayerWebKitThread::contentsVisible(const IntRect& contentsRect) const
return m_owner->contentsVisible(contentsRect);
}
-void LayerWebKitThread::createFrontBufferLock()
+void LayerWebKitThread::updateTextureContentsIfNeeded()
{
- pthread_mutexattr_t mutexAttributes;
- pthread_mutexattr_init(&mutexAttributes);
- m_frontBufferLock = new pthread_mutex_t;
- pthread_mutex_init(m_frontBufferLock, &mutexAttributes);
+ if (m_tiler)
+ m_tiler->updateTextureContentsIfNeeded(m_isMask ? 1.0 : contentsScale());
}
-void LayerWebKitThread::updateTextureContentsIfNeeded()
+void LayerWebKitThread::commitPendingTextureUploads()
{
if (m_tiler)
- m_tiler->updateTextureContentsIfNeeded(m_isMask ? 1.0 : contentsScale());
+ m_tiler->commitPendingTextureUploads();
}
void LayerWebKitThread::setContents(Image* contents)
@@ -199,7 +199,7 @@ void LayerWebKitThread::setDrawable(bool isDrawable)
m_isDrawable = isDrawable;
- setNeedsTexture(m_isDrawable && (drawsContent() || contents() || pluginView() || mediaPlayer() || m_texID));
+ setNeedsTexture(m_isDrawable && (drawsContent() || contents() || pluginView() || mediaPlayer()));
setNeedsCommit();
}
@@ -304,8 +304,7 @@ void LayerWebKitThread::commitOnCompositingThread()
}
m_position = oldPosition;
updateLayerHierarchy();
- if (m_tiler)
- m_tiler->commitPendingTextureUploads();
+ commitPendingTextureUploads();
size_t listSize = m_sublayers.size();
for (size_t i = 0; i < listSize; i++)
@@ -518,6 +517,21 @@ void LayerWebKitThread::setSuspendedAnimations(const Vector<RefPtr<LayerAnimatio
setNeedsCommit();
}
+void LayerWebKitThread::releaseLayerResources()
+{
+ deleteTextures();
+
+ size_t listSize = m_sublayers.size();
+ for (size_t i = 0; i < listSize; i++)
+ m_sublayers[i]->releaseLayerResources();
+
+ if (maskLayer())
+ maskLayer()->releaseLayerResources();
+
+ if (replicaLayer())
+ replicaLayer()->releaseLayerResources();
+}
+
}
#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.h b/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.h
index 564942da4..99ff1a3f6 100644
--- a/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.h
+++ b/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.h
@@ -133,6 +133,8 @@ public:
Image* contents() const { return m_contents.get(); }
void setOwner(GraphicsLayerBlackBerry* owner) { m_owner = owner; }
+ // NOTE: Can be 0.
+ GraphicsLayerBlackBerry* owner() const { return m_owner; }
bool drawsContent() const { return m_owner && m_owner->drawsContent(); }
void setDrawable(bool);
@@ -158,12 +160,13 @@ public:
// Allows you to clear the LayerCompositingThread::overrides from the WK thread
void clearOverride() { m_clearOverrideOnCommit = true; setNeedsCommit(); }
+ void releaseLayerResources();
+
protected:
LayerWebKitThread(LayerType, GraphicsLayerBlackBerry* owner);
void setNeedsTexture(bool needsTexture) { m_needsTexture = needsTexture; }
void setLayerProgramShader(LayerData::LayerProgramShader shader) { m_layerProgramShader = shader; }
- void createFrontBufferLock();
bool isDrawable() const { return m_isDrawable; }
void startAnimations(double time);
@@ -172,6 +175,8 @@ protected:
virtual void boundsChanged() { }
virtual void updateTextureContentsIfNeeded();
+ virtual void commitPendingTextureUploads();
+ virtual void deleteTextures() { }
private:
void updateLayerHierarchy();
diff --git a/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp b/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp
index 27fdf6491..dc445a51a 100644
--- a/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp
+++ b/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp
@@ -66,7 +66,7 @@ void MediaPlayerPrivate::registerMediaEngine(MediaEngineRegistrar registrar)
void MediaPlayerPrivate::getSupportedTypes(HashSet<String>& types)
{
- set<string> supported = MMRPlayer::allSupportedMimeTypes();
+ set<string> supported = PlatformPlayer::allSupportedMimeTypes();
set<string>::iterator i = supported.begin();
for (; i != supported.end(); i++)
types.add(i->c_str());
@@ -80,7 +80,7 @@ MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String& type, c
}
// spec says we should not return "probably" if the codecs string is empty
- if (MMRPlayer::mimeTypeSupported(type.ascii().data())) {
+ if (PlatformPlayer::mimeTypeSupported(type.ascii().data())) {
LOG(Media, "MediaPlayer supports type; cache contains type '%s'.", type.ascii().data());
return codecs.isEmpty() ? MediaPlayer::MayBeSupported : MediaPlayer::IsSupported;
}
@@ -90,16 +90,17 @@ MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String& type, c
void MediaPlayerPrivate::notifyAppActivatedEvent(bool activated)
{
- MMRPlayer::notifyAppActivatedEvent(activated);
+ PlatformPlayer::notifyAppActivatedEvent(activated);
}
void MediaPlayerPrivate::setCertificatePath(const String& caPath)
{
- MMRPlayer::setCertificatePath(string(caPath.utf8().data()));
+ PlatformPlayer::setCertificatePath(string(caPath.utf8().data()));
}
MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player)
: m_webCorePlayer(player)
+ , m_platformPlayer(0)
, m_networkState(MediaPlayer::Empty)
, m_readyState(MediaPlayer::HaveNothing)
, m_fullscreenWebPageClient(0)
@@ -114,14 +115,6 @@ MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player)
, m_waitMetadataTimer(this, &MediaPlayerPrivate::waitMetadataTimerFired)
, m_waitMetadataPopDialogCounter(0)
{
- void* tabId = 0;
- if (frameView() && frameView()->hostWindow())
- tabId = frameView()->hostWindow()->platformPageClient();
-#if USE(ACCELERATED_COMPOSITING)
- m_platformPlayer = new MMRPlayer(this, tabId, true);
-#else
- m_platformPlayer = new MMRPlayer(this, tabId, false);
-#endif
}
MediaPlayerPrivate::~MediaPlayerPrivate()
@@ -156,33 +149,48 @@ void MediaPlayerPrivate::load(const String& url)
modifiedUrl = decodeURLEscapeSequences(modifiedUrl);
}
+ void* tabId = 0;
+ if (frameView() && frameView()->hostWindow())
+ tabId = frameView()->hostWindow()->platformPageClient();
+
+ deleteGuardedObject(m_platformPlayer);
+#if USE(ACCELERATED_COMPOSITING)
+ m_platformPlayer = PlatformPlayer::create(this, tabId, true, modifiedUrl.utf8().data());
+#else
+ m_platformPlayer = PlatformPlayer::create(this, tabId, false, modifiedUrl.utf8().data());
+#endif
+
String cookiePairs;
if (!url.isEmpty())
cookiePairs = cookieManager().getCookie(KURL(ParsedURLString, url.utf8().data()), WithHttpOnlyCookies);
if (!cookiePairs.isEmpty() && cookiePairs.utf8().data())
- m_platformPlayer->load(modifiedUrl.utf8().data(), userAgent(modifiedUrl).utf8().data(), cookiePairs.utf8().data());
+ m_platformPlayer->load(modifiedUrl.utf8().data(), m_webCorePlayer->userAgent().utf8().data(), cookiePairs.utf8().data());
else
- m_platformPlayer->load(modifiedUrl.utf8().data(), userAgent(modifiedUrl).utf8().data(), 0);
+ m_platformPlayer->load(modifiedUrl.utf8().data(), m_webCorePlayer->userAgent().utf8().data(), 0);
}
void MediaPlayerPrivate::cancelLoad()
{
- m_platformPlayer->cancelLoad();
+ if (m_platformPlayer)
+ m_platformPlayer->cancelLoad();
}
void MediaPlayerPrivate::prepareToPlay()
{
- m_platformPlayer->prepareToPlay();
+ if (m_platformPlayer)
+ m_platformPlayer->prepareToPlay();
}
void MediaPlayerPrivate::play()
{
- m_platformPlayer->play();
+ if (m_platformPlayer)
+ m_platformPlayer->play();
}
void MediaPlayerPrivate::pause()
{
- m_platformPlayer->pause();
+ if (m_platformPlayer)
+ m_platformPlayer->pause();
}
bool MediaPlayerPrivate::supportsFullscreen() const
@@ -192,6 +200,9 @@ bool MediaPlayerPrivate::supportsFullscreen() const
IntSize MediaPlayerPrivate::naturalSize() const
{
+ if (!m_platformPlayer)
+ return IntSize();
+
// Cannot return empty size, otherwise paint() will never get called.
// Also, the values here will affect the aspect ratio of the output rectangle that will
// be used for renderering the video, so we must take PAR into account.
@@ -209,12 +220,16 @@ IntSize MediaPlayerPrivate::naturalSize() const
bool MediaPlayerPrivate::hasVideo() const
{
- return m_platformPlayer->hasVideo();
+ if (m_platformPlayer)
+ return m_platformPlayer->hasVideo();
+ return false;
}
bool MediaPlayerPrivate::hasAudio() const
{
- return m_platformPlayer->hasAudio();
+ if (m_platformPlayer)
+ return m_platformPlayer->hasAudio();
+ return false;
}
void MediaPlayerPrivate::setVisible(bool)
@@ -224,7 +239,9 @@ void MediaPlayerPrivate::setVisible(bool)
float MediaPlayerPrivate::duration() const
{
- return m_platformPlayer->duration();
+ if (m_platformPlayer)
+ return m_platformPlayer->duration();
+ return 0.0f;
}
static const double SeekSubmissionDelay = 0.1; // Reasonable throttling value.
@@ -232,6 +249,9 @@ static const double ShortMediaThreshold = SeekSubmissionDelay * 2.0;
float MediaPlayerPrivate::currentTime() const
{
+ if (!m_platformPlayer)
+ return 0.0f;
+
// For very short media on the order of SeekSubmissionDelay we get
// unwanted repeats if we don't return the most up-to-date currentTime().
bool shortMedia = m_platformPlayer->duration() < ShortMediaThreshold;
@@ -240,6 +260,9 @@ float MediaPlayerPrivate::currentTime() const
void MediaPlayerPrivate::seek(float time)
{
+ if (!m_platformPlayer)
+ return;
+
m_lastSeekTime = time;
m_lastSeekTimePending = true;
if (!m_userDrivenSeekTimer.isActive())
@@ -262,17 +285,21 @@ bool MediaPlayerPrivate::seeking() const
void MediaPlayerPrivate::setRate(float rate)
{
- m_platformPlayer->setRate(rate);
+ if (m_platformPlayer)
+ m_platformPlayer->setRate(rate);
}
bool MediaPlayerPrivate::paused() const
{
- return m_platformPlayer->paused();
+ if (m_platformPlayer)
+ return m_platformPlayer->paused();
+ return false;
}
void MediaPlayerPrivate::setVolume(float volume)
{
- m_platformPlayer->setVolume(volume);
+ if (m_platformPlayer)
+ m_platformPlayer->setVolume(volume);
}
MediaPlayer::NetworkState MediaPlayerPrivate::networkState() const
@@ -287,11 +314,16 @@ MediaPlayer::ReadyState MediaPlayerPrivate::readyState() const
float MediaPlayerPrivate::maxTimeSeekable() const
{
- return m_platformPlayer->maxTimeSeekable();
+ if (m_platformPlayer)
+ return m_platformPlayer->maxTimeSeekable();
+ return 0.0f;
}
PassRefPtr<TimeRanges> MediaPlayerPrivate::buffered() const
{
+ if (!m_platformPlayer)
+ return TimeRanges::create();
+
RefPtr<TimeRanges> timeRanges = TimeRanges::create();
if (float bufferLoaded = m_platformPlayer->bufferLoaded())
timeRanges->add(0, bufferLoaded);
@@ -311,6 +343,9 @@ void MediaPlayerPrivate::setSize(const IntSize&)
void MediaPlayerPrivate::paint(GraphicsContext* context, const IntRect& rect)
{
+ if (!m_platformPlayer)
+ return;
+
#if USE(ACCELERATED_COMPOSITING)
// Only process paint calls coming via the accelerated compositing code
// path, where we get called with a null graphics context. See
@@ -335,7 +370,9 @@ void MediaPlayerPrivate::paint(GraphicsContext* context, const IntRect& rect)
bool MediaPlayerPrivate::hasAvailableVideoFrame() const
{
- return m_platformPlayer->hasAvailableVideoFrame();
+ if (m_platformPlayer)
+ return m_platformPlayer->hasAvailableVideoFrame();
+ return false;
}
bool MediaPlayerPrivate::hasSingleSecurityOrigin() const
@@ -345,21 +382,9 @@ bool MediaPlayerPrivate::hasSingleSecurityOrigin() const
MediaPlayer::MovieLoadType MediaPlayerPrivate::movieLoadType() const
{
- return static_cast<MediaPlayer::MovieLoadType>(m_platformPlayer->movieLoadType());
-}
-
-// This function returns the user agent string associated with the
-// frame loader client of our HTMLMediaElement. The call below will
-// end up in FrameLoaderClientBlackBerry::userAgent().
-String MediaPlayerPrivate::userAgent(const String& url) const
-{
- HTMLMediaElement* element = static_cast<HTMLMediaElement*>(m_webCorePlayer->mediaPlayerClient());
- Document* topdoc = element->document()->topDocument();
- ASSERT(topdoc->frame());
- ASSERT(topdoc->frame()->loader());
- if (topdoc->frame())
- return topdoc->frame()->loader()->userAgent(KURL(KURL(), url));
- return String();
+ if (m_platformPlayer)
+ return static_cast<MediaPlayer::MovieLoadType>(m_platformPlayer->movieLoadType());
+ return MediaPlayer::Unknown;
}
void MediaPlayerPrivate::resizeSourceDimensions()
@@ -468,7 +493,8 @@ unsigned MediaPlayerPrivate::sourceHeight()
void MediaPlayerPrivate::setAllowPPSVolumeUpdates(bool allow)
{
- return m_platformPlayer->setAllowPPSVolumeUpdates(allow);
+ if (m_platformPlayer)
+ return m_platformPlayer->setAllowPPSVolumeUpdates(allow);
}
void MediaPlayerPrivate::updateStates()
@@ -476,36 +502,36 @@ void MediaPlayerPrivate::updateStates()
MediaPlayer::NetworkState oldNetworkState = m_networkState;
MediaPlayer::ReadyState oldReadyState = m_readyState;
- MMRPlayer::Error currentError = m_platformPlayer->error();
+ PlatformPlayer::Error currentError = m_platformPlayer->error();
HTMLMediaElement* element = static_cast<HTMLMediaElement*>(m_webCorePlayer->mediaPlayerClient());
- if (currentError != MMRPlayer::MediaOK) {
+ if (currentError != PlatformPlayer::MediaOK) {
m_readyState = MediaPlayer::HaveNothing;
- if (currentError == MMRPlayer::MediaDecodeError)
+ if (currentError == PlatformPlayer::MediaDecodeError)
m_networkState = MediaPlayer::DecodeError;
- else if (currentError == MMRPlayer::MediaMetaDataError
- || currentError == MMRPlayer::MediaAudioReceiveError
- || currentError == MMRPlayer::MediaVideoReceiveError)
+ else if (currentError == PlatformPlayer::MediaMetaDataError
+ || currentError == PlatformPlayer::MediaAudioReceiveError
+ || currentError == PlatformPlayer::MediaVideoReceiveError)
m_networkState = MediaPlayer::NetworkError;
} else {
switch (m_platformPlayer->mediaState()) {
- case MMRPlayer::MMRPlayStateIdle:
+ case PlatformPlayer::MMRPlayStateIdle:
m_networkState = MediaPlayer::Idle;
break;
- case MMRPlayer::MMRPlayStatePlaying:
+ case PlatformPlayer::MMRPlayStatePlaying:
m_networkState = MediaPlayer::Loading;
break;
- case MMRPlayer::MMRPlayStateStopped:
+ case PlatformPlayer::MMRPlayStateStopped:
m_networkState = MediaPlayer::Idle;
break;
- case MMRPlayer::MMRPlayStateUnknown:
+ case PlatformPlayer::MMRPlayStateUnknown:
default:
break;
}
switch (m_platformPlayer->state()) {
- case MMRPlayer::MP_STATE_IDLE:
+ case PlatformPlayer::MP_STATE_IDLE:
#if USE(ACCELERATED_COMPOSITING)
setBuffering(false);
m_mediaIsBuffering = false;
@@ -518,7 +544,7 @@ void MediaPlayerPrivate::updateStates()
if (isFullscreen())
element->exitFullscreen();
break;
- case MMRPlayer::MP_STATE_ACTIVE:
+ case PlatformPlayer::MP_STATE_ACTIVE:
#if USE(ACCELERATED_COMPOSITING)
m_showBufferingImage = false;
m_mediaIsBuffering = false;
@@ -527,7 +553,7 @@ void MediaPlayerPrivate::updateStates()
m_platformLayer = VideoLayerWebKitThread::create(m_webCorePlayer);
#endif
break;
- case MMRPlayer::MP_STATE_UNSUPPORTED:
+ case PlatformPlayer::MP_STATE_UNSUPPORTED:
break;
default:
break;
@@ -543,18 +569,18 @@ void MediaPlayerPrivate::updateStates()
m_webCorePlayer->networkStateChanged();
}
-// IMMRPlayerListener callbacks implementation
-void MediaPlayerPrivate::onStateChanged(MMRPlayer::MpState)
+// IPlatformPlayerListener callbacks implementation
+void MediaPlayerPrivate::onStateChanged(PlatformPlayer::MpState)
{
updateStates();
}
-void MediaPlayerPrivate::onMediaStatusChanged(MMRPlayer::MMRPlayState)
+void MediaPlayerPrivate::onMediaStatusChanged(PlatformPlayer::MMRPlayState)
{
updateStates();
}
-void MediaPlayerPrivate::onError(MMRPlayer::Error type)
+void MediaPlayerPrivate::onError(PlatformPlayer::Error type)
{
updateStates();
}
@@ -654,7 +680,7 @@ void MediaPlayerPrivate::waitMetadataTimerFired(Timer<MediaPlayerPrivate>*)
}
m_waitMetadataPopDialogCounter = 0;
- int wait = showErrorDialog(MMRPlayer::MediaMetaDataTimeoutError);
+ int wait = showErrorDialog(PlatformPlayer::MediaMetaDataTimeoutError);
if (!wait)
onPauseNotified();
else {
@@ -716,34 +742,34 @@ void MediaPlayerPrivate::onAuthenticationAccepted(const MMRAuthChallenge& authCh
CredentialStorage::set(Credential(authChallenge.username().c_str(), authChallenge.password().c_str(), static_cast<CredentialPersistence>(authChallenge.persistence())), protectionSpace, url);
}
-int MediaPlayerPrivate::showErrorDialog(MMRPlayer::Error type)
+int MediaPlayerPrivate::showErrorDialog(PlatformPlayer::Error type)
{
using namespace BlackBerry::WebKit;
WebPageClient::AlertType atype;
switch (type) {
- case MMRPlayer::MediaOK:
+ case PlatformPlayer::MediaOK:
atype = WebPageClient::MediaOK;
break;
- case MMRPlayer::MediaDecodeError:
+ case PlatformPlayer::MediaDecodeError:
atype = WebPageClient::MediaDecodeError;
break;
- case MMRPlayer::MediaMetaDataError:
+ case PlatformPlayer::MediaMetaDataError:
atype = WebPageClient::MediaMetaDataError;
break;
- case MMRPlayer::MediaMetaDataTimeoutError:
+ case PlatformPlayer::MediaMetaDataTimeoutError:
atype = WebPageClient::MediaMetaDataTimeoutError;
break;
- case MMRPlayer::MediaNoMetaDataError:
+ case PlatformPlayer::MediaNoMetaDataError:
atype = WebPageClient::MediaNoMetaDataError;
break;
- case MMRPlayer::MediaVideoReceiveError:
+ case PlatformPlayer::MediaVideoReceiveError:
atype = WebPageClient::MediaVideoReceiveError;
break;
- case MMRPlayer::MediaAudioReceiveError:
+ case PlatformPlayer::MediaAudioReceiveError:
atype = WebPageClient::MediaAudioReceiveError;
break;
- case MMRPlayer::MediaInvalidError:
+ case PlatformPlayer::MediaInvalidError:
atype = WebPageClient::MediaInvalidError;
break;
default:
diff --git a/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h b/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h
index 0a062e508..63bfdd481 100644
--- a/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h
+++ b/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h
@@ -22,7 +22,7 @@
#if ENABLE(VIDEO)
#include "MediaPlayerPrivate.h"
-#include <BlackBerryPlatformMMRPlayer.h>
+#include <BlackBerryPlatformPlayer.h>
namespace BlackBerry {
namespace WebKit {
@@ -32,7 +32,7 @@ class WebPageClient;
namespace WebCore {
-class MediaPlayerPrivate : public MediaPlayerPrivateInterface, public BlackBerry::Platform::IMMRPlayerListener {
+class MediaPlayerPrivate : public MediaPlayerPrivateInterface, public BlackBerry::Platform::IPlatformPlayerListener {
public:
virtual ~MediaPlayerPrivate();
@@ -113,10 +113,10 @@ public:
unsigned sourceHeight();
void setAllowPPSVolumeUpdates(bool);
- // IMMRPlayerListener implementation.
- virtual void onStateChanged(BlackBerry::Platform::MMRPlayer::MpState);
- virtual void onMediaStatusChanged(BlackBerry::Platform::MMRPlayer::MMRPlayState);
- virtual void onError(BlackBerry::Platform::MMRPlayer::Error);
+ // IPlatformPlayerListener implementation.
+ virtual void onStateChanged(BlackBerry::Platform::PlatformPlayer::MpState);
+ virtual void onMediaStatusChanged(BlackBerry::Platform::PlatformPlayer::MMRPlayState);
+ virtual void onError(BlackBerry::Platform::PlatformPlayer::Error);
virtual void onDurationChanged(float);
virtual void onTimeChanged(float);
virtual void onRateChanged(float);
@@ -136,7 +136,7 @@ public:
virtual bool isFullscreen() const;
virtual bool isElementPaused() const;
virtual bool isTabVisible() const;
- virtual int showErrorDialog(BlackBerry::Platform::MMRPlayer::Error);
+ virtual int showErrorDialog(BlackBerry::Platform::PlatformPlayer::Error);
virtual BlackBerry::Platform::Graphics::Window* platformWindow();
private:
@@ -149,7 +149,7 @@ private:
virtual String engineDescription() const { return "BlackBerry"; }
MediaPlayer* m_webCorePlayer;
- BlackBerry::Platform::MMRPlayer* m_platformPlayer;
+ BlackBerry::Platform::PlatformPlayer* m_platformPlayer;
mutable MediaPlayer::NetworkState m_networkState;
MediaPlayer::ReadyState m_readyState;
diff --git a/Source/WebCore/platform/graphics/blackberry/TextureCacheCompositingThread.cpp b/Source/WebCore/platform/graphics/blackberry/TextureCacheCompositingThread.cpp
index f9f65408a..5b6bb8736 100644
--- a/Source/WebCore/platform/graphics/blackberry/TextureCacheCompositingThread.cpp
+++ b/Source/WebCore/platform/graphics/blackberry/TextureCacheCompositingThread.cpp
@@ -201,10 +201,10 @@ void TextureCacheCompositingThread::setMemoryUsage(size_t memoryUsage)
PassRefPtr<Texture> TextureCacheCompositingThread::textureForTiledContents(const SkBitmap& contents, const IntRect& tileRect, const TileIndex& index, bool isOpaque)
{
- HashMap<ContentsKey, TextureMap>::iterator it = m_cache.add(key(contents), TextureMap()).first;
+ HashMap<ContentsKey, TextureMap>::iterator it = m_cache.add(key(contents), TextureMap()).iterator;
TextureMap& map = (*it).second;
- TextureMap::iterator jt = map.add(index, RefPtr<Texture>()).first;
+ TextureMap::iterator jt = map.add(index, RefPtr<Texture>()).iterator;
RefPtr<Texture> texture = (*jt).second;
if (!texture) {
texture = createTexture();
diff --git a/Source/WebCore/platform/graphics/blackberry/WebGLLayerWebKitThread.cpp b/Source/WebCore/platform/graphics/blackberry/WebGLLayerWebKitThread.cpp
index 75b9c5fa4..fd159d33c 100644
--- a/Source/WebCore/platform/graphics/blackberry/WebGLLayerWebKitThread.cpp
+++ b/Source/WebCore/platform/graphics/blackberry/WebGLLayerWebKitThread.cpp
@@ -27,35 +27,31 @@
namespace WebCore {
WebGLLayerWebKitThread::WebGLLayerWebKitThread()
- : LayerWebKitThread(WebGLLayer, 0)
+ : EGLImageLayerWebKitThread(WebGLLayer)
, m_webGLContext(0)
- , m_needsDisplay(false)
{
- setLayerProgramShader(LayerProgramShaderRGBA);
}
WebGLLayerWebKitThread::~WebGLLayerWebKitThread()
{
-}
-
-void WebGLLayerWebKitThread::setNeedsDisplay()
-{
- m_needsDisplay = true;
- setNeedsCommit();
+ if (m_webGLContext && m_webGLContext->makeContextCurrent())
+ deleteFrontBuffer();
}
void WebGLLayerWebKitThread::updateTextureContentsIfNeeded()
{
- // FIXME: Does WebGLLayer always need display? Or can we just return immediately if (!m_needsDisplay)?
- m_needsDisplay = false;
-
- if (!m_frontBufferLock)
- createFrontBufferLock();
+ if (!m_webGLContext || !m_webGLContext->makeContextCurrent())
+ return;
- // Lock copied GL texture so that the UI thread won't access it while we are drawing into it.
- pthread_mutex_lock(m_frontBufferLock);
m_webGLContext->prepareTexture();
- pthread_mutex_unlock(m_frontBufferLock);
+
+ updateFrontBuffer(m_webGLContext->getInternalFramebufferSize(), m_webGLContext->platformTexture());
+}
+
+void WebGLLayerWebKitThread::deleteTextures()
+{
+ if (m_webGLContext && m_webGLContext->makeContextCurrent())
+ deleteFrontBuffer();
}
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/blackberry/WebGLLayerWebKitThread.h b/Source/WebCore/platform/graphics/blackberry/WebGLLayerWebKitThread.h
index 6bcb48658..1480f255c 100644
--- a/Source/WebCore/platform/graphics/blackberry/WebGLLayerWebKitThread.h
+++ b/Source/WebCore/platform/graphics/blackberry/WebGLLayerWebKitThread.h
@@ -21,13 +21,13 @@
#if USE(ACCELERATED_COMPOSITING) && ENABLE(WEBGL)
-#include "LayerWebKitThread.h"
+#include "EGLImageLayerWebKitThread.h"
namespace WebCore {
class GraphicsContext3D;
-class WebGLLayerWebKitThread : public LayerWebKitThread {
+class WebGLLayerWebKitThread : public EGLImageLayerWebKitThread {
public:
static PassRefPtr<WebGLLayerWebKitThread> create()
{
@@ -38,16 +38,14 @@ public:
void setWebGLContext(GraphicsContext3D* context) { m_webGLContext = context; }
- virtual void setNeedsDisplay();
-
protected:
virtual void updateTextureContentsIfNeeded();
+ virtual void deleteTextures();
private:
WebGLLayerWebKitThread();
GraphicsContext3D* m_webGLContext;
- bool m_needsDisplay;
};
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
index e3a565d18..dcdb586d0 100644
--- a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
+++ b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
@@ -1957,6 +1957,10 @@ bool GraphicsLayerCA::createFilterAnimationsFromKeyframes(const KeyframeValueLis
return false;
const FilterOperations* operations = static_cast<const FilterAnimationValue*>(valueList.at(listIndex))->value();
+ // Make sure the platform layer didn't fallback to using software filter compositing instead.
+ if (!PlatformCALayer::filtersCanBeComposited(*operations))
+ return false;
+
int numAnimations = operations->size();
// FIXME: We can't currently hardware animate shadows.
diff --git a/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp b/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
index 3b4c9ccf3..947b97189 100644
--- a/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
+++ b/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
@@ -96,11 +96,12 @@ void ImageBuffer::clip(GraphicsContext* context, const FloatRect& maskRect) cons
context->platformContext()->pushImageMask(m_data.m_surface, maskRect);
}
-void ImageBuffer::draw(GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
+void ImageBuffer::draw(GraphicsContext* destinationContext, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
CompositeOperator op , bool useLowQualityScale)
{
- RefPtr<Image> image = copyImage(DontCopyBackingStore);
- context->drawImage(image.get(), styleColorSpace, destRect, srcRect, op, DoNotRespectImageOrientation, useLowQualityScale);
+ BackingStoreCopy copyMode = destinationContext == context() ? CopyBackingStore : DontCopyBackingStore;
+ RefPtr<Image> image = copyImage(copyMode);
+ destinationContext->drawImage(image.get(), styleColorSpace, destRect, srcRect, op, DoNotRespectImageOrientation, useLowQualityScale);
}
void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform,
diff --git a/Source/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp b/Source/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
index 50de51f47..ac00c43de 100644
--- a/Source/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
+++ b/Source/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
@@ -100,7 +100,7 @@ bool GraphicsContext3D::getImageData(Image* image,
return false;
CGImageRef cgImage;
RetainPtr<CGImageRef> decodedImage;
- bool hasAlpha = image->isBitmapImage() ? static_cast<BitmapImage*>(image)->frameHasAlphaAtIndex(0) : true;
+ bool hasAlpha = image->isBitmapImage() ? image->currentFrameHasAlpha() : true;
if ((ignoreGammaAndColorProfile || (hasAlpha && !premultiplyAlpha)) && image->data()) {
ImageSource decoder(ImageSource::AlphaNotPremultiplied,
ignoreGammaAndColorProfile ? ImageSource::GammaAndColorProfileIgnored : ImageSource::GammaAndColorProfileApplied);
diff --git a/Source/WebCore/platform/graphics/chromium/AnimationTranslationUtil.cpp b/Source/WebCore/platform/graphics/chromium/AnimationTranslationUtil.cpp
index f93695e04..63cff30d9 100644
--- a/Source/WebCore/platform/graphics/chromium/AnimationTranslationUtil.cpp
+++ b/Source/WebCore/platform/graphics/chromium/AnimationTranslationUtil.cpp
@@ -153,19 +153,31 @@ bool causesRotationOfAtLeast180Degrees(const TransformAnimationValue* value, con
const TransformOperations& operations = *value->value();
const TransformOperations& lastOperations = *lastValue->value();
- // We'll be doing matrix interpolation in this case. No risk of incorrect
- // rotations here.
- if (!operations.operationsMatch(lastOperations))
+ // We'll be doing matrix interpolation in this case. No risk of incorrect rotations here.
+ if (operations.size() && lastOperations.size() && !operations.operationsMatch(lastOperations))
return false;
- for (size_t i = 0; i < operations.size(); ++i) {
- if (!isRotationType(operations.operations()[i]->getOperationType()))
- continue;
+ size_t numOperations = max(operations.size(), lastOperations.size());
+ for (size_t i = 0; i < numOperations; ++i) {
+ float angle = 0;
+ if (i < operations.size()) {
+ if (!isRotationType(operations.operations()[i]->getOperationType()))
+ continue;
- RotateTransformOperation* rotation = static_cast<RotateTransformOperation*>(operations.operations()[i].get());
- RotateTransformOperation* lastRotation = static_cast<RotateTransformOperation*>(lastOperations.operations()[i].get());
+ RotateTransformOperation* rotation = static_cast<RotateTransformOperation*>(operations.operations()[i].get());
+ angle = rotation->angle();
+ }
+
+ float lastAngle = 0;
+ if (i < lastOperations.size()) {
+ if (!isRotationType(lastOperations.operations()[i]->getOperationType()))
+ continue;
+
+ RotateTransformOperation* lastRotation = static_cast<RotateTransformOperation*>(lastOperations.operations()[i].get());
+ lastAngle = lastRotation->angle();
+ }
- if (fabs(rotation->angle() - lastRotation->angle()) >= 180)
+ if (fabs(angle - lastAngle) >= 180)
return true;
}
@@ -272,7 +284,7 @@ PassOwnPtr<WebKit::WebAnimation> createWebAnimation(const KeyframeValueList& val
return nullptr;
}
- OwnPtr<WebKit::WebAnimation> anim(adoptPtr(new WebKit::WebAnimation(curve, animationId, groupId, targetProperty)));
+ OwnPtr<WebKit::WebAnimation> anim(adoptPtr(WebKit::WebAnimation::create(curve, animationId, groupId, targetProperty)));
int iterations = (animation && animation->isIterationCountSet()) ? animation->iterationCount() : 1;
anim->setIterations(iterations);
diff --git a/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp b/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp
index c92ce061d..c1210e545 100644
--- a/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp
+++ b/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp
@@ -46,9 +46,9 @@ BitmapCanvasLayerTextureUpdater::Texture::~Texture()
{
}
-void BitmapCanvasLayerTextureUpdater::Texture::updateRect(CCResourceProvider* resourceProvider, const IntRect& sourceRect, const IntRect& destRect)
+void BitmapCanvasLayerTextureUpdater::Texture::updateRect(CCResourceProvider* resourceProvider, const IntRect& sourceRect, const IntSize& destOffset)
{
- textureUpdater()->updateTextureRect(resourceProvider, texture(), sourceRect, destRect);
+ textureUpdater()->updateTextureRect(resourceProvider, texture(), sourceRect, destOffset);
}
PassRefPtr<BitmapCanvasLayerTextureUpdater> BitmapCanvasLayerTextureUpdater::create(PassOwnPtr<LayerPainterChromium> painter)
@@ -88,12 +88,12 @@ void BitmapCanvasLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect
paintContents(m_canvas.get(), contentRect, contentsWidthScale, contentsHeightScale, resultingOpaqueRect, stats);
}
-void BitmapCanvasLayerTextureUpdater::updateTextureRect(CCResourceProvider* resourceProvider, CCPrioritizedTexture* texture, const IntRect& sourceRect, const IntRect& destRect)
+void BitmapCanvasLayerTextureUpdater::updateTextureRect(CCResourceProvider* resourceProvider, CCPrioritizedTexture* texture, const IntRect& sourceRect, const IntSize& destOffset)
{
const SkBitmap& bitmap = m_canvas->getDevice()->accessBitmap(false);
bitmap.lockPixels();
- texture->upload(resourceProvider, static_cast<const uint8_t*>(bitmap.getPixels()), contentRect(), sourceRect, destRect);
+ texture->upload(resourceProvider, static_cast<const uint8_t*>(bitmap.getPixels()), contentRect(), sourceRect, destOffset);
bitmap.unlockPixels();
}
diff --git a/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h b/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h
index 8450e1f35..d54521f9b 100644
--- a/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h
+++ b/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h
@@ -47,7 +47,7 @@ public:
Texture(BitmapCanvasLayerTextureUpdater*, PassOwnPtr<CCPrioritizedTexture>);
virtual ~Texture();
- virtual void updateRect(CCResourceProvider*, const IntRect& sourceRect, const IntRect& destRect) OVERRIDE;
+ virtual void updateRect(CCResourceProvider*, const IntRect& sourceRect, const IntSize& destOffset) OVERRIDE;
private:
BitmapCanvasLayerTextureUpdater* textureUpdater() { return m_textureUpdater; }
@@ -61,7 +61,7 @@ public:
virtual PassOwnPtr<LayerTextureUpdater::Texture> createTexture(CCPrioritizedTextureManager*) OVERRIDE;
virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat) OVERRIDE;
virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, CCRenderingStats&) OVERRIDE;
- void updateTextureRect(CCResourceProvider*, CCPrioritizedTexture*, const IntRect& sourceRect, const IntRect& destRect);
+ void updateTextureRect(CCResourceProvider*, CCPrioritizedTexture*, const IntRect& sourceRect, const IntSize& destOffset);
virtual void setOpaque(bool) OVERRIDE;
diff --git a/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp b/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp
index de01086a8..39580ff4b 100644
--- a/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp
+++ b/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp
@@ -30,11 +30,11 @@
#include "BitmapSkPictureCanvasLayerTextureUpdater.h"
+#include "CCRenderingStats.h"
#include "LayerPainterChromium.h"
#include "PlatformColor.h"
#include "SkCanvas.h"
#include "SkDevice.h"
-#include "cc/CCRenderingStats.h"
#include <wtf/CurrentTime.h>
namespace WebCore {
@@ -57,10 +57,10 @@ void BitmapSkPictureCanvasLayerTextureUpdater::Texture::prepareRect(const IntRec
stats.totalPaintTimeInSeconds += monotonicallyIncreasingTime() - paintBeginTime;
}
-void BitmapSkPictureCanvasLayerTextureUpdater::Texture::updateRect(CCResourceProvider* resourceProvider, const IntRect& sourceRect, const IntRect& destRect)
+void BitmapSkPictureCanvasLayerTextureUpdater::Texture::updateRect(CCResourceProvider* resourceProvider, const IntRect& sourceRect, const IntSize& destOffset)
{
m_bitmap.lockPixels();
- texture()->upload(resourceProvider, static_cast<uint8_t*>(m_bitmap.getPixels()), destRect, destRect, destRect);
+ texture()->upload(resourceProvider, static_cast<uint8_t*>(m_bitmap.getPixels()), sourceRect, sourceRect, destOffset);
m_bitmap.unlockPixels();
m_bitmap.reset();
}
diff --git a/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h b/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h
index 70bdd5f90..38da53cd3 100644
--- a/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h
+++ b/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h
@@ -42,7 +42,7 @@ public:
Texture(BitmapSkPictureCanvasLayerTextureUpdater*, PassOwnPtr<CCPrioritizedTexture>);
virtual void prepareRect(const IntRect& sourceRect, CCRenderingStats&) OVERRIDE;
- virtual void updateRect(CCResourceProvider*, const IntRect& sourceRect, const IntRect& destRect) OVERRIDE;
+ virtual void updateRect(CCResourceProvider*, const IntRect& sourceRect, const IntSize& destOffset) OVERRIDE;
private:
BitmapSkPictureCanvasLayerTextureUpdater* textureUpdater() { return m_textureUpdater; }
diff --git a/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp b/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp
index 821e8ec8a..10654312c 100644
--- a/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp
+++ b/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp
@@ -31,8 +31,6 @@
#include "GraphicsContext3D.h"
#include "GraphicsContext3DPrivate.h"
#include "LayerRendererChromium.h" // For GLC() macro.
-#include "SkCanvas.h"
-#include "SkDeferredCanvas.h"
#include "TraceEvent.h"
#include <public/WebCompositor.h>
#include <public/WebGraphicsContext3D.h>
@@ -43,31 +41,6 @@ using WebKit::WebTextureUpdater;
namespace WebCore {
-class AcceleratedDeviceContext : public SkDeferredCanvas::DeviceContext {
-public:
- AcceleratedDeviceContext(WebGraphicsContext3D* context, WebExternalTextureLayer layer, bool useDoubleBuffering)
- : m_layer(layer)
- , m_context()
- , m_useDoubleBuffering(useDoubleBuffering)
- {
- ASSERT(context);
- ASSERT(!layer.isNull());
- m_context = context;
- }
-
- virtual void prepareForDraw()
- {
- if (!m_useDoubleBuffering)
- m_layer.willModifyTexture();
- m_context->makeContextCurrent();
- }
-
-private:
- WebExternalTextureLayer m_layer;
- WebGraphicsContext3D* m_context;
- bool m_useDoubleBuffering;
-};
-
Canvas2DLayerBridge::Canvas2DLayerBridge(PassRefPtr<GraphicsContext3D> context, const IntSize& size, DeferralMode deferralMode, unsigned textureId)
: m_deferralMode(deferralMode)
// FIXME: We currently turn off double buffering when canvas rendering is
@@ -96,28 +69,45 @@ Canvas2DLayerBridge::Canvas2DLayerBridge(PassRefPtr<GraphicsContext3D> context,
grContext->resetContext();
}
- m_layer = WebExternalTextureLayer::create(this);
- m_layer.setTextureId(textureId);
- m_layer.setRateLimitContext(!WebKit::WebCompositor::threadingEnabled() || m_useDoubleBuffering);
+ m_layer = adoptPtr(WebExternalTextureLayer::create(this));
+ m_layer->setTextureId(textureId);
+ m_layer->setRateLimitContext(!WebKit::WebCompositor::threadingEnabled() || m_useDoubleBuffering);
}
-
Canvas2DLayerBridge::~Canvas2DLayerBridge()
{
- m_layer.setTextureId(0);
+ if (SkDeferredCanvas* deferred = deferredCanvas())
+ deferred->setNotificationClient(0);
+ m_layer->setTextureId(0);
if (m_useDoubleBuffering) {
m_context->makeContextCurrent();
GLC(m_context.get(), m_context->deleteTexture(m_frontBufferTexture));
m_context->flush();
}
- m_layer.clearClient();
+}
+
+SkDeferredCanvas* Canvas2DLayerBridge::deferredCanvas()
+{
+ if (m_deferralMode == Deferred)
+ return static_cast<SkDeferredCanvas*>(m_canvas);
+ return 0;
+}
+
+void Canvas2DLayerBridge::prepareForDraw()
+{
+ ASSERT(deferredCanvas());
+ if (!m_useDoubleBuffering)
+ m_layer->willModifyTexture();
+ m_context->makeContextCurrent();
}
SkCanvas* Canvas2DLayerBridge::skCanvas(SkDevice* device)
{
+ ASSERT(!m_canvas);
if (m_deferralMode == Deferred) {
- SkAutoTUnref<AcceleratedDeviceContext> deviceContext(new AcceleratedDeviceContext(context(), m_layer, m_useDoubleBuffering));
- m_canvas = new SkDeferredCanvas(device, deviceContext.get());
+ SkDeferredCanvas* deferred = new SkDeferredCanvas(device);
+ deferred->setNotificationClient(this);
+ m_canvas = deferred;
} else
m_canvas = new SkCanvas(device);
@@ -157,13 +147,13 @@ WebGraphicsContext3D* Canvas2DLayerBridge::context()
WebKit::WebLayer* Canvas2DLayerBridge::layer()
{
- return &m_layer;
+ return m_layer->layer();
}
void Canvas2DLayerBridge::contextAcquired()
{
if (m_deferralMode == NonDeferred && !m_useDoubleBuffering)
- m_layer.willModifyTexture();
+ m_layer->willModifyTexture();
}
unsigned Canvas2DLayerBridge::backBufferTexture()
diff --git a/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.h b/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.h
index 08f401ce0..27b1ea659 100644
--- a/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.h
+++ b/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.h
@@ -29,14 +29,12 @@
#include "GraphicsContext3D.h"
#include "ImageBuffer.h" // For DeferralMode enum.
#include "IntSize.h"
+#include "SkDeferredCanvas.h"
#include <public/WebExternalTextureLayer.h>
#include <public/WebExternalTextureLayerClient.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
-class SkCanvas;
-class SkDevice;
-
namespace WebKit {
class WebGraphicsContext3D;
}
@@ -45,7 +43,7 @@ namespace WebCore {
class LayerChromium;
-class Canvas2DLayerBridge : public WebKit::WebExternalTextureLayerClient {
+class Canvas2DLayerBridge : public WebKit::WebExternalTextureLayerClient, public SkDeferredCanvas::NotificationClient {
WTF_MAKE_NONCOPYABLE(Canvas2DLayerBridge);
public:
static PassOwnPtr<Canvas2DLayerBridge> create(PassRefPtr<GraphicsContext3D> context, const IntSize& size, DeferralMode deferralMode, unsigned textureId)
@@ -59,6 +57,9 @@ public:
virtual unsigned prepareTexture(WebKit::WebTextureUpdater&) OVERRIDE;
virtual WebKit::WebGraphicsContext3D* context() OVERRIDE;
+ // SkDeferredCanvas::NotificationClient implementation
+ virtual void prepareForDraw();
+
SkCanvas* skCanvas(SkDevice*);
WebKit::WebLayer* layer();
void contextAcquired();
@@ -67,6 +68,7 @@ public:
private:
Canvas2DLayerBridge(PassRefPtr<GraphicsContext3D>, const IntSize&, DeferralMode, unsigned textureId);
+ SkDeferredCanvas* deferredCanvas();
DeferralMode m_deferralMode;
bool m_useDoubleBuffering;
@@ -74,7 +76,7 @@ private:
unsigned m_backBufferTexture;
IntSize m_size;
SkCanvas* m_canvas;
- WebKit::WebExternalTextureLayer m_layer;
+ OwnPtr<WebKit::WebExternalTextureLayer> m_layer;
RefPtr<GraphicsContext3D> m_context;
};
diff --git a/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.cpp b/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.cpp
index b5c651c7b..b87cf4c90 100644
--- a/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.cpp
+++ b/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.cpp
@@ -30,6 +30,7 @@
#include "CanvasLayerTextureUpdater.h"
+#include "CCRenderingStats.h"
#include "FloatRect.h"
#include "LayerPainterChromium.h"
#include "SkCanvas.h"
@@ -37,7 +38,6 @@
#include "SkRect.h"
#include "SkiaUtils.h"
#include "TraceEvent.h"
-#include "cc/CCRenderingStats.h"
#include <wtf/CurrentTime.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/CompositorHUDFontAtlas.cpp b/Source/WebCore/platform/graphics/chromium/CompositorHUDFontAtlas.cpp
index b53c12922..6edf3c5e0 100644
--- a/Source/WebCore/platform/graphics/chromium/CompositorHUDFontAtlas.cpp
+++ b/Source/WebCore/platform/graphics/chromium/CompositorHUDFontAtlas.cpp
@@ -65,7 +65,7 @@ SkBitmap CompositorHUDFontAtlas::generateFontAtlas(WebRect asciiToRectTable[128]
// Clear the entire texture atlas to transparent before drawing fonts.
atlasContext.setFillColor(Color(0, 0, 0, 0), ColorSpaceDeviceRGB);
- atlasContext.fillRect(FloatRect(0, 0, ATLAS_SIZE, ATLAS_SIZE));
+ atlasContext.clearRect(FloatRect(0, 0, ATLAS_SIZE, ATLAS_SIZE));
// FIXME: monospace font does not work as expected.
FontDescription fontDescription;
diff --git a/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
index 1f9ad216e..0dc960b6d 100644
--- a/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
@@ -36,10 +36,10 @@
#include "BitmapCanvasLayerTextureUpdater.h"
#include "BitmapSkPictureCanvasLayerTextureUpdater.h"
+#include "CCLayerTreeHost.h"
+#include "CCSettings.h"
#include "FrameBufferSkPictureCanvasLayerTextureUpdater.h"
#include "LayerPainterChromium.h"
-#include "cc/CCLayerTreeHost.h"
-#include "cc/CCSettings.h"
#include <public/Platform.h>
#include <wtf/CurrentTime.h>
diff --git a/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp b/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp
index 1d167a556..6102a3e6f 100644
--- a/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp
@@ -156,16 +156,15 @@ class DrawingBufferPrivate : public WebKit::WebExternalTextureLayerClient {
public:
explicit DrawingBufferPrivate(DrawingBuffer* drawingBuffer)
: m_drawingBuffer(drawingBuffer)
- , m_layer(WebKit::WebExternalTextureLayer::create(this))
+ , m_layer(adoptPtr(WebKit::WebExternalTextureLayer::create(this)))
{
GraphicsContext3D::Attributes attributes = m_drawingBuffer->graphicsContext3D()->getContextAttributes();
- m_layer.setOpaque(!attributes.alpha);
- m_layer.setPremultipliedAlpha(attributes.premultipliedAlpha);
+ m_layer->setOpaque(!attributes.alpha);
+ m_layer->setPremultipliedAlpha(attributes.premultipliedAlpha);
}
virtual ~DrawingBufferPrivate()
{
- m_layer.clearClient();
}
virtual unsigned prepareTexture(WebKit::WebTextureUpdater& updater) OVERRIDE
@@ -187,11 +186,11 @@ public:
return GraphicsContext3DPrivate::extractWebGraphicsContext3D(m_drawingBuffer->graphicsContext3D());
}
- WebKit::WebLayer* layer() { return &m_layer; }
+ WebKit::WebLayer* layer() { return m_layer->layer(); }
private:
DrawingBuffer* m_drawingBuffer;
- WebKit::WebExternalTextureLayer m_layer;
+ OwnPtr<WebKit::WebExternalTextureLayer> m_layer;
};
#if USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebCore/platform/graphics/chromium/Extensions3DChromium.h b/Source/WebCore/platform/graphics/chromium/Extensions3DChromium.h
index 2df315672..edd6c135c 100644
--- a/Source/WebCore/platform/graphics/chromium/Extensions3DChromium.h
+++ b/Source/WebCore/platform/graphics/chromium/Extensions3DChromium.h
@@ -49,6 +49,7 @@ public:
// GL_CHROMIUM_iosurface (Mac OS X specific)
// GL_CHROMIUM_command_buffer_query
// GL_ANGLE_texture_usage
+ // GL_EXT_debug_marker
// GL_EXT_texture_storage
// GL_EXT_occlusion_query_boolean
@@ -131,6 +132,11 @@ public:
virtual void getnUniformfvEXT(GC3Duint program, int location, GC3Dsizei bufSize, float *params);
virtual void getnUniformivEXT(GC3Duint program, int location, GC3Dsizei bufSize, int *params);
+ // GL_EXT_debug_marker
+ virtual void insertEventMarkerEXT(const String&);
+ virtual void pushGroupMarkerEXT(const String&);
+ virtual void popGroupMarkerEXT(void);
+
private:
// Instances of this class are strictly owned by the GraphicsContext3D implementation and do not
// need to be instantiated by any other code.
diff --git a/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp b/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp
index a0e857e9d..da2ecc610 100644
--- a/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp
+++ b/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp
@@ -30,10 +30,10 @@
#include "FrameBufferSkPictureCanvasLayerTextureUpdater.h"
+#include "CCProxy.h"
#include "LayerPainterChromium.h"
#include "SkCanvas.h"
#include "SkGpuDevice.h"
-#include "cc/CCProxy.h"
#include <public/WebGraphicsContext3D.h>
#include <public/WebSharedGraphicsContext3D.h>
@@ -67,13 +67,13 @@ FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::~Texture()
{
}
-void FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::updateRect(CCResourceProvider* resourceProvider, const IntRect& sourceRect, const IntRect& destRect)
+void FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::updateRect(CCResourceProvider* resourceProvider, const IntRect& sourceRect, const IntSize& destOffset)
{
WebGraphicsContext3D* sharedContext = CCProxy::hasImplThread() ? WebSharedGraphicsContext3D::compositorThreadContext() : WebSharedGraphicsContext3D::mainThreadContext();
GrContext* sharedGrContext = CCProxy::hasImplThread() ? WebSharedGraphicsContext3D::compositorThreadGrContext() : WebSharedGraphicsContext3D::mainThreadGrContext();
if (!sharedContext || !sharedGrContext)
return;
- textureUpdater()->updateTextureRect(sharedContext, sharedGrContext, resourceProvider, texture(), sourceRect, destRect);
+ textureUpdater()->updateTextureRect(sharedContext, sharedGrContext, resourceProvider, texture(), sourceRect, destOffset);
}
PassRefPtr<FrameBufferSkPictureCanvasLayerTextureUpdater> FrameBufferSkPictureCanvasLayerTextureUpdater::create(PassOwnPtr<LayerPainterChromium> painter)
@@ -101,7 +101,7 @@ LayerTextureUpdater::SampledTexelFormat FrameBufferSkPictureCanvasLayerTextureUp
return LayerTextureUpdater::SampledTexelFormatRGBA;
}
-void FrameBufferSkPictureCanvasLayerTextureUpdater::updateTextureRect(WebGraphicsContext3D* context, GrContext* grContext, CCResourceProvider* resourceProvider, CCPrioritizedTexture* texture, const IntRect& sourceRect, const IntRect& destRect)
+void FrameBufferSkPictureCanvasLayerTextureUpdater::updateTextureRect(WebGraphicsContext3D* context, GrContext* grContext, CCResourceProvider* resourceProvider, CCPrioritizedTexture* texture, const IntRect& sourceRect, const IntSize& destOffset)
{
// Make sure ganesh uses the correct GL context.
context->makeContextCurrent();
@@ -116,12 +116,12 @@ void FrameBufferSkPictureCanvasLayerTextureUpdater::updateTextureRect(WebGraphic
// need to do a y-flip.
canvas->translate(0.0, texture->size().height());
canvas->scale(1.0, -1.0);
- // Only the region corresponding to destRect on the texture must be updated.
- canvas->clipRect(SkRect::MakeXYWH(destRect.x(), destRect.y(), destRect.width(), destRect.height()));
+ // Clip to the destination on the texture that must be updated.
+ canvas->clipRect(SkRect::MakeXYWH(destOffset.width(), destOffset.height(), sourceRect.width(), sourceRect.height()));
// Translate the origin of contentRect to that of destRect.
// Note that destRect is defined relative to sourceRect.
- canvas->translate(contentRect().x() - sourceRect.x() + destRect.x(),
- contentRect().y() - sourceRect.y() + destRect.y());
+ canvas->translate(contentRect().x() - sourceRect.x() + destOffset.width(),
+ contentRect().y() - sourceRect.y() + destOffset.height());
drawPicture(canvas.get());
// Flush ganesh context so that all the rendered stuff appears on the texture.
diff --git a/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h b/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h
index 64d5eec38..05a9dfef3 100644
--- a/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h
+++ b/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h
@@ -50,7 +50,7 @@ public:
Texture(FrameBufferSkPictureCanvasLayerTextureUpdater*, PassOwnPtr<CCPrioritizedTexture>);
virtual ~Texture();
- virtual void updateRect(CCResourceProvider*, const IntRect& sourceRect, const IntRect& destRect) OVERRIDE;
+ virtual void updateRect(CCResourceProvider*, const IntRect& sourceRect, const IntSize& destOffset) OVERRIDE;
private:
FrameBufferSkPictureCanvasLayerTextureUpdater* textureUpdater() { return m_textureUpdater; }
@@ -63,7 +63,7 @@ public:
virtual PassOwnPtr<LayerTextureUpdater::Texture> createTexture(CCPrioritizedTextureManager*) OVERRIDE;
virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat) OVERRIDE;
- void updateTextureRect(WebKit::WebGraphicsContext3D*, GrContext*, CCResourceProvider*, CCPrioritizedTexture*, const IntRect& sourceRect, const IntRect& destRect);
+ void updateTextureRect(WebKit::WebGraphicsContext3D*, GrContext*, CCResourceProvider*, CCPrioritizedTexture*, const IntRect& sourceRect, const IntSize& destOffset);
private:
explicit FrameBufferSkPictureCanvasLayerTextureUpdater(PassOwnPtr<LayerPainterChromium>);
diff --git a/Source/WebCore/platform/graphics/chromium/GeometryBinding.cpp b/Source/WebCore/platform/graphics/chromium/GeometryBinding.cpp
index 1a4568bb0..67ab4624f 100644
--- a/Source/WebCore/platform/graphics/chromium/GeometryBinding.cpp
+++ b/Source/WebCore/platform/graphics/chromium/GeometryBinding.cpp
@@ -35,17 +35,17 @@
namespace WebCore {
-GeometryBinding::GeometryBinding(WebKit::WebGraphicsContext3D* context)
+GeometryBinding::GeometryBinding(WebKit::WebGraphicsContext3D* context, const FloatRect& quadVertexRect)
: m_context(context)
, m_quadVerticesVbo(0)
, m_quadElementsVbo(0)
, m_initialized(false)
{
// Vertex positions and texture coordinates for the 4 corners of a 1x1 quad.
- float vertices[] = { -0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
- -0.5f, -0.5f, 0.0f, 0.0f, 0.0f,
- 0.5f, -0.5f, 0.0f, 1.0f, 0.0f,
- 0.5f, 0.5f, 0.0f, 1.0f, 1.0f };
+ float vertices[] = { quadVertexRect.x(), quadVertexRect.maxY(), 0.0f, 0.0f, 1.0f,
+ quadVertexRect.x(), quadVertexRect.y(), 0.0f, 0.0f, 0.0f,
+ quadVertexRect.maxX(), quadVertexRect.y(), 0.0f, 1.0f, 0.0f,
+ quadVertexRect.maxX(), quadVertexRect.maxY(), 0.0f, 1.0f, 1.0f };
uint16_t indices[] = { 0, 1, 2, 0, 2, 3, // The two triangles that make up the layer quad.
0, 1, 2, 3}; // A line path for drawing the layer border.
diff --git a/Source/WebCore/platform/graphics/chromium/GeometryBinding.h b/Source/WebCore/platform/graphics/chromium/GeometryBinding.h
index 20b2d5a00..0af146c94 100644
--- a/Source/WebCore/platform/graphics/chromium/GeometryBinding.h
+++ b/Source/WebCore/platform/graphics/chromium/GeometryBinding.h
@@ -26,6 +26,8 @@
#ifndef GeometryBinding_h
#define GeometryBinding_h
+#include "FloatRect.h"
+
#if USE(ACCELERATED_COMPOSITING)
namespace WebKit {
@@ -36,7 +38,7 @@ namespace WebCore {
class GeometryBinding {
public:
- explicit GeometryBinding(WebKit::WebGraphicsContext3D*);
+ GeometryBinding(WebKit::WebGraphicsContext3D*, const FloatRect& quadVertexRect);
~GeometryBinding();
bool initialized() const { return m_initialized; }
diff --git a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
index 9f8304f6f..27d51e968 100644
--- a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
@@ -83,14 +83,16 @@ PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
GraphicsLayerChromium::GraphicsLayerChromium(GraphicsLayerClient* client)
: GraphicsLayer(client)
+ , m_contentsLayer(0)
+ , m_contentsLayerId(0)
, m_contentsLayerPurpose(NoContentsLayer)
, m_contentsLayerHasBackgroundColor(false)
, m_inSetChildren(false)
, m_pageScaleChanged(false)
{
m_opaqueRectTrackingContentLayerDelegate = adoptPtr(new OpaqueRectTrackingContentLayerDelegate(this));
- m_layer = WebContentLayer::create(m_opaqueRectTrackingContentLayerDelegate.get());
- m_layer.setDrawsContent(m_drawsContent && m_contentsVisible);
+ m_layer = adoptPtr(WebContentLayer::create(m_opaqueRectTrackingContentLayerDelegate.get()));
+ m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible);
if (client)
deviceOrPageScaleFactorChanged();
updateDebugIndicators();
@@ -98,34 +100,9 @@ GraphicsLayerChromium::GraphicsLayerChromium(GraphicsLayerClient* client)
GraphicsLayerChromium::~GraphicsLayerChromium()
{
- // Do cleanup while we can still safely call methods on the derived class.
willBeDestroyed();
}
-void GraphicsLayerChromium::willBeDestroyed()
-{
- if (!m_layer.isNull()) {
- m_layer.clearClient();
- m_layer.clearRenderSurface();
- m_layer.setAnimationDelegate(0);
- }
-
- if (!m_contentsLayer.isNull()) {
- m_contentsLayer.clearRenderSurface();
- m_contentsLayer.setAnimationDelegate(0);
- }
-
- if (!m_transformLayer.isNull()) {
- m_transformLayer.clearRenderSurface();
- m_transformLayer.setAnimationDelegate(0);
- }
-
- if (m_linkHighlight)
- m_linkHighlight.clear();
-
- GraphicsLayer::willBeDestroyed();
-}
-
void GraphicsLayerChromium::setName(const String& inName)
{
m_nameBase = inName;
@@ -136,21 +113,16 @@ void GraphicsLayerChromium::setName(const String& inName)
void GraphicsLayerChromium::updateNames()
{
- if (!m_layer.isNull()) {
- String debugName = "Layer for " + m_nameBase;
- m_layer.setDebugName(debugName);
- }
- if (!m_transformLayer.isNull()) {
+ String debugName = "Layer for " + m_nameBase;
+ m_layer->layer()->setDebugName(debugName);
+
+ if (m_transformLayer) {
String debugName = "TransformLayer for " + m_nameBase;
- m_transformLayer.setDebugName(debugName);
+ m_transformLayer->setDebugName(debugName);
}
- if (!m_contentsLayer.isNull()) {
+ if (m_contentsLayer) {
String debugName = "ContentsLayer for " + m_nameBase;
- m_contentsLayer.setDebugName(debugName);
- }
- if (m_linkHighlight) {
- String debugName = "LinkHighlight for " + m_nameBase;
- m_linkHighlight->contentLayer()->setDebugName(debugName);
+ m_contentsLayer->setDebugName(debugName);
}
}
@@ -203,7 +175,7 @@ bool GraphicsLayerChromium::replaceChild(GraphicsLayer* oldChild, GraphicsLayer*
void GraphicsLayerChromium::removeFromParent()
{
GraphicsLayer::removeFromParent();
- primaryLayer().removeFromParent();
+ platformLayer()->removeFromParent();
}
void GraphicsLayerChromium::setPosition(const FloatPoint& point)
@@ -233,8 +205,8 @@ void GraphicsLayerChromium::setSize(const FloatSize& size)
GraphicsLayer::setSize(clampedSize);
updateLayerSize();
- if (m_pageScaleChanged && !m_layer.isNull())
- m_layer.invalidate();
+ if (m_pageScaleChanged)
+ m_layer->layer()->invalidate();
m_pageScaleChanged = false;
}
@@ -301,13 +273,13 @@ void GraphicsLayerChromium::setBackgroundColor(const Color& color)
void GraphicsLayerChromium::clearBackgroundColor()
{
GraphicsLayer::clearBackgroundColor();
- m_contentsLayer.setBackgroundColor(static_cast<RGBA32>(0));
+ m_contentsLayer->setBackgroundColor(static_cast<RGBA32>(0));
}
void GraphicsLayerChromium::setContentsOpaque(bool opaque)
{
GraphicsLayer::setContentsOpaque(opaque);
- m_layer.setOpaque(m_contentsOpaque);
+ m_layer->layer()->setOpaque(m_contentsOpaque);
}
static bool copyWebCoreFilterOperationsToWebFilterOperations(const FilterOperations& filters, WebFilterOperations& webFilters)
@@ -388,9 +360,14 @@ static bool copyWebCoreFilterOperationsToWebFilterOperations(const FilterOperati
bool GraphicsLayerChromium::setFilters(const FilterOperations& filters)
{
WebFilterOperations webFilters;
- if (!copyWebCoreFilterOperationsToWebFilterOperations(filters, webFilters))
+ if (!copyWebCoreFilterOperationsToWebFilterOperations(filters, webFilters)) {
+ // Make sure the filters are removed from the platform layer, as they are
+ // going to fallback to software mode.
+ m_layer->layer()->setFilters(WebFilterOperations());
+ GraphicsLayer::setFilters(FilterOperations());
return false;
- m_layer.setFilters(webFilters);
+ }
+ m_layer->layer()->setFilters(webFilters);
return GraphicsLayer::setFilters(filters);
}
@@ -399,7 +376,7 @@ void GraphicsLayerChromium::setBackgroundFilters(const FilterOperations& filters
WebFilterOperations webFilters;
if (!copyWebCoreFilterOperationsToWebFilterOperations(filters, webFilters))
return;
- m_layer.setBackgroundFilters(webFilters);
+ m_layer->layer()->setBackgroundFilters(webFilters);
}
void GraphicsLayerChromium::setMaskLayer(GraphicsLayer* maskLayer)
@@ -409,23 +386,21 @@ void GraphicsLayerChromium::setMaskLayer(GraphicsLayer* maskLayer)
GraphicsLayer::setMaskLayer(maskLayer);
- WebLayer maskWebLayer;
- if (m_maskLayer)
- maskWebLayer = *m_maskLayer->platformLayer();
- m_layer.setMaskLayer(maskWebLayer);
+ WebLayer* maskWebLayer = m_maskLayer ? m_maskLayer->platformLayer() : 0;
+ m_layer->layer()->setMaskLayer(maskWebLayer);
}
void GraphicsLayerChromium::setBackfaceVisibility(bool visible)
{
GraphicsLayer::setBackfaceVisibility(visible);
- m_layer.setDoubleSided(m_backfaceVisibility);
+ m_layer->setDoubleSided(m_backfaceVisibility);
}
void GraphicsLayerChromium::setOpacity(float opacity)
{
float clampedOpacity = max(min(opacity, 1.0f), 0.0f);
GraphicsLayer::setOpacity(clampedOpacity);
- primaryLayer().setOpacity(opacity);
+ platformLayer()->setOpacity(opacity);
}
void GraphicsLayerChromium::setReplicatedByLayer(GraphicsLayer* layer)
@@ -433,29 +408,27 @@ void GraphicsLayerChromium::setReplicatedByLayer(GraphicsLayer* layer)
GraphicsLayerChromium* layerChromium = static_cast<GraphicsLayerChromium*>(layer);
GraphicsLayer::setReplicatedByLayer(layer);
- WebLayer webReplicaLayer;
- if (layerChromium)
- webReplicaLayer = layerChromium->primaryLayer();
- primaryLayer().setReplicaLayer(webReplicaLayer);
+ WebLayer* webReplicaLayer = layerChromium ? layerChromium->platformLayer() : 0;
+ platformLayer()->setReplicaLayer(webReplicaLayer);
}
void GraphicsLayerChromium::setContentsNeedsDisplay()
{
- if (!m_contentsLayer.isNull())
- m_contentsLayer.invalidate();
+ if (m_contentsLayer)
+ m_contentsLayer->invalidate();
}
void GraphicsLayerChromium::setNeedsDisplay()
{
if (drawsContent())
- m_layer.invalidate();
+ m_layer->layer()->invalidate();
}
void GraphicsLayerChromium::setNeedsDisplayInRect(const FloatRect& rect)
{
if (drawsContent())
- m_layer.invalidateRect(rect);
+ m_layer->layer()->invalidateRect(rect);
}
void GraphicsLayerChromium::setContentsRect(const IntRect& rect)
@@ -471,46 +444,56 @@ void GraphicsLayerChromium::setContentsToImage(Image* image)
{
bool childrenChanged = false;
if (image) {
- if (m_contentsLayer.isNull() || m_contentsLayerPurpose != ContentsLayerForImage) {
- WebKit::WebImageLayer imageLayer = WebKit::WebImageLayer::create();
- setupContentsLayer(imageLayer);
+ if (m_contentsLayerPurpose != ContentsLayerForImage) {
+ m_imageLayer = adoptPtr(WebImageLayer::create());
+ setupContentsLayer(m_imageLayer->layer());
m_contentsLayerPurpose = ContentsLayerForImage;
childrenChanged = true;
}
- WebKit::WebImageLayer imageLayer = m_contentsLayer.to<WebKit::WebImageLayer>();
NativeImageSkia* nativeImage = image->nativeImageForCurrentFrame();
- imageLayer.setBitmap(nativeImage->bitmap());
- imageLayer.setOpaque(image->isBitmapImage() && !image->currentFrameHasAlpha());
+ m_imageLayer->setBitmap(nativeImage->bitmap());
+ m_imageLayer->layer()->setOpaque(image->isBitmapImage() && !image->currentFrameHasAlpha());
updateContentsRect();
} else {
- if (!m_contentsLayer.isNull()) {
+ if (m_imageLayer) {
childrenChanged = true;
- // The old contents layer will be removed via updateChildList.
- m_contentsLayer.reset();
+ m_imageLayer.clear();
}
+ // The old contents layer will be removed via updateChildList.
+ m_contentsLayer = 0;
}
if (childrenChanged)
updateChildList();
}
-void GraphicsLayerChromium::setContentsToCanvas(PlatformLayer* platformLayer)
+void GraphicsLayerChromium::setContentsToCanvas(PlatformLayer* layer)
+{
+ setContentsTo(ContentsLayerForCanvas, layer);
+}
+
+void GraphicsLayerChromium::setContentsToMedia(PlatformLayer* layer)
+{
+ setContentsTo(ContentsLayerForVideo, layer);
+}
+
+void GraphicsLayerChromium::setContentsTo(ContentsLayerPurpose purpose, WebKit::WebLayer* layer)
{
bool childrenChanged = false;
- if (platformLayer) {
- if (m_contentsLayer != *platformLayer) {
- setupContentsLayer(*platformLayer);
- m_contentsLayerPurpose = ContentsLayerForCanvas;
+ if (layer) {
+ if (m_contentsLayerId != layer->id()) {
+ setupContentsLayer(layer);
+ m_contentsLayerPurpose = purpose;
childrenChanged = true;
}
updateContentsRect();
} else {
- if (!m_contentsLayer.isNull()) {
+ if (m_contentsLayer) {
childrenChanged = true;
// The old contents layer will be removed via updateChildList.
- m_contentsLayer.reset();
+ m_contentsLayer = 0;
}
}
@@ -520,17 +503,17 @@ void GraphicsLayerChromium::setContentsToCanvas(PlatformLayer* platformLayer)
bool GraphicsLayerChromium::addAnimation(const KeyframeValueList& values, const IntSize& boxSize, const Animation* animation, const String& animationName, double timeOffset)
{
- primaryLayer().setAnimationDelegate(this);
+ platformLayer()->setAnimationDelegate(this);
int animationId = mapAnimationNameToId(animationName);
int groupId = AnimationIdVendor::getNextGroupId();
OwnPtr<WebKit::WebAnimation> toAdd(createWebAnimation(values, animation, animationId, groupId, timeOffset, boxSize));
- if (toAdd.get()) {
+ if (toAdd) {
// Remove any existing animations with the same animation id and target property.
- primaryLayer().removeAnimation(animationId, toAdd->targetProperty());
- return primaryLayer().addAnimation(*toAdd);
+ platformLayer()->removeAnimation(animationId, toAdd->targetProperty());
+ return platformLayer()->addAnimation(toAdd.get());
}
return false;
@@ -538,12 +521,12 @@ bool GraphicsLayerChromium::addAnimation(const KeyframeValueList& values, const
void GraphicsLayerChromium::pauseAnimation(const String& animationName, double timeOffset)
{
- primaryLayer().pauseAnimation(mapAnimationNameToId(animationName), timeOffset);
+ platformLayer()->pauseAnimation(mapAnimationNameToId(animationName), timeOffset);
}
void GraphicsLayerChromium::removeAnimation(const String& animationName)
{
- primaryLayer().removeAnimation(mapAnimationNameToId(animationName));
+ platformLayer()->removeAnimation(mapAnimationNameToId(animationName));
}
void GraphicsLayerChromium::suspendAnimations(double wallClockTime)
@@ -551,88 +534,54 @@ void GraphicsLayerChromium::suspendAnimations(double wallClockTime)
// |wallClockTime| is in the wrong time base. Need to convert here.
// FIXME: find a more reliable way to do this.
double monotonicTime = wallClockTime + monotonicallyIncreasingTime() - currentTime();
- primaryLayer().suspendAnimations(monotonicTime);
+ platformLayer()->suspendAnimations(monotonicTime);
}
void GraphicsLayerChromium::resumeAnimations()
{
- primaryLayer().resumeAnimations(monotonicallyIncreasingTime());
+ platformLayer()->resumeAnimations(monotonicallyIncreasingTime());
}
-void GraphicsLayerChromium::addLinkHighlight(const Path& path)
+void GraphicsLayerChromium::addLinkHighlight(const Path&)
{
- m_linkHighlight = LinkHighlight::create(this, path, AnimationIdVendor::LinkHighlightAnimationId, AnimationIdVendor::getNextGroupId());
- updateChildList();
}
void GraphicsLayerChromium::didFinishLinkHighlight()
{
- if (m_linkHighlight)
- m_linkHighlight->contentLayer()->removeFromParent();
-
- m_linkHighlight.clear();
-}
-
-void GraphicsLayerChromium::setContentsToMedia(PlatformLayer* layer)
-{
- bool childrenChanged = false;
- if (layer) {
- if (m_contentsLayer.isNull() || m_contentsLayerPurpose != ContentsLayerForVideo) {
- setupContentsLayer(*layer);
- m_contentsLayerPurpose = ContentsLayerForVideo;
- childrenChanged = true;
- }
- updateContentsRect();
- } else {
- if (!m_contentsLayer.isNull()) {
- childrenChanged = true;
-
- // The old contents layer will be removed via updateChildList.
- m_contentsLayer.reset();
- }
- }
-
- if (childrenChanged)
- updateChildList();
-}
-
-WebKit::WebLayer GraphicsLayerChromium::primaryLayer() const
-{
- return m_transformLayer.isNull() ? m_layer : m_transformLayer;
}
PlatformLayer* GraphicsLayerChromium::platformLayer() const
{
- return const_cast<PlatformLayer*>(m_transformLayer.isNull() ? &m_layer : &m_transformLayer);
+ return m_transformLayer ? m_transformLayer.get() : m_layer->layer();
}
void GraphicsLayerChromium::setDebugBackgroundColor(const Color& color)
{
if (color.isValid())
- m_layer.setBackgroundColor(color.rgb());
+ m_layer->layer()->setBackgroundColor(color.rgb());
else
- m_layer.setBackgroundColor(static_cast<RGBA32>(0));
+ m_layer->layer()->setBackgroundColor(static_cast<RGBA32>(0));
}
void GraphicsLayerChromium::setDebugBorder(const Color& color, float borderWidth)
{
if (color.isValid()) {
- m_layer.setDebugBorderColor(color.rgb());
- m_layer.setDebugBorderWidth(borderWidth);
+ m_layer->layer()->setDebugBorderColor(color.rgb());
+ m_layer->layer()->setDebugBorderWidth(borderWidth);
} else {
- m_layer.setDebugBorderColor(static_cast<RGBA32>(0));
- m_layer.setDebugBorderWidth(0);
+ m_layer->layer()->setDebugBorderColor(static_cast<RGBA32>(0));
+ m_layer->layer()->setDebugBorderWidth(0);
}
}
void GraphicsLayerChromium::updateChildList()
{
- Vector<WebLayer> newChildren;
+ Vector<WebLayer*> newChildren;
- if (!m_transformLayer.isNull()) {
+ if (m_transformLayer) {
// Add the primary layer first. Even if we have negative z-order children, the primary layer always comes behind.
- newChildren.append(m_layer);
- } else if (!m_contentsLayer.isNull()) {
+ newChildren.append(m_layer->layer());
+ } else if (m_contentsLayer) {
// FIXME: add the contents layer in the correct order with negative z-order children.
// This does not cause visible rendering issues because currently contents layers are only used
// for replaced elements that don't have children.
@@ -644,79 +593,76 @@ void GraphicsLayerChromium::updateChildList()
for (size_t i = 0; i < numChildren; ++i) {
GraphicsLayerChromium* curChild = static_cast<GraphicsLayerChromium*>(childLayers[i]);
- newChildren.append(curChild->primaryLayer());
+ newChildren.append(curChild->platformLayer());
}
- if (m_linkHighlight)
- newChildren.append(m_linkHighlight->contentLayer());
-
for (size_t i = 0; i < newChildren.size(); ++i)
- newChildren[i].removeFromParent();
+ newChildren[i]->removeFromParent();
- WebVector<WebLayer> newWebChildren;
+ WebVector<WebLayer*> newWebChildren;
newWebChildren.assign(newChildren.data(), newChildren.size());
- if (!m_transformLayer.isNull()) {
- m_transformLayer.setChildren(newWebChildren);
+ if (m_transformLayer) {
+ m_transformLayer->setChildren(newWebChildren);
- if (!m_contentsLayer.isNull()) {
+ if (m_contentsLayer) {
// If we have a transform layer, then the contents layer is parented in the
// primary layer (which is itself a child of the transform layer).
- m_layer.removeAllChildren();
- m_layer.addChild(m_contentsLayer);
+ m_layer->layer()->removeAllChildren();
+ m_layer->layer()->addChild(m_contentsLayer);
}
} else
- m_layer.setChildren(newWebChildren);
+ m_layer->layer()->setChildren(newWebChildren);
}
void GraphicsLayerChromium::updateLayerPosition()
{
- primaryLayer().setPosition(m_position);
+ platformLayer()->setPosition(m_position);
}
void GraphicsLayerChromium::updateLayerSize()
{
IntSize layerSize(m_size.width(), m_size.height());
- if (!m_transformLayer.isNull()) {
- m_transformLayer.setBounds(layerSize);
- m_layer.setPosition(FloatPoint());
+ if (m_transformLayer) {
+ m_transformLayer->setBounds(layerSize);
+ m_layer->layer()->setPosition(FloatPoint());
}
- m_layer.setBounds(layerSize);
+ m_layer->layer()->setBounds(layerSize);
- // Note that we don't resize m_contentsLayer. It's up the caller to do that.
+ // Note that we don't resize m_contentsLayer-> It's up the caller to do that.
}
void GraphicsLayerChromium::updateAnchorPoint()
{
- primaryLayer().setAnchorPoint(FloatPoint(m_anchorPoint.x(), m_anchorPoint.y()));
- primaryLayer().setAnchorPointZ(m_anchorPoint.z());
+ platformLayer()->setAnchorPoint(FloatPoint(m_anchorPoint.x(), m_anchorPoint.y()));
+ platformLayer()->setAnchorPointZ(m_anchorPoint.z());
}
void GraphicsLayerChromium::updateTransform()
{
- primaryLayer().setTransform(WebTransformationMatrix(m_transform));
+ platformLayer()->setTransform(WebTransformationMatrix(m_transform));
}
void GraphicsLayerChromium::updateChildrenTransform()
{
- primaryLayer().setSublayerTransform(WebTransformationMatrix(m_childrenTransform));
+ platformLayer()->setSublayerTransform(WebTransformationMatrix(m_childrenTransform));
}
void GraphicsLayerChromium::updateMasksToBounds()
{
- m_layer.setMasksToBounds(m_masksToBounds);
+ m_layer->layer()->setMasksToBounds(m_masksToBounds);
updateDebugIndicators();
}
void GraphicsLayerChromium::updateLayerPreserves3D()
{
- if (m_preserves3D && m_transformLayer.isNull()) {
+ if (m_preserves3D && !m_transformLayer) {
// Create the transform layer.
- m_transformLayer = WebLayer::create();
- m_transformLayer.setPreserves3D(true);
- m_transformLayer.setAnimationDelegate(this);
- m_layer.transferAnimationsTo(&m_transformLayer);
+ m_transformLayer = adoptPtr(WebLayer::create());
+ m_transformLayer->setPreserves3D(true);
+ m_transformLayer->setAnimationDelegate(this);
+ m_layer->layer()->transferAnimationsTo(m_transformLayer.get());
// Copy the position from this layer.
updateLayerPosition();
@@ -725,34 +671,34 @@ void GraphicsLayerChromium::updateLayerPreserves3D()
updateTransform();
updateChildrenTransform();
- m_layer.setPosition(FloatPoint::zero());
+ m_layer->layer()->setPosition(FloatPoint::zero());
- m_layer.setAnchorPoint(FloatPoint(0.5f, 0.5f));
- m_layer.setTransform(SkMatrix44());
+ m_layer->layer()->setAnchorPoint(FloatPoint(0.5f, 0.5f));
+ m_layer->layer()->setTransform(SkMatrix44());
// Set the old layer to opacity of 1. Further down we will set the opacity on the transform layer.
- m_layer.setOpacity(1);
+ m_layer->layer()->setOpacity(1);
- m_layer.setContentsScale(contentsScale());
+ m_layer->setContentsScale(contentsScale());
// Move this layer to be a child of the transform layer.
- if (!m_layer.parent().isNull())
- m_layer.parent().replaceChild(m_layer, m_transformLayer);
- m_transformLayer.addChild(m_layer);
+ if (parent())
+ parent()->platformLayer()->replaceChild(m_layer->layer(), m_transformLayer.get());
+ m_transformLayer->addChild(m_layer->layer());
updateChildList();
- } else if (!m_preserves3D && !m_transformLayer.isNull()) {
+ } else if (m_preserves3D && !m_transformLayer) {
// Relace the transformLayer in the parent with this layer.
- m_layer.removeFromParent();
- if (!m_transformLayer.parent().isNull())
- m_transformLayer.parent().replaceChild(m_transformLayer, m_layer);
+ m_layer->layer()->removeFromParent();
+ if (parent())
+ parent()->platformLayer()->replaceChild(m_transformLayer.get(), m_layer->layer());
- m_layer.setAnimationDelegate(this);
- m_transformLayer.transferAnimationsTo(&m_layer);
+ m_layer->layer()->setAnimationDelegate(this);
+ m_transformLayer->transferAnimationsTo(m_layer->layer());
// Release the transform layer.
- m_transformLayer.setAnimationDelegate(0);
- m_transformLayer.reset();
+ m_transformLayer->setAnimationDelegate(0);
+ m_transformLayer.clear();
updateLayerPosition();
updateLayerSize();
@@ -763,39 +709,39 @@ void GraphicsLayerChromium::updateLayerPreserves3D()
updateChildList();
}
- m_layer.setPreserves3D(m_preserves3D);
- primaryLayer().setOpacity(m_opacity);
+ m_layer->layer()->setPreserves3D(m_preserves3D);
+ platformLayer()->setOpacity(m_opacity);
updateNames();
}
void GraphicsLayerChromium::updateLayerIsDrawable()
{
// For the rest of the accelerated compositor code, there is no reason to make a
- // distinction between drawsContent and contentsVisible. So, for m_layer, these two
+ // distinction between drawsContent and contentsVisible. So, for m_layer->layer(), these two
// flags are combined here. m_contentsLayer shouldn't receive the drawsContent flag
// so it is only given contentsVisible.
- m_layer.setDrawsContent(m_drawsContent && m_contentsVisible);
+ m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible);
- if (!m_contentsLayer.isNull())
- m_contentsLayer.setDrawsContent(m_contentsVisible);
+ if (m_contentsLayer)
+ m_contentsLayer->setDrawsContent(m_contentsVisible);
if (m_drawsContent)
- m_layer.invalidate();
+ m_layer->layer()->invalidate();
updateDebugIndicators();
}
void GraphicsLayerChromium::updateLayerBackgroundColor()
{
- if (m_contentsLayer.isNull())
+ if (!m_contentsLayer)
return;
// We never create the contents layer just for background color yet.
if (m_backgroundColorSet)
- m_contentsLayer.setBackgroundColor(m_backgroundColor.rgb());
+ m_contentsLayer->setBackgroundColor(m_backgroundColor.rgb());
else
- m_contentsLayer.setBackgroundColor(static_cast<RGBA32>(0));
+ m_contentsLayer->setBackgroundColor(static_cast<RGBA32>(0));
}
void GraphicsLayerChromium::updateContentsVideo()
@@ -805,50 +751,42 @@ void GraphicsLayerChromium::updateContentsVideo()
void GraphicsLayerChromium::updateContentsRect()
{
- if (m_contentsLayer.isNull())
+ if (!m_contentsLayer)
return;
- m_contentsLayer.setPosition(FloatPoint(m_contentsRect.x(), m_contentsRect.y()));
- m_contentsLayer.setBounds(IntSize(m_contentsRect.width(), m_contentsRect.height()));
+ m_contentsLayer->setPosition(FloatPoint(m_contentsRect.x(), m_contentsRect.y()));
+ m_contentsLayer->setBounds(IntSize(m_contentsRect.width(), m_contentsRect.height()));
}
void GraphicsLayerChromium::updateContentsScale()
{
// If page scale is already applied then there's no need to apply it again.
- if (appliesPageScale() || m_layer.isNull())
+ if (appliesPageScale())
return;
- m_layer.setContentsScale(contentsScale());
+ m_layer->setContentsScale(contentsScale());
}
-void GraphicsLayerChromium::setupContentsLayer(WebLayer contentsLayer)
+void GraphicsLayerChromium::setupContentsLayer(WebLayer* contentsLayer)
{
- if (contentsLayer == m_contentsLayer)
- return;
-
- if (!m_contentsLayer.isNull()) {
- m_contentsLayer.setUseParentBackfaceVisibility(false);
- m_contentsLayer.removeFromParent();
- m_contentsLayer.reset();
- }
-
m_contentsLayer = contentsLayer;
+ m_contentsLayerId = m_contentsLayer->id();
- if (!m_contentsLayer.isNull()) {
- m_contentsLayer.setAnchorPoint(FloatPoint(0, 0));
- m_contentsLayer.setUseParentBackfaceVisibility(true);
+ if (m_contentsLayer) {
+ m_contentsLayer->setAnchorPoint(FloatPoint(0, 0));
+ m_contentsLayer->setUseParentBackfaceVisibility(true);
// It is necessary to call setDrawsContent as soon as we receive the new contentsLayer, for
// the correctness of early exit conditions in setDrawsContent() and setContentsVisible().
- m_contentsLayer.setDrawsContent(m_contentsVisible);
+ m_contentsLayer->setDrawsContent(m_contentsVisible);
// Insert the content layer first. Video elements require this, because they have
// shadow content that must display in front of the video.
- m_layer.insertChild(m_contentsLayer, 0);
+ m_layer->layer()->insertChild(m_contentsLayer, 0);
if (showDebugBorders()) {
- m_contentsLayer.setDebugBorderColor(Color(0, 0, 128, 180).rgb());
- m_contentsLayer.setDebugBorderWidth(1);
+ m_contentsLayer->setDebugBorderColor(Color(0, 0, 128, 180).rgb());
+ m_contentsLayer->setDebugBorderWidth(1);
}
}
updateDebugIndicators();
diff --git a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h b/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
index 5ae094877..5f48a0878 100644
--- a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
+++ b/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
@@ -39,6 +39,7 @@
#include <public/WebAnimationDelegate.h>
#include <public/WebContentLayer.h>
+#include <public/WebImageLayer.h>
#include <public/WebLayer.h>
#include <wtf/HashMap.h>
@@ -101,7 +102,7 @@ public:
virtual void setContentsToImage(Image*);
virtual void setContentsToMedia(PlatformLayer*);
virtual void setContentsToCanvas(PlatformLayer*);
- virtual bool hasContentsLayer() const { return !m_contentsLayer.isNull(); }
+ virtual bool hasContentsLayer() const { return m_contentsLayer; }
virtual bool addAnimation(const KeyframeValueList&, const IntSize& boxSize, const Animation*, const String&, double timeOffset);
virtual void pauseAnimation(const String& animationName, double timeOffset);
@@ -125,14 +126,13 @@ public:
virtual void notifyAnimationStarted(double startTime) OVERRIDE;
virtual void notifyAnimationFinished(double finishTime) OVERRIDE;
+ WebKit::WebContentLayer* contentLayer() const { return m_layer.get(); }
+
// Exposed for tests.
- WebKit::WebLayer contentsLayer() const { return m_contentsLayer; }
+ WebKit::WebLayer* contentsLayer() const { return m_contentsLayer; }
+ float contentsScale() const;
private:
- virtual void willBeDestroyed();
-
- WebKit::WebLayer primaryLayer() const;
-
void updateNames();
void updateChildList();
void updateLayerPosition();
@@ -150,33 +150,37 @@ private:
void updateContentsRect();
void updateContentsScale();
- void setupContentsLayer(WebKit::WebLayer);
- float contentsScale() const;
+ enum ContentsLayerPurpose {
+ NoContentsLayer = 0,
+ ContentsLayerForImage,
+ ContentsLayerForVideo,
+ ContentsLayerForCanvas,
+ };
+
+ void setContentsTo(ContentsLayerPurpose, WebKit::WebLayer*);
+ void setupContentsLayer(WebKit::WebLayer*);
int mapAnimationNameToId(const String& animationName);
String m_nameBase;
- WebKit::WebContentLayer m_layer;
- WebKit::WebLayer m_transformLayer;
- WebKit::WebLayer m_contentsLayer;
+ OwnPtr<WebKit::WebContentLayer> m_layer;
+ OwnPtr<WebKit::WebLayer> m_transformLayer;
+ OwnPtr<WebKit::WebImageLayer> m_imageLayer;
+ WebKit::WebLayer* m_contentsLayer;
+ // We don't have ownership of m_contentsLayer, but we do want to know if a given layer is the
+ // same as our current layer in setContentsTo(). Since m_contentsLayer may be deleted at this point,
+ // we stash an ID away when we know m_contentsLayer is alive and use that for comparisons from that point
+ // on.
+ int m_contentsLayerId;
OwnPtr<OpaqueRectTrackingContentLayerDelegate> m_opaqueRectTrackingContentLayerDelegate;
- enum ContentsLayerPurpose {
- NoContentsLayer = 0,
- ContentsLayerForImage,
- ContentsLayerForVideo,
- ContentsLayerForCanvas,
- };
-
ContentsLayerPurpose m_contentsLayerPurpose;
bool m_contentsLayerHasBackgroundColor : 1;
bool m_inSetChildren;
bool m_pageScaleChanged;
- RefPtr<LinkHighlight> m_linkHighlight;
-
typedef HashMap<String, int> AnimationIdMap;
AnimationIdMap m_animationIdMap;
};
diff --git a/Source/WebCore/platform/graphics/chromium/HeadsUpDisplayLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/HeadsUpDisplayLayerChromium.cpp
index c6e759bdb..2ae58ab7b 100644
--- a/Source/WebCore/platform/graphics/chromium/HeadsUpDisplayLayerChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/HeadsUpDisplayLayerChromium.cpp
@@ -27,9 +27,9 @@
#include "HeadsUpDisplayLayerChromium.h"
+#include "CCHeadsUpDisplayLayerImpl.h"
+#include "CCLayerTreeHost.h"
#include "TraceEvent.h"
-#include "cc/CCHeadsUpDisplayLayerImpl.h"
-#include "cc/CCLayerTreeHost.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/HeadsUpDisplayLayerChromium.h b/Source/WebCore/platform/graphics/chromium/HeadsUpDisplayLayerChromium.h
index e6a983045..775720e0d 100644
--- a/Source/WebCore/platform/graphics/chromium/HeadsUpDisplayLayerChromium.h
+++ b/Source/WebCore/platform/graphics/chromium/HeadsUpDisplayLayerChromium.h
@@ -27,9 +27,9 @@
#ifndef HeadsUpDisplayLayerChromium_h
#define HeadsUpDisplayLayerChromium_h
+#include "CCFontAtlas.h"
#include "IntSize.h"
#include "LayerChromium.h"
-#include "cc/CCFontAtlas.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/IOSurfaceLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/IOSurfaceLayerChromium.cpp
index df6d6c82c..38dd87711 100644
--- a/Source/WebCore/platform/graphics/chromium/IOSurfaceLayerChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/IOSurfaceLayerChromium.cpp
@@ -29,7 +29,7 @@
#include "IOSurfaceLayerChromium.h"
-#include "cc/CCIOSurfaceLayerImpl.h"
+#include "CCIOSurfaceLayerImpl.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
index 5073d1cc8..f7e603ed8 100644
--- a/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
@@ -34,9 +34,9 @@
#include "ImageLayerChromium.h"
+#include "CCLayerTreeHost.h"
#include "LayerTextureUpdater.h"
#include "PlatformColor.h"
-#include "cc/CCLayerTreeHost.h"
namespace WebCore {
@@ -50,9 +50,9 @@ public:
{
}
- virtual void updateRect(CCResourceProvider* resourceProvider, const IntRect& sourceRect, const IntRect& destRect) OVERRIDE
+ virtual void updateRect(CCResourceProvider* resourceProvider, const IntRect& sourceRect, const IntSize& destOffset) OVERRIDE
{
- textureUpdater()->updateTextureRect(resourceProvider, texture(), sourceRect, destRect);
+ textureUpdater()->updateTextureRect(resourceProvider, texture(), sourceRect, destOffset);
}
private:
@@ -79,7 +79,7 @@ public:
LayerTextureUpdater::SampledTexelFormatRGBA : LayerTextureUpdater::SampledTexelFormatBGRA;
}
- void updateTextureRect(CCResourceProvider* resourceProvider, CCPrioritizedTexture* texture, const IntRect& sourceRect, const IntRect& destRect)
+ void updateTextureRect(CCResourceProvider* resourceProvider, CCPrioritizedTexture* texture, const IntRect& sourceRect, const IntSize& destOffset)
{
// Source rect should never go outside the image pixels, even if this
// is requested because the texture extends outside the image.
@@ -87,12 +87,10 @@ public:
IntRect imageRect = IntRect(0, 0, m_bitmap.width(), m_bitmap.height());
clippedSourceRect.intersect(imageRect);
- IntRect clippedDestRect = destRect;
- clippedDestRect.move(clippedSourceRect.location() - sourceRect.location());
- clippedDestRect.setSize(clippedSourceRect.size());
+ IntSize clippedDestOffset = destOffset + IntSize(clippedSourceRect.location() - sourceRect.location());
SkAutoLockPixels lock(m_bitmap);
- texture->upload(resourceProvider, static_cast<const uint8_t*>(m_bitmap.getPixels()), imageRect, clippedSourceRect, clippedDestRect);
+ texture->upload(resourceProvider, static_cast<const uint8_t*>(m_bitmap.getPixels()), imageRect, clippedSourceRect, clippedDestOffset);
}
void setBitmap(const SkBitmap& bitmap)
diff --git a/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
index 3b9c36269..4e7fa74f5 100644
--- a/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
@@ -33,13 +33,13 @@
#if USE(ACCELERATED_COMPOSITING)
#include "LayerChromium.h"
+#include "CCActiveAnimation.h"
+#include "CCAnimationEvents.h"
+#include "CCLayerAnimationController.h"
+#include "CCLayerImpl.h"
+#include "CCLayerTreeHost.h"
+#include "CCSettings.h"
#include "TextStream.h"
-#include "cc/CCActiveAnimation.h"
-#include "cc/CCAnimationEvents.h"
-#include "cc/CCLayerAnimationController.h"
-#include "cc/CCLayerImpl.h"
-#include "cc/CCLayerTreeHost.h"
-#include "cc/CCSettings.h"
#include <public/WebAnimationDelegate.h>
@@ -81,7 +81,6 @@ LayerChromium::LayerChromium()
, m_useLCDText(false)
, m_preserves3D(false)
, m_useParentBackfaceVisibility(false)
- , m_alwaysReserveTextures(false)
, m_drawCheckerboardForMissingTiles(false)
, m_forceRenderSurface(false)
, m_replicaLayer(0)
@@ -235,10 +234,11 @@ void LayerChromium::setBounds(const IntSize& size)
setNeedsCommit();
}
-const LayerChromium* LayerChromium::rootLayer() const
+LayerChromium* LayerChromium::rootLayer()
{
- const LayerChromium* layer = this;
- for (LayerChromium* parent = layer->parent(); parent; layer = parent, parent = parent->parent()) { }
+ LayerChromium* layer = this;
+ while (layer->parent())
+ layer = layer->parent();
return layer;
}
diff --git a/Source/WebCore/platform/graphics/chromium/LayerChromium.h b/Source/WebCore/platform/graphics/chromium/LayerChromium.h
index 29e387e53..2e541ee7b 100644
--- a/Source/WebCore/platform/graphics/chromium/LayerChromium.h
+++ b/Source/WebCore/platform/graphics/chromium/LayerChromium.h
@@ -34,13 +34,13 @@
#if USE(ACCELERATED_COMPOSITING)
+#include "CCLayerAnimationController.h"
+#include "CCOcclusionTracker.h"
+#include "CCPrioritizedTexture.h"
#include "FloatPoint.h"
#include "Region.h"
#include "RenderSurfaceChromium.h"
#include "SkColor.h"
-#include "cc/CCLayerAnimationController.h"
-#include "cc/CCOcclusionTracker.h"
-#include "cc/CCPrioritizedTexture.h"
#include <public/WebFilterOperations.h>
#include <public/WebTransformationMatrix.h>
@@ -95,7 +95,7 @@ public:
// The root layer is a special case -- it operates in physical pixels.
virtual const WebKit::WebTransformationMatrix& transform() const OVERRIDE { return m_transform; }
- const LayerChromium* rootLayer() const;
+ LayerChromium* rootLayer();
LayerChromium* parent() const;
void addChild(PassRefPtr<LayerChromium>);
void insertChild(PassRefPtr<LayerChromium>, size_t index);
@@ -267,9 +267,6 @@ public:
// Set the priority of all desired textures in this layer.
virtual void setTexturePriorities(const CCPriorityCalculator&) { }
- void setAlwaysReserveTextures(bool alwaysReserveTextures) { m_alwaysReserveTextures = alwaysReserveTextures; }
- bool alwaysReserveTextures() const { return m_alwaysReserveTextures; }
-
bool addAnimation(PassOwnPtr<CCActiveAnimation>);
void pauseAnimation(int animationId, double timeOffset);
void removeAnimation(int animationId);
@@ -373,7 +370,6 @@ private:
bool m_useLCDText;
bool m_preserves3D;
bool m_useParentBackfaceVisibility;
- bool m_alwaysReserveTextures;
bool m_drawCheckerboardForMissingTiles;
bool m_forceRenderSurface;
diff --git a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
index 7f9471a98..36e47d177 100644
--- a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
@@ -34,6 +34,16 @@
#if USE(ACCELERATED_COMPOSITING)
#include "LayerRendererChromium.h"
+#include "CCDamageTracker.h"
+#include "CCLayerQuad.h"
+#include "CCMathUtil.h"
+#include "CCProxy.h"
+#include "CCRenderPass.h"
+#include "CCRenderSurfaceFilters.h"
+#include "CCScopedTexture.h"
+#include "CCSettings.h"
+#include "CCSingleThreadProxy.h"
+#include "CCVideoLayerImpl.h"
#include "Extensions3D.h"
#include "FloatQuad.h"
#include "GeometryBinding.h"
@@ -44,16 +54,7 @@
#include "SkColor.h"
#include "ThrottledTextureUploader.h"
#include "TraceEvent.h"
-#include "cc/CCDamageTracker.h"
-#include "cc/CCLayerQuad.h"
-#include "cc/CCMathUtil.h"
-#include "cc/CCProxy.h"
-#include "cc/CCRenderPass.h"
-#include "cc/CCRenderSurfaceFilters.h"
-#include "cc/CCScopedTexture.h"
-#include "cc/CCSettings.h"
-#include "cc/CCSingleThreadProxy.h"
-#include "cc/CCVideoLayerImpl.h"
+#include "UnthrottledTextureUploader.h"
#include <public/WebGraphicsContext3D.h>
#include <public/WebSharedGraphicsContext3D.h>
#include <public/WebVideoFrame.h>
@@ -71,40 +72,6 @@ namespace WebCore {
namespace {
-static WebTransformationMatrix orthoMatrix(float left, float right, float bottom, float top)
-{
- float deltaX = right - left;
- float deltaY = top - bottom;
- WebTransformationMatrix ortho;
- if (!deltaX || !deltaY)
- return ortho;
- ortho.setM11(2.0f / deltaX);
- ortho.setM41(-(right + left) / deltaX);
- ortho.setM22(2.0f / deltaY);
- ortho.setM42(-(top + bottom) / deltaY);
-
- // Z component of vertices is always set to zero as we don't use the depth buffer
- // while drawing.
- ortho.setM33(0);
-
- return ortho;
-}
-
-static WebTransformationMatrix screenMatrix(int x, int y, int width, int height)
-{
- WebTransformationMatrix screen;
-
- // Map to viewport.
- screen.translate3d(x, y, 0);
- screen.scale3d(width, height, 0);
-
- // Map x, y and z to unit square.
- screen.translate3d(0.5, 0.5, 0.5);
- screen.scale3d(0.5, 0.5, 0.5);
-
- return screen;
-}
-
bool needsIOSurfaceReadbackWorkaround()
{
#if OS(DARWIN)
@@ -114,46 +81,8 @@ bool needsIOSurfaceReadbackWorkaround()
#endif
}
-class UnthrottledTextureUploader : public TextureUploader {
- WTF_MAKE_NONCOPYABLE(UnthrottledTextureUploader);
-public:
- static PassOwnPtr<UnthrottledTextureUploader> create()
- {
- return adoptPtr(new UnthrottledTextureUploader());
- }
- virtual ~UnthrottledTextureUploader() { }
-
- virtual bool isBusy() OVERRIDE { return false; }
- virtual void beginUploads() OVERRIDE { }
- virtual void endUploads() OVERRIDE { }
- virtual void uploadTexture(CCResourceProvider* resourceProvider, Parameters upload) OVERRIDE { upload.texture->updateRect(resourceProvider, upload.sourceRect, upload.destRect); }
-
-protected:
- UnthrottledTextureUploader() { }
-};
-
} // anonymous namespace
-class LayerRendererChromium::CachedTexture : public CCScopedTexture {
- WTF_MAKE_NONCOPYABLE(CachedTexture);
-public:
- static PassOwnPtr<CachedTexture> create(CCResourceProvider* resourceProvider) { return adoptPtr(new CachedTexture(resourceProvider)); }
- virtual ~CachedTexture() { }
-
- bool isComplete() const { return m_isComplete; }
- void setIsComplete(bool isComplete) { m_isComplete = isComplete; }
-
-protected:
- explicit CachedTexture(CCResourceProvider* resourceProvider)
- : CCScopedTexture(resourceProvider)
- , m_isComplete(false)
- {
- }
-
-private:
- bool m_isComplete;
-};
-
PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(CCRendererClient* client, CCResourceProvider* resourceProvider, TextureUploaderOption textureUploaderSetting)
{
OwnPtr<LayerRendererChromium> layerRenderer(adoptPtr(new LayerRendererChromium(client, resourceProvider, textureUploaderSetting)));
@@ -166,10 +95,9 @@ PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(CCRendererClient
LayerRendererChromium::LayerRendererChromium(CCRendererClient* client,
CCResourceProvider* resourceProvider,
TextureUploaderOption textureUploaderSetting)
- : CCRenderer(client)
+ : CCDirectRenderer(client, resourceProvider)
, m_offscreenFramebufferId(0)
, m_sharedGeometryQuad(FloatRect(-0.5f, -0.5f, 1.0f, 1.0f))
- , m_resourceProvider(resourceProvider)
, m_context(resourceProvider->graphicsContext3D())
, m_isViewportChanged(false)
, m_isFramebufferDiscarded(false)
@@ -186,6 +114,7 @@ bool LayerRendererChromium::initialize()
return false;
m_context->setContextLostCallback(this);
+ m_context->pushGroupMarkerEXT("CompositorContext");
WebKit::WebString extensionsWebString = m_context->getString(GraphicsContext3D::EXTENSIONS);
String extensionsString(extensionsWebString.data(), extensionsWebString.length());
@@ -298,83 +227,7 @@ void LayerRendererChromium::clearFramebuffer(DrawingFrame& frame)
m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT);
}
-// static
-IntSize LayerRendererChromium::renderPassTextureSize(const CCRenderPass* pass)
-{
- return pass->outputRect().size();
-}
-
-// static
-GC3Denum LayerRendererChromium::renderPassTextureFormat(const CCRenderPass*)
-{
- return GraphicsContext3D::RGBA;
-}
-
-void LayerRendererChromium::decideRenderPassAllocationsForFrame(const CCRenderPassList& renderPassesInDrawOrder)
-{
- HashMap<int, const CCRenderPass*> renderPassesInFrame;
- for (size_t i = 0; i < renderPassesInDrawOrder.size(); ++i)
- renderPassesInFrame.set(renderPassesInDrawOrder[i]->id(), renderPassesInDrawOrder[i]);
-
- Vector<int> passesToDelete;
- HashMap<int, OwnPtr<CachedTexture> >::const_iterator passIterator;
- for (passIterator = m_renderPassTextures.begin(); passIterator != m_renderPassTextures.end(); ++passIterator) {
- const CCRenderPass* renderPassInFrame = renderPassesInFrame.get(passIterator->first);
- if (!renderPassInFrame) {
- passesToDelete.append(passIterator->first);
- continue;
- }
-
- const IntSize& requiredSize = renderPassTextureSize(renderPassInFrame);
- GC3Denum requiredFormat = renderPassTextureFormat(renderPassInFrame);
- CachedTexture* texture = passIterator->second.get();
- ASSERT(texture);
-
- if (texture->id() && (texture->size() != requiredSize || texture->format() != requiredFormat))
- texture->free();
- }
-
- // Delete RenderPass textures from the previous frame that will not be used again.
- for (size_t i = 0; i < passesToDelete.size(); ++i)
- m_renderPassTextures.remove(passesToDelete[i]);
-
- for (size_t i = 0; i < renderPassesInDrawOrder.size(); ++i) {
- if (!m_renderPassTextures.contains(renderPassesInDrawOrder[i]->id())) {
- OwnPtr<CachedTexture> texture = CachedTexture::create(m_resourceProvider);
- m_renderPassTextures.set(renderPassesInDrawOrder[i]->id(), texture.release());
- }
- }
-}
-
-bool LayerRendererChromium::haveCachedResourcesForRenderPassId(int id) const
-{
- CachedTexture* texture = m_renderPassTextures.get(id);
- return texture && texture->id() && texture->isComplete();
-}
-
-void LayerRendererChromium::drawFrame(const CCRenderPassList& renderPassesInDrawOrder, const CCRenderPassIdHashMap& renderPassesById)
-{
- const CCRenderPass* rootRenderPass = renderPassesInDrawOrder.last();
- ASSERT(rootRenderPass);
-
- DrawingFrame frame;
- frame.renderPassesById = &renderPassesById;
- frame.rootRenderPass = rootRenderPass;
-
- frame.rootDamageRect = m_capabilities.usingPartialSwap ? frame.rootRenderPass->damageRect() : frame.rootRenderPass->outputRect();
- frame.rootDamageRect.intersect(IntRect(IntPoint::zero(), viewportSize()));
-
- beginDrawingFrame();
-
- for (size_t i = 0; i < renderPassesInDrawOrder.size(); ++i)
- drawRenderPass(frame, renderPassesInDrawOrder[i]);
-
- finishDrawingFrame();
-
- m_swapBufferRect.unite(enclosingIntRect(frame.rootDamageRect));
-}
-
-void LayerRendererChromium::beginDrawingFrame()
+void LayerRendererChromium::beginDrawingFrame(DrawingFrame& frame)
{
// FIXME: Remove this once framebuffer is automatically recreated on first use
ensureFramebuffer();
@@ -408,39 +261,8 @@ void LayerRendererChromium::doNoOp()
GLC(m_context, m_context->flush());
}
-void LayerRendererChromium::drawRenderPass(DrawingFrame& frame, const CCRenderPass* renderPass)
+void LayerRendererChromium::drawQuad(DrawingFrame& frame, const CCDrawQuad* quad)
{
- if (!useRenderPass(frame, renderPass))
- return;
-
- FloatRect scissorRect = renderPass->outputRect();
- if (frame.rootDamageRect != frame.rootRenderPass->outputRect()) {
- WebTransformationMatrix inverseTransformToRoot = renderPass->transformToRootTarget().inverse();
- scissorRect.intersect(CCMathUtil::projectClippedRect(inverseTransformToRoot, frame.rootDamageRect));
- }
-
- if (scissorRect != renderPass->outputRect())
- setScissorToRect(frame, enclosingIntRect(scissorRect));
- else
- GLC(m_context, m_context->disable(GraphicsContext3D::SCISSOR_TEST));
-
- clearFramebuffer(frame);
-
- const CCQuadList& quadList = renderPass->quadList();
- for (CCQuadList::constBackToFrontIterator it = quadList.backToFrontBegin(); it != quadList.backToFrontEnd(); ++it)
- drawQuad(frame, it->get(), scissorRect);
-
- CachedTexture* texture = m_renderPassTextures.get(renderPass->id());
- if (texture)
- texture->setIsComplete(!renderPass->hasOcclusionFromOutsideTargetSurface());
-}
-
-void LayerRendererChromium::drawQuad(DrawingFrame& frame, const CCDrawQuad* quad, FloatRect scissorRect)
-{
- scissorRect.intersect(quad->clippedRectInTarget());
- if (scissorRect.isEmpty())
- return;
-
if (quad->needsBlending())
GLC(m_context, m_context->enable(GraphicsContext3D::BLEND));
else
@@ -480,7 +302,7 @@ void LayerRendererChromium::drawQuad(DrawingFrame& frame, const CCDrawQuad* quad
}
}
-void LayerRendererChromium::drawCheckerboardQuad(DrawingFrame& frame, const CCCheckerboardDrawQuad* quad)
+void LayerRendererChromium::drawCheckerboardQuad(const DrawingFrame& frame, const CCCheckerboardDrawQuad* quad)
{
const TileCheckerboardProgram* program = tileCheckerboardProgram();
ASSERT(program && program->initialized());
@@ -502,7 +324,7 @@ void LayerRendererChromium::drawCheckerboardQuad(DrawingFrame& frame, const CCCh
drawQuadGeometry(frame, quad->quadTransform(), quad->quadRect(), program->vertexShader().matrixLocation());
}
-void LayerRendererChromium::drawDebugBorderQuad(DrawingFrame& frame, const CCDebugBorderDrawQuad* quad)
+void LayerRendererChromium::drawDebugBorderQuad(const DrawingFrame& frame, const CCDebugBorderDrawQuad* quad)
{
static float glMatrix[16];
const SolidColorProgram* program = solidColorProgram();
@@ -759,7 +581,7 @@ void LayerRendererChromium::drawRenderPassQuad(DrawingFrame& frame, const CCRend
drawQuadGeometry(frame, quad->quadTransform(), quad->quadRect(), shaderMatrixLocation);
}
-void LayerRendererChromium::drawSolidColorQuad(DrawingFrame& frame, const CCSolidColorDrawQuad* quad)
+void LayerRendererChromium::drawSolidColorQuad(const DrawingFrame& frame, const CCSolidColorDrawQuad* quad)
{
const SolidColorProgram* program = solidColorProgram();
GLC(context(), context()->useProgram(program->program()));
@@ -798,7 +620,7 @@ static void tileUniformLocation(T program, TileProgramUniforms& uniforms)
uniforms.edgeLocation = program->fragmentShader().edgeLocation();
}
-void LayerRendererChromium::drawTileQuad(DrawingFrame& frame, const CCTileDrawQuad* quad)
+void LayerRendererChromium::drawTileQuad(const DrawingFrame& frame, const CCTileDrawQuad* quad)
{
IntRect tileRect = quad->quadVisibleRect();
@@ -965,7 +787,7 @@ void LayerRendererChromium::drawTileQuad(DrawingFrame& frame, const CCTileDrawQu
drawQuadGeometry(frame, quad->quadTransform(), centeredRect, uniforms.matrixLocation);
}
-void LayerRendererChromium::drawYUVVideoQuad(DrawingFrame& frame, const CCYUVVideoDrawQuad* quad)
+void LayerRendererChromium::drawYUVVideoQuad(const DrawingFrame& frame, const CCYUVVideoDrawQuad* quad)
{
const VideoYUVProgram* program = videoYUVProgram();
ASSERT(program && program->initialized());
@@ -1025,7 +847,7 @@ void LayerRendererChromium::drawYUVVideoQuad(DrawingFrame& frame, const CCYUVVid
GLC(context(), context()->activeTexture(GraphicsContext3D::TEXTURE0));
}
-void LayerRendererChromium::drawStreamVideoQuad(DrawingFrame& frame, const CCStreamVideoDrawQuad* quad)
+void LayerRendererChromium::drawStreamVideoQuad(const DrawingFrame& frame, const CCStreamVideoDrawQuad* quad)
{
static float glMatrix[16];
@@ -1070,7 +892,7 @@ struct TexTransformTextureProgramBinding : TextureProgramBinding {
int texTransformLocation;
};
-void LayerRendererChromium::drawTextureQuad(DrawingFrame& frame, const CCTextureDrawQuad* quad)
+void LayerRendererChromium::drawTextureQuad(const DrawingFrame& frame, const CCTextureDrawQuad* quad)
{
ASSERT(CCProxy::isImplThread());
@@ -1114,7 +936,7 @@ void LayerRendererChromium::drawTextureQuad(DrawingFrame& frame, const CCTexture
GLC(m_context, m_context->blendFunc(GraphicsContext3D::ONE, GraphicsContext3D::ONE_MINUS_SRC_ALPHA));
}
-void LayerRendererChromium::drawIOSurfaceQuad(DrawingFrame& frame, const CCIOSurfaceDrawQuad* quad)
+void LayerRendererChromium::drawIOSurfaceQuad(const DrawingFrame& frame, const CCIOSurfaceDrawQuad* quad)
{
ASSERT(CCProxy::isImplThread());
TexTransformTextureProgramBinding binding;
@@ -1136,8 +958,11 @@ void LayerRendererChromium::drawIOSurfaceQuad(DrawingFrame& frame, const CCIOSur
GLC(context(), context()->bindTexture(Extensions3D::TEXTURE_RECTANGLE_ARB, 0));
}
-void LayerRendererChromium::finishDrawingFrame()
+void LayerRendererChromium::finishDrawingFrame(DrawingFrame& frame)
{
+ m_currentFramebufferLock.clear();
+ m_swapBufferRect.unite(enclosingIntRect(frame.rootDamageRect));
+
GLC(m_context, m_context->disable(GraphicsContext3D::SCISSOR_TEST));
GLC(m_context, m_context->disable(GraphicsContext3D::BLEND));
}
@@ -1185,20 +1010,18 @@ void LayerRendererChromium::setShaderOpacity(float opacity, int alphaLocation)
GLC(m_context, m_context->uniform1f(alphaLocation, opacity));
}
-void LayerRendererChromium::drawQuadGeometry(DrawingFrame& frame, const WebKit::WebTransformationMatrix& drawTransform, const FloatRect& quadRect, int matrixLocation)
+void LayerRendererChromium::drawQuadGeometry(const DrawingFrame& frame, const WebKit::WebTransformationMatrix& drawTransform, const FloatRect& quadRect, int matrixLocation)
{
- WebTransformationMatrix quadMatrix = drawTransform;
- quadMatrix.translate(0.5 * quadRect.width() + quadRect.x(), 0.5 * quadRect.height() + quadRect.y());
- quadMatrix.scaleNonUniform(quadRect.width(), quadRect.height());
-
+ WebTransformationMatrix quadRectMatrix;
+ quadRectTransform(&quadRectMatrix, drawTransform, quadRect);
static float glMatrix[16];
- toGLMatrix(&glMatrix[0], frame.projectionMatrix * quadMatrix);
+ toGLMatrix(&glMatrix[0], frame.projectionMatrix * quadRectMatrix);
GLC(m_context, m_context->uniformMatrix4fv(matrixLocation, 1, false, &glMatrix[0]));
GLC(m_context, m_context->drawElements(GraphicsContext3D::TRIANGLES, 6, GraphicsContext3D::UNSIGNED_SHORT, 0));
}
-void LayerRendererChromium::copyTextureToFramebuffer(DrawingFrame& frame, int textureId, const IntRect& rect, const WebTransformationMatrix& drawMatrix)
+void LayerRendererChromium::copyTextureToFramebuffer(const DrawingFrame& frame, int textureId, const IntRect& rect, const WebTransformationMatrix& drawMatrix)
{
const RenderPassProgram* program = renderPassProgram();
@@ -1383,31 +1206,6 @@ bool LayerRendererChromium::getFramebufferTexture(CCScopedTexture* texture, cons
return true;
}
-bool LayerRendererChromium::isCurrentRenderPass(DrawingFrame& frame, const CCRenderPass* renderPass)
-{
- return frame.currentRenderPass == renderPass && !frame.currentTexture;
-}
-
-bool LayerRendererChromium::useRenderPass(DrawingFrame& frame, const CCRenderPass* renderPass)
-{
- frame.currentRenderPass = renderPass;
- frame.currentTexture = 0;
-
- if (renderPass == frame.rootRenderPass) {
- frame.currentFramebufferLock.clear();
- GLC(m_context, m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0));
- setDrawFramebufferRect(frame, renderPass->outputRect(), true);
- return true;
- }
-
- CachedTexture* texture = m_renderPassTextures.get(renderPass->id());
- ASSERT(texture);
- if (!texture->id() && !texture->allocate(CCRenderer::ImplPool, renderPassTextureSize(renderPass), renderPassTextureFormat(renderPass), CCResourceProvider::TextureUsageFramebuffer))
- return false;
-
- return bindFramebufferToTexture(frame, texture, renderPass->outputRect());
-}
-
bool LayerRendererChromium::useScopedTexture(DrawingFrame& frame, const CCScopedTexture* texture, const IntRect& viewportRect)
{
ASSERT(texture->id());
@@ -1417,13 +1215,19 @@ bool LayerRendererChromium::useScopedTexture(DrawingFrame& frame, const CCScoped
return bindFramebufferToTexture(frame, texture, viewportRect);
}
+void LayerRendererChromium::bindFramebufferToOutputSurface(DrawingFrame& frame)
+{
+ m_currentFramebufferLock.clear();
+ GLC(m_context, m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0));
+}
+
bool LayerRendererChromium::bindFramebufferToTexture(DrawingFrame& frame, const CCScopedTexture* texture, const IntRect& framebufferRect)
{
ASSERT(texture->id());
GLC(m_context, m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_offscreenFramebufferId));
- frame.currentFramebufferLock = adoptPtr(new CCScopedLockResourceForWrite(m_resourceProvider, texture->id()));
- unsigned textureId = frame.currentFramebufferLock->textureId();
+ m_currentFramebufferLock = adoptPtr(new CCScopedLockResourceForWrite(m_resourceProvider, texture->id()));
+ unsigned textureId = m_currentFramebufferLock->textureId();
GLC(m_context, m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, textureId, 0));
#if !defined ( NDEBUG )
@@ -1433,51 +1237,32 @@ bool LayerRendererChromium::bindFramebufferToTexture(DrawingFrame& frame, const
}
#endif
- setDrawFramebufferRect(frame, framebufferRect, false);
+ initializeMatrices(frame, framebufferRect, false);
+ setDrawViewportSize(framebufferRect.size());
return true;
}
-// Sets the scissor region to the given rectangle. The coordinate system for the
-// scissorRect has its origin at the top left corner of the current visible rect.
-void LayerRendererChromium::setScissorToRect(DrawingFrame& frame, const IntRect& scissorRect)
+void LayerRendererChromium::enableScissorTestRect(const IntRect& scissorRect)
{
- IntRect framebufferOutputRect = frame.currentRenderPass->outputRect();
-
GLC(m_context, m_context->enable(GraphicsContext3D::SCISSOR_TEST));
-
- // The scissor coordinates must be supplied in viewport space so we need to offset
- // by the relative position of the top left corner of the current render pass.
- int scissorX = scissorRect.x() - framebufferOutputRect.x();
- // When rendering to the default render surface we're rendering upside down so the top
- // of the GL scissor is the bottom of our layer.
- // But, if rendering to offscreen texture, we reverse our sense of 'upside down'.
- int scissorY;
- if (isCurrentRenderPass(frame, frame.rootRenderPass))
- scissorY = framebufferOutputRect.height() - (scissorRect.maxY() - framebufferOutputRect.y());
- else
- scissorY = scissorRect.y() - framebufferOutputRect.y();
- GLC(m_context, m_context->scissor(scissorX, scissorY, scissorRect.width(), scissorRect.height()));
+ GLC(m_context, m_context->scissor(scissorRect.x(), scissorRect.y(), scissorRect.width(), scissorRect.height()));
}
-bool LayerRendererChromium::makeContextCurrent()
+void LayerRendererChromium::disableScissorTest()
{
- return m_context->makeContextCurrent();
+ GLC(m_context, m_context->disable(GraphicsContext3D::SCISSOR_TEST));
}
-// Sets the coordinate range of content that ends being drawn onto the target render surface.
-// The target render surface is assumed to have an origin at 0, 0 and the width and height of
-// of the drawRect.
-void LayerRendererChromium::setDrawFramebufferRect(DrawingFrame& frame, const IntRect& drawRect, bool flipY)
+void LayerRendererChromium::setDrawViewportSize(const IntSize& viewportSize)
{
- if (flipY)
- frame.projectionMatrix = orthoMatrix(drawRect.x(), drawRect.maxX(), drawRect.maxY(), drawRect.y());
- else
- frame.projectionMatrix = orthoMatrix(drawRect.x(), drawRect.maxX(), drawRect.y(), drawRect.maxY());
- GLC(m_context, m_context->viewport(0, 0, drawRect.width(), drawRect.height()));
- frame.windowMatrix = screenMatrix(0, 0, drawRect.width(), drawRect.height());
+ GLC(m_context, m_context->viewport(0, 0, viewportSize.width(), viewportSize.height()));
}
+bool LayerRendererChromium::makeContextCurrent()
+{
+ return m_context->makeContextCurrent();
+}
bool LayerRendererChromium::initializeSharedObjects()
{
@@ -1489,7 +1274,7 @@ 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));
+ m_sharedGeometry = adoptPtr(new GeometryBinding(m_context, quadVertexRect()));
m_renderPassProgram = adoptPtr(new RenderPassProgram(m_context));
m_tileProgram = adoptPtr(new TileProgram(m_context));
m_tileProgramOpaque = adoptPtr(new TileProgramOpaque(m_context));
diff --git a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
index 179103359..09cd0e291 100644
--- a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
+++ b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
@@ -34,18 +34,19 @@
#if USE(ACCELERATED_COMPOSITING)
+#include "CCCheckerboardDrawQuad.h"
+#include "CCDebugBorderDrawQuad.h"
+#include "CCDirectRenderer.h"
+#include "CCIOSurfaceDrawQuad.h"
+#include "CCRenderPassDrawQuad.h"
+#include "CCRenderer.h"
+#include "CCSolidColorDrawQuad.h"
+#include "CCStreamVideoDrawQuad.h"
+#include "CCTextureDrawQuad.h"
+#include "CCTileDrawQuad.h"
+#include "CCYUVVideoDrawQuad.h"
#include "Extensions3DChromium.h"
#include "TextureCopier.h"
-#include "cc/CCCheckerboardDrawQuad.h"
-#include "cc/CCDebugBorderDrawQuad.h"
-#include "cc/CCIOSurfaceDrawQuad.h"
-#include "cc/CCRenderPassDrawQuad.h"
-#include "cc/CCRenderer.h"
-#include "cc/CCSolidColorDrawQuad.h"
-#include "cc/CCStreamVideoDrawQuad.h"
-#include "cc/CCTextureDrawQuad.h"
-#include "cc/CCTileDrawQuad.h"
-#include "cc/CCYUVVideoDrawQuad.h"
#include <wtf/PassOwnPtr.h>
namespace WebKit {
@@ -59,7 +60,7 @@ class GeometryBinding;
class ScopedEnsureFramebufferAllocation;
// Class that handles drawing of composited render layers using GL.
-class LayerRendererChromium : public CCRenderer,
+class LayerRendererChromium : public CCDirectRenderer,
public WebKit::WebGraphicsContext3D::WebGraphicsSwapBuffersCompleteCallbackCHROMIUM,
public WebKit::WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM ,
public WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback {
@@ -77,11 +78,6 @@ public:
const FloatQuad& sharedGeometryQuad() const { return m_sharedGeometryQuad; }
- virtual void decideRenderPassAllocationsForFrame(const CCRenderPassList&) OVERRIDE;
- virtual bool haveCachedResourcesForRenderPassId(int id) const OVERRIDE;
-
- virtual void drawFrame(const CCRenderPassList&, const CCRenderPassIdHashMap&) OVERRIDE;
-
// waits for rendering to finish
virtual void finish() OVERRIDE;
@@ -103,73 +99,45 @@ public:
virtual void setVisible(bool) OVERRIDE;
- CCResourceProvider* resourceProvider() const { return m_resourceProvider; }
-
protected:
LayerRendererChromium(CCRendererClient*, CCResourceProvider*, TextureUploaderOption);
-
bool isFramebufferDiscarded() const { return m_isFramebufferDiscarded; }
bool initialize();
void releaseRenderPassTextures();
-private:
- struct DrawingFrame {
- const CCRenderPassIdHashMap* renderPassesById;
- const CCRenderPass* rootRenderPass;
- const CCRenderPass* currentRenderPass;
- const CCScopedTexture* currentTexture;
- OwnPtr<CCScopedLockResourceForWrite> currentFramebufferLock;
-
- FloatRect rootDamageRect;
-
- WebKit::WebTransformationMatrix projectionMatrix;
- WebKit::WebTransformationMatrix windowMatrix;
-
- DrawingFrame()
- : rootRenderPass(0)
- , currentRenderPass(0)
- , currentTexture(0)
- { }
- };
+ virtual void bindFramebufferToOutputSurface(DrawingFrame&) OVERRIDE;
+ virtual bool bindFramebufferToTexture(DrawingFrame&, const CCScopedTexture*, const IntRect& framebufferRect) OVERRIDE;
+ virtual void setDrawViewportSize(const IntSize&) OVERRIDE;
+ virtual void enableScissorTestRect(const IntRect& scissorRect) OVERRIDE;
+ virtual void disableScissorTest() OVERRIDE;
+ virtual void clearFramebuffer(DrawingFrame&) OVERRIDE;
+ virtual void drawQuad(DrawingFrame&, const CCDrawQuad*) OVERRIDE;
+ virtual void beginDrawingFrame(DrawingFrame&) OVERRIDE;
+ virtual void finishDrawingFrame(DrawingFrame&) OVERRIDE;
+private:
static void toGLMatrix(float*, const WebKit::WebTransformationMatrix&);
- void beginDrawingFrame();
- void drawRenderPass(DrawingFrame&, const CCRenderPass*);
- void finishDrawingFrame();
-
- void drawQuad(DrawingFrame&, const CCDrawQuad*, FloatRect scissorRect);
- void drawCheckerboardQuad(DrawingFrame&, const CCCheckerboardDrawQuad*);
- void drawDebugBorderQuad(DrawingFrame&, const CCDebugBorderDrawQuad*);
+ void drawCheckerboardQuad(const DrawingFrame&, const CCCheckerboardDrawQuad*);
+ void drawDebugBorderQuad(const DrawingFrame&, const CCDebugBorderDrawQuad*);
PassOwnPtr<CCScopedTexture> drawBackgroundFilters(DrawingFrame&, const CCRenderPassDrawQuad*, const WebKit::WebFilterOperations&, const WebKit::WebTransformationMatrix& deviceTransform);
void drawRenderPassQuad(DrawingFrame&, const CCRenderPassDrawQuad*);
- void drawSolidColorQuad(DrawingFrame&, const CCSolidColorDrawQuad*);
- void drawStreamVideoQuad(DrawingFrame&, const CCStreamVideoDrawQuad*);
- void drawTextureQuad(DrawingFrame&, const CCTextureDrawQuad*);
- void drawIOSurfaceQuad(DrawingFrame&, const CCIOSurfaceDrawQuad*);
- void drawTileQuad(DrawingFrame&, const CCTileDrawQuad*);
- void drawYUVVideoQuad(DrawingFrame&, const CCYUVVideoDrawQuad*);
+ void drawSolidColorQuad(const DrawingFrame&, const CCSolidColorDrawQuad*);
+ void drawStreamVideoQuad(const DrawingFrame&, const CCStreamVideoDrawQuad*);
+ void drawTextureQuad(const DrawingFrame&, const CCTextureDrawQuad*);
+ void drawIOSurfaceQuad(const DrawingFrame&, const CCIOSurfaceDrawQuad*);
+ void drawTileQuad(const DrawingFrame&, const CCTileDrawQuad*);
+ void drawYUVVideoQuad(const DrawingFrame&, const CCYUVVideoDrawQuad*);
void setShaderOpacity(float opacity, int alphaLocation);
void setShaderFloatQuad(const FloatQuad&, int quadLocation);
- void drawQuadGeometry(DrawingFrame&, const WebKit::WebTransformationMatrix& drawTransform, const FloatRect& quadRect, int matrixLocation);
-
- void copyTextureToFramebuffer(DrawingFrame&, int textureId, const IntRect&, const WebKit::WebTransformationMatrix& drawMatrix);
-
- void setScissorToRect(DrawingFrame&, const IntRect&);
+ void drawQuadGeometry(const DrawingFrame&, const WebKit::WebTransformationMatrix& drawTransform, const FloatRect& quadRect, int matrixLocation);
- void setDrawFramebufferRect(DrawingFrame&, const IntRect&, bool flipY);
+ void copyTextureToFramebuffer(const DrawingFrame&, int textureId, const IntRect&, const WebKit::WebTransformationMatrix& drawMatrix);
- // The current drawing target is either a RenderPass or ScopedTexture. Use these functions to switch to a new drawing target.
- bool useRenderPass(DrawingFrame&, const CCRenderPass*);
bool useScopedTexture(DrawingFrame&, const CCScopedTexture*, const IntRect& viewportRect);
- bool isCurrentRenderPass(DrawingFrame&, const CCRenderPass*);
-
- bool bindFramebufferToTexture(DrawingFrame&, const CCScopedTexture*, const IntRect& viewportRect);
-
- void clearFramebuffer(DrawingFrame&);
bool makeContextCurrent();
@@ -188,9 +156,6 @@ private:
// WebGraphicsContext3D::WebGraphicsContextLostCallback implementation.
virtual void onContextLost() OVERRIDE;
- static IntSize renderPassTextureSize(const CCRenderPass*);
- static GC3Denum renderPassTextureFormat(const CCRenderPass*);
-
LayerRendererCapabilities m_capabilities;
unsigned m_offscreenFramebufferId;
@@ -198,8 +163,6 @@ private:
OwnPtr<GeometryBinding> m_sharedGeometry;
FloatQuad m_sharedGeometryQuad;
- class CachedTexture;
-
// This block of bindings defines all of the programs used by the compositor itself.
// Tiled layer shaders.
@@ -273,12 +236,9 @@ private:
OwnPtr<SolidColorProgram> m_solidColorProgram;
- CCResourceProvider* m_resourceProvider;
OwnPtr<AcceleratedTextureCopier> m_textureCopier;
OwnPtr<TextureUploader> m_textureUploader;
- HashMap<int, OwnPtr<CachedTexture> > m_renderPassTextures;
-
WebKit::WebGraphicsContext3D* m_context;
IntRect m_swapBufferRect;
@@ -287,6 +247,8 @@ private:
bool m_isUsingBindUniform;
bool m_visible;
TextureUploaderOption m_textureUploaderSetting;
+
+ OwnPtr<CCScopedLockResourceForWrite> m_currentFramebufferLock;
};
diff --git a/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp b/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp
index b66d79e04..83c7114ba 100644
--- a/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp
+++ b/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp
@@ -49,17 +49,17 @@ LayerTextureSubImage::~LayerTextureSubImage()
}
void LayerTextureSubImage::upload(const uint8_t* image, const IntRect& imageRect,
- const IntRect& sourceRect, const IntRect& destRect,
+ const IntRect& sourceRect, const IntSize& destOffset,
GC3Denum format, WebGraphicsContext3D* context)
{
if (m_useMapTexSubImage)
- uploadWithMapTexSubImage(image, imageRect, sourceRect, destRect, format, context);
+ uploadWithMapTexSubImage(image, imageRect, sourceRect, destOffset, format, context);
else
- uploadWithTexSubImage(image, imageRect, sourceRect, destRect, format, context);
+ uploadWithTexSubImage(image, imageRect, sourceRect, destOffset, format, context);
}
void LayerTextureSubImage::uploadWithTexSubImage(const uint8_t* image, const IntRect& imageRect,
- const IntRect& sourceRect, const IntRect& destRect,
+ const IntRect& sourceRect, const IntSize& destOffset,
GC3Denum format, WebGraphicsContext3D* context)
{
TRACE_EVENT0("cc", "LayerTextureSubImage::uploadWithTexSubImage");
@@ -71,26 +71,26 @@ void LayerTextureSubImage::uploadWithTexSubImage(const uint8_t* image, const Int
if (imageRect.width() == sourceRect.width() && !offset.x())
pixelSource = &image[4 * offset.y() * imageRect.width()];
else {
- size_t neededSize = 4 * destRect.width() * destRect.height();
+ size_t neededSize = 4 * sourceRect.width() * sourceRect.height();
if (m_subImageSize < neededSize) {
m_subImage = adoptArrayPtr(new uint8_t[neededSize]);
m_subImageSize = neededSize;
}
// Strides not equal, so do a row-by-row memcpy from the
// paint results into a temp buffer for uploading.
- for (int row = 0; row < destRect.height(); ++row)
- memcpy(&m_subImage[destRect.width() * 4 * row],
+ for (int row = 0; row < sourceRect.height(); ++row)
+ memcpy(&m_subImage[sourceRect.width() * 4 * row],
&image[4 * (offset.x() + (offset.y() + row) * imageRect.width())],
- destRect.width() * 4);
+ sourceRect.width() * 4);
pixelSource = &m_subImage[0];
}
- GLC(context, context->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, destRect.x(), destRect.y(), destRect.width(), destRect.height(), format, GraphicsContext3D::UNSIGNED_BYTE, pixelSource));
+ GLC(context, context->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, destOffset.width(), destOffset.height(), sourceRect.width(), sourceRect.height(), format, GraphicsContext3D::UNSIGNED_BYTE, pixelSource));
}
void LayerTextureSubImage::uploadWithMapTexSubImage(const uint8_t* image, const IntRect& imageRect,
- const IntRect& sourceRect, const IntRect& destRect,
+ const IntRect& sourceRect, const IntSize& destOffset,
GC3Denum format, WebGraphicsContext3D* context)
{
TRACE_EVENT0("cc", "LayerTextureSubImage::uploadWithMapTexSubImage");
@@ -98,10 +98,10 @@ 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
- uint8_t* pixelDest = static_cast<uint8_t*>(context->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*>(context->mapTexSubImage2DCHROMIUM(GraphicsContext3D::TEXTURE_2D, 0, destOffset.width(), destOffset.height(), sourceRect.width(), sourceRect.height(), format, GraphicsContext3D::UNSIGNED_BYTE, Extensions3DChromium::WRITE_ONLY));
if (!pixelDest) {
- uploadWithTexSubImage(image, imageRect, sourceRect, destRect, format, context);
+ uploadWithTexSubImage(image, imageRect, sourceRect, destOffset, format, context);
return;
}
@@ -113,14 +113,14 @@ void LayerTextureSubImage::uploadWithMapTexSubImage(const uint8_t* image, const
}
if (imageRect.width() == sourceRect.width() && !offset.x())
- memcpy(pixelDest, &image[offset.y() * imageRect.width() * componentsPerPixel * bytesPerComponent], imageRect.width() * destRect.height() * componentsPerPixel * bytesPerComponent);
+ memcpy(pixelDest, &image[offset.y() * imageRect.width() * componentsPerPixel * bytesPerComponent], imageRect.width() * sourceRect.height() * componentsPerPixel * bytesPerComponent);
else {
// Strides not equal, so do a row-by-row memcpy from the
// paint results into the pixelDest
- for (int row = 0; row < destRect.height(); ++row)
- memcpy(&pixelDest[destRect.width() * row * componentsPerPixel * bytesPerComponent],
+ for (int row = 0; row < sourceRect.height(); ++row)
+ memcpy(&pixelDest[sourceRect.width() * row * componentsPerPixel * bytesPerComponent],
&image[4 * (offset.x() + (offset.y() + row) * imageRect.width())],
- destRect.width() * componentsPerPixel * bytesPerComponent);
+ sourceRect.width() * componentsPerPixel * bytesPerComponent);
}
GLC(context, context->unmapTexSubImage2DCHROMIUM(pixelDest));
}
diff --git a/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.h b/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.h
index 357b64134..e2a739a0f 100644
--- a/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.h
+++ b/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.h
@@ -46,15 +46,15 @@ public:
~LayerTextureSubImage();
void upload(const uint8_t* image, const IntRect& imageRect,
- const IntRect& sourceRect, const IntRect& destRect,
+ const IntRect& sourceRect, const IntSize& destOffset,
GC3Denum format, WebKit::WebGraphicsContext3D*);
private:
void uploadWithTexSubImage(const uint8_t* image, const IntRect& imageRect,
- const IntRect& sourceRect, const IntRect& destRect,
+ const IntRect& sourceRect, const IntSize& destOffset,
GC3Denum format, WebKit::WebGraphicsContext3D*);
void uploadWithMapTexSubImage(const uint8_t* image, const IntRect& imageRect,
- const IntRect& sourceRect, const IntRect& destRect,
+ const IntRect& sourceRect, const IntSize& destOffset,
GC3Denum format, WebKit::WebGraphicsContext3D*);
bool m_useMapTexSubImage;
diff --git a/Source/WebCore/platform/graphics/chromium/LayerTextureUpdater.h b/Source/WebCore/platform/graphics/chromium/LayerTextureUpdater.h
index e3ac49945..1ad61c8d8 100644
--- a/Source/WebCore/platform/graphics/chromium/LayerTextureUpdater.h
+++ b/Source/WebCore/platform/graphics/chromium/LayerTextureUpdater.h
@@ -29,8 +29,8 @@
#if USE(ACCELERATED_COMPOSITING)
+#include "CCPrioritizedTexture.h"
#include "GraphicsTypes3D.h"
-#include "cc/CCPrioritizedTexture.h"
#include <wtf/RefCounted.h>
namespace WebCore {
@@ -50,7 +50,7 @@ public:
CCPrioritizedTexture* texture() { return m_texture.get(); }
void swapTextureWith(OwnPtr<CCPrioritizedTexture>& texture) { m_texture.swap(texture); }
virtual void prepareRect(const IntRect& /* sourceRect */, CCRenderingStats&) { }
- virtual void updateRect(CCResourceProvider*, const IntRect& sourceRect, const IntRect& destRect) = 0;
+ virtual void updateRect(CCResourceProvider*, const IntRect& sourceRect, const IntSize& destOffset) = 0;
protected:
explicit Texture(PassOwnPtr<CCPrioritizedTexture> texture) : m_texture(texture) { }
diff --git a/Source/WebCore/platform/graphics/chromium/LinkHighlight.cpp b/Source/WebCore/platform/graphics/chromium/LinkHighlight.cpp
index 1b2c61e69..1d447304f 100644
--- a/Source/WebCore/platform/graphics/chromium/LinkHighlight.cpp
+++ b/Source/WebCore/platform/graphics/chromium/LinkHighlight.cpp
@@ -27,9 +27,9 @@
#include "LinkHighlight.h"
+#include "CCKeyframedAnimationCurve.h"
#include "GraphicsLayerChromium.h"
#include "PlatformContextSkia.h"
-#include "cc/CCKeyframedAnimationCurve.h"
#include <wtf/CurrentTime.h>
#include <wtf/OwnPtr.h>
diff --git a/Source/WebCore/platform/graphics/chromium/RateLimiter.cpp b/Source/WebCore/platform/graphics/chromium/RateLimiter.cpp
index 55a190290..c9d5f51e1 100644
--- a/Source/WebCore/platform/graphics/chromium/RateLimiter.cpp
+++ b/Source/WebCore/platform/graphics/chromium/RateLimiter.cpp
@@ -26,11 +26,11 @@
#include "config.h"
#if USE(ACCELERATED_COMPOSITING)
-
#include "RateLimiter.h"
+
+#include "CCProxy.h"
+#include "CCThread.h"
#include "TraceEvent.h"
-#include "cc/CCProxy.h"
-#include "cc/CCThread.h"
#include <public/WebGraphicsContext3D.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp b/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp
index ee9be6748..263b60186 100644
--- a/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp
@@ -29,8 +29,8 @@
#include "RenderSurfaceChromium.h"
+#include "CCMathUtil.h"
#include "LayerChromium.h"
-#include "cc/CCMathUtil.h"
#include <public/WebTransformationMatrix.h>
#include <wtf/text/CString.h>
diff --git a/Source/WebCore/platform/graphics/chromium/ScrollbarLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/ScrollbarLayerChromium.cpp
index a0fbf5c44..67fbd3679 100644
--- a/Source/WebCore/platform/graphics/chromium/ScrollbarLayerChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/ScrollbarLayerChromium.cpp
@@ -29,10 +29,10 @@
#include "ScrollbarLayerChromium.h"
#include "BitmapCanvasLayerTextureUpdater.h"
+#include "CCLayerTreeHost.h"
+#include "CCScrollbarLayerImpl.h"
+#include "CCTextureUpdateQueue.h"
#include "LayerPainterChromium.h"
-#include "cc/CCLayerTreeHost.h"
-#include "cc/CCScrollbarLayerImpl.h"
-#include "cc/CCTextureUpdateQueue.h"
#include <public/WebRect.h>
using WebKit::WebRect;
@@ -228,8 +228,8 @@ void ScrollbarLayerChromium::updatePart(LayerTextureUpdater* painter, LayerTextu
painter->prepareToUpdate(rect, rect.size(), 1, 1, paintedOpaqueRect, stats);
texture->prepareRect(rect, stats);
- IntRect destRect(IntPoint(), rect.size());
- TextureUploader::Parameters upload = { texture, rect, destRect };
+ IntSize destOffset(0, 0);
+ TextureUploader::Parameters upload = { texture, rect, destOffset };
queue.appendFullUpload(upload);
}
diff --git a/Source/WebCore/platform/graphics/chromium/SolidColorLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/SolidColorLayerChromium.cpp
index 0dc77ada8..0da63248a 100644
--- a/Source/WebCore/platform/graphics/chromium/SolidColorLayerChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/SolidColorLayerChromium.cpp
@@ -29,7 +29,7 @@
#include "SolidColorLayerChromium.h"
-#include "cc/CCSolidColorLayerImpl.h"
+#include "CCSolidColorLayerImpl.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/TextureCopier.h b/Source/WebCore/platform/graphics/chromium/TextureCopier.h
index afe2ec025..68b0f1656 100644
--- a/Source/WebCore/platform/graphics/chromium/TextureCopier.h
+++ b/Source/WebCore/platform/graphics/chromium/TextureCopier.h
@@ -51,7 +51,6 @@ public:
virtual void copyTexture(Parameters) = 0;
virtual void flush() = 0;
-protected:
virtual ~TextureCopier() { }
};
diff --git a/Source/WebCore/platform/graphics/chromium/TextureLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/TextureLayerChromium.cpp
index 7d575d31f..d2f469e36 100644
--- a/Source/WebCore/platform/graphics/chromium/TextureLayerChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/TextureLayerChromium.cpp
@@ -29,8 +29,8 @@
#include "TextureLayerChromium.h"
-#include "cc/CCLayerTreeHost.h"
-#include "cc/CCTextureLayerImpl.h"
+#include "CCLayerTreeHost.h"
+#include "CCTextureLayerImpl.h"
#include <public/WebGraphicsContext3D.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/TextureUploader.h b/Source/WebCore/platform/graphics/chromium/TextureUploader.h
index 7a51653f8..0a861612e 100644
--- a/Source/WebCore/platform/graphics/chromium/TextureUploader.h
+++ b/Source/WebCore/platform/graphics/chromium/TextureUploader.h
@@ -34,7 +34,7 @@ public:
struct Parameters {
LayerTextureUpdater::Texture* texture;
IntRect sourceRect;
- IntRect destRect;
+ IntSize destOffset;
};
virtual ~TextureUploader() { }
diff --git a/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.cpp b/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.cpp
index 93da189c5..b82ed2b97 100644
--- a/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.cpp
+++ b/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.cpp
@@ -122,7 +122,7 @@ void ThrottledTextureUploader::endUploads()
void ThrottledTextureUploader::uploadTexture(CCResourceProvider* resourceProvider, Parameters upload)
{
- upload.texture->updateRect(resourceProvider, upload.sourceRect, upload.destRect);
+ upload.texture->updateRect(resourceProvider, upload.sourceRect, upload.destOffset);
}
void ThrottledTextureUploader::processQueries()
diff --git a/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
index ccbd58d32..cce163522 100644
--- a/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
@@ -29,16 +29,14 @@
#include "TiledLayerChromium.h"
+#include "CCLayerImpl.h"
+#include "CCLayerTreeHost.h"
+#include "CCOverdrawMetrics.h"
+#include "CCTextureUpdateQueue.h"
+#include "CCTiledLayerImpl.h"
#include "GraphicsContext3D.h"
#include "Region.h"
#include "TextStream.h"
-
-#include "cc/CCLayerImpl.h"
-#include "cc/CCLayerTreeHost.h"
-#include "cc/CCOverdrawMetrics.h"
-#include "cc/CCTextureUpdateQueue.h"
-#include "cc/CCTiledLayerImpl.h"
-
#include <wtf/CurrentTime.h>
#include <wtf/MathExtras.h>
@@ -402,7 +400,7 @@ void TiledLayerChromium::markOcclusionsAndRequestTextures(int left, int top, int
// FIXME: This should not ever be null.
if (!tile)
continue;
- ASSERT(!tile->occluded); // Did resetUpdateState get skipped? Are we doing more than one occluded pass?
+ ASSERT(!tile->occluded); // Did resetUpdateState get skipped? Are we doing more than one occlusion pass?
IntRect visibleTileRect = intersection(m_tiler->tileBounds(i, j), visibleContentRect());
if (occlusion && occlusion->occluded(this, visibleTileRect)) {
tile->occluded = true;
@@ -529,10 +527,10 @@ void TiledLayerChromium::updateTileTextures(const IntRect& paintRect, int left,
const IntPoint anchor = m_tiler->tileRect(tile).location();
// Calculate tile-space rectangle to upload into.
- IntRect destRect(IntPoint(sourceRect.x() - anchor.x(), sourceRect.y() - anchor.y()), sourceRect.size());
- if (destRect.x() < 0)
+ IntSize destOffset(sourceRect.x() - anchor.x(), sourceRect.y() - anchor.y());
+ if (destOffset.width() < 0)
CRASH();
- if (destRect.y() < 0)
+ if (destOffset.height() < 0)
CRASH();
// Offset from paint rectangle to this tile's dirty rectangle.
@@ -541,12 +539,12 @@ void TiledLayerChromium::updateTileTextures(const IntRect& paintRect, int left,
CRASH();
if (paintOffset.y() < 0)
CRASH();
- if (paintOffset.x() + destRect.width() > paintRect.width())
+ if (paintOffset.x() + sourceRect.width() > paintRect.width())
CRASH();
- if (paintOffset.y() + destRect.height() > paintRect.height())
+ if (paintOffset.y() + sourceRect.height() > paintRect.height())
CRASH();
- TextureUploader::Parameters upload = { tile->texture(), sourceRect, destRect };
+ TextureUploader::Parameters upload = { tile->texture(), sourceRect, destOffset };
if (tile->partialUpdate)
queue.appendPartialUpload(upload);
else
@@ -560,31 +558,77 @@ void TiledLayerChromium::setTexturePriorities(const CCPriorityCalculator& priori
setTexturePrioritiesInRect(priorityCalc, visibleContentRect());
}
+namespace {
+// This picks a small animated layer to be anything less than one viewport. This
+// is specifically for page transitions which are viewport-sized layers. The extra
+// 64 pixels is due to these layers being slightly larger than the viewport in some cases.
+bool isSmallAnimatedLayer(TiledLayerChromium* layer)
+{
+ if (!layer->drawTransformIsAnimating() && !layer->screenSpaceTransformIsAnimating())
+ return false;
+ IntSize viewportSize = layer->layerTreeHost() ? layer->layerTreeHost()->deviceViewportSize() : IntSize();
+ IntRect contentRect(IntPoint::zero(), layer->contentBounds());
+ return contentRect.width() <= viewportSize.width() + 64
+ && contentRect.height() <= viewportSize.height() + 64;
+}
+
+// FIXME: Remove this and make this based on distance once distance can be calculated
+// for offscreen layers. For now, prioritize all small animated layers after 512
+// pixels of pre-painting.
+void setPriorityForTexture(const CCPriorityCalculator& priorityCalc,
+ const IntRect& visibleRect,
+ const IntRect& tileRect,
+ bool drawsToRoot,
+ bool isSmallAnimatedLayer,
+ CCPrioritizedTexture* texture)
+{
+ int priority = CCPriorityCalculator::lowestPriority();
+ if (!visibleRect.isEmpty())
+ priority = priorityCalc.priorityFromDistance(visibleRect, tileRect, drawsToRoot);
+ if (isSmallAnimatedLayer)
+ priority = CCPriorityCalculator::maxPriority(priority, priorityCalc.priorityFromDistance(512, drawsToRoot));
+ if (priority != CCPriorityCalculator::lowestPriority())
+ texture->setRequestPriority(priority);
+}
+}
+
void TiledLayerChromium::setTexturePrioritiesInRect(const CCPriorityCalculator& priorityCalc, const IntRect& visibleContentRect)
{
updateBounds();
resetUpdateState();
- IntRect prepaintRect = idlePaintRect(visibleContentRect);
+ if (m_tiler->hasEmptyBounds())
+ return;
+
bool drawsToRoot = !renderTarget()->parent();
+ bool smallAnimatedLayer = isSmallAnimatedLayer(this);
// Minimally create the tiles in the desired pre-paint rect.
- if (!prepaintRect.isEmpty()) {
+ IntRect createTilesRect = idlePaintRect(visibleContentRect);
+ if (!createTilesRect.isEmpty()) {
int left, top, right, bottom;
- m_tiler->contentRectToTileIndices(prepaintRect, left, top, right, bottom);
- for (int j = top; j <= bottom; ++j)
- for (int i = left; i <= right; ++i)
+ m_tiler->contentRectToTileIndices(createTilesRect, left, top, right, bottom);
+ for (int j = top; j <= bottom; ++j) {
+ for (int i = left; i <= right; ++i) {
if (!tileAt(i, j))
createTile(i, j);
+ }
+ }
}
+ // Also, minimally create all tiles for small animated layers and also
+ // double-buffer them since we have limited their size to be reasonable.
+ IntRect doubleBufferedRect = visibleContentRect;
+ if (smallAnimatedLayer)
+ doubleBufferedRect = IntRect(IntPoint::zero(), contentBounds());
+
// Create additional textures for double-buffered updates when needed.
// These textures must stay alive while the updated textures are incrementally
// uploaded, swapped atomically via pushProperties, and finally deleted
// after the commit is complete, after which they can be recycled.
- if (!visibleContentRect.isEmpty()) {
+ if (!doubleBufferedRect.isEmpty()) {
int left, top, right, bottom;
- m_tiler->contentRectToTileIndices(visibleContentRect, left, top, right, bottom);
+ m_tiler->contentRectToTileIndices(doubleBufferedRect, left, top, right, bottom);
for (int j = top; j <= bottom; ++j) {
for (int i = left; i <= right; ++i) {
UpdatableTile* tile = tileAt(i, j);
@@ -600,9 +644,10 @@ void TiledLayerChromium::setTexturePrioritiesInRect(const CCPriorityCalculator&
continue;
}
- tile->dirtyRect = m_tiler->tileRect(tile);
+ IntRect tileRect = m_tiler->tileRect(tile);
+ tile->dirtyRect = tileRect;
LayerTextureUpdater::Texture* backBuffer = tile->texture();
- backBuffer->texture()->setRequestPriority(priorityCalc.priorityFromVisibility(true, drawsToRoot));
+ setPriorityForTexture(priorityCalc, visibleContentRect, tile->dirtyRect, drawsToRoot, smallAnimatedLayer, backBuffer->texture());
OwnPtr<CCPrioritizedTexture> frontBuffer = CCPrioritizedTexture::create(backBuffer->texture()->textureManager(),
backBuffer->texture()->size(),
backBuffer->texture()->format());
@@ -613,18 +658,14 @@ void TiledLayerChromium::setTexturePrioritiesInRect(const CCPriorityCalculator&
}
}
- // Now set priorities on all tiles.
+ // Now update priorities on all tiles we have in the layer, no matter where they are.
for (CCLayerTilingData::TileMap::const_iterator iter = m_tiler->tiles().begin(); iter != m_tiler->tiles().end(); ++iter) {
UpdatableTile* tile = static_cast<UpdatableTile*>(iter->second.get());
+ // FIXME: This should not ever be null.
+ if (!tile)
+ continue;
IntRect tileRect = m_tiler->tileRect(tile);
- // FIXME: This indicates the "small animated layer" case. This special case
- // can be removed soon with better priorities, but for now paint these layers after
- // 512 pixels of pre-painting. Later we can just pass an animating flag etc. to the
- // calculator and it can take care of this special case if we still need it.
- if (visibleContentRect.isEmpty() && !prepaintRect.isEmpty())
- tile->managedTexture()->setRequestPriority(priorityCalc.priorityFromDistance(512, drawsToRoot));
- else if (!visibleContentRect.isEmpty())
- tile->managedTexture()->setRequestPriority(priorityCalc.priorityFromDistance(visibleContentRect, tileRect, drawsToRoot));
+ setPriorityForTexture(priorityCalc, visibleContentRect, tileRect, drawsToRoot, smallAnimatedLayer, tile->managedTexture());
}
}
@@ -660,45 +701,45 @@ void TiledLayerChromium::updateContentRect(CCTextureUpdateQueue& queue, const In
bool didPaint = false;
- // Visible painting. Only paint visible tiles if the visible rect isn't empty.
- if (!contentRect.isEmpty()) {
+ // Animation pre-paint. If the layer is small, try to paint it all
+ // immediately whether or not it is occluded, to avoid paint/upload
+ // hiccups while it is animating.
+ if (isSmallAnimatedLayer(this)) {
int left, top, right, bottom;
- m_tiler->contentRectToTileIndices(contentRect, left, top, right, bottom);
- markOcclusionsAndRequestTextures(left, top, right, bottom, occlusion);
- m_skipsDraw = !updateTiles(left, top, right, bottom, queue, occlusion, stats, didPaint);
- if (m_skipsDraw)
- m_tiler->reset();
- if (m_skipsDraw || didPaint)
+ m_tiler->contentRectToTileIndices(IntRect(IntPoint::zero(), contentBounds()), left, top, right, bottom);
+ updateTiles(left, top, right, bottom, queue, 0, stats, didPaint);
+ if (didPaint)
return;
+ // This was an attempt to paint the entire layer so if we fail it's okay,
+ // just fallback on painting visible etc. below.
+ m_failedUpdate = false;
}
- // If we have already painting everything visible. Do some pre-painting while idle.
- IntRect idlePaintContentRect = idlePaintRect(contentRect);
- if (idlePaintContentRect.isEmpty())
- return;
-
- int prepaintLeft, prepaintTop, prepaintRight, prepaintBottom;
- m_tiler->contentRectToTileIndices(idlePaintContentRect, prepaintLeft, prepaintTop, prepaintRight, prepaintBottom);
-
- // If the layer is not visible, we have nothing to expand from, so instead we prepaint the outer-most set of tiles.
- if (contentRect.isEmpty()) {
- if (!updateTiles(prepaintLeft, prepaintTop, prepaintRight, prepaintTop, queue, 0, stats, didPaint) || didPaint)
- return;
- if (!updateTiles(prepaintLeft, prepaintBottom, prepaintRight, prepaintBottom, queue, 0, stats, didPaint) || didPaint)
- return;
- if (!updateTiles(prepaintLeft, prepaintTop, prepaintLeft, prepaintBottom, queue, 0, stats, didPaint) || didPaint)
- return;
- updateTiles(prepaintRight, prepaintTop, prepaintRight, prepaintBottom, queue, 0, stats, didPaint);
+ if (contentRect.isEmpty())
return;
- }
+ // Visible painting. First occlude visible tiles and paint the non-occluded tiles.
int left, top, right, bottom;
m_tiler->contentRectToTileIndices(contentRect, left, top, right, bottom);
+ markOcclusionsAndRequestTextures(left, top, right, bottom, occlusion);
+ m_skipsDraw = !updateTiles(left, top, right, bottom, queue, occlusion, stats, didPaint);
+ if (m_skipsDraw)
+ m_tiler->reset();
+ if (m_skipsDraw || didPaint)
+ return;
+
+ // If we have already painting everything visible. Do some pre-painting while idle.
+ IntRect idlePaintContentRect = idlePaintRect(contentRect);
+ if (idlePaintContentRect.isEmpty())
+ return;
- // Otherwise, prepaint anything that was occluded but inside the layer's visible region.
+ // Prepaint anything that was occluded but inside the layer's visible region.
if (!updateTiles(left, top, right, bottom, queue, 0, stats, didPaint) || didPaint)
return;
+ int prepaintLeft, prepaintTop, prepaintRight, prepaintBottom;
+ m_tiler->contentRectToTileIndices(idlePaintContentRect, prepaintLeft, prepaintTop, prepaintRight, prepaintBottom);
+
// Then expand outwards from the visible area until we find a dirty row or column to update.
while (left > prepaintLeft || top > prepaintTop || right < prepaintRight || bottom < prepaintBottom) {
if (bottom < prepaintBottom) {
@@ -727,10 +768,7 @@ void TiledLayerChromium::updateContentRect(CCTextureUpdateQueue& queue, const In
bool TiledLayerChromium::needsIdlePaint(const IntRect& visibleContentRect)
{
// Don't trigger more paints if we failed (as we'll just fail again).
- if (m_failedUpdate)
- return false;
-
- if (m_tiler->hasEmptyBounds())
+ if (m_failedUpdate || visibleContentRect.isEmpty() || m_tiler->hasEmptyBounds())
return false;
IntRect idlePaintContentRect = idlePaintRect(visibleContentRect);
@@ -742,9 +780,6 @@ bool TiledLayerChromium::needsIdlePaint(const IntRect& visibleContentRect)
for (int j = top; j <= bottom; ++j) {
for (int i = left; i <= right; ++i) {
- // If the visibleContentRect is empty, then we are painting the outer-most set of tiles only.
- if (visibleContentRect.isEmpty() && i != left && i != right && j != top && j != bottom)
- continue;
UpdatableTile* tile = tileAt(i, j);
ASSERT(tile); // Did setTexturePriorities get skipped?
if (!tile)
@@ -762,23 +797,16 @@ bool TiledLayerChromium::needsIdlePaint(const IntRect& visibleContentRect)
IntRect TiledLayerChromium::idlePaintRect(const IntRect& visibleContentRect)
{
- IntRect contentRect(IntPoint::zero(), contentBounds());
-
- // For layers that are animating transforms but not visible at all, we don't know what part
- // of them is going to become visible. For small layers we return the entire layer, for larger
- // ones we avoid prepainting the layer at all.
- if (visibleContentRect.isEmpty()) {
- bool isSmallLayer = m_tiler->numTilesX() <= 9 && m_tiler->numTilesY() <= 9 && m_tiler->numTilesX() * m_tiler->numTilesY() <= 9;
- if ((drawTransformIsAnimating() || screenSpaceTransformIsAnimating()) && isSmallLayer)
- return contentRect;
- return IntRect();
- }
+ // Don't inflate an empty rect.
+ if (visibleContentRect.isEmpty())
+ return visibleContentRect;
// FIXME: This can be made a lot larger now! We should increase
// this slowly while insuring it doesn't cause any perf issues.
IntRect prepaintRect = visibleContentRect;
prepaintRect.inflateX(m_tiler->tileSize().width());
prepaintRect.inflateY(m_tiler->tileSize().height() * 2);
+ IntRect contentRect(IntPoint::zero(), contentBounds());
prepaintRect.intersect(contentRect);
return prepaintRect;
diff --git a/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h b/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h
index 13d345eb2..33263e543 100644
--- a/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h
+++ b/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h
@@ -28,9 +28,9 @@
#if USE(ACCELERATED_COMPOSITING)
+#include "CCLayerTilingData.h"
#include "LayerChromium.h"
#include "LayerTextureUpdater.h"
-#include "cc/CCLayerTilingData.h"
namespace WebCore {
class UpdatableTile;
diff --git a/Source/WebCore/platform/graphics/chromium/TreeSynchronizer.cpp b/Source/WebCore/platform/graphics/chromium/TreeSynchronizer.cpp
index 88b2c11df..247d0c4d9 100644
--- a/Source/WebCore/platform/graphics/chromium/TreeSynchronizer.cpp
+++ b/Source/WebCore/platform/graphics/chromium/TreeSynchronizer.cpp
@@ -27,11 +27,11 @@
#include "TreeSynchronizer.h"
+#include "CCLayerImpl.h"
+#include "CCScrollbarAnimationController.h"
+#include "CCScrollbarLayerImpl.h"
#include "LayerChromium.h"
#include "ScrollbarLayerChromium.h"
-#include "cc/CCLayerImpl.h"
-#include "cc/CCScrollbarAnimationController.h"
-#include "cc/CCScrollbarLayerImpl.h"
#include <wtf/RefPtr.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/UnthrottledTextureUploader.h b/Source/WebCore/platform/graphics/chromium/UnthrottledTextureUploader.h
new file mode 100644
index 000000000..fa96899b6
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/UnthrottledTextureUploader.h
@@ -0,0 +1,53 @@
+/*
+ * 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 UnthrottledTextureUploader_h
+#define UnthrottledTextureUploader_h
+
+#include "CCResourceProvider.h"
+#include "TextureUploader.h"
+
+namespace WebCore {
+
+class UnthrottledTextureUploader : public TextureUploader {
+ WTF_MAKE_NONCOPYABLE(UnthrottledTextureUploader);
+public:
+ static PassOwnPtr<UnthrottledTextureUploader> create()
+ {
+ return adoptPtr(new UnthrottledTextureUploader());
+ }
+ virtual ~UnthrottledTextureUploader() { }
+
+ virtual bool isBusy() OVERRIDE { return false; }
+ virtual void beginUploads() OVERRIDE { }
+ virtual void endUploads() OVERRIDE { }
+ virtual void uploadTexture(CCResourceProvider* resourceProvider, Parameters upload) OVERRIDE { upload.texture->updateRect(resourceProvider, upload.sourceRect, upload.destOffset); }
+
+protected:
+ UnthrottledTextureUploader() { }
+};
+
+}
+
+#endif
diff --git a/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
index e70c9ebc6..62337d3da 100644
--- a/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
@@ -32,7 +32,8 @@
#if USE(ACCELERATED_COMPOSITING)
#include "VideoLayerChromium.h"
-#include "cc/CCVideoLayerImpl.h"
+
+#include "CCVideoLayerImpl.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.cpp
index ff6e73398..68fe45a73 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.cpp
@@ -24,11 +24,40 @@
#include "config.h"
-#include "cc/CCActiveAnimation.h"
-
-#include "cc/CCAnimationCurve.h"
+#include "CCActiveAnimation.h"
+#include "CCAnimationCurve.h"
+#include "TraceEvent.h"
#include <cmath>
+#include <wtf/Assertions.h>
+#include <wtf/StdLibExtras.h>
+#include <wtf/StringExtras.h>
+
+namespace {
+
+// This should match the RunState enum.
+static const char* const s_runStateNames[] = {
+ "WaitingForNextTick",
+ "WaitingForTargetAvailability",
+ "WaitingForStartTime",
+ "WaitingForDeletion",
+ "Running",
+ "Paused",
+ "Finished",
+ "Aborted"
+};
+
+COMPILE_ASSERT(static_cast<int>(WebCore::CCActiveAnimation::RunStateEnumSize) == WTF_ARRAY_LENGTH(s_runStateNames), RunState_names_match_enum);
+
+// This should match the TargetProperty enum.
+static const char* const s_targetPropertyNames[] = {
+ "Transform",
+ "Opacity"
+};
+
+COMPILE_ASSERT(static_cast<int>(WebCore::CCActiveAnimation::TargetPropertyEnumSize) == WTF_ARRAY_LENGTH(s_targetPropertyNames), TargetProperty_names_match_enum);
+
+} // namespace
namespace WebCore {
@@ -51,11 +80,14 @@ CCActiveAnimation::CCActiveAnimation(PassOwnPtr<CCAnimationCurve> curve, int ani
, m_suspended(false)
, m_pauseTime(0)
, m_totalPausedTime(0)
+ , m_isControllingInstance(false)
{
}
CCActiveAnimation::~CCActiveAnimation()
{
+ if (m_runState == Running || m_runState == Paused)
+ setRunState(Aborted, 0);
}
void CCActiveAnimation::setRunState(RunState runState, double monotonicTime)
@@ -63,11 +95,35 @@ void CCActiveAnimation::setRunState(RunState runState, double monotonicTime)
if (m_suspended)
return;
+ char nameBuffer[256];
+ snprintf(nameBuffer, sizeof(nameBuffer), "%s-%d%s", s_targetPropertyNames[m_targetProperty], m_group, m_isControllingInstance ? "(impl)" : "");
+
+ bool isWaitingToStart = m_runState == WaitingForNextTick
+ || m_runState == WaitingForTargetAvailability
+ || m_runState == WaitingForStartTime;
+
+ if (isWaitingToStart && runState == Running)
+ TRACE_EVENT_ASYNC_BEGIN1("cc", "CCActiveAnimation", this, "Name", TRACE_STR_COPY(nameBuffer));
+
+ bool wasFinished = isFinished();
+
+ const char* oldRunStateName = s_runStateNames[m_runState];
+
if (runState == Running && m_runState == Paused)
m_totalPausedTime += monotonicTime - m_pauseTime;
else if (runState == Paused)
m_pauseTime = monotonicTime;
m_runState = runState;
+
+ const char* newRunStateName = s_runStateNames[runState];
+
+ if (!wasFinished && isFinished())
+ TRACE_EVENT_ASYNC_END0("cc", "CCActiveAnimation", this);
+
+ char stateBuffer[256];
+ snprintf(stateBuffer, sizeof(stateBuffer), "%s->%s", oldRunStateName, newRunStateName);
+
+ TRACE_EVENT_INSTANT2("cc", "CCLayerAnimationController::setRunState", "Name", TRACE_STR_COPY(nameBuffer), "State", TRACE_STR_COPY(stateBuffer));
}
void CCActiveAnimation::suspend(double monotonicTime)
@@ -139,16 +195,22 @@ double CCActiveAnimation::trimTimeToCurrentIteration(double monotonicTime) const
return trimmed;
}
-PassOwnPtr<CCActiveAnimation> CCActiveAnimation::cloneForImplThread() const
+PassOwnPtr<CCActiveAnimation> CCActiveAnimation::clone(InstanceType instanceType) const
+{
+ return cloneAndInitialize(instanceType, m_runState, m_startTime);
+}
+
+PassOwnPtr<CCActiveAnimation> CCActiveAnimation::cloneAndInitialize(InstanceType instanceType, RunState initialRunState, double startTime) const
{
OwnPtr<CCActiveAnimation> toReturn(adoptPtr(new CCActiveAnimation(m_curve->clone(), m_id, m_group, m_targetProperty)));
- toReturn->m_runState = m_runState;
+ toReturn->m_runState = initialRunState;
toReturn->m_iterations = m_iterations;
- toReturn->m_startTime = m_startTime;
+ toReturn->m_startTime = startTime;
toReturn->m_pauseTime = m_pauseTime;
toReturn->m_totalPausedTime = m_totalPausedTime;
toReturn->m_timeOffset = m_timeOffset;
toReturn->m_alternatesDirection = m_alternatesDirection;
+ toReturn->m_isControllingInstance = instanceType == ControllingInstance;
return toReturn.release();
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.h b/Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.h
index 1ac72e183..ea4e34f2e 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.h
@@ -56,12 +56,16 @@ public:
Running,
Paused,
Finished,
- Aborted
+ Aborted,
+ // This sentinel must be last.
+ RunStateEnumSize
};
enum TargetProperty {
Transform = 0,
- Opacity
+ Opacity,
+ // This sentinel must be last.
+ TargetPropertyEnumSize
};
static PassOwnPtr<CCActiveAnimation> create(PassOwnPtr<CCAnimationCurve>, int animationId, int groupId, TargetProperty);
@@ -112,7 +116,14 @@ public:
// of iterations, returns the relative time in the current iteration.
double trimTimeToCurrentIteration(double monotonicTime) const;
- PassOwnPtr<CCActiveAnimation> cloneForImplThread() const;
+ enum InstanceType {
+ ControllingInstance = 0,
+ NonControllingInstance
+ };
+
+ PassOwnPtr<CCActiveAnimation> clone(InstanceType) const;
+ PassOwnPtr<CCActiveAnimation> cloneAndInitialize(InstanceType, RunState initialRunState, double startTime) const;
+ bool isControllingInstance() const { return m_isControllingInstance; }
void pushPropertiesTo(CCActiveAnimation*) const;
@@ -154,6 +165,15 @@ private:
// about these values.
double m_pauseTime;
double m_totalPausedTime;
+
+ // Animations lead dual lives. An active animation will be conceptually owned by
+ // two controllers, one on the impl thread and one on the main. In reality, there
+ // will be two separate CCActiveAnimation instances for the same animation. They
+ // will have the same group id and the same target property (these two values
+ // uniquely identify an animation). The instance on the impl thread is the instance
+ // that ultimately controls the values of the animating layer and so we will refer
+ // to it as the 'controlling instance'.
+ bool m_isControllingInstance;
};
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCActiveGestureAnimation.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCActiveGestureAnimation.cpp
index 50f4ad8a6..7c6f8e446 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCActiveGestureAnimation.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCActiveGestureAnimation.cpp
@@ -24,10 +24,10 @@
#include "config.h"
-#include "cc/CCActiveGestureAnimation.h"
+#include "CCActiveGestureAnimation.h"
+#include "CCGestureCurve.h"
#include "TraceEvent.h"
-#include "cc/CCGestureCurve.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCAnimationCurve.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCAnimationCurve.cpp
index 58cdc6ad6..f41bfc13a 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCAnimationCurve.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCAnimationCurve.cpp
@@ -24,7 +24,7 @@
#include "config.h"
-#include "cc/CCAnimationCurve.h"
+#include "CCAnimationCurve.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCAnimationEvents.h b/Source/WebCore/platform/graphics/chromium/cc/CCAnimationEvents.h
index ef8011736..f21f3d025 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCAnimationEvents.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCAnimationEvents.h
@@ -25,7 +25,7 @@
#ifndef CCAnimationEvents_h
#define CCAnimationEvents_h
-#include "cc/CCActiveAnimation.h"
+#include "CCActiveAnimation.h"
#include <wtf/PassOwnPtr.h>
#include <wtf/Vector.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCCheckerboardDrawQuad.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCCheckerboardDrawQuad.cpp
index e155f7a50..52fca7c01 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCCheckerboardDrawQuad.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCCheckerboardDrawQuad.cpp
@@ -25,7 +25,7 @@
#include "config.h"
-#include "cc/CCCheckerboardDrawQuad.h"
+#include "CCCheckerboardDrawQuad.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCCheckerboardDrawQuad.h b/Source/WebCore/platform/graphics/chromium/cc/CCCheckerboardDrawQuad.h
index c6c87010c..7e1105d09 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCCheckerboardDrawQuad.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCCheckerboardDrawQuad.h
@@ -26,7 +26,7 @@
#ifndef CCCheckerboardDrawQuad_h
#define CCCheckerboardDrawQuad_h
-#include "cc/CCDrawQuad.h"
+#include "CCDrawQuad.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCDamageTracker.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCDamageTracker.cpp
index 5d5855c07..114499ba1 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCDamageTracker.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCDamageTracker.cpp
@@ -32,12 +32,12 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "cc/CCDamageTracker.h"
+#include "CCDamageTracker.h"
-#include "cc/CCLayerImpl.h"
-#include "cc/CCLayerTreeHostCommon.h"
-#include "cc/CCMathUtil.h"
-#include "cc/CCRenderSurface.h"
+#include "CCLayerImpl.h"
+#include "CCLayerTreeHostCommon.h"
+#include "CCMathUtil.h"
+#include "CCRenderSurface.h"
#include <public/WebFilterOperations.h>
using WebKit::WebTransformationMatrix;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.cpp
index ac43e4da0..694cc3718 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.cpp
@@ -25,7 +25,7 @@
#include "config.h"
-#include "cc/CCDebugBorderDrawQuad.h"
+#include "CCDebugBorderDrawQuad.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.h b/Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.h
index 3a5390047..027a88cc2 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.h
@@ -26,8 +26,8 @@
#ifndef CCDebugBorderDrawQuad_h
#define CCDebugBorderDrawQuad_h
+#include "CCDrawQuad.h"
#include "SkColor.h"
-#include "cc/CCDrawQuad.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp
index 2598b190e..271174002 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp
@@ -24,8 +24,9 @@
#include "config.h"
-#include "cc/CCDelayBasedTimeSource.h"
+#include "CCDelayBasedTimeSource.h"
+#include "TraceEvent.h"
#include <algorithm>
#include <wtf/CurrentTime.h>
#include <wtf/MathExtras.h>
@@ -66,6 +67,7 @@ CCDelayBasedTimeSource::CCDelayBasedTimeSource(double intervalSeconds, CCThread*
void CCDelayBasedTimeSource::setActive(bool active)
{
+ TRACE_EVENT1("cc", "CCDelayBasedTimeSource::setActive", "active", active);
if (!active) {
m_state = STATE_INACTIVE;
m_timer.stop();
@@ -86,7 +88,7 @@ void CCDelayBasedTimeSource::setActive(bool active)
m_state = STATE_ACTIVE;
- double now = monotonicallyIncreasingTime();
+ double now = monotonicTimeNow();
postNextTickTask(now);
}
@@ -104,7 +106,7 @@ void CCDelayBasedTimeSource::onTimerFired()
{
ASSERT(m_state != STATE_INACTIVE);
- double now = monotonicallyIncreasingTime();
+ double now = monotonicTimeNow();
m_lastTickTime = now;
if (m_state == STATE_STARTING) {
@@ -155,9 +157,9 @@ void CCDelayBasedTimeSource::setTimebaseAndInterval(double timebase, double inte
}
}
-double CCDelayBasedTimeSource::monotonicallyIncreasingTime() const
+double CCDelayBasedTimeSource::monotonicTimeNow() const
{
- return WTF::monotonicallyIncreasingTime();
+ return monotonicallyIncreasingTime();
}
// This code tries to achieve an average tick rate as close to m_intervalMs as possible.
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h b/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h
index 61f637ad7..f99837446 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h
@@ -25,9 +25,8 @@
#ifndef CCDelayBasedTimeSource_h
#define CCDelayBasedTimeSource_h
-#include "cc/CCTimeSource.h"
-#include "cc/CCTimer.h"
-
+#include "CCTimeSource.h"
+#include "CCTimer.h"
#include <wtf/PassRefPtr.h>
namespace WebCore {
@@ -59,7 +58,7 @@ public:
virtual void onTimerFired() OVERRIDE;
// Virtual for testing.
- virtual double monotonicallyIncreasingTime() const;
+ virtual double monotonicTimeNow() const;
protected:
CCDelayBasedTimeSource(double interval, CCThread*);
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCDirectRenderer.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCDirectRenderer.cpp
new file mode 100644
index 000000000..4688bed19
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCDirectRenderer.cpp
@@ -0,0 +1,233 @@
+/*
+ * 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 "CCDirectRenderer.h"
+
+#include "CCMathUtil.h"
+#include <public/WebTransformationMatrix.h>
+
+using WebKit::WebTransformationMatrix;
+
+static WebTransformationMatrix orthoProjectionMatrix(float left, float right, float bottom, float top)
+{
+ // Use the standard formula to map the clipping frustum to the cube from
+ // [-1, -1, -1] to [1, 1, 1].
+ float deltaX = right - left;
+ float deltaY = top - bottom;
+ WebTransformationMatrix proj;
+ if (!deltaX || !deltaY)
+ return proj;
+ proj.setM11(2.0f / deltaX);
+ proj.setM41(-(right + left) / deltaX);
+ proj.setM22(2.0f / deltaY);
+ proj.setM42(-(top + bottom) / deltaY);
+
+ // Z component of vertices is always set to zero as we don't use the depth buffer
+ // while drawing.
+ proj.setM33(0);
+
+ return proj;
+}
+
+static WebTransformationMatrix windowMatrix(int x, int y, int width, int height)
+{
+ WebTransformationMatrix canvas;
+
+ // Map to window position and scale up to pixel coordinates.
+ canvas.translate3d(x, y, 0);
+ canvas.scale3d(width, height, 0);
+
+ // Map from ([-1, -1] to [1, 1]) -> ([0, 0] to [1, 1])
+ canvas.translate3d(0.5, 0.5, 0.5);
+ canvas.scale3d(0.5, 0.5, 0.5);
+
+ return canvas;
+}
+
+namespace WebCore {
+//
+// static
+FloatRect CCDirectRenderer::quadVertexRect()
+{
+ return FloatRect(-0.5, -0.5, 1, 1);
+}
+
+// static
+void CCDirectRenderer::quadRectTransform(WebKit::WebTransformationMatrix* quadRectTransform, const WebKit::WebTransformationMatrix& quadTransform, const FloatRect& quadRect)
+{
+ *quadRectTransform = quadTransform;
+ quadRectTransform->translate(0.5 * quadRect.width() + quadRect.x(), 0.5 * quadRect.height() + quadRect.y());
+ quadRectTransform->scaleNonUniform(quadRect.width(), quadRect.height());
+}
+
+// static
+void CCDirectRenderer::initializeMatrices(DrawingFrame& frame, const IntRect& drawRect, bool flipY)
+{
+ if (flipY)
+ frame.projectionMatrix = orthoProjectionMatrix(drawRect.x(), drawRect.maxX(), drawRect.maxY(), drawRect.y());
+ else
+ frame.projectionMatrix = orthoProjectionMatrix(drawRect.x(), drawRect.maxX(), drawRect.y(), drawRect.maxY());
+ frame.windowMatrix = windowMatrix(0, 0, drawRect.width(), drawRect.height());
+ frame.flippedY = flipY;
+}
+
+// static
+IntRect CCDirectRenderer::moveScissorToWindowSpace(const DrawingFrame& frame, FloatRect scissorRect)
+{
+ IntRect scissorRectInCanvasSpace = enclosingIntRect(scissorRect);
+ // The scissor coordinates must be supplied in viewport space so we need to offset
+ // by the relative position of the top left corner of the current render pass.
+ IntRect framebufferOutputRect = frame.currentRenderPass->outputRect();
+ scissorRectInCanvasSpace.setX(scissorRectInCanvasSpace.x() - framebufferOutputRect.x());
+ if (frame.flippedY && !frame.currentTexture)
+ scissorRectInCanvasSpace.setY(framebufferOutputRect.height() - (scissorRectInCanvasSpace.maxY() - framebufferOutputRect.y()));
+ else
+ scissorRectInCanvasSpace.setY(scissorRectInCanvasSpace.y() - framebufferOutputRect.y());
+ return scissorRectInCanvasSpace;
+}
+
+void CCDirectRenderer::decideRenderPassAllocationsForFrame(const CCRenderPassList& renderPassesInDrawOrder)
+{
+ HashMap<int, const CCRenderPass*> renderPassesInFrame;
+ for (size_t i = 0; i < renderPassesInDrawOrder.size(); ++i)
+ renderPassesInFrame.set(renderPassesInDrawOrder[i]->id(), renderPassesInDrawOrder[i]);
+
+ Vector<int> passesToDelete;
+ HashMap<int, OwnPtr<CachedTexture> >::const_iterator passIterator;
+ for (passIterator = m_renderPassTextures.begin(); passIterator != m_renderPassTextures.end(); ++passIterator) {
+ const CCRenderPass* renderPassInFrame = renderPassesInFrame.get(passIterator->first);
+ if (!renderPassInFrame) {
+ passesToDelete.append(passIterator->first);
+ continue;
+ }
+
+ const IntSize& requiredSize = renderPassTextureSize(renderPassInFrame);
+ GC3Denum requiredFormat = renderPassTextureFormat(renderPassInFrame);
+ CachedTexture* texture = passIterator->second.get();
+ ASSERT(texture);
+
+ if (texture->id() && (texture->size() != requiredSize || texture->format() != requiredFormat))
+ texture->free();
+ }
+
+ // Delete RenderPass textures from the previous frame that will not be used again.
+ for (size_t i = 0; i < passesToDelete.size(); ++i)
+ m_renderPassTextures.remove(passesToDelete[i]);
+
+ for (size_t i = 0; i < renderPassesInDrawOrder.size(); ++i) {
+ if (!m_renderPassTextures.contains(renderPassesInDrawOrder[i]->id())) {
+ OwnPtr<CachedTexture> texture = CachedTexture::create(m_resourceProvider);
+ m_renderPassTextures.set(renderPassesInDrawOrder[i]->id(), texture.release());
+ }
+ }
+}
+
+void CCDirectRenderer::drawFrame(const CCRenderPassList& renderPassesInDrawOrder, const CCRenderPassIdHashMap& renderPassesById)
+{
+ const CCRenderPass* rootRenderPass = renderPassesInDrawOrder.last();
+ ASSERT(rootRenderPass);
+
+ DrawingFrame frame;
+ frame.renderPassesById = &renderPassesById;
+ frame.rootRenderPass = rootRenderPass;
+ frame.rootDamageRect = capabilities().usingPartialSwap ? rootRenderPass->damageRect() : rootRenderPass->outputRect();
+ frame.rootDamageRect.intersect(IntRect(IntPoint::zero(), viewportSize()));
+
+ beginDrawingFrame(frame);
+ for (size_t i = 0; i < renderPassesInDrawOrder.size(); ++i)
+ drawRenderPass(frame, renderPassesInDrawOrder[i]);
+ finishDrawingFrame(frame);
+}
+
+void CCDirectRenderer::drawRenderPass(DrawingFrame& frame, const CCRenderPass* renderPass)
+{
+ if (!useRenderPass(frame, renderPass))
+ return;
+
+ frame.scissorRectInRenderPassSpace = frame.currentRenderPass->outputRect();
+ if (frame.rootDamageRect != frame.rootRenderPass->outputRect()) {
+ WebTransformationMatrix inverseTransformToRoot = frame.currentRenderPass->transformToRootTarget().inverse();
+ frame.scissorRectInRenderPassSpace.intersect(CCMathUtil::projectClippedRect(inverseTransformToRoot, frame.rootDamageRect));
+ }
+
+ enableScissorTestRect(moveScissorToWindowSpace(frame, frame.scissorRectInRenderPassSpace));
+ clearFramebuffer(frame);
+
+ const CCQuadList& quadList = renderPass->quadList();
+ for (CCQuadList::constBackToFrontIterator it = quadList.backToFrontBegin(); it != quadList.backToFrontEnd(); ++it) {
+ FloatRect quadScissorRect = frame.scissorRectInRenderPassSpace;
+ quadScissorRect.intersect(it->get()->clippedRectInTarget());
+ if (!quadScissorRect.isEmpty()) {
+ enableScissorTestRect(moveScissorToWindowSpace(frame, quadScissorRect));
+ drawQuad(frame, it->get());
+ }
+ }
+
+ CachedTexture* texture = m_renderPassTextures.get(renderPass->id());
+ if (texture)
+ texture->setIsComplete(!renderPass->hasOcclusionFromOutsideTargetSurface());
+}
+
+bool CCDirectRenderer::useRenderPass(DrawingFrame& frame, const CCRenderPass* renderPass)
+{
+ frame.currentRenderPass = renderPass;
+ frame.currentTexture = 0;
+
+ if (renderPass == frame.rootRenderPass) {
+ bindFramebufferToOutputSurface(frame);
+ initializeMatrices(frame, renderPass->outputRect(), true);
+ setDrawViewportSize(renderPass->outputRect().size());
+ return true;
+ }
+
+ CachedTexture* texture = m_renderPassTextures.get(renderPass->id());
+ ASSERT(texture);
+ if (!texture->id() && !texture->allocate(CCRenderer::ImplPool, renderPassTextureSize(renderPass), renderPassTextureFormat(renderPass), CCResourceProvider::TextureUsageFramebuffer))
+ return false;
+
+ return bindFramebufferToTexture(frame, texture, renderPass->outputRect());
+}
+
+bool CCDirectRenderer::haveCachedResourcesForRenderPassId(int id) const
+{
+ CachedTexture* texture = m_renderPassTextures.get(id);
+ return texture && texture->id() && texture->isComplete();
+}
+
+// static
+IntSize CCDirectRenderer::renderPassTextureSize(const CCRenderPass* pass)
+{
+ return pass->outputRect().size();
+}
+
+// static
+GC3Denum CCDirectRenderer::renderPassTextureFormat(const CCRenderPass*)
+{
+ return GraphicsContext3D::RGBA;
+}
+
+}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCDirectRenderer.h b/Source/WebCore/platform/graphics/chromium/cc/CCDirectRenderer.h
new file mode 100644
index 000000000..294152cdd
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCDirectRenderer.h
@@ -0,0 +1,127 @@
+/*
+ * 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 CCDirectRenderer_h
+#define CCDirectRenderer_h
+
+#include "CCRenderer.h"
+#include "CCResourceProvider.h"
+#include "CCScopedTexture.h"
+
+namespace WebCore {
+
+class CCResourceProvider;
+
+// This is the base class for code shared between the GL and software
+// renderer implementations. "Direct" refers to the fact that it does not
+// delegate rendering to another compositor.
+class CCDirectRenderer : public CCRenderer {
+ WTF_MAKE_NONCOPYABLE(CCDirectRenderer);
+public:
+ virtual ~CCDirectRenderer() { }
+
+ CCResourceProvider* resourceProvider() const { return m_resourceProvider; }
+
+ virtual void decideRenderPassAllocationsForFrame(const CCRenderPassList& renderPassesInDrawOrder) OVERRIDE;
+ virtual bool haveCachedResourcesForRenderPassId(int id) const OVERRIDE;
+ virtual void drawFrame(const CCRenderPassList& renderPassesInDrawOrder, const CCRenderPassIdHashMap& renderPassesById) OVERRIDE;
+
+protected:
+ CCDirectRenderer(CCRendererClient* client, CCResourceProvider* resourceProvider)
+ : CCRenderer(client)
+ , m_resourceProvider(resourceProvider)
+ {
+ }
+
+ struct DrawingFrame {
+ const CCRenderPassIdHashMap* renderPassesById;
+ const CCRenderPass* rootRenderPass;
+ const CCRenderPass* currentRenderPass;
+ const CCScopedTexture* currentTexture;
+
+ FloatRect rootDamageRect;
+
+ WebKit::WebTransformationMatrix projectionMatrix;
+ WebKit::WebTransformationMatrix windowMatrix;
+ bool flippedY;
+ FloatRect scissorRectInRenderPassSpace;
+
+ DrawingFrame()
+ : rootRenderPass(0)
+ , currentRenderPass(0)
+ , currentTexture(0)
+ , flippedY(false)
+ { }
+ };
+
+ class CachedTexture : public CCScopedTexture {
+ WTF_MAKE_NONCOPYABLE(CachedTexture);
+ public:
+ static PassOwnPtr<CachedTexture> create(CCResourceProvider* resourceProvider) { return adoptPtr(new CachedTexture(resourceProvider)); }
+ virtual ~CachedTexture() { }
+
+ bool isComplete() const { return m_isComplete; }
+ void setIsComplete(bool isComplete) { m_isComplete = isComplete; }
+
+ protected:
+ explicit CachedTexture(CCResourceProvider* resourceProvider)
+ : CCScopedTexture(resourceProvider)
+ , m_isComplete(false)
+ {
+ }
+
+ private:
+ bool m_isComplete;
+ };
+
+ static FloatRect quadVertexRect();
+ static void quadRectTransform(WebKit::WebTransformationMatrix* quadRectTransform, const WebKit::WebTransformationMatrix& quadTransform, const FloatRect& quadRect);
+ static void initializeMatrices(DrawingFrame&, const IntRect& drawRect, bool flipY);
+ static IntRect moveScissorToWindowSpace(const DrawingFrame&, FloatRect scissorRect);
+
+ bool haveCachedResources(int renderPassId) const;
+ static IntSize renderPassTextureSize(const CCRenderPass*);
+ static GC3Denum renderPassTextureFormat(const CCRenderPass*);
+
+ void drawRenderPass(DrawingFrame&, const CCRenderPass*);
+ bool useRenderPass(DrawingFrame&, const CCRenderPass*);
+
+ virtual void bindFramebufferToOutputSurface(DrawingFrame&) = 0;
+ virtual bool bindFramebufferToTexture(DrawingFrame&, const CCScopedTexture*, const IntRect& framebufferRect) = 0;
+ virtual void setDrawViewportSize(const IntSize&) = 0;
+ virtual void enableScissorTestRect(const IntRect& scissorRect) = 0;
+ virtual void disableScissorTest() = 0;
+ virtual void clearFramebuffer(DrawingFrame&) = 0;
+ virtual void drawQuad(DrawingFrame&, const CCDrawQuad*) = 0;
+ virtual void beginDrawingFrame(DrawingFrame&) = 0;
+ virtual void finishDrawingFrame(DrawingFrame&) = 0;
+
+ HashMap<int, OwnPtr<CachedTexture> > m_renderPassTextures;
+ CCResourceProvider* m_resourceProvider;
+};
+
+}
+
+#endif // CCDirectRenderer_h
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.cpp
index 3b0699d8b..4584d4986 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.cpp
@@ -24,18 +24,18 @@
*/
#include "config.h"
-#include "cc/CCDrawQuad.h"
+#include "CCDrawQuad.h"
+#include "CCCheckerboardDrawQuad.h"
+#include "CCDebugBorderDrawQuad.h"
+#include "CCIOSurfaceDrawQuad.h"
+#include "CCRenderPassDrawQuad.h"
+#include "CCSolidColorDrawQuad.h"
+#include "CCStreamVideoDrawQuad.h"
+#include "CCTextureDrawQuad.h"
+#include "CCTileDrawQuad.h"
+#include "CCYUVVideoDrawQuad.h"
#include "IntRect.h"
-#include "cc/CCCheckerboardDrawQuad.h"
-#include "cc/CCDebugBorderDrawQuad.h"
-#include "cc/CCIOSurfaceDrawQuad.h"
-#include "cc/CCRenderPassDrawQuad.h"
-#include "cc/CCSolidColorDrawQuad.h"
-#include "cc/CCStreamVideoDrawQuad.h"
-#include "cc/CCTextureDrawQuad.h"
-#include "cc/CCTileDrawQuad.h"
-#include "cc/CCYUVVideoDrawQuad.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.h b/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.h
index bcda345bd..d4b0cc3f1 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.h
@@ -26,7 +26,7 @@
#ifndef CCDrawQuad_h
#define CCDrawQuad_h
-#include "cc/CCSharedQuadState.h"
+#include "CCSharedQuadState.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCFontAtlas.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCFontAtlas.cpp
index 388d43fb9..8636a1a3d 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCFontAtlas.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCFontAtlas.cpp
@@ -27,8 +27,8 @@
#if USE(ACCELERATED_COMPOSITING)
#include "CCFontAtlas.h"
+#include "CCProxy.h"
#include "SkCanvas.h"
-#include "cc/CCProxy.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.cpp
index b52fb5f6f..5b00fef79 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.cpp
@@ -24,11 +24,12 @@
#include "config.h"
-#include "cc/CCFrameRateController.h"
+#include "CCFrameRateController.h"
+#include "CCDelayBasedTimeSource.h"
+#include "CCTimeSource.h"
#include "TraceEvent.h"
-#include "cc/CCDelayBasedTimeSource.h"
-#include "cc/CCTimeSource.h"
+#include <wtf/CurrentTime.h>
namespace WebCore {
@@ -78,9 +79,9 @@ CCFrameRateController::~CCFrameRateController()
void CCFrameRateController::setActive(bool active)
{
+ TRACE_EVENT1("cc", "CCFrameRateController::setActive", "active", active);
if (m_active == active)
return;
- TRACE_EVENT1("cc", "CCFrameRateController::setActive", "active", active);
m_active = active;
if (m_isTimeSourceThrottling)
@@ -100,7 +101,8 @@ void CCFrameRateController::setMaxFramesPending(int maxFramesPending)
void CCFrameRateController::setTimebaseAndInterval(double timebase, double intervalSeconds)
{
- m_timeSource->setTimebaseAndInterval(timebase, intervalSeconds);
+ if (m_isTimeSourceThrottling)
+ m_timeSource->setTimebaseAndInterval(timebase, intervalSeconds);
}
void CCFrameRateController::onTimerTick()
@@ -115,6 +117,10 @@ void CCFrameRateController::onTimerTick()
if (m_client)
m_client->vsyncTick();
+
+ if (!m_isTimeSourceThrottling
+ && (!m_maxFramesPending || m_numFramesPending < m_maxFramesPending))
+ postManualTick();
}
void CCFrameRateController::postManualTick()
@@ -131,8 +137,6 @@ void CCFrameRateController::onTimerFired()
void CCFrameRateController::didBeginFrame()
{
m_numFramesPending++;
- if (!m_isTimeSourceThrottling)
- postManualTick();
}
void CCFrameRateController::didFinishFrame()
@@ -147,4 +151,12 @@ void CCFrameRateController::didAbortAllPendingFrames()
m_numFramesPending = 0;
}
+double CCFrameRateController::nextTickTime()
+{
+ if (m_isTimeSourceThrottling)
+ return m_timeSource->nextTickTime();
+
+ return monotonicallyIncreasingTime();
+}
+
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.h b/Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.h
index 69c9037e2..13d853b70 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.h
@@ -25,9 +25,8 @@
#ifndef CCFrameRateController_h
#define CCFrameRateController_h
-#include "cc/CCTimer.h"
+#include "CCTimer.h"
-#include <wtf/CurrentTime.h>
#include <wtf/Deque.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
@@ -68,6 +67,7 @@ public:
void didFinishFrame();
void didAbortAllPendingFrames();
void setMaxFramesPending(int); // 0 for unlimited.
+ double nextTickTime();
void setTimebaseAndInterval(double timebase, double intervalSeconds);
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp
index 6b46851db..5fdd2cd69 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp
@@ -25,20 +25,20 @@
#include "config.h"
-#include "cc/CCHeadsUpDisplayLayerImpl.h"
-
+#include "CCHeadsUpDisplayLayerImpl.h"
+
+#include "CCDebugRectHistory.h"
+#include "CCFontAtlas.h"
+#include "CCFrameRateCounter.h"
+#include "CCLayerTreeHostImpl.h"
+#include "CCQuadSink.h"
+#include "CCTextureDrawQuad.h"
#include "Extensions3DChromium.h"
#include "GraphicsContext3D.h"
#include "LayerRendererChromium.h"
#include "SkBitmap.h"
#include "SkColorMatrixFilter.h"
#include "SkPaint.h"
-#include "cc/CCDebugRectHistory.h"
-#include "cc/CCFontAtlas.h"
-#include "cc/CCFrameRateCounter.h"
-#include "cc/CCLayerTreeHostImpl.h"
-#include "cc/CCQuadSink.h"
-#include "cc/CCTextureDrawQuad.h"
#include "skia/ext/platform_canvas.h"
#include <wtf/text/WTFString.h>
@@ -87,19 +87,8 @@ void CCHeadsUpDisplayLayerImpl::willDraw(CCResourceProvider* resourceProvider)
if (m_hudTexture->size() != bounds())
m_hudTexture->free();
- if (!m_hudTexture->id() && !m_hudTexture->allocate(CCRenderer::ImplPool, bounds(), GraphicsContext3D::RGBA, CCResourceProvider::TextureUsageAny))
- return;
-
- // Render pixels into the texture.
- OwnPtr<SkCanvas> canvas = adoptPtr(skia::CreateBitmapCanvas(bounds().width(), bounds().height(), false /* opaque */));
- drawHudContents(canvas.get());
-
- const SkBitmap* bitmap = &canvas->getDevice()->accessBitmap(false);
- SkAutoLockPixels locker(*bitmap);
-
- IntRect layerRect(IntPoint(), bounds());
- ASSERT(bitmap->config() == SkBitmap::kARGB_8888_Config);
- resourceProvider->upload(m_hudTexture->id(), static_cast<const uint8_t*>(bitmap->getPixels()), layerRect, layerRect, layerRect);
+ if (!m_hudTexture->id())
+ m_hudTexture->allocate(CCRenderer::ImplPool, bounds(), GraphicsContext3D::RGBA, CCResourceProvider::TextureUsageAny);
}
void CCHeadsUpDisplayLayerImpl::appendQuads(CCQuadSink& quadList, const CCSharedQuadState* sharedQuadState, bool&)
@@ -114,6 +103,31 @@ void CCHeadsUpDisplayLayerImpl::appendQuads(CCQuadSink& quadList, const CCShared
quadList.append(CCTextureDrawQuad::create(sharedQuadState, quadRect, m_hudTexture->id(), premultipliedAlpha, uvRect, flipped));
}
+void CCHeadsUpDisplayLayerImpl::updateHudTexture(CCResourceProvider* resourceProvider)
+{
+ if (!m_hudTexture->id())
+ return;
+
+ SkISize canvasSize;
+ if (m_hudCanvas)
+ canvasSize = m_hudCanvas->getDeviceSize();
+ else
+ canvasSize.set(0, 0);
+
+ if (canvasSize.fWidth != bounds().width() || canvasSize.fHeight != bounds().height() || !m_hudCanvas)
+ m_hudCanvas = adoptPtr(skia::CreateBitmapCanvas(bounds().width(), bounds().height(), false /* opaque */));
+
+ m_hudCanvas->clear(SkColorSetARGB(0, 0, 0, 0));
+ drawHudContents(m_hudCanvas.get());
+
+ const SkBitmap* bitmap = &m_hudCanvas->getDevice()->accessBitmap(false);
+ SkAutoLockPixels locker(*bitmap);
+
+ IntRect layerRect(IntPoint(), bounds());
+ ASSERT(bitmap->config() == SkBitmap::kARGB_8888_Config);
+ resourceProvider->upload(m_hudTexture->id(), static_cast<const uint8_t*>(bitmap->getPixels()), layerRect, layerRect, IntSize());
+}
+
void CCHeadsUpDisplayLayerImpl::didDraw(CCResourceProvider* resourceProvider)
{
CCLayerImpl::didDraw(resourceProvider);
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.h b/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.h
index b2cdb4d31..1ee24c47e 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.h
@@ -26,9 +26,9 @@
#ifndef CCHeadsUpDisplayLayerImpl_h
#define CCHeadsUpDisplayLayerImpl_h
-#include "cc/CCFontAtlas.h"
-#include "cc/CCLayerImpl.h"
-#include "cc/CCScopedTexture.h"
+#include "CCFontAtlas.h"
+#include "CCLayerImpl.h"
+#include "CCScopedTexture.h"
class SkCanvas;
@@ -50,6 +50,7 @@ public:
virtual void willDraw(CCResourceProvider*) OVERRIDE;
virtual void appendQuads(CCQuadSink&, const CCSharedQuadState*, bool& hadMissingTiles) OVERRIDE;
+ void updateHudTexture(CCResourceProvider*);
virtual void didDraw(CCResourceProvider*) OVERRIDE;
virtual void didLoseContext() OVERRIDE;
@@ -68,6 +69,7 @@ private:
OwnPtr<CCFontAtlas> m_fontAtlas;
OwnPtr<CCScopedTexture> m_hudTexture;
+ OwnPtr<SkCanvas> m_hudCanvas;
};
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceDrawQuad.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceDrawQuad.cpp
index 5551b82d3..11b54b266 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceDrawQuad.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceDrawQuad.cpp
@@ -25,7 +25,7 @@
#include "config.h"
-#include "cc/CCIOSurfaceDrawQuad.h"
+#include "CCIOSurfaceDrawQuad.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceDrawQuad.h b/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceDrawQuad.h
index 7ce7c06ca..6abbed1fc 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceDrawQuad.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceDrawQuad.h
@@ -26,8 +26,8 @@
#ifndef CCIOSurfaceDrawQuad_h
#define CCIOSurfaceDrawQuad_h
+#include "CCDrawQuad.h"
#include "IntSize.h"
-#include "cc/CCDrawQuad.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp
index 473de259b..283b7c99a 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp
@@ -27,15 +27,15 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "cc/CCIOSurfaceLayerImpl.h"
+#include "CCIOSurfaceLayerImpl.h"
+#include "CCGraphicsContext.h"
+#include "CCIOSurfaceDrawQuad.h"
+#include "CCLayerTreeHostImpl.h"
+#include "CCQuadSink.h"
#include "Extensions3D.h"
#include "LayerRendererChromium.h"
#include "TextStream.h"
-#include "cc/CCGraphicsContext.h"
-#include "cc/CCIOSurfaceDrawQuad.h"
-#include "cc/CCLayerTreeHostImpl.h"
-#include "cc/CCQuadSink.h"
#include <public/WebGraphicsContext3D.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.h b/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.h
index 018804e18..019b8fe2d 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.h
@@ -26,8 +26,8 @@
#ifndef CCIOSurfaceLayerImpl_h
#define CCIOSurfaceLayerImpl_h
+#include "CCLayerImpl.h"
#include "IntSize.h"
-#include "cc/CCLayerImpl.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCInputHandler.h b/Source/WebCore/platform/graphics/chromium/cc/CCInputHandler.h
index 77dd2dbcf..d4f33948f 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCInputHandler.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCInputHandler.h
@@ -48,21 +48,21 @@ public:
enum ScrollStatus { ScrollOnMainThread, ScrollStarted, ScrollIgnored };
enum ScrollInputType { Gesture, Wheel };
- // Attempt to start scrolling a layer at a given point in window
- // coordinates. Returns ScrollStarted if the layer at the coordinates can
- // be scrolled, ScrollOnMainThread if the scroll event should instead be
- // delegated to the main thread, or ScrollIgnored if there is nothing to
- // be scrolled at the given coordinates.
+ // Selects a layer to be scrolled at a given point in window coordinates.
+ // Returns ScrollStarted if the layer at the coordinates can be scrolled,
+ // ScrollOnMainThread if the scroll event should instead be delegated to the
+ // main thread, or ScrollIgnored if there is nothing to be scrolled at the
+ // given coordinates.
virtual ScrollStatus scrollBegin(const IntPoint&, ScrollInputType) = 0;
- // Scroll the layer selected with scrollBegin(). If there is no room to
- // move the layer in the requested direction, its first ancestor layer that
- // can be scrolled will be moved instead. Should only be called if
- // scrollBegin() returned ScrollStarted.
- virtual void scrollBy(const IntSize&) = 0;
-
- // Stop scrolling the layer selected with scrollBegin(). Should only be
+ // Scroll the selected layer starting at the given window coordinate. If
+ // there is no room to move the layer in the requested direction, its first
+ // ancestor layer that can be scrolled will be moved instead. Should only be
// called if scrollBegin() returned ScrollStarted.
+ virtual void scrollBy(const IntPoint&, const IntSize&) = 0;
+
+ // Stop scrolling the selected layer. Should only be called if scrollBegin()
+ // returned ScrollStarted.
virtual void scrollEnd() = 0;
virtual void pinchGestureBegin() = 0;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCKeyframedAnimationCurve.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCKeyframedAnimationCurve.cpp
index bb4d47834..790370f4b 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCKeyframedAnimationCurve.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCKeyframedAnimationCurve.cpp
@@ -24,7 +24,7 @@
#include "config.h"
-#include "cc/CCKeyframedAnimationCurve.h"
+#include "CCKeyframedAnimationCurve.h"
#include <wtf/OwnPtr.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCKeyframedAnimationCurve.h b/Source/WebCore/platform/graphics/chromium/cc/CCKeyframedAnimationCurve.h
index 111ca81ce..1cad60435 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCKeyframedAnimationCurve.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCKeyframedAnimationCurve.h
@@ -25,11 +25,9 @@
#ifndef CCKeyframedAnimationCurve_h
#define CCKeyframedAnimationCurve_h
-#include "cc/CCAnimationCurve.h"
-#include "cc/CCTimingFunction.h"
-
+#include "CCAnimationCurve.h"
+#include "CCTimingFunction.h"
#include <public/WebTransformOperations.h>
-
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/Vector.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp
index bd3e6e60c..13b9c0888 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp
@@ -24,10 +24,10 @@
#include "config.h"
-#include "cc/CCLayerAnimationController.h"
+#include "CCLayerAnimationController.h"
-#include "cc/CCActiveAnimation.h"
-#include "cc/CCKeyframedAnimationCurve.h"
+#include "CCActiveAnimation.h"
+#include "CCKeyframedAnimationCurve.h"
#include <public/WebTransformationMatrix.h>
#include <wtf/CurrentTime.h>
#include <wtf/HashMap.h>
@@ -200,11 +200,11 @@ void CCLayerAnimationController::pushNewAnimationsToImplThread(CCLayerAnimationC
if (!m_activeAnimations[i]->needsSynchronizedStartTime())
continue;
- OwnPtr<CCActiveAnimation> toAdd(m_activeAnimations[i]->cloneForImplThread());
- ASSERT(!toAdd->needsSynchronizedStartTime());
// The new animation should be set to run as soon as possible.
- toAdd->setRunState(CCActiveAnimation::WaitingForTargetAvailability, 0);
- toAdd->setStartTime(0);
+ CCActiveAnimation::RunState initialRunState = CCActiveAnimation::WaitingForTargetAvailability;
+ double startTime = 0;
+ OwnPtr<CCActiveAnimation> toAdd(m_activeAnimations[i]->cloneAndInitialize(CCActiveAnimation::ControllingInstance, initialRunState, startTime));
+ ASSERT(!toAdd->needsSynchronizedStartTime());
controllerImpl->addAnimation(toAdd.release());
}
}
@@ -324,7 +324,6 @@ void CCLayerAnimationController::resolveConflicts(double monotonicTime)
}
}
-
void CCLayerAnimationController::markAnimationsForDeletion(double monotonicTime, CCAnimationEventsVector* events)
{
for (size_t i = 0; i < m_activeAnimations.size(); i++) {
@@ -369,13 +368,16 @@ void CCLayerAnimationController::replaceImplThreadAnimations(CCLayerAnimationCon
{
controllerImpl->m_activeAnimations.clear();
for (size_t i = 0; i < m_activeAnimations.size(); ++i) {
- OwnPtr<CCActiveAnimation> toAdd(m_activeAnimations[i]->cloneForImplThread());
+ OwnPtr<CCActiveAnimation> toAdd;
if (m_activeAnimations[i]->needsSynchronizedStartTime()) {
// We haven't received an animation started notification yet, so it
// is important that we add it in a 'waiting' and not 'running' state.
- toAdd->setRunState(CCActiveAnimation::WaitingForTargetAvailability, 0);
- toAdd->setStartTime(0);
- }
+ CCActiveAnimation::RunState initialRunState = CCActiveAnimation::WaitingForTargetAvailability;
+ double startTime = 0;
+ toAdd = m_activeAnimations[i]->cloneAndInitialize(CCActiveAnimation::ControllingInstance, initialRunState, startTime);
+ } else
+ toAdd = m_activeAnimations[i]->clone(CCActiveAnimation::ControllingInstance);
+
controllerImpl->addAnimation(toAdd.release());
}
}
@@ -413,6 +415,10 @@ void CCLayerAnimationController::tickAnimations(double monotonicTime)
break;
}
+ // Do nothing for sentinel value.
+ case CCActiveAnimation::TargetPropertyEnumSize:
+ ASSERT_NOT_REACHED();
+
}
}
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.h
index c6ebbe28b..343597016 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.h
@@ -25,7 +25,7 @@
#ifndef CCLayerAnimationController_h
#define CCLayerAnimationController_h
-#include "cc/CCAnimationEvents.h"
+#include "CCAnimationEvents.h"
#include <wtf/HashSet.h>
#include <wtf/Noncopyable.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
index a11dcd2ad..8444d1d88 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
@@ -27,16 +27,16 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "cc/CCLayerImpl.h"
-
+#include "CCLayerImpl.h"
+
+#include "CCDebugBorderDrawQuad.h"
+#include "CCLayerSorter.h"
+#include "CCMathUtil.h"
+#include "CCProxy.h"
+#include "CCQuadSink.h"
+#include "CCScrollbarAnimationController.h"
#include "TextStream.h"
#include "TraceEvent.h"
-#include "cc/CCDebugBorderDrawQuad.h"
-#include "cc/CCLayerSorter.h"
-#include "cc/CCMathUtil.h"
-#include "cc/CCProxy.h"
-#include "cc/CCQuadSink.h"
-#include "cc/CCScrollbarAnimationController.h"
#include <wtf/text/WTFString.h>
using WebKit::WebTransformationMatrix;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
index ff089b537..e951c5d7c 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
@@ -26,16 +26,16 @@
#ifndef CCLayerImpl_h
#define CCLayerImpl_h
+#include "CCInputHandler.h"
+#include "CCLayerAnimationController.h"
+#include "CCRenderSurface.h"
+#include "CCResourceProvider.h"
+#include "CCSharedQuadState.h"
#include "FloatRect.h"
#include "IntRect.h"
#include "Region.h"
#include "SkColor.h"
#include "TextStream.h"
-#include "cc/CCInputHandler.h"
-#include "cc/CCLayerAnimationController.h"
-#include "cc/CCRenderSurface.h"
-#include "cc/CCResourceProvider.h"
-#include "cc/CCSharedQuadState.h"
#include <public/WebFilterOperations.h>
#include <public/WebTransformationMatrix.h>
#include <wtf/OwnPtr.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.cpp
index 2d6d2f7f7..bb5929f0f 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.cpp
@@ -26,12 +26,12 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "cc/CCLayerIterator.h"
+#include "CCLayerIterator.h"
+#include "CCLayerImpl.h"
+#include "CCRenderSurface.h"
#include "LayerChromium.h"
#include "RenderSurfaceChromium.h"
-#include "cc/CCLayerImpl.h"
-#include "cc/CCRenderSurface.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.h
index 2f5ad2c77..9e71c4db2 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.h
@@ -25,7 +25,7 @@
#ifndef CCLayerIterator_h
#define CCLayerIterator_h
-#include "cc/CCLayerTreeHostCommon.h"
+#include "CCLayerTreeHostCommon.h"
#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerQuad.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerQuad.cpp
index 2c5f7ec62..e8c6da29f 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerQuad.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerQuad.cpp
@@ -28,7 +28,7 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "cc/CCLayerQuad.h"
+#include "CCLayerQuad.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerSorter.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerSorter.cpp
index 0cb703b42..c5240cc41 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerSorter.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerSorter.cpp
@@ -24,10 +24,10 @@
#include "config.h"
-#include "cc/CCLayerSorter.h"
+#include "CCLayerSorter.h"
-#include "cc/CCMathUtil.h"
-#include "cc/CCRenderSurface.h"
+#include "CCMathUtil.h"
+#include "CCRenderSurface.h"
#include <limits.h>
#include <public/WebTransformationMatrix.h>
#include <wtf/Deque.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerSorter.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerSorter.h
index cb88e85db..3592cad4d 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerSorter.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerSorter.h
@@ -25,10 +25,10 @@
#ifndef CCLayerSorter_h
#define CCLayerSorter_h
+#include "CCLayerImpl.h"
#include "FloatPoint3D.h"
#include "FloatQuad.h"
#include "FloatRect.h"
-#include "cc/CCLayerImpl.h"
#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
#include <wtf/Vector.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp
index 49d23366c..9b55156d9 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp
@@ -28,7 +28,7 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "cc/CCLayerTilingData.h"
+#include "CCLayerTilingData.h"
using namespace std;
@@ -101,6 +101,11 @@ void CCLayerTilingData::reset()
void CCLayerTilingData::contentRectToTileIndices(const IntRect& contentRect, int& left, int& top, int& right, int& bottom) const
{
+ // An empty rect doesn't result in an empty set of tiles, so don't pass an empty rect.
+ // FIXME: Possibly we should fill a vector of tiles instead,
+ // since the normal use of this function is to enumerate some tiles.
+ ASSERT(!contentRect.isEmpty());
+
left = m_tilingData.tileXIndexFromSrcCoord(contentRect.x());
top = m_tilingData.tileYIndexFromSrcCoord(contentRect.y());
right = m_tilingData.tileXIndexFromSrcCoord(contentRect.maxX() - 1);
@@ -138,6 +143,10 @@ Region CCLayerTilingData::opaqueRegionInContentRect(const IntRect& contentRect)
void CCLayerTilingData::setBounds(const IntSize& size)
{
m_tilingData.setTotalSize(size);
+ if (size.isEmpty()) {
+ m_tiles.clear();
+ return;
+ }
// Any tiles completely outside our new bounds are invalid and should be dropped.
int left, top, right, bottom;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
index e7939327a..ebd733902 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
@@ -24,24 +24,25 @@
#include "config.h"
-#include "cc/CCLayerTreeHost.h"
-
+#include "CCLayerTreeHost.h"
+
+#include "CCFontAtlas.h"
+#include "CCGraphicsContext.h"
+#include "CCHeadsUpDisplayLayerImpl.h"
+#include "CCLayerAnimationController.h"
+#include "CCLayerIterator.h"
+#include "CCLayerTreeHostCommon.h"
+#include "CCLayerTreeHostImpl.h"
+#include "CCOcclusionTracker.h"
+#include "CCOverdrawMetrics.h"
+#include "CCSettings.h"
+#include "CCSingleThreadProxy.h"
+#include "CCThreadProxy.h"
#include "HeadsUpDisplayLayerChromium.h"
#include "LayerChromium.h"
#include "Region.h"
#include "TraceEvent.h"
#include "TreeSynchronizer.h"
-#include "cc/CCFontAtlas.h"
-#include "cc/CCGraphicsContext.h"
-#include "cc/CCLayerAnimationController.h"
-#include "cc/CCLayerIterator.h"
-#include "cc/CCLayerTreeHostCommon.h"
-#include "cc/CCLayerTreeHostImpl.h"
-#include "cc/CCOcclusionTracker.h"
-#include "cc/CCOverdrawMetrics.h"
-#include "cc/CCSettings.h"
-#include "cc/CCSingleThreadProxy.h"
-#include "cc/CCThreadProxy.h"
using namespace std;
using WebKit::WebTransformationMatrix;
@@ -236,6 +237,11 @@ void CCLayerTreeHost::finishCommitOnImplThread(CCLayerTreeHostImpl* hostImpl)
hostImpl->setRootLayer(TreeSynchronizer::synchronizeTrees(rootLayer(), hostImpl->detachLayerTree(), hostImpl));
+ if (!m_hudLayer)
+ hostImpl->setHudLayer(0);
+ else
+ hostImpl->setHudLayer(static_cast<CCHeadsUpDisplayLayerImpl*>(CCLayerTreeHostCommon::findLayerInSubtree(hostImpl->rootLayer(), m_hudLayer->id())));
+
// We may have added an animation during the tree sync. This will cause both layer tree hosts
// to visit their controllers.
if (rootLayer() && m_needsAnimateLayers)
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
index 6a2d7e675..baee9e5e5 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
@@ -25,18 +25,16 @@
#ifndef CCLayerTreeHost_h
#define CCLayerTreeHost_h
+#include "CCAnimationEvents.h"
+#include "CCGraphicsContext.h"
+#include "CCLayerTreeHostCommon.h"
+#include "CCOcclusionTracker.h"
+#include "CCPrioritizedTextureManager.h"
+#include "CCProxy.h"
+#include "CCRenderingStats.h"
#include "IntRect.h"
#include "RateLimiter.h"
#include "SkColor.h"
-#include "cc/CCAnimationEvents.h"
-#include "cc/CCGraphicsContext.h"
-#include "cc/CCLayerTreeHostCommon.h"
-#include "cc/CCOcclusionTracker.h"
-#include "cc/CCPrioritizedTextureManager.h"
-#include "cc/CCProxy.h"
-#include "cc/CCRenderingStats.h"
-
-
#include <limits>
#include <wtf/HashMap.h>
#include <wtf/OwnPtr.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp
index 9f4a035d7..6898c9779 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp
@@ -25,17 +25,17 @@
#include "config.h"
-#include "cc/CCLayerTreeHostCommon.h"
+#include "CCLayerTreeHostCommon.h"
+#include "CCLayerImpl.h"
+#include "CCLayerIterator.h"
+#include "CCLayerSorter.h"
+#include "CCMathUtil.h"
+#include "CCRenderSurface.h"
#include "FloatQuad.h"
#include "IntRect.h"
#include "LayerChromium.h"
#include "RenderSurfaceChromium.h"
-#include "cc/CCLayerImpl.h"
-#include "cc/CCLayerIterator.h"
-#include "cc/CCLayerSorter.h"
-#include "cc/CCMathUtil.h"
-#include "cc/CCRenderSurface.h"
#include <public/WebTransformationMatrix.h>
using WebKit::WebTransformationMatrix;
@@ -502,10 +502,10 @@ static void calculateDrawTransformsInternal(LayerType* layer, LayerType* rootLay
// The drawTransform that gets computed below is effectively the layer's drawTransform, unless
// the layer itself creates a renderSurface. In that case, the renderSurface re-parents the transforms.
WebTransformationMatrix drawTransform = combinedTransform;
+ // M[draw] = M[parent] * LT * Tr[anchor2center] * Tr[center2origin]
+ drawTransform.translate(-layer->bounds().width() / 2.0, -layer->bounds().height() / 2.0);
if (!layer->contentBounds().isEmpty() && !layer->bounds().isEmpty()) {
- // M[draw] = M[parent] * LT * Tr[anchor2center] * Tr[center2anchor]
- drawTransform.translate(-layer->bounds().width() / 2.0, -layer->bounds().height() / 2.0);
- // M[draw] = M[parent] * LT * Tr[anchor2origin] * S[content2layer]
+ // M[draw] = M[parent] * LT * Tr[anchor2origin] * S[layer2content]
drawTransform.scaleNonUniform(layer->bounds().width() / static_cast<double>(layer->contentBounds().width()),
layer->bounds().height() / static_cast<double>(layer->contentBounds().height()));
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
index b4f808e15..46edcc0a8 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
@@ -24,29 +24,31 @@
#include "config.h"
-#include "cc/CCLayerTreeHostImpl.h"
-
+#include "CCLayerTreeHostImpl.h"
+
+#include "CCActiveGestureAnimation.h"
+#include "CCDamageTracker.h"
+#include "CCDebugRectHistory.h"
+#include "CCDelayBasedTimeSource.h"
+#include "CCFontAtlas.h"
+#include "CCFrameRateCounter.h"
+#include "CCHeadsUpDisplayLayerImpl.h"
+#include "CCLayerIterator.h"
+#include "CCLayerTreeHost.h"
+#include "CCLayerTreeHostCommon.h"
+#include "CCMathUtil.h"
+#include "CCOverdrawMetrics.h"
+#include "CCPageScaleAnimation.h"
+#include "CCPrioritizedTextureManager.h"
+#include "CCRenderPassDrawQuad.h"
+#include "CCRenderingStats.h"
+#include "CCScrollbarAnimationController.h"
+#include "CCScrollbarLayerImpl.h"
+#include "CCSettings.h"
+#include "CCSingleThreadProxy.h"
#include "LayerRendererChromium.h"
#include "TextStream.h"
#include "TraceEvent.h"
-#include "cc/CCActiveGestureAnimation.h"
-#include "cc/CCDamageTracker.h"
-#include "cc/CCDebugRectHistory.h"
-#include "cc/CCDelayBasedTimeSource.h"
-#include "cc/CCFontAtlas.h"
-#include "cc/CCFrameRateCounter.h"
-#include "cc/CCLayerIterator.h"
-#include "cc/CCLayerTreeHost.h"
-#include "cc/CCLayerTreeHostCommon.h"
-#include "cc/CCOverdrawMetrics.h"
-#include "cc/CCPageScaleAnimation.h"
-#include "cc/CCPrioritizedTextureManager.h"
-#include "cc/CCRenderPassDrawQuad.h"
-#include "cc/CCRenderingStats.h"
-#include "cc/CCScrollbarAnimationController.h"
-#include "cc/CCScrollbarLayerImpl.h"
-#include "cc/CCSettings.h"
-#include "cc/CCSingleThreadProxy.h"
#include <wtf/CurrentTime.h>
using WebKit::WebTransformationMatrix;
@@ -118,11 +120,13 @@ CCLayerTreeHostImpl::CCLayerTreeHostImpl(const CCLayerTreeSettings& settings, CC
, m_sourceFrameNumber(-1)
, m_rootScrollLayerImpl(0)
, m_currentlyScrollingLayerImpl(0)
+ , m_hudLayerImpl(0)
, m_scrollingLayerIdFromPreviousTree(-1)
+ , m_scrollDeltaIsInScreenSpace(false)
, m_settings(settings)
, m_deviceScaleFactor(1)
, m_visible(true)
- , m_contentsTexturesWerePurgedSinceLastCommit(false)
+ , m_contentsTexturesPurged(false)
, m_memoryAllocationLimitBytes(CCPrioritizedTextureManager::defaultMemoryAllocationLimit())
, m_pageScale(1)
, m_pageScaleDelta(1)
@@ -159,7 +163,6 @@ void CCLayerTreeHostImpl::commitComplete()
// Recompute max scroll position; must be after layer content bounds are
// updated.
updateMaxScrollPosition();
- m_contentsTexturesWerePurgedSinceLastCommit = false;
}
bool CCLayerTreeHostImpl::canDraw()
@@ -176,7 +179,7 @@ bool CCLayerTreeHostImpl::canDraw()
TRACE_EVENT_INSTANT0("cc", "CCLayerTreeHostImpl::canDraw no layerRenderer");
return false;
}
- if (m_contentsTexturesWerePurgedSinceLastCommit) {
+ if (m_contentsTexturesPurged) {
TRACE_EVENT_INSTANT0("cc", "CCLayerTreeHostImpl::canDraw contents textures purged");
return false;
}
@@ -252,6 +255,7 @@ void CCLayerTreeHostImpl::calculateRenderSurfaceLayerList(CCLayerList& renderSur
{
ASSERT(renderSurfaceLayerList.isEmpty());
ASSERT(m_rootLayerImpl);
+ ASSERT(m_layerRenderer); // For maxTextureSize.
{
TRACE_EVENT0("cc", "CCLayerTreeHostImpl::calcDrawEtc");
@@ -512,8 +516,10 @@ bool CCLayerTreeHostImpl::prepareToDraw(FrameData& frame)
void CCLayerTreeHostImpl::releaseContentsTextures()
{
+ if (m_contentsTexturesPurged)
+ return;
m_resourceProvider->deleteOwnedResources(CCRenderer::ContentPool);
- m_contentsTexturesWerePurgedSinceLastCommit = true;
+ m_contentsTexturesPurged = true;
m_client->setNeedsCommitOnImplThread();
}
@@ -543,11 +549,16 @@ void CCLayerTreeHostImpl::drawLayers(const FrameData& frame)
// RenderWidget.
m_fpsCounter->markBeginningOfFrame(currentTime());
- m_layerRenderer->drawFrame(frame.renderPasses, frame.renderPassesById);
-
if (m_settings.showDebugRects())
m_debugRectHistory->saveDebugRectsForCurrentFrame(m_rootLayerImpl.get(), *frame.renderSurfaceLayerList, frame.occludingScreenSpaceRects, settings());
+ // Because the contents of the HUD depend on everything else in the frame, the contents
+ // of its texture are updated as the last thing before the frame is drawn.
+ if (m_hudLayerImpl)
+ m_hudLayerImpl->updateHudTexture(m_resourceProvider.get());
+
+ m_layerRenderer->drawFrame(frame.renderPasses, frame.renderPassesById);
+
// Once a RenderPass has been drawn, its damage should be cleared in
// case the RenderPass will be reused next frame.
for (unsigned int i = 0; i < frame.renderPasses.size(); i++)
@@ -829,6 +840,8 @@ bool CCLayerTreeHostImpl::ensureRenderSurfaceLayerList()
{
if (!m_rootLayerImpl)
return false;
+ if (!m_layerRenderer)
+ return false;
// We need both a non-empty render surface layer list and a root render
// surface to be able to iterate over the visible layers.
@@ -884,36 +897,95 @@ CCInputHandlerClient::ScrollStatus CCLayerTreeHostImpl::scrollBegin(const IntPoi
if (potentiallyScrollingLayerImpl) {
m_currentlyScrollingLayerImpl = potentiallyScrollingLayerImpl;
+ // Gesture events need to be transformed from screen coordinates to local layer coordinates
+ // so that the scrolling contents exactly follow the user's finger. In contrast, wheel
+ // events are already in local layer coordinates so we can just apply them directly.
+ m_scrollDeltaIsInScreenSpace = (type == Gesture);
return ScrollStarted;
}
return ScrollIgnored;
}
-void CCLayerTreeHostImpl::scrollBy(const IntSize& scrollDelta)
+static FloatSize scrollLayerWithScreenSpaceDelta(CCLayerImpl& layerImpl, const FloatPoint& screenSpacePoint, const FloatSize& screenSpaceDelta)
+{
+ // Layers with non-invertible screen space transforms should not have passed the scroll hit
+ // test in the first place.
+ ASSERT(layerImpl.screenSpaceTransform().isInvertible());
+ WebTransformationMatrix inverseScreenSpaceTransform = layerImpl.screenSpaceTransform().inverse();
+
+ // First project the scroll start and end points to local layer space to find the scroll delta
+ // in layer coordinates.
+ bool startClipped, endClipped;
+ FloatPoint screenSpaceEndPoint = screenSpacePoint + screenSpaceDelta;
+ FloatPoint localStartPoint = CCMathUtil::projectPoint(inverseScreenSpaceTransform, screenSpacePoint, startClipped);
+ FloatPoint localEndPoint = CCMathUtil::projectPoint(inverseScreenSpaceTransform, screenSpaceEndPoint, endClipped);
+
+ // In general scroll point coordinates should not get clipped.
+ ASSERT(!startClipped);
+ ASSERT(!endClipped);
+ if (startClipped || endClipped)
+ return FloatSize();
+
+ // Apply the scroll delta.
+ FloatSize previousDelta(layerImpl.scrollDelta());
+ layerImpl.scrollBy(localEndPoint - localStartPoint);
+
+ // Calculate the applied scroll delta in screen space coordinates.
+ FloatPoint actualLocalEndPoint = localStartPoint + layerImpl.scrollDelta() - previousDelta;
+ FloatPoint actualScreenSpaceEndPoint = CCMathUtil::mapPoint(layerImpl.screenSpaceTransform(), actualLocalEndPoint, endClipped);
+ ASSERT(!endClipped);
+ if (endClipped)
+ return FloatSize();
+ return actualScreenSpaceEndPoint - screenSpacePoint;
+}
+
+static FloatSize scrollLayerWithLocalDelta(CCLayerImpl& layerImpl, const FloatSize& localDelta)
+{
+ FloatSize previousDelta(layerImpl.scrollDelta());
+ layerImpl.scrollBy(localDelta);
+ return layerImpl.scrollDelta() - previousDelta;
+}
+
+void CCLayerTreeHostImpl::scrollBy(const IntPoint& viewportPoint, const IntSize& scrollDelta)
{
TRACE_EVENT0("cc", "CCLayerTreeHostImpl::scrollBy");
if (!m_currentlyScrollingLayerImpl)
return;
FloatSize pendingDelta(scrollDelta);
- pendingDelta.scale(1 / m_pageScaleDelta);
-
- for (CCLayerImpl* layerImpl = m_currentlyScrollingLayerImpl; layerImpl && !pendingDelta.isZero(); layerImpl = layerImpl->parent()) {
+ for (CCLayerImpl* layerImpl = m_currentlyScrollingLayerImpl; layerImpl; layerImpl = layerImpl->parent()) {
if (!layerImpl->scrollable())
continue;
- FloatSize previousDelta(layerImpl->scrollDelta());
- layerImpl->scrollBy(pendingDelta);
- // Reset the pending scroll delta to zero if the layer was able to move along the requested
- // axis. This is to ensure it is possible to scroll exactly to the beginning or end of a
- // scroll area regardless of the scroll step. For diagonal scrolls this also avoids applying
- // the scroll on one axis to multiple layers.
- if (previousDelta.width() != layerImpl->scrollDelta().width())
- pendingDelta.setWidth(0);
- if (previousDelta.height() != layerImpl->scrollDelta().height())
- pendingDelta.setHeight(0);
+
+ FloatSize appliedDelta;
+ if (m_scrollDeltaIsInScreenSpace)
+ appliedDelta = scrollLayerWithScreenSpaceDelta(*layerImpl, viewportPoint, pendingDelta);
+ else
+ appliedDelta = scrollLayerWithLocalDelta(*layerImpl, pendingDelta);
+
+ // If the layer wasn't able to move, try the next one in the hierarchy.
+ float moveThresholdSquared = 0.1 * 0.1;
+ if (appliedDelta.diagonalLengthSquared() < moveThresholdSquared)
+ continue;
+
+ // If the applied delta is within 45 degrees of the input delta, bail out to make it easier
+ // to scroll just one layer in one direction without affecting any of its parents.
+ float angleThreshold = 45;
+ if (CCMathUtil::smallestAngleBetweenVectors(appliedDelta, pendingDelta) < angleThreshold) {
+ pendingDelta = FloatSize();
+ break;
+ }
+
+ // Allow further movement only on an axis perpendicular to the direction in which the layer
+ // moved.
+ FloatSize perpendicularAxis(-appliedDelta.height(), appliedDelta.width());
+ pendingDelta = CCMathUtil::projectVector(pendingDelta, perpendicularAxis);
+
+ if (flooredIntSize(pendingDelta).isZero())
+ break;
}
- if (!scrollDelta.isZero() && pendingDelta.isEmpty()) {
+ if (!scrollDelta.isZero() && flooredIntSize(pendingDelta).isEmpty()) {
m_client->setNeedsCommitOnImplThread();
m_client->setNeedsRedrawOnImplThread();
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
index 6ca0cd692..5a4b64a57 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
@@ -25,12 +25,12 @@
#ifndef CCLayerTreeHostImpl_h
#define CCLayerTreeHostImpl_h
+#include "CCAnimationEvents.h"
+#include "CCInputHandler.h"
+#include "CCLayerSorter.h"
+#include "CCRenderPass.h"
+#include "CCRenderer.h"
#include "SkColor.h"
-#include "cc/CCAnimationEvents.h"
-#include "cc/CCInputHandler.h"
-#include "cc/CCLayerSorter.h"
-#include "cc/CCRenderPass.h"
-#include "cc/CCRenderer.h"
#include <public/WebCompositorOutputSurfaceClient.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
@@ -41,6 +41,7 @@ class CCActiveGestureAnimation;
class CCCompletionEvent;
class CCDebugRectHistory;
class CCFrameRateCounter;
+class CCHeadsUpDisplayLayerImpl;
class CCLayerImpl;
class CCLayerTreeHostImplTimeSourceAdapter;
class CCPageScaleAnimation;
@@ -74,7 +75,7 @@ public:
// CCInputHandlerClient implementation
virtual CCInputHandlerClient::ScrollStatus scrollBegin(const IntPoint&, CCInputHandlerClient::ScrollInputType) OVERRIDE;
- virtual void scrollBy(const IntSize&) OVERRIDE;
+ virtual void scrollBy(const IntPoint&, const IntSize&) OVERRIDE;
virtual void scrollEnd() OVERRIDE;
virtual void pinchGestureBegin() OVERRIDE;
virtual void pinchGestureUpdate(float, const IntPoint&) OVERRIDE;
@@ -140,6 +141,9 @@ public:
void setRootLayer(PassOwnPtr<CCLayerImpl>);
CCLayerImpl* rootLayer() { return m_rootLayerImpl.get(); }
+ void setHudLayer(CCHeadsUpDisplayLayerImpl* layerImpl) { m_hudLayerImpl = layerImpl; }
+ CCHeadsUpDisplayLayerImpl* hudLayer() { return m_hudLayerImpl; }
+
// Release ownership of the current layer tree and replace it with an empty
// tree. Returns the root layer of the detached tree.
PassOwnPtr<CCLayerImpl> detachLayerTree();
@@ -152,7 +156,8 @@ public:
int sourceFrameNumber() const { return m_sourceFrameNumber; }
void setSourceFrameNumber(int frameNumber) { m_sourceFrameNumber = frameNumber; }
- bool contentsTexturesWerePurgedSinceLastCommit() const { return m_contentsTexturesWerePurgedSinceLastCommit; }
+ bool contentsTexturesPurged() const { return m_contentsTexturesPurged; }
+ void resetContentsTexturesPurged() { m_contentsTexturesPurged = false; }
size_t memoryAllocationLimitBytes() const { return m_memoryAllocationLimitBytes; }
void setViewportSize(const IntSize& layoutViewportSize, const IntSize& deviceViewportSize);
@@ -266,13 +271,15 @@ private:
OwnPtr<CCLayerImpl> m_rootLayerImpl;
CCLayerImpl* m_rootScrollLayerImpl;
CCLayerImpl* m_currentlyScrollingLayerImpl;
+ CCHeadsUpDisplayLayerImpl* m_hudLayerImpl;
int m_scrollingLayerIdFromPreviousTree;
+ bool m_scrollDeltaIsInScreenSpace;
CCLayerTreeSettings m_settings;
IntSize m_layoutViewportSize;
IntSize m_deviceViewportSize;
float m_deviceScaleFactor;
bool m_visible;
- bool m_contentsTexturesWerePurgedSinceLastCommit;
+ bool m_contentsTexturesPurged;
size_t m_memoryAllocationLimitBytes;
float m_pageScale;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCMathUtil.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCMathUtil.cpp
index 4d5ec933d..cad0a5d63 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCMathUtil.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCMathUtil.cpp
@@ -24,7 +24,7 @@
#include "config.h"
-#include "cc/CCMathUtil.h"
+#include "CCMathUtil.h"
#include "FloatPoint.h"
#include "FloatQuad.h"
@@ -381,4 +381,19 @@ void CCMathUtil::flattenTransformTo2d(WebTransformationMatrix& transform)
transform.setM43(0);
}
+float CCMathUtil::smallestAngleBetweenVectors(const FloatSize& v1, const FloatSize& v2)
+{
+ float dotProduct = (v1.width() * v2.width() + v1.height() * v2.height()) / (v1.diagonalLength() * v2.diagonalLength());
+ // Clamp to compensate for rounding errors.
+ dotProduct = std::max(-1.f, std::min(1.f, dotProduct));
+ return rad2deg(acosf(dotProduct));
+}
+
+FloatSize CCMathUtil::projectVector(const FloatSize& source, const FloatSize& destination)
+{
+ float sourceDotDestination = source.width() * destination.width() + source.height() * destination.height();
+ float projectedLength = sourceDotDestination / destination.diagonalLengthSquared();
+ return FloatSize(projectedLength * destination.width(), projectedLength * destination.height());
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCMathUtil.h b/Source/WebCore/platform/graphics/chromium/cc/CCMathUtil.h
index 3fb591429..0f9e7a0e3 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCMathUtil.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCMathUtil.h
@@ -115,6 +115,13 @@ public:
static FloatPoint projectPoint(const WebKit::WebTransformationMatrix&, const FloatPoint&, bool& clipped);
static void flattenTransformTo2d(WebKit::WebTransformationMatrix&);
+
+ // Returns the smallest angle between the given two vectors in degrees. Neither vector is
+ // assumed to be normalized.
+ static float smallestAngleBetweenVectors(const FloatSize&, const FloatSize&);
+
+ // Projects the |source| vector onto |destination|. Neither vector is assumed to be normalized.
+ static FloatSize projectVector(const FloatSize& source, const FloatSize& destination);
};
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp
index ae490b76e..a0f0e247b 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp
@@ -27,13 +27,12 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "cc/CCOcclusionTracker.h"
+#include "CCOcclusionTracker.h"
+#include "CCLayerImpl.h"
+#include "CCMathUtil.h"
+#include "CCOverdrawMetrics.h"
#include "LayerChromium.h"
-#include "cc/CCLayerImpl.h"
-#include "cc/CCMathUtil.h"
-#include "cc/CCOverdrawMetrics.h"
-
#include <algorithm>
using namespace std;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.h b/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.h
index d2f4a00dc..7877319f0 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.h
@@ -26,9 +26,9 @@
#ifndef CCOcclusionTracker_h
#define CCOcclusionTracker_h
+#include "CCLayerIterator.h"
#include "FloatQuad.h"
#include "Region.h"
-#include "cc/CCLayerIterator.h"
namespace WebCore {
class CCOverdrawMetrics;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCOverdrawMetrics.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCOverdrawMetrics.cpp
index c5b6f3ae7..dc90c5d4c 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCOverdrawMetrics.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCOverdrawMetrics.cpp
@@ -26,14 +26,14 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "cc/CCOverdrawMetrics.h"
+#include "CCOverdrawMetrics.h"
+#include "CCLayerTreeHost.h"
+#include "CCLayerTreeHostImpl.h"
+#include "CCMathUtil.h"
#include "FloatQuad.h"
#include "IntRect.h"
#include "TraceEvent.h"
-#include "cc/CCLayerTreeHost.h"
-#include "cc/CCLayerTreeHostImpl.h"
-#include "cc/CCMathUtil.h"
#include <public/Platform.h>
#include <public/WebTransformationMatrix.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCPageScaleAnimation.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCPageScaleAnimation.cpp
index e45c00f6b..508851f9d 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCPageScaleAnimation.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCPageScaleAnimation.cpp
@@ -27,7 +27,7 @@
#include "config.h"
-#include "cc/CCPageScaleAnimation.h"
+#include "CCPageScaleAnimation.h"
#include "FloatRect.h"
#include "FloatSize.h"
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTexture.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTexture.cpp
index 60cf1a1e2..b1722763a 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTexture.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTexture.cpp
@@ -105,13 +105,13 @@ CCResourceProvider::ResourceId CCPrioritizedTexture::resourceId() const
void CCPrioritizedTexture::upload(CCResourceProvider* resourceProvider,
const uint8_t* image, const IntRect& imageRect,
- const IntRect& sourceRect, const IntRect& destRect)
+ const IntRect& sourceRect, const IntSize& destOffset)
{
ASSERT(m_isAbovePriorityCutoff);
if (m_isAbovePriorityCutoff)
acquireBackingTexture(resourceProvider);
ASSERT(m_backing);
- resourceProvider->upload(resourceId(), image, imageRect, sourceRect, destRect);
+ resourceProvider->upload(resourceId(), image, imageRect, sourceRect, destOffset);
}
void CCPrioritizedTexture::link(Backing* backing)
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTexture.h b/Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTexture.h
index 764cbeced..3789d7f26 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTexture.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTexture.h
@@ -25,12 +25,12 @@
#ifndef CCPrioritizedTexture_h
#define CCPrioritizedTexture_h
+#include "CCPriorityCalculator.h"
+#include "CCResourceProvider.h"
+#include "CCTexture.h"
#include "GraphicsContext3D.h"
#include "IntRect.h"
#include "IntSize.h"
-#include "cc/CCPriorityCalculator.h"
-#include "cc/CCResourceProvider.h"
-#include "cc/CCTexture.h"
namespace WebCore {
@@ -86,7 +86,7 @@ public:
bool requestLate();
// Uploads pixels into the backing resource. This functions will aquire the backing if needed.
- void upload(CCResourceProvider*, const uint8_t* image, const IntRect& imageRect, const IntRect& sourceRect, const IntRect& destRect);
+ void upload(CCResourceProvider*, const uint8_t* image, const IntRect& imageRect, const IntRect& sourceRect, const IntSize& destOffset);
CCResourceProvider::ResourceId resourceId() const;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCPriorityCalculator.h b/Source/WebCore/platform/graphics/chromium/cc/CCPriorityCalculator.h
index a90a07390..7c2c8cda2 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCPriorityCalculator.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCPriorityCalculator.h
@@ -45,6 +45,7 @@ public:
static inline int lowestPriority() { return std::numeric_limits<int>::max(); }
static inline bool priorityIsLower(int a, int b) { return a > b; }
static inline bool priorityIsHigher(int a, int b) { return a < b; }
+ static inline bool maxPriority(int a, int b) { return priorityIsHigher(a, b) ? a : b; }
};
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCProxy.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCProxy.cpp
index 506a99376..05752f0f8 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCProxy.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCProxy.cpp
@@ -24,9 +24,9 @@
#include "config.h"
-#include "cc/CCProxy.h"
+#include "CCProxy.h"
-#include "cc/CCThreadTask.h"
+#include "CCThreadTask.h"
#include <wtf/MainThread.h>
using namespace WTF;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp
index 0684f3ee5..f2e9e9ffe 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp
@@ -27,15 +27,15 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "cc/CCQuadCuller.h"
+#include "CCQuadCuller.h"
+#include "CCDebugBorderDrawQuad.h"
+#include "CCLayerImpl.h"
+#include "CCOcclusionTracker.h"
+#include "CCOverdrawMetrics.h"
+#include "CCRenderPass.h"
#include "Region.h"
#include "SkColor.h"
-#include "cc/CCDebugBorderDrawQuad.h"
-#include "cc/CCLayerImpl.h"
-#include "cc/CCOcclusionTracker.h"
-#include "cc/CCOverdrawMetrics.h"
-#include "cc/CCRenderPass.h"
#include <public/WebTransformationMatrix.h>
using namespace std;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp
index 49dc90252..3133e23d5 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp
@@ -25,14 +25,14 @@
#include "config.h"
-#include "cc/CCRenderPass.h"
-
-#include "cc/CCLayerImpl.h"
-#include "cc/CCMathUtil.h"
-#include "cc/CCOcclusionTracker.h"
-#include "cc/CCQuadCuller.h"
-#include "cc/CCSharedQuadState.h"
-#include "cc/CCSolidColorDrawQuad.h"
+#include "CCRenderPass.h"
+
+#include "CCLayerImpl.h"
+#include "CCMathUtil.h"
+#include "CCOcclusionTracker.h"
+#include "CCQuadCuller.h"
+#include "CCSharedQuadState.h"
+#include "CCSolidColorDrawQuad.h"
using WebKit::WebTransformationMatrix;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.h b/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.h
index e2a480e09..67ecb4306 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.h
@@ -26,10 +26,10 @@
#ifndef CCRenderPass_h
#define CCRenderPass_h
+#include "CCDrawQuad.h"
+#include "CCOcclusionTracker.h"
+#include "CCSharedQuadState.h"
#include "SkColor.h"
-#include "cc/CCDrawQuad.h"
-#include "cc/CCOcclusionTracker.h"
-#include "cc/CCSharedQuadState.h"
#include <public/WebFilterOperations.h>
#include <public/WebTransformationMatrix.h>
#include <wtf/HashMap.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp
index 3b0a48a7a..c53b7fe45 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp
@@ -25,7 +25,7 @@
#include "config.h"
-#include "cc/CCRenderPassDrawQuad.h"
+#include "CCRenderPassDrawQuad.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.h b/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.h
index df8ce0c90..0d2caf9b5 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.h
@@ -26,9 +26,9 @@
#ifndef CCRenderPassDrawQuad_h
#define CCRenderPassDrawQuad_h
+#include "CCDrawQuad.h"
+#include "CCResourceProvider.h"
#include "IntRect.h"
-#include "cc/CCDrawQuad.h"
-#include "cc/CCResourceProvider.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.cpp
index ed9675e05..11edbfa88 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.cpp
@@ -27,18 +27,18 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "cc/CCRenderSurface.h"
-
+#include "CCRenderSurface.h"
+
+#include "CCDamageTracker.h"
+#include "CCDebugBorderDrawQuad.h"
+#include "CCLayerImpl.h"
+#include "CCMathUtil.h"
+#include "CCQuadSink.h"
+#include "CCRenderPassDrawQuad.h"
+#include "CCSharedQuadState.h"
#include "GraphicsContext3D.h"
#include "LayerRendererChromium.h"
#include "TextStream.h"
-#include "cc/CCDamageTracker.h"
-#include "cc/CCDebugBorderDrawQuad.h"
-#include "cc/CCLayerImpl.h"
-#include "cc/CCMathUtil.h"
-#include "cc/CCQuadSink.h"
-#include "cc/CCRenderPassDrawQuad.h"
-#include "cc/CCSharedQuadState.h"
#include <public/WebTransformationMatrix.h>
#include <wtf/text/CString.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h b/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h
index eb53af2b7..0e518b2aa 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h
@@ -29,9 +29,9 @@
#if USE(ACCELERATED_COMPOSITING)
+#include "CCSharedQuadState.h"
#include "FloatRect.h"
#include "IntRect.h"
-#include "cc/CCSharedQuadState.h"
#include <public/WebTransformationMatrix.h>
#include <wtf/Noncopyable.h>
#include <wtf/text/WTFString.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurfaceFilters.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurfaceFilters.cpp
index a02fd5f8f..bc3e5db14 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurfaceFilters.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurfaceFilters.cpp
@@ -27,7 +27,7 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "cc/CCRenderSurfaceFilters.h"
+#include "CCRenderSurfaceFilters.h"
#include "FloatSize.h"
#include "SkBlurImageFilter.h"
@@ -35,6 +35,7 @@
#include "SkColorMatrixFilter.h"
#include "SkGpuDevice.h"
#include "SkGrTexturePixelRef.h"
+#include "SkMagnifierImageFilter.h"
#include <public/WebFilterOperation.h>
#include <public/WebFilterOperations.h>
#include <public/WebGraphicsContext3D.h>
@@ -366,6 +367,7 @@ WebKit::WebFilterOperations CCRenderSurfaceFilters::optimize(const WebKit::WebFi
switch (op.type()) {
case WebKit::WebFilterOperation::FilterTypeBlur:
case WebKit::WebFilterOperation::FilterTypeDropShadow:
+ case WebKit::WebFilterOperation::FilterTypeZoom:
newList.append(op);
break;
case WebKit::WebFilterOperation::FilterTypeBrightness:
@@ -426,6 +428,20 @@ SkBitmap CCRenderSurfaceFilters::apply(const WebKit::WebFilterOperations& filter
canvas->drawBitmap(state.source(), 0, 0);
break;
}
+ case WebKit::WebFilterOperation::FilterTypeZoom: {
+ SkPaint paint;
+ SkAutoTUnref<SkImageFilter> zoomFilter(
+ new SkMagnifierImageFilter(
+ SkRect::MakeXYWH(op.zoomRect().x,
+ op.zoomRect().y,
+ op.zoomRect().width,
+ op.zoomRect().height),
+ op.amount()));
+ paint.setImageFilter(zoomFilter.get());
+ canvas->saveLayer(0, &paint);
+ canvas->drawBitmap(state.source(), 0, 0);
+ break;
+ }
case WebKit::WebFilterOperation::FilterTypeBrightness:
case WebKit::WebFilterOperation::FilterTypeContrast:
case WebKit::WebFilterOperation::FilterTypeGrayscale:
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCRenderer.h b/Source/WebCore/platform/graphics/chromium/cc/CCRenderer.h
index 6664b7f9e..40ab241c5 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCRenderer.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCRenderer.h
@@ -26,10 +26,10 @@
#ifndef CCRenderer_h
#define CCRenderer_h
+#include "CCLayerTreeHost.h"
+#include "CCRenderPass.h"
#include "FloatQuad.h"
#include "IntRect.h"
-#include "cc/CCLayerTreeHost.h"
-#include "cc/CCRenderPass.h"
#include <wtf/Noncopyable.h>
#include <wtf/PassRefPtr.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.cpp
index a0bd37cc8..8a5d6af9d 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.cpp
@@ -24,14 +24,15 @@
#include "config.h"
-#include "cc/CCResourceProvider.h"
+#include "CCResourceProvider.h"
+#include "CCProxy.h"
#include "Extensions3DChromium.h"
#include "IntRect.h"
#include "LayerRendererChromium.h" // For the GLC() macro
#include "LayerTextureSubImage.h"
-#include "cc/CCProxy.h"
#include <public/WebGraphicsContext3D.h>
+#include <wtf/HashSet.h>
using WebKit::WebGraphicsContext3D;
@@ -82,7 +83,7 @@ bool CCResourceProvider::inUseByConsumer(ResourceId id)
ASSERT(CCProxy::isImplThread());
ResourceMap::iterator it = m_resources.find(id);
ASSERT(it != m_resources.end());
- return !!it->second.lockForReadCount;
+ return !!it->second.lockForReadCount || it->second.exported;
}
CCResourceProvider::ResourceId CCResourceProvider::createResource(int pool, const IntSize& size, GC3Denum format, TextureUsageHint hint)
@@ -109,7 +110,7 @@ CCResourceProvider::ResourceId CCResourceProvider::createResource(int pool, cons
} else
GLC(context3d, context3d->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, format, size.width(), size.height(), 0, format, GraphicsContext3D::UNSIGNED_BYTE, 0));
ResourceId id = m_nextId++;
- Resource resource = {textureId, pool, 0, false, false, size, format};
+ Resource resource(textureId, pool, size, format);
m_resources.add(id, resource);
return id;
}
@@ -118,7 +119,9 @@ CCResourceProvider::ResourceId CCResourceProvider::createResourceFromExternalTex
{
ASSERT(CCProxy::isImplThread());
ResourceId id = m_nextId++;
- Resource resource = {textureId, 0, 0, false, true, IntSize(), 0};
+ Resource resource;
+ resource.glId = textureId;
+ resource.external = true;
m_resources.add(id, resource);
return id;
}
@@ -141,16 +144,16 @@ void CCResourceProvider::deleteResource(ResourceId id)
void CCResourceProvider::deleteOwnedResources(int pool)
{
ASSERT(CCProxy::isImplThread());
- Vector<ResourceId> toDelete;
+ ResourceIdArray toDelete;
for (ResourceMap::iterator it = m_resources.begin(); it != m_resources.end(); ++it) {
if (it->second.pool == pool && !it->second.external)
toDelete.append(it->first);
}
- for (Vector<ResourceId>::iterator it = toDelete.begin(); it != toDelete.end(); ++it)
+ for (ResourceIdArray::iterator it = toDelete.begin(); it != toDelete.end(); ++it)
deleteResource(*it);
}
-void CCResourceProvider::upload(ResourceId id, const uint8_t* image, const IntRect& imageRect, const IntRect& sourceRect, const IntRect& destRect)
+void CCResourceProvider::upload(ResourceId id, const uint8_t* image, const IntRect& imageRect, const IntRect& sourceRect, const IntSize& destOffset)
{
ASSERT(CCProxy::isImplThread());
ASSERT(m_texSubImage.get());
@@ -163,7 +166,7 @@ void CCResourceProvider::upload(ResourceId id, const uint8_t* image, const IntRe
ASSERT(it != m_resources.end() && !it->second.lockedForWrite && !it->second.lockForReadCount && !it->second.external);
context3d->bindTexture(GraphicsContext3D::TEXTURE_2D, it->second.glId);
- m_texSubImage->upload(image, imageRect, sourceRect, destRect, it->second.format, context3d);
+ m_texSubImage->upload(image, imageRect, sourceRect, destOffset, it->second.format, context3d);
}
unsigned CCResourceProvider::lockForWrite(ResourceId id)
@@ -228,6 +231,7 @@ void CCResourceProvider::unlockForRead(ResourceId id)
CCResourceProvider::CCResourceProvider(CCGraphicsContext* context)
: m_context(context)
, m_nextId(1)
+ , m_nextChild(1)
, m_useTextureStorageExt(false)
, m_useTextureUsageHint(false)
, m_useShallowFlush(false)
@@ -264,4 +268,177 @@ bool CCResourceProvider::initialize()
return true;
}
+int CCResourceProvider::createChild(int pool)
+{
+ ASSERT(CCProxy::isImplThread());
+ Child childInfo;
+ childInfo.pool = pool;
+ int child = m_nextChild++;
+ m_children.add(child, childInfo);
+ return child;
+}
+
+void CCResourceProvider::destroyChild(int child)
+{
+ ASSERT(CCProxy::isImplThread());
+ ChildMap::iterator it = m_children.find(child);
+ ASSERT(it != m_children.end());
+ deleteOwnedResources(it->second.pool);
+ m_children.remove(it);
+ trimMailboxDeque();
+}
+
+const CCResourceProvider::ResourceIdMap& CCResourceProvider::getChildToParentMap(int child) const
+{
+ ASSERT(CCProxy::isImplThread());
+ ChildMap::const_iterator it = m_children.find(child);
+ ASSERT(it != m_children.end());
+ return it->second.childToParentMap;
+}
+
+CCResourceProvider::TransferableResourceList CCResourceProvider::prepareSendToParent(const ResourceIdArray& resources)
+{
+ ASSERT(CCProxy::isImplThread());
+ TransferableResourceList list;
+ list.syncPoint = 0;
+ WebGraphicsContext3D* context3d = m_context->context3D();
+ if (!context3d || !context3d->makeContextCurrent()) {
+ // FIXME: Implement this path for software compositing.
+ return list;
+ }
+ for (ResourceIdArray::const_iterator it = resources.begin(); it != resources.end(); ++it) {
+ TransferableResource resource;
+ if (transferResource(context3d, *it, &resource)) {
+ m_resources.find(*it)->second.exported = true;
+ list.resources.append(resource);
+ }
+ }
+ if (list.resources.size())
+ list.syncPoint = context3d->insertSyncPoint();
+ return list;
+}
+
+CCResourceProvider::TransferableResourceList CCResourceProvider::prepareSendToChild(int child, const ResourceIdArray& resources)
+{
+ ASSERT(CCProxy::isImplThread());
+ TransferableResourceList list;
+ list.syncPoint = 0;
+ WebGraphicsContext3D* context3d = m_context->context3D();
+ if (!context3d || !context3d->makeContextCurrent()) {
+ // FIXME: Implement this path for software compositing.
+ return list;
+ }
+ Child& childInfo = m_children.find(child)->second;
+ for (ResourceIdArray::const_iterator it = resources.begin(); it != resources.end(); ++it) {
+ TransferableResource resource;
+ if (!transferResource(context3d, *it, &resource))
+ ASSERT_NOT_REACHED();
+ resource.id = childInfo.parentToChildMap.get(*it);
+ childInfo.parentToChildMap.remove(*it);
+ childInfo.childToParentMap.remove(resource.id);
+ list.resources.append(resource);
+ deleteResource(*it);
+ }
+ if (list.resources.size())
+ list.syncPoint = context3d->insertSyncPoint();
+ return list;
+}
+
+void CCResourceProvider::receiveFromChild(int child, const TransferableResourceList& resources)
+{
+ ASSERT(CCProxy::isImplThread());
+ WebGraphicsContext3D* context3d = m_context->context3D();
+ if (!context3d || !context3d->makeContextCurrent()) {
+ // FIXME: Implement this path for software compositing.
+ return;
+ }
+ if (resources.syncPoint) {
+ // NOTE: If the parent is a browser and the child a renderer, the parent
+ // is not supposed to have its context wait, because that could induce
+ // deadlocks and/or security issues. The caller is responsible for
+ // waiting asynchronously, and resetting syncPoint before calling this.
+ // However if the parent is a renderer (e.g. browser tag), it may be ok
+ // (and is simpler) to wait.
+ GLC(context3d, context3d->waitSyncPoint(resources.syncPoint));
+ }
+ Child& childInfo = m_children.find(child)->second;
+ for (Vector<TransferableResource>::const_iterator it = resources.resources.begin(); it != resources.resources.end(); ++it) {
+ unsigned textureId;
+ GLC(context3d, textureId = context3d->createTexture());
+ GLC(context3d, context3d->bindTexture(GraphicsContext3D::TEXTURE_2D, textureId));
+ GLC(context3d, context3d->consumeTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, it->mailbox.name));
+ ResourceId id = m_nextId++;
+ Resource resource(textureId, childInfo.pool, it->size, it->format);
+ m_resources.add(id, resource);
+ m_mailboxes.append(it->mailbox);
+ childInfo.parentToChildMap.add(id, it->id);
+ childInfo.childToParentMap.add(it->id, id);
+ }
+}
+
+void CCResourceProvider::receiveFromParent(const TransferableResourceList& resources)
+{
+ ASSERT(CCProxy::isImplThread());
+ WebGraphicsContext3D* context3d = m_context->context3D();
+ if (!context3d || !context3d->makeContextCurrent()) {
+ // FIXME: Implement this path for software compositing.
+ return;
+ }
+ if (resources.syncPoint)
+ GLC(context3d, context3d->waitSyncPoint(resources.syncPoint));
+ for (Vector<TransferableResource>::const_iterator it = resources.resources.begin(); it != resources.resources.end(); ++it) {
+ Resource& resource = m_resources.find(it->id)->second;
+ ASSERT(resource.exported);
+ resource.exported = false;
+ GLC(context3d, context3d->bindTexture(GraphicsContext3D::TEXTURE_2D, resource.glId));
+ GLC(context3d, context3d->consumeTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, it->mailbox.name));
+ m_mailboxes.append(it->mailbox);
+ }
+}
+
+bool CCResourceProvider::transferResource(WebGraphicsContext3D* context, ResourceId id, TransferableResource* resource)
+{
+ ASSERT(CCProxy::isImplThread());
+ ResourceMap::const_iterator it = m_resources.find(id);
+ ASSERT(it != m_resources.end() && !it->second.lockedForWrite && !it->second.lockForReadCount && !it->second.external);
+ if (it->second.exported)
+ return false;
+ resource->id = id;
+ resource->format = it->second.format;
+ resource->size = it->second.size;
+ if (!m_mailboxes.isEmpty())
+ resource->mailbox = m_mailboxes.takeFirst();
+ else
+ GLC(context, context->genMailboxCHROMIUM(resource->mailbox.name));
+ GLC(context, context->bindTexture(GraphicsContext3D::TEXTURE_2D, it->second.glId));
+ GLC(context, context->produceTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, resource->mailbox.name));
+ return true;
+}
+
+void CCResourceProvider::trimMailboxDeque()
+{
+ // Trim the mailbox deque to the maximum number of resources we may need to
+ // send.
+ // If we have a parent, any non-external resource not already transfered is
+ // eligible to be sent to the parent. Otherwise, all resources belonging to
+ // a child might need to be sent back to the child.
+ size_t maxMailboxCount = 0;
+ if (m_context->capabilities().hasParentCompositor) {
+ for (ResourceMap::iterator it = m_resources.begin(); it != m_resources.end(); ++it) {
+ if (!it->second.exported && !it->second.external)
+ ++maxMailboxCount;
+ }
+ } else {
+ HashSet<int> childPoolSet;
+ for (ChildMap::iterator it = m_children.begin(); it != m_children.end(); ++it)
+ childPoolSet.add(it->second.pool);
+ for (ResourceMap::iterator it = m_resources.begin(); it != m_resources.end(); ++it) {
+ if (childPoolSet.contains(it->second.pool))
+ ++maxMailboxCount;
+ }
+ }
+ while (m_mailboxes.size() > maxMailboxCount)
+ m_mailboxes.removeFirst();
+}
+
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.h b/Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.h
index add909e5b..e927d292f 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.h
@@ -27,14 +27,16 @@
#ifndef CCResourceProvider_h
#define CCResourceProvider_h
+#include "CCGraphicsContext.h"
#include "GraphicsContext3D.h"
#include "IntSize.h"
-#include "cc/CCGraphicsContext.h"
+#include <wtf/Deque.h>
#include <wtf/HashMap.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
namespace WebKit {
class WebGraphicsContext3D;
@@ -53,7 +55,23 @@ class CCResourceProvider {
WTF_MAKE_NONCOPYABLE(CCResourceProvider);
public:
typedef unsigned ResourceId;
+ typedef Vector<ResourceId> ResourceIdArray;
+ typedef HashMap<ResourceId, ResourceId> ResourceIdMap;
enum TextureUsageHint { TextureUsageAny, TextureUsageFramebuffer };
+ struct Mailbox {
+ GC3Dbyte name[64];
+ };
+ struct TransferableResource {
+ unsigned id;
+ GC3Denum format;
+ IntSize size;
+ Mailbox mailbox;
+ };
+ typedef Vector<TransferableResource> TransferableResourceArray;
+ struct TransferableResourceList {
+ TransferableResourceArray resources;
+ unsigned syncPoint;
+ };
static PassOwnPtr<CCResourceProvider> create(CCGraphicsContext*);
@@ -80,7 +98,7 @@ public:
void deleteOwnedResources(int pool);
// Upload data from image, copying sourceRect (in image) into destRect (in the resource).
- void upload(ResourceId, const uint8_t* image, const IntRect& imageRect, const IntRect& sourceRect, const IntRect& destRect);
+ void upload(ResourceId, const uint8_t* image, const IntRect& imageRect, const IntRect& sourceRect, const IntSize& destOffset);
// Flush all context operations, kicking uploads and ensuring ordering with
// respect to other contexts.
@@ -90,20 +108,86 @@ public:
// Returns true if the shallow flush occurred, false otherwise.
bool shallowFlushIfSupported();
+ // Creates accounting for a child, and associate it with a pool. Resources
+ // transfered from that child will go to that pool. Returns a child ID.
+ int createChild(int pool);
+
+ // Destroys accounting for the child, deleting all resources from that pool.
+ void destroyChild(int child);
+
+ // Gets the child->parent resource ID map.
+ const ResourceIdMap& getChildToParentMap(int child) const;
+
+ // Prepares resources to be transfered to the parent, moving them to
+ // mailboxes and serializing meta-data into TransferableResources.
+ // Resources are not removed from the CCResourceProvider, but are markes as
+ // "in use".
+ TransferableResourceList prepareSendToParent(const ResourceIdArray&);
+
+ // Prepares resources to be transfered back to the child, moving them to
+ // mailboxes and serializing meta-data into TransferableResources.
+ // Resources are removed from the CCResourceProvider. Note: the resource IDs
+ // passed are in the parent namespace and will be translated to the child
+ // namespace when returned.
+ TransferableResourceList prepareSendToChild(int child, const ResourceIdArray&);
+
+ // Receives resources from a child, moving them from mailboxes. Resource IDs
+ // passed are in the child namespace, and will be translated to the parent
+ // namespace, added to the child->parent map.
+ // NOTE: if the syncPoint filed in TransferableResourceList is set, this
+ // will wait on it.
+ void receiveFromChild(int child, const TransferableResourceList&);
+
+ // Receives resources from the parent, moving them from mailboxes. Resource IDs
+ // passed are in the child namespace.
+ // NOTE: if the syncPoint filed in TransferableResourceList is set, this
+ // will wait on it.
+ void receiveFromParent(const TransferableResourceList&);
+
+ // Only for testing
+ size_t mailboxCount() const { return m_mailboxes.size(); }
+
private:
friend class CCScopedLockResourceForRead;
friend class CCScopedLockResourceForWrite;
struct Resource {
+ Resource()
+ : glId(0)
+ , pool(0)
+ , lockForReadCount(0)
+ , lockedForWrite(false)
+ , external(false)
+ , exported(false)
+ , size()
+ , format(0)
+ { }
+ Resource(unsigned textureId, int pool, const IntSize& size, GC3Denum format)
+ : glId(textureId)
+ , pool(pool)
+ , lockForReadCount(0)
+ , lockedForWrite(false)
+ , external(false)
+ , exported(false)
+ , size(size)
+ , format(format)
+ { }
unsigned glId;
int pool;
int lockForReadCount;
bool lockedForWrite;
bool external;
+ bool exported;
IntSize size;
GC3Denum format;
};
typedef HashMap<ResourceId, Resource> ResourceMap;
+ struct Child {
+ int pool;
+ ResourceIdMap childToParentMap;
+ ResourceIdMap parentToChildMap;
+ };
+ typedef HashMap<int, Child> ChildMap;
explicit CCResourceProvider(CCGraphicsContext*);
bool initialize();
@@ -116,9 +200,16 @@ private:
unsigned lockForRead(ResourceId);
void unlockForRead(ResourceId);
+ bool transferResource(WebKit::WebGraphicsContext3D*, ResourceId, TransferableResource*);
+ void trimMailboxDeque();
+
CCGraphicsContext* m_context;
ResourceId m_nextId;
ResourceMap m_resources;
+ int m_nextChild;
+ ChildMap m_children;
+
+ Deque<Mailbox> m_mailboxes;
bool m_useTextureStorageExt;
bool m_useTextureUsageHint;
@@ -133,7 +224,10 @@ public:
CCScopedLockResourceForRead(CCResourceProvider* resourceProvider, CCResourceProvider::ResourceId resourceId)
: m_resourceProvider(resourceProvider)
, m_resourceId(resourceId)
- , m_textureId(resourceProvider->lockForRead(resourceId)) { }
+ , m_textureId(resourceProvider->lockForRead(resourceId))
+ {
+ ASSERT(m_textureId);
+ }
~CCScopedLockResourceForRead()
{
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCScheduler.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCScheduler.cpp
index 2c1b5053c..fa3dbe1ed 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCScheduler.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCScheduler.cpp
@@ -24,7 +24,8 @@
#include "config.h"
-#include "cc/CCScheduler.h"
+#include "CCScheduler.h"
+
#include "TraceEvent.h"
namespace WebCore {
@@ -173,16 +174,11 @@ void CCScheduler::processScheduledActions()
m_client->scheduledActionBeginFrame();
break;
case CCSchedulerStateMachine::ACTION_BEGIN_UPDATE_MORE_RESOURCES:
- m_client->scheduledActionUpdateMoreResources();
- if (!m_client->hasMoreResourceUpdates()) {
- // If we were just told to update resources, but there are no
- // more pending, then tell the state machine that the
- // beginUpdateMoreResources completed. If more are pending,
- // then we will ack the update at the next draw.
- m_updateMoreResourcesPending = false;
- m_stateMachine.beginUpdateMoreResourcesComplete(false);
- } else
+ if (m_client->hasMoreResourceUpdates()) {
+ m_client->scheduledActionUpdateMoreResources(m_frameRateController->nextTickTime());
m_updateMoreResourcesPending = true;
+ } else
+ m_stateMachine.beginUpdateMoreResourcesComplete(false);
break;
case CCSchedulerStateMachine::ACTION_COMMIT:
m_client->scheduledActionCommit();
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCScheduler.h b/Source/WebCore/platform/graphics/chromium/cc/CCScheduler.h
index a7d8b0330..63664bb59 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCScheduler.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCScheduler.h
@@ -25,8 +25,8 @@
#ifndef CCScheduler_h
#define CCScheduler_h
-#include "cc/CCFrameRateController.h"
-#include "cc/CCSchedulerStateMachine.h"
+#include "CCFrameRateController.h"
+#include "CCSchedulerStateMachine.h"
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
@@ -58,7 +58,7 @@ public:
virtual void scheduledActionBeginFrame() = 0;
virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapIfPossible() = 0;
virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced() = 0;
- virtual void scheduledActionUpdateMoreResources() = 0;
+ virtual void scheduledActionUpdateMoreResources(double monotonicTimeLimit) = 0;
virtual void scheduledActionCommit() = 0;
virtual void scheduledActionBeginContextRecreation() = 0;
virtual void scheduledActionAcquireLayerTexturesForMainThread() = 0;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCSchedulerStateMachine.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCSchedulerStateMachine.cpp
index c729d504b..ffcd5e90c 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCSchedulerStateMachine.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCSchedulerStateMachine.cpp
@@ -24,9 +24,7 @@
#include "config.h"
-#include "cc/CCSchedulerStateMachine.h"
-
-#include <stdio.h>
+#include "CCSchedulerStateMachine.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCScopedTexture.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCScopedTexture.cpp
index 21ef99a65..774c2a488 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCScopedTexture.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCScopedTexture.cpp
@@ -24,7 +24,8 @@
*/
#include "config.h"
-#include "cc/CCScopedTexture.h"
+
+#include "CCScopedTexture.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCScopedTexture.h b/Source/WebCore/platform/graphics/chromium/cc/CCScopedTexture.h
index 734420e90..2716d166e 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCScopedTexture.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCScopedTexture.h
@@ -26,7 +26,7 @@
#ifndef CCScopedTexture_h
#define CCScopedTexture_h
-#include "cc/CCTexture.h"
+#include "CCTexture.h"
#if !ASSERT_DISABLED
#include <wtf/MainThread.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCScopedThreadProxy.h b/Source/WebCore/platform/graphics/chromium/cc/CCScopedThreadProxy.h
index bd724a3ec..0e4530e1d 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCScopedThreadProxy.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCScopedThreadProxy.h
@@ -25,7 +25,7 @@
#ifndef CCScopedThreadProxy_h
#define CCScopedThreadProxy_h
-#include "cc/CCThreadTask.h"
+#include "CCThreadTask.h"
#include <wtf/ThreadSafeRefCounted.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarAnimationController.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarAnimationController.cpp
index 3c0aac16e..bb15f6cc2 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarAnimationController.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarAnimationController.cpp
@@ -24,13 +24,13 @@
#include "config.h"
-#include "cc/CCScrollbarAnimationController.h"
+#include "CCScrollbarAnimationController.h"
-#include "cc/CCScrollbarLayerImpl.h"
+#include "CCScrollbarLayerImpl.h"
#include <wtf/CurrentTime.h>
#if OS(ANDROID)
-#include "cc/CCScrollbarAnimationControllerLinearFade.h"
+#include "CCScrollbarAnimationControllerLinearFade.h"
#endif
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarAnimationControllerLinearFade.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarAnimationControllerLinearFade.cpp
index 820f2291f..ea97b1372 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarAnimationControllerLinearFade.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarAnimationControllerLinearFade.cpp
@@ -24,9 +24,9 @@
#include "config.h"
-#include "cc/CCScrollbarAnimationControllerLinearFade.h"
+#include "CCScrollbarAnimationControllerLinearFade.h"
-#include "cc/CCScrollbarLayerImpl.h"
+#include "CCScrollbarLayerImpl.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarAnimationControllerLinearFade.h b/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarAnimationControllerLinearFade.h
index eb9d81e86..cd9e0f3c9 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarAnimationControllerLinearFade.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarAnimationControllerLinearFade.h
@@ -25,7 +25,7 @@
#ifndef CCScrollbarAnimationControllerLinearFade_h
#define CCScrollbarAnimationControllerLinearFade_h
-#include "cc/CCScrollbarAnimationController.h"
+#include "CCScrollbarAnimationController.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp
index ec0589525..e29931884 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp
@@ -29,9 +29,9 @@
#include "CCScrollbarLayerImpl.h"
-#include "cc/CCQuadSink.h"
-#include "cc/CCScrollbarAnimationController.h"
-#include "cc/CCTextureDrawQuad.h"
+#include "CCQuadSink.h"
+#include "CCScrollbarAnimationController.h"
+#include "CCTextureDrawQuad.h"
using WebKit::WebRect;
using WebKit::WebScrollbar;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.h b/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.h
index 5b8dac297..ca40d099f 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.h
@@ -28,7 +28,7 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "cc/CCLayerImpl.h"
+#include "CCLayerImpl.h"
#include <public/WebRect.h>
#include <public/WebScrollbar.h>
#include <public/WebScrollbarThemeGeometry.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCSettings.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCSettings.cpp
index e6ef5517a..1bcab7460 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCSettings.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCSettings.cpp
@@ -24,7 +24,7 @@
#include "config.h"
-#include "cc/CCSettings.h"
+#include "CCSettings.h"
namespace {
static bool s_perTilePaintingEnabled = false;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCSharedQuadState.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCSharedQuadState.cpp
index e64f72f23..337987497 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCSharedQuadState.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCSharedQuadState.cpp
@@ -25,7 +25,7 @@
#include "config.h"
-#include "cc/CCSharedQuadState.h"
+#include "CCSharedQuadState.h"
#include "FloatQuad.h"
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
index 9fe505f32..88a8ffb82 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
@@ -24,14 +24,14 @@
#include "config.h"
-#include "cc/CCSingleThreadProxy.h"
+#include "CCSingleThreadProxy.h"
+#include "CCDrawQuad.h"
+#include "CCGraphicsContext.h"
+#include "CCLayerTreeHost.h"
+#include "CCTextureUpdateController.h"
+#include "CCTimer.h"
#include "TraceEvent.h"
-#include "cc/CCDrawQuad.h"
-#include "cc/CCGraphicsContext.h"
-#include "cc/CCLayerTreeHost.h"
-#include "cc/CCTextureUpdateController.h"
-#include "cc/CCTimer.h"
#include <wtf/CurrentTime.h>
using namespace WTF;
@@ -260,7 +260,7 @@ void CCSingleThreadProxy::stop()
DebugScopedSetMainThreadBlocked mainThreadBlocked;
DebugScopedSetImplThread impl;
- if (!m_layerTreeHostImpl->contentsTexturesWerePurgedSinceLastCommit())
+ if (!m_layerTreeHostImpl->contentsTexturesPurged())
m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->resourceProvider());
m_layerTreeHostImpl.clear();
}
@@ -300,11 +300,12 @@ bool CCSingleThreadProxy::commitAndComposite()
if (!m_layerTreeHost->initializeLayerRendererIfNeeded())
return false;
- if (m_layerTreeHostImpl->contentsTexturesWerePurgedSinceLastCommit())
+ if (m_layerTreeHostImpl->contentsTexturesPurged())
m_layerTreeHost->evictAllContentTextures();
CCTextureUpdateQueue queue;
m_layerTreeHost->updateLayers(queue, m_layerTreeHostImpl->memoryAllocationLimitBytes());
+ m_layerTreeHostImpl->resetContentsTexturesPurged();
m_layerTreeHost->willCommit();
doCommit(queue);
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h b/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h
index 319d33597..7f8047859 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h
@@ -25,9 +25,9 @@
#ifndef CCSingleThreadProxy_h
#define CCSingleThreadProxy_h
-#include "cc/CCAnimationEvents.h"
-#include "cc/CCLayerTreeHostImpl.h"
-#include "cc/CCProxy.h"
+#include "CCAnimationEvents.h"
+#include "CCLayerTreeHostImpl.h"
+#include "CCProxy.h"
#include <limits>
#include <wtf/OwnPtr.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCSolidColorDrawQuad.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCSolidColorDrawQuad.cpp
index 3b62b32bc..7d525083f 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCSolidColorDrawQuad.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCSolidColorDrawQuad.cpp
@@ -25,7 +25,7 @@
#include "config.h"
-#include "cc/CCSolidColorDrawQuad.h"
+#include "CCSolidColorDrawQuad.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCSolidColorDrawQuad.h b/Source/WebCore/platform/graphics/chromium/cc/CCSolidColorDrawQuad.h
index 59bc8fea1..2d9c6e590 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCSolidColorDrawQuad.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCSolidColorDrawQuad.h
@@ -26,9 +26,8 @@
#ifndef CCSolidColorDrawQuad_h
#define CCSolidColorDrawQuad_h
+#include "CCDrawQuad.h"
#include "SkColor.h"
-#include "cc/CCDrawQuad.h"
-
#include <wtf/PassOwnPtr.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCSolidColorLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCSolidColorLayerImpl.cpp
index f52c797c0..23984f9d4 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCSolidColorLayerImpl.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCSolidColorLayerImpl.cpp
@@ -27,10 +27,10 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "cc/CCSolidColorLayerImpl.h"
+#include "CCSolidColorLayerImpl.h"
-#include "cc/CCQuadSink.h"
-#include "cc/CCSolidColorDrawQuad.h"
+#include "CCQuadSink.h"
+#include "CCSolidColorDrawQuad.h"
#include <wtf/MathExtras.h>
#include <wtf/text/WTFString.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCSolidColorLayerImpl.h b/Source/WebCore/platform/graphics/chromium/cc/CCSolidColorLayerImpl.h
index 7153f21ab..d19a230dc 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCSolidColorLayerImpl.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCSolidColorLayerImpl.h
@@ -26,7 +26,7 @@
#ifndef CCSolidColorLayerImpl_h
#define CCSolidColorLayerImpl_h
-#include "cc/CCLayerImpl.h"
+#include "CCLayerImpl.h"
#include <public/WebTransformationMatrix.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCStreamVideoDrawQuad.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCStreamVideoDrawQuad.cpp
index 6dd3ff2f1..87e372ff5 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCStreamVideoDrawQuad.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCStreamVideoDrawQuad.cpp
@@ -25,7 +25,7 @@
#include "config.h"
-#include "cc/CCStreamVideoDrawQuad.h"
+#include "CCStreamVideoDrawQuad.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCStreamVideoDrawQuad.h b/Source/WebCore/platform/graphics/chromium/cc/CCStreamVideoDrawQuad.h
index c935db7af..477995b40 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCStreamVideoDrawQuad.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCStreamVideoDrawQuad.h
@@ -26,7 +26,7 @@
#ifndef CCStreamVideoDrawQuad_h
#define CCStreamVideoDrawQuad_h
-#include "cc/CCDrawQuad.h"
+#include "CCDrawQuad.h"
#include <public/WebTransformationMatrix.h>
#include <wtf/PassOwnPtr.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTexture.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCTexture.cpp
index a48e2d0f9..de80c9994 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTexture.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTexture.cpp
@@ -25,7 +25,7 @@
#include "config.h"
-#include "cc/CCTexture.h"
+#include "CCTexture.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTexture.h b/Source/WebCore/platform/graphics/chromium/cc/CCTexture.h
index d3e4b8f7e..f7ba07f32 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTexture.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTexture.h
@@ -26,10 +26,10 @@
#ifndef CCTexture_h
#define CCTexture_h
+#include "CCResourceProvider.h"
+#include "CCTexture.h"
#include "GraphicsContext3D.h"
#include "IntSize.h"
-#include "cc/CCResourceProvider.h"
-#include "cc/CCTexture.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTextureDrawQuad.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCTextureDrawQuad.cpp
index ed0b99d80..807fccf1c 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTextureDrawQuad.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTextureDrawQuad.cpp
@@ -25,7 +25,7 @@
#include "config.h"
-#include "cc/CCTextureDrawQuad.h"
+#include "CCTextureDrawQuad.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTextureDrawQuad.h b/Source/WebCore/platform/graphics/chromium/cc/CCTextureDrawQuad.h
index 20d5c9d12..01418930c 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTextureDrawQuad.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTextureDrawQuad.h
@@ -26,8 +26,8 @@
#ifndef CCTextureDrawQuad_h
#define CCTextureDrawQuad_h
+#include "CCDrawQuad.h"
#include "FloatRect.h"
-#include "cc/CCDrawQuad.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTextureLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCTextureLayerImpl.cpp
index 7cbbece16..b981f713d 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTextureLayerImpl.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTextureLayerImpl.cpp
@@ -27,12 +27,12 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "cc/CCTextureLayerImpl.h"
+#include "CCTextureLayerImpl.h"
+#include "CCQuadSink.h"
+#include "CCRenderer.h"
+#include "CCTextureDrawQuad.h"
#include "TextStream.h"
-#include "cc/CCQuadSink.h"
-#include "cc/CCRenderer.h"
-#include "cc/CCTextureDrawQuad.h"
namespace WebCore {
@@ -52,20 +52,24 @@ CCTextureLayerImpl::~CCTextureLayerImpl()
void CCTextureLayerImpl::willDraw(CCResourceProvider* resourceProvider)
{
+ if (!m_textureId)
+ return;
ASSERT(!m_externalTextureResource);
m_externalTextureResource = resourceProvider->createResourceFromExternalTexture(m_textureId);
}
void CCTextureLayerImpl::appendQuads(CCQuadSink& quadList, const CCSharedQuadState* sharedQuadState, bool&)
{
- ASSERT(m_externalTextureResource);
+ if (!m_externalTextureResource)
+ return;
IntRect quadRect(IntPoint(), contentBounds());
quadList.append(CCTextureDrawQuad::create(sharedQuadState, quadRect, m_externalTextureResource, m_premultipliedAlpha, m_uvRect, m_flipped));
}
void CCTextureLayerImpl::didDraw(CCResourceProvider* resourceProvider)
{
- ASSERT(m_externalTextureResource);
+ if (!m_externalTextureResource)
+ return;
// FIXME: the following assert will not be true when sending resources to a
// parent compositor. A synchronization scheme (double-buffering or
// pipelining of updates) for the client will need to exist to solve this.
@@ -84,6 +88,7 @@ void CCTextureLayerImpl::dumpLayerProperties(TextStream& ts, int indent) const
void CCTextureLayerImpl::didLoseContext()
{
m_textureId = 0;
+ m_externalTextureResource = 0;
}
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTextureLayerImpl.h b/Source/WebCore/platform/graphics/chromium/cc/CCTextureLayerImpl.h
index e5453148d..153eb918e 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTextureLayerImpl.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTextureLayerImpl.h
@@ -26,7 +26,7 @@
#ifndef CCTextureLayerImpl_h
#define CCTextureLayerImpl_h
-#include "cc/CCLayerImpl.h"
+#include "CCLayerImpl.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateController.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateController.cpp
index dde894950..6fc771e95 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateController.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateController.cpp
@@ -25,7 +25,7 @@
#include "config.h"
-#include "cc/CCTextureUpdateController.h"
+#include "CCTextureUpdateController.h"
#include "GraphicsContext3D.h"
#include "TextureCopier.h"
@@ -34,8 +34,11 @@
namespace {
-// Number of textures to update with each call to updateMoreTextures().
-static const size_t textureUpdatesPerFrame = 48;
+// Number of textures to update with each call to updateMoreTexturesIfEnoughTimeRemaining().
+static const size_t textureUpdatesPerTick = 12;
+
+// Measured in seconds.
+static const double textureUpdateTickRate = 0.004;
// Flush interval when performing texture uploads.
static const int textureUploadFlushPeriod = 4;
@@ -46,7 +49,7 @@ namespace WebCore {
size_t CCTextureUpdateController::maxPartialTextureUpdates()
{
- return textureUpdatesPerFrame;
+ return textureUpdatesPerTick;
}
void CCTextureUpdateController::updateTextures(CCResourceProvider* resourceProvider, TextureCopier* copier, TextureUploader* uploader, CCTextureUpdateQueue* queue, size_t count)
@@ -110,11 +113,14 @@ void CCTextureUpdateController::updateTextures(CCResourceProvider* resourceProvi
copier->flush();
}
-CCTextureUpdateController::CCTextureUpdateController(PassOwnPtr<CCTextureUpdateQueue> queue, CCResourceProvider* resourceProvider, TextureCopier* copier, TextureUploader* uploader)
- : m_queue(queue)
+CCTextureUpdateController::CCTextureUpdateController(CCThread* thread, PassOwnPtr<CCTextureUpdateQueue> queue, CCResourceProvider* resourceProvider, TextureCopier* copier, TextureUploader* uploader)
+ : m_timer(adoptPtr(new CCTimer(thread, this)))
+ , m_queue(queue)
, m_resourceProvider(resourceProvider)
, m_copier(copier)
, m_uploader(uploader)
+ , m_monotonicTimeLimit(0)
+ , m_firstUpdateAttempt(true)
{
}
@@ -127,17 +133,57 @@ bool CCTextureUpdateController::hasMoreUpdates() const
return m_queue->hasMoreUpdates();
}
-void CCTextureUpdateController::updateMoreTextures()
+void CCTextureUpdateController::updateMoreTextures(double monotonicTimeLimit)
{
+ m_monotonicTimeLimit = monotonicTimeLimit;
+
if (!m_queue->hasMoreUpdates())
return;
- updateTextures(m_resourceProvider, m_copier, m_uploader, m_queue.get(), updateMoreTexturesSize());
+ // Call updateMoreTexturesNow() directly unless it's the first update
+ // attempt. This ensures that we empty the update queue in a finite
+ // amount of time.
+ if (m_firstUpdateAttempt) {
+ updateMoreTexturesIfEnoughTimeRemaining();
+ m_firstUpdateAttempt = false;
+ } else
+ updateMoreTexturesNow();
+}
+
+void CCTextureUpdateController::onTimerFired()
+{
+ if (!m_queue->hasMoreUpdates())
+ return;
+
+ updateMoreTexturesIfEnoughTimeRemaining();
+}
+
+double CCTextureUpdateController::monotonicTimeNow() const
+{
+ return monotonicallyIncreasingTime();
+}
+
+double CCTextureUpdateController::updateMoreTexturesTime() const
+{
+ return textureUpdateTickRate;
}
size_t CCTextureUpdateController::updateMoreTexturesSize() const
{
- return textureUpdatesPerFrame;
+ return textureUpdatesPerTick;
+}
+
+void CCTextureUpdateController::updateMoreTexturesIfEnoughTimeRemaining()
+{
+ bool hasTimeRemaining = monotonicTimeNow() < m_monotonicTimeLimit - updateMoreTexturesTime();
+ if (hasTimeRemaining)
+ updateMoreTexturesNow();
+}
+
+void CCTextureUpdateController::updateMoreTexturesNow()
+{
+ m_timer->startOneShot(updateMoreTexturesTime());
+ updateTextures(m_resourceProvider, m_copier, m_uploader, m_queue.get(), updateMoreTexturesSize());
}
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateController.h b/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateController.h
index bd2c7bc82..dd758beb4 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateController.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateController.h
@@ -26,7 +26,8 @@
#ifndef CCTextureUpdateController_h
#define CCTextureUpdateController_h
-#include "cc/CCTextureUpdateQueue.h"
+#include "CCTextureUpdateQueue.h"
+#include "CCTimer.h"
#include <wtf/Noncopyable.h>
#include <wtf/OwnPtr.h>
@@ -35,12 +36,12 @@ namespace WebCore {
class TextureCopier;
class TextureUploader;
-class CCTextureUpdateController {
+class CCTextureUpdateController : public CCTimerClient {
WTF_MAKE_NONCOPYABLE(CCTextureUpdateController);
public:
- static PassOwnPtr<CCTextureUpdateController> create(PassOwnPtr<CCTextureUpdateQueue> queue, CCResourceProvider* resourceProvider, TextureCopier* copier, TextureUploader* uploader)
+ static PassOwnPtr<CCTextureUpdateController> create(CCThread* thread, PassOwnPtr<CCTextureUpdateQueue> queue, CCResourceProvider* resourceProvider, TextureCopier* copier, TextureUploader* uploader)
{
- return adoptPtr(new CCTextureUpdateController(queue, resourceProvider, copier, uploader));
+ return adoptPtr(new CCTextureUpdateController(thread, queue, resourceProvider, copier, uploader));
}
static size_t maxPartialTextureUpdates();
static void updateTextures(CCResourceProvider*, TextureCopier*, TextureUploader*, CCTextureUpdateQueue*, size_t count);
@@ -48,18 +49,30 @@ public:
virtual ~CCTextureUpdateController();
bool hasMoreUpdates() const;
- void updateMoreTextures();
+ void updateMoreTextures(double monotonicTimeLimit);
+
+ // CCTimerClient implementation.
+ virtual void onTimerFired() OVERRIDE;
// Virtual for testing.
+ virtual double monotonicTimeNow() const;
+ virtual double updateMoreTexturesTime() const;
virtual size_t updateMoreTexturesSize() const;
protected:
- CCTextureUpdateController(PassOwnPtr<CCTextureUpdateQueue>, CCResourceProvider*, TextureCopier*, TextureUploader*);
+ CCTextureUpdateController(CCThread*, PassOwnPtr<CCTextureUpdateQueue>, CCResourceProvider*, TextureCopier*, TextureUploader*);
+
+ void updateMoreTexturesIfEnoughTimeRemaining();
+ void updateMoreTexturesNow();
+ OwnPtr<CCTimer> m_timer;
OwnPtr<CCTextureUpdateQueue> m_queue;
+ bool m_contentsTexturesPurged;
CCResourceProvider* m_resourceProvider;
TextureCopier* m_copier;
TextureUploader* m_uploader;
+ double m_monotonicTimeLimit;
+ bool m_firstUpdateAttempt;
};
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateQueue.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateQueue.cpp
index ae9ab9788..8f58fcbcb 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateQueue.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateQueue.cpp
@@ -27,7 +27,7 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "cc/CCTextureUpdateQueue.h"
+#include "CCTextureUpdateQueue.h"
namespace WebCore {
@@ -54,6 +54,12 @@ void CCTextureUpdateQueue::appendCopy(TextureCopier::Parameters copy)
m_copyEntries.append(copy);
}
+void CCTextureUpdateQueue::clearUploads()
+{
+ m_fullEntries.clear();
+ m_partialEntries.clear();
+}
+
TextureUploader::Parameters CCTextureUpdateQueue::takeFirstFullUpload()
{
return m_fullEntries.takeFirst();
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateQueue.h b/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateQueue.h
index 7bb5cbc1d..de6373821 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateQueue.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateQueue.h
@@ -43,6 +43,8 @@ public:
void appendPartialUpload(TextureUploader::Parameters);
void appendCopy(TextureCopier::Parameters);
+ void clearUploads();
+
TextureUploader::Parameters takeFirstFullUpload();
TextureUploader::Parameters takeFirstPartialUpload();
TextureCopier::Parameters takeFirstCopy();
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
index d37168f11..297b13563 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
@@ -24,19 +24,19 @@
#include "config.h"
-#include "cc/CCThreadProxy.h"
-
+#include "CCThreadProxy.h"
+
+#include "CCDelayBasedTimeSource.h"
+#include "CCDrawQuad.h"
+#include "CCFrameRateController.h"
+#include "CCGraphicsContext.h"
+#include "CCInputHandler.h"
+#include "CCLayerTreeHost.h"
+#include "CCScheduler.h"
+#include "CCScopedThreadProxy.h"
+#include "CCTextureUpdateController.h"
+#include "CCThreadTask.h"
#include "TraceEvent.h"
-#include "cc/CCDelayBasedTimeSource.h"
-#include "cc/CCDrawQuad.h"
-#include "cc/CCFrameRateController.h"
-#include "cc/CCGraphicsContext.h"
-#include "cc/CCInputHandler.h"
-#include "cc/CCLayerTreeHost.h"
-#include "cc/CCScheduler.h"
-#include "cc/CCScopedThreadProxy.h"
-#include "cc/CCTextureUpdateController.h"
-#include "cc/CCThreadTask.h"
#include <public/WebSharedGraphicsContext3D.h>
#include <wtf/CurrentTime.h>
#include <wtf/MainThread.h>
@@ -80,6 +80,7 @@ CCThreadProxy::CCThreadProxy(CCLayerTreeHost* layerTreeHost)
, m_readbackRequestOnImplThread(0)
, m_commitCompletionEventOnImplThread(0)
, m_textureAcquisitionCompletionEventOnImplThread(0)
+ , m_resetContentsTexturesPurgedAfterCommitOnImplThread(false)
, m_nextFrameIsNewlyCommittedFrameOnImplThread(false)
, m_renderVSyncEnabled(layerTreeHost->settings().renderVSyncEnabled)
{
@@ -328,7 +329,7 @@ void CCThreadProxy::onVSyncParametersChanged(double monotonicTimebase, double in
{
ASSERT(isImplThread());
TRACE_EVENT0("cc", "CCThreadProxy::onVSyncParametersChanged");
- // FIXME: route this into the scheduler once the scheduler supports vsync.
+ m_schedulerOnImplThread->setTimebaseAndInterval(monotonicTimebase, intervalInSeconds);
}
void CCThreadProxy::setNeedsCommitOnImplThread()
@@ -452,7 +453,7 @@ void CCThreadProxy::scheduledActionBeginFrame()
m_pendingBeginFrameRequest = adoptPtr(new BeginFrameAndCommitState());
m_pendingBeginFrameRequest->monotonicFrameBeginTime = monotonicallyIncreasingTime();
m_pendingBeginFrameRequest->scrollInfo = m_layerTreeHostImpl->processScrollDeltas();
- m_pendingBeginFrameRequest->contentsTexturesWereDeleted = m_layerTreeHostImpl->contentsTexturesWerePurgedSinceLastCommit();
+ m_pendingBeginFrameRequest->contentsTexturesWereDeleted = m_layerTreeHostImpl->contentsTexturesPurged();
m_pendingBeginFrameRequest->memoryAllocationLimitBytes = m_layerTreeHostImpl->memoryAllocationLimitBytes();
m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadProxy::beginFrame));
@@ -545,7 +546,7 @@ void CCThreadProxy::beginFrame()
DebugScopedSetMainThreadBlocked mainThreadBlocked;
CCCompletionEvent completion;
- CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::beginFrameCompleteOnImplThread, &completion, queue.release()));
+ CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::beginFrameCompleteOnImplThread, &completion, queue.release(), request->contentsTexturesWereDeleted));
completion.wait();
}
@@ -553,7 +554,7 @@ void CCThreadProxy::beginFrame()
m_layerTreeHost->didBeginFrame();
}
-void CCThreadProxy::beginFrameCompleteOnImplThread(CCCompletionEvent* completion, PassOwnPtr<CCTextureUpdateQueue> queue)
+void CCThreadProxy::beginFrameCompleteOnImplThread(CCCompletionEvent* completion, PassOwnPtr<CCTextureUpdateQueue> queue, bool contentsTexturesWereDeleted)
{
TRACE_EVENT0("cc", "CCThreadProxy::beginFrameCompleteOnImplThread");
ASSERT(!m_commitCompletionEventOnImplThread);
@@ -566,7 +567,17 @@ void CCThreadProxy::beginFrameCompleteOnImplThread(CCCompletionEvent* completion
return;
}
- m_currentTextureUpdateControllerOnImplThread = CCTextureUpdateController::create(queue, m_layerTreeHostImpl->resourceProvider(), m_layerTreeHostImpl->layerRenderer()->textureCopier(), m_layerTreeHostImpl->layerRenderer()->textureUploader());
+ if (!contentsTexturesWereDeleted && m_layerTreeHostImpl->contentsTexturesPurged()) {
+ // We purged the content textures on the impl thread between the time we
+ // posted the beginFrame task and now, meaning we have a bunch of
+ // uploads that are now invalid. Clear the uploads (they all go to
+ // content textures), and kick another commit to fill them again.
+ queue->clearUploads();
+ setNeedsCommitOnImplThread();
+ } else
+ m_resetContentsTexturesPurgedAfterCommitOnImplThread = true;
+
+ m_currentTextureUpdateControllerOnImplThread = CCTextureUpdateController::create(CCProxy::implThread(), queue, m_layerTreeHostImpl->resourceProvider(), m_layerTreeHostImpl->layerRenderer()->textureCopier(), m_layerTreeHostImpl->layerRenderer()->textureUploader());
m_commitCompletionEventOnImplThread = completion;
m_schedulerOnImplThread->beginFrameComplete();
@@ -597,11 +608,11 @@ bool CCThreadProxy::canDraw()
return m_layerTreeHostImpl->canDraw();
}
-void CCThreadProxy::scheduledActionUpdateMoreResources()
+void CCThreadProxy::scheduledActionUpdateMoreResources(double monotonicTimeLimit)
{
TRACE_EVENT0("cc", "CCThreadProxy::scheduledActionUpdateMoreResources");
ASSERT(m_currentTextureUpdateControllerOnImplThread);
- m_currentTextureUpdateControllerOnImplThread->updateMoreTextures();
+ m_currentTextureUpdateControllerOnImplThread->updateMoreTextures(monotonicTimeLimit);
}
void CCThreadProxy::scheduledActionCommit()
@@ -619,6 +630,11 @@ void CCThreadProxy::scheduledActionCommit()
m_layerTreeHost->beginCommitOnImplThread(m_layerTreeHostImpl.get());
m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get());
+ if (m_resetContentsTexturesPurgedAfterCommitOnImplThread) {
+ m_resetContentsTexturesPurgedAfterCommitOnImplThread = false;
+ m_layerTreeHostImpl->resetContentsTexturesPurged();
+ }
+
m_layerTreeHostImpl->commitComplete();
m_nextFrameIsNewlyCommittedFrameOnImplThread = true;
@@ -853,7 +869,7 @@ void CCThreadProxy::layerTreeHostClosedOnImplThread(CCCompletionEvent* completio
{
TRACE_EVENT0("cc", "CCThreadProxy::layerTreeHostClosedOnImplThread");
ASSERT(isImplThread());
- if (!m_layerTreeHostImpl->contentsTexturesWerePurgedSinceLastCommit())
+ if (!m_layerTreeHostImpl->contentsTexturesPurged())
m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->resourceProvider());
m_inputHandlerOnImplThread.clear();
m_layerTreeHostImpl.clear();
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h b/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h
index 34360d51a..91a9e4d44 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h
@@ -25,11 +25,11 @@
#ifndef CCThreadProxy_h
#define CCThreadProxy_h
-#include "cc/CCAnimationEvents.h"
-#include "cc/CCCompletionEvent.h"
-#include "cc/CCLayerTreeHostImpl.h"
-#include "cc/CCProxy.h"
-#include "cc/CCScheduler.h"
+#include "CCAnimationEvents.h"
+#include "CCCompletionEvent.h"
+#include "CCLayerTreeHostImpl.h"
+#include "CCProxy.h"
+#include "CCScheduler.h"
#include <wtf/OwnPtr.h>
namespace WebCore {
@@ -88,7 +88,7 @@ public:
virtual void scheduledActionBeginFrame() OVERRIDE;
virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapIfPossible() OVERRIDE;
virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced() OVERRIDE;
- virtual void scheduledActionUpdateMoreResources() OVERRIDE;
+ virtual void scheduledActionUpdateMoreResources(double monotonicTimeLimit) OVERRIDE;
virtual void scheduledActionCommit() OVERRIDE;
virtual void scheduledActionBeginContextRecreation() OVERRIDE;
virtual void scheduledActionAcquireLayerTexturesForMainThread() OVERRIDE;
@@ -127,7 +127,7 @@ private:
IntRect rect;
};
void forceBeginFrameOnImplThread(CCCompletionEvent*);
- void beginFrameCompleteOnImplThread(CCCompletionEvent*, PassOwnPtr<CCTextureUpdateQueue>);
+ void beginFrameCompleteOnImplThread(CCCompletionEvent*, PassOwnPtr<CCTextureUpdateQueue>, bool contentsTexturesWereDeleted);
void beginFrameAbortedOnImplThread();
void requestReadbackOnImplThread(ReadbackRequest*);
void requestStartPageScaleAnimationOnImplThread(IntSize targetPosition, bool useAnchor, float scale, double durationSec);
@@ -185,6 +185,10 @@ private:
OwnPtr<CCTextureUpdateController> m_currentTextureUpdateControllerOnImplThread;
+ // Set when we need to reset the contentsTexturesPurged flag after the
+ // commit.
+ bool m_resetContentsTexturesPurgedAfterCommitOnImplThread;
+
// Set when the next draw should post didCommitAndDrawFrame to the main thread.
bool m_nextFrameIsNewlyCommittedFrameOnImplThread;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCThreadTask.h b/Source/WebCore/platform/graphics/chromium/cc/CCThreadTask.h
index c93159428..bd520d224 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCThreadTask.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCThreadTask.h
@@ -24,7 +24,7 @@
#ifndef CCThreadTask_h
#define CCThreadTask_h
-#include "cc/CCThread.h"
+#include "CCThread.h"
#include <wtf/PassOwnPtr.h>
#include <wtf/PassRefPtr.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTileDrawQuad.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCTileDrawQuad.cpp
index a5d317879..730835c39 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTileDrawQuad.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTileDrawQuad.cpp
@@ -25,7 +25,7 @@
#include "config.h"
-#include "cc/CCTileDrawQuad.h"
+#include "CCTileDrawQuad.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTileDrawQuad.h b/Source/WebCore/platform/graphics/chromium/cc/CCTileDrawQuad.h
index 7943bc9f0..53f2c8816 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTileDrawQuad.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTileDrawQuad.h
@@ -26,10 +26,10 @@
#ifndef CCTileDrawQuad_h
#define CCTileDrawQuad_h
+#include "CCDrawQuad.h"
#include "GraphicsTypes3D.h"
#include "IntPoint.h"
#include "IntSize.h"
-#include "cc/CCDrawQuad.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp
index 74eb2dc23..ad993ca15 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp
@@ -27,18 +27,19 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "cc/CCTiledLayerImpl.h"
-
+#include "CCTiledLayerImpl.h"
+
+#include "CCCheckerboardDrawQuad.h"
+#include "CCDebugBorderDrawQuad.h"
+#include "CCLayerTilingData.h"
+#include "CCMathUtil.h"
+#include "CCQuadSink.h"
+#include "CCSolidColorDrawQuad.h"
+#include "CCTileDrawQuad.h"
+#include "FloatQuad.h"
#include "GraphicsContext3D.h"
#include "SkColor.h"
#include "TextStream.h"
-#include "cc/CCCheckerboardDrawQuad.h"
-#include "cc/CCDebugBorderDrawQuad.h"
-#include "cc/CCLayerTilingData.h"
-#include "cc/CCMathUtil.h"
-#include "cc/CCQuadSink.h"
-#include "cc/CCSolidColorDrawQuad.h"
-#include "cc/CCTileDrawQuad.h"
#include <wtf/text/WTFString.h>
using namespace std;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.h b/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.h
index 015fdc306..6b877b341 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.h
@@ -26,7 +26,7 @@
#ifndef CCTiledLayerImpl_h
#define CCTiledLayerImpl_h
-#include "cc/CCLayerImpl.h"
+#include "CCLayerImpl.h"
#include <public/WebTransformationMatrix.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTimer.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCTimer.cpp
index 396d81a55..a5586adb5 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTimer.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTimer.cpp
@@ -30,9 +30,9 @@
#include "config.h"
-#include "cc/CCTimer.h"
+#include "CCTimer.h"
-#include "cc/CCThread.h"
+#include "CCThread.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTimingFunction.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCTimingFunction.cpp
index decc00c8f..28b5c13df 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTimingFunction.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTimingFunction.cpp
@@ -24,7 +24,7 @@
#include "config.h"
-#include "cc/CCTimingFunction.h"
+#include "CCTimingFunction.h"
#include <wtf/OwnPtr.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTimingFunction.h b/Source/WebCore/platform/graphics/chromium/cc/CCTimingFunction.h
index 272997e7c..6a79363d7 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTimingFunction.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTimingFunction.h
@@ -25,9 +25,8 @@
#ifndef CCTimingFunction_h
#define CCTimingFunction_h
+#include "CCAnimationCurve.h"
#include "UnitBezier.h"
-#include "cc/CCAnimationCurve.h"
-
#include <wtf/PassOwnPtr.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp
index fa201d112..14cb32726 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp
@@ -27,20 +27,20 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "cc/CCVideoLayerImpl.h"
-
+#include "CCVideoLayerImpl.h"
+
+#include "CCIOSurfaceDrawQuad.h"
+#include "CCLayerTreeHostImpl.h"
+#include "CCProxy.h"
+#include "CCQuadSink.h"
+#include "CCResourceProvider.h"
+#include "CCStreamVideoDrawQuad.h"
+#include "CCTextureDrawQuad.h"
+#include "CCYUVVideoDrawQuad.h"
#include "Extensions3DChromium.h"
#include "GraphicsContext3D.h"
#include "NotImplemented.h"
#include "TextStream.h"
-#include "cc/CCIOSurfaceDrawQuad.h"
-#include "cc/CCLayerTreeHostImpl.h"
-#include "cc/CCProxy.h"
-#include "cc/CCQuadSink.h"
-#include "cc/CCResourceProvider.h"
-#include "cc/CCStreamVideoDrawQuad.h"
-#include "cc/CCTextureDrawQuad.h"
-#include "cc/CCYUVVideoDrawQuad.h"
#include <public/WebVideoFrame.h>
#include <wtf/text/WTFString.h>
@@ -215,13 +215,7 @@ void CCVideoLayerImpl::appendQuads(CCQuadSink& quadList, const CCSharedQuadState
// NativeTexture hardware decoder.
bool premultipliedAlpha = true;
FloatRect uvRect(0, 0, 1, 1);
-#if defined(OS_CHROMEOS) && defined(__ARMEL__)
- bool flipped = true; // Under the covers, implemented by OpenMAX IL.
-#elif OS(WINDOWS)
- bool flipped = false; // Under the covers, implemented by DXVA.
-#else
- bool flipped = false; // LibVA (cros/intel), MacOS.
-#endif
+ bool flipped = false;
OwnPtr<CCTextureDrawQuad> textureQuad = CCTextureDrawQuad::create(sharedQuadState, quadRect, m_externalTextureResource, premultipliedAlpha, uvRect, flipped);
quadList.append(textureQuad.release());
break;
@@ -357,7 +351,7 @@ bool CCVideoLayerImpl::copyPlaneData(CCResourceProvider* resourceProvider)
CCVideoLayerImpl::FramePlane& plane = m_framePlanes[softwarePlaneIndex];
const uint8_t* softwarePlanePixels = static_cast<const uint8_t*>(m_frame->data(softwarePlaneIndex));
IntRect planeRect(IntPoint(), plane.size);
- resourceProvider->upload(plane.resourceId, softwarePlanePixels, planeRect, planeRect, planeRect);
+ resourceProvider->upload(plane.resourceId, softwarePlanePixels, planeRect, planeRect, IntSize());
}
return true;
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.h b/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.h
index 414ca68e3..30070c8c1 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.h
@@ -26,9 +26,9 @@
#ifndef CCVideoLayerImpl_h
#define CCVideoLayerImpl_h
+#include "CCLayerImpl.h"
#include "GraphicsContext3D.h"
#include "IntSize.h"
-#include "cc/CCLayerImpl.h"
#include <public/WebTransformationMatrix.h>
#include <public/WebVideoFrameProvider.h>
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCYUVVideoDrawQuad.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCYUVVideoDrawQuad.cpp
index 27a66f374..035d6a1ba 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCYUVVideoDrawQuad.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCYUVVideoDrawQuad.cpp
@@ -25,7 +25,7 @@
#include "config.h"
-#include "cc/CCYUVVideoDrawQuad.h"
+#include "CCYUVVideoDrawQuad.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCYUVVideoDrawQuad.h b/Source/WebCore/platform/graphics/chromium/cc/CCYUVVideoDrawQuad.h
index 456a96f48..b564e9f1e 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCYUVVideoDrawQuad.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCYUVVideoDrawQuad.h
@@ -26,8 +26,8 @@
#ifndef CCYUVVideoDrawQuad_h
#define CCYUVVideoDrawQuad_h
-#include "cc/CCDrawQuad.h"
-#include "cc/CCVideoLayerImpl.h"
+#include "CCDrawQuad.h"
+#include "CCVideoLayerImpl.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp b/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp
index 345507fd3..78e6fb12a 100644
--- a/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp
+++ b/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp
@@ -1081,6 +1081,11 @@ void GraphicsContext3DPrivate::deleteBuffer(Platform3DObject buffer)
void GraphicsContext3DPrivate::deleteFramebuffer(Platform3DObject framebuffer)
{
makeContextCurrent();
+ if (framebuffer == m_boundFBO) {
+ // Make sure the framebuffer is not going to be used for drawing
+ // operations after it gets deleted.
+ bindFramebuffer(FRAMEBUFFER, 0);
+ }
m_api->glDeleteFramebuffers(1, &framebuffer);
}
diff --git a/Source/WebCore/platform/graphics/filters/FECustomFilter.cpp b/Source/WebCore/platform/graphics/filters/FECustomFilter.cpp
index 39fa83163..a2ece0524 100644
--- a/Source/WebCore/platform/graphics/filters/FECustomFilter.cpp
+++ b/Source/WebCore/platform/graphics/filters/FECustomFilter.cpp
@@ -108,6 +108,9 @@ void FECustomFilter::deleteRenderBuffers()
return;
m_context->makeContextCurrent();
if (m_frameBuffer) {
+ // Make sure to unbind any framebuffer from the context first, otherwise
+ // some platforms might refuse to bind the same buffer id again.
+ m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0);
m_context->deleteFramebuffer(m_frameBuffer);
m_frameBuffer = 0;
}
diff --git a/Source/WebCore/platform/graphics/filters/FilterEffect.cpp b/Source/WebCore/platform/graphics/filters/FilterEffect.cpp
index 9701e5340..a2bb54d31 100644
--- a/Source/WebCore/platform/graphics/filters/FilterEffect.cpp
+++ b/Source/WebCore/platform/graphics/filters/FilterEffect.cpp
@@ -43,6 +43,8 @@ FilterEffect::FilterEffect(Filter* filter)
, m_hasWidth(false)
, m_hasHeight(false)
, m_clipsToBounds(true)
+ , m_colorSpace(ColorSpaceLinearRGB)
+ , m_resultColorSpace(ColorSpaceDeviceRGB)
{
ASSERT(m_filter);
}
@@ -104,8 +106,13 @@ void FilterEffect::apply()
in->apply();
if (!in->hasResult())
return;
+
+ // Convert input results to the current effect's color space.
+ in->transformResultColorSpace(m_colorSpace);
}
+
determineAbsolutePaintRect();
+ m_resultColorSpace = m_colorSpace;
if (!isFilterSizeValid(m_absolutePaintRect))
return;
@@ -188,7 +195,7 @@ ImageBuffer* FilterEffect::asImageBuffer()
return 0;
if (m_imageBufferResult)
return m_imageBufferResult.get();
- m_imageBufferResult = ImageBuffer::create(m_absolutePaintRect.size(), 1, ColorSpaceLinearRGB, m_filter->renderingMode());
+ m_imageBufferResult = ImageBuffer::create(m_absolutePaintRect.size(), 1, m_resultColorSpace, m_filter->renderingMode());
IntRect destinationRect(IntPoint(), m_absolutePaintRect.size());
if (m_premultipliedImageResult)
m_imageBufferResult->putByteArray(Premultiplied, m_premultipliedImageResult.get(), destinationRect.size(), destinationRect, IntPoint());
@@ -325,7 +332,7 @@ ImageBuffer* FilterEffect::createImageBufferResult()
ASSERT(!hasResult());
if (m_absolutePaintRect.isEmpty())
return 0;
- m_imageBufferResult = ImageBuffer::create(m_absolutePaintRect.size(), 1, ColorSpaceLinearRGB, m_filter->renderingMode());
+ m_imageBufferResult = ImageBuffer::create(m_absolutePaintRect.size(), 1, m_colorSpace, m_filter->renderingMode());
if (!m_imageBufferResult)
return 0;
ASSERT(m_imageBufferResult->context());
@@ -356,6 +363,32 @@ Uint8ClampedArray* FilterEffect::createPremultipliedImageResult()
return m_premultipliedImageResult.get();
}
+void FilterEffect::transformResultColorSpace(ColorSpace dstColorSpace)
+{
+#if USE(CG)
+ // CG handles color space adjustments internally.
+ UNUSED_PARAM(dstColorSpace);
+#else
+ if (!hasResult() || dstColorSpace == m_resultColorSpace)
+ return;
+
+ // FIXME: We can avoid this potentially unnecessary ImageBuffer conversion by adding
+ // color space transform support for the {pre,un}multiplied arrays.
+ if (!m_imageBufferResult) {
+ asImageBuffer();
+ ASSERT(m_imageBufferResult);
+ }
+
+ m_imageBufferResult->transformColorSpace(m_resultColorSpace, dstColorSpace);
+ m_resultColorSpace = dstColorSpace;
+
+ if (m_unmultipliedImageResult)
+ m_unmultipliedImageResult.clear();
+ if (m_premultipliedImageResult)
+ m_premultipliedImageResult.clear();
+#endif
+}
+
TextStream& FilterEffect::externalRepresentation(TextStream& ts, int) const
{
// FIXME: We should dump the subRegions of the filter primitives here later. This isn't
diff --git a/Source/WebCore/platform/graphics/filters/FilterEffect.h b/Source/WebCore/platform/graphics/filters/FilterEffect.h
index c99cd501d..1620abf1e 100644
--- a/Source/WebCore/platform/graphics/filters/FilterEffect.h
+++ b/Source/WebCore/platform/graphics/filters/FilterEffect.h
@@ -23,6 +23,7 @@
#define FilterEffect_h
#if ENABLE(FILTERS)
+#include "ColorSpace.h"
#include "FloatRect.h"
#include "IntRect.h"
@@ -129,6 +130,10 @@ public:
bool clipsToBounds() const { return m_clipsToBounds; }
void setClipsToBounds(bool value) { m_clipsToBounds = value; }
+ ColorSpace colorSpace() const { return m_colorSpace; }
+ void setColorSpace(ColorSpace colorSpace) { m_colorSpace = colorSpace; }
+ void transformResultColorSpace(ColorSpace);
+
protected:
FilterEffect(Filter*);
@@ -178,6 +183,9 @@ private:
// Should the effect clip to its primitive region, or expand to use the combined region of its inputs.
bool m_clipsToBounds;
+
+ ColorSpace m_colorSpace;
+ ColorSpace m_resultColorSpace;
};
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/filters/SourceGraphic.h b/Source/WebCore/platform/graphics/filters/SourceGraphic.h
index 06e6d09ba..d85330b77 100644
--- a/Source/WebCore/platform/graphics/filters/SourceGraphic.h
+++ b/Source/WebCore/platform/graphics/filters/SourceGraphic.h
@@ -48,6 +48,7 @@ private:
SourceGraphic(Filter* filter)
: FilterEffect(filter)
{
+ setColorSpace(ColorSpaceDeviceRGB);
}
};
diff --git a/Source/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp b/Source/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp
index 6cd9ee57f..7d476f3c3 100644
--- a/Source/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp
+++ b/Source/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp
@@ -27,8 +27,9 @@
#include "config.h"
#include "SharedGraphicsContext3D.h"
+
+#include "CCProxy.h"
#include "Extensions3D.h"
-#include "cc/CCProxy.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowPrivate.h b/Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowPrivate.h
index 423d0cbf3..f48ff836e 100644
--- a/Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowPrivate.h
+++ b/Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowPrivate.h
@@ -34,16 +34,16 @@ Q_OBJECT
public:
FullScreenVideoWindow();
void setVideoElement(HTMLVideoElement*);
-signals:
+Q_SIGNALS:
void closed();
protected:
void keyPressEvent(QKeyEvent*);
bool event(QEvent*);
-public slots:
+public Q_SLOTS:
void showFullScreen();
-private slots:
+private Q_SLOTS:
void hideCursor();
private:
diff --git a/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp b/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp
index 5002fdf6f..17d4ddcef 100644
--- a/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp
+++ b/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp
@@ -121,7 +121,7 @@ void HarfBuzzShaperBase::setNormalizedBuffer(NormalizeMode normalizeMode)
bool HarfBuzzShaperBase::isWordEnd(unsigned index)
{
// This could refer a high-surrogate, but should work.
- return index && isCodepointSpace(m_normalizedBuffer[index]) && !isCodepointSpace(m_normalizedBuffer[index - 1]);
+ return index && isCodepointSpace(m_run[index]);
}
int HarfBuzzShaperBase::determineWordBreakSpacing()
diff --git a/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaperBase.h b/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaperBase.h
index 67bcadbff..be368b2d1 100644
--- a/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaperBase.h
+++ b/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaperBase.h
@@ -33,6 +33,7 @@
#include "TextRun.h"
#include <wtf/OwnArrayPtr.h>
+#include <wtf/unicode/CharacterNames.h>
namespace WebCore {
@@ -57,8 +58,8 @@ protected:
// WebKit uses this to justify text.
void setPadding(int);
- // This matches the logic in RenderBlock::findNextLineBreak
- static bool isCodepointSpace(UChar c) { return c == ' ' || c == '\t'; }
+ // In complex text word-spacing affects each line-break, space (U+0020) and non-breaking space (U+00A0).
+ static bool isCodepointSpace(UChar c) { return c == ' ' || c == noBreakSpace || c == '\n'; }
const Font* m_font;
OwnArrayPtr<UChar> m_normalizedBuffer;
diff --git a/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp b/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp
index c3bb54da3..32e4d5600 100644
--- a/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp
+++ b/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp
@@ -403,8 +403,8 @@ int HarfBuzzShaper::offsetForPosition(float targetX)
FloatRect HarfBuzzShaper::selectionRect(const FloatPoint& point, int height, int from, int to)
{
float currentX = 0;
- float fromX;
- float toX;
+ float fromX = 0;
+ float toX = 0;
bool foundFromX = false;
bool foundToX = false;
diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
index 9319ff8d3..ccccd38bf 100644
--- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
+++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
@@ -99,9 +99,6 @@ GC3Dboolean Extensions3DOpenGL::isVertexArrayOES(Platform3DObject array)
void Extensions3DOpenGL::bindVertexArrayOES(Platform3DObject array)
{
- if (!array)
- return;
-
m_context->makeContextCurrent();
#if !PLATFORM(GTK) && !PLATFORM(QT) && !PLATFORM(EFL) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
glBindVertexArrayAPPLE(array);
@@ -114,6 +111,24 @@ void Extensions3DOpenGL::copyTextureCHROMIUM(GC3Denum, Platform3DObject, Platfor
return;
}
+void Extensions3DOpenGL::insertEventMarkerEXT(const String&)
+{
+ // FIXME: implement this function and add GL_EXT_debug_marker in supports().
+ return;
+}
+
+void Extensions3DOpenGL::pushGroupMarkerEXT(const String&)
+{
+ // FIXME: implement this function and add GL_EXT_debug_marker in supports().
+ return;
+}
+
+void Extensions3DOpenGL::popGroupMarkerEXT(void)
+{
+ // FIXME: implement this function and add GL_EXT_debug_marker in supports().
+ return;
+}
+
bool Extensions3DOpenGL::supportsExtension(const String& name)
{
// GL_ANGLE_framebuffer_blit and GL_ANGLE_framebuffer_multisample are "fake". They are implemented using other
diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h
index 786303c59..36a44b40b 100644
--- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h
+++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h
@@ -47,6 +47,9 @@ public:
virtual GC3Dboolean isVertexArrayOES(Platform3DObject);
virtual void bindVertexArrayOES(Platform3DObject);
virtual void copyTextureCHROMIUM(GC3Denum, Platform3DObject, Platform3DObject, GC3Dint, GC3Denum);
+ virtual void insertEventMarkerEXT(const String&);
+ virtual void pushGroupMarkerEXT(const String&);
+ virtual void popGroupMarkerEXT(void);
protected:
// This class only needs to be instantiated by GraphicsContext3D implementations.
diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp
index 4ade7e554..9d619b6fb 100644
--- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp
+++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp
@@ -95,6 +95,21 @@ void Extensions3DOpenGLES::copyTextureCHROMIUM(GC3Denum, Platform3DObject, Platf
notImplemented();
}
+void Extensions3DOpenGLES::insertEventMarkerEXT(const String&)
+{
+ notImplemented();
+}
+
+void Extensions3DOpenGLES::pushGroupMarkerEXT(const String&)
+{
+ notImplemented();
+}
+
+void Extensions3DOpenGLES::popGroupMarkerEXT(void)
+{
+ notImplemented();
+}
+
Platform3DObject Extensions3DOpenGLES::createVertexArrayOES()
{
m_context->makeContextCurrent();
diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h
index 1885880f2..6aa3274b2 100644
--- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h
+++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h
@@ -76,6 +76,9 @@ public:
virtual void blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter);
virtual void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height);
virtual void copyTextureCHROMIUM(GC3Denum, Platform3DObject, Platform3DObject, GC3Dint, GC3Denum);
+ virtual void insertEventMarkerEXT(const String&);
+ virtual void pushGroupMarkerEXT(const String&);
+ virtual void popGroupMarkerEXT(void);
virtual Platform3DObject createVertexArrayOES();
virtual void deleteVertexArrayOES(Platform3DObject);
diff --git a/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp b/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
index 225628248..e0c2d6e67 100644
--- a/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
+++ b/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
@@ -155,6 +155,7 @@ PassRefPtr<ImageData> GraphicsContext3D::paintRenderingResultsToImageData(Drawin
return imageData.release();
}
+#if !PLATFORM(BLACKBERRY)
void GraphicsContext3D::prepareTexture()
{
if (m_layerComposited)
@@ -166,22 +167,7 @@ void GraphicsContext3D::prepareTexture()
::glBindFramebufferEXT(GraphicsContext3D::FRAMEBUFFER, m_fbo);
::glActiveTexture(GL_TEXTURE0);
-#if PLATFORM(BLACKBERRY)
- if (!platformTexture()) {
- GLuint tex = 0;
- ::glGenTextures(1, &tex);
- ::glBindTexture(GL_TEXTURE_2D, tex);
- ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- ::glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_currentWidth, m_currentHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
- m_compositingLayer->setTextureID(tex);
- }
- ::glBindTexture(GL_TEXTURE_2D, platformTexture());
-#else
::glBindTexture(GL_TEXTURE_2D, m_compositorTexture);
-#endif
::glCopyTexImage2D(GL_TEXTURE_2D, 0, m_internalColorFormat, 0, 0, m_currentWidth, m_currentHeight, 0);
::glBindTexture(GL_TEXTURE_2D, m_boundTexture0);
::glActiveTexture(m_activeTexture);
@@ -190,6 +176,7 @@ void GraphicsContext3D::prepareTexture()
::glFinish();
m_layerComposited = true;
}
+#endif
void GraphicsContext3D::readRenderingResults(unsigned char *pixels, int pixelsSize)
{
@@ -1335,6 +1322,11 @@ void GraphicsContext3D::deleteBuffer(Platform3DObject buffer)
void GraphicsContext3D::deleteFramebuffer(Platform3DObject framebuffer)
{
makeContextCurrent();
+ if (framebuffer == m_boundFBO) {
+ // Make sure the framebuffer is not going to be used for drawing
+ // operations after it gets deleted.
+ bindFramebuffer(FRAMEBUFFER, 0);
+ }
glDeleteFramebuffersEXT(1, &framebuffer);
}
diff --git a/Source/WebCore/platform/graphics/qt/FontCacheQt.cpp b/Source/WebCore/platform/graphics/qt/FontCacheQt.cpp
index 816bccb89..957d77a9c 100644
--- a/Source/WebCore/platform/graphics/qt/FontCacheQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/FontCacheQt.cpp
@@ -36,9 +36,7 @@
#include <QFont>
#include <QFontDatabase>
-#if HAVE(QRAWFONT)
#include <QTextLayout>
-#endif
using namespace WTF;
@@ -48,7 +46,6 @@ void FontCache::platformInit()
{
}
-#if HAVE(QRAWFONT)
static QRawFont rawFontForCharacters(const QString& string, const QRawFont& font)
{
QTextLayout layout(string);
@@ -65,23 +62,15 @@ static QRawFont rawFontForCharacters(const QString& string, const QRawFont& font
const QGlyphRun& glyphs(glyphList.at(0));
return glyphs.rawFont();
}
-#endif // HAVE(QRAWFONT)
const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length)
{
-#if HAVE(QRAWFONT)
QString qstring = QString::fromRawData(reinterpret_cast<const QChar*>(characters), length);
QRawFont computedFont = rawFontForCharacters(qstring, font.rawFont());
if (!computedFont.isValid())
return 0;
FontPlatformData alternateFont(computedFont);
return getCachedFontData(&alternateFont, DoNotRetain);
-#else
- Q_UNUSED(font);
- Q_UNUSED(characters);
- Q_UNUSED(length);
- return 0;
-#endif
}
SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
diff --git a/Source/WebCore/platform/graphics/qt/FontCustomPlatformData.h b/Source/WebCore/platform/graphics/qt/FontCustomPlatformData.h
index 7fa9f8c11..fbf9a158d 100644
--- a/Source/WebCore/platform/graphics/qt/FontCustomPlatformData.h
+++ b/Source/WebCore/platform/graphics/qt/FontCustomPlatformData.h
@@ -29,9 +29,7 @@
#include <wtf/FastAllocBase.h>
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
-#if HAVE(QRAWFONT)
#include <QRawFont>
-#endif
namespace WebCore {
@@ -42,19 +40,13 @@ struct FontCustomPlatformData {
WTF_MAKE_NONCOPYABLE(FontCustomPlatformData); WTF_MAKE_FAST_ALLOCATED;
public:
FontCustomPlatformData() { }
- ~FontCustomPlatformData();
-
-#if !HAVE(QRAWFONT)
- // for use with QFontDatabase::addApplicationFont/removeApplicationFont
- int m_handle;
-#else
- QRawFont m_rawFont;
-#endif
FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, TextOrientation = TextOrientationVerticalRight,
FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
static bool supportsFormat(const String&);
+
+ QRawFont m_rawFont;
};
FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer);
diff --git a/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp b/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
index 4c5b96488..2be38550e 100644
--- a/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
@@ -24,35 +24,15 @@
#include "FontPlatformData.h"
#include "SharedBuffer.h"
-#if !HAVE(QRAWFONT)
-#include <QFontDatabase>
-#endif
#include <QStringList>
namespace WebCore {
-FontCustomPlatformData::~FontCustomPlatformData()
-{
-#if !HAVE(QRAWFONT)
- QFontDatabase::removeApplicationFont(m_handle);
-#endif
-}
-
FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, TextOrientation, FontWidthVariant, FontRenderingMode)
{
-#if !HAVE(QRAWFONT)
- QFont font;
- font.setFamily(QFontDatabase::applicationFontFamilies(m_handle)[0]);
- font.setPixelSize(size);
- if (bold)
- font.setWeight(QFont::Bold);
- font.setItalic(italic);
- return FontPlatformData(font);
-#else
Q_ASSERT(m_rawFont.isValid());
m_rawFont.setPixelSize(qreal(size));
return FontPlatformData(m_rawFont);
-#endif
}
FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
@@ -60,24 +40,13 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
ASSERT_ARG(buffer, buffer);
const QByteArray fontData(buffer->data(), buffer->size());
-#if !HAVE(QRAWFONT)
- int id = QFontDatabase::addApplicationFontFromData(fontData);
- if (id == -1)
- return 0;
- Q_ASSERT(QFontDatabase::applicationFontFamilies(id).size() > 0);
-#else
// Pixel size doesn't matter at this point, it is set in FontCustomPlatformData::fontPlatformData.
QRawFont rawFont(fontData, /*pixelSize = */0, QFont::PreferDefaultHinting);
if (!rawFont.isValid())
return 0;
-#endif
FontCustomPlatformData *data = new FontCustomPlatformData;
-#if !HAVE(QRAWFONT)
- data->m_handle = id;
-#else
data->m_rawFont = rawFont;
-#endif
return data;
}
diff --git a/Source/WebCore/platform/graphics/qt/FontPlatformData.h b/Source/WebCore/platform/graphics/qt/FontPlatformData.h
index b60d05d52..50885e23d 100644
--- a/Source/WebCore/platform/graphics/qt/FontPlatformData.h
+++ b/Source/WebCore/platform/graphics/qt/FontPlatformData.h
@@ -28,9 +28,7 @@
#include "FontOrientation.h"
#include <QFont>
#include <QHash>
-#if HAVE(QRAWFONT)
#include <QRawFont>
-#endif
#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
@@ -40,13 +38,8 @@ class FontPlatformDataPrivate : public RefCounted<FontPlatformDataPrivate> {
WTF_MAKE_NONCOPYABLE(FontPlatformDataPrivate); WTF_MAKE_FAST_ALLOCATED;
public:
FontPlatformDataPrivate()
-#if !HAVE(QRAWFONT)
- : size(font.pixelSize())
- , bold(font.bold())
-#else
: size(0)
, bold(false)
-#endif
, oblique(false)
, isDeletedValue(false)
{ }
@@ -58,23 +51,13 @@ public:
{
// This is necessary for SVG Fonts, which are only supported when using QRawFont.
// It is used to construct the appropriate platform data to use as a fallback.
-#if HAVE(QRAWFONT)
QFont font;
font.setBold(bold);
font.setItalic(oblique);
rawFont = QRawFont::fromFont(font, QFontDatabase::Any);
rawFont.setPixelSize(size);
-#endif
}
-#if !HAVE(QRAWFONT)
- FontPlatformDataPrivate(const QFont& font)
- : font(font)
- , size(font.pixelSize())
- , bold(font.bold())
- , oblique(false)
- , isDeletedValue(false)
- { }
-#else
+
FontPlatformDataPrivate(const QRawFont& rawFont)
: rawFont(rawFont)
, size(rawFont.pixelSize())
@@ -82,16 +65,12 @@ public:
, oblique(false)
, isDeletedValue(false)
{ }
-#endif
+
FontPlatformDataPrivate(WTF::HashTableDeletedValueType)
: isDeletedValue(true)
{ }
-#if !HAVE(QRAWFONT)
- QFont font;
-#else
QRawFont rawFont;
-#endif
float size;
bool bold : 1;
bool oblique : 1;
@@ -103,16 +82,10 @@ class FontPlatformData {
public:
FontPlatformData(float size, bool bold, bool oblique);
FontPlatformData(const FontDescription&, const AtomicString& familyName, int wordSpacing = 0, int letterSpacing = 0);
-#if !HAVE(QRAWFONT)
- FontPlatformData(const QFont& font)
- : m_data(adoptRef(new FontPlatformDataPrivate(font)))
- { }
-#else
FontPlatformData(const FontPlatformData&, float size);
FontPlatformData(const QRawFont& rawFont)
: m_data(adoptRef(new FontPlatformDataPrivate(rawFont)))
{ }
-#endif
FontPlatformData(WTF::HashTableDeletedValueType)
: m_data(adoptRef(new FontPlatformDataPrivate()))
{
@@ -126,15 +99,6 @@ public:
return m_data && m_data->isDeletedValue;
}
-#if !HAVE(QRAWFONT)
- QFont font() const
- {
- Q_ASSERT(!isHashTableDeletedValue());
- if (!m_data)
- return QFont();
- return m_data->font;
- }
-#else
QRawFont rawFont() const
{
Q_ASSERT(!isHashTableDeletedValue());
@@ -142,7 +106,7 @@ public:
return QRawFont();
return m_data->rawFont;
}
-#endif
+
float size() const
{
Q_ASSERT(!isHashTableDeletedValue());
diff --git a/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp b/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
index 44c9fdfca..c1a157422 100644
--- a/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
@@ -63,11 +63,7 @@ FontPlatformData::FontPlatformData(float size, bool bold, bool oblique)
FontPlatformData::FontPlatformData(const FontDescription& description, const AtomicString& familyName, int wordSpacing, int letterSpacing)
: m_data(adoptRef(new FontPlatformDataPrivate()))
{
-#if !HAVE(QRAWFONT)
- QFont& font = m_data->font;
-#else
QFont font;
-#endif
int requestedSize = description.computedPixelSize();
font.setFamily(familyName);
font.setPixelSize(requestedSize);
@@ -78,20 +74,13 @@ FontPlatformData::FontPlatformData(const FontDescription& description, const Ato
font.setStyleStrategy(QFont::ForceIntegerMetrics);
m_data->bold = font.bold();
-#if !HAVE(QRAWFONT)
- const bool smallCaps = description.smallCaps();
- font.setCapitalization(smallCaps ? QFont::SmallCaps : QFont::MixedCase);
// WebKit allows font size zero but QFont does not. We will return
// m_data->size if a font size of zero is requested and pixelSize()
// otherwise.
m_data->size = (!requestedSize) ? requestedSize : font.pixelSize();
-#else
m_data->rawFont = QRawFont::fromFont(font, QFontDatabase::Any);
- m_data->size = requestedSize;
-#endif
}
-#if HAVE(QRAWFONT)
FontPlatformData::FontPlatformData(const FontPlatformData& other, float size)
: m_data(adoptRef(new FontPlatformDataPrivate()))
{
@@ -101,7 +90,6 @@ FontPlatformData::FontPlatformData(const FontPlatformData& other, float size)
m_data->rawFont.setPixelSize(size);
m_data->size = m_data->rawFont.pixelSize();
}
-#endif // HAVE(QRAWFONT)
bool FontPlatformData::operator==(const FontPlatformData& other) const
{
@@ -114,11 +102,7 @@ bool FontPlatformData::operator==(const FontPlatformData& other) const
const bool equals = (m_data->size == other.m_data->size
&& m_data->bold == other.m_data->bold
&& m_data->oblique == other.m_data->oblique
-#if !HAVE(QRAWFONT)
- && m_data->font == other.m_data->font);
-#else
&& m_data->rawFont == other.m_data->rawFont);
-#endif
return equals;
}
@@ -128,15 +112,9 @@ unsigned FontPlatformData::hash() const
return 0;
if (m_data->isDeletedValue)
return 1;
-#if !HAVE(QRAWFONT)
- return (qHash(m_data->font.toString()) ^ qHash(m_data->bold)
- ^ qHash(m_data->oblique))
- ^ qHash(*reinterpret_cast<quint32*>(&m_data->size));
-#else
return qHash(m_data->rawFont.familyName()) ^ qHash(m_data->rawFont.style())
^ qHash(m_data->rawFont.weight())
^ qHash(*reinterpret_cast<quint32*>(&m_data->size));
-#endif
}
#ifndef NDEBUG
diff --git a/Source/WebCore/platform/graphics/qt/FontQt4.cpp b/Source/WebCore/platform/graphics/qt/FontQt4.cpp
deleted file mode 100644
index 232b8ffb4..000000000
--- a/Source/WebCore/platform/graphics/qt/FontQt4.cpp
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- Copyright (C) 2008, 2010 Holger Hans Peter Freyther
- Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
-
- 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 "Font.h"
-
-#include "AffineTransform.h"
-#include "FontDescription.h"
-#include "FontFallbackList.h"
-#include "FontSelector.h"
-#include "GlyphBuffer.h"
-#include "Gradient.h"
-#include "GraphicsContext.h"
-#include "NotImplemented.h"
-#include "Pattern.h"
-#include "ShadowBlur.h"
-#include "TextRun.h"
-
-#include <QBrush>
-#include <QFontInfo>
-#include <QFontMetrics>
-#include <QPainter>
-#include <QPainterPath>
-#include <QPen>
-#include <QTextLayout>
-#include <limits.h>
-#include <qalgorithms.h>
-#include <qdebug.h>
-
-
-namespace WebCore {
-
-static const QString fromRawDataWithoutRef(const String& string, int start = 0, int len = -1)
-{
- if (len < 0)
- len = string.length() - start;
- Q_ASSERT(start + len <= string.length());
-
- // We don't detach. This assumes the WebCore string data will stay valid for the
- // lifetime of the QString we pass back, since we don't ref the WebCore string.
- return QString::fromRawData(reinterpret_cast<const QChar*>(string.characters() + start), len);
-}
-
-static QTextLine setupLayout(QTextLayout* layout, const TextRun& style)
-{
- int flags = style.rtl() ? Qt::TextForceRightToLeft : Qt::TextForceLeftToRight;
- if (style.expansion())
- flags |= Qt::TextJustificationForced;
- layout->setFlags(flags);
- layout->beginLayout();
- QTextLine line = layout->createLine();
- line.setLineWidth(INT_MAX / 256);
- if (style.expansion())
- line.setLineWidth(line.naturalTextWidth() + style.expansion());
- layout->endLayout();
- return line;
-}
-
-static QPen fillPenForContext(GraphicsContext* ctx)
-{
- if (ctx->fillGradient()) {
- QBrush brush(*ctx->fillGradient()->platformGradient());
- brush.setTransform(ctx->fillGradient()->gradientSpaceTransform());
- return QPen(brush, 0);
- }
-
- if (ctx->fillPattern()) {
- return QPen(QBrush(ctx->fillPattern()->createPlatformPattern()), 0);
- }
-
- return QPen(QColor(ctx->fillColor()));
-}
-
-static QPen strokePenForContext(GraphicsContext* ctx)
-{
- if (ctx->strokeGradient()) {
- QBrush brush(*ctx->strokeGradient()->platformGradient());
- brush.setTransform(ctx->strokeGradient()->gradientSpaceTransform());
- return QPen(brush, ctx->strokeThickness());
- }
-
- if (ctx->strokePattern()) {
- QBrush brush(ctx->strokePattern()->createPlatformPattern());
- return QPen(brush, ctx->strokeThickness());
- }
-
- return QPen(QColor(ctx->strokeColor()), ctx->strokeThickness());
-}
-
-static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const FloatPoint& point, int from, int to, const QFont& font, bool isComplexText)
-{
- if (to < 0)
- to = run.length();
-
- QPainter* p = ctx->platformContext();
-
- QPen textFillPen;
- if (ctx->textDrawingMode() & TextModeFill)
- textFillPen = fillPenForContext(ctx);
-
- QPen textStrokePen;
- if (ctx->textDrawingMode() & TextModeStroke)
- textStrokePen = strokePenForContext(ctx);
-
- String sanitized = Font::normalizeSpaces(run.characters(), run.length());
- QString string = fromRawDataWithoutRef(sanitized);
- QPointF pt(point.x(), point.y());
-
- if (from > 0 || to < run.length()) {
- if (isComplexText) {
- QTextLayout layout(string, font);
- QTextLine line = setupLayout(&layout, run);
- float x1 = line.cursorToX(from);
- float x2 = line.cursorToX(to);
- if (x2 < x1)
- qSwap(x1, x2);
-
- QFontMetrics fm(font);
- int ascent = fm.ascent();
- QRectF boundingRect(point.x() + x1, point.y() - ascent, x2 - x1, fm.height());
- QRectF clip = boundingRect;
-
- ShadowBlur* ctxShadow = ctx->shadowBlur();
- if (ctxShadow->type() != ShadowBlur::NoShadow) {
- const QPointF shadowOffset(ctx->state().shadowOffset.width(), ctx->state().shadowOffset.height());
- qreal dx1 = 0, dx2 = 0, dy1 = 0, dy2 = 0;
- if (shadowOffset.x() > 0)
- dx2 = shadowOffset.x();
- else
- dx1 = -shadowOffset.x();
- if (shadowOffset.y() > 0)
- dy2 = shadowOffset.y();
- else
- dy1 = -shadowOffset.y();
- // expand the clip rect to include the text shadow as well
- const float blurDistance = ctx->state().shadowBlur;
- clip.adjust(dx1, dx2, dy1, dy2);
- clip.adjust(-blurDistance, -blurDistance, blurDistance, blurDistance);
- }
- p->save();
- p->setClipRect(clip.toRect(), Qt::IntersectClip);
- pt.setY(pt.y() - ascent);
-
- if (ctxShadow->type() != ShadowBlur::NoShadow) {
- ShadowBlur* ctxShadow = ctx->shadowBlur();
- if (ctxShadow->type() != ShadowBlur::BlurShadow
- && (!ctxShadow->shadowsIgnoreTransforms() || ctx->getCTM().isIdentity())) {
- p->save();
- p->setPen(ctx->state().shadowColor);
- p->translate(QPointF(ctx->state().shadowOffset.width(), ctx->state().shadowOffset.height()));
- line.draw(p, pt);
- p->restore();
- } else {
- GraphicsContext* shadowContext = ctxShadow->beginShadowLayer(ctx, boundingRect);
- if (shadowContext) {
- QPainter* shadowPainter = shadowContext->platformContext();
- // Since it will be blurred anyway, we don't care about render hints.
- shadowPainter->setFont(p->font());
- shadowPainter->setPen(ctx->state().shadowColor);
- line.draw(shadowPainter, pt);
- ctxShadow->endShadowLayer(ctx);
- }
- }
- }
- p->setPen(textFillPen);
- line.draw(p, pt);
- p->restore();
- return;
- }
- int skipWidth = QFontMetrics(font).width(string, from, Qt::TextBypassShaping);
- pt.setX(pt.x() + skipWidth);
- string = fromRawDataWithoutRef(sanitized, from, to - from);
- }
-
- p->setFont(font);
-
- int flags = run.rtl() ? Qt::TextForceRightToLeft : Qt::TextForceLeftToRight;
- if (!isComplexText && !(ctx->textDrawingMode() & TextModeStroke))
- flags |= Qt::TextBypassShaping;
-
- QPainterPath textStrokePath;
- if (ctx->textDrawingMode() & TextModeStroke)
- textStrokePath.addText(pt, font, string);
-
- ShadowBlur* ctxShadow = ctx->shadowBlur();
- if (ctx->hasShadow() && ctxShadow->type() != ShadowBlur::NoShadow) {
- if (ctx->textDrawingMode() & TextModeFill) {
- if (ctxShadow->type() != ShadowBlur::BlurShadow) {
- p->save();
- p->setPen(ctx->state().shadowColor);
- p->translate(QPointF(ctx->state().shadowOffset.width(), ctx->state().shadowOffset.height()));
- p->drawText(pt, string, flags, run.expansion());
- p->restore();
- } else {
- QFontMetrics fm(font);
- QRectF boundingRect(pt.x(), point.y() - fm.ascent(), fm.width(string, -1, flags), fm.height());
- GraphicsContext* shadowContext = ctxShadow->beginShadowLayer(ctx, boundingRect);
- if (shadowContext) {
- QPainter* shadowPainter = shadowContext->platformContext();
- // Since it will be blurred anyway, we don't care about render hints.
- shadowPainter->setFont(p->font());
- shadowPainter->setPen(ctx->state().shadowColor);
- shadowPainter->drawText(pt, string, flags, run.expansion());
- ctxShadow->endShadowLayer(ctx);
- }
- }
- } else if (ctx->textDrawingMode() & TextModeStroke) {
- if (ctxShadow->type() != ShadowBlur::BlurShadow) {
- const QPointF shadowOffset(ctx->state().shadowOffset.width(), ctx->state().shadowOffset.height());
- p->translate(shadowOffset);
- p->strokePath(textStrokePath, QPen(ctx->state().shadowColor));
- p->translate(-shadowOffset);
- } else {
- QFontMetrics fm(font);
- QRectF boundingRect(pt.x(), point.y() - fm.ascent(), fm.width(string, -1, flags), fm.height());
- GraphicsContext* shadowContext = ctxShadow->beginShadowLayer(ctx, boundingRect);
- if (shadowContext) {
- QPainter* shadowPainter = shadowContext->platformContext();
- // Since it will be blurred anyway, we don't care about render hints.
- shadowPainter->setFont(p->font());
- shadowPainter->strokePath(textStrokePath, QPen(ctx->state().shadowColor));
- ctxShadow->endShadowLayer(ctx);
- }
- }
- }
- }
-
- if (ctx->textDrawingMode() & TextModeStroke)
- p->strokePath(textStrokePath, textStrokePen);
-
- if (ctx->textDrawingMode() & TextModeFill) {
- QPen previousPen = p->pen();
- p->setPen(textFillPen);
- p->drawText(pt, string, flags, run.expansion());
- p->setPen(previousPen);
- }
-}
-
-void Font::drawComplexText(GraphicsContext* ctx, const TextRun& run, const FloatPoint& point, int from, int to) const
-{
- drawTextCommon(ctx, run, point, from, to, font(), /* isComplexText = */true);
-}
-
-float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>*, GlyphOverflow*) const
-{
- if (!primaryFont()->platformData().size())
- return 0;
-
- if (!run.length())
- return 0;
-
- if (run.length() == 1 && treatAsSpace(run[0]))
- return QFontMetrics(font()).width(space) + run.expansion();
-
- String sanitized = Font::normalizeSpaces(run.characters(), run.length());
- QString string = fromRawDataWithoutRef(sanitized);
-
- int w = QFontMetrics(font()).width(string);
- // WebKit expects us to ignore word spacing on the first character (as opposed to what Qt does)
- if (treatAsSpace(run[0]))
- w -= m_wordSpacing;
-
- return w + run.expansion();
-}
-
-int Font::offsetForPositionForComplexText(const TextRun& run, float position, bool) const
-{
- String sanitized = Font::normalizeSpaces(run.characters(), run.length());
- QString string = fromRawDataWithoutRef(sanitized);
-
- QTextLayout layout(string, font());
- QTextLine line = setupLayout(&layout, run);
- return line.xToCursor(position);
-}
-
-FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint& pt, int h, int from, int to) const
-{
- String sanitized = Font::normalizeSpaces(run.characters(), run.length());
- QString string = fromRawDataWithoutRef(sanitized);
-
- QTextLayout layout(string, font());
- QTextLine line = setupLayout(&layout, run);
-
- float x1 = line.cursorToX(from);
- float x2 = line.cursorToX(to);
- if (x2 < x1)
- qSwap(x1, x2);
-
- return FloatRect(pt.x() + x1, pt.y(), x2 - x1, h);
-}
-
-bool Font::canReturnFallbackFontsForComplexText()
-{
- return false;
-}
-
-void Font::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRun& /* run */, const AtomicString& /* mark */, const FloatPoint& /* point */, int /* from */, int /* to */) const
-{
- notImplemented();
-}
-
-void Font::drawSimpleText(GraphicsContext* ctx, const TextRun& run, const FloatPoint& point, int from, int to) const
-{
- drawTextCommon(ctx, run, point, from, to, font(), /* isComplexText = */false);
-}
-
-int Font::offsetForPositionForSimpleText(const TextRun& run, float position, bool includePartialGlyphs) const
-{
- String sanitized = Font::normalizeSpaces(run.characters(), run.length());
- QString string = fromRawDataWithoutRef(sanitized);
-
- QFontMetrics fm(font());
- float delta = position;
- int curPos = 0;
- do {
- float charWidth = fm.width(string[curPos]);
- delta -= charWidth;
- if (includePartialGlyphs) {
- if (delta + charWidth / 2 <= 0)
- break;
- } else {
- if (delta + charWidth <= 0)
- break;
- }
- } while (++curPos < string.size());
-
- return curPos;
-}
-
-
-float Font::floatWidthForSimpleText(const TextRun& run, GlyphBuffer* glyphBuffer, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
-{
- if (!primaryFont()->platformData().size())
- return 0;
-
- if (!run.length())
- return 0;
-
- String sanitized = Font::normalizeSpaces(run.characters(), run.length());
- QString string = fromRawDataWithoutRef(sanitized);
-
- int w = QFontMetrics(font()).width(string, -1, Qt::TextBypassShaping);
-
- // WebKit expects us to ignore word spacing on the first character (as opposed to what Qt does)
- if (treatAsSpace(run[0]))
- w -= m_wordSpacing;
-
- return w + run.expansion();
-}
-
-
-FloatRect Font::selectionRectForSimpleText(const TextRun& run, const FloatPoint& pt, int h, int from, int to) const
-{
- String sanitized = Font::normalizeSpaces(run.characters(), run.length());
- QString wholeText = fromRawDataWithoutRef(sanitized);
- QString selectedText = fromRawDataWithoutRef(sanitized, from, qMin(to - from, wholeText.length() - from));
-
- int startX = QFontMetrics(font()).width(wholeText, from, Qt::TextBypassShaping);
- int width = QFontMetrics(font()).width(selectedText, -1, Qt::TextBypassShaping);
-
- return FloatRect(pt.x() + startX, pt.y(), width, h);
-}
-
-bool Font::canExpandAroundIdeographsInComplexText()
-{
- return false;
-}
-
-bool Font::primaryFontHasGlyphForCharacter(UChar32) const
-{
- notImplemented();
- return true;
-}
-
-int Font::emphasisMarkAscent(const AtomicString&) const
-{
- notImplemented();
- return 0;
-}
-
-int Font::emphasisMarkDescent(const AtomicString&) const
-{
- notImplemented();
- return 0;
-}
-
-int Font::emphasisMarkHeight(const AtomicString&) const
-{
- notImplemented();
- return 0;
-}
-
-void Font::drawEmphasisMarksForSimpleText(GraphicsContext* /* context */, const TextRun& /* run */, const AtomicString& /* mark */, const FloatPoint& /* point */, int /* from */, int /* to */) const
-{
- notImplemented();
-}
-
-QFont Font::font() const
-{
- QFont f = primaryFont()->getQtFont();
- if (m_letterSpacing)
- f.setLetterSpacing(QFont::AbsoluteSpacing, m_letterSpacing);
- if (m_wordSpacing)
- f.setWordSpacing(m_wordSpacing);
- return f;
-}
-
-QFont Font::syntheticFont() const
-{
- return font();
-}
-
-}
-
diff --git a/Source/WebCore/platform/graphics/qt/GlyphPageTreeNodeQt.cpp b/Source/WebCore/platform/graphics/qt/GlyphPageTreeNodeQt.cpp
index 7b76804a4..5ee9922ba 100644
--- a/Source/WebCore/platform/graphics/qt/GlyphPageTreeNodeQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/GlyphPageTreeNodeQt.cpp
@@ -23,15 +23,12 @@
#include "config.h"
#include "GlyphPageTreeNode.h"
-#if HAVE(QRAWFONT)
#include "SimpleFontData.h"
#include <QFontMetricsF>
#include <QTextLayout>
-#endif
namespace WebCore {
-#if HAVE(QRAWFONT)
bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
{
QRawFont rawFont = fontData->platformData().rawFont();
@@ -51,15 +48,5 @@ bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned b
}
return haveGlyphs;
}
-#else
-
-void GlyphPageTreeNode::pruneTreeCustomFontData(const FontData*)
-{
-}
-
-void GlyphPageTreeNode::pruneTreeFontData(const WebCore::SimpleFontData*)
-{
-}
-#endif // HAVE(QRAWFONT)
}
diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
index cb824f63c..8852ccdb1 100644
--- a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
@@ -69,6 +69,7 @@ public:
#endif
#if USE(GRAPHICS_SURFACE)
virtual uint32_t copyToGraphicsSurface();
+ virtual uint64_t graphicsSurfaceToken() const;
#endif
QRectF boundingRect() const;
@@ -83,8 +84,7 @@ public:
PlatformGraphicsContext3D m_platformContext;
#if USE(GRAPHICS_SURFACE)
GraphicsSurface::Flags m_surfaceFlags;
- RefPtr<GraphicsSurface> m_frontBufferGraphicsSurface;
- RefPtr<GraphicsSurface> m_backBufferGraphicsSurface;
+ RefPtr<GraphicsSurface> m_graphicsSurface;
#endif
};
@@ -140,8 +140,7 @@ GraphicsContext3DPrivate::GraphicsContext3DPrivate(GraphicsContext3D* context, H
| GraphicsSurface::SupportsSharing;
if (!surfaceSize.isEmpty()) {
- m_frontBufferGraphicsSurface = GraphicsSurface::create(surfaceSize, m_surfaceFlags);
- m_backBufferGraphicsSurface = GraphicsSurface::create(surfaceSize, m_surfaceFlags);
+ m_graphicsSurface = GraphicsSurface::create(surfaceSize, m_surfaceFlags);
}
#endif
}
@@ -220,14 +219,19 @@ void GraphicsContext3DPrivate::paintToTextureMapper(TextureMapper* textureMapper
#if USE(GRAPHICS_SURFACE)
uint32_t GraphicsContext3DPrivate::copyToGraphicsSurface()
{
- if (!m_frontBufferGraphicsSurface || !m_backBufferGraphicsSurface)
+ if (!m_graphicsSurface)
return 0;
blitMultisampleFramebufferAndRestoreContext();
makeCurrentIfNeeded();
- m_backBufferGraphicsSurface->copyFromFramebuffer(m_context->m_fbo, IntRect(0, 0, m_context->m_currentWidth, m_context->m_currentHeight));
- std::swap(m_frontBufferGraphicsSurface, m_backBufferGraphicsSurface);
- return m_frontBufferGraphicsSurface->exportToken();
+ m_graphicsSurface->copyFromFramebuffer(m_context->m_fbo, IntRect(0, 0, m_context->m_currentWidth, m_context->m_currentHeight));
+ uint32_t frontBuffer = m_graphicsSurface->swapBuffers();
+ return frontBuffer;
+}
+
+uint64_t GraphicsContext3DPrivate::graphicsSurfaceToken() const
+{
+ return m_graphicsSurface->exportToken();
}
#endif
@@ -275,13 +279,10 @@ bool GraphicsContext3DPrivate::makeCurrentIfNeeded() const
void GraphicsContext3DPrivate::createGraphicsSurfaces(const IntSize& size)
{
#if USE(GRAPHICS_SURFACE)
- if (size.isEmpty()) {
- m_frontBufferGraphicsSurface.clear();
- m_backBufferGraphicsSurface.clear();
- } else {
- m_frontBufferGraphicsSurface = GraphicsSurface::create(size, m_surfaceFlags);
- m_backBufferGraphicsSurface = GraphicsSurface::create(size, m_surfaceFlags);
- }
+ if (size.isEmpty())
+ m_graphicsSurface.clear();
+ else
+ m_graphicsSurface = GraphicsSurface::create(size, m_surfaceFlags);
#endif
}
diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index cb81d6534..c7aef5e9e 100644
--- a/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -461,7 +461,12 @@ void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2)
p->setPen(pen);
}
- p->drawLine(p1, p2);
+ // Qt interprets geometric units as end-point inclusive, while WebCore interprets geomtric units as endpoint exclusive.
+ // This means we need to subtract one from the endpoint, or the line will be painted one pixel too long.
+ if (p1.x() == p2.x())
+ p->drawLine(p1, p2 - FloatSize(0, 1));
+ else
+ p->drawLine(p1, p2 - FloatSize(1, 0));
if (patWidth)
p->restore();
diff --git a/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h b/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
index e217ef5e1..f15af138d 100644
--- a/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
+++ b/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
@@ -116,7 +116,7 @@ public:
void removeVideoItem();
void restoreVideoItem();
-private slots:
+private Q_SLOTS:
void mediaStatusChanged(QMediaPlayer::MediaStatus);
void handleError(QMediaPlayer::Error);
void stateChanged(QMediaPlayer::State);
diff --git a/Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp b/Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp
index 57908656e..8ce9f77da 100644
--- a/Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp
@@ -24,26 +24,16 @@
#include "config.h"
#include "SimpleFontData.h"
-#if HAVE(QRAWFONT)
#include "NotImplemented.h"
-#else
-#include <QFontMetricsF>
-#endif
namespace WebCore {
void SimpleFontData::determinePitch()
{
-#if HAVE(QRAWFONT)
notImplemented();
m_treatAsFixedPitch = false;
-#else
- m_treatAsFixedPitch = m_platformData.font().fixedPitch();
-#endif
}
-#if HAVE(QRAWFONT)
-
static const float smallCapsFraction = 0.7;
static const float emphasisMarkFraction = 0.5;
@@ -102,23 +92,6 @@ FloatRect SimpleFontData::platformBoundsForGlyph(Glyph) const
notImplemented();
return FloatRect();
}
-#else
-bool SimpleFontData::containsCharacters(const UChar*, int) const
-{
- return true;
-}
-
-void SimpleFontData::platformGlyphInit()
-{
- if (!m_platformData.size())
- return;
- m_spaceGlyph = 0;
- m_adjustedSpaceWidth = m_spaceWidth;
- determinePitch();
- m_missingGlyphData.fontData = this;
- m_missingGlyphData.glyph = 0;
-}
-#endif
void SimpleFontData::platformInit()
{
@@ -129,7 +102,6 @@ void SimpleFontData::platformInit()
return;
}
-#if HAVE(QRAWFONT)
QRawFont rawFont(m_platformData.rawFont());
float descent = rawFont.descent();
float ascent = rawFont.ascent();
@@ -139,14 +111,6 @@ void SimpleFontData::platformInit()
QVector<quint32> indexes = rawFont.glyphIndexesForString(QLatin1String(" "));
QVector<QPointF> advances = rawFont.advancesForGlyphIndexes(indexes);
float spaceWidth = advances.at(0).x();
-#else
- QFontMetricsF fm(m_platformData.font());
- float descent = fm.descent();
- float ascent = fm.ascent();
- float xHeight = fm.xHeight();
- float lineSpacing = fm.lineSpacing();
- float spaceWidth = fm.width(QLatin1Char(' '));
-#endif
// The line spacing should always be >= (ascent + descent), but this
// may be false in some cases due to misbehaving platform libraries.
@@ -171,15 +135,9 @@ void SimpleFontData::platformCharWidthInit()
{
if (!m_platformData.size())
return;
-#if HAVE(QRAWFONT)
QRawFont rawFont(m_platformData.rawFont());
m_avgCharWidth = rawFont.averageCharWidth();
m_maxCharWidth = rawFont.maxCharWidth();
-#else
- QFontMetricsF fm(m_platformData.font());
- m_avgCharWidth = fm.averageCharWidth();
- m_maxCharWidth = fm.maxWidth();
-#endif
}
void SimpleFontData::platformDestroy()
diff --git a/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
index 860ff1b78..02b19ee5f 100644
--- a/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
@@ -46,7 +46,6 @@
#include "PlatformContextSkia.h"
#include "SharedGraphicsContext3D.h"
#include "SkColorPriv.h"
-#include "SkDeferredCanvas.h"
#include "SkGpuDevice.h"
#include "SkiaUtils.h"
#include "WEBPImageEncoder.h"
@@ -79,6 +78,7 @@ static SkCanvas* createAcceleratedCanvas(const IntSize& size, ImageBufferData* d
GrContext* gr = context3D->grContext();
if (!gr)
return 0;
+ context3D->getExtensions()->pushGroupMarkerEXT("AcceleratedCanvasContext");
gr->resetContext();
GrTextureDesc desc;
desc.fFlags = kRenderTarget_GrTextureFlagBit;
diff --git a/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp b/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp
index 7e34c079d..2c4baed75 100644
--- a/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp
@@ -34,12 +34,9 @@
#include "NativeImageSkia.h"
#include "GraphicsContext3D.h"
+#include "PlatformInstrumentation.h"
#include "SkiaUtils.h"
-#if PLATFORM(CHROMIUM)
-#include "TraceEvent.h"
-#endif
-
namespace WebCore {
NativeImageSkia::NativeImageSkia()
@@ -74,9 +71,6 @@ SkBitmap NativeImageSkia::resizedBitmap(const SkIRect& srcSubset,
int destHeight,
const SkIRect& destVisibleSubset) const
{
-#if PLATFORM(CHROMIUM)
- TRACE_EVENT0("skia", "NativeImageSkia::resizedBitmap");
-#endif
if (!hasResizedBitmap(srcSubset, destWidth, destHeight)) {
bool shouldCache = isDataComplete()
&& shouldCacheResampling(srcSubset, destWidth, destHeight, destVisibleSubset);
@@ -84,18 +78,16 @@ SkBitmap NativeImageSkia::resizedBitmap(const SkIRect& srcSubset,
SkBitmap subset;
m_image.extractSubset(&subset, srcSubset);
if (!shouldCache) {
-#if PLATFORM(CHROMIUM)
- TRACE_EVENT0("skia", "nonCachedResize");
-#endif
// Just resize the visible subset and return it.
+ PlatformInstrumentation::willResizeImage(shouldCache);
SkBitmap resizedImage = skia::ImageOperations::Resize(subset, skia::ImageOperations::RESIZE_LANCZOS3, destWidth, destHeight, destVisibleSubset);
+ PlatformInstrumentation::didResizeImage();
resizedImage.setImmutable();
return resizedImage;
} else {
-#if PLATFORM(CHROMIUM)
- TRACE_EVENT0("skia", "cachedResize");
-#endif
+ PlatformInstrumentation::willResizeImage(shouldCache);
m_resizedImage = skia::ImageOperations::Resize(subset, skia::ImageOperations::RESIZE_LANCZOS3, destWidth, destHeight);
+ PlatformInstrumentation::didResizeImage();
}
m_resizedImage.setImmutable();
}
diff --git a/Source/WebCore/platform/graphics/surfaces/GraphicsSurface.cpp b/Source/WebCore/platform/graphics/surfaces/GraphicsSurface.cpp
index 2b8cd6591..55c645a77 100644
--- a/Source/WebCore/platform/graphics/surfaces/GraphicsSurface.cpp
+++ b/Source/WebCore/platform/graphics/surfaces/GraphicsSurface.cpp
@@ -25,7 +25,7 @@
#if USE(GRAPHICS_SURFACE)
namespace WebCore {
-PassRefPtr<GraphicsSurface> GraphicsSurface::create(const IntSize& size, Flags flags, uint32_t token)
+PassRefPtr<GraphicsSurface> GraphicsSurface::create(const IntSize& size, Flags flags, uint64_t token)
{
return platformImport(size, flags, token);
}
@@ -35,7 +35,7 @@ PassRefPtr<GraphicsSurface> GraphicsSurface::create(const IntSize& size, Graphic
return platformCreate(size, flags);
}
-uint32_t GraphicsSurface::exportToken()
+uint64_t GraphicsSurface::exportToken()
{
return platformExport();
}
@@ -63,6 +63,16 @@ void GraphicsSurface::copyFromFramebuffer(uint32_t fbo, const IntRect& sourceRec
platformCopyFromFramebuffer(fbo, sourceRect);
}
+uint32_t GraphicsSurface::frontBuffer()
+{
+ return platformFrontBuffer();
+}
+
+uint32_t GraphicsSurface::swapBuffers()
+{
+ return platformSwapBuffers();
+}
+
GraphicsSurface::GraphicsSurface(const IntSize& size, Flags flags)
: m_flags(flags)
, m_size(size)
diff --git a/Source/WebCore/platform/graphics/surfaces/GraphicsSurface.h b/Source/WebCore/platform/graphics/surfaces/GraphicsSurface.h
index 7aeed792c..e8ac538f5 100644
--- a/Source/WebCore/platform/graphics/surfaces/GraphicsSurface.h
+++ b/Source/WebCore/platform/graphics/surfaces/GraphicsSurface.h
@@ -50,7 +50,8 @@ public:
SupportsTextureSource = 0x10,
SupportsCopyToTexture = 0x20,
SupportsCopyFromTexture = 0x40,
- SupportsSharing = 0x80
+ SupportsSharing = 0x80,
+ SupportsSingleBuffered = 0x100
};
enum LockOption {
@@ -66,10 +67,12 @@ public:
IntSize size() const { return m_size; }
static PassRefPtr<GraphicsSurface> create(const IntSize&, Flags);
- static PassRefPtr<GraphicsSurface> create(const IntSize&, Flags, uint32_t token);
+ static PassRefPtr<GraphicsSurface> create(const IntSize&, Flags, uint64_t token);
void copyToGLTexture(uint32_t target, uint32_t texture, const IntRect& targetRect, const IntPoint& sourceOffset);
void copyFromFramebuffer(uint32_t fbo, const IntRect& sourceRect);
- uint32_t exportToken();
+ uint32_t frontBuffer();
+ uint32_t swapBuffers();
+ uint64_t exportToken();
uint32_t getTextureID();
PassOwnPtr<GraphicsContext> beginPaint(const IntRect&, LockOptions);
PassRefPtr<Image> createReadOnlyImage(const IntRect&);
@@ -77,8 +80,8 @@ public:
protected:
static PassRefPtr<GraphicsSurface> platformCreate(const IntSize&, Flags);
- static PassRefPtr<GraphicsSurface> platformImport(const IntSize&, Flags, uint32_t);
- uint32_t platformExport();
+ static PassRefPtr<GraphicsSurface> platformImport(const IntSize&, Flags, uint64_t);
+ uint64_t platformExport();
void platformDestroy();
uint32_t platformGetTextureID();
@@ -86,6 +89,8 @@ protected:
void platformUnlock();
void platformCopyToGLTexture(uint32_t target, uint32_t texture, const IntRect&, const IntPoint&);
void platformCopyFromFramebuffer(uint32_t fbo, const IntRect& sourceRect);
+ uint32_t platformFrontBuffer() const;
+ uint32_t platformSwapBuffers();
PassOwnPtr<GraphicsContext> platformBeginPaint(const IntSize&, char* bits, int stride);
diff --git a/Source/WebCore/platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp b/Source/WebCore/platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp
index bfa20ba35..b211c1bd3 100644
--- a/Source/WebCore/platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp
+++ b/Source/WebCore/platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp
@@ -30,13 +30,6 @@
namespace WebCore {
-struct GraphicsSurfacePrivate { };
-
-uint32_t GraphicsSurface::platformExport()
-{
- return IOSurfaceGetID(m_platformSurface);
-}
-
static uint32_t createTexture(IOSurfaceRef handle)
{
GLuint texture = 0;
@@ -52,6 +45,7 @@ static uint32_t createTexture(IOSurfaceRef handle)
glGetIntegerv(GL_TEXTURE_RECTANGLE_ARB, &prevTexture);
if (!wasEnabled)
glEnable(GL_TEXTURE_RECTANGLE_ARB);
+
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, texture);
CGLError error = CGLTexImageIOSurface2D(context, GL_TEXTURE_RECTANGLE_ARB, internalFormat, IOSurfaceGetWidth(handle), IOSurfaceGetHeight(handle), format, type, handle, 0);
@@ -63,21 +57,149 @@ static uint32_t createTexture(IOSurfaceRef handle)
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, prevTexture);
if (!wasEnabled)
glDisable(GL_TEXTURE_RECTANGLE_ARB);
+
return texture;
}
+struct GraphicsSurfacePrivate {
+public:
+ GraphicsSurfacePrivate(uint64_t token)
+ : m_token(token)
+ , m_frontBufferTexture(0)
+ , m_backBufferTexture(0)
+ {
+ // The token contains the IOSurfaceID of the fist surface/buffer in the first 32 Bit
+ // and the IOSurfaceID of the second surface/buffer in the second 32 Bit.
+ uint32_t frontBuffer = token >> 32;
+ uint32_t backBuffer = token & 0xffff;
+
+ m_frontBuffer = IOSurfaceLookup(frontBuffer);
+ m_backBuffer = IOSurfaceLookup(backBuffer);
+ }
+
+ GraphicsSurfacePrivate(const IntSize& size, GraphicsSurface::Flags flags)
+ : m_frontBufferTexture(0)
+ , m_backBufferTexture(0)
+ {
+ unsigned pixelFormat = 'BGRA';
+ unsigned bytesPerElement = 4;
+ int width = size.width();
+ int height = size.height();
+
+ unsigned long bytesPerRow = IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, width * bytesPerElement);
+ if (!bytesPerRow)
+ return;
+
+ unsigned long allocSize = IOSurfaceAlignProperty(kIOSurfaceAllocSize, height * bytesPerRow);
+ if (!allocSize)
+ return;
+
+ const void *keys[7];
+ const void *values[7];
+ keys[0] = kIOSurfaceWidth;
+ values[0] = CFNumberCreate(0, kCFNumberIntType, &width);
+ keys[1] = kIOSurfaceHeight;
+ values[1] = CFNumberCreate(0, kCFNumberIntType, &height);
+ keys[2] = kIOSurfacePixelFormat;
+ values[2] = CFNumberCreate(0, kCFNumberIntType, &pixelFormat);
+ keys[3] = kIOSurfaceBytesPerElement;
+ values[3] = CFNumberCreate(0, kCFNumberIntType, &bytesPerElement);
+ keys[4] = kIOSurfaceBytesPerRow;
+ values[4] = CFNumberCreate(0, kCFNumberLongType, &bytesPerRow);
+ keys[5] = kIOSurfaceAllocSize;
+ values[5] = CFNumberCreate(0, kCFNumberLongType, &allocSize);
+ keys[6] = kIOSurfaceIsGlobal;
+ values[6] = (flags & GraphicsSurface::SupportsSharing) ? kCFBooleanTrue : kCFBooleanFalse;
+
+ CFDictionaryRef dict = CFDictionaryCreate(0, keys, values, 7, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+ for (unsigned i = 0; i < 7; i++)
+ CFRelease(values[i]);
+
+ m_frontBuffer = IOSurfaceCreate(dict);
+ m_backBuffer = IOSurfaceCreate(dict);
+
+ uint64_t token = IOSurfaceGetID(m_frontBuffer);
+ token <<= 32;
+ token |= IOSurfaceGetID(m_backBuffer);
+
+ m_token = token;
+ }
+
+ ~GraphicsSurfacePrivate()
+ {
+ if (m_frontBufferTexture)
+ glDeleteTextures(1, &m_frontBufferTexture);
+
+ if (m_backBufferTexture)
+ glDeleteTextures(1, &m_backBufferTexture);
+
+ if (m_frontBuffer)
+ CFRelease(IOSurfaceRef(m_frontBuffer));
+
+ if (m_backBuffer)
+ CFRelease(IOSurfaceRef(m_backBuffer));
+ }
+
+ uint32_t swapBuffers()
+ {
+ std::swap(m_frontBuffer, m_backBuffer);
+ std::swap(m_frontBufferTexture, m_backBufferTexture);
+
+ return IOSurfaceGetID(m_frontBuffer);
+ }
+
+ uint64_t token() const
+ {
+ return m_token;
+ }
+
+ uint32_t frontBufferTextureID()
+ {
+ if (!m_frontBufferTexture)
+ m_frontBufferTexture = createTexture(m_frontBuffer);
+
+ return m_frontBufferTexture;
+ }
+
+ uint32_t backBufferTextureID()
+ {
+ if (!m_backBufferTexture)
+ m_backBufferTexture = createTexture(m_backBuffer);
+
+ return m_backBufferTexture;
+ }
+
+ PlatformGraphicsSurface frontBuffer() const
+ {
+ return m_frontBuffer;
+ }
+
+ PlatformGraphicsSurface backBuffer() const
+ {
+ return m_backBuffer;
+ }
+
+private:
+ PlatformGraphicsSurface m_frontBuffer;
+ PlatformGraphicsSurface m_backBuffer;
+ uint32_t m_frontBufferTexture;
+ uint32_t m_backBufferTexture;
+ uint64_t m_token;
+};
+
+uint64_t GraphicsSurface::platformExport()
+{
+ return m_private->token();
+}
+
uint32_t GraphicsSurface::platformGetTextureID()
{
- if (!m_texture)
- m_texture = createTexture(m_platformSurface);
- return m_texture;
+ return m_private->frontBufferTextureID();
}
void GraphicsSurface::platformCopyToGLTexture(uint32_t target, uint32_t id, const IntRect& targetRect, const IntPoint& offset)
{
glPushAttrib(GL_ALL_ATTRIB_BITS);
- if (!m_texture)
- m_texture = createTexture(m_platformSurface);
if (!m_fbo)
glGenFramebuffers(1, &m_fbo);
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 0);
@@ -85,7 +207,7 @@ void GraphicsSurface::platformCopyToGLTexture(uint32_t target, uint32_t id, cons
glEnable(target);
glBindTexture(target, id);
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo);
- glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE_ARB, m_texture, 0);
+ glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE_ARB, m_private->frontBufferTextureID(), 0);
glCopyTexSubImage2D(target, 0, targetRect.x(), targetRect.y(), offset.x(), offset.y(), targetRect.width(), targetRect.height());
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE_ARB, 0, 0);
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
@@ -101,16 +223,15 @@ void GraphicsSurface::platformCopyToGLTexture(uint32_t target, uint32_t id, cons
void GraphicsSurface::platformCopyFromFramebuffer(uint32_t originFbo, const IntRect& sourceRect)
{
glPushAttrib(GL_ALL_ATTRIB_BITS);
- if (!m_texture)
- m_texture = createTexture(m_platformSurface);
if (!m_fbo)
glGenFramebuffers(1, &m_fbo);
+
GLint oldFBO;
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &oldFBO);
glEnable(GL_TEXTURE_RECTANGLE_ARB);
glBindFramebuffer(GL_READ_FRAMEBUFFER, originFbo);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_fbo);
- glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE_ARB, m_texture, 0);
+ glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE_ARB, m_private->backBufferTextureID(), 0);
glBlitFramebuffer(0, 0, sourceRect.width(), sourceRect.height(), 0, sourceRect.height(), sourceRect.width(), 0, GL_COLOR_BUFFER_BIT, GL_LINEAR); // Flip the texture upside down.
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE_ARB, 0, 0);
glBindFramebuffer(GL_FRAMEBUFFER, oldFBO);
@@ -120,67 +241,47 @@ void GraphicsSurface::platformCopyFromFramebuffer(uint32_t originFbo, const IntR
glFlush();
}
+uint32_t GraphicsSurface::platformFrontBuffer() const
+{
+ return IOSurfaceGetID(m_private->frontBuffer());
+}
+
+uint32_t GraphicsSurface::platformSwapBuffers()
+{
+ return m_private->swapBuffers();
+}
+
PassRefPtr<GraphicsSurface> GraphicsSurface::platformCreate(const IntSize& size, Flags flags)
{
// We currently disable support for CopyToTexture on Mac, because this is used for single buffered Tiles.
// The single buffered nature of this requires a call to glFlush, as described in platformCopyToTexture.
// This call blocks the GPU for about 40ms, which makes smooth animations impossible.
- if (flags & SupportsCopyToTexture)
+ if (flags & SupportsCopyToTexture || flags & SupportsSingleBuffered)
return PassRefPtr<GraphicsSurface>();
- unsigned pixelFormat = 'BGRA';
- unsigned bytesPerElement = 4;
- int width = size.width();
- int height = size.height();
-
- unsigned long bytesPerRow = IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, width * bytesPerElement);
- if (!bytesPerRow)
- return false;
-
- unsigned long allocSize = IOSurfaceAlignProperty(kIOSurfaceAllocSize, height * bytesPerRow);
- if (!allocSize)
- return false;
-
- const void *keys[7];
- const void *values[7];
- keys[0] = kIOSurfaceWidth;
- values[0] = CFNumberCreate(0, kCFNumberIntType, &width);
- keys[1] = kIOSurfaceHeight;
- values[1] = CFNumberCreate(0, kCFNumberIntType, &height);
- keys[2] = kIOSurfacePixelFormat;
- values[2] = CFNumberCreate(0, kCFNumberIntType, &pixelFormat);
- keys[3] = kIOSurfaceBytesPerElement;
- values[3] = CFNumberCreate(0, kCFNumberIntType, &bytesPerElement);
- keys[4] = kIOSurfaceBytesPerRow;
- values[4] = CFNumberCreate(0, kCFNumberLongType, &bytesPerRow);
- keys[5] = kIOSurfaceAllocSize;
- values[5] = CFNumberCreate(0, kCFNumberLongType, &allocSize);
- keys[6] = kIOSurfaceIsGlobal;
- values[6] = (flags & GraphicsSurface::SupportsSharing) ? kCFBooleanTrue : kCFBooleanFalse;
-
- CFDictionaryRef dict = CFDictionaryCreate(0, keys, values, 7, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
- for (unsigned i = 0; i < 7; i++)
- CFRelease(values[i]);
-
RefPtr<GraphicsSurface> surface = adoptRef(new GraphicsSurface(size, flags));
- surface->m_platformSurface = IOSurfaceCreate(dict);
- if (!surface->m_platformSurface)
+ surface->m_private = new GraphicsSurfacePrivate(size, flags);
+
+ if (!surface->m_private->frontBuffer() || !surface->m_private->backBuffer())
return PassRefPtr<GraphicsSurface>();
+
return surface;
}
-PassRefPtr<GraphicsSurface> GraphicsSurface::platformImport(const IntSize& size, Flags flags, uint32_t token)
+PassRefPtr<GraphicsSurface> GraphicsSurface::platformImport(const IntSize& size, Flags flags, uint64_t token)
{
// We currently disable support for CopyToTexture on Mac, because this is used for single buffered Tiles.
// The single buffered nature of this requires a call to glFlush, as described in platformCopyToTexture.
// This call blocks the GPU for about 40ms, which makes smooth animations impossible.
- if (flags & SupportsCopyToTexture)
+ if (flags & SupportsCopyToTexture || flags & SupportsSingleBuffered)
return PassRefPtr<GraphicsSurface>();
RefPtr<GraphicsSurface> surface = adoptRef(new GraphicsSurface(size, flags));
- surface->m_platformSurface = IOSurfaceLookup(token);
- if (!surface->m_platformSurface)
+ surface->m_private = new GraphicsSurfacePrivate(token);
+
+ if (!surface->m_private->frontBuffer() || !surface->m_private->backBuffer())
return PassRefPtr<GraphicsSurface>();
+
return surface;
}
@@ -191,38 +292,42 @@ static int ioSurfaceLockOptions(int lockOptions)
options |= kIOSurfaceLockReadOnly;
if (!(lockOptions & GraphicsSurface::RetainPixels))
options |= kIOSurfaceLockAvoidSync;
+
return options;
}
char* GraphicsSurface::platformLock(const IntRect& rect, int* outputStride, LockOptions lockOptions)
{
+ // Locking is only necessary for single buffered use.
+ // In this case we only have a front buffer, so we only lock this one.
m_lockOptions = lockOptions;
- IOReturn status = IOSurfaceLock(m_platformSurface, ioSurfaceLockOptions(m_lockOptions), 0);
+ IOReturn status = IOSurfaceLock(m_private->frontBuffer(), ioSurfaceLockOptions(m_lockOptions), 0);
if (status == kIOReturnCannotLock) {
m_lockOptions |= RetainPixels;
- IOSurfaceLock(m_platformSurface, ioSurfaceLockOptions(m_lockOptions), 0);
+ IOSurfaceLock(m_private->frontBuffer(), ioSurfaceLockOptions(m_lockOptions), 0);
}
- int stride = IOSurfaceGetBytesPerRow(m_platformSurface);
+ int stride = IOSurfaceGetBytesPerRow(m_private->frontBuffer());
if (outputStride)
*outputStride = stride;
- char* base = static_cast<char*>(IOSurfaceGetBaseAddress(m_platformSurface));
+ char* base = static_cast<char*>(IOSurfaceGetBaseAddress(m_private->frontBuffer()));
+
return base + stride * rect.y() + rect.x() * 4;
}
void GraphicsSurface::platformUnlock()
{
- IOSurfaceUnlock(m_platformSurface, ioSurfaceLockOptions(m_lockOptions), 0);
+ IOSurfaceUnlock(m_private->frontBuffer(), ioSurfaceLockOptions(m_lockOptions), 0);
}
void GraphicsSurface::platformDestroy()
{
if (m_fbo)
glDeleteFramebuffers(1, &m_fbo);
- if (m_texture)
- glDeleteTextures(1, &m_texture);
- CFRelease(IOSurfaceRef(m_platformSurface));
+ if (m_private)
+ delete m_private;
+ m_private = 0;
}
}
diff --git a/Source/WebCore/platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp b/Source/WebCore/platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp
index afc3a84f2..eabb52972 100644
--- a/Source/WebCore/platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp
+++ b/Source/WebCore/platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp
@@ -60,6 +60,7 @@ public:
XChangeWindowAttributes(dpy, window->handle()->winId(), X11OverrideRedirect, &attributes);
window->show();
}
+
return window;
}
@@ -173,6 +174,12 @@ struct GraphicsSurfacePrivate {
void swapBuffers()
{
+ // If there is a xpixmap, we are on the reading side and do not want to swap any buffers.
+ // The buffers are being switched on the writing side, the reading side just reads
+ // whatever texture the XWindow contains.
+ if (m_xPixmap)
+ return;
+
if (!m_surface->isVisible())
return;
@@ -182,8 +189,13 @@ struct GraphicsSurfacePrivate {
QCoreApplication::processEvents();
QOpenGLContext* glContext = QOpenGLContext::currentContext();
- if (m_surface && glContext)
+ if (m_surface && glContext) {
+ GLint oldFBO;
+ glGetIntegerv(GL_FRAMEBUFFER_BINDING, &oldFBO);
+ pGlBindFramebuffer(GL_FRAMEBUFFER, glContext->defaultFramebufferObject());
glContext->swapBuffers(m_surface.get());
+ pGlBindFramebuffer(GL_FRAMEBUFFER, oldFBO);
+ }
}
@@ -224,22 +236,22 @@ static bool resolveGLMethods(GraphicsSurfacePrivate* p)
return resolved;
}
-uint32_t GraphicsSurface::platformExport()
+uint64_t GraphicsSurface::platformExport()
{
return m_platformSurface;
}
uint32_t GraphicsSurface::platformGetTextureID()
{
- if (!m_texture)
+ if (!m_texture) {
glGenTextures(1, &m_texture);
-
- glBindTexture(GL_TEXTURE_2D, m_texture);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- pGlXBindTexImageEXT(m_private->display(), m_private->glxPixmap(), GLX_FRONT_EXT, 0);
+ glBindTexture(GL_TEXTURE_2D, m_texture);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ pGlXBindTexImageEXT(m_private->display(), m_private->glxPixmap(), GLX_FRONT_EXT, 0);
+ }
return m_texture;
}
@@ -263,14 +275,25 @@ void GraphicsSurface::platformCopyFromFramebuffer(uint32_t originFbo, const IntR
pGlBlitFramebuffer(0, 0, width, height, 0, 0, width, height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
pGlBindFramebuffer(GL_FRAMEBUFFER, oldFBO);
glPopAttrib();
+}
+uint32_t GraphicsSurface::platformFrontBuffer() const
+{
+ return 0;
+}
+
+uint32_t GraphicsSurface::platformSwapBuffers()
+{
m_private->swapBuffers();
+ return 0;
}
PassRefPtr<GraphicsSurface> GraphicsSurface::platformCreate(const IntSize& size, Flags flags)
{
// X11 does not support CopyToTexture, so we do not create a GraphicsSurface if this is requested.
- if (flags & SupportsCopyToTexture)
+ // GraphicsSurfaceGLX uses an XWindow as native surface. This one always has a front and a back buffer.
+ // Therefore single buffered GraphicsSurfaces are not supported.
+ if (flags & SupportsCopyToTexture || flags & SupportsSingleBuffered)
return PassRefPtr<GraphicsSurface>();
RefPtr<GraphicsSurface> surface = adoptRef(new GraphicsSurface(size, flags));
@@ -284,10 +307,12 @@ PassRefPtr<GraphicsSurface> GraphicsSurface::platformCreate(const IntSize& size,
return surface;
}
-PassRefPtr<GraphicsSurface> GraphicsSurface::platformImport(const IntSize& size, Flags flags, uint32_t token)
+PassRefPtr<GraphicsSurface> GraphicsSurface::platformImport(const IntSize& size, Flags flags, uint64_t token)
{
// X11 does not support CopyToTexture, so we do not create a GraphicsSurface if this is requested.
- if (flags & SupportsCopyToTexture)
+ // GraphicsSurfaceGLX uses an XWindow as native surface. This one always has a front and a back buffer.
+ // Therefore single buffered GraphicsSurfaces are not supported.
+ if (flags & SupportsCopyToTexture || flags & SupportsSingleBuffered)
return PassRefPtr<GraphicsSurface>();
RefPtr<GraphicsSurface> surface = adoptRef(new GraphicsSurface(size, flags));
diff --git a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
index f2051ecb6..f3b0eb411 100644
--- a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
+++ b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
@@ -84,8 +84,6 @@ void GraphicsLayerTextureMapper::setNeedsDisplay()
*/
void GraphicsLayerTextureMapper::setContentsNeedsDisplay()
{
- if (m_image)
- setContentsToImage(m_image.get());
notifyChange(TextureMapperLayer::DisplayChange);
}
@@ -325,14 +323,21 @@ void GraphicsLayerTextureMapper::setContentsRect(const IntRect& value)
*/
void GraphicsLayerTextureMapper::setContentsToImage(Image* image)
{
- if (image == m_image)
- return;
-
- m_image = image;
- if (m_image) {
- RefPtr<TextureMapperTiledBackingStore> backingStore = TextureMapperTiledBackingStore::create();
- backingStore->setContentsToImage(image);
- m_compositedImage = backingStore;
+ if (image) {
+ // Make the decision about whether the image has changed.
+ // This code makes the assumption that pointer equality on a NativeImagePtr is a valid way to tell if the image is changed.
+ // This assumption is true in Qt, GTK and EFL.
+ NativeImagePtr newNativeImagePtr = image->nativeImageForCurrentFrame();
+ if (!newNativeImagePtr)
+ return;
+
+ if (newNativeImagePtr == m_compositedNativeImagePtr)
+ return;
+
+ m_compositedNativeImagePtr = newNativeImagePtr;
+ if (!m_compositedImage)
+ m_compositedImage = TextureMapperTiledBackingStore::create();
+ m_compositedImage->setContentsToImage(image);
} else
m_compositedImage = 0;
diff --git a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
index c4d42f1fc..50070cc0f 100644
--- a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
+++ b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
@@ -100,8 +100,8 @@ private:
virtual void willBeDestroyed();
OwnPtr<TextureMapperLayer> m_layer;
- RefPtr<TextureMapperBackingStore> m_compositedImage;
- RefPtr<Image> m_image;
+ RefPtr<TextureMapperTiledBackingStore> m_compositedImage;
+ NativeImagePtr m_compositedNativeImagePtr;
int m_changeMask;
bool m_needsDisplay;
bool m_fixedToViewport;
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp
index 8d60c7b5e..6d6f1c7f5 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp
@@ -34,16 +34,19 @@
namespace WebCore {
#if USE(GRAPHICS_SURFACE)
-void TextureMapperSurfaceBackingStore::setGraphicsSurface(uint32_t graphicsSurfaceToken, const IntSize& surfaceSize)
+void TextureMapperSurfaceBackingStore::setGraphicsSurface(uint64_t graphicsSurfaceToken, const IntSize& surfaceSize, uint32_t frontBuffer)
{
- if (graphicsSurfaceToken != m_backBufferGraphicsSurfaceData.m_graphicsSurfaceToken) {
+ if (graphicsSurfaceToken != m_graphicsSurfaceToken) {
GraphicsSurface::Flags surfaceFlags = GraphicsSurface::SupportsTextureTarget
| GraphicsSurface::SupportsSharing;
- m_backBufferGraphicsSurfaceData.setSurface(GraphicsSurface::create(surfaceSize, surfaceFlags, graphicsSurfaceToken));
+ setSurface(GraphicsSurface::create(surfaceSize, surfaceFlags, graphicsSurfaceToken));
m_graphicsSurfaceSize = surfaceSize;
}
- std::swap(m_backBufferGraphicsSurfaceData, m_frontBufferGraphicsSurfaceData);
+ RefPtr<WebCore::GraphicsSurface> surface = graphicsSurface();
+ if (surface->frontBuffer() != frontBuffer)
+ surface->swapBuffers();
+
}
PassRefPtr<BitmapTexture> TextureMapperSurfaceBackingStore::texture() const
@@ -59,13 +62,22 @@ void TextureMapperSurfaceBackingStore::paintToTextureMapper(TextureMapper* textu
adjustedTransform.multiply(TransformationMatrix::rectToRect(FloatRect(FloatPoint::zero(), m_graphicsSurfaceSize), targetRect));
#if OS(DARWIN)
// This is specific to the Mac implementation of GraphicsSurface. IOSurface requires GL_TEXTURE_RECTANGLE_ARB to be used.
- static_cast<TextureMapperGL*>(textureMapper)->drawTextureRectangleARB(m_frontBufferGraphicsSurfaceData.m_textureID, 0, m_graphicsSurfaceSize, targetRect, adjustedTransform, opacity, mask);
+ static_cast<TextureMapperGL*>(textureMapper)->drawTextureRectangleARB(m_graphicsSurface->getTextureID(), 0, m_graphicsSurfaceSize, targetRect, adjustedTransform, opacity, mask);
#else
- UNUSED_PARAM(textureMapper);
- UNUSED_PARAM(opacity);
- UNUSED_PARAM(mask);
+ static_cast<TextureMapperGL*>(textureMapper)->drawTexture(m_graphicsSurface->getTextureID(), 0, m_graphicsSurfaceSize, targetRect, adjustedTransform, opacity, mask);
#endif
}
+
+void TextureMapperSurfaceBackingStore::setSurface(PassRefPtr<GraphicsSurface> surface)
+{
+ if (surface) {
+ m_graphicsSurface = surface;
+ m_graphicsSurfaceToken = m_graphicsSurface->exportToken();
+ } else {
+ m_graphicsSurface = RefPtr<GraphicsSurface>();
+ m_graphicsSurfaceToken = 0;
+ }
+}
#endif
void TextureMapperTile::updateContents(TextureMapper* textureMapper, Image* image, const IntRect& dirtyRect)
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h b/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h
index 4123066b8..9d002b48e 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h
@@ -47,35 +47,27 @@ protected:
};
#if USE(GRAPHICS_SURFACE)
-struct GraphicsSurfaceData {
- void setSurface(PassRefPtr<GraphicsSurface> surface)
- {
- m_graphicsSurface = surface;
- m_graphicsSurfaceToken = m_graphicsSurface->exportToken();
- m_textureID = m_graphicsSurface->getTextureID();
- }
-
- GraphicsSurfaceData()
- : m_textureID(0)
- , m_graphicsSurfaceToken(0)
- { }
-
- uint32_t m_textureID;
- uint32_t m_graphicsSurfaceToken;
- RefPtr<WebCore::GraphicsSurface> m_graphicsSurface;
-};
-
class TextureMapperSurfaceBackingStore : public TextureMapperBackingStore {
public:
static PassRefPtr<TextureMapperSurfaceBackingStore> create() { return adoptRef(new TextureMapperSurfaceBackingStore); }
- void setGraphicsSurface(uint32_t graphicsSurfaceToken, const IntSize& surfaceSize);
+ void setGraphicsSurface(uint64_t graphicsSurfaceToken, const IntSize& surfaceSize, uint32_t frontBuffer);
+ PassRefPtr<WebCore::GraphicsSurface> graphicsSurface() const { return m_graphicsSurface; }
virtual PassRefPtr<BitmapTexture> texture() const;
virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix&, float, BitmapTexture*);
virtual ~TextureMapperSurfaceBackingStore() { }
+
+protected:
+ void setSurface(PassRefPtr<GraphicsSurface>);
+
private:
+ TextureMapperSurfaceBackingStore()
+ : TextureMapperBackingStore()
+ , m_graphicsSurfaceToken(0)
+ { }
+
+ uint64_t m_graphicsSurfaceToken;
+ RefPtr<WebCore::GraphicsSurface> m_graphicsSurface;
IntSize m_graphicsSurfaceSize;
- GraphicsSurfaceData m_frontBufferGraphicsSurfaceData;
- GraphicsSurfaceData m_backBufferGraphicsSurfaceData;
};
#endif
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
index c6b1e2825..a22e720e1 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
@@ -264,7 +264,6 @@ void TextureMapperGL::beginPainting(PaintFlags flags)
GL_CMD(glDepthMask(0));
GL_CMD(glGetIntegerv(GL_VIEWPORT, data().viewport));
GL_CMD(glGetIntegerv(GL_SCISSOR_BOX, data().previousScissor));
- glGetIntegerv(GL_FRAMEBUFFER_BINDING, &data().targetFrameBuffer);
m_clipStack.init(IntRect(0, 0, data().viewport[2], data().viewport[3]));
GL_CMD(glGetIntegerv(GL_FRAMEBUFFER_BINDING, &data().targetFrameBuffer));
data().PaintFlags = flags;
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h b/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h
index 9614c8913..2292f4eb4 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h
@@ -34,6 +34,7 @@ public:
virtual void swapBuffers() { }
#if USE(GRAPHICS_SURFACE)
virtual uint32_t copyToGraphicsSurface() { return 0; }
+ virtual uint64_t graphicsSurfaceToken() const { return 0; }
#endif
};
diff --git a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h b/Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h
index e07bbacfa..2622fbad4 100644
--- a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h
+++ b/Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h
@@ -26,19 +26,15 @@
#ifndef MediaPlayerPrivateFullscreenWindow_h
#define MediaPlayerPrivateFullscreenWindow_h
+#if OS(WINDOWS)
+#include "WindowsExtras.h"
+#endif
#include <wtf/RefPtr.h>
#if USE(ACCELERATED_COMPOSITING)
#include "CACFLayerTreeHostClient.h"
#endif
-typedef unsigned WPARAM;
-typedef long LPARAM;
-typedef struct HWND__* HWND;
-typedef _W64 long LONG_PTR;
-typedef LONG_PTR LRESULT;
-typedef unsigned int UINT;
-
namespace WebCore {
#if USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp b/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp
index 43ef518de..72bc7d0c1 100644
--- a/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp
+++ b/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp
@@ -32,12 +32,9 @@
#include "BMPImageDecoder.h"
#include "BMPImageReader.h"
+#include "PlatformInstrumentation.h"
#include <wtf/PassOwnPtr.h>
-#if PLATFORM(CHROMIUM)
-#include "TraceEvent.h"
-#endif
-
namespace WebCore {
// Number of bits in .BMP used to store the file header (doesn't match
@@ -81,8 +78,11 @@ ImageFrame* BMPImageDecoder::frameBufferAtIndex(size_t index)
}
ImageFrame* buffer = &m_frameBufferCache.first();
- if (buffer->status() != ImageFrame::FrameComplete)
+ if (buffer->status() != ImageFrame::FrameComplete) {
+ PlatformInstrumentation::willDecodeImage("BMP");
decode(false);
+ PlatformInstrumentation::didDecodeImage();
+ }
return buffer;
}
@@ -94,9 +94,6 @@ bool BMPImageDecoder::setFailed()
void BMPImageDecoder::decode(bool onlySize)
{
-#if PLATFORM(CHROMIUM)
- TRACE_EVENT0("webkit", "BMPImageDecoder::decode");
-#endif
if (failed())
return;
diff --git a/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp b/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
index 724ea0d13..40e131e7c 100644
--- a/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
+++ b/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
@@ -27,12 +27,9 @@
#include "GIFImageDecoder.h"
#include "GIFImageReader.h"
+#include "PlatformInstrumentation.h"
#include <wtf/PassOwnPtr.h>
-#if PLATFORM(CHROMIUM)
-#include "TraceEvent.h"
-#endif
-
namespace WebCore {
GIFImageDecoder::GIFImageDecoder(ImageSource::AlphaOption alphaOption,
@@ -130,8 +127,11 @@ ImageFrame* GIFImageDecoder::frameBufferAtIndex(size_t index)
return 0;
ImageFrame& frame = m_frameBufferCache[index];
- if (frame.status() != ImageFrame::FrameComplete)
+ if (frame.status() != ImageFrame::FrameComplete) {
+ PlatformInstrumentation::willDecodeImage("GIF");
decode(index + 1, GIFFullQuery);
+ PlatformInstrumentation::didDecodeImage();
+ }
return &frame;
}
@@ -314,9 +314,6 @@ void GIFImageDecoder::gifComplete()
void GIFImageDecoder::decode(unsigned haltAtFrame, GIFQuery query)
{
-#if PLATFORM(CHROMIUM)
- TRACE_EVENT0("webkit", "GIFImageDecoder::decode");
-#endif
if (failed())
return;
diff --git a/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp b/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
index 36dde1cdd..2db3ecf6c 100644
--- a/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
+++ b/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
@@ -35,12 +35,9 @@
#include "BMPImageReader.h"
#include "PNGImageDecoder.h"
+#include "PlatformInstrumentation.h"
#include <wtf/PassOwnPtr.h>
-#if PLATFORM(CHROMIUM)
-#include "TraceEvent.h"
-#endif
-
namespace WebCore {
// Number of bits in .ICO/.CUR used to store the directory and its entries,
@@ -121,8 +118,11 @@ ImageFrame* ICOImageDecoder::frameBufferAtIndex(size_t index)
return 0;
ImageFrame* buffer = &m_frameBufferCache[index];
- if (buffer->status() != ImageFrame::FrameComplete)
+ if (buffer->status() != ImageFrame::FrameComplete) {
+ PlatformInstrumentation::willDecodeImage("ICO");
decode(index, false);
+ PlatformInstrumentation::didDecodeImage();
+ }
return buffer;
}
@@ -157,9 +157,6 @@ void ICOImageDecoder::setDataForPNGDecoderAtIndex(size_t index)
void ICOImageDecoder::decode(size_t index, bool onlySize)
{
-#if PLATFORM(CHROMIUM)
- TRACE_EVENT0("webkit", "ICOImageDecoder::decode");
-#endif
if (failed())
return;
diff --git a/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
index bef4203a5..275ffc059 100644
--- a/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ b/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -39,13 +39,10 @@
#include "config.h"
#include "JPEGImageDecoder.h"
+#include "PlatformInstrumentation.h"
#include <stdio.h> // Needed by jpeglib.h for FILE.
#include <wtf/PassOwnPtr.h>
-#if PLATFORM(CHROMIUM)
-#include "TraceEvent.h"
-#endif
-
#if OS(WINCE)
// Remove warning: 'FAR' macro redefinition
#undef FAR
@@ -540,8 +537,11 @@ ImageFrame* JPEGImageDecoder::frameBufferAtIndex(size_t index)
}
ImageFrame& frame = m_frameBufferCache[0];
- if (frame.status() != ImageFrame::FrameComplete)
+ if (frame.status() != ImageFrame::FrameComplete) {
+ PlatformInstrumentation::willDecodeImage("JPEG");
decode(false);
+ PlatformInstrumentation::didDecodeImage();
+ }
return &frame;
}
@@ -647,9 +647,6 @@ void JPEGImageDecoder::jpegComplete()
void JPEGImageDecoder::decode(bool onlySize)
{
-#if PLATFORM(CHROMIUM)
- TRACE_EVENT0("webkit", "JPEGImageDecoder::decode");
-#endif
if (failed())
return;
diff --git a/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp b/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
index 158debb5a..851b6f914 100644
--- a/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
+++ b/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
@@ -40,14 +40,11 @@
#include "config.h"
#include "PNGImageDecoder.h"
+#include "PlatformInstrumentation.h"
#include "png.h"
#include <wtf/OwnArrayPtr.h>
#include <wtf/PassOwnPtr.h>
-#if PLATFORM(CHROMIUM)
-#include "TraceEvent.h"
-#endif
-
#if USE(QCMSLIB)
#include "qcms.h"
#endif
@@ -261,8 +258,11 @@ ImageFrame* PNGImageDecoder::frameBufferAtIndex(size_t index)
}
ImageFrame& frame = m_frameBufferCache[0];
- if (frame.status() != ImageFrame::FrameComplete)
+ if (frame.status() != ImageFrame::FrameComplete) {
+ PlatformInstrumentation::willDecodeImage("PNG");
decode(false);
+ PlatformInstrumentation::didDecodeImage();
+ }
return &frame;
}
@@ -530,9 +530,6 @@ void PNGImageDecoder::pngComplete()
void PNGImageDecoder::decode(bool onlySize)
{
-#if PLATFORM(CHROMIUM)
- TRACE_EVENT0("webkit", "PNGImageDecoder::decode");
-#endif
if (failed())
return;
diff --git a/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp b/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp
index 612890f31..07ddf7049 100644
--- a/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp
+++ b/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -31,18 +31,21 @@
#if USE(WEBP)
+#include "PlatformInstrumentation.h"
#include "webp/decode.h"
-#if PLATFORM(CHROMIUM)
-#include "TraceEvent.h"
+// backward emulation for earlier versions than 0.1.99
+#if (WEBP_DECODER_ABI_VERSION < 0x0163)
+#define MODE_rgbA MODE_RGBA
+#define MODE_bgrA MODE_BGRA
#endif
#if CPU(BIG_ENDIAN) || CPU(MIDDLE_ENDIAN)
-inline WEBP_CSP_MODE outputMode() { return MODE_RGBA; }
+inline WEBP_CSP_MODE outputMode(bool hasAlpha) { return hasAlpha ? MODE_rgbA : MODE_RGBA; }
#elif USE(SKIA) && SK_B32_SHIFT
-inline WEBP_CSP_MODE outputMode() { return MODE_RGBA; }
+inline WEBP_CSP_MODE outputMode(bool hasAlpha) { return hasAlpha ? MODE_rgbA : MODE_RGBA; }
#else // LITTLE_ENDIAN, output BGRA pixels.
-inline WEBP_CSP_MODE outputMode() { return MODE_BGRA; }
+inline WEBP_CSP_MODE outputMode(bool hasAlpha) { return hasAlpha ? MODE_bgrA : MODE_BGRA; }
#endif
namespace WebCore {
@@ -51,6 +54,7 @@ WEBPImageDecoder::WEBPImageDecoder(ImageSource::AlphaOption alphaOption,
ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption)
: ImageDecoder(alphaOption, gammaAndColorProfileOption)
, m_decoder(0)
+ , m_hasAlpha(false)
{
}
@@ -80,16 +84,16 @@ ImageFrame* WEBPImageDecoder::frameBufferAtIndex(size_t index)
}
ImageFrame& frame = m_frameBufferCache[0];
- if (frame.status() != ImageFrame::FrameComplete)
+ if (frame.status() != ImageFrame::FrameComplete) {
+ PlatformInstrumentation::willDecodeImage("WEBP");
decode(false);
+ PlatformInstrumentation::didDecodeImage();
+ }
return &frame;
}
bool WEBPImageDecoder::decode(bool onlySize)
{
-#if PLATFORM(CHROMIUM)
- TRACE_EVENT0("webkit", "WEBPImageDecoder::decode");
-#endif
if (failed())
return false;
@@ -101,8 +105,19 @@ bool WEBPImageDecoder::decode(bool onlySize)
if (dataSize < imageHeaderSize)
return false;
int width, height;
+#if (WEBP_DECODER_ABI_VERSION >= 0x0163)
+ WebPBitstreamFeatures features;
+ if (WebPGetFeatures(dataBytes, dataSize, &features) != VP8_STATUS_OK)
+ return setFailed();
+ width = features.width;
+ height = features.height;
+ m_hasAlpha = features.has_alpha;
+#else
+ // Earlier version won't be able to display WebP files with alpha.
if (!WebPGetInfo(dataBytes, dataSize, &width, &height))
return setFailed();
+ m_hasAlpha = false;
+#endif
if (!setSize(width, height))
return setFailed();
}
@@ -119,7 +134,7 @@ bool WEBPImageDecoder::decode(bool onlySize)
if (!buffer.setSize(size().width(), size().height()))
return setFailed();
buffer.setStatus(ImageFrame::FramePartial);
- buffer.setHasAlpha(false); // FIXME: webp does not support alpha yet.
+ buffer.setHasAlpha(m_hasAlpha);
buffer.setOriginalFrameRect(IntRect(IntPoint(), size()));
}
@@ -127,7 +142,7 @@ bool WEBPImageDecoder::decode(bool onlySize)
int rowStride = size().width() * sizeof(ImageFrame::PixelData);
uint8_t* output = reinterpret_cast<uint8_t*>(buffer.getAddr(0, 0));
int outputSize = size().height() * rowStride;
- m_decoder = WebPINewRGB(outputMode(), output, outputSize, rowStride);
+ m_decoder = WebPINewRGB(outputMode(m_hasAlpha), output, outputSize, rowStride);
if (!m_decoder)
return setFailed();
}
diff --git a/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h b/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h
index 61ea13953..646647a5c 100644
--- a/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h
+++ b/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h
@@ -50,6 +50,7 @@ private:
bool decode(bool onlySize);
WebPIDecoder* m_decoder;
+ bool m_hasAlpha;
};
} // namespace WebCore
diff --git a/Source/WebCore/platform/mac/ThemeMac.mm b/Source/WebCore/platform/mac/ThemeMac.mm
index 34a9cff3f..7a4f945cd 100644
--- a/Source/WebCore/platform/mac/ThemeMac.mm
+++ b/Source/WebCore/platform/mac/ThemeMac.mm
@@ -552,19 +552,23 @@ static void paintStepper(ControlStates states, GraphicsContext* context, const I
int heightDiff = clampToInteger(bounds.size.height - backgroundBounds.size.height);
backgroundBounds.origin.y = bounds.origin.y + (heightDiff / 2) + 1;
}
- HIThemeDrawButton(&backgroundBounds, &drawInfo, context->platformContext(), kHIThemeOrientationNormal, 0);
+
+ LocalCurrentGraphicsContext localContext(context);
+ HIThemeDrawButton(&backgroundBounds, &drawInfo, localContext.cgContext(), kHIThemeOrientationNormal, 0);
}
// This will ensure that we always return a valid NSView, even if ScrollView doesn't have an associated document NSView.
// If the ScrollView doesn't have an NSView, we will return a fake NSView whose sole purpose is to tell AppKit that it's flipped.
NSView *ThemeMac::ensuredView(ScrollView* scrollView)
{
+#if !PLATFORM(CHROMIUM)
if (NSView *documentView = scrollView->documentView())
return documentView;
+#endif
// Use a fake flipped view.
static NSView *flippedView = [[WebCoreFlippedView alloc] init];
- [flippedView setFrameSize:scrollView->contentsSize()];
+ [flippedView setFrameSize:NSSizeFromCGSize(scrollView->contentsSize())];
return flippedView;
}
diff --git a/Source/WebCore/platform/network/BlobData.cpp b/Source/WebCore/platform/network/BlobData.cpp
index a1cc3130c..f2044fba2 100644
--- a/Source/WebCore/platform/network/BlobData.cpp
+++ b/Source/WebCore/platform/network/BlobData.cpp
@@ -89,6 +89,13 @@ void BlobData::appendBlob(const KURL& url, long long offset, long long length)
m_items.append(BlobDataItem(url, offset, length));
}
+#if ENABLE(FILE_SYSTEM)
+void BlobData::appendURL(const KURL& url, long long offset, long long length, double expectedModificationTime)
+{
+ m_items.append(BlobDataItem(url, offset, length, expectedModificationTime));
+}
+#endif
+
void BlobData::swapItems(BlobDataItemList& items)
{
m_items.swap(items);
diff --git a/Source/WebCore/platform/network/BlobData.h b/Source/WebCore/platform/network/BlobData.h
index 5195cc95c..b35d25cf7 100644
--- a/Source/WebCore/platform/network/BlobData.h
+++ b/Source/WebCore/platform/network/BlobData.h
@@ -110,10 +110,29 @@ struct BlobDataItem {
{
}
+#if ENABLE(FILE_SYSTEM)
+ // Constructor for URL type (e.g. FileSystem files).
+ BlobDataItem(const KURL& url, long long offset, long long length, double expectedModificationTime)
+ : type(URL)
+ , url(url)
+ , offset(offset)
+ , length(length)
+ , expectedModificationTime(expectedModificationTime)
+ {
+ }
+#endif
+
// Detaches from current thread so that it can be passed to another thread.
void detachFromCurrentThread();
- enum { Data, File, Blob } type;
+ enum {
+ Data,
+ File,
+ Blob
+#if ENABLE(FILE_SYSTEM)
+ , URL
+#endif
+ } type;
// For Data type.
RefPtr<RawData> data;
@@ -121,7 +140,7 @@ struct BlobDataItem {
// For File type.
String path;
- // For Blob type.
+ // For Blob or URL type.
KURL url;
long long offset;
@@ -165,6 +184,9 @@ public:
void appendFile(const String& path);
void appendFile(const String& path, long long offset, long long length, double expectedModificationTime);
void appendBlob(const KURL&, long long offset, long long length);
+#if ENABLE(FILE_SYSTEM)
+ void appendURL(const KURL&, long long offset, long long length, double expectedModificationTime);
+#endif
private:
friend class BlobRegistryImpl;
diff --git a/Source/WebCore/platform/network/BlobRegistryImpl.cpp b/Source/WebCore/platform/network/BlobRegistryImpl.cpp
index 59a9a9c60..c2590149e 100644
--- a/Source/WebCore/platform/network/BlobRegistryImpl.cpp
+++ b/Source/WebCore/platform/network/BlobRegistryImpl.cpp
@@ -107,6 +107,10 @@ void BlobRegistryImpl::appendStorageItems(BlobStorageData* blobStorageData, cons
for (BlobDataItemList::const_iterator iter = items.begin(); iter != items.end(); ++iter) {
if (iter->type == BlobDataItem::Data)
blobStorageData->m_data.appendData(iter->data, iter->offset, iter->length);
+#if ENABLE(FILE_SYSTEM)
+ else if (iter->type == BlobDataItem::URL)
+ blobStorageData->m_data.appendURL(iter->url, iter->offset, iter->length, iter->expectedModificationTime);
+#endif
else {
ASSERT(iter->type == BlobDataItem::File);
blobStorageData->m_data.appendFile(iter->path, iter->offset, iter->length, iter->expectedModificationTime);
@@ -133,6 +137,10 @@ void BlobRegistryImpl::appendStorageItems(BlobStorageData* blobStorageData, cons
long long newLength = currentLength > length ? length : currentLength;
if (iter->type == BlobDataItem::Data)
blobStorageData->m_data.appendData(iter->data, iter->offset + offset, newLength);
+#if ENABLE(FILE_SYSTEM)
+ else if (iter->type == BlobDataItem::URL)
+ blobStorageData->m_data.appendURL(iter->url, iter->offset + offset, newLength, iter->expectedModificationTime);
+#endif
else {
ASSERT(iter->type == BlobDataItem::File);
blobStorageData->m_data.appendFile(iter->path, iter->offset + offset, newLength, iter->expectedModificationTime);
@@ -152,6 +160,7 @@ void BlobRegistryImpl::registerBlobURL(const KURL& url, PassOwnPtr<BlobData> blo
// The blob data is stored in the "canonical" way. That is, it only contains a list of Data and File items.
// 1) The Data item is denoted by the raw data and the range.
// 2) The File item is denoted by the file path, the range and the expected modification time.
+ // 3) The URL item is denoted by the URL, the range and the expected modification time.
// All the Blob items in the passing blob data are resolved and expanded into a set of Data and File items.
for (BlobDataItemList::const_iterator iter = blobData->items().begin(); iter != blobData->items().end(); ++iter) {
@@ -162,6 +171,11 @@ void BlobRegistryImpl::registerBlobURL(const KURL& url, PassOwnPtr<BlobData> blo
case BlobDataItem::File:
blobStorageData->m_data.appendFile(iter->path, iter->offset, iter->length, iter->expectedModificationTime);
break;
+#if ENABLE(FILE_SYSTEM)
+ case BlobDataItem::URL:
+ blobStorageData->m_data.appendURL(iter->url, iter->offset, iter->length, iter->expectedModificationTime);
+ break;
+#endif
case BlobDataItem::Blob:
if (m_blobs.contains(iter->url.string()))
appendStorageItems(blobStorageData.get(), m_blobs.get(iter->url.string())->items(), iter->offset, iter->length);
diff --git a/Source/WebCore/platform/network/FormData.cpp b/Source/WebCore/platform/network/FormData.cpp
index 5f5b5dfd4..9c3c8c3ac 100644
--- a/Source/WebCore/platform/network/FormData.cpp
+++ b/Source/WebCore/platform/network/FormData.cpp
@@ -32,6 +32,7 @@
#include "FormDataBuilder.h"
#include "FormDataList.h"
#include "MIMETypeRegistry.h"
+#include "MemoryInstrumentation.h"
#include "Page.h"
#include "TextEncoding.h"
#include <wtf/Decoder.h>
@@ -143,7 +144,12 @@ PassRefPtr<FormData> FormData::deepCopy() const
break;
#if ENABLE(BLOB)
case FormDataElement::encodedBlob:
- formData->m_elements.append(FormDataElement(e.m_blobURL));
+ formData->m_elements.append(FormDataElement(e.m_url));
+ break;
+#endif
+#if ENABLE(FILE_SYSTEM)
+ case FormDataElement::encodedURL:
+ formData->m_elements.append(FormDataElement(e.m_url, e.m_fileStart, e.m_fileLength, e.m_expectedFileModificationTime));
break;
#endif
}
@@ -181,6 +187,17 @@ void FormData::appendBlob(const KURL& blobURL)
m_elements.append(FormDataElement(blobURL));
}
#endif
+#if ENABLE(FILE_SYSTEM)
+void FormData::appendURL(const KURL& url)
+{
+ m_elements.append(FormDataElement(url, 0, BlobDataItem::toEndOfFile, invalidFileTime()));
+}
+
+void FormData::appendURLRange(const KURL& url, long long start, long long length, double expectedModificationTime)
+{
+ m_elements.append(FormDataElement(url, start, length, expectedModificationTime));
+}
+#endif
void FormData::appendKeyValuePairItems(const FormDataList& list, const TextEncoding& encoding, bool isMultiPartForm, Document* document, EncodingType encodingType)
{
@@ -252,6 +269,10 @@ void FormData::appendKeyValuePairItems(const FormDataList& list, const TextEncod
// Do not add the file if the path is empty.
if (!file->path().isEmpty())
appendFile(file->path(), shouldGenerateFile);
+#if ENABLE(FILE_SYSTEM)
+ if (!file->fileSystemURL().isEmpty())
+ appendURL(file->fileSystemURL());
+#endif
}
#if ENABLE(BLOB)
else
@@ -336,6 +357,12 @@ void FormData::removeGeneratedFilesIfNeeded()
m_hasGeneratedFiles = false;
}
+void FormData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+ MemoryClassInfo info(memoryObjectInfo, this, MemoryInstrumentation::Loader);
+ info.addVector(m_boundary);
+}
+
static void encode(Encoder& encoder, const FormDataElement& element)
{
encoder.encodeUInt32(element.m_type);
@@ -361,7 +388,16 @@ static void encode(Encoder& encoder, const FormDataElement& element)
#if ENABLE(BLOB)
case FormDataElement::encodedBlob:
- encoder.encodeString(element.m_blobURL.string());
+ encoder.encodeString(element.m_url.string());
+ return;
+#endif
+
+#if ENABLE(FILE_SYSTEM)
+ case FormDataElement::encodedURL:
+ encoder.encodeString(element.m_url.string());
+ encoder.encodeInt64(element.m_fileStart);
+ encoder.encodeInt64(element.m_fileLength);
+ encoder.encodeDouble(element.m_expectedFileModificationTime);
return;
#endif
}
@@ -387,11 +423,16 @@ static bool decode(Decoder& decoder, FormDataElement& element)
return true;
}
- case FormDataElement::encodedFile: {
- element.m_type = FormDataElement::encodedFile;
- if (!decoder.decodeString(element.m_filename))
+ case FormDataElement::encodedFile:
+#if ENABLE(FILE_SYSTEM)
+ case FormDataElement::encodedURL:
+#endif
+ {
+ element.m_type = static_cast<FormDataElement::Type>(type);
+ String filenameOrURL;
+ if (!decoder.decodeString(filenameOrURL))
return false;
- if (!decoder.decodeBool(element.m_shouldGenerateFile))
+ if (type == FormDataElement::encodedFile && !decoder.decodeBool(element.m_shouldGenerateFile))
return false;
int64_t fileStart;
if (!decoder.decodeInt64(fileStart))
@@ -406,6 +447,14 @@ static bool decode(Decoder& decoder, FormDataElement& element)
double expectedFileModificationTime;
if (!decoder.decodeDouble(expectedFileModificationTime))
return false;
+
+#if ENABLE(FILE_SYSTEM)
+ if (type == FormDataElement::encodedURL)
+ element.m_url = KURL(KURL(), filenameOrURL);
+ else
+#endif
+ element.m_filename = filenameOrURL;
+
#if ENABLE(BLOB)
element.m_fileStart = fileStart;
element.m_fileLength = fileLength;
@@ -420,9 +469,10 @@ static bool decode(Decoder& decoder, FormDataElement& element)
String blobURLString;
if (!decoder.decodeString(blobURLString))
return false;
- element.m_blobURL = KURL(KURL(), blobURLString);
+ element.m_url = KURL(KURL(), blobURLString);
return true;
#endif
+
}
return false;
diff --git a/Source/WebCore/platform/network/FormData.h b/Source/WebCore/platform/network/FormData.h
index 14981366b..63cadc6c1 100644
--- a/Source/WebCore/platform/network/FormData.h
+++ b/Source/WebCore/platform/network/FormData.h
@@ -30,6 +30,7 @@ namespace WebCore {
class Document;
class FormDataList;
+class MemoryObjectInfo;
class TextEncoding;
class FormDataElement {
@@ -39,25 +40,31 @@ public:
#if ENABLE(BLOB)
FormDataElement(const String& filename, long long fileStart, long long fileLength, double expectedFileModificationTime, bool shouldGenerateFile) : m_type(encodedFile), m_filename(filename), m_fileStart(fileStart), m_fileLength(fileLength), m_expectedFileModificationTime(expectedFileModificationTime), m_shouldGenerateFile(shouldGenerateFile) { }
- explicit FormDataElement(const KURL& blobURL) : m_type(encodedBlob), m_blobURL(blobURL) { }
+ explicit FormDataElement(const KURL& blobURL) : m_type(encodedBlob), m_url(blobURL) { }
#else
FormDataElement(const String& filename, bool shouldGenerateFile) : m_type(encodedFile), m_filename(filename), m_shouldGenerateFile(shouldGenerateFile) { }
#endif
+#if ENABLE(FILE_SYSTEM)
+ FormDataElement(const KURL& url, long long start, long long length, double expectedFileModificationTime) : m_type(encodedURL), m_url(url), m_fileStart(start), m_fileLength(length), m_expectedFileModificationTime(expectedFileModificationTime), m_shouldGenerateFile(false) { }
+#endif
- enum {
+ enum Type {
data,
encodedFile
#if ENABLE(BLOB)
, encodedBlob
#endif
+#if ENABLE(FILE_SYSTEM)
+ , encodedURL
+#endif
} m_type;
Vector<char> m_data;
String m_filename;
#if ENABLE(BLOB)
+ KURL m_url; // For Blob or URL.
long long m_fileStart;
long long m_fileLength;
double m_expectedFileModificationTime;
- KURL m_blobURL;
#endif
String m_generatedFilename;
bool m_shouldGenerateFile;
@@ -76,10 +83,14 @@ inline bool operator==(const FormDataElement& a, const FormDataElement& b)
#if ENABLE(BLOB)
return a.m_filename == b.m_filename && a.m_fileStart == b.m_fileStart && a.m_fileLength == b.m_fileLength && a.m_expectedFileModificationTime == b.m_expectedFileModificationTime;
if (a.m_type == FormDataElement::encodedBlob)
- return a.m_blobURL == b.m_blobURL;
+ return a.m_url == b.m_url;
#else
return a.m_filename == b.m_filename;
#endif
+#if ENABLE(FILE_SYSTEM)
+ if (a.m_type == FormDataElement::encodedURL)
+ return a.m_url == b.m_url;
+#endif
return true;
}
@@ -116,6 +127,10 @@ public:
void appendFileRange(const String& filename, long long start, long long length, double expectedModificationTime, bool shouldGenerateFile = false);
void appendBlob(const KURL& blobURL);
#endif
+#if ENABLE(FILE_SYSTEM)
+ void appendURL(const KURL&);
+ void appendURLRange(const KURL&, long long start, long long length, double expectedModificationTime);
+#endif
void flatten(Vector<char>&) const; // omits files
String flattenToString() const; // omits files
@@ -138,6 +153,8 @@ public:
bool containsPasswordData() const { return m_containsPasswordData; }
void setContainsPasswordData(bool containsPasswordData) { m_containsPasswordData = containsPasswordData; }
+ void reportMemoryUsage(MemoryObjectInfo*) const;
+
static EncodingType parseEncodingType(const String& type)
{
if (equalIgnoringCase(type, "text/plain"))
diff --git a/Source/WebCore/platform/network/ResourceRequestBase.cpp b/Source/WebCore/platform/network/ResourceRequestBase.cpp
index 350979292..a829078ae 100644
--- a/Source/WebCore/platform/network/ResourceRequestBase.cpp
+++ b/Source/WebCore/platform/network/ResourceRequestBase.cpp
@@ -24,8 +24,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
-
#include "ResourceRequestBase.h"
+
+#include "MemoryInstrumentation.h"
#include "ResourceRequest.h"
using namespace std;
@@ -443,6 +444,18 @@ bool ResourceRequestBase::isConditional() const
m_httpHeaderFields.contains("If-Unmodified-Since"));
}
+void ResourceRequestBase::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+ MemoryClassInfo info(memoryObjectInfo, this, MemoryInstrumentation::Loader);
+ info.addMember(m_url);
+ info.addMember(m_firstPartyForCookies);
+ info.addInstrumentedMember(m_httpMethod);
+ info.addHashMap(m_httpHeaderFields);
+ info.addInstrumentedMapEntries(m_httpHeaderFields);
+ info.addInstrumentedVector(m_responseContentDispositionEncodingFallbackArray);
+ info.addInstrumentedMember(m_httpBody);
+}
+
double ResourceRequestBase::defaultTimeoutInterval()
{
return s_defaultTimeoutInterval;
diff --git a/Source/WebCore/platform/network/ResourceRequestBase.h b/Source/WebCore/platform/network/ResourceRequestBase.h
index 86dd62e8e..3b700a782 100644
--- a/Source/WebCore/platform/network/ResourceRequestBase.h
+++ b/Source/WebCore/platform/network/ResourceRequestBase.h
@@ -44,6 +44,7 @@ namespace WebCore {
ReturnCacheDataDontLoad // results of a post - allow stale data and only use cache
};
+ class MemoryObjectInfo;
class ResourceRequest;
struct CrossThreadResourceRequestData;
@@ -132,6 +133,8 @@ namespace WebCore {
bool reportRawHeaders() const { return m_reportRawHeaders; }
void setReportRawHeaders(bool reportRawHeaders) { m_reportRawHeaders = reportRawHeaders; }
+ void reportMemoryUsage(MemoryObjectInfo*) const;
+
static double defaultTimeoutInterval(); // May return 0 when using platform default.
static void setDefaultTimeoutInterval(double);
diff --git a/Source/WebCore/platform/network/ResourceResponseBase.cpp b/Source/WebCore/platform/network/ResourceResponseBase.cpp
index 111c6dc01..fa05381cd 100644
--- a/Source/WebCore/platform/network/ResourceResponseBase.cpp
+++ b/Source/WebCore/platform/network/ResourceResponseBase.cpp
@@ -28,6 +28,7 @@
#include "ResourceResponseBase.h"
#include "HTTPParsers.h"
+#include "MemoryInstrumentation.h"
#include "ResourceResponse.h"
#include <wtf/CurrentTime.h>
#include <wtf/MathExtras.h>
@@ -566,6 +567,20 @@ void ResourceResponseBase::lazyInit(InitLevel initLevel) const
{
const_cast<ResourceResponse*>(static_cast<const ResourceResponse*>(this))->platformLazyInit(initLevel);
}
+
+void ResourceResponseBase::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+ MemoryClassInfo info(memoryObjectInfo, this, MemoryInstrumentation::Loader);
+ info.addMember(m_url);
+ info.addInstrumentedMember(m_mimeType);
+ info.addInstrumentedMember(m_textEncodingName);
+ info.addInstrumentedMember(m_suggestedFilename);
+ info.addInstrumentedMember(m_httpStatusText);
+ info.addHashMap(m_httpHeaderFields);
+ info.addInstrumentedMapEntries(m_httpHeaderFields);
+ info.addMember(m_resourceLoadTiming);
+ info.addMember(m_resourceLoadInfo);
+}
bool ResourceResponseBase::compare(const ResourceResponse& a, const ResourceResponse& b)
{
diff --git a/Source/WebCore/platform/network/ResourceResponseBase.h b/Source/WebCore/platform/network/ResourceResponseBase.h
index 3c616665a..ea7ac6cec 100644
--- a/Source/WebCore/platform/network/ResourceResponseBase.h
+++ b/Source/WebCore/platform/network/ResourceResponseBase.h
@@ -41,6 +41,7 @@
namespace WebCore {
+class MemoryObjectInfo;
class ResourceResponse;
struct CrossThreadResourceResponseData;
@@ -126,6 +127,8 @@ public:
return 1280;
}
+ void reportMemoryUsage(MemoryObjectInfo*) const;
+
static bool compare(const ResourceResponse&, const ResourceResponse&);
protected:
diff --git a/Source/WebCore/platform/network/blackberry/DNSBlackBerry.cpp b/Source/WebCore/platform/network/blackberry/DNSBlackBerry.cpp
new file mode 100644
index 000000000..54f215f6f
--- /dev/null
+++ b/Source/WebCore/platform/network/blackberry/DNSBlackBerry.cpp
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef DNSPrefetchBlackBerry_H
+#define DNSPrefetchBlackBerry_H
+
+#include "config.h"
+#include "PlatformString.h"
+
+#include <BlackBerryPlatformCommonFunctions.h>
+#include <wtf/text/CString.h>
+
+namespace WebCore {
+
+void prefetchDNS(const String& host)
+{
+ if (host.isEmpty())
+ return;
+ BlackBerry::Platform::prefetchDNS(host.latin1().data());
+}
+
+}
+#endif
diff --git a/Source/WebCore/platform/network/blackberry/NetworkJob.cpp b/Source/WebCore/platform/network/blackberry/NetworkJob.cpp
index 5780a3349..3d803a252 100644
--- a/Source/WebCore/platform/network/blackberry/NetworkJob.cpp
+++ b/Source/WebCore/platform/network/blackberry/NetworkJob.cpp
@@ -173,6 +173,12 @@ void NetworkJob::handleNotifyStatusReceived(int status, const String& message)
if (isInfo(status))
return; // ignore
+ // Load up error page and ask the user to change their wireless proxy settings
+ if (status == 407) {
+ const ResourceError error = ResourceError(ResourceError::httpErrorDomain, BlackBerry::Platform::FilterStream::StatusWifiProxyAuthError, m_response.url().string(), emptyString());
+ m_handle->client()->didFail(m_handle.get(), error);
+ }
+
m_statusReceived = true;
// Convert non-HTTP status codes to generic HTTP codes.
@@ -277,9 +283,9 @@ void NetworkJob::notifyAuthReceived(BlackBerry::Platform::NetworkRequest::AuthTy
}
storeCredentials();
return;
- }
-
- m_newJobWithCredentialsStarted = sendRequestWithCredentials(serverType, scheme, realm, requireCredentials);
+ } else if (serverType != ProtectionSpaceProxyHTTP)
+ // If a wifi proxy auth failed, there is no point of trying anymore because the credentials are wrong.
+ m_newJobWithCredentialsStarted = sendRequestWithCredentials(serverType, scheme, realm, requireCredentials);
}
void NetworkJob::notifyStringHeaderReceived(const String& key, const String& value)
@@ -707,15 +713,8 @@ bool NetworkJob::sendRequestWithCredentials(ProtectionSpaceServerType type, Prot
String host;
int port;
- if (type == ProtectionSpaceProxyHTTP) {
- String proxyAddress = BlackBerry::Platform::Client::get()->getProxyAddress(newURL.string().ascii().data()).c_str();
- KURL proxyURL(KURL(), proxyAddress);
- host = proxyURL.host();
- port = proxyURL.port();
- } else {
- host = m_response.url().host();
- port = m_response.url().port();
- }
+ host = m_response.url().host();
+ port = m_response.url().port();
ProtectionSpace protectionSpace(host, port, type, realm, scheme);
@@ -742,11 +741,6 @@ bool NetworkJob::sendRequestWithCredentials(ProtectionSpaceServerType type, Prot
String username;
String password;
- if (type == ProtectionSpaceProxyHTTP) {
- username = BlackBerry::Platform::Client::get()->getProxyUsername().c_str();
- password = BlackBerry::Platform::Client::get()->getProxyPassword().c_str();
- }
-
if (username.isEmpty() || password.isEmpty()) {
// Before asking the user for credentials, we check if the URL contains that.
if (!m_handle->getInternal()->m_user.isEmpty() && !m_handle->getInternal()->m_pass.isEmpty()) {
diff --git a/Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp b/Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp
index 3d8d4c691..9f6ffaba5 100644
--- a/Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp
+++ b/Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp
@@ -21,6 +21,7 @@
#include "BlobRegistryImpl.h"
#include "CookieManager.h"
+#include "ReadOnlyLatin1String.h"
#include <LocaleHandler.h>
#include <network/NetworkRequest.h>
#include <wtf/HashMap.h>
@@ -148,8 +149,10 @@ void ResourceRequest::initializePlatformRequest(NetworkRequest& platformRequest,
if (isInitial)
platformRequest.setRequestInitial(timeoutInterval());
else {
- platformRequest.setRequestUrl(url().string().utf8().data(),
- httpMethod().latin1().data(),
+ ReadOnlyLatin1String latin1URL(url().string());
+ ReadOnlyLatin1String latin1HttpMethod(httpMethod());
+ platformRequest.setRequestUrl(latin1URL.data(), latin1URL.length(),
+ latin1HttpMethod.data(), latin1HttpMethod.length(),
platformCachePolicyForRequest(*this),
platformTargetTypeForRequest(*this),
timeoutInterval());
@@ -171,7 +174,7 @@ void ResourceRequest::initializePlatformRequest(NetworkRequest& platformRequest,
platformRequest.addMultipartFilename(element.m_filename.characters(), element.m_filename.length());
#if ENABLE(BLOB)
else if (element.m_type == FormDataElement::encodedBlob) {
- RefPtr<BlobStorageData> blobData = static_cast<BlobRegistryImpl&>(blobRegistry()).getBlobDataFromURL(KURL(ParsedURLString, element.m_blobURL));
+ RefPtr<BlobStorageData> blobData = static_cast<BlobRegistryImpl&>(blobRegistry()).getBlobDataFromURL(KURL(ParsedURLString, element.m_url));
if (blobData) {
for (size_t j = 0; j < blobData->items().size(); ++j) {
const BlobDataItem& blobItem = blobData->items()[j];
@@ -198,12 +201,19 @@ void ResourceRequest::initializePlatformRequest(NetworkRequest& platformRequest,
String key = it->first;
String value = it->second;
if (!key.isEmpty()) {
- // We need to check the encoding and encode the cookie's value using latin1 or utf8 to support unicode characters.
- // We wo't use the old cookies of resourceRequest for new location because these cookies may be changed by redirection.
- if (!equalIgnoringCase(key, "Cookie"))
- platformRequest.addHeader(key.latin1().data(), value.latin1().data());
- else if (!cookieHeaderMayBeDirty)
- platformRequest.addHeader(key.latin1().data(), value.containsOnlyLatin1() ? value.latin1().data() : value.utf8().data());
+ if (equalIgnoringCase(key, "Cookie")) {
+ // We won't use the old cookies of resourceRequest for new location because these cookies may be changed by redirection.
+ if (cookieHeaderMayBeDirty)
+ continue;
+ // We need to check the encoding and encode the cookie's value using latin1 or utf8 to support unicode data.
+ if (!value.containsOnlyLatin1()) {
+ platformRequest.addHeader("Cookie", value.utf8().data());
+ continue;
+ }
+ }
+ ReadOnlyLatin1String latin1Key(key);
+ ReadOnlyLatin1String latin1Value(value);
+ platformRequest.addHeader(latin1Key.data(), latin1Key.length(), latin1Value.data(), latin1Value.length());
}
}
diff --git a/Source/WebCore/platform/network/blackberry/SocketStreamHandleBlackBerry.cpp b/Source/WebCore/platform/network/blackberry/SocketStreamHandleBlackBerry.cpp
index 90ed528a7..55a295fe4 100644
--- a/Source/WebCore/platform/network/blackberry/SocketStreamHandleBlackBerry.cpp
+++ b/Source/WebCore/platform/network/blackberry/SocketStreamHandleBlackBerry.cpp
@@ -39,6 +39,7 @@
#include "Page.h"
#include "PageClientBlackBerry.h"
#include "PageGroup.h"
+#include "ReadOnlyLatin1String.h"
#include "SocketStreamError.h"
#include "SocketStreamHandleClient.h"
@@ -70,7 +71,8 @@ SocketStreamHandle::SocketStreamHandle(const String& groupName, const KURL& url,
// Open the socket
BlackBerry::Platform::NetworkRequest request;
- request.setRequestUrl(url.string().latin1().data(), "CONNECT");
+ ReadOnlyLatin1String latin1URL(url.string());
+ request.setRequestUrl(latin1URL.data(), latin1URL.length(), "CONNECT", 7);
m_socketStream->setRequest(request);
diff --git a/Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp b/Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp
index 68f063346..3d3e8a3ed 100644
--- a/Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp
+++ b/Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp
@@ -418,7 +418,7 @@ void setHTTPBody(CFMutableURLRequestRef request, PassRefPtr<FormData> prpFormDat
newFormData->appendFile(element.m_filename, element.m_shouldGenerateFile);
else {
ASSERT(element.m_type == FormDataElement::encodedBlob);
- RefPtr<BlobStorageData> blobData = static_cast<BlobRegistryImpl&>(blobRegistry()).getBlobDataFromURL(KURL(ParsedURLString, element.m_blobURL));
+ RefPtr<BlobStorageData> blobData = static_cast<BlobRegistryImpl&>(blobRegistry()).getBlobDataFromURL(KURL(ParsedURLString, element.m_url));
if (blobData) {
for (size_t j = 0; j < blobData->items().size(); ++j) {
const BlobDataItem& blobItem = blobData->items()[j];
diff --git a/Source/WebCore/platform/network/qt/DnsPrefetchHelper.h b/Source/WebCore/platform/network/qt/DnsPrefetchHelper.h
index 04921e20b..b57729da3 100644
--- a/Source/WebCore/platform/network/qt/DnsPrefetchHelper.h
+++ b/Source/WebCore/platform/network/qt/DnsPrefetchHelper.h
@@ -33,7 +33,7 @@ namespace WebCore {
public:
DnsPrefetchHelper() : QObject(), currentLookups(0) { }
- public slots:
+ public Q_SLOTS:
void lookup(QString hostname)
{
if (hostname.isEmpty())
diff --git a/Source/WebCore/platform/network/qt/NetworkStateNotifierPrivate.h b/Source/WebCore/platform/network/qt/NetworkStateNotifierPrivate.h
index 44784b3d4..5d02a299b 100644
--- a/Source/WebCore/platform/network/qt/NetworkStateNotifierPrivate.h
+++ b/Source/WebCore/platform/network/qt/NetworkStateNotifierPrivate.h
@@ -40,10 +40,10 @@ public:
void setNetworkAccessAllowed(bool);
bool effectivelyOnline() const { return m_online && m_networkAccessAllowed; }
-public slots:
+public Q_SLOTS:
void setOnlineState(bool);
-private slots:
+private Q_SLOTS:
void initialize();
public:
diff --git a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.h b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.h
index f7a447a5c..4771e88a6 100644
--- a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.h
+++ b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.h
@@ -136,7 +136,7 @@ public:
static ResourceError errorForReply(QNetworkReply*);
-private slots:
+private Q_SLOTS:
void uploadProgress(qint64 bytesSent, qint64 bytesTotal);
private:
diff --git a/Source/WebCore/platform/network/qt/QtMIMETypeSniffer.h b/Source/WebCore/platform/network/qt/QtMIMETypeSniffer.h
index 814f8cc4b..e63e9479f 100644
--- a/Source/WebCore/platform/network/qt/QtMIMETypeSniffer.h
+++ b/Source/WebCore/platform/network/qt/QtMIMETypeSniffer.h
@@ -34,10 +34,10 @@ public:
QString mimeType() const { return m_mimeType; }
bool isFinished() const { return m_isFinished; }
-signals:
+Q_SIGNALS:
void finished();
-private slots:
+private Q_SLOTS:
void trySniffing();
private:
diff --git a/Source/WebCore/platform/network/qt/SocketStreamHandlePrivate.h b/Source/WebCore/platform/network/qt/SocketStreamHandlePrivate.h
index 301927904..f447cc206 100644
--- a/Source/WebCore/platform/network/qt/SocketStreamHandlePrivate.h
+++ b/Source/WebCore/platform/network/qt/SocketStreamHandlePrivate.h
@@ -50,7 +50,7 @@ public:
SocketStreamHandlePrivate(SocketStreamHandle*, QTcpSocket*);
~SocketStreamHandlePrivate();
-public slots:
+public Q_SLOTS:
void socketConnected();
void socketReadyRead();
int send(const char* data, int len);
diff --git a/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
index 69b344246..30a2de455 100644
--- a/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
+++ b/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
@@ -534,7 +534,7 @@ static void addEncodedBlobItemToSoupMessageBody(SoupMessage* message, const Blob
static void addEncodedBlobToSoupMessageBody(SoupMessage* message, const FormDataElement& element, unsigned long& totalBodySize)
{
- RefPtr<BlobStorageData> blobData = static_cast<BlobRegistryImpl&>(blobRegistry()).getBlobDataFromURL(KURL(ParsedURLString, element.m_blobURL));
+ RefPtr<BlobStorageData> blobData = static_cast<BlobRegistryImpl&>(blobRegistry()).getBlobDataFromURL(KURL(ParsedURLString, element.m_url));
if (!blobData)
return;
diff --git a/Source/WebCore/platform/qt/GamepadsQt.cpp b/Source/WebCore/platform/qt/GamepadsQt.cpp
index 8ebe8ecc9..624fde947 100644
--- a/Source/WebCore/platform/qt/GamepadsQt.cpp
+++ b/Source/WebCore/platform/qt/GamepadsQt.cpp
@@ -58,7 +58,7 @@ private:
GamepadDeviceLinuxQt(const String&);
QSocketNotifier* m_notifier;
-private slots:
+private Q_SLOTS:
bool readCallback();
};
@@ -97,7 +97,7 @@ public:
void updateGamepadList(GamepadList*);
-private slots:
+private Q_SLOTS:
void onGamePadChange();
private:
diff --git a/Source/WebCore/platform/qt/SharedTimerQt.cpp b/Source/WebCore/platform/qt/SharedTimerQt.cpp
index b87284913..cebfea663 100644
--- a/Source/WebCore/platform/qt/SharedTimerQt.cpp
+++ b/Source/WebCore/platform/qt/SharedTimerQt.cpp
@@ -51,7 +51,7 @@ public:
protected:
void timerEvent(QTimerEvent* ev);
-private slots:
+private Q_SLOTS:
void destroy();
private:
diff --git a/Source/WebCore/platform/sql/SQLiteDatabase.cpp b/Source/WebCore/platform/sql/SQLiteDatabase.cpp
index bfca58636..3fd3d023d 100644
--- a/Source/WebCore/platform/sql/SQLiteDatabase.cpp
+++ b/Source/WebCore/platform/sql/SQLiteDatabase.cpp
@@ -56,7 +56,7 @@ SQLiteDatabase::SQLiteDatabase()
, m_openingThread(0)
, m_interrupted(false)
, m_openError(SQLITE_ERROR)
- , m_openErrorMessage(notOpenErrorMessage)
+ , m_openErrorMessage()
{
}
@@ -114,7 +114,7 @@ void SQLiteDatabase::close()
m_openingThread = 0;
m_openError = SQLITE_ERROR;
- m_openErrorMessage = notOpenErrorMessage;
+ m_openErrorMessage = CString();
}
void SQLiteDatabase::interrupt()
@@ -333,8 +333,10 @@ int SQLiteDatabase::lastError()
}
const char* SQLiteDatabase::lastErrorMsg()
-{
- return m_db ? sqlite3_errmsg(m_db) : m_openErrorMessage.data();
+{
+ if (m_db)
+ return sqlite3_errmsg(m_db);
+ return m_openErrorMessage.isNull() ? notOpenErrorMessage : m_openErrorMessage.data();
}
#ifndef NDEBUG
diff --git a/Source/WebCore/platform/text/LocaleWin.cpp b/Source/WebCore/platform/text/LocaleWin.cpp
index 68b6367d8..67eeddb75 100644
--- a/Source/WebCore/platform/text/LocaleWin.cpp
+++ b/Source/WebCore/platform/text/LocaleWin.cpp
@@ -278,16 +278,32 @@ static Vector<DateFormatToken> parseDateFormat(const String format)
// -------------------------------- Parsing
+bool LocaleWin::isLocalizedDigit(UChar ch)
+{
+ String normalizedDigit = convertFromLocalizedNumber(String(&ch, 1));
+ if (normalizedDigit.length() != 1)
+ return false;
+ return isASCIIDigit(normalizedDigit[0]);
+}
+
// Returns -1 if parsing fails.
-static int parseNumber(const String& input, unsigned& index)
+int LocaleWin::parseNumber(const String& input, unsigned& index)
{
unsigned digitsStart = index;
while (index < input.length() && isASCIIDigit(input[index]))
index++;
+ if (digitsStart != index) {
+ bool ok = false;
+ int number = input.substring(digitsStart, index - digitsStart).toInt(&ok);
+ return ok ? number : -1;
+ }
+
+ while (index < input.length() && isLocalizedDigit(input[index]))
+ index++;
if (digitsStart == index)
return -1;
bool ok = false;
- int number = input.substring(digitsStart, index - digitsStart).toInt(&ok);
+ int number = convertFromLocalizedNumber(input.substring(digitsStart, index - digitsStart)).toInt(&ok);
return ok ? number : -1;
}
@@ -403,31 +419,42 @@ double LocaleWin::parseDate(const Vector<DateFormatToken>& tokens, int baseYear,
// -------------------------------- Formatting
-static inline void appendNumber(int value, StringBuilder& buffer)
+inline void LocaleWin::appendNumber(int value, StringBuilder& buffer)
{
- buffer.append(String::number(value));
+ buffer.append(convertToLocalizedNumber(String::number(value)));
}
-static void appendTwoDigitsNumber(int value, StringBuilder& buffer)
+void LocaleWin::appendTwoDigitsNumber(int value, StringBuilder& buffer)
{
- if (value >= 0 && value < 10)
- buffer.append("0");
- buffer.append(String::number(value));
+ String numberString = String::number(value);
+ if (value < 0 || value >= 10) {
+ buffer.append(convertToLocalizedNumber(numberString));
+ return;
+ }
+ StringBuilder numberBuffer;
+ numberBuffer.reserveCapacity(1 + numberString.length());
+ numberBuffer.append("0");
+ numberBuffer.append(numberString);
+ buffer.append(convertToLocalizedNumber(numberBuffer.toString()));
}
-static void appendFourDigitsNumber(int value, StringBuilder& buffer)
+void LocaleWin::appendFourDigitsNumber(int value, StringBuilder& buffer)
{
+ String numberString = String::number(value);
if (value < 0) {
- buffer.append(String::number(value));
+ buffer.append(convertToLocalizedNumber(numberString));
return;
}
+ StringBuilder numberBuffer;
+ numberBuffer.reserveCapacity(3 + numberString.length());
if (value < 10)
- buffer.append("000");
+ numberBuffer.append("000");
else if (value < 100)
- buffer.append("00");
+ numberBuffer.append("00");
else if (value < 1000)
- buffer.append("0");
- buffer.append(String::number(value));
+ numberBuffer.append("0");
+ numberBuffer.append(numberString);
+ buffer.append(convertToLocalizedNumber(numberBuffer.toString()));
}
String LocaleWin::formatDate(const DateComponents& dateComponents)
@@ -709,7 +736,7 @@ void LocaleWin::initializeNumberLocalizerData()
};
DWORD digitSubstitution = DigitSubstitution0to9;
getLocaleInfo(LOCALE_IDIGITSUBSTITUTION, digitSubstitution);
- if (digitSubstitution != DigitSubstitutionNative) {
+ if (digitSubstitution == DigitSubstitution0to9) {
symbols.append("0");
symbols.append("1");
symbols.append("2");
diff --git a/Source/WebCore/platform/text/LocaleWin.h b/Source/WebCore/platform/text/LocaleWin.h
index f8248aa4c..33666b301 100644
--- a/Source/WebCore/platform/text/LocaleWin.h
+++ b/Source/WebCore/platform/text/LocaleWin.h
@@ -74,8 +74,13 @@ private:
void ensureShortMonthLabels();
void ensureMonthLabels();
void ensureShortDateTokens();
+ bool isLocalizedDigit(UChar);
+ int parseNumber(const String&, unsigned& index);
int parseNumberOrMonth(const String&, unsigned& index);
double parseDate(const Vector<DateFormatToken>&, int baseYear, const String&);
+ void appendNumber(int, StringBuilder&);
+ void appendTwoDigitsNumber(int, StringBuilder&);
+ void appendFourDigitsNumber(int, StringBuilder&);
String formatDate(const Vector<DateFormatToken>&, int baseYear, int year, int month, int day);
#if ENABLE(CALENDAR_PICKER)
void ensureWeekDayShortLabels();
diff --git a/Source/WebCore/platform/text/UnicodeBidi.h b/Source/WebCore/platform/text/UnicodeBidi.h
index 0b875e435..14c88bc1f 100644
--- a/Source/WebCore/platform/text/UnicodeBidi.h
+++ b/Source/WebCore/platform/text/UnicodeBidi.h
@@ -34,17 +34,17 @@ enum EUnicodeBidi {
Override,
Isolate,
Plaintext,
- OverrideIsolate,
+ IsolateOverride,
};
inline bool isIsolated(const EUnicodeBidi& unicodeBidi)
{
- return unicodeBidi == Isolate || unicodeBidi == OverrideIsolate || unicodeBidi == Plaintext;
+ return unicodeBidi == Isolate || unicodeBidi == IsolateOverride || unicodeBidi == Plaintext;
}
inline bool isOverride(EUnicodeBidi unicodeBidi)
{
- return unicodeBidi == Override || unicodeBidi == OverrideIsolate;
+ return unicodeBidi == Override || unicodeBidi == IsolateOverride;
}
}
diff --git a/Source/WebCore/platform/text/cf/StringCF.cpp b/Source/WebCore/platform/text/cf/StringCF.cpp
index 0a1928b87..2fe408b49 100644
--- a/Source/WebCore/platform/text/cf/StringCF.cpp
+++ b/Source/WebCore/platform/text/cf/StringCF.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2012 Apple Computer, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -45,7 +45,7 @@ String::String(CFStringRef str)
CFStringRef String::createCFString() const
{
if (!m_impl)
- return static_cast<CFStringRef>(CFRetain(CFSTR("")));
+ return CFSTR("");
return m_impl->createCFString();
}
diff --git a/Source/WebCore/platform/text/cf/StringImplCF.cpp b/Source/WebCore/platform/text/cf/StringImplCF.cpp
index 19fed849f..7a2d82e40 100644
--- a/Source/WebCore/platform/text/cf/StringImplCF.cpp
+++ b/Source/WebCore/platform/text/cf/StringImplCF.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2009, 2012 Apple 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
@@ -134,18 +134,23 @@ namespace StringWrapperCFAllocator {
CFStringRef StringImpl::createCFString()
{
- CFAllocatorRef allocator = (m_length && isMainThread()) ? StringWrapperCFAllocator::allocator() : 0;
- if (!allocator)
- return CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar*>(characters()), m_length);
+ if (!m_length || !isMainThread()) {
+ if (is8Bit())
+ return CFStringCreateWithBytes(0, reinterpret_cast<const UInt8*>(characters8()), m_length, kCFStringEncodingISOLatin1, false);
+ return CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar*>(characters16()), m_length);
+ }
+ CFAllocatorRef allocator = StringWrapperCFAllocator::allocator();
// Put pointer to the StringImpl in a global so the allocator can store it with the CFString.
ASSERT(!StringWrapperCFAllocator::currentString);
StringWrapperCFAllocator::currentString = this;
- CFStringRef string = CFStringCreateWithCharactersNoCopy(allocator, reinterpret_cast<const UniChar*>(characters()), m_length, kCFAllocatorNull);
-
- // The allocator cleared the global when it read it, but also clear it here just in case.
- ASSERT(!StringWrapperCFAllocator::currentString);
+ CFStringRef string;
+ if (is8Bit())
+ string = CFStringCreateWithBytesNoCopy(allocator, reinterpret_cast<const UInt8*>(characters8()), m_length, kCFStringEncodingISOLatin1, false, kCFAllocatorNull);
+ else
+ string = CFStringCreateWithCharactersNoCopy(allocator, reinterpret_cast<const UniChar*>(characters16()), m_length, kCFAllocatorNull);
+ // CoreFoundation might not have to allocate anything, we clear currentString in case we did not execute allocate().
StringWrapperCFAllocator::currentString = 0;
return string;
diff --git a/Source/WebCore/platform/text/gtk/TextCheckerEnchant.cpp b/Source/WebCore/platform/text/gtk/TextCheckerEnchant.cpp
index ad668ab20..f3f60e687 100644
--- a/Source/WebCore/platform/text/gtk/TextCheckerEnchant.cpp
+++ b/Source/WebCore/platform/text/gtk/TextCheckerEnchant.cpp
@@ -115,7 +115,7 @@ void TextCheckerEnchant::checkSpellingOfString(const String& string, int& misspe
g_utf8_strncpy(word.get(), cstart, wordLength);
for (; dictIter != m_enchantDictionaries.end(); ++dictIter) {
- if (enchant_dict_check(*dictIter, word.get(), wordLength)) {
+ if (enchant_dict_check(*dictIter, word.get(), bytes)) {
misspellingLocation = start;
misspellingLength = wordLength;
} else {
diff --git a/Source/WebCore/platform/win/WindowMessageListener.h b/Source/WebCore/platform/win/WindowMessageListener.h
index b99cb35b6..1d410f22c 100644
--- a/Source/WebCore/platform/win/WindowMessageListener.h
+++ b/Source/WebCore/platform/win/WindowMessageListener.h
@@ -29,10 +29,9 @@
#ifndef WindowMessageListener_h
#define WindowMessageListener_h
-typedef struct HWND__* HWND;
-typedef long LPARAM;
-typedef unsigned UINT;
-typedef unsigned WPARAM;
+#if OS(WINDOWS)
+#include "WindowsExtras.h"
+#endif
namespace WebCore {
diff --git a/Source/WebCore/rendering/AutoTableLayout.cpp b/Source/WebCore/rendering/AutoTableLayout.cpp
index 37df7bfbb..3a5cb0dda 100644
--- a/Source/WebCore/rendering/AutoTableLayout.cpp
+++ b/Source/WebCore/rendering/AutoTableLayout.cpp
@@ -74,9 +74,9 @@ void AutoTableLayout::recalcColumn(unsigned effCol)
if (cell->colSpan() == 1) {
if (cell->preferredLogicalWidthsDirty())
cell->computePreferredLogicalWidths();
- columnLayout.minLogicalWidth = max<int>(cell->minPreferredLogicalWidth(), columnLayout.minLogicalWidth);
+ columnLayout.minLogicalWidth = max<int>(cell->minPreferredLogicalWidth().ceil(), columnLayout.minLogicalWidth);
if (cell->maxPreferredLogicalWidth() > columnLayout.maxLogicalWidth) {
- columnLayout.maxLogicalWidth = cell->maxPreferredLogicalWidth();
+ columnLayout.maxLogicalWidth = cell->maxPreferredLogicalWidth().ceil();
maxContributor = cell;
}
@@ -93,7 +93,7 @@ void AutoTableLayout::recalcColumn(unsigned effCol)
case Fixed:
// ignore width=0
if (cellLogicalWidth.isPositive() && !columnLayout.logicalWidth.isPercent()) {
- int logicalWidth = cell->computeBorderBoxLogicalWidth(cellLogicalWidth.value());
+ LayoutUnit logicalWidth = cell->computeBorderBoxLogicalWidth(cellLogicalWidth.value());
if (columnLayout.logicalWidth.isFixed()) {
// Nav/IE weirdness
if ((logicalWidth > columnLayout.logicalWidth.value())
@@ -277,7 +277,7 @@ void AutoTableLayout::computePreferredLogicalWidths(LayoutUnit& minWidth, Layout
*/
int AutoTableLayout::calcEffectiveLogicalWidth()
{
- float maxLogicalWidth = 0;
+ int maxLogicalWidth = 0;
size_t nEffCols = m_layoutStruct.size();
int spacingInRowDirection = m_table->hBorderSpacing();
@@ -302,10 +302,10 @@ int AutoTableLayout::calcEffectiveLogicalWidth()
unsigned effCol = m_table->colToEffCol(cell->col());
size_t lastCol = effCol;
int cellMinLogicalWidth = cell->minPreferredLogicalWidth() + spacingInRowDirection;
- float cellMaxLogicalWidth = cell->maxPreferredLogicalWidth() + spacingInRowDirection;
+ int cellMaxLogicalWidth = cell->maxPreferredLogicalWidth() + spacingInRowDirection;
float totalPercent = 0;
int spanMinLogicalWidth = 0;
- float spanMaxLogicalWidth = 0;
+ int spanMaxLogicalWidth = 0;
bool allColsArePercent = true;
bool allColsAreFixed = true;
bool haveAuto = false;
@@ -361,11 +361,11 @@ int AutoTableLayout::calcEffectiveLogicalWidth()
// can't satify this condition, treat as variable
cellLogicalWidth = Length();
} else {
- maxLogicalWidth = max(maxLogicalWidth, static_cast<float>(max(spanMaxLogicalWidth, cellMaxLogicalWidth) * 100 / cellLogicalWidth.percent()));
+ maxLogicalWidth = max(maxLogicalWidth, static_cast<int>(max(spanMaxLogicalWidth, cellMaxLogicalWidth) * 100 / cellLogicalWidth.percent()));
// all non percent columns in the span get percent values to sum up correctly.
float percentMissing = cellLogicalWidth.percent() - totalPercent;
- float totalWidth = 0;
+ int totalWidth = 0;
for (unsigned pos = effCol; pos < lastCol; ++pos) {
if (!m_layoutStruct[pos].effectiveLogicalWidth.isPercent())
totalWidth += m_layoutStruct[pos].effectiveMaxLogicalWidth;
@@ -397,13 +397,13 @@ int AutoTableLayout::calcEffectiveLogicalWidth()
} else if (allColsArePercent) {
// In this case, we just split the colspan's min amd max widths following the percentage.
int allocatedMinLogicalWidth = 0;
- float allocatedMaxLogicalWidth = 0;
+ int allocatedMaxLogicalWidth = 0;
for (unsigned pos = effCol; pos < lastCol; ++pos) {
ASSERT(m_layoutStruct[pos].logicalWidth.isPercent() || m_layoutStruct[pos].effectiveLogicalWidth.isPercent());
// |allColsArePercent| means that either the logicalWidth *or* the effectiveLogicalWidth are percents, handle both of them here.
float percent = m_layoutStruct[pos].logicalWidth.isPercent() ? m_layoutStruct[pos].logicalWidth.percent() : m_layoutStruct[pos].effectiveLogicalWidth.percent();
int columnMinLogicalWidth = static_cast<int>(percent * cellMinLogicalWidth / totalPercent);
- float columnMaxLogicalWidth = percent * cellMaxLogicalWidth / totalPercent;
+ int columnMaxLogicalWidth = static_cast<int>(percent * cellMaxLogicalWidth / totalPercent);
m_layoutStruct[pos].effectiveMinLogicalWidth = max(m_layoutStruct[pos].effectiveMinLogicalWidth, columnMinLogicalWidth);
m_layoutStruct[pos].effectiveMaxLogicalWidth = columnMaxLogicalWidth;
allocatedMinLogicalWidth += columnMinLogicalWidth;
@@ -414,7 +414,7 @@ int AutoTableLayout::calcEffectiveLogicalWidth()
cellMinLogicalWidth -= allocatedMinLogicalWidth;
cellMaxLogicalWidth -= allocatedMaxLogicalWidth;
} else {
- float remainingMaxLogicalWidth = spanMaxLogicalWidth;
+ int remainingMaxLogicalWidth = spanMaxLogicalWidth;
int remainingMinLogicalWidth = spanMinLogicalWidth;
// Give min to variable first, to fixed second, and to others third.
@@ -462,7 +462,7 @@ int AutoTableLayout::calcEffectiveLogicalWidth()
}
m_effectiveLogicalWidthDirty = false;
- return static_cast<int>(min(maxLogicalWidth, INT_MAX / 2.0f));
+ return min(maxLogicalWidth, INT_MAX / 2);
}
/* gets all cells that originate in a column and have a cellspan > 1
diff --git a/Source/WebCore/rendering/EllipsisBox.cpp b/Source/WebCore/rendering/EllipsisBox.cpp
index 8c00fca75..7290cb25f 100644
--- a/Source/WebCore/rendering/EllipsisBox.cpp
+++ b/Source/WebCore/rendering/EllipsisBox.cpp
@@ -65,13 +65,29 @@ void EllipsisBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, La
if (setShadow)
context->clearShadow();
- if (m_markupBox) {
- // Paint the markup box
- LayoutPoint adjustedPaintOffset = paintOffset;
- adjustedPaintOffset.move(x() + m_logicalWidth - m_markupBox->x(),
- y() + style->fontMetrics().ascent() - (m_markupBox->y() + m_markupBox->renderer()->style(isFirstLineStyle())->fontMetrics().ascent()));
- m_markupBox->paint(paintInfo, adjustedPaintOffset, lineTop, lineBottom);
- }
+ paintMarkupBox(paintInfo, paintOffset, lineTop, lineBottom, style);
+}
+
+void EllipsisBox::paintMarkupBox(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom, RenderStyle* style)
+{
+ if (!m_shouldPaintMarkupBox || !m_renderer->isRenderBlock())
+ return;
+
+ RenderBlock* block = toRenderBlock(m_renderer);
+ RootInlineBox* lastLine = block->lineAtIndex(block->lineCount() - 1);
+ if (!lastLine)
+ return;
+
+ // If the last line-box on the last line of a block is a link, -webkit-line-clamp paints that box after the ellipsis.
+ // It does not actually move the link.
+ InlineBox* anchorBox = lastLine->lastChild();
+ if (!anchorBox || !anchorBox->renderer()->style()->isLink())
+ return;
+
+ LayoutPoint adjustedPaintOffset = paintOffset;
+ adjustedPaintOffset.move(x() + m_logicalWidth - anchorBox->x(),
+ y() + style->fontMetrics().ascent() - (anchorBox->y() + anchorBox->renderer()->style(isFirstLineStyle())->fontMetrics().ascent()));
+ anchorBox->paint(paintInfo, adjustedPaintOffset, lineTop, lineBottom);
}
IntRect EllipsisBox::selectionRect()
diff --git a/Source/WebCore/rendering/EllipsisBox.h b/Source/WebCore/rendering/EllipsisBox.h
index 35d634d7d..c759a397e 100644
--- a/Source/WebCore/rendering/EllipsisBox.h
+++ b/Source/WebCore/rendering/EllipsisBox.h
@@ -32,9 +32,9 @@ public:
EllipsisBox(RenderObject* obj, const AtomicString& ellipsisStr, InlineFlowBox* parent,
int width, int height, int y, bool firstLine, bool isVertical, InlineBox* markupBox)
: InlineBox(obj, FloatPoint(0, y), width, firstLine, true, false, false, isVertical, 0, 0, parent)
+ , m_shouldPaintMarkupBox(markupBox)
, m_height(height)
, m_str(ellipsisStr)
- , m_markupBox(markupBox)
, m_selectionState(RenderObject::SelectionNone)
{
}
@@ -45,13 +45,14 @@ public:
IntRect selectionRect();
private:
+ void paintMarkupBox(PaintInfo&, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom, RenderStyle*);
virtual int height() const { return m_height; }
virtual RenderObject::SelectionState selectionState() { return m_selectionState; }
void paintSelection(GraphicsContext*, const LayoutPoint&, RenderStyle*, const Font&);
+ bool m_shouldPaintMarkupBox;
int m_height;
AtomicString m_str;
- InlineBox* m_markupBox;
RenderObject::SelectionState m_selectionState;
};
diff --git a/Source/WebCore/rendering/FilterEffectRenderer.cpp b/Source/WebCore/rendering/FilterEffectRenderer.cpp
index 674861d6a..6d411995d 100644
--- a/Source/WebCore/rendering/FilterEffectRenderer.cpp
+++ b/Source/WebCore/rendering/FilterEffectRenderer.cpp
@@ -402,6 +402,10 @@ void FilterEffectRenderer::clearIntermediateResults()
void FilterEffectRenderer::apply()
{
lastEffect()->apply();
+
+#if !USE(CG)
+ output()->transformColorSpace(lastEffect()->colorSpace(), ColorSpaceDeviceRGB);
+#endif
}
LayoutRect FilterEffectRenderer::computeSourceImageRectForDirtyRect(const LayoutRect& filterBoxRect, const LayoutRect& dirtyRect)
diff --git a/Source/WebCore/rendering/HitTestResult.cpp b/Source/WebCore/rendering/HitTestResult.cpp
index 44b17478f..0745763d1 100644
--- a/Source/WebCore/rendering/HitTestResult.cpp
+++ b/Source/WebCore/rendering/HitTestResult.cpp
@@ -795,4 +795,19 @@ Vector<String> HitTestResult::dictationAlternatives() const
return frame->editor()->dictationAlternativesForMarker(marker);
}
+Node* HitTestResult::targetNode() const
+{
+ Node* node = innerNode();
+ if (!node)
+ return 0;
+ if (node->inDocument())
+ return node;
+
+ Element* element = node->parentElement();
+ if (element && element->inDocument())
+ return element;
+
+ return node;
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/rendering/HitTestResult.h b/Source/WebCore/rendering/HitTestResult.h
index 05ca90dc1..9d16bf042 100644
--- a/Source/WebCore/rendering/HitTestResult.h
+++ b/Source/WebCore/rendering/HitTestResult.h
@@ -177,6 +177,8 @@ public:
Vector<String> dictationAlternatives() const;
+ Node* targetNode() const;
+
private:
NodeSet& mutableRectBasedTestResult(); // See above.
diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp
index c2509065e..aa71af50c 100755
--- a/Source/WebCore/rendering/RenderBlock.cpp
+++ b/Source/WebCore/rendering/RenderBlock.cpp
@@ -554,6 +554,7 @@ RenderBlock* RenderBlock::clone() const
// generated content added yet.
cloneBlock->setChildrenInline(cloneBlock->firstChild() ? cloneBlock->firstChild()->isInline() : childrenInline());
}
+ cloneBlock->setInRenderFlowThread(inRenderFlowThread());
return cloneBlock;
}
@@ -1212,12 +1213,12 @@ void RenderBlock::removeChild(RenderObject* oldChild)
RenderBox::removeChild(oldChild);
RenderObject* child = prev ? prev : next;
- if (canMergeAnonymousBlocks && child && !child->previousSibling() && !child->nextSibling() && !isFlexibleBoxIncludingDeprecated()) {
+ if (canMergeAnonymousBlocks && child && !child->previousSibling() && !child->nextSibling() && canCollapseAnonymousBlockChild()) {
// The removal has knocked us down to containing only a single anonymous
// box. We can go ahead and pull the content right back up into our
// box.
collapseAnonymousBoxChild(this, child);
- } else if (((prev && prev->isAnonymousBlock()) || (next && next->isAnonymousBlock())) && !isFlexibleBoxIncludingDeprecated()) {
+ } else if (((prev && prev->isAnonymousBlock()) || (next && next->isAnonymousBlock())) && canCollapseAnonymousBlockChild()) {
// It's possible that the removal has knocked us down to a single anonymous
// block with pseudo-style element siblings (e.g. first-letter). If these
// are floating, then we need to pull the content up also.
@@ -3825,7 +3826,8 @@ LayoutPoint RenderBlock::computeLogicalLocationForFloat(const FloatingObject* fl
LayoutUnit heightRemainingLeft = 1;
LayoutUnit heightRemainingRight = 1;
floatLogicalLeft = logicalLeftOffsetForLine(logicalTopOffset, logicalLeftOffset, false, &heightRemainingLeft);
- while (logicalRightOffsetForLine(logicalTopOffset, logicalRightOffset, false, &heightRemainingRight) - floatLogicalLeft < floatLogicalWidth) {
+ // FIXME: LayoutUnit::epsilon is probably only necessary here due to lost precision elsewhere https://bugs.webkit.org/show_bug.cgi?id=94000
+ while (logicalRightOffsetForLine(logicalTopOffset, logicalRightOffset, false, &heightRemainingRight) - floatLogicalLeft + LayoutUnit::epsilon() < floatLogicalWidth) {
logicalTopOffset += min(heightRemainingLeft, heightRemainingRight);
floatLogicalLeft = logicalLeftOffsetForLine(logicalTopOffset, logicalLeftOffset, false, &heightRemainingLeft);
if (inRenderFlowThread()) {
@@ -3840,7 +3842,8 @@ LayoutPoint RenderBlock::computeLogicalLocationForFloat(const FloatingObject* fl
LayoutUnit heightRemainingLeft = 1;
LayoutUnit heightRemainingRight = 1;
floatLogicalLeft = logicalRightOffsetForLine(logicalTopOffset, logicalRightOffset, false, &heightRemainingRight);
- while (floatLogicalLeft - logicalLeftOffsetForLine(logicalTopOffset, logicalLeftOffset, false, &heightRemainingLeft) < floatLogicalWidth) {
+ // FIXME: LayoutUnit::epsilon is probably only necessary here due to lost precision elsewhere https://bugs.webkit.org/show_bug.cgi?id=94000
+ while (floatLogicalLeft - logicalLeftOffsetForLine(logicalTopOffset, logicalLeftOffset, false, &heightRemainingLeft) + LayoutUnit::epsilon() < floatLogicalWidth) {
logicalTopOffset += min(heightRemainingLeft, heightRemainingRight);
floatLogicalLeft = logicalRightOffsetForLine(logicalTopOffset, logicalRightOffset, false, &heightRemainingRight);
if (inRenderFlowThread()) {
@@ -5661,6 +5664,25 @@ static inline void updatePreferredWidth(LayoutUnit& preferredWidth, float& resul
preferredWidth = max(snappedResult, preferredWidth);
}
+// With sub-pixel enabled: When converting between floating point and LayoutUnits
+// we risk losing precision with each conversion. When this occurs while
+// accumulating our preferred widths, we can wind up with a line width that's
+// larger than our maxPreferredWidth due to pure float accumulation.
+//
+// With sub-pixel disabled: values from Lengths or the render tree aren't subject
+// to the same loss of precision, as they're always truncated and stored as
+// integers. We mirror that behavior here to prevent over-allocating our preferred
+// width.
+static inline LayoutUnit adjustFloatForSubPixelLayout(float value)
+{
+#if ENABLE(SUBPIXEL_LAYOUT)
+ return ceiledLayoutUnit(value);
+#else
+ return static_cast<int>(value);
+#endif
+}
+
+
void RenderBlock::computeInlinePreferredLogicalWidths()
{
float inlineMax = 0;
@@ -5750,11 +5772,11 @@ void RenderBlock::computeInlinePreferredLogicalWidths()
Length startMargin = childStyle->marginStart();
Length endMargin = childStyle->marginEnd();
if (startMargin.isFixed())
- margins += startMargin.value();
+ margins += adjustFloatForSubPixelLayout(startMargin.value());
if (endMargin.isFixed())
- margins += endMargin.value();
- childMin += margins;
- childMax += margins;
+ margins += adjustFloatForSubPixelLayout(endMargin.value());
+ childMin += margins.ceilToFloat();
+ childMax += margins.ceilToFloat();
}
}
@@ -5762,8 +5784,8 @@ void RenderBlock::computeInlinePreferredLogicalWidths()
// Case (2). Inline replaced elements and floats.
// Go ahead and terminate the current line as far as
// minwidth is concerned.
- childMin += child->minPreferredLogicalWidth();
- childMax += child->maxPreferredLogicalWidth();
+ childMin += child->minPreferredLogicalWidth().ceilToFloat();
+ childMax += child->maxPreferredLogicalWidth().ceilToFloat();
bool clearPreviousFloat;
if (child->isFloating()) {
@@ -5790,11 +5812,11 @@ void RenderBlock::computeInlinePreferredLogicalWidths()
LayoutUnit ti = 0;
if (!addedTextIndent) {
ti = textIndent;
- childMin += ti;
- childMax += ti;
+ childMin += ti.ceilToFloat();
+ childMax += ti.ceilToFloat();
if (childMin < 0)
- textIndent = childMin;
+ textIndent = adjustFloatForSubPixelLayout(childMin);
else
addedTextIndent = true;
}
@@ -5862,11 +5884,14 @@ void RenderBlock::computeInlinePreferredLogicalWidths()
trailingSpaceChild = 0;
// Add in text-indent. This is added in only once.
- LayoutUnit ti = 0;
+ float ti = 0;
if (!addedTextIndent) {
- ti = textIndent;
- childMin+=ti; beginMin += ti;
- childMax+=ti; beginMax += ti;
+ ti = textIndent.ceilToFloat();
+
+ childMin += ti;
+ childMax += ti;
+ beginMin += ti;
+ beginMax += ti;
if (childMin < 0)
textIndent = childMin;
diff --git a/Source/WebCore/rendering/RenderBlock.h b/Source/WebCore/rendering/RenderBlock.h
index 2c7fe3628..11b698b45 100644
--- a/Source/WebCore/rendering/RenderBlock.h
+++ b/Source/WebCore/rendering/RenderBlock.h
@@ -985,6 +985,8 @@ protected:
virtual bool recomputeLogicalWidth();
+ virtual bool canCollapseAnonymousBlockChild() const { return true; }
+
public:
LayoutUnit offsetFromLogicalTopOfFirstPage() const;
RenderRegion* regionAtBlockOffset(LayoutUnit) const;
diff --git a/Source/WebCore/rendering/RenderBlockLineLayout.cpp b/Source/WebCore/rendering/RenderBlockLineLayout.cpp
index 6b904b2cb..55377d986 100755
--- a/Source/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/Source/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -997,7 +997,7 @@ static inline void constructBidiRuns(InlineBidiResolver& topResolver, BidiRunLis
if (unicodeBidi == Plaintext)
determineDirectionality(direction, InlineIterator(isolatedInline, isolatedRun->object(), 0));
else {
- ASSERT(unicodeBidi == Isolate || unicodeBidi == OverrideIsolate);
+ ASSERT(unicodeBidi == Isolate || unicodeBidi == IsolateOverride);
direction = isolatedInline->style()->direction();
}
isolatedResolver.setStatus(statusWithDirection(direction, isOverride(unicodeBidi)));
@@ -1496,8 +1496,13 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, LayoutUnit& repain
deleteEllipsisLineBoxes();
if (firstChild()) {
- // layout replaced elements
+ // In full layout mode, clear the line boxes of children upfront. Otherwise,
+ // siblings can run into stale root lineboxes during layout. Then layout
+ // the replaced elements later. In partial layout mode, line boxes are not
+ // deleted and only dirtied. In that case, we can layout the replaced
+ // elements at the same time.
bool hasInlineChild = false;
+ Vector<RenderBox*> replacedChildren;
for (InlineWalker walker(this); !walker.atEnd(); walker.advance()) {
RenderObject* o = walker.current();
if (!hasInlineChild && o->isInline())
@@ -1517,9 +1522,13 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, LayoutUnit& repain
o->containingBlock()->insertPositionedObject(box);
else if (o->isFloating())
layoutState.floats().append(FloatWithRect(box));
- else if (layoutState.isFullLayout() || o->needsLayout()) {
- // Replaced elements
- toRenderBox(o)->dirtyLineBoxes(layoutState.isFullLayout());
+ else if (isFullLayout || o->needsLayout()) {
+ // Replaced element.
+ box->dirtyLineBoxes(isFullLayout);
+ if (isFullLayout)
+ replacedChildren.append(box);
+ else
+ o->layoutIfNeeded();
}
} else if (o->isText() || (o->isRenderInline() && !walker.atEndOfInline())) {
if (!o->isText())
@@ -1530,6 +1539,9 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, LayoutUnit& repain
}
}
+ for (size_t i = 0; i < replacedChildren.size(); i++)
+ replacedChildren[i]->layoutIfNeeded();
+
layoutRunsAndFloats(layoutState, hasInlineChild);
}
@@ -2289,7 +2301,6 @@ InlineIterator RenderBlock::LineBreaker::nextLineBreak(InlineBidiResolver& resol
width.addUncommittedWidth(borderPaddingMarginStart(flowBox) + borderPaddingMarginEnd(flowBox));
} else if (current.m_obj->isReplaced()) {
RenderBox* replacedBox = toRenderBox(current.m_obj);
- replacedBox->layoutIfNeeded();
// Break on replaced elements if either has normal white-space.
if ((autoWrap || RenderStyle::autoWrap(lastWS)) && (!current.m_obj->isImage() || allowImagesToBreak)) {
@@ -2333,10 +2344,10 @@ InlineIterator RenderBlock::LineBreaker::nextLineBreak(InlineBidiResolver& resol
bool isSVGText = t->isSVGInlineText();
#endif
- RenderStyle* style = t->style(lineInfo.isFirstLine());
- if (style->hasTextCombine() && current.m_obj->isCombineText() && !toRenderCombineText(current.m_obj)->isCombined())
+ if (t->style()->hasTextCombine() && current.m_obj->isCombineText() && !toRenderCombineText(current.m_obj)->isCombined())
toRenderCombineText(current.m_obj)->combineText();
+ RenderStyle* style = t->style(lineInfo.isFirstLine());
const Font& f = style->font();
bool isFixedPitch = f.isFixedPitch();
bool canHyphenate = style->hyphens() == HyphensAuto && WebCore::canHyphenate(style->locale());
@@ -2426,7 +2437,7 @@ InlineIterator RenderBlock::LineBreaker::nextLineBreak(InlineBidiResolver& resol
appliedStartWidth = true;
}
- applyWordSpacing = wordSpacing && currentCharacterIsSpace && !previousCharacterIsSpace;
+ applyWordSpacing = wordSpacing && currentCharacterIsSpace;
if (!width.committedWidth() && autoWrap && !width.fitsOnLine())
width.fitBelowFloats();
diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp
index faf9102e1..8d45f3ff8 100644
--- a/Source/WebCore/rendering/RenderBox.cpp
+++ b/Source/WebCore/rendering/RenderBox.cpp
@@ -1282,6 +1282,8 @@ void RenderBox::mapLocalToContainer(RenderBoxModelObject* repaintContainer, Tran
*wasFixed = mode & IsFixed;
LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(transformState.mappedPoint()));
+ if (mode & SnapOffsetForTransforms)
+ containerOffset = roundedIntSize(containerOffset);
bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || style()->preserves3D());
if (mode & UseTransforms && shouldUseTransformFromContainer(o)) {
@@ -1508,7 +1510,7 @@ void RenderBox::computeRectForRepaint(RenderBoxModelObject* repaintContainer, La
LayoutState* layoutState = v->layoutState();
if (layer() && layer()->transform())
- rect = layer()->transform()->mapRect(rect);
+ rect = layer()->transform()->mapRect(pixelSnappedIntRect(rect));
if (styleToUse->position() == RelativePosition && layer())
rect.move(layer()->relativePositionOffset());
@@ -1547,7 +1549,7 @@ void RenderBox::computeRectForRepaint(RenderBoxModelObject* repaintContainer, La
// in the parent's coordinate space that encloses us.
if (layer() && layer()->transform()) {
fixed = position == FixedPosition;
- rect = layer()->transform()->mapRect(rect);
+ rect = layer()->transform()->mapRect(pixelSnappedIntRect(rect));
topLeft = rect.location();
topLeft.move(locationOffset());
} else if (position == FixedPosition)
@@ -2144,10 +2146,7 @@ LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height)
cb->computeLogicalHeight();
result = cb->contentLogicalHeight();
cb->setLogicalHeight(oldHeight);
- } else if (cb->isRoot() && isOutOfFlowPositioned())
- // Match the positioned objects behavior, which is that positioned objects will fill their viewport
- // always. Note we could only hit this case by recurring into computePercentageLogicalHeight on a positioned containing block.
- result = cb->computeContentBoxLogicalHeight(cb->availableLogicalHeight());
+ }
if (result != -1) {
result = valueForLength(height, result);
@@ -2270,7 +2269,7 @@ LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(SizeType sizeType, Lengt
}
}
availableHeight = computeContentBoxLogicalHeight(valueForLength(logicalHeight, availableHeight));
- if (cb->style()->logicalHeight().isFixed())
+ if (cb->isBox() && cb->style()->logicalHeight().isFixed())
availableHeight = max<LayoutUnit>(0, availableHeight - toRenderBox(cb)->scrollbarLogicalHeight());
return availableHeight;
}
diff --git a/Source/WebCore/rendering/RenderBox.h b/Source/WebCore/rendering/RenderBox.h
index 2dcc3cdc7..89ba90740 100644
--- a/Source/WebCore/rendering/RenderBox.h
+++ b/Source/WebCore/rendering/RenderBox.h
@@ -42,7 +42,9 @@ public:
RenderBox(Node*);
virtual ~RenderBox();
- virtual bool requiresLayer() const OVERRIDE { return isRoot() || isOutOfFlowPositioned() || isRelPositioned() || isTransparent() || hasOverflowClip() || hasTransform() || hasHiddenBackface() || hasMask() || hasReflection() || hasFilter() || style()->specifiesColumns(); }
+ // hasAutoZIndex only returns true if the element is positioned or a flex-item since
+ // position:static elements that are not flex-items get their z-index coerced to auto.
+ virtual bool requiresLayer() const OVERRIDE { return isRoot() || isOutOfFlowPositioned() || isRelPositioned() || isTransparent() || hasOverflowClip() || hasTransform() || hasHiddenBackface() || hasMask() || hasReflection() || hasFilter() || style()->specifiesColumns() || !style()->hasAutoZIndex(); }
// Use this with caution! No type checking is done!
RenderBox* firstChildBox() const;
@@ -519,7 +521,7 @@ protected:
virtual bool shouldComputeSizeAsReplaced() const { return isReplaced() && !isInlineBlockOrInlineTable(); }
- virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState&, MapLocalToContainerFlags mode = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
+ virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState&, MapLocalToContainerFlags mode = ApplyContainerFlip | SnapOffsetForTransforms, bool* wasFixed = 0) const OVERRIDE;
virtual const RenderObject* pushMappingToContainer(const RenderBoxModelObject*, RenderGeometryMap&) const;
virtual void mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState&) const;
diff --git a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
index 830efb2b0..9c5587979 100644
--- a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
+++ b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
@@ -883,6 +883,7 @@ void RenderDeprecatedFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool
if (childDoesNotAffectWidthOrFlexing(child))
continue;
+ child->clearOverrideSize();
if (relayoutChildren || (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent()))
|| (child->style()->height().isAuto() && child->isBlockFlow())) {
child->setChildNeedsLayout(true, MarkOnlyThis);
@@ -921,7 +922,6 @@ void RenderDeprecatedFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool
child->setChildNeedsLayout(true, MarkOnlyThis);
child->setOverrideLogicalContentHeight(newHeight - child->borderAndPaddingHeight());
child->layoutIfNeeded();
- child->clearOverrideSize();
// FIXME: For now don't support RTL.
if (style()->direction() != LTR)
@@ -964,14 +964,12 @@ void RenderDeprecatedFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool
continue;
LayoutUnit blockRightEdge = destBlock->logicalRightOffsetForLine(lastVisibleLine->y(), false);
- LayoutUnit blockLeftEdge = destBlock->logicalLeftOffsetForLine(lastVisibleLine->y(), false);
-
- LayoutUnit blockEdge = leftToRight ? blockRightEdge : blockLeftEdge;
- if (!lastVisibleLine->lineCanAccommodateEllipsis(leftToRight, blockEdge, lastVisibleLine->x() + lastVisibleLine->logicalWidth(), totalWidth))
+ if (!lastVisibleLine->lineCanAccommodateEllipsis(leftToRight, blockRightEdge, lastVisibleLine->x() + lastVisibleLine->logicalWidth(), totalWidth))
continue;
// Let the truncation code kick in.
// FIXME: the text alignment should be recomputed after the width changes due to truncation.
+ LayoutUnit blockLeftEdge = destBlock->logicalLeftOffsetForLine(lastVisibleLine->y(), false);
lastVisibleLine->placeEllipsis(anchorBox ? ellipsisAndSpaceStr : ellipsisStr, leftToRight, blockLeftEdge, blockRightEdge, totalWidth, anchorBox);
destBlock->setHasMarkupTruncation(true);
}
@@ -984,6 +982,7 @@ void RenderDeprecatedFlexibleBox::clearLineClamp()
if (childDoesNotAffectWidthOrFlexing(child))
continue;
+ child->clearOverrideSize();
if ((child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent()))
|| (child->style()->height().isAuto() && child->isBlockFlow())) {
child->setChildNeedsLayout(true);
diff --git a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h
index 958bdf32f..851fbe464 100644
--- a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h
+++ b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h
@@ -47,9 +47,9 @@ public:
void layoutVerticalBox(bool relayoutChildren);
virtual bool avoidsFloats() const { return true; }
-
virtual bool isDeprecatedFlexibleBox() const { return true; }
virtual bool isStretchingChildren() const { return m_stretchingChildren; }
+ virtual bool canCollapseAnonymousBlockChild() const OVERRIDE { return false; }
void placeChild(RenderBox* child, const LayoutPoint& location);
diff --git a/Source/WebCore/rendering/RenderFlexibleBox.h b/Source/WebCore/rendering/RenderFlexibleBox.h
index bd05b450c..d418ce84c 100644
--- a/Source/WebCore/rendering/RenderFlexibleBox.h
+++ b/Source/WebCore/rendering/RenderFlexibleBox.h
@@ -45,6 +45,7 @@ public:
virtual bool isFlexibleBox() const OVERRIDE { return true; }
virtual bool avoidsFloats() const OVERRIDE { return true; }
+ virtual bool canCollapseAnonymousBlockChild() const OVERRIDE { return false; }
virtual void computePreferredLogicalWidths() OVERRIDE;
virtual void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) OVERRIDE;
diff --git a/Source/WebCore/rendering/RenderFlowThread.cpp b/Source/WebCore/rendering/RenderFlowThread.cpp
index 1c805c027..429dad3a9 100644
--- a/Source/WebCore/rendering/RenderFlowThread.cpp
+++ b/Source/WebCore/rendering/RenderFlowThread.cpp
@@ -678,9 +678,11 @@ void RenderFlowThread::computeOverflowStateForRegions(LayoutUnit oldClientAfterE
// might not be taken into account because the render flow thread height is greater that that regions height + its visual overflow
// because of how computeLogicalHeight is implemented for RenderFlowThread (as a sum of all regions height).
// This means that the middle region will be marked as fit (even if it has visual overflow flowing into the next region)
- if (hasRenderOverflow())
+ if (hasRenderOverflow() && ( (isHorizontalWritingMode() && visualOverflowRect().maxY() > clientBoxRect().maxY())
+ || (!isHorizontalWritingMode() && visualOverflowRect().maxX() > clientBoxRect().maxX())))
height = isHorizontalWritingMode() ? visualOverflowRect().maxY() : visualOverflowRect().maxX();
+ RenderRegion* lastReg = lastRegion();
for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
RenderRegion* region = *iter;
if (!region->isValid()) {
@@ -693,7 +695,7 @@ void RenderFlowThread::computeOverflowStateForRegions(LayoutUnit oldClientAfterE
RenderRegion::RegionState state = RenderRegion::RegionFit;
if (flowMin <= 0)
state = RenderRegion::RegionEmpty;
- if (flowMax > 0)
+ if (flowMax > 0 && region == lastReg)
state = RenderRegion::RegionOverset;
region->setRegionState(state);
// determine whether the NamedFlow object should dispatch a regionLayoutUpdate event
@@ -707,7 +709,6 @@ void RenderFlowThread::computeOverflowStateForRegions(LayoutUnit oldClientAfterE
// With the regions overflow state computed we can also set the overset flag for the named flow.
// If there are no valid regions in the chain, overset is true
- RenderRegion* lastReg = lastRegion();
m_overset = lastReg ? lastReg->regionState() == RenderRegion::RegionOverset : true;
}
diff --git a/Source/WebCore/rendering/RenderGeometryMap.cpp b/Source/WebCore/rendering/RenderGeometryMap.cpp
index edf59787c..fe16b9b8e 100644
--- a/Source/WebCore/rendering/RenderGeometryMap.cpp
+++ b/Source/WebCore/rendering/RenderGeometryMap.cpp
@@ -92,7 +92,7 @@ void RenderGeometryMap::mapToAbsolute(TransformState& transformState) const
{
// If the mapping includes something like columns, we have to go via renderers.
if (hasNonUniformStep()) {
- m_mapping.last().m_renderer->mapLocalToContainer(0, transformState, UseTransforms | ApplyContainerFlip);
+ m_mapping.last().m_renderer->mapLocalToContainer(0, transformState, UseTransforms | ApplyContainerFlip | SnapOffsetForTransforms);
return;
}
diff --git a/Source/WebCore/rendering/RenderGrid.h b/Source/WebCore/rendering/RenderGrid.h
index f9b0879bd..e5017fae0 100644
--- a/Source/WebCore/rendering/RenderGrid.h
+++ b/Source/WebCore/rendering/RenderGrid.h
@@ -41,6 +41,7 @@ public:
virtual void computePreferredLogicalWidths() OVERRIDE;
virtual bool avoidsFloats() const OVERRIDE { return true; }
+ virtual bool canCollapseAnonymousBlockChild() const OVERRIDE { return false; }
private:
class GridTrack;
diff --git a/Source/WebCore/rendering/RenderInline.cpp b/Source/WebCore/rendering/RenderInline.cpp
index da120bed1..35ba973bd 100644
--- a/Source/WebCore/rendering/RenderInline.cpp
+++ b/Source/WebCore/rendering/RenderInline.cpp
@@ -338,11 +338,12 @@ void RenderInline::addChildIgnoringContinuation(RenderObject* newChild, RenderOb
newChild->setNeedsLayoutAndPrefWidthsRecalc();
}
-RenderInline* RenderInline::cloneInline(RenderInline* src)
+RenderInline* RenderInline::clone() const
{
- RenderInline* o = new (src->renderArena()) RenderInline(src->node());
- o->setStyle(src->style());
- return o;
+ RenderInline* cloneInline = new (renderArena()) RenderInline(node());
+ cloneInline->setStyle(style());
+ cloneInline->setInRenderFlowThread(inRenderFlowThread());
+ return cloneInline;
}
void RenderInline::splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock,
@@ -350,8 +351,8 @@ void RenderInline::splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock,
RenderObject* beforeChild, RenderBoxModelObject* oldCont)
{
// Create a clone of this inline.
- RenderInline* clone = cloneInline(this);
- clone->setContinuation(oldCont);
+ RenderInline* cloneInline = clone();
+ cloneInline->setContinuation(oldCont);
// Now take all of the children from beforeChild to the end and remove
// them from |this| and place them in the clone.
@@ -359,12 +360,12 @@ void RenderInline::splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock,
while (o) {
RenderObject* tmp = o;
o = tmp->nextSibling();
- clone->addChildIgnoringContinuation(children()->removeChildNode(this, tmp), 0);
+ cloneInline->addChildIgnoringContinuation(children()->removeChildNode(this, tmp), 0);
tmp->setNeedsLayoutAndPrefWidthsRecalc();
}
// Hook |clone| up as the continuation of the middle block.
- middleBlock->setContinuation(clone);
+ middleBlock->setContinuation(cloneInline);
// We have been reparented and are now under the fromBlock. We need
// to walk up our inline parent chain until we hit the containing block.
@@ -382,17 +383,17 @@ void RenderInline::splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock,
ASSERT(curr->isRenderInline());
if (splitDepth < cMaxSplitDepth) {
// Create a new clone.
- RenderInline* cloneChild = clone;
- clone = cloneInline(toRenderInline(curr));
+ RenderInline* cloneChild = cloneInline;
+ cloneInline = toRenderInline(curr)->clone();
// Insert our child clone as the first child.
- clone->addChildIgnoringContinuation(cloneChild, 0);
+ cloneInline->addChildIgnoringContinuation(cloneChild, 0);
// Hook the clone up as a continuation of |curr|.
RenderInline* inlineCurr = toRenderInline(curr);
oldCont = inlineCurr->continuation();
- inlineCurr->setContinuation(clone);
- clone->setContinuation(oldCont);
+ inlineCurr->setContinuation(cloneInline);
+ cloneInline->setContinuation(oldCont);
// Someone may have indirectly caused a <q> to split. When this happens, the :after content
// has to move into the inline continuation. Call updateBeforeAfterContent to ensure that the inline's :after
@@ -406,7 +407,7 @@ void RenderInline::splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock,
while (o) {
RenderObject* tmp = o;
o = tmp->nextSibling();
- clone->addChildIgnoringContinuation(inlineCurr->children()->removeChildNode(curr, tmp), 0);
+ cloneInline->addChildIgnoringContinuation(inlineCurr->children()->removeChildNode(curr, tmp), 0);
tmp->setNeedsLayoutAndPrefWidthsRecalc();
}
}
@@ -418,7 +419,7 @@ void RenderInline::splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock,
}
// Now we are at the block level. We need to put the clone into the toBlock.
- toBlock->children()->appendChildNode(toBlock, clone);
+ toBlock->children()->appendChildNode(toBlock, cloneInline);
// Now take all the children after currChild and remove them from the fromBlock
// and put them in the toBlock.
@@ -1144,6 +1145,8 @@ void RenderInline::mapLocalToContainer(RenderBoxModelObject* repaintContainer, T
}
LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(transformState.mappedPoint()));
+ if (mode & SnapOffsetForTransforms)
+ containerOffset = roundedIntSize(containerOffset);
bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || style()->preserves3D());
if (mode & UseTransforms && shouldUseTransformFromContainer(o)) {
diff --git a/Source/WebCore/rendering/RenderInline.h b/Source/WebCore/rendering/RenderInline.h
index e207caf58..bb43289be 100644
--- a/Source/WebCore/rendering/RenderInline.h
+++ b/Source/WebCore/rendering/RenderInline.h
@@ -135,7 +135,7 @@ private:
virtual LayoutRect rectWithOutlineForRepaint(RenderBoxModelObject* repaintContainer, LayoutUnit outlineWidth) const;
virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, LayoutRect&, bool fixed) const;
- virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState&, MapLocalToContainerFlags mode = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
+ virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState&, MapLocalToContainerFlags mode = ApplyContainerFlip | SnapOffsetForTransforms, bool* wasFixed = 0) const OVERRIDE;
virtual const RenderObject* pushMappingToContainer(const RenderBoxModelObject* ancestorToStopAt, RenderGeometryMap&) const;
virtual VisiblePosition positionForPoint(const LayoutPoint&);
@@ -165,7 +165,7 @@ private:
virtual void updateBoxModelInfoFromStyle();
- static RenderInline* cloneInline(RenderInline* src);
+ RenderInline* clone() const;
void paintOutlineForLine(GraphicsContext*, const LayoutPoint&, const LayoutRect& prevLine, const LayoutRect& thisLine,
const LayoutRect& nextLine, const Color);
diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp
index 373beab8a..fe75262c8 100644
--- a/Source/WebCore/rendering/RenderLayer.cpp
+++ b/Source/WebCore/rendering/RenderLayer.cpp
@@ -565,7 +565,7 @@ void RenderLayer::updateTransform()
RenderBox* box = renderBox();
ASSERT(box);
m_transform->makeIdentity();
- box->style()->applyTransform(*m_transform, box->borderBoxRect().size(), RenderStyle::IncludeTransformOrigin);
+ box->style()->applyTransform(*m_transform, box->pixelSnappedBorderBoxRect().size(), RenderStyle::IncludeTransformOrigin);
makeMatrixRenderable(*m_transform, canRender3DTransforms());
}
@@ -582,7 +582,7 @@ TransformationMatrix RenderLayer::currentTransform() const
if (renderer()->style()->isRunningAcceleratedAnimation()) {
TransformationMatrix currTransform;
RefPtr<RenderStyle> style = renderer()->animation()->getAnimatedStyleForRenderer(renderer());
- style->applyTransform(currTransform, renderBox()->borderBoxRect().size(), RenderStyle::IncludeTransformOrigin);
+ style->applyTransform(currTransform, renderBox()->pixelSnappedBorderBoxRect().size(), RenderStyle::IncludeTransformOrigin);
makeMatrixRenderable(currTransform, canRender3DTransforms());
return currTransform;
}
@@ -890,7 +890,7 @@ TransformationMatrix RenderLayer::perspectiveTransform() const
return TransformationMatrix();
// Maybe fetch the perspective from the backing?
- const LayoutRect borderBox = toRenderBox(renderer())->borderBoxRect();
+ const IntRect borderBox = toRenderBox(renderer())->pixelSnappedBorderBoxRect();
const float boxWidth = borderBox.width();
const float boxHeight = borderBox.height();
@@ -2852,7 +2852,7 @@ bool RenderLayer::scroll(ScrollDirection direction, ScrollGranularity granularit
void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect, PaintBehavior paintBehavior, RenderObject* paintingRoot, RenderRegion* region, PaintLayerFlags paintFlags)
{
OverlapTestRequestMap overlapTestRequests;
- paintLayer(this, context, damageRect, paintBehavior, paintingRoot, region, &overlapTestRequests, paintFlags);
+ paintLayer(this, context, enclosingIntRect(damageRect), LayoutSize(), paintBehavior, paintingRoot, region, &overlapTestRequests, paintFlags);
OverlapTestRequestMap::iterator end = overlapTestRequests.end();
for (OverlapTestRequestMap::iterator it = overlapTestRequests.begin(); it != end; ++it)
it->first->setOverlapTestResult(false);
@@ -2862,7 +2862,7 @@ void RenderLayer::paintOverlayScrollbars(GraphicsContext* context, const LayoutR
{
if (!m_containsDirtyOverlayScrollbars)
return;
- paintLayer(this, context, damageRect, paintBehavior, paintingRoot, 0, 0, PaintLayerHaveTransparency | PaintLayerTemporaryClipRects
+ paintLayer(this, context, damageRect, LayoutSize(), paintBehavior, paintingRoot, 0, 0, PaintLayerHaveTransparency | PaintLayerTemporaryClipRects
| PaintLayerPaintingOverlayScrollbars);
m_containsDirtyOverlayScrollbars = false;
}
@@ -2959,7 +2959,7 @@ static inline bool shouldSuppressPaintingLayer(RenderLayer* layer)
void RenderLayer::paintLayer(RenderLayer* rootLayer, GraphicsContext* context,
- const LayoutRect& paintDirtyRect, PaintBehavior paintBehavior,
+ const LayoutRect& paintDirtyRect, const LayoutSize& subPixelAccumulation, PaintBehavior paintBehavior,
RenderObject* paintingRoot, RenderRegion* region, OverlapTestRequestMap* overlapTestRequests,
PaintLayerFlags paintFlags)
{
@@ -3017,11 +3017,14 @@ void RenderLayer::paintLayer(RenderLayer* rootLayer, GraphicsContext* context,
}
// Adjust the transform such that the renderer's upper left corner will paint at (0,0) in user space.
- // This involves subtracting out the position of the layer in our current coordinate space.
+ // This involves subtracting out the position of the layer in our current coordinate space, but preserving
+ // the accumulated error for sub-pixel layout.
LayoutPoint delta;
convertToLayerCoords(rootLayer, delta);
TransformationMatrix transform(layerTransform);
- transform.translateRight(delta.x(), delta.y());
+ IntPoint roundedDelta = roundedIntPoint(delta);
+ transform.translateRight(roundedDelta.x(), roundedDelta.y());
+ LayoutSize adjustedSubPixelAccumulation = subPixelAccumulation + (delta - roundedDelta);
// Apply the transform.
{
@@ -3029,7 +3032,7 @@ void RenderLayer::paintLayer(RenderLayer* rootLayer, GraphicsContext* context,
context->concatCTM(transform.toAffineTransform());
// Now do a paint with the root layer shifted to be us.
- paintLayerContentsAndReflection(this, context, transform.inverse().mapRect(paintDirtyRect), paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags);
+ paintLayerContentsAndReflection(this, context, enclosingIntRect(transform.inverse().mapRect(paintDirtyRect)), adjustedSubPixelAccumulation, paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags);
}
// Restore the clip.
@@ -3039,11 +3042,11 @@ void RenderLayer::paintLayer(RenderLayer* rootLayer, GraphicsContext* context,
return;
}
- paintLayerContentsAndReflection(rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags);
+ paintLayerContentsAndReflection(rootLayer, context, paintDirtyRect, subPixelAccumulation, paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags);
}
void RenderLayer::paintLayerContentsAndReflection(RenderLayer* rootLayer, GraphicsContext* context,
- const LayoutRect& paintDirtyRect, PaintBehavior paintBehavior,
+ const LayoutRect& paintDirtyRect, const LayoutSize& subPixelAccumulation, PaintBehavior paintBehavior,
RenderObject* paintingRoot, RenderRegion* region, OverlapTestRequestMap* overlapTestRequests,
PaintLayerFlags paintFlags)
{
@@ -3055,16 +3058,16 @@ void RenderLayer::paintLayerContentsAndReflection(RenderLayer* rootLayer, Graphi
if (m_reflection && !m_paintingInsideReflection) {
// Mark that we are now inside replica painting.
m_paintingInsideReflection = true;
- reflectionLayer()->paintLayer(rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, localPaintFlags | PaintLayerPaintingReflection);
+ reflectionLayer()->paintLayer(rootLayer, context, paintDirtyRect, subPixelAccumulation, paintBehavior, paintingRoot, region, overlapTestRequests, localPaintFlags | PaintLayerPaintingReflection);
m_paintingInsideReflection = false;
}
localPaintFlags |= PaintLayerPaintingCompositingAllPhases;
- paintLayerContents(rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, localPaintFlags);
+ paintLayerContents(rootLayer, context, paintDirtyRect, subPixelAccumulation, paintBehavior, paintingRoot, region, overlapTestRequests, localPaintFlags);
}
void RenderLayer::paintLayerContents(RenderLayer* rootLayer, GraphicsContext* context,
- const LayoutRect& parentPaintDirtyRect, PaintBehavior paintBehavior,
+ const LayoutRect& parentPaintDirtyRect, const LayoutSize& subPixelAccumulation, PaintBehavior paintBehavior,
RenderObject* paintingRoot, RenderRegion* region, OverlapTestRequestMap* overlapTestRequests,
PaintLayerFlags paintFlags)
{
@@ -3123,7 +3126,7 @@ void RenderLayer::paintLayerContents(RenderLayer* rootLayer, GraphicsContext* co
if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars) {
calculateRects(rootLayer, region, (localPaintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, paintDirtyRect, layerBounds, damageRect, clipRectToApply, outlineRect);
- paintOffset = toPoint(layerBounds.location() - renderBoxLocation());
+ paintOffset = toPoint(layerBounds.location() - renderBoxLocation() + subPixelAccumulation);
}
bool forceBlackText = paintBehavior & PaintBehaviorForceBlackText;
@@ -3215,20 +3218,6 @@ void RenderLayer::paintLayerContents(RenderLayer* rootLayer, GraphicsContext* co
// Now walk the sorted list of children with positive z-indices.
paintList(posZOrderList(), rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, localPaintFlags);
}
-
- if ((localPaintFlags & PaintLayerPaintingCompositingMaskPhase) && shouldPaintContent && renderer()->hasMask() && !selectionOnly) {
- if (useClipRect)
- clipToRect(rootLayer, context, paintDirtyRect, damageRect, DoNotIncludeSelfForBorderRadius); // Mask painting will handle clipping to self.
-
- // Paint the mask.
- PaintInfo paintInfo(context, pixelSnappedIntRect(damageRect.rect()), PaintPhaseMask, false, paintingRootForRenderer, region, 0);
- renderer()->paint(paintInfo, paintOffset);
-
- if (useClipRect) {
- // Restore the clip.
- restoreClip(context, paintDirtyRect, damageRect);
- }
- }
if (isPaintingOverlayScrollbars) {
clipToRect(rootLayer, context, paintDirtyRect, damageRect);
@@ -3247,7 +3236,21 @@ void RenderLayer::paintLayerContents(RenderLayer* rootLayer, GraphicsContext* co
// Make sure that we now use the original transparency context.
ASSERT(transparencyLayerContext == context);
-
+
+ if ((localPaintFlags & PaintLayerPaintingCompositingMaskPhase) && shouldPaintContent && renderer()->hasMask() && !selectionOnly) {
+ if (useClipRect)
+ clipToRect(rootLayer, context, paintDirtyRect, damageRect, DoNotIncludeSelfForBorderRadius); // Mask painting will handle clipping to self.
+
+ // Paint the mask.
+ PaintInfo paintInfo(context, pixelSnappedIntRect(damageRect.rect()), PaintPhaseMask, false, paintingRootForRenderer, region, 0);
+ renderer()->paint(paintInfo, paintOffset);
+
+ if (useClipRect) {
+ // Restore the clip.
+ restoreClip(context, paintDirtyRect, damageRect);
+ }
+ }
+
// End our transparency layer
if (haveTransparency && m_usedTransparency && !m_paintingInsideReflection) {
context->endTransparencyLayer();
@@ -3274,7 +3277,7 @@ void RenderLayer::paintList(Vector<RenderLayer*>* list, RenderLayer* rootLayer,
for (size_t i = 0; i < list->size(); ++i) {
RenderLayer* childLayer = list->at(i);
if (!childLayer->isPaginated())
- childLayer->paintLayer(rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags);
+ childLayer->paintLayer(rootLayer, context, paintDirtyRect, LayoutSize(), paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags);
else
paintPaginatedChildLayer(childLayer, rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags);
}
@@ -3365,7 +3368,7 @@ void RenderLayer::paintChildLayerIntoColumns(RenderLayer* childLayer, RenderLaye
newTransform.translateRight(roundToInt(offset.width()), roundToInt(offset.height()));
childLayer->m_transform = adoptPtr(new TransformationMatrix(newTransform));
- childLayer->paintLayer(rootLayer, context, localDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags);
+ childLayer->paintLayer(rootLayer, context, localDirtyRect, LayoutSize(), paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags);
if (oldHasTransform)
childLayer->m_transform = adoptPtr(new TransformationMatrix(oldTransform));
else
@@ -3961,7 +3964,7 @@ void RenderLayer::calculateClipRects(const RenderLayer* rootLayer, RenderRegion*
// some transformed layer boundary, for example, in the RenderLayerCompositor overlapMap, where
// clipRects are needed in view space.
LayoutPoint offset;
- offset = roundedIntPoint(renderer()->localToContainerPoint(FloatPoint(), rootLayer->renderer()));
+ offset = roundedLayoutPoint(renderer()->localToContainerPoint(FloatPoint(), rootLayer->renderer(), false, false, 0));
RenderView* view = renderer()->view();
ASSERT(view);
if (view && clipRects.fixed() && rootLayer->renderer() == view) {
@@ -4069,7 +4072,7 @@ void RenderLayer::calculateRects(const RenderLayer* rootLayer, RenderRegion* reg
backgroundRect.intersect(layerBoundsWithVisualOverflow);
} else {
// Shift the bounds to be for our region only.
- LayoutRect bounds = pixelSnappedIntRect(renderBox()->borderBoxRectInRegion(region));
+ LayoutRect bounds = renderBox()->borderBoxRectInRegion(region);
bounds.moveBy(offset);
backgroundRect.intersect(bounds);
}
@@ -4122,12 +4125,12 @@ LayoutRect RenderLayer::localClipRect() const
void RenderLayer::addBlockSelectionGapsBounds(const LayoutRect& bounds)
{
- m_blockSelectionGapsBounds.unite(bounds);
+ m_blockSelectionGapsBounds.unite(enclosingIntRect(bounds));
}
void RenderLayer::clearBlockSelectionGapsBounds()
{
- m_blockSelectionGapsBounds = LayoutRect();
+ m_blockSelectionGapsBounds = IntRect();
for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
child->clearBlockSelectionGapsBounds();
}
diff --git a/Source/WebCore/rendering/RenderLayer.h b/Source/WebCore/rendering/RenderLayer.h
index dd6df15a1..00c5c19d2 100644
--- a/Source/WebCore/rendering/RenderLayer.h
+++ b/Source/WebCore/rendering/RenderLayer.h
@@ -397,6 +397,10 @@ public:
bool isPaginated() const { return m_isPaginated; }
void updateTransform();
+
+#if ENABLE(CSS_COMPOSITING)
+ void updateBlendMode();
+#endif
const LayoutSize& relativePositionOffset() const { return m_relativeOffset; }
@@ -710,13 +714,13 @@ private:
void updateCompositingAndLayerListsIfNeeded();
- void paintLayer(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect,
+ void paintLayer(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect, const LayoutSize& subPixelAccumulation,
PaintBehavior, RenderObject* paintingRoot, RenderRegion* = 0, OverlapTestRequestMap* = 0,
PaintLayerFlags = 0);
- void paintLayerContentsAndReflection(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect,
+ void paintLayerContentsAndReflection(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect, const LayoutSize& subPixelAccumulation,
PaintBehavior, RenderObject* paintingRoot, RenderRegion* = 0, OverlapTestRequestMap* = 0,
PaintLayerFlags = 0);
- void paintLayerContents(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect,
+ void paintLayerContents(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect, const LayoutSize& subPixelAccumulation,
PaintBehavior, RenderObject* paintingRoot, RenderRegion* = 0, OverlapTestRequestMap* = 0,
PaintLayerFlags = 0);
void paintList(Vector<RenderLayer*>*, RenderLayer* rootLayer, GraphicsContext* p,
@@ -931,6 +935,10 @@ protected:
bool m_hasFilterInfo : 1;
#endif
+#if ENABLE(CSS_COMPOSITING)
+ BlendMode m_blendMode;
+#endif
+
RenderBoxModelObject* m_renderer;
RenderLayer* m_parent;
@@ -992,7 +1000,7 @@ protected:
RenderScrollbarPart* m_resizer;
private:
- LayoutRect m_blockSelectionGapsBounds;
+ IntRect m_blockSelectionGapsBounds;
#if USE(ACCELERATED_COMPOSITING)
OwnPtr<RenderLayerBacking> m_backing;
diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp
index 415891731..6641bbc56 100644
--- a/Source/WebCore/rendering/RenderLayerBacking.cpp
+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp
@@ -204,6 +204,9 @@ void RenderLayerBacking::createPrimaryGraphicsLayer()
#if ENABLE(CSS_FILTERS)
updateLayerFilters(renderer()->style());
#endif
+#if ENABLE(CSS_COMPOSITING)
+ updateLayerBlendMode(renderer()->style());
+#endif
}
void RenderLayerBacking::destroyGraphicsLayers()
@@ -228,7 +231,7 @@ void RenderLayerBacking::updateLayerTransform(const RenderStyle* style)
// baked into it, and we don't want that.
TransformationMatrix t;
if (m_owningLayer->hasTransform()) {
- style->applyTransform(t, toRenderBox(renderer())->borderBoxRect().size(), RenderStyle::ExcludeTransformOrigin);
+ style->applyTransform(t, toRenderBox(renderer())->pixelSnappedBorderBoxRect().size(), RenderStyle::ExcludeTransformOrigin);
makeMatrixRenderable(t, compositor()->canRender3DTransforms());
}
@@ -242,6 +245,12 @@ void RenderLayerBacking::updateLayerFilters(const RenderStyle* style)
}
#endif
+#if ENABLE(CSS_COMPOSITING)
+void RenderLayerBacking::updateLayerBlendMode(const RenderStyle*)
+{
+}
+#endif
+
static bool hasNonZeroTransformOrigin(const RenderObject* renderer)
{
RenderStyle* style = renderer->style();
@@ -452,6 +461,10 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
#if ENABLE(CSS_FILTERS)
updateLayerFilters(renderer()->style());
#endif
+
+#if ENABLE(CSS_COMPOSITING)
+ updateLayerBlendMode(renderer()->style());
+#endif
m_owningLayer->updateDescendantDependentFlags();
@@ -1183,6 +1196,12 @@ void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking)
compositor()->repaintInCompositedAncestor(m_owningLayer, compositedBounds());
}
+#if ENABLE(CSS_COMPOSITING)
+void RenderLayerBacking::setBlendMode(BlendMode)
+{
+}
+#endif
+
void RenderLayerBacking::setContentsNeedDisplay()
{
ASSERT(!paintsIntoCompositedAncestor());
@@ -1242,7 +1261,7 @@ void RenderLayerBacking::paintIntoLayer(RenderLayer* rootLayer, GraphicsContext*
paintFlags |= RenderLayer::PaintLayerPaintingCompositingMaskPhase;
// FIXME: GraphicsLayers need a way to split for RenderRegions.
- m_owningLayer->paintLayerContents(rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, 0, 0, paintFlags);
+ m_owningLayer->paintLayerContents(rootLayer, context, paintDirtyRect, LayoutSize(), paintBehavior, paintingRoot, 0, 0, paintFlags);
if (m_owningLayer->containsDirtyOverlayScrollbars())
m_owningLayer->paintOverlayScrollbars(context, paintDirtyRect, paintBehavior, paintingRoot);
diff --git a/Source/WebCore/rendering/RenderLayerBacking.h b/Source/WebCore/rendering/RenderLayerBacking.h
index 0f42d3fb9..f107dc279 100644
--- a/Source/WebCore/rendering/RenderLayerBacking.h
+++ b/Source/WebCore/rendering/RenderLayerBacking.h
@@ -165,6 +165,10 @@ public:
String nameForLayer() const;
+#if ENABLE(CSS_COMPOSITING)
+ void setBlendMode(BlendMode);
+#endif
+
private:
void createPrimaryGraphicsLayer();
void destroyGraphicsLayers();
@@ -196,7 +200,9 @@ private:
#if ENABLE(CSS_FILTERS)
void updateLayerFilters(const RenderStyle*);
#endif
-
+#if ENABLE(CSS_COMPOSITING)
+ void updateLayerBlendMode(const RenderStyle*);
+#endif
// Return the opacity value that this layer should use for compositing.
float compositingOpacity(float rendererOpacity) const;
diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp
index 6062aaec8..72ba4c2f8 100644
--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp
@@ -743,9 +743,18 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
haveComputedBounds = true;
compositingReason = overlapMap->overlapsLayers(absBounds) ? RenderLayer::IndirectCompositingForOverlap : RenderLayer::NoIndirectCompositingReason;
}
-
+
+#if ENABLE(VIDEO)
+ // Video is special. It's the only RenderLayer type that can both have
+ // RenderLayer children and whose children can't use its backing to render
+ // into. These children (the controls) always need to be promoted into their
+ // own layers to draw on top of the accelerated video.
+ if (compositingState.m_compositingAncestor && compositingState.m_compositingAncestor->renderer()->isVideo())
+ compositingReason = RenderLayer::IndirectCompositingForOverlap;
+#endif
+
layer->setIndirectCompositingReason(compositingReason);
-
+
// The children of this layer don't need to composite, unless there is
// a compositing layer among them, so start by inheriting the compositing
// ancestor with m_subtreeIsCompositing set to false.
@@ -763,14 +772,6 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
overlapMap->pushCompositingContainer();
}
-#if ENABLE(VIDEO)
- // Video is special. It's a replaced element with a content layer, but has shadow content
- // for the controller that must render in front. Without this, the controls fail to show
- // when the video element is a stacking context (e.g. due to opacity or transform).
- if (willBeComposited && layer->renderer()->isVideo())
- childState.m_subtreeIsCompositing = true;
-#endif
-
#if !ASSERT_DISABLED
LayerListMutationDetector mutationChecker(layer);
#endif
diff --git a/Source/WebCore/rendering/RenderLineBoxList.cpp b/Source/WebCore/rendering/RenderLineBoxList.cpp
index dbb5861c8..2739d4124 100644
--- a/Source/WebCore/rendering/RenderLineBoxList.cpp
+++ b/Source/WebCore/rendering/RenderLineBoxList.cpp
@@ -321,7 +321,7 @@ void RenderLineBoxList::dirtyLinesFromChangedChild(RenderObject* container, Rend
if (!firstBox) {
// For an empty inline, go ahead and propagate the check up to our parent, unless the parent
// is already dirty.
- if (container->isInline() && !container->parent()->ancestorLineBoxDirty()) {
+ if (container->isInline() && !container->ancestorLineBoxDirty()) {
container->parent()->dirtyLinesFromChangedChild(container);
container->setAncestorLineBoxDirty(); // Mark the container to avoid dirtying the same lines again across multiple destroy() calls of the same subtree.
}
@@ -361,7 +361,7 @@ void RenderLineBoxList::dirtyLinesFromChangedChild(RenderObject* container, Rend
// we won't find a previous sibling, but firstBox can be pointing to a following sibling.
// This isn't good enough, since we won't locate the root line box that encloses the removed
// <br>. We have to just over-invalidate a bit and go up to our parent.
- if (!inlineContainer->parent()->ancestorLineBoxDirty()) {
+ if (!inlineContainer->ancestorLineBoxDirty()) {
inlineContainer->parent()->dirtyLinesFromChangedChild(inlineContainer);
inlineContainer->setAncestorLineBoxDirty(); // Mark the container to avoid dirtying the same lines again across multiple destroy() calls of the same subtree.
}
diff --git a/Source/WebCore/rendering/RenderListBox.cpp b/Source/WebCore/rendering/RenderListBox.cpp
index 2f5ae2b6c..944ea5f08 100644
--- a/Source/WebCore/rendering/RenderListBox.cpp
+++ b/Source/WebCore/rendering/RenderListBox.cpp
@@ -105,12 +105,17 @@ RenderListBox::~RenderListBox()
frameView->removeScrollableArea(this);
}
+inline HTMLSelectElement* RenderListBox::selectElement() const
+{
+ return toHTMLSelectElement(node());
+}
+
void RenderListBox::updateFromElement()
{
FontCachePurgePreventer fontCachePurgePreventer;
if (m_optionsChanged) {
- const Vector<HTMLElement*>& listItems = toHTMLSelectElement(node())->listItems();
+ const Vector<HTMLElement*>& listItems = selectElement()->listItems();
int size = numItems();
float width = 0;
@@ -176,7 +181,7 @@ void RenderListBox::layout()
void RenderListBox::scrollToRevealSelection()
{
- HTMLSelectElement* select = toHTMLSelectElement(node());
+ HTMLSelectElement* select = selectElement();
m_scrollToRevealSelectionAfterLayout = false;
@@ -222,7 +227,7 @@ void RenderListBox::computePreferredLogicalWidths()
int RenderListBox::size() const
{
- int specifiedSize = toHTMLSelectElement(node())->size();
+ int specifiedSize = selectElement()->size();
if (specifiedSize > 1)
return max(minSize, specifiedSize);
@@ -237,7 +242,7 @@ int RenderListBox::numVisibleItems() const
int RenderListBox::numItems() const
{
- return toHTMLSelectElement(node())->listItems().size();
+ return selectElement()->listItems().size();
}
LayoutUnit RenderListBox::listHeight() const
@@ -326,7 +331,7 @@ void RenderListBox::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint&
if (!isSpatialNavigationEnabled(frame()))
return RenderBlock::addFocusRingRects(rects, additionalOffset);
- HTMLSelectElement* select = toHTMLSelectElement(node());
+ HTMLSelectElement* select = selectElement();
// Focus the last selected item.
int selectedItem = select->activeSelectionEndListIndex();
@@ -383,9 +388,9 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint&
{
FontCachePurgePreventer fontCachePurgePreventer;
- HTMLSelectElement* selectElement = toHTMLSelectElement(node());
+ HTMLSelectElement* select = selectElement();
- const Vector<HTMLElement*>& listItems = selectElement->listItems();
+ const Vector<HTMLElement*>& listItems = select->listItems();
HTMLElement* element = listItems[listIndex];
RenderStyle* itemStyle = element->renderStyle();
@@ -408,7 +413,7 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint&
if (frame()->selection()->isFocusedAndActive() && document()->focusedNode() == node())
textColor = theme()->activeListBoxSelectionForegroundColor();
// Honor the foreground color for disabled items
- else if (!element->disabled() && !selectElement->disabled())
+ else if (!element->disabled() && !select->disabled())
textColor = theme()->inactiveListBoxSelectionForegroundColor();
}
@@ -433,7 +438,7 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint&
void RenderListBox::paintItemBackground(PaintInfo& paintInfo, const LayoutPoint& paintOffset, int listIndex)
{
- const Vector<HTMLElement*>& listItems = toHTMLSelectElement(node())->listItems();
+ const Vector<HTMLElement*>& listItems = selectElement()->listItems();
HTMLElement* element = listItems[listIndex];
Color backColor;
@@ -528,7 +533,7 @@ void RenderListBox::panScroll(const IntPoint& panStartMousePosition)
return;
m_inAutoscroll = true;
- HTMLSelectElement* select = toHTMLSelectElement(node());
+ HTMLSelectElement* select = selectElement();
select->updateListBoxSelection(!select->multiple());
m_inAutoscroll = false;
}
@@ -557,7 +562,7 @@ void RenderListBox::autoscroll()
int endIndex = scrollToward(pos);
if (endIndex >= 0) {
- HTMLSelectElement* select = toHTMLSelectElement(node());
+ HTMLSelectElement* select = selectElement();
m_inAutoscroll = true;
if (!select->multiple())
@@ -571,7 +576,7 @@ void RenderListBox::autoscroll()
void RenderListBox::stopAutoscroll()
{
- toHTMLSelectElement(node())->listBoxOnChange();
+ selectElement()->listBoxOnChange();
}
bool RenderListBox::scrollToRevealElementAtListIndex(int index)
@@ -607,7 +612,7 @@ bool RenderListBox::logicalScroll(ScrollLogicalDirection direction, ScrollGranul
void RenderListBox::valueChanged(unsigned listIndex)
{
- HTMLSelectElement* element = toHTMLSelectElement(node());
+ HTMLSelectElement* element = selectElement();
element->setSelectedIndex(element->listToOptionIndex(listIndex));
element->dispatchFormControlChangeEvent();
}
@@ -693,7 +698,7 @@ bool RenderListBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re
{
if (!RenderBlock::nodeAtPoint(request, result, pointInContainer, accumulatedOffset, hitTestAction))
return false;
- const Vector<HTMLElement*>& listItems = toHTMLSelectElement(node())->listItems();
+ const Vector<HTMLElement*>& listItems = selectElement()->listItems();
int size = numItems();
LayoutPoint adjustedLocation = accumulatedOffset + location();
diff --git a/Source/WebCore/rendering/RenderListBox.h b/Source/WebCore/rendering/RenderListBox.h
index 6038c4316..d968c8717 100644
--- a/Source/WebCore/rendering/RenderListBox.h
+++ b/Source/WebCore/rendering/RenderListBox.h
@@ -36,6 +36,8 @@
namespace WebCore {
+class HTMLSelectElement;
+
class RenderListBox : public RenderBlock, private ScrollableArea {
public:
RenderListBox(Element*);
@@ -56,6 +58,8 @@ public:
int size() const;
private:
+ HTMLSelectElement* selectElement() const;
+
virtual const char* renderName() const { return "RenderListBox"; }
virtual bool isListBox() const { return true; }
diff --git a/Source/WebCore/rendering/RenderListItem.cpp b/Source/WebCore/rendering/RenderListItem.cpp
index 2f7ff6e32..ef6147f26 100644
--- a/Source/WebCore/rendering/RenderListItem.cpp
+++ b/Source/WebCore/rendering/RenderListItem.cpp
@@ -76,6 +76,20 @@ void RenderListItem::willBeDestroyed()
RenderBlock::willBeDestroyed();
}
+void RenderListItem::insertedIntoTree()
+{
+ RenderBlock::insertedIntoTree();
+
+ updateListMarkerNumbers();
+}
+
+void RenderListItem::willBeRemovedFromTree()
+{
+ RenderBlock::willBeRemovedFromTree();
+
+ updateListMarkerNumbers();
+}
+
static bool isList(Node* node)
{
return (node->hasTagName(ulTag) || node->hasTagName(olTag));
diff --git a/Source/WebCore/rendering/RenderListItem.h b/Source/WebCore/rendering/RenderListItem.h
index 3c0af2f65..65b1297f5 100644
--- a/Source/WebCore/rendering/RenderListItem.h
+++ b/Source/WebCore/rendering/RenderListItem.h
@@ -58,6 +58,9 @@ private:
virtual void willBeDestroyed();
+ virtual void insertedIntoTree() OVERRIDE;
+ virtual void willBeRemovedFromTree() OVERRIDE;
+
virtual bool isEmpty() const;
virtual void paint(PaintInfo&, const LayoutPoint&);
diff --git a/Source/WebCore/rendering/RenderMenuList.cpp b/Source/WebCore/rendering/RenderMenuList.cpp
index 521cc0327..5b79d6c90 100644
--- a/Source/WebCore/rendering/RenderMenuList.cpp
+++ b/Source/WebCore/rendering/RenderMenuList.cpp
@@ -119,6 +119,11 @@ void RenderMenuList::adjustInnerStyle()
}
}
+inline HTMLSelectElement* RenderMenuList::selectElement() const
+{
+ return toHTMLSelectElement(node());
+}
+
void RenderMenuList::addChild(RenderObject* newChild, RenderObject* beforeChild)
{
createInnerBlock();
@@ -155,7 +160,7 @@ void RenderMenuList::styleDidChange(StyleDifference diff, const RenderStyle* old
void RenderMenuList::updateOptionsWidth()
{
float maxOptionWidth = 0;
- const Vector<HTMLElement*>& listItems = toHTMLSelectElement(node())->listItems();
+ const Vector<HTMLElement*>& listItems = selectElement()->listItems();
int size = listItems.size();
FontCachePurgePreventer fontCachePurgePreventer;
@@ -197,12 +202,12 @@ void RenderMenuList::updateFromElement()
if (m_popupIsVisible)
m_popup->updateFromElement();
else
- setTextFromOption(toHTMLSelectElement(node())->selectedIndex());
+ setTextFromOption(selectElement()->selectedIndex());
}
void RenderMenuList::setTextFromOption(int optionIndex)
{
- HTMLSelectElement* select = toHTMLSelectElement(node());
+ HTMLSelectElement* select = selectElement();
const Vector<HTMLElement*>& listItems = select->listItems();
int size = listItems.size();
@@ -318,7 +323,7 @@ void RenderMenuList::showPopup()
FloatPoint absTopLeft = localToAbsolute(FloatPoint(), false, true);
IntRect absBounds = absoluteBoundingBoxRectIgnoringTransforms();
absBounds.setLocation(roundedIntPoint(absTopLeft));
- HTMLSelectElement* select = toHTMLSelectElement(node());
+ HTMLSelectElement* select = selectElement();
m_popup->show(absBounds, document()->view(), select->optionToListIndex(select->selectedIndex()));
}
@@ -336,23 +341,23 @@ void RenderMenuList::valueChanged(unsigned listIndex, bool fireOnChange)
if (!doc || doc != doc->frame()->document())
return;
- HTMLSelectElement* select = toHTMLSelectElement(node());
+ HTMLSelectElement* select = selectElement();
select->optionSelectedByUser(select->listToOptionIndex(listIndex), fireOnChange);
}
void RenderMenuList::listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow)
{
- toHTMLSelectElement(node())->listBoxSelectItem(listIndex, allowMultiplySelections, shift, fireOnChangeNow);
+ selectElement()->listBoxSelectItem(listIndex, allowMultiplySelections, shift, fireOnChangeNow);
}
bool RenderMenuList::multiple() const
{
- return toHTMLSelectElement(node())->multiple();
+ return selectElement()->multiple();
}
void RenderMenuList::didSetSelectedIndex(int listIndex)
{
- didUpdateActiveOption(toHTMLSelectElement(node())->listToOptionIndex(listIndex));
+ didUpdateActiveOption(selectElement()->listToOptionIndex(listIndex));
}
void RenderMenuList::didUpdateActiveOption(int optionIndex)
@@ -364,7 +369,7 @@ void RenderMenuList::didUpdateActiveOption(int optionIndex)
return;
m_lastActiveIndex = optionIndex;
- HTMLSelectElement* select = toHTMLSelectElement(node());
+ HTMLSelectElement* select = selectElement();
int listIndex = select->optionToListIndex(optionIndex);
if (listIndex < 0 || listIndex >= static_cast<int>(select->listItems().size()))
return;
@@ -377,7 +382,7 @@ void RenderMenuList::didUpdateActiveOption(int optionIndex)
String RenderMenuList::itemText(unsigned listIndex) const
{
- HTMLSelectElement* select = toHTMLSelectElement(node());
+ HTMLSelectElement* select = selectElement();
const Vector<HTMLElement*>& listItems = select->listItems();
if (listIndex >= listItems.size())
return String();
@@ -406,7 +411,7 @@ String RenderMenuList::itemIcon(unsigned) const
String RenderMenuList::itemAccessibilityText(unsigned listIndex) const
{
// Allow the accessible name be changed if necessary.
- const Vector<HTMLElement*>& listItems = toHTMLSelectElement(node())->listItems();
+ const Vector<HTMLElement*>& listItems = selectElement()->listItems();
if (listIndex >= listItems.size())
return String();
return listItems[listIndex]->fastGetAttribute(aria_labelAttr);
@@ -414,7 +419,7 @@ String RenderMenuList::itemAccessibilityText(unsigned listIndex) const
String RenderMenuList::itemToolTip(unsigned listIndex) const
{
- const Vector<HTMLElement*>& listItems = toHTMLSelectElement(node())->listItems();
+ const Vector<HTMLElement*>& listItems = selectElement()->listItems();
if (listIndex >= listItems.size())
return String();
return listItems[listIndex]->title();
@@ -422,7 +427,7 @@ String RenderMenuList::itemToolTip(unsigned listIndex) const
bool RenderMenuList::itemIsEnabled(unsigned listIndex) const
{
- const Vector<HTMLElement*>& listItems = toHTMLSelectElement(node())->listItems();
+ const Vector<HTMLElement*>& listItems = selectElement()->listItems();
if (listIndex >= listItems.size())
return false;
HTMLElement* element = listItems[listIndex];
@@ -442,7 +447,7 @@ bool RenderMenuList::itemIsEnabled(unsigned listIndex) const
PopupMenuStyle RenderMenuList::itemStyle(unsigned listIndex) const
{
- const Vector<HTMLElement*>& listItems = toHTMLSelectElement(node())->listItems();
+ const Vector<HTMLElement*>& listItems = selectElement()->listItems();
if (listIndex >= listItems.size()) {
// If we are making an out of bounds access, then we want to use the style
// of a different option element (index 0). However, if there isn't an option element
@@ -462,7 +467,7 @@ PopupMenuStyle RenderMenuList::itemStyle(unsigned listIndex) const
Color RenderMenuList::itemBackgroundColor(unsigned listIndex) const
{
- const Vector<HTMLElement*>& listItems = toHTMLSelectElement(node())->listItems();
+ const Vector<HTMLElement*>& listItems = selectElement()->listItems();
if (listIndex >= listItems.size())
return style()->visitedDependentColor(CSSPropertyBackgroundColor);
HTMLElement* element = listItems[listIndex];
@@ -539,12 +544,12 @@ LayoutUnit RenderMenuList::clientPaddingRight() const
int RenderMenuList::listSize() const
{
- return toHTMLSelectElement(node())->listItems().size();
+ return selectElement()->listItems().size();
}
int RenderMenuList::selectedIndex() const
{
- HTMLSelectElement* select = toHTMLSelectElement(node());
+ HTMLSelectElement* select = selectElement();
return select->optionToListIndex(select->selectedIndex());
}
@@ -555,19 +560,19 @@ void RenderMenuList::popupDidHide()
bool RenderMenuList::itemIsSeparator(unsigned listIndex) const
{
- const Vector<HTMLElement*>& listItems = toHTMLSelectElement(node())->listItems();
+ const Vector<HTMLElement*>& listItems = selectElement()->listItems();
return listIndex < listItems.size() && listItems[listIndex]->hasTagName(hrTag);
}
bool RenderMenuList::itemIsLabel(unsigned listIndex) const
{
- const Vector<HTMLElement*>& listItems = toHTMLSelectElement(node())->listItems();
+ const Vector<HTMLElement*>& listItems = selectElement()->listItems();
return listIndex < listItems.size() && listItems[listIndex]->hasTagName(optgroupTag);
}
bool RenderMenuList::itemIsSelected(unsigned listIndex) const
{
- const Vector<HTMLElement*>& listItems = toHTMLSelectElement(node())->listItems();
+ const Vector<HTMLElement*>& listItems = selectElement()->listItems();
if (listIndex >= listItems.size())
return false;
HTMLElement* element = listItems[listIndex];
@@ -576,7 +581,7 @@ bool RenderMenuList::itemIsSelected(unsigned listIndex) const
void RenderMenuList::setTextFromItem(unsigned listIndex)
{
- setTextFromOption(toHTMLSelectElement(node())->listToOptionIndex(listIndex));
+ setTextFromOption(selectElement()->listToOptionIndex(listIndex));
}
FontSelector* RenderMenuList::fontSelector() const
diff --git a/Source/WebCore/rendering/RenderMenuList.h b/Source/WebCore/rendering/RenderMenuList.h
index 0b4300840..295e2421c 100644
--- a/Source/WebCore/rendering/RenderMenuList.h
+++ b/Source/WebCore/rendering/RenderMenuList.h
@@ -37,6 +37,7 @@
namespace WebCore {
+class HTMLSelectElement;
class RenderText;
class RenderMenuList : public RenderDeprecatedFlexibleBox, private PopupMenuClient {
@@ -57,6 +58,8 @@ public:
String text() const;
private:
+ HTMLSelectElement* selectElement() const;
+
virtual bool isMenuList() const { return true; }
virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0);
diff --git a/Source/WebCore/rendering/RenderMeter.cpp b/Source/WebCore/rendering/RenderMeter.cpp
index 93b01720f..497bef91e 100644
--- a/Source/WebCore/rendering/RenderMeter.cpp
+++ b/Source/WebCore/rendering/RenderMeter.cpp
@@ -32,7 +32,7 @@ namespace WebCore {
using namespace HTMLNames;
-RenderMeter::RenderMeter(HTMLMeterElement* element)
+RenderMeter::RenderMeter(HTMLElement* element)
: RenderBlock(element)
{
}
@@ -41,6 +41,17 @@ RenderMeter::~RenderMeter()
{
}
+HTMLMeterElement* RenderMeter::meterElement() const
+{
+ ASSERT(node());
+
+ if (isHTMLMeterElement(node()))
+ return toHTMLMeterElement(node());
+
+ ASSERT(node()->shadowHost());
+ return toHTMLMeterElement(node()->shadowHost());
+}
+
void RenderMeter::computeLogicalWidth()
{
RenderBox::computeLogicalWidth();
@@ -55,7 +66,7 @@ void RenderMeter::computeLogicalHeight()
double RenderMeter::valueRatio() const
{
- return static_cast<HTMLMeterElement*>(node())->valueRatio();
+ return meterElement()->valueRatio();
}
void RenderMeter::updateFromElement()
diff --git a/Source/WebCore/rendering/RenderMeter.h b/Source/WebCore/rendering/RenderMeter.h
index 7306caea4..34909eeb0 100644
--- a/Source/WebCore/rendering/RenderMeter.h
+++ b/Source/WebCore/rendering/RenderMeter.h
@@ -32,17 +32,19 @@ class HTMLMeterElement;
class RenderMeter : public RenderBlock {
public:
- RenderMeter(HTMLMeterElement*);
+ RenderMeter(HTMLElement*);
virtual ~RenderMeter();
-private:
+ HTMLMeterElement* meterElement() const;
+ virtual void updateFromElement();
+
+private:
virtual void computeLogicalWidth();
virtual void computeLogicalHeight();
virtual const char* renderName() const { return "RenderMeter"; }
virtual bool isMeter() const { return true; }
virtual bool requiresForcedStyleRecalcPropagation() const { return true; }
- virtual void updateFromElement();
double valueRatio() const;
};
diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp
index b5f69575a..23d6cb8ac 100755
--- a/Source/WebCore/rendering/RenderObject.cpp
+++ b/Source/WebCore/rendering/RenderObject.cpp
@@ -586,6 +586,15 @@ RenderFlowThread* RenderObject::enclosingRenderFlowThread() const
return 0;
}
+RenderNamedFlowThread* RenderObject::enclosingRenderNamedFlowThread() const
+{
+ RenderObject* object = const_cast<RenderObject*>(this);
+ while (object && object->isAnonymousBlock() && !object->isRenderNamedFlowThread())
+ object = object->parent();
+
+ return object && object->isRenderNamedFlowThread() ? toRenderNamedFlowThread(object) : 0;
+}
+
RenderBlock* RenderObject::firstLineBlock() const
{
return 0;
@@ -1195,6 +1204,24 @@ void RenderObject::absoluteFocusRingQuads(Vector<FloatQuad>& quads)
}
}
+FloatRect RenderObject::absoluteBoundingBoxRectForRange(const Range* range)
+{
+ if (!range || !range->startContainer())
+ return FloatRect();
+
+ if (range->ownerDocument())
+ range->ownerDocument()->updateLayout();
+
+ Vector<FloatQuad> quads;
+ range->textQuads(quads);
+
+ FloatRect result;
+ for (size_t i = 0; i < quads.size(); ++i)
+ result.unite(quads[i].boundingBox());
+
+ return result;
+}
+
void RenderObject::addAbsoluteRectForLayer(LayoutRect& result)
{
if (hasLayer())
@@ -2098,7 +2125,7 @@ void RenderObject::getTransformFromContainer(const RenderObject* containerObject
#endif
}
-FloatQuad RenderObject::localToContainerQuad(const FloatQuad& localQuad, RenderBoxModelObject* repaintContainer, bool fixed, bool* wasFixed) const
+FloatQuad RenderObject::localToContainerQuad(const FloatQuad& localQuad, RenderBoxModelObject* repaintContainer, bool snapOffsetForTransforms, bool fixed, bool* wasFixed) const
{
// Track the point at the center of the quad's bounding box. As mapLocalToContainer() calls offsetFromContainer(),
// it will use that point as the reference point to decide which column's transform to apply in multiple-column blocks.
@@ -2106,18 +2133,22 @@ FloatQuad RenderObject::localToContainerQuad(const FloatQuad& localQuad, RenderB
MapLocalToContainerFlags mode = ApplyContainerFlip | UseTransforms;
if (fixed)
mode |= IsFixed;
+ if (snapOffsetForTransforms)
+ mode |= SnapOffsetForTransforms;
mapLocalToContainer(repaintContainer, transformState, mode, wasFixed);
transformState.flatten();
return transformState.lastPlanarQuad();
}
-FloatPoint RenderObject::localToContainerPoint(const FloatPoint& localPoint, RenderBoxModelObject* repaintContainer, bool fixed, bool* wasFixed) const
+FloatPoint RenderObject::localToContainerPoint(const FloatPoint& localPoint, RenderBoxModelObject* repaintContainer, bool snapOffsetForTransforms, bool fixed, bool* wasFixed) const
{
TransformState transformState(TransformState::ApplyTransformDirection, localPoint);
MapLocalToContainerFlags mode = ApplyContainerFlip | UseTransforms;
if (fixed)
mode |= IsFixed;
+ if (snapOffsetForTransforms)
+ mode |= SnapOffsetForTransforms;
mapLocalToContainer(repaintContainer, transformState, mode, wasFixed);
transformState.flatten();
@@ -2354,6 +2385,70 @@ void RenderObject::willBeDestroyed()
clearLayoutRootIfNeeded();
}
+void RenderObject::insertedIntoTree()
+{
+ // FIXME: We should ASSERT(isRooted()) here but generated content makes some out-of-order insertion.
+
+ // Keep our layer hierarchy updated. Optimize for the common case where we don't have any children
+ // and don't have a layer attached to ourselves.
+ RenderLayer* layer = 0;
+ if (firstChild() || hasLayer()) {
+ layer = parent()->enclosingLayer();
+ addLayers(layer);
+ }
+
+ // If |this| is visible but this object was not, tell the layer it has some visible content
+ // that needs to be drawn and layer visibility optimization can't be used
+ if (parent()->style()->visibility() != VISIBLE && style()->visibility() == VISIBLE && !hasLayer()) {
+ if (!layer)
+ layer = parent()->enclosingLayer();
+ if (layer)
+ layer->setHasVisibleContent();
+ }
+
+ if (!isFloating() && parent()->childrenInline())
+ parent()->dirtyLinesFromChangedChild(this);
+
+ if (RenderNamedFlowThread* containerFlowThread = parent()->enclosingRenderNamedFlowThread())
+ containerFlowThread->addFlowChild(this);
+}
+
+void RenderObject::willBeRemovedFromTree()
+{
+ // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removals which would need to be fixed first.
+
+ // If we remove a visible child from an invisible parent, we don't know the layer visibility any more.
+ RenderLayer* layer = 0;
+ if (parent()->style()->visibility() != VISIBLE && style()->visibility() == VISIBLE && !hasLayer()) {
+ if ((layer = parent()->enclosingLayer()))
+ layer->dirtyVisibleContentStatus();
+ }
+
+ // Keep our layer hierarchy updated.
+ if (firstChild() || hasLayer()) {
+ if (!layer)
+ layer = parent()->enclosingLayer();
+ removeLayers(layer);
+ }
+
+ if (isOutOfFlowPositioned() && parent()->childrenInline())
+ parent()->dirtyLinesFromChangedChild(this);
+
+ if (inRenderFlowThread()) {
+ if (isBox())
+ enclosingRenderFlowThread()->removeRenderBoxRegionInfo(toRenderBox(this));
+ enclosingRenderFlowThread()->clearRenderObjectCustomStyle(this);
+ }
+
+ if (RenderNamedFlowThread* containerFlowThread = parent()->enclosingRenderNamedFlowThread())
+ containerFlowThread->removeFlowChild(this);
+
+#if ENABLE(SVG)
+ // Update cached boundaries in SVG renderers, if a child is removed.
+ parent()->setNeedsBoundariesUpdate();
+#endif
+}
+
void RenderObject::destroyAndCleanupAnonymousWrappers()
{
RenderObject* parent = this->parent();
diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h
index 5ef90fc0e..266c83891 100644
--- a/Source/WebCore/rendering/RenderObject.h
+++ b/Source/WebCore/rendering/RenderObject.h
@@ -59,6 +59,7 @@ class RenderBlock;
class RenderFlowThread;
class RenderGeometryMap;
class RenderLayer;
+class RenderNamedFlowThread;
class RenderTable;
class RenderTheme;
class TransformState;
@@ -110,7 +111,8 @@ enum PlaceGeneratedRunInFlag {
enum MapLocalToContainerMode {
IsFixed = 1 << 0,
UseTransforms = 1 << 1,
- ApplyContainerFlip = 1 << 2
+ ApplyContainerFlip = 1 << 2,
+ SnapOffsetForTransforms = 1 << 3
};
typedef unsigned MapLocalToContainerFlags;
@@ -226,6 +228,8 @@ public:
// Function to return our enclosing flow thread if we are contained inside one.
RenderFlowThread* enclosingRenderFlowThread() const;
+ RenderNamedFlowThread* enclosingRenderNamedFlowThread() const;
+
virtual bool isEmpty() const { return firstChild() == 0; }
#ifndef NDEBUG
@@ -683,12 +687,12 @@ public:
// Convert a local quad to absolute coordinates, taking transforms into account.
FloatQuad localToAbsoluteQuad(const FloatQuad& quad, bool fixed = false, bool* wasFixed = 0) const
{
- return localToContainerQuad(quad, 0, fixed, wasFixed);
+ return localToContainerQuad(quad, 0, false, fixed, wasFixed);
}
// Convert a local quad into the coordinate system of container, taking transforms into account.
- FloatQuad localToContainerQuad(const FloatQuad&, RenderBoxModelObject* repaintContainer, bool fixed = false, bool* wasFixed = 0) const;
- FloatPoint localToContainerPoint(const FloatPoint&, RenderBoxModelObject* repaintContainer, bool fixed = false, bool* wasFixed = 0) const;
+ FloatQuad localToContainerQuad(const FloatQuad&, RenderBoxModelObject* repaintContainer, bool snapOffsetForTransforms = true, bool fixed = false, bool* wasFixed = 0) const;
+ FloatPoint localToContainerPoint(const FloatPoint&, RenderBoxModelObject* repaintContainer, bool snapOffsetForTransforms = true, bool fixed = false, bool* wasFixed = 0) const;
// Return the offset from the container() renderer (excluding transforms). In multi-column layout,
// different offsets apply at different points, so return the offset that applies to the given point.
@@ -707,6 +711,8 @@ public:
void absoluteFocusRingQuads(Vector<FloatQuad>&);
+ static FloatRect absoluteBoundingBoxRectForRange(const Range*);
+
// the rect that will be painted if this object is passed as the paintingRoot
LayoutRect paintingRootRect(LayoutRect& topLevelRect);
@@ -934,6 +940,9 @@ protected:
virtual bool canBeReplacedWithInlineRunIn() const;
+ virtual void insertedIntoTree();
+ virtual void willBeRemovedFromTree();
+
private:
RenderStyle* firstLineStyleSlowCase() const;
StyleDifference adjustStyleDifference(StyleDifference, unsigned contextSensitiveProperties) const;
diff --git a/Source/WebCore/rendering/RenderObjectChildList.cpp b/Source/WebCore/rendering/RenderObjectChildList.cpp
index 3158fbfb6..bdb5516b7 100644
--- a/Source/WebCore/rendering/RenderObjectChildList.cpp
+++ b/Source/WebCore/rendering/RenderObjectChildList.cpp
@@ -63,15 +63,7 @@ void RenderObjectChildList::destroyLeftoverChildren()
}
}
-static RenderNamedFlowThread* renderNamedFlowThreadContainer(RenderObject* object)
-{
- while (object && object->isAnonymousBlock() && !object->isRenderNamedFlowThread())
- object = object->parent();
-
- return object && object->isRenderNamedFlowThread() ? toRenderNamedFlowThread(object) : 0;
-}
-
-RenderObject* RenderObjectChildList::removeChildNode(RenderObject* owner, RenderObject* oldChild, bool fullRemove)
+RenderObject* RenderObjectChildList::removeChildNode(RenderObject* owner, RenderObject* oldChild, bool notifyRenderer)
{
ASSERT(oldChild->parent() == owner);
@@ -81,7 +73,7 @@ RenderObject* RenderObjectChildList::removeChildNode(RenderObject* owner, Render
// So that we'll get the appropriate dirty bit set (either that a normal flow child got yanked or
// that a positioned child got yanked). We also repaint, so that the area exposed when the child
// disappears gets repainted properly.
- if (!owner->documentBeingDestroyed() && fullRemove && oldChild->everHadLayout()) {
+ if (!owner->documentBeingDestroyed() && notifyRenderer && oldChild->everHadLayout()) {
oldChild->setNeedsLayoutAndPrefWidthsRecalc();
if (oldChild->isBody())
owner->view()->repaint();
@@ -93,47 +85,8 @@ RenderObject* RenderObjectChildList::removeChildNode(RenderObject* owner, Render
if (oldChild->isBox())
toRenderBox(oldChild)->deleteLineBoxWrapper();
- if (!owner->documentBeingDestroyed() && fullRemove) {
- // if we remove visible child from an invisible parent, we don't know the layer visibility any more
- RenderLayer* layer = 0;
- if (owner->style()->visibility() != VISIBLE && oldChild->style()->visibility() == VISIBLE && !oldChild->hasLayer()) {
- if ((layer = owner->enclosingLayer()))
- layer->dirtyVisibleContentStatus();
- }
-
- // Keep our layer hierarchy updated.
- if (oldChild->firstChild() || oldChild->hasLayer()) {
- if (!layer)
- layer = owner->enclosingLayer();
- oldChild->removeLayers(layer);
- }
-
- if (oldChild->isListItem())
- toRenderListItem(oldChild)->updateListMarkerNumbers();
-
- if (oldChild->isOutOfFlowPositioned() && owner->childrenInline())
- owner->dirtyLinesFromChangedChild(oldChild);
-
- if (oldChild->isRenderRegion())
- toRenderRegion(oldChild)->detachRegion();
-
- if (oldChild->isQuote())
- toRenderQuote(oldChild)->detachQuote();
-
- if (oldChild->inRenderFlowThread()) {
- if (oldChild->isBox())
- oldChild->enclosingRenderFlowThread()->removeRenderBoxRegionInfo(toRenderBox(oldChild));
- oldChild->enclosingRenderFlowThread()->clearRenderObjectCustomStyle(oldChild);
- }
-
- if (RenderNamedFlowThread* containerFlowThread = renderNamedFlowThreadContainer(owner))
- containerFlowThread->removeFlowChild(oldChild);
-
-#if ENABLE(SVG)
- // Update cached boundaries in SVG renderers, if a child is removed.
- owner->setNeedsBoundariesUpdate();
-#endif
- }
+ if (!owner->documentBeingDestroyed() && notifyRenderer)
+ oldChild->willBeRemovedFromTree();
// If oldChild is the start or end of the selection, then clear the selection to
// avoid problems of invalid pointers.
@@ -169,7 +122,7 @@ RenderObject* RenderObjectChildList::removeChildNode(RenderObject* owner, Render
return oldChild;
}
-void RenderObjectChildList::appendChildNode(RenderObject* owner, RenderObject* newChild, bool fullAppend)
+void RenderObjectChildList::appendChildNode(RenderObject* owner, RenderObject* newChild, bool notifyRenderer)
{
ASSERT(newChild->parent() == 0);
ASSERT(!owner->isBlockFlow() || (!newChild->isTableSection() && !newChild->isTableRow() && !newChild->isTableCell()));
@@ -185,40 +138,8 @@ void RenderObjectChildList::appendChildNode(RenderObject* owner, RenderObject* n
setLastChild(newChild);
- if (fullAppend) {
- // Keep our layer hierarchy updated. Optimize for the common case where we don't have any children
- // and don't have a layer attached to ourselves.
- RenderLayer* layer = 0;
- if (newChild->firstChild() || newChild->hasLayer()) {
- layer = owner->enclosingLayer();
- newChild->addLayers(layer);
- }
-
- // if the new child is visible but this object was not, tell the layer it has some visible content
- // that needs to be drawn and layer visibility optimization can't be used
- if (owner->style()->visibility() != VISIBLE && newChild->style()->visibility() == VISIBLE && !newChild->hasLayer()) {
- if (!layer)
- layer = owner->enclosingLayer();
- if (layer)
- layer->setHasVisibleContent();
- }
-
- if (newChild->isListItem())
- toRenderListItem(newChild)->updateListMarkerNumbers();
-
- if (!newChild->isFloating() && owner->childrenInline())
- owner->dirtyLinesFromChangedChild(newChild);
-
- if (newChild->isRenderRegion())
- toRenderRegion(newChild)->attachRegion();
-
- // You can't attachQuote() otherwise the quote would be attached too early
- // and get the wrong depth since generated content is inserted into anonymous
- // renderers before going into the main render tree.
-
- if (RenderNamedFlowThread* containerFlowThread = renderNamedFlowThreadContainer(owner))
- containerFlowThread->addFlowChild(newChild);
- }
+ if (!owner->documentBeingDestroyed() && notifyRenderer)
+ newChild->insertedIntoTree();
if (!owner->documentBeingDestroyed()) {
RenderCounter::rendererSubtreeAttached(newChild);
@@ -231,10 +152,10 @@ void RenderObjectChildList::appendChildNode(RenderObject* owner, RenderObject* n
owner->document()->axObjectCache()->childrenChanged(owner);
}
-void RenderObjectChildList::insertChildNode(RenderObject* owner, RenderObject* child, RenderObject* beforeChild, bool fullInsert)
+void RenderObjectChildList::insertChildNode(RenderObject* owner, RenderObject* child, RenderObject* beforeChild, bool notifyRenderer)
{
if (!beforeChild) {
- appendChildNode(owner, child, fullInsert);
+ appendChildNode(owner, child, notifyRenderer);
return;
}
@@ -257,39 +178,8 @@ void RenderObjectChildList::insertChildNode(RenderObject* owner, RenderObject* c
child->setParent(owner);
- if (fullInsert) {
- // Keep our layer hierarchy updated. Optimize for the common case where we don't have any children
- // and don't have a layer attached to ourselves.
- RenderLayer* layer = 0;
- if (child->firstChild() || child->hasLayer()) {
- layer = owner->enclosingLayer();
- child->addLayers(layer);
- }
-
- // if the new child is visible but this object was not, tell the layer it has some visible content
- // that needs to be drawn and layer visibility optimization can't be used
- if (owner->style()->visibility() != VISIBLE && child->style()->visibility() == VISIBLE && !child->hasLayer()) {
- if (!layer)
- layer = owner->enclosingLayer();
- if (layer)
- layer->setHasVisibleContent();
- }
-
- if (child->isListItem())
- toRenderListItem(child)->updateListMarkerNumbers();
-
- if (!child->isFloating() && owner->childrenInline())
- owner->dirtyLinesFromChangedChild(child);
-
- if (child->isRenderRegion())
- toRenderRegion(child)->attachRegion();
-
- // Calling attachQuote() here would be too early (before anonymous renderers are inserted)
- // see appendChild() for more explanation.
-
- if (RenderNamedFlowThread* containerFlowThread = renderNamedFlowThreadContainer(owner))
- containerFlowThread->addFlowChild(child, beforeChild);
- }
+ if (!owner->documentBeingDestroyed() && notifyRenderer)
+ child->insertedIntoTree();
if (!owner->documentBeingDestroyed()) {
RenderCounter::rendererSubtreeAttached(child);
diff --git a/Source/WebCore/rendering/RenderObjectChildList.h b/Source/WebCore/rendering/RenderObjectChildList.h
index cfe902617..63b733de0 100644
--- a/Source/WebCore/rendering/RenderObjectChildList.h
+++ b/Source/WebCore/rendering/RenderObjectChildList.h
@@ -52,9 +52,9 @@ public:
void destroyLeftoverChildren();
- RenderObject* removeChildNode(RenderObject* owner, RenderObject*, bool fullRemove = true);
- void appendChildNode(RenderObject* owner, RenderObject*, bool fullAppend = true);
- void insertChildNode(RenderObject* owner, RenderObject* child, RenderObject* before, bool fullInsert = true);
+ RenderObject* removeChildNode(RenderObject* owner, RenderObject*, bool notifyRenderer = true);
+ void appendChildNode(RenderObject* owner, RenderObject*, bool notifyRenderer = true);
+ void insertChildNode(RenderObject* owner, RenderObject* child, RenderObject* before, bool notifyRenderer = true);
void updateBeforeAfterContent(RenderObject* owner, PseudoId type, const RenderObject* styledObject = 0);
RenderObject* beforePseudoElementRenderer(const RenderObject* owner) const;
diff --git a/Source/WebCore/rendering/RenderQuote.cpp b/Source/WebCore/rendering/RenderQuote.cpp
index e17a044a4..679e55ba4 100644
--- a/Source/WebCore/rendering/RenderQuote.cpp
+++ b/Source/WebCore/rendering/RenderQuote.cpp
@@ -1,5 +1,6 @@
/**
* Copyright (C) 2011 Nokia 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
@@ -49,6 +50,13 @@ void RenderQuote::willBeDestroyed()
RenderText::willBeDestroyed();
}
+void RenderQuote::willBeRemovedFromTree()
+{
+ RenderText::willBeRemovedFromTree();
+
+ detachQuote();
+}
+
typedef HashMap<AtomicString, const QuotesData*, CaseFoldingHash> QuotesMap;
static const QuotesMap& quotesDataLanguageMap()
@@ -56,16 +64,165 @@ static const QuotesMap& quotesDataLanguageMap()
DEFINE_STATIC_LOCAL(QuotesMap, staticQuotesMap, ());
if (staticQuotesMap.size())
return staticQuotesMap;
- // FIXME: Expand this table to include all the languages in https://bug-3234-attachments.webkit.org/attachment.cgi?id=2135
- staticQuotesMap.set("en", QuotesData::create(U("\x201C"), U("\x201D"), U("\x2018"), U("\x2019")).leakRef());
- staticQuotesMap.set("no", QuotesData::create(U("\x00AB"), U("\x00BB"), U("\x2039"), U("\x203A")).leakRef());
- staticQuotesMap.set("ro", QuotesData::create(U("\x201E"), U("\x201D")).leakRef());
- staticQuotesMap.set("ru", QuotesData::create(U("\x00AB"), U("\x00BB"), U("\x201E"), U("\x201C")).leakRef());
+
+ // Table of quotes from http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#quotes
+ #define QUOTES_LANG(lang, o1, c1, o2, c2) staticQuotesMap.set(lang, QuotesData::create(U(o1), U(c1), U(o2), U(c2)).leakRef())
+ QUOTES_LANG("af", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("agq", "\x201e", "\x201d", "\x201a", "\x2019");
+ QUOTES_LANG("ak", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("am", "\x00ab", "\x00bb", "\x2039", "\x203a");
+ QUOTES_LANG("ar", "\x201d", "\x201c", "\x2019", "\x2018");
+ QUOTES_LANG("asa", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("az-Cyrl", "\x00ab", "\x00bb", "\x2039", "\x203a");
+ QUOTES_LANG("bas", "\x00ab", "\x00bb", "\x201e", "\x201c");
+ QUOTES_LANG("bem", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("bez", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("bg", "\x201e", "\x201c", "\x201a", "\x2018");
+ QUOTES_LANG("bm", "\x00ab", "\x00bb", "\x201c", "\x201d");
+ QUOTES_LANG("bn", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("br", "\x00ab", "\x00bb", "\x2039", "\x203a");
+ QUOTES_LANG("brx", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("bs-Cyrl", "\x201e", "\x201c", "\x201a", "\x2018");
+ QUOTES_LANG("ca", "\x201c", "\x201d", "\x00ab", "\x00bb");
+ QUOTES_LANG("cgg", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("chr", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("cs", "\x201e", "\x201c", "\x201a", "\x2018");
+ QUOTES_LANG("da", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("dav", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("de", "\x201e", "\x201c", "\x201a", "\x2018");
+ QUOTES_LANG("de-CH", "\x00ab", "\x00bb", "\x2039", "\x203a");
+ QUOTES_LANG("dje", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("dua", "\x00ab", "\x00bb", "\x2018", "\x2019");
+ QUOTES_LANG("dyo", "\x00ab", "\x00bb", "\x201c", "\x201d");
+ QUOTES_LANG("dz", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("ebu", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("ee", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("el", "\x00ab", "\x00bb", "\x201c", "\x201d");
+ QUOTES_LANG("en", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("en-GB", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("es", "\x201c", "\x201d", "\x00ab", "\x00bb");
+ QUOTES_LANG("et", "\x201e", "\x201c", "\x201a", "\x2018");
+ QUOTES_LANG("eu", "\x201c", "\x201d", "\x00ab", "\x00bb");
+ QUOTES_LANG("ewo", "\x00ab", "\x00bb", "\x201c", "\x201d");
+ QUOTES_LANG("fa", "\x00ab", "\x00bb", "\x2039", "\x203a");
+ QUOTES_LANG("ff", "\x201e", "\x201d", "\x201a", "\x2019");
+ QUOTES_LANG("fi", "\x201d", "\x201d", "\x2019", "\x2019");
+ QUOTES_LANG("fr", "\x00ab", "\x00bb", "\x00ab", "\x00bb");
+ QUOTES_LANG("fr-CA", "\x00ab", "\x00bb", "\x2039", "\x203a");
+ QUOTES_LANG("fr-CH", "\x00ab", "\x00bb", "\x2039", "\x203a");
+ QUOTES_LANG("gsw", "\x00ab", "\x00bb", "\x2039", "\x203a");
+ QUOTES_LANG("gu", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("guz", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("ha", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("he", "\x0022", "\x0022", "\x0027", "\x0027");
+ QUOTES_LANG("hi", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("hr", "\x201e", "\x201c", "\x201a", "\x2018");
+ QUOTES_LANG("hu", "\x201e", "\x201d", "\x00bb", "\x00ab");
+ QUOTES_LANG("id", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("ig", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("it", "\x00ab", "\x00bb", "\x201c", "\x201d");
+ QUOTES_LANG("ja", "\x300c", "\x300d", "\x300e", "\x300f");
+ QUOTES_LANG("jgo", "\x00ab", "\x00bb", "\x2039", "\x203a");
+ QUOTES_LANG("jmc", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("kab", "\x00ab", "\x00bb", "\x201c", "\x201d");
+ QUOTES_LANG("kam", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("kde", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("kea", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("khq", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("ki", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("kkj", "\x00ab", "\x00bb", "\x2039", "\x203a");
+ QUOTES_LANG("kln", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("km", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("kn", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("ko", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("ksb", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("ksf", "\x00ab", "\x00bb", "\x2018", "\x2019");
+ QUOTES_LANG("lag", "\x201d", "\x201d", "\x2019", "\x2019");
+ QUOTES_LANG("lg", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("ln", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("lo", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("lt", "\x201e", "\x201c", "\x201e", "\x201c");
+ QUOTES_LANG("lu", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("luo", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("luy", "\x201e", "\x201c", "\x201a", "\x2018");
+ QUOTES_LANG("lv", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("mas", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("mer", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("mfe", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("mg", "\x00ab", "\x00bb", "\x201c", "\x201d");
+ QUOTES_LANG("mgo", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("mk", "\x201e", "\x201c", "\x201a", "\x2018");
+ QUOTES_LANG("ml", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("mr", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("ms", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("mua", "\x00ab", "\x00bb", "\x201c", "\x201d");
+ QUOTES_LANG("my", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("naq", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("nb", "\x00ab", "\x00bb", "\x2018", "\x2019");
+ QUOTES_LANG("nd", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("nl", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("nmg", "\x201e", "\x201d", "\x00ab", "\x00bb");
+ QUOTES_LANG("nn", "\x00ab", "\x00bb", "\x2018", "\x2019");
+ QUOTES_LANG("nnh", "\x00ab", "\x00bb", "\x201c", "\x201d");
+ QUOTES_LANG("nus", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("nyn", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("pl", "\x201e", "\x201d", "\x00ab", "\x00bb");
+ QUOTES_LANG("pt", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("pt-PT", "\x00ab", "\x00bb", "\x201c", "\x201d");
+ QUOTES_LANG("rn", "\x201d", "\x201d", "\x2019", "\x2019");
+ QUOTES_LANG("ro", "\x201e", "\x201d", "\x00ab", "\x00bb");
+ QUOTES_LANG("rof", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("ru", "\x00ab", "\x00bb", "\x201e", "\x201c");
+ QUOTES_LANG("rw", "\x00ab", "\x00bb", "\x2018", "\x2019");
+ QUOTES_LANG("rwk", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("saq", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("sbp", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("seh", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("ses", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("sg", "\x00ab", "\x00bb", "\x201c", "\x201d");
+ QUOTES_LANG("shi", "\x00ab", "\x00bb", "\x201e", "\x201d");
+ QUOTES_LANG("shi-Tfng", "\x00ab", "\x00bb", "\x201e", "\x201d");
+ QUOTES_LANG("si", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("sk", "\x201e", "\x201c", "\x201a", "\x2018");
+ QUOTES_LANG("sl", "\x201e", "\x201c", "\x201a", "\x2018");
+ QUOTES_LANG("sn", "\x201d", "\x201d", "\x2019", "\x2019");
+ QUOTES_LANG("so", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("sq", "\x201e", "\x201c", "\x201a", "\x2018");
+ QUOTES_LANG("sr", "\x201e", "\x201c", "\x201a", "\x2018");
+ QUOTES_LANG("sr-Latn", "\x201e", "\x201c", "\x201a", "\x2018");
+ QUOTES_LANG("sv", "\x201d", "\x201d", "\x2019", "\x2019");
+ QUOTES_LANG("sw", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("swc", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("ta", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("te", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("teo", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("th", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("ti-ER", "\x2018", "\x2019", "\x201c", "\x201d");
+ QUOTES_LANG("to", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("tr", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("twq", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("tzm", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("uk", "\x00ab", "\x00bb", "\x201e", "\x201c");
+ QUOTES_LANG("ur", "\x201d", "\x201c", "\x2019", "\x2018");
+ QUOTES_LANG("vai", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("vai-Latn", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("vi", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("vun", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("xh", "\x2018", "\x2019", "\x201c", "\x201d");
+ QUOTES_LANG("xog", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("yav", "\x00ab", "\x00bb", "\x00ab", "\x00bb");
+ QUOTES_LANG("yo", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("zh", "\x201c", "\x201d", "\x2018", "\x2019");
+ QUOTES_LANG("zh-Hant", "\x300c", "\x300d", "\x300e", "\x300f");
+ QUOTES_LANG("zu", "\x201c", "\x201d", "\x2018", "\x2019");
+ #undef QUOTES_LANG
+
return staticQuotesMap;
}
static const QuotesData* basicQuotesData()
{
+ // FIXME: The default quotes should be the fancy quotes for "en".
static const QuotesData* staticBasicQuotes = QuotesData::create(U("\""), U("\""), U("'"), U("'")).leakRef();
return staticBasicQuotes;
}
@@ -77,8 +234,7 @@ PassRefPtr<StringImpl> RenderQuote::originalText() const
case NO_CLOSE_QUOTE:
return StringImpl::empty();
case CLOSE_QUOTE:
- // FIXME: When m_depth is 0 we should return empty string.
- return quotesData()->getCloseQuote(std::max(m_depth - 1, 0)).impl();
+ return quotesData()->getCloseQuote(m_depth - 1).impl();
case OPEN_QUOTE:
return quotesData()->getOpenQuote(m_depth).impl();
}
diff --git a/Source/WebCore/rendering/RenderQuote.h b/Source/WebCore/rendering/RenderQuote.h
index cf7032ca7..7917fc12b 100644
--- a/Source/WebCore/rendering/RenderQuote.h
+++ b/Source/WebCore/rendering/RenderQuote.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2011 Nokia 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
@@ -43,6 +44,13 @@ private:
virtual PassRefPtr<StringImpl> originalText() const OVERRIDE;
virtual void computePreferredLogicalWidths(float leadWidth) OVERRIDE;
+ // We don't override insertedIntoTree to call attachQuote() as it would be attached
+ // too early and get the wrong depth since generated content is inserted into anonymous
+ // renderers before going into the main render tree. Once we can ensure that insertIntoTree,
+ // is called on an attached tree, we should override it here.
+
+ virtual void willBeRemovedFromTree() OVERRIDE;
+
const QuotesData* quotesData() const;
void updateDepth();
bool isAttached() { return m_attached; }
diff --git a/Source/WebCore/rendering/RenderRegion.cpp b/Source/WebCore/rendering/RenderRegion.cpp
index aa4e05077..b9b33f397 100644
--- a/Source/WebCore/rendering/RenderRegion.cpp
+++ b/Source/WebCore/rendering/RenderRegion.cpp
@@ -193,9 +193,7 @@ void RenderRegion::layout()
void RenderRegion::attachRegion()
{
- if (documentBeingDestroyed())
- return;
-
+ ASSERT(view());
ASSERT(!m_flowThread);
// Initialize the flow thread reference and create the flow thread object if needed.
// The flow thread lifetime is influenced by the number of regions attached to it,
@@ -357,6 +355,20 @@ void RenderRegion::restoreRegionObjectsOriginalStyle()
m_renderObjectRegionStyle.swap(temp);
}
+void RenderRegion::insertedIntoTree()
+{
+ RenderReplaced::insertedIntoTree();
+
+ attachRegion();
+}
+
+void RenderRegion::willBeRemovedFromTree()
+{
+ RenderReplaced::willBeRemovedFromTree();
+
+ detachRegion();
+}
+
PassRefPtr<RenderStyle> RenderRegion::computeStyleInRegion(const RenderObject* object)
{
ASSERT(object);
@@ -399,6 +411,10 @@ void RenderRegion::computeChildrenStyleInRegion(const RenderObject* object)
void RenderRegion::setObjectStyleInRegion(RenderObject* object, PassRefPtr<RenderStyle> styleInRegion, bool objectRegionStyleCached)
{
+ ASSERT(object->inRenderFlowThread());
+ if (!object->inRenderFlowThread())
+ return;
+
RefPtr<RenderStyle> objectOriginalStyle = object->style();
object->setStyleInternal(styleInRegion);
diff --git a/Source/WebCore/rendering/RenderRegion.h b/Source/WebCore/rendering/RenderRegion.h
index 6093a9c03..861afcbe9 100644
--- a/Source/WebCore/rendering/RenderRegion.h
+++ b/Source/WebCore/rendering/RenderRegion.h
@@ -100,6 +100,9 @@ public:
private:
virtual const char* renderName() const { return "RenderRegion"; }
+ virtual void insertedIntoTree() OVERRIDE;
+ virtual void willBeRemovedFromTree() OVERRIDE;
+
PassRefPtr<RenderStyle> computeStyleInRegion(const RenderObject*);
void computeChildrenStyleInRegion(const RenderObject*);
void setRegionObjectsRegionStyle();
diff --git a/Source/WebCore/rendering/RenderReplica.cpp b/Source/WebCore/rendering/RenderReplica.cpp
index 141a45922..0879282a6 100644
--- a/Source/WebCore/rendering/RenderReplica.cpp
+++ b/Source/WebCore/rendering/RenderReplica.cpp
@@ -71,7 +71,7 @@ void RenderReplica::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
// Turn around and paint the parent layer. Use temporary clipRects, so that the layer doesn't end up caching clip rects
// computing using the wrong rootLayer
layer()->parent()->paintLayer(layer()->transform() ? layer()->parent() : layer()->enclosingTransformedAncestor(),
- paintInfo.context, paintInfo.rect,
+ paintInfo.context, paintInfo.rect, LayoutSize(),
PaintBehaviorNormal, 0, paintInfo.renderRegion, 0,
RenderLayer::PaintLayerHaveTransparency | RenderLayer::PaintLayerAppliedTransform | RenderLayer::PaintLayerTemporaryClipRects | RenderLayer::PaintLayerPaintingReflection);
else if (paintInfo.phase == PaintPhaseMask)
diff --git a/Source/WebCore/rendering/RenderTableCell.h b/Source/WebCore/rendering/RenderTableCell.h
index 4381555cd..5d5b2764b 100644
--- a/Source/WebCore/rendering/RenderTableCell.h
+++ b/Source/WebCore/rendering/RenderTableCell.h
@@ -38,11 +38,7 @@ enum IncludeBorderColorOrNot { DoNotIncludeBorderColor, IncludeBorderColor };
class RenderTableCell : public RenderBlock {
public:
explicit RenderTableCell(Node*);
-
- // FIXME: need to implement cellIndex
- int cellIndex() const { return 0; }
- void setCellIndex(int) { }
-
+
unsigned colSpan() const;
unsigned rowSpan() const;
@@ -116,7 +112,7 @@ public:
virtual LayoutUnit paddingLeft() const OVERRIDE;
virtual LayoutUnit paddingRight() const OVERRIDE;
- // FIXME: For now we just assume the cell has the same block flow direction as the table. It's likely we'll
+ // FIXME: For now we just assume the cell has the same block flow direction as the table. It's likely we'll
// create an extra anonymous RenderBlock to handle mixing directionality anyway, in which case we can lock
// the block flow directionality of the cells to the table's directionality.
virtual LayoutUnit paddingBefore() const OVERRIDE;
diff --git a/Source/WebCore/rendering/RenderTableSection.cpp b/Source/WebCore/rendering/RenderTableSection.cpp
index 80e6465ec..d34070cc6 100644
--- a/Source/WebCore/rendering/RenderTableSection.cpp
+++ b/Source/WebCore/rendering/RenderTableSection.cpp
@@ -1092,8 +1092,6 @@ CellSpan RenderTableSection::dirtiedColumns(const LayoutRect& damageRect) const
CellSpan RenderTableSection::spannedRows(const LayoutRect& flippedRect) const
{
// Find the first row that starts after rect top.
- // FIXME: Upper_bound might not be the correct algorithm here since it might skip empty rows, but it is
- // consistent with behavior in the former point based hit-testing (but inconsistent with spannedColumns).
unsigned nextRow = std::upper_bound(m_rowPos.begin(), m_rowPos.end(), flippedRect.y()) - m_rowPos.begin();
if (nextRow == m_rowPos.size())
@@ -1118,20 +1116,24 @@ CellSpan RenderTableSection::spannedColumns(const LayoutRect& flippedRect) const
{
const Vector<int>& columnPos = table()->columnPositions();
- // Find the first columnt that starts after rect left.
- unsigned nextColumn = std::lower_bound(columnPos.begin(), columnPos.end(), flippedRect.x()) - columnPos.begin();
+ // Find the first column that starts after rect left.
+ // lower_bound doesn't handle the edge between two cells properly as it would wrongly return the
+ // cell on the logical top/left.
+ // upper_bound on the other hand properly returns the cell on the logical bottom/right, which also
+ // matches the behavior of other browsers.
+ unsigned nextColumn = std::upper_bound(columnPos.begin(), columnPos.end(), flippedRect.x()) - columnPos.begin();
if (nextColumn == columnPos.size())
return CellSpan(columnPos.size() - 1, columnPos.size() - 1); // After all columns.
unsigned startColumn = nextColumn > 0 ? nextColumn - 1 : 0;
- // Find the first row that starts after rect right.
+ // Find the first column that starts after rect right.
unsigned endColumn;
if (columnPos[nextColumn] >= flippedRect.maxX())
endColumn = nextColumn;
else {
- endColumn = std::lower_bound(columnPos.begin() + nextColumn, columnPos.end(), flippedRect.maxX()) - columnPos.begin();
+ endColumn = std::upper_bound(columnPos.begin() + nextColumn, columnPos.end(), flippedRect.maxX()) - columnPos.begin();
if (endColumn == columnPos.size())
endColumn = columnPos.size() - 1;
}
diff --git a/Source/WebCore/rendering/RenderTextControl.cpp b/Source/WebCore/rendering/RenderTextControl.cpp
index 10a420aa8..1964d9171 100644
--- a/Source/WebCore/rendering/RenderTextControl.cpp
+++ b/Source/WebCore/rendering/RenderTextControl.cpp
@@ -155,11 +155,14 @@ void RenderTextControl::computeLogicalHeight()
void RenderTextControl::hitInnerTextElement(HitTestResult& result, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset)
{
- LayoutPoint adjustedLocation = accumulatedOffset + location();
HTMLElement* innerText = innerTextElement();
+ LayoutPoint adjustedLocation = accumulatedOffset + location();
+ LayoutPoint localPoint = pointInContainer - toLayoutSize(adjustedLocation + innerText->renderBox()->location());
+ if (hasOverflowClip())
+ localPoint += scrolledContentOffset();
result.setInnerNode(innerText);
result.setInnerNonSharedNode(innerText);
- result.setLocalPoint(pointInContainer - toLayoutSize(adjustedLocation + innerText->renderBox()->location()));
+ result.setLocalPoint(localPoint);
}
static const char* fontFamiliesWithInvalidCharWidth[] = {
diff --git a/Source/WebCore/rendering/RenderTextControlSingleLine.cpp b/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
index 0b63245e5..665af32be 100644
--- a/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
+++ b/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
@@ -49,23 +49,6 @@ namespace WebCore {
using namespace HTMLNames;
-VisiblePosition RenderTextControlInnerBlock::positionForPoint(const LayoutPoint& point)
-{
- LayoutPoint contentsPoint(point);
-
- // Multiline text controls have the scroll on shadowHost, so we need to take
- // that into account here.
- if (m_multiLine) {
- RenderTextControl* renderer = toRenderTextControl(node()->shadowHost()->renderer());
- if (renderer->hasOverflowClip())
- contentsPoint += renderer->scrolledContentOffset();
- }
-
- return RenderBlock::positionForPoint(contentsPoint);
-}
-
-// ----------------------------
-
RenderTextControlSingleLine::RenderTextControlSingleLine(Node* node)
: RenderTextControl(node)
, m_shouldDrawCapsLockIndicator(false)
@@ -368,7 +351,7 @@ PassRefPtr<RenderStyle> RenderTextControlSingleLine::createInnerTextStyle(const
textBlockStyle->setHeight(Length(m_desiredInnerTextHeight, Fixed));
// Do not allow line-height to be smaller than our default.
if (textBlockStyle->fontMetrics().lineSpacing() > lineHeight(true, HorizontalLine, PositionOfInteriorLineBoxes))
- textBlockStyle->setLineHeight(Length(-100.0f, Percent));
+ textBlockStyle->setLineHeight(RenderStyle::initialLineHeight());
textBlockStyle->setDisplay(BLOCK);
diff --git a/Source/WebCore/rendering/RenderTextControlSingleLine.h b/Source/WebCore/rendering/RenderTextControlSingleLine.h
index 115c48308..c79f3dfec 100644
--- a/Source/WebCore/rendering/RenderTextControlSingleLine.h
+++ b/Source/WebCore/rendering/RenderTextControlSingleLine.h
@@ -110,13 +110,10 @@ void toRenderTextControlSingleLine(const RenderTextControlSingleLine*);
class RenderTextControlInnerBlock : public RenderBlock {
public:
- RenderTextControlInnerBlock(Node* node, bool isMultiLine) : RenderBlock(node), m_multiLine(isMultiLine) { }
+ RenderTextControlInnerBlock(Node* node) : RenderBlock(node) { }
private:
virtual bool hasLineIfEmpty() const { return true; }
- virtual VisiblePosition positionForPoint(const LayoutPoint&);
-
- bool m_multiLine;
};
}
diff --git a/Source/WebCore/rendering/RenderTheme.cpp b/Source/WebCore/rendering/RenderTheme.cpp
index 3382d3fbd..934c4b2cf 100644
--- a/Source/WebCore/rendering/RenderTheme.cpp
+++ b/Source/WebCore/rendering/RenderTheme.cpp
@@ -41,6 +41,7 @@
#include "RenderStyle.h"
#include "RenderView.h"
#include "Settings.h"
+#include "SpinButtonElement.h"
#include "StringTruncator.h"
#include "TextControlInnerElements.h"
diff --git a/Source/WebCore/rendering/RenderTheme.h b/Source/WebCore/rendering/RenderTheme.h
index 6facf5280..6026b6017 100644
--- a/Source/WebCore/rendering/RenderTheme.h
+++ b/Source/WebCore/rendering/RenderTheme.h
@@ -365,7 +365,9 @@ private:
mutable Color m_inactiveListBoxSelectionForegroundColor;
#if ENABLE(TOUCH_EVENTS)
- static const RGBA32 defaultTapHighlightColor = 0x33000000;
+ // This color is expected to be drawn on a semi-transparent overlay,
+ // making it more transparent than its alpha value indicates.
+ static const RGBA32 defaultTapHighlightColor = 0x66000000;
#endif
#if USE(NEW_THEME)
diff --git a/Source/WebCore/rendering/RenderThemeChromiumMac.h b/Source/WebCore/rendering/RenderThemeChromiumMac.h
index e19ffa303..5853a0661 100644
--- a/Source/WebCore/rendering/RenderThemeChromiumMac.h
+++ b/Source/WebCore/rendering/RenderThemeChromiumMac.h
@@ -36,7 +36,6 @@ public:
virtual bool supportsDataListUI(const AtomicString& type) const OVERRIDE;
protected:
- virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&);
#if ENABLE(VIDEO)
virtual void adjustMediaSliderThumbSize(RenderStyle*) const;
virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const IntRect&);
diff --git a/Source/WebCore/rendering/RenderThemeChromiumMac.mm b/Source/WebCore/rendering/RenderThemeChromiumMac.mm
index fc01e6fa9..9af2dbc4c 100644
--- a/Source/WebCore/rendering/RenderThemeChromiumMac.mm
+++ b/Source/WebCore/rendering/RenderThemeChromiumMac.mm
@@ -134,23 +134,6 @@ bool RenderThemeChromiumMac::shouldShowPlaceholderWhenFocused() const
return true;
}
-bool RenderThemeChromiumMac::paintTextField(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
-{
- // Using the Cocoa code to paint the text field as RenderThemeMac does runs
- // into a bug when building against the 10.5 SDK, so we are forced here to
- // use the SPI. This override of paintTextField should be able to be removed
- // when 10.6 is the minimum required system and Chromium is built against
- // the 10.6 SDK.
- //
- // https://bugs.webkit.org/show_bug.cgi?id=75860
- // http://code.google.com/p/chromium/issues/detail?id=109567
-
- LocalCurrentGraphicsContext localContext(paintInfo.context);
- wkDrawBezeledTextFieldCell(r, isEnabled(o) && !isReadOnlyControl(o));
-
- return false;
-}
-
#if ENABLE(VIDEO)
void RenderThemeChromiumMac::adjustMediaSliderThumbSize(RenderStyle* style) const
diff --git a/Source/WebCore/rendering/RenderThemeMac.mm b/Source/WebCore/rendering/RenderThemeMac.mm
index 25b03b737..0bc9804fb 100644
--- a/Source/WebCore/rendering/RenderThemeMac.mm
+++ b/Source/WebCore/rendering/RenderThemeMac.mm
@@ -926,7 +926,7 @@ NSLevelIndicatorCell* RenderThemeMac::levelIndicatorFor(const RenderMeter* rende
m_levelIndicator.adoptNS([[NSLevelIndicatorCell alloc] initWithLevelIndicatorStyle:NSContinuousCapacityLevelIndicatorStyle]);
NSLevelIndicatorCell* cell = m_levelIndicator.get();
- HTMLMeterElement* element = static_cast<HTMLMeterElement*>(renderMeter->node());
+ HTMLMeterElement* element = renderMeter->meterElement();
double value = element->value();
// Because NSLevelIndicatorCell does not support optimum-in-the-middle type coloring,
diff --git a/Source/WebCore/rendering/RenderView.h b/Source/WebCore/rendering/RenderView.h
index e8e422765..296c629ec 100644
--- a/Source/WebCore/rendering/RenderView.h
+++ b/Source/WebCore/rendering/RenderView.h
@@ -207,7 +207,7 @@ public:
bool hasRenderCounters() { return m_renderCounterCount; }
protected:
- virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState&, MapLocalToContainerFlags mode = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
+ virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState&, MapLocalToContainerFlags mode = ApplyContainerFlip | SnapOffsetForTransforms, bool* wasFixed = 0) const OVERRIDE;
virtual const RenderObject* pushMappingToContainer(const RenderBoxModelObject* ancestorToStopAt, RenderGeometryMap&) const;
virtual void mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState&) const;
virtual bool requiresColumns(int desiredColumnCount) const OVERRIDE;
diff --git a/Source/WebCore/rendering/RenderWidget.cpp b/Source/WebCore/rendering/RenderWidget.cpp
index 3a30260f8..fc4f2f35a 100644
--- a/Source/WebCore/rendering/RenderWidget.cpp
+++ b/Source/WebCore/rendering/RenderWidget.cpp
@@ -176,11 +176,11 @@ bool RenderWidget::setWidgetGeometry(const LayoutRect& frame)
bool RenderWidget::updateWidgetGeometry()
{
- IntRect contentBox = pixelSnappedIntRect(contentBoxRect());
+ LayoutRect contentBox = contentBoxRect();
if (!m_widget->transformsAffectFrameRect())
return setWidgetGeometry(absoluteContentBox());
- IntRect absoluteContentBox(localToAbsoluteQuad(FloatQuad(contentBox)).boundingBox());
+ LayoutRect absoluteContentBox(localToAbsoluteQuad(FloatQuad(contentBox)).boundingBox());
if (m_widget->isFrameView()) {
contentBox.setLocation(absoluteContentBox.location());
return setWidgetGeometry(contentBox);
diff --git a/Source/WebCore/rendering/TextAutosizer.cpp b/Source/WebCore/rendering/TextAutosizer.cpp
index 82399c739..9e0f2a47d 100644
--- a/Source/WebCore/rendering/TextAutosizer.cpp
+++ b/Source/WebCore/rendering/TextAutosizer.cpp
@@ -27,6 +27,7 @@
#include "Document.h"
#include "InspectorInstrumentation.h"
#include "RenderObject.h"
+#include "RenderStyle.h"
#include "RenderText.h"
#include "RenderView.h"
#include "Settings.h"
@@ -49,75 +50,84 @@ bool TextAutosizer::processSubtree(RenderObject* layoutRoot)
if (!m_document->settings() || !m_document->settings()->textAutosizingEnabled() || layoutRoot->view()->printing() || !m_document->page())
return false;
+ Frame* mainFrame = m_document->page()->mainFrame();
+
+ // Window area, in logical (density-independent) pixels.
IntSize windowSize = m_document->settings()->textAutosizingWindowSizeOverride();
if (windowSize.isEmpty()) {
- Frame* mainFrame = m_document->page()->mainFrame();
bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenWidthOverride(mainFrame);
windowSize = mainFrame->view()->visibleContentRect(includeScrollbars).size(); // FIXME: Check that this is always in logical (density-independent) pixels (see wkbug.com/87440).
}
- for (RenderObject* descendant = traverseNext(layoutRoot, layoutRoot); descendant; descendant = traverseNext(descendant, layoutRoot)) {
- if (!treatAsInline(descendant))
- processBlock(toRenderBlock(descendant), windowSize);
+ // Largest area of block that can be visible at once (assuming the main
+ // frame doesn't get scaled to less than overview scale), in CSS pixels.
+ IntSize minLayoutSize = mainFrame->view()->layoutSize();
+ for (Frame* frame = m_document->frame(); frame; frame = frame->tree()->parent()) {
+ if (!frame->view()->isInChildFrameWithFrameFlattening())
+ minLayoutSize = minLayoutSize.shrunkTo(frame->view()->layoutSize());
+ }
+
+ for (RenderObject* descendant = layoutRoot->nextInPreOrder(layoutRoot); descendant; descendant = descendant->nextInPreOrder(layoutRoot)) {
+ if (isNotAnAutosizingContainer(descendant))
+ continue;
+ processBox(toRenderBox(descendant), windowSize, minLayoutSize);
}
return true;
}
-void TextAutosizer::processBlock(RenderBlock* block, const IntSize& windowSize)
+void TextAutosizer::processBox(RenderBox* box, const IntSize& windowSize, const IntSize& layoutSize)
{
- int windowLogicalWidth = block->isHorizontalWritingMode() ? windowSize.width() : windowSize.height();
- float multiplier = static_cast<float>(block->logicalWidth()) / windowLogicalWidth; // FIXME: This is overly simplistic.
+ int logicalWindowWidth = box->isHorizontalWritingMode() ? windowSize.width() : windowSize.height();
+ int logicalLayoutWidth = box->isHorizontalWritingMode() ? layoutSize.width() : layoutSize.height();
+ // Ignore box width in excess of the layout width, to avoid extreme multipliers.
+ float logicalBoxWidth = std::min<float>(box->logicalWidth(), logicalLayoutWidth);
+
+ float multiplier = logicalBoxWidth / logicalWindowWidth;
multiplier *= m_document->settings()->textAutosizingFontScaleFactor();
if (multiplier < 1)
return;
- for (RenderObject* descendant = traverseNext(block, block, treatAsInline); descendant; descendant = traverseNext(descendant, block, treatAsInline)) {
- if (descendant->isText())
- processText(toRenderText(descendant), multiplier);
+ RenderObject* descendant = nextInPreOrderMatchingFilter(box, box, isNotAnAutosizingContainer);
+ while (descendant) {
+ if (descendant->isText()) {
+ setMultiplier(descendant, multiplier);
+ setMultiplier(descendant->parent(), multiplier); // Parent does line spacing.
+ // FIXME: Increase list marker size proportionately.
+ }
+ descendant = nextInPreOrderMatchingFilter(descendant, box, isNotAnAutosizingContainer);
}
}
-void TextAutosizer::processText(RenderText* text, float multiplier)
+void TextAutosizer::setMultiplier(RenderObject* renderer, float multiplier)
{
- float specifiedSize = text->style()->fontDescription().specifiedSize();
- float newSize = specifiedSize * multiplier; // FIXME: This is overly simplistic.
-
- RefPtr<RenderStyle> style = RenderStyle::clone(text->style());
- FontDescription fontDescription(style->fontDescription());
- fontDescription.setComputedSize(newSize);
- style->setFontDescription(fontDescription);
- style->font().update(style->font().fontSelector());
- text->setStyle(style.release());
-
- // FIXME: Increase computed line height proportionately.
- // FIXME: Increase list marker size proportionately.
+ RefPtr<RenderStyle> newStyle = RenderStyle::clone(renderer->style());
+ newStyle->setTextAutosizingMultiplier(multiplier);
+ renderer->setStyle(newStyle.release());
}
-bool TextAutosizer::treatAsInline(const RenderObject* renderer)
+bool TextAutosizer::isNotAnAutosizingContainer(const RenderObject* renderer)
{
- return !renderer->isRenderBlock() || renderer->isListItem() || renderer->isInlineBlockOrInlineTable();
+ // "Autosizing containers" are the smallest unit for which we can enable/disable
+ // Text Autosizing. A uniform text size multiplier is enforced within them.
+ // - Must be RenderBoxes since they need a well-defined logicalWidth().
+ // - Must not be inline, as different multipliers on one line looks terrible.
+ // - Must not be list items, as items in the same list should look consistent.
+ return !renderer->isBox() || renderer->isInline() || renderer->isListItem();
}
-// FIXME: Consider making this a method on RenderObject if it remains this generic.
-RenderObject* TextAutosizer::traverseNext(RenderObject* current, const RenderObject* stayWithin, RenderObjectFilter filter)
+RenderObject* TextAutosizer::nextInPreOrderMatchingFilter(RenderObject* current, const RenderObject* stayWithin, RenderObjectFilterFunctor filter)
{
- for (RenderObject* child = current->firstChild(); child; child = child->nextSibling()) {
- if (!filter || filter(child)) {
- ASSERT(!stayWithin || child->isDescendantOf(stayWithin));
+ for (RenderObject* child = current->firstChild(); child; child = child->nextSibling())
+ if (filter(child))
return child;
- }
- }
- for (RenderObject* ancestor = current; ancestor; ancestor = ancestor->parent()) {
+ for (const RenderObject* ancestor = current; ancestor; ancestor = ancestor->parent()) {
if (ancestor == stayWithin)
return 0;
- for (RenderObject* sibling = ancestor->nextSibling(); sibling; sibling = sibling->nextSibling()) {
- if (!filter || filter(sibling)) {
- ASSERT(!stayWithin || sibling->isDescendantOf(stayWithin));
+ for (RenderObject* sibling = ancestor->nextSibling(); sibling; sibling = sibling->nextSibling())
+ if (filter(sibling))
return sibling;
- }
- }
}
return 0;
diff --git a/Source/WebCore/rendering/TextAutosizer.h b/Source/WebCore/rendering/TextAutosizer.h
index f5e14cfe1..3524f5f95 100644
--- a/Source/WebCore/rendering/TextAutosizer.h
+++ b/Source/WebCore/rendering/TextAutosizer.h
@@ -36,7 +36,7 @@
namespace WebCore {
class Document;
-class RenderBlock;
+class RenderBox;
class RenderObject;
class RenderStyle;
class RenderText;
@@ -54,13 +54,14 @@ public:
private:
explicit TextAutosizer(Document*);
- void processBlock(RenderBlock*, const IntSize& windowSize);
- void processText(RenderText*, float multiplier);
+ void processBox(RenderBox*, const IntSize& windowSize, const IntSize& layoutSize);
+ void setMultiplier(RenderObject*, float);
- typedef bool (*RenderObjectFilter)(const RenderObject*);
- static bool treatAsInline(const RenderObject*);
+ static bool isNotAnAutosizingContainer(const RenderObject*);
- RenderObject* traverseNext(RenderObject* current, const RenderObject* stayWithin, RenderObjectFilter = 0);
+ typedef bool (*RenderObjectFilterFunctor)(const RenderObject*);
+ // Use to traverse the tree of descendants, excluding any subtrees within that whose root doesn't pass the filter.
+ static RenderObject* nextInPreOrderMatchingFilter(RenderObject* current, const RenderObject* stayWithin, RenderObjectFilterFunctor);
Document* m_document;
};
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp b/Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp
index d8dab715a..dd0261de7 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp
@@ -71,7 +71,7 @@ void RenderMathMLSubSup::fixScriptsStyle()
scriptsStyle->setMarginLeft(Length(gSubsupScriptMargin, Fixed));
scriptsStyle->setTextAlign(LEFT);
// Set this wrapper's font-size for its line-height & baseline position, for its children.
- scriptsStyle->setBlendedFontSize(static_cast<int>(0.75 * style()->fontSize()));
+ scriptsStyle->setFontSize(static_cast<int>(0.75 * style()->fontSize()));
}
void RenderMathMLSubSup::addChild(RenderObject* child, RenderObject* beforeChild)
diff --git a/Source/WebCore/rendering/style/NinePieceImage.cpp b/Source/WebCore/rendering/style/NinePieceImage.cpp
index 98ffa6551..18a107e8a 100644
--- a/Source/WebCore/rendering/style/NinePieceImage.cpp
+++ b/Source/WebCore/rendering/style/NinePieceImage.cpp
@@ -26,10 +26,16 @@
namespace WebCore {
-bool NinePieceImage::operator==(const NinePieceImage& o) const
+bool NinePieceImageData::operator==(const NinePieceImageData& o) const
{
return StyleImage::imagesEquivalent(m_image.get(), o.m_image.get()) && m_imageSlices == o.m_imageSlices && m_fill == o.m_fill
&& m_borderSlices == o.m_borderSlices && m_outset == o.m_outset && m_horizontalRule == o.m_horizontalRule && m_verticalRule == o.m_verticalRule;
}
+const NinePieceImageData& NinePieceImage::defaultData()
+{
+ DEFINE_STATIC_LOCAL(NinePieceImageData, data, ());
+ return data;
+}
+
}
diff --git a/Source/WebCore/rendering/style/NinePieceImage.h b/Source/WebCore/rendering/style/NinePieceImage.h
index 6390f3d46..8f7ed8760 100644
--- a/Source/WebCore/rendering/style/NinePieceImage.h
+++ b/Source/WebCore/rendering/style/NinePieceImage.h
@@ -34,9 +34,9 @@ enum ENinePieceImageRule {
StretchImageRule, RoundImageRule, SpaceImageRule, RepeatImageRule
};
-class NinePieceImage {
+class NinePieceImageData {
public:
- NinePieceImage()
+ NinePieceImageData()
: m_image(0)
, m_imageSlices(Length(100, Percent), Length(100, Percent), Length(100, Percent), Length(100, Percent))
, m_borderSlices(Length(1, Relative), Length(1, Relative), Length(1, Relative), Length(1, Relative))
@@ -47,7 +47,7 @@ public:
{
}
- NinePieceImage(PassRefPtr<StyleImage> image, LengthBox imageSlices, bool fill, LengthBox borderSlices, LengthBox outset, ENinePieceImageRule h, ENinePieceImageRule v)
+ NinePieceImageData(PassRefPtr<StyleImage> image, LengthBox imageSlices, bool fill, LengthBox borderSlices, LengthBox outset, ENinePieceImageRule h, ENinePieceImageRule v)
: m_image(image)
, m_imageSlices(imageSlices)
, m_borderSlices(borderSlices)
@@ -58,24 +58,59 @@ public:
{
}
- bool operator==(const NinePieceImage& o) const;
- bool operator!=(const NinePieceImage& o) const { return !(*this == o); }
+ bool operator==(const NinePieceImageData&) const;
+ bool operator!=(const NinePieceImageData& o) const { return !(*this == o); }
+
+ RefPtr<StyleImage> m_image;
+ LengthBox m_imageSlices;
+ LengthBox m_borderSlices;
+ LengthBox m_outset;
+ bool m_fill : 1;
+ unsigned m_horizontalRule : 2; // ENinePieceImageRule
+ unsigned m_verticalRule : 2; // ENinePieceImageRule
+};
+
+class NinePieceImage {
+public:
+ NinePieceImage() { }
+
+ NinePieceImage(PassRefPtr<StyleImage> image, LengthBox imageSlices, bool fill, LengthBox borderSlices, LengthBox outset, ENinePieceImageRule h, ENinePieceImageRule v)
+ : m_data(adoptPtr(new NinePieceImageData(image, imageSlices, fill, borderSlices, outset, h, v)))
+ { }
- bool hasImage() const { return m_image != 0; }
- StyleImage* image() const { return m_image.get(); }
- void setImage(PassRefPtr<StyleImage> image) { m_image = image; }
+ NinePieceImage(const NinePieceImage& other)
+ {
+ *this = other;
+ }
+
+ void operator=(const NinePieceImage& other)
+ {
+ if (!other.m_data) {
+ m_data.clear();
+ return;
+ }
+ const NinePieceImageData& otherData = other.data();
+ m_data = adoptPtr(new NinePieceImageData(otherData.m_image, otherData.m_imageSlices, otherData.m_fill, otherData.m_borderSlices, otherData.m_outset, static_cast<ENinePieceImageRule>(otherData.m_horizontalRule), static_cast<ENinePieceImageRule>(otherData.m_verticalRule)));
+ }
+
+ bool operator==(const NinePieceImage& other) const { return data() == other.data(); }
+ bool operator!=(const NinePieceImage& other) const { return !(*this == other); }
+
+ bool hasImage() const { return m_data && m_data->m_image; }
+ StyleImage* image() const { return m_data ? m_data->m_image.get() : 0; }
+ void setImage(PassRefPtr<StyleImage> image) { ensureData(); m_data->m_image = image; }
- const LengthBox& imageSlices() const { return m_imageSlices; }
- void setImageSlices(const LengthBox& slices) { m_imageSlices = slices; }
+ const LengthBox& imageSlices() const { return data().m_imageSlices; }
+ void setImageSlices(const LengthBox& slices) { ensureData(); m_data->m_imageSlices = slices; }
- bool fill() const { return m_fill; }
- void setFill(bool fill) { m_fill = fill; }
+ bool fill() const { return data().m_fill; }
+ void setFill(bool fill) { ensureData(); m_data->m_fill = fill; }
- const LengthBox& borderSlices() const { return m_borderSlices; }
- void setBorderSlices(const LengthBox& slices) { m_borderSlices = slices; }
+ const LengthBox& borderSlices() const { return data().m_borderSlices; }
+ void setBorderSlices(const LengthBox& slices) { ensureData(); m_data->m_borderSlices = slices; }
- const LengthBox& outset() const { return m_outset; }
- void setOutset(const LengthBox& outset) { m_outset = outset; }
+ const LengthBox& outset() const { return data().m_outset; }
+ void setOutset(const LengthBox& outset) { ensureData(); m_data->m_outset = outset; }
static LayoutUnit computeOutset(Length outsetSide, LayoutUnit borderSide)
{
@@ -84,49 +119,63 @@ public:
return outsetSide.value();
}
- ENinePieceImageRule horizontalRule() const { return static_cast<ENinePieceImageRule>(m_horizontalRule); }
- void setHorizontalRule(ENinePieceImageRule rule) { m_horizontalRule = rule; }
+ ENinePieceImageRule horizontalRule() const { return static_cast<ENinePieceImageRule>(data().m_horizontalRule); }
+ void setHorizontalRule(ENinePieceImageRule rule) { ensureData(); m_data->m_horizontalRule = rule; }
- ENinePieceImageRule verticalRule() const { return static_cast<ENinePieceImageRule>(m_verticalRule); }
- void setVerticalRule(ENinePieceImageRule rule) { m_verticalRule = rule; }
+ ENinePieceImageRule verticalRule() const { return static_cast<ENinePieceImageRule>(data().m_verticalRule); }
+ void setVerticalRule(ENinePieceImageRule rule) { ensureData(); m_data->m_verticalRule = rule; }
void copyImageSlicesFrom(const NinePieceImage& other)
{
- m_imageSlices = other.m_imageSlices;
- m_fill = other.m_fill;
+ ensureData();
+ m_data->m_imageSlices = other.data().m_imageSlices;
+ m_data->m_fill = other.data().m_fill;
}
void copyBorderSlicesFrom(const NinePieceImage& other)
{
- m_borderSlices = other.m_borderSlices;
+ ensureData();
+ m_data->m_borderSlices = other.data().m_borderSlices;
}
void copyOutsetFrom(const NinePieceImage& other)
{
- m_outset = other.m_outset;
+ ensureData();
+ m_data->m_outset = other.data().m_outset;
}
void copyRepeatFrom(const NinePieceImage& other)
{
- m_horizontalRule = other.m_horizontalRule;
- m_verticalRule = other.m_verticalRule;
+ ensureData();
+ m_data->m_horizontalRule = other.data().m_horizontalRule;
+ m_data->m_verticalRule = other.data().m_verticalRule;
}
void setMaskDefaults()
{
- m_imageSlices = LengthBox(0);
- m_fill = true;
- m_borderSlices = LengthBox();
+ ensureData();
+ m_data->m_imageSlices = LengthBox(0);
+ m_data->m_fill = true;
+ m_data->m_borderSlices = LengthBox();
}
private:
- RefPtr<StyleImage> m_image;
- LengthBox m_imageSlices;
- LengthBox m_borderSlices;
- LengthBox m_outset;
- bool m_fill : 1;
- unsigned m_horizontalRule : 2; // ENinePieceImageRule
- unsigned m_verticalRule : 2; // ENinePieceImageRule
+ static const NinePieceImageData& defaultData();
+
+ void ensureData()
+ {
+ if (!m_data)
+ m_data = adoptPtr(new NinePieceImageData);
+ }
+
+ const NinePieceImageData& data() const
+ {
+ if (m_data)
+ return *m_data;
+ return defaultData();
+ }
+
+ OwnPtr<NinePieceImageData> m_data;
};
} // namespace WebCore
diff --git a/Source/WebCore/rendering/style/QuotesData.cpp b/Source/WebCore/rendering/style/QuotesData.cpp
index c854bd53c..a6a7c5ef2 100644
--- a/Source/WebCore/rendering/style/QuotesData.cpp
+++ b/Source/WebCore/rendering/style/QuotesData.cpp
@@ -47,7 +47,7 @@ void QuotesData::addPair(std::pair<String, String> quotePair)
const String QuotesData::getOpenQuote(int index) const
{
ASSERT(index >= 0);
- if (!m_quotePairs.size())
+ if (!m_quotePairs.size() || index < 0)
return emptyString();
if ((size_t)index >= m_quotePairs.size())
return m_quotePairs.last().first;
@@ -56,8 +56,8 @@ const String QuotesData::getOpenQuote(int index) const
const String QuotesData::getCloseQuote(int index) const
{
- ASSERT(index >= 0);
- if (!m_quotePairs.size())
+ ASSERT(index >= -1);
+ if (!m_quotePairs.size() || index < 0)
return emptyString();
if ((size_t)index >= m_quotePairs.size())
return m_quotePairs.last().second;
diff --git a/Source/WebCore/rendering/style/RenderStyle.cpp b/Source/WebCore/rendering/style/RenderStyle.cpp
index 2303ffa04..72a438961 100644
--- a/Source/WebCore/rendering/style/RenderStyle.cpp
+++ b/Source/WebCore/rendering/style/RenderStyle.cpp
@@ -26,7 +26,6 @@
#include "ContentData.h"
#include "CursorList.h"
#include "CSSPropertyNames.h"
-#include "CSSWrapShapes.h"
#include "FontSelector.h"
#include "MemoryInstrumentation.h"
#include "QuotesData.h"
@@ -489,6 +488,11 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon
return StyleDifferenceLayout;
}
+#if ENABLE(TEXT_AUTOSIZING)
+ if (visual->m_textAutosizingMultiplier != other->visual->m_textAutosizingMultiplier)
+ return StyleDifferenceLayout;
+#endif
+
if (inherited->line_height != other->inherited->line_height
|| inherited->list_style_image != other->inherited->list_style_image
|| inherited->font != other->inherited->font
@@ -563,9 +567,6 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon
const CounterDirectiveMap* mapB = other->rareNonInheritedData->m_counterDirectives.get();
if (!(mapA == mapB || (mapA && mapB && *mapA == *mapB)))
return StyleDifferenceLayout;
- if (rareNonInheritedData->m_counterIncrement != other->rareNonInheritedData->m_counterIncrement
- || rareNonInheritedData->m_counterReset != other->rareNonInheritedData->m_counterReset)
- return StyleDifferenceLayout;
if ((visibility() == COLLAPSE) != (other->visibility() == COLLAPSE))
return StyleDifferenceLayout;
@@ -608,6 +609,11 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon
|| visual->clip != other->visual->clip || visual->hasClip != other->visual->hasClip)
return StyleDifferenceRepaintLayer;
}
+
+#if ENABLE(CSS_COMPOSITING)
+ if (rareNonInheritedData->m_effectiveBlendMode != other->rareNonInheritedData->m_effectiveBlendMode)
+ return StyleDifferenceRepaintLayer;
+#endif
if (rareNonInheritedData->opacity != other->rareNonInheritedData->opacity) {
#if USE(ACCELERATED_COMPOSITING)
@@ -646,6 +652,9 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon
|| rareInheritedData->userSelect != other->rareInheritedData->userSelect
|| rareNonInheritedData->userDrag != other->rareNonInheritedData->userDrag
|| rareNonInheritedData->m_borderFit != other->rareNonInheritedData->m_borderFit
+#if ENABLE(CSS3_TEXT_DECORATION)
+ || rareNonInheritedData->m_textDecorationStyle != other->rareNonInheritedData->m_textDecorationStyle
+#endif // CSS3_TEXT_DECORATION
|| rareInheritedData->textFillColor != other->rareInheritedData->textFillColor
|| rareInheritedData->textStrokeColor != other->rareInheritedData->textStrokeColor
|| rareInheritedData->textEmphasisColor != other->rareInheritedData->textEmphasisColor
@@ -943,6 +952,23 @@ static float calcConstraintScaleFor(const IntRect& rect, const RoundedRect::Radi
return factor;
}
+StyleImage* RenderStyle::listStyleImage() const { return inherited->list_style_image.get(); }
+void RenderStyle::setListStyleImage(PassRefPtr<StyleImage> v)
+{
+ if (inherited->list_style_image != v)
+ inherited.access()->list_style_image = v;
+}
+
+Color RenderStyle::color() const { return inherited->color; }
+Color RenderStyle::visitedLinkColor() const { return inherited->visitedLinkColor; }
+void RenderStyle::setColor(const Color& v) { SET_VAR(inherited, color, v) };
+void RenderStyle::setVisitedLinkColor(const Color& v) { SET_VAR(inherited, visitedLinkColor, v) }
+
+short RenderStyle::horizontalBorderSpacing() const { return inherited->horizontal_border_spacing; }
+short RenderStyle::verticalBorderSpacing() const { return inherited->vertical_border_spacing; }
+void RenderStyle::setHorizontalBorderSpacing(short v) { SET_VAR(inherited, horizontal_border_spacing, v) }
+void RenderStyle::setVerticalBorderSpacing(short v) { SET_VAR(inherited, vertical_border_spacing, v) }
+
RoundedRect RenderStyle::getRoundedBorderFor(const LayoutRect& borderRect, RenderView* renderView, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
{
IntRect snappedBorderRect(pixelSnappedIntRect(borderRect));
@@ -1165,12 +1191,80 @@ const Animation* RenderStyle::transitionForProperty(CSSPropertyID property) cons
return 0;
}
-void RenderStyle::setBlendedFontSize(int size)
+const Font& RenderStyle::font() const { return inherited->font; }
+const FontMetrics& RenderStyle::fontMetrics() const { return inherited->font.fontMetrics(); }
+const FontDescription& RenderStyle::fontDescription() const { return inherited->font.fontDescription(); }
+float RenderStyle::specifiedFontSize() const { return fontDescription().specifiedSize(); }
+float RenderStyle::computedFontSize() const { return fontDescription().computedSize(); }
+int RenderStyle::fontSize() const { return inherited->font.pixelSize(); }
+
+int RenderStyle::wordSpacing() const { return inherited->font.wordSpacing(); }
+int RenderStyle::letterSpacing() const { return inherited->font.letterSpacing(); }
+
+bool RenderStyle::setFontDescription(const FontDescription& v)
+{
+ if (inherited->font.fontDescription() != v) {
+ inherited.access()->font = Font(v, inherited->font.letterSpacing(), inherited->font.wordSpacing());
+ return true;
+ }
+ return false;
+}
+
+Length RenderStyle::specifiedLineHeight() const { return inherited->line_height; }
+Length RenderStyle::lineHeight() const
+{
+ const Length& lh = inherited->line_height;
+#if ENABLE(TEXT_AUTOSIZING)
+ // Unlike fontDescription().computedSize() and hence fontSize(), this is
+ // recalculated on demand as we only store the specified line height.
+ // FIXME: Should consider scaling the fixed part of any calc expressions
+ // too, though this involves messily poking into CalcExpressionLength.
+ float multiplier = textAutosizingMultiplier();
+ if (multiplier > 1 && lh.isFixed())
+ return Length(lh.value() * multiplier, Fixed);
+#endif
+ return lh;
+}
+void RenderStyle::setLineHeight(Length specifiedLineHeight) { SET_VAR(inherited, line_height, specifiedLineHeight); }
+
+int RenderStyle::computedLineHeight(RenderView* renderView) const
+{
+ const Length& lh = lineHeight();
+
+ // Negative value means the line height is not set. Use the font's built-in spacing.
+ if (lh.isNegative())
+ return fontMetrics().lineSpacing();
+
+ if (lh.isPercent())
+ return minimumValueForLength(lh, fontSize());
+
+ if (lh.isViewportPercentage())
+ return valueForLength(lh, 0, renderView);
+
+ return lh.value();
+}
+
+void RenderStyle::setWordSpacing(int v) { inherited.access()->font.setWordSpacing(v); }
+void RenderStyle::setLetterSpacing(int v) { inherited.access()->font.setLetterSpacing(v); }
+
+void RenderStyle::setFontSize(float size)
{
+ // size must be specifiedSize if Text Autosizing is enabled, but computedSize if text
+ // zoom is enabled (if neither is enabled it's irrelevant as they're probably the same).
+
FontSelector* currentFontSelector = font().fontSelector();
FontDescription desc(fontDescription());
desc.setSpecifiedSize(size);
desc.setComputedSize(size);
+
+#if ENABLE(TEXT_AUTOSIZING)
+ float multiplier = textAutosizingMultiplier();
+ if (multiplier > 1) {
+ // FIXME: Large font sizes needn't be multiplied as much since they are already more legible.
+ desc.setComputedSize(size * multiplier);
+ }
+#endif
+
setFontDescription(desc);
font().update(currentFontSelector);
}
diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h
index 5c0bd5dcf..0925f80b7 100644
--- a/Source/WebCore/rendering/style/RenderStyle.h
+++ b/Source/WebCore/rendering/style/RenderStyle.h
@@ -594,18 +594,27 @@ public:
EClear clear() const { return static_cast<EClear>(noninherited_flags._clear); }
ETableLayout tableLayout() const { return static_cast<ETableLayout>(noninherited_flags._table_layout); }
- const Font& font() const { return inherited->font; }
- const FontMetrics& fontMetrics() const { return inherited->font.fontMetrics(); }
- const FontDescription& fontDescription() const { return inherited->font.fontDescription(); }
- int fontSize() const { return inherited->font.pixelSize(); }
+ const Font& font() const;
+ const FontMetrics& fontMetrics() const;
+ const FontDescription& fontDescription() const;
+ float specifiedFontSize() const;
+ float computedFontSize() const;
+ int fontSize() const;
+
+#if ENABLE(TEXT_AUTOSIZING)
+ float textAutosizingMultiplier() const { return visual->m_textAutosizingMultiplier; }
+#endif
Length textIndent() const { return rareInheritedData->indent; }
ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flags._text_align); }
ETextTransform textTransform() const { return static_cast<ETextTransform>(inherited_flags._text_transform); }
ETextDecoration textDecorationsInEffect() const { return static_cast<ETextDecoration>(inherited_flags._text_decorations); }
ETextDecoration textDecoration() const { return static_cast<ETextDecoration>(visual->textDecoration); }
- int wordSpacing() const { return inherited->font.wordSpacing(); }
- int letterSpacing() const { return inherited->font.letterSpacing(); }
+#if ENABLE(CSS3_TEXT_DECORATION)
+ TextDecorationStyle textDecorationStyle() const { return static_cast<TextDecorationStyle>(rareNonInheritedData->m_textDecorationStyle); }
+#endif // CSS3_TEXT_DECORATION
+ int wordSpacing() const;
+ int letterSpacing() const;
float zoom() const { return visual->m_zoom; }
float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; }
@@ -613,23 +622,9 @@ public:
TextDirection direction() const { return static_cast<TextDirection>(inherited_flags._direction); }
bool isLeftToRightDirection() const { return direction() == LTR; }
- Length lineHeight() const { return inherited->line_height; }
- int computedLineHeight(RenderView* renderView = 0) const
- {
- const Length& lh = inherited->line_height;
-
- // Negative value means the line height is not set. Use the font's built-in spacing.
- if (lh.isNegative())
- return fontMetrics().lineSpacing();
-
- if (lh.isPercent())
- return minimumValueForLength(lh, fontSize());
-
- if (lh.isViewportPercentage())
- return valueForLength(lh, 0, renderView);
-
- return lh.value();
- }
+ Length specifiedLineHeight() const;
+ Length lineHeight() const;
+ int computedLineHeight(RenderView* = 0) const;
EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(inherited_flags._white_space); }
static bool autoWrap(EWhiteSpace ws)
@@ -717,16 +712,13 @@ public:
StyleImage* maskBoxImageSource() const { return rareNonInheritedData->m_maskBoxImage.image(); }
EBorderCollapse borderCollapse() const { return static_cast<EBorderCollapse>(inherited_flags._border_collapse); }
- short horizontalBorderSpacing() const { return inherited->horizontal_border_spacing; }
- short verticalBorderSpacing() const { return inherited->vertical_border_spacing; }
+ short horizontalBorderSpacing() const;
+ short verticalBorderSpacing() const;
EEmptyCell emptyCells() const { return static_cast<EEmptyCell>(inherited_flags._empty_cells); }
ECaptionSide captionSide() const { return static_cast<ECaptionSide>(inherited_flags._caption_side); }
- short counterIncrement() const { return rareNonInheritedData->m_counterIncrement; }
- short counterReset() const { return rareNonInheritedData->m_counterReset; }
-
EListStyleType listStyleType() const { return static_cast<EListStyleType>(inherited_flags._list_style_type); }
- StyleImage* listStyleImage() const { return inherited->list_style_image.get(); }
+ StyleImage* listStyleImage() const;
EListStylePosition listStylePosition() const { return static_cast<EListStylePosition>(inherited_flags._list_style_position); }
Length marginTop() const { return surround->margin.top(); }
@@ -986,6 +978,14 @@ public:
bool hasFilter() const { return false; }
#endif
+#if ENABLE(CSS_COMPOSITING)
+ BlendMode blendMode() const { return static_cast<BlendMode>(rareNonInheritedData->m_effectiveBlendMode); }
+ void setBlendMode(BlendMode v) { rareNonInheritedData.access()->m_effectiveBlendMode = v; }
+ bool hasBlendMode() const { return static_cast<BlendMode>(rareNonInheritedData->m_effectiveBlendMode) == BlendModeNormal; }
+#else
+ bool hasBlendMode() const { return false; }
+#endif
+
#if USE(RTL_SCROLLBAR)
bool shouldPlaceBlockDirectionScrollbarOnLogicalLeft() const { return !isLeftToRightDirection() && isHorizontalWritingMode(); }
#else
@@ -1116,27 +1116,30 @@ public:
void setClear(EClear v) { noninherited_flags._clear = v; }
void setTableLayout(ETableLayout v) { noninherited_flags._table_layout = v; }
- bool setFontDescription(const FontDescription& v)
+ bool setFontDescription(const FontDescription&);
+ // Only used for blending font sizes when animating, for MathML anonymous blocks, and for text autosizing.
+ void setFontSize(float);
+
+#if ENABLE(TEXT_AUTOSIZING)
+ void setTextAutosizingMultiplier(float v)
{
- if (inherited->font.fontDescription() != v) {
- inherited.access()->font = Font(v, inherited->font.letterSpacing(), inherited->font.wordSpacing());
- return true;
- }
- return false;
+ SET_VAR(visual, m_textAutosizingMultiplier, v)
+ setFontSize(fontDescription().specifiedSize());
}
+#endif
- // Only used for blending font sizes when animating, or MathML anonymous blocks.
- void setBlendedFontSize(int);
-
- void setColor(const Color& v) { SET_VAR(inherited, color, v) }
+ void setColor(const Color&);
void setTextIndent(Length v) { SET_VAR(rareInheritedData, indent, v) }
void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; }
void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; }
void addToTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations |= v; }
void setTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations = v; }
void setTextDecoration(ETextDecoration v) { SET_VAR(visual, textDecoration, v); }
+#if ENABLE(CSS3_TEXT_DECORATION)
+ void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInheritedData, m_textDecorationStyle, v); }
+#endif // CSS3_TEXT_DECORATION
void setDirection(TextDirection v) { inherited_flags._direction = v; }
- void setLineHeight(Length v) { SET_VAR(inherited, line_height, v) }
+ void setLineHeight(Length specifiedLineHeight);
bool setZoom(float);
void setZoomWithoutReturnValue(float f) { setZoom(f); }
bool setEffectiveZoom(float);
@@ -1155,8 +1158,8 @@ public:
void setWhiteSpace(EWhiteSpace v) { inherited_flags._white_space = v; }
- void setWordSpacing(int v) { inherited.access()->font.setWordSpacing(v); }
- void setLetterSpacing(int v) { inherited.access()->font.setLetterSpacing(v); }
+ void setWordSpacing(int);
+ void setLetterSpacing(int);
void clearBackgroundLayers() { m_background.access()->m_background = FillLayer(BackgroundFillLayer); }
void inheritBackgroundLayers(const FillLayer& parent) { m_background.access()->m_background = parent; }
@@ -1189,19 +1192,17 @@ public:
void setMaskSize(LengthSize l) { SET_VAR(rareNonInheritedData, m_mask.m_sizeLength, l) }
void setBorderCollapse(EBorderCollapse collapse) { inherited_flags._border_collapse = collapse; }
- void setHorizontalBorderSpacing(short v) { SET_VAR(inherited, horizontal_border_spacing, v) }
- void setVerticalBorderSpacing(short v) { SET_VAR(inherited, vertical_border_spacing, v) }
+ void setHorizontalBorderSpacing(short);
+ void setVerticalBorderSpacing(short);
void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; }
void setCaptionSide(ECaptionSide v) { inherited_flags._caption_side = v; }
void setHasAspectRatio(bool b) { SET_VAR(rareNonInheritedData, m_hasAspectRatio, b); }
void setAspectRatioDenominator(float v) { SET_VAR(rareNonInheritedData, m_aspectRatioDenominator, v); }
void setAspectRatioNumerator(float v) { SET_VAR(rareNonInheritedData, m_aspectRatioNumerator, v); }
- void setCounterIncrement(short v) { SET_VAR(rareNonInheritedData, m_counterIncrement, v) }
- void setCounterReset(short v) { SET_VAR(rareNonInheritedData, m_counterReset, v) }
void setListStyleType(EListStyleType v) { inherited_flags._list_style_type = v; }
- void setListStyleImage(PassRefPtr<StyleImage> v) { if (inherited->list_style_image != v) inherited.access()->list_style_image = v; }
+ void setListStyleImage(PassRefPtr<StyleImage>);
void setListStylePosition(EListStylePosition v) { inherited_flags._list_style_position = v; }
void resetMargin() { SET_VAR(surround, margin, LengthBox(Fixed)) }
@@ -1583,6 +1584,9 @@ public:
static Length initialLineHeight() { return Length(-100.0, Percent); }
static ETextAlign initialTextAlign() { return TASTART; }
static ETextDecoration initialTextDecoration() { return TDNONE; }
+#if ENABLE(CSS3_TEXT_DECORATION)
+ static TextDecorationStyle initialTextDecorationStyle() { return TextDecorationStyleSolid; }
+#endif // CSS3_TEXT_DECORATION
static float initialZoom() { return 1.0f; }
static int initialOutlineOffset() { return 0; }
static float initialOpacity() { return 1.0f; }
@@ -1712,8 +1716,11 @@ public:
#if ENABLE(CSS_FILTERS)
static const FilterOperations& initialFilter() { DEFINE_STATIC_LOCAL(FilterOperations, ops, ()); return ops; }
#endif
+#if ENABLE(CSS_COMPOSITING)
+ static BlendMode initialBlendMode() { return BlendModeNormal; }
+#endif
private:
- void setVisitedLinkColor(const Color& v) { SET_VAR(inherited, visitedLinkColor, v) }
+ void setVisitedLinkColor(const Color&);
void setVisitedLinkBackgroundColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBackgroundColor, v) }
void setVisitedLinkBorderLeftColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderLeftColor, v) }
void setVisitedLinkBorderRightColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderRightColor, v) }
@@ -1759,13 +1766,13 @@ private:
Color borderTopColor() const { return surround->border.top().color(); }
Color borderBottomColor() const { return surround->border.bottom().color(); }
Color backgroundColor() const { return m_background->color(); }
- Color color() const { return inherited->color; }
+ Color color() const;
Color columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color(); }
Color outlineColor() const { return m_background->outline().color(); }
Color textEmphasisColor() const { return rareInheritedData->textEmphasisColor; }
Color textFillColor() const { return rareInheritedData->textFillColor; }
Color textStrokeColor() const { return rareInheritedData->textStrokeColor; }
- Color visitedLinkColor() const { return inherited->visitedLinkColor; }
+ Color visitedLinkColor() const;
Color visitedLinkBackgroundColor() const { return rareNonInheritedData->m_visitedLinkBackgroundColor; }
Color visitedLinkBorderLeftColor() const { return rareNonInheritedData->m_visitedLinkBorderLeftColor; }
Color visitedLinkBorderRightColor() const { return rareNonInheritedData->m_visitedLinkBorderRightColor; }
diff --git a/Source/WebCore/rendering/style/RenderStyleConstants.h b/Source/WebCore/rendering/style/RenderStyleConstants.h
index f71934a3c..b0c330d13 100644
--- a/Source/WebCore/rendering/style/RenderStyleConstants.h
+++ b/Source/WebCore/rendering/style/RenderStyleConstants.h
@@ -345,6 +345,16 @@ enum ETextDecoration {
inline ETextDecoration operator|(ETextDecoration a, ETextDecoration b) { return ETextDecoration(int(a) | int(b)); }
inline ETextDecoration& operator|=(ETextDecoration& a, ETextDecoration b) { return a = a | b; }
+#if ENABLE(CSS3_TEXT_DECORATION)
+enum TextDecorationStyle {
+ TextDecorationStyleSolid,
+ TextDecorationStyleDouble,
+ TextDecorationStyleDotted,
+ TextDecorationStyleDashed,
+ TextDecorationStyleWavy
+};
+#endif // CSS3_TEXT_DECORATION
+
enum EPageBreak {
PBAUTO, PBALWAYS, PBAVOID
};
diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
index 8d57922e3..1e2f4488d 100644
--- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
+++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
@@ -38,8 +38,6 @@ StyleRareNonInheritedData::StyleRareNonInheritedData()
: opacity(RenderStyle::initialOpacity())
, m_aspectRatioDenominator(RenderStyle::initialAspectRatioDenominator())
, m_aspectRatioNumerator(RenderStyle::initialAspectRatioNumerator())
- , m_counterIncrement(0)
- , m_counterReset(0)
, m_perspective(RenderStyle::initialPerspective())
, m_perspectiveOriginX(RenderStyle::initialPerspectiveOriginX())
, m_perspectiveOriginY(RenderStyle::initialPerspectiveOriginY())
@@ -72,12 +70,18 @@ StyleRareNonInheritedData::StyleRareNonInheritedData()
, m_appearance(RenderStyle::initialAppearance())
, m_borderFit(RenderStyle::initialBorderFit())
, m_textCombine(RenderStyle::initialTextCombine())
+#if ENABLE(CSS3_TEXT_DECORATION)
+ , m_textDecorationStyle(RenderStyle::initialTextDecorationStyle())
+#endif // CSS3_TEXT_DECORATION
, m_wrapFlow(RenderStyle::initialWrapFlow())
, m_wrapThrough(RenderStyle::initialWrapThrough())
#if USE(ACCELERATED_COMPOSITING)
, m_runningAcceleratedAnimation(false)
#endif
, m_hasAspectRatio(false)
+#if ENABLE(CSS_COMPOSITING)
+ , m_effectiveBlendMode(RenderStyle::initialBlendMode())
+#endif
{
m_maskBoxImage.setMaskDefaults();
}
@@ -87,8 +91,6 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited
, opacity(o.opacity)
, m_aspectRatioDenominator(o.m_aspectRatioDenominator)
, m_aspectRatioNumerator(o.m_aspectRatioNumerator)
- , m_counterIncrement(o.m_counterIncrement)
- , m_counterReset(o.m_counterReset)
, m_perspective(o.m_perspective)
, m_perspectiveOriginX(o.m_perspectiveOriginX)
, m_perspectiveOriginY(o.m_perspectiveOriginY)
@@ -143,12 +145,18 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited
, m_appearance(o.m_appearance)
, m_borderFit(o.m_borderFit)
, m_textCombine(o.m_textCombine)
+#if ENABLE(CSS3_TEXT_DECORATION)
+ , m_textDecorationStyle(o.m_textDecorationStyle)
+#endif // CSS3_TEXT_DECORATION
, m_wrapFlow(o.m_wrapFlow)
, m_wrapThrough(o.m_wrapThrough)
#if USE(ACCELERATED_COMPOSITING)
, m_runningAcceleratedAnimation(o.m_runningAcceleratedAnimation)
#endif
, m_hasAspectRatio(o.m_hasAspectRatio)
+#if ENABLE(CSS_COMPOSITING)
+ , m_effectiveBlendMode(RenderStyle::initialBlendMode())
+#endif
{
}
@@ -161,8 +169,6 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
return opacity == o.opacity
&& m_aspectRatioDenominator == o.m_aspectRatioDenominator
&& m_aspectRatioNumerator == o.m_aspectRatioNumerator
- && m_counterIncrement == o.m_counterIncrement
- && m_counterReset == o.m_counterReset
&& m_perspective == o.m_perspective
&& m_perspectiveOriginX == o.m_perspectiveOriginX
&& m_perspectiveOriginY == o.m_perspectiveOriginY
@@ -220,11 +226,17 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
&& m_appearance == o.m_appearance
&& m_borderFit == o.m_borderFit
&& m_textCombine == o.m_textCombine
+#if ENABLE(CSS3_TEXT_DECORATION)
+ && m_textDecorationStyle == o.m_textDecorationStyle
+#endif // CSS3_TEXT_DECORATION
&& m_wrapFlow == o.m_wrapFlow
&& m_wrapThrough == o.m_wrapThrough
#if USE(ACCELERATED_COMPOSITING)
&& !m_runningAcceleratedAnimation && !o.m_runningAcceleratedAnimation
#endif
+#if ENABLE(CSS_COMPOSITING)
+ && m_effectiveBlendMode == o.m_effectiveBlendMode
+#endif
&& m_hasAspectRatio == o.m_hasAspectRatio;
}
diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h b/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
index a206015ec..e6f4a18be 100644
--- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
+++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
@@ -97,9 +97,6 @@ public:
float m_aspectRatioDenominator;
float m_aspectRatioNumerator;
- short m_counterIncrement;
- short m_counterReset;
-
float m_perspective;
Length m_perspectiveOriginX;
Length m_perspectiveOriginY;
@@ -176,14 +173,22 @@ public:
unsigned m_borderFit : 1; // EBorderFit
unsigned m_textCombine : 1; // CSS3 text-combine properties
+#if ENABLE(CSS3_TEXT_DECORATION)
+ unsigned m_textDecorationStyle : 3; // TextDecorationStyle
+#endif // CSS3_TEXT_DECORATION
unsigned m_wrapFlow: 3; // WrapFlow
unsigned m_wrapThrough: 1; // WrapThrough
#if USE(ACCELERATED_COMPOSITING)
unsigned m_runningAcceleratedAnimation : 1;
#endif
+
unsigned m_hasAspectRatio : 1; // Whether or not an aspect ratio has been specified.
+#if ENABLE(CSS_COMPOSITING)
+ unsigned m_effectiveBlendMode: 5; // EBlendMode
+#endif
+
private:
StyleRareNonInheritedData();
StyleRareNonInheritedData(const StyleRareNonInheritedData&);
diff --git a/Source/WebCore/rendering/style/StyleVisualData.cpp b/Source/WebCore/rendering/style/StyleVisualData.cpp
index 14996c918..628a20ace 100644
--- a/Source/WebCore/rendering/style/StyleVisualData.cpp
+++ b/Source/WebCore/rendering/style/StyleVisualData.cpp
@@ -29,6 +29,9 @@ namespace WebCore {
StyleVisualData::StyleVisualData()
: hasClip(false)
, textDecoration(RenderStyle::initialTextDecoration())
+#if ENABLE(TEXT_AUTOSIZING)
+ , m_textAutosizingMultiplier(1)
+#endif
, m_zoom(RenderStyle::initialZoom())
{
}
@@ -42,6 +45,9 @@ StyleVisualData::StyleVisualData(const StyleVisualData& o)
, clip(o.clip)
, hasClip(o.hasClip)
, textDecoration(o.textDecoration)
+#if ENABLE(TEXT_AUTOSIZING)
+ , m_textAutosizingMultiplier(o.m_textAutosizingMultiplier)
+#endif
, m_zoom(RenderStyle::initialZoom())
{
}
diff --git a/Source/WebCore/rendering/style/StyleVisualData.h b/Source/WebCore/rendering/style/StyleVisualData.h
index 1affdb016..b5140a78d 100644
--- a/Source/WebCore/rendering/style/StyleVisualData.h
+++ b/Source/WebCore/rendering/style/StyleVisualData.h
@@ -40,17 +40,23 @@ public:
bool operator==(const StyleVisualData& o) const
{
- return ( clip == o.clip &&
- hasClip == o.hasClip &&
- textDecoration == o.textDecoration &&
- m_zoom == o.m_zoom);
+ return clip == o.clip
+ && hasClip == o.hasClip
+ && textDecoration == o.textDecoration
+#if ENABLE(TEXT_AUTOSIZING)
+ && m_textAutosizingMultiplier == o.m_textAutosizingMultiplier
+#endif
+ && m_zoom == o.m_zoom;
}
bool operator!=(const StyleVisualData& o) const { return !(*this == o); }
LengthBox clip;
bool hasClip : 1;
unsigned textDecoration : ETextDecorationBits; // Text decorations defined *only* by this element.
-
+
+#if ENABLE(TEXT_AUTOSIZING)
+ float m_textAutosizingMultiplier;
+#endif
float m_zoom;
private:
diff --git a/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp b/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
index 0a975f415..8f842ee21 100644
--- a/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
@@ -190,9 +190,9 @@ bool RenderSVGForeignObject::nodeAtPoint(const HitTestRequest&, HitTestResult&,
return false;
}
-void RenderSVGForeignObject::mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState& transformState, MapLocalToContainerFlags, bool* wasFixed) const
+void RenderSVGForeignObject::mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState& transformState, MapLocalToContainerFlags mode, bool* wasFixed) const
{
- SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, wasFixed);
+ SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, mode & SnapOffsetForTransforms, wasFixed);
}
const RenderObject* RenderSVGForeignObject::pushMappingToContainer(const RenderBoxModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const
diff --git a/Source/WebCore/rendering/svg/RenderSVGForeignObject.h b/Source/WebCore/rendering/svg/RenderSVGForeignObject.h
index 7da36eac6..7e52e00c2 100644
--- a/Source/WebCore/rendering/svg/RenderSVGForeignObject.h
+++ b/Source/WebCore/rendering/svg/RenderSVGForeignObject.h
@@ -54,7 +54,7 @@ public:
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE;
virtual bool isSVGForeignObject() const { return true; }
- virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState&, MapLocalToContainerFlags mode = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
+ virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState&, MapLocalToContainerFlags mode = ApplyContainerFlip | SnapOffsetForTransforms, bool* wasFixed = 0) const OVERRIDE;
virtual const RenderObject* pushMappingToContainer(const RenderBoxModelObject* ancestorToStopAt, RenderGeometryMap&) const;
virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; }
diff --git a/Source/WebCore/rendering/svg/RenderSVGInline.cpp b/Source/WebCore/rendering/svg/RenderSVGInline.cpp
index 2c6312eeb..21bed4a15 100644
--- a/Source/WebCore/rendering/svg/RenderSVGInline.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGInline.cpp
@@ -79,9 +79,9 @@ void RenderSVGInline::computeFloatRectForRepaint(RenderBoxModelObject* repaintCo
SVGRenderSupport::computeFloatRectForRepaint(this, repaintContainer, repaintRect, fixed);
}
-void RenderSVGInline::mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState& transformState, MapLocalToContainerFlags, bool* wasFixed) const
+void RenderSVGInline::mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState& transformState, MapLocalToContainerFlags mode, bool* wasFixed) const
{
- SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, wasFixed);
+ SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, mode & SnapOffsetForTransforms, wasFixed);
}
const RenderObject* RenderSVGInline::pushMappingToContainer(const RenderBoxModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const
diff --git a/Source/WebCore/rendering/svg/RenderSVGInline.h b/Source/WebCore/rendering/svg/RenderSVGInline.h
index 3dc7dda80..8ef9ced7a 100644
--- a/Source/WebCore/rendering/svg/RenderSVGInline.h
+++ b/Source/WebCore/rendering/svg/RenderSVGInline.h
@@ -47,7 +47,7 @@ public:
virtual LayoutRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const;
virtual void computeFloatRectForRepaint(RenderBoxModelObject* repaintContainer, FloatRect&, bool fixed = false) const;
- virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState&, MapLocalToContainerFlags mode = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
+ virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState&, MapLocalToContainerFlags mode = ApplyContainerFlip | SnapOffsetForTransforms, bool* wasFixed = 0) const OVERRIDE;
virtual const RenderObject* pushMappingToContainer(const RenderBoxModelObject* ancestorToStopAt, RenderGeometryMap&) const;
virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const;
diff --git a/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp b/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
index 7314179c8..082bf487e 100644
--- a/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
@@ -55,9 +55,9 @@ void RenderSVGModelObject::computeFloatRectForRepaint(RenderBoxModelObject* repa
SVGRenderSupport::computeFloatRectForRepaint(this, repaintContainer, repaintRect, fixed);
}
-void RenderSVGModelObject::mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState& transformState, MapLocalToContainerFlags, bool* wasFixed) const
+void RenderSVGModelObject::mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState& transformState, MapLocalToContainerFlags mode, bool* wasFixed) const
{
- SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, wasFixed);
+ SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, mode & SnapOffsetForTransforms, wasFixed);
}
const RenderObject* RenderSVGModelObject::pushMappingToContainer(const RenderBoxModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const
diff --git a/Source/WebCore/rendering/svg/RenderSVGModelObject.h b/Source/WebCore/rendering/svg/RenderSVGModelObject.h
index b4c3f68aa..a28376625 100644
--- a/Source/WebCore/rendering/svg/RenderSVGModelObject.h
+++ b/Source/WebCore/rendering/svg/RenderSVGModelObject.h
@@ -58,7 +58,7 @@ public:
virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const;
virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const;
- virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState&, MapLocalToContainerFlags mode = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
+ virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState&, MapLocalToContainerFlags mode = ApplyContainerFlip | SnapOffsetForTransforms, bool* wasFixed = 0) const OVERRIDE;
virtual const RenderObject* pushMappingToContainer(const RenderBoxModelObject* ancestorToStopAt, RenderGeometryMap&) const;
virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp b/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
index 0f91610e6..ee6a49db8 100644
--- a/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
@@ -121,6 +121,8 @@ PassRefPtr<SVGFilterBuilder> RenderSVGResourceFilter::buildPrimitives(SVGFilter*
builder->appendEffectToEffectReferences(effect, effectElement->renderer());
effectElement->setStandardAttributes(effect.get());
effect->setEffectBoundaries(SVGLengthContext::resolveRectangle<SVGFilterPrimitiveStandardAttributes>(effectElement, filterElement->primitiveUnits(), targetBoundingBox));
+ effect->setColorSpace(effectElement->renderer()->style()->svgStyle()->colorInterpolationFilters() == CI_LINEARRGB
+ ? ColorSpaceLinearRGB : ColorSpaceDeviceRGB);
builder->add(effectElement->result(), effect);
}
return builder.release();
@@ -284,10 +286,6 @@ void RenderSVGResourceFilter::postApplyResource(RenderObject* object, GraphicsCo
context = filterData->savedContext;
filterData->savedContext = 0;
-#if !USE(CG)
- if (filterData->sourceGraphicBuffer)
- filterData->sourceGraphicBuffer->transformColorSpace(ColorSpaceDeviceRGB, ColorSpaceLinearRGB);
-#endif
}
FilterEffect* lastEffect = filterData->builder->lastEffect();
@@ -306,7 +304,7 @@ void RenderSVGResourceFilter::postApplyResource(RenderObject* object, GraphicsCo
#if !USE(CG)
ImageBuffer* resultImage = lastEffect->asImageBuffer();
if (resultImage)
- resultImage->transformColorSpace(ColorSpaceLinearRGB, ColorSpaceDeviceRGB);
+ resultImage->transformColorSpace(lastEffect->colorSpace(), ColorSpaceDeviceRGB);
#endif
}
filterData->builded = true;
diff --git a/Source/WebCore/rendering/svg/RenderSVGRoot.h b/Source/WebCore/rendering/svg/RenderSVGRoot.h
index 3e2f3c70d..a0566b134 100644
--- a/Source/WebCore/rendering/svg/RenderSVGRoot.h
+++ b/Source/WebCore/rendering/svg/RenderSVGRoot.h
@@ -95,7 +95,7 @@ private:
virtual LayoutRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const;
virtual void computeFloatRectForRepaint(RenderBoxModelObject* repaintContainer, FloatRect& repaintRect, bool fixed) const;
- virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState&, MapLocalToContainerFlags mode = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
+ virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState&, MapLocalToContainerFlags mode = ApplyContainerFlip | SnapOffsetForTransforms, bool* wasFixed = 0) const OVERRIDE;
virtual const RenderObject* pushMappingToContainer(const RenderBoxModelObject* ancestorToStopAt, RenderGeometryMap&) const;
virtual bool canBeSelectionLeaf() const { return false; }
diff --git a/Source/WebCore/rendering/svg/RenderSVGText.cpp b/Source/WebCore/rendering/svg/RenderSVGText.cpp
index 398babe03..de2f0165c 100644
--- a/Source/WebCore/rendering/svg/RenderSVGText.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGText.cpp
@@ -111,9 +111,9 @@ void RenderSVGText::computeFloatRectForRepaint(RenderBoxModelObject* repaintCont
SVGRenderSupport::computeFloatRectForRepaint(this, repaintContainer, repaintRect, fixed);
}
-void RenderSVGText::mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState& transformState, MapLocalToContainerFlags, bool* wasFixed) const
+void RenderSVGText::mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState& transformState, MapLocalToContainerFlags mode, bool* wasFixed) const
{
- SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, wasFixed);
+ SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, mode & SnapOffsetForTransforms, wasFixed);
}
const RenderObject* RenderSVGText::pushMappingToContainer(const RenderBoxModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const
diff --git a/Source/WebCore/rendering/svg/RenderSVGText.h b/Source/WebCore/rendering/svg/RenderSVGText.h
index ee2dbda23..0a0c2856b 100644
--- a/Source/WebCore/rendering/svg/RenderSVGText.h
+++ b/Source/WebCore/rendering/svg/RenderSVGText.h
@@ -75,7 +75,7 @@ private:
virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, LayoutRect&, bool fixed = false) const;
virtual void computeFloatRectForRepaint(RenderBoxModelObject* repaintContainer, FloatRect&, bool fixed = false) const;
- virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState&, MapLocalToContainerFlags mode = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
+ virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState&, MapLocalToContainerFlags mode = ApplyContainerFlip | SnapOffsetForTransforms, bool* wasFixed = 0) const OVERRIDE;
virtual const RenderObject* pushMappingToContainer(const RenderBoxModelObject* ancestorToStopAt, RenderGeometryMap&) const;
virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
virtual void removeChild(RenderObject*) OVERRIDE;
diff --git a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp b/Source/WebCore/rendering/svg/SVGRenderSupport.cpp
index d88371429..fc572ad6f 100644
--- a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp
+++ b/Source/WebCore/rendering/svg/SVGRenderSupport.cpp
@@ -71,7 +71,7 @@ void SVGRenderSupport::computeFloatRectForRepaint(const RenderObject* object, Re
object->parent()->computeFloatRectForRepaint(repaintContainer, repaintRect, fixed);
}
-void SVGRenderSupport::mapLocalToContainer(const RenderObject* object, RenderBoxModelObject* repaintContainer, TransformState& transformState, bool* wasFixed)
+void SVGRenderSupport::mapLocalToContainer(const RenderObject* object, RenderBoxModelObject* repaintContainer, TransformState& transformState, bool snapOffsetForTransforms, bool* wasFixed)
{
transformState.applyTransform(object->localToParentTransform());
@@ -82,8 +82,11 @@ void SVGRenderSupport::mapLocalToContainer(const RenderObject* object, RenderBox
// RenderSVGRoot's mapLocalToContainer method expects CSS box coordinates.
if (parent->isSVGRoot())
transformState.applyTransform(toRenderSVGRoot(parent)->localToBorderBoxTransform());
-
- parent->mapLocalToContainer(repaintContainer, transformState, UseTransforms, wasFixed);
+
+ MapLocalToContainerFlags mode = UseTransforms;
+ if (snapOffsetForTransforms)
+ mode |= SnapOffsetForTransforms;
+ parent->mapLocalToContainer(repaintContainer, transformState, mode, wasFixed);
}
const RenderObject* SVGRenderSupport::pushMappingToContainer(const RenderObject* object, const RenderBoxModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap)
diff --git a/Source/WebCore/rendering/svg/SVGRenderSupport.h b/Source/WebCore/rendering/svg/SVGRenderSupport.h
index fa960f05e..b62ccfb2f 100644
--- a/Source/WebCore/rendering/svg/SVGRenderSupport.h
+++ b/Source/WebCore/rendering/svg/SVGRenderSupport.h
@@ -64,7 +64,7 @@ public:
// Important functions used by nearly all SVG renderers centralizing coordinate transformations / repaint rect calculations
static LayoutRect clippedOverflowRectForRepaint(const RenderObject*, RenderBoxModelObject* repaintContainer);
static void computeFloatRectForRepaint(const RenderObject*, RenderBoxModelObject* repaintContainer, FloatRect&, bool fixed);
- static void mapLocalToContainer(const RenderObject*, RenderBoxModelObject* repaintContainer, TransformState&, bool* wasFixed = 0);
+ static void mapLocalToContainer(const RenderObject*, RenderBoxModelObject* repaintContainer, TransformState&, bool snapOffsetForTransforms = true, bool* wasFixed = 0);
static const RenderObject* pushMappingToContainer(const RenderObject*, const RenderBoxModelObject* ancestorToStopAt, RenderGeometryMap&);
// Shared between SVG renderers and resources.
diff --git a/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp b/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp
index 685e51545..5ac85cbbe 100644
--- a/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp
+++ b/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp
@@ -48,23 +48,16 @@ bool SVGTextMetricsBuilder::advance()
if (int(m_textPosition) >= m_run.charactersLength())
return false;
-#if PLATFORM(QT) && !HAVE(QRAWFONT)
- advanceComplexText();
-#else
if (m_isComplexText)
advanceComplexText();
else
advanceSimpleText();
-#endif
return m_currentMetrics.length() > 0;
}
void SVGTextMetricsBuilder::advanceSimpleText()
{
-#if PLATFORM(QT) && !HAVE(QRAWFONT)
- ASSERT_NOT_REACHED();
-#else
unsigned metricsLength = m_simpleWidthIterator->advance(m_textPosition + 1);
if (!metricsLength) {
m_currentMetrics = SVGTextMetrics();
@@ -82,7 +75,6 @@ void SVGTextMetricsBuilder::advanceSimpleText()
#else
m_currentMetrics = SVGTextMetrics(m_text, m_textPosition, metricsLength, currentWidth, emptyString());
#endif
-#endif
}
void SVGTextMetricsBuilder::advanceComplexText()
@@ -115,12 +107,10 @@ void SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer(RenderSVGInlin
m_run = SVGTextMetrics::constructTextRun(text, text->characters(), 0, text->textLength());
m_isComplexText = scaledFont.codePath(m_run) == Font::Complex;
-#if !PLATFORM(QT) || HAVE(QRAWFONT)
if (m_isComplexText)
m_simpleWidthIterator.clear();
else
m_simpleWidthIterator = adoptPtr(new WidthIterator(&scaledFont, m_run));
-#endif
}
struct MeasureTextData {
diff --git a/Source/WebCore/storage/StorageEventDispatcher.cpp b/Source/WebCore/storage/StorageEventDispatcher.cpp
index 7cb368b29..d4502106e 100644
--- a/Source/WebCore/storage/StorageEventDispatcher.cpp
+++ b/Source/WebCore/storage/StorageEventDispatcher.cpp
@@ -57,7 +57,7 @@ void StorageEventDispatcher::dispatch(const String& key, const String& oldValue,
for (unsigned i = 0; i < frames.size(); ++i) {
ExceptionCode ec = 0;
- Storage* storage = frames[i]->domWindow()->sessionStorage(ec);
+ Storage* storage = frames[i]->document()->domWindow()->sessionStorage(ec);
if (!ec)
frames[i]->document()->enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage));
}
@@ -75,7 +75,7 @@ void StorageEventDispatcher::dispatch(const String& key, const String& oldValue,
for (unsigned i = 0; i < frames.size(); ++i) {
ExceptionCode ec = 0;
- Storage* storage = frames[i]->domWindow()->localStorage(ec);
+ Storage* storage = frames[i]->document()->domWindow()->localStorage(ec);
if (!ec)
frames[i]->document()->enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage));
}
diff --git a/Source/WebCore/svg/GradientAttributes.h b/Source/WebCore/svg/GradientAttributes.h
index b7cfe8a71..ccd0c8ea5 100644
--- a/Source/WebCore/svg/GradientAttributes.h
+++ b/Source/WebCore/svg/GradientAttributes.h
@@ -37,8 +37,8 @@ struct GradientAttributes {
{
}
- SVGSpreadMethodType spreadMethod() const { return m_spreadMethod; }
- SVGUnitTypes::SVGUnitType gradientUnits() const { return m_gradientUnits; }
+ SVGSpreadMethodType spreadMethod() const { return static_cast<SVGSpreadMethodType>(m_spreadMethod); }
+ SVGUnitTypes::SVGUnitType gradientUnits() const { return static_cast<SVGUnitTypes::SVGUnitType>(m_gradientUnits); }
AffineTransform gradientTransform() const { return m_gradientTransform; }
const Vector<Gradient::ColorStop>& stops() const { return m_stops; }
@@ -73,18 +73,27 @@ struct GradientAttributes {
private:
// Properties
- SVGSpreadMethodType m_spreadMethod;
- SVGUnitTypes::SVGUnitType m_gradientUnits;
AffineTransform m_gradientTransform;
Vector<Gradient::ColorStop> m_stops;
+ unsigned m_spreadMethod : 2;
+ unsigned m_gradientUnits : 2;
+
// Property states
- bool m_spreadMethodSet : 1;
- bool m_gradientUnitsSet : 1;
- bool m_gradientTransformSet : 1;
- bool m_stopsSet : 1;
+ unsigned m_spreadMethodSet : 1;
+ unsigned m_gradientUnitsSet : 1;
+ unsigned m_gradientTransformSet : 1;
+ unsigned m_stopsSet : 1;
+};
+
+struct SameSizeAsGradientAttributes {
+ AffineTransform a;
+ Vector<Gradient::ColorStop> b;
+ unsigned c : 8;
};
+COMPILE_ASSERT(sizeof(GradientAttributes) == sizeof(SameSizeAsGradientAttributes), GradientAttributes_size_guard);
+
} // namespace WebCore
#endif // ENABLE(SVG)
diff --git a/Source/WebCore/svg/SVGAnimationElement.cpp b/Source/WebCore/svg/SVGAnimationElement.cpp
index 34f0dc0fc..6ace61bee 100644
--- a/Source/WebCore/svg/SVGAnimationElement.cpp
+++ b/Source/WebCore/svg/SVGAnimationElement.cpp
@@ -574,8 +574,9 @@ void SVGAnimationElement::updateAnimation(float percent, unsigned repeatCount, S
return;
float effectivePercent;
- CalcMode mode = calcMode();
- if (animationMode() == ValuesAnimation) {
+ CalcMode calcMode = this->calcMode();
+ AnimationMode animationMode = this->animationMode();
+ if (animationMode == ValuesAnimation) {
String from;
String to;
currentValuesForValuesAnimation(percent, effectivePercent, from, to);
@@ -586,11 +587,11 @@ void SVGAnimationElement::updateAnimation(float percent, unsigned repeatCount, S
m_lastValuesAnimationFrom = from;
m_lastValuesAnimationTo = to;
}
- } else if (!m_keyPoints.isEmpty() && mode != CalcModePaced)
+ } else if (!m_keyPoints.isEmpty() && calcMode != CalcModePaced)
effectivePercent = calculatePercentFromKeyPoints(percent);
- else if (m_keyPoints.isEmpty() && mode == CalcModeSpline && m_keyTimes.size() > 1)
+ else if (m_keyPoints.isEmpty() && calcMode == CalcModeSpline && m_keyTimes.size() > 1)
effectivePercent = calculatePercentForSpline(percent, calculateKeyTimesIndex(percent));
- else if (animationMode() == FromToAnimation || animationMode() == ToAnimation)
+ else if (animationMode == FromToAnimation || animationMode == ToAnimation)
effectivePercent = calculatePercentForFromTo(percent);
else
effectivePercent = percent;
diff --git a/Source/WebCore/svg/SVGDocumentExtensions.cpp b/Source/WebCore/svg/SVGDocumentExtensions.cpp
index 152ce8bb7..cac1aea07 100644
--- a/Source/WebCore/svg/SVGDocumentExtensions.cpp
+++ b/Source/WebCore/svg/SVGDocumentExtensions.cpp
@@ -196,8 +196,8 @@ static int parserLineNumber(Document* document)
static void reportMessage(Document* document, MessageLevel level, const String& message)
{
- if (Frame* frame = document->frame())
- frame->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, level, message, document->documentURI(), parserLineNumber(document));
+ if (document->frame())
+ document->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, level, message, document->documentURI(), parserLineNumber(document));
}
void SVGDocumentExtensions::reportWarning(const String& message)
diff --git a/Source/WebCore/svg/SVGMaskElement.cpp b/Source/WebCore/svg/SVGMaskElement.cpp
index fd36b04fd..a714226a4 100644
--- a/Source/WebCore/svg/SVGMaskElement.cpp
+++ b/Source/WebCore/svg/SVGMaskElement.cpp
@@ -53,12 +53,12 @@ BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGMaskElement)
REGISTER_LOCAL_ANIMATED_PROPERTY(width)
REGISTER_LOCAL_ANIMATED_PROPERTY(height)
REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledLocatableElement)
+ REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledElement)
REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
END_REGISTER_ANIMATED_PROPERTIES
inline SVGMaskElement::SVGMaskElement(const QualifiedName& tagName, Document* document)
- : SVGStyledLocatableElement(tagName, document)
+ : SVGStyledElement(tagName, document)
, m_maskUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
, m_maskContentUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)
, m_x(LengthModeWidth, "-10%")
diff --git a/Source/WebCore/svg/SVGMaskElement.h b/Source/WebCore/svg/SVGMaskElement.h
index dced23fb7..326beefc6 100644
--- a/Source/WebCore/svg/SVGMaskElement.h
+++ b/Source/WebCore/svg/SVGMaskElement.h
@@ -26,13 +26,13 @@
#include "SVGAnimatedLength.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
-#include "SVGStyledLocatableElement.h"
+#include "SVGStyledElement.h"
#include "SVGTests.h"
#include "SVGUnitTypes.h"
namespace WebCore {
-class SVGMaskElement : public SVGStyledLocatableElement,
+class SVGMaskElement : public SVGStyledElement,
public SVGTests,
public SVGLangSpace,
public SVGExternalResourcesRequired {
diff --git a/Source/WebCore/svg/SVGPathElement.cpp b/Source/WebCore/svg/SVGPathElement.cpp
index 986f5fe5f..0eb63b6da 100644
--- a/Source/WebCore/svg/SVGPathElement.cpp
+++ b/Source/WebCore/svg/SVGPathElement.cpp
@@ -356,20 +356,6 @@ void SVGPathElement::pathSegListChanged(SVGPathSegRole role)
RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
}
-FloatRect SVGPathElement::getBBox(StyleUpdateStrategy styleUpdateStrategy)
-{
- if (styleUpdateStrategy == AllowStyleUpdate)
- this->document()->updateLayoutIgnorePendingStylesheets();
-
- RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer());
-
- // FIXME: Eventually we should support getBBox for detached elements.
- if (!renderer)
- return FloatRect();
-
- return renderer->path().boundingRect();
-}
-
RenderObject* SVGPathElement::createRenderer(RenderArena* arena, RenderStyle*)
{
// By default, any subclass is expected to do path-based drawing
diff --git a/Source/WebCore/svg/SVGPathElement.h b/Source/WebCore/svg/SVGPathElement.h
index 99821f77c..2735c8514 100644
--- a/Source/WebCore/svg/SVGPathElement.h
+++ b/Source/WebCore/svg/SVGPathElement.h
@@ -97,8 +97,6 @@ public:
static const SVGPropertyInfo* dPropertyInfo();
- virtual FloatRect getBBox(StyleUpdateStrategy = AllowStyleUpdate);
-
bool isAnimValObserved() const { return m_isAnimValObserved; }
private:
diff --git a/Source/WebCore/svg/animation/SVGSMILElement.cpp b/Source/WebCore/svg/animation/SVGSMILElement.cpp
index 0dc6a8a5d..43e84b1b3 100644
--- a/Source/WebCore/svg/animation/SVGSMILElement.cpp
+++ b/Source/WebCore/svg/animation/SVGSMILElement.cpp
@@ -410,6 +410,9 @@ bool SVGSMILElement::isSupportedAttribute(const QualifiedName& attrName)
supportedAttributes.add(SVGNames::minAttr);
supportedAttributes.add(SVGNames::maxAttr);
supportedAttributes.add(SVGNames::attributeNameAttr);
+ supportedAttributes.add(SVGNames::fromAttr);
+ supportedAttributes.add(SVGNames::toAttr);
+ supportedAttributes.add(SVGNames::byAttr);
supportedAttributes.add(XLinkNames::hrefAttr);
}
return supportedAttributes.contains<QualifiedName, SVGAttributeHashTranslator>(attrName);
diff --git a/Source/WebCore/testing/InternalSettings.cpp b/Source/WebCore/testing/InternalSettings.cpp
index 3592d05dd..063027870 100755
--- a/Source/WebCore/testing/InternalSettings.cpp
+++ b/Source/WebCore/testing/InternalSettings.cpp
@@ -96,6 +96,7 @@ InternalSettings::Backup::Backup(Page* page, Settings* settings)
#if ENABLE(DIALOG_ELEMENT)
, m_originalDialogElementEnabled(RuntimeEnabledFeatures::dialogElementEnabled())
#endif
+ , m_canStartMedia(page->canStartMedia())
{
}
@@ -127,6 +128,7 @@ void InternalSettings::Backup::restoreTo(Page* page, Settings* settings)
#if ENABLE(DIALOG_ELEMENT)
RuntimeEnabledFeatures::setDialogElementEnabled(m_originalDialogElementEnabled);
#endif
+ page->setCanStartMedia(m_canStartMedia);
}
InternalSettings* InternalSettings::from(Page* page)
@@ -433,6 +435,12 @@ bool InternalSettings::cssVariablesEnabled(ExceptionCode& ec)
return settings()->cssVariablesEnabled();
}
+void InternalSettings::setCanStartMedia(bool enabled, ExceptionCode& ec)
+{
+ InternalSettingsGuardForSettings();
+ m_page->setCanStartMedia(enabled);
+}
+
void InternalSettings::setMediaPlaybackRequiresUserGesture(bool enabled, ExceptionCode& ec)
{
InternalSettingsGuardForSettings();
diff --git a/Source/WebCore/testing/InternalSettings.h b/Source/WebCore/testing/InternalSettings.h
index 7b0f72aeb..cfae94fbb 100755
--- a/Source/WebCore/testing/InternalSettings.h
+++ b/Source/WebCore/testing/InternalSettings.h
@@ -78,6 +78,7 @@ public:
#if ENABLE(DIALOG_ELEMENT)
bool m_originalDialogElementEnabled;
#endif
+ bool m_canStartMedia;
};
typedef RefCountedSupplement<Page, InternalSettings> SuperType;
@@ -122,6 +123,7 @@ public:
void setCSSExclusionsEnabled(bool enabled, ExceptionCode&);
void setCSSVariablesEnabled(bool enabled, ExceptionCode&);
bool cssVariablesEnabled(ExceptionCode&);
+ void setCanStartMedia(bool, ExceptionCode&);
void setMediaPlaybackRequiresUserGesture(bool, ExceptionCode&);
void setEditingBehavior(const String&, ExceptionCode&);
void setFixedPositionCreatesStackingContext(bool, ExceptionCode&);
diff --git a/Source/WebCore/testing/InternalSettings.idl b/Source/WebCore/testing/InternalSettings.idl
index 6acda9885..b9c8f3ebf 100755
--- a/Source/WebCore/testing/InternalSettings.idl
+++ b/Source/WebCore/testing/InternalSettings.idl
@@ -60,6 +60,7 @@ module window {
void setCSSExclusionsEnabled(in boolean enabled) raises(DOMException);
void setCSSVariablesEnabled(in boolean enabled) raises(DOMException);
boolean cssVariablesEnabled() raises(DOMException);
+ void setCanStartMedia(in boolean enabled) raises(DOMException);
void setMediaPlaybackRequiresUserGesture(in boolean enabled) raises(DOMException);
void setEditingBehavior(in DOMString behavior) raises(DOMException);
void setFixedPositionCreatesStackingContext(in boolean creates) raises(DOMException);
diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp
index 6aaa7f172..c014adc74 100644
--- a/Source/WebCore/testing/Internals.cpp
+++ b/Source/WebCore/testing/Internals.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "Internals.h"
+#include "BackForwardController.h"
#include "CachedResourceLoader.h"
#include "ClientRect.h"
#include "ClientRectList.h"
@@ -37,7 +38,7 @@
#include "Element.h"
#include "ElementShadow.h"
#include "ExceptionCode.h"
-#include "FastMallocStatistics.h"
+#include "FormController.h"
#include "Frame.h"
#include "FrameView.h"
#include "HTMLContentElement.h"
@@ -54,6 +55,7 @@
#include "InternalSettings.h"
#include "IntRect.h"
#include "Language.h"
+#include "MallocStatistics.h"
#include "NodeRenderingContext.h"
#include "Page.h"
#include "PrintContext.h"
@@ -842,6 +844,42 @@ Node* Internals::touchNodeAdjustedToBestClickableNode(long x, long y, long width
return targetNode;
}
+PassRefPtr<WebKitPoint> Internals::touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document* document, ExceptionCode& ec)
+{
+ if (!document || !document->frame()) {
+ ec = INVALID_ACCESS_ERR;
+ return 0;
+ }
+
+ IntSize radius(width / 2, height / 2);
+ IntPoint point(x + radius.width(), y + radius.height());
+
+ Node* targetNode = 0;
+ IntPoint adjustedPoint;
+
+ bool foundNode = document->frame()->eventHandler()->bestContextMenuNodeForTouchPoint(point, radius, adjustedPoint, targetNode);
+ if (foundNode)
+ return WebKitPoint::create(adjustedPoint.x(), adjustedPoint.y());
+
+ return WebKitPoint::create(x, y);
+}
+
+Node* Internals::touchNodeAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document* document, ExceptionCode& ec)
+{
+ if (!document || !document->frame()) {
+ ec = INVALID_ACCESS_ERR;
+ return 0;
+ }
+
+ IntSize radius(width / 2, height / 2);
+ IntPoint point(x + radius.width(), y + radius.height());
+
+ Node* targetNode = 0;
+ IntPoint adjustedPoint;
+ document->frame()->eventHandler()->bestContextMenuNodeForTouchPoint(point, radius, adjustedPoint, targetNode);
+ return targetNode;
+}
+
PassRefPtr<ClientRect> Internals::bestZoomableAreaForTouchPoint(long x, long y, long width, long height, Document* document, ExceptionCode& ec)
{
if (!document || !document->frame()) {
@@ -927,17 +965,6 @@ unsigned Internals::touchEventHandlerCount(Document* document, ExceptionCode& ec
return document->touchEventHandlerCount();
}
-bool Internals::hasTouchEventListener(Document* document, ExceptionCode& ec)
-{
- if (!document) {
- ec = INVALID_ACCESS_ERR;
- return 0;
- }
-
- return document->hasListenerType(Document::TOUCH_LISTENER);
-}
-
-
PassRefPtr<NodeList> Internals::nodesFromRect(Document* document, int x, int y, unsigned topPadding, unsigned rightPadding,
unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, ExceptionCode& ec) const
{
@@ -1183,9 +1210,19 @@ void Internals::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const
SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(scheme);
}
-PassRefPtr<FastMallocStatistics> Internals::fastMallocStatistics() const
+PassRefPtr<MallocStatistics> Internals::mallocStatistics() const
{
- return FastMallocStatistics::create();
+ return MallocStatistics::create();
+}
+
+PassRefPtr<DOMStringList> Internals::getReferencedFilePaths() const
+{
+ RefPtr<DOMStringList> stringList = DOMStringList::create();
+ frame()->loader()->history()->saveDocumentAndScrollState();
+ const Vector<String>& filePaths = FormController::getReferencedFilePaths(frame()->loader()->history()->currentItem()->documentState());
+ for (size_t i = 0; i < filePaths.size(); ++i)
+ stringList->append(filePaths[i]);
+ return stringList.release();
}
}
diff --git a/Source/WebCore/testing/Internals.h b/Source/WebCore/testing/Internals.h
index 157662c3d..b73b7a803 100644
--- a/Source/WebCore/testing/Internals.h
+++ b/Source/WebCore/testing/Internals.h
@@ -49,7 +49,7 @@ class Range;
class ScriptExecutionContext;
class ShadowRoot;
class WebKitPoint;
-class FastMallocStatistics;
+class MallocStatistics;
typedef int ExceptionCode;
@@ -142,6 +142,8 @@ public:
#if ENABLE(TOUCH_ADJUSTMENT)
PassRefPtr<WebKitPoint> touchPositionAdjustedToBestClickableNode(long x, long y, long width, long height, Document*, ExceptionCode&);
Node* touchNodeAdjustedToBestClickableNode(long x, long y, long width, long height, Document*, ExceptionCode&);
+ PassRefPtr<WebKitPoint> touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document*, ExceptionCode&);
+ Node* touchNodeAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document*, ExceptionCode&);
PassRefPtr<ClientRect> bestZoomableAreaForTouchPoint(long x, long y, long width, long height, Document*, ExceptionCode&);
#endif
@@ -156,7 +158,6 @@ public:
unsigned wheelEventHandlerCount(Document*, ExceptionCode&);
unsigned touchEventHandlerCount(Document*, ExceptionCode&);
- bool hasTouchEventListener(Document*, ExceptionCode&);
PassRefPtr<NodeList> nodesFromRect(Document*, int x, int y, unsigned topPadding, unsigned rightPadding,
unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, ExceptionCode&) const;
@@ -208,7 +209,9 @@ public:
void registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme);
void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const String& scheme);
- PassRefPtr<FastMallocStatistics> fastMallocStatistics() const;
+ PassRefPtr<MallocStatistics> mallocStatistics() const;
+
+ PassRefPtr<DOMStringList> getReferencedFilePaths() const;
private:
explicit Internals(Document*);
diff --git a/Source/WebCore/testing/Internals.idl b/Source/WebCore/testing/Internals.idl
index 601e8a74f..afdc4a24b 100644
--- a/Source/WebCore/testing/Internals.idl
+++ b/Source/WebCore/testing/Internals.idl
@@ -117,6 +117,8 @@ module window {
#if defined(ENABLE_TOUCH_ADJUSTMENT) && ENABLE_TOUCH_ADJUSTMENT
WebKitPoint touchPositionAdjustedToBestClickableNode(in long x, in long y, in long width, in long height, in Document document) raises (DOMException);
Node touchNodeAdjustedToBestClickableNode(in long x, in long y, in long width, in long height, in Document document) raises (DOMException);
+ WebKitPoint touchPositionAdjustedToBestContextMenuNode(in long x, in long y, in long width, in long height, in Document document) raises (DOMException);
+ Node touchNodeAdjustedToBestContextMenuNode(in long x, in long y, in long width, in long height, in Document document) raises (DOMException);
ClientRect bestZoomableAreaForTouchPoint(in long x, in long y, in long width, in long height, in Document document) raises (DOMException);
#endif
@@ -133,7 +135,6 @@ module window {
unsigned long wheelEventHandlerCount(in Document document) raises (DOMException);
unsigned long touchEventHandlerCount(in Document document) raises (DOMException);
- boolean hasTouchEventListener(in Document document) raises (DOMException);
NodeList nodesFromRect(in Document document, in long x, in long y,
in unsigned long topPadding, in unsigned long rightPadding, in unsigned long bottomPadding, in unsigned long leftPadding,
@@ -185,7 +186,9 @@ module window {
void registerURLSchemeAsBypassingContentSecurityPolicy(in DOMString scheme);
void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(in DOMString scheme);
- FastMallocStatistics fastMallocStatistics();
+ MallocStatistics mallocStatistics();
+
+ DOMString[] getReferencedFilePaths();
};
}
diff --git a/Source/WebCore/testing/FastMallocStatistics.h b/Source/WebCore/testing/MallocStatistics.h
index 555630299..3f07bbd9f 100644
--- a/Source/WebCore/testing/FastMallocStatistics.h
+++ b/Source/WebCore/testing/MallocStatistics.h
@@ -23,8 +23,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef FastMallocStatistics_h
-#define FastMallocStatistics_h
+#ifndef MallocStatistics_h
+#define MallocStatistics_h
#include <wtf/FastMalloc.h>
#include <wtf/PassRefPtr.h>
@@ -32,16 +32,16 @@
namespace WebCore {
-class FastMallocStatistics : public RefCounted<FastMallocStatistics> {
+class MallocStatistics : public RefCounted<MallocStatistics> {
public:
- static PassRefPtr<FastMallocStatistics> create() { return adoptRef(new FastMallocStatistics()); }
+ static PassRefPtr<MallocStatistics> create() { return adoptRef(new MallocStatistics()); }
size_t reservedVMBytes() const { return m_stats.reservedVMBytes; }
size_t committedVMBytes() const { return m_stats.committedVMBytes; }
size_t freeListBytes() const { return m_stats.freeListBytes; }
private:
- FastMallocStatistics()
+ MallocStatistics()
{
m_stats = WTF::fastMallocStatistics();
}
diff --git a/Source/WebCore/testing/FastMallocStatistics.idl b/Source/WebCore/testing/MallocStatistics.idl
index 8b60ac3d5..bbaff9dbd 100644
--- a/Source/WebCore/testing/FastMallocStatistics.idl
+++ b/Source/WebCore/testing/MallocStatistics.idl
@@ -26,7 +26,7 @@
module window {
interface [
OmitConstructor
- ] FastMallocStatistics {
+ ] MallocStatistics {
readonly attribute unsigned long reservedVMBytes;
readonly attribute unsigned long committedVMBytes;
readonly attribute unsigned long freeListBytes;
diff --git a/Source/WebCore/xml/XMLHttpRequest.cpp b/Source/WebCore/xml/XMLHttpRequest.cpp
index 768a019cd..111a649a1 100644
--- a/Source/WebCore/xml/XMLHttpRequest.cpp
+++ b/Source/WebCore/xml/XMLHttpRequest.cpp
@@ -481,7 +481,7 @@ void XMLHttpRequest::open(const String& method, const KURL& url, bool async, Exc
}
if (!async && scriptExecutionContext()->isDocument()) {
- if (!document()->settings()->syncXHRInDocumentsEnabled()) {
+ if (document()->settings() && !document()->settings()->syncXHRInDocumentsEnabled()) {
logConsoleError(scriptExecutionContext(), "Synchronous XMLHttpRequests are disabled for this page.");
ec = INVALID_ACCESS_ERR;
return;
diff --git a/Source/WebCore/xml/XPathPath.cpp b/Source/WebCore/xml/XPathPath.cpp
index ba1ded39e..db88c98d0 100644
--- a/Source/WebCore/xml/XPathPath.cpp
+++ b/Source/WebCore/xml/XPathPath.cpp
@@ -93,11 +93,16 @@ Value LocationPath::evaluate() const
{
EvaluationContext& evaluationContext = Expression::evaluationContext();
EvaluationContext backupContext = evaluationContext;
- // For absolute location paths, the context node is ignored - the
- // document's root node is used instead.
+ // For absolute location paths, the context node is ignored. The
+ // document's root node is used for attached nodes, otherwise the root
+ // node of the detached subtree is used.
Node* context = evaluationContext.node.get();
- if (m_absolute && context->nodeType() != Node::DOCUMENT_NODE)
- context = context->ownerDocument();
+ if (m_absolute && context->nodeType() != Node::DOCUMENT_NODE) {
+ if (context->inDocument())
+ context = context->ownerDocument();
+ else
+ context = context->highestAncestor();
+ }
NodeSet nodes;
nodes.append(context);
diff --git a/Source/WebCore/xml/XSLImportRule.cpp b/Source/WebCore/xml/XSLImportRule.cpp
index ea671c95f..0a1770d03 100644
--- a/Source/WebCore/xml/XSLImportRule.cpp
+++ b/Source/WebCore/xml/XSLImportRule.cpp
@@ -87,14 +87,14 @@ void XSLImportRule::loadSheet()
String absHref = m_strHref;
XSLStyleSheet* parentSheet = parentStyleSheet();
- if (!parentSheet->finalURL().isNull())
+ if (!parentSheet->baseURL().isNull())
// use parent styleheet's URL as the base URL
- absHref = KURL(parentSheet->finalURL(), m_strHref).string();
+ absHref = KURL(parentSheet->baseURL(), m_strHref).string();
// Check for a cycle in our import chain. If we encounter a stylesheet
// in our parent chain with the same URL, then just bail.
for (XSLStyleSheet* parentSheet = parentStyleSheet(); parentSheet; parentSheet = parentSheet->parentStyleSheet()) {
- if (absHref == parentSheet->finalURL().string())
+ if (absHref == parentSheet->baseURL().string())
return;
}
diff --git a/Source/WebCore/xml/XSLStyleSheetLibxslt.cpp b/Source/WebCore/xml/XSLStyleSheetLibxslt.cpp
index a18b7b167..0b8340cd9 100644
--- a/Source/WebCore/xml/XSLStyleSheetLibxslt.cpp
+++ b/Source/WebCore/xml/XSLStyleSheetLibxslt.cpp
@@ -145,8 +145,8 @@ bool XSLStyleSheet::parseString(const String& string)
m_stylesheetDocTaken = false;
Console* console = 0;
- if (Frame* frame = ownerDocument()->frame())
- console = frame->domWindow()->console();
+ if (ownerDocument()->frame())
+ console = ownerDocument()->domWindow()->console();
XMLDocumentParserScope scope(cachedResourceLoader(), XSLTProcessor::genericErrorFunc, XSLTProcessor::parseErrorFunc, console);
diff --git a/Source/WebCore/xml/XSLTProcessor.cpp b/Source/WebCore/xml/XSLTProcessor.cpp
index c5c84e7f6..0e232351b 100644
--- a/Source/WebCore/xml/XSLTProcessor.cpp
+++ b/Source/WebCore/xml/XSLTProcessor.cpp
@@ -89,6 +89,7 @@ PassRefPtr<Document> XSLTProcessor::createDocumentFromSource(const String& sourc
if (Document* oldDocument = frame->document()) {
result->setTransformSourceDocument(oldDocument);
+ result->takeDOMWindowFrom(oldDocument);
result->setSecurityOrigin(oldDocument->securityOrigin());
result->setCookieURL(oldDocument->cookieURL());
result->setFirstPartyForCookies(oldDocument->firstPartyForCookies());
diff --git a/Source/WebCore/xml/XSLTProcessorLibxslt.cpp b/Source/WebCore/xml/XSLTProcessorLibxslt.cpp
index 076a852d0..e21c827c2 100644
--- a/Source/WebCore/xml/XSLTProcessorLibxslt.cpp
+++ b/Source/WebCore/xml/XSLTProcessorLibxslt.cpp
@@ -138,8 +138,8 @@ static xmlDocPtr docLoaderFunc(const xmlChar* uri,
}
Console* console = 0;
- if (Frame* frame = globalProcessor->xslStylesheet()->ownerDocument()->frame())
- console = frame->domWindow()->console();
+ if (globalProcessor->xslStylesheet()->ownerDocument()->frame())
+ console = globalProcessor->xslStylesheet()->ownerDocument()->domWindow()->console();
xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc);
xmlSetGenericErrorFunc(console, XSLTProcessor::genericErrorFunc);
diff --git a/Source/WebCore/xml/XSLTProcessorQt.cpp b/Source/WebCore/xml/XSLTProcessorQt.cpp
index c0ab4d693..a67c5fde7 100644
--- a/Source/WebCore/xml/XSLTProcessorQt.cpp
+++ b/Source/WebCore/xml/XSLTProcessorQt.cpp
@@ -83,9 +83,8 @@ void XSLTMessageHandler::handleMessage(QtMsgType type, const QString& descriptio
break;
}
- Console* console = m_document->frame()->domWindow()->console();
- console->addMessage(XMLMessageSource, LogMessageType, level, description,
- sourceLocation.uri().toString(), sourceLocation.line());
+ Console* console = m_document->domWindow()->console();
+ console->addMessage(XMLMessageSource, LogMessageType, level, description, sourceLocation.uri().toString(), sourceLocation.line());
}
class XSLTUriResolver : public QAbstractUriResolver {
diff --git a/Source/WebCore/xml/parser/MarkupTokenBase.h b/Source/WebCore/xml/parser/MarkupTokenBase.h
index 6bb0cb8b4..14914eeb1 100644
--- a/Source/WebCore/xml/parser/MarkupTokenBase.h
+++ b/Source/WebCore/xml/parser/MarkupTokenBase.h
@@ -97,6 +97,8 @@ public:
m_range.m_end = 0;
m_baseOffset = 0;
m_data.clear();
+ m_orAllData = 0;
+ m_convertTo8BitIfPossible = false;
}
bool isUninitialized() { return m_type == TypeSet::Uninitialized; }
@@ -172,6 +174,13 @@ public:
m_data.append(character);
}
+ void appendToCharacter(UChar character)
+ {
+ ASSERT(m_type == TypeSet::Character);
+ m_data.append(character);
+ m_orAllData |= character;
+ }
+
template<typename T>
void appendToCharacter(T characters)
{
@@ -274,6 +283,7 @@ public:
{
ASSERT(m_type == TypeSet::Character);
m_data.clear();
+ m_orAllData = 0;
}
void eraseValueOfAttribute(size_t i)
@@ -294,6 +304,16 @@ public:
return m_data;
}
+ void setConvertTo8BitIfPossible()
+ {
+ m_convertTo8BitIfPossible = true;
+ }
+
+ bool isAll8BitData() const
+ {
+ return m_convertTo8BitIfPossible && (m_orAllData <= 0xff);
+ }
+
// FIXME: Distinguish between a missing public identifer and an empty one.
const WTF::Vector<UChar>& publicIdentifier() const
{
@@ -370,6 +390,8 @@ protected:
typename Attribute::Range m_range; // Always starts at zero.
int m_baseOffset;
DataVector m_data;
+ UChar m_orAllData;
+ bool m_convertTo8BitIfPossible;
// For DOCTYPE
OwnPtr<DoctypeData> m_doctypeData;
@@ -413,6 +435,7 @@ public:
break;
case Token::Type::Character:
m_externalCharacters = &token->characters();
+ m_isAll8BitData = token->isAll8BitData();
break;
default:
break;
@@ -423,6 +446,7 @@ public:
: m_type(type)
, m_name(name)
, m_externalCharacters(0)
+ , m_isAll8BitData(false)
, m_attributes(attributes)
{
ASSERT(usesName());
@@ -472,6 +496,11 @@ public:
return *m_externalCharacters;
}
+ bool isAll8BitData() const
+ {
+ return m_isAll8BitData;
+ }
+
const String& comment() const
{
ASSERT(m_type == Token::Type::Comment);
@@ -495,6 +524,7 @@ public:
void clearExternalCharacters()
{
m_externalCharacters = 0;
+ m_isAll8BitData = false;
}
protected:
@@ -522,6 +552,7 @@ protected:
// FIXME: Add a mechanism for "internalizing" the characters when the
// HTMLToken is destructed.
const typename Token::DataVector* m_externalCharacters;
+ bool m_isAll8BitData;
// For DOCTYPE
OwnPtr<typename Token::DoctypeData> m_doctypeData;
diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog
index 3c5e06ce2..4bf98debd 100644
--- a/Source/WebKit/ChangeLog
+++ b/Source/WebKit/ChangeLog
@@ -1,3 +1,71 @@
+2012-08-20 Dominik Röttsches <dominik.rottsches@intel.com>
+
+ [EFL] Get rid of pango backend support once harfbuzz-ng is working
+ https://bugs.webkit.org/show_bug.cgi?id=92102
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Removing pango-specific includes and libraries.
+
+ * PlatformEfl.cmake: Pango sections removed.
+
+2012-08-17 Rob Buis <rbuis@rim.com>
+
+ [BlackBerry] Remove some shared libraries from linking
+ https://bugs.webkit.org/show_bug.cgi?id=94253
+
+ Reviewed by Yong Li.
+
+ Remove some shared libraries.
+
+ * PlatformBlackBerry.cmake:
+
+2012-08-15 Ryosuke Niwa <rniwa@webkit.org>
+
+ Update manual tests and comments to refer to TestRunner instead of LayoutTestController
+ https://bugs.webkit.org/show_bug.cgi?id=94168
+
+ Reviewed by Kent Tamura.
+
+ * PlatformBlackBerry.cmake:
+
+2012-08-14 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL] undefined reference to 'g_type_init' with gold linker
+ https://bugs.webkit.org/show_bug.cgi?id=93935
+
+ Unreviewed build fix. Link against glib-gobject to
+ fix linking error with gold linker.
+
+ * PlatformEfl.cmake:
+
+2012-08-11 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] Rewrite FindLibSoup2.cmake.
+ https://bugs.webkit.org/show_bug.cgi?id=93191
+
+ Reviewed by Rob Buis.
+
+ * PlatformEfl.cmake: Use LIBSOUP_FOO instead of LIBSOUP24_FOO.
+
+2012-08-13 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] Remove glib-related Find modules and write single new one instead.
+ https://bugs.webkit.org/show_bug.cgi?id=93786
+
+ Reviewed by Rob Buis.
+
+ * PlatformEfl.cmake: Use GLIB_* instead of Glib_*.
+
+2012-08-12 Loïc Yhuel <loic.yhuel@softathome.com>
+
+ [Qt] Make it possible to build without QtTest/QtPrintSupport
+ https://bugs.webkit.org/show_bug.cgi?id=93492
+
+ Reviewed by Tor Arne Vestbø.
+
+ * WebKit1.pri: Optional printsupport
+
2012-08-10 Joshua Netterfield <jnetterfield@rim.com>
[WebGL] Add support for EXT_robustness
diff --git a/Source/WebKit/PlatformBlackBerry.cmake b/Source/WebKit/PlatformBlackBerry.cmake
index d133d0fa9..5d5a255be 100644
--- a/Source/WebKit/PlatformBlackBerry.cmake
+++ b/Source/WebKit/PlatformBlackBerry.cmake
@@ -132,14 +132,14 @@ IF (NOT PUBLIC_BUILD)
${TOOLS_DIR}/DumpRenderTree/blackberry/DumpRenderTree.cpp
${TOOLS_DIR}/DumpRenderTree/blackberry/EventSender.cpp
${TOOLS_DIR}/DumpRenderTree/blackberry/GCControllerBlackBerry.cpp
- ${TOOLS_DIR}/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp
+ ${TOOLS_DIR}/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp
${TOOLS_DIR}/DumpRenderTree/blackberry/PixelDumpSupportBlackBerry.cpp
${TOOLS_DIR}/DumpRenderTree/blackberry/PNGImageEncoder.cpp
${TOOLS_DIR}/DumpRenderTree/blackberry/WorkQueueItemBlackBerry.cpp
${TOOLS_DIR}/DumpRenderTree/AccessibilityController.cpp
${TOOLS_DIR}/DumpRenderTree/AccessibilityUIElement.cpp
${TOOLS_DIR}/DumpRenderTree/AccessibilityTextMarker.cpp
- ${TOOLS_DIR}/DumpRenderTree/LayoutTestController.cpp
+ ${TOOLS_DIR}/DumpRenderTree/TestRunner.cpp
${TOOLS_DIR}/DumpRenderTree/CyclicRedundancyCheck.cpp
${TOOLS_DIR}/DumpRenderTree/PixelDumpSupport.cpp
${TOOLS_DIR}/DumpRenderTree/WorkQueue.cpp
@@ -150,10 +150,7 @@ ENDIF ()
SET(WebKit_LINK_FLAGS ${BLACKBERRY_LINK_FLAGS})
LIST(APPEND WebKit_LIBRARIES
- ${AOI_LIBRARY}
- ${CLIPBOARD_LIBRARY}
${CURL_LIBRARY}
- ${Crypto_LIBRARY}
${FONTCONFIG_LIBRARY}
${FREETYPE_LIBRARY}
${HARFBUZZ_LIBRARY}
@@ -161,23 +158,15 @@ LIST(APPEND WebKit_LIBRARIES
${ICUI18N_LIBRARY}
${ICUUC_LIBRARY}
${INTL_LIBRARY}
- ${Iconv_LIBRARY}
${JPEG_LIBRARY}
${JavaScriptCore_LIBRARY_NAME}
- ${MD_LIBRARY}
${MMR_LIBRARY}
${M_LIBRARY}
- ${NBUTIL_LIBRARY}
${OTS_LIBRARY}
${PNG_LIBRARY}
- ${PPSCache_LIBRARY}
${SQLITE3_LIBRARY}
- ${SSL_LIBRARY}
- ${STRM_LIBRARY}
- ${Screen_LIBRARY}
${Skia_LIBRARY}
${Skia_QNX_LIBRARY}
- ${Socket_LIBRARY}
${UUID_LIBRARY}
${WebKitPlatform_LIBRARY}
${XML2_LIBRARY}
diff --git a/Source/WebKit/PlatformEfl.cmake b/Source/WebKit/PlatformEfl.cmake
index 1706cda3a..cea3e5eaf 100644
--- a/Source/WebKit/PlatformEfl.cmake
+++ b/Source/WebKit/PlatformEfl.cmake
@@ -26,8 +26,8 @@ LIST(APPEND WebKit_INCLUDE_DIRECTORIES
${LIBXML2_INCLUDE_DIR}
${LIBXSLT_INCLUDE_DIR}
${SQLITE_INCLUDE_DIR}
- ${Glib_INCLUDE_DIRS}
- ${LIBSOUP24_INCLUDE_DIRS}
+ ${GLIB_INCLUDE_DIRS}
+ ${LIBSOUP_INCLUDE_DIRS}
)
IF (ENABLE_SVG)
@@ -60,16 +60,6 @@ IF (WTF_USE_FREETYPE)
)
ENDIF ()
-IF (WTF_USE_PANGO)
- LIST(APPEND WebKit_INCLUDE_DIRECTORIES
- "${WEBCORE_DIR}/platform/graphics/pango"
- ${Pango_INCLUDE_DIRS}
- )
- LIST(APPEND WebKit_LIBRARIES
- ${Pango_LIBRARIES}
- )
-ENDIF ()
-
IF (ENABLE_NOTIFICATIONS)
LIST(APPEND WebKit_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/Modules/notifications"
@@ -159,8 +149,9 @@ LIST(APPEND WebKit_LIBRARIES
${PNG_LIBRARY}
${JPEG_LIBRARY}
${CMAKE_DL_LIBS}
- ${Glib_LIBRARIES}
- ${LIBSOUP24_LIBRARIES}
+ ${GLIB_LIBRARIES}
+ ${GLIB_GOBJECT_LIBRARIES}
+ ${LIBSOUP_LIBRARIES}
)
SET(WebKit_THEME_DEFINITION "")
@@ -324,8 +315,8 @@ SET(EWKUnitTests_LINK_FLAGS
IF (ENABLE_GLIB_SUPPORT)
LIST(APPEND EWKUnitTests_INCLUDE_DIRECTORIES "${WTF_DIR}/wtf/gobject")
LIST(APPEND EWKUnitTests_LIBRARIES
- ${Glib_LIBRARIES}
- ${Gthread_LIBRARIES}
+ ${GLIB_LIBRARIES}
+ ${GLIB_GTHREAD_LIBRARIES}
)
ENDIF ()
diff --git a/Source/WebKit/WebKit1.pri b/Source/WebKit/WebKit1.pri
index 992fb56a2..cadb77e14 100644
--- a/Source/WebKit/WebKit1.pri
+++ b/Source/WebKit/WebKit1.pri
@@ -39,8 +39,9 @@ contains(CONFIG, texmap): DEFINES += WTF_USE_TEXTURE_MAPPER=1
plugin_backend_xlib: PKGCONFIG += x11
-QT += network widgets printsupport
+QT += network widgets
contains(DEFINES, HAVE_QTQUICK=1): QT += quick
+contains(DEFINES, HAVE_QTPRINTSUPPORT=1): QT += printsupport
contains(DEFINES, WTF_USE_TEXTURE_MAPPER_GL=1)|contains(DEFINES, ENABLE_WEBGL=1) {
QT *= opengl
diff --git a/Source/WebKit/blackberry/Api/InRegionScroller.cpp b/Source/WebKit/blackberry/Api/InRegionScroller.cpp
index 09012c1fd..205ef898b 100644
--- a/Source/WebKit/blackberry/Api/InRegionScroller.cpp
+++ b/Source/WebKit/blackberry/Api/InRegionScroller.cpp
@@ -26,9 +26,11 @@
#include "InRegionScrollableArea.h"
#include "InRegionScroller_p.h"
#include "LayerCompositingThread.h"
+#include "LayerWebKitThread.h"
#include "Page.h"
#include "RenderBox.h"
#include "RenderLayer.h"
+#include "RenderLayerBacking.h"
#include "RenderObject.h"
#include "RenderView.h"
#include "WebPage_p.h"
@@ -43,7 +45,6 @@ static bool canScrollRenderBox(RenderBox*);
static RenderLayer* parentLayer(RenderLayer*);
static Node* enclosingLayerNode(RenderLayer*);
static bool isNonRenderViewFixedPositionedContainer(RenderLayer*);
-static void pushBackInRegionScrollable(std::vector<Platform::ScrollViewBase*>&, InRegionScrollableArea*, InRegionScrollerPrivate*);
InRegionScroller::InRegionScroller(WebPagePrivate* webPagePrivate)
: d(new InRegionScrollerPrivate(webPagePrivate))
@@ -56,10 +57,20 @@ InRegionScroller::~InRegionScroller()
delete d;
}
-bool InRegionScroller::compositedSetScrollPosition(unsigned camouflagedLayer, const Platform::IntPoint& scrollPosition)
+bool InRegionScroller::setScrollPositionCompositingThread(unsigned camouflagedLayer, const Platform::IntPoint& scrollPosition)
{
ASSERT(Platform::userInterfaceThreadMessageClient()->isCurrentThread());
- return d->compositedSetScrollPosition(camouflagedLayer, d->m_webPage->mapFromTransformed(scrollPosition));
+
+ // FIXME: Negative values won't work with map{To,From}Transform methods.
+ return d->setScrollPositionCompositingThread(camouflagedLayer, d->m_webPage->mapFromTransformed(scrollPosition));
+}
+
+bool InRegionScroller::setScrollPositionWebKitThread(unsigned camouflagedLayer, const Platform::IntPoint& scrollPosition)
+{
+ ASSERT(Platform::webKitThreadMessageClient()->isCurrentThread());
+
+ // FIXME: Negative values won't work with map{To,From}Transform methods.
+ return d->setScrollPositionWebKitThread(camouflagedLayer, d->m_webPage->mapFromTransformed(scrollPosition));
}
InRegionScrollerPrivate::InRegionScrollerPrivate(WebPagePrivate* webPagePrivate)
@@ -80,6 +91,10 @@ WebCore::Node* InRegionScrollerPrivate::node() const
void InRegionScrollerPrivate::reset()
{
setNode(0);
+
+ for (size_t i = 0; i < m_activeInRegionScrollableAreas.size(); ++i)
+ delete m_activeInRegionScrollableAreas[i];
+ m_activeInRegionScrollableAreas.clear();
}
bool InRegionScrollerPrivate::hasNode() const
@@ -92,15 +107,36 @@ bool InRegionScrollerPrivate::canScroll() const
return hasNode();
}
-bool InRegionScrollerPrivate::compositedSetScrollPosition(unsigned camouflagedLayer, const WebCore::IntPoint& scrollPosition)
+bool InRegionScrollerPrivate::setScrollPositionCompositingThread(unsigned camouflagedLayer, const WebCore::IntPoint& scrollPosition)
{
- LayerCompositingThread* scrollLayer = reinterpret_cast<LayerCompositingThread*>(camouflagedLayer);
- scrollLayer->override()->setBoundsOrigin(WebCore::FloatPoint(scrollPosition.x(), scrollPosition.y()));
+ LayerCompositingThread* scrollLayer = reinterpret_cast<LayerWebKitThread*>(camouflagedLayer)->layerCompositingThread();
+
+ // FIXME: Clamp maximum and minimum scroll positions as a last attempt to fix round errors.
+ scrollLayer->override()->setBoundsOrigin(scrollPosition);
- m_webPage->scheduleCompositingRun();
+ // The client is going to blitVisibleContens, which allow us benefit from "defer blits" technique.
return true;
}
+bool InRegionScrollerPrivate::setScrollPositionWebKitThread(unsigned camouflagedLayer, const WebCore::IntPoint& scrollPosition)
+{
+ RenderLayer* layer = 0;
+
+ LayerWebKitThread* layerWebKitThread = reinterpret_cast<LayerWebKitThread*>(camouflagedLayer);
+ ASSERT(layerWebKitThread);
+ if (layerWebKitThread->owner()) {
+ GraphicsLayer* graphicsLayer = layerWebKitThread->owner();
+ RenderLayerBacking* backing = static_cast<RenderLayerBacking*>(graphicsLayer->client());
+ layer = backing->owningLayer();
+ }
+
+ if (!layer)
+ return false;
+
+ // FIXME: Clamp maximum and minimum scroll positions as a last attempt to fix round errors.
+ return setLayerScrollPosition(layer, scrollPosition);
+}
+
bool InRegionScrollerPrivate::scrollBy(const Platform::IntSize& delta)
{
ASSERT(Platform::webkitThreadMessageClient()->isCurrentThread());
@@ -111,15 +147,14 @@ bool InRegionScrollerPrivate::scrollBy(const Platform::IntSize& delta)
return scrollNodeRecursively(node(), delta);
}
-std::vector<Platform::ScrollViewBase*> InRegionScrollerPrivate::inRegionScrollableAreasForPoint(const WebCore::IntPoint& point)
+void InRegionScrollerPrivate::calculateInRegionScrollableAreasForPoint(const WebCore::IntPoint& point)
{
- std::vector<Platform::ScrollViewBase*> validReturn;
- std::vector<Platform::ScrollViewBase*> emptyReturn;
+ ASSERT(m_activeInRegionScrollableAreas.empty());
HitTestResult result = m_webPage->m_mainFrame->eventHandler()->hitTestResultAtPoint(m_webPage->mapFromViewportToContents(point), false /*allowShadowContent*/);
Node* node = result.innerNonSharedNode();
if (!node || !node->renderer())
- return emptyReturn;
+ return;
RenderLayer* layer = node->renderer()->enclosingLayer();
do {
@@ -128,37 +163,39 @@ std::vector<Platform::ScrollViewBase*> InRegionScrollerPrivate::inRegionScrollab
if (renderer->isRenderView()) {
if (RenderView* renderView = toRenderView(renderer)) {
FrameView* view = renderView->frameView();
- if (!view)
- return emptyReturn;
+ if (!view) {
+ reset();
+ return;
+ }
if (canScrollInnerFrame(view->frame())) {
- pushBackInRegionScrollable(validReturn, new InRegionScrollableArea(m_webPage, layer), this);
+ pushBackInRegionScrollable(new InRegionScrollableArea(m_webPage, layer));
continue;
}
}
} else if (canScrollRenderBox(layer->renderBox())) {
- pushBackInRegionScrollable(validReturn, new InRegionScrollableArea(m_webPage, layer), this);
+ pushBackInRegionScrollable(new InRegionScrollableArea(m_webPage, layer));
continue;
}
// If we run into a fix positioned layer, set the last scrollable in-region object
// as not able to propagate scroll to its parent scrollable.
- if (isNonRenderViewFixedPositionedContainer(layer) && validReturn.size()) {
- Platform::ScrollViewBase* end = validReturn.back();
+ if (isNonRenderViewFixedPositionedContainer(layer) && m_activeInRegionScrollableAreas.size()) {
+ Platform::ScrollViewBase* end = m_activeInRegionScrollableAreas.back();
end->setCanPropagateScrollingToEnclosingScrollable(false);
}
} while (layer = parentLayer(layer));
- if (validReturn.empty())
- return emptyReturn;
+ if (m_activeInRegionScrollableAreas.empty())
+ return;
// Post-calculate the visible window rects in reverse hit test order so
// we account for all and any clipping rects.
WebCore::IntRect recursiveClippingRect(WebCore::IntPoint::zero(), m_webPage->transformedViewportSize());
- std::vector<Platform::ScrollViewBase*>::reverse_iterator rend = validReturn.rend();
- for (std::vector<Platform::ScrollViewBase*>::reverse_iterator rit = validReturn.rbegin(); rit != rend; ++rit) {
+ std::vector<Platform::ScrollViewBase*>::reverse_iterator rend = m_activeInRegionScrollableAreas.rend();
+ for (std::vector<Platform::ScrollViewBase*>::reverse_iterator rit = m_activeInRegionScrollableAreas.rbegin(); rit != rend; ++rit) {
InRegionScrollableArea* curr = static_cast<InRegionScrollableArea*>(*rit);
RenderLayer* layer = curr->layer();
@@ -188,8 +225,34 @@ std::vector<Platform::ScrollViewBase*> InRegionScrollerPrivate::inRegionScrollab
recursiveClippingRect = visibleWindowRect;
}
}
+}
+
+const std::vector<Platform::ScrollViewBase*>& InRegionScrollerPrivate::activeInRegionScrollableAreas() const
+{
+ return m_activeInRegionScrollableAreas;
+}
+
+bool InRegionScrollerPrivate::setLayerScrollPosition(RenderLayer* layer, const IntPoint& scrollPosition)
+{
+ RenderObject* layerRenderer = layer->renderer();
+ ASSERT(layerRenderer);
+
+ if (layerRenderer->isRenderView()) { // #document case.
+ FrameView* view = toRenderView(layerRenderer)->frameView();
+ ASSERT(view);
+
+ Frame* frame = view->frame();
+ ASSERT_UNUSED(frame, frame);
+
+ view->setScrollPosition(scrollPosition);
+ return true;
+ }
- return validReturn;
+ // RenderBox-based elements case (scrollable boxes (div's, p's, textarea's, etc)).
+ layer->scrollToOffset(scrollPosition.x(), scrollPosition.y());
+ // FIXME_agomes: Please recheck if it is needed still!
+ layer->renderer()->repaint(true);
+ return true;
}
bool InRegionScrollerPrivate::scrollNodeRecursively(WebCore::Node* node, const WebCore::IntSize& delta)
@@ -376,16 +439,15 @@ static bool isNonRenderViewFixedPositionedContainer(RenderLayer* layer)
return o->isOutOfFlowPositioned() && o->style()->position() == FixedPosition;
}
-static void pushBackInRegionScrollable(std::vector<Platform::ScrollViewBase*>& vector, InRegionScrollableArea* scrollableArea, InRegionScrollerPrivate* scroller)
+void InRegionScrollerPrivate::pushBackInRegionScrollable(InRegionScrollableArea* scrollableArea)
{
- ASSERT(scroller);
ASSERT(!scrollableArea->isNull());
scrollableArea->setCanPropagateScrollingToEnclosingScrollable(!isNonRenderViewFixedPositionedContainer(scrollableArea->layer()));
- vector.push_back(scrollableArea);
- if (vector.size() == 1) {
+ m_activeInRegionScrollableAreas.push_back(scrollableArea);
+ if (m_activeInRegionScrollableAreas.size() == 1) {
// FIXME: Use RenderLayer::renderBox()->node() instead?
- scroller->setNode(enclosingLayerNode(scrollableArea->layer()));
+ setNode(enclosingLayerNode(scrollableArea->layer()));
}
}
diff --git a/Source/WebKit/blackberry/Api/InRegionScroller.h b/Source/WebKit/blackberry/Api/InRegionScroller.h
index c3d93a797..bbdd94fff 100644
--- a/Source/WebKit/blackberry/Api/InRegionScroller.h
+++ b/Source/WebKit/blackberry/Api/InRegionScroller.h
@@ -35,7 +35,8 @@ public:
InRegionScroller(WebPagePrivate*);
~InRegionScroller();
- bool compositedSetScrollPosition(unsigned /*camouflagedLayer*/, const Platform::IntPoint& /*scrollPosition*/);
+ bool setScrollPositionCompositingThread(unsigned camouflagedLayer, const Platform::IntPoint& /*scrollPosition*/);
+ bool setScrollPositionWebKitThread(unsigned camouflagedLayer, const Platform::IntPoint& /*scrollPosition*/);
private:
friend class WebPagePrivate;
diff --git a/Source/WebKit/blackberry/Api/InRegionScroller_p.h b/Source/WebKit/blackberry/Api/InRegionScroller_p.h
index bc47f9651..080766a3f 100644
--- a/Source/WebKit/blackberry/Api/InRegionScroller_p.h
+++ b/Source/WebKit/blackberry/Api/InRegionScroller_p.h
@@ -29,11 +29,13 @@ namespace WebCore {
class Frame;
class Node;
class RenderObject;
+class RenderLayer;
}
namespace BlackBerry {
namespace WebKit {
+class InRegionScrollableArea;
class WebPagePrivate;
class InRegionScrollerPrivate {
@@ -48,18 +50,27 @@ public:
bool hasNode() const;
bool scrollBy(const Platform::IntSize& delta);
- bool compositedSetScrollPosition(unsigned camouflagedLayer, const WebCore::IntPoint& scrollPosition);
- std::vector<Platform::ScrollViewBase*> inRegionScrollableAreasForPoint(const WebCore::IntPoint&);
+ bool setScrollPositionCompositingThread(unsigned camouflagedLayer, const WebCore::IntPoint& scrollPosition);
+ bool setScrollPositionWebKitThread(unsigned camouflagedLayer, const WebCore::IntPoint& scrollPosition);
+
+ void calculateInRegionScrollableAreasForPoint(const WebCore::IntPoint&);
+ const std::vector<Platform::ScrollViewBase*>& activeInRegionScrollableAreas() const;
WebPagePrivate* m_webPage;
private:
+ bool setLayerScrollPosition(WebCore::RenderLayer*, const WebCore::IntPoint& scrollPosition);
+
+ void pushBackInRegionScrollable(InRegionScrollableArea*);
+
+ // Obsolete codepath.
bool scrollNodeRecursively(WebCore::Node*, const WebCore::IntSize& delta);
bool scrollRenderer(WebCore::RenderObject*, const WebCore::IntSize& delta);
void adjustScrollDelta(const WebCore::IntPoint& maxOffset, const WebCore::IntPoint& currentOffset, WebCore::IntSize& delta) const;
RefPtr<WebCore::Node> m_inRegionScrollStartingNode;
+ std::vector<Platform::ScrollViewBase*> m_activeInRegionScrollableAreas;
};
}
diff --git a/Source/WebKit/blackberry/Api/WebOverlay.cpp b/Source/WebKit/blackberry/Api/WebOverlay.cpp
index abafe7139..e01694cef 100644
--- a/Source/WebKit/blackberry/Api/WebOverlay.cpp
+++ b/Source/WebKit/blackberry/Api/WebOverlay.cpp
@@ -215,10 +215,13 @@ WebPagePrivate* WebOverlayPrivate::page() const
WebOverlayOverride* WebOverlayPrivate::override()
{
+ if (!m_override)
+ m_override = adoptPtr(new WebOverlayOverride(this));
+
// Page might have changed if we were removed from the page and added to
// some other page.
- if (m_override)
- m_override->d->setPage(page());
+ m_override->d->setPage(page());
+
return m_override.get();
}
@@ -244,16 +247,6 @@ WebOverlayPrivateWebKitThread::WebOverlayPrivateWebKitThread(GraphicsLayerClient
m_layerCompositingThread = m_layer->platformLayer()->layerCompositingThread();
}
-WebOverlayOverride* WebOverlayPrivateWebKitThread::override()
-{
- if (!m_override) {
- WebOverlayPrivate* tmp = new WebOverlayPrivateCompositingThread(m_layerCompositingThread.get());
- m_override = adoptPtr(new WebOverlayOverride(tmp, true));
- }
-
- return WebOverlayPrivate::override();
-}
-
FloatPoint WebOverlayPrivateWebKitThread::position() const
{
return m_layer->position();
@@ -499,14 +492,6 @@ void WebOverlayPrivateCompositingThread::setClient(WebOverlayClient* client)
m_layerCompositingThreadClient->setClient(q, client);
}
-WebOverlayOverride* WebOverlayPrivateCompositingThread::override()
-{
- if (!m_override)
- m_override = adoptPtr(new WebOverlayOverride(this, false));
-
- return WebOverlayPrivate::override();
-}
-
FloatPoint WebOverlayPrivateCompositingThread::position() const
{
return m_layerCompositingThread->position();
diff --git a/Source/WebKit/blackberry/Api/WebOverlayOverride.cpp b/Source/WebKit/blackberry/Api/WebOverlayOverride.cpp
index 89e2233fb..831b2f9e5 100644
--- a/Source/WebKit/blackberry/Api/WebOverlayOverride.cpp
+++ b/Source/WebKit/blackberry/Api/WebOverlayOverride.cpp
@@ -27,57 +27,69 @@
#include "WebString.h"
#include <BlackBerryPlatformMessageClient.h>
+#include <wtf/CurrentTime.h>
namespace BlackBerry {
namespace WebKit {
using namespace WebCore;
-WebOverlayOverride::WebOverlayOverride(WebOverlayPrivate* d, bool owned)
+WebOverlayOverride::WebOverlayOverride(WebOverlayPrivate* d)
: d(d)
- , m_owned(owned)
{
}
WebOverlayOverride::~WebOverlayOverride()
{
- if (m_owned)
- delete d;
}
void WebOverlayOverride::setPosition(const Platform::FloatPoint& position)
{
- d->setPosition(position);
+ d->layerCompositingThread()->override()->setPosition(position);
+ d->scheduleCompositingRun();
}
void WebOverlayOverride::setAnchorPoint(const Platform::FloatPoint& anchor)
{
- d->setAnchorPoint(anchor);
+ d->layerCompositingThread()->override()->setAnchorPoint(anchor);
+ d->scheduleCompositingRun();
}
void WebOverlayOverride::setSize(const Platform::FloatSize& size)
{
- d->setSize(size);
+ d->layerCompositingThread()->override()->setBounds(IntSize(size.width(), size.height()));
+ d->scheduleCompositingRun();
}
void WebOverlayOverride::setTransform(const Platform::TransformationMatrix& transform)
{
- d->setTransform(reinterpret_cast<const TransformationMatrix&>(transform));
+ d->layerCompositingThread()->override()->setTransform(reinterpret_cast<const TransformationMatrix&>(transform));
+ d->scheduleCompositingRun();
}
void WebOverlayOverride::setOpacity(float opacity)
{
- d->setOpacity(opacity);
+ d->layerCompositingThread()->override()->setOpacity(opacity);
+ d->scheduleCompositingRun();
}
void WebOverlayOverride::addAnimation(const WebAnimation& animation)
{
- d->addAnimation(animation.d->name, animation.d->animation.get(), animation.d->keyframes);
+ LayerCompositingThread* layerCompositingThread = d->layerCompositingThread();
+ LayerOverride* override = layerCompositingThread->override();
+
+ IntSize boxSize = override->isBoundsSet() ? override->bounds() : layerCompositingThread->bounds();
+ RefPtr<LayerAnimation> layerAnimation = LayerAnimation::create(animation.d->keyframes, boxSize, animation.d->animation.get(), animation.d->name, 0.0);
+ layerAnimation->setStartTime(currentTime());
+
+ override->addAnimation(layerAnimation);
+ d->scheduleCompositingRun();
}
void WebOverlayOverride::removeAnimation(const WebString& name)
{
- d->removeAnimation(String(PassRefPtr<StringImpl>(name.impl())));
+ d->layerCompositingThread()->override()->removeAnimation(String(PassRefPtr<StringImpl>(name.impl())));
+ d->scheduleCompositingRun();
}
}
diff --git a/Source/WebKit/blackberry/Api/WebOverlayOverride.h b/Source/WebKit/blackberry/Api/WebOverlayOverride.h
index 09c9a3496..3c1b654f3 100644
--- a/Source/WebKit/blackberry/Api/WebOverlayOverride.h
+++ b/Source/WebKit/blackberry/Api/WebOverlayOverride.h
@@ -39,7 +39,7 @@ class WebString;
class BLACKBERRY_EXPORT WebOverlayOverride {
public:
// Don't use this, call WebOverlay::override() instead
- WebOverlayOverride(WebOverlayPrivate*, bool owned);
+ WebOverlayOverride(WebOverlayPrivate*);
~WebOverlayOverride();
void setPosition(const Platform::FloatPoint&);
diff --git a/Source/WebKit/blackberry/Api/WebOverlay_p.h b/Source/WebKit/blackberry/Api/WebOverlay_p.h
index 35c4a4b20..bd274328a 100644
--- a/Source/WebKit/blackberry/Api/WebOverlay_p.h
+++ b/Source/WebKit/blackberry/Api/WebOverlay_p.h
@@ -69,7 +69,7 @@ public:
virtual void setClient(WebOverlayClient* c) { client = c; }
- virtual WebOverlayOverride* override();
+ WebOverlayOverride* override();
virtual WebCore::FloatPoint position() const = 0;
virtual void setPosition(const WebCore::FloatPoint&) = 0;
@@ -128,8 +128,6 @@ class WebOverlayPrivateWebKitThread : public WebOverlayPrivate, public WebCore::
public:
WebOverlayPrivateWebKitThread(WebCore::GraphicsLayerClient* = 0);
- virtual WebOverlayOverride* override();
-
virtual WebCore::FloatPoint position() const;
virtual void setPosition(const WebCore::FloatPoint&);
@@ -220,7 +218,6 @@ public:
~WebOverlayPrivateCompositingThread();
virtual void setClient(WebOverlayClient*);
- virtual WebOverlayOverride* override();
virtual WebCore::FloatPoint position() const;
virtual void setPosition(const WebCore::FloatPoint&);
diff --git a/Source/WebKit/blackberry/Api/WebPage.cpp b/Source/WebKit/blackberry/Api/WebPage.cpp
index 3819523ae..137bc23cb 100644
--- a/Source/WebKit/blackberry/Api/WebPage.cpp
+++ b/Source/WebKit/blackberry/Api/WebPage.cpp
@@ -597,6 +597,7 @@ void WebPagePrivate::init(const WebString& pageGroupName)
Platform::userInterfaceThreadMessageClient()->dispatchSyncMessage(
createMethodCallMessage(&WebPagePrivate::createCompositor, this));
#endif
+ m_page->settings()->setDNSPrefetchingEnabled(true);
}
class DeferredTaskLoadManualScript: public DeferredTask<&WebPagePrivate::m_wouldLoadManualScript> {
@@ -884,8 +885,7 @@ void WebPage::executeJavaScriptFunction(const std::vector<std::string> &function
if (functionObject && thisObject)
result = JSObjectCallAsFunction(ctx, functionObject, thisObject, args.size(), argListRef.data(), 0);
- JSC::JSValue value = toJS(exec, result);
- if (!value) {
+ if (!result) {
returnValue.setType(JavaScriptVariant::Exception);
return;
}
@@ -1041,11 +1041,9 @@ void WebPagePrivate::setLoadState(LoadState state)
#endif
#if USE(ACCELERATED_COMPOSITING)
- if (isAcceleratedCompositingActive()) {
- Platform::userInterfaceThreadMessageClient()->dispatchSyncMessage(
- Platform::createMethodCallMessage(&WebPagePrivate::destroyLayerResources, this));
- }
+ releaseLayerResources();
#endif
+
// Suspend screen update to avoid ui thread blitting while resetting backingstore.
m_backingStore->d->suspendScreenAndBackingStoreUpdates();
@@ -1068,15 +1066,11 @@ void WebPagePrivate::setLoadState(LoadState state)
// Check if we have already process the meta viewport tag, this only happens on history navigation.
// For back/forward history navigation, we should only keep these previous values if the document
// has the meta viewport tag when the state is Committed in setLoadState.
- // Refreshing should keep these previous values as well.
static ViewportArguments defaultViewportArguments;
bool documentHasViewportArguments = false;
- FrameLoadType frameLoadType = FrameLoadTypeStandard;
if (m_mainFrame && m_mainFrame->document() && m_mainFrame->document()->viewportArguments() != defaultViewportArguments)
documentHasViewportArguments = true;
- if (m_mainFrame && m_mainFrame->loader())
- frameLoadType = m_mainFrame->loader()->loadType();
- if (!((m_didRestoreFromPageCache && documentHasViewportArguments) || (frameLoadType == FrameLoadTypeReload || frameLoadType == FrameLoadTypeReloadFromOrigin))) {
+ if (!(m_didRestoreFromPageCache && documentHasViewportArguments)) {
m_viewportArguments = ViewportArguments();
m_userScalable = m_webSettings->isUserScalable();
resetScales();
@@ -1095,16 +1089,6 @@ void WebPagePrivate::setLoadState(LoadState state)
didReceiveTouchEventMode(ProcessedTouchEvents);
#endif
- // If it's a outmost SVG document, we use FixedDesktop mode, otherwise
- // we default to Mobile mode. For example, using FixedDesktop mode to
- // render http://www.croczilla.com/bits_and_pieces/svg/samples/tiger/tiger.svg
- // is user-experience friendly.
- if (m_page->mainFrame()->document()->isSVGDocument()) {
- setShouldUseFixedDesktopMode(true);
- setViewMode(FixedDesktop);
- } else
- setViewMode(Mobile);
-
// Reset block zoom and reflow.
resetBlockZoom();
#if ENABLE(VIEWPORT_REFLOW)
@@ -1588,6 +1572,10 @@ bool WebPagePrivate::hasVirtualViewport() const
void WebPagePrivate::updateViewportSize(bool setFixedReportedSize, bool sendResizeEvent)
{
+ // This checks to make sure we're not calling updateViewportSize
+ // during WebPagePrivate::init().
+ if (!m_backingStore)
+ return;
ASSERT(m_mainFrame->view());
if (setFixedReportedSize)
m_mainFrame->view()->setFixedReportedSize(actualVisibleSize());
@@ -1765,9 +1753,9 @@ void WebPagePrivate::zoomToInitialScaleOnLoad()
bool performedZoom = false;
bool shouldZoom = !m_userPerformedManualZoom;
- // If this load should restore view state, don't zoom to initial scale
+ // If this is a back/forward type navigation, don't zoom to initial scale
// but instead let the HistoryItem's saved viewport reign supreme.
- if (m_mainFrame && m_mainFrame->loader() && m_mainFrame->loader()->shouldRestoreScrollPositionAndViewState())
+ if (m_mainFrame && m_mainFrame->loader() && isBackForwardLoadType(m_mainFrame->loader()->loadType()))
shouldZoom = false;
if (shouldZoom && shouldZoomToInitialScaleOnLoad()) {
@@ -2520,6 +2508,8 @@ IntSize WebPagePrivate::fixedLayoutSize(bool snapToIncrement) const
// If we detect an overflow larger than the contents size then use that instead since
// it'll still be clamped by the maxWidth below...
int width = std::max(absoluteVisibleOverflowSize().width(), contentsSize().width());
+ if (m_pendingOrientation != -1 && !m_nestedLayoutFinishedCount)
+ width = 0;
if (snapToIncrement) {
// Snap to increments of defaultLayoutWidth / 2.0.
@@ -2536,32 +2526,8 @@ IntSize WebPagePrivate::fixedLayoutSize(bool snapToIncrement) const
return IntSize(width, height);
}
- if (m_webSettings->isZoomToFitOnLoad()) {
- // We need to clamp the layout width to the minimum of the layout
- // width or the content width. This is important under rotation for mobile
- // websites. We want the page to remain layouted at the same width which
- // it was loaded with, and instead change the zoom level to fit to screen.
- // The height is welcome to adapt to the height used in the new orientation,
- // otherwise we will get a grey bar below the web page.
- if (m_mainFrame->view() && !contentsSize().isEmpty())
- minWidth = contentsSize().width();
- else {
- // If there is no contents width, use the minimum of screen width
- // and layout width to shape the first layout to a contents width
- // that we could reasonably zoom to fit, in a manner that takes
- // orientation into account and still respects a small default
- // layout width.
-#if ENABLE(ORIENTATION_EVENTS)
- minWidth = m_mainFrame->orientation() % 180
- ? Platform::Graphics::Screen::primaryScreen()->height()
- : Platform::Graphics::Screen::primaryScreen()->width();
-#else
- minWidth = Platform::Graphics::Screen::primaryScreen()->width();
-#endif
- }
- }
-
- return IntSize(std::min(minWidth, defaultLayoutWidth), defaultLayoutHeight);
+ ASSERT_NOT_REACHED();
+ return IntSize(defaultLayoutWidth, defaultLayoutHeight);
}
BackingStoreClient* WebPagePrivate::backingStoreClientForFrame(const Frame* frame) const
@@ -2808,7 +2774,7 @@ Node* WebPagePrivate::bestNodeForZoomUnderPoint(const IntPoint& point)
if (!originalNode)
return 0;
Node* node = bestChildNodeForClickRect(originalNode, clickRect);
- return node ? adjustedBlockZoomNodeForZoomLimits(node) : adjustedBlockZoomNodeForZoomLimits(originalNode);
+ return node ? adjustedBlockZoomNodeForZoomAndExpandingRatioLimits(node) : adjustedBlockZoomNodeForZoomAndExpandingRatioLimits(originalNode);
}
Node* WebPagePrivate::bestChildNodeForClickRect(Node* parentNode, const IntRect& clickRect)
@@ -2876,33 +2842,26 @@ Node* WebPagePrivate::nodeForZoomUnderPoint(const IntPoint& point)
return node;
}
-Node* WebPagePrivate::adjustedBlockZoomNodeForZoomLimits(Node* node)
+Node* WebPagePrivate::adjustedBlockZoomNodeForZoomAndExpandingRatioLimits(Node* node)
{
Node* initialNode = node;
RenderObject* renderer = node->renderer();
bool acceptableNodeSize = newScaleForBlockZoomRect(rectForNode(node), 1.0, 0) < maxBlockZoomScale();
+ IntSize actualVisibleSize = this->actualVisibleSize();
while (!renderer || !acceptableNodeSize) {
node = node->parentNode();
+ IntRect nodeRect = rectForNode(node);
- if (!node)
+ // Don't choose a node if the width of the node size is very close to the width of the actual visible size,
+ // as block zoom can do nothing on such kind of node.
+ if (!node || static_cast<double>(actualVisibleSize.width() - nodeRect.width()) / actualVisibleSize.width() < minimumExpandingRatio)
return initialNode;
renderer = node->renderer();
acceptableNodeSize = newScaleForBlockZoomRect(rectForNode(node), 1.0, 0) < maxBlockZoomScale();
}
- // Don't use a node if it is too close to the size of the actual contents.
- if (initialNode != node) {
- IntRect nodeRect = rectForNode(node);
- nodeRect = adjustRectOffsetForFrameOffset(nodeRect, node);
- nodeRect.intersect(IntRect(IntPoint::zero(), contentsSize()));
- int nodeArea = nodeRect.width() * nodeRect.height();
- int pageArea = contentsSize().width() * contentsSize().height();
- if (static_cast<double>(pageArea - nodeArea) / pageArea < minimumExpandingRatio)
- return initialNode;
- }
-
return node;
}
@@ -3540,7 +3499,7 @@ IntSize WebPagePrivate::recomputeVirtualViewportFromViewportArguments()
int deviceHeight = Platform::Graphics::Screen::primaryScreen()->height();
ViewportAttributes result = computeViewportAttributes(m_viewportArguments, desktopWidth, deviceWidth, deviceHeight, m_webSettings->devicePixelRatio(), m_defaultLayoutSize);
- setUserScalable(m_userScalable && result.userScalable);
+ setUserScalable(m_webSettings->isUserScalable() && result.userScalable);
if (result.initialScale > 0)
setInitialScale(result.initialScale * result.devicePixelRatio);
if (result.minimumScale > 0)
@@ -3857,16 +3816,25 @@ void WebPagePrivate::setViewportSize(const IntSize& transformedActualVisibleSize
}
}
- if (needsLayout)
- setNeedsLayout();
-
// Need to resume so that the backingstore will start recording the invalidated
// rects from below.
m_backingStore->d->resumeScreenAndBackingStoreUpdates(BackingStore::None);
// We might need to layout here to get a correct contentsSize so that zoomToFit
// is calculated correctly.
- requestLayoutIfNeeded();
+ while (needsLayout) {
+ setNeedsLayout();
+ requestLayoutIfNeeded();
+ needsLayout = false;
+
+ // Emulate the zoomToFitWidthOnLoad algorithm if we're rotating.
+ ++m_nestedLayoutFinishedCount;
+ if (needsLayoutToFindContentSize) {
+ if (setViewMode(viewMode()))
+ needsLayout = true;
+ }
+ }
+ m_nestedLayoutFinishedCount = 0;
// As a special case if we were zoomed to the initial scale at the beginning
// of the rotation then preserve that zoom level even when it is zoomToFit.
@@ -4183,7 +4151,9 @@ void WebPagePrivate::setScrollOriginPoint(const Platform::IntPoint& point)
if (!m_hasInRegionScrollableAreas)
return;
- m_client->notifyInRegionScrollingStartingPointChanged(m_inRegionScroller->d->inRegionScrollableAreasForPoint(point));
+ m_inRegionScroller->d->calculateInRegionScrollableAreasForPoint(point);
+ if (!m_inRegionScroller->d->activeInRegionScrollableAreas().empty())
+ m_client->notifyInRegionScrollingStartingPointChanged(m_inRegionScroller->d->activeInRegionScrollableAreas());
}
void WebPage::setScrollOriginPoint(const Platform::IntPoint& point)
@@ -5599,7 +5569,7 @@ GraphicsLayer* WebPagePrivate::overlayLayer()
return m_overlayLayer.get();
}
-void WebPagePrivate::setCompositor(PassRefPtr<WebPageCompositorPrivate> compositor, EGLContext compositingContext)
+void WebPagePrivate::setCompositor(PassRefPtr<WebPageCompositorPrivate> compositor)
{
using namespace BlackBerry::Platform;
@@ -5610,20 +5580,15 @@ void WebPagePrivate::setCompositor(PassRefPtr<WebPageCompositorPrivate> composit
if (m_compositor || m_client->window())
m_backingStore->d->suspendScreenAndBackingStoreUpdates();
- // This method call always round-trips on the WebKit thread (see WebPageCompositor::WebPageCompositor() and ~WebPageCompositor()),
- // and the compositing context must be set on the WebKit thread. How convenient!
- if (compositingContext != EGL_NO_CONTEXT)
- BlackBerry::Platform::Graphics::setCompositingContext(compositingContext);
-
// The m_compositor member has to be modified during a sync call for thread
// safe access to m_compositor and its refcount.
- userInterfaceThreadMessageClient()->dispatchSyncMessage(createMethodCallMessage(&WebPagePrivate::setCompositorHelper, this, compositor, compositingContext));
+ userInterfaceThreadMessageClient()->dispatchSyncMessage(createMethodCallMessage(&WebPagePrivate::setCompositorHelper, this, compositor));
if (m_compositor || m_client->window()) // the new compositor, if one was set
m_backingStore->d->resumeScreenAndBackingStoreUpdates(BackingStore::RenderAndBlit);
}
-void WebPagePrivate::setCompositorHelper(PassRefPtr<WebPageCompositorPrivate> compositor, EGLContext compositingContext)
+void WebPagePrivate::setCompositorHelper(PassRefPtr<WebPageCompositorPrivate> compositor)
{
using namespace BlackBerry::Platform;
@@ -5911,7 +5876,19 @@ void WebPagePrivate::syncDestroyCompositorOnCompositingThread()
&WebPagePrivate::destroyCompositor, this));
}
-void WebPagePrivate::destroyLayerResources()
+void WebPagePrivate::releaseLayerResources()
+{
+ if (!isAcceleratedCompositingActive())
+ return;
+
+ if (m_frameLayers)
+ m_frameLayers->releaseLayerResources();
+
+ Platform::userInterfaceThreadMessageClient()->dispatchSyncMessage(
+ Platform::createMethodCallMessage(&WebPagePrivate::releaseLayerResourcesCompositingThread, this));
+}
+
+void WebPagePrivate::releaseLayerResourcesCompositingThread()
{
m_compositor->releaseLayerResources();
}
@@ -5926,8 +5903,7 @@ void WebPagePrivate::suspendRootLayerCommit()
if (!m_compositor)
return;
- Platform::userInterfaceThreadMessageClient()->dispatchSyncMessage(
- Platform::createMethodCallMessage(&WebPagePrivate::destroyLayerResources, this));
+ releaseLayerResources();
}
void WebPagePrivate::resumeRootLayerCommit()
@@ -6435,10 +6411,11 @@ void WebPagePrivate::setTextZoomFactor(float textZoomFactor)
void WebPagePrivate::restoreHistoryViewState(Platform::IntSize contentsSize, Platform::IntPoint scrollPosition, double scale, bool shouldReflowBlock)
{
- if (!m_mainFrame)
+ if (!m_mainFrame) {
+ m_backingStore->d->resumeScreenAndBackingStoreUpdates(BackingStore::RenderAndBlit);
return;
+ }
- m_backingStore->d->suspendScreenAndBackingStoreUpdates(); // don't flash checkerboard for the setScrollPosition call
m_mainFrame->view()->setContentsSizeFromHistory(contentsSize);
// Here we need to set scroll position what we asked for.
diff --git a/Source/WebKit/blackberry/Api/WebPageClient.h b/Source/WebKit/blackberry/Api/WebPageClient.h
index 0da7318b2..be574a65b 100644
--- a/Source/WebKit/blackberry/Api/WebPageClient.h
+++ b/Source/WebKit/blackberry/Api/WebPageClient.h
@@ -26,6 +26,7 @@
#include <BlackBerryPlatformInputEvents.h>
#include <BlackBerryPlatformNavigationType.h>
#include <BlackBerryPlatformPrimitives.h>
+#include <imf/events.h>
#include <interaction/ScrollViewBase.h>
#include <vector>
@@ -99,8 +100,8 @@ public:
virtual void notifyRunLayoutTestsFinished() = 0;
- // Client is responsible for deleting the vector elements.
- virtual void notifyInRegionScrollingStartingPointChanged(std::vector<Platform::ScrollViewBase*>) = 0;
+ virtual void notifyInRegionScrollingStartingPointChanged(const std::vector<Platform::ScrollViewBase*>&) = 0;
+ virtual void notifyNoMouseMoveOrTouchMoveHandlers() = 0;
virtual void notifyDocumentOnLoad() = 0;
@@ -144,7 +145,7 @@ public:
virtual void showVirtualKeyboard(bool) = 0;
- virtual void requestSpellingSuggestionsForString(unsigned start, unsigned end) = 0;
+ virtual void requestSpellingCheckingOptions(imf_sp_text_t&) = 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;
diff --git a/Source/WebKit/blackberry/Api/WebPageCompositor.cpp b/Source/WebKit/blackberry/Api/WebPageCompositor.cpp
index 6e50f17c1..8948cb9e8 100644
--- a/Source/WebKit/blackberry/Api/WebPageCompositor.cpp
+++ b/Source/WebKit/blackberry/Api/WebPageCompositor.cpp
@@ -32,7 +32,6 @@
#include <BlackBerryPlatformExecutableMessage.h>
#include <BlackBerryPlatformMessage.h>
#include <BlackBerryPlatformMessageClient.h>
-#include <EGL/egl.h>
#include <GenericTimerClient.h>
#include <ThreadTimerClient.h>
#include <wtf/CurrentTime.h>
@@ -282,7 +281,7 @@ WebPageCompositor::WebPageCompositor(WebPage* page, WebPageCompositorClient* cli
// This ensures that the compositor will be around for as long as it's
// needed. Unfortunately RefPtr<T> is not public, so we have declare to
// resort to manual refcounting.
- webKitThreadMessageClient()->dispatchMessage(createMethodCallMessage(&WebPagePrivate::setCompositor, d->page(), tmp, eglGetCurrentContext()));
+ webKitThreadMessageClient()->dispatchMessage(createMethodCallMessage(&WebPagePrivate::setCompositor, d->page(), tmp));
}
WebPageCompositor::~WebPageCompositor()
@@ -291,7 +290,7 @@ WebPageCompositor::~WebPageCompositor()
// If we're being destroyed before the page, send a message to disconnect us
if (d->page())
- webKitThreadMessageClient()->dispatchMessage(createMethodCallMessage(&WebPagePrivate::setCompositor, d->page(), PassRefPtr<WebPageCompositorPrivate>(0), EGL_NO_CONTEXT));
+ webKitThreadMessageClient()->dispatchMessage(createMethodCallMessage(&WebPagePrivate::setCompositor, d->page(), PassRefPtr<WebPageCompositorPrivate>(0)));
d->compositorDestroyed();
d->deref();
}
diff --git a/Source/WebKit/blackberry/Api/WebPage_p.h b/Source/WebKit/blackberry/Api/WebPage_p.h
index 271ed0a39..04eb1b7fc 100644
--- a/Source/WebKit/blackberry/Api/WebPage_p.h
+++ b/Source/WebKit/blackberry/Api/WebPage_p.h
@@ -91,7 +91,7 @@ class WebPagePrivate : public PageClientBlackBerry
#endif
, public Platform::GuardedPointerBase {
public:
- enum ViewMode { Mobile, Desktop, FixedDesktop };
+ enum ViewMode { Desktop, FixedDesktop };
enum LoadState { None /* on instantiation of page */, Provisional, Committed, Finished, Failed };
WebPagePrivate(WebPage*, WebPageClient*, const WebCore::IntRect&);
@@ -291,7 +291,7 @@ public:
WebCore::Node* bestNodeForZoomUnderPoint(const WebCore::IntPoint&);
WebCore::Node* bestChildNodeForClickRect(WebCore::Node* parentNode, const WebCore::IntRect& clickRect);
WebCore::Node* nodeForZoomUnderPoint(const WebCore::IntPoint&);
- WebCore::Node* adjustedBlockZoomNodeForZoomLimits(WebCore::Node*);
+ WebCore::Node* adjustedBlockZoomNodeForZoomAndExpandingRatioLimits(WebCore::Node*);
WebCore::IntRect rectForNode(WebCore::Node*);
WebCore::IntRect blockZoomRectForNode(WebCore::Node*);
WebCore::IntRect adjustRectOffsetForFrameOffset(const WebCore::IntRect&, const WebCore::Node*);
@@ -413,13 +413,14 @@ public:
void commitRootLayer(const WebCore::IntRect&, const WebCore::IntSize&, bool);
bool isAcceleratedCompositingActive() const { return m_compositor; }
WebPageCompositorPrivate* compositor() const { return m_compositor.get(); }
- void setCompositor(PassRefPtr<WebPageCompositorPrivate>, EGLContext compositingContext);
- void setCompositorHelper(PassRefPtr<WebPageCompositorPrivate>, EGLContext compositingContext);
+ void setCompositor(PassRefPtr<WebPageCompositorPrivate>);
+ void setCompositorHelper(PassRefPtr<WebPageCompositorPrivate>);
void setCompositorBackgroundColor(const WebCore::Color&);
bool createCompositor();
void destroyCompositor();
void syncDestroyCompositorOnCompositingThread();
- void destroyLayerResources();
+ void releaseLayerResources();
+ void releaseLayerResourcesCompositingThread();
void suspendRootLayerCommit();
void resumeRootLayerCommit();
void blitVisibleContents();
diff --git a/Source/WebKit/blackberry/ChangeLog b/Source/WebKit/blackberry/ChangeLog
index ad8655511..253f13964 100644
--- a/Source/WebKit/blackberry/ChangeLog
+++ b/Source/WebKit/blackberry/ChangeLog
@@ -1,3 +1,791 @@
+2012-08-20 Sean Wang <Xuewen.Wang@torchmobile.com.cn>
+
+ [BlackBerry] Select popup shows blank content when its option tags contain '\' characters
+ https://bugs.webkit.org/show_bug.cgi?id=94321
+
+ Reviewed by George Staikos.
+
+ PR 194224
+
+ When the SelectPopupClient generates HTML, if there is a character '\' in the select options'
+ description, we should escape it to avoid the character being interpreted as an escape character.
+
+ * WebCoreSupport/SelectPopupClient.cpp:
+ (WebCore::SelectPopupClient::generateHTML):
+
+2012-08-20 Genevieve Mak <gmak@rim.com>
+
+ [BLACKBERRY] Add notification if an element does not have touch move or mouse move handlers.
+ https://bugs.webkit.org/show_bug.cgi?id=94529
+
+ Reviewed by George Staikos.
+
+ Send a notification to the client if the fat finger element does
+ not have a mouse move or touch move handler or if it is empty.
+ PR #177701
+
+ Reviewed Internally By Mike Lattanzio and Antonio Gomes.
+
+ * Api/WebPageClient.h:
+ * WebKitSupport/TouchEventHandler.cpp:
+ (BlackBerry::WebKit::TouchEventHandler::handleTouchPoint):
+
+2012-08-17 Antonio Gomes <agomes@rim.com>
+
+ [BlackBerry] Allow in-region accelerated scrolling take advantage of defer_blits
+ https://bugs.webkit.org/show_bug.cgi?id=94379
+ PR #194595
+
+ Reviewed by Yong Li.
+
+ Client does the blitting now.
+
+ * Api/InRegionScroller.cpp:
+ (BlackBerry::WebKit::InRegionScrollerPrivate::setScrollPositionCompositingThread):
+
+2012-08-17 Jacky Jiang <zhajiang@rim.com>
+
+ [BlackBerry] On reload, www.sohu.com renders part white background, part overscroll pattern
+ https://bugs.webkit.org/show_bug.cgi?id=94348
+
+ Reviewed by Yong Li.
+ Jacky Jiang <zhajiang@rim.com>
+
+ PR: 179200
+ This can fix the reload issues of sohu.com, yahoo.com and
+ thestar.com/iphone(PR158041). And it is also related with PR178305.
+
+ Internally reviewed by George Staikos.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::setLoadState): Keeping scales for
+ reload was doing more harm than good. Two reasons to remove this:
+ (1) During reload, contents rect is changing due to layout updates,
+ it is possible that the contents or the white background can't cover
+ the whole screen if we are using the previous scales.
+ (2) Before reload, the source of the web page can be changed, therefore
+ previous scales won't be valid anymore.
+ Remove shouldRestoreViewState() as this check here is useless now.
+ (BlackBerry::WebKit::WebPagePrivate::zoomToInitialScaleOnLoad): During
+ reload, we should give it a chance to zoom to fit the screen,
+ otherwise, it happens that the contents can't cover the whole screen
+ until we restore the view state, see PR158041.
+ Remove shouldRestoreViewState() as the error page issue PR178305 can be
+ covered by reload now.
+ * WebCoreSupport/FrameLoaderClientBlackBerry.h: Remove unused shouldRestoreViewState().
+
+2012-08-16 Mike Fenton <mifenton@rim.com>
+
+ [BlackBerry] Use form state to determine the VKB enter key.
+ https://bugs.webkit.org/show_bug.cgi?id=94239
+
+ Reviewed by Rob Buis.
+
+ PR 188234.
+
+ If the enter key for the VKB is not explicitly set, use
+ submit if we are in a single line input and a default
+ button exists for the form.
+
+ Reviewed Internally by Gen Mak.
+
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::setElementFocused):
+
+2012-08-16 Konrad Piascik <kpiascik@rim.com>
+
+ [BlackBerry] Reload valid page from Error Page keeps history ViewState and zoom.
+ https://bugs.webkit.org/show_bug.cgi?id=94123
+
+ Reviewed by Antonio Gomes.
+
+ Reviewed internally by Leo Yang, Jacky Jiang.
+ PR 178305
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::setLoadState):Reset the scales and
+ the user scalable flag if we're reloading from an error page.
+ (BlackBerry::WebKit::WebPagePrivate::updateViewportSize): Don't update the
+ viewport size if we're still in the WebPagePrivate::init method.
+ (BlackBerry::WebKit::WebPagePrivate::zoomToInitialScaleOnLoad):
+ Properly set the shouldZoom flag if we're not going to restore the
+ view state.
+ * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+ (WebCore::FrameLoaderClientBlackBerry::FrameLoaderClientBlackBerry):
+ (WebCore::FrameLoaderClientBlackBerry::dispatchDidCommitLoad): Set the
+ ViewState's shouldSaveViewState flag if we're coming from an error page.
+ (WebCore::FrameLoaderClientBlackBerry::saveViewStateToItem): Set the
+ new member variable m_shouldRestoreViewState based on the ViewState's
+ shouldSaveViewState flag.
+ (WebCore::FrameLoaderClientBlackBerry::restoreViewState): Added early
+ return if m_shouldRestoreViewState is false.
+ * WebCoreSupport/FrameLoaderClientBlackBerry.h: Add new method to have
+ the client track whether we should restore the view state.
+ (WebCore::FrameLoaderClientBlackBerry::shouldRestoreViewState):
+ (FrameLoaderClientBlackBerry):
+
+2012-08-16 Leo Yang <leoyang@rim.com>
+
+ [BlackBerry] Remove Mobile mode from WebPage.cpp and WebPage_p.h
+ https://bugs.webkit.org/show_bug.cgi?id=94223
+ PR #192773
+
+ Reviewed by Rob Buis.
+ Reviewed internally by Arvid Nilsson.
+
+ Remove Mobile mode as it's not been used. Also remove code that
+ handle top-level SVG document because now we can handle it in Desktop mode.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::setLoadState):
+ (BlackBerry::WebKit::WebPagePrivate::fixedLayoutSize):
+ * Api/WebPage_p.h:
+
+2012-08-16 Arvid Nilsson <anilsson@rim.com>
+
+ [BlackBerry] SurfacePool::waitForBuffer() sometimes waits for deleted EGLSyncKHR object
+ https://bugs.webkit.org/show_bug.cgi?id=94208
+
+ Reviewed by Rob Buis.
+
+ SurfacePool::notifyBuffersComposited() adds a tile's previous
+ sync object to the garbage list before replacing it with a new one.
+ However, it failed to thoroughly clear all tiles that were referencing
+ the old sync object.
+
+ Thus it could happen that if a set of tiles A was composited, then
+ another set of tiles B was composited, only the intersection of A and B
+ was cleared of the soon-to-be-deleted sync object, and the subtraction
+ A - B would reference an invalid sync object in case the BackingStore
+ decided to render to one of the tiles in A - B before they were
+ composited again.
+
+ Fixed by storing each individual sync object in only one place so we
+ don't have to rummage through all tiles and remove stale references to
+ sync objects that are about to be destroyed.
+
+ A new reference counted Fence class is added for this purpose, to store
+ a sync object. Tiles refer to Fence instances instead of holding a sync
+ object directly. Since Fence is reference counted, several tiles can
+ refer to the same Fence instance, and clearing its sync object will
+ instantly remove it from the grasp of all tiles that depend on that
+ Fence.
+
+ Since there's no point in waiting for the same Fence twice, the only
+ operation provided on Fence is takePlatformSync() which returns the
+ sync object and clears the Fence of its sync object.
+
+ Reviewed internally by Filip Spacek.
+
+ PR 193610
+
+ * WebKitSupport/BackingStoreTile.cpp:
+ (BlackBerry::WebKit::TileBuffer::TileBuffer):
+ * WebKitSupport/BackingStoreTile.h:
+ (BlackBerry):
+ (Fence):
+ (BlackBerry::Fence::create):
+ (BlackBerry::Fence::takePlatformSync):
+ (BlackBerry::Fence::Fence):
+ (BlackBerry::WebKit::TileBuffer::fence):
+ (BlackBerry::WebKit::TileBuffer::setFence):
+ (TileBuffer):
+ * WebKitSupport/SurfacePool.cpp:
+ (BlackBerry::WebKit::SurfacePool::waitForBuffer):
+ (BlackBerry::WebKit::SurfacePool::notifyBuffersComposited):
+ * WebKitSupport/SurfacePool.h:
+ (SurfacePool):
+
+2012-08-16 Rob Buis <rbuis@rim.com>
+
+ [BlackBerry] Suppress non DRT JS Console output.
+ https://bugs.webkit.org/show_bug.cgi?id=94058
+
+ Reviewed by Yong Li.
+ Reviewed internally by Ming Xie.
+
+ Some actual test results show JS Console showing up twice, for
+ instance traversal/moz-bug559526.html. Only print the DRT specific
+ Console message.
+
+ * WebCoreSupport/ChromeClientBlackBerry.cpp:
+ (WebCore::ChromeClientBlackBerry::addMessageToConsole):
+
+2012-08-16 Arvid Nilsson <anilsson@rim.com>
+
+ [BlackBerry] WebGL and Canvas fail to display after being restored from page cache
+ https://bugs.webkit.org/show_bug.cgi?id=94105
+
+ Reviewed by George Staikos.
+
+ The EGLImage was being destroyed when releasing layer resources on the
+ compositing thread, but the WebKit thread layer never found out and
+ failed to create a new image.
+
+ Fixed by extending the release layer resources mechanism to also make a
+ pass on the WebKit thread so that thread's layers have a chance to
+ delete their textures and related resources.
+
+ Reviewed internally by Filip Spacek.
+
+ PR 192899
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::setLoadState):
+ (BlackBerry::WebKit::WebPagePrivate::releaseLayerResources):
+ (WebKit):
+ (BlackBerry::WebKit::WebPagePrivate::releaseLayerResourcesCompositingThread):
+ (BlackBerry::WebKit::WebPagePrivate::suspendRootLayerCommit):
+ * Api/WebPage_p.h:
+ (WebPagePrivate):
+ * WebKitSupport/FrameLayers.cpp:
+ (BlackBerry::WebKit::FrameLayers::releaseLayerResources):
+ (WebKit):
+ * WebKitSupport/FrameLayers.h:
+ (FrameLayers):
+
+2012-08-16 Pierre Rossi <pierre.rossi@gmail.com>
+
+ [Qt] Remove FontQt4, HAVE_QRAWFONT flag and the related dead code
+ https://bugs.webkit.org/show_bug.cgi?id=93960
+
+ Reviewed by Simon Hausmann.
+
+ Following the removal of Qt 4 support from trunk in r124879.
+
+ * WebCoreSupport/AboutDataHaveFeatures.in: Remove all traces of HAVE_QRAWFONT's existence.
+
+2012-08-15 Benjamin C Meyer <bmeyer@rim.com>
+
+ [BlackBerry] When there is an exception we want to check if the ref is 0, not the
+ value as JSObjectCallAsFunction returns 0 in that case.
+ https://bugs.webkit.org/show_bug.cgi?id=94153
+
+ Reviewed by Yong Li.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPage::executeJavaScriptFunction):
+
+2012-08-15 Yong Li <yoli@rim.com>
+
+ [BlackBerry] Upstream FrameLoaderClientBlackBerry::securityOriginForNewDocument()
+ https://bugs.webkit.org/show_bug.cgi?id=94139
+
+ Reviewed by Antonio Gomes.
+
+ Keep same security origin when a file URL automatically redirects to its child folder.
+ This patch will be reverted when we finish the better solution.
+ PR# 172333 and PR# 180590.
+
+ * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+ (WebCore::FrameLoaderClientBlackBerry::FrameLoaderClientBlackBerry):
+ (WebCore::FrameLoaderClientBlackBerry::dispatchDidStartProvisionalLoad):
+ (WebCore::FrameLoaderClientBlackBerry::securityOriginForNewDocument):
+ (WebCore):
+ * WebCoreSupport/FrameLoaderClientBlackBerry.h:
+ (FrameLoaderClientBlackBerry):
+
+2012-08-15 Yong Li <yoli@rim.com>
+
+ [BlackBerry] Should not keep recreating GeoTracker in setEnableHighAccuracy()
+ https://bugs.webkit.org/show_bug.cgi?id=94136
+
+ Reviewed by Rob Buis.
+ Internally reviewed by Lyon Chen.
+
+ PR# 192401.
+ 1. The prototype of GeoTracker::create() has changed.
+ 2. Fix the issue that it could recreate tracker unnecessarily when
+ setEnableHighAccuracy() is called but accuracy requirment hasn't
+ changed.
+ 3. Fix the issue setEnableHighAccuracy() could start tracking when
+ tracker was suspended.
+
+ * WebCoreSupport/GeolocationControllerClientBlackBerry.cpp:
+ (GeolocationControllerClientBlackBerry::startUpdating):
+ (GeolocationControllerClientBlackBerry::setEnableHighAccuracy):
+
+2012-08-15 Mike Fenton <mifenton@rim.com>
+
+ [BlackBerry] Use the unconverted attribute instead of composing when deciding to how to handle key input.
+ https://bugs.webkit.org/show_bug.cgi?id=94132
+
+ Reviewed by Rob Buis.
+
+ PR 139838.
+
+ Switch direct key input handling to be based on the unconverted
+ attribute being present. Converted keys, even during composition
+ are now input directly.
+
+ Reviewed Internally by Nima Ghanavatian.
+
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::setText):
+
+2012-08-15 Joshua Netterfield <jnetterfield@rim.com>
+
+ [BlackBerry] Upstream BlackBerry build fixes
+ https://bugs.webkit.org/show_bug.cgi?id=94121
+
+ Reviewed by Rob Buis.
+
+ This includes several build fixes due to incorrect upstream patches.
+ These mistakes were never present downstream.
+
+ No new tests, because no new functionality is added.
+
+ * WebCoreSupport/AboutDataEnableFeatures.in:
+ * WebCoreSupport/AboutTemplate.html.cpp:
+ (writeHeader):
+
+2012-08-15 Leo Yang <leoyang@rim.com>
+
+ [BlackBerry] Use nested layout when rotating
+ https://bugs.webkit.org/show_bug.cgi?id=94117
+
+ Partially patched by Arvid Nilsson.
+
+ Reviewed by George Staikos.
+ Reviewed internally by Arvid Nilsson.
+
+ When rotating the content width used for fixedLayoutSize is not
+ correct because we are changing the rotation and the content with
+ should be determined after layout. So we set the with to 0 if we
+ are rotating and beginning the nested layout. And in setViewportSize
+ we need a nested layout loop to trigger zoom-to-fit.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::fixedLayoutSize):
+ (BlackBerry::WebKit::WebPagePrivate::setViewportSize):
+
+2012-08-14 Antonio Gomes <agomes@rim.com>
+
+ [BlackBerry] Stop copying ScrollViewBase vector all over
+ https://bugs.webkit.org/show_bug.cgi?id=94021
+
+ Reviewed by Rob Buis.
+
+ It outlives long enough in WebKit that we can
+ just pass a const+ref of it.
+
+ Internally reviewed by Gen Mak.
+
+ * Api/WebPageClient.h:
+
+2012-08-14 Antonio Gomes <agomes@rim.com>
+
+ [BlackBerry] Robust-fy the LayerWebKitThread ownership with InRegionScroller
+ https://bugs.webkit.org/show_bug.cgi?id=93983
+ PR #191737
+
+ Reviewed by Yong Li.
+
+ Patch changes the way we currently keep track of the active scrollable area
+ objects: before, we acquired the scrollable areas and just passed them in a vector up
+ to the client, copying it over and over again. Also, it was a client responsability to
+ delete stuff (BAD!).
+ Now, we keep track of vector within InRegionScroller, as a class member, which allows us to
+ avoid copies (in follow up patch), and control until when these objects outlive.
+
+ Patch also changes InRegionScrollableArea to "retptr" the composited layer
+ associated to it (if any). This ensure we have a non-null scrollable element always.
+
+ As mentioned, InRegionScroller is now responsible for deleting and vector of scrollable areas.
+
+ Internally reviewed by Arvid Nilsson.
+
+ * Api/InRegionScroller.cpp:
+ (WebKit):
+ (BlackBerry::WebKit::InRegionScrollerPrivate::reset): Method is now responsible for
+ deleting the tracked scrollable areas.
+ (BlackBerry::WebKit::InRegionScrollerPrivate::calculateInRegionScrollableAreasForPoint):
+ Renamed from 'inRegionScrollableAreasForPoint'. It was changed in order to store the
+ scrollable area objects instead of just pass a copy of them up to the client.
+ (BlackBerry::WebKit::InRegionScrollerPrivate::activeInRegionScrollableAreas): Getter.
+ (BlackBerry::WebKit::InRegionScrollerPrivate::pushBackInRegionScrollable): It was
+ promoted to a class method instead of a local helper.
+ * Api/InRegionScroller_p.h:
+ (WebKit):
+ (InRegionScrollerPrivate):
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::setScrollOriginPoint): Adjustments needed due to the
+ above changed.
+ * WebKitSupport/InRegionScrollableArea.cpp:
+ (BlackBerry::WebKit::InRegionScrollableArea::~InRegionScrollableArea): Clear up the cached layer.
+ (WebKit):
+ (BlackBerry::WebKit::InRegionScrollableArea::InRegionScrollableArea):
+ * WebKitSupport/InRegionScrollableArea.h:
+ (InRegionScrollableArea):
+
+2012-08-15 Nima Ghanavatian <nghanavatian@rim.com>
+
+ [BlackBerry] Check for valid field focus before processing a spellcheck request
+ https://bugs.webkit.org/show_bug.cgi?id=94115
+
+ Reviewed by Rob Buis.
+
+ PR192891
+ Checking for valid field focus before processing the spellcheck
+ request.
+
+ Internally reviewed by Mike Fenton.
+
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::requestCheckingOfString):
+
+2012-08-14 Adam Barth <abarth@webkit.org>
+
+ Delete Frame::domWindow() and Frame::existingDOMWindow()
+ https://bugs.webkit.org/show_bug.cgi?id=93990
+
+ Reviewed by Eric Seidel.
+
+ * WebCoreSupport/ChromeClientBlackBerry.cpp:
+ (WebCore::toOriginString):
+ (WebCore::ChromeClientBlackBerry::runJavaScriptAlert):
+ (WebCore::ChromeClientBlackBerry::runJavaScriptConfirm):
+ (WebCore::ChromeClientBlackBerry::runJavaScriptPrompt):
+ (WebCore::ChromeClientBlackBerry::runBeforeUnloadConfirmPanel):
+ (WebCore::ChromeClientBlackBerry::requestWebGLPermission):
+
+2012-08-14 Leo Yang <leoyang@rim.com>
+
+ [BlackBerry] Checkerboard flashes on Go Back
+ https://bugs.webkit.org/show_bug.cgi?id=94018
+
+ Reviewed by Yong Li.
+ Reviewed internally by Yong Li.
+
+ The backing store need to be suspended before the
+ WebPagePrivate::restoreHistoryViewState() is called to avoid UI thread
+ drawing checkerboard.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::restoreHistoryViewState):
+ * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+ (WebCore::FrameLoaderClientBlackBerry::restoreViewState):
+
+2012-08-14 Mike Fenton <mifenton@rim.com>
+
+ [BlackBerry] Remove unnecessary \n's from InputHandler log messages.
+ https://bugs.webkit.org/show_bug.cgi?id=94015
+
+ Reviewed by Rob Buis.
+
+ Remove many unnecessary \n's from the end of log messages.
+
+ Reviewed Internally by Nima Ghanavatian.
+
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::convertStringToWcharVector):
+ (BlackBerry::WebKit::convertSpannableStringToString):
+ (BlackBerry::WebKit::InputHandler::spannableTextInRange):
+ (BlackBerry::WebKit::InputHandler::setText):
+ (BlackBerry::WebKit::InputHandler::setSpannableTextAndRelativeCursor):
+
+2012-08-14 Nima Ghanavatian <nghanavatian@rim.com>
+
+ [BlackBerry] Queue spellcheck requests with char-count limitations
+ https://bugs.webkit.org/show_bug.cgi?id=93866
+
+ Reviewed by Rob Buis.
+
+ PR184196
+ Making spellcheck a little more granular so as to work around
+ the limitations of the inputservice.
+ Also, spellcheck the entire field on focus only if
+ spellcheck="on" is explicitly set.
+
+ Internally reviewed by Mike Fenton.
+
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::requestCheckingOfString):
+ (BlackBerry::WebKit::InputHandler::spellCheckingRequestProcessed):
+
+2012-08-14 Mike Fenton <mifenton@rim.com>
+
+ [BlackBerry] Use Form helper functions to determine state in DOMSupport::isTextBasedContentEditableElement
+ https://bugs.webkit.org/show_bug.cgi?id=93992
+
+ Reviewed by Antonio Gomes.
+
+ Use form control helper functions to determine the editable state
+ of the input field.
+
+ * WebKitSupport/DOMSupport.cpp:
+ (BlackBerry::WebKit::DOMSupport::isTextBasedContentEditableElement):
+
+2012-08-14 Mike Fenton <mifenton@rim.com>
+
+ [BlackBerry] Use constructor to initialize rect in TouchEventHandler::drawTapHighlight()
+ https://bugs.webkit.org/show_bug.cgi?id=93988
+
+ Reviewed by Antonio Gomes.
+
+ Use constructor to initialize rect in TouchEventHandler::drawTapHighlight()
+
+ * WebKitSupport/TouchEventHandler.cpp:
+ (BlackBerry::WebKit::TouchEventHandler::drawTapHighlight):
+
+2012-08-14 Mike Fenton <mifenton@rim.com>
+
+ [BlackBerry] Fix use of endsWith to use string instead of char.
+ https://bugs.webkit.org/show_bug.cgi?id=93994
+
+ Reviewed by Antonio Gomes.
+
+ Regex comparison should use string instead of char comparison.
+
+ * WebKitSupport/DOMSupport.cpp:
+ (BlackBerry::WebKit::DOMSupport::elementPatternMatches):
+
+2012-08-14 Jacky Jiang <zhajiang@rim.com>
+
+ [BlackBerry] Double-tap zoom on blocks on cnn.com desktop page doesn't work
+ https://bugs.webkit.org/show_bug.cgi?id=93895
+
+ Reviewed by Antonio Gomes.
+ Patch by Jacky Jiang <zhajiang@rim.com>
+
+ PR: 188232
+ When adjusting block zoom node, don't choose a node if the width of the
+ node size is very close to the width of the actual visible size as
+ block zoom can do nothing on such kind of node. This condition is more
+ restrictive than the one based on area and can bail out early.
+ In this way, we can get a better node for double-tap zoom.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::bestNodeForZoomUnderPoint):
+ (BlackBerry::WebKit::WebPagePrivate::adjustedBlockZoomNodeForZoomAndExpandingRatioLimits):
+ * Api/WebPage_p.h:
+ (WebPagePrivate):
+
+2012-08-14 Konrad Piascik <kpiascik@rim.com>
+
+ [BlackBerry] Change the call to setUserScalable to use the setting.
+ https://bugs.webkit.org/show_bug.cgi?id=93974
+
+ Reviewed by Rob Buis.
+
+ We should be using the WebSetting and not the current value of m_userScalable.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::recomputeVirtualViewportFromViewportArguments):
+
+2012-08-14 Charles Wei <charles.wei@torchmobile.com.cn>
+
+ [BlackBerry] Some callback of Select onchange doesn't work
+ https://bugs.webkit.org/show_bug.cgi?id=93944
+
+ Reviewed by George Staikos.
+
+ The Selection element is implemented with PagePopup, an HTML-based WebView with
+ some Javascripts to make the UI of the select and option lists; The selection
+ change is initiated from the javascript code in the Select Webview, and back to
+ the native code of SelectPopupClient, which now in turn dispatches
+ FormControlChangeEvent to the select element directly, and that causes the
+ javascript callback been invoked in the same cycle as the javascript in the
+ Popup View, and causes some Javascript Context problem.
+
+ The solution is to send the FormControlChangeEvent asynchronously by a timer,
+ when the JavaScript in the Popup view finishes execution, we then send the
+ FormControlChangeEvent to the select element in the content page, that avoids
+ the concurrent Javascript context issue.
+
+ * WebCoreSupport/SelectPopupClient.cpp:
+ (WebCore::SelectPopupClient::SelectPopupClient):
+ (WebCore::SelectPopupClient::setValueAndClosePopup):
+ (WebCore):
+ (WebCore::SelectPopupClient::notifySelectionChange):
+ * WebCoreSupport/SelectPopupClient.h:
+ (SelectPopupClient):
+
+2012-08-14 Arvid Nilsson <anilsson@rim.com>
+
+ [BlackBerry] Get rid of glCopyTexImage2D in Canvas and WebGL code paths
+ https://bugs.webkit.org/show_bug.cgi?id=93614
+
+ Reviewed by Antonio Gomes.
+
+ We used to set up resource sharing between the compositing thread
+ context and the Canvas and WebGL contexts, and use glCopyTexImage2D to
+ get a copy of the framebuffer to use as front buffer for compositing
+ purposes.
+
+ Now we instead create an EGLImage and blit the Canvas/WebGL output to
+ it. The compositing thread creates a texture from the EGLImage in order
+ to composite the output.
+
+ This allows us to turn off resource sharing, so the WebPageCompositor
+ no longer needs to pass the compositing thread context to the webkit
+ thread.
+
+ Reviewed internally by Filip Spacek.
+
+ PR 188472
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::setCompositor):
+ (BlackBerry::WebKit::WebPagePrivate::setCompositorHelper):
+ * Api/WebPageCompositor.cpp:
+ (BlackBerry::WebKit::WebPageCompositor::WebPageCompositor):
+ (BlackBerry::WebKit::WebPageCompositor::~WebPageCompositor):
+ * Api/WebPage_p.h:
+ (WebPagePrivate):
+
+2012-08-14 Charles Wei <charles.wei@torchmobile.com.cn>
+
+ [BlackBerry] Enable DNS prefetch
+ https://bugs.webkit.org/show_bug.cgi?id=93846
+
+ Reviewed by George Staikos.
+
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::init):
+
+2012-08-13 Tom Sepez <tsepez@chromium.org>
+
+ [chromium] release FrameLoaderClientImpl::m_pluginWidget refptr upon Plugin Document detach.
+ https://bugs.webkit.org/show_bug.cgi?id=93283
+
+ Reviewed by Eric Seidel.
+
+ Change the client redirectDataToPlugin method(s) to expect the possibility of
+ a NULL argument, keeping existing behaviour otherwise.
+
+ * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+ (WebCore::FrameLoaderClientBlackBerry::redirectDataToPlugin):
+
+2012-08-13 Mike Fenton <mifenton@rim.com>
+
+ [BlackBerry] Update API for spell checking suggestions again.
+ https://bugs.webkit.org/show_bug.cgi?id=93877
+
+ Reviewed by Antonio Gomes.
+
+ PR 163283.
+
+ Update the spell checking options request API
+ to include the caret positions.
+
+ Reviewed internally by Nima Ghanavatian.
+
+ * Api/WebPageClient.h:
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::shouldRequestSpellCheckingOptionsForPoint):
+ (WebKit):
+ (BlackBerry::WebKit::InputHandler::requestSpellingCheckingOptions):
+ * WebKitSupport/InputHandler.h:
+ (Platform):
+ (InputHandler):
+ * WebKitSupport/TouchEventHandler.cpp:
+ (BlackBerry::WebKit::TouchEventHandler::handleTouchPoint):
+ * WebKitSupport/TouchEventHandler.h:
+ (TouchEventHandler):
+
+2012-08-13 Antonio Gomes <agomes@rim.com>
+
+ [BlackBerry] Rounding error somewhere when translating CompositingLayer 's for in-region scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=93848
+ PR #190986
+
+ Reviewed by Yong Li.
+
+ Patch adds a WebKit thread setScrollPosition-like API to InRegionScroller.
+ It fixes a mismatch we had of setting a layer's scroll positing directly via
+ ::setScrollPosition on the UI thread, but dispatching a coalesceable
+ scrollBy(delta) message to WebKit thread.
+
+ * Api/InRegionScroller.cpp:
+ (BlackBerry::WebKit::InRegionScroller::setScrollPositionCompositingThread):
+ Changed the API name to match other thread specific methods naming.
+ (WebKit):
+ (BlackBerry::WebKit::InRegionScroller::setScrollPositionWebKitThread):
+ Added a setScrollPosition-like method to InRegionScroller public API. Used
+ together with its UI-thread counterpart, it can fix some rounding
+ errors we have due to mixing ::setScrollPosition and ::scrollBy methods.
+ (BlackBerry::WebKit::InRegionScrollerPrivate::setScrollPositionCompositingThread):
+ Method renamed. See reasons above.
+ (BlackBerry::WebKit::InRegionScrollerPrivate::setScrollPositionWebKitThread):
+ Calls fowards the call to ::setLayerScrollPosition (below).
+ (BlackBerry::WebKit::InRegionScrollerPrivate::setLayerScrollPosition):
+ Sets the scroll position of a given RenderLayer.
+ * Api/InRegionScroller.h:
+ (InRegionScroller):
+ * Api/InRegionScroller_p.h:
+ (WebCore):
+ (InRegionScrollerPrivate):
+ * WebKitSupport/InRegionScrollableArea.cpp:
+ (BlackBerry::WebKit::InRegionScrollableArea::InRegionScrollableArea):
+ Cache the RenderLayer object associated to a given scrollable area
+ instead of its LayerCompositingThread. This way we can use it for
+ scrolling from both Compositing/UI and WebKit threads.
+
+2012-08-12 Arvid Nilsson <anilsson@rim.com>
+
+ [BlackBerry] Tap highlight flashes checkerboard after pinch zoom
+ https://bugs.webkit.org/show_bug.cgi?id=93601
+
+ Reviewed by Antonio Gomes.
+
+ Since the tap highlight is usually rather small, we can reimplement
+ GraphicsLayerClient::contentsVisible() to always return true in order
+ to keep all AC layer tiles cached all the time.
+
+ PR 189895
+
+ * WebKitSupport/DefaultTapHighlight.cpp:
+ (BlackBerry::WebKit::DefaultTapHighlight::contentsVisible):
+ (WebKit):
+ * WebKitSupport/DefaultTapHighlight.h:
+ (DefaultTapHighlight):
+
+2012-08-12 Arvid Nilsson <anilsson@rim.com>
+
+ [BlackBerry] Tap highlight sometimes doesn't disappear
+ https://bugs.webkit.org/show_bug.cgi?id=93711
+
+ Reviewed by Antonio Gomes.
+
+ The WebOverlayOverride implementation just changes properties of a
+ LayerCompositingThread directly, which means the changes will
+ immediately be overwritten on the next commit. Therefore, when the tap
+ highlight implementation adds a fade out animation, that animation will
+ instantly be removed again if a commit happens for any reason.
+
+ The reason is I totally botched the implementation of
+ WebOverlayOverride, it's not wrapping WebCore::LayerOverride at all,
+ instead for some reason it's manipulating the LayerCompositingThread
+ directly.
+
+ Fixed by actually mapping WebOverlayOverride calls to the corresponding
+ WebCore::LayerOverride method, and scheduling a compositing run to make
+ the change visible and kick off animations.
+
+ Reviewed internally by Sean Wang.
+
+ PR 188453
+
+ * Api/WebOverlay.cpp:
+ (BlackBerry::WebKit::WebOverlayPrivate::override):
+ * Api/WebOverlayOverride.cpp:
+ (BlackBerry::WebKit::WebOverlayOverride::WebOverlayOverride):
+ (BlackBerry::WebKit::WebOverlayOverride::~WebOverlayOverride):
+ (BlackBerry::WebKit::WebOverlayOverride::setPosition):
+ (BlackBerry::WebKit::WebOverlayOverride::setAnchorPoint):
+ (BlackBerry::WebKit::WebOverlayOverride::setSize):
+ (BlackBerry::WebKit::WebOverlayOverride::setTransform):
+ (BlackBerry::WebKit::WebOverlayOverride::setOpacity):
+ (BlackBerry::WebKit::WebOverlayOverride::addAnimation):
+ (BlackBerry::WebKit::WebOverlayOverride::removeAnimation):
+ * Api/WebOverlayOverride.h:
+ * Api/WebOverlay_p.h:
+ (WebOverlayPrivate):
+ (WebOverlayPrivateWebKitThread):
+ (WebOverlayPrivateCompositingThread):
+
2012-08-10 Benjamin C Meyer <bmeyer@rim.com>
Introduce JavaScriptVariant object.
diff --git a/Source/WebKit/blackberry/WebCoreSupport/AboutDataEnableFeatures.in b/Source/WebKit/blackberry/WebCoreSupport/AboutDataEnableFeatures.in
index 9319c0001..15e40e66b 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/AboutDataEnableFeatures.in
+++ b/Source/WebKit/blackberry/WebCoreSupport/AboutDataEnableFeatures.in
@@ -117,7 +117,7 @@ MEDIA_STATISTICS
MEDIA_STREAM
MEMORY_SAMPLER
META_ALLOCATOR_PROFILE
-METER_ELEMENT
+METER_TAG
MHTML
MICRODATA
MUTATION_OBSERVERS
@@ -146,7 +146,7 @@ PERFORMANCE_TIMELINE
PLUGIN_PACKAGE_SIMPLE_HASH
PLUGIN_PROCESS
POINTER_LOCK
-PROGRESS_ELEMENT
+PROGRESS_TAG
PURGEABLE_MEMORY
QUOTA
REGEXP_TRACING
@@ -184,6 +184,7 @@ SVG_FOREIGN_OBJECT
TEXT_CARET
TEXT_NOTIFICATIONS_ONLY
THREADED_SCROLLING
+THREADED_SCROLLING
THREADING_GENERIC
THREADING_LIBDISPATCH
THREADING_OPENMP
@@ -198,7 +199,6 @@ VERBOSE_VALUE_RECOVERIES
VIBRATION
VIDEO
VIDEO_TRACK
-VIDEO|XSLT
VIEWPORT
VIEWPORT_REFLOW
WBXML
diff --git a/Source/WebKit/blackberry/WebCoreSupport/AboutDataHaveFeatures.in b/Source/WebKit/blackberry/WebCoreSupport/AboutDataHaveFeatures.in
index 1ab9d264e..a9ec5f28e 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/AboutDataHaveFeatures.in
+++ b/Source/WebKit/blackberry/WebCoreSupport/AboutDataHaveFeatures.in
@@ -32,7 +32,6 @@ PTHREAD_MACHDEP_H
PTHREAD_NP_H
PTHREAD_RWLOCK
PTHREAD_SETNAME_NP
-QRAWFONT
QT5
READLINE
RUNLOOP_TIMER
diff --git a/Source/WebKit/blackberry/WebCoreSupport/AboutTemplate.html.cpp b/Source/WebKit/blackberry/WebCoreSupport/AboutTemplate.html.cpp
index 74984ddd1..904e441d7 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/AboutTemplate.html.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/AboutTemplate.html.cpp
@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-static String writeHeader(const String& header)
+static String writeHeader(const String& title)
{
return "<!DOCTYPE html><html>"
"<head>"
diff --git a/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp
index b0dae6097..9a6325fcd 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp
@@ -78,12 +78,9 @@ using BlackBerry::Platform::Graphics::Window;
namespace WebCore {
-static CString frameOrigin(Frame* frame)
+static CString toOriginString(Frame* frame)
{
- DOMWindow* window = frame->domWindow();
- SecurityOrigin* origin = window->securityOrigin();
- CString latinOrigin = origin->toString().latin1();
- return latinOrigin;
+ return frame->document()->securityOrigin()->toString().latin1();
}
ChromeClientBlackBerry::ChromeClientBlackBerry(WebPagePrivate* pagePrivate)
@@ -94,8 +91,10 @@ ChromeClientBlackBerry::ChromeClientBlackBerry(WebPagePrivate* pagePrivate)
void ChromeClientBlackBerry::addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, unsigned int lineNumber, const String& sourceID)
{
#if !defined(PUBLIC_BUILD) || !PUBLIC_BUILD
- if (m_webPagePrivate->m_dumpRenderTree)
+ if (m_webPagePrivate->m_dumpRenderTree) {
m_webPagePrivate->m_dumpRenderTree->addMessageToConsole(message, lineNumber, sourceID);
+ return;
+ }
#endif
m_webPagePrivate->m_client->addMessageToConsole(message.characters(), message.length(), sourceID.characters(), sourceID.length(), lineNumber);
@@ -111,7 +110,7 @@ void ChromeClientBlackBerry::runJavaScriptAlert(Frame* frame, const String& mess
#endif
TimerBase::fireTimersInNestedEventLoop();
- CString latinOrigin = frameOrigin(frame);
+ CString latinOrigin = toOriginString(frame);
m_webPagePrivate->m_client->runJavaScriptAlert(message.characters(), message.length(), latinOrigin.data(), latinOrigin.length());
}
@@ -123,7 +122,7 @@ bool ChromeClientBlackBerry::runJavaScriptConfirm(Frame* frame, const String& me
#endif
TimerBase::fireTimersInNestedEventLoop();
- CString latinOrigin = frameOrigin(frame);
+ CString latinOrigin = toOriginString(frame);
return m_webPagePrivate->m_client->runJavaScriptConfirm(message.characters(), message.length(), latinOrigin.data(), latinOrigin.length());
}
@@ -137,7 +136,7 @@ bool ChromeClientBlackBerry::runJavaScriptPrompt(Frame* frame, const String& mes
#endif
TimerBase::fireTimersInNestedEventLoop();
- CString latinOrigin = frameOrigin(frame);
+ CString latinOrigin = toOriginString(frame);
WebString clientResult;
if (m_webPagePrivate->m_client->runJavaScriptPrompt(message.characters(), message.length(), defaultValue.characters(), defaultValue.length(), latinOrigin.data(), latinOrigin.length(), clientResult)) {
result = clientResult;
@@ -386,7 +385,7 @@ bool ChromeClientBlackBerry::runBeforeUnloadConfirmPanel(const String& message,
#endif
TimerBase::fireTimersInNestedEventLoop();
- CString latinOrigin = frameOrigin(frame);
+ CString latinOrigin = toOriginString(frame);
return m_webPagePrivate->m_client->runBeforeUnloadConfirmPanel(message.characters(), message.length(), latinOrigin.data(), latinOrigin.length());
}
@@ -768,7 +767,7 @@ void ChromeClientBlackBerry::fullScreenRendererChanged(RenderBox* fullScreenRend
void ChromeClientBlackBerry::requestWebGLPermission(Frame* frame)
{
if (frame) {
- CString latinOrigin = frameOrigin(frame);
+ CString latinOrigin = toOriginString(frame);
m_webPagePrivate->m_client->requestWebGLPermission(latinOrigin.data());
}
}
diff --git a/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
index 90ee06964..320c639ec 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
@@ -108,6 +108,8 @@ FrameLoaderClientBlackBerry::FrameLoaderClientBlackBerry()
, m_pluginView(0)
, m_hasSentResponseToPlugin(false)
, m_cancelLoadOnNextData(false)
+ , m_wasProvisionalLoadTriggeredByUserGesture(true) // To avoid affecting the first load.
+ , m_shouldRestoreViewState(true)
{
}
@@ -346,9 +348,9 @@ PassRefPtr<Widget> FrameLoaderClientBlackBerry::createPlugin(const IntSize& plug
void FrameLoaderClientBlackBerry::redirectDataToPlugin(Widget* pluginWidget)
{
- ASSERT(!m_pluginView);
m_pluginView = static_cast<PluginView*>(pluginWidget);
- m_hasSentResponseToPlugin = false;
+ if (pluginWidget)
+ m_hasSentResponseToPlugin = false;
}
void FrameLoaderClientBlackBerry::receivedData(const char* data, int length, const String& textEncoding)
@@ -504,6 +506,8 @@ void FrameLoaderClientBlackBerry::dispatchDidStartProvisionalLoad()
if (m_webPagePrivate->m_dumpRenderTree)
m_webPagePrivate->m_dumpRenderTree->didStartProvisionalLoadForFrame(m_frame);
+
+ m_wasProvisionalLoadTriggeredByUserGesture = ScriptController::processingUserGesture();
}
void FrameLoaderClientBlackBerry::dispatchDidReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse& response)
@@ -547,6 +551,8 @@ void FrameLoaderClientBlackBerry::dispatchDidCommitLoad()
// SubstituteData in dispatchDidFailProvisionalLoad).
if (m_loadingErrorPage) {
m_loadingErrorPage = false;
+ if (HistoryItem* item = m_frame->loader()->history()->currentItem())
+ item->viewState().shouldSaveViewState = false;
m_webPagePrivate->m_client->notifyLoadFailedBeforeCommit(
originalUrl.characters(), originalUrl.length(),
url.characters(), url.length(), token.characters(), token.length());
@@ -1022,7 +1028,8 @@ void FrameLoaderClientBlackBerry::saveViewStateToItem(HistoryItem* item)
ASSERT(item);
HistoryItemViewState& viewState = item->viewState();
- if (viewState.shouldSaveViewState) {
+ m_shouldRestoreViewState = viewState.shouldSaveViewState;
+ if (m_shouldRestoreViewState) {
viewState.orientation = m_webPagePrivate->mainFrame()->orientation();
viewState.isZoomToFitScale = m_webPagePrivate->currentScale() == m_webPagePrivate->zoomToFitScale();
viewState.scale = m_webPagePrivate->currentScale();
@@ -1035,6 +1042,8 @@ void FrameLoaderClientBlackBerry::saveViewStateToItem(HistoryItem* item)
void FrameLoaderClientBlackBerry::restoreViewState()
{
+ if (!m_shouldRestoreViewState)
+ return;
if (!isMainFrame())
return;
@@ -1088,6 +1097,10 @@ void FrameLoaderClientBlackBerry::restoreViewState()
if (orientationChanged && viewState.isZoomToFitScale)
scale = BlackBerry::Platform::Graphics::Screen::primaryScreen()->width() * scale / static_cast<double>(BlackBerry::Platform::Graphics::Screen::primaryScreen()->height());
+ // Don't flash checkerboard before WebPagePrivate::restoreHistoryViewState() finished.
+ // This call will be balanced by BackingStorePrivate::resumeScreenAndBackingStoreUpdates() in WebPagePrivate::restoreHistoryViewState().
+ m_webPagePrivate->m_backingStore->d->suspendScreenAndBackingStoreUpdates();
+
// It is not safe to render the page at this point. So we post a message instead. Messages have higher priority than timers.
BlackBerry::Platform::webKitThreadMessageClient()->dispatchMessage(BlackBerry::Platform::createMethodCallMessage(
&WebPagePrivate::restoreHistoryViewState, m_webPagePrivate, contentsSize, scrollPosition, scale, viewState.shouldReflowBlock));
@@ -1248,4 +1261,22 @@ void FrameLoaderClientBlackBerry::dispatchDidLoadFromApplicationCache(const Reso
m_webPagePrivate->m_client->notifyDidLoadFromApplicationCache();
}
+PassRefPtr<SecurityOrigin> FrameLoaderClientBlackBerry::securityOriginForNewDocument(const KURL& url)
+{
+ // What we are trying to do here is to keep using the old path as origin when a file-based html page
+ // changes its location to some html in a subfolder. This will allow some file-based html packages
+ // to work smoothly even with security checks enabled.
+
+ RefPtr<SecurityOrigin> newSecurityOrigin = SecurityOrigin::create(url);
+
+ if (m_wasProvisionalLoadTriggeredByUserGesture || !url.isLocalFile())
+ return newSecurityOrigin;
+
+ RefPtr<SecurityOrigin> currentSecurityOrigin = m_frame->document()->securityOrigin();
+ if (currentSecurityOrigin && currentSecurityOrigin->containsInFolder(newSecurityOrigin.get()))
+ return currentSecurityOrigin;
+
+ return newSecurityOrigin;
+}
+
} // WebCore
diff --git a/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.h b/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.h
index ba6b7e405..1eefa2ab2 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.h
+++ b/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.h
@@ -170,6 +170,8 @@ public:
virtual PassRefPtr<FrameNetworkingContext> createNetworkingContext();
+ virtual PassRefPtr<SecurityOrigin> securityOriginForNewDocument(const KURL&);
+
void readyToRender(bool pageIsVisuallyNonEmpty);
void doPendingFragmentScroll();
@@ -215,6 +217,10 @@ private:
// Used to stop media files from loading because we don't need to have the entire file loaded by WebKit.
bool m_cancelLoadOnNextData;
+
+ bool m_wasProvisionalLoadTriggeredByUserGesture;
+
+ bool m_shouldRestoreViewState;
};
} // WebCore
diff --git a/Source/WebKit/blackberry/WebCoreSupport/GeolocationControllerClientBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/GeolocationControllerClientBlackBerry.cpp
index b337d0396..ad7eb1b79 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/GeolocationControllerClientBlackBerry.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/GeolocationControllerClientBlackBerry.cpp
@@ -47,7 +47,7 @@ void GeolocationControllerClientBlackBerry::startUpdating()
if (m_tracker)
m_tracker->resume();
else
- m_tracker = BlackBerry::Platform::GeoTracker::create(this, 0, m_accuracy, -1, -1);
+ m_tracker = BlackBerry::Platform::GeoTracker::create(this, m_accuracy);
}
void GeolocationControllerClientBlackBerry::stopUpdating()
@@ -101,9 +101,10 @@ void GeolocationControllerClientBlackBerry::setEnableHighAccuracy(bool newAccura
{
if (m_accuracy == newAccuracy)
return;
- if (m_tracker) {
- m_tracker->destroy();
- m_tracker = BlackBerry::Platform::GeoTracker::create(this, 0, newAccuracy, -1, -1);
- }
+
+ m_accuracy = newAccuracy;
+
+ if (m_tracker)
+ m_tracker->setRequiresHighAccuracy(m_accuracy);
}
diff --git a/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp b/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp
index ab362c492..4b69bd6d3 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp
@@ -44,6 +44,7 @@ SelectPopupClient::SelectPopupClient(bool multiple, int size, const ScopeArray<B
, m_size(size)
, m_webPage(webPage)
, m_element(element)
+ , m_notifyChangeTimer(this, &SelectPopupClient::notifySelectionChange)
{
generateHTML(multiple, size, labels, enableds, itemType, selecteds);
}
@@ -82,7 +83,7 @@ void SelectPopupClient::generateHTML(bool multiple, int size, const ScopeArray<B
// Add labels.
source.append("[");
for (int i = 0; i < size; i++) {
- source.append("'" + String(labels[i].impl()).replace("'", "\\'") + "'");
+ source.append("'" + String(labels[i].impl()).replace('\\', "\\\\").replace('\'', "\\'") + "'");
// Don't append ',' to last element.
if (i != size - 1)
source.append(", ");
@@ -173,10 +174,10 @@ void SelectPopupClient::setValueAndClosePopup(int, const String& stringValue)
}
// Force repaint because we do not send mouse events to the select element
// and the element doesn't automatically repaint itself.
- m_element->dispatchFormControlChangeEvent();
if (m_element->renderer())
m_element->renderer()->repaint();
- closePopup();
+
+ m_notifyChangeTimer.startOneShot(0);
}
void SelectPopupClient::didClosePopup()
@@ -192,5 +193,13 @@ void SelectPopupClient::writeDocument(DocumentWriter& writer)
writer.addData(m_source.utf8().data(), m_source.utf8().length());
writer.end();
}
+
+void SelectPopupClient::notifySelectionChange(WebCore::Timer<SelectPopupClient>*)
+{
+ if (m_element)
+ m_element->dispatchFormControlChangeEvent();
+ closePopup();
+}
+
}
diff --git a/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.h b/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.h
index fc2f446ba..17cc776dc 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.h
+++ b/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.h
@@ -22,6 +22,7 @@
#include "IntSize.h"
#include "PagePopupClient.h"
#include "ScopePointer.h"
+#include "Timer.h"
#include "WTFString.h"
#include "WebString.h"
@@ -44,6 +45,7 @@ public:
void update(bool multiple, int size, const ScopeArray<BlackBerry::WebKit::WebString>& labels, bool* enableds, const int* itemType, bool* selecteds, BlackBerry::WebKit::WebPagePrivate*, HTMLSelectElement*);
void generateHTML(bool multiple, int size, const ScopeArray<BlackBerry::WebKit::WebString>& labels, bool* enableds, const int* itemType, bool* selecteds);
+ void notifySelectionChange(WebCore::Timer<SelectPopupClient> *);
void writeDocument(DocumentWriter&);
virtual IntSize contentSize();
@@ -57,6 +59,7 @@ public:
String m_source;
BlackBerry::WebKit::WebPagePrivate* m_webPage;
HTMLSelectElement* m_element;
+ WebCore::Timer<SelectPopupClient> m_notifyChangeTimer;
};
} // namespace WebCore
#endif
diff --git a/Source/WebKit/blackberry/WebKitSupport/BackingStoreTile.cpp b/Source/WebKit/blackberry/WebKitSupport/BackingStoreTile.cpp
index 0897df6f8..2c8242cbb 100644
--- a/Source/WebKit/blackberry/WebKitSupport/BackingStoreTile.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/BackingStoreTile.cpp
@@ -29,7 +29,7 @@ namespace WebKit {
TileBuffer::TileBuffer(const Platform::IntSize& size)
: m_size(size)
- , m_syncObject(0)
+ , m_fence(Fence::create())
, m_buffer(0)
{
}
diff --git a/Source/WebKit/blackberry/WebKitSupport/BackingStoreTile.h b/Source/WebKit/blackberry/WebKitSupport/BackingStoreTile.h
index eb10809ea..69bf40aa2 100644
--- a/Source/WebKit/blackberry/WebKitSupport/BackingStoreTile.h
+++ b/Source/WebKit/blackberry/WebKitSupport/BackingStoreTile.h
@@ -21,6 +21,9 @@
#include "BlackBerryPlatformIntRectRegion.h"
#include "BlackBerryPlatformPrimitives.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
namespace BlackBerry {
namespace Platform {
@@ -29,6 +32,37 @@ struct Buffer;
}
}
+// Represents a fence that has been inserted into the command stream. You can wait on the corresponding platform sync
+// object to make sure that previous commands have been completed.
+// There is no reason to wait twice on the same platform sync object, so the only mechanism provided to access the sync
+// object will also clear it to prevent anyone from waiting again.
+// Fence is only refcounted on the compositing thread, so RefCounted will suffice, we don't need ThreadSafeRefCounted.
+class Fence : public RefCounted<Fence> {
+public:
+ static PassRefPtr<Fence> create(void* platformSync = 0)
+ {
+ return adoptRef(new Fence(platformSync));
+ }
+
+ // Returns 0 if this fence is stale (someone already waited on it)
+ // Otherwise returns the platform sync object and clears the sync
+ // object so no-one waits again.
+ void* takePlatformSync()
+ {
+ void* tmp = m_platformSync;
+ m_platformSync = 0;
+ return tmp;
+ }
+
+private:
+ Fence(void* platformSync)
+ : m_platformSync(platformSync)
+ {
+ }
+
+ void* m_platformSync;
+};
+
namespace WebKit {
class TileBuffer {
public:
@@ -47,13 +81,13 @@ class TileBuffer {
Platform::Graphics::Buffer* nativeBuffer() const;
- void* syncObject() const { return m_syncObject; }
- void setSyncObject(void* syncObject) { m_syncObject = syncObject; }
+ Fence* fence() const { return m_fence.get(); }
+ void setFence(PassRefPtr<Fence> fence) { m_fence = fence; }
private:
Platform::IntSize m_size;
Platform::IntRectRegion m_renderedRegion;
- void* m_syncObject;
+ RefPtr<Fence> m_fence;
mutable Platform::Graphics::Buffer* m_buffer;
};
diff --git a/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp b/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp
index 99411f01f..4b0ffbc52 100644
--- a/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp
@@ -198,6 +198,11 @@ AttributeState elementSupportsAutocomplete(const Element* element)
return elementAttributeState(element, HTMLNames::autocompleteAttr);
}
+AttributeState elementSupportsSpellCheck(const Element* element)
+{
+ return elementAttributeState(element, HTMLNames::spellcheckAttr);
+}
+
AttributeState elementAttributeState(const Element* element, const QualifiedName& attributeName)
{
// First we check the input item itself. If the attribute is not defined,
@@ -231,10 +236,7 @@ bool isTextBasedContentEditableElement(Element* element)
if (!element)
return false;
- if (element->isTextFormControl() && static_cast<HTMLTextFormControlElement*>(element)->readOnly())
- return false;
-
- if (!element->isEnabledFormControl())
+ if (element->isReadOnlyFormControl() || !element->isEnabledFormControl())
return false;
if (isPopupInputField(element))
@@ -427,7 +429,7 @@ bool elementPatternMatches(const char* pattern, const HTMLInputElement* inputEle
return true;
// Is the regex specifying a character count?
- if (patternAttribute[patternString.length()] != '{' || !patternAttribute.endsWith('}'))
+ if (patternAttribute[patternString.length()] != '{' || !patternAttribute.endsWith("}"))
return false;
// Make sure the number in the regex is actually a number.
diff --git a/Source/WebKit/blackberry/WebKitSupport/DOMSupport.h b/Source/WebKit/blackberry/WebKitSupport/DOMSupport.h
index 38699dc1f..5de7f731f 100644
--- a/Source/WebKit/blackberry/WebKitSupport/DOMSupport.h
+++ b/Source/WebKit/blackberry/WebKitSupport/DOMSupport.h
@@ -60,6 +60,7 @@ bool isColorInputField(const WebCore::Element*);
AttributeState elementAttributeState(const WebCore::Element*, const WebCore::QualifiedName&);
AttributeState elementSupportsAutocorrect(const WebCore::Element*);
AttributeState elementSupportsAutocomplete(const WebCore::Element*);
+AttributeState elementSupportsSpellCheck(const WebCore::Element*);
WTF::String inputElementText(WebCore::Element*);
diff --git a/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.cpp b/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.cpp
index 5b8eeb5b5..f06263ae7 100644
--- a/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.cpp
@@ -158,6 +158,13 @@ bool DefaultTapHighlight::showRepaintCounter(const GraphicsLayer* layer) const
return m_page->showRepaintCounter(layer);
}
+bool DefaultTapHighlight::contentsVisible(const GraphicsLayer*, const IntRect& contentRect) const
+{
+ // This layer is typically small enough that we can afford to cache all tiles and never
+ // risk checkerboarding.
+ return true;
+}
+
} // namespace WebKit
} // namespace BlackBerry
diff --git a/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.h b/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.h
index c04f6377c..a34070f47 100644
--- a/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.h
+++ b/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.h
@@ -58,6 +58,7 @@ public:
virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& inClip);
virtual bool showDebugBorders(const WebCore::GraphicsLayer*) const;
virtual bool showRepaintCounter(const WebCore::GraphicsLayer*) const;
+ virtual bool contentsVisible(const WebCore::GraphicsLayer*, const WebCore::IntRect& contentRect) const;
private:
DefaultTapHighlight(WebPagePrivate*);
diff --git a/Source/WebKit/blackberry/WebKitSupport/FrameLayers.cpp b/Source/WebKit/blackberry/WebKitSupport/FrameLayers.cpp
index b875646da..a49f594f2 100644
--- a/Source/WebKit/blackberry/WebKitSupport/FrameLayers.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/FrameLayers.cpp
@@ -119,6 +119,12 @@ void FrameLayers::calculateRootLayer()
m_rootLayer = 0;
}
+void FrameLayers::releaseLayerResources()
+{
+ if (m_rootLayer)
+ m_rootLayer->releaseLayerResources();
+}
+
} // namespace BlackBerry
} // namespace WebKit
diff --git a/Source/WebKit/blackberry/WebKitSupport/FrameLayers.h b/Source/WebKit/blackberry/WebKitSupport/FrameLayers.h
index b90138ba9..33ee35ede 100644
--- a/Source/WebKit/blackberry/WebKitSupport/FrameLayers.h
+++ b/Source/WebKit/blackberry/WebKitSupport/FrameLayers.h
@@ -57,6 +57,8 @@ public:
// But it's now also being called on the Compositing thread.
WebCore::LayerWebKitThread* rootLayer() const { return m_rootLayer; }
+ void releaseLayerResources();
+
private:
WebPagePrivate* m_pagePrivate;
OwnPtr<WebCore::GraphicsLayer> m_rootGraphicsLayer;
diff --git a/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.cpp b/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.cpp
index d42059e6a..18a750a89 100644
--- a/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.cpp
@@ -20,7 +20,6 @@
#include "InRegionScrollableArea.h"
#include "Frame.h"
-#include "LayerCompositingThread.h"
#include "LayerWebKitThread.h"
#include "RenderBox.h"
#include "RenderLayer.h"
@@ -41,6 +40,10 @@ InRegionScrollableArea::InRegionScrollableArea()
{
}
+InRegionScrollableArea::~InRegionScrollableArea()
+{
+}
+
InRegionScrollableArea::InRegionScrollableArea(WebPagePrivate* webPage, RenderLayer* layer)
: m_webPage(webPage)
, m_layer(layer)
@@ -90,7 +93,8 @@ InRegionScrollableArea::InRegionScrollableArea(WebPagePrivate* webPage, RenderLa
if (m_layer->usesCompositedScrolling()) {
m_supportsCompositedScrolling = true;
ASSERT(m_layer->backing()->hasScrollingLayer());
- m_cachedCompositedScrollableLayer = reinterpret_cast<unsigned>(m_layer->backing()->scrollingLayer()->platformLayer()->layerCompositingThread());
+ m_camouflagedCompositedScrollableLayer = reinterpret_cast<unsigned>(m_layer->backing()->scrollingLayer()->platformLayer());
+ m_cachedCompositedScrollableLayer = m_layer->backing()->scrollingLayer()->platformLayer();
}
m_overscrollLimitFactor = 0.0;
diff --git a/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.h b/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.h
index 1e8482951..679e490b5 100644
--- a/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.h
+++ b/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.h
@@ -24,6 +24,7 @@
#include <interaction/ScrollViewBase.h>
namespace WebCore {
+class LayerWebKitThread;
class RenderLayer;
}
@@ -37,6 +38,7 @@ public:
InRegionScrollableArea();
InRegionScrollableArea(WebPagePrivate*, WebCore::RenderLayer*);
+ virtual ~InRegionScrollableArea();
void setVisibleWindowRect(const WebCore::IntRect&);
Platform::IntRect visibleWindowRect() const;
@@ -46,6 +48,9 @@ public:
private:
WebPagePrivate* m_webPage;
WebCore::RenderLayer* m_layer;
+
+ RefPtr<WebCore::LayerWebKitThread> m_cachedCompositedScrollableLayer;
+
bool m_hasWindowVisibleRectCalculated;
};
diff --git a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
index 37d5d30ad..77f8ada84 100644
--- a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
@@ -50,27 +50,31 @@
#include "RenderText.h"
#include "RenderTextControl.h"
#include "RenderWidget.h"
+#include "RenderedDocumentMarker.h"
#include "ScopePointer.h"
#include "SelectPopupClient.h"
#include "SelectionHandler.h"
#include "SpellChecker.h"
#include "TextCheckerClient.h"
#include "TextIterator.h"
+#include "VisiblePosition.h"
#include "WebPageClient.h"
#include "WebPage_p.h"
#include "WebSettings.h"
+#include "visible_units.h"
#include <BlackBerryPlatformKeyboardEvent.h>
#include <BlackBerryPlatformLog.h>
#include <BlackBerryPlatformMisc.h>
#include <BlackBerryPlatformSettings.h>
-#include <imf/events.h>
#include <sys/keycodes.h>
#define ENABLE_INPUT_LOG 0
#define ENABLE_FOCUS_LOG 0
+#define ENABLE_SPELLING_LOG 0
static const unsigned MaxLearnTextDataSize = 500;
+static const unsigned MaxSpellCheckingStringLength = 250;
using namespace BlackBerry::Platform;
using namespace WebCore;
@@ -87,6 +91,12 @@ using namespace WebCore;
#define FocusLog(severity, format, ...)
#endif // ENABLE_FOCUS_LOG
+#if ENABLE_SPELLING_LOG
+#define SpellingLog(severity, format, ...) logAlways(severity, format, ## __VA_ARGS__)
+#else
+#define SpellingLog(severity, format, ...)
+#endif // ENABLE_SPELLING_LOG
+
namespace BlackBerry {
namespace WebKit {
@@ -450,7 +460,7 @@ static bool convertStringToWcharVector(const String& string, WTF::Vector<wchar_t
return true;
if (!wcharString.tryReserveCapacity(length + 1)) {
- logAlways(LogLevelCritical, "InputHandler::convertStringToWcharVector Cannot allocate memory for string.\n");
+ logAlways(LogLevelCritical, "InputHandler::convertStringToWcharVector Cannot allocate memory for string.");
return false;
}
@@ -470,7 +480,7 @@ static String convertSpannableStringToString(spannable_string_t* src)
WTF::Vector<UChar> dest;
int destCapacity = (src->length * 2) + 1;
if (!dest.tryReserveCapacity(destCapacity)) {
- logAlways(LogLevelCritical, "InputHandler::convertSpannableStringToString Cannot allocate memory for string.\n");
+ logAlways(LogLevelCritical, "InputHandler::convertSpannableStringToString Cannot allocate memory for string.");
return String();
}
@@ -524,28 +534,54 @@ void InputHandler::requestCheckingOfString(PassRefPtr<WebCore::TextCheckingReque
RefPtr<WebCore::TextCheckingRequest> request = textCheckingRequest;
int32_t sequenceId = request->sequence();
- int requestLength = request->text().length();
- if (!requestLength /* || requestLength > maxSpellCheckStringLength */) {
+
+ if (!isActiveTextEdit()) {
spellCheckingRequestCancelled(sequenceId, true /* isSequenceId */);
return;
}
+ // Check if field explicitly asked for spellchecking.
+ if (DOMSupport::elementSupportsSpellCheck(m_currentFocusElement.get()) != DOMSupport::On) {
+ spellCheckingRequestCancelled(sequenceId, true /* isSequenceId */);
+ return;
+ }
+
+ unsigned requestLength = request->text().length();
+
+ if (requestLength < 2) {
+ spellCheckingRequestCancelled(sequenceId, true /* isSequenceId */);
+ return;
+ }
+
+ if (requestLength > MaxSpellCheckingStringLength) {
+ // Cancel this request and send it off in newly created chunks.
+ spellCheckingRequestCancelled(sequenceId, true /* isSequenceId */);
+ if (m_currentFocusElement && m_currentFocusElement->document() && m_currentFocusElement->document()->frame() && m_currentFocusElement->document()->frame()->selection()) {
+ // Convert from position back to selection so we can expand the range to include the previous line. This should handle cases when the user hits
+ // enter to finish composing a word and create a new line.
+ VisiblePosition caretPosition = m_currentFocusElement->document()->frame()->selection()->start();
+ VisibleSelection visibleSelection = VisibleSelection(previousLinePosition(caretPosition, caretPosition.lineDirectionPointForBlockDirectionNavigation()), caretPosition);
+ spellCheckBlock(visibleSelection, TextCheckingProcessIncremental);
+ }
+ return;
+ }
+
wchar_t* checkingString = (wchar_t*)malloc(sizeof(wchar_t) * (requestLength + 1));
if (!checkingString) {
- BlackBerry::Platform::logAlways(BlackBerry::Platform::LogLevelCritical, "InputHandler::requestCheckingOfString Cannot allocate memory for string.");
+ logAlways(LogLevelCritical, "InputHandler::requestCheckingOfString Cannot allocate memory for string.");
spellCheckingRequestCancelled(sequenceId, true /* isSequenceId */);
return;
}
- int stringLength = 0;
- if (!convertStringToWchar(request->text(), checkingString, requestLength + 1, &stringLength)) {
- BlackBerry::Platform::logAlways(BlackBerry::Platform::LogLevelCritical, "InputHandler::requestCheckingOfString Failed to convert String to wchar type.");
+ int paragraphLength = 0;
+ if (!convertStringToWchar(request->text(), checkingString, requestLength + 1, &paragraphLength)) {
+ logAlways(LogLevelCritical, "InputHandler::requestCheckingOfString Failed to convert String to wchar type.");
free(checkingString);
spellCheckingRequestCancelled(sequenceId, true /* isSequenceId */);
return;
}
- int32_t transactionId = m_webPage->m_client->checkSpellingOfStringAsync(checkingString, stringLength);
+ int32_t transactionId = m_webPage->m_client->checkSpellingOfStringAsync(checkingString, paragraphLength);
free(checkingString);
// If the call to the input service did not go through, then cancel the request so we don't block endlessly.
@@ -613,13 +649,20 @@ void InputHandler::spellCheckingRequestProcessed(int32_t transactionId, spannabl
// transactionId here is for use with the input service. We need to translate this to sequenceId used with SpellChecker.
int32_t sequenceId = convertTransactionIdToSequenceId(transactionId);
- SpellChecker* sp = getSpellChecker();
- if (!sp || !sequenceId) {
- InputLog(LogLevelWarn, "InputHandler::spellCheckingRequestProcessed failed to process the request with sequenceId %d", sequenceId);
+ SpellChecker* spellChecker = getSpellChecker();
+ if (!spellChecker || !sequenceId) {
+ SpellingLog(LogLevelWarn, "InputHandler::spellCheckingRequestProcessed Failed to process the request with sequenceId %d", sequenceId);
spellCheckingRequestCancelled(sequenceId, true /* isSequenceId */);
return;
}
- sp->didCheckSucceeded(sequenceId, results);
+ spellChecker->didCheckSucceeded(sequenceId, results);
+}
+
+void InputHandler::cancelAllSpellCheckingRequests()
+{
+ for (std::map<int32_t, int32_t>::iterator it = m_sequenceMap.begin(); it != m_sequenceMap.end(); ++it)
+ spellCheckingRequestCancelled(it->second, true /* isSequenceId */);
+ m_sequenceMap.clear();
}
void InputHandler::spellCheckingRequestCancelled(int32_t id, bool isSequenceId)
@@ -628,12 +671,12 @@ void InputHandler::spellCheckingRequestCancelled(int32_t id, bool isSequenceId)
return;
int32_t sequenceId = isSequenceId ? id : convertTransactionIdToSequenceId(id);
- SpellChecker* sp = getSpellChecker();
- if (!sp) {
- InputLog(LogLevelWarn, "InputHandler::spellCheckingRequestCancelled failed to cancel the request with sequenceId %d", sequenceId);
+ SpellChecker* spellChecker = getSpellChecker();
+ if (!spellChecker) {
+ SpellingLog(LogLevelWarn, "InputHandler::spellCheckingRequestCancelled failed to cancel the request with sequenceId %d", sequenceId);
return;
}
- sp->didCheckCanceled(sequenceId);
+ spellChecker->didCheckCanceled(sequenceId);
}
SpellChecker* InputHandler::getSpellChecker()
@@ -648,6 +691,50 @@ SpellChecker* InputHandler::getSpellChecker()
return 0;
}
+bool InputHandler::shouldRequestSpellCheckingOptionsForPoint(Platform::IntPoint& point, const Element* touchedElement, imf_sp_text_t& spellCheckingOptionRequest)
+{
+ if (!isActiveTextEdit() || touchedElement != m_currentFocusElement)
+ return false;
+
+ LayoutPoint contentPos(m_webPage->mapFromViewportToContents(point));
+ contentPos = DOMSupport::convertPointToFrame(m_webPage->mainFrame(), m_webPage->focusedOrMainFrame(), roundedIntPoint(contentPos));
+
+ Document* document = m_currentFocusElement->document();
+ ASSERT(document);
+
+ RenderedDocumentMarker* marker = document->markers()->renderedMarkerContainingPoint(contentPos, DocumentMarker::Spelling);
+ if (!marker)
+ return false;
+
+ SpellingLog(LogLevelInfo, "InputHandler::shouldRequestSpellCheckingOptionsForPoint Found spelling marker at point %d, %d", point.x(), point.y());
+
+ // imf_sp_text_t should be generated in pixel viewport coordinates.
+ WebCore::IntRect rect = m_webPage->mapToTransformed(m_webPage->focusedOrMainFrame()->view()->contentsToWindow(enclosingIntRect(marker->renderedRect())));
+ m_webPage->clipToTransformedContentsRect(rect);
+
+ // TODO use the actual caret position after it is placed.
+ spellCheckingOptionRequest.caret_rect.caret_top_x = point.x();
+ spellCheckingOptionRequest.caret_rect.caret_top_y = rect.y();
+ spellCheckingOptionRequest.caret_rect.caret_bottom_x = point.x();
+ spellCheckingOptionRequest.caret_rect.caret_bottom_y = rect.y() + rect.height();
+ spellCheckingOptionRequest.startTextPosition = marker->startOffset();
+ spellCheckingOptionRequest.endTextPosition = marker->endOffset();
+
+ return true;
+}
+
+void InputHandler::requestSpellingCheckingOptions(imf_sp_text_t& spellCheckingOptionRequest)
+{
+ SpellingLog(LogLevelInfo, "InputHandler::requestSpellingCheckingOptions Sending request:\ncaret_rect.caret_top_x = %d\ncaret_rect.caret_top_y = %d" \
+ "\ncaret_rect.caret_bottom_x = %d\ncaret_rect.caret_bottom_y = %d\nstartTextPosition = %d\nendTextPosition = %d",
+ spellCheckingOptionRequest.caret_rect.caret_top_x, spellCheckingOptionRequest.caret_rect.caret_top_y,
+ spellCheckingOptionRequest.caret_rect.caret_bottom_x, spellCheckingOptionRequest.caret_rect.caret_bottom_y,
+ spellCheckingOptionRequest.startTextPosition, spellCheckingOptionRequest.endTextPosition);
+
+ if (spellCheckingOptionRequest.startTextPosition || spellCheckingOptionRequest.endTextPosition)
+ m_webPage->m_client->requestSpellingCheckingOptions(spellCheckingOptionRequest);
+}
+
void InputHandler::setElementUnfocused(bool refocusOccuring)
{
if (isActiveTextEdit()) {
@@ -668,6 +755,9 @@ void InputHandler::setElementUnfocused(bool refocusOccuring)
// If the frame selection isn't focused, focus it.
if (!m_currentFocusElement->document()->frame()->selection()->isFocused())
m_currentFocusElement->document()->frame()->selection()->setFocused(true);
+
+ // Cancel any spellcheck requests that might be ongoing.
+ cancelAllSpellCheckingRequests();
}
// Clear the node details.
@@ -697,10 +787,22 @@ void InputHandler::setInputModeEnabled(bool active)
void InputHandler::setElementFocused(Element* element)
{
ASSERT(DOMSupport::isTextBasedContentEditableElement(element));
- ASSERT(element->document() && element->document()->frame());
+ ASSERT(element && element->document() && element->document()->frame());
- if (element->document()->frame()->selection()->isFocused() != isInputModeEnabled())
- element->document()->frame()->selection()->setFocused(isInputModeEnabled());
+#ifdef ENABLE_SPELLING_LOG
+ BlackBerry::Platform::StopWatch timer;
+ timer.start();
+#endif
+
+ if (!element || !(element->document()))
+ return;
+
+ Frame* frame = element->document()->frame();
+ if (!frame)
+ return;
+
+ if (frame->selection()->isFocused() != isInputModeEnabled())
+ frame->selection()->setFocused(isInputModeEnabled());
// Clear the existing focus node details.
setElementUnfocused(true /*refocusOccuring*/);
@@ -716,6 +818,14 @@ void InputHandler::setElementFocused(Element* element)
VirtualKeyboardType keyboardType = keyboardTypeAttribute(element);
VirtualKeyboardEnterKeyType enterKeyType = keyboardEnterKeyTypeAttribute(element);
+ if (enterKeyType == VKBEnterKeyNotSet && type != InputTypeTextArea) {
+ if (element->isFormControlElement()) {
+ const HTMLFormControlElement* formElement = static_cast<const HTMLFormControlElement*>(element);
+ if (formElement->form() && formElement->form()->defaultButton())
+ enterKeyType = VKBEnterKeySubmit;
+ }
+ }
+
FocusLog(LogLevelInfo, "InputHandler::setElementFocused, Type=%d, Style=%d, Keyboard Type=%d, Enter Key=%d", type, m_currentFocusElementTextEditMask, keyboardType, enterKeyType);
m_webPage->m_client->inputFocusGained(type, m_currentFocusElementTextEditMask, keyboardType, enterKeyType);
@@ -723,6 +833,91 @@ void InputHandler::setElementFocused(Element* element)
if (!m_delayKeyboardVisibilityChange)
notifyClientOfKeyboardVisibilityChange(true);
+
+#ifdef ENABLE_SPELLING_LOG
+ SpellingLog(LogLevelInfo, "InputHandler::setElementFocused Focusing the field took %f seconds.", timer.elapsed());
+#endif
+
+ // Check if the field explicitly asks for spellchecking.
+ if (DOMSupport::elementSupportsSpellCheck(element) != DOMSupport::On)
+ return;
+
+ // Spellcheck the field in its entirety.
+ VisibleSelection focusedBlock = DOMSupport::visibleSelectionForInputElement(element);
+ spellCheckBlock(focusedBlock, TextCheckingProcessBatch);
+
+#ifdef ENABLE_SPELLING_LOG
+ SpellingLog(LogLevelInfo, "InputHandler::setElementFocused Spellchecking the field increased the total time to focus to %f seconds.", timer.elapsed());
+#endif
+}
+
+void InputHandler::spellCheckBlock(VisibleSelection& visibleSelection, TextCheckingProcessType textCheckingProcessType)
+{
+ if (!isActiveTextEdit())
+ return;
+
+ SpellChecker* spellChecker = getSpellChecker();
+ if (!spellChecker) {
+ SpellingLog(LogLevelInfo, "InputHandler::spellCheckBlock Failed to spellcheck the current focused element.");
+ return;
+ }
+
+ RefPtr<Range> rangeForSpellChecking = visibleSelection.toNormalizedRange();
+
+ // If we have a batch request, try to send off the entire block.
+ if (textCheckingProcessType == TextCheckingProcessBatch) {
+ // If total block text is under the limited amount, send the entire chunk.
+ if (rangeForSpellChecking->text().length() < MaxSpellCheckingStringLength) {
+ spellChecker->requestCheckingFor(SpellCheckRequest::create(TextCheckingTypeSpelling, TextCheckingProcessBatch, rangeForSpellChecking, rangeForSpellChecking));
+ return;
+ }
+ }
+
+ // Since we couldn't check the entire block at once, set up starting and ending markers to fire incrementally.
+ VisiblePosition startPos = visibleSelection.visibleStart();
+ VisiblePosition startOfCurrentLine = startOfLine(startPos);
+ VisiblePosition endOfCurrentLine = endOfLine(startPos);
+
+ while (startOfCurrentLine != endOfCurrentLine) {
+ // Create a selection with the start and end points of the line, and convert to Range to create a SpellCheckRequest.
+ rangeForSpellChecking = VisibleSelection(startOfCurrentLine, endOfCurrentLine).toNormalizedRange();
+
+ if (rangeForSpellChecking->text().length() >= MaxSpellCheckingStringLength) {
+ // Iterate through words from the start of the line to the end.
+ rangeForSpellChecking = getRangeForSpellCheckWithFineGranularity(startOfCurrentLine, endOfCurrentLine);
+ if (!rangeForSpellChecking) {
+ SpellingLog(LogLevelWarn, "InputHandler::spellCheckBlock Failed to set text range for spellchecking");
+ return;
+ }
+ startOfCurrentLine = VisiblePosition(rangeForSpellChecking->endPosition());
+ } else {
+ startOfCurrentLine = nextLinePosition(startOfCurrentLine, startOfCurrentLine.lineDirectionPointForBlockDirectionNavigation());
+ endOfCurrentLine = endOfLine(startOfCurrentLine);
+ // If we are at the last line, nextLinePosition will return the position at the end of the line. If we're not at the end, wrap with a call to startOfLine to be safe.
+ if (startOfCurrentLine != endOfCurrentLine)
+ startOfCurrentLine = startOfLine(startOfCurrentLine);
+ }
+
+ SpellingLog(LogLevelInfo, "InputHandler::spellCheckBlock Substring text is '%s', of size %d", rangeForSpellChecking->text().latin1().data(), rangeForSpellChecking->text().length());
+
+ // Call spellcheck with substring.
+ spellChecker->requestCheckingFor(SpellCheckRequest::create(TextCheckingTypeSpelling, TextCheckingProcessBatch, rangeForSpellChecking, rangeForSpellChecking));
+ }
+}
+
+PassRefPtr<Range> InputHandler::getRangeForSpellCheckWithFineGranularity(VisiblePosition startPosition, VisiblePosition endPosition)
+{
+ VisiblePosition endOfCurrentWord = endOfWord(startPosition);
+ RefPtr<Range> rangeForSpellChecking;
+ while (endOfCurrentWord != endPosition) {
+ rangeForSpellChecking = VisibleSelection(startPosition, endOfCurrentWord).toNormalizedRange();
+ // If we exceed the MaxSpellCheckingStringLength limit, then go back one word and return this range.
+ if (rangeForSpellChecking->text().length() >= MaxSpellCheckingStringLength)
+ return VisibleSelection(startPosition, endOfWord(previousWordPosition(endOfCurrentWord))).toNormalizedRange();
+
+ endOfCurrentWord = endOfWord(nextWordPosition(endOfCurrentWord));
+ }
+ return 0;
}
bool InputHandler::openDatePopup(HTMLInputElement* element, BlackBerryInputType type)
@@ -1601,14 +1796,14 @@ spannable_string_t* InputHandler::spannableTextInRange(int start, int end, int32
// crash immediately on failure.
pst->str = (wchar_t*)malloc(sizeof(wchar_t) * (length + 1));
if (!pst->str) {
- logAlways(LogLevelCritical, "InputHandler::spannableTextInRange Cannot allocate memory for string.\n");
+ logAlways(LogLevelCritical, "InputHandler::spannableTextInRange Cannot allocate memory for string.");
free(pst);
return 0;
}
int stringLength = 0;
if (!convertStringToWchar(textString, pst->str, length + 1, &stringLength)) {
- logAlways(LogLevelCritical, "InputHandler::spannableTextInRange failed to convert string.\n");
+ logAlways(LogLevelCritical, "InputHandler::spannableTextInRange failed to convert string.");
free(pst->str);
free(pst);
return 0;
@@ -1817,7 +2012,7 @@ bool InputHandler::setText(spannable_string_t* spannableString)
String textToInsert = convertSpannableStringToString(spannableString);
int textLength = textToInsert.length();
- InputLog(LogLevelInfo, "InputHandler::setText spannableString is '%s', of length %d \n", textToInsert.latin1().data(), textLength);
+ InputLog(LogLevelInfo, "InputHandler::setText spannableString is '%s', of length %d", textToInsert.latin1().data(), textLength);
span_t* changedSpan = firstSpanInString(spannableString, CHANGED_ATTRIB);
int composingTextStart = m_composingTextStart;
@@ -1826,12 +2021,13 @@ bool InputHandler::setText(spannable_string_t* spannableString)
removeAttributedTextMarker();
if (isTrailingSingleCharacter(changedSpan, textLength, composingTextLength)) {
- // Handle the case where text is being composed.
- if (firstSpanInString(spannableString, COMPOSED_TEXT_ATTRIB)) {
- InputLog(LogLevelInfo, "InputHandler::setText Single trailing character detected. Text is being composed. \n");
+ // If the text is unconverted, do not allow JS processing as it is not a "real"
+ // character in the field.
+ if (firstSpanInString(spannableString, UNCONVERTED_TEXT_ATTRIB)) {
+ InputLog(LogLevelInfo, "InputHandler::setText Single trailing character detected. Text is unconverted.");
return editor->command("InsertText").execute(textToInsert.right(1));
}
- InputLog(LogLevelInfo, "InputHandler::setText Single trailing character detected. Text is not being composed. \n");
+ InputLog(LogLevelInfo, "InputHandler::setText Single trailing character detected.");
return handleKeyboardInput(Platform::KeyboardEvent(textToInsert[textLength - 1], Platform::KeyboardEvent::KeyChar, 0), false /* changeIsPartOfComposition */);
}
@@ -1839,12 +2035,12 @@ bool InputHandler::setText(spannable_string_t* spannableString)
if (!changedSpan) {
// If the composition length is the same as our string length, then we don't need to do anything.
if (composingTextLength == textLength) {
- InputLog(LogLevelInfo, "InputHandler::setText No spans have changed. New text is the same length as the old. Nothing to do. \n");
+ InputLog(LogLevelInfo, "InputHandler::setText No spans have changed. New text is the same length as the old. Nothing to do.");
return true;
}
if (composingTextLength - textLength == 1) {
- InputLog(LogLevelInfo, "InputHandler::setText No spans have changed. New text is one character shorter than the old. Treating as 'delete'. \n");
+ InputLog(LogLevelInfo, "InputHandler::setText No spans have changed. New text is one character shorter than the old. Treating as 'delete'.");
return editor->command("DeleteBackward").execute();
}
}
@@ -1877,7 +2073,7 @@ bool InputHandler::setText(spannable_string_t* spannableString)
if (textLength == 1 && !spannableString->spans_count) {
// Handle single key non-attributed entry as key press rather than insert to allow
// triggering of javascript events.
- InputLog(LogLevelInfo, "InputHandler::setText Single character entry treated as key-press in the absense of spans. \n");
+ InputLog(LogLevelInfo, "InputHandler::setText Single character entry treated as key-press in the absense of spans.");
return handleKeyboardInput(Platform::KeyboardEvent(textToInsert[0], Platform::KeyboardEvent::KeyChar, 0), true /* changeIsPartOfComposition */);
}
@@ -1959,7 +2155,7 @@ bool InputHandler::setRelativeCursorPosition(int insertionPoint, int relativeCur
bool InputHandler::setSpannableTextAndRelativeCursor(spannable_string_t* spannableString, int relativeCursorPosition, bool markTextAsComposing)
{
- InputLog(LogLevelInfo, "InputHandler::setSpannableTextAndRelativeCursor(%d, %d, %d)\n", spannableString->length, relativeCursorPosition, markTextAsComposing);
+ InputLog(LogLevelInfo, "InputHandler::setSpannableTextAndRelativeCursor(%d, %d, %d)", spannableString->length, relativeCursorPosition, markTextAsComposing);
int insertionPoint = compositionActive() ? m_composingTextStart : selectionStart();
ProcessingChangeGuard guard(this);
diff --git a/Source/WebKit/blackberry/WebKitSupport/InputHandler.h b/Source/WebKit/blackberry/WebKitSupport/InputHandler.h
index e492c607f..869cfc273 100644
--- a/Source/WebKit/blackberry/WebKitSupport/InputHandler.h
+++ b/Source/WebKit/blackberry/WebKitSupport/InputHandler.h
@@ -19,8 +19,11 @@
#ifndef InputHandler_h
#define InputHandler_h
+#include "TextChecking.h"
+
#include <BlackBerryPlatformInputEvents.h>
+#include <imf/events.h>
#include <imf/input_data.h>
#include <map>
#include <wtf/RefPtr.h>
@@ -37,13 +40,17 @@ class HTMLInputElement;
class HTMLSelectElement;
class IntRect;
class Node;
+class Range;
class SpellChecker;
class TextCheckingRequest;
+class VisiblePosition;
+class VisibleSelection;
}
namespace BlackBerry {
namespace Platform {
+class IntPoint;
class KeyboardEvent;
}
@@ -128,6 +135,9 @@ public:
void spellCheckingRequestProcessed(int32_t transactionId, spannable_string_t*);
void spellCheckingRequestCancelled(int32_t id, bool isSequenceId = false);
+ bool shouldRequestSpellCheckingOptionsForPoint(Platform::IntPoint&, const WebCore::Element*, imf_sp_text_t&);
+ void requestSpellingCheckingOptions(imf_sp_text_t&);
+
private:
enum PendingKeyboardStateChange { NoChange, Visible, NotVisible };
@@ -184,6 +194,9 @@ private:
void learnText();
void sendLearnTextDetails(const WTF::String&);
int32_t convertTransactionIdToSequenceId(int32_t transactionId);
+ void spellCheckBlock(WebCore::VisibleSelection&, WebCore::TextCheckingProcessType);
+ PassRefPtr<WebCore::Range> getRangeForSpellCheckWithFineGranularity(WebCore::VisiblePosition startPosition, WebCore::VisiblePosition endPosition);
+ void cancelAllSpellCheckingRequests();
WebCore::SpellChecker* getSpellChecker();
WebPagePrivate* m_webPage;
diff --git a/Source/WebKit/blackberry/WebKitSupport/SurfacePool.cpp b/Source/WebKit/blackberry/WebKitSupport/SurfacePool.cpp
index e4c99ed7b..3a09b8c42 100644
--- a/Source/WebKit/blackberry/WebKitSupport/SurfacePool.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/SurfacePool.cpp
@@ -234,31 +234,24 @@ void SurfacePool::waitForBuffer(TileBuffer* tileBuffer)
return;
#if BLACKBERRY_PLATFORM_GRAPHICS_EGL
- EGLSyncKHR syncObject;
+ EGLSyncKHR platformSync;
{
Platform::MutexLocker locker(&m_mutex);
- syncObject = tileBuffer->syncObject();
- if (!syncObject)
- return;
-
- // Stale references to this sync object may remain with other tiles, don't wait for it again.
- for (unsigned int i = 0; i < m_tilePool.size(); ++i) {
- TileBuffer* tileBuffer = m_tilePool[i]->frontBuffer();
- if (tileBuffer->syncObject() == syncObject)
- tileBuffer->setSyncObject(0);
- }
- if (backBuffer()->syncObject() == syncObject)
- backBuffer()->setSyncObject(0);
+ platformSync = tileBuffer->fence()->takePlatformSync();
}
- eglClientWaitSyncKHR(Platform::Graphics::eglDisplay(), syncObject, 0, 100000000LL);
+ if (!platformSync)
+ return;
+
+ if (!eglClientWaitSyncKHR(Platform::Graphics::eglDisplay(), platformSync, 0, 100000000LL))
+ Platform::logAlways(Platform::LogLevelWarn, "Failed to wait for EGLSyncKHR object!\n");
// Instead of assuming eglDestroySyncKHR is thread safe, we add it to
// a garbage list for later collection on the thread that created it.
{
Platform::MutexLocker locker(&m_mutex);
- m_syncObjectsToDestroy.insert(syncObject);
+ m_garbage.insert(platformSync);
}
#endif
}
@@ -275,21 +268,23 @@ void SurfacePool::notifyBuffersComposited(const Vector<TileBuffer*>& tileBuffers
// The EGL_KHR_fence_sync spec is nice enough to specify that the sync object
// is not actually deleted until everyone has stopped using it.
- for (std::set<void*>::const_iterator it = m_syncObjectsToDestroy.begin(); it != m_syncObjectsToDestroy.end(); ++it)
+ for (std::set<void*>::const_iterator it = m_garbage.begin(); it != m_garbage.end(); ++it)
eglDestroySyncKHR(display, *it);
- m_syncObjectsToDestroy.clear();
+ m_garbage.clear();
- // If we didn't blit anything, we don't need to create a new sync object.
+ // If we didn't blit anything, we don't need to create a new fence.
if (tileBuffers.isEmpty())
return;
- EGLSyncKHR syncObject = eglCreateSyncKHR(display, EGL_SYNC_FENCE_KHR, 0);
-
+ // Create a new fence and assign to the tiles that were blit. Invalidate any previous
+ // fence that may be active among these tiles and add its sync object to the garbage set
+ // for later destruction to make sure it doesn't leak.
+ RefPtr<Fence> fence = Fence::create(eglCreateSyncKHR(display, EGL_SYNC_FENCE_KHR, 0));
for (unsigned int i = 0; i < tileBuffers.size(); ++i) {
- if (EGLSyncKHR previousSyncObject = tileBuffers[i]->syncObject())
- m_syncObjectsToDestroy.insert(previousSyncObject);
+ if (EGLSyncKHR platformSync = tileBuffers[i]->fence()->takePlatformSync())
+ m_garbage.insert(platformSync);
- tileBuffers[i]->setSyncObject(syncObject);
+ tileBuffers[i]->setFence(fence);
}
#endif
}
diff --git a/Source/WebKit/blackberry/WebKitSupport/SurfacePool.h b/Source/WebKit/blackberry/WebKitSupport/SurfacePool.h
index 1c50df81b..40788fab6 100644
--- a/Source/WebKit/blackberry/WebKitSupport/SurfacePool.h
+++ b/Source/WebKit/blackberry/WebKitSupport/SurfacePool.h
@@ -99,7 +99,7 @@ private:
bool m_initialized; // SurfacePool has been set up, with or without buffers.
bool m_buffersSuspended; // Buffer objects exist, but pixel memory has been freed.
- std::set<void*> m_syncObjectsToDestroy;
+ std::set<void*> m_garbage;
bool m_hasFenceExtension;
mutable pthread_mutex_t m_mutex;
};
diff --git a/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp b/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp
index 492aeaa36..ee3a75f32 100644
--- a/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp
@@ -42,7 +42,6 @@
#include "RenderLayer.h"
#include "RenderTheme.h"
#include "RenderView.h"
-#include "RenderedDocumentMarker.h"
#include "SelectionHandler.h"
#include "WebPage_p.h"
#include "WebTapHighlight.h"
@@ -197,6 +196,9 @@ bool TouchEventHandler::handleTouchPoint(Platform::TouchPoint& point, bool useFa
Element* possibleTargetNodeForMouseMoveEvents = static_cast<Element*>(m_lastFatFingersResult.positionWasAdjusted() ? elementUnderFatFinger : m_lastFatFingersResult.node());
m_convertTouchToMouse = pureWithMouseConversion ? true : shouldConvertTouchToMouse(possibleTargetNodeForMouseMoveEvents);
+ if (!possibleTargetNodeForMouseMoveEvents || (!possibleTargetNodeForMouseMoveEvents->hasEventListeners(eventNames().touchmoveEvent) && !m_convertTouchToMouse))
+ m_webPage->client()->notifyNoMouseMoveOrTouchMoveHandlers();
+
if (elementUnderFatFinger)
drawTapHighlight();
@@ -214,7 +216,12 @@ bool TouchEventHandler::handleTouchPoint(Platform::TouchPoint& point, bool useFa
}
case Platform::TouchPoint::TouchReleased:
{
- unsigned spellLength = spellCheck(point);
+ imf_sp_text_t spellCheckOptionRequest;
+ bool shouldRequestSpellCheckOptions = false;
+
+ if (m_lastFatFingersResult.isTextInput())
+ shouldRequestSpellCheckOptions = m_webPage->m_inputHandler->shouldRequestSpellCheckingOptionsForPoint(point.m_pos, m_lastFatFingersResult.nodeAsElementIfApplicable(), spellCheckOptionRequest);
+
// Apply any suppressed changes. This does not eliminate the need
// for the show after the handling of fat finger pressed as it may
// have triggered a state change.
@@ -240,11 +247,8 @@ bool TouchEventHandler::handleTouchPoint(Platform::TouchPoint& point, bool useFa
PlatformMouseEvent mouseEvent(adjustedPoint, m_lastScreenPoint, PlatformEvent::MouseReleased, 1, LeftButton, TouchScreen);
m_webPage->handleMouseEvent(mouseEvent);
m_lastFatFingersResult.reset(); // Reset the fat finger result as its no longer valid when a user's finger is not on the screen.
- if (spellLength) {
- unsigned end = m_webPage->m_inputHandler->caretPosition();
- unsigned start = end - spellLength;
- m_webPage->m_client->requestSpellingSuggestionsForString(start, end);
- }
+ if (shouldRequestSpellCheckOptions)
+ m_webPage->m_inputHandler->requestSpellingCheckingOptions(spellCheckOptionRequest);
return true;
}
case Platform::TouchPoint::TouchMoved:
@@ -264,31 +268,6 @@ bool TouchEventHandler::handleTouchPoint(Platform::TouchPoint& point, bool useFa
return false;
}
-unsigned TouchEventHandler::spellCheck(Platform::TouchPoint& touchPoint)
-{
- Element* elementUnderFatFinger = m_lastFatFingersResult.nodeAsElementIfApplicable();
- if (!m_lastFatFingersResult.isTextInput() || !elementUnderFatFinger)
- return 0;
-
- LayoutPoint contentPos(m_webPage->mapFromViewportToContents(touchPoint.m_pos));
- contentPos = DOMSupport::convertPointToFrame(m_webPage->mainFrame(), m_webPage->focusedOrMainFrame(), contentPos);
-
- Document* document = elementUnderFatFinger->document();
- ASSERT(document);
- RenderedDocumentMarker* marker = document->markers()->renderedMarkerContainingPoint(contentPos, DocumentMarker::Spelling);
- if (!marker)
- return 0;
-
- IntRect rect = marker->renderedRect();
- LayoutPoint newContentPos = LayoutPoint(rect.x() + rect.width(), rect.y() + rect.height() / 2);
- Frame* frame = m_webPage->focusedOrMainFrame();
- if (frame != m_webPage->mainFrame())
- newContentPos = m_webPage->mainFrame()->view()->windowToContents(frame->view()->contentsToWindow(newContentPos));
- m_lastFatFingersResult.m_adjustedPosition = newContentPos;
- m_lastFatFingersResult.m_positionWasAdjusted = true;
- return marker->endOffset() - marker->startOffset();
-}
-
void TouchEventHandler::handleFatFingerPressed()
{
if (!m_didCancelTouch) {
@@ -369,7 +348,7 @@ void TouchEventHandler::drawTapHighlight()
IntPoint framePos(m_webPage->frameOffset(elementFrame));
// FIXME: We can get more precise on the <map> case by calculating the rect with HTMLAreaElement::computeRect().
- IntRect absoluteRect = renderer->absoluteClippedOverflowRect();
+ IntRect absoluteRect(renderer->absoluteClippedOverflowRect());
absoluteRect.move(framePos.x(), framePos.y());
IntRect clippingRect;
diff --git a/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.h b/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.h
index 91c7f160e..bce187dfa 100644
--- a/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.h
+++ b/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.h
@@ -45,7 +45,6 @@ public:
void resetLastFatFingersResult() { m_lastFatFingersResult.reset(); }
private:
- unsigned spellCheck(Platform::TouchPoint&);
void handleFatFingerPressed();
void drawTapHighlight();
diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog
index 3d9ea37fa..3d42baa97 100644
--- a/Source/WebKit/chromium/ChangeLog
+++ b/Source/WebKit/chromium/ChangeLog
@@ -1,3 +1,1717 @@
+2012-08-20 Kent Tamura <tkent@chromium.org>
+
+ [Chromium-win] Use native digits in parsing/formatting dates in the textfield part of input[type=date]
+ https://bugs.webkit.org/show_bug.cgi?id=94281
+
+ Reviewed by Hajime Morita.
+
+ * tests/LocaleWinTest.cpp:
+ (TEST_F): Added formatting and parsing tests for Persian locale to check
+ native digit behavior.
+
+2012-08-20 Kent Tamura <tkent@chromium.org>
+
+ [Chromium] Make the popup positioning code testable
+ https://bugs.webkit.org/show_bug.cgi?id=94086
+
+ Reviewed by Hajime Morita.
+
+ * WebKit.gypi: Add PopupContainerTest.cpp.
+ * tests/PopupContainerTest.cpp: Added.
+ (MockPopupContent):
+ (calculatePosition):
+ (TEST):
+
+2012-08-20 Scott Graham <scottmg@chromium.org>
+
+ [Chromium] Fix warnings on Windows builds
+ https://bugs.webkit.org/show_bug.cgi?id=94543
+
+ Reviewed by Adrienne Walker.
+
+ * tests/CCMathUtilTest.cpp:
+
+2012-08-20 Adam Klein <adamk@chromium.org>
+
+ Allow MutationEvents to be enabled/disabled per context
+ https://bugs.webkit.org/show_bug.cgi?id=94016
+
+ Reviewed by Ojan Vafai.
+
+ Add Chromium/WebKit API for enabling/disabling MutationEvents via
+ WebPermissionClient.
+
+ * public/WebPermissionClient.h:
+ (WebPermissionClient):
+ (WebKit::WebPermissionClient::allowMutationEvents):
+ * src/ContextFeaturesClientImpl.cpp:
+ (WebKit::ContextFeaturesClientImpl::askIfIsEnabled):
+
+2012-08-20 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r126095.
+ http://trac.webkit.org/changeset/126095
+ https://bugs.webkit.org/show_bug.cgi?id=94555
+
+ Breaks compilation of downstream WebWidget::paint
+ implementations (Requested by jamesr on #webkit).
+
+ * public/WebWidget.h:
+ (WebKit::WebWidget::paint):
+ * src/WebPagePopupImpl.cpp:
+ (WebKit::WebPagePopupImpl::paint):
+ * src/WebPagePopupImpl.h:
+ (WebPagePopupImpl):
+ * src/WebPopupMenuImpl.cpp:
+ (WebKit::WebPopupMenuImpl::paint):
+ * src/WebPopupMenuImpl.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::paint):
+ * src/WebViewImpl.h:
+ (WebViewImpl):
+
+2012-08-20 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move instrumentedCallFunction() from V8Proxy to ScriptController
+ https://bugs.webkit.org/show_bug.cgi?id=94456
+
+ Reviewed by Adam Barth.
+
+ To kill V8Proxy, this patch moves instrumentedCallFunction() from V8Proxy
+ to ScriptController. Also this patch renames instrumentedCallFunction()
+ to callFunctionWithInstrumentation(), for consistency with callFunction().
+
+ No tests. No change in behavior.
+
+ * src/WebDevToolsFrontendImpl.cpp:
+ (WebKit::WebDevToolsFrontendImpl::dispatchOnInspectorFrontend):
+
+2012-08-20 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move retrieve{Window,Frame,PerContextData}() from V8Proxy to V8Binding
+ https://bugs.webkit.org/show_bug.cgi?id=94460
+
+ Reviewed by Adam Barth.
+
+ To kill V8Proxy, we move retrieve{Window,Frame,PerContextData}()
+ from V8Proxy to V8Binding. Also, this patch renames these methods as follows:
+
+ - retrieveWindow() -> toDOMWindow()
+ - retrieveFrame() -> toFrameIfNotDetached()
+ - retrievePerContextData() -> perContextDataForCurrentWorld()
+
+ No tests. No change in behavior.
+
+ * src/WebBindings.cpp:
+ (WebKit::makeIntArrayImpl):
+ (WebKit::makeStringArrayImpl):
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrame::frameForContext):
+
+2012-08-20 James Robinson <jamesr@chromium.org>
+
+ [chromium] REGRESSION(126076) Should not touch old GraphicsLayerChromium::m_contentsLayer when setting up a new contents layer
+ https://bugs.webkit.org/show_bug.cgi?id=94544
+
+ Reviewed by Adrienne Walker.
+
+ * src/WebLayerImpl.cpp:
+ (WebKit::WebLayerImpl::id):
+ (WebKit):
+ * src/WebLayerImpl.h:
+ (WebLayerImpl):
+
+2012-08-20 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move collectGarbage() from ScriptController to V8GCController
+ https://bugs.webkit.org/show_bug.cgi?id=94455
+
+ Reviewed by Adam Barth.
+
+ - This patch moves collectGarbage() from ScriptController to V8GCController.
+ - This patch makes collectGarbage() a static method.
+ - This patch removes ScriptController::lowMemoryNotification()
+ since it is not used at all.
+
+ No tests. No change in behavior.
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::collectGarbage):
+
+2012-08-20 Adam Barth <abarth@webkit.org>
+
+ WebWidget should be able to paint into a zoomed canvas without aliasing
+ https://bugs.webkit.org/show_bug.cgi?id=92043
+
+ Reviewed by James Robinson.
+
+ If accelerated compositing is enabled, WebWidget::paint reads back from
+ the compositor rather than re-painting the widget. That approach works
+ well if the canvas we're rendering into is at a similar resolution to
+ the pixels in the compositor, but if the canvas has been scaled (e.g.,
+ to help the user disambiguate links), then reading back from the
+ compositor will cause aliasing artifacts.
+
+ This patch adds an option to paint to let the embedder request a
+ software re-rendering of the widget to avoid these aliasing artifacts.
+
+ * public/WebWidget.h:
+ (WebKit::WebWidget::paint):
+ * src/WebPagePopupImpl.cpp:
+ (WebKit::WebPagePopupImpl::paint):
+ * src/WebPagePopupImpl.h:
+ (WebPagePopupImpl):
+ * src/WebPopupMenuImpl.cpp:
+ (WebKit::WebPopupMenuImpl::paint):
+ * src/WebPopupMenuImpl.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::canvasBackgroundForTransparencey):
+ (WebKit):
+ (WebKit::WebViewImpl::paint):
+ * src/WebViewImpl.h:
+ (WebViewImpl):
+
+2012-08-20 James Robinson <jamesr@chromium.org>
+
+ Unreviewed. Roll WebKit chromium DEPS forward.
+
+ * DEPS:
+
+2012-08-20 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move clearForClose() and clearForNavigation() from V8Proxy to ScriptController
+ https://bugs.webkit.org/show_bug.cgi?id=94459
+
+ Reviewed by Adam Barth.
+
+ To kill V8Proxy, we can move clearForClose() and
+ clearForNavigation() from V8Proxy to ScriptController.
+
+ No tests. No change in behavior.
+
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::detachedFromParent3):
+
+2012-08-20 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move mainWorldContext() from V8Proxy to ScriptController
+ https://bugs.webkit.org/show_bug.cgi?id=94453
+
+ Reviewed by Adam Barth.
+
+ This patch moves mainWorldContext() from V8Proxy to ScriptController.
+ In addition, this patch removes dependency on V8Proxy from WorldContextHandle.
+
+ No tests. No change in behavior.
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::mainWorldScriptContext):
+
+2012-08-20 Adam Klein <adamk@chromium.org>
+
+ Remove redundant TOUCH_LISTENER event type
+ https://bugs.webkit.org/show_bug.cgi?id=94524
+
+ Reviewed by Ryosuke Niwa.
+
+ * src/WebPluginContainerImpl.cpp:
+ (WebKit::WebPluginContainerImpl::setIsAcceptingTouchEvents): Remove
+ bookkeeping for TOUCH_LISTENER.
+
+2012-08-16 James Robinson <jamesr@chromium.org>
+
+ [chromium] Change WebLayer from a concrete type to a pure virtual interface
+ https://bugs.webkit.org/show_bug.cgi?id=94174
+
+ Reviewed by Adrienne Walker.
+
+ This updates the implementation of the Web*Layer family to the new design and updates callers in WebViewImpl /
+ NonCompositedContentHost.
+
+ * WebKit.gyp:
+ * src/NonCompositedContentHost.cpp:
+ (WebKit::NonCompositedContentHost::NonCompositedContentHost):
+ (WebKit::NonCompositedContentHost::setScrollLayer):
+ (WebKit::NonCompositedContentHost::setViewport):
+ (WebKit::NonCompositedContentHost::scrollLayer):
+ * src/NonCompositedContentHost.h:
+ * src/WebContentLayerImpl.cpp:
+ (WebKit::WebContentLayer::create):
+ (WebKit::WebContentLayerImpl::WebContentLayerImpl):
+ (WebKit::WebContentLayerImpl::~WebContentLayerImpl):
+ (WebKit::WebContentLayerImpl::layer):
+ (WebKit):
+ (WebKit::WebContentLayerImpl::clearClient):
+ (WebKit::WebContentLayerImpl::setDoubleSided):
+ (WebKit::WebContentLayerImpl::setContentsScale):
+ (WebKit::WebContentLayerImpl::setUseLCDText):
+ (WebKit::WebContentLayerImpl::setDrawCheckerboardForMissingTiles):
+ (WebKit::WebContentLayerImpl::paintContents):
+ * src/WebContentLayerImpl.h:
+ (WebContentLayerImpl):
+ * src/WebExternalTextureLayer.cpp: Removed.
+ * src/WebExternalTextureLayerImpl.cpp: Added.
+ (WebKit):
+ (WebKit::WebExternalTextureLayer::create):
+ (WebKit::WebExternalTextureLayerImpl::WebExternalTextureLayerImpl):
+ (WebKit::WebExternalTextureLayerImpl::~WebExternalTextureLayerImpl):
+ (WebKit::WebExternalTextureLayerImpl::layer):
+ (WebKit::WebExternalTextureLayerImpl::clearClient):
+ (WebKit::WebExternalTextureLayerImpl::setTextureId):
+ (WebKit::WebExternalTextureLayerImpl::setFlipped):
+ (WebKit::WebExternalTextureLayerImpl::setUVRect):
+ (WebKit::WebExternalTextureLayerImpl::setOpaque):
+ (WebKit::WebExternalTextureLayerImpl::setPremultipliedAlpha):
+ (WebKit::WebExternalTextureLayerImpl::willModifyTexture):
+ (WebKit::WebExternalTextureLayerImpl::setRateLimitContext):
+ (WebTextureUpdaterImpl):
+ (WebKit::WebTextureUpdaterImpl::WebTextureUpdaterImpl):
+ (WebKit::WebExternalTextureLayerImpl::prepareTexture):
+ (WebKit::WebExternalTextureLayerImpl::context):
+ * src/WebExternalTextureLayerImpl.h: Renamed from Source/WebKit/chromium/src/WebContentLayer.cpp.
+ (WebKit):
+ (WebExternalTextureLayerImpl):
+ * src/WebIOSurfaceLayerImpl.cpp: Renamed from Source/WebKit/chromium/src/WebIOSurfaceLayer.cpp.
+ (WebKit):
+ (WebKit::WebIOSurfaceLayer::create):
+ (WebKit::WebIOSurfaceLayerImpl::WebIOSurfaceLayerImpl):
+ (WebKit::WebIOSurfaceLayerImpl::~WebIOSurfaceLayerImpl):
+ (WebKit::WebIOSurfaceLayerImpl::setIOSurfaceProperties):
+ (WebKit::WebIOSurfaceLayerImpl::layer):
+ * src/WebIOSurfaceLayerImpl.h: Copied from Source/Platform/chromium/public/WebImageLayer.h.
+ (WebCore):
+ (WebKit):
+ (WebIOSurfaceLayerImpl):
+ * src/WebImageLayerImpl.cpp: Renamed from Source/WebKit/chromium/src/WebSolidColorLayer.cpp.
+ (WebKit):
+ (WebKit::WebImageLayer::create):
+ (WebKit::WebImageLayerImpl::WebImageLayerImpl):
+ (WebKit::WebImageLayerImpl::~WebImageLayerImpl):
+ (WebKit::WebImageLayerImpl::layer):
+ (WebKit::WebImageLayerImpl::setBitmap):
+ * src/WebImageLayerImpl.h: Renamed from Source/WebKit/chromium/src/WebImageLayer.cpp.
+ (WebCore):
+ (WebKit):
+ (WebImageLayerImpl):
+ * src/WebLayer.cpp: Removed.
+ * src/WebLayerImpl.cpp:
+ (WebKit::WebLayer::create):
+ (WebKit::WebLayerImpl::WebLayerImpl):
+ (WebKit::WebLayerImpl::~WebLayerImpl):
+ (WebKit):
+ (WebKit::WebLayerImpl::invalidateRect):
+ (WebKit::WebLayerImpl::invalidate):
+ (WebKit::WebLayerImpl::addChild):
+ (WebKit::WebLayerImpl::insertChild):
+ (WebKit::WebLayerImpl::replaceChild):
+ (WebKit::WebLayerImpl::setChildren):
+ (WebKit::WebLayerImpl::removeFromParent):
+ (WebKit::WebLayerImpl::removeAllChildren):
+ (WebKit::WebLayerImpl::setAnchorPoint):
+ (WebKit::WebLayerImpl::anchorPoint):
+ (WebKit::WebLayerImpl::setAnchorPointZ):
+ (WebKit::WebLayerImpl::anchorPointZ):
+ (WebKit::WebLayerImpl::setBounds):
+ (WebKit::WebLayerImpl::bounds):
+ (WebKit::WebLayerImpl::setMasksToBounds):
+ (WebKit::WebLayerImpl::masksToBounds):
+ (WebKit::WebLayerImpl::setMaskLayer):
+ (WebKit::WebLayerImpl::setReplicaLayer):
+ (WebKit::WebLayerImpl::setOpacity):
+ (WebKit::WebLayerImpl::opacity):
+ (WebKit::WebLayerImpl::setOpaque):
+ (WebKit::WebLayerImpl::opaque):
+ (WebKit::WebLayerImpl::setPosition):
+ (WebKit::WebLayerImpl::position):
+ (WebKit::WebLayerImpl::setSublayerTransform):
+ (WebKit::WebLayerImpl::sublayerTransform):
+ (WebKit::WebLayerImpl::setTransform):
+ (WebKit::WebLayerImpl::transform):
+ (WebKit::WebLayerImpl::setDrawsContent):
+ (WebKit::WebLayerImpl::drawsContent):
+ (WebKit::WebLayerImpl::setPreserves3D):
+ (WebKit::WebLayerImpl::setUseParentBackfaceVisibility):
+ (WebKit::WebLayerImpl::setBackgroundColor):
+ (WebKit::WebLayerImpl::setFilters):
+ (WebKit::WebLayerImpl::setBackgroundFilters):
+ (WebKit::WebLayerImpl::setDebugBorderColor):
+ (WebKit::WebLayerImpl::setDebugBorderWidth):
+ (WebKit::WebLayerImpl::setDebugName):
+ (WebKit::WebLayerImpl::setAnimationDelegate):
+ (WebKit::WebLayerImpl::addAnimation):
+ (WebKit::WebLayerImpl::removeAnimation):
+ (WebKit::WebLayerImpl::pauseAnimation):
+ (WebKit::WebLayerImpl::suspendAnimations):
+ (WebKit::WebLayerImpl::resumeAnimations):
+ (WebKit::WebLayerImpl::hasActiveAnimation):
+ (WebKit::WebLayerImpl::transferAnimationsTo):
+ (WebKit::WebLayerImpl::setForceRenderSurface):
+ (WebKit::WebLayerImpl::clearRenderSurface):
+ (WebKit::WebLayerImpl::setScrollPosition):
+ (WebKit::WebLayerImpl::setScrollable):
+ (WebKit::WebLayerImpl::setHaveWheelEventHandlers):
+ (WebKit::WebLayerImpl::setShouldScrollOnMainThread):
+ (WebKit::WebLayerImpl::setNonFastScrollableRegion):
+ (WebKit::WebLayerImpl::setIsContainerForFixedPositionLayers):
+ (WebKit::WebLayerImpl::setFixedToContainerLayer):
+ (WebKit::WebLayerImpl::layer):
+ * src/WebLayerImpl.h:
+ (WebCore):
+ (WebLayerImpl):
+ * src/WebLayerTreeView.cpp:
+ (WebKit::WebLayerTreeView::setRootLayer):
+ * src/WebLayerTreeViewImpl.cpp:
+ (WebKit::WebLayerTreeViewImpl::create):
+ * src/WebMediaPlayerClientImpl.cpp:
+ (WebKit::WebMediaPlayerClientImpl::readyStateChanged):
+ (WebKit::WebMediaPlayerClientImpl::repaint):
+ (WebKit::WebMediaPlayerClientImpl::setOpaque):
+ (WebKit::WebMediaPlayerClientImpl::platformLayer):
+ (WebKit::WebMediaPlayerClientImpl::acceleratedRenderingInUse):
+ * src/WebMediaPlayerClientImpl.h:
+ (WebMediaPlayerClientImpl):
+ * src/WebPluginContainerImpl.cpp:
+ (WebKit::WebPluginContainerImpl::setBackingTextureId):
+ (WebKit::WebPluginContainerImpl::setBackingIOSurfaceId):
+ (WebKit::WebPluginContainerImpl::commitBackingTexture):
+ (WebKit::WebPluginContainerImpl::setOpaque):
+ (WebKit::WebPluginContainerImpl::platformLayer):
+ * src/WebPluginContainerImpl.h:
+ (WebPluginContainerImpl):
+ * src/WebScrollableLayerImpl.cpp: Renamed from Source/WebKit/chromium/src/WebScrollableLayer.cpp.
+ (WebKit):
+ (WebKit::WebScrollableLayer::setScrollPosition):
+ (WebKit::WebScrollableLayer::setScrollable):
+ (WebKit::WebScrollableLayer::setHaveWheelEventHandlers):
+ (WebKit::WebScrollableLayer::setShouldScrollOnMainThread):
+ (WebKit::WebScrollableLayer::setNonFastScrollableRegion):
+ (WebKit::WebScrollableLayer::setIsContainerForFixedPositionLayers):
+ (WebKit::WebScrollableLayer::setFixedToContainerLayer):
+ * src/WebScrollbarLayerImpl.cpp: Renamed from Source/WebKit/chromium/src/WebScrollbarLayer.cpp.
+ (WebKit):
+ (WebKit::WebScrollbarLayer::create):
+ (WebKit::WebScrollbarLayerImpl::WebScrollbarLayerImpl):
+ (WebKit::WebScrollbarLayerImpl::~WebScrollbarLayerImpl):
+ (WebKit::WebScrollbarLayerImpl::layer):
+ (WebKit::WebScrollbarLayerImpl::setScrollLayer):
+ * src/WebScrollbarLayerImpl.h: Copied from Source/WebKit/chromium/src/WebSolidColorLayerImpl.h.
+ (WebCore):
+ (WebKit):
+ (WebScrollbarLayerImpl):
+ * src/WebSolidColorLayerImpl.cpp:
+ (WebKit::WebSolidColorLayer::create):
+ (WebKit::WebSolidColorLayerImpl::WebSolidColorLayerImpl):
+ (WebKit::WebSolidColorLayerImpl::layer):
+ (WebKit):
+ (WebKit::WebSolidColorLayerImpl::setBackgroundColor):
+ * src/WebSolidColorLayerImpl.h:
+ (WebCore):
+ (WebKit):
+ (WebSolidColorLayerImpl):
+ * src/WebVideoLayerImpl.cpp: Copied from Source/WebKit/chromium/src/WebVideoLayer.cpp.
+ (WebKit):
+ (WebKit::WebVideoLayer::create):
+ (WebKit::WebVideoLayerImpl::WebVideoLayerImpl):
+ (WebKit::WebVideoLayerImpl::~WebVideoLayerImpl):
+ (WebKit::WebVideoLayerImpl::layer):
+ (WebKit::WebVideoLayerImpl::active):
+ * src/WebVideoLayerImpl.h: Renamed from Source/WebKit/chromium/src/WebVideoLayer.cpp.
+ (WebCore):
+ (WebKit):
+ (WebVideoLayerImpl):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+ (WebKit::WebViewImpl::setRootGraphicsLayer):
+ (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+ (WebKit):
+ * src/WebViewImpl.h:
+ * tests/ImageLayerChromiumTest.cpp:
+ (WebCore::TEST):
+ * tests/WebLayerTest.cpp:
+ * tests/WebLayerTreeViewTest.cpp:
+
+2012-08-20 Shawn Singh <shawnsingh@chromium.org>
+
+ [chromium] CCMathUtilTest.smallestAngleBetweenVectors unit test failing
+ https://bugs.webkit.org/show_bug.cgi?id=94502
+
+ Reviewed by Kenneth Russell.
+
+ The test needed to use EXPECT_FLOAT_EQ instead of EXPECT_EQ. In
+ this patch, the test is also re-enabled.
+
+ * tests/CCMathUtilTest.cpp:
+
+2012-08-20 Leandro Gracia Gil <leandrogracia@chromium.org>
+
+ Move transformFriendlyBoundingBox out of Range
+ https://bugs.webkit.org/show_bug.cgi?id=94366
+
+ Reviewed by Ryosuke Niwa.
+
+ Update the WebKit code that makes use of transformFriendlyBoundingBox.
+
+ * src/FindInPageCoordinates.cpp:
+ (WebKit::findInPageRectFromRange):
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::find):
+ (WebKit::WebFrameImpl::selectFindMatch):
+
+2012-08-20 Leandro Gracia Gil <leandrogracia@chromium.org>
+
+ [Chromium] detectContentIntentAround has a misleading name
+ https://bugs.webkit.org/show_bug.cgi?id=94349
+
+ Reviewed by Adam Barth.
+
+ The current WebViewClient API exposes a method named detectContentIntentAround.
+ However, this is not designed to detect any "content intent", but to allow the embedder
+ to detect content around a position and fire Android intents if appropriate.
+
+ This patch also disables content detection if the touched node listens to events
+ that consume the tap action like clicks, touch events or mouse events.
+
+ * public/WebViewClient.h:
+ (WebViewClient):
+ (WebKit::WebViewClient::detectContentAround):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::detectContentOnTouch):
+ * src/WebViewImpl.h:
+ (WebViewImpl):
+
+2012-08-20 Hans Wennborg <hans@chromium.org>
+
+ Respect runtime flags for Device Orientation and Device Motion
+ https://bugs.webkit.org/show_bug.cgi?id=94479
+
+ Reviewed by Adam Barth.
+
+ WebRuntimeFeatures::enableDeviceMotion should not be hard-coded to
+ false.
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebView::create):
+
+2012-08-20 David Reveman <reveman@chromium.org>
+
+ [Chromium] Schedule texture uploads based on hard-coded timer and vsync.
+ https://bugs.webkit.org/show_bug.cgi?id=84281
+
+ Reviewed by James Robinson.
+
+ * tests/CCSchedulerTest.cpp:
+ (WebKitTests::TEST):
+ * tests/CCSchedulerTestCommon.h:
+ (WebKitTests::FakeCCTimeSource::FakeCCTimeSource):
+ (WebKitTests::FakeCCTimeSource::setNextTickTime):
+ (FakeCCTimeSource):
+ * tests/CCTextureUpdateControllerTest.cpp:
+
+2012-08-20 Kenneth Russell <kbr@google.com>
+
+ Unreviewed Chromium rebaselining and test failure suppressions.
+
+ https://bugs.webkit.org/show_bug.cgi?id=94502
+
+ * tests/CCMathUtilTest.cpp:
+
+2012-08-20 Ian Vollick <vollick@chromium.org>
+
+ [chromium] Add tracing for active composited animations
+ https://bugs.webkit.org/show_bug.cgi?id=84210
+
+ Reviewed by James Robinson.
+
+ This patch issues the trace events from the animations. Animations will
+ report when they start and finish on the main and impl threads (via
+ TRACE_EVENT_ASYNC*), and also issues instant trace events whenever they
+ change state.
+
+ * src/WebAnimationImpl.cpp:
+ (WebKit::WebAnimationImpl::cloneToCCAnimation):
+ * tests/CCAnimationTestCommon.h:
+
+2012-08-20 Sami Kyostila <skyostil@chromium.org>
+
+ [chromium] Convert screen space scroll gestures to layer space
+ https://bugs.webkit.org/show_bug.cgi?id=92499
+
+ Reviewed by James Robinson.
+
+ Added new tests for verifying transformed layer scrolling:
+
+ CCLayerTreeHostImplTest.scrollAxisAlignedRotatedLayer
+ CCLayerTreeHostImplTest.scrollNonAxisAlignedRotatedLayer
+ CCLayerTreeHostImplTest.scrollScaledLayer
+
+ Also some tests for the introduced math utilities:
+
+ CCMathUtilTest.smallestAngleBetweenVectors
+ CCMathUtilTest.vectorProjection
+
+ * src/WebCompositorInputHandlerImpl.cpp:
+ (WebKit::WebCompositorInputHandlerImpl::handleInputEventInternal):
+ (WebKit::WebCompositorInputHandlerImpl::handleGestureFling):
+ * tests/CCLayerTreeHostImplTest.cpp: Adjusted scroll delta in scrollChildBeyondLimit to avoid triggering the 45 degree rule.
+ * tests/CCLayerTreeHostTest.cpp:
+ * tests/CCMathUtilTest.cpp:
+ * tests/WebCompositorInputHandlerImplTest.cpp:
+ (MockCCInputHandlerClient):
+ (WebKit::TEST_F):
+
+2012-08-20 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: load scripts panel lazily
+ https://bugs.webkit.org/show_bug.cgi?id=94416
+
+ Reviewed by Vsevolod Vlasov.
+
+ * WebKit.gyp:
+
+2012-08-19 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move contextDebugId() and setContextDebugId() from V8Proxy to ScriptController
+ https://bugs.webkit.org/show_bug.cgi?id=94446
+
+ Reviewed by Adam Barth.
+
+ To kill V8Proxy, we can move contextDebugId() and setContextDebugId()
+ from V8Proxy to ScriptController.
+
+ No tests. No change in behavior.
+
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::WebDevToolsAgentImpl::didCreateScriptContext):
+
+2012-08-20 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Move V8Proxy::m_extensions to ScriptController
+ https://bugs.webkit.org/show_bug.cgi?id=94444
+
+ Reviewed by Adam Barth.
+
+ To kill V8Proxy, this patch moves V8Proxy::m_extensions to ScriptController.
+
+ No tests. No change in behavior.
+
+ * src/WebScriptController.cpp:
+ (WebKit::WebScriptController::registerExtension):
+
+2012-08-19 James Robinson <jamesr@chromium.org>
+
+ [chromium] Put webkit compositor binding files in separate conditionally included gyp section
+ https://bugs.webkit.org/show_bug.cgi?id=94392
+
+ Reviewed by Dirk Pranke.
+
+ This allows the use_libcc_for_compositor gyp variable to control whether the webkit bindings are pulled from the
+ WebKit repository or an external target.
+
+ * WebKit.gyp:
+ * WebKit.gypi:
+
+2012-08-19 Rick Byers <rbyers@chromium.org>
+
+ [chromium] Add additional fields to WebGestureEvent
+ https://bugs.webkit.org/show_bug.cgi?id=94238
+
+ Reviewed by James Robinson.
+
+ Add a union to WebGestureEvent with per-event-type data, as a first
+ step to eliminating the overloaded delta fields.
+
+ * public/WebInputEvent.h:
+ (WebGestureEvent):
+ (WebKit::WebGestureEvent::WebGestureEvent):
+ * src/WebInputEvent.cpp:
+ (SameSizeAsWebGestureEvent):
+
+2012-08-19 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: load network panel lazily
+ https://bugs.webkit.org/show_bug.cgi?id=94414
+
+ Reviewed by Vsevolod Vlasov.
+
+ * WebKit.gyp:
+
+2012-08-18 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: make profiles panel a lazily loaded module.
+ https://bugs.webkit.org/show_bug.cgi?id=94351
+
+ Reviewed by Yury Semikhatsky.
+
+ * WebKit.gyp:
+
+2012-08-18 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: load panels code on demand
+ https://bugs.webkit.org/show_bug.cgi?id=94326
+
+ Reviewed by Vsevolod Vlasov.
+
+ * WebKit.gyp:
+ * scripts/concatenate_js_files.py:
+ (OrderedJSFilesExtractor.handle_starttag):
+ * scripts/inline_js_imports.py:
+ (main):
+
+2012-08-17 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, rolling out r125897.
+ http://trac.webkit.org/changeset/125897
+ https://bugs.webkit.org/show_bug.cgi?id=94326
+
+ this patch seems to have broken the inspector on the apple mac bots.
+
+ * WebKit.gyp:
+ * scripts/concatenate_js_files.py:
+ (OrderedJSFilesExtractor.handle_starttag):
+ * scripts/inline_js_imports.py:
+ (main):
+
+2012-08-17 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125922.
+ http://trac.webkit.org/changeset/125922
+ https://bugs.webkit.org/show_bug.cgi?id=94389
+
+ "Causing failing/crashing tests on Mac bots" (Requested by
+ bradee-oh on #webkit).
+
+ * WebKit.gyp:
+
+2012-08-16 James Robinson <jamesr@chromium.org>
+
+ [chromium] Add Source/WebCore/platform/graphics/chromium/cc/ to include path and remove cc/ prefix from includes
+ https://bugs.webkit.org/show_bug.cgi?id=94279
+
+ Reviewed by Adam Barth.
+
+ * src/WebAnimationCurveCommon.cpp:
+ * src/WebAnimationImpl.cpp:
+ * src/WebCompositorInputHandlerImpl.cpp:
+ * src/WebCompositorInputHandlerImpl.h:
+ * src/WebExternalTextureLayer.cpp:
+ * src/WebFloatAnimationCurve.cpp:
+ * src/WebLayerTreeView.cpp:
+ * src/WebLayerTreeViewImpl.cpp:
+ * src/WebTransformAnimationCurve.cpp:
+ * tests/CCActiveAnimationTest.cpp:
+ * tests/CCAnimationTestCommon.cpp:
+ * tests/CCAnimationTestCommon.h:
+ * tests/CCDamageTrackerTest.cpp:
+ * tests/CCDelayBasedTimeSourceTest.cpp:
+ * tests/CCFrameRateControllerTest.cpp:
+ * tests/CCKeyframedAnimationCurveTest.cpp:
+ * tests/CCLayerAnimationControllerTest.cpp:
+ * tests/CCLayerImplTest.cpp:
+ * tests/CCLayerIteratorTest.cpp:
+ * tests/CCLayerQuadTest.cpp:
+ * tests/CCLayerSorterTest.cpp:
+ * tests/CCLayerTestCommon.cpp:
+ * tests/CCLayerTestCommon.h:
+ * tests/CCLayerTreeHostCommonTest.cpp:
+ * tests/CCLayerTreeHostImplTest.cpp:
+ * tests/CCLayerTreeHostTest.cpp:
+ * tests/CCMathUtilTest.cpp:
+ * tests/CCOcclusionTrackerTest.cpp:
+ * tests/CCOcclusionTrackerTestCommon.h:
+ * tests/CCPrioritizedTextureTest.cpp:
+ * tests/CCQuadCullerTest.cpp:
+ * tests/CCRenderSurfaceFiltersTest.cpp:
+ * tests/CCRenderSurfaceTest.cpp:
+ * tests/CCResourceProviderTest.cpp:
+ * tests/CCSchedulerStateMachineTest.cpp:
+ * tests/CCSchedulerTest.cpp:
+ * tests/CCSchedulerTestCommon.h:
+ * tests/CCScopedTextureTest.cpp:
+ * tests/CCScrollbarAnimationControllerLinearFadeTest.cpp:
+ * tests/CCSolidColorLayerImplTest.cpp:
+ * tests/CCTestCommon.h:
+ * tests/CCTextureUpdateControllerTest.cpp:
+ * tests/CCThreadTaskTest.cpp:
+ * tests/CCThreadedTest.cpp:
+ * tests/CCThreadedTest.h:
+ * tests/CCTiledLayerImplTest.cpp:
+ * tests/CCTiledLayerTestCommon.h:
+ * tests/CCTimerTest.cpp:
+ * tests/ContentLayerChromiumTest.cpp:
+ * tests/FakeCCGraphicsContext.h:
+ * tests/FakeCCLayerTreeHostClient.h:
+ * tests/FloatQuadTest.cpp:
+ * tests/GraphicsLayerChromiumTest.cpp:
+ * tests/LayerChromiumTest.cpp:
+ * tests/LayerRendererChromiumTest.cpp:
+ * tests/MockCCQuadCuller.h:
+ * tests/PlatformGestureCurveTest.cpp:
+ * tests/ScrollbarLayerChromiumTest.cpp:
+ * tests/TextureLayerChromiumTest.cpp:
+ * tests/TiledLayerChromiumTest.cpp:
+ * tests/TreeSynchronizerTest.cpp:
+ * tests/WebCompositorInputHandlerImplTest.cpp:
+ * tests/WebFloatAnimationCurveTest.cpp:
+ * tests/WebTransformAnimationCurveTest.cpp:
+
+2012-08-17 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: make profiles panel a lazily loaded module.
+ https://bugs.webkit.org/show_bug.cgi?id=94351
+
+ Reviewed by Yury Semikhatsky.
+
+ * WebKit.gyp:
+
+2012-08-17 Keishi Hattori <keishi@webkit.org>
+
+ [Chromium] Turn off ENABLE_DATALIST_ELEMENT for Android
+ https://bugs.webkit.org/show_bug.cgi?id=94337
+
+ Reviewed by Kent Tamura.
+
+ We shouldn't have turned ENABLE_DATALIST_ELEMENT on for Android.
+
+ * features.gypi:
+
+2012-08-17 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125892.
+ http://trac.webkit.org/changeset/125892
+ https://bugs.webkit.org/show_bug.cgi?id=94350
+
+ Broke windows build (Requested by vollick on #webkit).
+
+ * src/WebAnimationImpl.cpp:
+ (WebKit::WebAnimationImpl::cloneToCCAnimation):
+
+2012-08-17 Peter Beverloo <peter@chromium.org>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
+2012-08-17 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: load panels code on demand
+ https://bugs.webkit.org/show_bug.cgi?id=94326
+
+ Reviewed by Vsevolod Vlasov.
+
+ * WebKit.gyp:
+ * scripts/concatenate_js_files.py:
+ (OrderedJSFilesExtractor.handle_starttag):
+ * scripts/inline_js_imports.py:
+ (main):
+
+2012-08-17 Ian Vollick <vollick@chromium.org>
+
+ [chromium] Add tracing for active composited animations
+ https://bugs.webkit.org/show_bug.cgi?id=84210
+
+ Reviewed by James Robinson.
+
+ This patch issues the trace events from the animations. Animations will
+ report when they start and finish on the main and impl threads (via
+ TRACE_EVENT_ASYNC*), and also issues instant trace events whenever they
+ change state.
+
+ * src/WebAnimationImpl.cpp:
+ (WebKit::WebAnimationImpl::cloneToCCAnimation):
+
+2012-08-16 Antoine Labour <piman@chromium.org>
+
+ [chromium] Add resource transfer functions to CCResourceProvider
+ https://bugs.webkit.org/show_bug.cgi?id=93524
+
+ Reviewed by James Robinson.
+
+ This adds methods to CCResourceProvider to be able to transport
+ resources from a child to a parent.
+
+ Added test to CCResourceProviderTest.
+
+ * tests/CCResourceProviderTest.cpp:
+ (WebKit::textureSize):
+ (WebKit):
+ (WebKit::Texture::Texture):
+ (Texture):
+ (ContextSharedData):
+ (WebKit::ContextSharedData::create):
+ (WebKit::ContextSharedData::insertSyncPoint):
+ (WebKit::ContextSharedData::genMailbox):
+ (WebKit::ContextSharedData::produceTexture):
+ (WebKit::ContextSharedData::consumeTexture):
+ (WebKit::ContextSharedData::ContextSharedData):
+ (WebKit::ResourceProviderContext::create):
+ (ResourceProviderContext):
+ (WebKit::ResourceProviderContext::insertSyncPoint):
+ (WebKit::ResourceProviderContext::waitSyncPoint):
+ (WebKit::ResourceProviderContext::genMailboxCHROMIUM):
+ (WebKit::ResourceProviderContext::produceTextureCHROMIUM):
+ (WebKit::ResourceProviderContext::consumeTextureCHROMIUM):
+ (WebKit::ResourceProviderContext::ResourceProviderContext):
+ (PendingProduceTexture):
+ (WebKit::CCResourceProviderTest::CCResourceProviderTest):
+ (CCResourceProviderTest):
+ (WebKit::TEST_F):
+
+2012-08-16 David Grogan <dgrogan@chromium.org>
+
+ IndexedDB: Frontend and plumbing for integer versions
+ https://bugs.webkit.org/show_bug.cgi?id=92897
+
+ Reviewed by Tony Chang.
+
+ * src/IDBCallbacksProxy.cpp:
+ (WebKit::IDBCallbacksProxy::onBlocked):
+ (WebKit):
+ (WebKit::IDBCallbacksProxy::onUpgradeNeeded):
+ * src/IDBCallbacksProxy.h:
+ (IDBCallbacksProxy):
+ * src/IDBDatabaseBackendProxy.cpp:
+ (WebKit::IDBDatabaseBackendProxy::setVersion):
+ * src/IDBDatabaseCallbacksProxy.cpp:
+ (WebKit::IDBDatabaseCallbacksProxy::onVersionChange):
+ (WebKit):
+ * src/IDBDatabaseCallbacksProxy.h:
+ (IDBDatabaseCallbacksProxy):
+ * src/IDBFactoryBackendProxy.cpp:
+ (WebKit::IDBFactoryBackendProxy::open):
+ * src/IDBFactoryBackendProxy.h:
+ (IDBFactoryBackendProxy):
+ * src/IDBTransactionCallbacksProxy.cpp:
+ (WebKit::IDBTransactionCallbacksProxy::onComplete):
+ * src/WebIDBCallbacksImpl.cpp:
+ (WebKit::WebIDBCallbacksImpl::WebIDBCallbacksImpl):
+ (WebKit::WebIDBCallbacksImpl::onSuccess):
+ We don't want to create IDBDatabaseBackendProxy again if we've already
+ created it during upgradeNeeded. This makes
+ IDBRequest::onSuccess(IDBDatabaseBackend) reuse its previous
+ IDBDatabaseBackendInterface if it has one.
+
+ (WebKit::WebIDBCallbacksImpl::onBlocked):
+ (WebKit):
+ (WebKit::WebIDBCallbacksImpl::onUpgradeNeeded):
+ * src/WebIDBCallbacksImpl.h:
+ (WebIDBCallbacksImpl):
+ * src/WebIDBDatabaseCallbacksImpl.cpp:
+ (WebKit::WebIDBDatabaseCallbacksImpl::onVersionChange):
+ (WebKit):
+ * src/WebIDBDatabaseCallbacksImpl.h:
+ (WebIDBDatabaseCallbacksImpl):
+ * src/WebIDBDatabaseImpl.cpp:
+ (WebKit::WebIDBDatabaseImpl::WebIDBDatabaseImpl):
+ (WebKit::WebIDBDatabaseImpl::close):
+ (WebKit::WebIDBDatabaseImpl::open):
+ * src/WebIDBDatabaseImpl.h:
+ (WebIDBDatabaseImpl):
+ * src/WebIDBFactoryImpl.cpp:
+ (WebKit::WebIDBFactoryImpl::open):
+ * src/WebIDBFactoryImpl.h:
+ (WebIDBFactoryImpl):
+ * src/WebIDBTransactionCallbacksImpl.cpp:
+ (WebKit::WebIDBTransactionCallbacksImpl::onComplete):
+ * tests/IDBAbortOnCorruptTest.cpp:
+ (WebCore::TEST):
+ * tests/IDBDatabaseBackendTest.cpp:
+
+2012-08-16 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125838.
+ http://trac.webkit.org/changeset/125838
+ https://bugs.webkit.org/show_bug.cgi?id=94283
+
+ Breaks Mac compile due to bug 74625 (Requested by enne on
+ #webkit).
+
+ * tests/CCResourceProviderTest.cpp:
+ (WebKit::ResourceProviderContext::create):
+ (WebKit::ResourceProviderContext::textureSize):
+ (ResourceProviderContext):
+ (WebKit::ResourceProviderContext::ResourceProviderContext):
+ (WebKit::ResourceProviderContext::Texture::Texture):
+ (Texture):
+ (WebKit::CCResourceProviderTest::CCResourceProviderTest):
+ (CCResourceProviderTest):
+ (WebKit::TEST_F):
+
+2012-08-16 Kenneth Russell <kbr@google.com>
+
+ Unreviewed, rolling out r125800.
+ http://trac.webkit.org/changeset/125800
+ https://bugs.webkit.org/show_bug.cgi?id=84281
+
+ Hypothesis that this change caused gpu_throughput_tests to
+ start timing out on all platforms on the Chromium GPU
+ canaries.
+
+ * tests/CCSchedulerTest.cpp:
+ (WebKitTests::TEST):
+ * tests/CCSchedulerTestCommon.h:
+ (WebKitTests::FakeCCTimeSource::FakeCCTimeSource):
+ (FakeCCTimeSource):
+ * tests/CCTextureUpdateControllerTest.cpp:
+
+2012-08-16 Antoine Labour <piman@chromium.org>
+
+ [chromium] Add resource transfer functions to CCResourceProvider
+ https://bugs.webkit.org/show_bug.cgi?id=93524
+
+ Reviewed by James Robinson.
+
+ This adds methods to CCResourceProvider to be able to transport
+ resources from a child to a parent.
+
+ Added test to CCResourceProviderTest.
+
+ * tests/CCResourceProviderTest.cpp:
+ (WebKit::textureSize):
+ (WebKit):
+ (WebKit::Texture::Texture):
+ (Texture):
+ (ContextSharedData):
+ (WebKit::ContextSharedData::create):
+ (WebKit::ContextSharedData::insertSyncPoint):
+ (WebKit::ContextSharedData::genMailbox):
+ (WebKit::ContextSharedData::produceTexture):
+ (WebKit::ContextSharedData::consumeTexture):
+ (WebKit::ContextSharedData::ContextSharedData):
+ (WebKit::ResourceProviderContext::create):
+ (ResourceProviderContext):
+ (WebKit::ResourceProviderContext::insertSyncPoint):
+ (WebKit::ResourceProviderContext::waitSyncPoint):
+ (WebKit::ResourceProviderContext::genMailboxCHROMIUM):
+ (WebKit::ResourceProviderContext::produceTextureCHROMIUM):
+ (WebKit::ResourceProviderContext::consumeTextureCHROMIUM):
+ (WebKit::ResourceProviderContext::ResourceProviderContext):
+ (PendingProduceTexture):
+ (WebKit::CCResourceProviderTest::CCResourceProviderTest):
+ (CCResourceProviderTest):
+ (WebKit::TEST_F):
+
+2012-08-16 Alexandre Elias <aelias@google.com>
+
+ [chromium] Replace destRect with destOffset in texture upload
+ https://bugs.webkit.org/show_bug.cgi?id=94154
+
+ Reviewed by James Robinson.
+
+ Previously, texture upload code implicitly assumed that sourceRect and
+ destRect have the same size. The behavior is undefined if they are
+ different, since they are used interchangeably and there's no support
+ for scaling from one rect to the other. This patch enforces that
+ constraint at the interface level by replacing all instances of
+ "IntRect destRect" by "IntSize destOffset".
+
+ * tests/CCResourceProviderTest.cpp:
+ (WebKit::TEST_F):
+ * tests/CCTextureUpdateControllerTest.cpp:
+ * tests/CCTiledLayerTestCommon.cpp:
+ (WebKitTests::FakeLayerTextureUpdater::Texture::updateRect):
+ * tests/CCTiledLayerTestCommon.h:
+ (Texture):
+ (WebKitTests::FakeTextureUploader::uploadTexture):
+
+2012-08-16 James Robinson <jamesr@chromium.org>
+
+ [chromium] Remove unnecessary tree hierarchy inspection APIs from WebLayer
+ https://bugs.webkit.org/show_bug.cgi?id=94229
+
+ Reviewed by Adrienne Walker.
+
+ Remove dead WebLayer function implementations and tests of same.
+
+ * src/WebLayer.cpp:
+ * tests/WebLayerTest.cpp:
+
+2012-08-16 David Reveman <reveman@chromium.org>
+
+ [Chromium] Avoid aliasing global symbol monotonicallyIncreasingTime().
+ https://bugs.webkit.org/show_bug.cgi?id=94233
+
+ Reviewed by James Robinson.
+
+ * tests/CCDelayBasedTimeSourceTest.cpp:
+ (WebKitTests::TEST):
+ * tests/CCFrameRateControllerTest.cpp:
+ (WebKitTests::TEST):
+ * tests/CCSchedulerTestCommon.h:
+ (WebKitTests::FakeCCDelayBasedTimeSource::setMonotonicTimeNow):
+ (WebKitTests::FakeCCDelayBasedTimeSource::FakeCCDelayBasedTimeSource):
+ (FakeCCDelayBasedTimeSource):
+
+2012-08-16 David Reveman <reveman@chromium.org>
+
+ [Chromium] Schedule texture uploads based on hard-coded timer and vsync.
+ https://bugs.webkit.org/show_bug.cgi?id=84281
+
+ Reviewed by James Robinson.
+
+ * tests/CCSchedulerTest.cpp:
+ (WebKitTests::TEST):
+ * tests/CCSchedulerTestCommon.h:
+ (WebKitTests::FakeCCTimeSource::FakeCCTimeSource):
+ (WebKitTests::FakeCCTimeSource::setNextTickTime):
+ (FakeCCTimeSource):
+ * tests/CCTextureUpdateControllerTest.cpp:
+
+2012-08-16 Dana Jansens <danakj@chromium.org>
+
+ [chromium] Impl scrolling crashes when the renderer's initialization failed
+ https://bugs.webkit.org/show_bug.cgi?id=94232
+
+ Reviewed by James Robinson.
+
+ Also updated the finishAllRenderingAfterContextLost to properly fail
+ renderer initialization.
+
+ * tests/CCLayerTreeHostImplTest.cpp:
+
+2012-08-16 Peter Beverloo <peter@chromium.org>
+
+ [Chromium] Pass the --strip-binary argument to the apk test generator
+ https://bugs.webkit.org/show_bug.cgi?id=94224
+
+ Reviewed by Adam Barth.
+
+ The native test generator currently relies on the $STRIP environment
+ variable to be available, which it shouldn't do. Instead, pass it as an
+ argument to the script. The $STRIP variable is being deprecated.
+
+ * WebKitUnitTests.gyp:
+
+2012-08-16 James Robinson <jamesr@chromium.org>
+
+ [chromium] Remove alwaysReserveTextures code - it doesn't do anything
+ https://bugs.webkit.org/show_bug.cgi?id=94183
+
+ Reviewed by Dimitri Glazkov.
+
+ Stops attempting to find the scrollbar layers and call setAlwaysReserveTextures() on them since the call doesn't
+ do anything.
+
+ * src/NonCompositedContentHost.cpp:
+ (WebKit::NonCompositedContentHost::setViewport):
+ * src/WebLayer.cpp:
+
+2012-08-16 Peter Beverloo <peter@chromium.org>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
+2012-08-16 Keishi Hattori <keishi@webkit.org>
+
+ DOMWindowPagePopup needs to be installed before loading the html inside the page popup
+ https://bugs.webkit.org/show_bug.cgi?id=94193
+
+ Reviewed by Kent Tamura.
+
+ We are using window.pagePopupController.localizeNumberString while loading so we need to install DOMWindowPagePopup before loading the html.
+
+ * src/WebPagePopupImpl.cpp:
+ (WebKit::WebPagePopupImpl::initPage):
+
+2012-08-16 Marja Hölttä <marja@chromium.org>
+
+ WebHistoryItem: Enable reading selected file names from document state
+ https://bugs.webkit.org/show_bug.cgi?id=91231
+
+ Reviewed by Jochen Eisinger.
+
+ This change enables Chromium to set up file permissions properly when
+ the session restore feature restores a page with selected files.
+
+ * public/WebHistoryItem.h:
+ (WebHistoryItem): Added getReferencedFilePaths.
+ * src/WebHistoryItem.cpp:
+ (WebKit::WebHistoryItem::getReferencedFilePaths): Extracts selected and posted file paths from a document state.
+ (WebKit):
+
+2012-08-15 Shawn Singh <shawnsingh@chromium.org>
+
+ [chromium] set scissorRect per quad so that quads are correctly clipped
+ https://bugs.webkit.org/show_bug.cgi?id=94050
+
+ Reviewed by Adrienne Walker.
+
+ Updated two unit tests to reflect that we need to always scissor,
+ until we refactor so that quads do not depend on scissoring.
+
+ * tests/CCLayerTreeHostImplTest.cpp:
+
+2012-08-16 Hironori Bono <hbono@chromium.org>
+
+ Prevent showing suggestions when right-clicking a selection range.
+ https://bugs.webkit.org/show_bug.cgi?id=94189
+
+ Reviewed by Hajime Morita.
+
+ To emulate Safari, my r120810 changes selection when right-clicking a misspelled
+ word. Unfortunately, this change somehow uses VisibleSelection::isCaretOrRange
+ and it changes the existing selection when right-clicking a selection which
+ includes a misspelled word. This change uses VisibleSelection::isCaret to
+ prevent showing suggestions when right-clicking a selection range. (Neither does
+ Safari show suggestions when there is a selection range.)
+
+ * src/ContextMenuClientImpl.cpp:
+ (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):
+
+2012-08-15 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
+2012-08-15 Ryosuke Niwa <rniwa@webkit.org>
+
+ Update manual tests and comments to refer to TestRunner instead of LayoutTestController
+ https://bugs.webkit.org/show_bug.cgi?id=94168
+
+ Reviewed by Kent Tamura.
+
+ * public/WebDevToolsAgent.h:
+ (WebDevToolsAgent):
+ * public/WebView.h:
+ (WebView):
+
+2012-08-15 Alec Flett <alecflett@chromium.org>
+
+ IndexedDB: generate index keys for existing data in createIndex in front end
+ https://bugs.webkit.org/show_bug.cgi?id=91125
+
+ Reviewed by Tony Chang.
+
+ Add Chromium API methods to let the renderer process tell the
+ browser process about indexing progress.
+
+ * public/WebIDBObjectStore.h:
+ (WebKit::WebIDBObjectStore::openCursor):
+ * src/IDBObjectStoreBackendProxy.cpp:
+ (WebKit::IDBObjectStoreBackendProxy::setIndexKeys):
+ (WebKit):
+ (WebKit::IDBObjectStoreBackendProxy::setIndexesReady):
+ (WebKit::IDBObjectStoreBackendProxy::openCursor):
+ * src/IDBObjectStoreBackendProxy.h:
+ (IDBObjectStoreBackendProxy):
+ * src/WebIDBObjectStoreImpl.cpp:
+ (WebKit::WebIDBObjectStoreImpl::setIndexKeys):
+ (WebKit):
+ (WebKit::WebIDBObjectStoreImpl::setIndexesReady):
+ (WebKit::WebIDBObjectStoreImpl::openCursor):
+ * src/WebIDBObjectStoreImpl.h:
+ (WebIDBObjectStoreImpl):
+
+2012-08-15 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com>
+
+ [css3-text] Add CSS3 Text decoration compile flag
+ https://bugs.webkit.org/show_bug.cgi?id=93863
+
+ Reviewed by Julien Chaffraix.
+
+ This patch handles the compile flag implementation, which will come disabled by
+ default, thus not exposing the CSS3 text decoration features to the web, unless
+ when explicitly enabling it with "--css3-text-decoration" build parameter.
+
+ * features.gypi:
+
+2012-08-15 Iain Merrick <husky@chromium.org>
+
+ Refactoring: move EventHandler::targetNode into HitTestResult
+ https://bugs.webkit.org/show_bug.cgi?id=94107
+
+ Reviewed by Dimitri Glazkov.
+
+ This static helper method in EventHandler was made public so that
+ WebFrameImpl can call it. That's untidy because EventHandler isn't
+ really involved. This patch turns it into an instance method of
+ HitTestResult (with a wrapper in MouseEventWithHitTestResult for
+ convenience).
+
+ Pure refactoring, no behavior change, no new test needed.
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::visiblePositionForWindowPoint):
+
+2012-08-15 David Grogan <dgrogan@chromium.org>
+
+ IndexedDB: Add some ASSERTs
+ https://bugs.webkit.org/show_bug.cgi?id=94055
+
+ Reviewed by Ojan Vafai.
+
+ * src/IDBDatabaseBackendProxy.cpp:
+ (WebKit::IDBDatabaseBackendProxy::setVersion):
+
+2012-08-15 Ian Vollick <vollick@chromium.org>
+
+ [chromium] Must account for empty transformation lists when checking for big rotations.
+ https://bugs.webkit.org/show_bug.cgi?id=93975
+
+ Reviewed by James Robinson.
+
+ Adds a test to check that creating an animation with a big (> 180
+ degree) rotation, where the transform operations list in the 1st
+ keyframe is empty fails as expected.
+
+ * tests/AnimationTranslationUtilTest.cpp:
+ (WebKit::TEST):
+ (WebKit):
+
+2012-08-15 Joshua Bell <jsbell@chromium.org>
+
+ [chromium] IndexedDB: Delete unused WebKit API cursor accessors
+ https://bugs.webkit.org/show_bug.cgi?id=94134
+
+ Reviewed by Adam Barth.
+
+ Last bit of refactor work from http://webkit.org/b/92278 that ships the
+ cursor key/primaryKey/value to the front end via success messages, eliminating
+ the need for these accessors and the old success messages.
+
+ * public/WebIDBCallbacks.h:
+ * public/WebIDBCursor.h:
+
+2012-08-15 Anna Cavender <annacc@chromium.org>
+
+ Add the timestampOffset attribute to SourceBuffer.
+ https://bugs.webkit.org/show_bug.cgi?id=93303
+
+ Reviewed by Dimitri Glazkov.
+
+ On the 30 July 2012 version of the Media Source Extensions spec, a timestampOffset
+ attribute was added to the SourceBuffer object:
+ http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#dom-timestampoffset
+
+ * public/WebMediaPlayer.h:
+ (WebKit::WebMediaPlayer::sourceSetTimestampOffset): Add the new method.
+ * src/WebMediaPlayerClientImpl.cpp:
+ (WebKit):
+ (WebKit::WebMediaPlayerClientImpl::sourceSetTimestampOffset): Forward the call.
+ * src/WebMediaPlayerClientImpl.h:
+ (WebMediaPlayerClientImpl):
+
+2012-08-15 Peter Beverloo <peter@chromium.org>
+
+ [Chromium] Roll WebKit Chromium DEPS to r151672
+ https://bugs.webkit.org/show_bug.cgi?id=94091
+
+ Unreviewed DEPS roll.
+
+ This also adds the new dependency on third_party/skia/gyp/, as was
+ introduced in Chromium's revision 151463.
+
+ * DEPS:
+
+2012-08-14 Keishi Hattori <keishi@webkit.org>
+
+ Share common code between calendar picker and color suggestion picker
+ https://bugs.webkit.org/show_bug.cgi?id=93802
+
+ Reviewed by Kent Tamura.
+
+ * src/ColorChooserUIController.cpp:
+ (WebKit::ColorChooserUIController::writeDocument):
+
+2012-08-14 Scott Graham <scottmg@chromium.org>
+
+ [Chromium] Fix warnings on Windows build
+ https://bugs.webkit.org/show_bug.cgi?id=93997
+
+ Reviewed by Kentaro Hara.
+
+ Fixes truncation from 'double' to 'float' warnings on Chromium Windows
+ build.
+
+ * tests/CCRenderSurfaceFiltersTest.cpp:
+ (WebKit::TEST):
+ * tests/CCScrollbarAnimationControllerLinearFadeTest.cpp:
+ (WebCore::TEST_F):
+
+2012-08-14 Chris Rogers <crogers@google.com>
+
+ Implement new synchronized audio I/O render method in chromium
+ https://bugs.webkit.org/show_bug.cgi?id=93510
+
+ Reviewed by Kenneth Russell.
+
+ The chromium implementation of AudioDestination is being upgraded to
+ support synchronized audio I/O. Other changes on the chromium-side
+ can then be tested against something that works in WebKit.
+
+ * src/AudioDestinationChromium.cpp:
+ (WebCore::AudioDestinationChromium::AudioDestinationChromium):
+ (WebCore::AudioDestinationChromium::render):
+ (WebCore):
+ (WebCore::AudioDestinationChromium::provideInput):
+ * src/AudioDestinationChromium.h:
+ (WebCore):
+ (AudioDestinationChromium):
+
+2012-08-14 Adam Barth <abarth@webkit.org>
+
+ Delete Frame::domWindow() and Frame::existingDOMWindow()
+ https://bugs.webkit.org/show_bug.cgi?id=93990
+
+ Reviewed by Eric Seidel.
+
+ * src/StorageAreaProxy.cpp:
+ (WebCore::StorageAreaProxy::dispatchLocalStorageEvent):
+ (WebCore::StorageAreaProxy::dispatchSessionStorageEvent):
+ * src/WebDOMMessageEvent.cpp:
+ (WebKit::WebDOMMessageEvent::initMessageEvent):
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::performance):
+ (WebKit::WebFrameImpl::addMessageToConsole):
+ (WebKit::WebFrameImpl::unloadListenerCount):
+ (WebKit::WebFrameImpl::addEventListener):
+ (WebKit::WebFrameImpl::removeEventListener):
+ (WebKit::WebFrameImpl::dispatchEvent):
+ (WebKit::WebFrameImpl::dispatchMessageEventWithOriginCheck):
+ (WebKit::WebFrameImpl::deliverIntent):
+ * src/WebPagePopupImpl.cpp:
+ (WebKit::WebPagePopupImpl::initPage):
+
+2012-08-14 Iain Merrick <husky@chromium.org>
+
+ [chromium] Add a test to WebFrameTest for selectRange and visiblePositionForWindowPoint.
+ https://bugs.webkit.org/show_bug.cgi?id=93108
+
+ Reviewed by Adam Barth.
+
+ Adds a new test WebFrameTest.SelectRange. This tests WebFrameImpl::selectRange,
+ and also serves to test WebFrameImpl::visiblePositionForWindowPoint as it is
+ used by selectRange.
+
+ The test uses sample files that contain selected text on load. The test uses
+ WebViewImpl::selectionBounds to get the coordinates, deselects all, then
+ calls WebFrameImpl::selectRange to attempt to reselect the same text.
+
+ Four cases are tested:
+ - the basic case
+ - the case where the selected text is offscreen due to a scroll
+ - the case where the selected text is in an iframe
+ - the case where the selected text is in an editable element
+
+ * tests/WebFrameTest.cpp:
+ * tests/data/select_range_basic.html: Added.
+ * tests/data/select_range_editable.html: Added.
+ * tests/data/select_range_iframe.html: Added.
+ * tests/data/select_range_scroll.html: Added.
+
+2012-08-14 Joshua Bell <jsbell@chromium.org>
+
+ IndexedDB: Pass cursor continue results back in callback
+ https://bugs.webkit.org/show_bug.cgi?id=92278
+
+ Reviewed by Tony Chang.
+
+ Supply the updated cursor key/primaryKey/value in the success callback,
+ rather than forcing the callee to make three calls into the back end to
+ fetch them. Callbacks onSuccess(cursor) and onSuccessWithContinuation()
+ are given the three new payload parameters (and the latter is renamed.)
+
+ * public/WebIDBCallbacks.h:
+ (WebIDBCallbacks):
+ (WebKit::WebIDBCallbacks::onSuccess): Replace with no-op stub.
+ (WebKit::WebIDBCallbacks::onSuccessWithContinuation): Ditto.
+ * public/WebIDBCursor.h:
+ (WebIDBCursor): Methods can be removed once Chromium is cleaned up.
+ * src/IDBCallbacksProxy.cpp: Updated callbacks.
+ (WebKit::IDBCallbacksProxy::onSuccess):
+ (WebKit):
+ * src/IDBCallbacksProxy.h: Updated callbacks.
+ (IDBCallbacksProxy):
+ * src/IDBCursorBackendProxy.cpp: Remove back end accessors.
+ * src/IDBCursorBackendProxy.h:
+ (IDBCursorBackendProxy):
+ * src/WebIDBCallbacksImpl.cpp: Updated callbacks.
+ (WebKit::WebIDBCallbacksImpl::onSuccess):
+ * src/WebIDBCallbacksImpl.h: Updated callbacks.
+ (WebIDBCallbacksImpl):
+ * src/WebIDBCursorImpl.cpp: Remove back end accessors.
+ * src/WebIDBCursorImpl.h: Remove back end accessors.
+ (WebIDBCursorImpl):
+ * tests/IDBAbortOnCorruptTest.cpp: Update test stubs.
+ (WebCore::MockIDBCallbacks::onSuccess):
+ * tests/IDBDatabaseBackendTest.cpp: Ditto.
+ * tests/IDBRequestTest.cpp: Ditto.
+
+2012-08-14 Peter Beverloo <peter@chromium.org>
+
+ [Chromium] Remove unneeded build logic for Android
+ https://bugs.webkit.org/show_bug.cgi?id=93962
+
+ Reviewed by Dimitri Glazkov.
+
+ The Android SDK and NDK have been checked in to the Chromium tree, which
+ allows WebKit to leverage those as well. They will already be pulled in
+ through a DEPS change made last week, and by not setting the ANDROID_NDK_ROOT
+ environment variable, the envsetup.sh will set the project files up
+ appropriately for us.
+
+ * DEPS:
+
+2012-08-14 Peter Beverloo <peter@chromium.org>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
+2012-08-14 Peter Beverloo <peter@chromium.org>
+
+ [Chromium] Fix apk generation for the Android platform
+ https://bugs.webkit.org/show_bug.cgi?id=93841
+
+ Unreviewed build fix (step 2).
+
+ The path from webkit_unit_tests isn't robust enough. Use the same
+ convention as the Chromium side, i.e. walk up from the ant_build_out path.
+ One-line Android-only gyp change.
+
+ * WebKitUnitTests.gyp:
+
+2012-08-14 Peter Beverloo <peter@chromium.org>
+
+ [Chromium] Fix apk generation for the Android platform
+ https://bugs.webkit.org/show_bug.cgi?id=93841
+
+ Unreviewed build fix.
+
+ APK generation was broken as the configuration file assumed compilation
+ would only occur in the Chromium tree. Pass the path to Chromium's source
+ base directory as a property to ant.
+
+ * WebKitUnitTests.gyp:
+
+2012-08-13 Tom Sepez <tsepez@chromium.org>
+
+ [chromium] release FrameLoaderClientImpl::m_pluginWidget refptr upon Plugin Document detach.
+ https://bugs.webkit.org/show_bug.cgi?id=93283
+
+ Reviewed by Eric Seidel.
+
+ Change the client redirectDataToPlugin method(s) to expect the possibility of
+ a NULL argument, NULLing Chromium's refptr that needs to be NULLed.
+
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::redirectDataToPlugin):
+
+2012-08-13 Eric Penner <epenner@google.com>
+
+ [chromium] Paint animated layers immediately to avoid animation hiccups.
+ https://bugs.webkit.org/show_bug.cgi?id=93028
+
+ Reviewed by Adrienne Walker.
+
+ Replaced one test. Test painting full animated layer.
+
+ * tests/TiledLayerChromiumTest.cpp:
+
+2012-08-12 Shawn Singh <shawnsingh@chromium.org>
+
+ [chromium] renderSurface in incorrect space if owning layer has empty but non-zero bounds
+ https://bugs.webkit.org/show_bug.cgi?id=93795
+
+ Reviewed by Adrienne Walker.
+
+ * tests/CCLayerTreeHostCommonTest.cpp:
+
+2012-08-13 James Robinson <jamesr@chromium.org>
+
+ [chromium] Make WebAnimation a pure virtual interface to hide implementation and avoid unresolved symbols
+ https://bugs.webkit.org/show_bug.cgi?id=93907
+
+ Reviewed by Darin Fisher.
+
+ Adds a WebAnimationImpl implementation of the WebAnimation interface.
+
+ * WebKit.gyp:
+ * src/WebAnimationImpl.cpp: Renamed from Source/WebKit/chromium/src/WebAnimation.cpp.
+ (WebKit):
+ (WebKit::WebAnimation::create):
+ (WebKit::WebAnimationImpl::targetProperty):
+ (WebKit::WebAnimationImpl::iterations):
+ (WebKit::WebAnimationImpl::setIterations):
+ (WebKit::WebAnimationImpl::startTime):
+ (WebKit::WebAnimationImpl::setStartTime):
+ (WebKit::WebAnimationImpl::timeOffset):
+ (WebKit::WebAnimationImpl::setTimeOffset):
+ (WebKit::WebAnimationImpl::alternatesDirection):
+ (WebKit::WebAnimationImpl::setAlternatesDirection):
+ (WebKit::WebAnimationImpl::cloneToCCAnimation):
+ * src/WebAnimationImpl.h: Added.
+ (WebCore):
+ (WebKit):
+ (WebAnimationImpl):
+ (WebKit::WebAnimationImpl::WebAnimationImpl):
+ (WebKit::WebAnimationImpl::~WebAnimationImpl):
+ * src/WebLayer.cpp:
+ (WebKit::WebLayer::addAnimation):
+ * tests/WebAnimationTest.cpp:
+ (WebKit::TEST):
+
+2012-08-10 James Robinson <jamesr@chromium.org>
+
+ [chromium] Clean up dependencies for Canvas2DLayerBridgeTest and GraphicsLayerChromiumTest unit tests
+ https://bugs.webkit.org/show_bug.cgi?id=93757
+
+ Reviewed by Adrienne Walker.
+
+ Breaks up some unit tests and removes unused code to avoid unit tests depending on both non-compositor WebCore
+ logic and compositor internals. Canvas2DLayerBridgeTest had some vestigal includes and local variables that
+ weren't being used, those are removed. GraphicsLayerChromiumTest was reaching into CC types, but could mostly
+ use Platform API types for testing.
+
+ GraphicsLayerChromiumTest had some tests that were verifying that we could correctly translate WebCore
+ animation lists into CCAnimation types - these have been moved into AnimationTranslationUtilTest.cpp, since the
+ logic under test is in AnimationTranslationUtil. Currently these only test that we accept / reject animations as
+ expected. They could be expanded to verify that the animation was translated faithfully, but that would require
+ expanding the information exposed on WebAnimation.
+
+ * WebKit.gypi:
+ * src/WebLayer.cpp:
+ (WebKit::WebLayer::hasActiveAnimation):
+ (WebKit):
+ * tests/Canvas2DLayerBridgeTest.cpp:
+ (Canvas2DLayerBridgeTest::fullLifecycleTest):
+ * tests/GraphicsLayerChromiumTest.cpp:
+ (WebKit::GraphicsLayerChromiumTest::GraphicsLayerChromiumTest):
+ (WebKit::GraphicsLayerChromiumTest::~GraphicsLayerChromiumTest):
+ (GraphicsLayerChromiumTest):
+ (WebKit::TEST_F):
+ * tests/WebLayerTreeViewTest.cpp:
+ * tests/WebLayerTreeViewTestCommon.h: Added.
+ (WebKit):
+ (MockWebLayerTreeViewClient):
+
+2012-08-13 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125422.
+ http://trac.webkit.org/changeset/125422
+ https://bugs.webkit.org/show_bug.cgi?id=93902
+
+ Broke the Android canary build (Requested by fmalita on
+ #webkit).
+
+ * WebKitUnitTests.gyp:
+
+2012-08-13 Leandro Gracia Gil <leandrogracia@chromium.org>
+
+ [Chromium] Fix nits in the find-in-page match rects API
+ https://bugs.webkit.org/show_bug.cgi?id=93817
+
+ Reviewed by Adam Barth.
+
+ This patch fixes a few pending nits from 93111.
+
+ * src/FindInPageCoordinates.cpp: replace a pointer by a reference in an output argument.
+ (WebKit::toNormalizedRect):
+ (WebKit::findInPageRectFromAbsoluteRect):
+
+2012-08-13 Peter Beverloo <peter@chromium.org>
+
+ [Chromium] Fix apk generation for the Android platform
+ https://bugs.webkit.org/show_bug.cgi?id=93841
+
+ Reviewed by Dimitri Glazkov.
+
+ APK generation was broken as the configuration file assumed compilation
+ would only occur in the Chromium tree. Pass the path to Chromium's source
+ base directory as a property to ant.
+
+ * WebKitUnitTests.gyp:
+
+2012-08-13 Peter Beverloo <peter@chromium.org>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
+2012-08-13 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
+2012-08-13 Peter Beverloo <peter@chromium.org>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
+2012-08-10 Kinuko Yasuda <kinuko@chromium.org>
+
+ Support creating File object from FileSystem URL for files in FileSystem API
+ https://bugs.webkit.org/show_bug.cgi?id=93706
+
+ Reviewed by Darin Fisher.
+
+ * src/WebBlobData.cpp:
+ (WebKit::WebBlobData::itemAt):
+
+2012-08-12 Yuta Kitamura <yutak@google.com>
+
+ Unreviewed. Fix Chromium's Android build.
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::find): Needs parentheses for a function call.
+
+2012-08-12 Leandro Gracia Gil <leandrogracia@chromium.org>
+
+ [Chromium] Implement the find-in-page match rects API
+ https://bugs.webkit.org/show_bug.cgi?id=93111
+
+ Reviewed by Adam Barth.
+
+ Implement the funcionality of the find-in-page match rects API in WebFrame.
+ These methods keep a cache of the match rects in a special coordinate system
+ (find-in-page coordinates) and update them on size changes. They also allow
+ to recover the match closest to a given point, therefore enabling to move
+ to find matches when tapping on their corresponding tickmarks.
+
+ * WebKit.gyp: add FindInPageCoordinates.h / cpp.
+ * src/ChromeClientImpl.cpp:
+ (WebKit::ChromeClientImpl::contentsSizeChanged): propagate didChangeContentsSize to WebFrameImpl.
+ * src/FindInPageCoordinates.cpp: Added.
+ (WebKit):
+ (WebKit::toNormalizedRect): auxiliary internal function.
+ (WebKit::findInPageRectFromAbsoluteRect): main coordinate conversion function.
+ (WebKit::findInPageRectFromRange): convenience conversion function for Ranges.
+ * src/FindInPageCoordinates.h: Added.
+ (WebCore):
+ (WebKit):
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::FindMatch::FindMatch): find matches cache constructor.
+ (WebKit):
+ (WebKit::WebFrameImpl::find): clear match cache when appropriate and zoom into results on the Android port.
+ (WebKit::WebFrameImpl::stopFinding): clear matches cache.
+ (WebKit::WebFrameImpl::scopeStringMatches): add new results to the matches cache.
+ (WebKit::WebFrameImpl::increaseMatchCount): update the matches cache version.
+ (WebKit::WebFrameImpl::resetMatchCount): update the matches cache version.
+ (WebKit::WebFrameImpl::findMatchMarkersVersion): new API providing the matches cache version.
+ (WebKit::WebFrameImpl::clearFindMatchesCache): internal utility method to reset the matches cache.
+ (WebKit::WebFrameImpl::isActiveMatchFrameValid): internal utility method to check if the local frame is still in the frame tree.
+ (WebKit::WebFrameImpl::updateFindMatchRects): internal utility method to update the match result rects if required.
+ (WebKit::WebFrameImpl::activeFindMatchRect): new API providing the active find match rect in find-in-page coordinates.
+ (WebKit::WebFrameImpl::findMatchRects): new API returning the valid match rects in find-in-page coordinates.
+ (WebKit::WebFrameImpl::appendFindMatchRects): internal utility method to concatenate the match results of multiple frames.
+ (WebKit::WebFrameImpl::selectNearestFindMatch): new API selecting the find match closer to a point in find-in-page coordinates.
+ (WebKit::WebFrameImpl::nearestFindMatch): internal utility method to find the nearest find match to a point in a frame.
+ (WebKit::WebFrameImpl::selectFindMatch): internal utility method to select a match in the cache.
+ (WebKit::WebFrameImpl::WebFrameImpl): initialization of new variables.
+ (WebKit::WebFrameImpl::didChangeContentsSize): invalidate the cached match rect coordinates on frame content size changes.
+ * src/WebFrameImpl.h:
+ (WebCore):
+ (WebFrameImpl):
+ (WebKit::WebFrameImpl::activeMatchFrame): remove unrequired const.
+ (WebKit::WebFrameImpl::activeMatch): expose the range of the active match to allow testing.
+ (FindMatch): cache structure for find matches.
+ * tests/WebFrameTest.cpp: new test case for find-in-page match rects.
+ * tests/data/find_in_page.html: Added. Test case layout.
+ * tests/data/find_in_page_frame.html: Added. Test case layout.
+
2012-08-09 James Robinson <jamesr@chromium.org>
[chromium] Remove forwarding headers for compositor-related WebKit API and update includes
diff --git a/Source/WebKit/chromium/DEPS b/Source/WebKit/chromium/DEPS
index 3f938525d..eb01ba514 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': '151128'
+ 'chromium_rev': '152373'
}
deps = {
@@ -58,6 +58,8 @@ deps = {
From('chromium_deps', 'src/third_party/skia/src'),
'third_party/skia/include':
From('chromium_deps', 'src/third_party/skia/include'),
+ 'third_party/skia/gyp':
+ From('chromium_deps', 'src/third_party/skia/gyp'),
# testing
'testing':
@@ -181,8 +183,6 @@ deps_os = {
'android': {
'third_party/android_tools':
From('chromium_deps', 'src/third_party/android_tools'),
- 'third_party/aosp':
- From('chromium_deps', 'src/third_party/aosp'),
'third_party/freetype':
From('chromium_deps', 'src/third_party/freetype'),
'tools/android':
diff --git a/Source/WebKit/chromium/WebKit.gyp b/Source/WebKit/chromium/WebKit.gyp
index 36ecf80f5..e226db13a 100644
--- a/Source/WebKit/chromium/WebKit.gyp
+++ b/Source/WebKit/chromium/WebKit.gyp
@@ -54,6 +54,10 @@
# stored as is. Otherwise, a concatenated file is stored.
'debug_devtools%': 0,
+ # If set to 1, links against the compositor bindings from the chromium repository
+ # instead of the compositor-implementation binding files in WebKit/chromium/src.
+ 'use_libcc_for_compositor%': 0,
+
# List of DevTools source files, ordered by dependencies. It is used both
# for copying them to resource dir, and for generating 'devtools.html' file.
'devtools_files': [
@@ -386,6 +390,8 @@
'src/EventListenerWrapper.h',
'src/ExternalPopupMenu.cpp',
'src/ExternalPopupMenu.h',
+ 'src/FindInPageCoordinates.cpp',
+ 'src/FindInPageCoordinates.h',
'src/FrameLoaderClientImpl.cpp',
'src/FrameLoaderClientImpl.h',
'src/FrameNetworkingContextImpl.h',
@@ -468,11 +474,8 @@
'src/WebTextCheckingCompletionImpl.cpp',
'src/WebTextCheckingResult.cpp',
'src/WebAccessibilityObject.cpp',
- 'src/WebAnimation.cpp',
'src/WebAnimationControllerImpl.cpp',
'src/WebAnimationControllerImpl.h',
- 'src/WebAnimationCurveCommon.cpp',
- 'src/WebAnimationCurveCommon.h',
'src/WebArrayBuffer.cpp',
'src/WebArrayBufferView.cpp',
'src/WebBindings.cpp',
@@ -481,11 +484,6 @@
'src/WebCache.cpp',
'src/WebColorName.cpp',
'src/WebCommon.cpp',
- 'src/WebCompositorInputHandlerImpl.cpp',
- 'src/WebCompositorInputHandlerImpl.h',
- 'src/WebContentLayer.cpp',
- 'src/WebContentLayerImpl.cpp',
- 'src/WebContentLayerImpl.h',
'src/WebCrossOriginPreflightResultCache.cpp',
'src/WebCursorInfo.cpp',
'src/WebDOMEvent.cpp',
@@ -512,12 +510,10 @@
'src/WebElement.cpp',
'src/WebEntities.cpp',
'src/WebEntities.h',
- 'src/WebExternalTextureLayer.cpp',
'src/WebFileChooserCompletionImpl.cpp',
'src/WebFileChooserCompletionImpl.h',
'src/WebFileSystemCallbacksImpl.cpp',
'src/WebFileSystemCallbacksImpl.h',
- 'src/WebFloatAnimationCurve.cpp',
'src/WebFontCache.cpp',
'src/WebFontDescription.cpp',
'src/WebFontImpl.cpp',
@@ -561,9 +557,7 @@
'src/WebIDBTransactionImpl.h',
'src/WebIDBTransactionCallbacksImpl.cpp',
'src/WebIDBTransactionCallbacksImpl.h',
- 'src/WebIOSurfaceLayer.cpp',
'src/WebImageDecoder.cpp',
- 'src/WebImageLayer.cpp',
'src/WebImageSkia.cpp',
'src/WebInputElement.cpp',
'src/WebInputEvent.cpp',
@@ -574,12 +568,6 @@
'src/WebIntentServiceInfo.cpp',
'src/WebKit.cpp',
'src/WebLabelElement.cpp',
- 'src/WebLayer.cpp',
- 'src/WebLayerImpl.cpp',
- 'src/WebLayerImpl.h',
- 'src/WebLayerTreeView.cpp',
- 'src/WebLayerTreeViewImpl.cpp',
- 'src/WebLayerTreeViewImpl.h',
'src/WebMediaPlayerClientImpl.cpp',
'src/WebMediaPlayerClientImpl.h',
'src/WebMediaStreamRegistry.cpp',
@@ -615,8 +603,6 @@
'src/WebScopedMicrotaskSuppression.cpp',
'src/WebScopedUserGesture.cpp',
'src/WebScriptController.cpp',
- 'src/WebScrollbarLayer.cpp',
- 'src/WebScrollableLayer.cpp',
'src/WebScrollbarImpl.cpp',
'src/WebScrollbarImpl.h',
'src/WebScrollbarThemeClientImpl.cpp',
@@ -635,8 +621,6 @@
'src/WebSocket.cpp',
'src/WebSocketImpl.cpp',
'src/WebSocketImpl.h',
- 'src/WebSolidColorLayer.cpp',
- 'src/WebSolidColorLayerImpl.cpp',
'src/WebSpeechGrammar.cpp',
'src/WebSpeechInputResult.cpp',
'src/WebSpeechRecognitionHandle.cpp',
@@ -647,12 +631,10 @@
'src/WebSurroundingText.cpp',
'src/WebTextInputInfo.cpp',
'src/WebTextRun.cpp',
- 'src/WebTransformAnimationCurve.cpp',
'src/WebURLLoadTiming.cpp',
'src/WebScopedUserGesture.cpp',
'src/WebTextFieldDecoratorClient.cpp',
'src/WebUserMediaRequest.cpp',
- 'src/WebVideoLayer.cpp',
'src/WebViewBenchmarkSupportImpl.cpp',
'src/WebViewBenchmarkSupportImpl.h',
'src/WebViewImpl.cpp',
@@ -850,6 +832,15 @@
'WARNING_CFLAGS': ['-Wglobal-constructors'],
},
}],
+ ['use_libcc_for_compositor==1', {
+ 'dependencies': [
+ '<(chromium_src_dir)/webkit/compositor/compositor.gyp:webkit_compositor',
+ ],
+ }, { # else: use_libcc_for_compositor==0
+ 'sources': [
+ '<@(webkit_compositor_bindings_files)',
+ ]
+ }],
],
'target_conditions': [
['OS=="android"', {
@@ -870,6 +861,14 @@
'conditions': [
['debug_devtools==0', {
'dependencies': ['concatenated_devtools_js',
+ 'concatenated_devtools_elements_js',
+ 'concatenated_devtools_resources_js',
+ 'concatenated_devtools_network_js',
+ 'concatenated_devtools_scripts_js',
+ 'concatenated_devtools_timeline_js',
+ 'concatenated_devtools_profiles_js',
+ 'concatenated_devtools_audits_js',
+ 'concatenated_devtools_codemirror_js',
'concatenated_heap_snapshot_worker_js',
'concatenated_script_formatter_worker_js',
'concatenated_devtools_css'],
@@ -950,6 +949,14 @@
'conditions': [
['debug_devtools==0', {
'dependencies': ['concatenated_devtools_js',
+ 'concatenated_devtools_elements_js',
+ 'concatenated_devtools_resources_js',
+ 'concatenated_devtools_network_js',
+ 'concatenated_devtools_scripts_js',
+ 'concatenated_devtools_timeline_js',
+ 'concatenated_devtools_profiles_js',
+ 'concatenated_devtools_audits_js',
+ 'concatenated_devtools_codemirror_js',
'concatenated_heap_snapshot_worker_js',
'concatenated_script_formatter_worker_js',
'concatenated_devtools_css'],
@@ -966,11 +973,18 @@
'input_pages': [
'<(PRODUCT_DIR)/resources/inspector/devtools.html',
'<(PRODUCT_DIR)/resources/inspector/DevTools.js',
+ '<(PRODUCT_DIR)/resources/inspector/ElementsPanel.js',
+ '<(PRODUCT_DIR)/resources/inspector/ResourcesPanel.js',
+ '<(PRODUCT_DIR)/resources/inspector/NetworkPanel.js',
+ '<(PRODUCT_DIR)/resources/inspector/ScriptsPanel.js',
+ '<(PRODUCT_DIR)/resources/inspector/TimelinePanel.js',
+ '<(PRODUCT_DIR)/resources/inspector/ProfilesPanel.js',
+ '<(PRODUCT_DIR)/resources/inspector/AuditsPanel.js',
+ '<(PRODUCT_DIR)/resources/inspector/CodeMirrorTextEditor.js',
'<(PRODUCT_DIR)/resources/inspector/HeapSnapshotWorker.js',
'<(PRODUCT_DIR)/resources/inspector/ScriptFormatterWorker.js',
'<(PRODUCT_DIR)/resources/inspector/devTools.css',
'<(PRODUCT_DIR)/resources/inspector/devtools_extension_api.js',
- '<@(webinspector_standalone_js_files)',
'<@(webinspector_standalone_css_files)',
],
'images': [
@@ -1086,11 +1100,133 @@
'outputs': ['<(PRODUCT_DIR)/resources/inspector/DevTools.js'],
'action': ['python', '<@(_script_name)', '<@(_input_page)', '<@(_search_path)', '<@(_outputs)'],
}],
- 'copies': [{
- 'destination': '<(PRODUCT_DIR)/resources/inspector',
- 'files': [
- '<@(webinspector_standalone_js_files)',
+ },
+ {
+ 'target_name': 'concatenated_devtools_elements_js',
+ 'type': 'none',
+ 'actions': [{
+ 'action_name': 'concatenate_devtools_elements_js',
+ 'script_name': 'scripts/inline_js_imports.py',
+ 'input_file': '../../WebCore/inspector/front-end/ElementsPanel.js',
+ 'inputs': [
+ '<@(_script_name)',
+ '<@(webinspector_elements_js_files)',
+ ],
+ 'search_path': '../../WebCore/inspector/front-end',
+ 'outputs': ['<(PRODUCT_DIR)/resources/inspector/ElementsPanel.js'],
+ 'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
+ }],
+ },
+ {
+ 'target_name': 'concatenated_devtools_resources_js',
+ 'type': 'none',
+ 'actions': [{
+ 'action_name': 'concatenate_devtools_resources_js',
+ 'script_name': 'scripts/inline_js_imports.py',
+ 'input_file': '../../WebCore/inspector/front-end/ResourcesPanel.js',
+ 'inputs': [
+ '<@(_script_name)',
+ '<@(webinspector_resources_js_files)',
+ ],
+ 'search_path': '../../WebCore/inspector/front-end',
+ 'outputs': ['<(PRODUCT_DIR)/resources/inspector/ResourcesPanel.js'],
+ 'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
+ }],
+ },
+ {
+ 'target_name': 'concatenated_devtools_network_js',
+ 'type': 'none',
+ 'actions': [{
+ 'action_name': 'concatenate_devtools_network_js',
+ 'script_name': 'scripts/inline_js_imports.py',
+ 'input_file': '../../WebCore/inspector/front-end/NetworkPanel.js',
+ 'inputs': [
+ '<@(_script_name)',
+ '<@(webinspector_network_js_files)',
+ ],
+ 'search_path': '../../WebCore/inspector/front-end',
+ 'outputs': ['<(PRODUCT_DIR)/resources/inspector/NetworkPanel.js'],
+ 'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
+ }],
+ },
+ {
+ 'target_name': 'concatenated_devtools_scripts_js',
+ 'type': 'none',
+ 'actions': [{
+ 'action_name': 'concatenate_devtools_scripts_js',
+ 'script_name': 'scripts/inline_js_imports.py',
+ 'input_file': '../../WebCore/inspector/front-end/ScriptsPanel.js',
+ 'inputs': [
+ '<@(_script_name)',
+ '<@(webinspector_scripts_js_files)',
+ ],
+ 'search_path': '../../WebCore/inspector/front-end',
+ 'outputs': ['<(PRODUCT_DIR)/resources/inspector/ScriptsPanel.js'],
+ 'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
+ }],
+ },
+ {
+ 'target_name': 'concatenated_devtools_timeline_js',
+ 'type': 'none',
+ 'actions': [{
+ 'action_name': 'concatenate_devtools_timeline_js',
+ 'script_name': 'scripts/inline_js_imports.py',
+ 'input_file': '../../WebCore/inspector/front-end/TimelinePanel.js',
+ 'inputs': [
+ '<@(_script_name)',
+ '<@(webinspector_resources_js_files)',
+ ],
+ 'search_path': '../../WebCore/inspector/front-end',
+ 'outputs': ['<(PRODUCT_DIR)/resources/inspector/TimelinePanel.js'],
+ 'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
+ }],
+ },
+ {
+ 'target_name': 'concatenated_devtools_profiles_js',
+ 'type': 'none',
+ 'actions': [{
+ 'action_name': 'concatenate_devtools_profiles_js',
+ 'script_name': 'scripts/inline_js_imports.py',
+ 'input_file': '../../WebCore/inspector/front-end/ProfilesPanel.js',
+ 'inputs': [
+ '<@(_script_name)',
+ '<@(webinspector_profiles_js_files)',
],
+ 'search_path': '../../WebCore/inspector/front-end',
+ 'outputs': ['<(PRODUCT_DIR)/resources/inspector/ProfilesPanel.js'],
+ 'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
+ }],
+ },
+ {
+ 'target_name': 'concatenated_devtools_audits_js',
+ 'type': 'none',
+ 'actions': [{
+ 'action_name': 'concatenate_devtools_audits_js',
+ 'script_name': 'scripts/inline_js_imports.py',
+ 'input_file': '../../WebCore/inspector/front-end/AuditsPanel.js',
+ 'inputs': [
+ '<@(_script_name)',
+ '<@(webinspector_audits_js_files)',
+ ],
+ 'search_path': '../../WebCore/inspector/front-end',
+ 'outputs': ['<(PRODUCT_DIR)/resources/inspector/AuditsPanel.js'],
+ 'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
+ }],
+ },
+ {
+ 'target_name': 'concatenated_devtools_codemirror_js',
+ 'type': 'none',
+ 'actions': [{
+ 'action_name': 'concatenate_devtools_codemirror_js',
+ 'script_name': 'scripts/inline_js_imports.py',
+ 'input_file': '../../WebCore/inspector/front-end/CodeMirrorTextEditor.js',
+ 'inputs': [
+ '<@(_script_name)',
+ '<@(webinspector_codemirror_js_files)',
+ ],
+ 'search_path': '../../WebCore/inspector/front-end',
+ 'outputs': ['<(PRODUCT_DIR)/resources/inspector/CodeMirrorTextEditor.js'],
+ 'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)', 'true'],
}],
},
{
diff --git a/Source/WebKit/chromium/WebKit.gypi b/Source/WebKit/chromium/WebKit.gypi
index 9d041a18d..fc86f83b3 100644
--- a/Source/WebKit/chromium/WebKit.gypi
+++ b/Source/WebKit/chromium/WebKit.gypi
@@ -52,6 +52,7 @@
'src/js/Images/segmentSelectedEndChromium.png',
],
'webkit_unittest_files': [
+ 'tests/AnimationTranslationUtilTest.cpp',
'tests/ArenaTestHelpers.h',
'tests/AssociatedURLLoaderTest.cpp',
'tests/Canvas2DLayerBridgeTest.cpp',
@@ -139,6 +140,7 @@
'tests/PODArenaTest.cpp',
'tests/PODIntervalTreeTest.cpp',
'tests/PODRedBlackTreeTest.cpp',
+ 'tests/PopupContainerTest.cpp',
'tests/CCPrioritizedTextureTest.cpp',
'tests/RegionTest.cpp',
'tests/RenderTableCellTest.cpp',
@@ -160,6 +162,7 @@
'tests/WebFrameTest.cpp',
'tests/WebLayerTest.cpp',
'tests/WebLayerTreeViewTest.cpp',
+ 'tests/WebLayerTreeViewTestCommon.h',
'tests/WebMediaPlayerClientImplTest.cpp',
'tests/WebPageNewSerializerTest.cpp',
'tests/WebPageSerializerTest.cpp',
@@ -173,6 +176,36 @@
'tests/WebViewTest.cpp',
],
+ 'webkit_compositor_bindings_files': [
+ 'src/WebAnimationCurveCommon.cpp',
+ 'src/WebAnimationCurveCommon.h',
+ 'src/WebAnimationImpl.cpp',
+ 'src/WebAnimationImpl.h',
+ 'src/WebCompositorInputHandlerImpl.cpp',
+ 'src/WebCompositorInputHandlerImpl.h',
+ 'src/WebContentLayerImpl.cpp',
+ 'src/WebContentLayerImpl.h',
+ 'src/WebExternalTextureLayerImpl.cpp',
+ 'src/WebExternalTextureLayerImpl.h',
+ 'src/WebFloatAnimationCurve.cpp',
+ 'src/WebIOSurfaceLayerImpl.cpp',
+ 'src/WebIOSurfaceLayerImpl.h',
+ 'src/WebImageLayerImpl.cpp',
+ 'src/WebImageLayerImpl.h',
+ 'src/WebLayerImpl.cpp',
+ 'src/WebLayerImpl.h',
+ 'src/WebLayerTreeView.cpp',
+ 'src/WebLayerTreeViewImpl.cpp',
+ 'src/WebLayerTreeViewImpl.h',
+ 'src/WebScrollbarLayerImpl.cpp',
+ 'src/WebScrollbarLayerImpl.h',
+ 'src/WebSolidColorLayerImpl.cpp',
+ 'src/WebSolidColorLayerImpl.h',
+ 'src/WebTransformAnimationCurve.cpp',
+ 'src/WebVideoLayerImpl.cpp',
+ 'src/WebVideoLayerImpl.h',
+ ],
+
'conditions': [
['OS=="win"', {
'webkit_unittest_files': [
diff --git a/Source/WebKit/chromium/WebKitUnitTests.gyp b/Source/WebKit/chromium/WebKitUnitTests.gyp
index b05a55271..a77392ef4 100644
--- a/Source/WebKit/chromium/WebKitUnitTests.gyp
+++ b/Source/WebKit/chromium/WebKitUnitTests.gyp
@@ -147,6 +147,13 @@
'input_jars_paths': [
'<(PRODUCT_DIR)/lib.java/chromium_base.jar',
],
+ 'conditions': [
+ ['inside_chromium_build==1', {
+ 'ant_build_to_chromium_src': '<(ant_build_out)/../../',
+ }, {
+ 'ant_build_to_chromium_src': '<(ant_build_out)/../../Source/WebKit/chromium',
+ }],
+ ],
},
# Part of the following was copied from <(chromium_src_dir)/build/apk_test.gpyi.
# Not including it because gyp include doesn't support variable in path or under
@@ -171,6 +178,7 @@
'"<@(input_jars_paths)"',
'--output',
'<(PRODUCT_DIR)/webkit_unit_tests_apk',
+ '--strip-binary=<(android_strip)',
'--ant-args',
'-DANDROID_SDK=<(android_sdk)',
'--ant-args',
@@ -183,6 +191,8 @@
'-DANDROID_TOOLCHAIN=<(android_toolchain)',
'--ant-args',
'-DPRODUCT_DIR=<(ant_build_out)',
+ '--ant-args',
+ '-DCHROMIUM_SRC=<(ant_build_to_chromium_src)',
'--sdk-build=<(sdk_build)',
'--app_abi',
'<(android_app_abi)',
diff --git a/Source/WebKit/chromium/features.gypi b/Source/WebKit/chromium/features.gypi
index 8dc7e2f6f..6b165fd8e 100644
--- a/Source/WebKit/chromium/features.gypi
+++ b/Source/WebKit/chromium/features.gypi
@@ -39,6 +39,7 @@
'ENABLE_CHANNEL_MESSAGING=1',
'ENABLE_CSP_NEXT=1',
'ENABLE_CSS3_FLEXBOX=1',
+ 'ENABLE_CSS3_TEXT_DECORATION=0',
'ENABLE_CSS_BOX_DECORATION_BREAK=1',
'ENABLE_CSS_COMPOSITING=0',
'ENABLE_CSS_EXCLUSIONS=1',
@@ -51,7 +52,6 @@
'ENABLE_CSS_VARIABLES=1',
'ENABLE_CSS_STICKY_POSITION=1',
'ENABLE_CUSTOM_SCHEME_HANDLER=0',
- 'ENABLE_DATALIST_ELEMENT=1',
'ENABLE_DASHBOARD_SUPPORT=0',
'ENABLE_DATA_TRANSFER_ITEMS=1',
'ENABLE_DETAILS_ELEMENT=1',
@@ -149,6 +149,7 @@
['OS=="android"', {
'feature_defines': [
'ENABLE_CALENDAR_PICKER=0',
+ 'ENABLE_DATALIST_ELEMENT=0',
'ENABLE_INPUT_SPEECH=0',
'ENABLE_INPUT_TYPE_COLOR=0',
'ENABLE_JAVASCRIPT_I18N_API=0',
@@ -170,6 +171,7 @@
}, { # OS!="android"
'feature_defines': [
'ENABLE_CALENDAR_PICKER=1',
+ 'ENABLE_DATALIST_ELEMENT=1',
'ENABLE_INPUT_SPEECH=1',
'ENABLE_INPUT_TYPE_COLOR=1',
'ENABLE_INPUT_TYPE_TIME_MULTIPLE_FIELDS=1',
diff --git a/Source/WebKit/chromium/gyp_webkit b/Source/WebKit/chromium/gyp_webkit
index fb720d97a..36f0f431b 100755
--- a/Source/WebKit/chromium/gyp_webkit
+++ b/Source/WebKit/chromium/gyp_webkit
@@ -87,9 +87,6 @@ if __name__ == '__main__':
envsetup_location = os.path.join(chrome_src, 'build', 'android', 'envsetup.sh')
exit(subprocess.call(['bash', '-c', 'source %s && python gyp_webkit --no-envsetup-recursion %s' % (envsetup_location, ' '.join(args))]))
else:
- # FIXME: v8 requires the CXX_target variable to determine whether -m32 should be
- # set. The current Android build set-up is not sustainable and breaks too often.
- os.environ['CXX_target'] = glob.glob('%s/*-g++' % os.environ.get('ANDROID_TOOLCHAIN'))[0]
args.remove('--no-envsetup-recursion')
# Add includes.
diff --git a/Source/WebKit/chromium/public/WebDevToolsAgent.h b/Source/WebKit/chromium/public/WebDevToolsAgent.h
index 9f1d53f1b..4f90302c8 100644
--- a/Source/WebKit/chromium/public/WebDevToolsAgent.h
+++ b/Source/WebKit/chromium/public/WebDevToolsAgent.h
@@ -66,7 +66,7 @@ public:
virtual void inspectElementAt(const WebPoint&) = 0;
virtual void setProcessId(long) = 0;
- // Exposed for LayoutTestController.
+ // Exposed for TestRunner.
virtual void evaluateInWebInspector(long callId, const WebString& script) = 0;
class MessageDescriptor {
diff --git a/Source/WebKit/chromium/public/WebHistoryItem.h b/Source/WebKit/chromium/public/WebHistoryItem.h
index 015a79beb..2c416f827 100644
--- a/Source/WebKit/chromium/public/WebHistoryItem.h
+++ b/Source/WebKit/chromium/public/WebHistoryItem.h
@@ -124,6 +124,8 @@ public:
WEBKIT_EXPORT void setChildren(const WebVector<WebHistoryItem>&);
WEBKIT_EXPORT void appendToChildren(const WebHistoryItem&);
+ WEBKIT_EXPORT WebVector<WebString> getReferencedFilePaths() const;
+
#if WEBKIT_IMPLEMENTATION
WebHistoryItem(const WTF::PassRefPtr<WebCore::HistoryItem>&);
WebHistoryItem& operator=(const WTF::PassRefPtr<WebCore::HistoryItem>&);
diff --git a/Source/WebKit/chromium/public/WebIDBCallbacks.h b/Source/WebKit/chromium/public/WebIDBCallbacks.h
index 655b009e0..358b73b17 100644
--- a/Source/WebKit/chromium/public/WebIDBCallbacks.h
+++ b/Source/WebKit/chromium/public/WebIDBCallbacks.h
@@ -50,17 +50,13 @@ public:
// For the rest, pass ownership to the callee via a pointer.
virtual void onError(const WebIDBDatabaseError&) { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void onSuccess(const WebDOMStringList&) { WEBKIT_ASSERT_NOT_REACHED(); }
- virtual void onSuccess(WebIDBCursor*) { WEBKIT_ASSERT_NOT_REACHED(); }
- // FIXME: Temporary no-op method to allow callers to update before WK92278 lands.
- virtual void onSuccess(WebIDBCursor*, const WebIDBKey& key, const WebIDBKey& primaryKey, const WebSerializedScriptValue&) { }
+ virtual void onSuccess(WebIDBCursor*, const WebIDBKey& key, const WebIDBKey& primaryKey, const WebSerializedScriptValue&) { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void onSuccess(WebIDBDatabase*) { WEBKIT_ASSERT_NOT_REACHED(); }
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(); }
- // FIXME: Temporary no-op method to allow callers to update before WK92278 lands.
- virtual void onSuccess(const WebIDBKey& key, const WebIDBKey& primaryKey, const WebSerializedScriptValue&) { }
+ virtual void onSuccess(const WebIDBKey& key, const WebIDBKey& primaryKey, const WebSerializedScriptValue&) { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void onBlocked() { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void onBlocked(long long oldVersion) { 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/WebIDBCursor.h b/Source/WebKit/chromium/public/WebIDBCursor.h
index ac89d7955..e5846a972 100644
--- a/Source/WebKit/chromium/public/WebIDBCursor.h
+++ b/Source/WebKit/chromium/public/WebIDBCursor.h
@@ -47,22 +47,6 @@ public:
PrevNoDuplicate = 3,
};
- virtual WebIDBKey key() const
- {
- WEBKIT_ASSERT_NOT_REACHED();
- return WebIDBKey::createInvalid();
- }
- virtual WebIDBKey primaryKey() const
- {
- WEBKIT_ASSERT_NOT_REACHED();
- return WebIDBKey::createInvalid();
- }
- virtual WebSerializedScriptValue value() const
- {
- WEBKIT_ASSERT_NOT_REACHED();
- return WebSerializedScriptValue();
- }
-
virtual void advance(unsigned long, WebIDBCallbacks*, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void continueFunction(const WebIDBKey&, WebIDBCallbacks*, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void deleteFunction(WebIDBCallbacks*, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); }
diff --git a/Source/WebKit/chromium/public/WebIDBObjectStore.h b/Source/WebKit/chromium/public/WebIDBObjectStore.h
index ba59c15ee..826965c0d 100644
--- a/Source/WebKit/chromium/public/WebIDBObjectStore.h
+++ b/Source/WebKit/chromium/public/WebIDBObjectStore.h
@@ -73,7 +73,10 @@ public:
}
virtual void deleteIndex(const WebString& name, const WebIDBTransaction&, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); }
// FIXME: Remove this version of openCursor when TaskType is plumbed through chromium.
- virtual void openCursor(const WebIDBKeyRange&, unsigned short direction, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); }
+ virtual void openCursor(const WebIDBKeyRange& range, unsigned short direction, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec)
+ {
+ openCursor(range, static_cast<WebIDBCursor::Direction>(direction), callbacks, WebIDBTransaction::NormalTask, transaction, ec);
+ }
virtual void openCursor(const WebIDBKeyRange&, WebIDBCursor::Direction direction, WebIDBCallbacks*, WebIDBTransaction::TaskType, const WebIDBTransaction&, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void count(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); }
diff --git a/Source/WebKit/chromium/public/WebInputEvent.h b/Source/WebKit/chromium/public/WebInputEvent.h
index 09048cded..d1f5173e9 100644
--- a/Source/WebKit/chromium/public/WebInputEvent.h
+++ b/Source/WebKit/chromium/public/WebInputEvent.h
@@ -370,15 +370,41 @@ public:
int globalX;
int globalY;
- // NOTE: |deltaX| and |deltaY| represents the amount to scroll for Scroll gesture events.
- // For Pinch gesture events, |deltaX| represents the scaling/magnification factor.
- // For a GestureTap event, |deltaX| represents the tap count.
- // For a FlingStart event, |deltaX| and |deltaY| represent the velocity.
- // FIXME: Avoid overloading 'delta' in this way. http://wkb.ug/93123
+ // FIXME: These are currently overloaded. We're in the process of moving
+ // to the union below. http://wkb.ug/93123
float deltaX;
float deltaY;
WebRect boundingBox;
+ union {
+ struct {
+ int tapCount;
+ int width;
+ int height;
+ } tap;
+
+ struct {
+ int width;
+ int height;
+ } longPress;
+
+ struct {
+ float deltaX;
+ float deltaY;
+ float velocityX;
+ float velocityY;
+ } scrollUpdate;
+
+ struct {
+ float velocityX;
+ float velocityY;
+ } flingStart;
+
+ struct {
+ float scale;
+ } pinchUpdate;
+ } data;
+
WebGestureEvent(unsigned sizeParam = sizeof(WebGestureEvent))
: WebInputEvent(sizeParam)
, x(0)
@@ -388,6 +414,7 @@ public:
, deltaX(0.0f)
, deltaY(0.0f)
{
+ memset(&data, 0, sizeof(data));
}
};
diff --git a/Source/WebKit/chromium/public/WebMediaPlayer.h b/Source/WebKit/chromium/public/WebMediaPlayer.h
index 3b8ef6451..ed62754d3 100644
--- a/Source/WebKit/chromium/public/WebMediaPlayer.h
+++ b/Source/WebKit/chromium/public/WebMediaPlayer.h
@@ -187,6 +187,7 @@ public:
virtual bool sourceAppend(const WebString& id, const unsigned char* data, unsigned length) { return false; }
virtual bool sourceAbort(const WebString& id) { return false; }
virtual void sourceEndOfStream(EndOfStreamStatus) { }
+ virtual bool sourceSetTimestampOffset(const WebString& id, double offset) { return false; }
// Returns whether keySystem is supported. If true, the result will be
// reported by an event.
diff --git a/Source/WebKit/chromium/public/WebPermissionClient.h b/Source/WebKit/chromium/public/WebPermissionClient.h
index 5adcde2e0..5d059ef5d 100644
--- a/Source/WebKit/chromium/public/WebPermissionClient.h
+++ b/Source/WebKit/chromium/public/WebPermissionClient.h
@@ -96,6 +96,11 @@ public:
// Controls whether enabling HTML notifications for this frame.
virtual bool allowHTMLNotifications(const WebDocument&) { return true; }
+ // Controls whether to enable MutationEvents for this document.
+ // The common use case of this method is actually to selectively disable MutationEvents,
+ // but it's been named for consistency with the rest of the interface.
+ virtual bool allowMutationEvents(const WebDocument&, bool defaultValue) { return defaultValue; }
+
// Notifies the client that the frame would have instantiated a plug-in if plug-ins were enabled.
virtual void didNotAllowPlugins(WebFrame*) { }
diff --git a/Source/WebKit/chromium/public/WebSpeechInputController.h b/Source/WebKit/chromium/public/WebSpeechInputController.h
index ed930dc2b..386b8ac1a 100644
--- a/Source/WebKit/chromium/public/WebSpeechInputController.h
+++ b/Source/WebKit/chromium/public/WebSpeechInputController.h
@@ -44,7 +44,8 @@ class WebSpeechInputController {
public:
// Starts speech recognition. Speech will get recorded until the endpointer detects silence,
// runs to the limit or stopRecording is called. Progress indications and the recognized
- // text are returned via the listener interface.
+ // text are returned via the listener interface. elementRect is the position
+ // of the element where the user clicked in the RootView coordinate system.
virtual bool startRecognition(int requestId, const WebRect& elementRect, const WebString& language, const WebString& grammar, const WebSecurityOrigin& origin)
{
WEBKIT_ASSERT_NOT_REACHED();
diff --git a/Source/WebKit/chromium/public/WebView.h b/Source/WebKit/chromium/public/WebView.h
index e8f791fa6..45d3dd3c3 100644
--- a/Source/WebKit/chromium/public/WebView.h
+++ b/Source/WebKit/chromium/public/WebView.h
@@ -507,7 +507,7 @@ public:
// level is changed in this update from the previous update).
virtual void updateBatteryStatus(const WebBatteryStatus&) { }
- // Testing functionality for LayoutTestController -----------------------
+ // Testing functionality for TestRunner ---------------------------------
// Simulates a compositor lost context.
virtual void loseCompositorContext(int numTimes) = 0;
diff --git a/Source/WebKit/chromium/public/WebViewClient.h b/Source/WebKit/chromium/public/WebViewClient.h
index 726cc6482..904d4a2d2 100644
--- a/Source/WebKit/chromium/public/WebViewClient.h
+++ b/Source/WebKit/chromium/public/WebViewClient.h
@@ -37,7 +37,6 @@
#include "WebEditingAction.h"
#include "WebFileChooserCompletion.h"
#include "WebFileChooserParams.h"
-#include "WebHitTestResult.h"
#include "WebPageVisibilityState.h"
#include "WebPopupType.h"
#include "WebTextAffinity.h"
@@ -64,6 +63,7 @@ class WebFrame;
class WebGeolocationClient;
class WebGeolocationService;
class WebHelperPlugin;
+class WebHitTestResult;
class WebIconLoadingCompletion;
class WebImage;
class WebInputElement;
@@ -374,9 +374,8 @@ public:
// Retrieves detectable content (e.g., email addresses, phone numbers)
// around a hit test result. The embedder should use platform-specific
- // content detectors (e.g., from the Android intent system) to analyze the
- // region around the hit test result.
- virtual WebContentDetectionResult detectContentIntentAround(const WebHitTestResult&) { return WebContentDetectionResult(); }
+ // content detectors to analyze the region around the hit test result.
+ virtual WebContentDetectionResult detectContentAround(const WebHitTestResult&) { return WebContentDetectionResult(); }
// Schedules a new content intent with the provided url.
virtual void scheduleContentIntent(const WebURL&) { }
diff --git a/Source/WebKit/chromium/scripts/concatenate_js_files.py b/Source/WebKit/chromium/scripts/concatenate_js_files.py
index 82cbe86c4..91c599462 100644
--- a/Source/WebKit/chromium/scripts/concatenate_js_files.py
+++ b/Source/WebKit/chromium/scripts/concatenate_js_files.py
@@ -55,7 +55,6 @@ class OrderedJSFilesExtractor(HTMLParser):
if ('type' in attrs_dict and attrs_dict['type'] == 'text/javascript' and 'src' in attrs_dict):
self.ordered_js_files.append(attrs_dict['src'])
-
class PathExpander:
def __init__(self, paths):
diff --git a/Source/WebKit/chromium/scripts/inline_js_imports.py b/Source/WebKit/chromium/scripts/inline_js_imports.py
index 265501612..776a3fcde 100644
--- a/Source/WebKit/chromium/scripts/inline_js_imports.py
+++ b/Source/WebKit/chromium/scripts/inline_js_imports.py
@@ -43,12 +43,13 @@ import sys
def main(argv):
if len(argv) < 3:
- print('usage: %s input_file imports_dir output_file' % argv[0])
+ print('usage: %s input_file imports_dir output_file no_minify' % argv[0])
return 1
input_file_name = argv[1]
imports_dir = argv[2]
output_file_name = argv[3]
+ no_minify = len(argv) > 4 and argv[4]
input_file = open(input_file_name, 'r')
input_script = input_file.read()
@@ -66,10 +67,12 @@ def main(argv):
import_file.close()
return import_script
- output_script = re.sub(r'importScripts\([\'"]([^\'"]+)[\'"]\)', replace, input_script)
+ output_script = re.sub(r'importScripts?\([\'"]([^\'"]+)[\'"]\)', replace, input_script)
output_file = open(output_file_name, 'w')
- output_file.write(jsmin.jsmin(output_script))
+ if not no_minify:
+ output_script = jsmin.jsmin(output_script)
+ output_file.write(output_script)
output_file.close()
# Touch output file directory to make sure that Xcode will copy
diff --git a/Source/WebKit/chromium/src/AudioDestinationChromium.cpp b/Source/WebKit/chromium/src/AudioDestinationChromium.cpp
index 646e9ef0d..380c74b85 100644
--- a/Source/WebKit/chromium/src/AudioDestinationChromium.cpp
+++ b/Source/WebKit/chromium/src/AudioDestinationChromium.cpp
@@ -32,6 +32,7 @@
#include "AudioDestinationChromium.h"
+#include "AudioFIFO.h"
#include "AudioPullFIFO.h"
#include "WebKit.h"
#include "platform/WebKitPlatformSupport.h"
@@ -59,6 +60,7 @@ PassOwnPtr<AudioDestination> AudioDestination::create(AudioIOCallback& callback,
AudioDestinationChromium::AudioDestinationChromium(AudioIOCallback& callback, float sampleRate)
: m_callback(callback)
+ , m_inputBus(numberOfChannels, renderBufferSize)
, m_renderBus(numberOfChannels, renderBufferSize, false)
, m_sampleRate(sampleRate)
, m_isPlaying(false)
@@ -70,7 +72,7 @@ AudioDestinationChromium::AudioDestinationChromium(AudioIOCallback& callback, fl
ASSERT(m_callbackBufferSize + renderBufferSize <= fifoSize);
if (m_callbackBufferSize + renderBufferSize > fifoSize)
return;
-
+
m_audioDevice = adoptPtr(WebKit::Platform::current()->createAudioDevice(m_callbackBufferSize, numberOfChannels, sampleRate, this));
ASSERT(m_audioDevice);
@@ -80,6 +82,17 @@ AudioDestinationChromium::AudioDestinationChromium(AudioIOCallback& callback, fl
// Otherwise, the FIFO will call the provider enough times to
// satisfy the request for data.
m_fifo = adoptPtr(new AudioPullFIFO(*this, numberOfChannels, fifoSize, renderBufferSize));
+
+ // Input buffering.
+ m_inputFifo = adoptPtr(new AudioFIFO(numberOfChannels, fifoSize));
+
+ // If the callback size does not match the render size, then we need to buffer some
+ // extra silence for the input. Otherwise, we can over-consume the input FIFO.
+ if (m_callbackBufferSize != renderBufferSize) {
+ // FIXME: handle multi-channel input and don't hard-code to stereo.
+ AudioBus silence(2, renderBufferSize);
+ m_inputFifo->push(&silence);
+ }
}
AudioDestinationChromium::~AudioDestinationChromium()
@@ -108,7 +121,37 @@ float AudioDestination::hardwareSampleRate()
return static_cast<float>(WebKit::Platform::current()->audioHardwareSampleRate());
}
+void AudioDestinationChromium::render(const WebVector<float*>& sourceData, const WebVector<float*>& audioData, size_t numberOfFrames)
+{
+ bool isNumberOfChannelsGood = audioData.size() == numberOfChannels;
+ if (!isNumberOfChannelsGood) {
+ ASSERT_NOT_REACHED();
+ return;
+ }
+
+ bool isBufferSizeGood = numberOfFrames == m_callbackBufferSize;
+ if (!isBufferSizeGood) {
+ ASSERT_NOT_REACHED();
+ return;
+ }
+
+ // Buffer optional live input.
+ if (sourceData.size() >= 2) {
+ // FIXME: handle multi-channel input and don't hard-code to stereo.
+ AudioBus wrapperBus(2, numberOfFrames, false);
+ wrapperBus.setChannelMemory(0, sourceData[0], numberOfFrames);
+ wrapperBus.setChannelMemory(1, sourceData[1], numberOfFrames);
+ m_inputFifo->push(&wrapperBus);
+ }
+
+ m_renderBus.setChannelMemory(0, audioData[0], numberOfFrames);
+ m_renderBus.setChannelMemory(1, audioData[1], numberOfFrames);
+
+ m_fifo->consume(&m_renderBus, numberOfFrames);
+}
+
// Pulls on our provider to get the rendered audio stream.
+// FIXME: remove this method when the chromium-side switches over to the synchronized I/O render() method (above).
void AudioDestinationChromium::render(const WebVector<float*>& audioData, size_t numberOfFrames)
{
bool isNumberOfChannelsGood = audioData.size() == numberOfChannels;
@@ -116,7 +159,7 @@ void AudioDestinationChromium::render(const WebVector<float*>& audioData, size_t
ASSERT_NOT_REACHED();
return;
}
-
+
bool isBufferSizeGood = numberOfFrames == m_callbackBufferSize;
if (!isBufferSizeGood) {
ASSERT_NOT_REACHED();
@@ -130,8 +173,13 @@ void AudioDestinationChromium::render(const WebVector<float*>& audioData, size_t
void AudioDestinationChromium::provideInput(AudioBus* bus, size_t framesToProcess)
{
- // FIXME: Add support for local/live audio input.
- m_callback.render(0, bus, framesToProcess);
+ AudioBus* sourceBus = 0;
+ if (m_inputFifo->framesInFifo() >= framesToProcess) {
+ m_inputFifo->consume(&m_inputBus, framesToProcess);
+ sourceBus = &m_inputBus;
+ }
+
+ m_callback.render(sourceBus, bus, framesToProcess);
}
} // namespace WebCore
diff --git a/Source/WebKit/chromium/src/AudioDestinationChromium.h b/Source/WebKit/chromium/src/AudioDestinationChromium.h
index fd676d102..7d261a7fa 100644
--- a/Source/WebKit/chromium/src/AudioDestinationChromium.h
+++ b/Source/WebKit/chromium/src/AudioDestinationChromium.h
@@ -40,6 +40,7 @@ namespace WebKit { class WebAudioDevice; }
namespace WebCore {
+class AudioFIFO;
class AudioPullFIFO;
// An AudioDestination using Chromium's audio system
@@ -56,6 +57,7 @@ public:
float sampleRate() const { return m_sampleRate; }
// WebKit::WebAudioDevice::RenderCallback
+ virtual void render(const WebKit::WebVector<float*>& sourceData, const WebKit::WebVector<float*>& audioData, size_t numberOfFrames);
virtual void render(const WebKit::WebVector<float*>& audioData, size_t numberOfFrames);
// WebCore::AudioSourceProvider
@@ -63,11 +65,14 @@ public:
private:
AudioIOCallback& m_callback;
+ AudioBus m_inputBus;
AudioBus m_renderBus;
float m_sampleRate;
bool m_isPlaying;
OwnPtr<WebKit::WebAudioDevice> m_audioDevice;
size_t m_callbackBufferSize;
+
+ OwnPtr<AudioFIFO> m_inputFifo;
OwnPtr<AudioPullFIFO> m_fifo;
};
diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp
index ad1000e63..329a99f19 100644
--- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp
+++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp
@@ -575,6 +575,7 @@ void ChromeClientImpl::contentsSizeChanged(Frame* frame, const IntSize& size) co
m_webView->didChangeContentsSize();
WebFrameImpl* webframe = WebFrameImpl::fromFrame(frame);
+ webframe->didChangeContentsSize(size);
if (webframe->client())
webframe->client()->didChangeContentsSize(webframe, size);
}
diff --git a/Source/WebKit/chromium/src/ColorChooserUIController.cpp b/Source/WebKit/chromium/src/ColorChooserUIController.cpp
index 28cdc3840..c77634cff 100644
--- a/Source/WebKit/chromium/src/ColorChooserUIController.cpp
+++ b/Source/WebKit/chromium/src/ColorChooserUIController.cpp
@@ -34,6 +34,7 @@
#include "ColorSuggestionPicker.h"
#include "IntRect.h"
#include "LocalizedStrings.h"
+#include "PickerCommon.h"
#include "WebColorChooser.h"
#include "platform/WebColor.h"
#include "platform/WebKitPlatformSupport.h"
@@ -103,12 +104,14 @@ void ColorChooserUIController::writeDocument(WebCore::DocumentWriter& writer)
suggestionValues.append(suggestions[i].serialized());
WebCore::PagePopupClient::addString("<!DOCTYPE html><head><meta charset='UTF-8'><style>\n", writer);
+ writer.addData(WebCore::pickerCommonCss, sizeof(WebCore::pickerCommonCss));
writer.addData(WebCore::colorSuggestionPickerCss, sizeof(WebCore::colorSuggestionPickerCss));
WebCore::PagePopupClient::addString("</style></head><body><div id=main>Loading...</div><script>\n"
"window.dialogArguments = {\n", writer);
WebCore::PagePopupClient::addProperty("values", suggestionValues, writer);
WebCore::PagePopupClient::addProperty("otherColorLabel", Platform::current()->queryLocalizedString(WebLocalizedString::OtherColorLabel), writer);
WebCore::PagePopupClient::addString("};\n", writer);
+ writer.addData(WebCore::pickerCommonJs, sizeof(WebCore::pickerCommonJs));
writer.addData(WebCore::colorSuggestionPickerJs, sizeof(WebCore::colorSuggestionPickerJs));
WebCore::PagePopupClient::addString("</script></body>\n", writer);
}
diff --git a/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp b/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp
index bc4cfb834..833a5016d 100644
--- a/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp
+++ b/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp
@@ -145,6 +145,8 @@ bool ContextFeaturesClientImpl::askIfIsEnabled(Document* document, ContextFeatur
return m_client->allowWebComponents(WebDocument(document), defaultValue);
case ContextFeatures::HTMLNotifications:
return m_client->allowHTMLNotifications(WebDocument(document));
+ case ContextFeatures::MutationEvents:
+ return m_client->allowMutationEvents(WebDocument(document), defaultValue);
default:
return defaultValue;
}
diff --git a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
index a32a182a4..adaa41392 100644
--- a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
+++ b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
@@ -279,9 +279,8 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems(
// a mouse on a word, Chrome just needs to find a spelling marker on the word instread of spellchecking it.
if (selectedFrame->settings() && selectedFrame->settings()->asynchronousSpellCheckingEnabled()) {
VisibleSelection selection = selectedFrame->selection()->selection();
- if (selection.isCaretOrRange()) {
- if (selection.isCaret())
- selection.expandUsingGranularity(WordGranularity);
+ if (selection.isCaret()) {
+ selection.expandUsingGranularity(WordGranularity);
RefPtr<Range> range = selection.toNormalizedRange();
Vector<DocumentMarker*> markers = selectedFrame->document()->markers()->markersInRange(range.get(), DocumentMarker::Spelling | DocumentMarker::Grammar);
if (markers.size() == 1) {
diff --git a/Source/WebKit/chromium/src/FindInPageCoordinates.cpp b/Source/WebKit/chromium/src/FindInPageCoordinates.cpp
new file mode 100644
index 000000000..b00a30c23
--- /dev/null
+++ b/Source/WebKit/chromium/src/FindInPageCoordinates.cpp
@@ -0,0 +1,142 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "FindInPageCoordinates.h"
+
+#include "FloatPoint.h"
+#include "FloatQuad.h"
+#include "FloatRect.h"
+#include "Frame.h"
+#include "IntPoint.h"
+#include "Node.h"
+#include "Range.h"
+#include "RenderBox.h"
+#include "RenderObject.h"
+#include "RenderPart.h"
+#include "RenderStyle.h"
+#include "RenderView.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+static FloatRect toNormalizedRect(const FloatRect& absoluteRect, const RenderObject* renderer, FloatRect& containerBoundingBox)
+{
+ ASSERT(renderer);
+
+ const RenderObject* container = renderer->container();
+ if (!container) {
+ containerBoundingBox = FloatRect();
+ return FloatRect();
+ }
+
+ FloatRect normalizedRect = absoluteRect;
+ FloatRect containerRect = container->absoluteBoundingBoxRect();
+ containerBoundingBox = containerRect;
+
+ // For RenderBoxes we want to normalize by the max layout overflow size instead of only the visible bounding box.
+ // Quads and their enclosing bounding boxes need to be used in order to keep results transform-friendly.
+ if (container->isBox()) {
+ const RenderBox* containerBox = toRenderBox(container);
+ FloatPoint scrolledOrigin;
+
+ // For overflow:scroll we need to get where the actual origin is independently of the scroll.
+ if (container->hasOverflowClip())
+ scrolledOrigin = -IntPoint(containerBox->scrolledContentOffset());
+
+ FloatRect overflowRect(scrolledOrigin, containerBox->maxLayoutOverflow());
+ containerRect = containerBox->localToAbsoluteQuad(FloatQuad(overflowRect), false).enclosingBoundingBox();
+ }
+
+ if (containerRect.isEmpty())
+ return FloatRect();
+
+ // Make the coordinates relative to the container enclosing bounding box.
+ // Since we work with rects enclosing quad unions this is still transform-friendly.
+ normalizedRect.moveBy(-containerRect.location());
+
+ // Fixed positions do not make sense in this coordinate system, but need to leave consistent tickmarks.
+ // So, use their position when the view is not scrolled, like an absolute position.
+ if (renderer->style()->position() == FixedPosition && container->isRenderView())
+ normalizedRect.move(-toRenderView(container)->frameView()->scrollOffsetForFixedPosition());
+
+ normalizedRect.scale(1 / containerRect.width(), 1 / containerRect.height());
+
+ return normalizedRect;
+}
+
+FloatRect findInPageRectFromAbsoluteRect(const FloatRect& inputRect, const RenderObject* renderer)
+{
+ if (!renderer || inputRect.isEmpty())
+ return FloatRect();
+
+ // Normalize the input rect to its container, saving the container bounding box for the incoming loop.
+ FloatRect rendererBoundingBox;
+ FloatRect normalizedRect = toNormalizedRect(inputRect, renderer, rendererBoundingBox);
+ renderer = renderer->container();
+
+ // Go up across frames.
+ while (renderer) {
+
+ // Go up the render tree until we reach the root of the current frame (the RenderView).
+ for (const RenderObject* container = renderer->container(); container; renderer = container, container = container->container()) {
+
+ // Compose the normalized rects. The absolute bounding box of the container is calculated in toNormalizedRect
+ // and can be reused for the next iteration of the loop.
+ FloatRect normalizedBoxRect = toNormalizedRect(rendererBoundingBox, renderer, rendererBoundingBox);
+ normalizedRect.scale(normalizedBoxRect.width(), normalizedBoxRect.height());
+ normalizedRect.moveBy(normalizedBoxRect.location());
+
+ if (normalizedRect.isEmpty())
+ return normalizedRect;
+ }
+
+ // Jump to the renderer owning the frame, if any.
+ ASSERT(renderer->isRenderView());
+ renderer = renderer->frame() ? renderer->frame()->ownerRenderer() : 0;
+
+ // Update the absolute coordinates to the new frame.
+ if (renderer)
+ rendererBoundingBox = renderer->absoluteBoundingBoxRect();
+ }
+
+ return normalizedRect;
+}
+
+FloatRect findInPageRectFromRange(Range* range)
+{
+ if (!range || !range->firstNode())
+ return FloatRect();
+
+ return findInPageRectFromAbsoluteRect(RenderObject::absoluteBoundingBoxRectForRange(range), range->firstNode()->renderer());
+}
+
+} // namespace WebKit
diff --git a/Source/WebCore/bindings/v8/custom/V8CustomVoidCallback.h b/Source/WebKit/chromium/src/FindInPageCoordinates.h
index c7dfbe25e..35465eb02 100644
--- a/Source/WebCore/bindings/v8/custom/V8CustomVoidCallback.h
+++ b/Source/WebKit/chromium/src/FindInPageCoordinates.h
@@ -1,10 +1,10 @@
/*
- * Copyright (C) 2009 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 are
* met:
- *
+ *
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -14,7 +14,7 @@
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -28,42 +28,34 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef V8CustomVoidCallback_h
-#define V8CustomVoidCallback_h
+#ifndef FindInPageCoordinates_h
+#define FindInPageCoordinates_h
-#include "VoidCallback.h"
-#include "WorldContextHandle.h"
-#include <v8.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
+#include "FloatRect.h"
namespace WebCore {
-
-class ScriptExecutionContext;
-
-class V8CustomVoidCallback : public VoidCallback {
-public:
- static PassRefPtr<V8CustomVoidCallback> create(v8::Local<v8::Value> value, ScriptExecutionContext* context)
- {
- ASSERT(value->IsObject());
- return adoptRef(new V8CustomVoidCallback(value->ToObject(), context));
- }
- virtual ~V8CustomVoidCallback();
-
- virtual void handleEvent();
-
-private:
- V8CustomVoidCallback(v8::Local<v8::Object>, ScriptExecutionContext* context);
-
- v8::Persistent<v8::Object> m_callback;
- RefPtr<ScriptExecutionContext> m_scriptExecutionContext;
- WorldContextHandle m_worldContext;
-};
-
-// Returns false if callback failed (null, wrong type, or threw exception).
-bool invokeCallback(v8::Persistent<v8::Object> callback, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue, ScriptExecutionContext*);
-bool invokeCallback(v8::Persistent<v8::Object> callback, v8::Handle<v8::Object> thisObject, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue, ScriptExecutionContext*);
-
-} // namespace WebCore
-
-#endif // V8CustomVoidCallback_h
+class Range;
+class RenderObject;
+}
+
+namespace WebKit {
+
+// Find-in-page coordinate conversion methods.
+//
+// This coordinate system is designed to give consistent tickmarks in cases where find matches
+// are in scrollable areas but might not be visible (e.g. child frames, scroll:overflow).
+// In these cases, using absolute positions might lead to tickmarks pointing outside the visible
+// area of its container, which is counter-intuitive for users.
+//
+// Find-in-page coordinates are represented as normalized fractions of the main frame document with
+// the property that they are built by composing the relative position of each renderer to the maximum
+// effective layout size of its container all the way up the render tree. The resulting coordinates
+// are scroll-independent, representing any contents scaled to the visible area of their container.
+// The provided methods support scroll:overflow and are CSS position and transform-friendly.
+
+WebCore::FloatRect findInPageRectFromAbsoluteRect(const WebCore::FloatRect&, const WebCore::RenderObject*);
+WebCore::FloatRect findInPageRectFromRange(WebCore::Range*);
+
+} // namespace WebKit
+
+#endif
diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
index 1e315660a..5dd02b563 100644
--- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
+++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
@@ -304,7 +304,7 @@ void FrameLoaderClientImpl::detachedFromParent3()
// will cause a crash. If you remove/modify this, just ensure that you can
// go to a page and then navigate to a new page without getting any asserts
// or crashes.
- m_webFrame->frame()->script()->proxy()->clearForClose();
+ m_webFrame->frame()->script()->clearForClose();
// Alert the client that the frame is being detached. This is the last
// chance we have to communicate with the client.
@@ -1490,9 +1490,8 @@ PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin(
// (e.g., acrobat reader).
void FrameLoaderClientImpl::redirectDataToPlugin(Widget* pluginWidget)
{
- if (pluginWidget->isPluginContainer())
- m_pluginWidget = static_cast<WebPluginContainerImpl*>(pluginWidget);
- ASSERT(m_pluginWidget);
+ ASSERT(!pluginWidget || pluginWidget->isPluginContainer());
+ m_pluginWidget = static_cast<WebPluginContainerImpl*>(pluginWidget);
}
PassRefPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget(
diff --git a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp b/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp
index 7df84d2ff..193bf2b5f 100644
--- a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp
+++ b/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp
@@ -68,9 +68,9 @@ void IDBCallbacksProxy::onError(PassRefPtr<IDBDatabaseError> idbDatabaseError)
m_callbacks->onError(WebIDBDatabaseError(idbDatabaseError));
}
-void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBCursorBackendInterface> idbCursorBackend)
+void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBCursorBackendInterface> idbCursorBackend, PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue> value)
{
- m_callbacks->onSuccess(new WebIDBCursorImpl(idbCursorBackend));
+ m_callbacks->onSuccess(new WebIDBCursorImpl(idbCursorBackend), key, primaryKey, value);
}
void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBDatabaseBackendInterface> backend)
@@ -102,9 +102,10 @@ void IDBCallbacksProxy::onSuccess(PassRefPtr<SerializedScriptValue> serializedSc
{
m_callbacks->onSuccess(serializedScriptValue, key, keyPath);
}
-void IDBCallbacksProxy::onSuccessWithContinuation()
+
+void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue> value)
{
- m_callbacks->onSuccessWithContinuation();
+ m_callbacks->onSuccess(key, primaryKey, value);
}
void IDBCallbacksProxy::onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >& keys, const Vector<RefPtr<IDBKey> >& primaryKeys, const Vector<RefPtr<SerializedScriptValue> >& values)
@@ -129,6 +130,16 @@ void IDBCallbacksProxy::onBlocked()
m_callbacks->onBlocked();
}
+void IDBCallbacksProxy::onBlocked(int64_t existingVersion)
+{
+ m_callbacks->onBlocked(existingVersion);
+}
+
+void IDBCallbacksProxy::onUpgradeNeeded(int64_t oldVersion, PassRefPtr<IDBTransactionBackendInterface> transaction, PassRefPtr<IDBDatabaseBackendInterface> database)
+{
+ m_callbacks->onUpgradeNeeded(oldVersion, new WebIDBTransactionImpl(transaction), new WebIDBDatabaseImpl(database));
+}
+
} // namespace WebKit
#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebKit/chromium/src/IDBCallbacksProxy.h b/Source/WebKit/chromium/src/IDBCallbacksProxy.h
index db3056550..825758aad 100644
--- a/Source/WebKit/chromium/src/IDBCallbacksProxy.h
+++ b/Source/WebKit/chromium/src/IDBCallbacksProxy.h
@@ -47,15 +47,17 @@ public:
virtual void onError(PassRefPtr<WebCore::IDBDatabaseError>);
virtual void onSuccess(PassRefPtr<WebCore::DOMStringList>);
- virtual void onSuccess(PassRefPtr<WebCore::IDBCursorBackendInterface>);
+ virtual void onSuccess(PassRefPtr<WebCore::IDBCursorBackendInterface>, PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBKey> primaryKey, PassRefPtr<WebCore::SerializedScriptValue>);
virtual void onSuccess(PassRefPtr<WebCore::IDBDatabaseBackendInterface>);
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 onSuccess(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBKey> primaryKey, PassRefPtr<WebCore::SerializedScriptValue>);
virtual void onSuccessWithPrefetch(const Vector<RefPtr<WebCore::IDBKey> >& keys, const Vector<RefPtr<WebCore::IDBKey> >& primaryKeys, const Vector<RefPtr<WebCore::SerializedScriptValue> >& values);
virtual void onBlocked();
+ virtual void onBlocked(int64_t existingVersion);
+ virtual void onUpgradeNeeded(int64_t oldVersion, PassRefPtr<WebCore::IDBTransactionBackendInterface>, PassRefPtr<WebCore::IDBDatabaseBackendInterface>);
private:
IDBCallbacksProxy(PassOwnPtr<WebIDBCallbacks>);
diff --git a/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp b/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp
index 277a665cf..9243d2ba2 100644
--- a/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp
+++ b/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp
@@ -54,21 +54,6 @@ IDBCursorBackendProxy::~IDBCursorBackendProxy()
{
}
-PassRefPtr<IDBKey> IDBCursorBackendProxy::key() const
-{
- return m_idbCursor->key();
-}
-
-PassRefPtr<IDBKey> IDBCursorBackendProxy::primaryKey() const
-{
- return m_idbCursor->primaryKey();
-}
-
-PassRefPtr<SerializedScriptValue> IDBCursorBackendProxy::value() const
-{
- return m_idbCursor->value();
-}
-
void IDBCursorBackendProxy::advance(unsigned long count, PassRefPtr<IDBCallbacks> callbacks, ExceptionCode& ec)
{
m_idbCursor->advance(count, new WebIDBCallbacksImpl(callbacks), ec);
diff --git a/Source/WebKit/chromium/src/IDBCursorBackendProxy.h b/Source/WebKit/chromium/src/IDBCursorBackendProxy.h
index d742f68e5..08afeba8f 100644
--- a/Source/WebKit/chromium/src/IDBCursorBackendProxy.h
+++ b/Source/WebKit/chromium/src/IDBCursorBackendProxy.h
@@ -42,9 +42,6 @@ public:
static PassRefPtr<WebCore::IDBCursorBackendInterface> create(PassOwnPtr<WebIDBCursor>);
virtual ~IDBCursorBackendProxy();
- virtual PassRefPtr<WebCore::IDBKey> key() const;
- virtual PassRefPtr<WebCore::IDBKey> primaryKey() const;
- virtual PassRefPtr<WebCore::SerializedScriptValue> value() const;
virtual void advance(unsigned long, PassRefPtr<WebCore::IDBCallbacks>, WebCore::ExceptionCode&);
virtual void continueFunction(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::ExceptionCode&);
virtual void deleteFunction(PassRefPtr<WebCore::IDBCallbacks>, WebCore::ExceptionCode&);
diff --git a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp
index 901b55e54..56afe5fb5 100644
--- a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp
+++ b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp
@@ -87,6 +87,7 @@ void IDBDatabaseBackendProxy::deleteObjectStore(const String& name, IDBTransacti
void IDBDatabaseBackendProxy::setVersion(const String& version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, ExceptionCode& ec)
{
+ ASSERT(m_webIDBDatabase);
m_webIDBDatabase->setVersion(version, new WebIDBCallbacksImpl(callbacks), ec);
}
diff --git a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp
index 816faf6c4..019e59ba0 100644
--- a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp
+++ b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp
@@ -48,6 +48,11 @@ IDBDatabaseCallbacksProxy::~IDBDatabaseCallbacksProxy()
{
}
+void IDBDatabaseCallbacksProxy::onVersionChange(int64_t oldVersion, int64_t newVersion)
+{
+ m_callbacks->onVersionChange(oldVersion, newVersion);
+}
+
void IDBDatabaseCallbacksProxy::onVersionChange(const String& requestedVersion)
{
m_callbacks->onVersionChange(requestedVersion);
diff --git a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h
index affdce77d..9995abd2b 100644
--- a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h
+++ b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h
@@ -41,6 +41,7 @@ public:
virtual ~IDBDatabaseCallbacksProxy();
virtual void onVersionChange(const String& requestedVersion);
+ virtual void onVersionChange(int64_t oldVersion, int64_t newVersion);
private:
IDBDatabaseCallbacksProxy(PassOwnPtr<WebIDBDatabaseCallbacks>);
diff --git a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp
index c1bec1077..babcbae18 100755
--- a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp
+++ b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp
@@ -203,7 +203,7 @@ void IDBFactoryBackendProxy::getDatabaseNames(PassRefPtr<IDBCallbacks> prpCallba
}
-void IDBFactoryBackendProxy::open(const String& name, PassRefPtr<IDBCallbacks> prpCallbacks, PassRefPtr<SecurityOrigin> securityOrigin, ScriptExecutionContext* context, const String& dataDir)
+void IDBFactoryBackendProxy::open(const String& name, int64_t version, PassRefPtr<IDBCallbacks> prpCallbacks, PassRefPtr<SecurityOrigin> securityOrigin, ScriptExecutionContext* context, const String& dataDir)
{
RefPtr<IDBCallbacks> callbacks(prpCallbacks);
WebSecurityOrigin origin(securityOrigin);
@@ -211,7 +211,7 @@ void IDBFactoryBackendProxy::open(const String& name, PassRefPtr<IDBCallbacks> p
return;
WebFrameImpl* webFrame = getWebFrame(context);
- m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir);
+ m_webIDBFactory->open(name, version, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir);
}
void IDBFactoryBackendProxy::deleteDatabase(const String& name, PassRefPtr<IDBCallbacks> prpCallbacks, PassRefPtr<SecurityOrigin> securityOrigin, ScriptExecutionContext* context, const String& dataDir)
diff --git a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h
index 22a6f52a8..c0de910a9 100644
--- a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h
+++ b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h
@@ -49,7 +49,7 @@ public:
virtual ~IDBFactoryBackendProxy();
virtual void getDatabaseNames(PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::SecurityOrigin>, WebCore::ScriptExecutionContext*, const String& dataDir);
- virtual void open(const String& name, PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::SecurityOrigin>, WebCore::ScriptExecutionContext*, const String& dataDir);
+ virtual void open(const String& name, int64_t version, PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::SecurityOrigin>, WebCore::ScriptExecutionContext*, const String& dataDir);
virtual void deleteDatabase(const String& name, PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::SecurityOrigin>, WebCore::ScriptExecutionContext*, const String& dataDir);
private:
diff --git a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp
index 4d1c91d07..b8fb074ea 100755
--- a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp
+++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp
@@ -77,6 +77,16 @@ void IDBObjectStoreBackendProxy::putWithIndexKeys(PassRefPtr<SerializedScriptVal
m_webIDBObjectStore->putWithIndexKeys(value, key, static_cast<WebIDBObjectStore::PutMode>(putMode), new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), webIndexNames, webIndexKeys, ec);
}
+void IDBObjectStoreBackendProxy::setIndexKeys(PassRefPtr<IDBKey> prpPrimaryKey, const Vector<String>& indexNames, const Vector<IndexKeys>& indexKeys, IDBTransactionBackendInterface* transaction)
+{
+ // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer,
+ // all implementations of IDB interfaces are proxy objects.
+ IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction);
+ WebVector<WebString> webIndexNames(indexNames);
+ WebVector<IndexKeys> webIndexKeys(indexKeys);
+ m_webIDBObjectStore->setIndexKeys(prpPrimaryKey, webIndexNames, webIndexKeys, *transactionProxy->getWebIDBTransaction());
+}
+
void IDBObjectStoreBackendProxy::deleteFunction(PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
{
// The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer,
@@ -104,6 +114,14 @@ PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendProxy::createIndex(con
return IDBIndexBackendProxy::create(index.release());
}
+void IDBObjectStoreBackendProxy::setIndexesReady(const Vector<String>& indexNames, IDBTransactionBackendInterface* transaction)
+{
+ // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer,
+ // all implementations of IDB interfaces are proxy objects.
+ IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction);
+ m_webIDBObjectStore->setIndexesReady(indexNames, *transactionProxy->getWebIDBTransaction());
+}
+
PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendProxy::index(const String& name, ExceptionCode& ec)
{
OwnPtr<WebIDBIndex> index = adoptPtr(m_webIDBObjectStore->index(name, ec));
@@ -125,7 +143,15 @@ void IDBObjectStoreBackendProxy::openCursor(PassRefPtr<IDBKeyRange> range, unsig
// The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer,
// all implementations of IDB interfaces are proxy objects.
IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction);
- m_webIDBObjectStore->openCursor(range, direction, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec);
+ m_webIDBObjectStore->openCursor(range, static_cast<WebIDBCursor::Direction>(direction), new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec);
+}
+
+void IDBObjectStoreBackendProxy::openCursor(PassRefPtr<IDBKeyRange> range, IDBCursor::Direction direction, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface::TaskType taskType, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
+{
+ // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer,
+ // all implementations of IDB interfaces are proxy objects.
+ IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction);
+ m_webIDBObjectStore->openCursor(range, static_cast<WebIDBCursor::Direction>(direction), new WebIDBCallbacksImpl(callbacks), static_cast<WebIDBTransaction::TaskType>(taskType), *transactionProxy->getWebIDBTransaction(), ec);
}
void IDBObjectStoreBackendProxy::count(PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
diff --git a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h
index 0235077fa..fb0f2af37 100644
--- a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h
+++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h
@@ -49,10 +49,15 @@ public:
virtual void clear(PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
PassRefPtr<WebCore::IDBIndexBackendInterface> createIndex(const String& name, const WebCore::IDBKeyPath&, bool unique, bool multiEntry, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
+ virtual void setIndexKeys(PassRefPtr<WebCore::IDBKey> prpPrimaryKey, const WTF::Vector<WTF::String>&, const WTF::Vector<IndexKeys>&, WebCore::IDBTransactionBackendInterface*);
+ virtual void setIndexesReady(const Vector<String>&, WebCore::IDBTransactionBackendInterface*);
+
PassRefPtr<WebCore::IDBIndexBackendInterface> index(const String& name, WebCore::ExceptionCode&);
void deleteIndex(const String& name, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
+ // FIXME: Remove this version of openCursor when TaskType is plumbed through chromium.
virtual void openCursor(PassRefPtr<WebCore::IDBKeyRange>, unsigned short direction, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
+ virtual void openCursor(PassRefPtr<WebCore::IDBKeyRange>, WebCore::IDBCursor::Direction, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface::TaskType, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
virtual void count(PassRefPtr<WebCore::IDBKeyRange>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
private:
diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
index fb9c12de6..4df4204b3 100644
--- a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
+++ b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
@@ -30,6 +30,7 @@
#include "FloatPoint.h"
#include "FloatRect.h"
#include "GraphicsLayer.h"
+#include "GraphicsLayerChromium.h"
#include "PlatformContextSkia.h"
#include "WebViewImpl.h"
#include <public/WebContentLayer.h>
@@ -48,11 +49,11 @@ NonCompositedContentHost::NonCompositedContentHost(WebViewImpl* webView)
m_graphicsLayer->setName("non-composited content");
#endif
m_graphicsLayer->setDrawsContent(true);
- WebContentLayer layer = m_graphicsLayer->platformLayer()->to<WebContentLayer>();
- layer.setUseLCDText(true);
- layer.setOpaque(true);
+ WebContentLayer* layer = static_cast<WebCore::GraphicsLayerChromium*>(m_graphicsLayer.get())->contentLayer();
+ layer->setUseLCDText(true);
+ layer->layer()->setOpaque(true);
#if !OS(ANDROID)
- layer.setDrawCheckerboardForMissingTiles(true);
+ layer->setDrawCheckerboardForMissingTiles(true);
#endif
}
@@ -80,27 +81,13 @@ void NonCompositedContentHost::setScrollLayer(WebCore::GraphicsLayer* layer)
return;
}
- if (*layer->platformLayer() == scrollLayer())
+ if (layer->platformLayer() == scrollLayer())
return;
layer->addChildAtIndex(m_graphicsLayer.get(), 0);
ASSERT(haveScrollLayer());
}
-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.numberOfChildren(); ++i)
- reserveScrollbarLayers(layer.childAt(i), clipLayer);
-
- 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 (!haveScrollLayer())
@@ -109,12 +96,12 @@ void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize,
bool visibleRectChanged = m_viewportSize != viewportSize;
m_viewportSize = viewportSize;
- WebScrollableLayer layer = scrollLayer();
- layer.setScrollPosition(scrollPosition + scrollOrigin);
- layer.setPosition(WebFloatPoint(-scrollPosition));
+ WebLayer* 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.
- layer.setScrollable(true);
+ layer->setScrollable(true);
m_deviceScaleFactor = deviceScale;
m_graphicsLayer->deviceOrPageScaleFactorChanged();
m_graphicsLayer->setSize(contentsSize);
@@ -134,12 +121,6 @@ void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize,
m_graphicsLayer->setNeedsDisplay();
} else if (visibleRectChanged)
m_graphicsLayer->setNeedsDisplay();
-
- WebLayer clipLayer = layer.parent();
- WebLayer rootLayer = clipLayer;
- while (!rootLayer.parent().isNull())
- rootLayer = rootLayer.parent();
- reserveScrollbarLayers(rootLayer, clipLayer);
}
bool NonCompositedContentHost::haveScrollLayer()
@@ -147,11 +128,11 @@ bool NonCompositedContentHost::haveScrollLayer()
return m_graphicsLayer->parent();
}
-WebScrollableLayer NonCompositedContentHost::scrollLayer()
+WebLayer* NonCompositedContentHost::scrollLayer()
{
if (!m_graphicsLayer->parent())
- return WebScrollableLayer();
- return m_graphicsLayer->parent()->platformLayer()->to<WebScrollableLayer>();
+ return 0;
+ return 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 e60e9ef48..08b5f6a41 100644
--- a/Source/WebKit/chromium/src/NonCompositedContentHost.h
+++ b/Source/WebKit/chromium/src/NonCompositedContentHost.h
@@ -29,7 +29,7 @@
#include "GraphicsLayerClient.h"
#include "IntSize.h"
-#include <public/WebScrollableLayer.h>
+#include <public/WebLayer.h>
#include <wtf/Noncopyable.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
@@ -80,7 +80,7 @@ private:
virtual float deviceScaleFactor() const OVERRIDE { return m_deviceScaleFactor; }
bool haveScrollLayer();
- WebScrollableLayer scrollLayer();
+ WebLayer* scrollLayer();
OwnPtr<WebCore::GraphicsLayer> m_graphicsLayer;
WebViewImpl* m_webView;
diff --git a/Source/WebKit/chromium/src/StorageAreaProxy.cpp b/Source/WebKit/chromium/src/StorageAreaProxy.cpp
index 722e80f53..efa0c9098 100644
--- a/Source/WebKit/chromium/src/StorageAreaProxy.cpp
+++ b/Source/WebKit/chromium/src/StorageAreaProxy.cpp
@@ -131,7 +131,7 @@ void StorageAreaProxy::dispatchLocalStorageEvent(PageGroup* pageGroup, const Str
const HashSet<Page*>& pages = pageGroup->pages();
for (HashSet<Page*>::const_iterator it = pages.begin(); it != pages.end(); ++it) {
for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
- Storage* storage = frame->domWindow()->optionalLocalStorage();
+ Storage* storage = frame->document()->domWindow()->optionalLocalStorage();
if (storage && frame->document()->securityOrigin()->equal(securityOrigin) && !isEventSource(storage, sourceAreaInstance))
frame->document()->enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, pageURL, storage));
}
@@ -160,7 +160,7 @@ void StorageAreaProxy::dispatchSessionStorageEvent(PageGroup* pageGroup, const S
return;
for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
- Storage* storage = frame->domWindow()->optionalSessionStorage();
+ Storage* storage = frame->document()->domWindow()->optionalSessionStorage();
if (storage && frame->document()->securityOrigin()->equal(securityOrigin) && !isEventSource(storage, sourceAreaInstance))
frame->document()->enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, pageURL, storage));
}
diff --git a/Source/WebKit/chromium/src/WebAnimationCurveCommon.cpp b/Source/WebKit/chromium/src/WebAnimationCurveCommon.cpp
index b5b98b0a3..2b7be0361 100644
--- a/Source/WebKit/chromium/src/WebAnimationCurveCommon.cpp
+++ b/Source/WebKit/chromium/src/WebAnimationCurveCommon.cpp
@@ -26,7 +26,7 @@
#include "WebAnimationCurveCommon.h"
-#include "cc/CCTimingFunction.h"
+#include "CCTimingFunction.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
diff --git a/Source/WebKit/chromium/src/WebAnimation.cpp b/Source/WebKit/chromium/src/WebAnimationImpl.cpp
index 610201512..187272ef2 100644
--- a/Source/WebKit/chromium/src/WebAnimation.cpp
+++ b/Source/WebKit/chromium/src/WebAnimationImpl.cpp
@@ -24,11 +24,12 @@
#include "config.h"
-#include <public/WebAnimation.h>
+#include "WebAnimationImpl.h"
#include "AnimationIdVendor.h"
-#include "cc/CCActiveAnimation.h"
-#include "cc/CCAnimationCurve.h"
+#include "CCActiveAnimation.h"
+#include "CCAnimationCurve.h"
+#include <public/WebAnimation.h>
#include <public/WebAnimationCurve.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
@@ -38,71 +39,66 @@ using WebCore::CCActiveAnimation;
namespace WebKit {
-WebAnimation::TargetProperty WebAnimation::targetProperty() const
+WebAnimation* WebAnimation::create(const WebAnimationCurve& curve, TargetProperty targetProperty)
{
- return static_cast<WebAnimation::TargetProperty>(m_private->targetProperty());
+ return WebAnimation::create(curve, AnimationIdVendor::getNextAnimationId(), AnimationIdVendor::getNextGroupId(), targetProperty);
}
-int WebAnimation::iterations() const
+WebAnimation* WebAnimation::create(const WebAnimationCurve& curve, int animationId, int groupId, TargetProperty targetProperty)
{
- return m_private->iterations();
+ return new WebAnimationImpl(CCActiveAnimation::create(curve, animationId, groupId, static_cast<WebCore::CCActiveAnimation::TargetProperty>(targetProperty)));
}
-void WebAnimation::setIterations(int n)
+WebAnimation::TargetProperty WebAnimationImpl::targetProperty() const
{
- m_private->setIterations(n);
+ return static_cast<WebAnimationImpl::TargetProperty>(m_animation->targetProperty());
}
-double WebAnimation::startTime() const
+int WebAnimationImpl::iterations() const
{
- return m_private->startTime();
+ return m_animation->iterations();
}
-void WebAnimation::setStartTime(double monotonicTime)
+void WebAnimationImpl::setIterations(int n)
{
- m_private->setStartTime(monotonicTime);
+ m_animation->setIterations(n);
}
-double WebAnimation::timeOffset() const
+double WebAnimationImpl::startTime() const
{
- return m_private->timeOffset();
+ return m_animation->startTime();
}
-void WebAnimation::setTimeOffset(double monotonicTime)
+void WebAnimationImpl::setStartTime(double monotonicTime)
{
- m_private->setTimeOffset(monotonicTime);
+ m_animation->setStartTime(monotonicTime);
}
-bool WebAnimation::alternatesDirection() const
+double WebAnimationImpl::timeOffset() const
{
- return m_private->alternatesDirection();
+ return m_animation->timeOffset();
}
-void WebAnimation::setAlternatesDirection(bool alternates)
+void WebAnimationImpl::setTimeOffset(double monotonicTime)
{
- m_private->setAlternatesDirection(alternates);
+ m_animation->setTimeOffset(monotonicTime);
}
-WebAnimation::operator PassOwnPtr<WebCore::CCActiveAnimation>() const
+bool WebAnimationImpl::alternatesDirection() const
{
- OwnPtr<WebCore::CCActiveAnimation> toReturn(m_private->cloneForImplThread());
- toReturn->setNeedsSynchronizedStartTime(true);
- return toReturn.release();
+ return m_animation->alternatesDirection();
}
-void WebAnimation::initialize(const WebAnimationCurve& curve, TargetProperty targetProperty)
+void WebAnimationImpl::setAlternatesDirection(bool alternates)
{
- initialize(curve, AnimationIdVendor::getNextAnimationId(), AnimationIdVendor::getNextGroupId(), targetProperty);
+ m_animation->setAlternatesDirection(alternates);
}
-void WebAnimation::initialize(const WebAnimationCurve& curve, int animationId, int groupId, TargetProperty targetProperty)
+PassOwnPtr<WebCore::CCActiveAnimation> WebAnimationImpl::cloneToCCAnimation()
{
- m_private.reset(CCActiveAnimation::create(curve, animationId, groupId, static_cast<WebCore::CCActiveAnimation::TargetProperty>(targetProperty)).leakPtr());
-}
-
-void WebAnimation::destroy()
-{
- m_private.reset(0);
+ OwnPtr<WebCore::CCActiveAnimation> toReturn(m_animation->clone(WebCore::CCActiveAnimation::NonControllingInstance));
+ toReturn->setNeedsSynchronizedStartTime(true);
+ return toReturn.release();
}
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebAnimationImpl.h b/Source/WebKit/chromium/src/WebAnimationImpl.h
new file mode 100644
index 000000000..8677b9c60
--- /dev/null
+++ b/Source/WebKit/chromium/src/WebAnimationImpl.h
@@ -0,0 +1,65 @@
+/*
+ * 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 WebAnimationImpl_h
+#define WebAnimationImpl_h
+
+#include <public/WebAnimation.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+class CCActiveAnimation;
+}
+
+namespace WebKit {
+
+class WebAnimationImpl : public WebAnimation {
+public:
+ explicit WebAnimationImpl(PassOwnPtr<WebCore::CCActiveAnimation> animation)
+ : m_animation(animation)
+ {
+ }
+ virtual ~WebAnimationImpl() { }
+
+ // WebAnimation implementation
+ virtual TargetProperty targetProperty() const OVERRIDE;
+ virtual int iterations() const OVERRIDE;
+ virtual void setIterations(int) OVERRIDE;
+ virtual double startTime() const OVERRIDE;
+ virtual void setStartTime(double monotonicTime) OVERRIDE;
+ virtual double timeOffset() const OVERRIDE;
+ virtual void setTimeOffset(double monotonicTime) OVERRIDE;
+ virtual bool alternatesDirection() const OVERRIDE;
+ virtual void setAlternatesDirection(bool) OVERRIDE;
+
+ PassOwnPtr<WebCore::CCActiveAnimation> cloneToCCAnimation();
+private:
+ OwnPtr<WebCore::CCActiveAnimation> m_animation;
+};
+
+}
+
+#endif // WebAnimationImpl_h
+
diff --git a/Source/WebKit/chromium/src/WebBindings.cpp b/Source/WebKit/chromium/src/WebBindings.cpp
index 786a4175b..71a74db1b 100644
--- a/Source/WebKit/chromium/src/WebBindings.cpp
+++ b/Source/WebKit/chromium/src/WebBindings.cpp
@@ -290,7 +290,7 @@ static NPObject* makeIntArrayImpl(const WebVector<int>& data)
for (size_t i = 0; i < data.size(); ++i)
result->Set(i, v8::Number::New(data[i]));
- DOMWindow* window = V8Proxy::retrieveWindow(v8::Context::GetCurrent());
+ DOMWindow* window = toDOMWindow(v8::Context::GetCurrent());
return npCreateV8ScriptObject(0, result, window);
}
@@ -301,7 +301,7 @@ static NPObject* makeStringArrayImpl(const WebVector<WebString>& data)
for (size_t i = 0; i < data.size(); ++i)
result->Set(i, data[i].data() ? v8::String::New(reinterpret_cast<const uint16_t*>((data[i].data())), data[i].length()) : v8::String::New(""));
- DOMWindow* window = V8Proxy::retrieveWindow(v8::Context::GetCurrent());
+ DOMWindow* window = toDOMWindow(v8::Context::GetCurrent());
return npCreateV8ScriptObject(0, result, window);
}
diff --git a/Source/WebKit/chromium/src/WebBlobData.cpp b/Source/WebKit/chromium/src/WebBlobData.cpp
index c767d1bdd..094ff8013 100644
--- a/Source/WebKit/chromium/src/WebBlobData.cpp
+++ b/Source/WebKit/chromium/src/WebBlobData.cpp
@@ -83,7 +83,12 @@ bool WebBlobData::itemAt(size_t index, Item& result) const
return true;
case BlobDataItem::Blob:
result.type = Item::TypeBlob;
- result.blobURL = item.url;
+ result.blobURL = item.url; // FIXME: deprecate this.
+ result.url = item.url;
+ return true;
+ case BlobDataItem::URL:
+ result.type = Item::TypeURL;
+ result.url = item.url;
return true;
}
ASSERT_NOT_REACHED();
diff --git a/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp b/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp
index 25b31d5e9..8084d715c 100644
--- a/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp
+++ b/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp
@@ -27,14 +27,14 @@
#include "WebCompositorInputHandlerImpl.h"
+#include "CCActiveGestureAnimation.h"
+#include "CCProxy.h"
#include "PlatformGestureCurveTarget.h"
#include "TouchpadFlingPlatformGestureCurve.h"
#include "TraceEvent.h"
#include "WebCompositorImpl.h"
#include "WebCompositorInputHandlerClient.h"
#include "WebInputEvent.h"
-#include "cc/CCActiveGestureAnimation.h"
-#include "cc/CCProxy.h"
#include <wtf/ThreadingPrimitives.h>
using namespace WebCore;
@@ -181,7 +181,7 @@ WebCompositorInputHandlerImpl::EventDisposition WebCompositorInputHandlerImpl::h
switch (scrollStatus) {
case CCInputHandlerClient::ScrollStarted: {
TRACE_EVENT_INSTANT2("cc", "WebCompositorInputHandlerImpl::handleInput wheel scroll", "deltaX", -wheelEvent.deltaX, "deltaY", -wheelEvent.deltaY);
- m_inputHandlerClient->scrollBy(IntSize(-wheelEvent.deltaX, -wheelEvent.deltaY));
+ m_inputHandlerClient->scrollBy(IntPoint(wheelEvent.x, wheelEvent.y), IntSize(-wheelEvent.deltaX, -wheelEvent.deltaY));
m_inputHandlerClient->scrollEnd();
return DidHandle;
}
@@ -216,7 +216,7 @@ WebCompositorInputHandlerImpl::EventDisposition WebCompositorInputHandlerImpl::h
return DidNotHandle;
const WebGestureEvent& gestureEvent = *static_cast<const WebGestureEvent*>(&event);
- m_inputHandlerClient->scrollBy(IntSize(-gestureEvent.deltaX, -gestureEvent.deltaY));
+ m_inputHandlerClient->scrollBy(IntPoint(gestureEvent.x, gestureEvent.y), IntSize(-gestureEvent.deltaX, -gestureEvent.deltaY));
return DidHandle;
} else if (event.type == WebInputEvent::GestureScrollEnd) {
ASSERT(m_expectScrollUpdateEnd);
@@ -263,7 +263,7 @@ WebCompositorInputHandlerImpl::EventDisposition WebCompositorInputHandlerImpl::h
WebCompositorInputHandlerImpl::EventDisposition WebCompositorInputHandlerImpl::handleGestureFling(const WebGestureEvent& gestureEvent)
{
- CCInputHandlerClient::ScrollStatus scrollStatus = m_inputHandlerClient->scrollBegin(IntPoint(gestureEvent.x, gestureEvent.y), CCInputHandlerClient::Wheel);
+ CCInputHandlerClient::ScrollStatus scrollStatus = m_inputHandlerClient->scrollBegin(IntPoint(gestureEvent.x, gestureEvent.y), CCInputHandlerClient::Gesture);
switch (scrollStatus) {
case CCInputHandlerClient::ScrollStarted: {
TRACE_EVENT_INSTANT0("cc", "WebCompositorInputHandlerImpl::handleGestureFling::started");
diff --git a/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.h b/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.h
index 6bb09ab5c..9474b2193 100644
--- a/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.h
+++ b/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.h
@@ -26,11 +26,11 @@
#ifndef WebCompositorInputHandlerImpl_h
#define WebCompositorInputHandlerImpl_h
+#include "CCGestureCurve.h"
+#include "CCInputHandler.h"
#include "WebActiveWheelFlingParameters.h"
#include "WebCompositorInputHandler.h"
#include "WebInputEvent.h"
-#include "cc/CCGestureCurve.h"
-#include "cc/CCInputHandler.h"
#include <public/WebCompositor.h>
#include <wtf/HashSet.h>
#include <wtf/Noncopyable.h>
diff --git a/Source/WebKit/chromium/src/WebContentLayerImpl.cpp b/Source/WebKit/chromium/src/WebContentLayerImpl.cpp
index 69da1ea3f..fa21e8974 100644
--- a/Source/WebKit/chromium/src/WebContentLayerImpl.cpp
+++ b/Source/WebKit/chromium/src/WebContentLayerImpl.cpp
@@ -26,37 +26,66 @@
#include "config.h"
#include "WebContentLayerImpl.h"
+#include "SkMatrix44.h"
#include <public/WebContentLayerClient.h>
+#include <public/WebFloatPoint.h>
#include <public/WebFloatRect.h>
#include <public/WebRect.h>
+#include <public/WebSize.h>
using namespace WebCore;
namespace WebKit {
-PassRefPtr<WebContentLayerImpl> WebContentLayerImpl::create(WebContentLayerClient* contentClient)
+WebContentLayer* WebContentLayer::create(WebContentLayerClient* client)
{
- return adoptRef(new WebContentLayerImpl(contentClient));
+ return new WebContentLayerImpl(client);
}
-WebContentLayerImpl::WebContentLayerImpl(WebContentLayerClient* contentClient)
- : ContentLayerChromium(this)
- , m_contentClient(contentClient)
+WebContentLayerImpl::WebContentLayerImpl(WebContentLayerClient* client)
+ : m_webLayerImpl(adoptPtr(new WebLayerImpl(ContentLayerChromium::create(this))))
+ , m_client(client)
{
- setIsDrawable(true);
+ m_webLayerImpl->layer()->setIsDrawable(true);
}
WebContentLayerImpl::~WebContentLayerImpl()
{
- clearDelegate();
+ static_cast<ContentLayerChromium*>(m_webLayerImpl->layer())->clearDelegate();
}
+WebLayer* WebContentLayerImpl::layer()
+{
+ return m_webLayerImpl.get();
+}
+
+void WebContentLayerImpl::setDoubleSided(bool doubleSided)
+{
+ m_webLayerImpl->layer()->setDoubleSided(doubleSided);
+}
+
+void WebContentLayerImpl::setContentsScale(float scale)
+{
+ m_webLayerImpl->layer()->setContentsScale(scale);
+}
+
+void WebContentLayerImpl::setUseLCDText(bool enable)
+{
+ m_webLayerImpl->layer()->setUseLCDText(enable);
+}
+
+void WebContentLayerImpl::setDrawCheckerboardForMissingTiles(bool enable)
+{
+ m_webLayerImpl->layer()->setDrawCheckerboardForMissingTiles(enable);
+}
+
+
void WebContentLayerImpl::paintContents(SkCanvas* canvas, const IntRect& clip, FloatRect& opaque)
{
- if (!m_contentClient)
+ if (!m_client)
return;
WebFloatRect webOpaque;
- m_contentClient->paintContents(canvas, WebRect(clip), webOpaque);
+ m_client->paintContents(canvas, WebRect(clip), webOpaque);
opaque = webOpaque;
}
diff --git a/Source/WebKit/chromium/src/WebContentLayerImpl.h b/Source/WebKit/chromium/src/WebContentLayerImpl.h
index 97729ea1e..511f8e0ba 100644
--- a/Source/WebKit/chromium/src/WebContentLayerImpl.h
+++ b/Source/WebKit/chromium/src/WebContentLayerImpl.h
@@ -27,23 +27,33 @@
#define WebContentLayerImpl_h
#include "ContentLayerChromium.h"
+#include "WebLayerImpl.h"
+#include <public/WebContentLayer.h>
#include <wtf/PassRefPtr.h>
namespace WebKit {
class WebContentLayerClient;
-class WebContentLayerImpl : public WebCore::ContentLayerChromium, public WebCore::ContentLayerDelegate {
+class WebContentLayerImpl : public WebContentLayer,
+ public WebCore::ContentLayerDelegate {
public:
- static PassRefPtr<WebContentLayerImpl> create(WebContentLayerClient* contentClient);
+ explicit WebContentLayerImpl(WebContentLayerClient*);
+
+ // WebContentLayer implementation.
+ virtual WebLayer* layer() OVERRIDE;
+ virtual void setDoubleSided(bool) OVERRIDE;
+ virtual void setContentsScale(float) OVERRIDE;
+ virtual void setUseLCDText(bool) OVERRIDE;
+ virtual void setDrawCheckerboardForMissingTiles(bool) OVERRIDE;
protected:
- explicit WebContentLayerImpl(WebContentLayerClient* contentClient);
virtual ~WebContentLayerImpl();
// ContentLayerDelegate implementation.
virtual void paintContents(SkCanvas*, const WebCore::IntRect& clip, WebCore::FloatRect& opaque) OVERRIDE;
- WebContentLayerClient* m_contentClient;
+ OwnPtr<WebLayerImpl> m_webLayerImpl;
+ WebContentLayerClient* m_client;
bool m_drawsContent;
};
diff --git a/Source/WebKit/chromium/src/WebDOMMessageEvent.cpp b/Source/WebKit/chromium/src/WebDOMMessageEvent.cpp
index 53ea43ce1..06cf66fc5 100644
--- a/Source/WebKit/chromium/src/WebDOMMessageEvent.cpp
+++ b/Source/WebKit/chromium/src/WebDOMMessageEvent.cpp
@@ -32,6 +32,7 @@
#include "WebDOMMessageEvent.h"
#include "DOMWindow.h"
+#include "Document.h"
#include "MessageEvent.h"
#include "MessagePort.h"
#include "PlatformMessagePortChannel.h"
@@ -55,7 +56,7 @@ void WebDOMMessageEvent::initMessageEvent(const WebString& type, bool canBubble,
ASSERT(isMessageEvent());
DOMWindow* window = 0;
if (sourceFrame)
- window = static_cast<const WebFrameImpl*>(sourceFrame)->frame()->domWindow();
+ window = static_cast<const WebFrameImpl*>(sourceFrame)->frame()->document()->domWindow();
OwnPtr<MessagePortArray> ports;
unwrap<MessageEvent>()->initMessageEvent(type, canBubble, cancelable, messageData, origin, lastEventId, window, ports.release());
}
diff --git a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
index d4366f99a..e3a80e0d4 100644
--- a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
+++ b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
@@ -424,7 +424,7 @@ void WebDevToolsAgentImpl::didCreateScriptContext(WebFrameImpl* webframe, int wo
if (worldId)
return;
if (WebCore::Frame* frame = webframe->frame())
- frame->script()->proxy()->setContextDebugId(m_hostId);
+ frame->script()->setContextDebugId(m_hostId);
}
void WebDevToolsAgentImpl::mainFrameViewCreated(WebFrameImpl* webFrame)
diff --git a/Source/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp b/Source/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
index 054e5b245..9418c0dc0 100644
--- a/Source/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
+++ b/Source/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
@@ -122,7 +122,7 @@ void WebDevToolsFrontendImpl::dispatchOnInspectorFrontend(const WebString& messa
args.append(ToV8String(message));
v8::TryCatch tryCatch;
tryCatch.SetVerbose(true);
- V8Proxy::instrumentedCallFunction(frame->frame(), function, inspectorBackend, args.size(), args.data());
+ ScriptController::callFunctionWithInstrumentation(frame->frame() ? frame->frame()->document() : 0, function, inspectorBackend, args.size(), args.data());
}
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebExternalTextureLayer.cpp b/Source/WebKit/chromium/src/WebExternalTextureLayer.cpp
deleted file mode 100644
index bbd1f8ddb..000000000
--- a/Source/WebKit/chromium/src/WebExternalTextureLayer.cpp
+++ /dev/null
@@ -1,131 +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 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/WebExternalTextureLayer.h>
-
-#include "TextureLayerChromium.h"
-#include "cc/CCTextureUpdateQueue.h"
-#include <public/WebExternalTextureLayerClient.h>
-#include <public/WebFloatRect.h>
-#include <public/WebSize.h>
-
-using namespace WebCore;
-
-namespace WebKit {
-
-class WebTextureUpdaterImpl : public WebTextureUpdater {
-public:
- explicit WebTextureUpdaterImpl(CCTextureUpdateQueue& queue)
- : m_queue(queue)
- {
- }
-
- virtual void appendCopy(unsigned sourceTexture, unsigned destinationTexture, WebSize size) OVERRIDE
- {
- TextureCopier::Parameters copy = { sourceTexture, destinationTexture, size };
- m_queue.appendCopy(copy);
- }
-
-private:
- CCTextureUpdateQueue& m_queue;
-};
-
-class WebExternalTextureLayerImpl : public TextureLayerChromiumClient, public TextureLayerChromium {
-public:
- explicit WebExternalTextureLayerImpl(WebExternalTextureLayerClient* client)
- : TextureLayerChromium(client ? this : 0)
- , m_client(client)
- {
- }
-
- virtual unsigned prepareTexture(CCTextureUpdateQueue& queue) OVERRIDE
- {
- WebTextureUpdaterImpl updaterImpl(queue);
- return m_client->prepareTexture(updaterImpl);
- }
-
- virtual WebKit::WebGraphicsContext3D* context() OVERRIDE
- {
- return m_client->context();
- }
-
-private:
- WebExternalTextureLayerClient* m_client;
-};
-
-WebExternalTextureLayer WebExternalTextureLayer::create(WebExternalTextureLayerClient* client)
-{
- RefPtr<TextureLayerChromium> layer = adoptRef(new WebExternalTextureLayerImpl(client));
- layer->setIsDrawable(true);
- return WebExternalTextureLayer(layer.release());
-}
-
-void WebExternalTextureLayer::clearClient()
-{
- unwrap<TextureLayerChromium>()->clearClient();
-}
-
-void WebExternalTextureLayer::setTextureId(unsigned id)
-{
- unwrap<TextureLayerChromium>()->setTextureId(id);
-}
-
-void WebExternalTextureLayer::setFlipped(bool flipped)
-{
- unwrap<TextureLayerChromium>()->setFlipped(flipped);
-}
-
-void WebExternalTextureLayer::setUVRect(const WebFloatRect& rect)
-{
- unwrap<TextureLayerChromium>()->setUVRect(rect);
-}
-
-void WebExternalTextureLayer::setOpaque(bool opaque)
-{
- unwrap<TextureLayerChromium>()->setOpaque(opaque);
-}
-
-void WebExternalTextureLayer::setPremultipliedAlpha(bool premultipliedAlpha)
-{
- unwrap<TextureLayerChromium>()->setPremultipliedAlpha(premultipliedAlpha);
-}
-
-void WebExternalTextureLayer::willModifyTexture()
-{
- unwrap<TextureLayerChromium>()->willModifyTexture();
-}
-
-void WebExternalTextureLayer::setRateLimitContext(bool rateLimit)
-{
- unwrap<TextureLayerChromium>()->setRateLimitContext(rateLimit);
-}
-
-WebExternalTextureLayer::WebExternalTextureLayer(PassRefPtr<TextureLayerChromium> layer)
- : WebLayer(layer)
-{
-}
-
-} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebExternalTextureLayerImpl.cpp b/Source/WebKit/chromium/src/WebExternalTextureLayerImpl.cpp
new file mode 100644
index 000000000..d62166f44
--- /dev/null
+++ b/Source/WebKit/chromium/src/WebExternalTextureLayerImpl.cpp
@@ -0,0 +1,132 @@
+/*
+ * 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 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 "WebExternalTextureLayerImpl.h"
+
+#include "CCTextureUpdateQueue.h"
+#include "TextureLayerChromium.h"
+#include "WebLayerImpl.h"
+#include <public/WebExternalTextureLayerClient.h>
+#include <public/WebFloatRect.h>
+#include <public/WebSize.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebExternalTextureLayer* WebExternalTextureLayer::create(WebExternalTextureLayerClient* client)
+{
+ return new WebExternalTextureLayerImpl(client);
+}
+
+WebExternalTextureLayerImpl::WebExternalTextureLayerImpl(WebExternalTextureLayerClient* client)
+ : m_client(client)
+{
+ RefPtr<TextureLayerChromium> layer;
+ if (m_client)
+ layer = TextureLayerChromium::create(this);
+ else
+ layer = TextureLayerChromium::create(0);
+ layer->setIsDrawable(true);
+ m_layer = adoptPtr(new WebLayerImpl(layer.release()));
+}
+
+WebExternalTextureLayerImpl::~WebExternalTextureLayerImpl()
+{
+ static_cast<TextureLayerChromium*>(m_layer->layer())->clearClient();
+}
+
+WebLayer* WebExternalTextureLayerImpl::layer()
+{
+ return m_layer.get();
+}
+
+void WebExternalTextureLayerImpl::setTextureId(unsigned id)
+{
+ static_cast<TextureLayerChromium*>(m_layer->layer())->setTextureId(id);
+}
+
+void WebExternalTextureLayerImpl::setFlipped(bool flipped)
+{
+ static_cast<TextureLayerChromium*>(m_layer->layer())->setFlipped(flipped);
+}
+
+void WebExternalTextureLayerImpl::setUVRect(const WebFloatRect& rect)
+{
+ static_cast<TextureLayerChromium*>(m_layer->layer())->setUVRect(rect);
+}
+
+void WebExternalTextureLayerImpl::setOpaque(bool opaque)
+{
+ static_cast<TextureLayerChromium*>(m_layer->layer())->setOpaque(opaque);
+}
+
+void WebExternalTextureLayerImpl::setPremultipliedAlpha(bool premultipliedAlpha)
+{
+ static_cast<TextureLayerChromium*>(m_layer->layer())->setPremultipliedAlpha(premultipliedAlpha);
+}
+
+void WebExternalTextureLayerImpl::willModifyTexture()
+{
+ static_cast<TextureLayerChromium*>(m_layer->layer())->willModifyTexture();
+}
+
+void WebExternalTextureLayerImpl::setRateLimitContext(bool rateLimit)
+{
+ static_cast<TextureLayerChromium*>(m_layer->layer())->setRateLimitContext(rateLimit);
+}
+
+class WebTextureUpdaterImpl : public WebTextureUpdater {
+public:
+ explicit WebTextureUpdaterImpl(CCTextureUpdateQueue& queue)
+ : m_queue(queue)
+ {
+ }
+
+ virtual void appendCopy(unsigned sourceTexture, unsigned destinationTexture, WebSize size) OVERRIDE
+ {
+ TextureCopier::Parameters copy = { sourceTexture, destinationTexture, size };
+ m_queue.appendCopy(copy);
+ }
+
+private:
+ CCTextureUpdateQueue& m_queue;
+};
+
+unsigned WebExternalTextureLayerImpl::prepareTexture(CCTextureUpdateQueue& queue)
+{
+ ASSERT(m_client);
+ WebTextureUpdaterImpl updaterImpl(queue);
+ return m_client->prepareTexture(updaterImpl);
+}
+
+WebGraphicsContext3D* WebExternalTextureLayerImpl::context()
+{
+ ASSERT(m_client);
+ return m_client->context();
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebContentLayer.cpp b/Source/WebKit/chromium/src/WebExternalTextureLayerImpl.h
index efa7465b1..5348895bf 100644
--- a/Source/WebKit/chromium/src/WebContentLayer.cpp
+++ b/Source/WebKit/chromium/src/WebExternalTextureLayerImpl.h
@@ -23,60 +23,42 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
-#include <public/WebContentLayer.h>
+#ifndef WebExternalTextureLayerImpl_h
+#define WebExternalTextureLayerImpl_h
-#include "ContentLayerChromium.h"
-#include "WebContentLayerImpl.h"
-
-using namespace WebCore;
+#include "TextureLayerChromium.h"
+#include <public/WebExternalTextureLayer.h>
namespace WebKit {
-WebContentLayer WebContentLayer::create(WebContentLayerClient* contentClient)
-{
- return WebContentLayer(WebContentLayerImpl::create(contentClient));
-}
+class WebLayerImpl;
-void WebContentLayer::clearClient()
-{
- unwrap<ContentLayerChromium>()->clearDelegate();
-}
+class WebExternalTextureLayerImpl : public WebExternalTextureLayer,
+ public WebCore::TextureLayerChromiumClient {
+public:
+ explicit WebExternalTextureLayerImpl(WebExternalTextureLayerClient*);
+ virtual ~WebExternalTextureLayerImpl();
-void WebContentLayer::setDoubleSided(bool doubleSided)
-{
- m_private->setDoubleSided(doubleSided);
-}
+ // WebExternalTextureLayer implementation.
+ virtual WebLayer* layer() OVERRIDE;
+ virtual void setTextureId(unsigned) OVERRIDE;
+ virtual void setFlipped(bool) OVERRIDE;
+ virtual void setUVRect(const WebFloatRect&) OVERRIDE;
+ virtual void setOpaque(bool) OVERRIDE;
+ virtual void setPremultipliedAlpha(bool) OVERRIDE;
+ virtual void willModifyTexture() OVERRIDE;
+ virtual void setRateLimitContext(bool) OVERRIDE;
-void WebContentLayer::setContentsScale(float scale)
-{
- m_private->setContentsScale(scale);
-}
+ // TextureLayerChromiumClient implementation.
+ virtual unsigned prepareTexture(WebCore::CCTextureUpdateQueue&) OVERRIDE;
+ virtual WebGraphicsContext3D* context() OVERRIDE;
-void WebContentLayer::setUseLCDText(bool enable)
-{
- m_private->setUseLCDText(enable);
-}
+private:
+ WebExternalTextureLayerClient* m_client;
+ OwnPtr<WebLayerImpl> m_layer;
+};
-void WebContentLayer::setDrawCheckerboardForMissingTiles(bool enable)
-{
- m_private->setDrawCheckerboardForMissingTiles(enable);
}
-WebContentLayer::WebContentLayer(const PassRefPtr<ContentLayerChromium>& node)
- : WebScrollableLayer(node)
-{
-}
-
-WebContentLayer& WebContentLayer::operator=(const PassRefPtr<ContentLayerChromium>& node)
-{
- m_private = node;
- return *this;
-}
-
-WebContentLayer::operator PassRefPtr<ContentLayerChromium>() const
-{
- return static_cast<ContentLayerChromium*>(m_private.get());
-}
+#endif // WebExternalTextureLayerImpl_h
-} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebFloatAnimationCurve.cpp b/Source/WebKit/chromium/src/WebFloatAnimationCurve.cpp
index d8cc9bb98..e8cf7c2d2 100644
--- a/Source/WebKit/chromium/src/WebFloatAnimationCurve.cpp
+++ b/Source/WebKit/chromium/src/WebFloatAnimationCurve.cpp
@@ -26,9 +26,9 @@
#include <public/WebFloatAnimationCurve.h>
+#include "CCKeyframedAnimationCurve.h"
+#include "CCTimingFunction.h"
#include "WebAnimationCurveCommon.h"
-#include "cc/CCKeyframedAnimationCurve.h"
-#include "cc/CCTimingFunction.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp
index fb2a29540..0a9855f15 100644
--- a/Source/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp
@@ -89,6 +89,7 @@
#include "EventHandler.h"
#include "EventListenerWrapper.h"
#include "FileSystemType.h"
+#include "FindInPageCoordinates.h"
#include "FocusController.h"
#include "FontCache.h"
#include "FormState.h"
@@ -118,6 +119,7 @@
#include "PlatformSupport.h"
#include "PluginDocument.h"
#include "PrintContext.h"
+#include "RenderBox.h"
#include "RenderFrame.h"
#include "RenderLayer.h"
#include "RenderObject.h"
@@ -192,6 +194,7 @@
#include "V8DirectoryEntry.h"
#include "V8DOMFileSystem.h"
#include "V8FileEntry.h"
+#include "V8GCController.h"
#include <public/WebFileSystem.h>
#endif
@@ -516,6 +519,12 @@ static WebDataSource* DataSourceForDocLoader(DocumentLoader* loader)
return loader ? WebDataSourceImpl::fromDocumentLoader(loader) : 0;
}
+WebFrameImpl::FindMatch::FindMatch(PassRefPtr<Range> range, int ordinal)
+ : m_range(range)
+ , m_ordinal(ordinal)
+{
+}
+
// WebFrame -------------------------------------------------------------------
class WebFrameImpl::DeferredScopeStringMatches {
@@ -574,8 +583,8 @@ WebFrame* WebFrame::frameForCurrentContext()
#if WEBKIT_USING_V8
WebFrame* WebFrame::frameForContext(v8::Handle<v8::Context> context)
-{
- return WebFrameImpl::fromFrame(V8Proxy::retrieveFrame(context));
+{
+ return WebFrameImpl::fromFrame(toFrameIfNotDetached(context));
}
#endif
@@ -801,10 +810,10 @@ WebAnimationController* WebFrameImpl::animationController()
WebPerformance WebFrameImpl::performance() const
{
- if (!m_frame || !m_frame->domWindow())
+ if (!m_frame)
return WebPerformance();
- return WebPerformance(m_frame->domWindow()->performance());
+ return WebPerformance(m_frame->document()->domWindow()->performance());
}
NPObject* WebFrameImpl::windowObject() const
@@ -879,7 +888,7 @@ void WebFrameImpl::addMessageToConsole(const WebConsoleMessage& message)
return;
}
- frame()->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, webCoreMessageLevel, message.text);
+ frame()->document()->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, webCoreMessageLevel, message.text);
}
void WebFrameImpl::collectGarbage()
@@ -890,7 +899,7 @@ void WebFrameImpl::collectGarbage()
return;
// FIXME: Move this to the ScriptController and make it JS neutral.
#if USE(V8)
- m_frame->script()->collectGarbage();
+ V8GCController::collectGarbage();
#else
notImplemented();
#endif
@@ -952,7 +961,7 @@ v8::Local<v8::Context> WebFrameImpl::mainWorldScriptContext() const
if (!m_frame)
return v8::Local<v8::Context>();
- return V8Proxy::mainWorldContext(m_frame);
+ return ScriptController::mainWorldContext(m_frame);
}
v8::Handle<v8::Value> WebFrameImpl::createFileSystem(WebFileSystem::Type type,
@@ -1172,7 +1181,7 @@ void WebFrameImpl::commitDocumentData(const char* data, size_t length)
unsigned WebFrameImpl::unloadListenerCount() const
{
- return frame()->domWindow()->pendingUnloadEventListeners();
+ return frame()->document()->domWindow()->pendingUnloadEventListeners();
}
bool WebFrameImpl::isProcessingUserGesture() const
@@ -1495,7 +1504,7 @@ VisiblePosition WebFrameImpl::visiblePositionForWindowPoint(const WebPoint& poin
frame()->document()->renderView()->layer()->hitTest(request, result);
- Node* node = EventHandler::targetNode(result);
+ Node* node = result.targetNode();
if (!node)
return VisiblePosition();
@@ -1654,10 +1663,18 @@ bool WebFrameImpl::find(int identifier,
m_activeMatch = frame()->editor()->findStringAndScrollToVisible(searchText, m_activeMatch.get(), findOptions);
if (!m_activeMatch) {
+ // If we're finding next the next active match might not be in the current frame.
+ // In this case we don't want to clear the matches cache.
+ if (!options.findNext)
+ clearFindMatchesCache();
invalidateArea(InvalidateAll);
return false;
}
+#if OS(ANDROID)
+ viewImpl()->zoomToFindInPageRect(frameView()->contentsToWindow(enclosingIntRect(RenderObject::absoluteBoundingBoxRectForRange(m_activeMatch.get()))));
+#endif
+
setMarkerActive(m_activeMatch.get(), true);
WebFrameImpl* oldActiveFrame = mainFrameImpl->m_currentActiveMatchFrame;
mainFrameImpl->m_currentActiveMatchFrame = this;
@@ -1705,6 +1722,7 @@ void WebFrameImpl::stopFinding(bool clearSelection)
// Remove all markers for matches found and turn off the highlighting.
frame()->document()->markers()->removeMarkers(DocumentMarker::TextMatch);
frame()->editor()->setMarkedTextMatchesAreHighlighted(false);
+ clearFindMatchesCache();
// Let the frame know that we don't want tickmarks or highlighting anymore.
invalidateArea(InvalidateAll);
@@ -1727,6 +1745,10 @@ void WebFrameImpl::scopeStringMatches(int identifier,
// Clear highlighting for this frame.
if (frame()->editor()->markedTextMatchesAreHighlighted())
frame()->page()->unmarkAllTextMatches();
+
+ // Clear the tickmarks and results cache.
+ clearFindMatchesCache();
+
// Clear the counters from last operation.
m_lastMatchCount = 0;
m_nextInvalidateAfter = 0;
@@ -1825,6 +1847,8 @@ void WebFrameImpl::scopeStringMatches(int identifier,
addMarker(resultRange.get(), foundActiveMatch);
+ m_findMatchesCache.append(FindMatch(resultRange.get(), m_lastMatchCount + matchCount));
+
// Set the new start for the search range to be the end of the previous
// result range. There is no need to use a VisiblePosition here,
// since findPlainText will use a TextIterator to go over the visible
@@ -1895,6 +1919,9 @@ void WebFrameImpl::increaseMatchCount(int count, int identifier)
// This function should only be called on the mainframe.
ASSERT(!parent());
+ if (count)
+ ++m_findMatchMarkersVersion;
+
m_totalMatchCount += count;
// Update the UI with the latest findings.
@@ -1913,6 +1940,9 @@ void WebFrameImpl::reportFindInPageSelection(const WebRect& selectionRect,
void WebFrameImpl::resetMatchCount()
{
+ if (m_totalMatchCount > 0)
+ ++m_findMatchMarkersVersion;
+
m_totalMatchCount = 0;
m_framesScopingCount = 0;
}
@@ -1927,57 +1957,215 @@ void WebFrameImpl::sendOrientationChangeEvent(int orientation)
void WebFrameImpl::addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture)
{
- DOMWindow* window = m_frame->domWindow();
-
- EventListenerWrapper* listenerWrapper =
- listener->createEventListenerWrapper(eventType, useCapture, window);
-
- m_frame->domWindow()->addEventListener(eventType, adoptRef(listenerWrapper), useCapture);
+ DOMWindow* window = m_frame->document()->domWindow();
+ EventListenerWrapper* listenerWrapper = listener->createEventListenerWrapper(eventType, useCapture, window);
+ window->addEventListener(eventType, adoptRef(listenerWrapper), useCapture);
}
void WebFrameImpl::removeEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture)
{
- DOMWindow* window = m_frame->domWindow();
-
- EventListenerWrapper* listenerWrapper =
- listener->getEventListenerWrapper(eventType, useCapture, window);
+ DOMWindow* window = m_frame->document()->domWindow();
+ EventListenerWrapper* listenerWrapper = listener->getEventListenerWrapper(eventType, useCapture, window);
window->removeEventListener(eventType, listenerWrapper, useCapture);
}
bool WebFrameImpl::dispatchEvent(const WebDOMEvent& event)
{
ASSERT(!event.isNull());
- return m_frame->domWindow()->dispatchEvent(event);
+ return m_frame->document()->domWindow()->dispatchEvent(event);
}
void WebFrameImpl::dispatchMessageEventWithOriginCheck(const WebSecurityOrigin& intendedTargetOrigin, const WebDOMEvent& event)
{
ASSERT(!event.isNull());
// Pass an empty call stack, since we don't have the one from the other process.
- m_frame->domWindow()->dispatchMessageEventWithOriginCheck(intendedTargetOrigin.get(), event, 0);
+ m_frame->document()->domWindow()->dispatchMessageEventWithOriginCheck(intendedTargetOrigin.get(), event, 0);
}
int WebFrameImpl::findMatchMarkersVersion() const
{
- // FIXME: Implement this as part of https://bugs.webkit.org/show_bug.cgi?id=93111.
- return 0;
+ ASSERT(!parent());
+ return m_findMatchMarkersVersion;
+}
+
+void WebFrameImpl::clearFindMatchesCache()
+{
+ if (!m_findMatchesCache.isEmpty())
+ viewImpl()->mainFrameImpl()->m_findMatchMarkersVersion++;
+
+ m_findMatchesCache.clear();
+ m_findMatchRectsAreValid = false;
+}
+
+bool WebFrameImpl::isActiveMatchFrameValid() const
+{
+ WebFrameImpl* mainFrameImpl = viewImpl()->mainFrameImpl();
+ WebFrameImpl* activeMatchFrame = mainFrameImpl->activeMatchFrame();
+ return activeMatchFrame && activeMatchFrame->m_activeMatch
+ && activeMatchFrame->frame()->tree()->isDescendantOf(mainFrameImpl->frame());
+}
+
+void WebFrameImpl::updateFindMatchRects()
+{
+ IntSize currentContentsSize = contentsSize();
+ if (m_contentsSizeForCurrentFindMatchRects != currentContentsSize) {
+ m_contentsSizeForCurrentFindMatchRects = currentContentsSize;
+ m_findMatchRectsAreValid = false;
+ }
+
+ size_t deadMatches = 0;
+ for (Vector<FindMatch>::iterator it = m_findMatchesCache.begin(); it != m_findMatchesCache.end(); ++it) {
+ if (!it->m_range->boundaryPointsValid() || !it->m_range->startContainer()->inDocument())
+ it->m_rect = FloatRect();
+ else if (!m_findMatchRectsAreValid)
+ it->m_rect = findInPageRectFromRange(it->m_range.get());
+
+ if (it->m_rect.isEmpty())
+ ++deadMatches;
+ }
+
+ // Remove any invalid matches from the cache.
+ if (deadMatches) {
+ Vector<FindMatch> filteredMatches;
+ filteredMatches.reserveCapacity(m_findMatchesCache.size() - deadMatches);
+
+ for (Vector<FindMatch>::const_iterator it = m_findMatchesCache.begin(); it != m_findMatchesCache.end(); ++it)
+ if (!it->m_rect.isEmpty())
+ filteredMatches.append(*it);
+
+ m_findMatchesCache.swap(filteredMatches);
+ }
+
+ // Invalidate the rects in child frames. Will be updated later during traversal.
+ if (!m_findMatchRectsAreValid)
+ for (WebFrame* child = firstChild(); child; child = child->nextSibling())
+ static_cast<WebFrameImpl*>(child)->m_findMatchRectsAreValid = false;
+
+ m_findMatchRectsAreValid = true;
}
WebFloatRect WebFrameImpl::activeFindMatchRect()
{
- // FIXME: Implement this as part of https://bugs.webkit.org/show_bug.cgi?id=93111.
- return WebFloatRect();
+ ASSERT(!parent());
+
+ if (!isActiveMatchFrameValid())
+ return WebFloatRect();
+
+ return WebFloatRect(findInPageRectFromRange(m_currentActiveMatchFrame->m_activeMatch.get()));
}
void WebFrameImpl::findMatchRects(WebVector<WebFloatRect>& outputRects)
{
- // FIXME: Implement this as part of https://bugs.webkit.org/show_bug.cgi?id=93111.
+ ASSERT(!parent());
+
+ Vector<WebFloatRect> matchRects;
+ for (WebFrameImpl* frame = this; frame; frame = static_cast<WebFrameImpl*>(frame->traverseNext(false)))
+ frame->appendFindMatchRects(matchRects);
+
+ outputRects = matchRects;
+}
+
+void WebFrameImpl::appendFindMatchRects(Vector<WebFloatRect>& frameRects)
+{
+ updateFindMatchRects();
+ frameRects.reserveCapacity(frameRects.size() + m_findMatchesCache.size());
+ for (Vector<FindMatch>::const_iterator it = m_findMatchesCache.begin(); it != m_findMatchesCache.end(); ++it) {
+ ASSERT(!it->m_rect.isEmpty());
+ frameRects.append(it->m_rect);
+ }
}
int WebFrameImpl::selectNearestFindMatch(const WebFloatPoint& point, WebRect* selectionRect)
{
- // FIXME: Implement this as part of https://bugs.webkit.org/show_bug.cgi?id=93111.
- return 0;
+ ASSERT(!parent());
+
+ WebFrameImpl* bestFrame = 0;
+ int indexInBestFrame = -1;
+ float distanceInBestFrame = FLT_MAX;
+
+ for (WebFrameImpl* frame = this; frame; frame = static_cast<WebFrameImpl*>(frame->traverseNext(false))) {
+ float distanceInFrame;
+ int indexInFrame = frame->nearestFindMatch(point, distanceInFrame);
+ if (distanceInFrame < distanceInBestFrame) {
+ bestFrame = frame;
+ indexInBestFrame = indexInFrame;
+ distanceInBestFrame = distanceInFrame;
+ }
+ }
+
+ if (indexInBestFrame != -1)
+ return bestFrame->selectFindMatch(static_cast<unsigned>(indexInBestFrame), selectionRect);
+
+ return -1;
+}
+
+int WebFrameImpl::nearestFindMatch(const FloatPoint& point, float& distanceSquared)
+{
+ updateFindMatchRects();
+
+ int nearest = -1;
+ distanceSquared = FLT_MAX;
+ for (size_t i = 0; i < m_findMatchesCache.size(); ++i) {
+ ASSERT(!m_findMatchesCache[i].m_rect.isEmpty());
+ FloatSize offset = point - m_findMatchesCache[i].m_rect.center();
+ float width = offset.width();
+ float height = offset.height();
+ float currentDistanceSquared = width * width + height * height;
+ if (currentDistanceSquared < distanceSquared) {
+ nearest = i;
+ distanceSquared = currentDistanceSquared;
+ }
+ }
+ return nearest;
+}
+
+int WebFrameImpl::selectFindMatch(unsigned index, WebRect* selectionRect)
+{
+ ASSERT(index < m_findMatchesCache.size());
+
+ RefPtr<Range> range = m_findMatchesCache[index].m_range;
+ if (!range->boundaryPointsValid() || !range->startContainer()->inDocument())
+ return -1;
+
+ // Check if the match is already selected.
+ WebFrameImpl* activeMatchFrame = viewImpl()->mainFrameImpl()->m_currentActiveMatchFrame;
+ if (this != activeMatchFrame || !m_activeMatch || !areRangesEqual(m_activeMatch.get(), range.get())) {
+ if (isActiveMatchFrameValid())
+ activeMatchFrame->setMarkerActive(activeMatchFrame->m_activeMatch.get(), false);
+
+ m_activeMatchIndexInCurrentFrame = m_findMatchesCache[index].m_ordinal - 1;
+
+ // Set this frame as the active frame (the one with the active highlight).
+ viewImpl()->mainFrameImpl()->m_currentActiveMatchFrame = this;
+ viewImpl()->setFocusedFrame(this);
+
+ m_activeMatch = range.release();
+ setMarkerActive(m_activeMatch.get(), true);
+
+ // Clear any user selection, to make sure Find Next continues on from the match we just activated.
+ frame()->selection()->clear();
+
+ // Make sure no node is focused. See http://crbug.com/38700.
+ frame()->document()->setFocusedNode(0);
+ }
+
+ IntRect activeMatchRect;
+ IntRect activeMatchBoundingBox = enclosingIntRect(RenderObject::absoluteBoundingBoxRectForRange(m_activeMatch.get()));
+
+ if (!activeMatchBoundingBox.isEmpty()) {
+ if (m_activeMatch->firstNode() && m_activeMatch->firstNode()->renderer())
+ m_activeMatch->firstNode()->renderer()->scrollRectToVisible(activeMatchBoundingBox,
+ ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeeded);
+
+ // Zoom to the active match.
+ activeMatchRect = frameView()->contentsToWindow(activeMatchBoundingBox);
+ viewImpl()->zoomToFindInPageRect(activeMatchRect);
+ }
+
+ if (selectionRect)
+ *selectionRect = activeMatchRect;
+
+ return ordinalOfFirstMatchForFrame(this) + m_activeMatchIndexInCurrentFrame + 1;
}
void WebFrameImpl::deliverIntent(const WebIntent& intent, WebMessagePortChannelArray* ports, WebDeliveredIntentClient* intentClient)
@@ -1998,11 +2186,11 @@ void WebFrameImpl::deliverIntent(const WebIntent& intent, WebMessagePortChannelA
(*channels)[i] = MessagePortChannel::create(platformChannel);
}
}
- OwnPtr<MessagePortArray> portArray = WebCore::MessagePort::entanglePorts(*(m_frame->domWindow()->scriptExecutionContext()), channels.release());
+ OwnPtr<MessagePortArray> portArray = WebCore::MessagePort::entanglePorts(*(m_frame->document()), channels.release());
RefPtr<DeliveredIntent> deliveredIntent = DeliveredIntent::create(m_frame, client.release(), intent.action(), intent.type(), intentData, portArray.release(), webcoreIntent->extras());
- DOMWindowIntents::from(m_frame->domWindow())->deliver(deliveredIntent.release());
+ DOMWindowIntents::from(m_frame->document()->domWindow())->deliver(deliveredIntent.release());
#endif
}
@@ -2097,6 +2285,8 @@ WebFrameImpl::WebFrameImpl(WebFrameClient* client)
, m_framesScopingCount(-1)
, m_scopingComplete(false)
, m_nextInvalidateAfter(0)
+ , m_findMatchMarkersVersion(0)
+ , m_findMatchRectsAreValid(false)
, m_animationController(this)
, m_identifier(generateFrameIdentifier())
, m_inSameDocumentHistoryLoad(false)
@@ -2175,6 +2365,15 @@ PassRefPtr<Frame> WebFrameImpl::createChildFrame(
return childFrame.release();
}
+void WebFrameImpl::didChangeContentsSize(const IntSize& size)
+{
+ // This is only possible on the main frame.
+ if (m_totalMatchCount > 0) {
+ ASSERT(!parent());
+ ++m_findMatchMarkersVersion;
+ }
+}
+
void WebFrameImpl::createFrameView()
{
ASSERT(m_frame); // If m_frame doesn't exist, we probably didn't init properly.
diff --git a/Source/WebKit/chromium/src/WebFrameImpl.h b/Source/WebKit/chromium/src/WebFrameImpl.h
index 0aba56f4c..e83b3b0f7 100644
--- a/Source/WebKit/chromium/src/WebFrameImpl.h
+++ b/Source/WebKit/chromium/src/WebFrameImpl.h
@@ -45,6 +45,7 @@ namespace WebCore {
class GraphicsContext;
class HTMLInputElement;
class HistoryItem;
+class IntSize;
class KURL;
class Node;
class Range;
@@ -248,6 +249,8 @@ public:
PassRefPtr<WebCore::Frame> createChildFrame(
const WebCore::FrameLoadRequest&, WebCore::HTMLFrameOwnerElement*);
+ void didChangeContentsSize(const WebCore::IntSize&);
+
void createFrameView();
static WebFrameImpl* fromFrame(WebCore::Frame* frame);
@@ -270,7 +273,11 @@ public:
// Returns which frame has an active match. This function should only be
// called on the main frame, as it is the only frame keeping track. Returned
// value can be 0 if no frame has an active match.
- const WebFrameImpl* activeMatchFrame() const { return m_currentActiveMatchFrame; }
+ WebFrameImpl* activeMatchFrame() const { return m_currentActiveMatchFrame; }
+
+ // Returns the active match in the current frame. Could be a null range if
+ // the local frame has no active match.
+ WebCore::Range* activeMatch() const { return m_activeMatch.get(); }
// When a Find operation ends, we want to set the selection to what was active
// and set focus to the first focusable node we find (starting with the first
@@ -297,6 +304,19 @@ private:
friend class DeferredScopeStringMatches;
friend class FrameLoaderClientImpl;
+ struct FindMatch {
+ RefPtr<WebCore::Range> m_range;
+
+ // 1-based index within this frame.
+ int m_ordinal;
+
+ // In find-in-page coordinates.
+ // Lazily calculated by updateFindMatchRects.
+ WebCore::FloatRect m_rect;
+
+ FindMatch(PassRefPtr<WebCore::Range>, int ordinal);
+ };
+
// A bit mask specifying area of the frame to invalidate.
enum AreaToInvalidate {
InvalidateNothing,
@@ -315,6 +335,32 @@ private:
void reportFindInPageSelection(
const WebRect& selectionRect, int activeMatchOrdinal, int identifier);
+ // Clear the find-in-page matches cache forcing rects to be fully
+ // calculated again next time updateFindMatchRects is called.
+ void clearFindMatchesCache();
+
+ // Check if the activeMatchFrame still exists in the frame tree.
+ bool isActiveMatchFrameValid() const;
+
+ // Return the index in the find-in-page cache of the match closest to the
+ // provided point in find-in-page coordinates, or -1 in case of error.
+ // The squared distance to the closest match is returned in the distanceSquared parameter.
+ int nearestFindMatch(const WebCore::FloatPoint&, float& distanceSquared);
+
+ // Select a find-in-page match marker in the current frame using a cache
+ // match index returned by nearestFindMatch. Returns the ordinal of the new
+ // selected match or -1 in case of error. Also provides the bounding box of
+ // the marker in window coordinates if selectionRect is not null.
+ int selectFindMatch(unsigned index, WebRect* selectionRect);
+
+ // Compute and cache the rects for FindMatches if required.
+ // Rects are automatically invalidated in case of content size changes,
+ // propagating the invalidation to child frames.
+ void updateFindMatchRects();
+
+ // Append the find-in-page match rects of the current frame to the provided vector.
+ void appendFindMatchRects(Vector<WebFloatRect>& frameRects);
+
// Invalidates a certain area within the frame.
void invalidateArea(AreaToInvalidate);
@@ -414,6 +460,21 @@ private:
// A list of all of the pending calls to scopeStringMatches.
Vector<DeferredScopeStringMatches*> m_deferredScopingWork;
+ // Version number incremented on the main frame only whenever the document
+ // find-in-page match markers change. It should be 0 for all other frames.
+ int m_findMatchMarkersVersion;
+
+ // Local cache of the find match markers currently displayed for this frame.
+ Vector<FindMatch> m_findMatchesCache;
+
+ // Determines if the rects in the find-in-page matches cache of this frame
+ // are invalid and should be recomputed.
+ bool m_findMatchRectsAreValid;
+
+ // Contents size when find-in-page match rects were last computed for this
+ // frame's cache.
+ WebCore::IntSize m_contentsSizeForCurrentFindMatchRects;
+
// Valid between calls to BeginPrint() and EndPrint(). Containts the print
// information. Is used by PrintPage().
OwnPtr<ChromePrintContext> m_printContext;
diff --git a/Source/WebKit/chromium/src/WebHistoryItem.cpp b/Source/WebKit/chromium/src/WebHistoryItem.cpp
index db35317ad..31d2bd564 100644
--- a/Source/WebKit/chromium/src/WebHistoryItem.cpp
+++ b/Source/WebKit/chromium/src/WebHistoryItem.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "WebHistoryItem.h"
+#include "FormController.h"
#include "FormData.h"
#include "HistoryItem.h"
#include "KURL.h"
@@ -287,6 +288,23 @@ void WebHistoryItem::appendToChildren(const WebHistoryItem& item)
m_private->addChildItem(item);
}
+WebVector<WebString> WebHistoryItem::getReferencedFilePaths() const
+{
+ Vector<WebString> filePaths;
+ const FormData* formData = m_private->formData();
+ if (formData) {
+ for (size_t i = 0; i < formData->elements().size(); ++i) {
+ const FormDataElement& element = formData->elements()[i];
+ if (element.m_type == FormDataElement::encodedFile)
+ filePaths.append(element.m_filename);
+ }
+ }
+ const Vector<String>& selectedFilePaths = WebCore::FormController::getReferencedFilePaths(m_private->documentState());
+ for (size_t i = 0; i < selectedFilePaths.size(); ++i)
+ filePaths.append(selectedFilePaths[i]);
+ return filePaths;
+}
+
WebHistoryItem::WebHistoryItem(const PassRefPtr<HistoryItem>& item)
: m_private(item)
{
diff --git a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp
index 5b5aedf7c..2cb90ea46 100644
--- a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp
@@ -48,6 +48,7 @@ namespace WebKit {
WebIDBCallbacksImpl::WebIDBCallbacksImpl(PassRefPtr<IDBCallbacks> callbacks)
: m_callbacks(callbacks)
+ , m_didCreateDatabaseProxy(false)
{
}
@@ -65,13 +66,17 @@ void WebIDBCallbacksImpl::onSuccess(const WebDOMStringList& domStringList)
m_callbacks->onSuccess(domStringList);
}
-void WebIDBCallbacksImpl::onSuccess(WebIDBCursor* cursor)
+void WebIDBCallbacksImpl::onSuccess(WebIDBCursor* cursor, const WebIDBKey& key, const WebIDBKey& primaryKey, const WebSerializedScriptValue& value)
{
- m_callbacks->onSuccess(IDBCursorBackendProxy::create(adoptPtr(cursor)));
+ m_callbacks->onSuccess(IDBCursorBackendProxy::create(adoptPtr(cursor)), key, primaryKey, value);
}
void WebIDBCallbacksImpl::onSuccess(WebIDBDatabase* webKitInstance)
{
+ if (m_didCreateDatabaseProxy) {
+ m_callbacks->onSuccess(IDBDatabaseBackendProxy::create(adoptPtr(static_cast<WebIDBDatabase*>(0))));
+ return;
+ }
m_callbacks->onSuccess(IDBDatabaseBackendProxy::create(adoptPtr(webKitInstance)));
}
@@ -95,9 +100,9 @@ void WebIDBCallbacksImpl::onSuccess(const WebSerializedScriptValue& serializedSc
m_callbacks->onSuccess(serializedScriptValue, key, keyPath);
}
-void WebIDBCallbacksImpl::onSuccessWithContinuation()
+void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key, const WebIDBKey& primaryKey, const WebSerializedScriptValue& value)
{
- m_callbacks->onSuccessWithContinuation();
+ m_callbacks->onSuccess(key, primaryKey, value);
}
void WebIDBCallbacksImpl::onBlocked()
@@ -105,6 +110,17 @@ void WebIDBCallbacksImpl::onBlocked()
m_callbacks->onBlocked();
}
+void WebIDBCallbacksImpl::onBlocked(long long oldVersion)
+{
+ m_callbacks->onBlocked(oldVersion);
+}
+
+void WebIDBCallbacksImpl::onUpgradeNeeded(long long oldVersion, WebIDBTransaction* transaction, WebIDBDatabase* database)
+{
+ m_didCreateDatabaseProxy = true;
+ m_callbacks->onUpgradeNeeded(oldVersion, IDBTransactionBackendProxy::create(adoptPtr(transaction)), IDBDatabaseBackendProxy::create(adoptPtr(database)));
+}
+
} // namespace WebKit
#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h
index 7b0216359..33cd2029f 100644
--- a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h
@@ -43,17 +43,20 @@ public:
virtual void onError(const WebIDBDatabaseError&);
virtual void onSuccess(const WebDOMStringList&);
- virtual void onSuccess(WebIDBCursor*);
+ virtual void onSuccess(WebIDBCursor*, const WebIDBKey&, const WebIDBKey& primaryKey, const WebSerializedScriptValue&);
virtual void onSuccess(WebIDBDatabase*);
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 onSuccess(const WebIDBKey&, const WebIDBKey& primaryKey, const WebSerializedScriptValue&);
virtual void onBlocked();
+ virtual void onBlocked(long long oldVersion);
+ virtual void onUpgradeNeeded(long long oldVersion, WebIDBTransaction*, WebIDBDatabase*);
private:
RefPtr<WebCore::IDBCallbacks> m_callbacks;
+ bool m_didCreateDatabaseProxy;
};
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp b/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp
index 0d65a87be..252cfdd11 100644
--- a/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp
@@ -47,21 +47,6 @@ WebIDBCursorImpl::~WebIDBCursorImpl()
{
}
-WebIDBKey WebIDBCursorImpl::key() const
-{
- return m_idbCursorBackend->key();
-}
-
-WebIDBKey WebIDBCursorImpl::primaryKey() const
-{
- return m_idbCursorBackend->primaryKey();
-}
-
-WebSerializedScriptValue WebIDBCursorImpl::value() const
-{
- return m_idbCursorBackend->value();
-}
-
void WebIDBCursorImpl::advance(unsigned long count, WebIDBCallbacks* callbacks, WebExceptionCode& ec)
{
m_idbCursorBackend->advance(count, IDBCallbacksProxy::create(adoptPtr(callbacks)), ec);
diff --git a/Source/WebKit/chromium/src/WebIDBCursorImpl.h b/Source/WebKit/chromium/src/WebIDBCursorImpl.h
index 45a229b38..eccc65dd0 100644
--- a/Source/WebKit/chromium/src/WebIDBCursorImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBCursorImpl.h
@@ -44,9 +44,6 @@ public:
WebIDBCursorImpl(WTF::PassRefPtr<WebCore::IDBCursorBackendInterface>);
virtual ~WebIDBCursorImpl();
- virtual WebIDBKey key() const;
- virtual WebIDBKey primaryKey() const;
- virtual WebSerializedScriptValue value() const;
virtual void advance(unsigned long, WebIDBCallbacks*, WebExceptionCode&);
virtual void continueFunction(const WebIDBKey&, WebIDBCallbacks*, WebExceptionCode&);
virtual void deleteFunction(WebIDBCallbacks*, WebExceptionCode&);
diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp
index ff0e89864..14757bac6 100644
--- a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp
@@ -44,6 +44,11 @@ WebIDBDatabaseCallbacksImpl::~WebIDBDatabaseCallbacksImpl()
{
}
+void WebIDBDatabaseCallbacksImpl::onVersionChange(long long oldVersion, long long newVersion)
+{
+ m_callbacks->onVersionChange(oldVersion, newVersion);
+}
+
void WebIDBDatabaseCallbacksImpl::onVersionChange(const WebString& version)
{
m_callbacks->onVersionChange(version);
diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h
index 21c3dc7c5..1857ca658 100644
--- a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h
@@ -43,6 +43,7 @@ public:
WebIDBDatabaseCallbacksImpl(PassRefPtr<WebCore::IDBDatabaseCallbacks>);
virtual ~WebIDBDatabaseCallbacksImpl();
+ virtual void onVersionChange(long long oldVersion, long long newVersion);
virtual void onVersionChange(const WebString& version);
private:
diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
index bc6d09fa1..9343281cf 100644
--- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
@@ -47,6 +47,7 @@ namespace WebKit {
WebIDBDatabaseImpl::WebIDBDatabaseImpl(PassRefPtr<IDBDatabaseBackendInterface> databaseBackend)
: m_databaseBackend(databaseBackend)
+ , m_closePending(false)
{
}
@@ -94,8 +95,10 @@ void WebIDBDatabaseImpl::close()
{
// Use the callbacks that ::open gave us so that the backend in
// multi-process chromium knows which database connection is closing.
- if (!m_databaseCallbacks)
+ if (!m_databaseCallbacks) {
+ m_closePending = true;
return;
+ }
m_databaseBackend->close(m_databaseCallbacks);
m_databaseCallbacks = 0;
}
@@ -105,6 +108,8 @@ void WebIDBDatabaseImpl::open(WebIDBDatabaseCallbacks* callbacks)
ASSERT(!m_databaseCallbacks);
m_databaseCallbacks = IDBDatabaseCallbacksProxy::create(adoptPtr(callbacks));
m_databaseBackend->registerFrontendCallbacks(m_databaseCallbacks);
+ if (m_closePending)
+ close();
}
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h
index 4f8251820..1409cb65f 100644
--- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h
@@ -64,6 +64,9 @@ public:
private:
WTF::RefPtr<WebCore::IDBDatabaseBackendInterface> m_databaseBackend;
WTF::RefPtr<IDBDatabaseCallbacksProxy> m_databaseCallbacks;
+ // FIXME: Remove this flag when we consolidate two-phase open.
+ // http://wkb.ug/90411
+ bool m_closePending;
};
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp b/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp
index d14ac71e1..ad71476b7 100755
--- a/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp
@@ -63,17 +63,9 @@ void WebIDBFactoryImpl::getDatabaseNames(WebIDBCallbacks* callbacks, const WebSe
m_idbFactoryBackend->getDatabaseNames(IDBCallbacksProxy::create(adoptPtr(callbacks)), origin, 0, dataDir);
}
-
-void WebIDBFactoryImpl::open(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir)
-{
- m_idbFactoryBackend->open(name, IDBCallbacksProxy::create(adoptPtr(callbacks)).get(), origin, 0, dataDir);
-}
-
void WebIDBFactoryImpl::open(const WebString& name, long long version, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir)
{
- // FIXME: Pass version along when WebCore::IDBFactoryBackendInterface
- // has an open method that accepts it.
- m_idbFactoryBackend->open(name, IDBCallbacksProxy::create(adoptPtr(callbacks)).get(), origin, 0, dataDir);
+ m_idbFactoryBackend->open(name, version, IDBCallbacksProxy::create(adoptPtr(callbacks)).get(), origin, 0, dataDir);
}
void WebIDBFactoryImpl::deleteDatabase(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir)
diff --git a/Source/WebKit/chromium/src/WebIDBFactoryImpl.h b/Source/WebKit/chromium/src/WebIDBFactoryImpl.h
index fa438d764..833eeb591 100644
--- a/Source/WebKit/chromium/src/WebIDBFactoryImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBFactoryImpl.h
@@ -45,7 +45,6 @@ public:
virtual ~WebIDBFactoryImpl();
virtual void getDatabaseNames(WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir);
- virtual void open(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir);
virtual void open(const WebString& name, long long version, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir);
virtual void deleteDatabase(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir);
diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
index c327eba84..f5dd913c9 100755
--- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
@@ -75,6 +75,30 @@ void WebIDBObjectStoreImpl::putWithIndexKeys(const WebSerializedScriptValue& val
m_objectStore->putWithIndexKeys(value, key, static_cast<IDBObjectStoreBackendInterface::PutMode>(putMode), IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), indexNames, indexKeys, ec);
}
+void WebIDBObjectStoreImpl::setIndexKeys(const WebIDBKey& primaryKey, const WebVector<WebString>& webIndexNames, const WebVector<WebIndexKeys>& webIndexKeys, const WebIDBTransaction& transaction)
+{
+ ASSERT(webIndexNames.size() == webIndexKeys.size());
+ Vector<String> indexNames(webIndexNames.size());
+ Vector<IDBObjectStoreBackendInterface::IndexKeys> indexKeys(webIndexKeys.size());
+
+ for (size_t i = 0; i < webIndexNames.size(); ++i) {
+ indexNames[i] = webIndexNames[i];
+ Vector<RefPtr<IDBKey> > indexKeyList(webIndexKeys[i].size());
+ for (size_t j = 0; j < webIndexKeys[i].size(); ++j)
+ indexKeyList[j] = webIndexKeys[i][j];
+ indexKeys[i] = indexKeyList;
+ }
+ m_objectStore->setIndexKeys(primaryKey, indexNames, indexKeys, transaction.getIDBTransactionBackendInterface());
+}
+
+void WebIDBObjectStoreImpl::setIndexesReady(const WebVector<WebString>& webIndexNames, const WebIDBTransaction& transaction)
+{
+ Vector<String> indexNames(webIndexNames.size());
+ for (size_t i = 0; i < webIndexNames.size(); ++i)
+ indexNames[i] = webIndexNames[i];
+ m_objectStore->setIndexesReady(indexNames, transaction.getIDBTransactionBackendInterface());
+}
+
void WebIDBObjectStoreImpl::deleteFunction(const WebIDBKeyRange& keyRange, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec)
{
m_objectStore->deleteFunction(keyRange, IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), ec);
@@ -106,10 +130,9 @@ void WebIDBObjectStoreImpl::deleteIndex(const WebString& name, const WebIDBTrans
m_objectStore->deleteIndex(name, transaction.getIDBTransactionBackendInterface(), ec);
}
-void WebIDBObjectStoreImpl::openCursor(const WebIDBKeyRange& keyRange, WebIDBCursor::Direction direction, WebIDBCallbacks* callbacks, WebIDBTransaction::TaskType, const WebIDBTransaction& transaction, WebExceptionCode& ec)
+void WebIDBObjectStoreImpl::openCursor(const WebIDBKeyRange& keyRange, WebIDBCursor::Direction direction, WebIDBCallbacks* callbacks, WebIDBTransaction::TaskType taskType, const WebIDBTransaction& transaction, WebExceptionCode& ec)
{
- // FIXME: Pass along TaskType when the API becomes available.
- m_objectStore->openCursor(keyRange, direction, IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), ec);
+ m_objectStore->openCursor(keyRange, static_cast<IDBCursor::Direction>(direction), IDBCallbacksProxy::create(adoptPtr(callbacks)), static_cast<IDBTransactionBackendInterface::TaskType>(taskType), transaction.getIDBTransactionBackendInterface(), ec);
}
void WebIDBObjectStoreImpl::count(const WebIDBKeyRange& keyRange, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec)
diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
index 482b22380..95879b5d0 100644
--- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
@@ -46,7 +46,9 @@ public:
~WebIDBObjectStoreImpl();
void get(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
- void putWithIndexKeys(const WebSerializedScriptValue&, const WebIDBKey&, PutMode, WebIDBCallbacks*, const WebIDBTransaction&, const WebVector<WebString>& indexNames, const WebVector<WebIndexKeys>&, WebExceptionCode&);
+ void putWithIndexKeys(const WebSerializedScriptValue&, const WebIDBKey&, PutMode, WebIDBCallbacks*, const WebIDBTransaction&, const WebVector<WebString>&, const WebVector<WebIndexKeys>&, WebExceptionCode&);
+ void setIndexKeys(const WebIDBKey&, const WebVector<WebString>& indexNames, const WebVector<WebIndexKeys>&, const WebIDBTransaction&);
+ void setIndexesReady(const WebVector<WebString>&, const WebIDBTransaction&);
void deleteFunction(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
void clear(WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
diff --git a/Source/WebKit/chromium/src/WebIOSurfaceLayer.cpp b/Source/WebKit/chromium/src/WebIOSurfaceLayerImpl.cpp
index 77db0c877..bab70c61d 100644
--- a/Source/WebKit/chromium/src/WebIOSurfaceLayer.cpp
+++ b/Source/WebKit/chromium/src/WebIOSurfaceLayerImpl.cpp
@@ -24,30 +24,39 @@
*/
#include "config.h"
-#include <public/WebIOSurfaceLayer.h>
+#include "WebIOSurfaceLayerImpl.h"
#include "IOSurfaceLayerChromium.h"
-#include <public/WebSize.h>
+#include "WebLayerImpl.h"
-using namespace WebCore;
+using WebCore::IOSurfaceLayerChromium;
namespace WebKit {
-WebIOSurfaceLayer WebIOSurfaceLayer::create()
+WebIOSurfaceLayer* WebIOSurfaceLayer::create()
{
RefPtr<IOSurfaceLayerChromium> layer = IOSurfaceLayerChromium::create();
layer->setIsDrawable(true);
- return WebIOSurfaceLayer(layer.release());
+ return new WebIOSurfaceLayerImpl(layer.release());
}
-void WebIOSurfaceLayer::setIOSurfaceProperties(unsigned ioSurfaceId, WebSize size)
+WebIOSurfaceLayerImpl::WebIOSurfaceLayerImpl(PassRefPtr<IOSurfaceLayerChromium> layer)
+ : m_layer(adoptPtr(new WebLayerImpl(layer)))
{
- unwrap<IOSurfaceLayerChromium>()->setIOSurfaceProperties(ioSurfaceId, size);
}
-WebIOSurfaceLayer::WebIOSurfaceLayer(PassRefPtr<IOSurfaceLayerChromium> layer)
- : WebLayer(layer)
+WebIOSurfaceLayerImpl::~WebIOSurfaceLayerImpl()
{
}
+void WebIOSurfaceLayerImpl::setIOSurfaceProperties(unsigned ioSurfaceId, WebSize size)
+{
+ static_cast<IOSurfaceLayerChromium*>(m_layer->layer())->setIOSurfaceProperties(ioSurfaceId, size);
+}
+
+WebLayer* WebIOSurfaceLayerImpl::layer()
+{
+ return m_layer.get();
+}
+
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebIOSurfaceLayerImpl.h b/Source/WebKit/chromium/src/WebIOSurfaceLayerImpl.h
new file mode 100644
index 000000000..3dbb02759
--- /dev/null
+++ b/Source/WebKit/chromium/src/WebIOSurfaceLayerImpl.h
@@ -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.
+ */
+
+#ifndef WebIOSurfaceLayerImpl_h
+#define WebIOSurfaceLayerImpl_h
+
+#include <public/WebIOSurfaceLayer.h>
+#include <wtf/OwnPtr.h>
+
+namespace WebCore {
+class IOSurfaceLayerChromium;
+}
+
+namespace WebKit {
+
+class WebIOSurfaceLayerImpl : public WebIOSurfaceLayer {
+public:
+ explicit WebIOSurfaceLayerImpl(PassRefPtr<WebCore::IOSurfaceLayerChromium>);
+ virtual ~WebIOSurfaceLayerImpl();
+
+ // WebIOSurfaceLayer implementation.
+ virtual WebLayer* layer() OVERRIDE;
+ virtual void setIOSurfaceProperties(unsigned ioSurfaceId, WebSize) OVERRIDE;
+
+private:
+ OwnPtr<WebLayerImpl> m_layer;
+};
+
+}
+
+#endif // WebIOSurfaceLayerImpl_h
+
diff --git a/Source/WebKit/chromium/src/WebImageLayerImpl.cpp b/Source/WebKit/chromium/src/WebImageLayerImpl.cpp
new file mode 100644
index 000000000..d93af8045
--- /dev/null
+++ b/Source/WebKit/chromium/src/WebImageLayerImpl.cpp
@@ -0,0 +1,60 @@
+/*
+ * 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 "WebImageLayerImpl.h"
+
+#include "ImageLayerChromium.h"
+#include "WebLayerImpl.h"
+
+using WebCore::ImageLayerChromium;
+
+namespace WebKit {
+
+WebImageLayer* WebImageLayer::create()
+{
+ return new WebImageLayerImpl(WebCore::ImageLayerChromium::create());
+}
+
+WebImageLayerImpl::WebImageLayerImpl(PassRefPtr<WebCore::ImageLayerChromium> layer)
+ : m_layer(adoptPtr(new WebLayerImpl(layer)))
+{
+}
+
+WebImageLayerImpl::~WebImageLayerImpl()
+{
+}
+
+WebLayer* WebImageLayerImpl::layer()
+{
+ return m_layer.get();
+}
+
+void WebImageLayerImpl::setBitmap(SkBitmap bitmap)
+{
+ static_cast<ImageLayerChromium*>(m_layer->layer())->setBitmap(bitmap);
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebImageLayerImpl.h b/Source/WebKit/chromium/src/WebImageLayerImpl.h
new file mode 100644
index 000000000..9a4b8b3eb
--- /dev/null
+++ b/Source/WebKit/chromium/src/WebImageLayerImpl.h
@@ -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.
+ */
+
+#ifndef WebImageLayerImpl_h
+#define WebImageLayerImpl_h
+
+#include <public/WebImageLayer.h>
+#include <wtf/OwnPtr.h>
+
+namespace WebCore {
+class ImageLayerChromium;
+}
+
+namespace WebKit {
+class WebLayerImpl;
+
+class WebImageLayerImpl : public WebImageLayer {
+public:
+ explicit WebImageLayerImpl(PassRefPtr<WebCore::ImageLayerChromium>);
+ virtual ~WebImageLayerImpl();
+
+ // WebImageLayer implementation.
+ WebLayer* layer() OVERRIDE;
+ virtual void setBitmap(SkBitmap) OVERRIDE;
+
+private:
+ OwnPtr<WebLayerImpl> m_layer;
+};
+
+}
+
+#endif // WebImageLayerImpl_h
diff --git a/Source/WebKit/chromium/src/WebInputEvent.cpp b/Source/WebKit/chromium/src/WebInputEvent.cpp
index 66a0480b4..d61eb2d31 100644
--- a/Source/WebKit/chromium/src/WebInputEvent.cpp
+++ b/Source/WebKit/chromium/src/WebInputEvent.cpp
@@ -60,7 +60,7 @@ struct SameSizeAsWebMouseWheelEvent : public SameSizeAsWebMouseEvent {
};
struct SameSizeAsWebGestureEvent : public SameSizeAsWebInputEvent {
- int gestureData[10];
+ int gestureData[14];
};
struct SameSizeAsWebTouchEvent : public SameSizeAsWebInputEvent {
diff --git a/Source/WebKit/chromium/src/WebLayer.cpp b/Source/WebKit/chromium/src/WebLayer.cpp
deleted file mode 100644
index d77c25eb9..000000000
--- a/Source/WebKit/chromium/src/WebLayer.cpp
+++ /dev/null
@@ -1,403 +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 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/WebLayer.h>
-
-#include "LayerChromium.h"
-#include "SkMatrix44.h"
-#include "WebLayerImpl.h"
-#include <public/WebFilterOperations.h>
-#include <public/WebFloatPoint.h>
-#include <public/WebFloatRect.h>
-#include <public/WebSize.h>
-#include <public/WebTransformationMatrix.h>
-
-using namespace WebCore;
-using WebKit::WebTransformationMatrix;
-
-namespace {
-
-WebTransformationMatrix transformationMatrixFromSkMatrix44(const SkMatrix44& matrix)
-{
- double data[16];
- matrix.asColMajord(data);
- return WebTransformationMatrix(data[0], data[1], data[2], data[3],
- data[4], data[5], data[6], data[7],
- data[8], data[9], data[10], data[11],
- data[12], data[13], data[14], data[15]);
-}
-
-SkMatrix44 skMatrix44FromTransformationMatrix(const WebTransformationMatrix& matrix)
-{
- SkMatrix44 skMatrix;
- skMatrix.set(0, 0, SkDoubleToMScalar(matrix.m11()));
- skMatrix.set(1, 0, SkDoubleToMScalar(matrix.m12()));
- skMatrix.set(2, 0, SkDoubleToMScalar(matrix.m13()));
- skMatrix.set(3, 0, SkDoubleToMScalar(matrix.m14()));
- skMatrix.set(0, 1, SkDoubleToMScalar(matrix.m21()));
- skMatrix.set(1, 1, SkDoubleToMScalar(matrix.m22()));
- skMatrix.set(2, 1, SkDoubleToMScalar(matrix.m23()));
- skMatrix.set(3, 1, SkDoubleToMScalar(matrix.m24()));
- skMatrix.set(0, 2, SkDoubleToMScalar(matrix.m31()));
- skMatrix.set(1, 2, SkDoubleToMScalar(matrix.m32()));
- skMatrix.set(2, 2, SkDoubleToMScalar(matrix.m33()));
- skMatrix.set(3, 2, SkDoubleToMScalar(matrix.m34()));
- skMatrix.set(0, 3, SkDoubleToMScalar(matrix.m41()));
- skMatrix.set(1, 3, SkDoubleToMScalar(matrix.m42()));
- skMatrix.set(2, 3, SkDoubleToMScalar(matrix.m43()));
- skMatrix.set(3, 3, SkDoubleToMScalar(matrix.m44()));
- return skMatrix;
-}
-
-} // anonymous namespace
-
-namespace WebKit {
-
-WebLayer WebLayer::create()
-{
- return WebLayer(WebLayerImpl::create());
-}
-
-void WebLayer::reset()
-{
- m_private.reset();
-}
-
-void WebLayer::assign(const WebLayer& other)
-{
- m_private = other.m_private;
-}
-
-bool WebLayer::equals(const WebLayer& n) const
-{
- return (m_private.get() == n.m_private.get());
-}
-
-void WebLayer::invalidateRect(const WebFloatRect& dirtyRect)
-{
- m_private->setNeedsDisplayRect(dirtyRect);
-}
-
-void WebLayer::invalidate()
-{
- m_private->setNeedsDisplay();
-}
-
-WebLayer WebLayer::rootLayer() const
-{
- return WebLayer(const_cast<LayerChromium*>(m_private->rootLayer()));
-}
-
-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);
-}
-
-void WebLayer::insertChild(const WebLayer& child, size_t index)
-{
- m_private->insertChild(child, index);
-}
-
-void WebLayer::replaceChild(const WebLayer& reference, const WebLayer& newLayer)
-{
- WebLayer ref = reference;
- m_private->replaceChild(ref.unwrap<LayerChromium>(), newLayer);
-}
-
-void WebLayer::setChildren(const WebVector<WebLayer>& webChildren)
-{
- Vector<RefPtr<LayerChromium> > children(webChildren.size());
- for (size_t i = 0; i < webChildren.size(); ++i)
- children[i] = webChildren[i].unwrap<LayerChromium>();
- m_private->setChildren(children);
-}
-
-void WebLayer::removeFromParent()
-{
- m_private->removeFromParent();
-}
-
-void WebLayer::removeAllChildren()
-{
- m_private->removeAllChildren();
-}
-
-void WebLayer::setAnchorPoint(const WebFloatPoint& anchorPoint)
-{
- m_private->setAnchorPoint(anchorPoint);
-}
-
-WebFloatPoint WebLayer::anchorPoint() const
-{
- return WebFloatPoint(m_private->anchorPoint());
-}
-
-void WebLayer::setAnchorPointZ(float anchorPointZ)
-{
- m_private->setAnchorPointZ(anchorPointZ);
-}
-
-float WebLayer::anchorPointZ() const
-{
- return m_private->anchorPointZ();
-}
-
-void WebLayer::setBounds(const WebSize& size)
-{
- m_private->setBounds(size);
-}
-
-WebSize WebLayer::bounds() const
-{
- return WebSize(m_private->bounds());
-}
-
-void WebLayer::setMasksToBounds(bool masksToBounds)
-{
- m_private->setMasksToBounds(masksToBounds);
-}
-
-bool WebLayer::masksToBounds() const
-{
- return m_private->masksToBounds();
-}
-
-void WebLayer::setMaskLayer(const WebLayer& maskLayer)
-{
- WebLayer ref = maskLayer;
- m_private->setMaskLayer(ref.unwrap<LayerChromium>());
-}
-
-WebLayer WebLayer::maskLayer() const
-{
- return WebLayer(m_private->maskLayer());
-}
-
-void WebLayer::setReplicaLayer(const WebLayer& replicaLayer)
-{
- WebLayer ref = replicaLayer;
- m_private->setReplicaLayer(ref.unwrap<LayerChromium>());
-}
-
-void WebLayer::setOpacity(float opacity)
-{
- m_private->setOpacity(opacity);
-}
-
-float WebLayer::opacity() const
-{
- return m_private->opacity();
-}
-
-void WebLayer::setOpaque(bool opaque)
-{
- m_private->setOpaque(opaque);
-}
-
-bool WebLayer::opaque() const
-{
- return m_private->opaque();
-}
-
-void WebLayer::setPosition(const WebFloatPoint& position)
-{
- m_private->setPosition(position);
-}
-
-WebFloatPoint WebLayer::position() const
-{
- return WebFloatPoint(m_private->position());
-}
-
-void WebLayer::setSublayerTransform(const SkMatrix44& matrix)
-{
- m_private->setSublayerTransform(transformationMatrixFromSkMatrix44(matrix));
-}
-
-void WebLayer::setSublayerTransform(const WebTransformationMatrix& matrix)
-{
- m_private->setSublayerTransform(matrix);
-}
-
-SkMatrix44 WebLayer::sublayerTransform() const
-{
- return skMatrix44FromTransformationMatrix(m_private->sublayerTransform());
-}
-
-void WebLayer::setTransform(const SkMatrix44& matrix)
-{
- m_private->setTransform(transformationMatrixFromSkMatrix44(matrix));
-}
-
-void WebLayer::setTransform(const WebTransformationMatrix& matrix)
-{
- m_private->setTransform(matrix);
-}
-
-SkMatrix44 WebLayer::transform() const
-{
- return skMatrix44FromTransformationMatrix(m_private->transform());
-}
-
-void WebLayer::setDrawsContent(bool drawsContent)
-{
- m_private->setIsDrawable(drawsContent);
-}
-
-bool WebLayer::drawsContent() const
-{
- return m_private->drawsContent();
-}
-
-void WebLayer::setPreserves3D(bool preserve3D)
-{
- m_private->setPreserves3D(preserve3D);
-}
-
-void WebLayer::setUseParentBackfaceVisibility(bool useParentBackfaceVisibility)
-{
- m_private->setUseParentBackfaceVisibility(useParentBackfaceVisibility);
-}
-
-void WebLayer::setBackgroundColor(WebColor color)
-{
- m_private->setBackgroundColor(color);
-}
-
-void WebLayer::setFilters(const WebFilterOperations& filters)
-{
- m_private->setFilters(filters);
-}
-
-void WebLayer::setBackgroundFilters(const WebFilterOperations& filters)
-{
- m_private->setBackgroundFilters(filters);
-}
-
-void WebLayer::setDebugBorderColor(const WebColor& color)
-{
- m_private->setDebugBorderColor(color);
-}
-
-void WebLayer::setDebugBorderWidth(float width)
-{
- m_private->setDebugBorderWidth(width);
-}
-
-void WebLayer::setDebugName(WebString name)
-{
- m_private->setDebugName(name);
-}
-
-void WebLayer::setAnimationDelegate(WebAnimationDelegate* delegate)
-{
- m_private->setLayerAnimationDelegate(delegate);
-}
-
-bool WebLayer::addAnimation(const WebAnimation& animation)
-{
- return m_private->addAnimation(animation);
-}
-
-void WebLayer::removeAnimation(int animationId)
-{
- m_private->removeAnimation(animationId);
-}
-
-void WebLayer::removeAnimation(int animationId, WebAnimation::TargetProperty targetProperty)
-{
- m_private->layerAnimationController()->removeAnimation(animationId, static_cast<CCActiveAnimation::TargetProperty>(targetProperty));
-}
-
-void WebLayer::pauseAnimation(int animationId, double timeOffset)
-{
- m_private->pauseAnimation(animationId, timeOffset);
-}
-
-void WebLayer::suspendAnimations(double monotonicTime)
-{
- m_private->suspendAnimations(monotonicTime);
-}
-
-void WebLayer::resumeAnimations(double monotonicTime)
-{
- m_private->resumeAnimations(monotonicTime);
-}
-
-void WebLayer::transferAnimationsTo(WebLayer* other)
-{
- ASSERT(other);
- if (other)
- other->m_private->setLayerAnimationController(m_private->releaseLayerAnimationController());
-}
-
-void WebLayer::setAlwaysReserveTextures(bool reserve)
-{
- m_private->setAlwaysReserveTextures(reserve);
-}
-
-void WebLayer::setForceRenderSurface(bool forceRenderSurface)
-{
- m_private->setForceRenderSurface(forceRenderSurface);
-}
-
-void WebLayer::clearRenderSurface()
-{
- m_private->clearRenderSurface();
-}
-
-WebLayer::WebLayer(const PassRefPtr<LayerChromium>& node)
- : m_private(node)
-{
-}
-
-WebLayer& WebLayer::operator=(const PassRefPtr<LayerChromium>& node)
-{
- m_private = node;
- return *this;
-}
-
-WebLayer::operator PassRefPtr<LayerChromium>() const
-{
- return m_private.get();
-}
-
-} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebLayerImpl.cpp b/Source/WebKit/chromium/src/WebLayerImpl.cpp
index 16e1206ca..40ced485d 100644
--- a/Source/WebKit/chromium/src/WebLayerImpl.cpp
+++ b/Source/WebKit/chromium/src/WebLayerImpl.cpp
@@ -26,25 +26,376 @@
#include "config.h"
#include "WebLayerImpl.h"
-using namespace WebCore;
+#include "CCActiveAnimation.h"
+#include "LayerChromium.h"
+#include "SkMatrix44.h"
+#include "WebAnimationImpl.h"
+#include <public/WebFloatPoint.h>
+#include <public/WebFloatRect.h>
+#include <public/WebSize.h>
+#include <public/WebTransformationMatrix.h>
+
+using WebCore::CCActiveAnimation;
+using WebCore::LayerChromium;
namespace WebKit {
-PassRefPtr<WebLayerImpl> WebLayerImpl::create()
+namespace {
+
+WebTransformationMatrix transformationMatrixFromSkMatrix44(const SkMatrix44& matrix)
+{
+ double data[16];
+ matrix.asColMajord(data);
+ return WebTransformationMatrix(data[0], data[1], data[2], data[3],
+ data[4], data[5], data[6], data[7],
+ data[8], data[9], data[10], data[11],
+ data[12], data[13], data[14], data[15]);
+}
+
+SkMatrix44 skMatrix44FromTransformationMatrix(const WebTransformationMatrix& matrix)
+{
+ SkMatrix44 skMatrix;
+ skMatrix.set(0, 0, SkDoubleToMScalar(matrix.m11()));
+ skMatrix.set(1, 0, SkDoubleToMScalar(matrix.m12()));
+ skMatrix.set(2, 0, SkDoubleToMScalar(matrix.m13()));
+ skMatrix.set(3, 0, SkDoubleToMScalar(matrix.m14()));
+ skMatrix.set(0, 1, SkDoubleToMScalar(matrix.m21()));
+ skMatrix.set(1, 1, SkDoubleToMScalar(matrix.m22()));
+ skMatrix.set(2, 1, SkDoubleToMScalar(matrix.m23()));
+ skMatrix.set(3, 1, SkDoubleToMScalar(matrix.m24()));
+ skMatrix.set(0, 2, SkDoubleToMScalar(matrix.m31()));
+ skMatrix.set(1, 2, SkDoubleToMScalar(matrix.m32()));
+ skMatrix.set(2, 2, SkDoubleToMScalar(matrix.m33()));
+ skMatrix.set(3, 2, SkDoubleToMScalar(matrix.m34()));
+ skMatrix.set(0, 3, SkDoubleToMScalar(matrix.m41()));
+ skMatrix.set(1, 3, SkDoubleToMScalar(matrix.m42()));
+ skMatrix.set(2, 3, SkDoubleToMScalar(matrix.m43()));
+ skMatrix.set(3, 3, SkDoubleToMScalar(matrix.m44()));
+ return skMatrix;
+}
+
+} // anonymous namespace
+
+
+WebLayer* WebLayer::create()
{
- return adoptRef(new WebLayerImpl());
+ return new WebLayerImpl(LayerChromium::create());
}
-WebLayerImpl::WebLayerImpl()
- : LayerChromium()
+WebLayerImpl::WebLayerImpl(PassRefPtr<LayerChromium> layer)
+ : m_layer(layer)
{
- // Make sure that this layer does not draw content. This way we don't have to override
- // the base class implementation of drawsContent().
- ASSERT(!drawsContent());
}
WebLayerImpl::~WebLayerImpl()
{
+ m_layer->clearRenderSurface();
+ m_layer->setLayerAnimationDelegate(0);
+}
+
+int WebLayerImpl::id() const
+{
+ return m_layer->id();
+}
+
+void WebLayerImpl::invalidateRect(const WebFloatRect& rect)
+{
+ m_layer->setNeedsDisplayRect(rect);
+}
+
+void WebLayerImpl::invalidate()
+{
+ m_layer->setNeedsDisplay();
+}
+
+void WebLayerImpl::addChild(WebLayer* child)
+{
+ m_layer->addChild(static_cast<WebLayerImpl*>(child)->layer());
+}
+
+void WebLayerImpl::insertChild(WebLayer* child, size_t index)
+{
+ m_layer->insertChild(static_cast<WebLayerImpl*>(child)->layer(), index);
+}
+
+void WebLayerImpl::replaceChild(WebLayer* reference, WebLayer* newLayer)
+{
+ m_layer->replaceChild(static_cast<WebLayerImpl*>(reference)->layer(), static_cast<WebLayerImpl*>(newLayer)->layer());
+}
+
+void WebLayerImpl::setChildren(const WebVector<WebLayer*>& webChildren)
+{
+ Vector<RefPtr<LayerChromium> > children(webChildren.size());
+ for (size_t i = 0; i < webChildren.size(); ++i)
+ children[i] = static_cast<WebLayerImpl*>(webChildren[i])->layer();
+ m_layer->setChildren(children);
+}
+
+void WebLayerImpl::removeFromParent()
+{
+ m_layer->removeFromParent();
+}
+
+void WebLayerImpl::removeAllChildren()
+{
+ m_layer->removeAllChildren();
+}
+
+void WebLayerImpl::setAnchorPoint(const WebFloatPoint& anchorPoint)
+{
+ m_layer->setAnchorPoint(anchorPoint);
+}
+
+WebFloatPoint WebLayerImpl::anchorPoint() const
+{
+ return WebFloatPoint(m_layer->anchorPoint());
+}
+
+void WebLayerImpl::setAnchorPointZ(float anchorPointZ)
+{
+ m_layer->setAnchorPointZ(anchorPointZ);
+}
+
+float WebLayerImpl::anchorPointZ() const
+{
+ return m_layer->anchorPointZ();
+}
+
+void WebLayerImpl::setBounds(const WebSize& size)
+{
+ m_layer->setBounds(size);
+}
+
+WebSize WebLayerImpl::bounds() const
+{
+ return WebSize(m_layer->bounds());
+}
+
+void WebLayerImpl::setMasksToBounds(bool masksToBounds)
+{
+ m_layer->setMasksToBounds(masksToBounds);
+}
+
+bool WebLayerImpl::masksToBounds() const
+{
+ return m_layer->masksToBounds();
+}
+
+void WebLayerImpl::setMaskLayer(WebLayer* maskLayer)
+{
+ m_layer->setMaskLayer(maskLayer ? static_cast<WebLayerImpl*>(maskLayer)->layer() : 0);
+}
+
+void WebLayerImpl::setReplicaLayer(WebLayer* replicaLayer)
+{
+ m_layer->setReplicaLayer(replicaLayer ? static_cast<WebLayerImpl*>(replicaLayer)->layer() : 0);
+}
+
+void WebLayerImpl::setOpacity(float opacity)
+{
+ m_layer->setOpacity(opacity);
+}
+
+float WebLayerImpl::opacity() const
+{
+ return m_layer->opacity();
+}
+
+void WebLayerImpl::setOpaque(bool opaque)
+{
+ m_layer->setOpaque(opaque);
+}
+
+bool WebLayerImpl::opaque() const
+{
+ return m_layer->opaque();
+}
+
+void WebLayerImpl::setPosition(const WebFloatPoint& position)
+{
+ m_layer->setPosition(position);
+}
+
+WebFloatPoint WebLayerImpl::position() const
+{
+ return WebFloatPoint(m_layer->position());
+}
+
+void WebLayerImpl::setSublayerTransform(const SkMatrix44& matrix)
+{
+ m_layer->setSublayerTransform(transformationMatrixFromSkMatrix44(matrix));
+}
+
+void WebLayerImpl::setSublayerTransform(const WebTransformationMatrix& matrix)
+{
+ m_layer->setSublayerTransform(matrix);
+}
+
+SkMatrix44 WebLayerImpl::sublayerTransform() const
+{
+ return skMatrix44FromTransformationMatrix(m_layer->sublayerTransform());
+}
+
+void WebLayerImpl::setTransform(const SkMatrix44& matrix)
+{
+ m_layer->setTransform(transformationMatrixFromSkMatrix44(matrix));
+}
+
+void WebLayerImpl::setTransform(const WebTransformationMatrix& matrix)
+{
+ m_layer->setTransform(matrix);
+}
+
+SkMatrix44 WebLayerImpl::transform() const
+{
+ return skMatrix44FromTransformationMatrix(m_layer->transform());
+}
+
+void WebLayerImpl::setDrawsContent(bool drawsContent)
+{
+ m_layer->setIsDrawable(drawsContent);
+}
+
+bool WebLayerImpl::drawsContent() const
+{
+ return m_layer->drawsContent();
+}
+
+void WebLayerImpl::setPreserves3D(bool preserve3D)
+{
+ m_layer->setPreserves3D(preserve3D);
+}
+
+void WebLayerImpl::setUseParentBackfaceVisibility(bool useParentBackfaceVisibility)
+{
+ m_layer->setUseParentBackfaceVisibility(useParentBackfaceVisibility);
+}
+
+void WebLayerImpl::setBackgroundColor(WebColor color)
+{
+ m_layer->setBackgroundColor(color);
+}
+
+void WebLayerImpl::setFilters(const WebFilterOperations& filters)
+{
+ m_layer->setFilters(filters);
+}
+
+void WebLayerImpl::setBackgroundFilters(const WebFilterOperations& filters)
+{
+ m_layer->setBackgroundFilters(filters);
+}
+
+void WebLayerImpl::setDebugBorderColor(const WebColor& color)
+{
+ m_layer->setDebugBorderColor(color);
+}
+
+void WebLayerImpl::setDebugBorderWidth(float width)
+{
+ m_layer->setDebugBorderWidth(width);
+}
+
+void WebLayerImpl::setDebugName(WebString name)
+{
+ m_layer->setDebugName(name);
+}
+
+void WebLayerImpl::setAnimationDelegate(WebAnimationDelegate* delegate)
+{
+ m_layer->setLayerAnimationDelegate(delegate);
+}
+
+bool WebLayerImpl::addAnimation(WebAnimation* animation)
+{
+ return m_layer->addAnimation(static_cast<WebAnimationImpl*>(animation)->cloneToCCAnimation());
+}
+
+void WebLayerImpl::removeAnimation(int animationId)
+{
+ m_layer->removeAnimation(animationId);
+}
+
+void WebLayerImpl::removeAnimation(int animationId, WebAnimation::TargetProperty targetProperty)
+{
+ m_layer->layerAnimationController()->removeAnimation(animationId, static_cast<CCActiveAnimation::TargetProperty>(targetProperty));
+}
+
+void WebLayerImpl::pauseAnimation(int animationId, double timeOffset)
+{
+ m_layer->pauseAnimation(animationId, timeOffset);
+}
+
+void WebLayerImpl::suspendAnimations(double monotonicTime)
+{
+ m_layer->suspendAnimations(monotonicTime);
+}
+
+void WebLayerImpl::resumeAnimations(double monotonicTime)
+{
+ m_layer->resumeAnimations(monotonicTime);
+}
+
+bool WebLayerImpl::hasActiveAnimation()
+{
+ return m_layer->hasActiveAnimation();
+}
+
+void WebLayerImpl::transferAnimationsTo(WebLayer* other)
+{
+ ASSERT(other);
+ static_cast<WebLayerImpl*>(other)->m_layer->setLayerAnimationController(m_layer->releaseLayerAnimationController());
+}
+
+void WebLayerImpl::setForceRenderSurface(bool forceRenderSurface)
+{
+ m_layer->setForceRenderSurface(forceRenderSurface);
+}
+
+void WebLayerImpl::setScrollPosition(WebPoint position)
+{
+ m_layer->setScrollPosition(position);
+}
+
+void WebLayerImpl::setScrollable(bool scrollable)
+{
+ m_layer->setScrollable(scrollable);
+}
+
+void WebLayerImpl::setHaveWheelEventHandlers(bool haveWheelEventHandlers)
+{
+ m_layer->setHaveWheelEventHandlers(haveWheelEventHandlers);
+}
+
+void WebLayerImpl::setShouldScrollOnMainThread(bool shouldScrollOnMainThread)
+{
+ m_layer->setShouldScrollOnMainThread(shouldScrollOnMainThread);
+}
+
+void WebLayerImpl::setNonFastScrollableRegion(const WebVector<WebRect>& rects)
+{
+ WebCore::Region region;
+ for (size_t i = 0; i < rects.size(); ++i) {
+ WebCore::IntRect rect = rects[i];
+ region.unite(rect);
+ }
+ m_layer->setNonFastScrollableRegion(region);
+
+}
+
+void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable)
+{
+ m_layer->setIsContainerForFixedPositionLayers(enable);
+}
+
+void WebLayerImpl::setFixedToContainerLayer(bool enable)
+{
+ m_layer->setFixedToContainerLayer(enable);
+}
+
+LayerChromium* WebLayerImpl::layer() const
+{
+ return m_layer.get();
}
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebLayerImpl.h b/Source/WebKit/chromium/src/WebLayerImpl.h
index 7e4e75062..7e3b533bc 100644
--- a/Source/WebKit/chromium/src/WebLayerImpl.h
+++ b/Source/WebKit/chromium/src/WebLayerImpl.h
@@ -26,18 +26,84 @@
#ifndef WebLayerImpl_h
#define WebLayerImpl_h
-#include "LayerChromium.h"
-#include <wtf/PassRefPtr.h>
+#include <public/WebLayer.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+class LayerChromium;
+}
namespace WebKit {
-class WebLayerImpl : public WebCore::LayerChromium {
+class WebLayerImpl : public WebLayer {
public:
- static PassRefPtr<WebLayerImpl> create();
+ explicit WebLayerImpl(PassRefPtr<WebCore::LayerChromium>);
+ virtual ~WebLayerImpl();
+
+ // WebLayer implementation.
+ virtual int id() const OVERRIDE;
+ virtual void invalidateRect(const WebFloatRect&) OVERRIDE;
+ virtual void invalidate() OVERRIDE;
+ virtual void addChild(WebLayer*) OVERRIDE;
+ virtual void insertChild(WebLayer*, size_t index) OVERRIDE;
+ virtual void replaceChild(WebLayer* reference, WebLayer* newLayer) OVERRIDE;
+ virtual void setChildren(const WebVector<WebLayer*>&) OVERRIDE;
+ virtual void removeFromParent() OVERRIDE;
+ virtual void removeAllChildren() OVERRIDE;
+ virtual void setAnchorPoint(const WebFloatPoint&) OVERRIDE;
+ virtual WebFloatPoint anchorPoint() const OVERRIDE;
+ virtual void setAnchorPointZ(float) OVERRIDE;
+ virtual float anchorPointZ() const OVERRIDE;
+ virtual void setBounds(const WebSize&) OVERRIDE;
+ virtual WebSize bounds() const OVERRIDE;
+ virtual void setMasksToBounds(bool) OVERRIDE;
+ virtual bool masksToBounds() const OVERRIDE;
+ virtual void setMaskLayer(WebLayer*) OVERRIDE;
+ virtual void setReplicaLayer(WebLayer*) OVERRIDE;
+ virtual void setOpacity(float) OVERRIDE;
+ virtual float opacity() const OVERRIDE;
+ virtual void setOpaque(bool) OVERRIDE;
+ virtual bool opaque() const OVERRIDE;
+ virtual void setPosition(const WebFloatPoint&) OVERRIDE;
+ virtual WebFloatPoint position() const OVERRIDE;
+ virtual void setSublayerTransform(const SkMatrix44&) OVERRIDE;
+ virtual void setSublayerTransform(const WebTransformationMatrix&) OVERRIDE;
+ virtual SkMatrix44 sublayerTransform() const OVERRIDE;
+ virtual void setTransform(const SkMatrix44&) OVERRIDE;
+ virtual void setTransform(const WebTransformationMatrix&) OVERRIDE;
+ virtual SkMatrix44 transform() const OVERRIDE;
+ virtual void setDrawsContent(bool) OVERRIDE;
+ virtual bool drawsContent() const OVERRIDE;
+ virtual void setPreserves3D(bool) OVERRIDE;
+ virtual void setUseParentBackfaceVisibility(bool) OVERRIDE;
+ virtual void setBackgroundColor(WebColor) OVERRIDE;
+ virtual void setFilters(const WebFilterOperations&) OVERRIDE;
+ virtual void setBackgroundFilters(const WebFilterOperations&) OVERRIDE;
+ virtual void setDebugBorderColor(const WebColor&) OVERRIDE;
+ virtual void setDebugBorderWidth(float) OVERRIDE;
+ virtual void setDebugName(WebString) OVERRIDE;
+ virtual void setAnimationDelegate(WebAnimationDelegate*) OVERRIDE;
+ virtual bool addAnimation(WebAnimation*) OVERRIDE;
+ virtual void removeAnimation(int animationId) OVERRIDE;
+ virtual void removeAnimation(int animationId, WebAnimation::TargetProperty) OVERRIDE;
+ virtual void pauseAnimation(int animationId, double timeOffset) OVERRIDE;
+ virtual void suspendAnimations(double monotonicTime) OVERRIDE;
+ virtual void resumeAnimations(double monotonicTime) OVERRIDE;
+ virtual bool hasActiveAnimation() OVERRIDE;
+ virtual void transferAnimationsTo(WebLayer*) OVERRIDE;
+ virtual void setForceRenderSurface(bool) OVERRIDE;
+ virtual void setScrollPosition(WebPoint) OVERRIDE;
+ virtual void setScrollable(bool) OVERRIDE;
+ virtual void setHaveWheelEventHandlers(bool) OVERRIDE;
+ virtual void setShouldScrollOnMainThread(bool) OVERRIDE;
+ virtual void setNonFastScrollableRegion(const WebVector<WebRect>&) OVERRIDE;
+ virtual void setIsContainerForFixedPositionLayers(bool) OVERRIDE;
+ virtual void setFixedToContainerLayer(bool) OVERRIDE;
+
+ WebCore::LayerChromium* layer() const;
protected:
- WebLayerImpl();
- virtual ~WebLayerImpl();
+ RefPtr<WebCore::LayerChromium> m_layer;
};
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebLayerTreeView.cpp b/Source/WebKit/chromium/src/WebLayerTreeView.cpp
index edd43df20..7dfbcd129 100644
--- a/Source/WebKit/chromium/src/WebLayerTreeView.cpp
+++ b/Source/WebKit/chromium/src/WebLayerTreeView.cpp
@@ -26,12 +26,13 @@
#include "config.h"
#include <public/WebLayerTreeView.h>
+#include "CCFontAtlas.h"
+#include "CCGraphicsContext.h"
+#include "CCLayerTreeHost.h"
+#include "CCRenderingStats.h"
#include "LayerChromium.h"
+#include "WebLayerImpl.h"
#include "WebLayerTreeViewImpl.h"
-#include "cc/CCFontAtlas.h"
-#include "cc/CCGraphicsContext.h"
-#include "cc/CCLayerTreeHost.h"
-#include "cc/CCRenderingStats.h"
#include <public/WebLayer.h>
#include <public/WebPoint.h>
#include <public/WebRect.h>
@@ -83,7 +84,7 @@ void WebLayerTreeView::setSurfaceReady()
void WebLayerTreeView::setRootLayer(WebLayer *root)
{
if (root)
- m_private->layerTreeHost()->setRootLayer(*root);
+ m_private->layerTreeHost()->setRootLayer(static_cast<WebLayerImpl*>(root)->layer());
else
m_private->layerTreeHost()->setRootLayer(PassRefPtr<LayerChromium>());
}
diff --git a/Source/WebKit/chromium/src/WebLayerTreeViewImpl.cpp b/Source/WebKit/chromium/src/WebLayerTreeViewImpl.cpp
index a7bf64d36..1fd823976 100644
--- a/Source/WebKit/chromium/src/WebLayerTreeViewImpl.cpp
+++ b/Source/WebKit/chromium/src/WebLayerTreeViewImpl.cpp
@@ -26,9 +26,10 @@
#include "config.h"
#include "WebLayerTreeViewImpl.h"
+#include "CCLayerTreeHost.h"
+#include "CCThreadProxy.h"
#include "LayerChromium.h"
-#include "cc/CCLayerTreeHost.h"
-#include "cc/CCThreadProxy.h"
+#include "WebLayerImpl.h"
#include <public/WebGraphicsContext3D.h>
#include <public/WebLayer.h>
#include <public/WebLayerTreeView.h>
@@ -142,7 +143,7 @@ PassOwnPtr<WebLayerTreeViewImpl> WebLayerTreeViewImpl::create(WebLayerTreeViewCl
OwnPtr<WebLayerTreeViewImpl> impl = adoptPtr(new WebLayerTreeViewImpl(client, settings));
if (!impl->layerTreeHost())
return nullptr;
- impl->layerTreeHost()->setRootLayer(root);
+ impl->layerTreeHost()->setRootLayer(static_cast<const WebLayerImpl*>(&root)->layer());
return impl.release();
}
diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
index c48aa8967..cb756233e 100644
--- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
+++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
@@ -109,9 +109,9 @@ void WebMediaPlayerClientImpl::readyStateChanged()
ASSERT(m_mediaPlayer);
m_mediaPlayer->readyStateChanged();
#if USE(ACCELERATED_COMPOSITING)
- if (hasVideo() && supportsAcceleratedRendering() && m_videoLayer.isNull()) {
- m_videoLayer = WebVideoLayer::create(this);
- m_videoLayer.setOpaque(m_opaque);
+ if (hasVideo() && supportsAcceleratedRendering() && !m_videoLayer) {
+ m_videoLayer = adoptPtr(WebVideoLayer::create(this));
+ m_videoLayer->layer()->setOpaque(m_opaque);
}
#endif
}
@@ -138,8 +138,8 @@ void WebMediaPlayerClientImpl::repaint()
{
ASSERT(m_mediaPlayer);
#if USE(ACCELERATED_COMPOSITING)
- if (!m_videoLayer.isNull() && supportsAcceleratedRendering())
- m_videoLayer.invalidate();
+ if (m_videoLayer && supportsAcceleratedRendering())
+ m_videoLayer->layer()->invalidate();
#endif
m_mediaPlayer->repaint();
}
@@ -166,8 +166,8 @@ void WebMediaPlayerClientImpl::setOpaque(bool opaque)
{
#if USE(ACCELERATED_COMPOSITING)
m_opaque = opaque;
- if (!m_videoLayer.isNull())
- m_videoLayer.setOpaque(m_opaque);
+ if (m_videoLayer)
+ m_videoLayer->layer()->setOpaque(m_opaque);
#endif
}
@@ -343,7 +343,7 @@ void WebMediaPlayerClientImpl::cancelLoad()
WebLayer* WebMediaPlayerClientImpl::platformLayer() const
{
ASSERT(m_supportsAcceleratedCompositing);
- return const_cast<WebVideoLayer*>(&m_videoLayer);
+ return m_videoLayer ? m_videoLayer->layer() : 0;
}
#endif
@@ -435,6 +435,13 @@ void WebMediaPlayerClientImpl::sourceEndOfStream(WebCore::MediaPlayer::EndOfStre
if (m_webMediaPlayer)
m_webMediaPlayer->sourceEndOfStream(static_cast<WebMediaPlayer::EndOfStreamStatus>(status));
}
+
+bool WebMediaPlayerClientImpl::sourceSetTimestampOffset(const String& id, double offset)
+{
+ if (!m_webMediaPlayer)
+ return false;
+ return m_webMediaPlayer->sourceSetTimestampOffset(id, offset);
+}
#endif
#if ENABLE(ENCRYPTED_MEDIA)
@@ -738,7 +745,7 @@ bool WebMediaPlayerClientImpl::supportsAcceleratedRendering() const
bool WebMediaPlayerClientImpl::acceleratedRenderingInUse()
{
- return !m_videoLayer.isNull() && m_videoLayer.active();
+ return m_videoLayer && m_videoLayer->active();
}
void WebMediaPlayerClientImpl::setVideoFrameProviderClient(WebVideoFrameProvider::Client* client)
diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h
index 2df54cd20..329fd9ec0 100644
--- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h
+++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h
@@ -164,6 +164,7 @@ public:
virtual bool sourceAppend(const String&, const unsigned char* data, unsigned length);
virtual bool sourceAbort(const String&);
virtual void sourceEndOfStream(WebCore::MediaPlayer::EndOfStreamStatus);
+ virtual bool sourceSetTimestampOffset(const String&, double offset);
#endif
#if ENABLE(ENCRYPTED_MEDIA)
@@ -204,7 +205,7 @@ private:
WebCore::MediaPlayer::Preload m_preload;
RefPtr<WebHelperPluginImpl> m_helperPlugin;
#if USE(ACCELERATED_COMPOSITING)
- WebVideoLayer m_videoLayer;
+ OwnPtr<WebVideoLayer> m_videoLayer;
bool m_supportsAcceleratedCompositing;
bool m_opaque;
WebVideoFrameProvider::Client* m_videoFrameProviderClient;
diff --git a/Source/WebKit/chromium/src/WebPagePopupImpl.cpp b/Source/WebKit/chromium/src/WebPagePopupImpl.cpp
index 18f5de20a..fe945c063 100644
--- a/Source/WebKit/chromium/src/WebPagePopupImpl.cpp
+++ b/Source/WebKit/chromium/src/WebPagePopupImpl.cpp
@@ -191,15 +191,14 @@ bool WebPagePopupImpl::initPage()
frame->view()->resize(m_popupClient->contentSize());
frame->view()->setTransparent(false);
+ DOMWindowPagePopup::install(frame->document()->domWindow(), m_popupClient);
+
DocumentWriter* writer = frame->loader()->activeDocumentLoader()->writer();
writer->setMIMEType("text/html");
writer->setEncoding("UTF-8", false);
writer->begin();
m_popupClient->writeDocument(*writer);
writer->end();
-
- ASSERT(frame->existingDOMWindow());
- DOMWindowPagePopup::install(frame->existingDOMWindow(), m_popupClient);
return true;
}
diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
index 71361780b..75a97e0f6 100644
--- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
+++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
@@ -366,11 +366,11 @@ void WebPluginContainerImpl::setBackingTextureId(unsigned textureId)
if (m_textureId == textureId)
return;
- ASSERT(m_ioSurfaceLayer.isNull());
+ ASSERT(!m_ioSurfaceLayer);
- if (m_textureLayer.isNull())
- m_textureLayer = WebExternalTextureLayer::create();
- m_textureLayer.setTextureId(textureId);
+ if (!m_textureLayer)
+ m_textureLayer = adoptPtr(WebExternalTextureLayer::create());
+ m_textureLayer->setTextureId(textureId);
// If anyone of the IDs is zero we need to switch between hardware
// and software compositing. This is done by triggering a style recalc
@@ -390,11 +390,11 @@ void WebPluginContainerImpl::setBackingIOSurfaceId(int width,
if (ioSurfaceId == m_ioSurfaceId)
return;
- ASSERT(m_textureLayer.isNull());
+ ASSERT(!m_textureLayer);
- if (m_ioSurfaceLayer.isNull())
- m_ioSurfaceLayer = WebIOSurfaceLayer::create();
- m_ioSurfaceLayer.setIOSurfaceProperties(ioSurfaceId, WebSize(width, height));
+ if (!m_ioSurfaceLayer)
+ m_ioSurfaceLayer = adoptPtr(WebIOSurfaceLayer::create());
+ m_ioSurfaceLayer->setIOSurfaceProperties(ioSurfaceId, WebSize(width, height));
// If anyone of the IDs is zero we need to switch between hardware
// and software compositing. This is done by triggering a style recalc
@@ -409,11 +409,11 @@ void WebPluginContainerImpl::setBackingIOSurfaceId(int width,
void WebPluginContainerImpl::commitBackingTexture()
{
#if USE(ACCELERATED_COMPOSITING)
- if (!m_textureLayer.isNull())
- m_textureLayer.invalidate();
+ if (m_textureLayer)
+ m_textureLayer->layer()->invalidate();
- if (!m_ioSurfaceLayer.isNull())
- m_ioSurfaceLayer.invalidate();
+ if (m_ioSurfaceLayer)
+ m_ioSurfaceLayer->layer()->invalidate();
#endif
}
@@ -480,11 +480,11 @@ void WebPluginContainerImpl::zoomLevelChanged(double zoomLevel)
void WebPluginContainerImpl::setOpaque(bool opaque)
{
#if USE(ACCELERATED_COMPOSITING)
- if (!m_textureLayer.isNull())
- m_textureLayer.setOpaque(opaque);
+ if (m_textureLayer)
+ m_textureLayer->layer()->setOpaque(opaque);
- if (!m_ioSurfaceLayer.isNull())
- m_ioSurfaceLayer.setOpaque(opaque);
+ if (m_ioSurfaceLayer)
+ m_ioSurfaceLayer->layer()->setOpaque(opaque);
#endif
}
@@ -512,10 +512,9 @@ void WebPluginContainerImpl::setIsAcceptingTouchEvents(bool acceptingTouchEvents
if (m_isAcceptingTouchEvents == acceptingTouchEvents)
return;
m_isAcceptingTouchEvents = acceptingTouchEvents;
- if (m_isAcceptingTouchEvents) {
+ if (m_isAcceptingTouchEvents)
m_element->document()->didAddTouchEventHandler();
- m_element->document()->addListenerType(Document::TOUCH_LISTENER);
- } else
+ else
m_element->document()->didRemoveTouchEventHandler();
}
@@ -576,9 +575,9 @@ void WebPluginContainerImpl::willDestroyPluginLoadObserver(WebPluginLoadObserver
WebLayer* WebPluginContainerImpl::platformLayer() const
{
if (m_textureId)
- return const_cast<WebExternalTextureLayer*>(&m_textureLayer);
+ return m_textureLayer->layer();
if (m_ioSurfaceId)
- return const_cast<WebIOSurfaceLayer*>(&m_ioSurfaceLayer);
+ return m_ioSurfaceLayer->layer();
return 0;
}
#endif
diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.h b/Source/WebKit/chromium/src/WebPluginContainerImpl.h
index 074a0ccdc..998be6e41 100644
--- a/Source/WebKit/chromium/src/WebPluginContainerImpl.h
+++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.h
@@ -186,10 +186,10 @@ private:
// A composited plugin will either have no composited layer, a texture layer, or an IOSurface layer.
// It will never have both a texture and IOSurface output.
unsigned m_textureId;
- WebExternalTextureLayer m_textureLayer;
+ OwnPtr<WebExternalTextureLayer> m_textureLayer;
unsigned m_ioSurfaceId;
- WebIOSurfaceLayer m_ioSurfaceLayer;
+ OwnPtr<WebIOSurfaceLayer> m_ioSurfaceLayer;
#endif
// The associated scrollbar group object, created lazily. Used for Pepper
diff --git a/Source/WebKit/chromium/src/WebScriptController.cpp b/Source/WebKit/chromium/src/WebScriptController.cpp
index 804e27821..fbf73f689 100644
--- a/Source/WebKit/chromium/src/WebScriptController.cpp
+++ b/Source/WebKit/chromium/src/WebScriptController.cpp
@@ -31,9 +31,9 @@
#include "config.h"
#include "WebScriptController.h"
+#include "ScriptController.h"
#include "V8Binding.h"
#include "V8DOMMap.h"
-#include "V8Proxy.h"
#include "platform/WebString.h"
@@ -43,7 +43,7 @@ namespace WebKit {
void WebScriptController::registerExtension(v8::Extension* extension)
{
- V8Proxy::registerExtensionIfNeeded(extension);
+ ScriptController::registerExtensionIfNeeded(extension);
}
void WebScriptController::enableV8SingleThreadMode()
diff --git a/Source/WebKit/chromium/src/WebScrollableLayer.cpp b/Source/WebKit/chromium/src/WebScrollableLayer.cpp
deleted file mode 100644
index a20e81d81..000000000
--- a/Source/WebKit/chromium/src/WebScrollableLayer.cpp
+++ /dev/null
@@ -1,75 +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 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"
-#include "Region.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);
-}
-
-void WebScrollableLayer::setNonFastScrollableRegion(const WebVector<WebRect>& rects)
-{
- WebCore::Region region;
- for (size_t i = 0; i < rects.size(); ++i) {
- WebCore::IntRect rect = rects[i];
- region.unite(rect);
- }
- m_private->setNonFastScrollableRegion(region);
-
-}
-
-void WebScrollableLayer::setIsContainerForFixedPositionLayers(bool enable)
-{
- m_private->setIsContainerForFixedPositionLayers(enable);
-}
-
-void WebScrollableLayer::setFixedToContainerLayer(bool enable)
-{
- m_private->setFixedToContainerLayer(enable);
-}
-
-} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebScrollbarLayer.cpp b/Source/WebKit/chromium/src/WebScrollbarLayerImpl.cpp
index 2bd1b20fb..ec6e9895d 100644
--- a/Source/WebKit/chromium/src/WebScrollbarLayer.cpp
+++ b/Source/WebKit/chromium/src/WebScrollbarLayerImpl.cpp
@@ -24,39 +24,42 @@
*/
#include "config.h"
-#include <public/WebScrollbarLayer.h>
+#include "WebScrollbarLayerImpl.h"
#include "ScrollbarLayerChromium.h"
+#include "WebLayerImpl.h"
-using namespace WebCore;
+using WebCore::Scrollbar;
+using WebCore::ScrollbarLayerChromium;
namespace WebKit {
-void WebScrollbarLayer::setScrollLayer(const WebLayer layer)
+WebScrollbarLayer* WebScrollbarLayer::create(WebCore::Scrollbar* scrollbar, WebScrollbarThemePainter painter, PassOwnPtr<WebScrollbarThemeGeometry> geometry)
{
- int id = layer.isNull() ? 0 : layer.constUnwrap<LayerChromium>()->id();
- unwrap<ScrollbarLayerChromium>()->setScrollLayerId(id);
+ return new WebScrollbarLayerImpl(ScrollbarLayerChromium::create(WebScrollbar::create(scrollbar), painter, geometry, 0));
}
-WebScrollbarLayer WebScrollbarLayer::create(WebCore::Scrollbar* scrollbar, WebScrollbarThemePainter painter, PassOwnPtr<WebScrollbarThemeGeometry> geometry)
+
+WebScrollbarLayerImpl::WebScrollbarLayerImpl(PassRefPtr<WebCore::ScrollbarLayerChromium> layer)
+ : m_layer(adoptPtr(new WebLayerImpl(layer)))
{
- return WebScrollbarLayer(ScrollbarLayerChromium::create(WebScrollbar::create(scrollbar), painter, geometry, 0));
}
-WebScrollbarLayer::WebScrollbarLayer(const WTF::PassRefPtr<WebCore::ScrollbarLayerChromium>& layer)
- : WebLayer(layer)
+WebScrollbarLayerImpl::~WebScrollbarLayerImpl()
{
}
-WebScrollbarLayer& WebScrollbarLayer::operator=(const WTF::PassRefPtr<WebCore::ScrollbarLayerChromium>& layer)
+WebLayer* WebScrollbarLayerImpl::layer()
{
- m_private = layer;
- return *this;
+ return m_layer.get();
}
-WebScrollbarLayer::operator PassRefPtr<ScrollbarLayerChromium>() const
+void WebScrollbarLayerImpl::setScrollLayer(WebLayer* layer)
{
- return unwrap<ScrollbarLayerChromium>();
+ int id = layer ? static_cast<WebLayerImpl*>(layer)->layer()->id() : 0;
+ static_cast<ScrollbarLayerChromium*>(m_layer->layer())->setScrollLayerId(id);
}
+
+
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebScrollbarLayerImpl.h b/Source/WebKit/chromium/src/WebScrollbarLayerImpl.h
new file mode 100644
index 000000000..720f79c55
--- /dev/null
+++ b/Source/WebKit/chromium/src/WebScrollbarLayerImpl.h
@@ -0,0 +1,55 @@
+/*
+ * 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 WebScrollbarLayerImpl_h
+#define WebScrollbarLayerImpl_h
+
+#include <public/WebScrollbarLayer.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+class ScrollbarLayerChromium;
+}
+
+namespace WebKit {
+class WebLayerImpl;
+
+class WebScrollbarLayerImpl : public WebScrollbarLayer {
+public:
+ explicit WebScrollbarLayerImpl(PassRefPtr<WebCore::ScrollbarLayerChromium>);
+ virtual ~WebScrollbarLayerImpl();
+
+ // WebScrollbarLayer implementation.
+ virtual WebLayer* layer() OVERRIDE;
+ virtual void setScrollLayer(WebLayer*) OVERRIDE;
+
+private:
+ OwnPtr<WebLayerImpl> m_layer;
+};
+
+}
+
+#endif // WebScrollbarLayerImpl_h
diff --git a/Source/WebKit/chromium/src/WebSolidColorLayerImpl.cpp b/Source/WebKit/chromium/src/WebSolidColorLayerImpl.cpp
index 33b1a30e3..94404262c 100644
--- a/Source/WebKit/chromium/src/WebSolidColorLayerImpl.cpp
+++ b/Source/WebKit/chromium/src/WebSolidColorLayerImpl.cpp
@@ -26,24 +26,37 @@
#include "config.h"
#include "WebSolidColorLayerImpl.h"
-using namespace WebCore;
+#include "SolidColorLayerChromium.h"
+#include "WebLayerImpl.h"
+
+using WebCore::SolidColorLayerChromium;
namespace WebKit {
-PassRefPtr<WebSolidColorLayerImpl> WebSolidColorLayerImpl::create()
+WebSolidColorLayer* WebSolidColorLayer::create()
{
- return adoptRef(new WebSolidColorLayerImpl());
+ return new WebSolidColorLayerImpl(SolidColorLayerChromium::create());
}
-WebSolidColorLayerImpl::WebSolidColorLayerImpl()
- : SolidColorLayerChromium()
+WebSolidColorLayerImpl::WebSolidColorLayerImpl(PassRefPtr<SolidColorLayerChromium> layer)
+ : m_layer(adoptPtr(new WebLayerImpl(layer)))
{
- setIsDrawable(true);
+ m_layer->layer()->setIsDrawable(true);
}
WebSolidColorLayerImpl::~WebSolidColorLayerImpl()
{
}
+WebLayer* WebSolidColorLayerImpl::layer()
+{
+ return m_layer.get();
+}
+
+void WebSolidColorLayerImpl::setBackgroundColor(WebColor color)
+{
+ m_layer->setBackgroundColor(color);
+}
+
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebSolidColorLayerImpl.h b/Source/WebKit/chromium/src/WebSolidColorLayerImpl.h
index d2673b42b..7742ba492 100644
--- a/Source/WebKit/chromium/src/WebSolidColorLayerImpl.h
+++ b/Source/WebKit/chromium/src/WebSolidColorLayerImpl.h
@@ -26,18 +26,28 @@
#ifndef WebSolidColorLayerImpl_h
#define WebSolidColorLayerImpl_h
-#include "SolidColorLayerChromium.h"
+#include <public/WebSolidColorLayer.h>
+#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
+namespace WebCore {
+class SolidColorLayerChromium;
+}
+
namespace WebKit {
+class WebLayerImpl;
-class WebSolidColorLayerImpl : public WebCore::SolidColorLayerChromium {
+class WebSolidColorLayerImpl : public WebSolidColorLayer {
public:
- static PassRefPtr<WebSolidColorLayerImpl> create();
-
-protected:
- WebSolidColorLayerImpl();
+ explicit WebSolidColorLayerImpl(PassRefPtr<WebCore::SolidColorLayerChromium>);
virtual ~WebSolidColorLayerImpl();
+
+ // WebSolidColorLayer implementation.
+ virtual WebLayer* layer() OVERRIDE;
+ virtual void setBackgroundColor(WebColor) OVERRIDE;
+
+private:
+ OwnPtr<WebLayerImpl> m_layer;
};
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebTransformAnimationCurve.cpp b/Source/WebKit/chromium/src/WebTransformAnimationCurve.cpp
index ca95fa39e..dad084987 100644
--- a/Source/WebKit/chromium/src/WebTransformAnimationCurve.cpp
+++ b/Source/WebKit/chromium/src/WebTransformAnimationCurve.cpp
@@ -26,9 +26,9 @@
#include <public/WebTransformAnimationCurve.h>
+#include "CCKeyframedAnimationCurve.h"
+#include "CCTimingFunction.h"
#include "WebAnimationCurveCommon.h"
-#include "cc/CCKeyframedAnimationCurve.h"
-#include "cc/CCTimingFunction.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
diff --git a/Source/WebKit/chromium/src/WebVideoLayerImpl.cpp b/Source/WebKit/chromium/src/WebVideoLayerImpl.cpp
new file mode 100644
index 000000000..5bfed6742
--- /dev/null
+++ b/Source/WebKit/chromium/src/WebVideoLayerImpl.cpp
@@ -0,0 +1,58 @@
+/*
+ * 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 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 "WebVideoLayerImpl.h"
+
+#include "VideoLayerChromium.h"
+#include "WebLayerImpl.h"
+
+namespace WebKit {
+
+WebVideoLayer* WebVideoLayer::create(WebVideoFrameProvider* provider)
+{
+ return new WebVideoLayerImpl(WebCore::VideoLayerChromium::create(provider));
+}
+
+WebVideoLayerImpl::WebVideoLayerImpl(PassRefPtr<WebCore::VideoLayerChromium> layer)
+ : m_layer(adoptPtr(new WebLayerImpl(layer)))
+{
+}
+
+WebVideoLayerImpl::~WebVideoLayerImpl()
+{
+}
+
+WebLayer* WebVideoLayerImpl::layer()
+{
+ return m_layer.get();
+}
+
+bool WebVideoLayerImpl::active() const
+{
+ return m_layer->layer()->layerTreeHost();
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebVideoLayer.cpp b/Source/WebKit/chromium/src/WebVideoLayerImpl.h
index 0f342155d..287e4b5e2 100644
--- a/Source/WebKit/chromium/src/WebVideoLayer.cpp
+++ b/Source/WebKit/chromium/src/WebVideoLayerImpl.h
@@ -23,25 +23,32 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
-#include "VideoLayerChromium.h"
+#ifndef WebVideoLayerImpl_h
+#define WebVideoLayerImpl_h
+
#include <public/WebVideoLayer.h>
+namespace WebCore {
+class VideoLayerChromium;
+}
+
namespace WebKit {
+class WebLayerImpl;
-WebVideoLayer WebVideoLayer::create(WebVideoFrameProvider* provider)
-{
- return WebVideoLayer(WebCore::VideoLayerChromium::create(provider));
-}
+class WebVideoLayerImpl : public WebVideoLayer {
+public:
+ explicit WebVideoLayerImpl(PassRefPtr<WebCore::VideoLayerChromium>);
+ virtual ~WebVideoLayerImpl();
-WebVideoLayer::WebVideoLayer(PassRefPtr<WebCore::VideoLayerChromium> layer)
- : WebLayer(layer)
-{
-}
+ // WebVideoLayer implementation.
+ virtual WebLayer* layer() OVERRIDE;
+ virtual bool active() const OVERRIDE;
+
+private:
+ OwnPtr<WebLayerImpl> m_layer;
+};
-bool WebVideoLayer::active() const
-{
- return m_private->layerTreeHost();
}
-} // namespace WebKit
+#endif // WebVideoLayerImpl_h
+
diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp
index 0bd3ea116..97339b342 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.cpp
+++ b/Source/WebKit/chromium/src/WebViewImpl.cpp
@@ -129,6 +129,7 @@
#include "WebDevToolsAgentPrivate.h"
#include "WebFrameImpl.h"
#include "WebHelperPluginImpl.h"
+#include "WebHitTestResult.h"
#include "WebInputElement.h"
#include "WebInputEvent.h"
#include "WebInputEventConversion.h"
@@ -266,9 +267,6 @@ static int webInputEventKeyStateToPlatformEventKeyState(int webInputEventKeyStat
WebView* WebView::create(WebViewClient* client)
{
- // Keep runtime flag for device motion turned off until it's implemented.
- WebRuntimeFeatures::enableDeviceMotion(false);
-
// Pass the WebViewImpl's self-reference to the caller.
return adoptRef(new WebViewImpl(client)).leakRef();
}
@@ -410,6 +408,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
, m_isCancelingFullScreen(false)
, m_benchmarkSupport(this)
#if USE(ACCELERATED_COMPOSITING)
+ , m_rootLayer(0)
, m_rootGraphicsLayer(0)
, m_isAcceleratedCompositingActive(false)
, m_compositorCreationFailed(false)
@@ -3514,6 +3513,7 @@ bool WebViewImpl::allowsAcceleratedCompositing()
void WebViewImpl::setRootGraphicsLayer(GraphicsLayer* layer)
{
m_rootGraphicsLayer = layer;
+ m_rootLayer = layer ? layer->platformLayer() : 0;
setIsAcceleratedCompositingActive(layer);
if (m_nonCompositedContentHost) {
@@ -3527,11 +3527,8 @@ void WebViewImpl::setRootGraphicsLayer(GraphicsLayer* layer)
m_nonCompositedContentHost->setScrollLayer(scrollLayer);
}
- if (layer)
- m_rootLayer = *layer->platformLayer();
-
if (!m_layerTreeView.isNull())
- m_layerTreeView.setRootLayer(layer ? &m_rootLayer : 0);
+ m_layerTreeView.setRootLayer(m_rootLayer);
IntRect damagedRect(0, 0, m_size.width, m_size.height);
if (!m_isAcceleratedCompositingActive)
@@ -3644,7 +3641,7 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active)
m_nonCompositedContentHost->setShowDebugBorders(page()->settings()->showDebugBorders());
m_nonCompositedContentHost->setOpaque(!isTransparent());
- m_layerTreeView.initialize(this, m_rootLayer, layerTreeViewSettings);
+ m_layerTreeView.initialize(this, *m_rootLayer, layerTreeViewSettings);
if (!m_layerTreeView.isNull()) {
if (m_webSettings->applyDefaultDeviceScaleFactorInCompositor() && page()->deviceScaleFactor() != 1) {
ASSERT(page()->deviceScaleFactor());
@@ -3855,7 +3852,7 @@ void WebViewImpl::selectAutofillSuggestionAtIndex(unsigned listIndex)
m_autofillPopupClient->valueChanged(listIndex);
}
-bool WebViewImpl::detectContentIntentOnTouch(const WebPoint& position, WebInputEvent::Type touchType)
+bool WebViewImpl::detectContentOnTouch(const WebPoint& position, WebInputEvent::Type touchType)
{
ASSERT(touchType == WebInputEvent::GestureTap || touchType == WebInputEvent::GestureLongPress);
HitTestResult touchHit = hitTestResultForWindowPos(position);
@@ -3869,7 +3866,7 @@ bool WebViewImpl::detectContentIntentOnTouch(const WebPoint& position, WebInputE
// FIXME: Should we not detect content intents in nodes that have event listeners?
- WebContentDetectionResult content = m_client->detectContentIntentAround(touchHit);
+ WebContentDetectionResult content = m_client->detectContentAround(touchHit);
if (!content.isValid())
return false;
diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h
index 39783680f..431dad490 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.h
+++ b/Source/WebKit/chromium/src/WebViewImpl.h
@@ -391,7 +391,7 @@ public:
void mouseContextMenu(const WebMouseEvent&);
void mouseDoubleClick(const WebMouseEvent&);
- bool detectContentIntentOnTouch(const WebPoint&, WebInputEvent::Type);
+ bool detectContentOnTouch(const WebPoint&, WebInputEvent::Type);
void startPageScaleAnimation(const WebCore::IntPoint& targetPosition, bool useAnchor, float newScale, double durationInSeconds);
void numberOfWheelEventHandlersChanged(unsigned);
@@ -814,7 +814,7 @@ private:
WebCore::IntRect m_rootLayerScrollDamage;
OwnPtr<NonCompositedContentHost> m_nonCompositedContentHost;
WebLayerTreeView m_layerTreeView;
- WebLayer m_rootLayer;
+ WebLayer* m_rootLayer;
WebCore::GraphicsLayer* m_rootGraphicsLayer;
bool m_isAcceleratedCompositingActive;
bool m_compositorCreationFailed;
diff --git a/Source/WebKit/chromium/tests/AnimationTranslationUtilTest.cpp b/Source/WebKit/chromium/tests/AnimationTranslationUtilTest.cpp
new file mode 100644
index 000000000..70da65ef6
--- /dev/null
+++ b/Source/WebKit/chromium/tests/AnimationTranslationUtilTest.cpp
@@ -0,0 +1,243 @@
+/*
+ * 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 "AnimationTranslationUtil.h"
+
+#include "Animation.h"
+#include "GraphicsLayer.h" // For KeyframeValueList
+#include "IntSize.h"
+#include "Matrix3DTransformOperation.h"
+#include "RotateTransformOperation.h"
+#include "TransformOperations.h"
+#include "TranslateTransformOperation.h"
+#include <gtest/gtest.h>
+#include <public/WebAnimation.h>
+#include <wtf/RefPtr.h>
+
+using namespace WebCore;
+using namespace WebKit;
+
+namespace {
+
+bool animationCanBeTranslated(const KeyframeValueList& values, Animation* animation)
+{
+ IntSize boxSize;
+ return createWebAnimation(values, animation, 0, 0, 0, boxSize);
+}
+
+TEST(AnimationTranslationUtilTest, createOpacityAnimation)
+{
+ const double duration = 1;
+ WebCore::KeyframeValueList values(AnimatedPropertyOpacity);
+ values.insert(new FloatAnimationValue(0, 0));
+ values.insert(new FloatAnimationValue(duration, 1));
+
+ RefPtr<Animation> animation = Animation::create();
+ animation->setDuration(duration);
+
+ EXPECT_TRUE(animationCanBeTranslated(values, animation.get()));
+}
+
+TEST(AnimationTranslationUtilTest, createTransformAnimation)
+{
+ const double duration = 1;
+ WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
+
+ TransformOperations operations1;
+ operations1.operations().append(TranslateTransformOperation::create(Length(2, WebCore::Fixed), Length(0, WebCore::Fixed), TransformOperation::TRANSLATE_X));
+ values.insert(new TransformAnimationValue(0, &operations1));
+
+ TransformOperations operations2;
+ operations2.operations().append(TranslateTransformOperation::create(Length(4, WebCore::Fixed), Length(0, WebCore::Fixed), TransformOperation::TRANSLATE_X));
+ values.insert(new TransformAnimationValue(duration, &operations2));
+
+ RefPtr<Animation> animation = Animation::create();
+ animation->setDuration(duration);
+
+ EXPECT_TRUE(animationCanBeTranslated(values, animation.get()));
+}
+
+TEST(AnimationTranslationUtilTest, createTransformAnimationWithBigRotation)
+{
+ const double duration = 1;
+ WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
+
+ TransformOperations operations1;
+ operations1.operations().append(RotateTransformOperation::create(0, TransformOperation::ROTATE));
+ values.insert(new TransformAnimationValue(0, &operations1));
+
+ TransformOperations operations2;
+ operations2.operations().append(RotateTransformOperation::create(270, TransformOperation::ROTATE));
+ values.insert(new TransformAnimationValue(duration, &operations2));
+
+ RefPtr<Animation> animation = Animation::create();
+ animation->setDuration(duration);
+
+ EXPECT_FALSE(animationCanBeTranslated(values, animation.get()));
+}
+
+TEST(AnimationTranslationUtilTest, createTransformAnimationWithBigRotationAndEmptyTransformOperationList)
+{
+ const double duration = 1;
+ WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
+
+ TransformOperations operations1;
+ values.insert(new TransformAnimationValue(0, &operations1));
+
+ TransformOperations operations2;
+ operations2.operations().append(RotateTransformOperation::create(270, TransformOperation::ROTATE));
+ values.insert(new TransformAnimationValue(duration, &operations2));
+
+ RefPtr<Animation> animation = Animation::create();
+ animation->setDuration(duration);
+
+ EXPECT_FALSE(animationCanBeTranslated(values, animation.get()));
+}
+
+TEST(AnimationTranslationUtilTest, createTransformAnimationWithRotationInvolvingNegativeAngles)
+{
+ const double duration = 1;
+ WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
+
+ TransformOperations operations1;
+ operations1.operations().append(RotateTransformOperation::create(-330, TransformOperation::ROTATE));
+ values.insert(new TransformAnimationValue(0, &operations1));
+
+ TransformOperations operations2;
+ operations2.operations().append(RotateTransformOperation::create(-320, TransformOperation::ROTATE));
+ values.insert(new TransformAnimationValue(duration, &operations2));
+
+ RefPtr<Animation> animation = Animation::create();
+ animation->setDuration(duration);
+
+ EXPECT_TRUE(animationCanBeTranslated(values, animation.get()));
+}
+
+TEST(AnimationTranslationUtilTest, createTransformAnimationWithSmallRotationInvolvingLargeAngles)
+{
+ const double duration = 1;
+ WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
+
+ TransformOperations operations1;
+ operations1.operations().append(RotateTransformOperation::create(270, TransformOperation::ROTATE));
+ values.insert(new TransformAnimationValue(0, &operations1));
+
+ TransformOperations operations2;
+ operations2.operations().append(RotateTransformOperation::create(360, TransformOperation::ROTATE));
+ values.insert(new TransformAnimationValue(duration, &operations2));
+
+ RefPtr<Animation> animation = Animation::create();
+ animation->setDuration(duration);
+
+ EXPECT_TRUE(animationCanBeTranslated(values, animation.get()));
+}
+
+TEST(AnimationTranslationUtilTest, createTransformAnimationWithSingularMatrix)
+{
+ const double duration = 1;
+ WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
+
+ TransformationMatrix matrix1;
+ TransformOperations operations1;
+ operations1.operations().append(Matrix3DTransformOperation::create(matrix1));
+ values.insert(new TransformAnimationValue(0, &operations1));
+
+ TransformationMatrix matrix2;
+ matrix2.setM11(0);
+ TransformOperations operations2;
+ operations2.operations().append(Matrix3DTransformOperation::create(matrix2));
+ values.insert(new TransformAnimationValue(duration, &operations2));
+
+ RefPtr<Animation> animation = Animation::create();
+ animation->setDuration(duration);
+
+ EXPECT_FALSE(animationCanBeTranslated(values, animation.get()));
+}
+
+TEST(AnimationTranslationUtilTest, createReversedAnimation)
+{
+ const double duration = 1;
+ WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
+
+ TransformOperations operations1;
+ operations1.operations().append(TranslateTransformOperation::create(Length(2, WebCore::Fixed), Length(0, WebCore::Fixed), TransformOperation::TRANSLATE_X));
+ values.insert(new TransformAnimationValue(0, &operations1));
+
+ TransformOperations operations2;
+ operations2.operations().append(TranslateTransformOperation::create(Length(4, WebCore::Fixed), Length(0, WebCore::Fixed), TransformOperation::TRANSLATE_X));
+ values.insert(new TransformAnimationValue(duration, &operations2));
+
+ RefPtr<Animation> animation = Animation::create();
+ animation->setDuration(duration);
+ animation->setDirection(Animation::AnimationDirectionReverse);
+
+ EXPECT_TRUE(animationCanBeTranslated(values, animation.get()));
+}
+
+TEST(AnimationTranslationUtilTest, createAlternatingAnimation)
+{
+ const double duration = 1;
+ WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
+
+ TransformOperations operations1;
+ operations1.operations().append(TranslateTransformOperation::create(Length(2, WebCore::Fixed), Length(0, WebCore::Fixed), TransformOperation::TRANSLATE_X));
+ values.insert(new TransformAnimationValue(0, &operations1));
+
+ TransformOperations operations2;
+ operations2.operations().append(TranslateTransformOperation::create(Length(4, WebCore::Fixed), Length(0, WebCore::Fixed), TransformOperation::TRANSLATE_X));
+ values.insert(new TransformAnimationValue(duration, &operations2));
+
+ RefPtr<Animation> animation = Animation::create();
+ animation->setDuration(duration);
+ animation->setDirection(Animation::AnimationDirectionAlternate);
+ animation->setIterationCount(2);
+
+ EXPECT_TRUE(animationCanBeTranslated(values, animation.get()));
+}
+
+TEST(AnimationTranslationUtilTest, createReversedAlternatingAnimation)
+{
+ const double duration = 1;
+ WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
+
+ TransformOperations operations1;
+ operations1.operations().append(TranslateTransformOperation::create(Length(2, WebCore::Fixed), Length(0, WebCore::Fixed), TransformOperation::TRANSLATE_X));
+ values.insert(new TransformAnimationValue(0, &operations1));
+
+ TransformOperations operations2;
+ operations2.operations().append(TranslateTransformOperation::create(Length(4, WebCore::Fixed), Length(0, WebCore::Fixed), TransformOperation::TRANSLATE_X));
+ values.insert(new TransformAnimationValue(duration, &operations2));
+
+ RefPtr<Animation> animation = Animation::create();
+ animation->setDuration(duration);
+ animation->setDirection(Animation::AnimationDirectionAlternateReverse);
+ animation->setIterationCount(2);
+
+ EXPECT_TRUE(animationCanBeTranslated(values, animation.get()));
+}
+
+}
+
diff --git a/Source/WebKit/chromium/tests/CCActiveAnimationTest.cpp b/Source/WebKit/chromium/tests/CCActiveAnimationTest.cpp
index af9fde1d5..899dd3731 100644
--- a/Source/WebKit/chromium/tests/CCActiveAnimationTest.cpp
+++ b/Source/WebKit/chromium/tests/CCActiveAnimationTest.cpp
@@ -24,9 +24,9 @@
#include "config.h"
-#include "cc/CCActiveAnimation.h"
-#include "CCAnimationTestCommon.h"
+#include "CCActiveAnimation.h"
+#include "CCAnimationTestCommon.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <wtf/Vector.h>
diff --git a/Source/WebKit/chromium/tests/CCAnimationTestCommon.cpp b/Source/WebKit/chromium/tests/CCAnimationTestCommon.cpp
index f210c1bb7..76d1c0a3e 100644
--- a/Source/WebKit/chromium/tests/CCAnimationTestCommon.cpp
+++ b/Source/WebKit/chromium/tests/CCAnimationTestCommon.cpp
@@ -26,11 +26,10 @@
#include "CCAnimationTestCommon.h"
+#include "CCKeyframedAnimationCurve.h"
+#include "CCLayerAnimationController.h"
+#include "CCLayerImpl.h"
#include "LayerChromium.h"
-#include "cc/CCKeyframedAnimationCurve.h"
-#include "cc/CCLayerAnimationController.h"
-#include "cc/CCLayerImpl.h"
-
#include <public/WebTransformOperations.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/tests/CCAnimationTestCommon.h b/Source/WebKit/chromium/tests/CCAnimationTestCommon.h
index 4bbd60112..71b0add26 100644
--- a/Source/WebKit/chromium/tests/CCAnimationTestCommon.h
+++ b/Source/WebKit/chromium/tests/CCAnimationTestCommon.h
@@ -25,9 +25,10 @@
#ifndef CCAnimationTestCommon_h
#define CCAnimationTestCommon_h
+#include "CCActiveAnimation.h"
+#include "CCAnimationCurve.h"
+#include "CCLayerAnimationController.h"
#include "IntSize.h"
-#include "cc/CCAnimationCurve.h"
-#include "cc/CCLayerAnimationController.h"
#include <wtf/OwnPtr.h>
diff --git a/Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp b/Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp
index 8f813b9ba..f9eecdb75 100644
--- a/Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp
+++ b/Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp
@@ -24,14 +24,14 @@
#include "config.h"
-#include "cc/CCDamageTracker.h"
+#include "CCDamageTracker.h"
+#include "CCLayerImpl.h"
+#include "CCLayerSorter.h"
+#include "CCLayerTreeHostCommon.h"
#include "CCLayerTreeTestCommon.h"
-#include "cc/CCLayerImpl.h"
-#include "cc/CCLayerSorter.h"
-#include "cc/CCLayerTreeHostCommon.h"
-#include "cc/CCMathUtil.h"
-#include "cc/CCSingleThreadProxy.h"
+#include "CCMathUtil.h"
+#include "CCSingleThreadProxy.h"
#include <gtest/gtest.h>
#include <public/WebFilterOperation.h>
#include <public/WebFilterOperations.h>
diff --git a/Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp b/Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp
index 08b5d8202..1197a3118 100644
--- a/Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp
+++ b/Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp
@@ -24,10 +24,10 @@
#include "config.h"
-#include "cc/CCDelayBasedTimeSource.h"
+#include "CCDelayBasedTimeSource.h"
#include "CCSchedulerTestCommon.h"
-#include "cc/CCThread.h"
+#include "CCThread.h"
#include <gtest/gtest.h>
#include <wtf/RefPtr.h>
@@ -44,12 +44,12 @@ TEST(CCDelayBasedTimeSourceTest, TaskPostedAndTickCalled)
RefPtr<FakeCCDelayBasedTimeSource> timer = FakeCCDelayBasedTimeSource::create(1.0 / 60.0, &thread);
timer->setClient(&client);
- timer->setMonotonicallyIncreasingTime(0);
+ timer->setMonotonicTimeNow(0);
timer->setActive(true);
EXPECT_TRUE(timer->active());
EXPECT_TRUE(thread.hasPendingTask());
- timer->setMonotonicallyIncreasingTime(0.016);
+ timer->setMonotonicTimeNow(0.016);
thread.runPendingTask();
EXPECT_TRUE(timer->active());
EXPECT_TRUE(client.tickCalled());
@@ -109,7 +109,7 @@ TEST(CCDelayBasedTimeSource, NextDelaySaneWhenExactlyOnRequestedTime)
EXPECT_EQ(16, thread.pendingDelayMs());
- timer->setMonotonicallyIncreasingTime(interval);
+ timer->setMonotonicTimeNow(interval);
thread.runPendingTask();
EXPECT_EQ(16, thread.pendingDelayMs());
@@ -130,7 +130,7 @@ TEST(CCDelayBasedTimeSource, NextDelaySaneWhenSlightlyAfterRequestedTime)
EXPECT_EQ(16, thread.pendingDelayMs());
- timer->setMonotonicallyIncreasingTime(interval + 0.0000001);
+ timer->setMonotonicTimeNow(interval + 0.0000001);
thread.runPendingTask();
EXPECT_EQ(16, thread.pendingDelayMs());
@@ -151,7 +151,7 @@ TEST(CCDelayBasedTimeSource, NextDelaySaneWhenExactlyTwiceAfterRequestedTime)
EXPECT_EQ(16, thread.pendingDelayMs());
- timer->setMonotonicallyIncreasingTime(2*interval);
+ timer->setMonotonicTimeNow(2*interval);
thread.runPendingTask();
EXPECT_EQ(16, thread.pendingDelayMs());
@@ -172,7 +172,7 @@ TEST(CCDelayBasedTimeSource, NextDelaySaneWhenSlightlyAfterTwiceRequestedTime)
EXPECT_EQ(16, thread.pendingDelayMs());
- timer->setMonotonicallyIncreasingTime(2*interval + 0.0000001);
+ timer->setMonotonicTimeNow(2*interval + 0.0000001);
thread.runPendingTask();
EXPECT_EQ(16, thread.pendingDelayMs());
@@ -193,7 +193,7 @@ TEST(CCDelayBasedTimeSource, NextDelaySaneWhenHalfAfterRequestedTime)
EXPECT_EQ(16, thread.pendingDelayMs());
- timer->setMonotonicallyIncreasingTime(interval + interval * 0.5);
+ timer->setMonotonicTimeNow(interval + interval * 0.5);
thread.runPendingTask();
EXPECT_EQ(8, thread.pendingDelayMs());
@@ -216,7 +216,7 @@ TEST(CCDelayBasedTimeSource, SaneHandlingOfJitteryTimebase)
// Jitter timebase ~1ms late
timer->setTimebaseAndInterval(interval + 0.001, interval);
- timer->setMonotonicallyIncreasingTime(interval);
+ timer->setMonotonicTimeNow(interval);
thread.runPendingTask();
// Without double tick prevention, pendingDelayMs would be 1.
@@ -224,7 +224,7 @@ TEST(CCDelayBasedTimeSource, SaneHandlingOfJitteryTimebase)
// Jitter timebase ~1ms early
timer->setTimebaseAndInterval(interval * 2 - 0.001, interval);
- timer->setMonotonicallyIncreasingTime(interval * 2);
+ timer->setMonotonicTimeNow(interval * 2);
thread.runPendingTask();
EXPECT_EQ(15, thread.pendingDelayMs());
@@ -244,7 +244,7 @@ TEST(CCDelayBasedTimeSource, HanldlesSignificantTimebaseChangesImmediately)
EXPECT_EQ(16, thread.pendingDelayMs());
// Tick, then shift timebase by +7ms.
- timer->setMonotonicallyIncreasingTime(interval);
+ timer->setMonotonicTimeNow(interval);
thread.runPendingTask();
EXPECT_EQ(16, thread.pendingDelayMs());
@@ -258,7 +258,7 @@ TEST(CCDelayBasedTimeSource, HanldlesSignificantTimebaseChangesImmediately)
EXPECT_EQ(7, thread.pendingDelayMs());
// Tick, then shift timebase by -7ms.
- timer->setMonotonicallyIncreasingTime(interval + 0.0070001);
+ timer->setMonotonicTimeNow(interval + 0.0070001);
thread.runPendingTask();
EXPECT_EQ(16, thread.pendingDelayMs());
@@ -286,7 +286,7 @@ TEST(CCDelayBasedTimeSource, HanldlesSignificantIntervalChangesImmediately)
EXPECT_EQ(16, thread.pendingDelayMs());
// Tick, then double the interval.
- timer->setMonotonicallyIncreasingTime(interval);
+ timer->setMonotonicTimeNow(interval);
thread.runPendingTask();
EXPECT_EQ(16, thread.pendingDelayMs());
@@ -300,7 +300,7 @@ TEST(CCDelayBasedTimeSource, HanldlesSignificantIntervalChangesImmediately)
EXPECT_EQ(33, thread.pendingDelayMs());
// Tick, then halve the interval.
- timer->setMonotonicallyIncreasingTime(interval * 3);
+ timer->setMonotonicTimeNow(interval * 3);
thread.runPendingTask();
EXPECT_EQ(33, thread.pendingDelayMs());
@@ -332,8 +332,8 @@ TEST(CCDelayBasedTimeSourceTest, AchievesTargetRateWithNoNoise)
totalFrameTime += delayMs / 1000.0;
// Run the callback exactly when asked
- double now = timer->monotonicallyIncreasingTime() + delayMs / 1000.0;
- timer->setMonotonicallyIncreasingTime(now);
+ double now = timer->monotonicTimeNow() + delayMs / 1000.0;
+ timer->setMonotonicTimeNow(now);
thread.runPendingTask();
}
double averageInterval = totalFrameTime / static_cast<double>(numIterations);
@@ -361,7 +361,7 @@ TEST(CCDelayBasedTimeSource, TestDeactivateAndReactivateBeforeNextTickTime)
// Should run the activate task, and pick up a new timebase.
timer->setActive(true);
- timer->setMonotonicallyIncreasingTime(0);
+ timer->setMonotonicTimeNow(0);
thread.runPendingTask();
// Stop the timer
@@ -372,7 +372,7 @@ TEST(CCDelayBasedTimeSource, TestDeactivateAndReactivateBeforeNextTickTime)
// Start the timer again, but before the next tick time the timer previously
// planned on using. That same tick time should still be targeted.
- timer->setMonotonicallyIncreasingTime(0.004);
+ timer->setMonotonicTimeNow(0.004);
timer->setActive(true);
EXPECT_EQ(12, thread.pendingDelayMs());
}
@@ -386,7 +386,7 @@ TEST(CCDelayBasedTimeSource, TestDeactivateAndReactivateAfterNextTickTime)
// Should run the activate task, and pick up a new timebase.
timer->setActive(true);
- timer->setMonotonicallyIncreasingTime(0);
+ timer->setMonotonicTimeNow(0);
thread.runPendingTask();
// Stop the timer
@@ -397,7 +397,7 @@ TEST(CCDelayBasedTimeSource, TestDeactivateAndReactivateAfterNextTickTime)
// Start the timer again, but before the next tick time the timer previously
// planned on using. That same tick time should still be targeted.
- timer->setMonotonicallyIncreasingTime(0.02);
+ timer->setMonotonicTimeNow(0.02);
timer->setActive(true);
EXPECT_EQ(13, thread.pendingDelayMs());
}
diff --git a/Source/WebKit/chromium/tests/CCFrameRateControllerTest.cpp b/Source/WebKit/chromium/tests/CCFrameRateControllerTest.cpp
index 20f2374a3..3cf646a74 100644
--- a/Source/WebKit/chromium/tests/CCFrameRateControllerTest.cpp
+++ b/Source/WebKit/chromium/tests/CCFrameRateControllerTest.cpp
@@ -24,7 +24,7 @@
#include "config.h"
-#include "cc/CCFrameRateController.h"
+#include "CCFrameRateController.h"
#include "CCSchedulerTestCommon.h"
#include <gtest/gtest.h>
@@ -63,7 +63,7 @@ TEST(CCFrameRateControllerTest, TestFrameThrottling_ImmediateAck)
// Trigger one frame, make sure the vsync callback is called
elapsed += thread.pendingDelayMs() / 1000.0;
- timeSource->setMonotonicallyIncreasingTime(elapsed);
+ timeSource->setMonotonicTimeNow(elapsed);
thread.runPendingTask();
EXPECT_TRUE(client.vsyncTicked());
client.reset();
@@ -72,13 +72,13 @@ TEST(CCFrameRateControllerTest, TestFrameThrottling_ImmediateAck)
controller.didBeginFrame();
// Tell the controller the frame ended 5ms later
- timeSource->setMonotonicallyIncreasingTime(timeSource->monotonicallyIncreasingTime() + 0.005);
+ timeSource->setMonotonicTimeNow(timeSource->monotonicTimeNow() + 0.005);
controller.didFinishFrame();
// Trigger another frame, make sure vsync runs again
elapsed += thread.pendingDelayMs() / 1000.0;
- EXPECT_TRUE(elapsed >= timeSource->monotonicallyIncreasingTime()); // Sanity check that previous code didn't move time backward.
- timeSource->setMonotonicallyIncreasingTime(elapsed);
+ EXPECT_TRUE(elapsed >= timeSource->monotonicTimeNow()); // Sanity check that previous code didn't move time backward.
+ timeSource->setMonotonicTimeNow(elapsed);
thread.runPendingTask();
EXPECT_TRUE(client.vsyncTicked());
}
@@ -98,7 +98,7 @@ TEST(CCFrameRateControllerTest, TestFrameThrottling_TwoFramesInFlight)
// Trigger one frame, make sure the vsync callback is called
elapsed += thread.pendingDelayMs() / 1000.0;
- timeSource->setMonotonicallyIncreasingTime(elapsed);
+ timeSource->setMonotonicTimeNow(elapsed);
thread.runPendingTask();
EXPECT_TRUE(client.vsyncTicked());
client.reset();
@@ -108,8 +108,8 @@ TEST(CCFrameRateControllerTest, TestFrameThrottling_TwoFramesInFlight)
// Trigger another frame, make sure vsync callback runs again
elapsed += thread.pendingDelayMs() / 1000.0;
- EXPECT_TRUE(elapsed >= timeSource->monotonicallyIncreasingTime()); // Sanity check that previous code didn't move time backward.
- timeSource->setMonotonicallyIncreasingTime(elapsed);
+ EXPECT_TRUE(elapsed >= timeSource->monotonicTimeNow()); // Sanity check that previous code didn't move time backward.
+ timeSource->setMonotonicTimeNow(elapsed);
thread.runPendingTask();
EXPECT_TRUE(client.vsyncTicked());
client.reset();
@@ -119,13 +119,13 @@ TEST(CCFrameRateControllerTest, TestFrameThrottling_TwoFramesInFlight)
// Trigger another frame. Since two frames are pending, we should not draw.
elapsed += thread.pendingDelayMs() / 1000.0;
- EXPECT_TRUE(elapsed >= timeSource->monotonicallyIncreasingTime()); // Sanity check that previous code didn't move time backward.
- timeSource->setMonotonicallyIncreasingTime(elapsed);
+ EXPECT_TRUE(elapsed >= timeSource->monotonicTimeNow()); // Sanity check that previous code didn't move time backward.
+ timeSource->setMonotonicTimeNow(elapsed);
thread.runPendingTask();
EXPECT_FALSE(client.vsyncTicked());
// Tell the controller the first frame ended 5ms later
- timeSource->setMonotonicallyIncreasingTime(timeSource->monotonicallyIncreasingTime() + 0.005);
+ timeSource->setMonotonicTimeNow(timeSource->monotonicTimeNow() + 0.005);
controller.didFinishFrame();
// Tick should not have been called
@@ -133,8 +133,8 @@ TEST(CCFrameRateControllerTest, TestFrameThrottling_TwoFramesInFlight)
// Trigger yet another frame. Since one frames is pending, another vsync callback should run.
elapsed += thread.pendingDelayMs() / 1000.0;
- EXPECT_TRUE(elapsed >= timeSource->monotonicallyIncreasingTime()); // Sanity check that previous code didn't move time backward.
- timeSource->setMonotonicallyIncreasingTime(elapsed);
+ EXPECT_TRUE(elapsed >= timeSource->monotonicTimeNow()); // Sanity check that previous code didn't move time backward.
+ timeSource->setMonotonicTimeNow(elapsed);
thread.runPendingTask();
EXPECT_TRUE(client.vsyncTicked());
}
@@ -154,6 +154,17 @@ TEST(CCFrameRateControllerTest, TestFrameThrottling_Unthrottled)
EXPECT_TRUE(client.vsyncTicked());
client.reset();
+ // Even if we don't call didBeginFrame, CCFrameRateController should
+ // still attempt to vsync tick multiple times until it does result in
+ // a didBeginFrame.
+ thread.runPendingTask();
+ EXPECT_TRUE(client.vsyncTicked());
+ client.reset();
+
+ thread.runPendingTask();
+ EXPECT_TRUE(client.vsyncTicked());
+ client.reset();
+
// didBeginFrame triggers 2nd frame, make sure the vsync callback is called
controller.didBeginFrame();
thread.runPendingTask();
@@ -166,6 +177,9 @@ TEST(CCFrameRateControllerTest, TestFrameThrottling_Unthrottled)
EXPECT_FALSE(client.vsyncTicked());
client.reset();
+ // Make sure there is no pending task since we can't do anything until we receive a didFinishFrame anyway.
+ EXPECT_FALSE(thread.hasPendingTask());
+
// didFinishFrame triggers a frame, make sure the vsync callback is called
controller.didFinishFrame();
thread.runPendingTask();
diff --git a/Source/WebKit/chromium/tests/CCKeyframedAnimationCurveTest.cpp b/Source/WebKit/chromium/tests/CCKeyframedAnimationCurveTest.cpp
index 4d2c4ddaf..571eee141 100644
--- a/Source/WebKit/chromium/tests/CCKeyframedAnimationCurveTest.cpp
+++ b/Source/WebKit/chromium/tests/CCKeyframedAnimationCurveTest.cpp
@@ -24,7 +24,7 @@
#include "config.h"
-#include "cc/CCKeyframedAnimationCurve.h"
+#include "CCKeyframedAnimationCurve.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/Source/WebKit/chromium/tests/CCLayerAnimationControllerTest.cpp b/Source/WebKit/chromium/tests/CCLayerAnimationControllerTest.cpp
index 2ce33a561..80e120f84 100644
--- a/Source/WebKit/chromium/tests/CCLayerAnimationControllerTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerAnimationControllerTest.cpp
@@ -24,12 +24,11 @@
#include "config.h"
-#include "cc/CCLayerAnimationController.h"
+#include "CCLayerAnimationController.h"
+#include "CCActiveAnimation.h"
+#include "CCAnimationCurve.h"
#include "CCAnimationTestCommon.h"
-#include "cc/CCActiveAnimation.h"
-#include "cc/CCAnimationCurve.h"
-
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <public/WebTransformationMatrix.h>
diff --git a/Source/WebKit/chromium/tests/CCLayerImplTest.cpp b/Source/WebKit/chromium/tests/CCLayerImplTest.cpp
index 27c4a918a..965a21111 100644
--- a/Source/WebKit/chromium/tests/CCLayerImplTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerImplTest.cpp
@@ -24,9 +24,9 @@
#include "config.h"
-#include "cc/CCLayerImpl.h"
+#include "CCLayerImpl.h"
-#include "cc/CCSingleThreadProxy.h"
+#include "CCSingleThreadProxy.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <public/WebFilterOperation.h>
diff --git a/Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp b/Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp
index b5e226916..a8db3678f 100644
--- a/Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp
@@ -24,10 +24,10 @@
#include "config.h"
-#include "cc/CCLayerIterator.h"
+#include "CCLayerIterator.h"
+#include "CCLayerTreeHostCommon.h"
#include "LayerChromium.h"
-#include "cc/CCLayerTreeHostCommon.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <public/WebTransformationMatrix.h>
diff --git a/Source/WebKit/chromium/tests/CCLayerQuadTest.cpp b/Source/WebKit/chromium/tests/CCLayerQuadTest.cpp
index ece2420e4..59bf8eec2 100644
--- a/Source/WebKit/chromium/tests/CCLayerQuadTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerQuadTest.cpp
@@ -24,7 +24,7 @@
#include "config.h"
-#include "cc/CCLayerQuad.h"
+#include "CCLayerQuad.h"
#include <gtest/gtest.h>
diff --git a/Source/WebKit/chromium/tests/CCLayerSorterTest.cpp b/Source/WebKit/chromium/tests/CCLayerSorterTest.cpp
index 8ffcea24f..b2cb479a8 100644
--- a/Source/WebKit/chromium/tests/CCLayerSorterTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerSorterTest.cpp
@@ -24,11 +24,11 @@
#include "config.h"
-#include "cc/CCLayerSorter.h"
+#include "CCLayerSorter.h"
-#include "cc/CCLayerImpl.h"
-#include "cc/CCMathUtil.h"
-#include "cc/CCSingleThreadProxy.h"
+#include "CCLayerImpl.h"
+#include "CCMathUtil.h"
+#include "CCSingleThreadProxy.h"
#include <gtest/gtest.h>
#include <public/WebTransformationMatrix.h>
diff --git a/Source/WebKit/chromium/tests/CCLayerTestCommon.cpp b/Source/WebKit/chromium/tests/CCLayerTestCommon.cpp
index 6cc4d2c39..b2b6df568 100644
--- a/Source/WebKit/chromium/tests/CCLayerTestCommon.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerTestCommon.cpp
@@ -25,7 +25,7 @@
#include "config.h"
#include "CCLayerTestCommon.h"
-#include "cc/CCDrawQuad.h"
+#include "CCDrawQuad.h"
#include <gtest/gtest.h>
#include <wtf/Vector.h>
diff --git a/Source/WebKit/chromium/tests/CCLayerTestCommon.h b/Source/WebKit/chromium/tests/CCLayerTestCommon.h
index 052d44bc9..8b048b7d5 100644
--- a/Source/WebKit/chromium/tests/CCLayerTestCommon.h
+++ b/Source/WebKit/chromium/tests/CCLayerTestCommon.h
@@ -25,9 +25,9 @@
#ifndef CCLayerTestCommon_h
#define CCLayerTestCommon_h
+#include "CCRenderPass.h"
#include "IntRect.h"
#include "Region.h"
-#include "cc/CCRenderPass.h"
namespace CCLayerTestCommon {
diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp
index 9fd226858..ac04b505e 100644
--- a/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp
@@ -24,19 +24,19 @@
#include "config.h"
-#include "cc/CCLayerTreeHostCommon.h"
+#include "CCLayerTreeHostCommon.h"
#include "CCAnimationTestCommon.h"
+#include "CCLayerAnimationController.h"
+#include "CCLayerImpl.h"
+#include "CCLayerSorter.h"
#include "CCLayerTreeTestCommon.h"
+#include "CCMathUtil.h"
+#include "CCProxy.h"
+#include "CCSingleThreadProxy.h"
+#include "CCThread.h"
#include "ContentLayerChromium.h"
#include "LayerChromium.h"
-#include "cc/CCLayerAnimationController.h"
-#include "cc/CCLayerImpl.h"
-#include "cc/CCLayerSorter.h"
-#include "cc/CCMathUtil.h"
-#include "cc/CCProxy.h"
-#include "cc/CCSingleThreadProxy.h"
-#include "cc/CCThread.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
@@ -609,6 +609,36 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForFlatteningLayer)
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildScreenSpaceTransform, grandChild->screenSpaceTransform());
}
+TEST(CCLayerTreeHostCommonTest, verifyTransformsForDegenerateIntermediateLayer)
+{
+ // A layer that is empty in one axis, but not the other, was accidentally skipping a necessary translation.
+ // Without that translation, the coordinate space of the layer's drawTransform is incorrect.
+ //
+ // Normally this isn't a problem, because the layer wouldn't be drawn anyway, but if that layer becomes a renderSurface, then
+ // its drawTransform is implicitly inherited by the rest of the subtree, which then is positioned incorrectly as a result.
+
+ RefPtr<LayerChromium> root = LayerChromium::create();
+ RefPtr<LayerChromium> child = LayerChromium::create();
+ RefPtr<LayerChromiumWithForcedDrawsContent> grandChild = adoptRef(new LayerChromiumWithForcedDrawsContent());
+
+ // The child height is zero, but has non-zero width that should be accounted for while computing drawTransforms.
+ const WebTransformationMatrix identityMatrix;
+ setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(100, 100), false);
+ setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 0), false);
+ setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
+
+ root->addChild(child);
+ child->addChild(grandChild);
+ child->setForceRenderSurface(true);
+
+ executeCalculateDrawTransformsAndVisibility(root.get());
+
+ ASSERT_TRUE(child->renderSurface());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, child->renderSurface()->drawTransform()); // This is the real test, the rest are sanity checks.
+ EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, child->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, grandChild->drawTransform());
+}
+
TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceListForRenderSurfaceWithClippedLayer)
{
RefPtr<LayerChromium> parent = LayerChromium::create();
diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
index 2c14a1cc3..6ec0ce5d7 100644
--- a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
@@ -24,30 +24,30 @@
#include "config.h"
-#include "cc/CCLayerTreeHostImpl.h"
+#include "CCLayerTreeHostImpl.h"
#include "CCAnimationTestCommon.h"
+#include "CCHeadsUpDisplayLayerImpl.h"
+#include "CCIOSurfaceLayerImpl.h"
+#include "CCLayerImpl.h"
#include "CCLayerTestCommon.h"
+#include "CCLayerTilingData.h"
#include "CCLayerTreeTestCommon.h"
+#include "CCQuadCuller.h"
+#include "CCRenderPassDrawQuad.h"
+#include "CCScrollbarLayerImpl.h"
+#include "CCSettings.h"
+#include "CCSingleThreadProxy.h"
+#include "CCSolidColorDrawQuad.h"
#include "CCTestCommon.h"
+#include "CCTextureLayerImpl.h"
+#include "CCTileDrawQuad.h"
+#include "CCTiledLayerImpl.h"
+#include "CCVideoLayerImpl.h"
#include "FakeWebCompositorOutputSurface.h"
#include "FakeWebGraphicsContext3D.h"
#include "FakeWebScrollbarThemeGeometry.h"
#include "LayerRendererChromium.h"
-#include "cc/CCHeadsUpDisplayLayerImpl.h"
-#include "cc/CCIOSurfaceLayerImpl.h"
-#include "cc/CCLayerImpl.h"
-#include "cc/CCLayerTilingData.h"
-#include "cc/CCQuadCuller.h"
-#include "cc/CCRenderPassDrawQuad.h"
-#include "cc/CCScrollbarLayerImpl.h"
-#include "cc/CCSettings.h"
-#include "cc/CCSingleThreadProxy.h"
-#include "cc/CCSolidColorDrawQuad.h"
-#include "cc/CCTextureLayerImpl.h"
-#include "cc/CCTileDrawQuad.h"
-#include "cc/CCTiledLayerImpl.h"
-#include "cc/CCVideoLayerImpl.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <public/WebVideoFrame.h>
@@ -154,12 +154,11 @@ public:
m_hostImpl->setRootLayer(root.release());
}
- static PassOwnPtr<CCLayerImpl> createScrollableLayer(int id, const FloatPoint& position, const IntSize& size)
+ static PassOwnPtr<CCLayerImpl> createScrollableLayer(int id, const IntSize& size)
{
OwnPtr<CCLayerImpl> layer = CCLayerImpl::create(id);
layer->setScrollable(true);
layer->setDrawsContent(true);
- layer->setPosition(position);
layer->setBounds(size);
layer->setContentBounds(size);
layer->setMaxScrollPosition(IntSize(size.width() * 2, size.height() * 2));
@@ -190,6 +189,11 @@ protected:
CCScopedSettings m_scopedSettings;
};
+class FakeWebGraphicsContext3DMakeCurrentFails : public FakeWebGraphicsContext3D {
+public:
+ virtual bool makeContextCurrent() { return false; }
+};
+
TEST_F(CCLayerTreeHostImplTest, scrollDeltaNoLayers)
{
ASSERT_FALSE(m_hostImpl->rootLayer());
@@ -264,7 +268,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollRootCallsCommitAndRedraw)
initializeLayerRendererAndDrawFrame();
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
- m_hostImpl->scrollBy(IntSize(0, 10));
+ m_hostImpl->scrollBy(IntPoint(), IntSize(0, 10));
m_hostImpl->scrollEnd();
EXPECT_TRUE(m_didRequestRedraw);
EXPECT_TRUE(m_didRequestCommit);
@@ -276,6 +280,21 @@ TEST_F(CCLayerTreeHostImplTest, scrollWithoutRootLayer)
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollIgnored);
}
+TEST_F(CCLayerTreeHostImplTest, scrollWithoutRenderer)
+{
+ CCLayerTreeSettings settings;
+ m_hostImpl = CCLayerTreeHostImpl::create(settings, this);
+
+ // Initialization will fail here.
+ m_hostImpl->initializeLayerRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails)), UnthrottledUploader);
+ m_hostImpl->setViewportSize(IntSize(10, 10), IntSize(10, 10));
+
+ setupScrollAndContentsLayers(IntSize(100, 100));
+
+ // We should not crash when trying to scroll after the renderer initialization fails.
+ EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollIgnored);
+}
+
TEST_F(CCLayerTreeHostImplTest, replaceTreeWhileScrolling)
{
const int scrollLayerId = 1;
@@ -292,7 +311,7 @@ TEST_F(CCLayerTreeHostImplTest, replaceTreeWhileScrolling)
// We should still be scrolling, because the scrolled layer also exists in the new tree.
IntSize scrollDelta(0, 10);
- m_hostImpl->scrollBy(scrollDelta);
+ m_hostImpl->scrollBy(IntPoint(), scrollDelta);
m_hostImpl->scrollEnd();
OwnPtr<CCScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDeltas();
expectContains(*scrollInfo, scrollLayerId, scrollDelta);
@@ -354,10 +373,10 @@ TEST_F(CCLayerTreeHostImplTest, nonFastScrollableRegionBasic)
// All scroll types outside this region should succeed.
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(75, 75), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
- m_hostImpl->scrollBy(IntSize(0, 10));
+ m_hostImpl->scrollBy(IntPoint(), IntSize(0, 10));
m_hostImpl->scrollEnd();
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(75, 75), CCInputHandlerClient::Gesture), CCInputHandlerClient::ScrollStarted);
- m_hostImpl->scrollBy(IntSize(0, 10));
+ m_hostImpl->scrollBy(IntPoint(), IntSize(0, 10));
m_hostImpl->scrollEnd();
}
@@ -373,7 +392,7 @@ TEST_F(CCLayerTreeHostImplTest, nonFastScrollableRegionWithOffset)
// This point would fall into the non-fast scrollable region except that we've moved the layer down by 25 pixels.
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(40, 10), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
- m_hostImpl->scrollBy(IntSize(0, 1));
+ m_hostImpl->scrollBy(IntPoint(), IntSize(0, 1));
m_hostImpl->scrollEnd();
// This point is still inside the non-fast region.
@@ -595,7 +614,7 @@ TEST_F(CCLayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhileAnimatingPa
// Scrolling during the animation is ignored.
const IntSize scrollDelta(0, 10);
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(25, 25), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
- m_hostImpl->scrollBy(scrollDelta);
+ m_hostImpl->scrollBy(IntPoint(), scrollDelta);
m_hostImpl->scrollEnd();
// The final page scale and scroll deltas should match what we got
@@ -866,7 +885,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollNonCompositedRoot)
initializeLayerRendererAndDrawFrame();
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
- m_hostImpl->scrollBy(IntSize(0, 10));
+ m_hostImpl->scrollBy(IntPoint(), IntSize(0, 10));
m_hostImpl->scrollEnd();
EXPECT_TRUE(m_didRequestRedraw);
EXPECT_TRUE(m_didRequestCommit);
@@ -878,13 +897,13 @@ TEST_F(CCLayerTreeHostImplTest, scrollChildCallsCommitAndRedraw)
OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
root->setBounds(surfaceSize);
root->setContentBounds(surfaceSize);
- root->addChild(createScrollableLayer(2, FloatPoint(0, 0), surfaceSize));
+ root->addChild(createScrollableLayer(2, surfaceSize));
m_hostImpl->setRootLayer(root.release());
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeLayerRendererAndDrawFrame();
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
- m_hostImpl->scrollBy(IntSize(0, 10));
+ m_hostImpl->scrollBy(IntPoint(), IntSize(0, 10));
m_hostImpl->scrollEnd();
EXPECT_TRUE(m_didRequestRedraw);
EXPECT_TRUE(m_didRequestCommit);
@@ -894,7 +913,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollMissesChild)
{
IntSize surfaceSize(10, 10);
OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
- root->addChild(createScrollableLayer(2, FloatPoint(0, 0), surfaceSize));
+ root->addChild(createScrollableLayer(2, surfaceSize));
m_hostImpl->setRootLayer(root.release());
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeLayerRendererAndDrawFrame();
@@ -909,7 +928,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollMissesBackfacingChild)
{
IntSize surfaceSize(10, 10);
OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
- OwnPtr<CCLayerImpl> child = createScrollableLayer(2, FloatPoint(0, 0), surfaceSize);
+ OwnPtr<CCLayerImpl> child = createScrollableLayer(2, surfaceSize);
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
WebTransformationMatrix matrix;
@@ -931,11 +950,11 @@ TEST_F(CCLayerTreeHostImplTest, scrollMissesBackfacingChild)
TEST_F(CCLayerTreeHostImplTest, scrollBlockedByContentLayer)
{
IntSize surfaceSize(10, 10);
- OwnPtr<CCLayerImpl> contentLayer = createScrollableLayer(1, FloatPoint(0, 0), surfaceSize);
+ OwnPtr<CCLayerImpl> contentLayer = createScrollableLayer(1, surfaceSize);
contentLayer->setShouldScrollOnMainThread(true);
contentLayer->setScrollable(false);
- OwnPtr<CCLayerImpl> scrollLayer = createScrollableLayer(2, FloatPoint(0, 0), surfaceSize);
+ OwnPtr<CCLayerImpl> scrollLayer = createScrollableLayer(2, surfaceSize);
scrollLayer->addChild(contentLayer.release());
m_hostImpl->setRootLayer(scrollLayer.release());
@@ -950,7 +969,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollRootAndChangePageScaleOnMainThread)
{
IntSize surfaceSize(10, 10);
float pageScale = 2;
- OwnPtr<CCLayerImpl> root = createScrollableLayer(1, FloatPoint(0, 0), surfaceSize);
+ OwnPtr<CCLayerImpl> root = createScrollableLayer(1, surfaceSize);
m_hostImpl->setRootLayer(root.release());
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeLayerRendererAndDrawFrame();
@@ -959,7 +978,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollRootAndChangePageScaleOnMainThread)
IntSize expectedScrollDelta(scrollDelta);
IntSize expectedMaxScroll(m_hostImpl->rootLayer()->maxScrollPosition());
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
- m_hostImpl->scrollBy(scrollDelta);
+ m_hostImpl->scrollBy(IntPoint(), scrollDelta);
m_hostImpl->scrollEnd();
// Set new page scale from main thread.
@@ -981,7 +1000,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollRootAndChangePageScaleOnImplThread)
{
IntSize surfaceSize(10, 10);
float pageScale = 2;
- OwnPtr<CCLayerImpl> root = createScrollableLayer(1, FloatPoint(0, 0), surfaceSize);
+ OwnPtr<CCLayerImpl> root = createScrollableLayer(1, surfaceSize);
m_hostImpl->setRootLayer(root.release());
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
m_hostImpl->setPageScaleFactorAndLimits(1, 1, pageScale);
@@ -991,7 +1010,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollRootAndChangePageScaleOnImplThread)
IntSize expectedScrollDelta(scrollDelta);
IntSize expectedMaxScroll(m_hostImpl->rootLayer()->maxScrollPosition());
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
- m_hostImpl->scrollBy(scrollDelta);
+ m_hostImpl->scrollBy(IntPoint(), scrollDelta);
m_hostImpl->scrollEnd();
// Set new page scale on impl thread by pinching.
@@ -1021,7 +1040,7 @@ TEST_F(CCLayerTreeHostImplTest, pageScaleDeltaAppliedToRootScrollLayerOnly)
CCLayerImpl* root = m_hostImpl->rootLayer();
CCLayerImpl* child = root->children()[0].get();
- OwnPtr<CCLayerImpl> scrollableChild = createScrollableLayer(3, FloatPoint(0, 0), surfaceSize);
+ OwnPtr<CCLayerImpl> scrollableChild = createScrollableLayer(3, surfaceSize);
child->addChild(scrollableChild.release());
CCLayerImpl* grandChild = child->children()[0].get();
@@ -1059,7 +1078,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollChildAndChangePageScaleOnMainThread)
// Also mark the root scrollable so it becomes the root scroll layer.
root->setScrollable(true);
int scrollLayerId = 2;
- root->addChild(createScrollableLayer(scrollLayerId, FloatPoint(0, 0), surfaceSize));
+ root->addChild(createScrollableLayer(scrollLayerId, surfaceSize));
m_hostImpl->setRootLayer(root.release());
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeLayerRendererAndDrawFrame();
@@ -1070,7 +1089,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollChildAndChangePageScaleOnMainThread)
IntSize expectedScrollDelta(scrollDelta);
IntSize expectedMaxScroll(child->maxScrollPosition());
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
- m_hostImpl->scrollBy(scrollDelta);
+ m_hostImpl->scrollBy(IntPoint(), scrollDelta);
m_hostImpl->scrollEnd();
float pageScale = 2;
@@ -1094,12 +1113,12 @@ TEST_F(CCLayerTreeHostImplTest, scrollChildBeyondLimit)
// parent layer is scrolled on the axis on which the child was unable to
// scroll.
IntSize surfaceSize(10, 10);
- OwnPtr<CCLayerImpl> root = createScrollableLayer(1, FloatPoint(0, 0), surfaceSize);
+ OwnPtr<CCLayerImpl> root = createScrollableLayer(1, surfaceSize);
- OwnPtr<CCLayerImpl> grandChild = createScrollableLayer(3, FloatPoint(0, 0), surfaceSize);
+ OwnPtr<CCLayerImpl> grandChild = createScrollableLayer(3, surfaceSize);
grandChild->setScrollPosition(IntPoint(0, 5));
- OwnPtr<CCLayerImpl> child = createScrollableLayer(2, FloatPoint(0, 0), surfaceSize);
+ OwnPtr<CCLayerImpl> child = createScrollableLayer(2, surfaceSize);
child->setScrollPosition(IntPoint(3, 0));
child->addChild(grandChild.release());
@@ -1108,9 +1127,9 @@ TEST_F(CCLayerTreeHostImplTest, scrollChildBeyondLimit)
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeLayerRendererAndDrawFrame();
{
- IntSize scrollDelta(-3, -7);
+ IntSize scrollDelta(-8, -7);
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
- m_hostImpl->scrollBy(scrollDelta);
+ m_hostImpl->scrollBy(IntPoint(), scrollDelta);
m_hostImpl->scrollEnd();
OwnPtr<CCScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDeltas();
@@ -1130,8 +1149,8 @@ TEST_F(CCLayerTreeHostImplTest, scrollEventBubbling)
// When we try to scroll a non-scrollable child layer, the scroll delta
// should be applied to one of its ancestors if possible.
IntSize surfaceSize(10, 10);
- OwnPtr<CCLayerImpl> root = createScrollableLayer(1, FloatPoint(0, 0), surfaceSize);
- OwnPtr<CCLayerImpl> child = createScrollableLayer(2, FloatPoint(0, 0), surfaceSize);
+ OwnPtr<CCLayerImpl> root = createScrollableLayer(1, surfaceSize);
+ OwnPtr<CCLayerImpl> child = createScrollableLayer(2, surfaceSize);
child->setScrollable(false);
root->addChild(child.release());
@@ -1142,7 +1161,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollEventBubbling)
{
IntSize scrollDelta(0, 4);
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
- m_hostImpl->scrollBy(scrollDelta);
+ m_hostImpl->scrollBy(IntPoint(), scrollDelta);
m_hostImpl->scrollEnd();
OwnPtr<CCScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDeltas();
@@ -1156,18 +1175,150 @@ TEST_F(CCLayerTreeHostImplTest, scrollEventBubbling)
TEST_F(CCLayerTreeHostImplTest, scrollBeforeRedraw)
{
IntSize surfaceSize(10, 10);
- m_hostImpl->setRootLayer(createScrollableLayer(1, FloatPoint(0, 0), surfaceSize));
+ m_hostImpl->setRootLayer(createScrollableLayer(1, surfaceSize));
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
// Draw one frame and then immediately rebuild the layer tree to mimic a tree synchronization.
initializeLayerRendererAndDrawFrame();
m_hostImpl->detachLayerTree();
- m_hostImpl->setRootLayer(createScrollableLayer(2, FloatPoint(0, 0), surfaceSize));
+ m_hostImpl->setRootLayer(createScrollableLayer(2, surfaceSize));
// Scrolling should still work even though we did not draw yet.
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
}
+TEST_F(CCLayerTreeHostImplTest, scrollAxisAlignedRotatedLayer)
+{
+ setupScrollAndContentsLayers(IntSize(100, 100));
+
+ // Rotate the root layer 90 degrees counter-clockwise about its center.
+ WebTransformationMatrix rotateTransform;
+ rotateTransform.rotate(-90);
+ m_hostImpl->rootLayer()->setTransform(rotateTransform);
+
+ IntSize surfaceSize(50, 50);
+ m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
+ initializeLayerRendererAndDrawFrame();
+
+ // Scroll to the right in screen coordinates with a gesture.
+ IntSize gestureScrollDelta(10, 0);
+ EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Gesture), CCInputHandlerClient::ScrollStarted);
+ m_hostImpl->scrollBy(IntPoint(), gestureScrollDelta);
+ m_hostImpl->scrollEnd();
+
+ // The layer should have scrolled down in its local coordinates.
+ OwnPtr<CCScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDeltas();
+ expectContains(*scrollInfo.get(), m_hostImpl->rootLayer()->id(), IntSize(0, gestureScrollDelta.width()));
+
+ // Reset and scroll down with the wheel.
+ m_hostImpl->rootLayer()->setScrollDelta(FloatSize());
+ IntSize wheelScrollDelta(0, 10);
+ EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
+ m_hostImpl->scrollBy(IntPoint(), wheelScrollDelta);
+ m_hostImpl->scrollEnd();
+
+ // The layer should have scrolled down in its local coordinates.
+ scrollInfo = m_hostImpl->processScrollDeltas();
+ expectContains(*scrollInfo.get(), m_hostImpl->rootLayer()->id(), wheelScrollDelta);
+}
+
+TEST_F(CCLayerTreeHostImplTest, scrollNonAxisAlignedRotatedLayer)
+{
+ setupScrollAndContentsLayers(IntSize(100, 100));
+ int childLayerId = 3;
+ float childLayerAngle = -20;
+
+ // Create a child layer that is rotated to a non-axis-aligned angle.
+ OwnPtr<CCLayerImpl> child = createScrollableLayer(childLayerId, m_hostImpl->rootLayer()->contentBounds());
+ WebTransformationMatrix rotateTransform;
+ rotateTransform.translate(-50, -50);
+ rotateTransform.rotate(childLayerAngle);
+ rotateTransform.translate(50, 50);
+ child->setTransform(rotateTransform);
+
+ // Only allow vertical scrolling.
+ child->setMaxScrollPosition(IntSize(0, child->contentBounds().height()));
+ m_hostImpl->rootLayer()->addChild(child.release());
+
+ IntSize surfaceSize(50, 50);
+ m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
+ initializeLayerRendererAndDrawFrame();
+
+ {
+ // Scroll down in screen coordinates with a gesture.
+ IntSize gestureScrollDelta(0, 10);
+ EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Gesture), CCInputHandlerClient::ScrollStarted);
+ m_hostImpl->scrollBy(IntPoint(), gestureScrollDelta);
+ m_hostImpl->scrollEnd();
+
+ // The child layer should have scrolled down in its local coordinates an amount proportional to
+ // the angle between it and the input scroll delta.
+ IntSize expectedScrollDelta(0, gestureScrollDelta.height() * cosf(deg2rad(childLayerAngle)));
+ OwnPtr<CCScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDeltas();
+ expectContains(*scrollInfo.get(), childLayerId, expectedScrollDelta);
+
+ // The root layer should not have scrolled, because the input delta was close to the layer's
+ // axis of movement.
+ EXPECT_EQ(scrollInfo->scrolls.size(), 1u);
+ }
+
+ {
+ // Now reset and scroll the same amount horizontally.
+ m_hostImpl->rootLayer()->children()[1]->setScrollDelta(FloatSize());
+ IntSize gestureScrollDelta(10, 0);
+ EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Gesture), CCInputHandlerClient::ScrollStarted);
+ m_hostImpl->scrollBy(IntPoint(), gestureScrollDelta);
+ m_hostImpl->scrollEnd();
+
+ // The child layer should have scrolled down in its local coordinates an amount proportional to
+ // the angle between it and the input scroll delta.
+ IntSize expectedScrollDelta(0, -gestureScrollDelta.width() * sinf(deg2rad(childLayerAngle)));
+ OwnPtr<CCScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDeltas();
+ expectContains(*scrollInfo.get(), childLayerId, expectedScrollDelta);
+
+ // The root layer should have scrolled more, since the input scroll delta was mostly
+ // orthogonal to the child layer's vertical scroll axis.
+ IntSize expectedRootScrollDelta(gestureScrollDelta.width() * pow(cosf(deg2rad(childLayerAngle)), 2), 0);
+ expectContains(*scrollInfo.get(), m_hostImpl->rootLayer()->id(), expectedRootScrollDelta);
+ }
+}
+
+TEST_F(CCLayerTreeHostImplTest, scrollScaledLayer)
+{
+ setupScrollAndContentsLayers(IntSize(100, 100));
+
+ // Scale the layer to twice its normal size.
+ int scale = 2;
+ WebTransformationMatrix scaleTransform;
+ scaleTransform.scale(scale);
+ m_hostImpl->rootLayer()->setTransform(scaleTransform);
+
+ IntSize surfaceSize(50, 50);
+ m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
+ initializeLayerRendererAndDrawFrame();
+
+ // Scroll down in screen coordinates with a gesture.
+ IntSize scrollDelta(0, 10);
+ EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Gesture), CCInputHandlerClient::ScrollStarted);
+ m_hostImpl->scrollBy(IntPoint(), scrollDelta);
+ m_hostImpl->scrollEnd();
+
+ // The layer should have scrolled down in its local coordinates, but half he amount.
+ OwnPtr<CCScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDeltas();
+ expectContains(*scrollInfo.get(), m_hostImpl->rootLayer()->id(), IntSize(0, scrollDelta.height() / scale));
+
+ // Reset and scroll down with the wheel.
+ m_hostImpl->rootLayer()->setScrollDelta(FloatSize());
+ IntSize wheelScrollDelta(0, 10);
+ EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
+ m_hostImpl->scrollBy(IntPoint(), wheelScrollDelta);
+ m_hostImpl->scrollEnd();
+
+ // The scale should not have been applied to the scroll delta.
+ scrollInfo = m_hostImpl->processScrollDeltas();
+ expectContains(*scrollInfo.get(), m_hostImpl->rootLayer()->id(), wheelScrollDelta);
+}
+
class BlendStateTrackerContext: public FakeWebGraphicsContext3D {
public:
BlendStateTrackerContext() : m_blend(false) { }
@@ -1840,7 +1991,7 @@ TEST_F(CCLayerTreeHostImplTest, noPartialSwap)
MockContextHarness harness(mockContext);
harness.mustDrawSolidQuad();
- harness.mustSetNoScissor();
+ harness.mustSetScissor(0, 0, 10, 10);
// Run test case
OwnPtr<CCLayerTreeHostImpl> myHostImpl = createLayerTreeHost(false, context.release(), FakeLayerWithQuads::create(1));
@@ -1861,7 +2012,7 @@ TEST_F(CCLayerTreeHostImplTest, partialSwap)
OwnPtr<CCLayerTreeHostImpl> myHostImpl = createLayerTreeHost(true, context.release(), FakeLayerWithQuads::create(1));
// The first frame is not a partially-swapped one.
- harness.mustSetNoScissor();
+ harness.mustSetScissor(0, 0, 10, 10);
harness.mustDrawSolidQuad();
{
CCLayerTreeHostImpl::FrameData frame;
@@ -2062,13 +2213,11 @@ TEST_F(CCLayerTreeHostImplTest, contextLostAndRestoredNotificationSentToAllLayer
EXPECT_TRUE(layer2->didLoseContextCalled());
}
-class FakeWebGraphicsContext3DMakeCurrentFails : public FakeWebGraphicsContext3D {
-public:
- virtual bool makeContextCurrent() { return false; }
-};
-
TEST_F(CCLayerTreeHostImplTest, finishAllRenderingAfterContextLost)
{
+ CCLayerTreeSettings settings;
+ m_hostImpl = CCLayerTreeHostImpl::create(settings, this);
+
// The context initialization will fail, but we should still be able to call finishAllRendering() without any ill effects.
m_hostImpl->initializeLayerRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails)), UnthrottledUploader);
m_hostImpl->finishAllRendering();
diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
index 137e6249a..5202208b9 100644
--- a/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
@@ -24,16 +24,16 @@
#include "config.h"
-#include "cc/CCLayerTreeHost.h"
+#include "CCLayerTreeHost.h"
+#include "CCGraphicsContext.h"
+#include "CCLayerTreeHostImpl.h"
#include "CCOcclusionTrackerTestCommon.h"
+#include "CCSettings.h"
+#include "CCTextureUpdateQueue.h"
#include "CCThreadedTest.h"
+#include "CCTimingFunction.h"
#include "ContentLayerChromium.h"
-#include "cc/CCGraphicsContext.h"
-#include "cc/CCLayerTreeHostImpl.h"
-#include "cc/CCSettings.h"
-#include "cc/CCTextureUpdateQueue.h"
-#include "cc/CCTimingFunction.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <public/Platform.h>
@@ -2221,7 +2221,7 @@ public:
{
if (impl->sourceAnimationFrameNumber() == 1) {
EXPECT_EQ(impl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
- impl->scrollBy(m_scrollAmount);
+ impl->scrollBy(IntPoint(), m_scrollAmount);
impl->scrollEnd();
} else if (impl->sourceAnimationFrameNumber() == 2)
endTest();
@@ -2347,4 +2347,251 @@ private:
SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit)
+
+class EvictionTrackingTexture : public LayerTextureUpdater::Texture {
+public:
+ static PassOwnPtr<EvictionTrackingTexture> create(PassOwnPtr<CCPrioritizedTexture> texture) { return adoptPtr(new EvictionTrackingTexture(texture)); }
+ virtual ~EvictionTrackingTexture() { }
+
+ virtual void updateRect(CCResourceProvider* resourceProvider, const IntRect&, const IntSize&) OVERRIDE
+ {
+ ASSERT_TRUE(!texture()->haveBackingTexture() || resourceProvider->numResources() > 0);
+ texture()->acquireBackingTexture(resourceProvider);
+ m_updated = true;
+ }
+ void resetUpdated() { m_updated = false; }
+ bool updated() const { return m_updated; }
+
+private:
+ explicit EvictionTrackingTexture(PassOwnPtr<CCPrioritizedTexture> texture)
+ : LayerTextureUpdater::Texture(texture)
+ , m_updated(false)
+ { }
+ bool m_updated;
+};
+
+class EvictionTestLayer : public LayerChromium {
+public:
+ static PassRefPtr<EvictionTestLayer> create() { return adoptRef(new EvictionTestLayer()); }
+
+ virtual void update(CCTextureUpdateQueue&, const CCOcclusionTracker*, CCRenderingStats&) OVERRIDE;
+ virtual bool drawsContent() const OVERRIDE { return true; }
+
+ virtual PassOwnPtr<CCLayerImpl> createCCLayerImpl() OVERRIDE;
+ virtual void pushPropertiesTo(CCLayerImpl*) OVERRIDE;
+ virtual void setTexturePriorities(const CCPriorityCalculator&) OVERRIDE;
+
+ void resetUpdated()
+ {
+ if (m_texture.get())
+ m_texture->resetUpdated();
+ }
+ bool updated() const { return m_texture.get() ? m_texture->updated() : false; }
+
+private:
+ EvictionTestLayer() : LayerChromium() { }
+
+ void createTextureIfNeeded()
+ {
+ if (m_texture.get())
+ return;
+ m_texture = EvictionTrackingTexture::create(CCPrioritizedTexture::create(layerTreeHost()->contentsTextureManager()));
+ m_texture->texture()->setDimensions(WebCore::IntSize(10, 10), WebCore::GraphicsContext3D::RGBA);
+ }
+
+ OwnPtr<EvictionTrackingTexture> m_texture;
+};
+
+class EvictionTestLayerImpl : public CCLayerImpl {
+public:
+ static PassOwnPtr<EvictionTestLayerImpl> create(int id)
+ {
+ return adoptPtr(new EvictionTestLayerImpl(id));
+ }
+ virtual ~EvictionTestLayerImpl() { }
+ virtual void appendQuads(CCQuadSink&, const CCSharedQuadState*, bool& hadMissingTiles)
+ {
+ ASSERT_TRUE(m_hasTexture);
+ ASSERT_NE(0u, layerTreeHostImpl()->resourceProvider()->numResources());
+ }
+ void setHasTexture(bool hasTexture) { m_hasTexture = hasTexture; }
+
+private:
+ explicit EvictionTestLayerImpl(int id)
+ : CCLayerImpl(id)
+ , m_hasTexture(false) { }
+
+ bool m_hasTexture;
+};
+
+void EvictionTestLayer::setTexturePriorities(const CCPriorityCalculator&)
+{
+ createTextureIfNeeded();
+ if (!m_texture.get())
+ return;
+ m_texture->texture()->setRequestPriority(CCPriorityCalculator::uiPriority(true));
+}
+
+void EvictionTestLayer::update(CCTextureUpdateQueue& queue, const CCOcclusionTracker*, CCRenderingStats&)
+{
+ createTextureIfNeeded();
+ if (!m_texture.get())
+ return;
+ IntRect fullRect(0, 0, 10, 10);
+ TextureUploader::Parameters parameters = { m_texture.get(), fullRect, IntSize() };
+ queue.appendFullUpload(parameters);
+}
+
+PassOwnPtr<CCLayerImpl> EvictionTestLayer::createCCLayerImpl()
+{
+ return EvictionTestLayerImpl::create(m_layerId);
+}
+
+void EvictionTestLayer::pushPropertiesTo(CCLayerImpl* layerImpl)
+{
+ LayerChromium::pushPropertiesTo(layerImpl);
+
+ EvictionTestLayerImpl* testLayerImpl = static_cast<EvictionTestLayerImpl*>(layerImpl);
+ testLayerImpl->setHasTexture(m_texture->texture()->haveBackingTexture());
+}
+
+class CCLayerTreeHostTestEvictTextures : public CCLayerTreeHostTest {
+public:
+ CCLayerTreeHostTestEvictTextures()
+ : m_layer(EvictionTestLayer::create())
+ , m_implForEvictTextures(0)
+ , m_numCommits(0)
+ {
+ }
+
+ virtual void beginTest()
+ {
+ m_layerTreeHost->setRootLayer(m_layer);
+ m_layerTreeHost->setViewportSize(IntSize(10, 20), IntSize(10, 20));
+
+ WebTransformationMatrix identityMatrix;
+ setLayerPropertiesForTesting(m_layer.get(), 0, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 20), true);
+ }
+
+ class EvictTexturesTask : public WebKit::WebThread::Task {
+ public:
+ EvictTexturesTask(CCLayerTreeHostTestEvictTextures* test) : m_test(test) { }
+ virtual ~EvictTexturesTask() { }
+ virtual void run()
+ {
+ ASSERT(m_test->m_implForEvictTextures);
+ m_test->m_implForEvictTextures->releaseContentsTextures();
+ }
+
+ private:
+ CCLayerTreeHostTestEvictTextures* m_test;
+ };
+
+ void postEvictTextures()
+ {
+ ASSERT(webThread());
+ webThread()->postTask(new EvictTexturesTask(this));
+ }
+
+ // Commit 1: Just commit and draw normally, then post an eviction at the end
+ // that will trigger a commit.
+ // Commit 2: Triggered by the eviction, let it go through and then set
+ // needsCommit.
+ // Commit 3: Triggered by the setNeedsCommit. In layout(), post an eviction
+ // task, which will be handled before the commit. Don't set needsCommit, it
+ // should have been posted. A frame should not be drawn (note,
+ // didCommitAndDrawFrame may be called anyway).
+ // Commit 4: Triggered by the eviction, let it go through and then set
+ // needsCommit.
+ // Commit 5: Triggered by the setNeedsCommit, post an eviction task in
+ // layout(), a frame should not be drawn but a commit will be posted.
+ // Commit 6: Triggered by the eviction, post an eviction task in
+ // layout(), which will be a noop, letting the commit (which recreates the
+ // textures) go through and draw a frame, then end the test.
+ //
+ // Commits 1+2 test the eviction recovery path where eviction happens outside
+ // of the beginFrame/commit pair.
+ // Commits 3+4 test the eviction recovery path where eviction happens inside
+ // the beginFrame/commit pair.
+ // Commits 5+6 test the path where an eviction happens during the eviction
+ // recovery path.
+ virtual void didCommitAndDrawFrame()
+ {
+ switch (m_numCommits) {
+ case 1:
+ EXPECT_TRUE(m_layer->updated());
+ postEvictTextures();
+ break;
+ case 2:
+ EXPECT_TRUE(m_layer->updated());
+ m_layerTreeHost->setNeedsCommit();
+ break;
+ case 3:
+ break;
+ case 4:
+ EXPECT_TRUE(m_layer->updated());
+ m_layerTreeHost->setNeedsCommit();
+ break;
+ case 5:
+ break;
+ case 6:
+ EXPECT_TRUE(m_layer->updated());
+ endTest();
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ }
+
+ virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl)
+ {
+ m_implForEvictTextures = impl;
+ }
+
+ virtual void layout()
+ {
+ ++m_numCommits;
+ switch (m_numCommits) {
+ case 1:
+ case 2:
+ break;
+ case 3:
+ postEvictTextures();
+ break;
+ case 4:
+ // We couldn't check in didCommitAndDrawFrame on commit 3, so check here.
+ EXPECT_FALSE(m_layer->updated());
+ break;
+ case 5:
+ postEvictTextures();
+ break;
+ case 6:
+ // We couldn't check in didCommitAndDrawFrame on commit 5, so check here.
+ EXPECT_FALSE(m_layer->updated());
+ postEvictTextures();
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ m_layer->resetUpdated();
+ }
+
+ virtual void afterTest()
+ {
+ }
+
+private:
+ MockContentLayerDelegate m_delegate;
+ RefPtr<EvictionTestLayer> m_layer;
+ CCLayerTreeHostImpl* m_implForEvictTextures;
+ int m_numCommits;
+};
+
+TEST_F(CCLayerTreeHostTestEvictTextures, runMultiThread)
+{
+ runTest(true);
+}
+
} // namespace
diff --git a/Source/WebKit/chromium/tests/CCMathUtilTest.cpp b/Source/WebKit/chromium/tests/CCMathUtilTest.cpp
index 44a68b9eb..416e1b56d 100644
--- a/Source/WebKit/chromium/tests/CCMathUtilTest.cpp
+++ b/Source/WebKit/chromium/tests/CCMathUtilTest.cpp
@@ -24,7 +24,7 @@
#include "config.h"
-#include "cc/CCMathUtil.h"
+#include "CCMathUtil.h"
#include "CCLayerTreeTestCommon.h"
#include "FloatRect.h"
@@ -152,4 +152,51 @@ TEST(CCMathUtilTest, verifyEnclosingRectOfVerticesUsesCorrectInitialBounds)
EXPECT_FLOAT_RECT_EQ(FloatRect(FloatPoint(-100, -100), FloatSize(90, 90)), result);
}
+TEST(CCMathUtilTest, smallestAngleBetweenVectors)
+{
+ FloatSize x(1, 0);
+ FloatSize y(0, 1);
+ FloatSize testVector(0.5, 0.5);
+
+ // Orthogonal vectors are at an angle of 90 degress.
+ EXPECT_EQ(90, CCMathUtil::smallestAngleBetweenVectors(x, y));
+
+ // A vector makes a zero angle with itself.
+ EXPECT_EQ(0, CCMathUtil::smallestAngleBetweenVectors(x, x));
+ EXPECT_EQ(0, CCMathUtil::smallestAngleBetweenVectors(y, y));
+ EXPECT_EQ(0, CCMathUtil::smallestAngleBetweenVectors(testVector, testVector));
+
+ // Parallel but reversed vectors are at 180 degrees.
+ EXPECT_FLOAT_EQ(180, CCMathUtil::smallestAngleBetweenVectors(x, -x));
+ EXPECT_FLOAT_EQ(180, CCMathUtil::smallestAngleBetweenVectors(y, -y));
+ EXPECT_FLOAT_EQ(180, CCMathUtil::smallestAngleBetweenVectors(testVector, -testVector));
+
+ // The test vector is at a known angle.
+ EXPECT_FLOAT_EQ(45, floor(CCMathUtil::smallestAngleBetweenVectors(testVector, x)));
+ EXPECT_FLOAT_EQ(45, floor(CCMathUtil::smallestAngleBetweenVectors(testVector, y)));
+}
+
+TEST(CCMathUtilTest, vectorProjection)
+{
+ FloatSize x(1, 0);
+ FloatSize y(0, 1);
+ FloatSize testVector(0.3f, 0.7f);
+
+ // Orthogonal vectors project to a zero vector.
+ EXPECT_EQ(FloatSize(0, 0), CCMathUtil::projectVector(x, y));
+ EXPECT_EQ(FloatSize(0, 0), CCMathUtil::projectVector(y, x));
+
+ // Projecting a vector onto the orthonormal basis gives the corresponding component of the
+ // vector.
+ EXPECT_EQ(FloatSize(testVector.width(), 0), CCMathUtil::projectVector(testVector, x));
+ EXPECT_EQ(FloatSize(0, testVector.height()), CCMathUtil::projectVector(testVector, y));
+
+ // Finally check than an arbitrary vector projected to another one gives a vector parallel to
+ // the second vector.
+ FloatSize targetVector(0.5, 0.2f);
+ FloatSize projectedVector = CCMathUtil::projectVector(testVector, targetVector);
+ EXPECT_EQ(projectedVector.width() / targetVector.width(),
+ projectedVector.height() / targetVector.height());
+}
+
} // namespace
diff --git a/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp b/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp
index 9d51c9970..4e5f9dc88 100644
--- a/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp
+++ b/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp
@@ -24,19 +24,19 @@
#include "config.h"
-#include "cc/CCOcclusionTracker.h"
+#include "CCOcclusionTracker.h"
#include "CCAnimationTestCommon.h"
+#include "CCLayerAnimationController.h"
+#include "CCLayerImpl.h"
+#include "CCLayerTreeHostCommon.h"
#include "CCLayerTreeTestCommon.h"
+#include "CCMathUtil.h"
#include "CCOcclusionTrackerTestCommon.h"
+#include "CCOverdrawMetrics.h"
+#include "CCSingleThreadProxy.h"
#include "LayerChromium.h"
#include "Region.h"
-#include "cc/CCLayerAnimationController.h"
-#include "cc/CCLayerImpl.h"
-#include "cc/CCLayerTreeHostCommon.h"
-#include "cc/CCMathUtil.h"
-#include "cc/CCOverdrawMetrics.h"
-#include "cc/CCSingleThreadProxy.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <public/WebFilterOperation.h>
diff --git a/Source/WebKit/chromium/tests/CCOcclusionTrackerTestCommon.h b/Source/WebKit/chromium/tests/CCOcclusionTrackerTestCommon.h
index fcdc3ed6c..cf38c5a33 100644
--- a/Source/WebKit/chromium/tests/CCOcclusionTrackerTestCommon.h
+++ b/Source/WebKit/chromium/tests/CCOcclusionTrackerTestCommon.h
@@ -25,11 +25,11 @@
#ifndef CCOcclusionTrackerTestCommon_h
#define CCOcclusionTrackerTestCommon_h
+#include "CCOcclusionTracker.h"
+#include "CCRenderSurface.h"
#include "IntRect.h"
#include "Region.h"
#include "RenderSurfaceChromium.h"
-#include "cc/CCOcclusionTracker.h"
-#include "cc/CCRenderSurface.h"
namespace WebKitTests {
diff --git a/Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp b/Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp
index 97027095e..4bcaccdc3 100644
--- a/Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp
+++ b/Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp
@@ -24,13 +24,13 @@
#include "config.h"
-#include "cc/CCPrioritizedTexture.h"
+#include "CCPrioritizedTexture.h"
+#include "CCPrioritizedTextureManager.h"
+#include "CCSingleThreadProxy.h" // For DebugScopedSetImplThread
+#include "CCTexture.h"
#include "CCTiledLayerTestCommon.h"
#include "FakeCCGraphicsContext.h"
-#include "cc/CCPrioritizedTextureManager.h"
-#include "cc/CCSingleThreadProxy.h" // For DebugScopedSetImplThread
-#include "cc/CCTexture.h"
#include <gtest/gtest.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp b/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp
index 8279a3a6b..f732cdc68 100644
--- a/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp
+++ b/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp
@@ -24,15 +24,15 @@
#include "config.h"
-#include "cc/CCQuadCuller.h"
-
-#include "cc/CCLayerTilingData.h"
-#include "cc/CCMathUtil.h"
-#include "cc/CCOcclusionTracker.h"
-#include "cc/CCOverdrawMetrics.h"
-#include "cc/CCSingleThreadProxy.h"
-#include "cc/CCTiledLayerImpl.h"
-#include "cc/CCTileDrawQuad.h"
+#include "CCQuadCuller.h"
+
+#include "CCLayerTilingData.h"
+#include "CCMathUtil.h"
+#include "CCOcclusionTracker.h"
+#include "CCOverdrawMetrics.h"
+#include "CCSingleThreadProxy.h"
+#include "CCTileDrawQuad.h"
+#include "CCTiledLayerImpl.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <public/WebTransformationMatrix.h>
diff --git a/Source/WebKit/chromium/tests/CCRenderSurfaceFiltersTest.cpp b/Source/WebKit/chromium/tests/CCRenderSurfaceFiltersTest.cpp
index b56a7fb42..1b56c20ec 100644
--- a/Source/WebKit/chromium/tests/CCRenderSurfaceFiltersTest.cpp
+++ b/Source/WebKit/chromium/tests/CCRenderSurfaceFiltersTest.cpp
@@ -24,7 +24,7 @@
#include "config.h"
-#include "cc/CCRenderSurfaceFilters.h"
+#include "CCRenderSurfaceFilters.h"
#include "CompositorFakeWebGraphicsContext3D.h"
#include <gtest/gtest.h>
@@ -52,27 +52,30 @@ TEST(CCRenderSurfaceFiltersTest, testColorMatrixFiltersCombined)
// Several filters should always combine for any amount between 0 and 1:
// grayscale, saturate, invert, contrast, opacity.
EXPECT_TRUE(isCombined(WebFilterOperation::createGrayscaleFilter(0)));
- EXPECT_TRUE(isCombined(WebFilterOperation::createGrayscaleFilter(0.3)));
+ // Note that we use 0.3f to avoid "argument is truncated from 'double' to
+ // 'float'" warnings on Windows. 0.5 is exactly representable as a float, so
+ // there is no warning.
+ EXPECT_TRUE(isCombined(WebFilterOperation::createGrayscaleFilter(0.3f)));
EXPECT_TRUE(isCombined(WebFilterOperation::createGrayscaleFilter(0.5)));
EXPECT_TRUE(isCombined(WebFilterOperation::createGrayscaleFilter(1)));
EXPECT_TRUE(isCombined(WebFilterOperation::createSaturateFilter(0)));
- EXPECT_TRUE(isCombined(WebFilterOperation::createSaturateFilter(0.3)));
+ EXPECT_TRUE(isCombined(WebFilterOperation::createSaturateFilter(0.3f)));
EXPECT_TRUE(isCombined(WebFilterOperation::createSaturateFilter(0.5)));
EXPECT_TRUE(isCombined(WebFilterOperation::createSaturateFilter(1)));
EXPECT_TRUE(isCombined(WebFilterOperation::createInvertFilter(0)));
- EXPECT_TRUE(isCombined(WebFilterOperation::createInvertFilter(0.3)));
+ EXPECT_TRUE(isCombined(WebFilterOperation::createInvertFilter(0.3f)));
EXPECT_TRUE(isCombined(WebFilterOperation::createInvertFilter(0.5)));
EXPECT_TRUE(isCombined(WebFilterOperation::createInvertFilter(1)));
EXPECT_TRUE(isCombined(WebFilterOperation::createContrastFilter(0)));
- EXPECT_TRUE(isCombined(WebFilterOperation::createContrastFilter(0.3)));
+ EXPECT_TRUE(isCombined(WebFilterOperation::createContrastFilter(0.3f)));
EXPECT_TRUE(isCombined(WebFilterOperation::createContrastFilter(0.5)));
EXPECT_TRUE(isCombined(WebFilterOperation::createContrastFilter(1)));
EXPECT_TRUE(isCombined(WebFilterOperation::createOpacityFilter(0)));
- EXPECT_TRUE(isCombined(WebFilterOperation::createOpacityFilter(0.3)));
+ EXPECT_TRUE(isCombined(WebFilterOperation::createOpacityFilter(0.3f)));
EXPECT_TRUE(isCombined(WebFilterOperation::createOpacityFilter(0.5)));
EXPECT_TRUE(isCombined(WebFilterOperation::createOpacityFilter(1)));
diff --git a/Source/WebKit/chromium/tests/CCRenderSurfaceTest.cpp b/Source/WebKit/chromium/tests/CCRenderSurfaceTest.cpp
index ad8df2595..a6a422e32 100644
--- a/Source/WebKit/chromium/tests/CCRenderSurfaceTest.cpp
+++ b/Source/WebKit/chromium/tests/CCRenderSurfaceTest.cpp
@@ -24,11 +24,11 @@
#include "config.h"
-#include "cc/CCRenderSurface.h"
+#include "CCRenderSurface.h"
-#include "cc/CCLayerImpl.h"
-#include "cc/CCSharedQuadState.h"
-#include "cc/CCSingleThreadProxy.h"
+#include "CCLayerImpl.h"
+#include "CCSharedQuadState.h"
+#include "CCSingleThreadProxy.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <public/WebTransformationMatrix.h>
diff --git a/Source/WebKit/chromium/tests/CCResourceProviderTest.cpp b/Source/WebKit/chromium/tests/CCResourceProviderTest.cpp
index 42277459a..9e8599c0f 100644
--- a/Source/WebKit/chromium/tests/CCResourceProviderTest.cpp
+++ b/Source/WebKit/chromium/tests/CCResourceProviderTest.cpp
@@ -24,13 +24,13 @@
#include "config.h"
-#include "cc/CCResourceProvider.h"
+#include "CCResourceProvider.h"
+#include "CCGraphicsContext.h"
+#include "CCSingleThreadProxy.h" // For DebugScopedSetImplThread
#include "CompositorFakeWebGraphicsContext3D.h"
#include "Extensions3DChromium.h"
#include "FakeWebCompositorOutputSurface.h"
-#include "cc/CCGraphicsContext.h"
-#include "cc/CCSingleThreadProxy.h" // For DebugScopedSetImplThread
#include <gtest/gtest.h>
#include <public/WebGraphicsContext3D.h>
#include <wtf/HashMap.h>
@@ -42,9 +42,98 @@ using namespace WebKit;
namespace {
+size_t textureSize(const IntSize& size, WGC3Denum format)
+{
+ unsigned int componentsPerPixel = 4;
+ unsigned int bytesPerComponent = 1;
+ GraphicsContext3D::computeFormatAndTypeParameters(format, GraphicsContext3D::UNSIGNED_BYTE, &componentsPerPixel, &bytesPerComponent);
+ return size.width() * size.height() * componentsPerPixel * bytesPerComponent;
+}
+
+struct Texture {
+ Texture(const IntSize& size, WGC3Denum format)
+ : size(size)
+ , format(format)
+ , data(adoptArrayPtr(new uint8_t[textureSize(size, format)]))
+ {
+ }
+
+ IntSize size;
+ WGC3Denum format;
+ OwnArrayPtr<uint8_t> data;
+};
+
+// Shared data between multiple ResourceProviderContext. This contains mailbox
+// contents as well as information about sync points.
+class ContextSharedData {
+public:
+ static PassOwnPtr<ContextSharedData> create() { return adoptPtr(new ContextSharedData()); }
+
+ unsigned insertSyncPoint() { return m_nextSyncPoint++; }
+
+ void genMailbox(WGC3Dbyte* mailbox)
+ {
+ memset(mailbox, 0, sizeof(WGC3Dbyte[64]));
+ memcpy(mailbox, &m_nextMailBox, sizeof(m_nextMailBox));
+ ++m_nextMailBox;
+ }
+
+ void produceTexture(const WGC3Dbyte* mailboxName, unsigned syncPoint, PassOwnPtr<Texture> texture)
+ {
+ unsigned mailbox = 0;
+ memcpy(&mailbox, mailboxName, sizeof(mailbox));
+ ASSERT(mailbox && mailbox < m_nextMailBox);
+ m_textures.set(mailbox, texture);
+ ASSERT(m_syncPointForMailbox.get(mailbox) < syncPoint);
+ m_syncPointForMailbox.set(mailbox, syncPoint);
+ }
+
+ PassOwnPtr<Texture> consumeTexture(const WGC3Dbyte* mailboxName, unsigned syncPoint)
+ {
+ unsigned mailbox = 0;
+ memcpy(&mailbox, mailboxName, sizeof(mailbox));
+ ASSERT(mailbox && mailbox < m_nextMailBox);
+
+ // If the latest sync point the context has waited on is before the sync
+ // point for when the mailbox was set, pretend we never saw that
+ // produceTexture.
+ if (m_syncPointForMailbox.get(mailbox) < syncPoint)
+ return nullptr;
+ return m_textures.take(mailbox);
+ }
+
+private:
+ ContextSharedData()
+ : m_nextSyncPoint(1)
+ , m_nextMailBox(1)
+ { }
+
+ unsigned m_nextSyncPoint;
+ unsigned m_nextMailBox;
+ typedef HashMap<unsigned, OwnPtr<Texture> > TextureMap;
+ TextureMap m_textures;
+ HashMap<unsigned, unsigned> m_syncPointForMailbox;
+};
+
class ResourceProviderContext : public CompositorFakeWebGraphicsContext3D {
public:
- static PassOwnPtr<ResourceProviderContext> create() { return adoptPtr(new ResourceProviderContext(Attributes())); }
+ static PassOwnPtr<ResourceProviderContext> create(ContextSharedData* sharedData) { return adoptPtr(new ResourceProviderContext(Attributes(), sharedData)); }
+
+ virtual unsigned insertSyncPoint()
+ {
+ unsigned syncPoint = m_sharedData->insertSyncPoint();
+ // Commit the produceTextureCHROMIUM calls at this point, so that
+ // they're associated with the sync point.
+ for (PendingProduceTextureList::iterator it = m_pendingProduceTextures.begin(); it != m_pendingProduceTextures.end(); ++it)
+ m_sharedData->produceTexture((*it)->mailbox, syncPoint, (*it)->texture.release());
+ m_pendingProduceTextures.clear();
+ return syncPoint;
+ }
+
+ virtual void waitSyncPoint(unsigned syncPoint)
+ {
+ m_lastWaitedSyncPoint = std::max(syncPoint, m_lastWaitedSyncPoint);
+ }
virtual void bindTexture(WGC3Denum target, WebGLId texture)
{
@@ -113,6 +202,29 @@ public:
setPixels(xoffset, yoffset, width, height, pixels);
}
+ virtual void genMailboxCHROMIUM(WGC3Dbyte* mailbox) { return m_sharedData->genMailbox(mailbox); }
+ virtual void produceTextureCHROMIUM(WGC3Denum target, const WGC3Dbyte* mailbox)
+ {
+ ASSERT(m_currentTexture);
+ ASSERT(target == GraphicsContext3D::TEXTURE_2D);
+
+ // Delay movind the texture into the mailbox until the next
+ // insertSyncPoint, so that it is not visible to other contexts that
+ // haven't waited on that sync point.
+ OwnPtr<PendingProduceTexture> pending(adoptPtr(new PendingProduceTexture));
+ memcpy(pending->mailbox, mailbox, sizeof(pending->mailbox));
+ pending->texture = m_textures.take(m_currentTexture);
+ m_textures.set(m_currentTexture, nullptr);
+ m_pendingProduceTextures.append(pending.release());
+ }
+
+ virtual void consumeTextureCHROMIUM(WGC3Denum target, const WGC3Dbyte* mailbox)
+ {
+ ASSERT(m_currentTexture);
+ ASSERT(target == GraphicsContext3D::TEXTURE_2D);
+ m_textures.set(m_currentTexture, m_sharedData->consumeTexture(mailbox, m_lastWaitedSyncPoint));
+ }
+
void getPixels(const IntSize& size, WGC3Denum format, uint8_t* pixels)
{
ASSERT(m_currentTexture);
@@ -128,34 +240,15 @@ public:
return m_textures.size();
}
- static size_t textureSize(const IntSize& size, WGC3Denum format)
- {
- unsigned int componentsPerPixel = 4;
- unsigned int bytesPerComponent = 1;
- GraphicsContext3D::computeFormatAndTypeParameters(format, GraphicsContext3D::UNSIGNED_BYTE, &componentsPerPixel, &bytesPerComponent);
- return size.width() * size.height() * componentsPerPixel * bytesPerComponent;
- }
-
protected:
- explicit ResourceProviderContext(const Attributes& attrs)
+ ResourceProviderContext(const Attributes& attrs, ContextSharedData* sharedData)
: CompositorFakeWebGraphicsContext3D(attrs)
+ , m_sharedData(sharedData)
, m_currentTexture(0)
+ , m_lastWaitedSyncPoint(0)
{ }
private:
- struct Texture {
- Texture(const IntSize& size_, WGC3Denum format_)
- : size(size_)
- , format(format_)
- , data(adoptArrayPtr(new uint8_t[textureSize(size, format)]))
- {
- }
-
- IntSize size;
- WGC3Denum format;
- OwnArrayPtr<uint8_t> data;
- };
-
void allocateTexture(const IntSize& size, WGC3Denum format)
{
ASSERT(m_currentTexture);
@@ -182,14 +275,23 @@ private:
}
typedef HashMap<WebGLId, OwnPtr<Texture> > TextureMap;
+ struct PendingProduceTexture {
+ WGC3Dbyte mailbox[64];
+ OwnPtr<Texture> texture;
+ };
+ typedef Deque<OwnPtr<PendingProduceTexture> > PendingProduceTextureList;
+ ContextSharedData* m_sharedData;
WebGLId m_currentTexture;
TextureMap m_textures;
+ unsigned m_lastWaitedSyncPoint;
+ PendingProduceTextureList m_pendingProduceTextures;
};
class CCResourceProviderTest : public testing::Test {
public:
CCResourceProviderTest()
- : m_context(FakeWebCompositorOutputSurface::create(ResourceProviderContext::create()))
+ : m_sharedData(ContextSharedData::create())
+ , m_context(FakeWebCompositorOutputSurface::create(ResourceProviderContext::create(m_sharedData.get())))
, m_resourceProvider(CCResourceProvider::create(m_context.get()))
{
}
@@ -206,6 +308,7 @@ public:
protected:
DebugScopedSetImplThread implThread;
+ OwnPtr<ContextSharedData> m_sharedData;
OwnPtr<CCGraphicsContext> m_context;
OwnPtr<CCResourceProvider> m_resourceProvider;
};
@@ -215,7 +318,7 @@ TEST_F(CCResourceProviderTest, Basic)
IntSize size(1, 1);
WGC3Denum format = GraphicsContext3D::RGBA;
int pool = 1;
- size_t pixelSize = ResourceProviderContext::textureSize(size, format);
+ size_t pixelSize = textureSize(size, format);
ASSERT_EQ(4U, pixelSize);
CCResourceProvider::ResourceId id = m_resourceProvider->createResource(pool, size, format, CCResourceProvider::TextureUsageAny);
@@ -223,7 +326,7 @@ TEST_F(CCResourceProviderTest, Basic)
uint8_t data[4] = {1, 2, 3, 4};
IntRect rect(IntPoint(), size);
- m_resourceProvider->upload(id, data, rect, rect, rect);
+ m_resourceProvider->upload(id, data, rect, rect, IntSize());
uint8_t result[4] = {0};
getResourcePixels(id, size, format, result);
@@ -256,14 +359,14 @@ TEST_F(CCResourceProviderTest, Upload)
IntSize size(2, 2);
WGC3Denum format = GraphicsContext3D::RGBA;
int pool = 1;
- size_t pixelSize = ResourceProviderContext::textureSize(size, format);
+ size_t pixelSize = textureSize(size, format);
ASSERT_EQ(16U, pixelSize);
CCResourceProvider::ResourceId id = m_resourceProvider->createResource(pool, size, format, CCResourceProvider::TextureUsageAny);
uint8_t image[16] = {0};
IntRect imageRect(IntPoint(), size);
- m_resourceProvider->upload(id, image, imageRect, imageRect, imageRect);
+ m_resourceProvider->upload(id, image, imageRect, imageRect, IntSize());
for (uint8_t i = 0 ; i < pixelSize; ++i)
image[i] = i;
@@ -271,8 +374,8 @@ TEST_F(CCResourceProviderTest, Upload)
uint8_t result[16] = {0};
{
IntRect sourceRect(0, 0, 1, 1);
- IntRect destRect(0, 0, 1, 1);
- m_resourceProvider->upload(id, image, imageRect, sourceRect, destRect);
+ IntSize destOffset(0, 0);
+ m_resourceProvider->upload(id, image, imageRect, sourceRect, destOffset);
uint8_t expected[16] = {0, 1, 2, 3, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0};
@@ -281,8 +384,8 @@ TEST_F(CCResourceProviderTest, Upload)
}
{
IntRect sourceRect(0, 0, 1, 1);
- IntRect destRect(1, 1, 1, 1);
- m_resourceProvider->upload(id, image, imageRect, sourceRect, destRect);
+ IntSize destOffset(1, 1);
+ m_resourceProvider->upload(id, image, imageRect, sourceRect, destOffset);
uint8_t expected[16] = {0, 1, 2, 3, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 2, 3};
@@ -291,8 +394,8 @@ TEST_F(CCResourceProviderTest, Upload)
}
{
IntRect sourceRect(1, 0, 1, 1);
- IntRect destRect(0, 1, 1, 1);
- m_resourceProvider->upload(id, image, imageRect, sourceRect, destRect);
+ IntSize destOffset(0, 1);
+ m_resourceProvider->upload(id, image, imageRect, sourceRect, destOffset);
uint8_t expected[16] = {0, 1, 2, 3, 0, 0, 0, 0,
4, 5, 6, 7, 0, 1, 2, 3};
@@ -303,4 +406,117 @@ TEST_F(CCResourceProviderTest, Upload)
m_resourceProvider->deleteResource(id);
}
+TEST_F(CCResourceProviderTest, TransferResources)
+{
+ OwnPtr<CCGraphicsContext> childContext(FakeWebCompositorOutputSurface::create(ResourceProviderContext::create(m_sharedData.get())));
+ OwnPtr<CCResourceProvider> childResourceProvider(CCResourceProvider::create(childContext.get()));
+
+ IntSize size(1, 1);
+ WGC3Denum format = GraphicsContext3D::RGBA;
+ int pool = 1;
+ size_t pixelSize = textureSize(size, format);
+ ASSERT_EQ(4U, pixelSize);
+
+ CCResourceProvider::ResourceId id1 = childResourceProvider->createResource(pool, size, format, CCResourceProvider::TextureUsageAny);
+ uint8_t data1[4] = {1, 2, 3, 4};
+ IntRect rect(IntPoint(), size);
+ childResourceProvider->upload(id1, data1, rect, rect, IntSize());
+
+ CCResourceProvider::ResourceId id2 = childResourceProvider->createResource(pool, size, format, CCResourceProvider::TextureUsageAny);
+ uint8_t data2[4] = {5, 5, 5, 5};
+ childResourceProvider->upload(id2, data2, rect, rect, IntSize());
+
+ int childPool = 2;
+ int childId = m_resourceProvider->createChild(childPool);
+
+ {
+ // Transfer some resources to the parent.
+ CCResourceProvider::ResourceIdArray resourceIdsToTransfer;
+ resourceIdsToTransfer.append(id1);
+ resourceIdsToTransfer.append(id2);
+ CCResourceProvider::TransferableResourceList list = childResourceProvider->prepareSendToParent(resourceIdsToTransfer);
+ EXPECT_NE(0u, list.syncPoint);
+ EXPECT_EQ(2u, list.resources.size());
+ EXPECT_TRUE(childResourceProvider->inUseByConsumer(id1));
+ EXPECT_TRUE(childResourceProvider->inUseByConsumer(id2));
+ m_resourceProvider->receiveFromChild(childId, list);
+ }
+
+ EXPECT_EQ(2u, m_resourceProvider->numResources());
+ EXPECT_EQ(2u, m_resourceProvider->mailboxCount());
+ CCResourceProvider::ResourceIdMap resourceMap = m_resourceProvider->getChildToParentMap(childId);
+ CCResourceProvider::ResourceId mappedId1 = resourceMap.get(id1);
+ CCResourceProvider::ResourceId mappedId2 = resourceMap.get(id2);
+ EXPECT_NE(0u, mappedId1);
+ EXPECT_NE(0u, mappedId2);
+ EXPECT_FALSE(m_resourceProvider->inUseByConsumer(id1));
+ EXPECT_FALSE(m_resourceProvider->inUseByConsumer(id2));
+
+ uint8_t result[4] = {0};
+ getResourcePixels(mappedId1, size, format, result);
+ EXPECT_EQ(0, memcmp(data1, result, pixelSize));
+
+ getResourcePixels(mappedId2, size, format, result);
+ EXPECT_EQ(0, memcmp(data2, result, pixelSize));
+
+ {
+ // Check that transfering again the same resource from the child to the
+ // parent is a noop.
+ CCResourceProvider::ResourceIdArray resourceIdsToTransfer;
+ resourceIdsToTransfer.append(id1);
+ CCResourceProvider::TransferableResourceList list = childResourceProvider->prepareSendToParent(resourceIdsToTransfer);
+ EXPECT_EQ(0u, list.syncPoint);
+ EXPECT_EQ(0u, list.resources.size());
+ }
+
+ {
+ // Transfer resources back from the parent to the child.
+ CCResourceProvider::ResourceIdArray resourceIdsToTransfer;
+ resourceIdsToTransfer.append(mappedId1);
+ resourceIdsToTransfer.append(mappedId2);
+ CCResourceProvider::TransferableResourceList list = m_resourceProvider->prepareSendToChild(childId, resourceIdsToTransfer);
+ EXPECT_NE(0u, list.syncPoint);
+ EXPECT_EQ(2u, list.resources.size());
+ childResourceProvider->receiveFromParent(list);
+ }
+ EXPECT_EQ(0u, m_resourceProvider->mailboxCount());
+ EXPECT_EQ(2u, childResourceProvider->mailboxCount());
+ EXPECT_FALSE(childResourceProvider->inUseByConsumer(id1));
+ EXPECT_FALSE(childResourceProvider->inUseByConsumer(id2));
+
+ ResourceProviderContext* childContext3D = static_cast<ResourceProviderContext*>(childContext->context3D());
+ {
+ CCScopedLockResourceForRead lock(childResourceProvider.get(), id1);
+ ASSERT_NE(0U, lock.textureId());
+ childContext3D->bindTexture(GraphicsContext3D::TEXTURE_2D, lock.textureId());
+ childContext3D->getPixels(size, format, result);
+ EXPECT_EQ(0, memcmp(data1, result, pixelSize));
+ }
+ {
+ CCScopedLockResourceForRead lock(childResourceProvider.get(), id2);
+ ASSERT_NE(0U, lock.textureId());
+ childContext3D->bindTexture(GraphicsContext3D::TEXTURE_2D, lock.textureId());
+ childContext3D->getPixels(size, format, result);
+ EXPECT_EQ(0, memcmp(data2, result, pixelSize));
+ }
+
+ {
+ // Transfer resources to the parent again.
+ CCResourceProvider::ResourceIdArray resourceIdsToTransfer;
+ resourceIdsToTransfer.append(id1);
+ resourceIdsToTransfer.append(id2);
+ CCResourceProvider::TransferableResourceList list = childResourceProvider->prepareSendToParent(resourceIdsToTransfer);
+ EXPECT_NE(0u, list.syncPoint);
+ EXPECT_EQ(2u, list.resources.size());
+ EXPECT_TRUE(childResourceProvider->inUseByConsumer(id1));
+ EXPECT_TRUE(childResourceProvider->inUseByConsumer(id2));
+ m_resourceProvider->receiveFromChild(childId, list);
+ }
+
+ EXPECT_EQ(2u, m_resourceProvider->numResources());
+ m_resourceProvider->destroyChild(childId);
+ EXPECT_EQ(0u, m_resourceProvider->numResources());
+ EXPECT_EQ(0u, m_resourceProvider->mailboxCount());
+}
+
} // namespace
diff --git a/Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp b/Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp
index 2e31d44d0..563c2c04c 100644
--- a/Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp
+++ b/Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp
@@ -24,7 +24,7 @@
#include "config.h"
-#include "cc/CCSchedulerStateMachine.h"
+#include "CCSchedulerStateMachine.h"
#include <gtest/gtest.h>
#include <wtf/text/CString.h>
diff --git a/Source/WebKit/chromium/tests/CCSchedulerTest.cpp b/Source/WebKit/chromium/tests/CCSchedulerTest.cpp
index 41250884b..93ff66ea2 100644
--- a/Source/WebKit/chromium/tests/CCSchedulerTest.cpp
+++ b/Source/WebKit/chromium/tests/CCSchedulerTest.cpp
@@ -24,7 +24,7 @@
#include "config.h"
-#include "cc/CCScheduler.h"
+#include "CCScheduler.h"
#include "CCSchedulerTestCommon.h"
#include <gmock/gmock.h>
@@ -81,7 +81,7 @@ public:
return CCScheduledActionDrawAndSwapResult(true, m_swapWillHappenIfDrawHappens);
}
- virtual void scheduledActionUpdateMoreResources() OVERRIDE { m_actions.push_back("scheduledActionUpdateMoreResources"); }
+ virtual void scheduledActionUpdateMoreResources(double) OVERRIDE { m_actions.push_back("scheduledActionUpdateMoreResources"); }
virtual void scheduledActionCommit() OVERRIDE { m_actions.push_back("scheduledActionCommit"); }
virtual void scheduledActionBeginContextRecreation() OVERRIDE { m_actions.push_back("scheduledActionBeginContextRecreation"); }
virtual void scheduledActionAcquireLayerTexturesForMainThread() OVERRIDE { m_actions.push_back("scheduledActionAcquireLayerTexturesForMainThread"); }
@@ -114,12 +114,10 @@ TEST(CCSchedulerTest, RequestCommit)
client.reset();
// Since, hasMoreResourceUpdates is set to false,
- // beginFrameComplete should updateMoreResources, then
- // commit
+ // beginFrameComplete should commit
scheduler->beginFrameComplete();
- EXPECT_EQ(2, client.numActions());
- EXPECT_STREQ("scheduledActionUpdateMoreResources", client.action(0));
- EXPECT_STREQ("scheduledActionCommit", client.action(1));
+ EXPECT_EQ(1, client.numActions());
+ EXPECT_STREQ("scheduledActionCommit", client.action(0));
EXPECT_TRUE(timeSource->active());
client.reset();
@@ -152,12 +150,10 @@ TEST(CCSchedulerTest, RequestCommitAfterBeginFrame)
scheduler->setNeedsCommit();
// Since, hasMoreResourceUpdates is set to false, and another commit is
- // needed, beginFrameComplete should updateMoreResources, then commit, then
- // begin another frame.
+ // needed, beginFrameComplete should commit, then begin another frame.
scheduler->beginFrameComplete();
- EXPECT_EQ(2, client.numActions());
- EXPECT_STREQ("scheduledActionUpdateMoreResources", client.action(0));
- EXPECT_STREQ("scheduledActionCommit", client.action(1));
+ EXPECT_EQ(1, client.numActions());
+ EXPECT_STREQ("scheduledActionCommit", client.action(0));
client.reset();
// Tick should draw but then begin another frame.
@@ -257,7 +253,7 @@ public:
return CCScheduledActionDrawAndSwapResult(true, true);
}
- virtual void scheduledActionUpdateMoreResources() OVERRIDE { }
+ virtual void scheduledActionUpdateMoreResources(double) OVERRIDE { }
virtual void scheduledActionCommit() OVERRIDE { }
virtual void scheduledActionBeginContextRecreation() OVERRIDE { }
@@ -357,7 +353,7 @@ public:
return CCScheduledActionDrawAndSwapResult(true, true);
}
- virtual void scheduledActionUpdateMoreResources() OVERRIDE { }
+ virtual void scheduledActionUpdateMoreResources(double) OVERRIDE { }
virtual void scheduledActionCommit() OVERRIDE { }
virtual void scheduledActionBeginContextRecreation() OVERRIDE { }
diff --git a/Source/WebKit/chromium/tests/CCSchedulerTestCommon.h b/Source/WebKit/chromium/tests/CCSchedulerTestCommon.h
index beb16554d..824af26c7 100644
--- a/Source/WebKit/chromium/tests/CCSchedulerTestCommon.h
+++ b/Source/WebKit/chromium/tests/CCSchedulerTestCommon.h
@@ -25,9 +25,9 @@
#ifndef CCSchedulerTestCommon_h
#define CCSchedulerTestCommon_h
-#include "cc/CCDelayBasedTimeSource.h"
-#include "cc/CCFrameRateController.h"
-#include "cc/CCThread.h"
+#include "CCDelayBasedTimeSource.h"
+#include "CCFrameRateController.h"
+#include "CCThread.h"
#include <gtest/gtest.h>
#include <wtf/OwnPtr.h>
@@ -96,6 +96,7 @@ class FakeCCTimeSource : public WebCore::CCTimeSource {
public:
FakeCCTimeSource()
: m_active(false)
+ , m_nextTickTime(0)
, m_client(0) { }
virtual ~FakeCCTimeSource() { }
@@ -114,8 +115,11 @@ public:
m_client->onTimerTick();
}
+ void setNextTickTime(double nextTickTime) { m_nextTickTime = nextTickTime; }
+
protected:
bool m_active;
+ double m_nextTickTime;
WebCore::CCTimeSourceClient* m_client;
};
@@ -126,15 +130,15 @@ public:
return adoptRef(new FakeCCDelayBasedTimeSource(interval, thread));
}
- void setMonotonicallyIncreasingTime(double time) { m_monotonicallyIncreasingTime = time; }
- virtual double monotonicallyIncreasingTime() const { return m_monotonicallyIncreasingTime; }
+ void setMonotonicTimeNow(double time) { m_monotonicTimeNow = time; }
+ virtual double monotonicTimeNow() const OVERRIDE { return m_monotonicTimeNow; }
protected:
FakeCCDelayBasedTimeSource(double interval, WebCore::CCThread* thread)
: CCDelayBasedTimeSource(interval, thread)
- , m_monotonicallyIncreasingTime(0) { }
+ , m_monotonicTimeNow(0) { }
- double m_monotonicallyIncreasingTime;
+ double m_monotonicTimeNow;
};
class FakeCCFrameRateController : public WebCore::CCFrameRateController {
diff --git a/Source/WebKit/chromium/tests/CCScopedTextureTest.cpp b/Source/WebKit/chromium/tests/CCScopedTextureTest.cpp
index 505ae9625..56568f8f8 100644
--- a/Source/WebKit/chromium/tests/CCScopedTextureTest.cpp
+++ b/Source/WebKit/chromium/tests/CCScopedTextureTest.cpp
@@ -24,14 +24,13 @@
#include "config.h"
-#include "cc/CCScopedTexture.h"
+#include "CCScopedTexture.h"
+#include "CCRenderer.h"
+#include "CCSingleThreadProxy.h" // For DebugScopedSetImplThread
#include "CCTiledLayerTestCommon.h"
#include "FakeCCGraphicsContext.h"
#include "GraphicsContext3D.h"
-#include "cc/CCRenderer.h"
-#include "cc/CCSingleThreadProxy.h" // For DebugScopedSetImplThread
-
#include <gtest/gtest.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/tests/CCScrollbarAnimationControllerLinearFadeTest.cpp b/Source/WebKit/chromium/tests/CCScrollbarAnimationControllerLinearFadeTest.cpp
index e6cdc24c1..61e5f4400 100644
--- a/Source/WebKit/chromium/tests/CCScrollbarAnimationControllerLinearFadeTest.cpp
+++ b/Source/WebKit/chromium/tests/CCScrollbarAnimationControllerLinearFadeTest.cpp
@@ -24,10 +24,10 @@
#include "config.h"
-#include "cc/CCScrollbarAnimationControllerLinearFade.h"
+#include "CCScrollbarAnimationControllerLinearFade.h"
-#include "cc/CCScrollbarLayerImpl.h"
-#include "cc/CCSingleThreadProxy.h"
+#include "CCScrollbarLayerImpl.h"
+#include "CCSingleThreadProxy.h"
#include <gtest/gtest.h>
#include <wtf/OwnPtr.h>
@@ -84,9 +84,11 @@ TEST_F(CCScrollbarAnimationControllerLinearFadeTest, verifyAwakenByScroll)
m_scrollbarController->animate(3);
EXPECT_FLOAT_EQ(1, m_scrollbarLayer->opacity());
m_scrollbarController->animate(4);
- EXPECT_FLOAT_EQ(2 / 3.0, m_scrollbarLayer->opacity());
+ // Note that we use 3.0f to avoid "argument is truncated from 'double' to
+ // 'float'" warnings on Windows.
+ EXPECT_FLOAT_EQ(2 / 3.0f, m_scrollbarLayer->opacity());
m_scrollbarController->animate(5);
- EXPECT_FLOAT_EQ(1 / 3.0, m_scrollbarLayer->opacity());
+ EXPECT_FLOAT_EQ(1 / 3.0f, m_scrollbarLayer->opacity());
m_scrollLayer->setScrollDelta(IntSize(3, 3));
m_scrollbarController->updateScrollOffsetAtTime(m_scrollLayer.get(), 5);
m_scrollbarController->animate(6);
@@ -94,9 +96,9 @@ TEST_F(CCScrollbarAnimationControllerLinearFadeTest, verifyAwakenByScroll)
m_scrollbarController->animate(7);
EXPECT_FLOAT_EQ(1, m_scrollbarLayer->opacity());
m_scrollbarController->animate(8);
- EXPECT_FLOAT_EQ(2 / 3.0, m_scrollbarLayer->opacity());
+ EXPECT_FLOAT_EQ(2 / 3.0f, m_scrollbarLayer->opacity());
m_scrollbarController->animate(9);
- EXPECT_FLOAT_EQ(1 / 3.0, m_scrollbarLayer->opacity());
+ EXPECT_FLOAT_EQ(1 / 3.0f, m_scrollbarLayer->opacity());
m_scrollbarController->animate(10);
EXPECT_FLOAT_EQ(0, m_scrollbarLayer->opacity());
}
@@ -127,9 +129,9 @@ TEST_F(CCScrollbarAnimationControllerLinearFadeTest, verifyForceAwakenByPinch)
m_scrollbarController->animate(8);
EXPECT_FLOAT_EQ(1, m_scrollbarLayer->opacity());
m_scrollbarController->animate(9);
- EXPECT_FLOAT_EQ(2 / 3.0, m_scrollbarLayer->opacity());
+ EXPECT_FLOAT_EQ(2 / 3.0f, m_scrollbarLayer->opacity());
m_scrollbarController->animate(10);
- EXPECT_FLOAT_EQ(1 / 3.0, m_scrollbarLayer->opacity());
+ EXPECT_FLOAT_EQ(1 / 3.0f, m_scrollbarLayer->opacity());
m_scrollbarController->animate(11);
EXPECT_FLOAT_EQ(0, m_scrollbarLayer->opacity());
diff --git a/Source/WebKit/chromium/tests/CCSolidColorLayerImplTest.cpp b/Source/WebKit/chromium/tests/CCSolidColorLayerImplTest.cpp
index 141a96328..1eba991c3 100644
--- a/Source/WebKit/chromium/tests/CCSolidColorLayerImplTest.cpp
+++ b/Source/WebKit/chromium/tests/CCSolidColorLayerImplTest.cpp
@@ -24,13 +24,12 @@
#include "config.h"
-#include "cc/CCSolidColorLayerImpl.h"
+#include "CCSolidColorLayerImpl.h"
#include "CCLayerTestCommon.h"
+#include "CCSingleThreadProxy.h"
+#include "CCSolidColorDrawQuad.h"
#include "MockCCQuadCuller.h"
-#include "cc/CCSingleThreadProxy.h"
-#include "cc/CCSolidColorDrawQuad.h"
-
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/Source/WebKit/chromium/tests/CCTestCommon.h b/Source/WebKit/chromium/tests/CCTestCommon.h
index 89fce9818..d2c830c98 100644
--- a/Source/WebKit/chromium/tests/CCTestCommon.h
+++ b/Source/WebKit/chromium/tests/CCTestCommon.h
@@ -25,7 +25,7 @@
#ifndef CCTestCommon_h
#define CCTestCommon_h
-#include "cc/CCSettings.h"
+#include "CCSettings.h"
namespace WebKitTests {
diff --git a/Source/WebKit/chromium/tests/CCTextureUpdateControllerTest.cpp b/Source/WebKit/chromium/tests/CCTextureUpdateControllerTest.cpp
index a0dc2ec1f..11659f6f5 100644
--- a/Source/WebKit/chromium/tests/CCTextureUpdateControllerTest.cpp
+++ b/Source/WebKit/chromium/tests/CCTextureUpdateControllerTest.cpp
@@ -24,17 +24,16 @@
#include "config.h"
-#include "cc/CCTextureUpdateController.h"
+#include "CCTextureUpdateController.h"
#include "CCSchedulerTestCommon.h"
+#include "CCSingleThreadProxy.h" // For DebugScopedSetImplThread
#include "CCTiledLayerTestCommon.h"
#include "FakeWebCompositorOutputSurface.h"
#include "FakeWebGraphicsContext3D.h"
-#include "cc/CCSingleThreadProxy.h" // For DebugScopedSetImplThread
+#include <gtest/gtest.h>
#include <public/WebCompositor.h>
#include <public/WebThread.h>
-
-#include <gtest/gtest.h>
#include <wtf/RefPtr.h>
using namespace WebCore;
@@ -89,7 +88,7 @@ private:
class TextureForUploadTest : public LayerTextureUpdater::Texture {
public:
TextureForUploadTest() : LayerTextureUpdater::Texture(adoptPtr<CCPrioritizedTexture>(0)) { }
- virtual void updateRect(CCResourceProvider*, const IntRect& sourceRect, const IntRect& destRect) { }
+ virtual void updateRect(CCResourceProvider*, const IntRect& sourceRect, const IntSize& destOffset) { }
};
@@ -190,7 +189,7 @@ protected:
m_totalUploadCountExpected += count;
const IntRect rect(0, 0, 300, 150);
- const TextureUploader::Parameters upload = { &m_texture, rect, rect };
+ const TextureUploader::Parameters upload = { &m_texture, rect, IntSize() };
for (int i = 0; i < count; i++)
m_queue->appendFullUpload(upload);
}
@@ -201,7 +200,7 @@ protected:
m_totalUploadCountExpected += count;
const IntRect rect(0, 0, 100, 100);
- const TextureUploader::Parameters upload = { &m_texture, rect, rect };
+ const TextureUploader::Parameters upload = { &m_texture, rect, IntSize() };
for (int i = 0; i < count; i++)
m_queue->appendPartialUpload(upload);
}
@@ -542,4 +541,148 @@ TEST_F(CCTextureUpdateControllerTest, TripleUpdateFinalUpdateAllPartial)
EXPECT_EQ(kFullUploads + kPartialUploads, m_numTotalUploads);
}
+class FakeCCTextureUpdateController : public WebCore::CCTextureUpdateController {
+public:
+ static PassOwnPtr<FakeCCTextureUpdateController> create(WebCore::CCThread* thread, PassOwnPtr<CCTextureUpdateQueue> queue, CCResourceProvider* resourceProvider, TextureCopier* copier, TextureUploader* uploader)
+ {
+ return adoptPtr(new FakeCCTextureUpdateController(thread, queue, resourceProvider, copier, uploader));
+ }
+
+ void setMonotonicTimeNow(double time) { m_monotonicTimeNow = time; }
+ virtual double monotonicTimeNow() const OVERRIDE { return m_monotonicTimeNow; }
+ void setUpdateMoreTexturesTime(double time) { m_updateMoreTexturesTime = time; }
+ virtual double updateMoreTexturesTime() const OVERRIDE { return m_updateMoreTexturesTime; }
+ void setUpdateMoreTexturesSize(size_t size) { m_updateMoreTexturesSize = size; }
+ virtual size_t updateMoreTexturesSize() const OVERRIDE { return m_updateMoreTexturesSize; }
+
+protected:
+ FakeCCTextureUpdateController(WebCore::CCThread* thread, PassOwnPtr<CCTextureUpdateQueue> queue, CCResourceProvider* resourceProvider, TextureCopier* copier, TextureUploader* uploader)
+ : WebCore::CCTextureUpdateController(thread, queue, resourceProvider, copier, uploader)
+ , m_monotonicTimeNow(0)
+ , m_updateMoreTexturesTime(0)
+ , m_updateMoreTexturesSize(0) { }
+
+ double m_monotonicTimeNow;
+ double m_updateMoreTexturesTime;
+ size_t m_updateMoreTexturesSize;
+};
+
+TEST_F(CCTextureUpdateControllerTest, UpdateMoreTextures)
+{
+ FakeCCThread thread;
+
+ setMaxUploadCountPerUpdate(1);
+ appendFullUploadsToUpdateQueue(3);
+ appendPartialUploadsToUpdateQueue(0);
+
+ DebugScopedSetImplThread implThread;
+ OwnPtr<FakeCCTextureUpdateController> controller(FakeCCTextureUpdateController::create(&thread, m_queue.release(), m_resourceProvider.get(), &m_copier, &m_uploader));
+
+ controller->setMonotonicTimeNow(0);
+ controller->setUpdateMoreTexturesTime(0.1);
+ controller->setUpdateMoreTexturesSize(1);
+ // Not enough time for any updates.
+ controller->updateMoreTextures(0.09);
+ EXPECT_FALSE(thread.hasPendingTask());
+ EXPECT_EQ(0, m_numBeginUploads);
+ EXPECT_EQ(0, m_numEndUploads);
+
+ thread.reset();
+ controller->setMonotonicTimeNow(0);
+ controller->setUpdateMoreTexturesTime(0.1);
+ controller->setUpdateMoreTexturesSize(1);
+ // Only enough time for 1 update.
+ controller->updateMoreTextures(0.12);
+ EXPECT_TRUE(thread.hasPendingTask());
+ controller->setMonotonicTimeNow(thread.pendingDelayMs() / 1000.0);
+ thread.runPendingTask();
+ EXPECT_EQ(1, m_numBeginUploads);
+ EXPECT_EQ(1, m_numEndUploads);
+ EXPECT_EQ(1, m_numTotalUploads);
+
+ thread.reset();
+ controller->setMonotonicTimeNow(0);
+ controller->setUpdateMoreTexturesTime(0.1);
+ controller->setUpdateMoreTexturesSize(1);
+ // Enough time for 2 updates.
+ controller->updateMoreTextures(0.22);
+ EXPECT_TRUE(thread.hasPendingTask());
+ controller->setMonotonicTimeNow(controller->monotonicTimeNow() + thread.pendingDelayMs() / 1000.0);
+ thread.runPendingTask();
+ EXPECT_EQ(3, m_numBeginUploads);
+ EXPECT_EQ(3, m_numEndUploads);
+ EXPECT_EQ(3, m_numTotalUploads);
+}
+
+TEST_F(CCTextureUpdateControllerTest, NoMoreUpdates)
+{
+ FakeCCThread thread;
+
+ setMaxUploadCountPerUpdate(1);
+ appendFullUploadsToUpdateQueue(2);
+ appendPartialUploadsToUpdateQueue(0);
+
+ DebugScopedSetImplThread implThread;
+ OwnPtr<FakeCCTextureUpdateController> controller(FakeCCTextureUpdateController::create(&thread, m_queue.release(), m_resourceProvider.get(), &m_copier, &m_uploader));
+
+ controller->setMonotonicTimeNow(0);
+ controller->setUpdateMoreTexturesTime(0.1);
+ controller->setUpdateMoreTexturesSize(1);
+ // Enough time for 3 updates but only 2 necessary.
+ controller->updateMoreTextures(0.31);
+ EXPECT_TRUE(thread.hasPendingTask());
+ controller->setMonotonicTimeNow(controller->monotonicTimeNow() + thread.pendingDelayMs() / 1000.0);
+ thread.runPendingTask();
+ EXPECT_TRUE(thread.hasPendingTask());
+ controller->setMonotonicTimeNow(controller->monotonicTimeNow() + thread.pendingDelayMs() / 1000.0);
+ thread.runPendingTask();
+ EXPECT_EQ(2, m_numBeginUploads);
+ EXPECT_EQ(2, m_numEndUploads);
+ EXPECT_EQ(2, m_numTotalUploads);
+
+ thread.reset();
+ controller->setMonotonicTimeNow(0);
+ controller->setUpdateMoreTexturesTime(0.1);
+ controller->setUpdateMoreTexturesSize(1);
+ // Enough time for updates but no more updates left.
+ controller->updateMoreTextures(0.31);
+ EXPECT_FALSE(thread.hasPendingTask());
+ EXPECT_EQ(2, m_numBeginUploads);
+ EXPECT_EQ(2, m_numEndUploads);
+ EXPECT_EQ(2, m_numTotalUploads);
+}
+
+TEST_F(CCTextureUpdateControllerTest, UpdatesCompleteInFiniteTime)
+{
+ FakeCCThread thread;
+
+ setMaxUploadCountPerUpdate(1);
+ appendFullUploadsToUpdateQueue(2);
+ appendPartialUploadsToUpdateQueue(0);
+
+ DebugScopedSetImplThread implThread;
+ OwnPtr<FakeCCTextureUpdateController> controller(FakeCCTextureUpdateController::create(&thread, m_queue.release(), m_resourceProvider.get(), &m_copier, &m_uploader));
+
+ controller->setMonotonicTimeNow(0);
+ controller->setUpdateMoreTexturesTime(0.5);
+ controller->setUpdateMoreTexturesSize(1);
+
+ for (int i = 0; i < 100; i++) {
+ if (!controller->hasMoreUpdates())
+ break;
+
+ // Not enough time for any updates.
+ controller->updateMoreTextures(0.4);
+
+ if (thread.hasPendingTask()) {
+ controller->setMonotonicTimeNow(controller->monotonicTimeNow() + thread.pendingDelayMs() / 1000.0);
+ thread.runPendingTask();
+ }
+ }
+
+ EXPECT_EQ(2, m_numBeginUploads);
+ EXPECT_EQ(2, m_numEndUploads);
+ EXPECT_EQ(2, m_numTotalUploads);
+}
+
} // namespace
diff --git a/Source/WebKit/chromium/tests/CCThreadTaskTest.cpp b/Source/WebKit/chromium/tests/CCThreadTaskTest.cpp
index d9943e713..820a7b710 100644
--- a/Source/WebKit/chromium/tests/CCThreadTaskTest.cpp
+++ b/Source/WebKit/chromium/tests/CCThreadTaskTest.cpp
@@ -24,7 +24,7 @@
#include "config.h"
-#include "cc/CCThreadTask.h"
+#include "CCThreadTask.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/Source/WebKit/chromium/tests/CCThreadedTest.cpp b/Source/WebKit/chromium/tests/CCThreadedTest.cpp
index 89ff9cba3..cde88f8e6 100644
--- a/Source/WebKit/chromium/tests/CCThreadedTest.cpp
+++ b/Source/WebKit/chromium/tests/CCThreadedTest.cpp
@@ -26,22 +26,22 @@
#include "CCThreadedTest.h"
+#include "CCActiveAnimation.h"
#include "CCAnimationTestCommon.h"
+#include "CCLayerAnimationController.h"
+#include "CCLayerImpl.h"
+#include "CCLayerTreeHostImpl.h"
#include "CCOcclusionTrackerTestCommon.h"
+#include "CCScopedThreadProxy.h"
+#include "CCSingleThreadProxy.h"
+#include "CCTextureUpdateQueue.h"
+#include "CCThreadTask.h"
#include "CCTiledLayerTestCommon.h"
+#include "CCTimingFunction.h"
#include "ContentLayerChromium.h"
#include "FakeWebCompositorOutputSurface.h"
#include "FakeWebGraphicsContext3D.h"
#include "LayerChromium.h"
-#include "cc/CCActiveAnimation.h"
-#include "cc/CCLayerAnimationController.h"
-#include "cc/CCLayerImpl.h"
-#include "cc/CCLayerTreeHostImpl.h"
-#include "cc/CCScopedThreadProxy.h"
-#include "cc/CCSingleThreadProxy.h"
-#include "cc/CCTextureUpdateQueue.h"
-#include "cc/CCThreadTask.h"
-#include "cc/CCTimingFunction.h"
#include <gmock/gmock.h>
#include <public/Platform.h>
#include <public/WebCompositor.h>
diff --git a/Source/WebKit/chromium/tests/CCThreadedTest.h b/Source/WebKit/chromium/tests/CCThreadedTest.h
index 946b65fd1..0f87de1f5 100644
--- a/Source/WebKit/chromium/tests/CCThreadedTest.h
+++ b/Source/WebKit/chromium/tests/CCThreadedTest.h
@@ -25,10 +25,10 @@
#ifndef CCThreadedTest_h
#define CCThreadedTest_h
+#include "CCLayerTreeHost.h"
+#include "CCLayerTreeHostImpl.h"
+#include "CCScopedThreadProxy.h"
#include "CompositorFakeWebGraphicsContext3D.h"
-#include "cc/CCLayerTreeHost.h"
-#include "cc/CCLayerTreeHostImpl.h"
-#include "cc/CCScopedThreadProxy.h"
#include <gtest/gtest.h>
#include <public/WebAnimationDelegate.h>
@@ -134,6 +134,7 @@ protected:
static void dispatchDidAddAnimation(void* self);
virtual void runTest(bool threaded);
+ WebKit::WebThread* webThread() const { return m_webThread.get(); }
WebCore::CCLayerTreeSettings m_settings;
OwnPtr<MockCCLayerTreeHostClient> m_client;
diff --git a/Source/WebKit/chromium/tests/CCTiledLayerImplTest.cpp b/Source/WebKit/chromium/tests/CCTiledLayerImplTest.cpp
index 8d3ca4219..62336bb50 100644
--- a/Source/WebKit/chromium/tests/CCTiledLayerImplTest.cpp
+++ b/Source/WebKit/chromium/tests/CCTiledLayerImplTest.cpp
@@ -24,13 +24,13 @@
#include "config.h"
-#include "cc/CCTiledLayerImpl.h"
+#include "CCTiledLayerImpl.h"
#include "CCLayerTestCommon.h"
+#include "CCLayerTilingData.h"
+#include "CCSingleThreadProxy.h"
+#include "CCTileDrawQuad.h"
#include "MockCCQuadCuller.h"
-#include "cc/CCLayerTilingData.h"
-#include "cc/CCSingleThreadProxy.h"
-#include "cc/CCTileDrawQuad.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp b/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp
index 54f29bbef..58f37c694 100644
--- a/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp
+++ b/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp
@@ -40,7 +40,7 @@ FakeLayerTextureUpdater::Texture::~Texture()
{
}
-void FakeLayerTextureUpdater::Texture::updateRect(CCResourceProvider* resourceProvider, const IntRect&, const IntRect&)
+void FakeLayerTextureUpdater::Texture::updateRect(CCResourceProvider* resourceProvider, const IntRect&, const IntSize&)
{
texture()->acquireBackingTexture(resourceProvider);
m_layer->updateRect();
diff --git a/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h b/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h
index c75932acf..5de1c5fb3 100644
--- a/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h
+++ b/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h
@@ -25,6 +25,11 @@
#ifndef CCTiledLayerTestCommon_h
#define CCTiledLayerTestCommon_h
+#include "CCGraphicsContext.h"
+#include "CCPrioritizedTexture.h"
+#include "CCResourceProvider.h"
+#include "CCTextureUpdateQueue.h"
+#include "CCTiledLayerImpl.h"
#include "IntRect.h"
#include "IntSize.h"
#include "LayerTextureUpdater.h"
@@ -32,11 +37,6 @@
#include "TextureCopier.h"
#include "TextureUploader.h"
#include "TiledLayerChromium.h"
-#include "cc/CCGraphicsContext.h"
-#include "cc/CCPrioritizedTexture.h"
-#include "cc/CCResourceProvider.h"
-#include "cc/CCTextureUpdateQueue.h"
-#include "cc/CCTiledLayerImpl.h"
namespace WebKitTests {
@@ -49,7 +49,7 @@ public:
Texture(FakeLayerTextureUpdater*, PassOwnPtr<WebCore::CCPrioritizedTexture>);
virtual ~Texture();
- virtual void updateRect(WebCore::CCResourceProvider* , const WebCore::IntRect&, const WebCore::IntRect&) OVERRIDE;
+ virtual void updateRect(WebCore::CCResourceProvider* , const WebCore::IntRect&, const WebCore::IntSize&) OVERRIDE;
virtual void prepareRect(const WebCore::IntRect&, WebCore::CCRenderingStats&) OVERRIDE;
private:
@@ -162,7 +162,7 @@ public:
virtual bool isBusy() { return false; }
virtual void beginUploads() { }
virtual void endUploads() { }
- virtual void uploadTexture(WebCore::CCResourceProvider* resourceProvider, Parameters upload) { upload.texture->updateRect(resourceProvider, upload.sourceRect, upload.destRect); }
+ virtual void uploadTexture(WebCore::CCResourceProvider* resourceProvider, Parameters upload) { upload.texture->updateRect(resourceProvider, upload.sourceRect, upload.destOffset); }
};
}
diff --git a/Source/WebKit/chromium/tests/CCTimerTest.cpp b/Source/WebKit/chromium/tests/CCTimerTest.cpp
index c1b2efb77..852558885 100644
--- a/Source/WebKit/chromium/tests/CCTimerTest.cpp
+++ b/Source/WebKit/chromium/tests/CCTimerTest.cpp
@@ -30,7 +30,7 @@
#include "config.h"
-#include "cc/CCTimer.h"
+#include "CCTimer.h"
#include "CCSchedulerTestCommon.h"
#include <gtest/gtest.h>
diff --git a/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp b/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp
index fd72e96ed..6972424b0 100644
--- a/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp
+++ b/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp
@@ -30,10 +30,6 @@
#include "FakeWebGraphicsContext3D.h"
#include "GraphicsContext3DPrivate.h"
#include "ImageBuffer.h"
-#include "LayerChromium.h"
-#include "cc/CCGraphicsContext.h"
-#include "cc/CCRenderingStats.h"
-#include "cc/CCTextureUpdateQueue.h"
#include <public/Platform.h>
#include <public/WebCompositor.h>
#include <public/WebThread.h>
@@ -75,10 +71,8 @@ protected:
void fullLifecycleTest(ThreadMode threadMode, DeferralMode deferralMode)
{
RefPtr<GraphicsContext3D> mainContext = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new MockCanvasContext));
- OwnPtr<CCGraphicsContext> ccImplContext = FakeWebCompositorOutputSurface::create(adoptPtr(new MockCanvasContext));
MockCanvasContext& mainMock = *static_cast<MockCanvasContext*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(mainContext.get()));
- MockCanvasContext& implMock = *static_cast<MockCanvasContext*>(ccImplContext->context3D());
MockWebTextureUpdater updater;
@@ -115,7 +109,6 @@ protected:
EXPECT_CALL(mainMock, flush());
}
bridge.clear();
- ::testing::Mock::VerifyAndClearExpectations(&implMock);
WebCompositor::shutdown();
}
diff --git a/Source/WebKit/chromium/tests/ContentLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/ContentLayerChromiumTest.cpp
index 007bea446..fd35e2224 100644
--- a/Source/WebKit/chromium/tests/ContentLayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/ContentLayerChromiumTest.cpp
@@ -28,11 +28,10 @@
#include "BitmapCanvasLayerTextureUpdater.h"
#include "CCLayerTreeTestCommon.h"
+#include "CCRenderingStats.h"
#include "GraphicsContext.h"
#include "OpaqueRectTrackingContentLayerDelegate.h"
-#include "cc/CCRenderingStats.h"
#include "skia/ext/platform_canvas.h"
-
#include <gtest/gtest.h>
#include <public/WebFloatRect.h>
#include <public/WebRect.h>
diff --git a/Source/WebKit/chromium/tests/FakeCCGraphicsContext.h b/Source/WebKit/chromium/tests/FakeCCGraphicsContext.h
index 33c4b3046..e849ec2ed 100644
--- a/Source/WebKit/chromium/tests/FakeCCGraphicsContext.h
+++ b/Source/WebKit/chromium/tests/FakeCCGraphicsContext.h
@@ -26,9 +26,9 @@
#ifndef FakeCCGraphicsContext_h
#define FakeCCGraphicsContext_h
+#include "CCGraphicsContext.h"
#include "CompositorFakeWebGraphicsContext3D.h"
#include "FakeWebCompositorOutputSurface.h"
-#include "cc/CCGraphicsContext.h"
#include <public/WebCompositorOutputSurface.h>
namespace WebKit {
diff --git a/Source/WebKit/chromium/tests/FakeCCLayerTreeHostClient.h b/Source/WebKit/chromium/tests/FakeCCLayerTreeHostClient.h
index 84804da96..b87305afe 100755
--- a/Source/WebKit/chromium/tests/FakeCCLayerTreeHostClient.h
+++ b/Source/WebKit/chromium/tests/FakeCCLayerTreeHostClient.h
@@ -27,11 +27,10 @@
#include "config.h"
+#include "CCLayerTreeHost.h"
#include "CompositorFakeWebGraphicsContext3D.h"
#include "FakeWebCompositorOutputSurface.h"
-#include "cc/CCLayerTreeHost.h"
-
namespace WebCore {
class FakeCCLayerTreeHostClient : public CCLayerTreeHostClient {
diff --git a/Source/WebKit/chromium/tests/FloatQuadTest.cpp b/Source/WebKit/chromium/tests/FloatQuadTest.cpp
index 3e2f9bce6..671894a4c 100644
--- a/Source/WebKit/chromium/tests/FloatQuadTest.cpp
+++ b/Source/WebKit/chromium/tests/FloatQuadTest.cpp
@@ -25,7 +25,7 @@
#include "config.h"
-#include "cc/CCMathUtil.h"
+#include "CCMathUtil.h"
#include "FloatQuad.h"
#include <gtest/gtest.h>
#include <public/WebTransformationMatrix.h>
diff --git a/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp
index 21d0705b8..26627ec8d 100644
--- a/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp
@@ -26,28 +26,24 @@
#include "GraphicsLayerChromium.h"
-#include "CCAnimationTestCommon.h"
+#include "CCLayerTreeHost.h"
+#include "CCLayerTreeHostImpl.h"
+#include "CCSingleThreadProxy.h"
#include "CompositorFakeWebGraphicsContext3D.h"
-#include "FakeCCLayerTreeHostClient.h"
-#include "GraphicsContext3D.h"
-#include "GraphicsContext3DPrivate.h"
#include "GraphicsLayer.h"
-#include "LayerChromium.h"
#include "Matrix3DTransformOperation.h"
#include "RotateTransformOperation.h"
#include "TranslateTransformOperation.h"
-#include "cc/CCLayerTreeHost.h"
-#include "cc/CCLayerTreeHostImpl.h"
-#include "cc/CCSingleThreadProxy.h"
-#include <public/WebCompositor.h>
-
+#include "WebLayerTreeViewTestCommon.h"
#include <gtest/gtest.h>
+#include <public/WebCompositor.h>
+#include <public/WebFloatAnimationCurve.h>
#include <public/WebGraphicsContext3D.h>
+#include <public/WebLayerTreeView.h>
#include <wtf/PassOwnPtr.h>
using namespace WebCore;
using namespace WebKit;
-using namespace WebKitTests;
namespace {
@@ -61,31 +57,6 @@ class MockGraphicsLayerClient : public GraphicsLayerClient {
virtual float deviceScaleFactor() const OVERRIDE { return 2; }
};
-class MockLayerTreeHost : public CCLayerTreeHost {
-public:
- static PassOwnPtr<MockLayerTreeHost> create()
- {
- CCLayerTreeSettings settings;
- OwnPtr<MockLayerTreeHost> layerTreeHost(adoptPtr(new MockLayerTreeHost(new FakeCCLayerTreeHostClient(), settings)));
- bool success = layerTreeHost->initialize();
- EXPECT_TRUE(success);
- layerTreeHost->setRootLayer(LayerChromium::create());
- layerTreeHost->setViewportSize(IntSize(1, 1), IntSize(1, 1));
- return layerTreeHost.release();
- }
-
- virtual PassOwnPtr<CCLayerTreeHostImpl> createLayerTreeHostImpl(CCLayerTreeHostImplClient* client)
- {
- return CCLayerTreeHostImpl::create(settings(), client);
- }
-
-private:
- MockLayerTreeHost(CCLayerTreeHostClient* client, const CCLayerTreeSettings& settings)
- : CCLayerTreeHost(client, settings)
- {
- }
-};
-
class GraphicsLayerChromiumTest : public testing::Test {
public:
GraphicsLayerChromiumTest()
@@ -94,15 +65,15 @@ public:
WebCompositor::setAcceleratedAnimationEnabled(true);
WebCompositor::initialize(0);
m_graphicsLayer = static_pointer_cast<GraphicsLayerChromium>(GraphicsLayer::create(&m_client));
- m_platformLayer = m_graphicsLayer->platformLayer()->unwrap<LayerChromium>();
- m_layerTreeHost = MockLayerTreeHost::create();
- m_platformLayer->setLayerTreeHost(m_layerTreeHost.get());
+ m_platformLayer = m_graphicsLayer->platformLayer();
+ m_layerTreeView.initialize(&m_layerTreeViewClient, *m_platformLayer, WebLayerTreeView::Settings());
+ m_layerTreeView.setViewportSize(WebSize(1, 1), WebSize(1, 1));
}
virtual ~GraphicsLayerChromiumTest()
{
m_graphicsLayer.clear();
- m_layerTreeHost.clear();
+ m_layerTreeView.reset();
WebCompositor::shutdown();
}
@@ -112,318 +83,46 @@ protected:
EXPECT_FLOAT_EQ(translateX, matrix.m41());
}
- LayerChromium* m_platformLayer;
+ WebLayer* m_platformLayer;
OwnPtr<GraphicsLayerChromium> m_graphicsLayer;
- OwnPtr<CCLayerTreeHost> m_layerTreeHost;
private:
+ MockWebLayerTreeViewClient m_layerTreeViewClient;
+ WebLayerTreeView m_layerTreeView;
MockGraphicsLayerClient m_client;
- DebugScopedSetMainThread m_main;
};
TEST_F(GraphicsLayerChromiumTest, updateLayerPreserves3DWithAnimations)
{
ASSERT_FALSE(m_platformLayer->hasActiveAnimation());
- OwnPtr<CCActiveAnimation> floatAnimation(CCActiveAnimation::create(adoptPtr(new FakeFloatAnimationCurve), 0, 1, CCActiveAnimation::Opacity));
- m_platformLayer->layerAnimationController()->addAnimation(floatAnimation.release());
+ WebFloatAnimationCurve curve;
+ curve.add(WebFloatKeyframe(0.0, 0.0));
+ OwnPtr<WebAnimation> floatAnimation(adoptPtr(WebAnimation::create(curve, 1, 1, WebAnimation::TargetPropertyOpacity)));
+ ASSERT_TRUE(m_platformLayer->addAnimation(floatAnimation.get()));
ASSERT_TRUE(m_platformLayer->hasActiveAnimation());
m_graphicsLayer->setPreserves3D(true);
- m_platformLayer = m_graphicsLayer->platformLayer()->unwrap<LayerChromium>();
+ m_platformLayer = m_graphicsLayer->platformLayer();
ASSERT_TRUE(m_platformLayer);
ASSERT_TRUE(m_platformLayer->hasActiveAnimation());
- m_platformLayer->removeAnimation(0);
+ m_platformLayer->removeAnimation(1);
ASSERT_FALSE(m_platformLayer->hasActiveAnimation());
m_graphicsLayer->setPreserves3D(false);
- m_platformLayer = m_graphicsLayer->platformLayer()->unwrap<LayerChromium>();
+ m_platformLayer = m_graphicsLayer->platformLayer();
ASSERT_TRUE(m_platformLayer);
ASSERT_FALSE(m_platformLayer->hasActiveAnimation());
}
-TEST_F(GraphicsLayerChromiumTest, createOpacityAnimation)
-{
- const double duration = 1;
- WebCore::KeyframeValueList values(AnimatedPropertyOpacity);
- values.insert(new FloatAnimationValue(0, 0));
- values.insert(new FloatAnimationValue(duration, 1));
-
- RefPtr<Animation> animation = Animation::create();
- animation->setDuration(duration);
-
- IntSize boxSize;
- bool addedAnimation = m_graphicsLayer->addAnimation(values, boxSize, animation.get(), "", 0);
-
- EXPECT_TRUE(addedAnimation);
-
- EXPECT_TRUE(m_platformLayer->layerAnimationController()->hasActiveAnimation());
-
- CCActiveAnimation* activeAnimation = m_platformLayer->layerAnimationController()->getActiveAnimation(CCActiveAnimation::Opacity);
- EXPECT_TRUE(activeAnimation);
-
- EXPECT_EQ(1, activeAnimation->iterations());
- EXPECT_EQ(CCActiveAnimation::Opacity, activeAnimation->targetProperty());
-
- EXPECT_EQ(CCAnimationCurve::Float, activeAnimation->curve()->type());
-
- const CCFloatAnimationCurve* curve = activeAnimation->curve()->toFloatAnimationCurve();
- EXPECT_TRUE(curve);
-
- EXPECT_EQ(0, curve->getValue(0));
- EXPECT_EQ(1, curve->getValue(duration));
-}
-
-TEST_F(GraphicsLayerChromiumTest, createTransformAnimation)
-{
- const double duration = 1;
- WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
-
- TransformOperations operations1;
- operations1.operations().append(TranslateTransformOperation::create(Length(2, WebCore::Fixed), Length(0, WebCore::Fixed), TransformOperation::TRANSLATE_X));
- values.insert(new TransformAnimationValue(0, &operations1));
-
- TransformOperations operations2;
- operations2.operations().append(TranslateTransformOperation::create(Length(4, WebCore::Fixed), Length(0, WebCore::Fixed), TransformOperation::TRANSLATE_X));
- values.insert(new TransformAnimationValue(duration, &operations2));
-
- RefPtr<Animation> animation = Animation::create();
- animation->setDuration(duration);
-
- IntSize boxSize;
- m_graphicsLayer->addAnimation(values, boxSize, animation.get(), "", 0);
-
- EXPECT_TRUE(m_platformLayer->layerAnimationController()->hasActiveAnimation());
-
- CCActiveAnimation* activeAnimation = m_platformLayer->layerAnimationController()->getActiveAnimation(CCActiveAnimation::Transform);
- EXPECT_TRUE(activeAnimation);
-
- EXPECT_EQ(1, activeAnimation->iterations());
- EXPECT_EQ(CCActiveAnimation::Transform, activeAnimation->targetProperty());
-
- EXPECT_EQ(CCAnimationCurve::Transform, activeAnimation->curve()->type());
-
- const CCTransformAnimationCurve* curve = activeAnimation->curve()->toTransformAnimationCurve();
- EXPECT_TRUE(curve);
-
- expectTranslateX(2, curve->getValue(0));
- expectTranslateX(4, curve->getValue(duration));
-}
-
-TEST_F(GraphicsLayerChromiumTest, createTransformAnimationWithBigRotation)
-{
- const double duration = 1;
- WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
-
- TransformOperations operations1;
- operations1.operations().append(RotateTransformOperation::create(0, TransformOperation::ROTATE));
- values.insert(new TransformAnimationValue(0, &operations1));
-
- TransformOperations operations2;
- operations2.operations().append(RotateTransformOperation::create(270, TransformOperation::ROTATE));
- values.insert(new TransformAnimationValue(duration, &operations2));
-
- RefPtr<Animation> animation = Animation::create();
- animation->setDuration(duration);
-
- IntSize boxSize;
- m_graphicsLayer->addAnimation(values, boxSize, animation.get(), "", 0);
-
- EXPECT_FALSE(m_platformLayer->layerAnimationController()->hasActiveAnimation());
-}
-
-TEST_F(GraphicsLayerChromiumTest, createTransformAnimationWithRotationInvolvingNegativeAngles)
-{
- const double duration = 1;
- WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
-
- TransformOperations operations1;
- operations1.operations().append(RotateTransformOperation::create(-330, TransformOperation::ROTATE));
- values.insert(new TransformAnimationValue(0, &operations1));
-
- TransformOperations operations2;
- operations2.operations().append(RotateTransformOperation::create(-320, TransformOperation::ROTATE));
- values.insert(new TransformAnimationValue(duration, &operations2));
-
- RefPtr<Animation> animation = Animation::create();
- animation->setDuration(duration);
-
- IntSize boxSize;
- m_graphicsLayer->addAnimation(values, boxSize, animation.get(), "", 0);
-
- EXPECT_TRUE(m_platformLayer->layerAnimationController()->hasActiveAnimation());
-}
-
-TEST_F(GraphicsLayerChromiumTest, createTransformAnimationWithSmallRotationInvolvingLargeAngles)
-{
- const double duration = 1;
- WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
-
- TransformOperations operations1;
- operations1.operations().append(RotateTransformOperation::create(270, TransformOperation::ROTATE));
- values.insert(new TransformAnimationValue(0, &operations1));
-
- TransformOperations operations2;
- operations2.operations().append(RotateTransformOperation::create(360, TransformOperation::ROTATE));
- values.insert(new TransformAnimationValue(duration, &operations2));
-
- RefPtr<Animation> animation = Animation::create();
- animation->setDuration(duration);
-
- IntSize boxSize;
- m_graphicsLayer->addAnimation(values, boxSize, animation.get(), "", 0);
-
- EXPECT_TRUE(m_platformLayer->layerAnimationController()->hasActiveAnimation());
-}
-
-TEST_F(GraphicsLayerChromiumTest, createTransformAnimationWithSingularMatrix)
-{
- const double duration = 1;
- WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
-
- TransformationMatrix matrix1;
- TransformOperations operations1;
- operations1.operations().append(Matrix3DTransformOperation::create(matrix1));
- values.insert(new TransformAnimationValue(0, &operations1));
-
- TransformationMatrix matrix2;
- matrix2.setM11(0);
- TransformOperations operations2;
- operations2.operations().append(Matrix3DTransformOperation::create(matrix2));
- values.insert(new TransformAnimationValue(duration, &operations2));
-
- RefPtr<Animation> animation = Animation::create();
- animation->setDuration(duration);
-
- IntSize boxSize;
- m_graphicsLayer->addAnimation(values, boxSize, animation.get(), "", 0);
-
- EXPECT_FALSE(m_platformLayer->layerAnimationController()->hasActiveAnimation());
-}
-
-TEST_F(GraphicsLayerChromiumTest, createReversedAnimation)
-{
- const double duration = 1;
- WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
-
- TransformOperations operations1;
- operations1.operations().append(TranslateTransformOperation::create(Length(2, WebCore::Fixed), Length(0, WebCore::Fixed), TransformOperation::TRANSLATE_X));
- values.insert(new TransformAnimationValue(0, &operations1));
-
- TransformOperations operations2;
- operations2.operations().append(TranslateTransformOperation::create(Length(4, WebCore::Fixed), Length(0, WebCore::Fixed), TransformOperation::TRANSLATE_X));
- values.insert(new TransformAnimationValue(duration, &operations2));
-
- RefPtr<Animation> animation = Animation::create();
- animation->setDuration(duration);
- animation->setDirection(Animation::AnimationDirectionReverse);
-
- IntSize boxSize;
- m_graphicsLayer->addAnimation(values, boxSize, animation.get(), "", 0);
-
- EXPECT_TRUE(m_platformLayer->layerAnimationController()->hasActiveAnimation());
-
- CCActiveAnimation* activeAnimation = m_platformLayer->layerAnimationController()->getActiveAnimation(CCActiveAnimation::Transform);
- EXPECT_TRUE(activeAnimation);
-
- EXPECT_EQ(1, activeAnimation->iterations());
- EXPECT_EQ(CCActiveAnimation::Transform, activeAnimation->targetProperty());
-
- EXPECT_EQ(CCAnimationCurve::Transform, activeAnimation->curve()->type());
-
- const CCTransformAnimationCurve* curve = activeAnimation->curve()->toTransformAnimationCurve();
- EXPECT_TRUE(curve);
-
- expectTranslateX(4, curve->getValue(0));
- expectTranslateX(2, curve->getValue(duration));
-}
-
-TEST_F(GraphicsLayerChromiumTest, createAlternatingAnimation)
-{
- const double duration = 1;
- WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
-
- TransformOperations operations1;
- operations1.operations().append(TranslateTransformOperation::create(Length(2, WebCore::Fixed), Length(0, WebCore::Fixed), TransformOperation::TRANSLATE_X));
- values.insert(new TransformAnimationValue(0, &operations1));
-
- TransformOperations operations2;
- operations2.operations().append(TranslateTransformOperation::create(Length(4, WebCore::Fixed), Length(0, WebCore::Fixed), TransformOperation::TRANSLATE_X));
- values.insert(new TransformAnimationValue(duration, &operations2));
-
- RefPtr<Animation> animation = Animation::create();
- animation->setDuration(duration);
- animation->setDirection(Animation::AnimationDirectionAlternate);
- animation->setIterationCount(2);
-
- IntSize boxSize;
- m_graphicsLayer->addAnimation(values, boxSize, animation.get(), "", 0);
-
- EXPECT_TRUE(m_platformLayer->layerAnimationController()->hasActiveAnimation());
-
- CCActiveAnimation* activeAnimation = m_platformLayer->layerAnimationController()->getActiveAnimation(CCActiveAnimation::Transform);
- EXPECT_TRUE(activeAnimation);
- EXPECT_TRUE(activeAnimation->alternatesDirection());
-
- EXPECT_EQ(2, activeAnimation->iterations());
- EXPECT_EQ(CCActiveAnimation::Transform, activeAnimation->targetProperty());
-
- EXPECT_EQ(CCAnimationCurve::Transform, activeAnimation->curve()->type());
-
- const CCTransformAnimationCurve* curve = activeAnimation->curve()->toTransformAnimationCurve();
- EXPECT_TRUE(curve);
-
- expectTranslateX(2, curve->getValue(0));
- expectTranslateX(4, curve->getValue(duration));
-}
-
-TEST_F(GraphicsLayerChromiumTest, createReversedAlternatingAnimation)
-{
- const double duration = 1;
- WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
-
- TransformOperations operations1;
- operations1.operations().append(TranslateTransformOperation::create(Length(2, WebCore::Fixed), Length(0, WebCore::Fixed), TransformOperation::TRANSLATE_X));
- values.insert(new TransformAnimationValue(0, &operations1));
-
- TransformOperations operations2;
- operations2.operations().append(TranslateTransformOperation::create(Length(4, WebCore::Fixed), Length(0, WebCore::Fixed), TransformOperation::TRANSLATE_X));
- values.insert(new TransformAnimationValue(duration, &operations2));
-
- RefPtr<Animation> animation = Animation::create();
- animation->setDuration(duration);
- animation->setDirection(Animation::AnimationDirectionAlternateReverse);
- animation->setIterationCount(2);
-
- IntSize boxSize;
- m_graphicsLayer->addAnimation(values, boxSize, animation.get(), "", 0);
-
- EXPECT_TRUE(m_platformLayer->layerAnimationController()->hasActiveAnimation());
-
- CCActiveAnimation* activeAnimation = m_platformLayer->layerAnimationController()->getActiveAnimation(CCActiveAnimation::Transform);
- EXPECT_TRUE(activeAnimation);
- EXPECT_TRUE(activeAnimation->alternatesDirection());
-
- EXPECT_EQ(2, activeAnimation->iterations());
- EXPECT_EQ(CCActiveAnimation::Transform, activeAnimation->targetProperty());
-
- EXPECT_EQ(CCAnimationCurve::Transform, activeAnimation->curve()->type());
-
- const CCTransformAnimationCurve* curve = activeAnimation->curve()->toTransformAnimationCurve();
- EXPECT_TRUE(curve);
-
- expectTranslateX(4, curve->getValue(0));
- expectTranslateX(2, curve->getValue(duration));
-}
-
TEST_F(GraphicsLayerChromiumTest, shouldStartWithCorrectContentsScale)
{
- EXPECT_EQ(2, m_platformLayer->contentsScale());
+ EXPECT_EQ(2, m_graphicsLayer->contentsScale());
}
} // namespace
diff --git a/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp b/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp
index 91df126a5..1d395096a 100644
--- a/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp
+++ b/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp
@@ -51,7 +51,7 @@ public:
m_wasErrorCalled = true;
}
virtual void onSuccess(PassRefPtr<DOMStringList>) { }
- virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>) { }
+ virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey>, PassRefPtr<SerializedScriptValue>) { }
virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>)
{
EXPECT_TRUE(false);
@@ -60,7 +60,7 @@ public:
virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>) { }
virtual void onSuccess(PassRefPtr<SerializedScriptValue>) { }
virtual void onSuccess(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, const IDBKeyPath&) { }
- virtual void onSuccessWithContinuation() { }
+ virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey>, PassRefPtr<SerializedScriptValue>) { };
virtual void onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<SerializedScriptValue> >&) { }
virtual void onBlocked() { }
private:
@@ -102,7 +102,8 @@ TEST(IDBAbortTest, TheTest)
const String& name = "db name";
MockIDBCallbacks callbacks;
RefPtr<SecurityOrigin> origin = SecurityOrigin::create("http", "localhost", 81);
- factory->open(name, &callbacks, origin, 0 /*Frame*/, String() /*path*/);
+ const int64_t DummyVersion = 2;
+ factory->open(name, DummyVersion, &callbacks, origin, 0 /*Frame*/, String() /*path*/);
}
} // namespace
diff --git a/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp b/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp
index 5c01e9ecc..8605c0f1a 100644
--- a/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp
+++ b/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp
@@ -77,7 +77,7 @@ public:
}
virtual void onError(PassRefPtr<IDBDatabaseError>) OVERRIDE { }
virtual void onSuccess(PassRefPtr<DOMStringList>) OVERRIDE { }
- virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>) OVERRIDE { }
+ virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey>, PassRefPtr<SerializedScriptValue>) OVERRIDE { }
virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>) OVERRIDE
{
m_wasSuccessDBCalled = true;
@@ -86,7 +86,7 @@ public:
virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>) OVERRIDE { }
virtual void onSuccess(PassRefPtr<SerializedScriptValue>) OVERRIDE { }
virtual void onSuccess(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, const IDBKeyPath&) OVERRIDE { };
- virtual void onSuccessWithContinuation() OVERRIDE { }
+ virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey>, PassRefPtr<SerializedScriptValue>) OVERRIDE { };
virtual void onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<SerializedScriptValue> >&) OVERRIDE { }
virtual void onBlocked() OVERRIDE { }
private:
@@ -100,6 +100,7 @@ public:
static PassRefPtr<FakeIDBDatabaseCallbacks> create() { return adoptRef(new FakeIDBDatabaseCallbacks()); }
virtual ~FakeIDBDatabaseCallbacks() { }
virtual void onVersionChange(const String& version) OVERRIDE { }
+ virtual void onVersionChange(int64_t oldVersion, int64_t newVersion) OVERRIDE { }
private:
FakeIDBDatabaseCallbacks() { }
};
diff --git a/Source/WebKit/chromium/tests/IDBRequestTest.cpp b/Source/WebKit/chromium/tests/IDBRequestTest.cpp
index 0f3b77527..77757193b 100644
--- a/Source/WebKit/chromium/tests/IDBRequestTest.cpp
+++ b/Source/WebKit/chromium/tests/IDBRequestTest.cpp
@@ -51,12 +51,12 @@ TEST(IDBRequestTest, EventsAfterStopping)
request->onError(IDBDatabaseError::create(IDBDatabaseException::IDB_ABORT_ERR, "Description goes here."));
request->onSuccess(DOMStringList::create());
request->onSuccess(PassRefPtr<IDBDatabaseBackendInterface>());
- request->onSuccess(PassRefPtr<IDBCursorBackendInterface>());
+ request->onSuccess(PassRefPtr<IDBCursorBackendInterface>(), IDBKey::createInvalid(), IDBKey::createInvalid(), SerializedScriptValue::nullValue());
request->onSuccess(IDBKey::createInvalid());
request->onSuccess(PassRefPtr<IDBTransactionBackendInterface>());
request->onSuccess(SerializedScriptValue::nullValue());
request->onSuccess(SerializedScriptValue::nullValue(), IDBKey::createInvalid(), IDBKeyPath());
- request->onSuccessWithContinuation();
+ request->onSuccess(IDBKey::createInvalid(), IDBKey::createInvalid(), SerializedScriptValue::nullValue());
}
} // namespace
diff --git a/Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp
index a5ca55124..4948f97cc 100644
--- a/Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp
@@ -122,13 +122,13 @@ TEST(ImageLayerChromiumTest, opaqueImages)
RefPtr<Image> nonOpaqueImage = TestImage::create(IntSize(100, 100), false);
ASSERT_TRUE(nonOpaqueImage.get());
- ASSERT_TRUE(graphicsLayer->contentsLayer().isNull());
+ ASSERT_FALSE(graphicsLayer->contentsLayer());
graphicsLayer->setContentsToImage(opaqueImage.get());
- ASSERT_TRUE(graphicsLayer->contentsLayer().opaque());
+ ASSERT_TRUE(graphicsLayer->contentsLayer()->opaque());
graphicsLayer->setContentsToImage(nonOpaqueImage.get());
- ASSERT_FALSE(graphicsLayer->contentsLayer().opaque());
+ ASSERT_FALSE(graphicsLayer->contentsLayer()->opaque());
}
} // namespace
diff --git a/Source/WebKit/chromium/tests/LayerChromiumTest.cpp b/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
index 1a14d75bc..b9025b4c8 100644
--- a/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
@@ -26,12 +26,12 @@
#include "LayerChromium.h"
+#include "CCLayerImpl.h"
+#include "CCLayerTreeHost.h"
#include "CCLayerTreeTestCommon.h"
+#include "CCSingleThreadProxy.h"
#include "FakeCCLayerTreeHostClient.h"
#include "LayerPainterChromium.h"
-#include "cc/CCLayerImpl.h"
-#include "cc/CCLayerTreeHost.h"
-#include "cc/CCSingleThreadProxy.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <public/WebCompositor.h>
@@ -79,13 +79,11 @@ protected:
{
// Initialize without threading support.
WebKit::WebCompositor::initialize(0);
- DebugScopedSetMainThread main;
m_layerTreeHost = adoptPtr(new MockCCLayerTreeHost);
}
virtual void TearDown()
{
- DebugScopedSetMainThread main;
Mock::VerifyAndClearExpectations(m_layerTreeHost.get());
EXPECT_CALL(*m_layerTreeHost, setNeedsCommit()).Times(AnyNumber());
m_parent.clear();
@@ -638,7 +636,6 @@ void assertLayerTreeHostMatchesForSubtree(LayerChromium* layer, CCLayerTreeHost*
TEST(LayerChromiumLayerTreeHostTest, enteringTree)
{
WebKit::WebCompositor::initialize(0);
- DebugScopedSetMainThread main;
RefPtr<LayerChromium> parent = LayerChromium::create();
RefPtr<LayerChromium> child = LayerChromium::create();
RefPtr<LayerChromium> mask = LayerChromium::create();
@@ -671,7 +668,6 @@ TEST(LayerChromiumLayerTreeHostTest, enteringTree)
TEST(LayerChromiumLayerTreeHostTest, addingLayerSubtree)
{
WebKit::WebCompositor::initialize(0);
- DebugScopedSetMainThread main;
RefPtr<LayerChromium> parent = LayerChromium::create();
OwnPtr<FakeCCLayerTreeHost> layerTreeHost(FakeCCLayerTreeHost::create());
@@ -703,7 +699,6 @@ TEST(LayerChromiumLayerTreeHostTest, addingLayerSubtree)
TEST(LayerChromiumLayerTreeHostTest, changeHost)
{
WebKit::WebCompositor::initialize(0);
- DebugScopedSetMainThread main;
RefPtr<LayerChromium> parent = LayerChromium::create();
RefPtr<LayerChromium> child = LayerChromium::create();
RefPtr<LayerChromium> mask = LayerChromium::create();
@@ -737,7 +732,6 @@ TEST(LayerChromiumLayerTreeHostTest, changeHost)
TEST(LayerChromiumLayerTreeHostTest, changeHostInSubtree)
{
WebKit::WebCompositor::initialize(0);
- DebugScopedSetMainThread main;
RefPtr<LayerChromium> firstParent = LayerChromium::create();
RefPtr<LayerChromium> firstChild = LayerChromium::create();
RefPtr<LayerChromium> secondParent = LayerChromium::create();
@@ -775,7 +769,6 @@ TEST(LayerChromiumLayerTreeHostTest, changeHostInSubtree)
TEST(LayerChromiumLayerTreeHostTest, replaceMaskAndReplicaLayer)
{
WebKit::WebCompositor::initialize(0);
- DebugScopedSetMainThread main;
RefPtr<LayerChromium> parent = LayerChromium::create();
RefPtr<LayerChromium> mask = LayerChromium::create();
RefPtr<LayerChromium> replica = LayerChromium::create();
diff --git a/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp b/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp
index c4bddc5fb..36eddc534 100644
--- a/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp
@@ -25,18 +25,17 @@
#include "config.h"
#include "LayerRendererChromium.h"
+#include "CCDrawQuad.h"
+#include "CCPrioritizedTextureManager.h"
+#include "CCSettings.h"
+#include "CCSingleThreadProxy.h"
#include "CCTestCommon.h"
#include "FakeWebCompositorOutputSurface.h"
#include "FakeWebGraphicsContext3D.h"
#include "GraphicsContext3D.h"
-#include "cc/CCDrawQuad.h"
-#include "cc/CCPrioritizedTextureManager.h"
-#include "cc/CCSettings.h"
-#include "cc/CCSingleThreadProxy.h"
-#include <public/WebCompositor.h>
-
#include <gmock/gmock.h>
#include <gtest/gtest.h>
+#include <public/WebCompositor.h>
using namespace WebCore;
using namespace WebKit;
diff --git a/Source/WebKit/chromium/tests/LocaleWinTest.cpp b/Source/WebKit/chromium/tests/LocaleWinTest.cpp
index 5f5642e91..32aaa53d7 100644
--- a/Source/WebKit/chromium/tests/LocaleWinTest.cpp
+++ b/Source/WebKit/chromium/tests/LocaleWinTest.cpp
@@ -211,7 +211,10 @@ TEST_F(LocaleWinTest, TestFormat)
EXPECT_STREQ("Jan-1-0001", locale->formatDate("MMM-d-yyyy", 2012, 1, January, 1).utf8().data());
EXPECT_STREQ("Sep-13-275760", locale->formatDate("MMM-d-yyyy", 2012, 275760, September, 13).utf8().data());
-
+
+ OwnPtr<LocaleWin> persian = LocaleWin::create(Persian);
+ // U+06F0 U+06F1 / U+06F0 U+06F8 / U+06F0 U+06F0 U+06F0 U+06F2
+ EXPECT_STREQ("\xDB\xB0\xDB\xB1/\xDB\xB0\xDB\xB8/\xDB\xB0\xDB\xB0\xDB\xB0\xDB\xB1", persian->formatDate("dd/MM/yyyy", 2012, 1, August, 1).utf8().data());
// For the following test, we'd like to confirm they don't crash and their
// results are not important because we can assume invalid arguments are
@@ -255,6 +258,10 @@ TEST_F(LocaleWinTest, TestParse)
EXPECT_TRUE(isnan(locale->parseDate("MMMM/d/y", 2012, "November 27 2")));
EXPECT_TRUE(isnan(locale->parseDate("MMMM/d/y", 2012, "November 32 2")));
EXPECT_TRUE(isnan(locale->parseDate("MMMM/d/y", 2012, "-1/-1/-1")));
+
+ OwnPtr<LocaleWin> persian = LocaleWin::create(Persian);
+ // U+06F1 U+06F6 / U+06F0 U+06F8 / 2012
+ EXPECT_EQ(msForDate(2012, August, 16), persian->parseDate("dd/MM/yyyy", 2012, String::fromUTF8("\xDB\xB1\xDB\xB6/\xDB\xB0\xDB\xB8/2012")));
}
TEST_F(LocaleWinTest, formatDate)
diff --git a/Source/WebKit/chromium/tests/MockCCQuadCuller.h b/Source/WebKit/chromium/tests/MockCCQuadCuller.h
index 15cb19d6c..7f6e0f85a 100644
--- a/Source/WebKit/chromium/tests/MockCCQuadCuller.h
+++ b/Source/WebKit/chromium/tests/MockCCQuadCuller.h
@@ -25,9 +25,9 @@
#ifndef MockCCQuadCuller_h
#define MockCCQuadCuller_h
+#include "CCDrawQuad.h"
+#include "CCQuadSink.h"
#include "IntRect.h"
-#include "cc/CCDrawQuad.h"
-#include "cc/CCQuadSink.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
diff --git a/Source/WebKit/chromium/tests/PlatformGestureCurveTest.cpp b/Source/WebKit/chromium/tests/PlatformGestureCurveTest.cpp
index 362727c04..4f0a2276f 100644
--- a/Source/WebKit/chromium/tests/PlatformGestureCurveTest.cpp
+++ b/Source/WebKit/chromium/tests/PlatformGestureCurveTest.cpp
@@ -28,11 +28,11 @@
#include "PlatformGestureCurve.h"
#include "ActivePlatformGestureAnimation.h"
+#include "CCActiveGestureAnimation.h"
+#include "CCGestureCurve.h"
#include "PlatformGestureCurveTarget.h"
#include "TouchpadFlingPlatformGestureCurve.h"
#include "WheelFlingPlatformGestureCurve.h"
-#include "cc/CCActiveGestureAnimation.h"
-#include "cc/CCGestureCurve.h"
#include <gtest/gtest.h>
#include <wtf/OwnPtr.h>
diff --git a/Source/WebKit/chromium/tests/PopupContainerTest.cpp b/Source/WebKit/chromium/tests/PopupContainerTest.cpp
new file mode 100644
index 000000000..a721b4cbb
--- /dev/null
+++ b/Source/WebKit/chromium/tests/PopupContainerTest.cpp
@@ -0,0 +1,159 @@
+/*
+ * 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 "PopupContainer.h"
+
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+
+class MockPopupContent : public PopupContent {
+public:
+ virtual void setMaxHeight(int max) OVERRIDE { maxHeight = max; }
+ virtual int popupContentHeight() const OVERRIDE { return height; }
+ virtual ~MockPopupContent() { }
+
+ virtual void layout() OVERRIDE
+ {
+ layoutCount++;
+ width = std::min(maxWidth, width);
+ height = std::min(maxHeight, height);
+ height -= height % 16;
+ }
+
+ virtual void setMaxWidthAndLayout(int max) OVERRIDE
+ {
+ maxWidth = max;
+ layout();
+ }
+
+ MockPopupContent(const IntSize& widgetSize)
+ : width(widgetSize.width() - borderSize * 2)
+ , height(widgetSize.height() - borderSize * 2)
+ , maxWidth(width)
+ , maxHeight(height)
+ , layoutCount(0)
+ {
+ }
+
+ int width;
+ int height;
+ int maxWidth;
+ int maxHeight;
+ unsigned layoutCount;
+
+ static const int borderSize = 1; // Should match to kBorderSize in PopupContainer.cpp.
+};
+
+const int screenMaxX = 1024;
+const int screenMaxY = 768;
+const int targetControlWidth = 130;
+
+static IntRect calculatePosition(const IntRect& initialRect, PopupContent* content)
+{
+ const bool isRTL = true;
+ const int targetControlHeight = 20;
+ const FloatRect screenRect(0, 0, screenMaxX, screenMaxY);
+ const FloatRect windowRect(0, 0, 512, 512);
+ int rtlOffset = targetControlWidth - initialRect.width();
+ bool needToResizeView = false;
+ return PopupContainer::layoutAndCalculateWidgetRectInternal(initialRect, targetControlHeight, windowRect, screenRect, !isRTL, rtlOffset, content, needToResizeView);
+}
+
+TEST(PopupContainerTest, PopupPosition)
+{
+ // Suppose that initialRect.location is the bottom-left corner of the target
+ // control such as <select>.
+
+ {
+ // If initialRect is in the screen, nothing should happen.
+ IntRect initialRect(100, 100, 256, 258);
+ MockPopupContent content(initialRect.size());
+ IntRect resultRect = calculatePosition(initialRect, &content);
+ EXPECT_EQ(initialRect, resultRect);
+ EXPECT_EQ(0u, content.layoutCount);
+ }
+
+ {
+ // If the left edge of the control is projecting from the screen, making
+ // the widget aligned to the right edge of the control.
+ IntRect initialRect(-10, 100, 100, 258);
+ MockPopupContent content(initialRect.size());
+ IntRect resultRect = calculatePosition(initialRect, &content);
+ EXPECT_EQ(IntRect(20, 100, 100, 258), resultRect);
+ }
+
+ {
+ // Made the widget aligned to the right edge. But it's still projecting
+ // from the screen.
+ IntRect initialRect(-10, 100, targetControlWidth, 258);
+ MockPopupContent content(initialRect.size());
+ IntRect resultRect = calculatePosition(initialRect, &content);
+ EXPECT_EQ(IntRect(0, 100, 120, 258), resultRect);
+ EXPECT_EQ(118, content.width);
+ EXPECT_TRUE(content.layoutCount);
+ }
+
+ {
+ // If the right edge of the control is projecting from the screen,
+ // shrink the width of the widget.
+ IntRect initialRect(screenMaxX - 100, 100, targetControlWidth, 258);
+ MockPopupContent content(initialRect.size());
+ IntRect resultRect = calculatePosition(initialRect, &content);
+ EXPECT_EQ(IntRect(screenMaxX - 100, 100, 100, 258), resultRect);
+ EXPECT_EQ(98, content.width);
+ EXPECT_TRUE(content.layoutCount);
+ }
+
+ {
+ // If there is no enough room below, move the widget upwards.
+ IntRect initialRect(100, 700, targetControlWidth, 258);
+ MockPopupContent content(initialRect.size());
+ IntRect resultRect = calculatePosition(initialRect, &content);
+ EXPECT_EQ(IntRect(100, 422, targetControlWidth, 258), resultRect);
+ EXPECT_EQ(0u, content.layoutCount);
+ }
+
+ {
+ // There is no enough room below and above, and the below space is larger.
+ IntRect initialRect(100, 300, targetControlWidth, 514);
+ MockPopupContent content(initialRect.size());
+ IntRect resultRect = calculatePosition(initialRect, &content);
+ EXPECT_EQ(IntRect(100, 300, targetControlWidth, 466), resultRect);
+ EXPECT_TRUE(content.layoutCount);
+ EXPECT_EQ(464, content.height);
+ }
+
+ {
+ // There is no enough room below and above, and the above space is larger.
+ IntRect initialRect(100, 400, targetControlWidth, 514);
+ MockPopupContent content(initialRect.size());
+ IntRect resultRect = calculatePosition(initialRect, &content);
+ EXPECT_EQ(IntRect(100, 10, targetControlWidth, 370), resultRect);
+ EXPECT_TRUE(content.layoutCount);
+ EXPECT_EQ(368, content.height);
+ }
+}
diff --git a/Source/WebKit/chromium/tests/ScrollbarLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/ScrollbarLayerChromiumTest.cpp
index 0e3b1fbdb..6242043b3 100644
--- a/Source/WebKit/chromium/tests/ScrollbarLayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/ScrollbarLayerChromiumTest.cpp
@@ -26,13 +26,13 @@
#include "ScrollbarLayerChromium.h"
+#include "CCScrollbarAnimationController.h"
+#include "CCScrollbarLayerImpl.h"
+#include "CCSingleThreadProxy.h"
#include "FakeWebScrollbarThemeGeometry.h"
#include "Scrollbar.h"
#include "Settings.h"
#include "TreeSynchronizer.h"
-#include "cc/CCScrollbarAnimationController.h"
-#include "cc/CCScrollbarLayerImpl.h"
-#include "cc/CCSingleThreadProxy.h"
#include <gtest/gtest.h>
#include <public/WebScrollbar.h>
#include <public/WebScrollbarThemeGeometry.h>
diff --git a/Source/WebKit/chromium/tests/TextureLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/TextureLayerChromiumTest.cpp
index 54e253995..a4830e53f 100644
--- a/Source/WebKit/chromium/tests/TextureLayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/TextureLayerChromiumTest.cpp
@@ -26,8 +26,8 @@
#include "TextureLayerChromium.h"
+#include "CCLayerTreeHost.h"
#include "FakeCCLayerTreeHostClient.h"
-#include "cc/CCLayerTreeHost.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <public/WebCompositor.h>
diff --git a/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
index bab7168c4..689b817af 100644
--- a/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
@@ -29,14 +29,14 @@
#include "BitmapCanvasLayerTextureUpdater.h"
#include "CCAnimationTestCommon.h"
#include "CCLayerTreeTestCommon.h"
+#include "CCOverdrawMetrics.h"
+#include "CCRenderingStats.h"
+#include "CCSingleThreadProxy.h" // For DebugScopedSetImplThread
+#include "CCTextureUpdateController.h"
#include "CCTiledLayerTestCommon.h"
#include "FakeCCGraphicsContext.h"
#include "FakeCCLayerTreeHostClient.h"
#include "LayerPainterChromium.h"
-#include "cc/CCOverdrawMetrics.h"
-#include "cc/CCRenderingStats.h"
-#include "cc/CCSingleThreadProxy.h" // For DebugScopedSetImplThread
-#include "cc/CCTextureUpdateController.h"
#include <gtest/gtest.h>
#include <public/WebCompositor.h>
#include <public/WebTransformationMatrix.h>
@@ -497,6 +497,72 @@ TEST_F(TiledLayerChromiumTest, pushTilesLayerMarkedDirtyDuringPaintOnPreviousLay
EXPECT_TRUE(layer2Impl->hasTileAt(0, 1));
}
+TEST_F(TiledLayerChromiumTest, paintSmallAnimatedLayersImmediately)
+{
+ // Create a CCLayerTreeHost that has the right viewportsize,
+ // so the layer is considered small enough.
+ WebKit::WebCompositor::initialize(0);
+ FakeCCLayerTreeHostClient fakeCCLayerTreeHostClient;
+ OwnPtr<CCLayerTreeHost> ccLayerTreeHost = CCLayerTreeHost::create(&fakeCCLayerTreeHostClient, CCLayerTreeSettings());
+
+ bool runOutOfMemory[2] = {false, true};
+ for (int i = 0; i < 2; i++) {
+ // Create a layer with 4x4 tiles.
+ int layerWidth = 4 * FakeTiledLayerChromium::tileSize().width();
+ int layerHeight = 4 * FakeTiledLayerChromium::tileSize().height();
+ int memoryForLayer = layerWidth * layerHeight * 4;
+ IntSize viewportSize = IntSize(layerWidth, layerHeight);
+ ccLayerTreeHost->setViewportSize(viewportSize, viewportSize);
+
+ // Use 8x4 tiles to run out of memory.
+ if (runOutOfMemory[i])
+ layerWidth *= 2;
+
+ OwnPtr<CCPrioritizedTextureManager> textureManager = CCPrioritizedTextureManager::create(memoryForLayer, 1024, CCRenderer::ContentPool);
+ DebugScopedSetImplThread implThread;
+
+ RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
+ OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(1)));
+
+ // Full size layer with half being visible.
+ IntSize contentBounds(layerWidth, layerHeight);
+ IntRect contentRect(IntPoint::zero(), contentBounds);
+ IntRect visibleRect(IntPoint::zero(), IntSize(layerWidth / 2, layerHeight));
+
+ // Pretend the layer is animating.
+ layer->setDrawTransformIsAnimating(true);
+ layer->setBounds(contentBounds);
+ layer->setVisibleContentRect(visibleRect);
+ layer->invalidateContentRect(contentRect);
+ layer->setLayerTreeHost(ccLayerTreeHost.get());
+
+ // The layer should paint it's entire contents on the first paint
+ // if it is close to the viewport size and has the available memory.
+ layer->setTexturePriorities(m_priorityCalculator);
+ textureManager->prioritizeTextures();
+ layer->updateContentRect(m_queue, visibleRect, 0, m_stats);
+ updateTextures();
+ layer->pushPropertiesTo(layerImpl.get());
+
+ // We should have all the tiles for the small animated layer.
+ // We should still have the visible tiles when we didn't
+ // have enough memory for all the tiles.
+ if (!runOutOfMemory[i]) {
+ for (int i = 0; i < 4; ++i) {
+ for (int j = 0; j < 4; ++j)
+ EXPECT_TRUE(layerImpl->hasTileAt(i, j));
+ }
+ } else {
+ for (int i = 0; i < 8; ++i) {
+ for (int j = 0; j < 4; ++j)
+ EXPECT_EQ(layerImpl->hasTileAt(i, j), i < 4);
+ }
+ }
+ }
+ ccLayerTreeHost.clear();
+ WebKit::WebCompositor::shutdown();
+}
+
TEST_F(TiledLayerChromiumTest, idlePaintOutOfMemory)
{
// The tile size is 100x100. Setup 3x3 tiles with one 1x1 visible tile in the center.
@@ -581,108 +647,47 @@ TEST_F(TiledLayerChromiumTest, idlePaintNonVisibleLayers)
IntSize contentBounds(100, 100);
IntRect contentRect(IntPoint::zero(), contentBounds);
- OwnPtr<CCPrioritizedTextureManager> textureManager = CCPrioritizedTextureManager::create(20000, 1024, CCRenderer::ContentPool);
+ OwnPtr<CCPrioritizedTextureManager> textureManager = CCPrioritizedTextureManager::create(4*1024*1024, 1024, CCRenderer::ContentPool);
RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
DebugScopedSetImplThread implThread;
OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(1)));
-
- // Invalidate the layer but make none of it visible, so nothing paints.
- IntRect visibleRect;
-
layer->setBounds(contentBounds);
- layer->setVisibleContentRect(visibleRect);
- layer->invalidateContentRect(contentRect);
-
- for (int i = 0; i < 2; i++) {
- // Paint / idle-paint.
- layer->setTexturePriorities(m_priorityCalculator);
- textureManager->prioritizeTextures();
- layer->updateContentRect(m_queue, visibleRect, 0, m_stats);
-
- // Non-visible layers don't need idle paint.
- EXPECT_FALSE(layer->needsIdlePaint(visibleRect));
-
- layer->pushPropertiesTo(layerImpl.get());
-
- // We should not have any tiles pushed since the layer is not visible.
- EXPECT_FALSE(layerImpl->hasTileAt(0, 0));
- }
-}
-static void testHaveOuterTiles(FakeCCTiledLayerImpl* layerImpl, int width, int height, int have)
-{
- for (int i = 0; i < width; ++i) {
- for (int j = 0; j < height; ++j) {
- bool hasTile = i < have || j < have || i >= width - have || j >= height - have;
- EXPECT_EQ(hasTile, layerImpl->hasTileAt(i, j));
- }
- }
-}
+ // Alternate between not visible and visible.
+ IntRect v(0, 0, 100, 100);
+ IntRect nv(0, 0, 0, 0);
+ IntRect visibleRect[10] = {nv, nv, v, v, nv, nv, v, v, nv, nv};
+ bool invalidate[10] = {true, true, true, true, true, true, true, true, false, false };
-TEST_F(TiledLayerChromiumTest, idlePaintNonVisibleAnimatingLayers)
-{
- OwnPtr<CCPrioritizedTextureManager> textureManager = CCPrioritizedTextureManager::create(8000*8000*8, 1024, CCRenderer::ContentPool);
- DebugScopedSetImplThread implThread;
+ // We should not have any tiles except for when the layer was visible
+ // or after the layer was visible and we didn't invalidate.
+ bool haveTile[10] = { false, false, true, true, false, false, true, true, true, true };
- int tileWidth = FakeTiledLayerChromium::tileSize().width();
- int tileHeight = FakeTiledLayerChromium::tileSize().height();
- int width[] = { 1, 2, 3, 4, 9, 10, 0 };
- int height[] = { 1, 2, 3, 4, 9, 10, 0 };
+ for (int i = 0; i < 10; i++) {
+ layer->setVisibleContentRect(visibleRect[i]);
- for (int j = 0; height[j]; ++j) {
- for (int i = 0; width[i]; ++i) {
- RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
- OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(1)));
-
- // Pretend the layer is animating.
- layer->setDrawTransformIsAnimating(true);
-
- IntSize contentBounds(width[i] * tileWidth, height[j] * tileHeight);
- IntRect contentRect(IntPoint::zero(), contentBounds);
- IntRect visibleRect;
-
- layer->setBounds(contentBounds);
- layer->setVisibleContentRect(visibleRect);
+ // Skip invalidation once to insure the tile stays in memory while not visible.
+ if (invalidate[i])
layer->invalidateContentRect(contentRect);
- layer->setTexturePriorities(m_priorityCalculator);
- textureManager->prioritizeTextures();
-
- // If idlePaintRect gives back a non-empty result then we should paint it. Otherwise,
- // we shoud paint nothing.
- bool shouldPrepaint = !layer->idlePaintRect(visibleRect).isEmpty();
-
- // Normally we don't allow non-visible layers to pre-paint, but if they are animating then we should.
- EXPECT_EQ(shouldPrepaint, layer->needsIdlePaint(visibleRect));
-
- // If the layer is to be prepainted at all, then after four updates we should have the outer row/columns painted.
- for (int k = 0; k < 4; ++k) {
- layer->setTexturePriorities(m_priorityCalculator);
- textureManager->prioritizeTextures();
-
- layer->updateContentRect(m_queue, visibleRect, 0, m_stats);
- updateTextures();
- layer->pushPropertiesTo(layerImpl.get());
- }
-
- testHaveOuterTiles(layerImpl.get(), width[i], height[j], shouldPrepaint ? 1 : 0);
+ // Paint / idle-paint.
+ textureManager->clearPriorities();
+ layer->setTexturePriorities(m_priorityCalculator);
+ textureManager->prioritizeTextures();
+ layer->updateContentRect(m_queue, visibleRect[i], 0, m_stats);
- // We don't currently idle paint past the outermost tiles.
- EXPECT_FALSE(layer->needsIdlePaint(visibleRect));
- for (int k = 0; k < 4; ++k) {
- layer->setTexturePriorities(m_priorityCalculator);
- textureManager->prioritizeTextures();
+ updateTextures();
- layer->updateContentRect(m_queue, visibleRect, 0, m_stats);
- updateTextures();
- layer->pushPropertiesTo(layerImpl.get());
- }
+ // We should never signal idle paint, as we painted the entire layer
+ // or the layer was not visible.
+ EXPECT_FALSE(layer->needsIdlePaint(visibleRect[i]));
- testHaveOuterTiles(layerImpl.get(), width[i], height[j], shouldPrepaint ? 1 : 0);
- }
+ layer->pushPropertiesTo(layerImpl.get());
+ EXPECT_EQ(layerImpl->hasTileAt(0, 0), haveTile[i]);
}
}
+
TEST_F(TiledLayerChromiumTest, invalidateFromPrepare)
{
OwnPtr<CCPrioritizedTextureManager> textureManager = CCPrioritizedTextureManager::create(4*1024*1024, 1024, CCRenderer::ContentPool);
diff --git a/Source/WebKit/chromium/tests/TreeSynchronizerTest.cpp b/Source/WebKit/chromium/tests/TreeSynchronizerTest.cpp
index 08597f1dc..20e378fba 100644
--- a/Source/WebKit/chromium/tests/TreeSynchronizerTest.cpp
+++ b/Source/WebKit/chromium/tests/TreeSynchronizerTest.cpp
@@ -27,12 +27,12 @@
#include "TreeSynchronizer.h"
#include "CCAnimationTestCommon.h"
+#include "CCLayerAnimationController.h"
+#include "CCLayerImpl.h"
+#include "CCProxy.h"
+#include "CCSingleThreadProxy.h"
#include "LayerChromium.h"
#include "Region.h"
-#include "cc/CCLayerAnimationController.h"
-#include "cc/CCLayerImpl.h"
-#include "cc/CCProxy.h"
-#include "cc/CCSingleThreadProxy.h"
#include <gtest/gtest.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/tests/WebAnimationTest.cpp b/Source/WebKit/chromium/tests/WebAnimationTest.cpp
index c2ccc4503..a682ab020 100644
--- a/Source/WebKit/chromium/tests/WebAnimationTest.cpp
+++ b/Source/WebKit/chromium/tests/WebAnimationTest.cpp
@@ -47,13 +47,13 @@ namespace {
TEST(WebAnimationTest, MAYBE_DefaultSettings)
{
WebFloatAnimationCurve curve;
- WebAnimation animation(curve, WebAnimation::TargetPropertyOpacity);
+ OwnPtr<WebAnimation> animation = adoptPtr(WebAnimation::create(curve, WebAnimation::TargetPropertyOpacity));
// Ensure that the defaults are correct.
- EXPECT_EQ(1, animation.iterations());
- EXPECT_EQ(0, animation.startTime());
- EXPECT_EQ(0, animation.timeOffset());
- EXPECT_FALSE(animation.alternatesDirection());
+ EXPECT_EQ(1, animation->iterations());
+ EXPECT_EQ(0, animation->startTime());
+ EXPECT_EQ(0, animation->timeOffset());
+ EXPECT_FALSE(animation->alternatesDirection());
}
// Linux/Win bots failed on this test.
@@ -68,16 +68,16 @@ TEST(WebAnimationTest, MAYBE_DefaultSettings)
TEST(WebAnimationTest, MAYBE_ModifiedSettings)
{
WebFloatAnimationCurve curve;
- WebAnimation animation(curve, WebAnimation::TargetPropertyOpacity);
- animation.setIterations(2);
- animation.setStartTime(2);
- animation.setTimeOffset(2);
- animation.setAlternatesDirection(true);
+ OwnPtr<WebAnimation> animation = adoptPtr(WebAnimation::create(curve, WebAnimation::TargetPropertyOpacity));
+ animation->setIterations(2);
+ animation->setStartTime(2);
+ animation->setTimeOffset(2);
+ animation->setAlternatesDirection(true);
- EXPECT_EQ(2, animation.iterations());
- EXPECT_EQ(2, animation.startTime());
- EXPECT_EQ(2, animation.timeOffset());
- EXPECT_TRUE(animation.alternatesDirection());
+ EXPECT_EQ(2, animation->iterations());
+ EXPECT_EQ(2, animation->startTime());
+ EXPECT_EQ(2, animation->timeOffset());
+ EXPECT_TRUE(animation->alternatesDirection());
}
} // namespace
diff --git a/Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp b/Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp
index 902fac981..8313b0f5b 100644
--- a/Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp
+++ b/Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp
@@ -27,11 +27,11 @@
#include "WebCompositorInputHandlerImpl.h"
+#include "CCActiveGestureAnimation.h"
+#include "CCInputHandler.h"
+#include "CCSingleThreadProxy.h"
#include "WebCompositorInputHandlerClient.h"
#include "WebInputEvent.h"
-#include "cc/CCActiveGestureAnimation.h"
-#include "cc/CCInputHandler.h"
-#include "cc/CCSingleThreadProxy.h"
#include <public/WebCompositor.h>
#include <public/WebFloatPoint.h>
#include <public/WebPoint.h>
@@ -60,7 +60,7 @@ public:
MOCK_METHOD0(scheduleAnimation, void());
MOCK_METHOD2(scrollBegin, ScrollStatus(const WebCore::IntPoint&, WebCore::CCInputHandlerClient::ScrollInputType));
- MOCK_METHOD1(scrollBy, void(const WebCore::IntSize&));
+ MOCK_METHOD2(scrollBy, void(const WebCore::IntPoint&, const WebCore::IntSize&));
MOCK_METHOD0(scrollEnd, void());
private:
@@ -117,12 +117,24 @@ TEST(WebCompositorInputHandlerImpl, fromIdentifier)
WebCompositor::shutdown();
}
+class WebCompositorInitializer {
+public:
+ WebCompositorInitializer()
+ {
+ WebCompositor::initialize(0);
+ }
+
+ ~WebCompositorInitializer()
+ {
+ WebCompositor::shutdown();
+ }
+};
+
class WebCompositorInputHandlerImplTest : public testing::Test {
public:
WebCompositorInputHandlerImplTest()
: m_expectedDisposition(DidHandle)
{
- WebCompositor::initialize(0);
m_inputHandler = WebCompositorInputHandlerImpl::create(&m_mockCCInputHandlerClient);
m_inputHandler->setClient(&m_mockClient);
}
@@ -131,7 +143,6 @@ public:
{
m_inputHandler->setClient(0);
m_inputHandler.clear();
- WebCompositor::shutdown();
}
// This is defined as a macro because when an expectation is not satisfied the only output you get
@@ -166,12 +177,11 @@ protected:
OwnPtr<WebCompositorInputHandlerImpl> m_inputHandler;
MockWebCompositorInputHandlerClient m_mockClient;
WebGestureEvent gesture;
+ WebCore::DebugScopedSetImplThread alwaysImplThread;
+ WebCompositorInitializer initializer;
enum ExpectedDisposition { DidHandle, DidNotHandle, DropEvent };
ExpectedDisposition m_expectedDisposition;
-
-private:
- WebCore::DebugScopedSetImplThread m_alwaysImplThread;
};
@@ -191,7 +201,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureScrollStarted)
gesture.type = WebInputEvent::GestureScrollUpdate;
gesture.deltaY = -40; // -Y means scroll down - i.e. in the +Y direction.
- EXPECT_CALL(m_mockCCInputHandlerClient, scrollBy(testing::Property(&WebCore::IntSize::height, testing::Gt(0))));
+ EXPECT_CALL(m_mockCCInputHandlerClient, scrollBy(testing::_, testing::Property(&WebCore::IntSize::height, testing::Gt(0))));
m_inputHandler->handleInputEvent(gesture);
VERIFY_AND_RESET_MOCKS();
@@ -376,7 +386,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingAnimates)
EXPECT_CALL(m_mockCCInputHandlerClient, scheduleAnimation());
EXPECT_CALL(m_mockCCInputHandlerClient, scrollBegin(testing::_, testing::_))
.WillOnce(testing::Return(WebCore::CCInputHandlerClient::ScrollStarted));
- EXPECT_CALL(m_mockCCInputHandlerClient, scrollBy(testing::Property(&WebCore::IntSize::width, testing::Lt(0))));
+ EXPECT_CALL(m_mockCCInputHandlerClient, scrollBy(testing::_, testing::Property(&WebCore::IntSize::width, testing::Lt(0))));
EXPECT_CALL(m_mockCCInputHandlerClient, scrollEnd());
m_inputHandler->animate(10.1);
@@ -388,7 +398,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingAnimates)
EXPECT_CALL(m_mockCCInputHandlerClient, scheduleAnimation());
EXPECT_CALL(m_mockCCInputHandlerClient, scrollBegin(testing::_, testing::_))
.WillOnce(testing::Return(WebCore::CCInputHandlerClient::ScrollOnMainThread));
- EXPECT_CALL(m_mockCCInputHandlerClient, scrollBy(testing::_)).Times(0);
+ EXPECT_CALL(m_mockCCInputHandlerClient, scrollBy(testing::_, testing::_)).Times(0);
EXPECT_CALL(m_mockCCInputHandlerClient, scrollEnd()).Times(0);
// Expected wheel fling animation parameters:
@@ -458,7 +468,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingTransferResets)
EXPECT_CALL(m_mockCCInputHandlerClient, scheduleAnimation());
EXPECT_CALL(m_mockCCInputHandlerClient, scrollBegin(testing::_, testing::_))
.WillOnce(testing::Return(WebCore::CCInputHandlerClient::ScrollStarted));
- EXPECT_CALL(m_mockCCInputHandlerClient, scrollBy(testing::Property(&WebCore::IntSize::width, testing::Lt(0))));
+ EXPECT_CALL(m_mockCCInputHandlerClient, scrollBy(testing::_, testing::Property(&WebCore::IntSize::width, testing::Lt(0))));
EXPECT_CALL(m_mockCCInputHandlerClient, scrollEnd());
m_inputHandler->animate(10.1);
@@ -470,7 +480,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingTransferResets)
EXPECT_CALL(m_mockCCInputHandlerClient, scheduleAnimation());
EXPECT_CALL(m_mockCCInputHandlerClient, scrollBegin(testing::_, testing::_))
.WillOnce(testing::Return(WebCore::CCInputHandlerClient::ScrollOnMainThread));
- EXPECT_CALL(m_mockCCInputHandlerClient, scrollBy(testing::_)).Times(0);
+ EXPECT_CALL(m_mockCCInputHandlerClient, scrollBy(testing::_, testing::_)).Times(0);
EXPECT_CALL(m_mockCCInputHandlerClient, scrollEnd()).Times(0);
// Expected wheel fling animation parameters:
@@ -537,7 +547,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingTransferResets)
EXPECT_CALL(m_mockCCInputHandlerClient, scheduleAnimation());
EXPECT_CALL(m_mockCCInputHandlerClient, scrollBegin(testing::_, testing::_))
.WillOnce(testing::Return(WebCore::CCInputHandlerClient::ScrollStarted));
- EXPECT_CALL(m_mockCCInputHandlerClient, scrollBy(testing::Property(&WebCore::IntSize::height, testing::Gt(0))));
+ EXPECT_CALL(m_mockCCInputHandlerClient, scrollBy(testing::_, testing::Property(&WebCore::IntSize::height, testing::Gt(0))));
EXPECT_CALL(m_mockCCInputHandlerClient, scrollEnd());
m_inputHandler->animate(30.1);
@@ -547,7 +557,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingTransferResets)
EXPECT_CALL(m_mockCCInputHandlerClient, scheduleAnimation());
EXPECT_CALL(m_mockCCInputHandlerClient, scrollBegin(testing::_, testing::_))
.WillOnce(testing::Return(WebCore::CCInputHandlerClient::ScrollOnMainThread));
- EXPECT_CALL(m_mockCCInputHandlerClient, scrollBy(testing::_)).Times(0);
+ EXPECT_CALL(m_mockCCInputHandlerClient, scrollBy(testing::_, testing::_)).Times(0);
EXPECT_CALL(m_mockCCInputHandlerClient, scrollEnd()).Times(0);
// We should get parameters from the second fling, nothing from the first fling should "leak".
diff --git a/Source/WebKit/chromium/tests/WebFloatAnimationCurveTest.cpp b/Source/WebKit/chromium/tests/WebFloatAnimationCurveTest.cpp
index bdfe4ec7d..3cac764b6 100644
--- a/Source/WebKit/chromium/tests/WebFloatAnimationCurveTest.cpp
+++ b/Source/WebKit/chromium/tests/WebFloatAnimationCurveTest.cpp
@@ -26,7 +26,7 @@
#include <public/WebFloatAnimationCurve.h>
-#include "cc/CCTimingFunction.h"
+#include "CCTimingFunction.h"
#include <gtest/gtest.h>
#include <wtf/OwnPtr.h>
diff --git a/Source/WebKit/chromium/tests/WebFrameTest.cpp b/Source/WebKit/chromium/tests/WebFrameTest.cpp
index cd23d6268..8fc74988e 100644
--- a/Source/WebKit/chromium/tests/WebFrameTest.cpp
+++ b/Source/WebKit/chromium/tests/WebFrameTest.cpp
@@ -32,9 +32,11 @@
#include "WebFrame.h"
+#include "FloatRect.h"
#include "Frame.h"
#include "FrameTestHelpers.h"
#include "FrameView.h"
+#include "Range.h"
#include "ResourceError.h"
#include "URLTestHelpers.h"
#include "WebDataSource.h"
@@ -51,11 +53,14 @@
#include "WebSettings.h"
#include "WebViewClient.h"
#include "WebViewImpl.h"
+#include "platform/WebFloatRect.h"
#include "v8.h"
#include <gtest/gtest.h>
#include <webkit/support/webkit_support.h>
using namespace WebKit;
+using WebCore::FloatRect;
+using WebCore::Range;
using WebKit::URLTestHelpers::toKURL;
namespace {
@@ -854,4 +859,193 @@ TEST_F(WebFrameTest, DidCreateFrame)
EXPECT_EQ(webFrameClient.m_parent, webView->mainFrame());
}
+class FindUpdateWebFrameClient : public WebFrameClient {
+public:
+ FindUpdateWebFrameClient()
+ : m_findResultsAreReady(false)
+ {
+ }
+
+ virtual void reportFindInPageMatchCount(int, int, bool finalUpdate) OVERRIDE
+ {
+ if (finalUpdate)
+ m_findResultsAreReady = true;
+ }
+
+ bool findResultsAreReady() const { return m_findResultsAreReady; }
+
+private:
+ bool m_findResultsAreReady;
+};
+
+TEST_F(WebFrameTest, FindInPageMatchRects)
+{
+ registerMockedHttpURLLoad("find_in_page.html");
+ registerMockedHttpURLLoad("find_in_page_frame.html");
+
+ FindUpdateWebFrameClient client;
+ WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "find_in_page.html", true, &client);
+ webView->resize(WebSize(640, 480));
+ webView->layout();
+ webkit_support::RunAllPendingMessages();
+
+ static const char* kFindString = "result";
+ static const int kFindIdentifier = 12345;
+ static const int kNumResults = 10;
+
+ WebFindOptions options;
+ WebString searchText = WebString::fromUTF8(kFindString);
+ WebFrameImpl* mainFrame = static_cast<WebFrameImpl*>(webView->mainFrame());
+ EXPECT_TRUE(mainFrame->find(kFindIdentifier, searchText, options, false, 0));
+
+ for (WebFrame* frame = mainFrame; frame; frame = frame->traverseNext(false))
+ frame->scopeStringMatches(kFindIdentifier, searchText, options, true);
+
+ webkit_support::RunAllPendingMessages();
+ EXPECT_TRUE(client.findResultsAreReady());
+
+ WebVector<WebFloatRect> webMatchRects;
+ mainFrame->findMatchRects(webMatchRects);
+ ASSERT_EQ(webMatchRects.size(), static_cast<size_t>(kNumResults));
+ int rectsVersion = mainFrame->findMatchMarkersVersion();
+
+ for (int resultIndex = 0; resultIndex < kNumResults; ++resultIndex) {
+ FloatRect resultRect = static_cast<FloatRect>(webMatchRects[resultIndex]);
+
+ // Select the match by the center of its rect.
+ EXPECT_EQ(mainFrame->selectNearestFindMatch(resultRect.center(), 0), resultIndex + 1);
+
+ // Check that the find result ordering matches with our expectations.
+ Range* result = mainFrame->activeMatchFrame()->activeMatch();
+ ASSERT_TRUE(result);
+ result->setEnd(result->endContainer(), result->endOffset() + 2);
+ EXPECT_EQ(result->text(), String::format("%s %d", kFindString, resultIndex));
+
+ // Verify that the expected match rect also matches the currently active match.
+ // Compare the enclosing rects to prevent precision issues caused by CSS transforms.
+ FloatRect activeMatch = mainFrame->activeFindMatchRect();
+ EXPECT_EQ(enclosingIntRect(activeMatch), enclosingIntRect(resultRect));
+
+ // The rects version should not have changed.
+ EXPECT_EQ(mainFrame->findMatchMarkersVersion(), rectsVersion);
+ }
+
+ // All results after the first two ones should be below between them in find-in-page coordinates.
+ // This is because results 2 to 9 are inside an iframe located between results 0 and 1. This applies to the fixed div too.
+ EXPECT_TRUE(webMatchRects[0].y < webMatchRects[1].y);
+ for (int resultIndex = 2; resultIndex < kNumResults; ++resultIndex) {
+ EXPECT_TRUE(webMatchRects[0].y < webMatchRects[resultIndex].y);
+ EXPECT_TRUE(webMatchRects[1].y > webMatchRects[resultIndex].y);
+ }
+
+ // Result 3 should be below both 2 and 4. This is caused by the CSS transform in the containing div.
+ // If the transform doesn't work then 3 will be between 2 and 4.
+ EXPECT_TRUE(webMatchRects[3].y > webMatchRects[2].y);
+ EXPECT_TRUE(webMatchRects[3].y > webMatchRects[4].y);
+
+ // Results 6, 7, 8 and 9 should be one below the other in that same order.
+ // If overflow:scroll is not properly handled then result 8 would be below result 9 or
+ // result 7 above result 6 depending on the scroll.
+ EXPECT_TRUE(webMatchRects[6].y < webMatchRects[7].y);
+ EXPECT_TRUE(webMatchRects[7].y < webMatchRects[8].y);
+ EXPECT_TRUE(webMatchRects[8].y < webMatchRects[9].y);
+
+ // Resizing should update the rects version.
+ webView->resize(WebSize(800, 600));
+ webkit_support::RunAllPendingMessages();
+ EXPECT_TRUE(mainFrame->findMatchMarkersVersion() != rectsVersion);
+
+ webView->close();
+}
+
+static WebView* selectRangeTestCreateWebView(const std::string& url)
+{
+ WebView* webView = FrameTestHelpers::createWebViewAndLoad(url, true);
+ webView->settings()->setDefaultFontSize(12);
+ webView->resize(WebSize(640, 480));
+ return webView;
+}
+
+static WebPoint topLeft(const WebRect& rect)
+{
+ return WebPoint(rect.x, rect.y);
+}
+
+static WebPoint bottomRightMinusOne(const WebRect& rect)
+{
+ // FIXME: If we don't subtract 1 from the x- and y-coordinates of the
+ // selection bounds, selectRange() will select the *next* element. That's
+ // strictly correct, as hit-testing checks the pixel to the lower-right of
+ // the input coordinate, but it's a wart on the API.
+ return WebPoint(rect.x + rect.width - 1, rect.y + rect.height - 1);
+}
+
+static std::string selectionAsString(WebFrame* frame)
+{
+ return std::string(frame->selectionAsText().utf8().data());
+}
+
+TEST_F(WebFrameTest, SelectRange)
+{
+ WebView* webView;
+ WebFrame* frame;
+ WebRect startWebRect;
+ WebRect endWebRect;
+
+ registerMockedHttpURLLoad("select_range_basic.html");
+ registerMockedHttpURLLoad("select_range_scroll.html");
+ registerMockedHttpURLLoad("select_range_iframe.html");
+ registerMockedHttpURLLoad("select_range_editable.html");
+
+ webView = selectRangeTestCreateWebView(m_baseURL + "select_range_basic.html");
+ frame = webView->mainFrame();
+ EXPECT_EQ("Some test text for testing.", selectionAsString(frame));
+ webView->selectionBounds(startWebRect, endWebRect);
+ frame->executeCommand(WebString::fromUTF8("Unselect"));
+ EXPECT_EQ("", selectionAsString(frame));
+ frame->selectRange(topLeft(startWebRect), bottomRightMinusOne(endWebRect));
+ EXPECT_EQ("Some test text for testing.", selectionAsString(frame));
+ webView->close();
+
+ webView = selectRangeTestCreateWebView(m_baseURL + "select_range_scroll.html");
+ frame = webView->mainFrame();
+ EXPECT_EQ("Some offscreen test text for testing.", selectionAsString(frame));
+ webView->selectionBounds(startWebRect, endWebRect);
+ frame->executeCommand(WebString::fromUTF8("Unselect"));
+ EXPECT_EQ("", selectionAsString(frame));
+ frame->selectRange(topLeft(startWebRect), bottomRightMinusOne(endWebRect));
+ EXPECT_EQ("Some offscreen test text for testing.", selectionAsString(frame));
+ webView->close();
+
+ webView = selectRangeTestCreateWebView(m_baseURL + "select_range_iframe.html");
+ frame = webView->mainFrame();
+ WebFrame* subframe = frame->findChildByExpression(WebString::fromUTF8("/html/body/iframe"));
+ EXPECT_EQ("Some test text for testing.", selectionAsString(subframe));
+ webView->selectionBounds(startWebRect, endWebRect);
+ subframe->executeCommand(WebString::fromUTF8("Unselect"));
+ EXPECT_EQ("", selectionAsString(subframe));
+ subframe->selectRange(topLeft(startWebRect), bottomRightMinusOne(endWebRect));
+ EXPECT_EQ("Some test text for testing.", selectionAsString(subframe));
+ webView->close();
+
+ // Select the middle of an editable element, then try to extend the selection to the top of the document.
+ // The selection range should be clipped to the bounds of the editable element.
+ webView = selectRangeTestCreateWebView(m_baseURL + "select_range_editable.html");
+ frame = webView->mainFrame();
+ EXPECT_EQ("This text is initially selected.", selectionAsString(frame));
+ webView->selectionBounds(startWebRect, endWebRect);
+ frame->selectRange(WebPoint(0, 0), bottomRightMinusOne(endWebRect));
+ EXPECT_EQ("16-char header. This text is initially selected.", selectionAsString(frame));
+ webView->close();
+
+ // As above, but extending the selection to the bottom of the document.
+ webView = selectRangeTestCreateWebView(m_baseURL + "select_range_editable.html");
+ frame = webView->mainFrame();
+ EXPECT_EQ("This text is initially selected.", selectionAsString(frame));
+ webView->selectionBounds(startWebRect, endWebRect);
+ frame->selectRange(topLeft(startWebRect), WebPoint(640, 480));
+ EXPECT_EQ("This text is initially selected. 16-char footer.", selectionAsString(frame));
+ webView->close();
+}
+
} // namespace
diff --git a/Source/WebKit/chromium/tests/WebLayerTest.cpp b/Source/WebKit/chromium/tests/WebLayerTest.cpp
index 5381173ef..9b8e58ca1 100644
--- a/Source/WebKit/chromium/tests/WebLayerTest.cpp
+++ b/Source/WebKit/chromium/tests/WebLayerTest.cpp
@@ -26,6 +26,7 @@
#include <public/WebLayer.h>
#include "CompositorFakeWebGraphicsContext3D.h"
+#include "WebLayerImpl.h"
#include <public/WebCompositor.h>
#include <public/WebContentLayer.h>
#include <public/WebContentLayerClient.h>
@@ -76,9 +77,9 @@ public:
{
// Initialize without threading support.
WebKit::WebCompositor::initialize(0);
- m_rootLayer = WebLayer::create();
+ m_rootLayer = adoptPtr(WebLayer::create());
EXPECT_CALL(m_client, scheduleComposite()).Times(AnyNumber());
- EXPECT_TRUE(m_view.initialize(&m_client, m_rootLayer, WebLayerTreeView::Settings()));
+ EXPECT_TRUE(m_view.initialize(&m_client, *m_rootLayer, WebLayerTreeView::Settings()));
Mock::VerifyAndClearExpectations(&m_client);
}
@@ -87,14 +88,14 @@ public:
// We may get any number of scheduleComposite calls during shutdown.
EXPECT_CALL(m_client, scheduleComposite()).Times(AnyNumber());
m_view.setRootLayer(0);
- m_rootLayer.reset();
+ m_rootLayer.clear();
m_view.reset();
WebKit::WebCompositor::shutdown();
}
protected:
MockWebLayerTreeViewClient m_client;
- WebLayer m_rootLayer;
+ OwnPtr<WebLayer> m_rootLayer;
WebLayerTreeView m_view;
};
@@ -104,74 +105,73 @@ TEST_F(WebLayerTest, Client)
{
// Base layer.
EXPECT_CALL(m_client, scheduleComposite()).Times(AnyNumber());
- WebLayer layer = WebLayer::create();
- m_rootLayer.addChild(layer);
+ OwnPtr<WebLayer> layer = adoptPtr(WebLayer::create());
+ m_rootLayer->addChild(layer.get());
Mock::VerifyAndClearExpectations(&m_client);
WebFloatPoint point(3, 4);
EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
- layer.setAnchorPoint(point);
+ layer->setAnchorPoint(point);
Mock::VerifyAndClearExpectations(&m_client);
- EXPECT_EQ(point, layer.anchorPoint());
+ EXPECT_EQ(point, layer->anchorPoint());
EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
float anchorZ = 5;
- layer.setAnchorPointZ(anchorZ);
+ layer->setAnchorPointZ(anchorZ);
Mock::VerifyAndClearExpectations(&m_client);
- EXPECT_EQ(anchorZ, layer.anchorPointZ());
+ EXPECT_EQ(anchorZ, layer->anchorPointZ());
WebSize size(7, 8);
EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
- layer.setBounds(size);
+ layer->setBounds(size);
Mock::VerifyAndClearExpectations(&m_client);
- EXPECT_EQ(size, layer.bounds());
+ EXPECT_EQ(size, layer->bounds());
EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
- layer.setMasksToBounds(true);
+ layer->setMasksToBounds(true);
Mock::VerifyAndClearExpectations(&m_client);
- EXPECT_TRUE(layer.masksToBounds());
+ EXPECT_TRUE(layer->masksToBounds());
EXPECT_CALL(m_client, scheduleComposite()).Times(AnyNumber());
- WebLayer otherLayer = WebLayer::create();
- m_rootLayer.addChild(otherLayer);
+ OwnPtr<WebLayer> otherLayer = adoptPtr(WebLayer::create());
+ m_rootLayer->addChild(otherLayer.get());
EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
- layer.setMaskLayer(otherLayer);
+ layer->setMaskLayer(otherLayer.get());
Mock::VerifyAndClearExpectations(&m_client);
- EXPECT_EQ(otherLayer, layer.maskLayer());
EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
float opacity = 0.123f;
- layer.setOpacity(opacity);
+ layer->setOpacity(opacity);
Mock::VerifyAndClearExpectations(&m_client);
- EXPECT_EQ(opacity, layer.opacity());
+ EXPECT_EQ(opacity, layer->opacity());
EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
- layer.setOpaque(true);
+ layer->setOpaque(true);
Mock::VerifyAndClearExpectations(&m_client);
- EXPECT_TRUE(layer.opaque());
+ EXPECT_TRUE(layer->opaque());
EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
- layer.setPosition(point);
+ layer->setPosition(point);
Mock::VerifyAndClearExpectations(&m_client);
- EXPECT_EQ(point, layer.position());
+ EXPECT_EQ(point, layer->position());
// Texture layer.
EXPECT_CALL(m_client, scheduleComposite()).Times(AnyNumber());
- WebExternalTextureLayer textureLayer = WebExternalTextureLayer::create();
- m_rootLayer.addChild(textureLayer);
+ OwnPtr<WebExternalTextureLayer> textureLayer = adoptPtr(WebExternalTextureLayer::create());
+ m_rootLayer->addChild(textureLayer->layer());
Mock::VerifyAndClearExpectations(&m_client);
EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
- textureLayer.setTextureId(3);
+ textureLayer->setTextureId(3);
Mock::VerifyAndClearExpectations(&m_client);
EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
- textureLayer.setFlipped(true);
+ textureLayer->setFlipped(true);
Mock::VerifyAndClearExpectations(&m_client);
EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
WebFloatRect uvRect(0.1f, 0.1f, 0.9f, 0.9f);
- textureLayer.setUVRect(uvRect);
+ textureLayer->setUVRect(uvRect);
Mock::VerifyAndClearExpectations(&m_client);
@@ -179,52 +179,14 @@ TEST_F(WebLayerTest, Client)
MockWebContentLayerClient contentClient;
EXPECT_CALL(contentClient, paintContents(_, _, _)).Times(AnyNumber());
EXPECT_CALL(m_client, scheduleComposite()).Times(AnyNumber());
- WebContentLayer contentLayer = WebContentLayer::create(&contentClient);
- m_rootLayer.addChild(contentLayer);
+ OwnPtr<WebContentLayer> contentLayer = adoptPtr(WebContentLayer::create(&contentClient));
+ m_rootLayer->addChild(contentLayer->layer());
Mock::VerifyAndClearExpectations(&m_client);
EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
- contentLayer.setDrawsContent(false);
+ contentLayer->layer()->setDrawsContent(false);
Mock::VerifyAndClearExpectations(&m_client);
- EXPECT_FALSE(contentLayer.drawsContent());
-}
-
-TEST_F(WebLayerTest, Hierarchy)
-{
- EXPECT_CALL(m_client, scheduleComposite()).Times(AnyNumber());
- WebLayer layer1 = WebLayer::create();
- WebLayer layer2 = WebLayer::create();
-
- EXPECT_TRUE(layer1.parent().isNull());
- EXPECT_TRUE(layer2.parent().isNull());
-
- layer1.addChild(layer2);
- EXPECT_TRUE(layer1.parent().isNull());
- EXPECT_EQ(layer1, layer2.parent());
-
- layer2.removeFromParent();
- EXPECT_TRUE(layer2.parent().isNull());
-
- layer1.addChild(layer2);
- EXPECT_EQ(layer1, layer2.parent());
- layer1.removeAllChildren();
- EXPECT_TRUE(layer2.parent().isNull());
-
- MockWebContentLayerClient contentClient;
- EXPECT_CALL(contentClient, paintContents(_, _, _)).Times(AnyNumber());
- WebContentLayer contentLayer = WebContentLayer::create(&contentClient);
- WebExternalTextureLayer textureLayer = WebExternalTextureLayer::create();
-
- textureLayer.addChild(contentLayer);
- contentLayer.addChild(layer1);
- layer1.addChild(layer2);
-
- // Release reference on all layers, checking that destruction (which may
- // generate calls to the client) doesn't crash.
- layer2.reset();
- layer1.reset();
- contentLayer.reset();
- textureLayer.reset();
+ EXPECT_FALSE(contentLayer->layer()->drawsContent());
}
}
diff --git a/Source/WebKit/chromium/tests/WebLayerTreeViewTest.cpp b/Source/WebKit/chromium/tests/WebLayerTreeViewTest.cpp
index 4f0330035..1c1602c23 100644
--- a/Source/WebKit/chromium/tests/WebLayerTreeViewTest.cpp
+++ b/Source/WebKit/chromium/tests/WebLayerTreeViewTest.cpp
@@ -28,6 +28,7 @@
#include "CompositorFakeWebGraphicsContext3D.h"
#include "FakeWebCompositorOutputSurface.h"
+#include "WebLayerTreeViewTestCommon.h"
#include <gmock/gmock.h>
#include <public/Platform.h>
#include <public/WebCompositor.h>
@@ -41,27 +42,6 @@ using testing::Test;
namespace {
-class MockWebLayerTreeViewClient : public WebLayerTreeViewClient {
-public:
- virtual void scheduleComposite() OVERRIDE { }
- virtual void updateAnimations(double frameBeginTime) OVERRIDE { }
- MOCK_METHOD0(willBeginFrame, void());
- MOCK_METHOD0(didBeginFrame, void());
- virtual void layout() OVERRIDE { }
- virtual void applyScrollAndScale(const WebSize& scrollDelta, float scaleFactor) OVERRIDE { }
-
- virtual WebCompositorOutputSurface* createOutputSurface() OVERRIDE
- {
- return FakeWebCompositorOutputSurface::create(CompositorFakeWebGraphicsContext3D::create(WebGraphicsContext3D::Attributes())).leakPtr();
- }
- virtual void didRecreateOutputSurface(bool) OVERRIDE { }
-
- MOCK_METHOD0(willCommit, void());
- MOCK_METHOD0(didCommit, void());
- virtual void didCommitAndDrawFrame() OVERRIDE { }
- virtual void didCompleteSwapBuffers() OVERRIDE { }
-};
-
class MockWebLayerTreeViewClientForThreadedTests : public MockWebLayerTreeViewClient {
public:
virtual void didBeginFrame() OVERRIDE
@@ -80,8 +60,8 @@ public:
virtual void SetUp()
{
initializeCompositor();
- m_rootLayer = WebLayer::create();
- EXPECT_TRUE(m_view.initialize(client(), m_rootLayer, WebLayerTreeView::Settings()));
+ m_rootLayer = adoptPtr(WebLayer::create());
+ EXPECT_TRUE(m_view.initialize(client(), *m_rootLayer, WebLayerTreeView::Settings()));
m_view.setSurfaceReady();
}
@@ -90,13 +70,13 @@ public:
Mock::VerifyAndClearExpectations(client());
m_view.setRootLayer(0);
- m_rootLayer.reset();
+ m_rootLayer.clear();
m_view.reset();
WebKit::WebCompositor::shutdown();
}
protected:
- WebLayer m_rootLayer;
+ OwnPtr<WebLayer> m_rootLayer;
WebLayerTreeView m_view;
};
diff --git a/Source/WebKit/chromium/tests/WebLayerTreeViewTestCommon.h b/Source/WebKit/chromium/tests/WebLayerTreeViewTestCommon.h
new file mode 100644
index 000000000..e2a62b6a3
--- /dev/null
+++ b/Source/WebKit/chromium/tests/WebLayerTreeViewTestCommon.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 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 WebLayerTreeViewTestCommon_h
+#define WebLayerTreeViewTestCommon_h
+
+#include "CompositorFakeWebGraphicsContext3D.h"
+#include "FakeWebCompositorOutputSurface.h"
+#include <gmock/gmock.h>
+#include <public/WebLayerTreeViewClient.h>
+
+namespace WebKit {
+
+class MockWebLayerTreeViewClient : public WebLayerTreeViewClient {
+public:
+ virtual void scheduleComposite() OVERRIDE { }
+ virtual void updateAnimations(double frameBeginTime) OVERRIDE { }
+ MOCK_METHOD0(willBeginFrame, void());
+ MOCK_METHOD0(didBeginFrame, void());
+ virtual void layout() OVERRIDE { }
+ virtual void applyScrollAndScale(const WebSize& scrollDelta, float scaleFactor) OVERRIDE { }
+
+ virtual WebCompositorOutputSurface* createOutputSurface() OVERRIDE
+ {
+ return FakeWebCompositorOutputSurface::create(CompositorFakeWebGraphicsContext3D::create(WebGraphicsContext3D::Attributes())).leakPtr();
+ }
+ virtual void didRecreateOutputSurface(bool) OVERRIDE { }
+
+ MOCK_METHOD0(willCommit, void());
+ MOCK_METHOD0(didCommit, void());
+ virtual void didCommitAndDrawFrame() OVERRIDE { }
+ virtual void didCompleteSwapBuffers() OVERRIDE { }
+};
+
+}
+
+#endif // WebLayerTreeViewTestCommon_h
diff --git a/Source/WebKit/chromium/tests/WebTransformAnimationCurveTest.cpp b/Source/WebKit/chromium/tests/WebTransformAnimationCurveTest.cpp
index f18f87be2..2f4de73cb 100644
--- a/Source/WebKit/chromium/tests/WebTransformAnimationCurveTest.cpp
+++ b/Source/WebKit/chromium/tests/WebTransformAnimationCurveTest.cpp
@@ -26,7 +26,7 @@
#include <public/WebTransformAnimationCurve.h>
-#include "cc/CCTimingFunction.h"
+#include "CCTimingFunction.h"
#include <gtest/gtest.h>
#include <public/WebTransformOperations.h>
diff --git a/Source/WebKit/chromium/tests/data/find_in_page.html b/Source/WebKit/chromium/tests/data/find_in_page.html
new file mode 100644
index 000000000..c09c9dd06
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/find_in_page.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
+</head>
+<body>
+This a find-in-page match rect test.</br>
+result 0</br>
+<iframe src="find_in_page_frame.html" height="300" scrolling="yes"></iframe>
+</br>
+result 1
+</body>
+</html>
diff --git a/Source/WebKit/chromium/tests/data/find_in_page_frame.html b/Source/WebKit/chromium/tests/data/find_in_page_frame.html
new file mode 100644
index 000000000..47d29ae0f
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/find_in_page_frame.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
+<style type="text/css">
+div.transform {
+ background-color: #00FF00;
+ width: 100px;
+ height: 100px;
+ padding-left: 30px;
+ padding-top: 20px;
+ -webkit-transform:matrix(0.866,0.5,-0.5,0.866,120,150);
+}
+div.scroll {
+ background-color: #00FFFF;
+ width: 100px;
+ height: 100px;
+ overflow: scroll;
+}
+div.fixed {
+ background-color: #FF0000;
+ left: 200px;
+ top: 50px;
+ width: 100px;
+ height: 100px;
+ position: fixed;
+}
+</style>
+</head>
+<body>
+This is a test.
+</br></br>
+</br></br>
+</br></br>
+Foo bar.
+</br></br>
+</br></br>
+</br></br>
+result 2
+<div class="transform">
+result 3
+</div>
+result 4
+<div class="fixed">
+result 5
+</div>
+result 6
+<div class="scroll">
+result 7
+Foo bar.
+</br></br>
+</br></br>
+</br></br>
+result 8
+</div>
+result 9
+</body>
+</html>
diff --git a/Source/WebKit/chromium/tests/data/select_range_basic.html b/Source/WebKit/chromium/tests/data/select_range_basic.html
new file mode 100644
index 000000000..8ffc3fc2f
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/select_range_basic.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<body>
+Some extra text.
+<span id='target'>Some test text for testing.</span>
+Some extra text.
+<script>
+ function select() {
+ var range = document.createRange();
+ range.selectNode(document.getElementById('target'));
+ window.getSelection().addRange(range);
+ }
+ window.onload = select;
+</script>
+</body>
+</html>
+
diff --git a/Source/WebKit/chromium/tests/data/select_range_editable.html b/Source/WebKit/chromium/tests/data/select_range_editable.html
new file mode 100644
index 000000000..a186979af
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/select_range_editable.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<body>
+This text won't be selected because it isn't editable.
+<span id='target' contenteditable="true">16-char header. This text is initially selected. 16-char footer.</span>
+This text won't be selected because it isn't editable.
+<script>
+ function select() {
+ var text = document.getElementById('target').firstChild;
+ var range = document.createRange();
+ range.setStart(text, 16);
+ range.setEnd(text, 48);
+ window.getSelection().addRange(range);
+ }
+ window.onload = select;
+</script>
+</body>
+</html>
+
diff --git a/Source/WebKit/chromium/tests/data/select_range_iframe.html b/Source/WebKit/chromium/tests/data/select_range_iframe.html
new file mode 100644
index 000000000..f78089abb
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/select_range_iframe.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body>
+This is a test case for selecting a range within an iframe.
+<iframe width=400 height=200 id="iframe" src="select_range_basic.html"></iframe>
+<script>
+ document.getElementById('iframe').contentWindow.focus();
+</script>
+</body>
+</html>
+
diff --git a/Source/WebKit/chromium/tests/data/select_range_scroll.html b/Source/WebKit/chromium/tests/data/select_range_scroll.html
new file mode 100644
index 000000000..a67f189c3
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/select_range_scroll.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<body>
+<div style='height:3000px'>
+ <span id="target">Some offscreen test text for testing.</span>
+</div>
+<script>
+ var range = document.createRange();
+ range.selectNode(document.getElementById('target'));
+ window.getSelection().addRange(range);
+ window.scrollBy(0,500);
+</script>
+</body>
+</html>
+
diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog
index 3bc2ceab5..d5b2ddf4e 100644
--- a/Source/WebKit/efl/ChangeLog
+++ b/Source/WebKit/efl/ChangeLog
@@ -1,3 +1,68 @@
+2012-08-20 Thiago Marcos P. Santos <thiago.santos@intel.com>
+
+ Regression(r124945): Build is broken when touch events is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=94466
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Added missing guards around touch events code.
+
+ * ewk/ewk_touch_event.cpp:
+ * ewk/ewk_touch_event_private.h:
+
+2012-08-17 Thiago Marcos P. Santos <thiago.santos@intel.com>
+
+ [EFL] Change font family/script on layout tests causes flakiness
+ https://bugs.webkit.org/show_bug.cgi?id=94327
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Always set the font on WebCore even if the font family is the same. It
+ has to be done because the script value might have also changed.
+ Settings::set*FontFamily() has an implicit UScriptCode
+ parameter that will set the script back to the defaults.
+
+ * ewk/ewk_view.cpp:
+ (ewk_view_font_family_name_set):
+
+2012-08-14 Adam Barth <abarth@webkit.org>
+
+ Delete Frame::domWindow() and Frame::existingDOMWindow()
+ https://bugs.webkit.org/show_bug.cgi?id=93990
+
+ Reviewed by Eric Seidel.
+
+ * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+ (DumpRenderTreeSupportEfl::pendingUnloadEventCount):
+ * ewk/ewk_frame.cpp:
+ (ewk_frame_intent_deliver):
+
+2012-08-13 Tom Sepez <tsepez@chromium.org>
+
+ [chromium] release FrameLoaderClientImpl::m_pluginWidget refptr upon Plugin Document detach.
+ https://bugs.webkit.org/show_bug.cgi?id=93283
+
+ Reviewed by Eric Seidel.
+
+ Change the client redirectDataToPlugin method(s) to expect the possibility of
+ a NULL argument, keeping existing behaviour otherwise.
+
+ * WebCoreSupport/FrameLoaderClientEfl.cpp:
+ (WebCore::FrameLoaderClientEfl::redirectDataToPlugin):
+
+2012-08-12 Krzysztof Czech <k.czech@samsung.com>
+
+ [EFL][UT] Delete shutdown method.
+ https://bugs.webkit.org/show_bug.cgi?id=90785
+
+ Reviewed by Eric Seidel.
+
+ EWKTestBase class already has a shutdownAll method that can be used instead of shutdown.
+
+ * tests/UnitTestUtils/EWKTestBase.cpp:
+ * tests/UnitTestUtils/EWKTestBase.h:
+ (EWKTestBase):
+
2012-08-09 Carlos Garcia Campos <cgarcia@igalia.com>
Handle SSL errors for SOUP
diff --git a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
index 4b804dd62..96a5791ee 100644
--- a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
@@ -225,7 +225,7 @@ bool DumpRenderTreeSupportEfl::pauseTransition(Evas_Object* ewkFrame, const char
unsigned DumpRenderTreeSupportEfl::pendingUnloadEventCount(const Evas_Object* ewkFrame)
{
if (WebCore::Frame* frame = EWKPrivate::coreFrame(ewkFrame))
- return frame->domWindow()->pendingUnloadEventListeners();
+ return frame->document()->domWindow()->pendingUnloadEventListeners();
return 0;
}
diff --git a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
index d26961b16..c78520127 100644
--- a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
@@ -371,9 +371,9 @@ PassRefPtr<Frame> FrameLoaderClientEfl::createFrame(const KURL& url, const Strin
void FrameLoaderClientEfl::redirectDataToPlugin(Widget* pluginWidget)
{
- ASSERT(!m_pluginView);
m_pluginView = static_cast<PluginView*>(pluginWidget);
- m_hasSentResponseToPlugin = false;
+ if (pluginWidget)
+ m_hasSentResponseToPlugin = false;
}
PassRefPtr<Widget> FrameLoaderClientEfl::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL& baseURL,
diff --git a/Source/WebKit/efl/ewk/ewk_frame.cpp b/Source/WebKit/efl/ewk/ewk_frame.cpp
index e8fec6d63..7231b549d 100644
--- a/Source/WebKit/efl/ewk/ewk_frame.cpp
+++ b/Source/WebKit/efl/ewk/ewk_frame.cpp
@@ -766,12 +766,12 @@ void ewk_frame_intent_deliver(const Evas_Object* ewkFrame, Ewk_Intent* ewk_inten
for (size_t i = 0; i < origChannels->size(); ++i)
(*channels)[i] = origChannels->at(i).release();
}
- OwnPtr<WebCore::MessagePortArray> ports = WebCore::MessagePort::entanglePorts(*(smartData->frame->domWindow()->scriptExecutionContext()), channels.release());
+ OwnPtr<WebCore::MessagePortArray> ports = WebCore::MessagePort::entanglePorts(*(smartData->frame->document()), channels.release());
OwnPtr<WebCore::DeliveredIntentClient> dummyClient;
RefPtr<WebCore::DeliveredIntent> deliveredIntent = WebCore::DeliveredIntent::create(smartData->frame, dummyClient.release(), intent->action(), intent->type(), intent->data(), ports.release(), intent->extras());
- WebCore::DOMWindowIntents::from(smartData->frame->domWindow())->deliver(deliveredIntent.release());
+ WebCore::DOMWindowIntents::from(smartData->frame->document()->domWindow())->deliver(deliveredIntent.release());
#endif
}
diff --git a/Source/WebKit/efl/ewk/ewk_touch_event.cpp b/Source/WebKit/efl/ewk/ewk_touch_event.cpp
index 0695d41ad..290fa58a7 100644
--- a/Source/WebKit/efl/ewk/ewk_touch_event.cpp
+++ b/Source/WebKit/efl/ewk/ewk_touch_event.cpp
@@ -25,6 +25,8 @@
#include "config.h"
+#if ENABLE(TOUCH_EVENTS)
+
#include "PlatformTouchPoint.h"
#include "ewk_touch_event_private.h"
#include <Ecore_Input.h>
@@ -92,3 +94,5 @@ WebCore::PlatformTouchEvent platformTouchEvent(Evas_Coord x, Evas_Coord y, Eina_
}
}
+
+#endif // ENABLE(TOUCH_EVENTS)
diff --git a/Source/WebKit/efl/ewk/ewk_touch_event_private.h b/Source/WebKit/efl/ewk/ewk_touch_event_private.h
index 0f7737a88..07778bf84 100644
--- a/Source/WebKit/efl/ewk/ewk_touch_event_private.h
+++ b/Source/WebKit/efl/ewk/ewk_touch_event_private.h
@@ -26,6 +26,8 @@
#ifndef ewk_touch_event_private_h
#define ewk_touch_event_private_h
+#if ENABLE(TOUCH_EVENTS)
+
#include "PlatformTouchEvent.h"
#include "ewk_frame.h"
@@ -33,4 +35,6 @@ namespace EWKPrivate {
WebCore::PlatformTouchEvent platformTouchEvent(Evas_Coord x, Evas_Coord y, Eina_List* points, Ewk_Touch_Event_Type action, unsigned modifiers);
} // namespace EWKPrivate
+#endif // ENABLE(TOUCH_EVENTS)
+
#endif // ewk_touch_event_private_h
diff --git a/Source/WebKit/efl/ewk/ewk_view.cpp b/Source/WebKit/efl/ewk/ewk_view.cpp
index 081e6ba49..40fbfad6a 100644
--- a/Source/WebKit/efl/ewk/ewk_view.cpp
+++ b/Source/WebKit/efl/ewk/ewk_view.cpp
@@ -2502,28 +2502,28 @@ Eina_Bool ewk_view_font_family_name_set(Evas_Object* ewkView, Ewk_Font_Family fo
switch (fontFamily) {
case EWK_FONT_FAMILY_STANDARD:
- if (eina_stringshare_replace(&priv->settings.fontStandard, name))
- priv->pageSettings->setStandardFontFamily(AtomicString::fromUTF8(name));
+ eina_stringshare_replace(&priv->settings.fontStandard, name);
+ priv->pageSettings->setStandardFontFamily(AtomicString::fromUTF8(name));
break;
case EWK_FONT_FAMILY_CURSIVE:
- if (eina_stringshare_replace(&priv->settings.fontCursive, name))
- priv->pageSettings->setCursiveFontFamily(AtomicString::fromUTF8(name));
+ eina_stringshare_replace(&priv->settings.fontCursive, name);
+ priv->pageSettings->setCursiveFontFamily(AtomicString::fromUTF8(name));
break;
case EWK_FONT_FAMILY_FANTASY:
- if (eina_stringshare_replace(&priv->settings.fontFantasy, name))
- priv->pageSettings->setFantasyFontFamily(AtomicString::fromUTF8(name));
+ eina_stringshare_replace(&priv->settings.fontFantasy, name);
+ priv->pageSettings->setFantasyFontFamily(AtomicString::fromUTF8(name));
break;
case EWK_FONT_FAMILY_MONOSPACE:
- if (eina_stringshare_replace(&priv->settings.fontMonospace, name))
- priv->pageSettings->setFixedFontFamily(AtomicString::fromUTF8(name));
+ eina_stringshare_replace(&priv->settings.fontMonospace, name);
+ priv->pageSettings->setFixedFontFamily(AtomicString::fromUTF8(name));
break;
case EWK_FONT_FAMILY_SERIF:
- if (eina_stringshare_replace(&priv->settings.fontSerif, name))
- priv->pageSettings->setSerifFontFamily(AtomicString::fromUTF8(name));
+ eina_stringshare_replace(&priv->settings.fontSerif, name);
+ priv->pageSettings->setSerifFontFamily(AtomicString::fromUTF8(name));
break;
case EWK_FONT_FAMILY_SANS_SERIF:
- if (eina_stringshare_replace(&priv->settings.fontSansSerif, name))
- priv->pageSettings->setSansSerifFontFamily(AtomicString::fromUTF8(name));
+ eina_stringshare_replace(&priv->settings.fontSansSerif, name);
+ priv->pageSettings->setSansSerifFontFamily(AtomicString::fromUTF8(name));
break;
default:
return false;
diff --git a/Source/WebKit/efl/tests/UnitTestUtils/EWKTestBase.cpp b/Source/WebKit/efl/tests/UnitTestUtils/EWKTestBase.cpp
index 608300aa6..2d3e2ae9e 100644
--- a/Source/WebKit/efl/tests/UnitTestUtils/EWKTestBase.cpp
+++ b/Source/WebKit/efl/tests/UnitTestUtils/EWKTestBase.cpp
@@ -49,13 +49,6 @@ bool EWKTestBase::init()
return ret;
}
-void EWKTestBase::shutdown()
-{
- ecore_evas_shutdown();
- edje_shutdown();
- ewk_shutdown();
-}
-
void EWKTestBase::shutdownAll()
{
int count = 0;
diff --git a/Source/WebKit/efl/tests/UnitTestUtils/EWKTestBase.h b/Source/WebKit/efl/tests/UnitTestUtils/EWKTestBase.h
index fc1d27171..ec7513297 100644
--- a/Source/WebKit/efl/tests/UnitTestUtils/EWKTestBase.h
+++ b/Source/WebKit/efl/tests/UnitTestUtils/EWKTestBase.h
@@ -54,7 +54,6 @@ class EWKTestBase {
static bool createTest(const char* url, void (*event_callback)(void*, Evas_Object*, void*), const char* event_name, void* event_data);
public:
static bool init();
- static void shutdown();
static void shutdownAll();
static void startTest();
static void endTest();
diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog
index 268a9df9d..511a0871a 100644
--- a/Source/WebKit/gtk/ChangeLog
+++ b/Source/WebKit/gtk/ChangeLog
@@ -1,3 +1,76 @@
+2012-08-15 Joanmarie Diggs <jdiggs@igalia.com>
+
+ [Gtk] atk_text_set_caret_offset() fails for table cells
+ https://bugs.webkit.org/show_bug.cgi?id=83501
+
+ Reviewed by Chris Fleizach.
+
+ Update unit test to include setting the caret in a table cell via the AtkText interface.
+
+ * tests/testatk.c:
+ (testWebkitAtkCaretOffsets): Add setting the caret inside the text of a table cell.
+
+2012-08-15 Joanmarie Diggs <jdiggs@igalia.com>
+
+ [Gtk] atk_text_get_text_at_offset() fails to provide the correct line for paragraphs in list items whose text wraps
+ https://bugs.webkit.org/show_bug.cgi?id=83435
+
+ Reviewed by Chris Fleizach.
+
+ Updated unit test to include a paragraph in a list item when testing atk_text_get_text_at_offset().
+
+ * tests/testatk.c:
+ (testWebkitAtkGetTextAtOffsetWithSpecialCharacters):
+
+2012-08-14 Adam Barth <abarth@webkit.org>
+
+ Delete Frame::domWindow() and Frame::existingDOMWindow()
+ https://bugs.webkit.org/show_bug.cgi?id=93990
+
+ Reviewed by Eric Seidel.
+
+ * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
+ (DumpRenderTreeSupportGtk::getPendingUnloadEventCount):
+
+2012-08-13 Tom Sepez <tsepez@chromium.org>
+
+ [chromium] release FrameLoaderClientImpl::m_pluginWidget refptr upon Plugin Document detach.
+ https://bugs.webkit.org/show_bug.cgi?id=93283
+
+ Reviewed by Eric Seidel.
+
+ Change the client redirectDataToPlugin method(s) to expect the possibility of
+ a NULL argument, keeping existing behaviour otherwise.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::redirectDataToPlugin):
+
+2012-08-13 Martin Robinson <mrobinson@igalia.com>
+
+ [GTK] Default signal handler for WebKitWebView::should-show-delete-interface-for-element overrides default result
+ https://bugs.webkit.org/show_bug.cgi?id=93600
+
+ Reviewed by Xan Lopez.
+
+ Instead of using the default editing signal handler for ::should-show-delete-interface-for-element,
+ do not use a default signal handler. This means that the result of the signal defaults to FALSE,
+ which is the expected value to ensure that the delete interface is not shown.
+
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_class_init): Do not install a default signal handler.
+
+2012-08-13 Mario Sanchez Prada <msanchez@igalia.com>
+
+ [GTK] Implementation of atk_editable_text_insert_text ignores 'length' parameter
+ https://bugs.webkit.org/show_bug.cgi?id=93804
+
+ Reviewed by Carlos Garcia Campos.
+
+ Update unit tests to also check inserting a partial string.
+
+ * tests/testatk.c:
+ (testWebkitAtkTextChangedNotifications): Update test.
+
2012-08-10 Alice Cheng <alice_cheng@apple.com>
Part 1 of: Extend -webkit-user-select with a new value "all"
diff --git a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
index 00febc8b7..c76dce9f6 100644
--- a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
+++ b/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
@@ -279,7 +279,7 @@ guint DumpRenderTreeSupportGtk::getPendingUnloadEventCount(WebKitWebFrame* frame
{
g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), 0);
- return core(frame)->domWindow()->pendingUnloadEventListeners();
+ return core(frame)->document()->domWindow()->pendingUnloadEventListeners();
}
bool DumpRenderTreeSupportGtk::pauseAnimation(WebKitWebFrame* frame, const char* name, double time, const char* element)
diff --git a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index 7f6c94f19..103e6cdb1 100644
--- a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -534,9 +534,9 @@ PassRefPtr<Frame> FrameLoaderClient::createFrame(const KURL& url, const String&
void FrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget)
{
- ASSERT(!m_pluginView);
m_pluginView = static_cast<PluginView*>(pluginWidget);
- m_hasSentResponseToPlugin = false;
+ if (pluginWidget)
+ m_hasSentResponseToPlugin = false;
}
PassRefPtr<Widget> FrameLoaderClient::createJavaAppletWidget(const IntSize& pluginSize, HTMLAppletElement* element, const KURL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues)
diff --git a/Source/WebKit/gtk/tests/testatk.c b/Source/WebKit/gtk/tests/testatk.c
index cc51be804..2463c74a5 100644
--- a/Source/WebKit/gtk/tests/testatk.c
+++ b/Source/WebKit/gtk/tests/testatk.c
@@ -35,7 +35,7 @@ static const char* contentsWithNewlines = "<html><body><p>This is a test. \n\nTh
static const char* contentsWithPreformattedText = "<html><body><pre>\n\t\n\tfirst line\n\tsecond line\n</pre></body></html>";
-static const char* contentsWithSpecialChars = "<html><body><p>&laquo;&nbsp;This is a paragraph with &ldquo;special&rdquo; characters inside.&nbsp;&raquo;</p><ul><li style='max-width:100px;'>List item with some text that wraps across different lines.</li></ul></body></html>";
+static const char* contentsWithSpecialChars = "<html><body><p>&laquo;&nbsp;This is a paragraph with &ldquo;special&rdquo; characters inside.&nbsp;&raquo;</p><ul><li style='max-width:100px;'>List item with some text that wraps across different lines.</li><li style='max-width:100px;'><p>List item with some text that wraps across different lines.</p></li></ul></body></html>";
static const char* contentsInTextarea = "<html><body><textarea cols='80'>This is a test. This is the second sentence. And this the third.</textarea></body></html>";
@@ -65,7 +65,7 @@ static const char* linksWithInlineImages = "<html><head><style>a.http:before {co
static const char* listsOfItems = "<html><body><ul><li>text only</li><li><a href='foo'>link only</a></li><li>text and a <a href='bar'>link</a></li></ul><ol><li>text only</li><li><a href='foo'>link only</a></li><li>text and a <a href='bar'>link</a></li></ol></body></html>";
-static const char* textForCaretBrowsing = "<html><body><h1>A text header</h1><p>A paragraph <a href='http://foo.bar.baz/'>with a link</a> in the middle</p><ol><li>A list item</li></ol><select><option selected value='foo'>An option in a combo box</option></select><input type='text'' name='foo'' value='foo bar baz' /></body></html>";
+static const char* textForCaretBrowsing = "<html><body><h1>A text header</h1><p>A paragraph <a href='http://foo.bar.baz/'>with a link</a> in the middle</p><ol><li>A list item</li></ol><select><option selected value='foo'>An option in a combo box</option></select><input type='text'' name='foo'' value='foo bar baz' /><table><tr><td>a table cell</td></tr></table></body></html>";
static const char* textForSelections = "<html><body><p>A paragraph with plain text</p><p>A paragraph with <a href='http://webkit.org'>a link</a> in the middle</p><ol><li>A list item</li></ol><select></body></html>";
@@ -389,6 +389,23 @@ static void testWebkitAtkCaretOffsets()
offset = atk_text_get_caret_offset(ATK_TEXT(textEntry));
g_assert_cmpint(offset, ==, 5);
+ AtkObject* table = atk_object_ref_accessible_child(object, 4);
+ g_assert(ATK_IS_OBJECT(table));
+ g_assert(atk_object_get_role(table) == ATK_ROLE_TABLE);
+ g_assert_cmpint(atk_object_get_n_accessible_children(table), ==, 1);
+
+ AtkObject* tableCell = atk_object_ref_accessible_child(table, 0);
+ g_assert(ATK_IS_TEXT(tableCell));
+ g_assert(atk_object_get_role(tableCell) == ATK_ROLE_TABLE_CELL);
+ text = atk_text_get_text(ATK_TEXT(tableCell), 0, -1);
+ g_assert_cmpstr(text, ==, "a table cell");
+ g_free(text);
+
+ result = atk_text_set_caret_offset(ATK_TEXT(tableCell), 2);
+ g_assert_cmpint(result, ==, TRUE);
+ offset = atk_text_get_caret_offset(ATK_TEXT(tableCell));
+ g_assert_cmpint(offset, ==, 2);
+
g_free(textCaretMovedResult);
g_object_unref(header);
@@ -401,6 +418,8 @@ static void testWebkitAtkCaretOffsets()
g_object_unref(menuPopup);
g_object_unref(comboBoxOption);
g_object_unref(textEntry);
+ g_object_unref(table);
+ g_object_unref(tableCell);
g_object_unref(webView);
}
@@ -845,6 +864,21 @@ static void testWebkitAtkGetTextAtOffsetWithSpecialCharacters()
testGetTextFunction(ATK_TEXT(listItem), atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_END, 0, "\342\200\242 List item", 0, 11);
testGetTextFunction(ATK_TEXT(listItem), atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_END, 12, " with some", 11, 21);
+ g_object_unref(listItem);
+
+ listItem = ATK_TEXT(atk_object_ref_accessible_child(list, 1));
+ g_assert(ATK_IS_TEXT(listItem));
+
+ /* Check that placing the same text in a paragraph doesn't break things. */
+ text = atk_text_get_text(ATK_TEXT(listItem), 0, -1);
+ g_assert_cmpstr(text, ==, "\342\200\242 List item with some text that wraps across different lines.");
+ g_free(text);
+
+ testGetTextFunction(ATK_TEXT(listItem), atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_START, 3, "\342\200\242 List item ", 0, 12);
+ testGetTextFunction(ATK_TEXT(listItem), atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_START, 13, "with some ", 12, 22);
+ testGetTextFunction(ATK_TEXT(listItem), atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_END, 0, "\342\200\242 List item", 0, 11);
+ testGetTextFunction(ATK_TEXT(listItem), atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_END, 12, " with some", 11, 21);
+
g_object_unref(list);
g_object_unref(listItem);
g_object_unref(paragraph);
@@ -1761,7 +1795,7 @@ static void testWebkitAtkTextChangedNotifications()
g_free(text);
pos = 4;
- atk_editable_text_insert_text(ATK_EDITABLE_TEXT(textEntry), "qux quux", 8, &pos);
+ atk_editable_text_insert_text(ATK_EDITABLE_TEXT(textEntry), "qux quux tobeignored", 8, &pos);
text = atk_text_get_text(ATK_TEXT(textEntry), 0, -1);
g_assert_cmpstr(text, ==, "foo qux quux baz");
g_assert_cmpstr(textChangedResult, ==, "|1|4|8|'qux quux'|");
@@ -1794,7 +1828,7 @@ static void testWebkitAtkTextChangedNotifications()
g_free(text);
pos = 3;
- atk_editable_text_insert_text(ATK_EDITABLE_TEXT(passwordEntry), "qux", 3, &pos);
+ atk_editable_text_insert_text(ATK_EDITABLE_TEXT(passwordEntry), "qux tobeignored", 3, &pos);
g_assert_cmpstr(textChangedResult, ==, "|1|3|3|'\342\200\242\342\200\242\342\200\242'|");
text = atk_text_get_text(ATK_TEXT(passwordEntry), 0, -1);
diff --git a/Source/WebKit/gtk/webkit/webkitwebview.cpp b/Source/WebKit/gtk/webkit/webkitwebview.cpp
index 0b8d6a8f0..971780637 100644
--- a/Source/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/Source/WebKit/gtk/webkit/webkitwebview.cpp
@@ -2655,7 +2655,7 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
webkit_web_view_signals[SHOULD_SHOW_DELETE_INTERFACE_FOR_ELEMENT] = g_signal_new("should-show-delete-interface-for-element",
G_TYPE_FROM_CLASS(webViewClass), static_cast<GSignalFlags>(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
- G_STRUCT_OFFSET(WebKitWebViewClass, should_allow_editing_action), g_signal_accumulator_first_wins, 0,
+ 0, g_signal_accumulator_first_wins, 0,
webkit_marshal_BOOLEAN__OBJECT, G_TYPE_BOOLEAN, 1, WEBKIT_TYPE_DOM_HTML_ELEMENT);
webkit_web_view_signals[SHOULD_CHANGE_SELECTED_RANGE] = g_signal_new("should-change-selected-range",
diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog
index 9317bd2f7..0f2e3d42d 100644
--- a/Source/WebKit/mac/ChangeLog
+++ b/Source/WebKit/mac/ChangeLog
@@ -1,3 +1,68 @@
+2012-08-15 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com>
+
+ [css3-text] Add CSS3 Text decoration compile flag
+ https://bugs.webkit.org/show_bug.cgi?id=93863
+
+ Reviewed by Julien Chaffraix.
+
+ This patch handles the compile flag implementation, which will come disabled by
+ default, thus not exposing the CSS3 text decoration features to the web, unless
+ when explicitly enabling it with "--css3-text-decoration" build parameter.
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2012-08-15 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125687.
+ http://trac.webkit.org/changeset/125687
+ https://bugs.webkit.org/show_bug.cgi?id=94147
+
+ It broke the whole world (Requested by Ossy_night on #webkit).
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::addValueToArray):
+
+2012-08-14 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ Change behavior of MasqueradesAsUndefined to better accommodate DFG changes
+ https://bugs.webkit.org/show_bug.cgi?id=93884
+
+ Reviewed by Geoffrey Garen.
+
+ With some upcoming changes to the DFG to remove uses of ClassInfo, we will be changing the behavior of
+ MasqueradesAsUndefined. In order to make this change consistent across all of our execution engines,
+ we will make this change to MasqueradesAsUndefined as a separate patch. After this patch, MasqueradesAsUndefined
+ objects will only masquerade as undefined in their original context (i.e. their original JSGlobalObject).
+ For example, if an object that masquerades as undefined in frame A is passed to frame B, it will not
+ masquerade as undefined within frame B, but it will continue to masquerade in frame A.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::addValueToArray): Passing ExecState to toBoolean call.
+
+2012-08-14 Adam Barth <abarth@webkit.org>
+
+ Delete Frame::domWindow() and Frame::existingDOMWindow()
+ https://bugs.webkit.org/show_bug.cgi?id=93990
+
+ Reviewed by Eric Seidel.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _pendingFrameUnloadEventCount]):
+ (-[WebFrame _cacheabilityDictionary]):
+
+2012-08-14 Tom Sepez <tsepez@chromium.org>
+
+ REGRESSION r125500: 7 tests crashing on Mac bots
+ https://bugs.webkit.org/show_bug.cgi?id=93970
+
+ Reviewed by Eric Seidel.
+
+ Make WebFrameLoaderClient::redirectDataToPlugin expect the now real possibility
+ of a NULL pluginWidget argument.
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::redirectDataToPlugin)
+
2012-08-09 Kinuko Yasuda <kinuko@chromium.org>
http/tests/security/mixedContent/blob-url-in-iframe.html fails on Mac
diff --git a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig b/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
index 10257077c..cedd95d76 100644
--- a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
+++ b/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
@@ -49,6 +49,7 @@ ENABLE_CSS_COMPOSITING = ;
ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION;
ENABLE_CSS_VARIABLES = ;
ENABLE_CSS3_FLEXBOX = ENABLE_CSS3_FLEXBOX;
+ENABLE_CSS3_TEXT_DECORATION = ;
ENABLE_CUSTOM_SCHEME_HANDLER = ;
ENABLE_DASHBOARD_SUPPORT = $(ENABLE_DASHBOARD_SUPPORT_$(REAL_PLATFORM_NAME));
ENABLE_DASHBOARD_SUPPORT_macosx = ENABLE_DASHBOARD_SUPPORT;
@@ -140,4 +141,4 @@ ENABLE_WIDGET_REGION_macosx = ENABLE_WIDGET_REGION;
ENABLE_WORKERS = ENABLE_WORKERS;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_FLEXBOX) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WIDGET_REGION) $(ENABLE_WORKERS) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_FLEXBOX) $(ENABLE_CSS3_TEXT_DECORATION) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WIDGET_REGION) $(ENABLE_WORKERS) $(ENABLE_XSLT);
diff --git a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
index 6d017afac..fd14bc00a 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
+++ b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
@@ -1724,6 +1724,9 @@ PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLP
void WebFrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget)
{
+ if (!pluginWidget)
+ return;
+
BEGIN_BLOCK_OBJC_EXCEPTIONS;
WebHTMLRepresentation *representation = (WebHTMLRepresentation *)[[m_webFrame.get() _dataSource] representation];
diff --git a/Source/WebKit/mac/WebView/WebFrame.mm b/Source/WebKit/mac/WebView/WebFrame.mm
index 0ad0eca25..92f9e0bb6 100644
--- a/Source/WebKit/mac/WebView/WebFrame.mm
+++ b/Source/WebKit/mac/WebView/WebFrame.mm
@@ -906,7 +906,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
- (unsigned)_pendingFrameUnloadEventCount
{
- return _private->coreFrame->domWindow()->pendingUnloadEventListeners();
+ return _private->coreFrame->document()->domWindow()->pendingUnloadEventListeners();
}
#if ENABLE(NETSCAPE_PLUGIN_API)
@@ -1067,7 +1067,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
if (frameLoader->subframeLoader()->containsPlugins())
[result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameHasPlugins];
- if (DOMWindow* domWindow = _private->coreFrame->domWindow()) {
+ if (DOMWindow* domWindow = _private->coreFrame->document()->domWindow()) {
if (domWindow->hasEventListeners(eventNames().unloadEvent))
[result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameHasUnloadListener];
if (domWindow->optionalApplicationCache())
diff --git a/Source/WebKit/qt/Api/qwebelement.cpp b/Source/WebKit/qt/Api/qwebelement.cpp
index 50128cbe8..a208cbc4e 100644
--- a/Source/WebKit/qt/Api/qwebelement.cpp
+++ b/Source/WebKit/qt/Api/qwebelement.cpp
@@ -2057,7 +2057,7 @@ static QVariant convertJSValueToWebElementVariant(JSC::JSObject* object, int *di
// loop since when we find an Element we do not recurse.
visitedObjects->remove(object);
} else if (object && object->inherits(&JSDocument::s_info)) {
- // To support LayoutTestControllerQt::nodesFromRect(), used in DRT, we do an implicit
+ // To support TestRunnerQt::nodesFromRect(), used in DRT, we do an implicit
// conversion from 'document' to the QWebElement representing the 'document.documentElement'.
// We can't simply use a QVariantMap in nodesFromRect() because it currently times out
// when serializing DOMMimeType and DOMPlugin, even if we limit the recursion.
diff --git a/Source/WebKit/qt/Api/qwebframe.cpp b/Source/WebKit/qt/Api/qwebframe.cpp
index 52b97382d..22e47c55d 100644
--- a/Source/WebKit/qt/Api/qwebframe.cpp
+++ b/Source/WebKit/qt/Api/qwebframe.cpp
@@ -93,7 +93,9 @@
#include <qevent.h>
#include <qfileinfo.h>
#include <qpainter.h>
+#if HAVE(QTPRINTSUPPORT)
#include <qprinter.h>
+#endif
#include <qregion.h>
#include <qnetworkrequest.h>
@@ -1427,6 +1429,7 @@ bool QWebFrame::event(QEvent *e)
*/
void QWebFrame::print(QPrinter *printer) const
{
+#if HAVE(QTPRINTSUPPORT)
QPainter painter;
if (!painter.begin(printer))
return;
@@ -1514,6 +1517,7 @@ void QWebFrame::print(QPrinter *printer) const
}
printContext.end();
+#endif // HAVE(PRINTSUPPORT)
}
#endif // QT_NO_PRINTER
diff --git a/Source/WebKit/qt/Api/qwebview.cpp b/Source/WebKit/qt/Api/qwebview.cpp
index f90790f0c..036c8ea2e 100644
--- a/Source/WebKit/qt/Api/qwebview.cpp
+++ b/Source/WebKit/qt/Api/qwebview.cpp
@@ -30,7 +30,9 @@
#include "qbitmap.h"
#include "qevent.h"
#include "qpainter.h"
+#if HAVE(QTPRINTSUPPORT)
#include "qprinter.h"
+#endif
#include "qdir.h"
#include "qfile.h"
#ifndef QT_NO_ACCESSIBILITY
@@ -746,7 +748,7 @@ bool QWebView::event(QEvent *e)
*/
void QWebView::print(QPrinter *printer) const
{
-#ifndef QT_NO_PRINTER
+#if !defined(QT_NO_PRINTER) && HAVE(QTPRINTSUPPORT)
page()->mainFrame()->print(printer);
#endif
}
diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog
index b008c205d..48445e27d 100644
--- a/Source/WebKit/qt/ChangeLog
+++ b/Source/WebKit/qt/ChangeLog
@@ -1,3 +1,179 @@
+2012-08-17 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] REGRESSION(r125428): fast/profiler/nested-start-and-stop-profiler.html fails
+ https://bugs.webkit.org/show_bug.cgi?id=93897
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Fixed some test expectations.
+
+ * tests/qobjectbridge/tst_qobjectbridge.cpp:
+ (tst_QObjectBridge::objectDeleted): Since runtime methods are real function objects again, we
+ can go back to testing Function.prototype.call, as it was done before r125428.
+ (tst_QObjectBridge::introspectQtMethods_data): Removed tests for the length property.
+ (tst_QObjectBridge::introspectQtMethods): Changed test expectation of the properties of
+ run-time methods back to being non-configurable, as before r125428.
+
+2012-08-15 Ryosuke Niwa <rniwa@webkit.org>
+
+ Update manual tests and comments to refer to TestRunner instead of LayoutTestController
+ https://bugs.webkit.org/show_bug.cgi?id=94168
+
+ Reviewed by Kent Tamura.
+
+ * Api/qwebelement.cpp:
+ (convertJSValueToWebElementVariant):
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+
+2012-08-14 Adam Barth <abarth@webkit.org>
+
+ Delete Frame::domWindow() and Frame::existingDOMWindow()
+ https://bugs.webkit.org/show_bug.cgi?id=93990
+
+ Reviewed by Eric Seidel.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishDocumentLoad):
+
+2012-08-14 Lauro Neto <lauro.neto@openbossa.org>
+
+ Convert signals/slots to Q_* macros.
+
+ [Qt] Use Q_SLOTS and Q_SIGNALS instead of slots and signals
+ https://bugs.webkit.org/show_bug.cgi?id=93996
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Change usage of keyword-conflicting 'signals' and 'slots' for
+ Q_SIGNALS and Q_SLOTS macro.
+
+ * WebCoreSupport/FrameLoaderClientQt.h:
+ (FrameLoaderClientQt):
+ * WebCoreSupport/FullScreenVideoQt.h:
+ (FullScreenVideoQt):
+ * WebCoreSupport/FullScreenVideoWidget.h:
+ (FullScreenVideoWidget):
+ * WebCoreSupport/IconDatabaseClientQt.h:
+ (IconDatabaseClientQt):
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (InspectorClientWebPage):
+ * WebCoreSupport/InspectorServerQt.h:
+ (InspectorServerQt):
+ (InspectorServerRequestHandlerQt):
+ * WebCoreSupport/PopupMenuQt.h:
+ (PopupMenuQt):
+ * WebCoreSupport/QtFallbackWebPopup.h:
+ (QtFallbackWebPopup):
+ * docs/webkitsnippets/qtwebkit_bridge_snippets.cpp:
+ (wrapInFunction):
+ * docs/webkitsnippets/webpage/main.cpp:
+ (Thumbnailer):
+ * examples/platformplugin/WebPlugin.h:
+ (Popup):
+ (WebPopup):
+ * tests/benchmarks/webgl/tst_webgl.cpp:
+ (tst_WebGlPerformance):
+ * tests/hybridPixmap/tst_hybridPixmap.cpp:
+ (tst_hybridPixmap):
+ * tests/hybridPixmap/widget.h:
+ (Widget):
+ * tests/qdeclarativewebview/tst_qdeclarativewebview.cpp:
+ (tst_QDeclarativeWebView):
+ * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
+ (tst_QGraphicsWebView):
+ (WebPage):
+ (ResizeSpy):
+ * tests/qobjectbridge/tst_qobjectbridge.cpp:
+ (MyWebElementSlotOnlyObject):
+ (tst_QObjectBridge):
+ (TestPluginWidget):
+ * tests/qwebelement/tst_qwebelement.cpp:
+ (tst_QWebElement):
+ * tests/qwebframe/tst_qwebframe.cpp:
+ (tst_QWebFrame):
+ (FakeReply):
+ * tests/qwebhistory/tst_qwebhistory.cpp:
+ * tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp:
+ (tst_QWebHistoryInterface):
+ * tests/qwebinspector/tst_qwebinspector.cpp:
+ (tst_QWebInspector):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage):
+ (JSTestPage):
+ (RepaintRequestedRenderer):
+ (SpyForLoadSignalsOrder):
+ * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp:
+ (tst_QWebPluginDatabase):
+ * tests/qwebview/tst_qwebview.cpp:
+ (tst_QWebView):
+ (WebViewCrashTest):
+
+2012-08-14 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Fix failing tst_QWebPage::findText unit test
+ https://bugs.webkit.org/show_bug.cgi?id=93951
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Adjust the expected text, as the HTML editing code improved to avoid unnecessary tags.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::findText):
+
+2012-08-13 Tom Sepez <tsepez@chromium.org>
+
+ [chromium] release FrameLoaderClientImpl::m_pluginWidget refptr upon Plugin Document detach.
+ https://bugs.webkit.org/show_bug.cgi?id=93283
+
+ Reviewed by Eric Seidel.
+
+ Change the client redirectDataToPlugin method(s) to expect the possibility of
+ a NULL argument, keeping existing behaviour otherwise.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::redirectDataToPlugin):
+
+2012-08-13 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Port meta method/signal/slot handling in run-time bridge to use JSC C API
+ https://bugs.webkit.org/show_bug.cgi?id=93476
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Changed semantics of some test expectations. Similarly to r125032 when generating
+ error exceptions for connect/disconnect, we cannot generate explicit type error
+ exceptions but only generic errors. Another change is that the meta-method wrapper
+ doesn't support the call() through Function.prototype anymore. See WebCore changelog
+ for details.
+
+ * tests/qobjectbridge/tst_qobjectbridge.cpp:
+ (tst_QObjectBridge::connectAndDisconnect):
+ (tst_QObjectBridge::objectDeleted):
+ (tst_QObjectBridge::introspectQtMethods):
+
+2012-08-13 Kwang Yul Seo <skyul@company100.net>
+
+ [Qt] Add gprof.prf to build WebKit with gprof enabled
+ https://bugs.webkit.org/show_bug.cgi?id=90283
+
+ Reviewed by Eric Seidel.
+
+ * tests/MIMESniffing/MIMESniffing.pro:
+ Don't build MIMESniffing.cpp because MIMESniffing test links
+ WebKitQt statically when gprof is enabled.
+
+2012-08-12 Loïc Yhuel <loic.yhuel@softathome.com>
+
+ [Qt] Make it possible to build without QtTest/QtPrintSupport
+ https://bugs.webkit.org/show_bug.cgi?id=93492
+
+ Reviewed by Tor Arne Vestbø.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::print): Does nothing if no printsupport
+ * Api/qwebview.cpp:
+ (QWebView::print): Does nothing if no printsupport
+
2012-08-11 Pierre Rossi <pierre.rossi@gmail.com>
[Qt] Add support for HTML5 state object history API in FrameLoaderClientQt
diff --git a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
index 34041ddfa..5ed249222 100644
--- a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
+++ b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
@@ -52,7 +52,7 @@ QT_END_NAMESPACE
extern QMap<int, QWebScriptWorld*> m_worldMap;
-// Used to pass WebCore::Node's to layout tests using LayoutTestController
+// Used to pass WebCore::Node's to layout tests using TestRunner
class QWEBKIT_EXPORT QDRTNode {
public:
QDRTNode();
diff --git a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index bcd1a18ec..bcf072d65 100644
--- a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -503,7 +503,7 @@ void FrameLoaderClientQt::dispatchDidFinishDocumentLoad()
printf("%s - didFinishDocumentLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
if (QWebPagePrivate::drtRun) {
- int unloadEventCount = m_frame->domWindow()->pendingUnloadEventListeners();
+ int unloadEventCount = m_frame->document()->domWindow()->pendingUnloadEventListeners();
if (unloadEventCount)
printf("%s - has %u onunload handler(s)\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)), unloadEventCount);
}
@@ -1638,9 +1638,9 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
void FrameLoaderClientQt::redirectDataToPlugin(Widget* pluginWidget)
{
- ASSERT(!m_pluginView);
m_pluginView = static_cast<PluginView*>(pluginWidget);
- m_hasSentResponseToPlugin = false;
+ if (pluginWidget)
+ m_hasSentResponseToPlugin = false;
}
PassRefPtr<Widget> FrameLoaderClientQt::createJavaAppletWidget(const IntSize& pluginSize, HTMLAppletElement* element, const KURL& url,
diff --git a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
index 8d1c770c8..4a636a049 100644
--- a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
+++ b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
@@ -69,7 +69,7 @@ class FrameLoaderClientQt : public QObject, public FrameLoaderClient {
void callPolicyFunction(FramePolicyFunction function, PolicyAction action);
bool callErrorPageExtension(const ResourceError&);
-signals:
+Q_SIGNALS:
void loadProgress(int d);
void titleChanged(const QString& title);
void unsupportedContent(QNetworkReply*);
@@ -243,7 +243,7 @@ public:
static bool dumpHistoryCallbacks;
static QMap<QString, QString> URLsToRedirect;
-private slots:
+private Q_SLOTS:
void onIconLoadedForPageURL(const QString&);
private:
diff --git a/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h
index 6c7c7e926..34bc90c0d 100644
--- a/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h
+++ b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h
@@ -100,7 +100,7 @@ private:
MediaPlayerPrivateQt* mediaPlayer();
#endif
-private slots:
+private Q_SLOTS:
void aboutToClose();
private:
diff --git a/Source/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.h b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.h
index 466042c4d..7e7f8df1c 100644
--- a/Source/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.h
+++ b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.h
@@ -52,7 +52,7 @@ protected:
virtual bool event(QEvent*);
virtual void keyPressEvent(QKeyEvent*);
-private slots:
+private Q_SLOTS:
void hideCursor();
private:
diff --git a/Source/WebKit/qt/WebCoreSupport/IconDatabaseClientQt.h b/Source/WebKit/qt/WebCoreSupport/IconDatabaseClientQt.h
index 593fdd30b..59e9839f8 100644
--- a/Source/WebKit/qt/WebCoreSupport/IconDatabaseClientQt.h
+++ b/Source/WebKit/qt/WebCoreSupport/IconDatabaseClientQt.h
@@ -45,7 +45,7 @@ public:
virtual void didChangeIconForPageURL(const String&);
virtual void didFinishURLImport();
-signals:
+Q_SIGNALS:
void iconLoadedForPageURL(const QString&);
private:
diff --git a/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
index 73f6dd4a4..5595cc603 100644
--- a/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -75,7 +75,7 @@ public:
return page;
}
-public slots:
+public Q_SLOTS:
void javaScriptWindowObjectCleared()
{
#ifndef QT_NO_PROPERTIES
diff --git a/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.h b/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.h
index 0638f8614..b130b0a0d 100644
--- a/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.h
+++ b/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.h
@@ -55,7 +55,7 @@ protected:
InspectorServerQt();
virtual ~InspectorServerQt();
-private slots:
+private Q_SLOTS:
void newConnection();
private:
@@ -75,7 +75,7 @@ public:
virtual int webSocketSend(QByteArray payload);
virtual int webSocketSend(const char *payload, size_t length);
-private slots:
+private Q_SLOTS:
void tcpReadyRead();
void tcpConnectionDisconnected();
void webSocketReadyRead();
diff --git a/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.h b/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.h
index b7f0065dc..657651080 100644
--- a/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.h
+++ b/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.h
@@ -45,7 +45,7 @@ public:
virtual void updateFromElement();
virtual void disconnectClient();
-private slots:
+private Q_SLOTS:
void didHide();
void selectItem(int index, bool ctrl, bool shift);
diff --git a/Source/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h b/Source/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
index 2980d4582..f753373be 100644
--- a/Source/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
+++ b/Source/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
@@ -53,7 +53,7 @@ public:
void setFont(const QFont& font) { m_font = font; }
QFont font() const { return m_font; }
-private slots:
+private Q_SLOTS:
void activeChanged(int);
void deleteComboBox();
diff --git a/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp b/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp
index b18456b0f..27018af33 100644
--- a/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp
+++ b/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp
@@ -58,7 +58,7 @@ void wrapInFunction()
class MyObject : QObject {
Q_OBJECT
- public slots:
+ public Q_SLOTS:
void doSomethingWithWebElement(const QWebElement&);
};
diff --git a/Source/WebKit/qt/docs/webkitsnippets/webpage/main.cpp b/Source/WebKit/qt/docs/webkitsnippets/webpage/main.cpp
index 491935a00..daeed2bc6 100644
--- a/Source/WebKit/qt/docs/webkitsnippets/webpage/main.cpp
+++ b/Source/WebKit/qt/docs/webkitsnippets/webpage/main.cpp
@@ -30,10 +30,10 @@ class Thumbnailer : public QObject
public:
Thumbnailer(const QUrl &url);
-signals:
+Q_SIGNALS:
void finished();
-private slots:
+private Q_SLOTS:
void render();
private:
diff --git a/Source/WebKit/qt/examples/platformplugin/WebPlugin.h b/Source/WebKit/qt/examples/platformplugin/WebPlugin.h
index 446d0f754..69181f016 100644
--- a/Source/WebKit/qt/examples/platformplugin/WebPlugin.h
+++ b/Source/WebKit/qt/examples/platformplugin/WebPlugin.h
@@ -38,10 +38,10 @@ class Popup : public QDialog {
public:
Popup(const QWebSelectData& data) : m_data(data) { setModal(true); }
-signals:
+Q_SIGNALS:
void itemClicked(int idx);
-protected slots:
+protected Q_SLOTS:
void onItemSelected(QListWidgetItem* item);
protected:
@@ -77,7 +77,7 @@ public:
virtual void setGeometry(const QRect&) { }
virtual void setFont(const QFont&) { }
-private slots:
+private Q_SLOTS:
void popupClosed();
void itemClicked(int idx);
diff --git a/Source/WebKit/qt/tests/MIMESniffing/MIMESniffing.pro b/Source/WebKit/qt/tests/MIMESniffing/MIMESniffing.pro
index c856a6e7d..288e10402 100644
--- a/Source/WebKit/qt/tests/MIMESniffing/MIMESniffing.pro
+++ b/Source/WebKit/qt/tests/MIMESniffing/MIMESniffing.pro
@@ -2,7 +2,10 @@ include(../tests.pri)
TARGET = MIMESniffing
CONFIG += console
-SOURCES += ../../../../WebCore/platform/network/MIMESniffing.cpp
+!contains(CONFIG, gprof) {
+ SOURCES += ../../../../WebCore/platform/network/MIMESniffing.cpp
+}
+
HEADERS += \
../../../../WebCore/platform/network/MIMESniffing.h \
TestData.h
diff --git a/Source/WebKit/qt/tests/benchmarks/webgl/tst_webgl.cpp b/Source/WebKit/qt/tests/benchmarks/webgl/tst_webgl.cpp
index bd865a233..14ff1a80f 100644
--- a/Source/WebKit/qt/tests/benchmarks/webgl/tst_webgl.cpp
+++ b/Source/WebKit/qt/tests/benchmarks/webgl/tst_webgl.cpp
@@ -31,7 +31,7 @@ class GraphicsView;
class tst_WebGlPerformance : public QObject {
Q_OBJECT
-private slots:
+private Q_SLOTS:
void init();
void cleanup();
diff --git a/Source/WebKit/qt/tests/hybridPixmap/tst_hybridPixmap.cpp b/Source/WebKit/qt/tests/hybridPixmap/tst_hybridPixmap.cpp
index 72dbb3b96..84891580a 100644
--- a/Source/WebKit/qt/tests/hybridPixmap/tst_hybridPixmap.cpp
+++ b/Source/WebKit/qt/tests/hybridPixmap/tst_hybridPixmap.cpp
@@ -28,7 +28,7 @@ class tst_hybridPixmap : public QObject {
public:
tst_hybridPixmap(QObject* o = 0) : QObject(o) {}
-public slots:
+public Q_SLOTS:
void init()
{
}
@@ -37,7 +37,7 @@ public slots:
{
}
-private slots:
+private Q_SLOTS:
void hybridPixmap()
{
Widget widget;
diff --git a/Source/WebKit/qt/tests/hybridPixmap/widget.h b/Source/WebKit/qt/tests/hybridPixmap/widget.h
index c6061736b..b78df8b5e 100644
--- a/Source/WebKit/qt/tests/hybridPixmap/widget.h
+++ b/Source/WebKit/qt/tests/hybridPixmap/widget.h
@@ -46,10 +46,10 @@ public:
void setImage(const QImage&);
QImage image() const;
-private slots:
+private Q_SLOTS:
void refreshJS();
-public slots:
+public Q_SLOTS:
void completeTest();
void start();
void compare(const QVariant& a, const QVariant& b);
@@ -58,7 +58,7 @@ public slots:
void randomSlot(const QPixmap&);
QImage abcImage(int format);
-signals:
+Q_SIGNALS:
void testComplete();
void imageSignal(const QImage&);
void pixmapSignal(const QPixmap&);
diff --git a/Source/WebKit/qt/tests/qdeclarativewebview/tst_qdeclarativewebview.cpp b/Source/WebKit/qt/tests/qdeclarativewebview/tst_qdeclarativewebview.cpp
index 3623c6a3f..97da3539a 100644
--- a/Source/WebKit/qt/tests/qdeclarativewebview/tst_qdeclarativewebview.cpp
+++ b/Source/WebKit/qt/tests/qdeclarativewebview/tst_qdeclarativewebview.cpp
@@ -20,7 +20,7 @@ class tst_QDeclarativeWebView : public QObject {
public:
tst_QDeclarativeWebView();
-private slots:
+private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
diff --git a/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp b/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
index c4f58a711..992eb904b 100644
--- a/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
+++ b/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
@@ -34,7 +34,7 @@ class tst_QGraphicsWebView : public QObject
{
Q_OBJECT
-private slots:
+private Q_SLOTS:
void qgraphicswebview();
void crashOnViewlessWebPages();
void microFocusCoordinates();
@@ -92,7 +92,7 @@ public:
QGraphicsWebView* webView;
-private slots:
+private Q_SLOTS:
// Force a webview deletion during the load.
// It should not cause WebPage to crash due to
// it accessing invalid pageClient pointer.
@@ -636,7 +636,7 @@ void tst_QGraphicsWebView::compareCanvasToImage(const QUrl& url, const QImage& r
class ResizeSpy : public QObject {
Q_OBJECT
-public slots:
+public Q_SLOTS:
void receiveResize(int width, int height)
{
m_size = QSize(width, height);
@@ -648,7 +648,7 @@ public slots:
return m_size;
}
-signals:
+Q_SIGNALS:
void resized();
private:
diff --git a/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp b/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp
index 45626d9ef..13d98af93 100644
--- a/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp
+++ b/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp
@@ -589,7 +589,7 @@ private:
class MyWebElementSlotOnlyObject : public QObject {
Q_OBJECT
Q_PROPERTY(QString tagName READ tagName)
-public slots:
+public Q_SLOTS:
void doSomethingWithWebElement(const QWebElement& element)
{
m_tagName = element.tagName();
@@ -616,11 +616,11 @@ class tst_QObjectBridge : public QObject {
public:
tst_QObjectBridge();
-public slots:
+public Q_SLOTS:
void init();
void cleanup();
-private slots:
+private Q_SLOTS:
void getSetStaticProperty();
void getSetDynamicProperty();
void getSetChildren();
@@ -1499,10 +1499,13 @@ void tst_QObjectBridge::connectAndDisconnect()
QCOMPARE(evalJS("myObject.mySignal2.disconnect(myObject, myHandler)"), sUndefined);
// connect(obj, string)
- QCOMPARE(evalJS("myObject.mySignal.connect(yetAnotherObject, 'func')"), sUndefined);
- QCOMPARE(evalJS("myObject.mySignal.connect(myObject, 'mySlot')"), sUndefined);
- QCOMPARE(evalJS("myObject.mySignal.disconnect(yetAnotherObject, 'func')"), sUndefined);
- QCOMPARE(evalJS("myObject.mySignal.disconnect(myObject, 'mySlot')"), sUndefined);
+ {
+ QString type;
+ QCOMPARE(evalJS("myObject.mySignal.connect(yetAnotherObject, 'func')", type), sUndefined);
+ QCOMPARE(evalJS("myObject.mySignal.connect(myObject, 'mySlot')", type), sUndefined);
+ QCOMPARE(evalJS("myObject.mySignal.disconnect(yetAnotherObject, 'func')", type), sUndefined);
+ QCOMPARE(evalJS("myObject.mySignal.disconnect(myObject, 'mySlot')", type), sUndefined);
+ }
// check that emitting signals from script works
@@ -1555,6 +1558,14 @@ void tst_QObjectBridge::connectAndDisconnect()
QCOMPARE(m_myObject->qtFunctionActuals().at(0).toInt(), 456);
QCOMPARE(evalJS("myObject.mySignalWithIntArg.disconnect(myObject['myOverloadedSlot(int)'])"), sUndefined);
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg.connect(myObject, 'myOverloadedSlot(int)')"), sUndefined);
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg(456)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 28); // int overload
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toInt(), 456);
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg.disconnect(myObject, 'myOverloadedSlot(int)')"), sUndefined);
+
// erroneous input
{
// ### QtScript adds .connect to all functions, WebKit does only to signals/slots
@@ -1587,20 +1598,34 @@ void tst_QObjectBridge::connectAndDisconnect()
QString type;
QString ret = evalJS("myObject.myInvokable.connect(123)", type);
QCOMPARE(type, sError);
- QCOMPARE(ret, QLatin1String("TypeError: QtMetaMethod.connect: MyQObject::myInvokable() is not a signal"));
+ QCOMPARE(ret, QLatin1String("Error: QtMetaMethod.connect: MyQObject::myInvokable() is not a signal"));
}
{
QString type;
QString ret = evalJS("myObject.myInvokable.connect(function() { })", type);
QCOMPARE(type, sError);
- QCOMPARE(ret, QLatin1String("TypeError: QtMetaMethod.connect: MyQObject::myInvokable() is not a signal"));
+ QCOMPARE(ret, QLatin1String("Error: QtMetaMethod.connect: MyQObject::myInvokable() is not a signal"));
}
{
QString type;
QString ret = evalJS("myObject.mySignal.connect(123)", type);
QCOMPARE(type, sError);
- QCOMPARE(ret, QLatin1String("TypeError: QtMetaMethod.connect: target is not a function"));
+ QCOMPARE(ret, QLatin1String("Error: QtMetaMethod.connect: target is not a function"));
+ }
+
+ {
+ QString type;
+ QString ret = evalJS("var randomObject = new Object; myObject.mySignal.connect(myObject, randomObject)", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("Error: QtMetaMethod.connect: target is not a function"));
+ }
+
+ {
+ QString type;
+ QString ret = evalJS("myObject.mySignal.connect(myObject, 'nonExistantSlot')", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("Error: QtMetaMethod.connect: target is not a function"));
}
{
@@ -1616,6 +1641,13 @@ void tst_QObjectBridge::connectAndDisconnect()
QCOMPARE(ret, QLatin1String("Error: QtMetaMethod.disconnect: no arguments given"));
}
+ {
+ QString type;
+ QString ret = evalJS("myObject.mySignal.disconnect(myObject, 'nonExistantSlot')", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("Error: QtMetaMethod.disconnect: target is not a function"));
+ }
+
/* XFAIL - Function.prototype doesn't get connect/disconnect, just signals/slots
{
QString type;
@@ -1629,27 +1661,27 @@ void tst_QObjectBridge::connectAndDisconnect()
QString type;
QString ret = evalJS("var o = { }; o.disconnect = myObject.myInvokable.disconnect; o.disconnect(123)", type);
QCOMPARE(type, sError);
- QCOMPARE(ret, QLatin1String("TypeError: QtMetaMethod.disconnect: MyQObject::myInvokable() is not a signal"));
+ QCOMPARE(ret, QLatin1String("Error: QtMetaMethod.disconnect: MyQObject::myInvokable() is not a signal"));
}
{
QString type;
QString ret = evalJS("myObject.myInvokable.disconnect(123)", type);
QCOMPARE(type, sError);
- QCOMPARE(ret, QLatin1String("TypeError: QtMetaMethod.disconnect: MyQObject::myInvokable() is not a signal"));
+ QCOMPARE(ret, QLatin1String("Error: QtMetaMethod.disconnect: MyQObject::myInvokable() is not a signal"));
}
{
QString type;
QString ret = evalJS("myObject.myInvokable.disconnect(function() { })", type);
QCOMPARE(type, sError);
- QCOMPARE(ret, QLatin1String("TypeError: QtMetaMethod.disconnect: MyQObject::myInvokable() is not a signal"));
+ QCOMPARE(ret, QLatin1String("Error: QtMetaMethod.disconnect: MyQObject::myInvokable() is not a signal"));
}
{
QString type;
QString ret = evalJS("myObject.mySignal.disconnect(123)", type);
QCOMPARE(type, sError);
- QCOMPARE(ret, QLatin1String("TypeError: QtMetaMethod.disconnect: target is not a function"));
+ QCOMPARE(ret, QLatin1String("Error: QtMetaMethod.disconnect: target is not a function"));
}
{
@@ -2116,15 +2148,15 @@ void tst_QObjectBridge::introspectQtMethods_data()
QTest::addColumn<QStringList>("expectedPropertyNames");
QTest::newRow("myObject.mySignal")
- << "myObject" << "mySignal" << (QStringList() << "connect" << "disconnect" << "length" << "name");
+ << "myObject" << "mySignal" << (QStringList() << "connect" << "disconnect" << "name");
QTest::newRow("myObject.mySlot")
- << "myObject" << "mySlot" << (QStringList() << "connect" << "disconnect" << "length" << "name");
+ << "myObject" << "mySlot" << (QStringList() << "connect" << "disconnect" << "name");
QTest::newRow("myObject.myInvokable")
- << "myObject" << "myInvokable" << (QStringList() << "connect" << "disconnect" << "length" << "name");
+ << "myObject" << "myInvokable" << (QStringList() << "connect" << "disconnect" << "name");
QTest::newRow("myObject.mySignal.connect")
- << "myObject.mySignal" << "connect" << (QStringList() << "length" << "name");
+ << "myObject.mySignal" << "connect" << (QStringList() << "name");
QTest::newRow("myObject.mySignal.disconnect")
- << "myObject.mySignal" << "disconnect" << (QStringList() << "length" << "name");
+ << "myObject.mySignal" << "disconnect" << (QStringList() << "name");
}
void tst_QObjectBridge::introspectQtMethods()
@@ -2165,7 +2197,7 @@ class TestPluginWidget : public QWidget {
public:
TestPluginWidget() { }
-public slots:
+public Q_SLOTS:
int slotWithReturnValue() { return 42; }
};
diff --git a/Source/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp b/Source/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
index 9a208bc47..ca3d1bbf5 100644
--- a/Source/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
+++ b/Source/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
@@ -36,11 +36,11 @@ public:
tst_QWebElement();
virtual ~tst_QWebElement();
-public slots:
+public Q_SLOTS:
void init();
void cleanup();
-private slots:
+private Q_SLOTS:
void textHtml();
void simpleCollection();
void attributes();
diff --git a/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index d7db84726..4c2d042f8 100644
--- a/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -46,11 +46,11 @@ class tst_QWebFrame : public QObject
public:
bool eventFilter(QObject* watched, QEvent* event);
-public slots:
+public Q_SLOTS:
void init();
void cleanup();
-private slots:
+private Q_SLOTS:
void horizontalScrollAfterBack();
void symmetricUrl();
void progressSignal();
@@ -244,7 +244,7 @@ protected:
return 0;
}
-private slots:
+private Q_SLOTS:
void continueRedirect()
{
emit metaDataChanged();
@@ -1489,10 +1489,10 @@ public:
URLSetter(QWebFrame*, Signal, Type, const QUrl&);
-public slots:
+public Q_SLOTS:
void execute();
-signals:
+Q_SIGNALS:
void finished();
private:
diff --git a/Source/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp b/Source/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
index 783214ccb..c0d9d8ec2 100644
--- a/Source/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
+++ b/Source/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
@@ -41,11 +41,11 @@ protected :
waitForLoadFinished.exec();
}
-public slots:
+public Q_SLOTS:
void init();
void cleanup();
-private slots:
+private Q_SLOTS:
void title();
void count();
void back();
diff --git a/Source/WebKit/qt/tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp b/Source/WebKit/qt/tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp
index 84b12d2d7..f4571cf74 100644
--- a/Source/WebKit/qt/tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp
+++ b/Source/WebKit/qt/tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp
@@ -35,11 +35,11 @@ public:
tst_QWebHistoryInterface();
virtual ~tst_QWebHistoryInterface();
-public slots:
+public Q_SLOTS:
void init();
void cleanup();
-private slots:
+private Q_SLOTS:
void visitedLinks();
private:
diff --git a/Source/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp b/Source/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp
index 12cd630cd..181fdac45 100644
--- a/Source/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp
+++ b/Source/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp
@@ -27,7 +27,7 @@
class tst_QWebInspector : public QObject {
Q_OBJECT
-private slots:
+private Q_SLOTS:
void attachAndDestroy();
};
diff --git a/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 13e7a9f17..67b45b18e 100644
--- a/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -82,12 +82,12 @@ public:
tst_QWebPage();
virtual ~tst_QWebPage();
-public slots:
+public Q_SLOTS:
void init();
void cleanup();
void cleanupFiles();
-private slots:
+private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
void thirdPartyCookiePolicy();
@@ -262,7 +262,7 @@ public:
JSTestPage(QObject* parent = 0)
: QWebPage(parent) {}
-public slots:
+public Q_SLOTS:
bool shouldInterruptJavaScript() {
return true;
}
@@ -2946,7 +2946,7 @@ void tst_QWebPage::findText()
foreach (QString subString, words) {
m_page->findText(subString, QWebPage::FindWrapsAroundDocument);
QCOMPARE(m_page->selectedText(), subString);
- QCOMPARE(m_page->selectedHtml().trimmed().replace(regExp, ""), QString("<span>%1</span>").arg(subString));
+ QCOMPARE(m_page->selectedHtml().trimmed().replace(regExp, ""), subString);
m_page->findText("");
QVERIFY(m_page->selectedText().isEmpty());
QVERIFY(m_page->selectedHtml().isEmpty());
@@ -3170,10 +3170,10 @@ public:
connect(m_page, SIGNAL(repaintRequested(QRect)), this, SLOT(onRepaintRequested(QRect)));
}
-signals:
+Q_SIGNALS:
void finished();
-private slots:
+private Q_SLOTS:
void onRepaintRequested(const QRect& rect)
{
QCOMPARE(m_recursionCount, 0);
@@ -3238,7 +3238,7 @@ public Q_SLOTS:
if (progress == 100)
emit lastLoadProgress();
}
-signals:
+Q_SIGNALS:
void lastLoadProgress();
};
diff --git a/Source/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp b/Source/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp
index 1ee6206c5..1d524e24a 100644
--- a/Source/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp
+++ b/Source/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp
@@ -30,7 +30,7 @@ class tst_QWebPluginDatabase : public QObject
{
Q_OBJECT
-private slots:
+private Q_SLOTS:
void installedPlugins();
void searchPaths();
void null_data();
diff --git a/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp
index f7dc9c5f4..c1f8ac6a2 100644
--- a/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp
+++ b/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp
@@ -38,13 +38,13 @@ class tst_QWebView : public QObject
{
Q_OBJECT
-public slots:
+public Q_SLOTS:
void initTestCase();
void cleanupTestCase();
void init();
void cleanup();
-private slots:
+private Q_SLOTS:
void renderingAfterMaxAndBack();
void renderHints();
void getWebKitVersion();
@@ -180,7 +180,7 @@ public:
view->connect(view, SIGNAL(loadProgress(int)), this, SLOT(loading(int)));
}
-private slots:
+private Q_SLOTS:
void loading(int progress)
{
if (progress >= 20 && progress < 90) {
diff --git a/Source/WebKit/win/ChangeLog b/Source/WebKit/win/ChangeLog
index d13a3fc1c..ed76faf90 100644
--- a/Source/WebKit/win/ChangeLog
+++ b/Source/WebKit/win/ChangeLog
@@ -1,3 +1,36 @@
+2012-08-15 Ryosuke Niwa <rniwa@webkit.org>
+
+ Update manual tests and comments to refer to TestRunner instead of LayoutTestController
+ https://bugs.webkit.org/show_bug.cgi?id=94168
+
+ Reviewed by Kent Tamura.
+
+ * Interfaces/IWebPreferencesPrivate.idl:
+
+2012-08-14 Adam Barth <abarth@webkit.org>
+
+ Delete Frame::domWindow() and Frame::existingDOMWindow()
+ https://bugs.webkit.org/show_bug.cgi?id=93990
+
+ Reviewed by Eric Seidel.
+
+ * WebFrame.cpp:
+ (WebFrame::DOMWindow):
+ (WebFrame::pendingFrameUnloadEventCount):
+
+2012-08-13 Tom Sepez <tsepez@chromium.org>
+
+ [chromium] release FrameLoaderClientImpl::m_pluginWidget refptr upon Plugin Document detach.
+ https://bugs.webkit.org/show_bug.cgi?id=93283
+
+ Reviewed by Eric Seidel.
+
+ Change the client redirectDataToPlugin method(s) to expect the possibility of
+ a NULL argument, keeping existing behaviour otherwise.
+
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::redirectDataToPlugin):
+
2012-08-05 Patrick Gansterer <paroga@webkit.org>
[WIN] Use sizeof() for cbWndExtra values
diff --git a/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl b/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
index 2f1fdeae5..f88f783a5 100644
--- a/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
+++ b/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
@@ -88,7 +88,7 @@ interface IWebPreferencesPrivate : IUnknown
HRESULT setShouldUseHighResolutionTimers([in] BOOL useHighResolutionTimers);
HRESULT shouldUseHighResolutionTimers([out, retval] BOOL* useHighResolutionTimers);
- // Used to set preference specified by a test via LayoutTestController.overridePreference(..).
+ // Used to set preference specified by a test via TestRunner.overridePreference(..).
// Used by DumpRenderTree.
HRESULT setPreferenceForTest([in] BSTR key, [in] BSTR value);
diff --git a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
index 4f717c57b..64622968a 100644
--- a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -885,8 +885,7 @@ PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize& pluginSize,
void WebFrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget)
{
// Ideally, this function shouldn't be necessary, see <rdar://problem/4852889>
-
- if (pluginWidget->isPluginView())
+ if (!pluginWidget || pluginWidget->isPluginView())
m_manualLoader = static_cast<PluginView*>(pluginWidget);
else
m_manualLoader = static_cast<EmbeddedWidget*>(pluginWidget);
diff --git a/Source/WebKit/win/WebFrame.cpp b/Source/WebKit/win/WebFrame.cpp
index ff560c67b..d1880cf3f 100644
--- a/Source/WebKit/win/WebFrame.cpp
+++ b/Source/WebKit/win/WebFrame.cpp
@@ -478,7 +478,7 @@ HRESULT WebFrame::DOMWindow(/* [retval][out] */ IDOMWindow** window)
*window = 0;
if (Frame* coreFrame = core(this)) {
- if (WebCore::DOMWindow* coreWindow = coreFrame->domWindow())
+ if (WebCore::DOMWindow* coreWindow = coreFrame->document()->domWindow())
*window = ::DOMWindow::createInstance(coreWindow);
}
@@ -989,7 +989,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::pendingFrameUnloadEventCount(
if (!coreFrame)
return E_FAIL;
- *result = coreFrame->domWindow()->pendingUnloadEventListeners();
+ *result = coreFrame->document()->domWindow()->pendingUnloadEventListeners();
return S_OK;
}
diff --git a/Source/WebKit/wince/ChangeLog b/Source/WebKit/wince/ChangeLog
index 1b81b8549..31f521746 100644
--- a/Source/WebKit/wince/ChangeLog
+++ b/Source/WebKit/wince/ChangeLog
@@ -1,3 +1,16 @@
+2012-08-13 Tom Sepez <tsepez@chromium.org>
+
+ [chromium] release FrameLoaderClientImpl::m_pluginWidget refptr upon Plugin Document detach.
+ https://bugs.webkit.org/show_bug.cgi?id=93283
+
+ Reviewed by Eric Seidel.
+
+ Change the client redirectDataToPlugin method(s) to expect the possibility of
+ a NULL argument, keeping existing behaviour otherwise.
+
+ * WebCoreSupport/FrameLoaderClientWinCE.cpp:
+ (WebKit::FrameLoaderClientWinCE::redirectDataToPlugin):
+
2012-07-23 Pierre Rossi <pierre.rossi@gmail.com>
Unify numTouchEventHandlersChanged and needTouchEvents in the chrome client
diff --git a/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp b/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp
index 839f4b9b8..daefb90be 100644
--- a/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp
+++ b/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp
@@ -174,9 +174,9 @@ PassRefPtr<Frame> FrameLoaderClientWinCE::createFrame(const KURL& url, const Str
void FrameLoaderClientWinCE::redirectDataToPlugin(Widget* pluginWidget)
{
- ASSERT(!m_pluginView);
m_pluginView = static_cast<PluginView*>(pluginWidget);
- m_hasSentResponseToPlugin = false;
+ if (pluginWidget)
+ m_hasSentResponseToPlugin = false;
}
PassRefPtr<Widget> FrameLoaderClientWinCE::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL&, const Vector<String>&, const Vector<String>&)
diff --git a/Source/WebKit/wx/ChangeLog b/Source/WebKit/wx/ChangeLog
index 5af5a7eef..1952bbbf0 100644
--- a/Source/WebKit/wx/ChangeLog
+++ b/Source/WebKit/wx/ChangeLog
@@ -1,3 +1,18 @@
+2012-08-13 Tom Sepez <tsepez@chromium.org>
+
+ [chromium] release FrameLoaderClientImpl::m_pluginWidget refptr upon Plugin Document detach.
+ https://bugs.webkit.org/show_bug.cgi?id=93283
+
+ Reviewed by Eric Seidel.
+
+ Chromium has a refptr that needs to be NULLed at this point.
+
+ Change the client redirectDataToPlugin method(s) to expect the possibility of
+ a NULL argument, keeping existing behaviour otherwise.
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::redirectDataToPlugin):
+
2012-07-23 Pierre Rossi <pierre.rossi@gmail.com>
Unify numTouchEventHandlersChanged and needTouchEvents in the chrome client
diff --git a/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp b/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
index 899d0fc60..18b6730da 100644
--- a/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
+++ b/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
@@ -904,9 +904,9 @@ PassRefPtr<Widget> FrameLoaderClientWx::createPlugin(const IntSize& size, HTMLPl
void FrameLoaderClientWx::redirectDataToPlugin(Widget* pluginWidget)
{
- ASSERT(!m_pluginView);
m_pluginView = static_cast<PluginView*>(pluginWidget);
- m_hasSentResponseToPlugin = false;
+ if (pluginWidget)
+ m_hasSentResponseToPlugin = false;
}
ResourceError FrameLoaderClientWx::pluginWillHandleLoadError(const ResourceResponse& response)
diff --git a/Source/WebKit2/CMakeLists.txt b/Source/WebKit2/CMakeLists.txt
index 06440b234..c43dd4ac8 100644
--- a/Source/WebKit2/CMakeLists.txt
+++ b/Source/WebKit2/CMakeLists.txt
@@ -56,6 +56,7 @@ SET(WebKit2_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/bridge/jsc"
"${WEBCORE_DIR}/css"
"${WEBCORE_DIR}/dom"
+ "${WEBCORE_DIR}/dom/default"
"${WEBCORE_DIR}/editing"
"${WEBCORE_DIR}/history"
"${WEBCORE_DIR}/html"
@@ -380,6 +381,7 @@ SET(WebKit2_SOURCES
WebProcess/InjectedBundle/InjectedBundleClient.cpp
WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.cpp
WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp
+ WebProcess/InjectedBundle/InjectedBundleIntent.cpp
WebProcess/InjectedBundle/InjectedBundleIntentRequest.cpp
WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp
WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp
@@ -400,6 +402,7 @@ SET(WebKit2_SOURCES
WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp
WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp
+ WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp
WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.cpp
WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp
WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp
@@ -464,6 +467,7 @@ SET(WebKit2_SOURCES
WebProcess/WebPage/EventDispatcher.cpp
WebProcess/WebPage/FindController.cpp
+ WebProcess/WebPage/AreaAllocator.cpp
WebProcess/WebPage/LayerTreeHost.cpp
WebProcess/WebPage/PageOverlay.cpp
WebProcess/WebPage/TapHighlightController.cpp
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index 3994b5c36..1ed41a373 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,1294 @@
+2012-08-21 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed build fix for newer Qt 5: QT += qmltest does not imply QT += testlib anymore, but
+ the code here needs QSignalSpy from QTestLib
+
+ * UIProcess/API/qt/tests/qmltests/DesktopBehavior.pro:
+ * UIProcess/API/qt/tests/qmltests/WebView.pro:
+
+2012-08-18 John Sullivan <sullivan@apple.com>
+
+ <https://bugs.webkit.org/show_bug.cgi?id=94486>
+ <rdar://problem/12128557>
+ REGRESSION (r121482, Lion-only): Closing a popover containing a WKView can crash
+
+ Reviewed by Darin Adler.
+
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView viewWillMoveToWindow:]):
+ Avoid calling the code added in 121482 that ensures that the undo stack is cleaned up
+ before the WKView is moved from one window to another when the WKView is being moved
+ out of a popover window. This avoids a bug in OS X 10.7 that was fixed in 10.8.
+ While this technically reopens a potentially crashing code path that 121482 closed,
+ it only reopens it for WKViews that are used for text editing and that are removed
+ from an NSPopover at some time earlier than tear-down of the NSPopover.
+
+2012-08-20 Allan Sandfeld Jensen <allan.jensen@nokia.com>
+
+ [Qt] Custom tap-highlight-color renders fully opaque
+ https://bugs.webkit.org/show_bug.cgi?id=94468
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Draw tap-highlight-color at 50% transparency, to better match how
+ existing WebKit browsers act on custom tap-highlight colors.
+
+ * WebProcess/WebPage/TapHighlightController.cpp:
+ (WebKit::TapHighlightController::drawRect):
+
+2012-08-20 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Replace webkit_web_view_replace_content with webkit_web_view_load_alternate_html
+ https://bugs.webkit.org/show_bug.cgi?id=94471
+
+ Reviewed by Martin Robinson.
+
+ In WebKit1 there's code to prevent that load signals are emitted
+ when loading internal custom error pages. We added
+ webkit_web_view_replace_content() with the same idea, but it has
+ ended up being problematic, because it allows to add any HTML
+ content (in WebKit1 we assumed internal error pages never failed
+ and always loaded) and it's impossible to know when the load has
+ finished. It also required a lot of logic to handle
+ replace_content as an especial case, in order to hide the fact
+ that it loads content. This patch renames
+ webkit_web_view_replace_content() as
+ webkit_web_view_load_alternate_html() and emit load events
+ normally.
+
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+ (_WebKitWebViewPrivate):
+ (webkitWebViewLoadChanged):
+ (webkitWebViewLoadFailed):
+ (webkitWebViewSetEstimatedLoadProgress):
+ (webkitWebViewResourceLoadStarted):
+ (webkitWebViewGetLoadingWebResource):
+ (webkitWebViewRemoveLoadingWebResource):
+ (webkitWebViewResourceLoadFinished):
+ (webkit_web_view_load_alternate_html):
+ * UIProcess/API/gtk/WebKitWebView.h:
+ * UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
+ * UIProcess/API/gtk/tests/TestLoaderClient.cpp:
+ (testLoadAlternateHTML):
+ (beforeAll):
+ * UIProcess/API/gtk/tests/TestResources.cpp:
+ (beforeAll):
+ * UIProcess/API/gtk/tests/TestWebKitWebView.cpp:
+ (beforeAll):
+ * UIProcess/API/gtk/tests/WebViewTest.cpp:
+ (WebViewTest::loadAlternateHTML):
+ * UIProcess/API/gtk/tests/WebViewTest.h:
+
+2012-08-20 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ [EFL][WK2] Add unit tests for WKEinaSharedString
+ https://bugs.webkit.org/show_bug.cgi?id=94104
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Added unit tests for WKEinaSharedString class.
+
+ * PlatformEfl.cmake:
+ * UIProcess/API/efl/tests/test_ewk2_eina_shared_string.cpp: Added.
+ (checkString):
+ (TEST_F):
+
+2012-08-20 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Add API to set preferred languages to WebKit2 GTK+
+ https://bugs.webkit.org/show_bug.cgi?id=90878
+
+ Reviewed by Martin Robinson.
+
+ * UIProcess/API/gtk/WebKitWebContext.cpp:
+ (webkit_web_context_set_preferred_languages): Public API to set a
+ list of preferred languages sorted from most desirable to least
+ desirable.
+ * UIProcess/API/gtk/WebKitWebContext.h:
+ * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol.
+ * UIProcess/API/gtk/tests/TestWebKitWebContext.cpp:
+ (testWebContextLanguages):
+ (serverCallback):
+ (beforeAll):
+ (afterAll):
+ * UIProcess/API/gtk/tests/WebViewTest.cpp:
+ (resourceGetDataCallback):
+ (WebViewTest::mainResourceData): Moved from TestWebKitWebContext
+ to make it available to all WebViewTests.
+ * UIProcess/API/gtk/tests/WebViewTest.h:
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::userPreferredLanguagesChanged): Notify our
+ observer that the languages have been overriden.
+ * WebProcess/gtk/WebProcessGtk.cpp:
+ (WebKit::buildAcceptLanguages): Helper function to build the
+ accept languages as specified in RFC 2616.
+ (WebKit::setSoupSessionAcceptLanguage): Set the accept-language
+ property of the default SoupSession.
+ (WebKit::languageChanged): Update the preferred languages in
+ SoupSession.
+ (WebKit::WebProcess::platformInitializeWebProcess): Add an
+ observer to be notified when the list of preferred languages is
+ updated.
+ (WebKit::WebProcess::platformTerminate): Remove the observer added
+ in platformInitializeWebProcess().
+
+2012-08-19 Dan Bernstein <mitz@apple.com>
+
+ WebPageProxy::setCursor does not check that the view is still in an active window
+ https://bugs.webkit.org/show_bug.cgi?id=94427
+
+ Reviewed by Alexey Proskuryakov.
+
+ The Web process may ask to change the cursor when the view is in an active window, but
+ if by the time the UI process receives the message, the view is no longer in a window or the
+ window is not active , then the cursor should not change.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::setCursor): Added a check that the view is in an active window before
+ allowing the page to change the cursor.
+
+2012-08-19 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125972.
+ http://trac.webkit.org/changeset/125972
+ https://bugs.webkit.org/show_bug.cgi?id=94431
+
+ Breaks AppleMac builds (Requested by pfeldman on #webkit).
+
+ * UIProcess/API/gtk/WebKitWebContext.cpp:
+ * UIProcess/API/gtk/WebKitWebContext.h:
+ * UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
+ * UIProcess/API/gtk/tests/TestWebKitWebContext.cpp:
+ (beforeAll):
+ (afterAll):
+ * UIProcess/API/gtk/tests/WebViewTest.cpp:
+ (WebViewTest::WebViewTest):
+ * UIProcess/API/gtk/tests/WebViewTest.h:
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::userPreferredLanguagesChanged):
+ * WebProcess/gtk/WebProcessGtk.cpp:
+ (WebKit::WebProcess::platformInitializeWebProcess):
+ (WebKit::WebProcess::platformTerminate):
+
+2012-08-19 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL][WK2] Add API unit tests for Web Intents
+ https://bugs.webkit.org/show_bug.cgi?id=90454
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add unit testing for Web intent requests,
+ including the "intent,request,new" signal on
+ the Ewk_View and the Ewk_Intent API.
+
+ * UIProcess/API/efl/ewk_view.h: Fix documentation for argument type of "intent,request,new" signal.
+ * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
+ (EWK2UnitTest::EWK2UnitTestBase::mouseClick): Add utility method to simulate a click at given
+ coordinates. This is needed for testing functionality that requires a user gesture.
+ (EWK2UnitTest):
+ * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
+ (EWK2UnitTestBase):
+ * UIProcess/API/efl/tests/resources/intent-request.html: Added.
+ * UIProcess/API/efl/tests/test_ewk2_intents.cpp:
+ (stringSortCb):
+ (onIntentReceived):
+ (TEST_F):
+
+2012-08-18 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Add API to set preferred languages to WebKit2 GTK+
+ https://bugs.webkit.org/show_bug.cgi?id=90878
+
+ Reviewed by Martin Robinson.
+
+ * UIProcess/API/gtk/WebKitWebContext.cpp:
+ (webkit_web_context_set_preferred_languages): Public API to set a
+ list of preferred languages sorted from most desirable to least
+ desirable.
+ * UIProcess/API/gtk/WebKitWebContext.h:
+ * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol.
+ * UIProcess/API/gtk/tests/TestWebKitWebContext.cpp:
+ (testWebContextLanguages):
+ (serverCallback):
+ (beforeAll):
+ (afterAll):
+ * UIProcess/API/gtk/tests/WebViewTest.cpp:
+ (resourceGetDataCallback):
+ (WebViewTest::mainResourceData): Moved from TestWebKitWebContext
+ to make it available to all WebViewTests.
+ * UIProcess/API/gtk/tests/WebViewTest.h:
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::userPreferredLanguagesChanged): Notify our
+ observer that the languages have been overriden.
+ * WebProcess/gtk/WebProcessGtk.cpp:
+ (WebKit::buildAcceptLanguages): Helper function to build the
+ accept languages as specified in RFC 2616.
+ (WebKit::setSoupSessionAcceptLanguage): Set the accept-language
+ property of the default SoupSession.
+ (WebKit::languageChanged): Update the preferred languages in
+ SoupSession.
+ (WebKit::WebProcess::platformInitializeWebProcess): Add an
+ observer to be notified when the list of preferred languages is
+ updated.
+ (WebKit::WebProcess::platformTerminate): Remove the observer added
+ in platformInitializeWebProcess().
+
+2012-08-18 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ [EFL][WK2] ewk_back_forward_list_item properties should be in sync with WebProcessProxy::m_backForwardListItemMap
+ https://bugs.webkit.org/show_bug.cgi?id=94248
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Currently ewk_back_forward_list_item properties are initialized from
+ WKBackForwardListItemRef once in the constructor and then just stored.
+ This is erroneous approach as back forward items can be initialized within
+ several iterations, meaning several ipc calls to UI process and several updates
+ of WebProcessProxy::m_backForwardListItemMap where the items are stored.
+ Hence the values of ewk_back_forward_list_item properties should be updated
+ with the corresponding WKBackForwardListItem function invokes every time
+ they are called.
+
+ * UIProcess/API/efl/ewk_back_forward_list_item.cpp:
+ (_Ewk_Back_Forward_List_Item): Data members have to be mutable as assigned being const pointers.
+ (_Ewk_Back_Forward_List_Item::_Ewk_Back_Forward_List_Item):
+ (ewk_back_forward_list_item_uri_get):
+ (ewk_back_forward_list_item_title_get):
+ (ewk_back_forward_list_item_original_uri_get):
+
+2012-08-17 Enrica Casucci <enrica@apple.com>
+
+ Adding back the first statement of WebProcessMain accidentally
+ removed in r125358.
+
+ Reviewed by Sam Weinig.
+
+ * WebProcess/mac/WebProcessMainMac.mm: Adding back the stripping
+ of DYLD_INSERT_LIBRARIES.
+
+2012-08-17 Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com>
+
+ [EFL] REGRESSION(r125923): Breaks EFL build
+ https://bugs.webkit.org/show_bug.cgi?id=94376
+
+ Reviewed by Alexey Proskuryakov.
+
+ Fix EFL build break after r125923.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::didReceiveIntentForFrame):
+
+2012-08-17 Alexey Proskuryakov <ap@apple.com>
+
+ Access m_process directly in WebPageProxy.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=94363
+
+ Reviewed by John Sullivan.
+
+ Consistency fix - we don't use accessors when we don't have to, and there is a mix in this file.
+
+ * UIProcess/WebPageProxy.cpp:
+
+2012-08-17 Claudio Saavedra <csaavedra@igalia.com>
+
+ [GTK] Add WK2 API to get suggested filename for URI responses
+ https://bugs.webkit.org/show_bug.cgi?id=92967
+
+ Reviewed by Carlos Garcia Campos.
+
+ Webcore has API to get the suggested filename for a response, add
+ a property and getter for it in WebKitURIResponse.
+
+ * UIProcess/API/gtk/WebKitURIResponse.cpp:
+ (_WebKitURIResponsePrivate): Add a CString holding the value.
+ (webkitURIResponseGetProperty): Add the gobject bits for the
+ property.
+ (webkit_uri_response_class_init): Install the property.
+ (webkit_uri_response_get_suggested_filename): New getter.
+ * UIProcess/API/gtk/WebKitURIResponse.h: Declare the public
+ method.
+ * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add the new API
+ symbols.
+ * UIProcess/API/gtk/tests/TestResources.cpp:
+ (testWebResourceSuggestedFilename): Test the new API.
+ (serverCallback): Add the the content-disposition header
+ in one case, in order to test it.
+ (beforeAll): Add the new test.
+
+2012-08-17 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ [EFL][wk2] Add unit tests for back-forward list API
+ https://bugs.webkit.org/show_bug.cgi?id=92617
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Added unit tests covering the existing EFL WK2 back-forward list API.
+
+ * PlatformEfl.cmake:
+ * UIProcess/API/efl/tests/resources/default_test_page.html:
+ * UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp: Added.
+ (serverCallbackNavigation):
+ (checkItem):
+ (urlFromTitle):
+ (TEST_F):
+
+2012-08-17 Jeff Miller <jeffm@apple.com>
+
+ UserMessageEncoder::baseEncode() should ASSERT when attempting to encode a non-shareable image
+ https://bugs.webkit.org/show_bug.cgi?id=94245
+
+ Reviewed by Alexey Proskuryakov.
+
+ It's a programming error if a client attempts to encode an image that has an
+ allocated bitmap, but isn't shareable, so we should assert in this case.
+
+ * Shared/UserMessageCoders.h:
+ (WebKit::UserMessageEncoder::baseEncode):
+ Assert if we're trying to encode valid non-shareable image.
+
+2012-08-17 Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com>
+
+ [EFL] [WK2] Add unit tests for vibration_client_callbacks_set API
+ https://bugs.webkit.org/show_bug.cgi?id=93890
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ This patch covers unit testing of the Vibration API as delivered.
+
+ * UIProcess/API/efl/tests/test_ewk2_context.cpp:
+ (VibrationCbData):
+ (vibrateCallback):
+ (cancelVibrationCallback):
+ (loadVibrationHTMLString):
+ (TEST_F):
+
+2012-08-17 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Rename WebKitWebView print-requested signal to print
+ https://bugs.webkit.org/show_bug.cgi?id=94306
+
+ Reviewed by Martin Robinson.
+
+ WebKitWebView::print-requested is inconsistent with the rest of
+ the API. It's a true_handled signal that allows users to implement
+ their own print dialog, or block printing, or rely on
+ defaults. The signal should be WebKitWebView::print like other
+ signals (create, close, decide_policy, etc.)
+
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+ (webkit_web_view_class_init):
+ (webkitWebViewPrintFrame):
+ * UIProcess/API/gtk/WebKitWebView.h:
+ (_WebKitWebViewClass):
+ * UIProcess/API/gtk/tests/TestPrinting.cpp:
+ (webViewPrintCallback):
+ (testWebViewPrint):
+ (beforeAll):
+
+2012-08-17 Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com>
+
+ [EFL] [WK2] Free Eina Strbuf with eina_strbuf_free() instead of eina_strbuf_string_free()
+ https://bugs.webkit.org/show_bug.cgi?id=94312
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ eina_strbuf_string_free() frees the contents of a string buffer but not the
+ buffer, so eina_strbuf_free() must be used to free the buffer.
+
+ Contents of the buffer has already been take care by stealing it with
+ eina_strbuf_string_steal(), so no reason to call eina_strbuf_string_free().
+
+ * UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp:
+ (serverCallback):
+
+2012-08-17 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ [EFL][WK2] Getting unnecessary EINA_SAFETY_ON_NULL_RETURN_VAL warnings while page navigation
+ https://bugs.webkit.org/show_bug.cgi?id=94308
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ The reason is that loadClient.didChangeBackForwardList callback is invoked with zero
+ arguments which is valid case while page back-forward navigation and means basically
+ that the back-froward list has changed but items were not added or deleted.
+
+ * UIProcess/API/efl/ewk_back_forward_list.cpp:
+ (ewk_back_forward_list_changed):
+
+2012-08-16 Lauro Neto <lauro.neto@openbossa.org>
+
+ [Qt] Failure to build with --no-inspector
+ https://bugs.webkit.org/show_bug.cgi?id=94148
+
+ Reviewed by Noam Rosenthal.
+
+ Add guards around usage of inspector functions.
+
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebViewExperimental::remoteInspectorUrl):
+
+2012-08-16 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ [Qt] Remove an unused variable
+
+ Reviewed by Simon Hausmann.
+
+ * UIProcess/API/qt/qquickwebpage.cpp:
+ (QQuickWebPagePrivate::QQuickWebPagePrivate):
+ * UIProcess/API/qt/qquickwebpage_p_p.h:
+ (QQuickWebPagePrivate):
+
+2012-08-16 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ [Qt][WK2] Change the default cache model to enable the page cache
+ https://bugs.webkit.org/show_bug.cgi?id=94221
+
+ Reviewed by Simon Hausmann.
+
+ The default CacheModelDocumentViewer disables the memory back-forward page cache.
+ As uses of applications using QQuickWebView might vary, I'm setting the default to
+ CacheModelDocumentBrowser.
+ We should eventually expose this in the API to allow serious Web browsers setting it
+ to CacheModelPrimaryWebBrowser or to CacheModelDocumentViewer for application tight
+ on memory with limited page navigations.
+
+ * UIProcess/qt/QtWebContext.cpp:
+ (WebKit::QtWebContext::defaultContext):
+
+2012-08-15 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ [Qt] Make sure that we don't prematurely force the first layout during loading.
+ https://bugs.webkit.org/show_bug.cgi?id=94106
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ This would have the nasty effect that the frame loader would report the first layout
+ before loadCommitted was reported. This would resume the rendering engine prematurely,
+ showing blank content and reporting an empty contents size.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::setFixedLayoutSize):
+
+2012-08-16 Marcelo Lira <marcelo.lira@openbossa.org>
+
+ [Qt] Input method hints are not being set.
+ https://bugs.webkit.org/show_bug.cgi?id=92386
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Input method hints for an editable element must be obtained from a proper
+ HTML element. If the editable element is a complex one, it will have elements
+ in the Shadow DOM, and it's one of those that will be returned as the root
+ editable element. This works for editable DIVs, but not for INPUT elements.
+ Using Element::shadowHost() on the root editable element will provide the
+ needed HTML element, and for further clarity a method that does this was added
+ to FrameSelection.
+
+ Added an API test to the Qt port regarding the correct setting
+ of input method hints information on INPUT HTML tags.
+
+ * UIProcess/API/qt/tests/html/inputmethod.html:
+ * UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
+ (tst_QQuickWebView):
+ (tst_QQuickWebView::inputMethodHints):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::editorState):
+
+2012-08-16 Zeno Albisser <zeno@webkit.org>
+
+ Make GraphicsSurface double buffered by default.
+ https://bugs.webkit.org/show_bug.cgi?id=93252
+
+ Create only a single GraphicsSurface per canvas
+ on both supported platforms Mac/Linux.
+ The GraphicsSurface on Mac internally uses two IOSurface
+ to provide a front and a back buffer.
+ The GLX implementation of GraphicsSurface uses
+ an XWindow which already provides a front and a back buffer.
+
+ Reviewed by Noam Rosenthal.
+
+ * Shared/ShareableSurface.h:
+ (Handle):
+ Change the type of GraphicsSurface token to uint64_t.
+ * UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp:
+ (WebKit::LayerTreeCoordinatorProxy::syncCanvas):
+ Add a parameter that denotes the current front buffer of the
+ GraphicsSurface.
+ * UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h:
+ (LayerTreeCoordinatorProxy):
+ * UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.messages.in:
+ * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
+ (WebKit::LayerTreeRenderer::syncCanvas):
+ * UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
+ (LayerTreeRenderer):
+ * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
+ (WebCore::CoordinatedGraphicsLayer::syncCanvas):
+ * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:
+ (CoordinatedGraphicsLayerClient):
+ * WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp:
+ (WebKit::LayerTreeCoordinator::syncCanvas):
+ * WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h:
+ (LayerTreeCoordinator):
+
+2012-08-16 Pierre Rossi <pierre.rossi@gmail.com>
+
+ [Qt] Remove FontQt4, HAVE_QRAWFONT flag and the related dead code
+ https://bugs.webkit.org/show_bug.cgi?id=93960
+
+ Reviewed by Simon Hausmann.
+
+ Following the removal of Qt 4 support from trunk in r124879.
+
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::getWebCoreStatistics):
+
+2012-08-16 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL][WK2] Add unit tests for Web intent registration
+ https://bugs.webkit.org/show_bug.cgi?id=94133
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add unit tests for Web Intent service registration.
+ This tests the "intent,service,register" signaling
+ on the Ewk_View as well as Ewk_Intent_Service.
+
+ * PlatformEfl.cmake:
+ * UIProcess/API/efl/tests/resources/intent-service.html: Added.
+ * UIProcess/API/efl/tests/test_ewk2_intents.cpp: Added.
+ (onIntentServiceRegistration):
+ (TEST_F):
+
+2012-08-16 Marja Hölttä <marja@chromium.org>
+
+ FormController, WebHistoryItem: Enable reading selected file names from document state
+ https://bugs.webkit.org/show_bug.cgi?id=91231
+
+ Reviewed by Jochen Eisinger.
+
+ This change enables Chromium to set up file permissions properly when
+ the session restore feature restores a page with selected files.
+
+ * win/WebKit2.def: Exported FormController::getReferencedFilePaths and HistoryController::saveDocumentAndScrollState.
+
+2012-08-15 Ryosuke Niwa <rniwa@webkit.org>
+
+ Update manual tests and comments to refer to TestRunner instead of LayoutTestController
+ https://bugs.webkit.org/show_bug.cgi?id=94168
+
+ Reviewed by Kent Tamura.
+
+ * Shared/WebPreferencesStore.cpp:
+ (WebKit::WebPreferencesStore::getBoolValueForKey):
+
+2012-08-15 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com>
+
+ [css3-text] Add CSS3 Text decoration compile flag
+ https://bugs.webkit.org/show_bug.cgi?id=93863
+
+ Reviewed by Julien Chaffraix.
+
+ This patch handles the compile flag implementation, which will come disabled by
+ default, thus not exposing the CSS3 text decoration features to the web, unless
+ when explicitly enabling it with "--css3-text-decoration" build parameter.
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2012-08-15 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125687.
+ http://trac.webkit.org/changeset/125687
+ https://bugs.webkit.org/show_bug.cgi?id=94147
+
+ It broke the whole world (Requested by Ossy_night on #webkit).
+
+ * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
+ (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
+
+2012-08-15 Beth Dakin <bdakin@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=93693
+ [WK2] REGRESSION(125091): pixel results don't sow scrollbars
+ anymore
+
+ Reviewed by Sam Weinig.
+
+ This is a regression from http://trac.webkit.org/changeset/125091
+ in which I failed to noticed that
+ WKBundlePageCreateSnapshotInViewCoordinates() did actually do
+ something different than
+ WKBundlePageCreateSnapshotInDocumentCoordinates(). Specifically,
+ it used ScrollView::paint() to paint instead of
+ FrameView::paintContents(). So this patch restores that
+ functionality by adding a value to SnapshotOptions indicating
+ whether the snapshot should be taken in ViewCoordinates
+ (otherwise it defaults to DocumentCoordinates).
+
+ * Shared/API/c/WKImage.h:
+ * Shared/API/c/WKSharedAPICast.h:
+ (WebKit::toSnapshotOptions):
+ * Shared/ImageOptions.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::scaledSnapshotWithOptions):
+
+ Even though we plan to deprecate this API, it should keep doing
+ the right thing until it's gone.
+ * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+ (WKBundlePageCreateSnapshotInViewCoordinates):
+
+2012-08-15 Brady Eidson <beidson@apple.com>
+
+ Removing a plug-in element from a page opened in a background tab in Safari crashes
+ <rdar://problem/12057991> and https://bugs.webkit.org/show_bug.cgi?id=93913
+
+ Reviewed by Beth Dakin.
+
+ This only happens in WebKit2 with asynchronous plug-in initialization enabled.
+
+ * WebProcess/Plugins/PluginProxy.cpp:
+ (WebKit::PluginProxy::destroy): Null-check m_connection, as it might not have been created yet.
+
+ * win/WebKit2.def: Export Page::setCanStartMedia for InternalSettings/DRT use.
+
+2012-08-14 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ Change behavior of MasqueradesAsUndefined to better accommodate DFG changes
+ https://bugs.webkit.org/show_bug.cgi?id=93884
+
+ Reviewed by Geoffrey Garen.
+
+ With some upcoming changes to the DFG to remove uses of ClassInfo, we will be changing the behavior of
+ MasqueradesAsUndefined. In order to make this change consistent across all of our execution engines,
+ we will make this change to MasqueradesAsUndefined as a separate patch. After this patch, MasqueradesAsUndefined
+ objects will only masquerade as undefined in their original context (i.e. their original JSGlobalObject).
+ For example, if an object that masquerades as undefined in frame A is passed to frame B, it will not
+ masquerade as undefined within frame B, but it will continue to masquerade in frame A.
+
+ * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
+ (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant): Passing ExecState to toBoolean call.
+
+2012-08-15 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ [EFL][WK2] Refactoring: start using WKEinaSharedString in ewk_ classes
+ https://bugs.webkit.org/show_bug.cgi?id=93964
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Started using WKEinaSharedString where it is advisable.
+
+ * UIProcess/API/cpp/efl/WKEinaSharedString.cpp:
+ (WKEinaSharedString::operator==):
+ * UIProcess/API/cpp/efl/WKEinaSharedString.h:
+ * UIProcess/API/efl/ewk_download_job.cpp:
+ (_Ewk_Download_Job):
+ (_Ewk_Download_Job::_Ewk_Download_Job):
+ (_Ewk_Download_Job::~_Ewk_Download_Job):
+ (ewk_download_job_destination_set):
+ (ewk_download_job_suggested_filename_set):
+ * UIProcess/API/efl/ewk_intent.cpp:
+ (_Ewk_Intent):
+ (_Ewk_Intent::_Ewk_Intent):
+ (_Ewk_Intent::~_Ewk_Intent):
+ (ewk_intent_action_get):
+ (ewk_intent_type_get):
+ (ewk_intent_service_get):
+ * UIProcess/API/efl/ewk_intent_service.cpp:
+ (_Ewk_Intent_Service):
+ (_Ewk_Intent_Service::_Ewk_Intent_Service):
+ (_Ewk_Intent_Service::~_Ewk_Intent_Service):
+ (ewk_intent_service_action_get):
+ (ewk_intent_service_type_get):
+ (ewk_intent_service_href_get):
+ (ewk_intent_service_title_get):
+ (ewk_intent_service_disposition_get):
+ * UIProcess/API/efl/ewk_navigation_policy_decision.cpp:
+ (_Ewk_Navigation_Policy_Decision):
+ (_Ewk_Navigation_Policy_Decision::_Ewk_Navigation_Policy_Decision):
+ (_Ewk_Navigation_Policy_Decision::~_Ewk_Navigation_Policy_Decision):
+ * UIProcess/API/efl/ewk_url_request.cpp:
+ (_Ewk_Url_Request):
+ (_Ewk_Url_Request::_Ewk_Url_Request):
+ (_Ewk_Url_Request::~_Ewk_Url_Request):
+ (ewk_url_request_url_get):
+ (ewk_request_cookies_first_party_get):
+ (ewk_url_request_http_method_get):
+ * UIProcess/API/efl/ewk_url_response.cpp:
+ (_Ewk_Url_Response):
+ (_Ewk_Url_Response::_Ewk_Url_Response):
+ (_Ewk_Url_Response::~_Ewk_Url_Response):
+ (ewk_url_response_url_get):
+ (ewk_url_response_mime_type_get):
+ * UIProcess/API/efl/ewk_view.cpp:
+ (_Ewk_View_Private_Data):
+ (_Ewk_View_Private_Data::_Ewk_View_Private_Data):
+ (_Ewk_View_Private_Data::~_Ewk_View_Private_Data):
+ (ewk_view_uri_update):
+ (ewk_view_title_get):
+ (ewk_view_theme_set):
+ (ewk_view_setting_encoding_custom_get):
+ (ewk_view_setting_encoding_custom_set):
+ * UIProcess/API/efl/ewk_web_error.cpp:
+ (_Ewk_Web_Error):
+ (_Ewk_Web_Error::_Ewk_Web_Error):
+ (_Ewk_Web_Error::~_Ewk_Web_Error):
+ (ewk_web_error_url_get):
+ (ewk_web_error_description_get):
+ * UIProcess/API/efl/ewk_web_resource.cpp:
+ (_Ewk_Web_Resource):
+ (_Ewk_Web_Resource::_Ewk_Web_Resource):
+ (_Ewk_Web_Resource::~_Ewk_Web_Resource):
+
+2012-08-15 Christophe Dumez <christophe.dumez@intel.com>
+
+ [WK2] Add support for Web Intents MessagePorts
+ https://bugs.webkit.org/show_bug.cgi?id=89072
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add support for WebIntents MessagePorts in WebKit2.
+ MessagePorts can be passed with a Web Intent in
+ order to open a direct communication channel
+ between the Web application and the intent service.
+
+ This functionality is already supported by WebKit 1.
+
+ This patch introduces a new InjectedBundleIntent
+ class which wraps a WebCore::Intent. This way
+ information regarding the MessagePorts in a Web
+ Intent is kept when using an injected bundle.
+
+ For the UIProcess, WebIntentData now carries
+ identifiers for the MessagePorts which can go over
+ IPC. Those identifiers map to actual MessagePorts
+ stored in the Web process. This way, when the UI
+ delivers an intent to a frame, we can get back the
+ corresponding MessagePorts from the Web process
+ before delivering the intent to the DOMWindow.
+
+ This functionality is already tested by:
+
+ - webintents/web-intents-invoke-port.html
+ - webintents/web-intents-obj-constructor.html
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * Shared/API/c/WKBase.h:
+ * Shared/APIObject.h:
+ * Shared/IntentData.cpp: Add MessagePort identifiers.
+ (WebKit::IntentData::IntentData):
+ (WebKit::IntentData::encode):
+ (WebKit::IntentData::decode):
+ * Shared/IntentData.h:
+ (IntentData):
+ * Target.pri:
+ * UIProcess/API/C/WKIntentData.cpp: Rename WKIntentDataCopyExtra() to
+ WKIntentDataCopyExtraValue() for clarity.
+ (WKIntentDataCopyExtraValue):
+ * UIProcess/API/C/WKIntentData.h: Remove WKIntentDataCreate() function now
+ that WTR uses WKBundleIntentCreate() instead.
+ * UIProcess/API/efl/ewk_intent.cpp:
+ (ewk_intent_extra_get): Use WKIntentDataCopyExtraValue() instead of
+ WKIntentDataCopyExtra() since it was renamed.
+ * UIProcess/WebIntentData.cpp:
+ (WebKit::WebIntentData::WebIntentData):
+ (WebKit::WebIntentData::~WebIntentData): Remove MessagePorts from WebProcess upon
+ WebIntentData destruction.
+ (WebKit):
+ (WebKit::WebIntentData::extras):
+ * UIProcess/WebIntentData.h:
+ (WebKit):
+ (WebKit::WebIntentData::create):
+ (WebIntentData):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::didReceiveIntentForFrame):
+ * UIProcess/WebProcessProxy.cpp:
+ (WebKit):
+ (WebKit::WebProcessProxy::removeMessagePortChannel):
+ * UIProcess/WebProcessProxy.h:
+ (WebProcessProxy):
+ * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
+ (WebKit):
+ * WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp: Copied from Source/WebKit2/UIProcess/API/C/WKIntentData.cpp.
+ (WKBundleIntentGetTypeID):
+ (WKBundleIntentCreate):
+ (WKBundleIntentCopyAction):
+ (WKBundleIntentCopyType):
+ (WKBundleIntentCopyService):
+ (WKBundleIntentCopySuggestions):
+ (WKBundleIntentCopyExtraValue):
+ (WKBundleIntentCopyExtras):
+ (WKBundleIntentMessagePortCount):
+ * WebProcess/InjectedBundle/API/c/WKBundleIntent.h: Copied from Source/WebKit2/UIProcess/API/C/WKIntentData.h.
+ * WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.cpp:
+ (WKBundleIntentRequestCopyIntent):
+ * WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.h:
+ * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+ (WKBundlePageDeliverIntentToFrame):
+ * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
+ * WebProcess/InjectedBundle/InjectedBundleIntent.cpp: Copied from Source/WebKit2/UIProcess/WebIntentData.cpp.
+ (WebKit):
+ (WebKit::InjectedBundleIntent::create):
+ (WebKit::InjectedBundleIntent::InjectedBundleIntent):
+ (WebKit::InjectedBundleIntent::action):
+ (WebKit::InjectedBundleIntent::payloadType):
+ (WebKit::InjectedBundleIntent::service):
+ (WebKit::InjectedBundleIntent::data):
+ (WebKit::InjectedBundleIntent::extra):
+ (WebKit::InjectedBundleIntent::extras):
+ (WebKit::InjectedBundleIntent::suggestions):
+ * WebProcess/InjectedBundle/InjectedBundleIntent.h: Copied from Source/WebKit2/UIProcess/WebIntentData.h.
+ (WebKit):
+ (InjectedBundleIntent):
+ (WebKit::InjectedBundleIntent::coreIntent):
+ (WebKit::InjectedBundleIntent::type):
+ * WebProcess/InjectedBundle/InjectedBundleIntentRequest.cpp:
+ (WebKit::InjectedBundleIntentRequest::intent):
+ * WebProcess/InjectedBundle/InjectedBundleIntentRequest.h:
+ (WebKit):
+ (InjectedBundleIntentRequest):
+ * WebProcess/WebPage/WebFrame.cpp:
+ (WebKit::WebFrame::deliverIntent):
+ (WebKit):
+ * WebProcess/WebPage/WebFrame.h:
+ (WebCore):
+ (WebFrame):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit):
+ (WebKit::WebPage::deliverCoreIntentToFrame):
+ * WebProcess/WebPage/WebPage.h:
+ (WebCore):
+ (WebPage):
+ * WebProcess/WebProcess.cpp: Store MessagePorts in WebProcess and keep mapping with
+ their identifiers.
+ (WebKit):
+ (WebKit::WebProcess::addMessagePortChannel):
+ (WebKit::WebProcess::messagePortChannel):
+ (WebKit::WebProcess::removeMessagePortChannel):
+ * WebProcess/WebProcess.h:
+ (WebCore):
+ (WebProcess):
+ * WebProcess/WebProcess.messages.in:
+
+2012-08-14 Adam Barth <abarth@webkit.org>
+
+ Delete Frame::domWindow() and Frame::existingDOMWindow()
+ https://bugs.webkit.org/show_bug.cgi?id=93990
+
+ Reviewed by Eric Seidel.
+
+ * WebProcess/WebPage/WebFrame.cpp:
+ (WebKit::WebFrame::deliverIntent):
+ (WebKit::WebFrame::pendingUnloadCount):
+
+2012-08-14 Lauro Neto <lauro.neto@openbossa.org>
+
+ Convert signals/slots to Q_* macros.
+
+ [Qt] Use Q_SLOTS and Q_SIGNALS instead of slots and signals
+ https://bugs.webkit.org/show_bug.cgi?id=93996
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Change usage of keyword-conflicting 'signals' and 'slots' for
+ Q_SIGNALS and Q_SLOTS macro.
+
+ * UIProcess/API/qt/qwebkittest_p.h:
+ * UIProcess/API/qt/tests/inspectorserver/tst_inspectorserver.cpp:
+ (tst_InspectorServer):
+ * UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp:
+ (tst_publicapi):
+ * UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
+ (tst_QQuickWebView):
+ * UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp:
+ (WebView):
+ (tst_qrawwebview):
+ * UIProcess/API/qt/tests/util.cpp:
+ (LoadSpy):
+ * UIProcess/API/qt/tests/util.h:
+ (LoadStartedCatcher):
+ * UIProcess/InspectorServer/qt/WebSocketServerQt.h:
+ (QtTcpServerHandler):
+ * UIProcess/qt/QtDialogRunner.cpp:
+ (DialogContextBase):
+ (DialogContextObject):
+ (BaseAuthenticationContextObject):
+ (CertificateVerificationDialogContextObject):
+ (FilePickerContextObject):
+ (DatabaseQuotaDialogContextObject):
+ * UIProcess/qt/QtDialogRunner.h:
+ (QtDialogRunner):
+ * UIProcess/qt/QtWebPageEventHandler.h:
+ (QtWebPageEventHandler):
+ * WebProcess/Downloads/qt/QtFileDownloader.h:
+
+2012-08-14 Alexey Proskuryakov <ap@apple.com>
+
+ [WK2] Track multiple Web Processes per context
+ https://bugs.webkit.org/show_bug.cgi?id=93915
+
+ Reviewed by Sam Weinig.
+
+ * UIProcess/Downloads/DownloadProxy.cpp:
+ (WebKit::DownloadProxy::didReceiveAuthenticationChallenge): Downloads don't work
+ yet, added a FIXME.
+
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::deprecatedSharedProcess): Renamed from process(), added an
+ assertion that this is only used in single proces mode.
+ (WebKit::WebContext::textCheckerStateChanged): Abstract out access to web processes.
+ (WebKit::WebContext::ensureSharedWebProcess): Renamed ensureWebProcess() for clarity.
+ (WebKit::WebContext::createNewWebProcess): Extracted code for creating a process
+ from ensureWebProcess().
+ (WebKit::WebContext::warmInitialProcess): Create the process more explicitly.
+ (WebKit::WebContext::enableProcessTermination): Iterate over all processes.
+ (WebKit::WebContext::shouldTerminate): Updated assertion.
+ (WebKit::WebContext::processDidFinishLaunching): Changed to use process argument
+ instead of m_process.
+ (WebKit::WebContext::disconnectProcess): Updated code forto use m_processes.
+ (WebKit::WebContext::createWebPage): Handle both process policies (initial support
+ for multi-process).
+ (WebKit::WebContext::relaunchProcessIfNecessary): Added cases for both policies.
+ (WebKit::WebContext::download): Ditto.
+ (WebKit::WebContext::postMessageToInjectedBundle): Ditto.
+ (WebKit::WebContext::didReceiveSyncMessage): Fixed whitespace.
+ (WebKit::WebContext::getWebCoreStatistics): Added cases for both policies.
+
+ * UIProcess/WebContext.h:
+ (WebKit::WebContext::sendToAllProcesses):
+ (WebKit::WebContext::sendToAllProcessesRelaunchingThemIfNecessary):
+ Send to all processes. Changed return type to void, since no caller checked it.
+
+ * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::createWebPage): Removed
+ an assertion that assumed one process per context.
+
+ * UIProcess/WebTextChecker.cpp: (WebKit::updateStateForAllWebProcesses): Updated
+ to use a WebContext method.
+
+2012-08-14 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ WebKitTestRunner needs layoutTestController.dumpResourceLoadCallbacks
+ https://bugs.webkit.org/show_bug.cgi?id=42332
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Added new getters to WKURL, WKURLRequest, WKURLResponse so that it is possible
+ to dump information necessary for the tests passing.
+
+ * Shared/API/c/WKURL.cpp:
+ (WKURLCopyPath):
+ * Shared/API/c/WKURL.h:
+ * Shared/API/c/WKURLRequest.cpp:
+ (WKURLRequestCopyFirstPartyForCookies):
+ (WKURLRequestCopyHTTPMethod):
+ * Shared/API/c/WKURLRequest.h:
+ * Shared/API/c/WKURLResponse.cpp:
+ (WKURLResponseHTTPStatusCode):
+ * Shared/API/c/WKURLResponse.h:
+ * Shared/WebURL.h:
+ (WebKit::WebURL::path):
+ (WebURL):
+
+2012-08-14 Allan Sandfeld Jensen <allan.jensen@nokia.com>
+
+ [Qt] UpdateAtlas is wasting memory
+ https://bugs.webkit.org/show_bug.cgi?id=93606
+
+ Reviewed by Jocelyn Turcotte.
+
+ Imported and QAreaAllocator from Qt3D and ported it to WebCore style,
+ and use this new area allocator to replace old one from UpdateAtlas.
+
+ * CMakeLists.txt:
+ * Target.pri:
+ * WebProcess/WebPage/AreaAllocator.cpp: Added.
+ (WebKit::AreaAllocator::AreaAllocator):
+ (WebKit::AreaAllocator::~AreaAllocator):
+ (WebKit::AreaAllocator::expand):
+ (WebKit::AreaAllocator::expandBy):
+ (WebKit::AreaAllocator::release):
+ (WebKit::AreaAllocator::overhead):
+ (WebKit::AreaAllocator::roundAllocation):
+ (WebKit::GeneralAreaAllocator::GeneralAreaAllocator):
+ (WebKit::GeneralAreaAllocator::~GeneralAreaAllocator):
+ (WebKit::GeneralAreaAllocator::freeNode):
+ (WebKit::GeneralAreaAllocator::expand):
+ (WebKit::fitsWithin):
+ (WebKit::GeneralAreaAllocator::allocate):
+ (WebKit::GeneralAreaAllocator::allocateFromNode):
+ (WebKit::GeneralAreaAllocator::splitNode):
+ (WebKit::GeneralAreaAllocator::updateLargestFree):
+ (WebKit::GeneralAreaAllocator::release):
+ (WebKit::GeneralAreaAllocator::overhead):
+ * WebProcess/WebPage/AreaAllocator.h: Added.
+ (WebCore::nextPowerOfTwo):
+ (AreaAllocator):
+ (WebKit::AreaAllocator::size):
+ (WebKit::AreaAllocator::minimumAllocation):
+ (WebKit::AreaAllocator::setMinimumAllocation):
+ (WebKit::AreaAllocator::margin):
+ (WebKit::AreaAllocator::setMargin):
+ (GeneralAreaAllocator):
+ (Node):
+ * WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp:
+ (WebKit::LayerTreeCoordinator::renderNextFrame):
+ (WebKit::LayerTreeCoordinator::beginContentUpdate):
+ * WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h:
+ (LayerTreeCoordinator):
+ * WebProcess/WebPage/UpdateAtlas.cpp:
+ (WebKit::UpdateAtlas::UpdateAtlas):
+ (WebKit::UpdateAtlas::buildLayoutIfNeeded):
+ (WebKit::UpdateAtlas::didSwapBuffers):
+ (WebKit::UpdateAtlas::beginPaintingOnAvailableBuffer):
+ * WebProcess/WebPage/UpdateAtlas.h:
+ (UpdateAtlas):
+
+2012-08-14 Sergio Villar Senin <svillar@igalia.com>
+
+ [GTK] REGRESSION (r122428) WebKit2APITests/TestWebKitFindController fails "next" test
+ https://bugs.webkit.org/show_bug.cgi?id=91083
+
+ Reviewed by Carlos Garcia Campos.
+
+ After r122428 search_next()/search_prev() should return just 1 match
+ if the text is found.
+
+ * UIProcess/API/gtk/tests/TestWebKitFindController.cpp:
+ (testFindControllerNext):
+ (testFindControllerPrevious):
+
+2012-08-13 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Implement smart separators for context menu in WebKit2 GTK+
+ https://bugs.webkit.org/show_bug.cgi?id=90449
+
+ Reviewed by Martin Robinson.
+
+ Don't add to the context menu separators that are at the very
+ beginning or end of the menu. Once the context menu is shown,
+ monitor menu items visibility to hide or show separators to make
+ sure they never appear in the context menu unless they are between
+ two visible items.
+
+ * UIProcess/API/gtk/tests/TestContextMenu.cpp:
+ (testContextMenuSmartSeparators):
+ (beforeAll):
+ * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
+ (WebKit::contextMenuItemVisibilityChanged):
+ (WebKit):
+ (WebKit::WebContextMenuProxyGtk::append):
+ (WebKit::WebContextMenuProxyGtk::populate):
+
+2012-08-14 Kihong Kwon <kihong.kwon@samsung.com>
+
+ [WK2] Add getter for capture attribute of input element
+ https://bugs.webkit.org/show_bug.cgi?id=93710
+
+ Reviewed by Antonio Gomes.
+
+ Add getter for capture attribute to WKOpenPanelParameters to support HTML Media Capture.
+
+ * Shared/WebCoreArgumentCoders.cpp:
+ (CoreIPC::::encode):
+ (CoreIPC::::decode):
+ * Shared/WebOpenPanelParameters.cpp:
+ (WebKit):
+ (WebKit::WebOpenPanelParameters::capture):
+ * Shared/WebOpenPanelParameters.h:
+ (WebOpenPanelParameters):
+ * UIProcess/API/C/WKOpenPanelParameters.cpp:
+ (WKOpenPanelParametersCopyCapture):
+ * UIProcess/API/C/WKOpenPanelParameters.h:
+
+2012-08-13 Tom Sepez <tsepez@chromium.org>
+
+ [chromium] release FrameLoaderClientImpl::m_pluginWidget refptr upon Plugin Document detach.
+ https://bugs.webkit.org/show_bug.cgi?id=93283
+
+ Reviewed by Eric Seidel.
+
+ Chromium has a refptr that needs to be NULLed at this point.
+
+ Change the client redirectDataToPlugin method(s) to expect the possibility of
+ a NULL argument, keeping existing behaviour otherwise.
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::redirectDataToPlugin):
+
+2012-08-13 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [EFL] Unreviewed bot fix after r125467.
+
+ * PlatformEfl.cmake: Make the WK2 tests link against glib, gobject
+ and gio as well.
+
+2012-08-13 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [EFL] Unreviewed attempt at fixing the bots after r125467.
+
+ * PlatformEfl.cmake: Link against GIO and GObject due to the usage
+ of libsoup.
+
+2012-08-11 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] Rewrite FindLibSoup2.cmake.
+ https://bugs.webkit.org/show_bug.cgi?id=93191
+
+ Reviewed by Rob Buis.
+
+ * PlatformEfl.cmake: Use LIBSOUP_FOO instead of LIBSOUP24_FOO, and
+ do not use LIBSOUP24_LDFLAGS, as it is not needed anymore.
+
+2012-08-13 Alexey Proskuryakov <ap@apple.com>
+
+ [WK2] Move a remaining per-process message from WebContext to WebProcessProxy
+ https://bugs.webkit.org/show_bug.cgi?id=93883
+
+ More Windows build fixing.
+
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::dummy):
+
+2012-08-13 Alexey Proskuryakov <ap@apple.com>
+
+ [WK2] Move a remaining per-process message from WebContext to WebProcessProxy
+ https://bugs.webkit.org/show_bug.cgi?id=93883
+
+ More Windows build fix
+
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebPage::dummy):
+ * UIProcess/WebContext.h: (WebContext):
+ * UIProcess/WebContext.messages.in:
+ Add a dummy sync message - the same workaround is already used in WebPage.
+
+2012-08-13 Brady Eidson <beidson@apple.com>
+
+ With asynchronous plug-in initialization, WebProcess and PluginProcess can deadlock
+ <rdar://problem/12062125> and https://bugs.webkit.org/show_bug.cgi?id=93894
+
+ Reviewed by Alexey Proskuryakov.
+
+ A few things were in play here:
+ - The WebProcess thought the plug-in was done initializing but it wasn't.
+ - The sync message out from the PluginProcess was not being handled by the WebProcess.
+
+ Expose the ability for the PluginProcess to act as if it is handling a sync message and needs messages dispatched:
+ * Platform/CoreIPC/Connection.h:
+ (CoreIPC::Connection::incrementDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount):
+ (CoreIPC::Connection::decrementDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount):
+
+ * PluginProcess/PluginControllerProxy.cpp:
+ (WebKit::PluginControllerProxy::PluginControllerProxy):
+ (WebKit::PluginControllerProxy::setInitializationReply): Save the delayed reply for synchronous initialization.
+ (WebKit::PluginControllerProxy::takeInitializationReply): Give back the delayed reply for initialization completion.
+ (WebKit::PluginControllerProxy::initialize):
+ * PluginProcess/PluginControllerProxy.h:
+ (WebKit::PluginControllerProxy::isInitializing): Accessor so WebProcessConnection knows whether or not to store the
+ delayed reply for later.
+
+ * PluginProcess/WebProcessConnection.messages.in: Make the synchronous form of "CreatePlugin" have a delayed reply.
+ * PluginProcess/WebProcessConnection.cpp:
+ (WebKit::WebProcessConnection::createPlugin): Store away the delayed reply message so it can be responded to after
+ asynchronous initialization completes.
+ (WebKit::WebProcessConnection::createPluginAsynchronously): If there is a stored away delayed reply message, respond to
+ it instead of sending the asynchronously reply.
+ * PluginProcess/WebProcessConnection.h:
+ (WebProcessConnection):
+
+2012-08-13 Alexey Proskuryakov <ap@apple.com>
+
+ [WK2] Move a remaining per-process message from WebContext to WebProcessProxy
+ https://bugs.webkit.org/show_bug.cgi?id=93883
+
+ Windows build fix.
+
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::getSitesWithPluginData):
+ (WebKit::WebProcess::clearPluginSiteData):
+ Use WebProcessProxy for the message here, too.
+
+2012-08-13 Alexey Proskuryakov <ap@apple.com>
+
+ [WK2] Move a remaining per-process message from WebContext to WebProcessProxy
+ https://bugs.webkit.org/show_bug.cgi?id=93883
+
+ Reviewed by Sam Weinig.
+
+ There was one plug-in message renaming. Moving it, and also other plug-in messages
+ for consistency.
+
+ * UIProcess/WebContext.cpp:
+ (WebKit): Got rid of the last MESSAGE_CHECK in this file.
+ (WebKit::WebContext::WebContext): Moved m_pluginWorkQueue to a singleton.
+ We don't need more than one queue (all it does is read plug-in info), and if we
+ needed, it would have been per-process, not per-context.
+ (WebKit::WebContext::~WebContext): No more work queue.
+ (WebKit::WebContext::processDidFinishLaunching): Ditto.
+
+ * UIProcess/WebContext.h: No longer needs to be a QueueClient.
+
+ * UIProcess/WebContext.messages.in:
+ * UIProcess/WebProcessProxy.messages.in:
+ Moved plug-in related messages.
+
+ * UIProcess/WebProcessProxy.cpp:
+ (WebKit::pluginWorkQueue): Moved from WebContext to a singleton.
+ (WebKit::WebProcessProxy::sendDidGetPlugins): Moved from WebContext.
+ (WebKit::WebProcessProxy::handleGetPlugins): Ditto.
+ (WebKit::WebProcessProxy::getPlugins): Ditto.
+ (WebKit::WebProcessProxy::getPluginPath): Ditto.
+ (WebKit::WebProcessProxy::getPluginProcessConnection): Ditto.
+ (WebKit::WebProcessProxy::didGetSitesWithPluginData): Ditto.
+ (WebKit::WebProcessProxy::didClearPluginSiteData): Ditto.
+
+ * UIProcess/WebProcessProxy.h: Process proxy needs to be thread safe ref counted
+ now, since it sends messages to itself on a work queue and back.
+
+ * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
+ (WebKit::WebPlatformStrategies::populatePluginCache): Updated for new receiver.
+
+ * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): Ditto.
+
+ * WebProcess/WebProcess.cpp: (WebKit::canPluginHandleResponse): Ditto.
+
+2012-08-13 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] Remove glib-related Find modules and write single new one instead.
+ https://bugs.webkit.org/show_bug.cgi?id=93786
+
+ Reviewed by Rob Buis.
+
+ * PlatformEfl.cmake: Use GLIB_* instead of Glib_*.
+
+2012-08-13 Christophe Dumez <christophe.dumez@intel.com>
+
+ [SOUP][WK2] Missing LocalTerminationDisabler in WebCookieManager::setCookiePersistentStorage()
+ https://bugs.webkit.org/show_bug.cgi?id=93837
+
+ Reviewed by Carlos Garcia Campos.
+
+ Add missing WebCore::LocalTerminationDisabler in
+ WebCookieManager::setCookiePersistentStorage() to
+ temporarily disable process termination.
+
+ * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
+ (WebKit::WebCookieManager::setCookiePersistentStorage):
+
+2012-08-12 Nuno Lopes <nlopes@apple.com>
+
+ Fix build with recent clang.
+ https://bugs.webkit.org/show_bug.cgi?id=90701
+
+ Reviewed by Eric Seidel.
+
+ * Shared/CommandLine.h:
+ (CommandLine):
+ * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
+ (WebKit::NotificationPermissionRequestManager::NotificationPermissionRequestManager):
+ * WebProcess/Notifications/NotificationPermissionRequestManager.h:
+ (NotificationPermissionRequestManager):
+
2012-08-11 Sam Weinig <sam@webkit.org>
Fix the build.
diff --git a/Source/WebKit2/Configurations/FeatureDefines.xcconfig b/Source/WebKit2/Configurations/FeatureDefines.xcconfig
index 1da0cc82f..16ce00e8a 100644
--- a/Source/WebKit2/Configurations/FeatureDefines.xcconfig
+++ b/Source/WebKit2/Configurations/FeatureDefines.xcconfig
@@ -48,6 +48,7 @@ ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS;
ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION;
ENABLE_CSS_VARIABLES = ;
ENABLE_CSS3_FLEXBOX = ENABLE_CSS3_FLEXBOX;
+ENABLE_CSS3_TEXT_DECORATION = ;
ENABLE_CUSTOM_SCHEME_HANDLER = ;
ENABLE_DASHBOARD_SUPPORT = $(ENABLE_DASHBOARD_SUPPORT_$(REAL_PLATFORM_NAME));
ENABLE_DASHBOARD_SUPPORT_macosx = ENABLE_DASHBOARD_SUPPORT;
@@ -139,4 +140,4 @@ ENABLE_WIDGET_REGION_macosx = ENABLE_WIDGET_REGION;
ENABLE_WORKERS = ENABLE_WORKERS;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_FLEXBOX) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WIDGET_REGION) $(ENABLE_WORKERS) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_FLEXBOX) $(ENABLE_CSS3_TEXT_DECORATION) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WIDGET_REGION) $(ENABLE_WORKERS) $(ENABLE_XSLT);
diff --git a/Source/WebKit2/GNUmakefile.list.am b/Source/WebKit2/GNUmakefile.list.am
index d737bc774..d417b5f45 100644
--- a/Source/WebKit2/GNUmakefile.list.am
+++ b/Source/WebKit2/GNUmakefile.list.am
@@ -961,6 +961,8 @@ webkit2_sources += \
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleInitialize.h \
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp \
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleInspector.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.h \
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.cpp \
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.h \
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp \
@@ -995,6 +997,8 @@ webkit2_sources += \
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.h \
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp \
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.h \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntent.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntent.h \
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntentRequest.cpp \
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntentRequest.h \
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp \
diff --git a/Source/WebKit2/Platform/CoreIPC/Connection.h b/Source/WebKit2/Platform/CoreIPC/Connection.h
index ddf591f32..b8410a900 100644
--- a/Source/WebKit2/Platform/CoreIPC/Connection.h
+++ b/Source/WebKit2/Platform/CoreIPC/Connection.h
@@ -207,6 +207,9 @@ public:
void wakeUpRunLoop();
+ void incrementDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount() { ++m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount; }
+ void decrementDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount() { --m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount; }
+
private:
template<typename T> class Message {
public:
diff --git a/Source/WebKit2/PlatformEfl.cmake b/Source/WebKit2/PlatformEfl.cmake
index d5ed5420f..d4b08f8be 100644
--- a/Source/WebKit2/PlatformEfl.cmake
+++ b/Source/WebKit2/PlatformEfl.cmake
@@ -5,7 +5,6 @@ LIST(APPEND WebKit2_LINK_FLAGS
${EFLDEPS_LDFLAGS}
${EFREET_LDFLAGS}
${EVAS_LDFLAGS}
- ${LIBSOUP24_LDFLAGS}
)
LIST(APPEND WebKit2_SOURCES
@@ -142,8 +141,8 @@ LIST(APPEND WebKit2_INCLUDE_DIRECTORIES
${LIBXML2_INCLUDE_DIR}
${LIBXSLT_INCLUDE_DIRS}
${SQLITE_INCLUDE_DIRS}
- ${Glib_INCLUDE_DIRS}
- ${LIBSOUP24_INCLUDE_DIRS}
+ ${GLIB_INCLUDE_DIRS}
+ ${LIBSOUP_INCLUDE_DIRS}
${WTF_DIR}
)
@@ -160,8 +159,10 @@ LIST(APPEND WebKit2_LIBRARIES
${PNG_LIBRARY}
${JPEG_LIBRARY}
${CMAKE_DL_LIBS}
- ${Glib_LIBRARIES}
- ${LIBSOUP24_LIBRARIES}
+ ${GLIB_LIBRARIES}
+ ${GLIB_GIO_LIBRARIES}
+ ${GLIB_GOBJECT_LIBRARIES}
+ ${LIBSOUP_LIBRARIES}
)
LIST (APPEND WebProcess_SOURCES
@@ -227,14 +228,17 @@ SET(EWK2UnitTests_LIBRARIES
${ECORE_LIBRARIES}
${ECORE_EVAS_LIBRARIES}
${EVAS_LIBRARIES}
- ${LIBSOUP24_LIBRARIES}
+ ${GLIB_LIBRARIES}
+ ${GLIB_GIO_LIBRARIES}
+ ${GLIB_GOBJECT_LIBRARIES}
+ ${LIBSOUP_LIBRARIES}
gtest
)
IF (ENABLE_GLIB_SUPPORT)
LIST(APPEND EWK2UnitTests_LIBRARIES
- ${Glib_LIBRARIES}
- ${Gthread_LIBRARIES}
+ ${GLIB_LIBRARIES}
+ ${GLIB_GTHREAD_LIBRARIES}
)
ENDIF()
@@ -261,9 +265,12 @@ TARGET_LINK_LIBRARIES(ewk2UnitTestUtils ${EWK2UnitTests_LIBRARIES})
# The "ewk" on the test name needs to be suffixed with "2", otherwise it
# will clash with tests from the WebKit 1 test suite.
SET(EWK2UnitTests_BINARIES
+ test_ewk2_back_forward_list
test_ewk2_context
test_ewk2_cookie_manager
test_ewk2_download_job
+ test_ewk2_eina_shared_string
+ test_ewk2_intents
test_ewk2_view
)
diff --git a/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp b/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
index ab60f941c..2ad41daa5 100644
--- a/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
+++ b/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
@@ -43,6 +43,7 @@
#include <WebCore/GraphicsContext.h>
#include <WebCore/IdentifierRep.h>
#include <WebCore/NotImplemented.h>
+#include <wtf/TemporaryChange.h>
#include <wtf/text/WTFString.h>
#if PLATFORM(MAC)
@@ -66,6 +67,7 @@ PluginControllerProxy::PluginControllerProxy(WebProcessConnection* connection, c
#if USE(ACCELERATED_COMPOSITING)
, m_isAcceleratedCompositingEnabled(creationParameters.isAcceleratedCompositingEnabled)
#endif
+ , m_isInitializing(false)
, m_paintTimer(RunLoop::main(), this, &PluginControllerProxy::paint)
, m_pluginDestructionProtectCount(0)
, m_pluginDestroyTimer(RunLoop::main(), this, &PluginControllerProxy::destroy)
@@ -91,9 +93,22 @@ PluginControllerProxy::~PluginControllerProxy()
releaseNPObject(m_pluginElementNPObject);
}
+void PluginControllerProxy::setInitializationReply(PassRefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply> reply)
+{
+ ASSERT(!m_initializationReply);
+ m_initializationReply = reply;
+}
+
+PassRefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply> PluginControllerProxy::takeInitializationReply()
+{
+ return m_initializationReply.release();
+}
+
bool PluginControllerProxy::initialize(const PluginCreationParameters& creationParameters)
{
ASSERT(!m_plugin);
+
+ TemporaryChange<bool> initializing(m_isInitializing, true);
m_plugin = NetscapePlugin::create(PluginProcess::shared().netscapePluginModule());
if (!m_plugin) {
diff --git a/Source/WebKit2/PluginProcess/PluginControllerProxy.h b/Source/WebKit2/PluginProcess/PluginControllerProxy.h
index 46da1a4bf..a9d35a663 100644
--- a/Source/WebKit2/PluginProcess/PluginControllerProxy.h
+++ b/Source/WebKit2/PluginProcess/PluginControllerProxy.h
@@ -33,6 +33,7 @@
#include "PluginController.h"
#include "PluginControllerProxyMessages.h"
#include "ShareableBitmap.h"
+#include "WebProcessConnectionMessages.h"
#include <WebCore/RunLoop.h>
#include <wtf/Noncopyable.h>
@@ -70,6 +71,11 @@ public:
PluginController* asPluginController() { return this; }
+ bool isInitializing() const { return m_isInitializing; }
+
+ void setInitializationReply(PassRefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply>);
+ PassRefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply> takeInitializationReply();
+
private:
PluginControllerProxy(WebProcessConnection*, const PluginCreationParameters&);
@@ -159,6 +165,9 @@ private:
String m_userAgent;
bool m_isPrivateBrowsingEnabled;
bool m_isAcceleratedCompositingEnabled;
+ bool m_isInitializing;
+
+ RefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply> m_initializationReply;
RefPtr<Plugin> m_plugin;
diff --git a/Source/WebKit2/PluginProcess/WebProcessConnection.cpp b/Source/WebKit2/PluginProcess/WebProcessConnection.cpp
index 1621ca0c8..1d95df1ed 100644
--- a/Source/WebKit2/PluginProcess/WebProcessConnection.cpp
+++ b/Source/WebKit2/PluginProcess/WebProcessConnection.cpp
@@ -263,17 +263,23 @@ void WebProcessConnection::createPluginInternal(const PluginCreationParameters&
#endif
}
-void WebProcessConnection::createPlugin(const PluginCreationParameters& creationParameters, bool& result, bool& wantsWheelEvents, uint32_t& remoteLayerClientID)
+void WebProcessConnection::createPlugin(const PluginCreationParameters& creationParameters, PassRefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply> reply)
{
PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(creationParameters.pluginInstanceID);
- // The plug-in we're being asked to create synchronously might already exist if we just finished creating it asynchronously.
- // In that case we need to not create it again (but also need to return the correct information about its creation).
+ // The controller proxy for the plug-in we're being asked to create synchronously might already exist if it was requested asynchronously before.
if (pluginControllerProxy) {
- result = true;
- wantsWheelEvents = pluginControllerProxy->wantsWheelEvents();
+ // It might still be in the middle of initialization in which case we have to let that initialization complete and respond to this message later.
+ if (pluginControllerProxy->isInitializing()) {
+ pluginControllerProxy->setInitializationReply(reply);
+ return;
+ }
+
+ // If its initialization is complete then we need to respond to this message with the correct information about its creation.
#if PLATFORM(MAC)
- remoteLayerClientID = pluginControllerProxy->remoteLayerClientID();
+ reply->send(true, pluginControllerProxy->wantsWheelEvents(), pluginControllerProxy->remoteLayerClientID());
+#else
+ reply->send(true, pluginControllerProxy->wantsWheelEvents(), 0);
#endif
return;
}
@@ -283,7 +289,12 @@ void WebProcessConnection::createPlugin(const PluginCreationParameters& creation
if (creationParameters.asynchronousCreationIncomplete)
m_asynchronousInstanceIDsToIgnore.add(creationParameters.pluginInstanceID);
+ bool result = false;
+ bool wantsWheelEvents = false;
+ uint32_t remoteLayerClientID = 0;
createPluginInternal(creationParameters, result, wantsWheelEvents, remoteLayerClientID);
+
+ reply->send(result, wantsWheelEvents, remoteLayerClientID);
}
void WebProcessConnection::createPluginAsynchronously(const PluginCreationParameters& creationParameters)
@@ -297,16 +308,33 @@ void WebProcessConnection::createPluginAsynchronously(const PluginCreationParame
// This version of CreatePlugin is only used by plug-ins that are known to behave when started asynchronously.
bool result = false;
- uint32_t remoteLayerClientID = 0;
bool wantsWheelEvents = false;
+ uint32_t remoteLayerClientID = 0;
if (creationParameters.artificialPluginInitializationDelayEnabled) {
unsigned artificialPluginInitializationDelay = 5;
sleep(artificialPluginInitializationDelay);
}
+ // Since plug-in creation can often message to the WebProcess synchronously (with NPP_Evaluate for example)
+ // we need to make sure that the web process will handle the plug-in process's synchronous messages,
+ // even if the web process is waiting on a synchronous reply itself.
+ // Normally the plug-in process doesn't give its synchronous messages the special flag to allow for that.
+ // We can force it to do so by incrementing the "DispatchMessageMarkedDispatchWhenWaitingForSyncReply" count.
+ m_connection->incrementDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount();
createPluginInternal(creationParameters, result, wantsWheelEvents, remoteLayerClientID);
+ m_connection->decrementDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount();
+
+ // If someone asked for this plug-in synchronously while it was in the middle of being created then we need perform the
+ // synchronous reply instead of sending the asynchronous reply.
+ PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(creationParameters.pluginInstanceID);
+ ASSERT(pluginControllerProxy);
+ if (RefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply> delayedSyncReply = pluginControllerProxy->takeInitializationReply()) {
+ delayedSyncReply->send(result, wantsWheelEvents, remoteLayerClientID);
+ return;
+ }
+ // Otherwise, send the asynchronous results now.
if (!result) {
m_connection->sendSync(Messages::PluginProxy::DidFailToCreatePlugin(), Messages::PluginProxy::DidFailToCreatePlugin::Reply(), creationParameters.pluginInstanceID);
return;
diff --git a/Source/WebKit2/PluginProcess/WebProcessConnection.h b/Source/WebKit2/PluginProcess/WebProcessConnection.h
index 53ca1e40e..ce98e1036 100644
--- a/Source/WebKit2/PluginProcess/WebProcessConnection.h
+++ b/Source/WebKit2/PluginProcess/WebProcessConnection.h
@@ -30,6 +30,7 @@
#include "Connection.h"
#include "Plugin.h"
+#include "WebProcessConnectionMessages.h"
#include <wtf/HashSet.h>
#include <wtf/RefCounted.h>
@@ -70,7 +71,7 @@ private:
// Message handlers.
void didReceiveWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
void didReceiveSyncWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
- void createPlugin(const PluginCreationParameters&, bool& result, bool& wantsWheelEvents, uint32_t& remoteLayerClientID);
+ void createPlugin(const PluginCreationParameters&, PassRefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply>);
void createPluginAsynchronously(const PluginCreationParameters&);
void destroyPlugin(uint64_t pluginInstanceID, bool asynchronousCreationIncomplete);
diff --git a/Source/WebKit2/PluginProcess/WebProcessConnection.messages.in b/Source/WebKit2/PluginProcess/WebProcessConnection.messages.in
index f1a83594f..effb97966 100644
--- a/Source/WebKit2/PluginProcess/WebProcessConnection.messages.in
+++ b/Source/WebKit2/PluginProcess/WebProcessConnection.messages.in
@@ -24,7 +24,7 @@
messages -> WebProcessConnection {
# Creates a plug-in instance using the given creation parameters.
- CreatePlugin(WebKit::PluginCreationParameters pluginCreationParameters) -> (bool result, bool wantsWheelEvents, uint32_t remoteLayerClientID)
+ CreatePlugin(WebKit::PluginCreationParameters pluginCreationParameters) -> (bool creationResult, bool wantsWheelEvents, uint32_t remoteLayerClientID) Delayed
# Creates a plug-in instance asynchronously using the given creation parameters.
CreatePluginAsynchronously(WebKit::PluginCreationParameters pluginCreationParameters)
diff --git a/Source/WebKit2/Shared/API/c/WKBase.h b/Source/WebKit2/Shared/API/c/WKBase.h
index 6854ecc27..a6a8bd66f 100644
--- a/Source/WebKit2/Shared/API/c/WKBase.h
+++ b/Source/WebKit2/Shared/API/c/WKBase.h
@@ -135,6 +135,7 @@ typedef const struct OpaqueWKBundleDOMWindowExtension* WKBundleDOMWindowExtensio
typedef const struct OpaqueWKBundleFrame* WKBundleFrameRef;
typedef const struct OpaqueWKBundleHitTestResult* WKBundleHitTestResultRef;
typedef const struct OpaqueWKBundleInspector* WKBundleInspectorRef;
+typedef const struct OpaqueWKBundleIntent* WKBundleIntentRef;
typedef const struct OpaqueWKBundleIntentRequest* WKBundleIntentRequestRef;
typedef const struct OpaqueWKBundleNavigationAction* WKBundleNavigationActionRef;
typedef const struct OpaqueWKBundleNodeHandle* WKBundleNodeHandleRef;
diff --git a/Source/WebKit2/Shared/API/c/WKImage.h b/Source/WebKit2/Shared/API/c/WKImage.h
index 8dec00a9d..1f23b134a 100644
--- a/Source/WebKit2/Shared/API/c/WKImage.h
+++ b/Source/WebKit2/Shared/API/c/WKImage.h
@@ -40,7 +40,8 @@ typedef uint32_t WKImageOptions;
enum {
kWKSnapshotOptionsShareable = 1 << 0,
- kWKSnapshotOptionsExcludeSelectionHighlighting = 1 << 1
+ kWKSnapshotOptionsExcludeSelectionHighlighting = 1 << 1,
+ kWKSnapshotOptionsInViewCoordinates = 1 << 2
};
typedef uint32_t WKSnapshotOptions;
diff --git a/Source/WebKit2/Shared/API/c/WKSharedAPICast.h b/Source/WebKit2/Shared/API/c/WKSharedAPICast.h
index cc605d1f8..8a73a01fa 100644
--- a/Source/WebKit2/Shared/API/c/WKSharedAPICast.h
+++ b/Source/WebKit2/Shared/API/c/WKSharedAPICast.h
@@ -776,6 +776,8 @@ inline SnapshotOptions toSnapshotOptions(WKSnapshotOptions wkSnapshotOptions)
snapshotOptions |= SnapshotOptionsShareable;
if (wkSnapshotOptions & kWKSnapshotOptionsExcludeSelectionHighlighting)
snapshotOptions |= SnapshotOptionsExcludeSelectionHighlighting;
+ if (wkSnapshotOptions & kWKSnapshotOptionsInViewCoordinates)
+ snapshotOptions |= SnapshotOptionsInViewCoordinates;
return snapshotOptions;
}
diff --git a/Source/WebKit2/Shared/API/c/WKURL.cpp b/Source/WebKit2/Shared/API/c/WKURL.cpp
index 99cde89ef..2268413a0 100644
--- a/Source/WebKit2/Shared/API/c/WKURL.cpp
+++ b/Source/WebKit2/Shared/API/c/WKURL.cpp
@@ -60,6 +60,11 @@ WKStringRef WKURLCopyScheme(WKURLRef url)
return toCopiedAPI(toImpl(url)->protocol());
}
+WK_EXPORT WKStringRef WKURLCopyPath(WKURLRef url)
+{
+ return toCopiedAPI(toImpl(url)->path());
+}
+
WKStringRef WKURLCopyLastPathComponent(WKURLRef url)
{
return toCopiedAPI(toImpl(url)->lastPathComponent());
diff --git a/Source/WebKit2/Shared/API/c/WKURL.h b/Source/WebKit2/Shared/API/c/WKURL.h
index 2cda6c192..4e9867246 100644
--- a/Source/WebKit2/Shared/API/c/WKURL.h
+++ b/Source/WebKit2/Shared/API/c/WKURL.h
@@ -39,6 +39,7 @@ WK_EXPORT WKURLRef WKURLCreateWithUTF8CString(const char* string);
WK_EXPORT WKStringRef WKURLCopyString(WKURLRef url);
WK_EXPORT WKStringRef WKURLCopyHostName(WKURLRef url);
WK_EXPORT WKStringRef WKURLCopyScheme(WKURLRef url);
+WK_EXPORT WKStringRef WKURLCopyPath(WKURLRef url);
WK_EXPORT WKStringRef WKURLCopyLastPathComponent(WKURLRef url);
WK_EXPORT bool WKURLIsEqual(WKURLRef a, WKURLRef b);
diff --git a/Source/WebKit2/Shared/API/c/WKURLRequest.cpp b/Source/WebKit2/Shared/API/c/WKURLRequest.cpp
index 776367b75..114c74190 100644
--- a/Source/WebKit2/Shared/API/c/WKURLRequest.cpp
+++ b/Source/WebKit2/Shared/API/c/WKURLRequest.cpp
@@ -48,6 +48,16 @@ WKURLRef WKURLRequestCopyURL(WKURLRequestRef requestRef)
return toCopiedURLAPI(toImpl(requestRef)->url());
}
+WKURLRef WKURLRequestCopyFirstPartyForCookies(WKURLRequestRef requestRef)
+{
+ return toCopiedURLAPI(toImpl(requestRef)->resourceRequest().firstPartyForCookies());
+}
+
+WKStringRef WKURLRequestCopyHTTPMethod(WKURLRequestRef requestRef)
+{
+ return toCopiedAPI(toImpl(requestRef)->resourceRequest().httpMethod());
+}
+
void WKURLRequestSetDefaultTimeoutInterval(double timeoutInterval)
{
WebURLRequest::setDefaultTimeoutInterval(timeoutInterval);
diff --git a/Source/WebKit2/Shared/API/c/WKURLRequest.h b/Source/WebKit2/Shared/API/c/WKURLRequest.h
index a53ce1635..85df3d389 100644
--- a/Source/WebKit2/Shared/API/c/WKURLRequest.h
+++ b/Source/WebKit2/Shared/API/c/WKURLRequest.h
@@ -38,6 +38,10 @@ WK_EXPORT WKURLRequestRef WKURLRequestCreateWithWKURL(WKURLRef);
WK_EXPORT WKURLRef WKURLRequestCopyURL(WKURLRequestRef);
+WK_EXPORT WKURLRef WKURLRequestCopyFirstPartyForCookies(WKURLRequestRef);
+
+WK_EXPORT WKStringRef WKURLRequestCopyHTTPMethod(WKURLRequestRef);
+
WK_EXPORT void WKURLRequestSetDefaultTimeoutInterval(double);
#ifdef __cplusplus
diff --git a/Source/WebKit2/Shared/API/c/WKURLResponse.cpp b/Source/WebKit2/Shared/API/c/WKURLResponse.cpp
index cefd07d31..2d25f282a 100644
--- a/Source/WebKit2/Shared/API/c/WKURLResponse.cpp
+++ b/Source/WebKit2/Shared/API/c/WKURLResponse.cpp
@@ -46,3 +46,8 @@ WKStringRef WKURLResponseCopyMIMEType(WKURLResponseRef responseRef)
{
return toCopiedAPI(toImpl(responseRef)->resourceResponse().mimeType());
}
+
+int32_t WKURLResponseHTTPStatusCode(WKURLResponseRef responseRef)
+{
+ return toImpl(responseRef)->resourceResponse().httpStatusCode();
+}
diff --git a/Source/WebKit2/Shared/API/c/WKURLResponse.h b/Source/WebKit2/Shared/API/c/WKURLResponse.h
index 8988dff08..d4c269340 100644
--- a/Source/WebKit2/Shared/API/c/WKURLResponse.h
+++ b/Source/WebKit2/Shared/API/c/WKURLResponse.h
@@ -38,6 +38,8 @@ WK_EXPORT WKURLRef WKURLResponseCopyURL(WKURLResponseRef);
WK_EXPORT WKStringRef WKURLResponseCopyMIMEType(WKURLResponseRef);
+WK_EXPORT int32_t WKURLResponseHTTPStatusCode(WKURLResponseRef);
+
#ifdef __cplusplus
}
#endif
diff --git a/Source/WebKit2/Shared/APIObject.h b/Source/WebKit2/Shared/APIObject.h
index 8e4d29342..708effe5d 100644
--- a/Source/WebKit2/Shared/APIObject.h
+++ b/Source/WebKit2/Shared/APIObject.h
@@ -117,6 +117,7 @@ public:
TypeBundleFrame,
TypeBundleHitTestResult,
TypeBundleInspector,
+ TypeBundleIntent,
TypeBundleIntentRequest,
TypeBundleNavigationAction,
TypeBundleNodeHandle,
diff --git a/Source/WebKit2/Shared/CommandLine.h b/Source/WebKit2/Shared/CommandLine.h
index f70601ce2..2d7951067 100644
--- a/Source/WebKit2/Shared/CommandLine.h
+++ b/Source/WebKit2/Shared/CommandLine.h
@@ -48,8 +48,6 @@ public:
}
private:
- bool m_parsedSuccessfully;
-
HashMap<String, String> m_args;
};
diff --git a/Source/WebKit2/Shared/ImageOptions.h b/Source/WebKit2/Shared/ImageOptions.h
index 534cd2332..304ecf86b 100644
--- a/Source/WebKit2/Shared/ImageOptions.h
+++ b/Source/WebKit2/Shared/ImageOptions.h
@@ -34,7 +34,8 @@ enum ImageOptions {
enum {
SnapshotOptionsShareable = 1 << 0,
- SnapshotOptionsExcludeSelectionHighlighting = 1 << 1
+ SnapshotOptionsExcludeSelectionHighlighting = 1 << 1,
+ SnapshotOptionsInViewCoordinates = 1 << 2
};
typedef uint32_t SnapshotOptions;
diff --git a/Source/WebKit2/Shared/IntentData.cpp b/Source/WebKit2/Shared/IntentData.cpp
index 4995b2ef5..41078747c 100644
--- a/Source/WebKit2/Shared/IntentData.cpp
+++ b/Source/WebKit2/Shared/IntentData.cpp
@@ -31,7 +31,10 @@
#include "APIObject.h"
#include "DataReference.h"
#include "WebCoreArgumentCoders.h"
+#include "WebProcess.h"
#include <WebCore/Intent.h>
+#include <WebCore/MessagePortChannel.h>
+#include <WebCore/PlatformMessagePortChannel.h>
using namespace WebCore;
@@ -45,6 +48,12 @@ IntentData::IntentData(Intent* coreIntent)
, extras(coreIntent->extras())
, suggestions(coreIntent->suggestions())
{
+ MessagePortChannelArray* coreMessagePorts = coreIntent->messagePorts();
+ if (coreMessagePorts) {
+ size_t numMessagePorts = coreMessagePorts->size();
+ for (size_t i = 0; i < numMessagePorts; ++i)
+ messagePorts.append(WebProcess::shared().addMessagePortChannel((*coreMessagePorts)[i]->channel()));
+ }
}
void IntentData::encode(CoreIPC::ArgumentEncoder* encoder) const
@@ -55,6 +64,7 @@ void IntentData::encode(CoreIPC::ArgumentEncoder* encoder) const
encoder->encode(CoreIPC::DataReference(data));
encoder->encode(extras);
encoder->encode(suggestions);
+ encoder->encode(messagePorts);
}
bool IntentData::decode(CoreIPC::ArgumentDecoder* decoder, IntentData& intentData)
@@ -73,6 +83,8 @@ bool IntentData::decode(CoreIPC::ArgumentDecoder* decoder, IntentData& intentDat
return false;
if (!decoder->decode(intentData.suggestions))
return false;
+ if (!decoder->decode(intentData.messagePorts))
+ return false;
return true;
}
diff --git a/Source/WebKit2/Shared/IntentData.h b/Source/WebKit2/Shared/IntentData.h
index 96e2d9f99..e8435c284 100644
--- a/Source/WebKit2/Shared/IntentData.h
+++ b/Source/WebKit2/Shared/IntentData.h
@@ -29,7 +29,8 @@
#if ENABLE(WEB_INTENTS)
#include "APIObject.h"
-#include "GenericCallback.h"
+#include <WebCore/KURL.h>
+#include <wtf/HashMap.h>
#include <wtf/text/WTFString.h>
namespace CoreIPC {
@@ -56,6 +57,7 @@ struct IntentData {
Vector<uint8_t> data;
HashMap<String, String> extras;
Vector<WebCore::KURL> suggestions;
+ Vector<uint64_t> messagePorts;
};
} // namespace WebKit
diff --git a/Source/WebKit2/Shared/ShareableSurface.h b/Source/WebKit2/Shared/ShareableSurface.h
index fb74b61be..6cd7369a1 100644
--- a/Source/WebKit2/Shared/ShareableSurface.h
+++ b/Source/WebKit2/Shared/ShareableSurface.h
@@ -62,7 +62,7 @@ public:
friend class ShareableSurface;
mutable ShareableBitmap::Handle m_bitmapHandle;
#if USE(GRAPHICS_SURFACE)
- uint32_t m_graphicsSurfaceToken;
+ uint64_t m_graphicsSurfaceToken;
#endif
WebCore::IntSize m_size;
ShareableBitmap::Flags m_flags;
diff --git a/Source/WebKit2/Shared/UserMessageCoders.h b/Source/WebKit2/Shared/UserMessageCoders.h
index 85ed57b57..ee4ab64ff 100644
--- a/Source/WebKit2/Shared/UserMessageCoders.h
+++ b/Source/WebKit2/Shared/UserMessageCoders.h
@@ -186,6 +186,7 @@ public:
WebImage* image = static_cast<WebImage*>(m_root);
ShareableBitmap::Handle handle;
+ ASSERT(!image->bitmap() || image->bitmap()->isBackedBySharedMemory());
if (!image->bitmap() || !image->bitmap()->isBackedBySharedMemory() || !image->bitmap()->createHandle(handle)) {
// Initial false indicates no allocated bitmap or is not shareable.
encoder->encode(false);
diff --git a/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp b/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
index 7d40bc866..cbf624926 100644
--- a/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
+++ b/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
@@ -555,6 +555,9 @@ void ArgumentCoder<FileChooserSettings>::encode(ArgumentEncoder* encoder, const
#endif
encoder->encode(settings.acceptMIMETypes);
encoder->encode(settings.selectedFiles);
+#if ENABLE(MEDIA_CAPTURE)
+ encoder->encode(settings.capture);
+#endif
}
bool ArgumentCoder<FileChooserSettings>::decode(ArgumentDecoder* decoder, FileChooserSettings& settings)
@@ -569,6 +572,10 @@ bool ArgumentCoder<FileChooserSettings>::decode(ArgumentDecoder* decoder, FileCh
return false;
if (!decoder->decode(settings.selectedFiles))
return false;
+#if ENABLE(MEDIA_CAPTURE)
+ if (!decoder->decode(settings.capture))
+ return false;
+#endif
return true;
}
diff --git a/Source/WebKit2/Shared/WebOpenPanelParameters.cpp b/Source/WebKit2/Shared/WebOpenPanelParameters.cpp
index f6722bba0..772504066 100644
--- a/Source/WebKit2/Shared/WebOpenPanelParameters.cpp
+++ b/Source/WebKit2/Shared/WebOpenPanelParameters.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Samsung Electronics. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -60,4 +61,12 @@ PassRefPtr<ImmutableArray> WebOpenPanelParameters::acceptMIMETypes() const
return ImmutableArray::adopt(vector);
}
+#if ENABLE(MEDIA_CAPTURE)
+String WebOpenPanelParameters::capture() const
+{
+ return m_settings.capture;
+}
+#endif
+
+
} // namespace WebCore
diff --git a/Source/WebKit2/Shared/WebOpenPanelParameters.h b/Source/WebKit2/Shared/WebOpenPanelParameters.h
index eca44e1e3..ab12c0fc1 100644
--- a/Source/WebKit2/Shared/WebOpenPanelParameters.h
+++ b/Source/WebKit2/Shared/WebOpenPanelParameters.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Samsung Electronics. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,6 +46,9 @@ public:
bool allowMultipleFiles() const { return m_settings.allowsMultipleFiles; }
PassRefPtr<ImmutableArray> acceptMIMETypes() const;
Vector<String> selectedFileNames() const { return m_settings.selectedFiles; }
+#if ENABLE(MEDIA_CAPTURE)
+ String capture() const;
+#endif
private:
explicit WebOpenPanelParameters(const WebCore::FileChooserSettings&);
diff --git a/Source/WebKit2/Shared/WebPreferencesStore.cpp b/Source/WebKit2/Shared/WebPreferencesStore.cpp
index 8668bec0c..89734bf0e 100644
--- a/Source/WebKit2/Shared/WebPreferencesStore.cpp
+++ b/Source/WebKit2/Shared/WebPreferencesStore.cpp
@@ -184,7 +184,7 @@ bool WebPreferencesStore::setBoolValueForKey(const String& key, bool value)
bool WebPreferencesStore::getBoolValueForKey(const String& key) const
{
- // FIXME: Extend overriding to other key types used from LayoutTestController.
+ // FIXME: Extend overriding to other key types used from TestRunner.
BoolOverridesMap::const_iterator it = boolTestRunnerOverridesMap().find(key);
if (it != boolTestRunnerOverridesMap().end())
return it->second;
diff --git a/Source/WebKit2/Shared/WebURL.h b/Source/WebKit2/Shared/WebURL.h
index f0cce8d02..b2961277b 100644
--- a/Source/WebKit2/Shared/WebURL.h
+++ b/Source/WebKit2/Shared/WebURL.h
@@ -63,6 +63,12 @@ public:
return m_parsedURL->isValid() ? m_parsedURL->protocol() : String();
}
+ String path() const
+ {
+ parseURLIfNecessary();
+ return m_parsedURL->isValid() ? m_parsedURL->path() : String();
+ }
+
String lastPathComponent() const
{
parseURLIfNecessary();
diff --git a/Source/WebKit2/Target.pri b/Source/WebKit2/Target.pri
index 5ffc8ccb3..37336505f 100644
--- a/Source/WebKit2/Target.pri
+++ b/Source/WebKit2/Target.pri
@@ -279,6 +279,7 @@ HEADERS += \
WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.h \
WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h \
WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h \
+ WebProcess/InjectedBundle/API/c/WKBundleIntent.h \
WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.h \
WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.h \
WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h \
@@ -292,6 +293,7 @@ HEADERS += \
WebProcess/InjectedBundle/InjectedBundleClient.h \
WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.h \
WebProcess/InjectedBundle/InjectedBundleHitTestResult.h \
+ WebProcess/InjectedBundle/InjectedBundleIntent.h \
WebProcess/InjectedBundle/InjectedBundleIntentRequest.h \
WebProcess/InjectedBundle/InjectedBundleNavigationAction.h \
WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h \
@@ -341,6 +343,7 @@ HEADERS += \
WebProcess/WebCoreSupport/WebSearchPopupMenu.h \
WebProcess/WebCoreSupport/WebVibrationClient.h \
WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.h \
+ WebProcess/WebPage/AreaAllocator.h \
WebProcess/WebPage/DrawingArea.h \
WebProcess/WebPage/DrawingAreaImpl.h \
WebProcess/WebPage/EventDispatcher.h \
@@ -630,6 +633,7 @@ SOURCES += \
WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp \
WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp \
WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp \
+ WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp \
WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.cpp \
WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp \
WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp \
@@ -645,6 +649,7 @@ SOURCES += \
WebProcess/InjectedBundle/InjectedBundleClient.cpp \
WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.cpp \
WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp \
+ WebProcess/InjectedBundle/InjectedBundleIntent.cpp \
WebProcess/InjectedBundle/InjectedBundleIntentRequest.cpp \
WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp \
WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp \
@@ -702,6 +707,7 @@ SOURCES += \
WebProcess/WebCoreSupport/qt/WebDragClientQt.cpp \
WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp \
WebProcess/WebCoreSupport/qt/WebPopupMenuQt.cpp \
+ WebProcess/WebPage/AreaAllocator.cpp \
WebProcess/WebPage/DecoderAdapter.cpp \
WebProcess/WebPage/DrawingArea.cpp \
WebProcess/WebPage/DrawingAreaImpl.cpp \
diff --git a/Source/WebKit2/UIProcess/API/C/WKIntentData.cpp b/Source/WebKit2/UIProcess/API/C/WKIntentData.cpp
index 7a92db54c..92e61871c 100644
--- a/Source/WebKit2/UIProcess/API/C/WKIntentData.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKIntentData.cpp
@@ -31,6 +31,7 @@
#include "WKAPICast.h"
#include "WKDictionary.h"
#include "WKString.h"
+#include "WebSerializedScriptValue.h"
#if ENABLE(WEB_INTENTS)
#include "WebIntentData.h"
@@ -47,27 +48,6 @@ WKTypeID WKIntentDataGetTypeID()
#endif
}
-WKIntentDataRef WKIntentDataCreate(WKDictionaryRef initDictionaryRef)
-{
-#if ENABLE(WEB_INTENTS)
- IntentData intentData;
- WKStringRef action = static_cast<WKStringRef>(WKDictionaryGetItemForKey(initDictionaryRef, WKStringCreateWithUTF8CString("action")));
- ASSERT(action);
- intentData.action = toImpl(action)->string();
- WKStringRef type = static_cast<WKStringRef>(WKDictionaryGetItemForKey(initDictionaryRef, WKStringCreateWithUTF8CString("type")));
- ASSERT(type);
- intentData.type = toImpl(type)->string();
- WKSerializedScriptValueRef data = static_cast<WKSerializedScriptValueRef>(WKDictionaryGetItemForKey(initDictionaryRef, WKStringCreateWithUTF8CString("data")));
- if (data)
- intentData.data = toImpl(data)->dataReference().vector();
-
- RefPtr<WebIntentData> webIntentData = WebIntentData::create(intentData);
- return toAPI(webIntentData.release().leakRef());
-#else
- return 0;
-#endif
-}
-
WKStringRef WKIntentDataCopyAction(WKIntentDataRef intentRef)
{
#if ENABLE(WEB_INTENTS)
@@ -104,7 +84,7 @@ WKArrayRef WKIntentDataCopySuggestions(WKIntentDataRef intentRef)
#endif
}
-WKStringRef WKIntentDataCopyExtra(WKIntentDataRef intentRef, WKStringRef key)
+WKStringRef WKIntentDataCopyExtraValue(WKIntentDataRef intentRef, WKStringRef key)
{
#if ENABLE(WEB_INTENTS)
return toCopiedAPI(toImpl(intentRef)->extra(toWTFString(key)));
diff --git a/Source/WebKit2/UIProcess/API/C/WKIntentData.h b/Source/WebKit2/UIProcess/API/C/WKIntentData.h
index 1f809ec8d..caf1b459f 100644
--- a/Source/WebKit2/UIProcess/API/C/WKIntentData.h
+++ b/Source/WebKit2/UIProcess/API/C/WKIntentData.h
@@ -34,13 +34,11 @@ extern "C" {
WK_EXPORT WKTypeID WKIntentDataGetTypeID();
-WK_EXPORT WKIntentDataRef WKIntentDataCreate(WKDictionaryRef initDictionary);
-
WK_EXPORT WKStringRef WKIntentDataCopyAction(WKIntentDataRef intentRef);
WK_EXPORT WKStringRef WKIntentDataCopyType(WKIntentDataRef intentRef);
WK_EXPORT WKURLRef WKIntentDataCopyService(WKIntentDataRef intentRef);
WK_EXPORT WKArrayRef WKIntentDataCopySuggestions(WKIntentDataRef intentRef);
-WK_EXPORT WKStringRef WKIntentDataCopyExtra(WKIntentDataRef intentRef, WKStringRef key);
+WK_EXPORT WKStringRef WKIntentDataCopyExtraValue(WKIntentDataRef intentRef, WKStringRef key);
WK_EXPORT WKDictionaryRef WKIntentDataCopyExtras(WKIntentDataRef intentRef);
#ifdef __cplusplus
diff --git a/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp b/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp
index c6f7a661c..6a7c53e8f 100644
--- a/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Samsung Electronics. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -46,3 +47,12 @@ WKArrayRef WKOpenPanelParametersCopyAcceptedMIMETypes(WKOpenPanelParametersRef p
{
return toAPI(toImpl(parametersRef)->acceptMIMETypes().leakRef());
}
+
+WKStringRef WKOpenPanelParametersCopyCapture(WKOpenPanelParametersRef parametersRef)
+{
+#if ENABLE(MEDIA_CAPTURE)
+ return toCopiedAPI(toImpl(parametersRef)->capture());
+#else
+ return 0;
+#endif
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h b/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h
index 64577bad9..ddcaae265 100644
--- a/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h
+++ b/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Samsung Electronics. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -42,6 +43,8 @@ WK_EXPORT bool WKOpenPanelParametersGetAllowsMultipleFiles(WKOpenPanelParameters
WK_EXPORT WKArrayRef WKOpenPanelParametersCopyAcceptedMIMETypes(WKOpenPanelParametersRef parameters);
+WK_EXPORT WKStringRef WKOpenPanelParametersCopyCapture(WKOpenPanelParametersRef parameters);
+
#ifdef __cplusplus
}
#endif
diff --git a/Source/WebKit2/UIProcess/API/cpp/efl/WKEinaSharedString.cpp b/Source/WebKit2/UIProcess/API/cpp/efl/WKEinaSharedString.cpp
index d2681203c..ea43df167 100644
--- a/Source/WebKit2/UIProcess/API/cpp/efl/WKEinaSharedString.cpp
+++ b/Source/WebKit2/UIProcess/API/cpp/efl/WKEinaSharedString.cpp
@@ -100,3 +100,8 @@ WKEinaSharedString& WKEinaSharedString::operator=(const char* str)
eina_stringshare_replace(&m_string, str);
return *this;
}
+
+bool WKEinaSharedString::operator==(const char* str) const
+{
+ return (!str || !m_string) ? (str == m_string) : !strcmp(m_string, str);
+}
diff --git a/Source/WebKit2/UIProcess/API/cpp/efl/WKEinaSharedString.h b/Source/WebKit2/UIProcess/API/cpp/efl/WKEinaSharedString.h
index 83f661418..68d76f4ea 100644
--- a/Source/WebKit2/UIProcess/API/cpp/efl/WKEinaSharedString.h
+++ b/Source/WebKit2/UIProcess/API/cpp/efl/WKEinaSharedString.h
@@ -52,6 +52,9 @@ public:
ALWAYS_INLINE bool operator==(const WKEinaSharedString& other) const { return this->m_string == other.m_string; }
ALWAYS_INLINE bool operator!=(const WKEinaSharedString& other) const { return !(*this == other); }
+ bool operator==(const char* str) const;
+ ALWAYS_INLINE bool operator!=(const char* str) const { return !(*this == str); }
+
ALWAYS_INLINE operator const char* () const { return m_string; }
ALWAYS_INLINE bool isNull() const { return !m_string; }
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.cpp
index 5b8e2d7ea..acf8d5645 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.cpp
@@ -128,7 +128,8 @@ unsigned ewk_back_forward_list_count(Ewk_Back_Forward_List* list)
*/
void ewk_back_forward_list_changed(Ewk_Back_Forward_List* list, WKBackForwardListItemRef wkAddedItem, WKArrayRef wkRemovedItems)
{
- addItemToWrapperCache(list, wkAddedItem); // Puts new item to the cache.
+ if (wkAddedItem) // Checking also here to avoid EINA_SAFETY_ON_NULL_RETURN_VAL warnings.
+ addItemToWrapperCache(list, wkAddedItem); // Puts new item to the cache.
const size_t removedItemsSize = wkRemovedItems ? WKArrayGetSize(wkRemovedItems) : 0;
for (size_t i = 0; i < removedItemsSize; ++i) {
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.cpp
index a8586b23d..871187d2a 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.cpp
@@ -39,16 +39,13 @@ using namespace WebKit;
struct _Ewk_Back_Forward_List_Item {
unsigned int __ref; /**< the reference count of the object */
WKRetainPtr<WKBackForwardListItemRef> wkItem;
- WKEinaSharedString uri;
- WKEinaSharedString title;
- WKEinaSharedString originalUri;
+ mutable WKEinaSharedString uri;
+ mutable WKEinaSharedString title;
+ mutable WKEinaSharedString originalUri;
_Ewk_Back_Forward_List_Item(WKBackForwardListItemRef itemRef)
: __ref(1)
, wkItem(itemRef)
- , uri(AdoptWK, WKBackForwardListItemCopyURL(itemRef))
- , title(AdoptWK, WKBackForwardListItemCopyTitle(itemRef))
- , originalUri(AdoptWK, WKBackForwardListItemCopyOriginalURL(itemRef))
{ }
~_Ewk_Back_Forward_List_Item()
@@ -57,6 +54,17 @@ struct _Ewk_Back_Forward_List_Item {
}
};
+#define EWK_BACK_FORWARD_LIST_ITEM_WK_GET_OR_RETURN(item, wkItem_, ...) \
+ if (!(item)) { \
+ EINA_LOG_CRIT("item is NULL."); \
+ return __VA_ARGS__; \
+ } \
+ if (!(item)->wkItem) { \
+ EINA_LOG_CRIT("item->wkItem is NULL."); \
+ return __VA_ARGS__; \
+ } \
+ WKBackForwardListItemRef wkItem_ = (item)->wkItem.get()
+
void ewk_back_forward_list_item_ref(Ewk_Back_Forward_List_Item* item)
{
EINA_SAFETY_ON_NULL_RETURN(item);
@@ -75,21 +83,27 @@ void ewk_back_forward_list_item_unref(Ewk_Back_Forward_List_Item* item)
const char* ewk_back_forward_list_item_uri_get(const Ewk_Back_Forward_List_Item* item)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
+ EWK_BACK_FORWARD_LIST_ITEM_WK_GET_OR_RETURN(item, wkItem, 0);
+
+ item->uri = WKEinaSharedString(AdoptWK, WKBackForwardListItemCopyURL(wkItem));
return item->uri;
}
const char* ewk_back_forward_list_item_title_get(const Ewk_Back_Forward_List_Item* item)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
+ EWK_BACK_FORWARD_LIST_ITEM_WK_GET_OR_RETURN(item, wkItem, 0);
+
+ item->title = WKEinaSharedString(AdoptWK, WKBackForwardListItemCopyTitle(wkItem));
return item->title;
}
const char* ewk_back_forward_list_item_original_uri_get(const Ewk_Back_Forward_List_Item* item)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
+ EWK_BACK_FORWARD_LIST_ITEM_WK_GET_OR_RETURN(item, wkItem, 0);
+
+ item->originalUri = WKEinaSharedString(AdoptWK, WKBackForwardListItemCopyOriginalURL(wkItem));
return item->originalUri;
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_download_job.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_download_job.cpp
index c41681071..a27abc40d 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_download_job.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_download_job.cpp
@@ -28,6 +28,7 @@
#include "DownloadProxy.h"
#include "WKAPICast.h"
+#include "WKEinaSharedString.h"
#include "WKRetainPtr.h"
#include "WebURLRequest.h"
#include "ewk_download_job_private.h"
@@ -50,8 +51,8 @@ struct _Ewk_Download_Job {
double startTime;
double endTime;
uint64_t downloaded; /**< length already downloaded */
- const char* destination;
- const char* suggestedFilename;
+ WKEinaSharedString destination;
+ WKEinaSharedString suggestedFilename;
_Ewk_Download_Job(DownloadProxy* download, Evas_Object* ewkView)
: __ref(1)
@@ -63,8 +64,6 @@ struct _Ewk_Download_Job {
, startTime(-1)
, endTime(-1)
, downloaded(0)
- , destination(0)
- , suggestedFilename(0)
{ }
~_Ewk_Download_Job()
@@ -74,8 +73,6 @@ struct _Ewk_Download_Job {
ewk_url_request_unref(request);
if (response)
ewk_url_response_unref(response);
- eina_stringshare_del(destination);
- eina_stringshare_del(suggestedFilename);
}
};
@@ -159,7 +156,7 @@ Eina_Bool ewk_download_job_destination_set(Ewk_Download_Job* download, const cha
EINA_SAFETY_ON_NULL_RETURN_VAL(download, false);
EINA_SAFETY_ON_NULL_RETURN_VAL(destination, false);
- eina_stringshare_replace(&download->destination, destination);
+ download->destination = destination;
return true;
}
@@ -236,7 +233,7 @@ void ewk_download_job_suggested_filename_set(Ewk_Download_Job* download, const c
{
EINA_SAFETY_ON_NULL_RETURN(download);
- eina_stringshare_replace(&download->suggestedFilename, suggestedFilename);
+ download->suggestedFilename = suggestedFilename;
}
/**
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp
index 856179346..ed5950311 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp
@@ -29,6 +29,7 @@
#include "WKAPICast.h"
#include "WKArray.h"
#include "WKDictionary.h"
+#include "WKEinaSharedString.h"
#include "WKIntentData.h"
#include "WKRetainPtr.h"
#include "WKString.h"
@@ -47,26 +48,23 @@ struct _Ewk_Intent {
#if ENABLE(WEB_INTENTS)
WKRetainPtr<WKIntentDataRef> wkIntent;
#endif
- const char* action;
- const char* type;
- const char* service;
+ WKEinaSharedString action;
+ WKEinaSharedString type;
+ WKEinaSharedString service;
_Ewk_Intent(WKIntentDataRef intentRef)
: __ref(1)
#if ENABLE(WEB_INTENTS)
, wkIntent(intentRef)
+ , action(AdoptWK, WKIntentDataCopyAction(intentRef))
+ , type(AdoptWK, WKIntentDataCopyType(intentRef))
+ , service(AdoptWK, WKIntentDataCopyService(intentRef))
#endif
- , action(0)
- , type(0)
- , service(0)
{ }
~_Ewk_Intent()
{
ASSERT(!__ref);
- eina_stringshare_del(action);
- eina_stringshare_del(type);
- eina_stringshare_del(service);
}
};
@@ -103,47 +101,23 @@ void ewk_intent_unref(Ewk_Intent* intent)
const char* ewk_intent_action_get(const Ewk_Intent* intent)
{
-#if ENABLE(WEB_INTENTS)
- EWK_INTENT_WK_GET_OR_RETURN(intent, wkIntent, 0);
-
- WKRetainPtr<WKStringRef> wkAction(AdoptWK, WKIntentDataCopyAction(wkIntent));
- Ewk_Intent* ewkIntent = const_cast<Ewk_Intent*>(intent);
- eina_stringshare_replace(&ewkIntent->action, toImpl(wkAction.get())->string().utf8().data());
+ EINA_SAFETY_ON_NULL_RETURN_VAL(intent, 0);
return intent->action;
-#else
- return 0;
-#endif
}
const char* ewk_intent_type_get(const Ewk_Intent* intent)
{
-#if ENABLE(WEB_INTENTS)
- EWK_INTENT_WK_GET_OR_RETURN(intent, wkIntent, 0);
-
- WKRetainPtr<WKStringRef> wkType(AdoptWK, WKIntentDataCopyType(wkIntent));
- Ewk_Intent* ewkIntent = const_cast<Ewk_Intent*>(intent);
- eina_stringshare_replace(&ewkIntent->type, toImpl(wkType.get())->string().utf8().data());
+ EINA_SAFETY_ON_NULL_RETURN_VAL(intent, 0);
return intent->type;
-#else
- return 0;
-#endif
}
const char* ewk_intent_service_get(const Ewk_Intent* intent)
{
-#if ENABLE(WEB_INTENTS)
- EWK_INTENT_WK_GET_OR_RETURN(intent, wkIntent, 0);
-
- WKRetainPtr<WKURLRef> wkService(AdoptWK, WKIntentDataCopyService(wkIntent));
- Ewk_Intent* ewkIntent = const_cast<Ewk_Intent*>(intent);
- eina_stringshare_replace(&ewkIntent->service, toImpl(wkService.get())->string().utf8().data());
+ EINA_SAFETY_ON_NULL_RETURN_VAL(intent, 0);
return intent->service;
-#else
- return 0;
-#endif
}
Eina_List* ewk_intent_suggestions_get(const Ewk_Intent* intent)
@@ -171,7 +145,7 @@ const char* ewk_intent_extra_get(const Ewk_Intent* intent, const char* key)
EWK_INTENT_WK_GET_OR_RETURN(intent, wkIntent, 0);
WKRetainPtr<WKStringRef> keyRef = adoptWK(WKStringCreateWithUTF8CString(key));
- WKRetainPtr<WKStringRef> wkValue(AdoptWK, WKIntentDataCopyExtra(wkIntent, keyRef.get()));
+ WKRetainPtr<WKStringRef> wkValue(AdoptWK, WKIntentDataCopyExtraValue(wkIntent, keyRef.get()));
String value = toImpl(wkValue.get())->string();
if (value.isEmpty())
return 0;
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.cpp
index 18422b757..19215724b 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.cpp
@@ -28,6 +28,7 @@
#include "IntentServiceInfo.h"
#include "WKAPICast.h"
+#include "WKEinaSharedString.h"
#include "WKIntentServiceInfo.h"
#include "WKRetainPtr.h"
#include "WKURL.h"
@@ -42,49 +43,30 @@ using namespace WebKit;
*/
struct _Ewk_Intent_Service {
unsigned int __ref; /**< the reference count of the object */
-#if ENABLE(WEB_INTENTS_TAG)
- WKRetainPtr<WKIntentServiceInfoRef> wkService;
-#endif
- const char* action;
- const char* type;
- const char* href;
- const char* title;
- const char* disposition;
+
+ WKEinaSharedString action;
+ WKEinaSharedString type;
+ WKEinaSharedString href;
+ WKEinaSharedString title;
+ WKEinaSharedString disposition;
_Ewk_Intent_Service(WKIntentServiceInfoRef serviceRef)
: __ref(1)
#if ENABLE(WEB_INTENTS_TAG)
- , wkService(serviceRef)
+ , action(AdoptWK, WKIntentServiceInfoCopyAction(serviceRef))
+ , type(AdoptWK, WKIntentServiceInfoCopyType(serviceRef))
+ , href(AdoptWK, WKIntentServiceInfoCopyHref(serviceRef))
+ , title(AdoptWK, WKIntentServiceInfoCopyTitle(serviceRef))
+ , disposition(AdoptWK, WKIntentServiceInfoCopyDisposition(serviceRef))
#endif
- , action(0)
- , type(0)
- , href(0)
- , title(0)
- , disposition(0)
{ }
~_Ewk_Intent_Service()
{
ASSERT(!__ref);
- eina_stringshare_del(action);
- eina_stringshare_del(type);
- eina_stringshare_del(href);
- eina_stringshare_del(title);
- eina_stringshare_del(disposition);
}
};
-#define EWK_INTENT_SERVICE_WK_GET_OR_RETURN(service, wkService_, ...) \
- if (!(service)) { \
- EINA_LOG_CRIT("service is NULL."); \
- return __VA_ARGS__; \
- } \
- if (!(service)->wkService) { \
- EINA_LOG_CRIT("service->wkService is NULL."); \
- return __VA_ARGS__; \
- } \
- WKIntentServiceInfoRef wkService_ = (service)->wkService.get()
-
void ewk_intent_service_ref(Ewk_Intent_Service* service)
{
#if ENABLE(WEB_INTENTS_TAG)
@@ -107,77 +89,37 @@ void ewk_intent_service_unref(Ewk_Intent_Service* service)
const char* ewk_intent_service_action_get(const Ewk_Intent_Service* service)
{
-#if ENABLE(WEB_INTENTS_TAG)
- EWK_INTENT_SERVICE_WK_GET_OR_RETURN(service, wkService, 0);
-
- WKRetainPtr<WKStringRef> wkAction(AdoptWK, WKIntentServiceInfoCopyAction(wkService));
- Ewk_Intent_Service* ewkIntentService = const_cast<Ewk_Intent_Service*>(service);
- eina_stringshare_replace(&ewkIntentService->action, toImpl(wkAction.get())->string().utf8().data());
+ EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
return service->action;
-#else
- return 0;
-#endif
}
const char* ewk_intent_service_type_get(const Ewk_Intent_Service* service)
{
-#if ENABLE(WEB_INTENTS_TAG)
- EWK_INTENT_SERVICE_WK_GET_OR_RETURN(service, wkService, 0);
-
- WKRetainPtr<WKStringRef> wkType(AdoptWK, WKIntentServiceInfoCopyType(wkService));
- Ewk_Intent_Service* ewkIntentService = const_cast<Ewk_Intent_Service*>(service);
- eina_stringshare_replace(&ewkIntentService->type, toImpl(wkType.get())->string().utf8().data());
+ EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
return service->type;
-#else
- return 0;
-#endif
}
const char* ewk_intent_service_href_get(const Ewk_Intent_Service* service)
{
-#if ENABLE(WEB_INTENTS_TAG)
- EWK_INTENT_SERVICE_WK_GET_OR_RETURN(service, wkService, 0);
-
- WKRetainPtr<WKURLRef> wkHref(AdoptWK, WKIntentServiceInfoCopyHref(wkService));
- Ewk_Intent_Service* ewkIntentService = const_cast<Ewk_Intent_Service*>(service);
- eina_stringshare_replace(&ewkIntentService->href, toImpl(wkHref.get())->string().utf8().data());
+ EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
return service->href;
-#else
- return 0;
-#endif
}
const char* ewk_intent_service_title_get(const Ewk_Intent_Service* service)
{
-#if ENABLE(WEB_INTENTS_TAG)
- EWK_INTENT_SERVICE_WK_GET_OR_RETURN(service, wkService, 0);
-
- WKRetainPtr<WKStringRef> wkTitle(AdoptWK, WKIntentServiceInfoCopyTitle(wkService));
- Ewk_Intent_Service* ewkIntentService = const_cast<Ewk_Intent_Service*>(service);
- eina_stringshare_replace(&ewkIntentService->title, toImpl(wkTitle.get())->string().utf8().data());
+ EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
return service->title;
-#else
- return 0;
-#endif
}
const char* ewk_intent_service_disposition_get(const Ewk_Intent_Service* service)
{
-#if ENABLE(WEB_INTENTS_TAG)
- EWK_INTENT_SERVICE_WK_GET_OR_RETURN(service, wkService, 0);
-
- WKRetainPtr<WKStringRef> wkDisposition(AdoptWK, WKIntentServiceInfoCopyDisposition(wkService));
- Ewk_Intent_Service* ewkIntentService = const_cast<Ewk_Intent_Service*>(service);
- eina_stringshare_replace(&ewkIntentService->disposition, toImpl(wkDisposition.get())->string().utf8().data());
+ EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
return service->disposition;
-#else
- return 0;
-#endif
}
#if ENABLE(WEB_INTENTS_TAG)
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.cpp
index ae725d74a..190810962 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.cpp
@@ -27,6 +27,7 @@
#include "ewk_navigation_policy_decision.h"
#include "WKAPICast.h"
+#include "WKEinaSharedString.h"
#include "WKFramePolicyListener.h"
#include "WKRetainPtr.h"
#include "ewk_navigation_policy_decision_private.h"
@@ -47,7 +48,7 @@ struct _Ewk_Navigation_Policy_Decision {
Event_Mouse_Button mouseButton;
Event_Modifier_Keys modifiers;
Ewk_Url_Request* request;
- const char* frameName;
+ WKEinaSharedString frameName;
_Ewk_Navigation_Policy_Decision(WKFramePolicyListenerRef _listener, Ewk_Navigation_Type _navigationType, Event_Mouse_Button _mouseButton, Event_Modifier_Keys _modifiers, Ewk_Url_Request* _request, const char* _frameName)
: __ref(1)
@@ -57,7 +58,7 @@ struct _Ewk_Navigation_Policy_Decision {
, mouseButton(_mouseButton)
, modifiers(_modifiers)
, request(_request)
- , frameName(eina_stringshare_add(_frameName))
+ , frameName(_frameName)
{ }
~_Ewk_Navigation_Policy_Decision()
@@ -69,7 +70,6 @@ struct _Ewk_Navigation_Policy_Decision {
WKFramePolicyListenerUse(listener.get());
ewk_url_request_unref(request);
- eina_stringshare_del(frameName);
}
};
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_request.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_url_request.cpp
index f209952fe..5816b2feb 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_url_request.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_request.cpp
@@ -27,7 +27,7 @@
#include "ewk_url_request.h"
#include "WKAPICast.h"
-#include "WKRetainPtr.h"
+#include "WKEinaSharedString.h"
#include "WKURL.h"
#include "WKURLRequest.h"
#include "WebURLRequest.h"
@@ -42,40 +42,24 @@ using namespace WebKit;
*/
struct _Ewk_Url_Request {
unsigned int __ref; /**< the reference count of the object */
- WKRetainPtr<WKURLRequestRef> wkRequest;
- const char* url;
- const char* first_party;
- const char* http_method;
+ WKEinaSharedString url;
+ WKEinaSharedString first_party;
+ WKEinaSharedString http_method;
_Ewk_Url_Request(WKURLRequestRef requestRef)
: __ref(1)
- , wkRequest(requestRef)
- , url(0)
- , first_party(0)
- , http_method(0)
+ , url(AdoptWK, WKURLRequestCopyURL(requestRef))
+ , first_party(AdoptWK, WKURLRequestCopyFirstPartyForCookies(requestRef))
+ , http_method(AdoptWK, WKURLRequestCopyHTTPMethod(requestRef))
{ }
~_Ewk_Url_Request()
{
ASSERT(!__ref);
- eina_stringshare_del(url);
- eina_stringshare_del(first_party);
- eina_stringshare_del(http_method);
}
};
-#define EWK_URL_REQUEST_WK_GET_OR_RETURN(request, wkRequest_, ...) \
- if (!(request)) { \
- EINA_LOG_CRIT("request is NULL."); \
- return __VA_ARGS__; \
- } \
- if (!(request)->wkRequest) { \
- EINA_LOG_CRIT("request->wkRequest is NULL."); \
- return __VA_ARGS__; \
- } \
- WKURLRequestRef wkRequest_ = (request)->wkRequest.get()
-
void ewk_url_request_ref(Ewk_Url_Request* request)
{
EINA_SAFETY_ON_NULL_RETURN(request);
@@ -94,31 +78,21 @@ void ewk_url_request_unref(Ewk_Url_Request* request)
const char* ewk_url_request_url_get(const Ewk_Url_Request* request)
{
- EWK_URL_REQUEST_WK_GET_OR_RETURN(request, wkRequest, 0);
-
- WKRetainPtr<WKURLRef> wkUrl(AdoptWK, WKURLRequestCopyURL(wkRequest));
- Ewk_Url_Request* ewkRequest = const_cast<Ewk_Url_Request*>(request);
- eina_stringshare_replace(&ewkRequest->url, toImpl(wkUrl.get())->string().utf8().data());
+ EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
return request->url;
}
const char* ewk_request_cookies_first_party_get(const Ewk_Url_Request* request)
{
- EWK_URL_REQUEST_WK_GET_OR_RETURN(request, wkRequest, 0);
-
- Ewk_Url_Request* ewkRequest = const_cast<Ewk_Url_Request*>(request);
- eina_stringshare_replace(&ewkRequest->first_party, toImpl(wkRequest)->resourceRequest().firstPartyForCookies().string().utf8().data());
+ EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
return request->first_party;
}
const char* ewk_url_request_http_method_get(const Ewk_Url_Request* request)
{
- EWK_URL_REQUEST_WK_GET_OR_RETURN(request, wkRequest, 0);
-
- Ewk_Url_Request* ewkRequest = const_cast<Ewk_Url_Request*>(request);
- eina_stringshare_replace(&ewkRequest->http_method, toImpl(wkRequest)->resourceRequest().httpMethod().utf8().data());
+ EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
return request->http_method;
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp
index 8f9f5366a..8d0a8ee30 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp
@@ -26,9 +26,14 @@
#include "config.h"
#include "ewk_url_response.h"
+#include "WKAPICast.h"
+#include "WKEinaSharedString.h"
+#include "WKURLResponse.h"
#include "ewk_url_response_private.h"
#include <wtf/text/CString.h>
+using namespace WebKit;
+
/**
* \struct _Ewk_Url_Response
* @brief Contains the URL response data.
@@ -37,21 +42,19 @@ struct _Ewk_Url_Response {
unsigned int __ref; /**< the reference count of the object */
WebCore::ResourceResponse coreResponse;
- const char* url;
- const char* mimeType;
+ WKEinaSharedString url;
+ WKEinaSharedString mimeType;
_Ewk_Url_Response(const WebCore::ResourceResponse& _coreResponse)
: __ref(1)
, coreResponse(_coreResponse)
- , url(0)
- , mimeType(0)
+ , url(AdoptWK, WKURLResponseCopyURL(toAPI(coreResponse)))
+ , mimeType(AdoptWK, WKURLResponseCopyMIMEType(toAPI(coreResponse)))
{ }
~_Ewk_Url_Response()
{
ASSERT(!__ref);
- eina_stringshare_del(url);
- eina_stringshare_del(mimeType);
}
};
@@ -75,9 +78,6 @@ const char* ewk_url_response_url_get(const Ewk_Url_Response* response)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(response, 0);
- Ewk_Url_Response* ewkResponse = const_cast<Ewk_Url_Response*>(response);
- eina_stringshare_replace(&ewkResponse->url, response->coreResponse.url().string().utf8().data());
-
return response->url;
}
@@ -92,9 +92,6 @@ const char* ewk_url_response_mime_type_get(const Ewk_Url_Response* response)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(response, 0);
- Ewk_Url_Response* ewkResponse = const_cast<Ewk_Url_Response*>(response);
- eina_stringshare_replace(&ewkResponse->mimeType, response->coreResponse.mimeType().utf8().data());
-
return response->mimeType;
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
index 7d8b1ce05..ce7f7b454 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
@@ -26,6 +26,7 @@
#include "NativeWebWheelEvent.h"
#include "PageClientImpl.h"
#include "WKAPICast.h"
+#include "WKEinaSharedString.h"
#include "WKFindOptions.h"
#include "WKRetainPtr.h"
#include "WKString.h"
@@ -73,11 +74,11 @@ struct _Ewk_View_Private_Data {
OwnPtr<EflViewportHandler> viewportHandler;
#endif
- const char* uri;
- const char* title;
- const char* theme;
- const char* customEncoding;
- const char* cursorGroup;
+ WKEinaSharedString uri;
+ WKEinaSharedString title;
+ WKEinaSharedString theme;
+ WKEinaSharedString customEncoding;
+ WKEinaSharedString cursorGroup;
Evas_Object* cursorObject;
LoadingResourcesMap loadingResourcesMap;
Ewk_Back_Forward_List* backForwardList;
@@ -93,12 +94,7 @@ struct _Ewk_View_Private_Data {
#endif
_Ewk_View_Private_Data()
- : uri(0)
- , title(0)
- , theme(0)
- , customEncoding(0)
- , cursorGroup(0)
- , cursorObject(0)
+ : cursorObject(0)
, backForwardList(0)
#ifdef HAVE_ECORE_X
, isUsingEcoreX(false)
@@ -112,10 +108,6 @@ struct _Ewk_View_Private_Data {
~_Ewk_View_Private_Data()
{
- eina_stringshare_del(uri);
- eina_stringshare_del(title);
- eina_stringshare_del(theme);
- eina_stringshare_del(customEncoding);
_ewk_view_priv_loading_resources_clear(loadingResourcesMap);
if (cursorObject)
@@ -771,10 +763,12 @@ void ewk_view_uri_update(Evas_Object* ewkView)
if (activeURL.isEmpty())
return;
- if (!eina_stringshare_replace(&priv->uri, activeURL.utf8().data()))
+ if (priv->uri == activeURL.utf8().data())
return;
- evas_object_smart_callback_call(ewkView, "uri,changed", static_cast<void*>(const_cast<char*>(priv->uri)));
+ priv->uri = activeURL.utf8().data();
+ const char* callbackArgument = static_cast<const char*>(priv->uri);
+ evas_object_smart_callback_call(ewkView, "uri,changed", const_cast<char*>(callbackArgument));
}
Eina_Bool ewk_view_uri_set(Evas_Object* ewkView, const char* uri)
@@ -933,7 +927,7 @@ const char* ewk_view_title_get(const Evas_Object* ewkView)
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0);
CString title = priv->pageClient->page()->pageTitle().utf8();
- eina_stringshare_replace(&priv->title, title.data());
+ priv->title = title.data();
return priv->title;
}
@@ -1032,10 +1026,10 @@ void ewk_view_theme_set(Evas_Object* ewkView, const char* path)
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
- if (!eina_stringshare_replace(&priv->theme, path))
- return;
-
- priv->pageClient->page()->setThemePath(path);
+ if (priv->theme != path) {
+ priv->theme = path;
+ priv->pageClient->page()->setThemePath(path);
+ }
}
const char* ewk_view_theme_get(const Evas_Object* ewkView)
@@ -1381,7 +1375,7 @@ const char* ewk_view_setting_encoding_custom_get(const Evas_Object* ewkView)
if (customEncoding.isEmpty())
return 0;
- eina_stringshare_replace(&priv->customEncoding, customEncoding.utf8().data());
+ priv->customEncoding = customEncoding.utf8().data();
return priv->customEncoding;
}
@@ -1391,8 +1385,8 @@ Eina_Bool ewk_view_setting_encoding_custom_set(Evas_Object* ewkView, const char*
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
- if (eina_stringshare_replace(&priv->customEncoding, encoding))
- priv->pageClient->page()->setCustomTextEncodingName(encoding ? encoding : String());
+ priv->customEncoding = encoding;
+ priv->pageClient->page()->setCustomTextEncodingName(encoding ? encoding : String());
return true;
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.h b/Source/WebKit2/UIProcess/API/efl/ewk_view.h
index 423f9e143..6064cf855 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.h
@@ -42,7 +42,7 @@
* when done to continue with the form submission. If the last reference is removed on a
* #Ewk_Form_Submission_Request and the form has not been submitted yet,
* ewk_form_submission_request_submit() will be called automatically.
- * - "intent,request,new", Ewk_Intent_Request*: reports new Web intent request.
+ * - "intent,request,new", Ewk_Intent*: reports new Web intent request.
* - "intent,service,register", Ewk_Intent_Service*: reports new Web intent service registration.
* - "load,error", const Ewk_Web_Error*: reports main frame load failed.
* - "load,finished", void: reports load finished.
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_web_error.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_web_error.cpp
index e6e3eb891..70380bdd2 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_web_error.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_web_error.cpp
@@ -27,6 +27,7 @@
#include "ewk_web_error.h"
#include "ErrorsEfl.h"
+#include "WKEinaSharedString.h"
#include "WKString.h"
#include "WKURL.h"
#include "ewk_web_error_private.h"
@@ -41,19 +42,17 @@ using namespace WebKit;
struct _Ewk_Web_Error {
WKRetainPtr<WKErrorRef> wkError;
- const char* url;
- const char* description;
+ WKEinaSharedString url;
+ WKEinaSharedString description;
_Ewk_Web_Error(WKErrorRef errorRef)
: wkError(errorRef)
- , url(0)
- , description(0)
+ , url(AdoptWK, WKErrorCopyFailingURL(errorRef))
+ , description(AdoptWK, WKErrorCopyLocalizedDescription(errorRef))
{ }
~_Ewk_Web_Error()
{
- eina_stringshare_del(url);
- eina_stringshare_del(description);
}
};
@@ -97,11 +96,7 @@ Ewk_Web_Error_Type ewk_web_error_type_get(const Ewk_Web_Error* error)
const char* ewk_web_error_url_get(const Ewk_Web_Error* error)
{
- EWK_WEB_ERROR_WK_GET_OR_RETURN(error, wkError, 0);
-
- WKRetainPtr<WKURLRef> wkUrl(AdoptWK, WKErrorCopyFailingURL(wkError));
- Ewk_Web_Error* ewkError = const_cast<Ewk_Web_Error*>(error);
- eina_stringshare_replace(&ewkError->url, toImpl(wkUrl.get())->string().utf8().data());
+ EINA_SAFETY_ON_NULL_RETURN_VAL(error, 0);
return error->url;
}
@@ -115,11 +110,7 @@ int ewk_web_error_code_get(const Ewk_Web_Error* error)
const char* ewk_web_error_description_get(const Ewk_Web_Error* error)
{
- EWK_WEB_ERROR_WK_GET_OR_RETURN(error, wkError, 0);
-
- WKRetainPtr<WKStringRef> wkDescription(AdoptWK, WKErrorCopyLocalizedDescription(wkError));
- Ewk_Web_Error* ewkError = const_cast<Ewk_Web_Error*>(error);
- eina_stringshare_replace(&ewkError->description, toImpl(wkDescription.get())->string().utf8().data());
+ EINA_SAFETY_ON_NULL_RETURN_VAL(error, 0);
return error->description;
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.cpp
index e0d728a9e..355592df4 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.cpp
@@ -26,24 +26,24 @@
#include "config.h"
#include "ewk_web_resource.h"
+#include "WKEinaSharedString.h"
#include "ewk_web_resource_private.h"
#include <wtf/text/CString.h>
struct _Ewk_Web_Resource {
unsigned int __ref; /**< the reference count of the object */
- const char* url;
+ WKEinaSharedString url;
bool isMainResource;
- _Ewk_Web_Resource(const char* _url, bool _isMainResource)
+ _Ewk_Web_Resource(const char* url, bool isMainResource)
: __ref(1)
- , url(eina_stringshare_add(_url))
- , isMainResource(_isMainResource)
+ , url(url)
+ , isMainResource(isMainResource)
{ }
~_Ewk_Web_Resource()
{
ASSERT(!__ref);
- eina_stringshare_del(url);
}
};
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp b/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp
index 4069e25fa..39bc5a4db 100644
--- a/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp
@@ -112,4 +112,12 @@ void EWK2UnitTestBase::waitUntilTitleChangedTo(const char* expectedTitle)
evas_object_smart_callback_del(m_webView, "title,changed", onTitleChanged);
}
+void EWK2UnitTestBase::mouseClick(int x, int y)
+{
+ Evas* evas = evas_object_evas_get(m_webView);
+ evas_event_feed_mouse_move(evas, x, y, 0, 0);
+ evas_event_feed_mouse_down(evas, /* Left */ 1, EVAS_BUTTON_NONE, 0, 0);
+ evas_event_feed_mouse_up(evas, /* Left */ 1, EVAS_BUTTON_NONE, 0, 0);
+}
+
} // namespace EWK2UnitTest
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h b/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h
index 64b9bce60..29d55bee4 100644
--- a/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h
+++ b/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h
@@ -38,6 +38,7 @@ protected:
void loadUrlSync(const char* url);
void waitUntilTitleChangedTo(const char* expectedTitle);
+ void mouseClick(int x, int y);
private:
Evas_Object* m_webView;
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/resources/default_test_page.html b/Source/WebKit2/UIProcess/API/efl/tests/resources/default_test_page.html
index edd81e732..5d1e00856 100644
--- a/Source/WebKit2/UIProcess/API/efl/tests/resources/default_test_page.html
+++ b/Source/WebKit2/UIProcess/API/efl/tests/resources/default_test_page.html
@@ -1,4 +1,5 @@
<HTML>
+<title>Default Testing Web Page</title>
<BODY>
<H2 align="center">EFL Unit Tests</H2>
<H2 align="center">Default Testing Web Page</H2>
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/resources/intent-request.html b/Source/WebKit2/UIProcess/API/efl/tests/resources/intent-request.html
new file mode 100644
index 000000000..7b06cbec9
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/efl/tests/resources/intent-request.html
@@ -0,0 +1,29 @@
+<html>
+<head>
+<title>Web intent request test</title>
+<script type="text/javascript">
+var clickCount = 0;
+
+function buttonClicked() {
+ if (clickCount == 0) {
+ var testIntent = new WebKitIntent(
+ {"action": "action1",
+ "type": "mime/type1",
+ "service": "http://service1.com/",
+ "extras": {"key1": "value1", "key2": "value2"}});
+ navigator.webkitStartActivity(testIntent);
+ } else if (clickCount == 1) {
+ var testIntent = new WebKitIntent(
+ {"action": "action2",
+ "type": "mime/type2",
+ "suggestions": ["http://service1.com/", "http://service2.com/"]});
+ navigator.webkitStartActivity(testIntent);
+ }
+ clickCount++;
+}
+</script>
+</head>
+<body>
+<input type="button" id="button" value="Start Web Intent" onmouseup="buttonClicked()" style="position: absolute; top: 0px; left: 0px;"/>
+</body>
+</html>
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/resources/intent-service.html b/Source/WebKit2/UIProcess/API/efl/tests/resources/intent-service.html
new file mode 100644
index 000000000..1d9fa2a33
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/efl/tests/resources/intent-service.html
@@ -0,0 +1,9 @@
+<html>
+<head>
+<title>Web Intent service registration test</title>
+</head>
+ <body>
+ <intent action="action" type="type" title="Title" href="http://example.com/service" disposition="inline"></intent>
+ Registered Intent Service.
+ </body>
+</html>
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp
new file mode 100644
index 000000000..af10981ec
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp
@@ -0,0 +1,183 @@
+/*
+ * 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 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 "UnitTestUtils/EWK2UnitTestBase.h"
+#include "UnitTestUtils/EWK2UnitTestEnvironment.h"
+#include "UnitTestUtils/EWK2UnitTestServer.h"
+#include "WKEinaSharedString.h"
+#include <EWebKit2.h>
+#include <gtest/gtest.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+
+using namespace EWK2UnitTest;
+using namespace WTF;
+
+extern EWK2UnitTestEnvironment* environment;
+
+static const char title1[] = "Page1";
+static const char title2[] = "Page2";
+
+static void serverCallbackNavigation(SoupServer* server, SoupMessage* message, const char* path, GHashTable*, SoupClientContext*, gpointer)
+{
+ if (message->method != SOUP_METHOD_GET) {
+ soup_message_set_status(message, SOUP_STATUS_NOT_IMPLEMENTED);
+ return;
+ }
+
+ soup_message_set_status(message, SOUP_STATUS_OK);
+
+ Eina_Strbuf* body = eina_strbuf_new();
+ eina_strbuf_append_printf(body, "<html><title>%s</title><body>%s</body></html>", path + 1, path + 1);
+ const size_t bodyLength = eina_strbuf_length_get(body);
+ soup_message_body_append(message->response_body, SOUP_MEMORY_TAKE, eina_strbuf_string_steal(body), bodyLength);
+ eina_strbuf_free(body);
+
+ soup_message_body_complete(message->response_body);
+}
+
+static inline void checkItem(Ewk_Back_Forward_List_Item* item, const char* title, const char* uri, const char* originalURI)
+{
+ ASSERT_TRUE(item);
+ EXPECT_STREQ(uri, ewk_back_forward_list_item_uri_get(item));
+ EXPECT_STREQ(title, ewk_back_forward_list_item_title_get(item));
+ EXPECT_STREQ(originalURI, ewk_back_forward_list_item_original_uri_get(item));
+}
+
+static inline WKEinaSharedString urlFromTitle(EWK2UnitTestServer* httpServer, const char* title)
+{
+ Eina_Strbuf* path = eina_strbuf_new();
+ eina_strbuf_append_printf(path, "/%s", title);
+ WKEinaSharedString res = httpServer->getURIForPath(eina_strbuf_string_get(path)).data();
+ eina_strbuf_free(path);
+
+ return res;
+}
+
+TEST_F(EWK2UnitTestBase, ewk_back_forward_list_current_item_get)
+{
+ const char* url = environment->defaultTestPageUrl();
+ loadUrlSync(url);
+ Ewk_Back_Forward_List* backForwardList = ewk_view_back_forward_list_get(webView());
+ ASSERT_TRUE(backForwardList);
+
+ Ewk_Back_Forward_List_Item* currentItem = ewk_back_forward_list_current_item_get(backForwardList);
+ checkItem(currentItem, ewk_view_title_get(webView()), url, url);
+
+ Ewk_Back_Forward_List_Item* anotherCurrentItem = ewk_back_forward_list_current_item_get(backForwardList);
+ ASSERT_EQ(currentItem, anotherCurrentItem);
+}
+
+TEST_F(EWK2UnitTestBase, ewk_back_forward_list_previous_item_get)
+{
+ OwnPtr<EWK2UnitTestServer> httpServer = adoptPtr(new EWK2UnitTestServer);
+ httpServer->run(serverCallbackNavigation);
+
+ WKEinaSharedString url1 = urlFromTitle(httpServer.get(), title1);
+ loadUrlSync(url1);
+ ASSERT_STREQ(ewk_view_title_get(webView()), title1);
+
+ loadUrlSync(urlFromTitle(httpServer.get(), title2));
+ ASSERT_STREQ(ewk_view_title_get(webView()), title2);
+
+ Ewk_Back_Forward_List* backForwardList = ewk_view_back_forward_list_get(webView());
+ ASSERT_TRUE(backForwardList);
+
+ Ewk_Back_Forward_List_Item* previousItem = ewk_back_forward_list_previous_item_get(backForwardList);
+ checkItem(previousItem, title1, url1, url1);
+
+ Ewk_Back_Forward_List_Item* anotherPreviousItem = ewk_back_forward_list_previous_item_get(backForwardList);
+ ASSERT_EQ(previousItem, anotherPreviousItem);
+}
+
+TEST_F(EWK2UnitTestBase, ewk_back_forward_list_next_item_get)
+{
+ OwnPtr<EWK2UnitTestServer> httpServer = adoptPtr(new EWK2UnitTestServer);
+ httpServer->run(serverCallbackNavigation);
+
+ loadUrlSync(urlFromTitle(httpServer.get(), title1));
+ ASSERT_STREQ(ewk_view_title_get(webView()), title1);
+
+ WKEinaSharedString url2 = urlFromTitle(httpServer.get(), title2);
+ loadUrlSync(url2);
+ ASSERT_STREQ(ewk_view_title_get(webView()), title2);
+
+ // Go back to Page1.
+ ewk_view_back(webView());
+ waitUntilTitleChangedTo(title1);
+
+ Ewk_Back_Forward_List* backForwardList = ewk_view_back_forward_list_get(webView());
+ ASSERT_TRUE(backForwardList);
+
+ Ewk_Back_Forward_List_Item* nextItem = ewk_back_forward_list_next_item_get(backForwardList);
+ checkItem(nextItem, title2, url2, url2);
+
+ Ewk_Back_Forward_List_Item* anotherNextItem = ewk_back_forward_list_next_item_get(backForwardList);
+ ASSERT_EQ(nextItem, anotherNextItem);
+}
+
+TEST_F(EWK2UnitTestBase, ewk_back_forward_list_item_at_index_get)
+{
+ OwnPtr<EWK2UnitTestServer> httpServer = adoptPtr(new EWK2UnitTestServer);
+ httpServer->run(serverCallbackNavigation);
+
+ WKEinaSharedString url1 = urlFromTitle(httpServer.get(), title1);
+ loadUrlSync(url1);
+ ASSERT_STREQ(ewk_view_title_get(webView()), title1);
+
+ loadUrlSync(urlFromTitle(httpServer.get(), title2));
+ ASSERT_STREQ(ewk_view_title_get(webView()), title2);
+
+ Ewk_Back_Forward_List* backForwardList = ewk_view_back_forward_list_get(webView());
+ ASSERT_TRUE(backForwardList);
+
+ Ewk_Back_Forward_List_Item* previousItem = ewk_back_forward_list_item_at_index_get(backForwardList, -1);
+ checkItem(previousItem, title1, url1, url1);
+
+ Ewk_Back_Forward_List_Item* anotherPreviousItem = ewk_back_forward_list_item_at_index_get(backForwardList, -1);
+ ASSERT_EQ(previousItem, anotherPreviousItem);
+
+ Ewk_Back_Forward_List_Item* nonExistingItem = ewk_back_forward_list_item_at_index_get(backForwardList, 10);
+ ASSERT_FALSE(nonExistingItem);
+}
+
+TEST_F(EWK2UnitTestBase, ewk_back_forward_list_count)
+{
+ OwnPtr<EWK2UnitTestServer> httpServer = adoptPtr(new EWK2UnitTestServer);
+ httpServer->run(serverCallbackNavigation);
+
+ loadUrlSync(urlFromTitle(httpServer.get(), title1));
+ ASSERT_STREQ(ewk_view_title_get(webView()), title1);
+
+ loadUrlSync(urlFromTitle(httpServer.get(), title2));
+ ASSERT_STREQ(ewk_view_title_get(webView()), title2);
+
+ Ewk_Back_Forward_List* backForwardList = ewk_view_back_forward_list_get(webView());
+ ASSERT_TRUE(backForwardList);
+
+ EXPECT_EQ(ewk_back_forward_list_count(backForwardList), 2);
+}
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp
index 034f87140..a5e8157da 100644
--- a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp
@@ -28,6 +28,7 @@
#include "UnitTestUtils/EWK2UnitTestBase.h"
#include "UnitTestUtils/EWK2UnitTestEnvironment.h"
#include <EWebKit2.h>
+#include <Ecore.h>
#include <gtest/gtest.h>
using namespace EWK2UnitTest;
@@ -67,3 +68,83 @@ TEST_F(EWK2UnitTestBase, ewk_context_uri_scheme_register)
loadUrlSync("fooscheme:MyPath");
ASSERT_STREQ(ewk_view_title_get(webView()), "Foo");
}
+
+struct VibrationCbData {
+ bool didReceiveVibrateCallback; // Whether the vibration event received.
+ bool didReceiveCancelVibrationCallback; // Whether the cancel vibration event received.
+ unsigned vibrateCalledCount; // Vibrate callbacks count.
+ uint64_t expectedVibrationTime; // Expected vibration time.
+};
+
+static void vibrateCallback(uint64_t vibrationTime, void* userData)
+{
+ VibrationCbData* data = static_cast<VibrationCbData*>(userData);
+ if (vibrationTime == data->expectedVibrationTime)
+ data->didReceiveVibrateCallback = true;
+ data->vibrateCalledCount++;
+}
+
+static void cancelVibrationCallback(void* userData)
+{
+ VibrationCbData* data = static_cast<VibrationCbData*>(userData);
+ data->didReceiveCancelVibrationCallback = true;
+}
+
+static void loadVibrationHTMLString(Evas_Object* webView, const char* vibrationPattern, bool waitForVibrationEvent, VibrationCbData* data)
+{
+ const char* content =
+ "<html><head><script type='text/javascript'>function vibrate() { navigator.vibrate(%s);"
+ " document.title = \"Loaded\"; }</script></head><body onload='vibrate()'></body></html>";
+
+ data->didReceiveVibrateCallback = false;
+ data->didReceiveCancelVibrationCallback = false;
+ data->vibrateCalledCount = 0;
+ Eina_Strbuf* buffer = eina_strbuf_new();
+ eina_strbuf_append_printf(buffer, content, vibrationPattern);
+ ewk_view_html_string_load(webView, eina_strbuf_string_get(buffer), 0, 0);
+ eina_strbuf_free(buffer);
+
+ if (!waitForVibrationEvent)
+ return;
+
+ while (!data->didReceiveVibrateCallback && !data->didReceiveCancelVibrationCallback)
+ ecore_main_loop_iterate();
+}
+
+TEST_F(EWK2UnitTestBase, ewk_context_vibration_client_callbacks_set)
+{
+ VibrationCbData data = { false, false, 0, 5000 };
+ ewk_context_vibration_client_callbacks_set(ewk_context_default_get(), vibrateCallback, cancelVibrationCallback, &data);
+
+ // Vibrate for 5 seconds.
+ loadVibrationHTMLString(webView(), "5000", true, &data);
+ ASSERT_TRUE(data.didReceiveVibrateCallback);
+
+ // Cancel any existing vibrations.
+ loadVibrationHTMLString(webView(), "0", true, &data);
+ ASSERT_TRUE(data.didReceiveCancelVibrationCallback);
+
+ // This case the pattern will cause the device to vibrate for 200 ms, be still for 100 ms, and then vibrate for 5000 ms.
+ loadVibrationHTMLString(webView(), "[200, 100, 5000]", true, &data);
+ ASSERT_EQ(data.vibrateCalledCount, 2);
+ ASSERT_TRUE(data.didReceiveVibrateCallback);
+
+ // Cancel outstanding vibration pattern.
+ loadVibrationHTMLString(webView(), "[0]", true, &data);
+ ASSERT_TRUE(data.didReceiveCancelVibrationCallback);
+
+ // Stop listening for vibration events, by calling the function with null for the callbacks.
+ ewk_context_vibration_client_callbacks_set(ewk_context_default_get(), 0, 0, &data);
+
+ // Make sure we don't receive vibration event.
+ loadVibrationHTMLString(webView(), "[5000]", false, &data);
+ waitUntilTitleChangedTo("Loaded");
+ ASSERT_STREQ(ewk_view_title_get(webView()), "Loaded");
+ ASSERT_FALSE(data.didReceiveVibrateCallback);
+
+ // Make sure we don't receive cancel vibration event.
+ loadVibrationHTMLString(webView(), "0", false, &data);
+ waitUntilTitleChangedTo("Loaded");
+ ASSERT_STREQ(ewk_view_title_get(webView()), "Loaded");
+ ASSERT_FALSE(data.didReceiveCancelVibrationCallback);
+}
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp
index 7dbd496bd..10be26cb5 100644
--- a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp
@@ -57,7 +57,7 @@ static void serverCallback(SoupServer* server, SoupMessage* message, const char*
eina_strbuf_append_printf(buffer, INDEX_HTML_STRING, soup_server_get_port(server));
soup_message_headers_replace(message->response_headers, "Set-Cookie", "foo=bar; Max-Age=60");
soup_message_body_append(message->response_body, SOUP_MEMORY_TAKE, eina_strbuf_string_steal(buffer), eina_strbuf_length_get(buffer));
- eina_strbuf_string_free(buffer);
+ eina_strbuf_free(buffer);
} else if (!strcmp(path, "/image.png"))
soup_message_headers_replace(message->response_headers, "Set-Cookie", "baz=qux; Max-Age=60");
else
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_eina_shared_string.cpp b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_eina_shared_string.cpp
new file mode 100644
index 000000000..7f62e0b1e
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_eina_shared_string.cpp
@@ -0,0 +1,118 @@
+/*
+ * 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 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 "UnitTestUtils/EWK2UnitTestBase.h"
+#include "UnitTestUtils/EWK2UnitTestEnvironment.h"
+#include "WKEinaSharedString.h"
+#include <EWebKit2.h>
+#include <Ecore.h>
+#include <WebKit2/WKString.h>
+#include <WebKit2/WKURL.h>
+#include <gtest/gtest.h>
+
+using namespace EWK2UnitTest;
+
+extern EWK2UnitTestEnvironment* environment;
+
+// Use macro here instead of global variables in order not to have always the same pointers.
+#define testString "I'm test string!"
+#define anotherTestString "I'm another test string!"
+#define testUrl "file:///path/somewhere"
+
+static inline void checkString(const WKEinaSharedString& string, const char* pattern)
+{
+ ASSERT_EQ(string.isNull(), pattern ? false : true);
+ ASSERT_EQ(string.length(), pattern ? strlen(pattern) : 0); // Compare length.
+ ASSERT_EQ(string, pattern); // Compare values. Check '==' operator with WKEinaSharedString and plain string.
+ ASSERT_STREQ(string, pattern); // Compare values. Check 'const char*' operator.
+}
+
+TEST_F(EWK2UnitTestBase, constructEmpty)
+{
+ WKEinaSharedString emptyString;
+ checkString(emptyString, 0);
+}
+
+TEST_F(EWK2UnitTestBase, constructFromPlainString)
+{
+ WKEinaSharedString emptyString(testString);
+ checkString(emptyString, testString);
+}
+
+TEST_F(EWK2UnitTestBase, constructFromWKString)
+{
+ WKEinaSharedString string(AdoptWK, WKStringCreateWithUTF8CString(testString));
+ checkString(string, testString);
+}
+
+TEST_F(EWK2UnitTestBase, constructFromWKURL)
+{
+ WKEinaSharedString string(AdoptWK, WKURLCreateWithUTF8CString(testUrl));
+ checkString(string, testUrl);
+}
+
+TEST_F(EWK2UnitTestBase, costructCopy)
+{
+ WKEinaSharedString string(testString);
+ WKEinaSharedString copyString(string);
+ checkString(string, testString);
+ checkString(copyString, testString);
+ ASSERT_EQ(string, copyString); // Check '==' operator with two instances of WKEinaSharedString.
+}
+
+TEST_F(EWK2UnitTestBase, comparisonOperators)
+{
+ WKEinaSharedString string(testString);
+ WKEinaSharedString sameString(testString);
+ WKEinaSharedString anotherString(anotherTestString);
+
+ ASSERT_EQ(string, sameString); // Check '==' operator with two instances of WKEinaSharedString.
+ ASSERT_NE(string, anotherString); // Check '!=' operator with two instances of WKEinaSharedString.
+
+ const char* explicitlySharedString = eina_stringshare_add(testString);
+ ASSERT_EQ(static_cast<const char*>(string), explicitlySharedString); // Compare pointers.
+ ASSERT_STREQ(string, explicitlySharedString); // Compare values.
+ eina_stringshare_del(explicitlySharedString);
+
+ ASSERT_EQ(string, string); // Self-comparison.
+}
+
+TEST_F(EWK2UnitTestBase, assignmentOperators)
+{
+ WKEinaSharedString string;
+
+ string = testString;
+ checkString(string, testString);
+
+ WKEinaSharedString anotherString(anotherTestString);
+ string = anotherString;
+ checkString(string, anotherTestString);
+ ASSERT_EQ(string, anotherString);
+
+ string = string; // Check that self-assignment does not break WKEinaSharedString internal data.
+ checkString(string, anotherTestString);
+}
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_intents.cpp b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_intents.cpp
new file mode 100644
index 000000000..fdf7fdf23
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_intents.cpp
@@ -0,0 +1,116 @@
+/*
+ * 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 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 "UnitTestUtils/EWK2UnitTestBase.h"
+#include "UnitTestUtils/EWK2UnitTestEnvironment.h"
+#include "UnitTestUtils/EWK2UnitTestServer.h"
+#include <EWebKit2.h>
+#include <Ecore.h>
+
+using namespace EWK2UnitTest;
+
+extern EWK2UnitTestEnvironment* environment;
+
+static void onIntentServiceRegistration(void* userData, Evas_Object*, void* eventInfo)
+{
+ bool* intentRegistered = static_cast<bool*>(userData);
+ ASSERT_FALSE(*intentRegistered);
+ *intentRegistered = true;
+
+ Ewk_Intent_Service* service = static_cast<Ewk_Intent_Service*>(eventInfo);
+ ASSERT_TRUE(service);
+ EXPECT_STREQ(ewk_intent_service_action_get(service), "action");
+ EXPECT_STREQ(ewk_intent_service_type_get(service), "type");
+ EXPECT_STREQ(ewk_intent_service_title_get(service), "Title");
+ EXPECT_STREQ(ewk_intent_service_href_get(service), "http://example.com/service");
+ EXPECT_STREQ(ewk_intent_service_disposition_get(service), "inline");
+}
+
+TEST_F(EWK2UnitTestBase, ewk_intent_service_registration)
+{
+ bool intentRegistered = false;
+ evas_object_smart_callback_add(webView(), "intent,service,register", onIntentServiceRegistration, &intentRegistered);
+ loadUrlSync(environment->urlForResource("intent-service.html").data());
+ evas_object_smart_callback_del(webView(), "intent,service,register", onIntentServiceRegistration);
+ ASSERT_TRUE(intentRegistered);
+}
+
+int stringSortCb(const void* d1, const void* d2)
+{
+ return strcmp(static_cast<const char*>(d1), static_cast<const char*>(d2));
+}
+
+static void onIntentReceived(void* userData, Evas_Object*, void* eventInfo)
+{
+ unsigned* intentReceivedCount = static_cast<unsigned*>(userData);
+ ASSERT_GE(*intentReceivedCount, 0);
+ ASSERT_LE(*intentReceivedCount, 1);
+ ++(*intentReceivedCount);
+
+ Ewk_Intent* intent = static_cast<Ewk_Intent*>(eventInfo);
+ ASSERT_TRUE(intent);
+
+ if (*intentReceivedCount == 1) {
+ // First intent.
+ EXPECT_STREQ(ewk_intent_action_get(intent), "action1");
+ EXPECT_STREQ(ewk_intent_type_get(intent), "mime/type1");
+ EXPECT_STREQ(ewk_intent_service_get(intent), "http://service1.com/");
+ EXPECT_STREQ(ewk_intent_extra_get(intent, "key1"), "value1");
+ EXPECT_STREQ(ewk_intent_extra_get(intent, "key2"), "value2");
+ } else {
+ // Second intent.
+ EXPECT_STREQ(ewk_intent_action_get(intent), "action2");
+ EXPECT_STREQ(ewk_intent_type_get(intent), "mime/type2");
+ Eina_List* suggestions = ewk_intent_suggestions_get(intent);
+ ASSERT_TRUE(suggestions);
+ ASSERT_EQ(eina_list_count(suggestions), 2);
+ // We need to sort the suggestions since Intent is using a HashSet internally.
+ suggestions = eina_list_sort(suggestions, 2, stringSortCb);
+ EXPECT_STREQ(static_cast<const char*>(eina_list_nth(suggestions, 0)), "http://service1.com/");
+ EXPECT_STREQ(static_cast<const char*>(eina_list_nth(suggestions, 1)), "http://service2.com/");
+ }
+}
+
+TEST_F(EWK2UnitTestBase, ewk_intent_request)
+{
+ unsigned intentReceivedCount = 0;
+ evas_object_smart_callback_add(webView(), "intent,request,new", onIntentReceived, &intentReceivedCount);
+ loadUrlSync(environment->urlForResource("intent-request.html").data());
+
+ // A user gesture is required for the intent to start.
+ mouseClick(5, 5);
+ while (intentReceivedCount != 1)
+ ecore_main_loop_iterate();
+ ASSERT_EQ(intentReceivedCount, 1);
+
+ // Generate a second intent request.
+ mouseClick(5, 5);
+ while (intentReceivedCount != 2)
+ ecore_main_loop_iterate();
+ ASSERT_EQ(intentReceivedCount, 2);
+ evas_object_smart_callback_del(webView(), "intent,request,new", onIntentReceived);
+}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp
index 43ec3338d..29811fc6a 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp
@@ -33,7 +33,8 @@ enum {
PROP_URI,
PROP_STATUS_CODE,
PROP_CONTENT_LENGTH,
- PROP_MIME_TYPE
+ PROP_MIME_TYPE,
+ PROP_SUGGESTED_FILENAME
};
using namespace WebKit;
@@ -45,6 +46,7 @@ struct _WebKitURIResponsePrivate {
WebCore::ResourceResponse resourceResponse;
CString uri;
CString mimeType;
+ CString suggestedFilename;
};
static void webkitURIResponseFinalize(GObject* object)
@@ -70,6 +72,9 @@ static void webkitURIResponseGetProperty(GObject* object, guint propId, GValue*
case PROP_MIME_TYPE:
g_value_set_string(value, webkit_uri_response_get_mime_type(response));
break;
+ case PROP_SUGGESTED_FILENAME:
+ g_value_set_string(value, webkit_uri_response_get_suggested_filename(response));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
}
@@ -133,6 +138,19 @@ static void webkit_uri_response_class_init(WebKitURIResponseClass* responseClass
0,
WEBKIT_PARAM_READABLE));
+ /**
+ * WebKitURIResponse:suggested-filename:
+ *
+ * The suggested filename for the URI response.
+ */
+ g_object_class_install_property(objectClass,
+ PROP_SUGGESTED_FILENAME,
+ g_param_spec_string("suggested-filename",
+ _("Suggested Filename"),
+ _("The suggested filename for the URI response"),
+ 0,
+ WEBKIT_PARAM_READABLE));
+
g_type_class_add_private(responseClass, sizeof(WebKitURIResponsePrivate));
}
@@ -230,6 +248,28 @@ gboolean webkit_uri_response_get_https_status(WebKitURIResponse* response, GTlsC
return !!response->priv->resourceResponse.soupMessageCertificate();
}
+/**
+ * webkit_uri_response_get_suggested_filename:
+ * @response: a #WebKitURIResponse
+ *
+ * Get the suggested filename for @response, as specified by
+ * the 'Content-Disposition' HTTP header, or %NULL if it's not
+ * present.
+ *
+ * Returns: (transfer none): the suggested filename or %NULL if
+ * the 'Content-Disposition' HTTP header is not present.
+ */
+const gchar* webkit_uri_response_get_suggested_filename(WebKitURIResponse* response)
+{
+ g_return_val_if_fail(WEBKIT_IS_URI_RESPONSE(response), 0);
+
+ if (response->priv->resourceResponse.suggestedFilename().isEmpty())
+ return 0;
+
+ response->priv->suggestedFilename = response->priv->resourceResponse.suggestedFilename().utf8();
+ return response->priv->suggestedFilename.data();
+}
+
WebKitURIResponse* webkitURIResponseCreateForResourceResponse(const WebCore::ResourceResponse& resourceResponse)
{
WebKitURIResponse* uriResponse = WEBKIT_URI_RESPONSE(g_object_new(WEBKIT_TYPE_URI_RESPONSE, NULL));
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.h b/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.h
index 19705921a..d90cf4132 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.h
@@ -53,24 +53,26 @@ struct _WebKitURIResponseClass {
};
WEBKIT_API GType
-webkit_uri_response_get_type (void);
+webkit_uri_response_get_type (void);
WEBKIT_API const gchar *
-webkit_uri_response_get_uri (WebKitURIResponse *response);
+webkit_uri_response_get_uri (WebKitURIResponse *response);
WEBKIT_API guint
-webkit_uri_response_get_status_code (WebKitURIResponse *response);
+webkit_uri_response_get_status_code (WebKitURIResponse *response);
WEBKIT_API guint64
-webkit_uri_response_get_content_length (WebKitURIResponse *response);
+webkit_uri_response_get_content_length (WebKitURIResponse *response);
WEBKIT_API const gchar *
-webkit_uri_response_get_mime_type (WebKitURIResponse *response);
+webkit_uri_response_get_mime_type (WebKitURIResponse *response);
WEBKIT_API gboolean
-webkit_uri_response_get_https_status (WebKitURIResponse *response,
- GTlsCertificate **certificate,
- GTlsCertificateFlags *errors);
+webkit_uri_response_get_https_status (WebKitURIResponse *response,
+ GTlsCertificate **certificate,
+ GTlsCertificateFlags *errors);
+WEBKIT_API const gchar *
+webkit_uri_response_get_suggested_filename (WebKitURIResponse *response);
G_END_DECLS
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
index fe9df9f75..620c9a876 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
@@ -32,6 +32,7 @@
#include "WebKitURISchemeRequestPrivate.h"
#include "WebKitWebContextPrivate.h"
#include <WebCore/FileSystem.h>
+#include <WebCore/Language.h>
#include <wtf/HashMap.h>
#include <wtf/OwnPtr.h>
#include <wtf/gobject/GOwnPtr.h>
@@ -518,6 +519,31 @@ void webkit_web_context_set_spell_checking_languages(WebKitWebContext* context,
#endif
}
+/**
+ * webkit_web_context_set_preferred_languages:
+ * @context: a #WebKitWebContext
+ * @languages: (element-type utf8): a #GList of language identifiers
+ *
+ * Set the list of preferred languages, sorted from most desirable
+ * to least desirable. The list will be used to build the "Accept-Language"
+ * header that will be included in the network requests started by
+ * the #WebKitWebContext.
+ */
+void webkit_web_context_set_preferred_languages(WebKitWebContext* context, GList* languageList)
+{
+ g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context));
+
+ if (!languageList)
+ return;
+
+ Vector<String> languages;
+ for (GList* iter = languageList; iter; iter = g_list_next(iter))
+ languages.append(String::fromUTF8(static_cast<char*>(iter->data)).lower().replace("_", "-"));
+
+ WebCore::overrideUserPreferredLanguages(languages);
+ WebCore::languageDidChange();
+}
+
WebKitDownload* webkitWebContextGetOrCreateDownload(WKDownloadRef wkDownload)
{
GRefPtr<WebKitDownload> download = downloadsMap().get(wkDownload);
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h
index 0d32ba5bb..5af7f2414 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h
@@ -146,6 +146,10 @@ WEBKIT_API void
webkit_web_context_set_spell_checking_languages (WebKitWebContext *context,
const gchar *languages);
+WEBKIT_API void
+webkit_web_context_set_preferred_languages (WebKitWebContext *context,
+ GList *languages);
+
G_END_DECLS
#endif
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
index 80e5fff23..ee86d448a 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
@@ -79,7 +79,7 @@ enum {
MOUSE_TARGET_CHANGED,
- PRINT_REQUESTED,
+ PRINT,
RESOURCE_LOAD_STARTED,
@@ -106,13 +106,6 @@ enum {
PROP_ZOOM_LEVEL
};
-typedef enum {
- NotReplacingContent,
- WillReplaceContent,
- ReplacingContent,
- DidReplaceContent
-} ReplaceContentStatus;
-
typedef HashMap<uint64_t, GRefPtr<WebKitWebResource> > LoadingResourcesMap;
typedef HashMap<String, GRefPtr<WebKitWebResource> > ResourcesMap;
@@ -122,7 +115,6 @@ struct _WebKitWebViewPrivate {
CString customTextEncoding;
double estimatedLoadProgress;
CString activeURI;
- ReplaceContentStatus replaceContentStatus;
bool waitingForMainResource;
gulong mainResourceResponseHandlerID;
@@ -159,7 +151,7 @@ static gboolean webkitWebViewLoadFail(WebKitWebView* webView, WebKitLoadEvent, c
return FALSE;
GOwnPtr<char> htmlString(g_strdup_printf("<html><body>%s</body></html>", error->message));
- webkit_web_view_replace_content(webView, htmlString.get(), failingURI, 0);
+ webkit_web_view_load_alternate_html(webView, htmlString.get(), failingURI, 0);
return TRUE;
}
@@ -882,7 +874,7 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
WEBKIT_TYPE_HIT_TEST_RESULT,
G_TYPE_UINT);
/**
- * WebKitWebView::print-requested:
+ * WebKitWebView::print:
* @web_view: the #WebKitWebView on which the signal is emitted
* @print_operation: the #WebKitPrintOperation that will handle the print request
*
@@ -899,11 +891,11 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
* Returns: %TRUE to stop other handlers from being invoked for the event.
* %FALSE to propagate the event further.
*/
- signals[PRINT_REQUESTED] =
- g_signal_new("print-requested",
+ signals[PRINT] =
+ g_signal_new("print",
G_TYPE_FROM_CLASS(webViewClass),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(WebKitWebViewClass, print_requested),
+ G_STRUCT_OFFSET(WebKitWebViewClass, print),
g_signal_accumulator_true_handled, 0,
webkit_marshal_BOOLEAN__OBJECT,
G_TYPE_BOOLEAN, 1,
@@ -1107,25 +1099,6 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
WEBKIT_TYPE_FORM_SUBMISSION_REQUEST);
}
-static bool updateReplaceContentStatus(WebKitWebView* webView, WebKitLoadEvent loadEvent)
-{
- if (webView->priv->replaceContentStatus == ReplacingContent) {
- if (loadEvent == WEBKIT_LOAD_FINISHED)
- webView->priv->replaceContentStatus = DidReplaceContent;
- return true;
- }
-
- if (loadEvent == WEBKIT_LOAD_STARTED) {
- if (webView->priv->replaceContentStatus == WillReplaceContent) {
- webView->priv->replaceContentStatus = ReplacingContent;
- return true;
- }
- webView->priv->replaceContentStatus = NotReplacingContent;
- }
-
- return false;
-}
-
static void setCertificateToMainResource(WebKitWebView* webView)
{
WebKitWebViewPrivate* priv = webView->priv;
@@ -1169,21 +1142,16 @@ void webkitWebViewLoadChanged(WebKitWebView* webView, WebKitLoadEvent loadEvent)
webView->priv->waitingForMainResource = false;
} else if (loadEvent == WEBKIT_LOAD_COMMITTED) {
webView->priv->subresourcesMap.clear();
- if (webView->priv->replaceContentStatus != ReplacingContent) {
- if (!webView->priv->mainResource) {
- // When a page is loaded from the history cache, the main resource load callbacks
- // are called when the main frame load is finished. We want to make sure there's a
- // main resource available when load has been committed, so we delay the emission of
- // load-changed signal until main resource object has been created.
- webView->priv->waitingForMainResource = true;
- } else
- setCertificateToMainResource(webView);
- }
+ if (!webView->priv->mainResource) {
+ // When a page is loaded from the history cache, the main resource load callbacks
+ // are called when the main frame load is finished. We want to make sure there's a
+ // main resource available when load has been committed, so we delay the emission of
+ // load-changed signal until main resource object has been created.
+ webView->priv->waitingForMainResource = true;
+ } else
+ setCertificateToMainResource(webView);
}
- if (updateReplaceContentStatus(webView, loadEvent))
- return;
-
if (webView->priv->waitingForMainResource)
webView->priv->lastDelayedEvent = loadEvent;
else
@@ -1192,9 +1160,6 @@ void webkitWebViewLoadChanged(WebKitWebView* webView, WebKitLoadEvent loadEvent)
void webkitWebViewLoadFailed(WebKitWebView* webView, WebKitLoadEvent loadEvent, const char* failingURI, GError *error)
{
- if (webView->priv->replaceContentStatus == ReplacingContent)
- return;
-
gboolean returnValue;
g_signal_emit(webView, signals[LOAD_FAILED], 0, loadEvent, failingURI, error, &returnValue);
g_signal_emit(webView, signals[LOAD_CHANGED], 0, WEBKIT_LOAD_FINISHED);
@@ -1212,9 +1177,6 @@ void webkitWebViewSetTitle(WebKitWebView* webView, const CString& title)
void webkitWebViewSetEstimatedLoadProgress(WebKitWebView* webView, double estimatedLoadProgress)
{
- if (webView->priv->replaceContentStatus != NotReplacingContent)
- return;
-
if (webView->priv->estimatedLoadProgress == estimatedLoadProgress)
return;
@@ -1321,7 +1283,7 @@ void webkitWebViewPrintFrame(WebKitWebView* webView, WKFrameRef wkFrame)
{
GRefPtr<WebKitPrintOperation> printOperation = adoptGRef(webkit_print_operation_new(webView));
gboolean returnValue;
- g_signal_emit(webView, signals[PRINT_REQUESTED], 0, printOperation.get(), &returnValue);
+ g_signal_emit(webView, signals[PRINT], 0, printOperation.get(), &returnValue);
if (returnValue)
return;
@@ -1349,16 +1311,8 @@ static void waitForMainResourceResponseIfWaitingForResource(WebKitWebView* webVi
g_signal_connect(priv->mainResource.get(), "notify::response", G_CALLBACK(mainResourceResponseChangedCallback), webView);
}
-static inline bool webkitWebViewIsReplacingContentOrDidReplaceContent(WebKitWebView* webView)
-{
- return (webView->priv->replaceContentStatus == ReplacingContent || webView->priv->replaceContentStatus == DidReplaceContent);
-}
-
void webkitWebViewResourceLoadStarted(WebKitWebView* webView, WKFrameRef wkFrame, uint64_t resourceIdentifier, WebKitURIRequest* request, bool isMainResource)
{
- if (webkitWebViewIsReplacingContentOrDidReplaceContent(webView))
- return;
-
WebKitWebViewPrivate* priv = webView->priv;
WebKitWebResource* resource = webkitWebResourceCreate(wkFrame, request, isMainResource);
if (WKFrameIsMainFrame(wkFrame) && (isMainResource || !priv->mainResource)) {
@@ -1371,9 +1325,6 @@ void webkitWebViewResourceLoadStarted(WebKitWebView* webView, WKFrameRef wkFrame
WebKitWebResource* webkitWebViewGetLoadingWebResource(WebKitWebView* webView, uint64_t resourceIdentifier)
{
- if (webkitWebViewIsReplacingContentOrDidReplaceContent(webView))
- return 0;
-
GRefPtr<WebKitWebResource> resource = webView->priv->loadingResourcesMap.get(resourceIdentifier);
ASSERT(resource.get());
return resource.get();
@@ -1381,9 +1332,6 @@ WebKitWebResource* webkitWebViewGetLoadingWebResource(WebKitWebView* webView, ui
void webkitWebViewRemoveLoadingWebResource(WebKitWebView* webView, uint64_t resourceIdentifier)
{
- if (webkitWebViewIsReplacingContentOrDidReplaceContent(webView))
- return;
-
WebKitWebViewPrivate* priv = webView->priv;
ASSERT(priv->loadingResourcesMap.contains(resourceIdentifier));
priv->loadingResourcesMap.remove(resourceIdentifier);
@@ -1391,9 +1339,6 @@ void webkitWebViewRemoveLoadingWebResource(WebKitWebView* webView, uint64_t reso
WebKitWebResource* webkitWebViewResourceLoadFinished(WebKitWebView* webView, uint64_t resourceIdentifier)
{
- if (webkitWebViewIsReplacingContentOrDidReplaceContent(webView))
- return 0;
-
WebKitWebViewPrivate* priv = webView->priv;
WebKitWebResource* resource = webkitWebViewGetLoadingWebResource(webView, resourceIdentifier);
if (resource != priv->mainResource)
@@ -1597,6 +1542,33 @@ void webkit_web_view_load_html(WebKitWebView* webView, const gchar* content, con
}
/**
+ * webkit_web_view_load_alternate_html:
+ * @web_view: a #WebKitWebView
+ * @content: the new content to display as the main page of the @web_view
+ * @content_uri: the URI for the alternate page content
+ * @base_uri: (allow-none): the base URI for relative locations or %NULL
+ *
+ * Load the given @content string for the URI @content_uri.
+ * This allows clients to display page-loading errors in the #WebKitWebView itself.
+ * When this method is called from #WebKitWebView::load-failed signal to show an
+ * error page, the the back-forward list is maintained appropriately.
+ * For everything else this method works the same way as webkit_web_view_load_html().
+ */
+void webkit_web_view_load_alternate_html(WebKitWebView* webView, const gchar* content, const gchar* contentURI, const gchar* baseURI)
+{
+ g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
+ g_return_if_fail(content);
+ g_return_if_fail(contentURI);
+
+ WKRetainPtr<WKStringRef> htmlString(AdoptWK, WKStringCreateWithUTF8CString(content));
+ WKRetainPtr<WKURLRef> contentURL(AdoptWK, WKURLCreateWithUTF8CString(contentURI));
+ WKRetainPtr<WKURLRef> baseURL = baseURI ? adoptWK(WKURLCreateWithUTF8CString(baseURI)) : 0;
+ WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView));
+ WKPageLoadAlternateHTMLString(toAPI(page), htmlString.get(), baseURL.get(), contentURL.get());
+ webkitWebViewUpdateURI(webView);
+}
+
+/**
* webkit_web_view_load_plain_text:
* @web_view: a #WebKitWebView
* @plain_text: The plain text to load
@@ -1637,36 +1609,6 @@ void webkit_web_view_load_request(WebKitWebView* webView, WebKitURIRequest* requ
}
/**
- * webkit_web_view_replace_content:
- * @web_view: a #WebKitWebView
- * @content: the new content to display as the main page of the @web_view
- * @content_uri: the URI for the page content
- * @base_uri: (allow-none): the base URI for relative locations or %NULL
- *
- * Replace the content of @web_view with @content using @content_uri as page URI.
- * This allows clients to display page-loading errors in the #WebKitWebView itself.
- * This is typically called from #WebKitWebView::load-failed signal. The URI passed in
- * @base_uri has to be an absolute URI. The mime type of the document will be "text/html".
- * Signals #WebKitWebView::load-changed and #WebKitWebView::load-failed are not emitted
- * when replacing content of a #WebKitWebView using this method.
- */
-void webkit_web_view_replace_content(WebKitWebView* webView, const gchar* content, const gchar* contentURI, const gchar* baseURI)
-{
- g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
- g_return_if_fail(content);
- g_return_if_fail(contentURI);
-
- webView->priv->replaceContentStatus = WillReplaceContent;
-
- WKRetainPtr<WKStringRef> htmlString(AdoptWK, WKStringCreateWithUTF8CString(content));
- WKRetainPtr<WKURLRef> contentURL(AdoptWK, WKURLCreateWithUTF8CString(contentURI));
- WKRetainPtr<WKURLRef> baseURL = baseURI ? adoptWK(WKURLCreateWithUTF8CString(baseURI)) : 0;
- WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView));
- WKPageLoadAlternateHTMLString(toAPI(page), htmlString.get(), baseURL.get(), contentURL.get());
- webkitWebViewUpdateURI(webView);
-}
-
-/**
* webkit_web_view_get_title:
* @web_view: a #WebKitWebView
*
@@ -1815,6 +1757,10 @@ gboolean webkit_web_view_can_go_forward(WebKitWebView* webView)
* the requested URI is "about:blank".
* </para></listitem>
* <listitem><para>
+ * If the load operation was started by webkit_web_view_load_alternate_html(),
+ * the requested URI is content URI provided.
+ * </para></listitem>
+ * <listitem><para>
* If the load operation was started by webkit_web_view_go_back() or
* webkit_web_view_go_forward(), the requested URI is the original URI
* of the previous/next item in the #WebKitBackForwardList of @web_view.
@@ -1838,10 +1784,6 @@ gboolean webkit_web_view_can_go_forward(WebKitWebView* webView)
* one and it will not change unless a new load operation is started
* or a navigation action within the same page is performed.
* </para></listitem>
- * <listitem><para>
- * When the page content is replaced using webkit_web_view_replace_content(),
- * the active URI is the content_uri provided.
- * </para></listitem>
* </orderedlist>
*
* You can monitor the active URI by connecting to the notify::uri
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h
index 6ebd17f04..540014ac4 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h
@@ -162,7 +162,7 @@ struct _WebKitWebViewClass {
void (* mouse_target_changed) (WebKitWebView *web_view,
WebKitHitTestResult *hit_test_result,
guint modifiers);
- gboolean (* print_requested) (WebKitWebView *web_view,
+ gboolean (* print) (WebKitWebView *web_view,
WebKitPrintOperation *print_operation);
void (* resource_load_started) (WebKitWebView *web_view,
WebKitWebResource *resource,
@@ -210,7 +210,11 @@ WEBKIT_API void
webkit_web_view_load_html (WebKitWebView *web_view,
const gchar *content,
const gchar *base_uri);
-
+WEBKIT_API void
+webkit_web_view_load_alternate_html (WebKitWebView *web_view,
+ const gchar *content,
+ const gchar *content_uri,
+ const gchar *base_uri);
WEBKIT_API void
webkit_web_view_load_plain_text (WebKitWebView *web_view,
const gchar *plain_text);
@@ -222,12 +226,6 @@ webkit_web_view_load_request (WebKitWebView *w
WEBKIT_API void
webkit_web_view_stop_loading (WebKitWebView *web_view);
-WEBKIT_API void
-webkit_web_view_replace_content (WebKitWebView *web_view,
- const gchar *content,
- const gchar *content_uri,
- const gchar *base_uri);
-
WEBKIT_API const gchar *
webkit_web_view_get_title (WebKitWebView *web_view);
diff --git a/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt b/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
index 92da1ebe5..596498c83 100644
--- a/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
+++ b/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
@@ -37,6 +37,7 @@ webkit_web_context_get_spell_checking_enabled
webkit_web_context_set_spell_checking_enabled
webkit_web_context_get_spell_checking_languages
webkit_web_context_set_spell_checking_languages
+webkit_web_context_set_preferred_languages
<SUBSECTION URI Scheme>
WebKitURISchemeRequestCallback
@@ -75,9 +76,9 @@ webkit_web_view_new_with_context
webkit_web_view_get_context
webkit_web_view_load_uri
webkit_web_view_load_html
+webkit_web_view_load_alternate_html
webkit_web_view_load_plain_text
webkit_web_view_load_request
-webkit_web_view_replace_content
webkit_web_view_can_go_back
webkit_web_view_go_back
webkit_web_view_can_go_forward
@@ -325,6 +326,7 @@ webkit_uri_response_get_status_code
webkit_uri_response_get_content_length
webkit_uri_response_get_mime_type
webkit_uri_response_get_https_status
+webkit_uri_response_get_suggested_filename
<SUBSECTION Standard>
WebKitURIResponseClass
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestContextMenu.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestContextMenu.cpp
index 876685712..eff59862b 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestContextMenu.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestContextMenu.cpp
@@ -74,6 +74,24 @@ public:
quitMainLoop();
}
+ GtkMenu* getPopupMenu()
+ {
+ GOwnPtr<GList> toplevels(gtk_window_list_toplevels());
+ for (GList* iter = toplevels.get(); iter; iter = g_list_next(iter)) {
+ if (!GTK_IS_WINDOW(iter->data))
+ continue;
+
+ GtkWidget* child = gtk_bin_get_child(GTK_BIN(iter->data));
+ if (!GTK_IS_MENU(child))
+ continue;
+
+ if (gtk_menu_get_attach_widget(GTK_MENU(child)) == GTK_WIDGET(m_webView))
+ return GTK_MENU(child);
+ }
+ g_assert_not_reached();
+ return 0;
+ }
+
bool shouldShowInputMethodsMenu()
{
GtkSettings* settings = gtk_widget_get_settings(GTK_WIDGET(m_webView));
@@ -391,24 +409,6 @@ public:
return false;
}
- GtkMenu* getPopupMenu()
- {
- GOwnPtr<GList> toplevels(gtk_window_list_toplevels());
- for (GList* iter = toplevels.get(); iter; iter = g_list_next(iter)) {
- if (!GTK_IS_WINDOW(iter->data))
- continue;
-
- GtkWidget* child = gtk_bin_get_child(GTK_BIN(iter->data));
- if (!GTK_IS_MENU(child))
- continue;
-
- if (gtk_menu_get_attach_widget(GTK_MENU(child)) == GTK_WIDGET(m_webView))
- return GTK_MENU(child);
- }
- g_assert_not_reached();
- return 0;
- }
-
GtkMenuItem* getMenuItem(GtkMenu* menu, const gchar* itemLabel)
{
GOwnPtr<GList> items(gtk_container_get_children(GTK_CONTAINER(menu)));
@@ -721,6 +721,115 @@ static void testContextMenuDismissed(ContextMenuDismissedTest* test, gconstpoint
g_assert(test->m_dismissed);
}
+class ContextMenuSmartSeparatorsTest: public ContextMenuTest {
+public:
+ MAKE_GLIB_TEST_FIXTURE(ContextMenuSmartSeparatorsTest);
+
+ bool contextMenu(WebKitContextMenu* contextMenu, GdkEvent*, WebKitHitTestResult*)
+ {
+ webkit_context_menu_remove_all(contextMenu);
+
+ webkit_context_menu_append(contextMenu, webkit_context_menu_item_new_separator());
+ webkit_context_menu_append(contextMenu, webkit_context_menu_item_new_separator());
+ webkit_context_menu_append(contextMenu, webkit_context_menu_item_new_from_stock_action(WEBKIT_CONTEXT_MENU_ACTION_GO_BACK));
+ webkit_context_menu_append(contextMenu, webkit_context_menu_item_new_from_stock_action(WEBKIT_CONTEXT_MENU_ACTION_GO_FORWARD));
+ webkit_context_menu_append(contextMenu, webkit_context_menu_item_new_separator());
+ webkit_context_menu_append(contextMenu, webkit_context_menu_item_new_separator());
+ webkit_context_menu_append(contextMenu, webkit_context_menu_item_new_from_stock_action(WEBKIT_CONTEXT_MENU_ACTION_COPY));
+ webkit_context_menu_append(contextMenu, webkit_context_menu_item_new_separator());
+ webkit_context_menu_append(contextMenu, webkit_context_menu_item_new_from_stock_action(WEBKIT_CONTEXT_MENU_ACTION_INSPECT_ELEMENT));
+ webkit_context_menu_append(contextMenu, webkit_context_menu_item_new_separator());
+ webkit_context_menu_append(contextMenu, webkit_context_menu_item_new_separator());
+
+ quitMainLoop();
+
+ return false;
+ }
+
+ GtkMenu* showContextMenuAndGetGtkMenu()
+ {
+ showContextMenuAndWaitUntilFinished();
+ return getPopupMenu();
+ }
+};
+
+static void testContextMenuSmartSeparators(ContextMenuSmartSeparatorsTest* test, gconstpointer)
+{
+ test->showInWindowAndWaitUntilMapped();
+
+ test->loadHtml("<html><body>WebKitGTK+ Context menu tests</body></html>", "file:///");
+ test->waitUntilLoadFinished();
+
+ GtkMenu* menu = test->showContextMenuAndGetGtkMenu();
+ g_assert(menu);
+
+ // Leading and trailing separators are not added to the context menu.
+ GOwnPtr<GList> menuItems(gtk_container_get_children(GTK_CONTAINER(menu)));
+ g_assert_cmpuint(g_list_length(menuItems.get()), ==, 6);
+ GtkWidget* item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 0));
+ g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 1));
+ g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 2));
+ g_assert(GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 3));
+ g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 4));
+ g_assert(GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 5));
+ g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+
+ // Hiding a menu item between two separators hides the following separator.
+ GtkAction* action = gtk_activatable_get_related_action(GTK_ACTIVATABLE(g_list_nth_data(menuItems.get(), 3)));
+ gtk_action_set_visible(action, FALSE);
+ menuItems.set(gtk_container_get_children(GTK_CONTAINER(menu)));
+ g_assert_cmpuint(g_list_length(menuItems.get()), ==, 6);
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 0));
+ g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 1));
+ g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 2));
+ g_assert(GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 3));
+ g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && !gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 4));
+ g_assert(GTK_IS_SEPARATOR_MENU_ITEM(item) && !gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 5));
+ g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+ gtk_action_set_visible(action, TRUE);
+
+ // Showing an action between two separators shows the hidden separator.
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 0));
+ g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 1));
+ g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 2));
+ g_assert(GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 3));
+ g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 4));
+ g_assert(GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 5));
+ g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+
+ // Trailing separators are hidden too.
+ action = gtk_activatable_get_related_action(GTK_ACTIVATABLE(g_list_nth_data(menuItems.get(), 5)));
+ gtk_action_set_visible(action, FALSE);
+ menuItems.set(gtk_container_get_children(GTK_CONTAINER(menu)));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 0));
+ g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 1));
+ g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 2));
+ g_assert(GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 3));
+ g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 4));
+ g_assert(GTK_IS_SEPARATOR_MENU_ITEM(item) && !gtk_widget_get_visible(item));
+ item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 5));
+ g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && !gtk_widget_get_visible(item));
+}
+
void beforeAll()
{
ContextMenuDefaultTest::add("WebKitWebView", "default-menu", testContextMenuDefaultMenu);
@@ -729,6 +838,7 @@ void beforeAll()
ContextMenuDisabledTest::add("WebKitWebView", "disable-menu", testContextMenuDisableMenu);
ContextMenuSubmenuTest::add("WebKitWebView", "submenu", testContextMenuSubMenu);
ContextMenuDismissedTest::add("WebKitWebView", "menu-dismissed", testContextMenuDismissed);
+ ContextMenuSmartSeparatorsTest::add("WebKitWebView", "smart-separators", testContextMenuSmartSeparators);
}
void afterAll()
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestLoaderClient.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestLoaderClient.cpp
index 59eed7658..dabf072e3 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestLoaderClient.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestLoaderClient.cpp
@@ -70,6 +70,13 @@ static void testLoadHtml(LoadTrackingTest* test, gconstpointer)
assertNormalLoadHappened(test->m_loadEvents);
}
+static void testLoadAlternateHTML(LoadTrackingTest* test, gconstpointer)
+{
+ test->loadAlternateHTML("<html><body>Alternate page</body></html>", "http://error-page.foo/", 0);
+ test->waitUntilLoadFinished();
+ assertNormalLoadHappened(test->m_loadEvents);
+}
+
static void testLoadPlainText(LoadTrackingTest* test, gconstpointer)
{
test->loadPlainText("Hello WebKit-GTK+");
@@ -262,6 +269,7 @@ void beforeAll()
LoadTrackingTest::add("WebKitWebView", "loading-status", testLoadingStatus);
LoadTrackingTest::add("WebKitWebView", "loading-error", testLoadingError);
LoadTrackingTest::add("WebKitWebView", "load-html", testLoadHtml);
+ LoadTrackingTest::add("WebKitWebView", "load-alternate-html", testLoadAlternateHTML);
LoadTrackingTest::add("WebKitWebView", "load-plain-text", testLoadPlainText);
LoadTrackingTest::add("WebKitWebView", "load-request", testLoadRequest);
LoadStopTrackingTest::add("WebKitWebView", "stop-loading", testLoadCancelled);
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestPrinting.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestPrinting.cpp
index 150c31bd3..123831f76 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestPrinting.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestPrinting.cpp
@@ -49,7 +49,7 @@ static void testPrintOperationPrintSettings(WebViewTest* test, gconstpointer)
g_assert(webkit_print_operation_get_page_setup(printOperation.get()) == pageSetup.get());
}
-static gboolean webViewPrintRequestedCallback(WebKitWebView* webView, WebKitPrintOperation* printOperation, WebViewTest* test)
+static gboolean webViewPrintCallback(WebKitWebView* webView, WebKitPrintOperation* printOperation, WebViewTest* test)
{
g_assert(webView == test->m_webView);
@@ -64,9 +64,9 @@ static gboolean webViewPrintRequestedCallback(WebKitWebView* webView, WebKitPrin
return TRUE;
}
-static void testWebViewPrintRequested(WebViewTest* test, gconstpointer)
+static void testWebViewPrint(WebViewTest* test, gconstpointer)
{
- g_signal_connect(test->m_webView, "print-requested", G_CALLBACK(webViewPrintRequestedCallback), test);
+ g_signal_connect(test->m_webView, "print", G_CALLBACK(webViewPrintCallback), test);
test->loadHtml("<html><body onLoad=\"print();\">WebKitGTK+ printing test</body></html>", 0);
g_main_loop_run(test->m_mainLoop);
}
@@ -196,7 +196,7 @@ void beforeAll()
g_assert(kTempDirectory);
WebViewTest::add("WebKitPrintOperation", "printing-settings", testPrintOperationPrintSettings);
- WebViewTest::add("WebKitWebView", "print-requested", testWebViewPrintRequested);
+ WebViewTest::add("WebKitWebView", "print", testWebViewPrint);
#ifdef HAVE_GTK_UNIX_PRINTING
PrintTest::add("WebKitPrintOperation", "print", testPrintOperationPrint);
PrintTest::add("WebKitPrintOperation", "print-errors", testPrintOperationErrors);
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp
index dc7a518dd..7e2e5de61 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp
@@ -397,6 +397,17 @@ static void testWebResourceMimeType(SingleResourceLoadTest* test, gconstpointer)
g_assert_cmpstr(webkit_uri_response_get_mime_type(response), ==, "text/css");
}
+static void testWebResourceSuggestedFilename(SingleResourceLoadTest* test, gconstpointer)
+{
+ test->loadURI(kServer->getURIForPath("/javascript.html").data());
+ WebKitURIResponse* response = test->waitUntilResourceLoadFinishedAndReturnURIResponse();
+ g_assert_cmpstr(webkit_uri_response_get_suggested_filename(response), ==, "JavaScript.js");
+
+ test->loadURI(kServer->getURIForPath("/image.html").data());
+ response = test->waitUntilResourceLoadFinishedAndReturnURIResponse();
+ g_assert(!webkit_uri_response_get_suggested_filename(response));
+}
+
class ResourceURITrackingTest: public SingleResourceLoadTest {
public:
MAKE_GLIB_TEST_FIXTURE(ResourceURITrackingTest);
@@ -494,32 +505,6 @@ static void testWebResourceGetData(ResourcesTest* test, gconstpointer)
test->checkResourceData(WEBKIT_WEB_RESOURCE(item->data));
}
-static void replacedContentResourceLoadStartedCallback()
-{
- g_assert_not_reached();
-}
-
-static void testWebViewResourcesReplacedContent(ResourcesTest* test, gconstpointer)
-{
- test->loadURI(kServer->getURIForPath("/").data());
- // FIXME: this should be 4 instead of 3, but we don't get the css image resource
- // due to bug https://bugs.webkit.org/show_bug.cgi?id=78510.
- test->waitUntilResourcesLoaded(3);
-
- static const char* replacedHtml =
- "<html><head>"
- " <title>Content Replaced</title>"
- " <link rel='stylesheet' href='data:text/css,body { margin: 0px; padding: 0px; }' type='text/css'>"
- " <script language='javascript' src='data:application/javascript,function foo () { var a = 1; }'></script>"
- "</head><body onload='document.title=\"Loaded\"'>WebKitGTK+ resources on replaced content test</body></html>";
- g_signal_connect(test->m_webView, "resource-load-started", G_CALLBACK(replacedContentResourceLoadStartedCallback), test);
- test->replaceContent(replacedHtml, "http://error-page.foo", 0);
- test->waitUntilTitleChangedTo("Loaded");
-
- g_assert(!webkit_web_view_get_main_resource(test->m_webView));
- g_assert(!webkit_web_view_get_subresources(test->m_webView));
-}
-
static void testWebViewResourcesHistoryCache(SingleResourceLoadTest* test, gconstpointer)
{
test->loadURI(kServer->getURIForPath("/").data());
@@ -588,6 +573,7 @@ static void serverCallback(SoupServer* server, SoupMessage* message, const char*
} else if (g_str_equal(path, "/javascript.js")) {
soup_message_body_append(message->response_body, SOUP_MEMORY_STATIC, kJavascript, strlen(kJavascript));
soup_message_headers_append(message->response_headers, "Content-Type", "text/javascript");
+ soup_message_headers_append(message->response_headers, "Content-Disposition", "filename=JavaScript.js");
} else if (g_str_equal(path, "/blank.ico")) {
GOwnPtr<char> filePath(g_build_filename(Test::getWebKit1TestResoucesDir().data(), path, NULL));
char* contents;
@@ -620,9 +606,9 @@ void beforeAll()
SingleResourceLoadTest::add("WebKitWebResource", "loading", testWebResourceLoading);
SingleResourceLoadTest::add("WebKitWebResource", "response", testWebResourceResponse);
SingleResourceLoadTest::add("WebKitWebResource", "mime-type", testWebResourceMimeType);
+ SingleResourceLoadTest::add("WebKitWebResource", "suggested-filename", testWebResourceSuggestedFilename);
ResourceURITrackingTest::add("WebKitWebResource", "active-uri", testWebResourceActiveURI);
ResourcesTest::add("WebKitWebResource", "get-data", testWebResourceGetData);
- ResourcesTest::add("WebKitWebView", "replaced-content", testWebViewResourcesReplacedContent);
SingleResourceLoadTest::add("WebKitWebView", "history-cache", testWebViewResourcesHistoryCache);
}
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitFindController.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitFindController.cpp
index a185db8a7..a2af7bd8d 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitFindController.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitFindController.cpp
@@ -165,14 +165,14 @@ static void testFindControllerNext(FindControllerTest* test, gconstpointer)
test->waitUntilFindFinished();
g_assert(test->m_textFound);
- g_assert(test->m_matchCount == 2);
+ g_assert(test->m_matchCount == 1);
g_assert(!(webkit_find_controller_get_options(test->m_findController.get()) & WEBKIT_FIND_OPTIONS_BACKWARDS));
webkit_find_controller_search_next(test->m_findController.get());
test->waitUntilFindFinished();
g_assert(!test->m_textFound);
- g_assert(test->m_matchCount == 2);
+ g_assert(test->m_matchCount == 1);
g_assert(!(webkit_find_controller_get_options(test->m_findController.get()) & WEBKIT_FIND_OPTIONS_BACKWARDS));
}
@@ -191,14 +191,14 @@ static void testFindControllerPrevious(FindControllerTest* test, gconstpointer)
test->waitUntilFindFinished();
g_assert(test->m_textFound);
- g_assert(test->m_matchCount == 2);
+ g_assert(test->m_matchCount == 1);
g_assert(!(webkit_find_controller_get_options(test->m_findController.get()) & WEBKIT_FIND_OPTIONS_BACKWARDS));
webkit_find_controller_search_previous(test->m_findController.get());
test->waitUntilFindFinished();
g_assert(test->m_textFound);
- g_assert(test->m_matchCount == 2);
+ g_assert(test->m_matchCount == 1);
g_assert(webkit_find_controller_get_options(test->m_findController.get()) & WEBKIT_FIND_OPTIONS_BACKWARDS);
}
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp
index 1b172dfee..cde0bc34a 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp
@@ -20,6 +20,7 @@
#include "config.h"
#include "LoadTrackingTest.h"
+#include "WebKitTestServer.h"
#include <gtk/gtk.h>
#include <webkit2/webkit2.h>
#include <wtf/HashMap.h>
@@ -27,6 +28,8 @@
#include <wtf/gobject/GRefPtr.h>
#include <wtf/text/StringHash.h>
+static WebKitTestServer* kServer;
+
static void testWebContextDefault(Test* test, gconstpointer)
{
// Check there's a single instance of the default web context.
@@ -165,35 +168,6 @@ public:
webkit_web_context_register_uri_scheme(webkit_web_context_get_default(), scheme, uriSchemeRequestCallback, this);
}
- static void resourceGetDataCallback(GObject* object, GAsyncResult* result, gpointer userData)
- {
- size_t dataSize;
- GOwnPtr<GError> error;
- unsigned char* data = webkit_web_resource_get_data_finish(WEBKIT_WEB_RESOURCE(object), result, &dataSize, &error.outPtr());
- g_assert(data);
-
- URISchemeTest* test = static_cast<URISchemeTest*>(userData);
- test->m_resourceData.set(reinterpret_cast<char*>(data));
- test->m_resourceDataSize = dataSize;
- g_main_loop_quit(test->m_mainLoop);
- }
-
- const char* mainResourceData(size_t& mainResourceDataSize)
- {
- m_resourceDataSize = 0;
- m_resourceData.clear();
- WebKitWebResource* resource = webkit_web_view_get_main_resource(m_webView);
- g_assert(resource);
-
- webkit_web_resource_get_data(resource, 0, resourceGetDataCallback, this);
- g_main_loop_run(m_mainLoop);
-
- mainResourceDataSize = m_resourceDataSize;
- return m_resourceData.get();
- }
-
- GOwnPtr<char> m_resourceData;
- size_t m_resourceDataSize;
GRefPtr<WebKitURISchemeRequest> m_uriSchemeRequest;
HashMap<String, URISchemeHandler> m_handlersMap;
};
@@ -266,14 +240,57 @@ static void testWebContextSpellChecker(Test* test, gconstpointer)
g_assert(webkit_web_context_get_spell_checking_enabled(webContext));
}
+static void testWebContextLanguages(WebViewTest* test, gconstpointer)
+{
+ static const char* expectedDefaultLanguage = "en";
+ test->loadURI(kServer->getURIForPath("/").data());
+ test->waitUntilLoadFinished();
+ size_t mainResourceDataSize = 0;
+ const char* mainResourceData = test->mainResourceData(mainResourceDataSize);
+ g_assert_cmpuint(mainResourceDataSize, ==, strlen(expectedDefaultLanguage));
+ g_assert(!strncmp(mainResourceData, expectedDefaultLanguage, mainResourceDataSize));
+
+ GList* languages = g_list_prepend(0, const_cast<gpointer>(static_cast<const void*>("dE")));
+ languages = g_list_prepend(languages, const_cast<gpointer>(static_cast<const void*>("ES_es")));
+ languages = g_list_prepend(languages, const_cast<gpointer>(static_cast<const void*>("en")));
+ webkit_web_context_set_preferred_languages(webkit_web_context_get_default(), languages);
+ g_list_free(languages);
+
+ static const char* expectedLanguages = "en, es-es;q=0.90, de;q=0.80";
+ test->loadURI(kServer->getURIForPath("/").data());
+ test->waitUntilLoadFinished();
+ mainResourceDataSize = 0;
+ mainResourceData = test->mainResourceData(mainResourceDataSize);
+ g_assert_cmpuint(mainResourceDataSize, ==, strlen(expectedLanguages));
+ g_assert(!strncmp(mainResourceData, expectedLanguages, mainResourceDataSize));
+}
+
+static void serverCallback(SoupServer* server, SoupMessage* message, const char* path, GHashTable*, SoupClientContext*, gpointer)
+{
+ if (message->method != SOUP_METHOD_GET) {
+ soup_message_set_status(message, SOUP_STATUS_NOT_IMPLEMENTED);
+ return;
+ }
+
+ soup_message_set_status(message, SOUP_STATUS_OK);
+ const char* acceptLanguage = soup_message_headers_get_one(message->request_headers, "Accept-Language");
+ soup_message_body_append(message->response_body, SOUP_MEMORY_COPY, acceptLanguage, strlen(acceptLanguage));
+ soup_message_body_complete(message->response_body);
+}
+
void beforeAll()
{
+ kServer = new WebKitTestServer();
+ kServer->run(serverCallback);
+
Test::add("WebKitWebContext", "default-context", testWebContextDefault);
PluginsTest::add("WebKitWebContext", "get-plugins", testWebContextGetPlugins);
URISchemeTest::add("WebKitWebContext", "uri-scheme", testWebContextURIScheme);
Test::add("WebKitWebContext", "spell-checker", testWebContextSpellChecker);
+ WebViewTest::add("WebKitWebContext", "languages", testWebContextLanguages);
}
void afterAll()
{
+ delete kServer;
}
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp
index 22796bf73..cc67c5d63 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp
@@ -74,24 +74,6 @@ static void testWebViewSettings(WebViewTest* test, gconstpointer)
g_assert(webkit_settings_get_enable_javascript(settings));
}
-static void replaceContentLoadCallback(WebKitWebView* webView, WebKitLoadEvent loadEvent, WebViewTest* test)
-{
- // There might be an event from a previous load,
- // but never a WEBKIT_LOAD_STARTED after webkit_web_view_replace_content().
- g_assert_cmpint(loadEvent, !=, WEBKIT_LOAD_STARTED);
-}
-
-static void testWebViewReplaceContent(WebViewTest* test, gconstpointer)
-{
- test->loadHtml("<html><head><title>Replace Content Test</title></head><body>Content to replace</body></html>", 0);
- test->waitUntilTitleChangedTo("Replace Content Test");
-
- g_signal_connect(test->m_webView, "load-changed", G_CALLBACK(replaceContentLoadCallback), test);
- test->replaceContent("<html><body onload='document.title=\"Content Replaced\"'>New Content</body></html>",
- "http://foo.com/bar", 0);
- test->waitUntilTitleChangedTo("Content Replaced");
-}
-
static const char* kAlertDialogMessage = "WebKitGTK+ alert dialog message";
static const char* kConfirmDialogMessage = "WebKitGTK+ confirm dialog message";
static const char* kPromptDialogMessage = "WebKitGTK+ prompt dialog message";
@@ -1048,7 +1030,6 @@ void beforeAll()
WebViewTest::add("WebKitWebView", "default-context", testWebViewDefaultContext);
WebViewTest::add("WebKitWebView", "custom-charset", testWebViewCustomCharset);
WebViewTest::add("WebKitWebView", "settings", testWebViewSettings);
- WebViewTest::add("WebKitWebView", "replace-content", testWebViewReplaceContent);
UIClientTest::add("WebKitWebView", "create-ready-close", testWebViewCreateReadyClose);
ModalDialogsTest::add("WebKitWebView", "allow-modal-dialogs", testWebViewAllowModalDialogs);
ModalDialogsTest::add("WebKitWebView", "disallow-modal-dialogs", testWebViewDisallowModalDialogs);
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp
index 321b6a37a..a8d20f88c 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp
@@ -29,6 +29,7 @@ WebViewTest::WebViewTest()
, m_mainLoop(g_main_loop_new(0, TRUE))
, m_parentWindow(0)
, m_javascriptResult(0)
+ , m_resourceDataSize(0)
{
assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_webView));
}
@@ -70,10 +71,10 @@ void WebViewTest::loadRequest(WebKitURIRequest* request)
webkit_web_view_load_request(m_webView, request);
}
-void WebViewTest::replaceContent(const char* html, const char* contentURI, const char* baseURI)
+void WebViewTest::loadAlternateHTML(const char* html, const char* contentURI, const char* baseURI)
{
m_activeURI = contentURI;
- webkit_web_view_replace_content(m_webView, html, contentURI, baseURI);
+ webkit_web_view_load_alternate_html(m_webView, html, contentURI, baseURI);
}
void WebViewTest::goBack()
@@ -197,6 +198,33 @@ void WebViewTest::resizeView(int width, int height)
gtk_widget_size_allocate(GTK_WIDGET(m_webView), &allocation);
}
+static void resourceGetDataCallback(GObject* object, GAsyncResult* result, gpointer userData)
+{
+ size_t dataSize;
+ GOwnPtr<GError> error;
+ unsigned char* data = webkit_web_resource_get_data_finish(WEBKIT_WEB_RESOURCE(object), result, &dataSize, &error.outPtr());
+ g_assert(data);
+
+ WebViewTest* test = static_cast<WebViewTest*>(userData);
+ test->m_resourceData.set(reinterpret_cast<char*>(data));
+ test->m_resourceDataSize = dataSize;
+ g_main_loop_quit(test->m_mainLoop);
+}
+
+const char* WebViewTest::mainResourceData(size_t& mainResourceDataSize)
+{
+ m_resourceDataSize = 0;
+ m_resourceData.clear();
+ WebKitWebResource* resource = webkit_web_view_get_main_resource(m_webView);
+ g_assert(resource);
+
+ webkit_web_resource_get_data(resource, 0, resourceGetDataCallback, this);
+ g_main_loop_run(m_mainLoop);
+
+ mainResourceDataSize = m_resourceDataSize;
+ return m_resourceData.get();
+}
+
void WebViewTest::mouseMoveTo(int x, int y, unsigned int mouseModifiers)
{
g_assert(m_parentWindow);
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.h b/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.h
index 8e469f142..25209caa3 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.h
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.h
@@ -35,7 +35,7 @@ public:
virtual void loadHtml(const char* html, const char* baseURI);
virtual void loadPlainText(const char* plainText);
virtual void loadRequest(WebKitURIRequest*);
- void replaceContent(const char* html, const char* contentURI, const char* baseURI);
+ void loadAlternateHTML(const char* html, const char* contentURI, const char* baseURI);
void goBack();
void goForward();
void goToBackForwardListItem(WebKitBackForwardListItem*);
@@ -48,6 +48,7 @@ public:
void waitUntilTitleChanged();
void showInWindowAndWaitUntilMapped(GtkWindowType = GTK_WINDOW_POPUP);
void resizeView(int width, int height);
+ const char* mainResourceData(size_t& mainResourceDataSize);
void mouseMoveTo(int x, int y, unsigned int mouseModifiers = 0);
void clickMouseButton(int x, int y, unsigned int button = 1, unsigned int mouseModifiers = 0);
@@ -69,6 +70,8 @@ public:
CString m_expectedTitle;
WebKitJavascriptResult* m_javascriptResult;
GError** m_javascriptError;
+ GOwnPtr<char> m_resourceData;
+ size_t m_resourceDataSize;
private:
void doMouseButtonEvent(GdkEventType, int, int, unsigned int, unsigned int);
diff --git a/Source/WebKit2/UIProcess/API/mac/WKView.mm b/Source/WebKit2/UIProcess/API/mac/WKView.mm
index a11ef65d0..eb6b819c5 100644
--- a/Source/WebKit2/UIProcess/API/mac/WKView.mm
+++ b/Source/WebKit2/UIProcess/API/mac/WKView.mm
@@ -1895,8 +1895,17 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl
NSWindow *currentWindow = [self window];
if (window == currentWindow)
return;
-
- _data->_pageClient->viewWillMoveToAnotherWindow();
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED == 1070
+ // Avoid calling the code added in 121482 that ensures that the undo stack is cleaned up
+ // before the WKView is moved from one window to another when the WKView is being moved
+ // out of a popover window. This avoids a bug in OS X 10.7 that was fixed in 10.8.
+ // While this technically reopens a potentially crashing code path that 121482 closed,
+ // it only reopens it for WKViews that are used for text editing and that are removed
+ // from an NSPopover at some time earlier than tear-down of the NSPopover.
+ if (![currentWindow isKindOfClass:NSClassFromString(@"_NSPopoverWindow")])
+#endif
+ _data->_pageClient->viewWillMoveToAnotherWindow();
[self removeWindowObservers];
[self addWindowObserversForWindow:window];
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
index 7911f167c..db51b85dd 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
@@ -55,7 +55,6 @@ QQuickWebPagePrivate::QQuickWebPagePrivate(QQuickWebPage* q, QQuickWebView* view
, viewportItem(viewportItem)
, webPageProxy(0)
, paintingIsInitialized(false)
- , m_paintNode(0)
, contentsScale(1)
{
}
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h
index ba0e42eda..ad1c6ad3f 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h
@@ -47,7 +47,6 @@ public:
QQuickWebView* const viewportItem;
WebKit::WebPageProxy* webPageProxy;
bool paintingIsInitialized;
- QSGNode* m_paintNode;
QSizeF contentsSize;
qreal contentsScale;
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
index 6ca413f66..921586d1b 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
@@ -33,8 +33,10 @@
#include "QtWebPageLoadClient.h"
#include "QtWebPagePolicyClient.h"
#include "WebBackForwardList.h"
+#if ENABLE(INSPECTOR_SERVER)
#include "WebInspectorProxy.h"
#include "WebInspectorServer.h"
+#endif
#if ENABLE(FULLSCREEN_API)
#include "WebFullScreenManagerProxy.h"
#endif
@@ -1331,7 +1333,11 @@ void QQuickWebViewExperimental::setUserScripts(const QList<QUrl>& userScripts)
QUrl QQuickWebViewExperimental::remoteInspectorUrl() const
{
+#if ENABLE(INSPECTOR_SERVER)
return QUrl(WebInspectorServer::shared().inspectorUrlForPageID(d_ptr->webPageProxy->inspector()->remoteInspectionPageID()));
+#else
+ return QUrl();
+#endif
}
QQuickUrlSchemeDelegate* QQuickWebViewExperimental::schemeDelegates_At(QQmlListProperty<QQuickUrlSchemeDelegate>* property, int index)
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebkittest_p.h b/Source/WebKit2/UIProcess/API/qt/qwebkittest_p.h
index c0d3e1187..3754f169a 100644
--- a/Source/WebKit2/UIProcess/API/qt/qwebkittest_p.h
+++ b/Source/WebKit2/UIProcess/API/qt/qwebkittest_p.h
@@ -47,13 +47,13 @@ class QWEBKIT_EXPORT QWebKitTest : public QObject {
Q_PROPERTY(QVariant minimumScale READ minimumScale NOTIFY viewportChanged)
Q_PROPERTY(QVariant layoutSize READ layoutSize NOTIFY viewportChanged)
-signals:
+Q_SIGNALS:
void contentsSizeChanged();
void contentsScaleChanged();
void contentsScaleCommitted();
void viewportChanged();
-public slots:
+public Q_SLOTS:
bool touchTap(QObject* item, qreal x, qreal y, int delay = -1);
bool touchDoubleTap(QObject* item, qreal x, qreal y, int delay = -1);
bool wheelEvent(QObject* item, qreal x, qreal y, int delta, Qt::Orientation orient = Qt::Vertical);
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/html/inputmethod.html b/Source/WebKit2/UIProcess/API/qt/tests/html/inputmethod.html
index f3ca937d2..dc9140f9d 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/html/inputmethod.html
+++ b/Source/WebKit2/UIProcess/API/qt/tests/html/inputmethod.html
@@ -5,5 +5,7 @@
<body>
<h1>Basic page</h1>
<input id="inputField" />
+<input id="emailInputField" type="email" />
+<div id="editableDiv" contenteditable></div>
</body>
</html>
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/inspectorserver/tst_inspectorserver.cpp b/Source/WebKit2/UIProcess/API/qt/tests/inspectorserver/tst_inspectorserver.cpp
index 3d2a95a6c..2ad673a4b 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/inspectorserver/tst_inspectorserver.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/tests/inspectorserver/tst_inspectorserver.cpp
@@ -38,7 +38,7 @@ class tst_InspectorServer : public QObject {
public:
tst_InspectorServer();
-private slots:
+private Q_SLOTS:
void init();
void cleanup();
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp b/Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp
index 12e0ab903..d0ea1beb8 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp
@@ -31,7 +31,7 @@
class tst_publicapi : public QObject {
Q_OBJECT
-private slots:
+private Q_SLOTS:
void publicAPI();
};
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/DesktopBehavior.pro b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/DesktopBehavior.pro
index 11733ce48..3fd3d4583 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/DesktopBehavior.pro
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/DesktopBehavior.pro
@@ -6,7 +6,6 @@ OBJECTS_DIR = obj_DesktopBehavior/$$activeBuildConfig()
QT += webkit-private
CONFIG += warn_on testcase
-QT -= testlib
QT += qmltest
DEFINES += DISABLE_FLICKABLE_VIEWPORT=1
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView.pro b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView.pro
index fd940d43d..b340235e4 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView.pro
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView.pro
@@ -6,7 +6,6 @@ OBJECTS_DIR = obj_WebView/$$activeBuildConfig()
QT += webkit-private
CONFIG += warn_on testcase
-QT -= testlib
QT += qmltest
# Test the QML files under WebView in the source repository.
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp b/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp
index d347e158a..5b98ae7b7 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp
@@ -31,7 +31,7 @@ class tst_QQuickWebView : public QObject {
public:
tst_QQuickWebView();
-private slots:
+private Q_SLOTS:
void init();
void cleanup();
@@ -58,6 +58,7 @@ private slots:
void transparentWebViews();
void inputMethod();
+ void inputMethodHints();
void basicRenderingSanity();
private:
@@ -410,6 +411,33 @@ void tst_QQuickWebView::inputMethod()
QVERIFY(!view->flags().testFlag(QQuickItem::ItemAcceptsInputMethod));
}
+void tst_QQuickWebView::inputMethodHints()
+{
+ QQuickWebView* view = webView();
+
+ view->setUrl(QUrl::fromLocalFile(QLatin1String(TESTS_SOURCE_DIR "/html/inputmethod.html")));
+ QVERIFY(waitForLoadSucceeded(view));
+
+ // Setting focus on an input element results in an element in its shadow tree becoming the focus node.
+ // Input hints should not be set from this shadow tree node but from the input element itself.
+ runJavaScript("document.getElementById('emailInputField').focus();");
+ QVERIFY(view->flags().testFlag(QQuickItem::ItemAcceptsInputMethod));
+ QInputMethodQueryEvent query(Qt::ImHints);
+ QGuiApplication::sendEvent(view, &query);
+ Qt::InputMethodHints hints(query.value(Qt::ImHints).toUInt() & Qt::ImhExclusiveInputMask);
+ QCOMPARE(hints, Qt::ImhEmailCharactersOnly);
+
+ // The focus of an editable DIV is given directly to it, so no shadow root element
+ // is necessary. This tests the WebPage::editorState() method ability to get the
+ // right element without breaking.
+ runJavaScript("document.getElementById('editableDiv').focus();");
+ QVERIFY(view->flags().testFlag(QQuickItem::ItemAcceptsInputMethod));
+ query = QInputMethodQueryEvent(Qt::ImHints);
+ QGuiApplication::sendEvent(view, &query);
+ hints = Qt::InputMethodHints(query.value(Qt::ImHints).toUInt());
+ QCOMPARE(hints, Qt::ImhNone);
+}
+
void tst_QQuickWebView::scrollRequest()
{
webView()->setSize(QSizeF(300, 400));
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp b/Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp
index b322bacd4..93d669cee 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp
@@ -123,7 +123,7 @@ public:
static_cast<WebView*>(const_cast<void*>(clientInfo))->frameLoaded();
}
-signals:
+Q_SIGNALS:
void loaded();
private:
@@ -154,7 +154,7 @@ public:
, m_baseUrl(QUrl::fromLocalFile(TESTS_SOURCE_DIR "/html").toString())
{ }
-private slots:
+private Q_SLOTS:
void paint() { run(&tst_qrawwebview::doPaint, m_resourceDir + "/qwkview_paint.png"); }
void noBackground1() { run(&tst_qrawwebview::doNoBackground1, m_resourceDir + "/qwkview_noBackground1.png"); }
void noBackground2() { run(&tst_qrawwebview::doNoBackground2, m_resourceDir + "/qwkview_noBackground1.png"); }
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/util.cpp b/Source/WebKit2/UIProcess/API/qt/tests/util.cpp
index cdd1f9961..6c91de717 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/util.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/tests/util.cpp
@@ -65,10 +65,10 @@ public:
{
connect(webView, SIGNAL(loadingChanged(QWebLoadRequest*)), SLOT(onLoadingChanged(QWebLoadRequest*)));
}
-signals:
+Q_SIGNALS:
void loadSucceeded();
void loadFailed();
-private slots:
+private Q_SLOTS:
void onLoadingChanged(QWebLoadRequest* loadRequest)
{
if (loadRequest->status() == QQuickWebView::LoadSucceededStatus)
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/util.h b/Source/WebKit2/UIProcess/API/qt/tests/util.h
index 907ddb05f..ebb162cc4 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/util.h
+++ b/Source/WebKit2/UIProcess/API/qt/tests/util.h
@@ -40,9 +40,9 @@ class LoadStartedCatcher : public QObject {
Q_OBJECT
public:
LoadStartedCatcher(QQuickWebView* webView);
-public slots:
+public Q_SLOTS:
void onLoadingChanged(QWebLoadRequest* loadRequest);
-signals:
+Q_SIGNALS:
void finished();
private:
QQuickWebView* m_webView;
diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp
index ef972f3e3..6b0de7f25 100644
--- a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp
+++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp
@@ -174,9 +174,9 @@ void LayerTreeCoordinatorProxy::didChangeScrollPosition(const IntPoint& position
dispatchUpdate(bind(&LayerTreeRenderer::didChangeScrollPosition, m_renderer.get(), position));
}
-void LayerTreeCoordinatorProxy::syncCanvas(uint32_t id, const IntSize& canvasSize, uint32_t graphicsSurfaceToken)
+void LayerTreeCoordinatorProxy::syncCanvas(uint32_t id, const IntSize& canvasSize, uint64_t graphicsSurfaceToken, uint32_t frontBuffer)
{
- dispatchUpdate(bind(&LayerTreeRenderer::syncCanvas, m_renderer.get(), id, canvasSize, graphicsSurfaceToken));
+ dispatchUpdate(bind(&LayerTreeRenderer::syncCanvas, m_renderer.get(), id, canvasSize, graphicsSurfaceToken, frontBuffer));
}
void LayerTreeCoordinatorProxy::purgeBackingStores()
diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h
index f603cd0fc..ed71dfe94 100644
--- a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h
+++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h
@@ -73,7 +73,7 @@ public:
void updateViewport();
void renderNextFrame();
void didChangeScrollPosition(const WebCore::IntPoint& position);
- void syncCanvas(uint32_t id, const WebCore::IntSize& canvasSize, uint32_t graphicsSurfaceToken);
+ void syncCanvas(uint32_t id, const WebCore::IntSize& canvasSize, uint64_t graphicsSurfaceToken, uint32_t frontBuffer);
void purgeBackingStores();
LayerTreeRenderer* layerTreeRenderer() const { return m_renderer.get(); }
void setLayerAnimatedOpacity(uint32_t, float);
diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.messages.in b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.messages.in
index d2438f1f1..23869233c 100644
--- a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.messages.in
+++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.messages.in
@@ -33,7 +33,7 @@ messages -> LayerTreeCoordinatorProxy {
DestroyDirectlyCompositedImage(int64_t key)
DidRenderFrame()
DidChangeScrollPosition(WebCore::IntPoint position)
- SyncCanvas(uint32_t id, WebCore::IntSize canvasSize, uint32_t graphicsSurfaceToken)
+ SyncCanvas(uint32_t id, WebCore::IntSize canvasSize, uint64_t graphicsSurfaceToken, uint32_t frontBuffer)
SetLayerAnimatedOpacity(uint32_t id, float opacity)
SetLayerAnimatedTransform(uint32_t id, WebCore::TransformationMatrix transform)
}
diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp
index ed0be3c29..481b9f74b 100644
--- a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp
+++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp
@@ -191,7 +191,7 @@ void LayerTreeRenderer::didChangeScrollPosition(const IntPoint& position)
m_pendingRenderedContentsScrollPosition = position;
}
-void LayerTreeRenderer::syncCanvas(WebLayerID id, const WebCore::IntSize& canvasSize, uint32_t graphicsSurfaceToken)
+void LayerTreeRenderer::syncCanvas(WebLayerID id, const WebCore::IntSize& canvasSize, uint64_t graphicsSurfaceToken, uint32_t frontBuffer)
{
if (canvasSize.isEmpty() || !m_textureMapper)
return;
@@ -208,7 +208,7 @@ void LayerTreeRenderer::syncCanvas(WebLayerID id, const WebCore::IntSize& canvas
} else
canvasBackingStore = it->second;
- canvasBackingStore->setGraphicsSurface(graphicsSurfaceToken, canvasSize);
+ canvasBackingStore->setGraphicsSurface(graphicsSurfaceToken, canvasSize, frontBuffer);
layer->setContentsToMedia(canvasBackingStore.get());
#endif
}
diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h
index 6403b5d2d..5706a4ccd 100644
--- a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h
+++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h
@@ -68,7 +68,7 @@ public:
void setContentsSize(const WebCore::FloatSize&);
void setVisibleContentsRect(const WebCore::FloatRect&);
void didChangeScrollPosition(const WebCore::IntPoint& position);
- void syncCanvas(uint32_t id, const WebCore::IntSize& canvasSize, uint32_t graphicsSurfaceToken);
+ void syncCanvas(uint32_t id, const WebCore::IntSize& canvasSize, uint64_t graphicsSurfaceToken, uint32_t frontBuffer);
void detach();
void appendUpdate(const Function<void()>&);
diff --git a/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp b/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp
index 26a521f39..2ba13e03c 100644
--- a/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp
+++ b/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp
@@ -98,7 +98,8 @@ void DownloadProxy::didReceiveAuthenticationChallenge(const AuthenticationChalle
if (!m_webContext)
return;
- RefPtr<AuthenticationChallengeProxy> authenticationChallengeProxy = AuthenticationChallengeProxy::create(authenticationChallenge, challengeID, m_webContext->process());
+ // FIXME (Multi-WebProcess): Get rid of deprecatedSharedProcess.
+ RefPtr<AuthenticationChallengeProxy> authenticationChallengeProxy = AuthenticationChallengeProxy::create(authenticationChallenge, challengeID, m_webContext->deprecatedSharedProcess());
m_webContext->downloadClient().didReceiveAuthenticationChallenge(m_webContext, this, authenticationChallengeProxy.get());
}
diff --git a/Source/WebKit2/UIProcess/InspectorServer/qt/WebSocketServerQt.h b/Source/WebKit2/UIProcess/InspectorServer/qt/WebSocketServerQt.h
index d565977d9..4b49767c3 100644
--- a/Source/WebKit2/UIProcess/InspectorServer/qt/WebSocketServerQt.h
+++ b/Source/WebKit2/UIProcess/InspectorServer/qt/WebSocketServerQt.h
@@ -41,7 +41,7 @@ public:
bool listen(const String& bindAddress, unsigned short port);
void close();
-private slots:
+private Q_SLOTS:
void handleNewConnection();
private:
diff --git a/Source/WebKit2/UIProcess/WebContext.cpp b/Source/WebKit2/UIProcess/WebContext.cpp
index c80aad42b..e024f175e 100644
--- a/Source/WebKit2/UIProcess/WebContext.cpp
+++ b/Source/WebKit2/UIProcess/WebContext.cpp
@@ -62,10 +62,6 @@
#include <wtf/CurrentTime.h>
#include <wtf/MainThread.h>
-#if PLATFORM(MAC)
-#include "BuiltInPDFView.h"
-#endif
-
#if ENABLE(BATTERY_STATUS)
#include "WebBatteryManagerProxy.h"
#endif
@@ -86,8 +82,6 @@
#include <wtf/RefCountedLeakCounter.h>
#endif
-#define MESSAGE_CHECK_URL(url) MESSAGE_CHECK_BASE(m_process->checkURLReceivedFromWebProcess(url), m_process->connection())
-
using namespace WebCore;
namespace WebKit {
@@ -153,7 +147,6 @@ WebContext::WebContext(ProcessModel processModel, const String& injectedBundlePa
, m_initialHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyAlways)
#endif
, m_processTerminationEnabled(true)
- , m_pluginWorkQueue("com.apple.CoreIPC.PluginQueue")
{
#if !LOG_DISABLED
WebKit::initializeLogChannelsIfNecessary();
@@ -174,11 +167,6 @@ WebContext::WebContext(ProcessModel processModel, const String& injectedBundlePa
WebContext::~WebContext()
{
- m_pluginWorkQueue.invalidate();
-
- if (m_process && m_process->isValid())
- m_process->connection()->removeQueueClient(this);
-
ASSERT(contexts().find(this) != notFound);
contexts().remove(contexts().find(this));
@@ -266,7 +254,15 @@ void WebContext::initializeDownloadClient(const WKContextDownloadClient* client)
{
m_downloadClient.initialize(client);
}
-
+
+WebProcessProxy* WebContext::deprecatedSharedProcess()
+{
+ ASSERT(m_processModel == ProcessModelSharedSecondaryProcess);
+ if (m_processes.isEmpty())
+ return 0;
+ return m_processes[0].get();
+}
+
void WebContext::languageChanged(void* context)
{
static_cast<WebContext*>(context)->languageChanged();
@@ -282,12 +278,20 @@ void WebContext::fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled)
sendToAllProcesses(Messages::WebProcess::FullKeyboardAccessModeChanged(fullKeyboardAccessEnabled));
}
-void WebContext::ensureWebProcess()
+void WebContext::textCheckerStateChanged()
{
- if (m_process)
- return;
+ sendToAllProcesses(Messages::WebProcess::SetTextCheckerState(TextChecker::state()));
+}
+
+void WebContext::ensureSharedWebProcess()
+{
+ if (m_processes.isEmpty())
+ m_processes.append(createNewWebProcess());
+}
- m_process = WebProcessProxy::create(this);
+PassRefPtr<WebProcessProxy> WebContext::createNewWebProcess()
+{
+ RefPtr<WebProcessProxy> process = WebProcessProxy::create(this);
WebProcessCreationParameters parameters;
@@ -332,31 +336,37 @@ void WebContext::ensureWebProcess()
RefPtr<APIObject> injectedBundleInitializationUserData = m_injectedBundleClient.getInjectedBundleInitializationUserData(this);
if (!injectedBundleInitializationUserData)
injectedBundleInitializationUserData = m_injectedBundleInitializationUserData;
- m_process->send(Messages::WebProcess::InitializeWebProcess(parameters, WebContextUserMessageEncoder(injectedBundleInitializationUserData.get())), 0);
+ process->send(Messages::WebProcess::InitializeWebProcess(parameters, WebContextUserMessageEncoder(injectedBundleInitializationUserData.get())), 0);
for (size_t i = 0; i != m_pendingMessagesToPostToInjectedBundle.size(); ++i) {
pair<String, RefPtr<APIObject> >& message = m_pendingMessagesToPostToInjectedBundle[i];
- m_process->deprecatedSend(InjectedBundleMessage::PostMessage, 0, CoreIPC::In(message.first, WebContextUserMessageEncoder(message.second.get())));
+ process->deprecatedSend(InjectedBundleMessage::PostMessage, 0, CoreIPC::In(message.first, WebContextUserMessageEncoder(message.second.get())));
}
+ // FIXME (Multi-WebProcess): What does this mean in the brave new world?
m_pendingMessagesToPostToInjectedBundle.clear();
+
+ return process.release();
}
void WebContext::warmInitialProcess()
{
- ensureWebProcess();
+ ASSERT(m_processes.isEmpty());
+ m_processes.append(createNewWebProcess());
}
void WebContext::enableProcessTermination()
{
m_processTerminationEnabled = true;
- if (shouldTerminate(m_process.get()))
- m_process->terminate();
+ Vector<RefPtr<WebProcessProxy> > processes = m_processes;
+ for (size_t i = 0; i < processes.size(); ++i) {
+ if (shouldTerminate(processes[i].get()))
+ processes[i]->terminate();
+ }
}
bool WebContext::shouldTerminate(WebProcessProxy* process)
{
- // FIXME: Once we support multiple processes per context, this assertion won't hold.
- ASSERT(process == m_process);
+ ASSERT(m_processes.contains(process));
if (!m_processTerminationEnabled)
return false;
@@ -386,13 +396,10 @@ bool WebContext::shouldTerminate(WebProcessProxy* process)
void WebContext::processDidFinishLaunching(WebProcessProxy* process)
{
- // FIXME: Once we support multiple processes per context, this assertion won't hold.
- ASSERT_UNUSED(process, process == m_process);
+ ASSERT(m_processes.contains(process));
m_visitedLinkProvider.processDidFinishLaunching();
- m_process->connection()->addQueueClient(this);
-
// Sometimes the memorySampler gets initialized after process initialization has happened but before the process has finished launching
// so check if it needs to be started here
if (m_memorySamplerEnabled) {
@@ -401,7 +408,7 @@ void WebContext::processDidFinishLaunching(WebProcessProxy* process)
String sampleLogFilePath = String::format("WebProcess%llu", static_cast<unsigned long long>(now));
sampleLogFilePath = SandboxExtension::createHandleForTemporaryFile(sampleLogFilePath, SandboxExtension::WriteOnly, sampleLogSandboxHandle);
- m_process->send(Messages::WebProcess::StartMemorySampler(sampleLogSandboxHandle, sampleLogFilePath, m_memorySamplerInterval), 0);
+ process->send(Messages::WebProcess::StartMemorySampler(sampleLogSandboxHandle, sampleLogFilePath, m_memorySamplerInterval), 0);
}
m_connectionClient.didCreateConnection(this, process->webConnection());
@@ -409,8 +416,7 @@ void WebContext::processDidFinishLaunching(WebProcessProxy* process)
void WebContext::disconnectProcess(WebProcessProxy* process)
{
- // FIXME: Once we support multiple processes per context, this assertion won't hold.
- ASSERT_UNUSED(process, process == m_process);
+ ASSERT(m_processes.contains(process));
m_visitedLinkProvider.processDidClose();
@@ -452,53 +458,74 @@ void WebContext::disconnectProcess(WebProcessProxy* process)
#endif
// This can cause the web context to be destroyed.
- m_process = 0;
+ m_processes.remove(m_processes.find(process));
}
PassRefPtr<WebPageProxy> WebContext::createWebPage(PageClient* pageClient, WebPageGroup* pageGroup)
{
- ensureWebProcess();
+ RefPtr<WebProcessProxy> process;
+ if (m_processModel == ProcessModelSharedSecondaryProcess) {
+ ensureSharedWebProcess();
+ process = m_processes[0];
+ } else {
+ // FIXME (Multi-WebProcess): Add logic for sharing a process.
+ process = createNewWebProcess();
+ m_processes.append(process);
+ }
if (!pageGroup)
pageGroup = m_defaultPageGroup.get();
- return m_process->createWebPage(pageClient, this, pageGroup);
+ return process->createWebPage(pageClient, this, pageGroup);
}
WebProcessProxy* WebContext::relaunchProcessIfNecessary()
{
- ensureWebProcess();
-
- ASSERT(m_process);
- return m_process.get();
+ if (m_processModel == ProcessModelSharedSecondaryProcess) {
+ ensureSharedWebProcess();
+ return m_processes[0].get();
+ } else {
+ // FIXME (Multi-WebProcess): What should this do in this model?
+ return 0;
+ }
}
DownloadProxy* WebContext::download(WebPageProxy* initiatingPage, const ResourceRequest& request)
{
- ensureWebProcess();
+ if (m_processModel == ProcessModelSharedSecondaryProcess) {
+ ensureSharedWebProcess();
- DownloadProxy* download = createDownloadProxy();
- uint64_t initiatingPageID = initiatingPage ? initiatingPage->pageID() : 0;
+ DownloadProxy* download = createDownloadProxy();
+ uint64_t initiatingPageID = initiatingPage ? initiatingPage->pageID() : 0;
#if PLATFORM(QT)
- ASSERT(initiatingPage); // Our design does not suppport downloads without a WebPage.
- initiatingPage->handleDownloadRequest(download);
+ ASSERT(initiatingPage); // Our design does not suppport downloads without a WebPage.
+ initiatingPage->handleDownloadRequest(download);
#endif
- process()->send(Messages::WebProcess::DownloadRequest(download->downloadID(), initiatingPageID, request), 0);
- return download;
+ m_processes[0]->send(Messages::WebProcess::DownloadRequest(download->downloadID(), initiatingPageID, request), 0);
+ return download;
+
+ } else {
+ // FIXME: (Multi-WebProcess): Implement.
+ return 0;
+ }
}
void WebContext::postMessageToInjectedBundle(const String& messageName, APIObject* messageBody)
{
- if (!m_process || !m_process->canSendMessage()) {
- m_pendingMessagesToPostToInjectedBundle.append(std::make_pair(messageName, messageBody));
- return;
- }
+ if (m_processModel == ProcessModelSharedSecondaryProcess) {
+ if (m_processes.isEmpty() || !m_processes[0]->canSendMessage()) {
+ m_pendingMessagesToPostToInjectedBundle.append(std::make_pair(messageName, messageBody));
+ return;
+ }
- // FIXME: We should consider returning false from this function if the messageBody cannot
- // be encoded.
- m_process->deprecatedSend(InjectedBundleMessage::PostMessage, 0, CoreIPC::In(messageName, WebContextUserMessageEncoder(messageBody)));
+ // FIXME: We should consider returning false from this function if the messageBody cannot
+ // be encoded.
+ m_processes[0]->deprecatedSend(InjectedBundleMessage::PostMessage, 0, CoreIPC::In(messageName, WebContextUserMessageEncoder(messageBody)));
+ } else {
+ // FIXME (Multi-WebProcess): Implement.
+ }
}
// InjectedBundle client
@@ -588,74 +615,6 @@ void WebContext::addVisitedLinkHash(LinkHash linkHash)
m_visitedLinkProvider.addVisitedLink(linkHash);
}
-void WebContext::sendDidGetPlugins(uint64_t requestID, PassOwnPtr<Vector<PluginInfo> > pluginInfos)
-{
- ASSERT(isMainThread());
-
- OwnPtr<Vector<PluginInfo> > plugins(pluginInfos);
-
-#if PLATFORM(MAC)
- // Add built-in PDF last, so that it's not used when a real plug-in is installed.
- // NOTE: This has to be done on the main thread as it calls localizedString().
- if (!omitPDFSupport())
- plugins->append(BuiltInPDFView::pluginInfo());
-#endif
-
- process()->send(Messages::WebProcess::DidGetPlugins(requestID, *plugins), 0);
-}
-
-void WebContext::handleGetPlugins(uint64_t requestID, bool refresh)
-{
- if (refresh)
- m_pluginInfoStore.refresh();
-
- OwnPtr<Vector<PluginInfo> > pluginInfos = adoptPtr(new Vector<PluginInfo>);
-
- Vector<PluginModuleInfo> plugins = m_pluginInfoStore.plugins();
- for (size_t i = 0; i < plugins.size(); ++i)
- pluginInfos->append(plugins[i].info);
-
- // NOTE: We have to pass the PluginInfo vector to the secondary thread via a pointer as otherwise
- // we'd end up with a deref() race on all the WTF::Strings it contains.
- RunLoop::main()->dispatch(bind(&WebContext::sendDidGetPlugins, this, requestID, pluginInfos.release()));
-}
-
-void WebContext::getPlugins(CoreIPC::Connection*, uint64_t requestID, bool refresh)
-{
- m_pluginWorkQueue.dispatch(bind(&WebContext::handleGetPlugins, this, requestID, refresh));
-}
-
-void WebContext::getPluginPath(const String& mimeType, const String& urlString, String& pluginPath, bool& blocked)
-{
- MESSAGE_CHECK_URL(urlString);
-
- String newMimeType = mimeType.lower();
-
- blocked = false;
- PluginModuleInfo plugin = pluginInfoStore().findPlugin(newMimeType, KURL(KURL(), urlString));
- if (!plugin.path)
- return;
-
- if (pluginInfoStore().shouldBlockPlugin(plugin)) {
- blocked = true;
- return;
- }
-
- pluginPath = plugin.path;
-}
-
-#if !ENABLE(PLUGIN_PROCESS)
-void WebContext::didGetSitesWithPluginData(const Vector<String>& sites, uint64_t callbackID)
-{
- m_pluginSiteDataManager->didGetSitesWithData(sites, callbackID);
-}
-
-void WebContext::didClearPluginSiteData(uint64_t callbackID)
-{
- m_pluginSiteDataManager->didClearSiteData(callbackID);
-}
-#endif
-
DownloadProxy* WebContext::createDownloadProxy()
{
RefPtr<DownloadProxy> downloadProxy = DownloadProxy::create(this);
@@ -802,7 +761,7 @@ void WebContext::didReceiveSyncMessage(WebProcessProxy* process, CoreIPC::Messag
downloadProxy->didReceiveSyncDownloadProxyMessage(process->connection(), messageID, arguments, reply);
return;
}
-
+
if (messageID.is<CoreIPC::MessageClassWebIconDatabase>()) {
m_iconDatabase->didReceiveSyncMessage(process->connection(), messageID, arguments, reply);
return;
@@ -921,14 +880,20 @@ bool WebContext::httpPipeliningEnabled() const
void WebContext::getWebCoreStatistics(PassRefPtr<DictionaryCallback> callback)
{
- if (!m_process) {
+ if (m_processModel == ProcessModelSharedSecondaryProcess) {
+ if (m_processes.isEmpty()) {
+ callback->invalidate();
+ return;
+ }
+
+ uint64_t callbackID = callback->callbackID();
+ m_dictionaryCallbacks.set(callbackID, callback.get());
+ m_processes[0]->send(Messages::WebProcess::GetWebCoreStatistics(callbackID), 0);
+
+ } else {
+ // FIXME (Multi-WebProcess): Implement.
callback->invalidate();
- return;
}
-
- uint64_t callbackID = callback->callbackID();
- m_dictionaryCallbacks.set(callbackID, callback.get());
- process()->send(Messages::WebProcess::GetWebCoreStatistics(callbackID), 0);
}
static PassRefPtr<MutableDictionary> createDictionaryFromHashMap(const HashMap<String, uint64_t>& map)
@@ -941,6 +906,12 @@ static PassRefPtr<MutableDictionary> createDictionaryFromHashMap(const HashMap<S
return result;
}
+#if !PLATFORM(MAC)
+void WebContext::dummy(bool&)
+{
+}
+#endif
+
void WebContext::didGetWebCoreStatistics(const StatisticsData& statisticsData, uint64_t callbackID)
{
RefPtr<DictionaryCallback> callback = m_dictionaryCallbacks.take(callbackID);
@@ -972,12 +943,4 @@ void WebContext::setJavaScriptGarbageCollectorTimerEnabled(bool flag)
sendToAllProcesses(Messages::WebProcess::SetJavaScriptGarbageCollectorTimerEnabled(flag));
}
-void WebContext::didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage)
-{
- if (messageID.is<CoreIPC::MessageClassWebContext>()) {
- didReceiveWebContextMessageOnConnectionWorkQueue(connection, messageID, arguments, didHandleMessage);
- return;
- }
-}
-
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/WebContext.h b/Source/WebKit2/UIProcess/WebContext.h
index aef8af977..a011461f4 100644
--- a/Source/WebKit2/UIProcess/WebContext.h
+++ b/Source/WebKit2/UIProcess/WebContext.h
@@ -75,7 +75,7 @@ struct WebProcessCreationParameters;
typedef GenericCallback<WKDictionaryRef> DictionaryCallback;
-class WebContext : public APIObject, private CoreIPC::Connection::QueueClient {
+class WebContext : public APIObject {
public:
static const Type APIType = TypeContext;
@@ -90,10 +90,12 @@ public:
void initializeDownloadClient(const WKContextDownloadClient*);
ProcessModel processModel() const { return m_processModel; }
- WebProcessProxy* process() const { return m_process.get(); }
- template<typename U> bool sendToAllProcesses(const U& message);
- template<typename U> bool sendToAllProcessesRelaunchingThemIfNecessary(const U& message);
+ // FIXME (Multi-WebProcess): Remove. No code should assume that there is a shared process.
+ WebProcessProxy* deprecatedSharedProcess();
+
+ template<typename U> void sendToAllProcesses(const U& message);
+ template<typename U> void sendToAllProcessesRelaunchingThemIfNecessary(const U& message);
void processDidFinishLaunching(WebProcessProxy*);
@@ -198,7 +200,8 @@ public:
String iconDatabasePath() const;
void setLocalStorageDirectory(const String& dir) { m_overrideLocalStorageDirectory = dir; }
- void ensureWebProcess();
+ void ensureSharedWebProcess();
+ PassRefPtr<WebProcessProxy> createNewWebProcess();
void warmInitialProcess();
bool shouldTerminate(WebProcessProxy*);
@@ -220,6 +223,8 @@ public:
void fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled);
+ void textCheckerStateChanged();
+
private:
WebContext(ProcessModel, const String& injectedBundlePath);
@@ -228,14 +233,6 @@ private:
void platformInitializeWebProcess(WebProcessCreationParameters&);
void platformInvalidateContext();
- // Plugins
- void getPlugins(CoreIPC::Connection*, uint64_t requestID, bool refresh);
- void getPluginPath(const String& mimeType, const String& urlString, String& pluginPath, bool& blocked);
-#if !ENABLE(PLUGIN_PROCESS)
- void didGetSitesWithPluginData(const Vector<String>& sites, uint64_t callbackID);
- void didClearPluginSiteData(uint64_t callbackID);
-#endif
-
#if PLATFORM(MAC)
void getPasteboardTypes(const String& pasteboardName, Vector<String>& pasteboardTypes);
void getPasteboardPathnamesForType(const String& pasteboardName, const String& pasteboardType, Vector<String>& pathnames);
@@ -253,14 +250,17 @@ private:
void setPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, const SharedMemory::Handle&, uint64_t size);
#endif
+#if !PLATFORM(MAC)
+ // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
+ // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
+ void dummy(bool&);
+#endif
+
void didGetWebCoreStatistics(const StatisticsData&, uint64_t callbackID);
// Implemented in generated WebContextMessageReceiver.cpp
void didReceiveWebContextMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
void didReceiveSyncWebContextMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
- void didReceiveWebContextMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, bool& didHandleMessage);
-
- virtual void didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, bool& didHandleMessage) OVERRIDE;
static void languageChanged(void* context);
void languageChanged();
@@ -273,13 +273,9 @@ private:
String localStorageDirectory() const;
String platformDefaultLocalStorageDirectory() const;
- void handleGetPlugins(uint64_t requestID, bool refresh);
- void sendDidGetPlugins(uint64_t requestID, PassOwnPtr<Vector<WebCore::PluginInfo> >);
-
ProcessModel m_processModel;
- // FIXME: In the future, this should be one or more WebProcessProxies.
- RefPtr<WebProcessProxy> m_process;
+ Vector<RefPtr<WebProcessProxy> > m_processes;
RefPtr<WebPageGroup> m_defaultPageGroup;
@@ -352,23 +348,22 @@ private:
bool m_processTerminationEnabled;
HashMap<uint64_t, RefPtr<DictionaryCallback> > m_dictionaryCallbacks;
-
- WorkQueue m_pluginWorkQueue;
};
-template<typename U> inline bool WebContext::sendToAllProcesses(const U& message)
+template<typename U> inline void WebContext::sendToAllProcesses(const U& message)
{
- if (!m_process || !m_process->canSendMessage())
- return false;
-
- return m_process->send(message, 0);
+ size_t processCount = m_processes.size();
+ for (size_t i = 0; i < processCount; ++i) {
+ WebProcessProxy* process = m_processes[i].get();
+ if (process->canSendMessage())
+ process->send(message, 0);
+ }
}
-template<typename U> bool WebContext::sendToAllProcessesRelaunchingThemIfNecessary(const U& message)
+template<typename U> void WebContext::sendToAllProcessesRelaunchingThemIfNecessary(const U& message)
{
relaunchProcessIfNecessary();
-
- return m_process->send(message, 0);
+ sendToAllProcesses(message);
}
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/WebContext.messages.in b/Source/WebKit2/UIProcess/WebContext.messages.in
index 64f598cef..2664a5f4f 100644
--- a/Source/WebKit2/UIProcess/WebContext.messages.in
+++ b/Source/WebKit2/UIProcess/WebContext.messages.in
@@ -24,15 +24,6 @@ messages -> WebContext {
# Visited link provider messages.
AddVisitedLinkHash(uint64_t linkHash)
-
- # Plugin messages.
- GetPlugins(uint64_t requestID, bool refresh) DispatchOnConnectionQueue
- GetPluginPath(WTF::String mimeType, WTF::String urlString) -> (WTF::String pluginPath, bool blocked)
-
-#if !ENABLE(PLUGIN_PROCESS)
- void DidGetSitesWithPluginData(Vector<WTF::String> sites, uint64_t callbackID)
- void DidClearPluginSiteData(uint64_t callbackID)
-#endif
DidGetWebCoreStatistics(WebKit::StatisticsData statisticsData, uint64_t callbackID)
@@ -54,4 +45,10 @@ messages -> WebContext {
SetPasteboardStringForType(WTF::String pasteboardName, WTF::String pasteboardType, WTF::String string)
SetPasteboardBufferForType(WTF::String pasteboardName, WTF::String pasteboardType, WebKit::SharedMemory::Handle handle, uint64_t size)
#endif
+
+#if !PLATFORM(MAC)
+ // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
+ // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
+ Dummy() -> (bool dummyReturn)
+#endif
}
diff --git a/Source/WebKit2/UIProcess/WebIntentData.cpp b/Source/WebKit2/UIProcess/WebIntentData.cpp
index 96128dbe2..632aa3b75 100644
--- a/Source/WebKit2/UIProcess/WebIntentData.cpp
+++ b/Source/WebKit2/UIProcess/WebIntentData.cpp
@@ -30,16 +30,29 @@
#include "ImmutableArray.h"
#include "ImmutableDictionary.h"
+#include "WebProcessProxy.h"
+#include "WebSerializedScriptValue.h"
#include "WebString.h"
#include "WebURL.h"
namespace WebKit {
-WebIntentData::WebIntentData(const IntentData& store)
+WebIntentData::WebIntentData(const IntentData& store, WebProcessProxy* process)
: m_store(store)
+ , m_process(process)
{
}
+WebIntentData::~WebIntentData()
+{
+ // Remove MessagePortChannels from WebProcess.
+ if (m_process) {
+ size_t numMessagePorts = m_store.messagePorts.size();
+ for (size_t i = 0; i < numMessagePorts; ++i)
+ m_process->removeMessagePortChannel(m_store.messagePorts[i]);
+ }
+}
+
PassRefPtr<WebSerializedScriptValue> WebIntentData::data() const
{
Vector<uint8_t> dataCopy = m_store.data;
@@ -66,6 +79,7 @@ PassRefPtr<ImmutableDictionary> WebIntentData::extras() const
HashMap<String, String>::const_iterator end = m_store.extras.end();
for (HashMap<String, String>::const_iterator it = m_store.extras.begin(); it != end; ++it)
wkExtras.set(it->first, WebString::create(it->second));
+
return ImmutableDictionary::adopt(wkExtras);
}
diff --git a/Source/WebKit2/UIProcess/WebIntentData.h b/Source/WebKit2/UIProcess/WebIntentData.h
index decf4ae4f..9d59f90ce 100644
--- a/Source/WebKit2/UIProcess/WebIntentData.h
+++ b/Source/WebKit2/UIProcess/WebIntentData.h
@@ -30,21 +30,26 @@
#include "APIObject.h"
#include "IntentData.h"
-#include "WebSerializedScriptValue.h"
+#include <WebCore/KURL.h>
#include <wtf/PassRefPtr.h>
namespace WebKit {
+class ImmutableArray;
+class ImmutableDictionary;
+class WebProcessProxy;
+class WebSerializedScriptValue;
+
class WebIntentData : public APIObject {
public:
static const Type APIType = TypeIntentData;
- static PassRefPtr<WebIntentData> create(const IntentData& store)
+ static PassRefPtr<WebIntentData> create(const IntentData& store, WebProcessProxy* process)
{
- return adoptRef(new WebIntentData(store));
+ return adoptRef(new WebIntentData(store, process));
}
- virtual ~WebIntentData() { }
+ virtual ~WebIntentData();
const String& action() const { return m_store.action; }
const String& payloadType() const { return m_store.type; }
@@ -57,11 +62,12 @@ public:
const IntentData& store() const { return m_store; }
private:
- WebIntentData(const IntentData&);
+ WebIntentData(const IntentData&, WebProcessProxy*);
virtual Type type() const { return APIType; }
IntentData m_store;
+ WebProcessProxy* m_process;
};
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp
index 9c4df8eea..8d5cc32df 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp
@@ -281,7 +281,7 @@ void WebPageProxy::initializeLoaderClient(const WKPageLoaderClient* loadClient)
if (!loadClient)
return;
- process()->send(Messages::WebPage::SetWillGoToBackForwardItemCallbackEnabled(loadClient->version > 0), m_pageID);
+ m_process->send(Messages::WebPage::SetWillGoToBackForwardItemCallbackEnabled(loadClient->version > 0), m_pageID);
}
void WebPageProxy::initializePolicyClient(const WKPagePolicyClient* policyClient)
@@ -306,7 +306,7 @@ void WebPageProxy::initializeUIClient(const WKPageUIClient* client)
m_uiClient.initialize(client);
- process()->send(Messages::WebPage::SetCanRunBeforeUnloadConfirmPanel(m_uiClient.canRunBeforeUnloadConfirmPanel()), m_pageID);
+ m_process->send(Messages::WebPage::SetCanRunBeforeUnloadConfirmPanel(m_uiClient.canRunBeforeUnloadConfirmPanel()), m_pageID);
setCanRunModal(m_uiClient.canRunModal());
}
@@ -329,7 +329,7 @@ void WebPageProxy::reattachToWebProcess()
m_isValid = true;
m_process = m_process->context()->relaunchProcessIfNecessary();
- process()->addExistingWebPage(this, m_pageID);
+ m_process->addExistingWebPage(this, m_pageID);
initializeWebPage();
@@ -347,8 +347,8 @@ void WebPageProxy::reattachToWebProcessWithItem(WebBackForwardListItem* item)
if (!item)
return;
- process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
- process()->responsivenessTimer()->start();
+ m_process->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
+ m_process->responsivenessTimer()->start();
}
void WebPageProxy::initializeWebPage()
@@ -357,7 +357,7 @@ void WebPageProxy::initializeWebPage()
BackForwardListItemVector items = m_backForwardList->entries();
for (size_t i = 0; i < items.size(); ++i)
- process()->registerNewWebBackForwardListItem(items[i].get());
+ m_process->registerNewWebBackForwardListItem(items[i].get());
m_drawingArea = m_pageClient->createDrawingAreaProxy();
ASSERT(m_drawingArea);
@@ -367,10 +367,10 @@ void WebPageProxy::initializeWebPage()
inspector()->enableRemoteInspection();
#endif
- process()->send(Messages::WebProcess::CreateWebPage(m_pageID, creationParameters()), 0);
+ m_process->send(Messages::WebProcess::CreateWebPage(m_pageID, creationParameters()), 0);
#if ENABLE(PAGE_VISIBILITY_API)
- process()->send(Messages::WebPage::SetVisibilityState(m_visibilityState, /* isInitialState */ true), m_pageID);
+ m_process->send(Messages::WebPage::SetVisibilityState(m_visibilityState, /* isInitialState */ true), m_pageID);
#endif
}
@@ -384,7 +384,7 @@ void WebPageProxy::close()
m_backForwardList->pageClosed();
m_pageClient->pageClosed();
- process()->disconnectFramesFromPage(this);
+ m_process->disconnectFramesFromPage(this);
m_mainFrame = 0;
#if ENABLE(INSPECTOR)
@@ -455,8 +455,8 @@ void WebPageProxy::close()
m_drawingArea = nullptr;
- process()->send(Messages::WebPage::Close(), m_pageID);
- process()->removeWebPage(m_pageID);
+ m_process->send(Messages::WebPage::Close(), m_pageID);
+ m_process->removeWebPage(m_pageID);
}
bool WebPageProxy::tryClose()
@@ -464,8 +464,8 @@ bool WebPageProxy::tryClose()
if (!isValid())
return true;
- process()->send(Messages::WebPage::TryClose(), m_pageID);
- process()->responsivenessTimer()->start();
+ m_process->send(Messages::WebPage::TryClose(), m_pageID);
+ m_process->responsivenessTimer()->start();
return false;
}
@@ -494,9 +494,9 @@ void WebPageProxy::loadURL(const String& url)
SandboxExtension::Handle sandboxExtensionHandle;
bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), url), sandboxExtensionHandle);
if (createdExtension)
- process()->willAcquireUniversalFileReadSandboxExtension();
- process()->send(Messages::WebPage::LoadURL(url, sandboxExtensionHandle), m_pageID);
- process()->responsivenessTimer()->start();
+ m_process->willAcquireUniversalFileReadSandboxExtension();
+ m_process->send(Messages::WebPage::LoadURL(url, sandboxExtensionHandle), m_pageID);
+ m_process->responsivenessTimer()->start();
}
void WebPageProxy::loadURLRequest(WebURLRequest* urlRequest)
@@ -509,9 +509,9 @@ void WebPageProxy::loadURLRequest(WebURLRequest* urlRequest)
SandboxExtension::Handle sandboxExtensionHandle;
bool createdExtension = maybeInitializeSandboxExtensionHandle(urlRequest->resourceRequest().url(), sandboxExtensionHandle);
if (createdExtension)
- process()->willAcquireUniversalFileReadSandboxExtension();
- process()->send(Messages::WebPage::LoadURLRequest(urlRequest->resourceRequest(), sandboxExtensionHandle), m_pageID);
- process()->responsivenessTimer()->start();
+ m_process->willAcquireUniversalFileReadSandboxExtension();
+ m_process->send(Messages::WebPage::LoadURLRequest(urlRequest->resourceRequest(), sandboxExtensionHandle), m_pageID);
+ m_process->responsivenessTimer()->start();
}
void WebPageProxy::loadHTMLString(const String& htmlString, const String& baseURL)
@@ -519,9 +519,9 @@ void WebPageProxy::loadHTMLString(const String& htmlString, const String& baseUR
if (!isValid())
reattachToWebProcess();
- process()->assumeReadAccessToBaseURL(baseURL);
- process()->send(Messages::WebPage::LoadHTMLString(htmlString, baseURL), m_pageID);
- process()->responsivenessTimer()->start();
+ m_process->assumeReadAccessToBaseURL(baseURL);
+ m_process->send(Messages::WebPage::LoadHTMLString(htmlString, baseURL), m_pageID);
+ m_process->responsivenessTimer()->start();
}
void WebPageProxy::loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL)
@@ -532,9 +532,9 @@ void WebPageProxy::loadAlternateHTMLString(const String& htmlString, const Strin
if (m_mainFrame)
m_mainFrame->setUnreachableURL(unreachableURL);
- process()->assumeReadAccessToBaseURL(baseURL);
- process()->send(Messages::WebPage::LoadAlternateHTMLString(htmlString, baseURL, unreachableURL), m_pageID);
- process()->responsivenessTimer()->start();
+ m_process->assumeReadAccessToBaseURL(baseURL);
+ m_process->send(Messages::WebPage::LoadAlternateHTMLString(htmlString, baseURL, unreachableURL), m_pageID);
+ m_process->responsivenessTimer()->start();
}
void WebPageProxy::loadPlainTextString(const String& string)
@@ -542,8 +542,8 @@ void WebPageProxy::loadPlainTextString(const String& string)
if (!isValid())
reattachToWebProcess();
- process()->send(Messages::WebPage::LoadPlainTextString(string), m_pageID);
- process()->responsivenessTimer()->start();
+ m_process->send(Messages::WebPage::LoadPlainTextString(string), m_pageID);
+ m_process->responsivenessTimer()->start();
}
void WebPageProxy::loadWebArchiveData(const WebData* webArchiveData)
@@ -551,8 +551,8 @@ void WebPageProxy::loadWebArchiveData(const WebData* webArchiveData)
if (!isValid())
reattachToWebProcess();
- process()->send(Messages::WebPage::LoadWebArchiveData(webArchiveData->dataReference()), m_pageID);
- process()->responsivenessTimer()->start();
+ m_process->send(Messages::WebPage::LoadWebArchiveData(webArchiveData->dataReference()), m_pageID);
+ m_process->responsivenessTimer()->start();
}
void WebPageProxy::stopLoading()
@@ -560,8 +560,8 @@ void WebPageProxy::stopLoading()
if (!isValid())
return;
- process()->send(Messages::WebPage::StopLoading(), m_pageID);
- process()->responsivenessTimer()->start();
+ m_process->send(Messages::WebPage::StopLoading(), m_pageID);
+ m_process->responsivenessTimer()->start();
}
void WebPageProxy::reload(bool reloadFromOrigin)
@@ -575,7 +575,7 @@ void WebPageProxy::reload(bool reloadFromOrigin)
// We may not have an extension yet if back/forward list was reinstated after a WebProcess crash or a browser relaunch
bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), url), sandboxExtensionHandle);
if (createdExtension)
- process()->willAcquireUniversalFileReadSandboxExtension();
+ m_process->willAcquireUniversalFileReadSandboxExtension();
}
if (!isValid()) {
@@ -583,8 +583,8 @@ void WebPageProxy::reload(bool reloadFromOrigin)
return;
}
- process()->send(Messages::WebPage::Reload(reloadFromOrigin, sandboxExtensionHandle), m_pageID);
- process()->responsivenessTimer()->start();
+ m_process->send(Messages::WebPage::Reload(reloadFromOrigin, sandboxExtensionHandle), m_pageID);
+ m_process->responsivenessTimer()->start();
}
void WebPageProxy::goForward()
@@ -603,8 +603,8 @@ void WebPageProxy::goForward()
return;
}
- process()->send(Messages::WebPage::GoForward(forwardItem->itemID()), m_pageID);
- process()->responsivenessTimer()->start();
+ m_process->send(Messages::WebPage::GoForward(forwardItem->itemID()), m_pageID);
+ m_process->responsivenessTimer()->start();
}
bool WebPageProxy::canGoForward() const
@@ -628,8 +628,8 @@ void WebPageProxy::goBack()
return;
}
- process()->send(Messages::WebPage::GoBack(backItem->itemID()), m_pageID);
- process()->responsivenessTimer()->start();
+ m_process->send(Messages::WebPage::GoBack(backItem->itemID()), m_pageID);
+ m_process->responsivenessTimer()->start();
}
bool WebPageProxy::canGoBack() const
@@ -646,8 +646,8 @@ void WebPageProxy::goToBackForwardItem(WebBackForwardListItem* item)
setPendingAPIRequestURL(item->url());
- process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
- process()->responsivenessTimer()->start();
+ m_process->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
+ m_process->responsivenessTimer()->start();
}
void WebPageProxy::tryRestoreScrollPosition()
@@ -655,7 +655,7 @@ void WebPageProxy::tryRestoreScrollPosition()
if (!isValid())
return;
- process()->send(Messages::WebPage::TryRestoreScrollPosition(), m_pageID);
+ m_process->send(Messages::WebPage::TryRestoreScrollPosition(), m_pageID);
}
void WebPageProxy::didChangeBackForwardList(WebBackForwardListItem* added, Vector<RefPtr<APIObject> >* removed)
@@ -665,7 +665,7 @@ void WebPageProxy::didChangeBackForwardList(WebBackForwardListItem* added, Vecto
void WebPageProxy::shouldGoToBackForwardListItem(uint64_t itemID, bool& shouldGoToBackForwardItem)
{
- WebBackForwardListItem* item = process()->webBackForwardItem(itemID);
+ WebBackForwardListItem* item = m_process->webBackForwardItem(itemID);
shouldGoToBackForwardItem = item && m_loaderClient.shouldGoToBackForwardListItem(this, item);
}
@@ -676,7 +676,7 @@ void WebPageProxy::willGoToBackForwardListItem(uint64_t itemID, CoreIPC::Argumen
if (!arguments->decode(messageDecoder))
return;
- if (WebBackForwardListItem* item = process()->webBackForwardItem(itemID))
+ if (WebBackForwardListItem* item = m_process->webBackForwardItem(itemID))
m_loaderClient.willGoToBackForwardListItem(this, item, userData.get());
}
@@ -748,7 +748,7 @@ void WebPageProxy::setDrawsBackground(bool drawsBackground)
m_drawsBackground = drawsBackground;
if (isValid())
- process()->send(Messages::WebPage::SetDrawsBackground(drawsBackground), m_pageID);
+ m_process->send(Messages::WebPage::SetDrawsBackground(drawsBackground), m_pageID);
}
void WebPageProxy::setDrawsTransparentBackground(bool drawsTransparentBackground)
@@ -759,21 +759,21 @@ void WebPageProxy::setDrawsTransparentBackground(bool drawsTransparentBackground
m_drawsTransparentBackground = drawsTransparentBackground;
if (isValid())
- process()->send(Messages::WebPage::SetDrawsTransparentBackground(drawsTransparentBackground), m_pageID);
+ m_process->send(Messages::WebPage::SetDrawsTransparentBackground(drawsTransparentBackground), m_pageID);
}
void WebPageProxy::viewWillStartLiveResize()
{
if (!isValid())
return;
- process()->send(Messages::WebPage::ViewWillStartLiveResize(), m_pageID);
+ m_process->send(Messages::WebPage::ViewWillStartLiveResize(), m_pageID);
}
void WebPageProxy::viewWillEndLiveResize()
{
if (!isValid())
return;
- process()->send(Messages::WebPage::ViewWillEndLiveResize(), m_pageID);
+ m_process->send(Messages::WebPage::ViewWillEndLiveResize(), m_pageID);
}
void WebPageProxy::setViewNeedsDisplay(const IntRect& rect)
@@ -797,10 +797,10 @@ void WebPageProxy::viewStateDidChange(ViewStateFlags flags)
return;
if (flags & ViewIsFocused)
- process()->send(Messages::WebPage::SetFocused(m_pageClient->isViewFocused()), m_pageID);
+ m_process->send(Messages::WebPage::SetFocused(m_pageClient->isViewFocused()), m_pageID);
if (flags & ViewWindowIsActive)
- process()->send(Messages::WebPage::SetActive(m_pageClient->isViewWindowActive()), m_pageID);
+ m_process->send(Messages::WebPage::SetActive(m_pageClient->isViewWindowActive()), m_pageID);
if (flags & ViewIsVisible) {
bool isVisible = m_pageClient->isViewVisible();
@@ -812,7 +812,7 @@ void WebPageProxy::viewStateDidChange(ViewStateFlags flags)
// If we've started the responsiveness timer as part of telling the web process to update the backing store
// state, it might not send back a reply (since it won't paint anything if the web page is hidden) so we
// stop the unresponsiveness timer here.
- process()->responsivenessTimer()->stop();
+ m_process->responsivenessTimer()->stop();
}
}
}
@@ -821,7 +821,7 @@ void WebPageProxy::viewStateDidChange(ViewStateFlags flags)
bool isInWindow = m_pageClient->isViewInWindow();
if (m_isInWindow != isInWindow) {
m_isInWindow = isInWindow;
- process()->send(Messages::WebPage::SetIsInWindow(isInWindow), m_pageID);
+ m_process->send(Messages::WebPage::SetIsInWindow(isInWindow), m_pageID);
}
if (isInWindow) {
@@ -841,7 +841,7 @@ void WebPageProxy::viewStateDidChange(ViewStateFlags flags)
if (visibilityState != m_visibilityState) {
m_visibilityState = visibilityState;
- process()->send(Messages::WebPage::SetVisibilityState(visibilityState, false), m_pageID);
+ m_process->send(Messages::WebPage::SetVisibilityState(visibilityState, false), m_pageID);
}
#endif
@@ -857,21 +857,21 @@ void WebPageProxy::setInitialFocus(bool forward, bool isKeyboardEventValid, cons
{
if (!isValid())
return;
- process()->send(Messages::WebPage::SetInitialFocus(forward, isKeyboardEventValid, keyboardEvent), m_pageID);
+ m_process->send(Messages::WebPage::SetInitialFocus(forward, isKeyboardEventValid, keyboardEvent), m_pageID);
}
void WebPageProxy::setWindowResizerSize(const IntSize& windowResizerSize)
{
if (!isValid())
return;
- process()->send(Messages::WebPage::SetWindowResizerSize(windowResizerSize), m_pageID);
+ m_process->send(Messages::WebPage::SetWindowResizerSize(windowResizerSize), m_pageID);
}
void WebPageProxy::clearSelection()
{
if (!isValid())
return;
- process()->send(Messages::WebPage::ClearSelection(), m_pageID);
+ m_process->send(Messages::WebPage::ClearSelection(), m_pageID);
}
void WebPageProxy::validateCommand(const String& commandName, PassRefPtr<ValidateCommandCallback> callback)
@@ -883,7 +883,7 @@ void WebPageProxy::validateCommand(const String& commandName, PassRefPtr<Validat
uint64_t callbackID = callback->callbackID();
m_validateCommandCallbacks.set(callbackID, callback.get());
- process()->send(Messages::WebPage::ValidateCommand(commandName, callbackID), m_pageID);
+ m_process->send(Messages::WebPage::ValidateCommand(commandName, callbackID), m_pageID);
}
void WebPageProxy::setMaintainsInactiveSelection(bool newValue)
@@ -900,7 +900,7 @@ void WebPageProxy::executeEditCommand(const String& commandName)
if (commandName == ignoreSpellingCommandName)
++m_pendingLearnOrIgnoreWordMessageCount;
- process()->send(Messages::WebPage::ExecuteEditCommand(commandName), m_pageID);
+ m_process->send(Messages::WebPage::ExecuteEditCommand(commandName), m_pageID);
}
#if USE(TILED_BACKING_STORE)
@@ -909,7 +909,7 @@ void WebPageProxy::setViewportSize(const IntSize& size)
if (!isValid())
return;
- process()->send(Messages::WebPage::SetViewportSize(size), m_pageID);
+ m_process->send(Messages::WebPage::SetViewportSize(size), m_pageID);
}
#endif
@@ -946,12 +946,12 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag
return;
#if PLATFORM(WIN)
// FIXME: We should pass the drag data map only on DragEnter.
- process()->send(Messages::WebPage::PerformDragControllerAction(action, dragData->clientPosition(), dragData->globalPosition(),
+ m_process->send(Messages::WebPage::PerformDragControllerAction(action, dragData->clientPosition(), dragData->globalPosition(),
dragData->draggingSourceOperationMask(), dragData->dragDataMap(), dragData->flags()), m_pageID);
#elif PLATFORM(QT) || PLATFORM(GTK)
- process()->send(Messages::WebPage::PerformDragControllerAction(action, *dragData), m_pageID);
+ m_process->send(Messages::WebPage::PerformDragControllerAction(action, *dragData), m_pageID);
#else
- process()->send(Messages::WebPage::PerformDragControllerAction(action, dragData->clientPosition(), dragData->globalPosition(), dragData->draggingSourceOperationMask(), dragStorageName, dragData->flags(), sandboxExtensionHandle, sandboxExtensionsForUpload), m_pageID);
+ m_process->send(Messages::WebPage::PerformDragControllerAction(action, dragData->clientPosition(), dragData->globalPosition(), dragData->draggingSourceOperationMask(), dragStorageName, dragData->flags(), sandboxExtensionHandle, sandboxExtensionsForUpload), m_pageID);
#endif
}
@@ -978,7 +978,7 @@ void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& glo
{
if (!isValid())
return;
- process()->send(Messages::WebPage::DragEnded(clientPosition, globalPosition, operation), m_pageID);
+ m_process->send(Messages::WebPage::DragEnded(clientPosition, globalPosition, operation), m_pageID);
}
#endif // ENABLE(DRAG_SUPPORT)
@@ -989,7 +989,7 @@ void WebPageProxy::handleMouseEvent(const NativeWebMouseEvent& event)
// NOTE: This does not start the responsiveness timer because mouse move should not indicate interaction.
if (event.type() != WebEvent::MouseMove)
- process()->responsivenessTimer()->start();
+ m_process->responsivenessTimer()->start();
else {
if (m_processingMouseMoveEvent) {
m_nextMouseMoveEvent = adoptPtr(new NativeWebMouseEvent(event));
@@ -1008,10 +1008,10 @@ void WebPageProxy::handleMouseEvent(const NativeWebMouseEvent& event)
if (m_shouldSendEventsSynchronously) {
bool handled = false;
- process()->sendSync(Messages::WebPage::MouseEventSyncForTesting(event), Messages::WebPage::MouseEventSyncForTesting::Reply(handled), m_pageID);
+ m_process->sendSync(Messages::WebPage::MouseEventSyncForTesting(event), Messages::WebPage::MouseEventSyncForTesting::Reply(handled), m_pageID);
didReceiveEvent(event.type(), handled);
} else
- process()->send(Messages::WebPage::MouseEvent(event), m_pageID);
+ m_process->send(Messages::WebPage::MouseEvent(event), m_pageID);
}
#if MERGE_WHEEL_EVENTS
@@ -1111,16 +1111,16 @@ void WebPageProxy::processNextQueuedWheelEvent()
void WebPageProxy::sendWheelEvent(const WebWheelEvent& event)
{
- process()->responsivenessTimer()->start();
+ m_process->responsivenessTimer()->start();
if (m_shouldSendEventsSynchronously) {
bool handled = false;
- process()->sendSync(Messages::WebPage::WheelEventSyncForTesting(event), Messages::WebPage::WheelEventSyncForTesting::Reply(handled), m_pageID);
+ m_process->sendSync(Messages::WebPage::WheelEventSyncForTesting(event), Messages::WebPage::WheelEventSyncForTesting::Reply(handled), m_pageID);
didReceiveEvent(event.type(), handled);
return;
}
- process()->send(Messages::EventDispatcher::WheelEvent(m_pageID, event, canGoBack(), canGoForward()), 0);
+ m_process->send(Messages::EventDispatcher::WheelEvent(m_pageID, event, canGoBack(), canGoForward()), 0);
}
void WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event)
@@ -1132,13 +1132,13 @@ void WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event)
m_keyEventQueue.append(event);
- process()->responsivenessTimer()->start();
+ m_process->responsivenessTimer()->start();
if (m_shouldSendEventsSynchronously) {
bool handled = false;
- process()->sendSync(Messages::WebPage::KeyEventSyncForTesting(event), Messages::WebPage::KeyEventSyncForTesting::Reply(handled), m_pageID);
+ m_process->sendSync(Messages::WebPage::KeyEventSyncForTesting(event), Messages::WebPage::KeyEventSyncForTesting::Reply(handled), m_pageID);
didReceiveEvent(event.type(), handled);
} else if (m_keyEventQueue.size() == 1) // Otherwise, sent from DidReceiveEvent message handler.
- process()->send(Messages::WebPage::KeyEvent(event), m_pageID);
+ m_process->send(Messages::WebPage::KeyEvent(event), m_pageID);
}
#if ENABLE(GESTURE_EVENTS)
@@ -1149,8 +1149,8 @@ void WebPageProxy::handleGestureEvent(const WebGestureEvent& event)
m_gestureEventQueue.append(event);
- process()->responsivenessTimer()->start();
- process()->send(Messages::EventDispatcher::GestureEvent(m_pageID, event), 0);
+ m_process->responsivenessTimer()->start();
+ m_process->send(Messages::EventDispatcher::GestureEvent(m_pageID, event), 0);
}
#endif
@@ -1158,7 +1158,7 @@ void WebPageProxy::handleGestureEvent(const WebGestureEvent& event)
#if PLATFORM(QT)
void WebPageProxy::handlePotentialActivation(const IntPoint& touchPoint, const IntSize& touchArea)
{
- process()->send(Messages::WebPage::HighlightPotentialActivation(touchPoint, touchArea), m_pageID);
+ m_process->send(Messages::WebPage::HighlightPotentialActivation(touchPoint, touchArea), m_pageID);
}
#endif
@@ -1172,13 +1172,13 @@ void WebPageProxy::handleTouchEvent(const NativeWebTouchEvent& event)
// we do not send any of the events to the page even if is has listeners.
if (m_needTouchEvents && !m_isPageSuspended) {
m_touchEventQueue.append(event);
- process()->responsivenessTimer()->start();
+ m_process->responsivenessTimer()->start();
if (m_shouldSendEventsSynchronously) {
bool handled = false;
- process()->sendSync(Messages::WebPage::TouchEventSyncForTesting(event), Messages::WebPage::TouchEventSyncForTesting::Reply(handled), m_pageID);
+ m_process->sendSync(Messages::WebPage::TouchEventSyncForTesting(event), Messages::WebPage::TouchEventSyncForTesting::Reply(handled), m_pageID);
didReceiveEvent(event.type(), handled);
} else
- process()->send(Messages::WebPage::TouchEvent(event), m_pageID);
+ m_process->send(Messages::WebPage::TouchEvent(event), m_pageID);
} else {
if (m_touchEventQueue.isEmpty()) {
bool isEventHandled = false;
@@ -1198,7 +1198,7 @@ void WebPageProxy::scrollBy(ScrollDirection direction, ScrollGranularity granula
if (!isValid())
return;
- process()->send(Messages::WebPage::ScrollBy(direction, granularity), m_pageID);
+ m_process->send(Messages::WebPage::ScrollBy(direction, granularity), m_pageID);
}
void WebPageProxy::centerSelectionInVisibleArea()
@@ -1206,7 +1206,7 @@ void WebPageProxy::centerSelectionInVisibleArea()
if (!isValid())
return;
- process()->send(Messages::WebPage::CenterSelectionInVisibleArea(), m_pageID);
+ m_process->send(Messages::WebPage::CenterSelectionInVisibleArea(), m_pageID);
}
void WebPageProxy::receivedPolicyDecision(PolicyAction action, WebFrameProxy* frame, uint64_t listenerID)
@@ -1246,7 +1246,7 @@ void WebPageProxy::receivedPolicyDecision(PolicyAction action, WebFrameProxy* fr
return;
}
- process()->send(Messages::WebPage::DidReceivePolicyDecision(frame->frameID(), listenerID, action, downloadID), m_pageID);
+ m_process->send(Messages::WebPage::DidReceivePolicyDecision(frame->frameID(), listenerID, action, downloadID), m_pageID);
}
String WebPageProxy::pageTitle() const
@@ -1267,7 +1267,7 @@ void WebPageProxy::setUserAgent(const String& userAgent)
if (!isValid())
return;
- process()->send(Messages::WebPage::SetUserAgent(m_userAgent), m_pageID);
+ m_process->send(Messages::WebPage::SetUserAgent(m_userAgent), m_pageID);
}
void WebPageProxy::setApplicationNameForUserAgent(const String& applicationName)
@@ -1304,7 +1304,7 @@ void WebPageProxy::resumeActiveDOMObjectsAndAnimations()
m_isPageSuspended = false;
- process()->send(Messages::WebPage::ResumeActiveDOMObjectsAndAnimations(), m_pageID);
+ m_process->send(Messages::WebPage::ResumeActiveDOMObjectsAndAnimations(), m_pageID);
}
void WebPageProxy::suspendActiveDOMObjectsAndAnimations()
@@ -1314,7 +1314,7 @@ void WebPageProxy::suspendActiveDOMObjectsAndAnimations()
m_isPageSuspended = true;
- process()->send(Messages::WebPage::SuspendActiveDOMObjectsAndAnimations(), m_pageID);
+ m_process->send(Messages::WebPage::SuspendActiveDOMObjectsAndAnimations(), m_pageID);
}
bool WebPageProxy::supportsTextEncoding() const
@@ -1330,7 +1330,7 @@ void WebPageProxy::setCustomTextEncodingName(const String& encodingName)
if (!isValid())
return;
- process()->send(Messages::WebPage::SetCustomTextEncodingName(encodingName), m_pageID);
+ m_process->send(Messages::WebPage::SetCustomTextEncodingName(encodingName), m_pageID);
}
void WebPageProxy::terminateProcess()
@@ -1340,7 +1340,7 @@ void WebPageProxy::terminateProcess()
if (!m_isValid)
return;
- process()->terminate();
+ m_process->terminate();
}
#if !USE(CF) || defined(BUILDING_QT__)
@@ -1380,7 +1380,7 @@ void WebPageProxy::setTextZoomFactor(double zoomFactor)
return;
m_textZoomFactor = zoomFactor;
- process()->send(Messages::WebPage::SetTextZoomFactor(m_textZoomFactor), m_pageID);
+ m_process->send(Messages::WebPage::SetTextZoomFactor(m_textZoomFactor), m_pageID);
}
double WebPageProxy::pageZoomFactor() const
@@ -1402,7 +1402,7 @@ void WebPageProxy::setPageZoomFactor(double zoomFactor)
return;
m_pageZoomFactor = zoomFactor;
- process()->send(Messages::WebPage::SetPageZoomFactor(m_pageZoomFactor), m_pageID);
+ m_process->send(Messages::WebPage::SetPageZoomFactor(m_pageZoomFactor), m_pageID);
}
void WebPageProxy::setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor)
@@ -1420,7 +1420,7 @@ void WebPageProxy::setPageAndTextZoomFactors(double pageZoomFactor, double textZ
m_pageZoomFactor = pageZoomFactor;
m_textZoomFactor = textZoomFactor;
- process()->send(Messages::WebPage::SetPageAndTextZoomFactors(m_pageZoomFactor, m_textZoomFactor), m_pageID);
+ m_process->send(Messages::WebPage::SetPageAndTextZoomFactors(m_pageZoomFactor, m_textZoomFactor), m_pageID);
}
void WebPageProxy::scalePage(double scale, const IntPoint& origin)
@@ -1428,7 +1428,7 @@ void WebPageProxy::scalePage(double scale, const IntPoint& origin)
if (!isValid())
return;
- process()->send(Messages::WebPage::ScalePage(scale, origin), m_pageID);
+ m_process->send(Messages::WebPage::ScalePage(scale, origin), m_pageID);
}
void WebPageProxy::setIntrinsicDeviceScaleFactor(float scaleFactor)
@@ -1447,7 +1447,7 @@ void WebPageProxy::windowScreenDidChange(PlatformDisplayID displayID)
if (!isValid())
return;
- process()->send(Messages::WebPage::WindowScreenDidChange(displayID), m_pageID);
+ m_process->send(Messages::WebPage::WindowScreenDidChange(displayID), m_pageID);
}
float WebPageProxy::deviceScaleFactor() const
@@ -1486,7 +1486,7 @@ void WebPageProxy::setUseFixedLayout(bool fixed)
m_useFixedLayout = fixed;
if (!fixed)
m_fixedLayoutSize = IntSize();
- process()->send(Messages::WebPage::SetUseFixedLayout(fixed), m_pageID);
+ m_process->send(Messages::WebPage::SetUseFixedLayout(fixed), m_pageID);
}
void WebPageProxy::setFixedLayoutSize(const IntSize& size)
@@ -1498,7 +1498,7 @@ void WebPageProxy::setFixedLayoutSize(const IntSize& size)
return;
m_fixedLayoutSize = size;
- process()->send(Messages::WebPage::SetFixedLayoutSize(size), m_pageID);
+ m_process->send(Messages::WebPage::SetFixedLayoutSize(size), m_pageID);
}
void WebPageProxy::setPaginationMode(WebCore::Page::Pagination::Mode mode)
@@ -1510,7 +1510,7 @@ void WebPageProxy::setPaginationMode(WebCore::Page::Pagination::Mode mode)
if (!isValid())
return;
- process()->send(Messages::WebPage::SetPaginationMode(mode), m_pageID);
+ m_process->send(Messages::WebPage::SetPaginationMode(mode), m_pageID);
}
void WebPageProxy::setPaginationBehavesLikeColumns(bool behavesLikeColumns)
@@ -1522,7 +1522,7 @@ void WebPageProxy::setPaginationBehavesLikeColumns(bool behavesLikeColumns)
if (!isValid())
return;
- process()->send(Messages::WebPage::SetPaginationBehavesLikeColumns(behavesLikeColumns), m_pageID);
+ m_process->send(Messages::WebPage::SetPaginationBehavesLikeColumns(behavesLikeColumns), m_pageID);
}
void WebPageProxy::setPageLength(double pageLength)
@@ -1534,7 +1534,7 @@ void WebPageProxy::setPageLength(double pageLength)
if (!isValid())
return;
- process()->send(Messages::WebPage::SetPageLength(pageLength), m_pageID);
+ m_process->send(Messages::WebPage::SetPageLength(pageLength), m_pageID);
}
void WebPageProxy::setGapBetweenPages(double gap)
@@ -1546,7 +1546,7 @@ void WebPageProxy::setGapBetweenPages(double gap)
if (!isValid())
return;
- process()->send(Messages::WebPage::SetGapBetweenPages(gap), m_pageID);
+ m_process->send(Messages::WebPage::SetGapBetweenPages(gap), m_pageID);
}
void WebPageProxy::pageScaleFactorDidChange(double scaleFactor)
@@ -1563,7 +1563,7 @@ void WebPageProxy::setMemoryCacheClientCallsEnabled(bool memoryCacheClientCallsE
return;
m_areMemoryCacheClientCallsEnabled = memoryCacheClientCallsEnabled;
- process()->send(Messages::WebPage::SetMemoryCacheMessagesEnabled(memoryCacheClientCallsEnabled), m_pageID);
+ m_process->send(Messages::WebPage::SetMemoryCacheMessagesEnabled(memoryCacheClientCallsEnabled), m_pageID);
}
void WebPageProxy::findString(const String& string, FindOptions options, unsigned maxMatchCount)
@@ -1571,12 +1571,12 @@ void WebPageProxy::findString(const String& string, FindOptions options, unsigne
if (m_mainFrameHasCustomRepresentation)
m_pageClient->findStringInCustomRepresentation(string, options, maxMatchCount);
else
- process()->send(Messages::WebPage::FindString(string, options, maxMatchCount), m_pageID);
+ m_process->send(Messages::WebPage::FindString(string, options, maxMatchCount), m_pageID);
}
void WebPageProxy::hideFindUI()
{
- process()->send(Messages::WebPage::HideFindUI(), m_pageID);
+ m_process->send(Messages::WebPage::HideFindUI(), m_pageID);
}
void WebPageProxy::countStringMatches(const String& string, FindOptions options, unsigned maxMatchCount)
@@ -1589,7 +1589,7 @@ void WebPageProxy::countStringMatches(const String& string, FindOptions options,
if (!isValid())
return;
- process()->send(Messages::WebPage::CountStringMatches(string, options, maxMatchCount), m_pageID);
+ m_process->send(Messages::WebPage::CountStringMatches(string, options, maxMatchCount), m_pageID);
}
void WebPageProxy::runJavaScriptInMainFrame(const String& script, PassRefPtr<ScriptValueCallback> prpCallback)
@@ -1602,7 +1602,7 @@ void WebPageProxy::runJavaScriptInMainFrame(const String& script, PassRefPtr<Scr
uint64_t callbackID = callback->callbackID();
m_scriptValueCallbacks.set(callbackID, callback.get());
- process()->send(Messages::WebPage::RunJavaScriptInMainFrame(script, callbackID), m_pageID);
+ m_process->send(Messages::WebPage::RunJavaScriptInMainFrame(script, callbackID), m_pageID);
}
void WebPageProxy::getRenderTreeExternalRepresentation(PassRefPtr<StringCallback> prpCallback)
@@ -1615,7 +1615,7 @@ void WebPageProxy::getRenderTreeExternalRepresentation(PassRefPtr<StringCallback
uint64_t callbackID = callback->callbackID();
m_stringCallbacks.set(callbackID, callback.get());
- process()->send(Messages::WebPage::GetRenderTreeExternalRepresentation(callbackID), m_pageID);
+ m_process->send(Messages::WebPage::GetRenderTreeExternalRepresentation(callbackID), m_pageID);
}
void WebPageProxy::getSourceForFrame(WebFrameProxy* frame, PassRefPtr<StringCallback> prpCallback)
@@ -1629,7 +1629,7 @@ void WebPageProxy::getSourceForFrame(WebFrameProxy* frame, PassRefPtr<StringCall
uint64_t callbackID = callback->callbackID();
m_loadDependentStringCallbackIDs.add(callbackID);
m_stringCallbacks.set(callbackID, callback.get());
- process()->send(Messages::WebPage::GetSourceForFrame(frame->frameID(), callbackID), m_pageID);
+ m_process->send(Messages::WebPage::GetSourceForFrame(frame->frameID(), callbackID), m_pageID);
}
#if ENABLE(WEB_INTENTS)
@@ -1638,7 +1638,7 @@ void WebPageProxy::deliverIntentToFrame(WebFrameProxy* frame, WebIntentData* web
if (!isValid())
return;
- process()->send(Messages::WebPage::DeliverIntentToFrame(frame->frameID(), webIntentData->store()), m_pageID);
+ m_process->send(Messages::WebPage::DeliverIntentToFrame(frame->frameID(), webIntentData->store()), m_pageID);
}
#endif
@@ -1653,7 +1653,7 @@ void WebPageProxy::getContentsAsString(PassRefPtr<StringCallback> prpCallback)
uint64_t callbackID = callback->callbackID();
m_loadDependentStringCallbackIDs.add(callbackID);
m_stringCallbacks.set(callbackID, callback.get());
- process()->send(Messages::WebPage::GetContentsAsString(callbackID), m_pageID);
+ m_process->send(Messages::WebPage::GetContentsAsString(callbackID), m_pageID);
}
#if ENABLE(MHTML)
@@ -1667,7 +1667,7 @@ void WebPageProxy::getContentsAsMHTMLData(PassRefPtr<DataCallback> prpCallback,
uint64_t callbackID = callback->callbackID();
m_dataCallbacks.set(callbackID, callback.get());
- process()->send(Messages::WebPage::GetContentsAsMHTMLData(callbackID, useBinaryEncoding), m_pageID);
+ m_process->send(Messages::WebPage::GetContentsAsMHTMLData(callbackID, useBinaryEncoding), m_pageID);
}
#endif
@@ -1681,7 +1681,7 @@ void WebPageProxy::getSelectionOrContentsAsString(PassRefPtr<StringCallback> prp
uint64_t callbackID = callback->callbackID();
m_stringCallbacks.set(callbackID, callback.get());
- process()->send(Messages::WebPage::GetSelectionOrContentsAsString(callbackID), m_pageID);
+ m_process->send(Messages::WebPage::GetSelectionOrContentsAsString(callbackID), m_pageID);
}
void WebPageProxy::getMainResourceDataOfFrame(WebFrameProxy* frame, PassRefPtr<DataCallback> prpCallback)
@@ -1694,7 +1694,7 @@ void WebPageProxy::getMainResourceDataOfFrame(WebFrameProxy* frame, PassRefPtr<D
uint64_t callbackID = callback->callbackID();
m_dataCallbacks.set(callbackID, callback.get());
- process()->send(Messages::WebPage::GetMainResourceDataOfFrame(frame->frameID(), callbackID), m_pageID);
+ m_process->send(Messages::WebPage::GetMainResourceDataOfFrame(frame->frameID(), callbackID), m_pageID);
}
void WebPageProxy::getResourceDataFromFrame(WebFrameProxy* frame, WebURL* resourceURL, PassRefPtr<DataCallback> prpCallback)
@@ -1707,7 +1707,7 @@ void WebPageProxy::getResourceDataFromFrame(WebFrameProxy* frame, WebURL* resour
uint64_t callbackID = callback->callbackID();
m_dataCallbacks.set(callbackID, callback.get());
- process()->send(Messages::WebPage::GetResourceDataFromFrame(frame->frameID(), resourceURL->string(), callbackID), m_pageID);
+ m_process->send(Messages::WebPage::GetResourceDataFromFrame(frame->frameID(), resourceURL->string(), callbackID), m_pageID);
}
void WebPageProxy::getWebArchiveOfFrame(WebFrameProxy* frame, PassRefPtr<DataCallback> prpCallback)
@@ -1720,7 +1720,7 @@ void WebPageProxy::getWebArchiveOfFrame(WebFrameProxy* frame, PassRefPtr<DataCal
uint64_t callbackID = callback->callbackID();
m_dataCallbacks.set(callbackID, callback.get());
- process()->send(Messages::WebPage::GetWebArchiveOfFrame(frame->frameID(), callbackID), m_pageID);
+ m_process->send(Messages::WebPage::GetWebArchiveOfFrame(frame->frameID(), callbackID), m_pageID);
}
void WebPageProxy::forceRepaint(PassRefPtr<VoidCallback> prpCallback)
@@ -1734,7 +1734,7 @@ void WebPageProxy::forceRepaint(PassRefPtr<VoidCallback> prpCallback)
uint64_t callbackID = callback->callbackID();
m_voidCallbacks.set(callbackID, callback.get());
m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
- process()->send(Messages::WebPage::ForceRepaint(callbackID), m_pageID);
+ m_process->send(Messages::WebPage::ForceRepaint(callbackID), m_pageID);
}
void WebPageProxy::preferencesDidChange()
@@ -1752,7 +1752,7 @@ void WebPageProxy::preferencesDidChange()
// even if nothing changed in UI process, so that overrides get removed.
// Preferences need to be updated during synchronous printing to make "print backgrounds" preference work when toggled from a print dialog checkbox.
- process()->send(Messages::WebPage::PreferencesDidChange(pageGroup()->preferences()->store()), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
+ m_process->send(Messages::WebPage::PreferencesDidChange(pageGroup()->preferences()->store()), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
}
void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
@@ -1811,28 +1811,28 @@ void WebPageProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIP
void WebPageProxy::didCreateMainFrame(uint64_t frameID)
{
MESSAGE_CHECK(!m_mainFrame);
- MESSAGE_CHECK(process()->canCreateFrame(frameID));
+ MESSAGE_CHECK(m_process->canCreateFrame(frameID));
m_mainFrame = WebFrameProxy::create(this, frameID);
// Add the frame to the process wide map.
- process()->frameCreated(frameID, m_mainFrame.get());
+ m_process->frameCreated(frameID, m_mainFrame.get());
}
void WebPageProxy::didCreateSubframe(uint64_t frameID, uint64_t parentFrameID)
{
MESSAGE_CHECK(m_mainFrame);
- WebFrameProxy* parentFrame = process()->webFrame(parentFrameID);
+ WebFrameProxy* parentFrame = m_process->webFrame(parentFrameID);
MESSAGE_CHECK(parentFrame);
MESSAGE_CHECK(parentFrame->isDescendantOf(m_mainFrame.get()));
- MESSAGE_CHECK(process()->canCreateFrame(frameID));
+ MESSAGE_CHECK(m_process->canCreateFrame(frameID));
RefPtr<WebFrameProxy> subFrame = WebFrameProxy::create(this, frameID);
// Add the frame to the process wide map.
- process()->frameCreated(frameID, subFrame.get());
+ m_process->frameCreated(frameID, subFrame.get());
// Insert the frame into the frame hierarchy.
parentFrame->appendChild(subFrame.get());
@@ -1847,7 +1847,7 @@ void WebPageProxy::didSaveFrameToPageCache(uint64_t frameID)
{
MESSAGE_CHECK(m_mainFrame);
- WebFrameProxy* subframe = process()->webFrame(frameID);
+ WebFrameProxy* subframe = m_process->webFrame(frameID);
MESSAGE_CHECK(subframe);
if (isDisconnectedFrame(subframe))
@@ -1862,12 +1862,12 @@ void WebPageProxy::didRestoreFrameFromPageCache(uint64_t frameID, uint64_t paren
{
MESSAGE_CHECK(m_mainFrame);
- WebFrameProxy* subframe = process()->webFrame(frameID);
+ WebFrameProxy* subframe = m_process->webFrame(frameID);
MESSAGE_CHECK(subframe);
MESSAGE_CHECK(!subframe->parentFrame());
MESSAGE_CHECK(subframe->page() == m_mainFrame->page());
- WebFrameProxy* parentFrame = process()->webFrame(parentFrameID);
+ WebFrameProxy* parentFrame = m_process->webFrame(parentFrameID);
MESSAGE_CHECK(parentFrame);
MESSAGE_CHECK(parentFrame->isDescendantOf(m_mainFrame.get()));
@@ -1917,7 +1917,7 @@ void WebPageProxy::registerIntentServiceForFrame(uint64_t frameID, const IntentS
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
RefPtr<WebIntentServiceInfo> webIntentServiceInfo = WebIntentServiceInfo::create(serviceInfo);
@@ -1934,7 +1934,7 @@ void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, const Strin
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
MESSAGE_CHECK_URL(url);
@@ -1951,7 +1951,7 @@ void WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t f
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
MESSAGE_CHECK_URL(url);
@@ -1967,7 +1967,7 @@ void WebPageProxy::didFailProvisionalLoadForFrame(uint64_t frameID, const Resour
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
frame->didFailProvisionalLoad();
@@ -1995,7 +1995,7 @@ void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, const String& mimeTyp
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
#if PLATFORM(MAC)
@@ -2035,7 +2035,7 @@ void WebPageProxy::didFinishDocumentLoadForFrame(uint64_t frameID, CoreIPC::Argu
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
m_loaderClient.didFinishDocumentLoadForFrame(this, frame, userData.get());
@@ -2048,7 +2048,7 @@ void WebPageProxy::didFinishLoadForFrame(uint64_t frameID, CoreIPC::ArgumentDeco
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
frame->didFinishLoad();
@@ -2063,7 +2063,7 @@ void WebPageProxy::didFailLoadForFrame(uint64_t frameID, const ResourceError& er
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
clearLoadDependentCallbacks();
@@ -2080,7 +2080,7 @@ void WebPageProxy::didSameDocumentNavigationForFrame(uint64_t frameID, uint32_t
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
MESSAGE_CHECK_URL(url);
@@ -2097,7 +2097,7 @@ void WebPageProxy::didReceiveTitleForFrame(uint64_t frameID, const String& title
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
frame->didChangeTitle(title);
@@ -2112,7 +2112,7 @@ void WebPageProxy::didFirstLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDec
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
m_loaderClient.didFirstLayoutForFrame(this, frame, userData.get());
@@ -2125,7 +2125,7 @@ void WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, Core
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
m_loaderClient.didFirstVisuallyNonEmptyLayoutForFrame(this, frame, userData.get());
@@ -2148,7 +2148,7 @@ void WebPageProxy::didRemoveFrameFromHierarchy(uint64_t frameID, CoreIPC::Argume
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
frame->didRemoveFromHierarchy();
@@ -2163,7 +2163,7 @@ void WebPageProxy::didDisplayInsecureContentForFrame(uint64_t frameID, CoreIPC::
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
m_loaderClient.didDisplayInsecureContentForFrame(this, frame, userData.get());
@@ -2176,7 +2176,7 @@ void WebPageProxy::didRunInsecureContentForFrame(uint64_t frameID, CoreIPC::Argu
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
m_loaderClient.didRunInsecureContentForFrame(this, frame, userData.get());
@@ -2189,7 +2189,7 @@ void WebPageProxy::didDetectXSSForFrame(uint64_t frameID, CoreIPC::ArgumentDecod
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
m_loaderClient.didDetectXSSForFrame(this, frame, userData.get());
@@ -2203,17 +2203,17 @@ void WebPageProxy::didReceiveIntentForFrame(uint64_t frameID, const IntentData&
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
- RefPtr<WebIntentData> webIntentData = WebIntentData::create(intentData);
+ RefPtr<WebIntentData> webIntentData = WebIntentData::create(intentData, m_process.get());
m_loaderClient.didReceiveIntentForFrame(this, frame, webIntentData.get(), userData.get());
}
#endif
void WebPageProxy::frameDidBecomeFrameSet(uint64_t frameID, bool value)
{
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
frame->setIsFrameSet(value);
@@ -2232,7 +2232,7 @@ void WebPageProxy::decidePolicyForNavigationAction(uint64_t frameID, uint32_t op
if (request.url() != pendingAPIRequestURL())
clearPendingAPIRequestURL();
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
MESSAGE_CHECK_URL(request.url());
@@ -2267,7 +2267,7 @@ void WebPageProxy::decidePolicyForNewWindowAction(uint64_t frameID, uint32_t opa
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
MESSAGE_CHECK_URL(request.url());
@@ -2287,7 +2287,7 @@ void WebPageProxy::decidePolicyForResponse(uint64_t frameID, const ResourceRespo
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
MESSAGE_CHECK_URL(request.url());
MESSAGE_CHECK_URL(response.url());
@@ -2319,7 +2319,7 @@ void WebPageProxy::unableToImplementPolicy(uint64_t frameID, const ResourceError
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
m_policyClient.unableToImplementPolicy(this, frame, error, userData.get());
@@ -2334,10 +2334,10 @@ void WebPageProxy::willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, cons
if (!arguments->decode(messageDecoder))
return;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
- WebFrameProxy* sourceFrame = process()->webFrame(sourceFrameID);
+ WebFrameProxy* sourceFrame = m_process->webFrame(sourceFrameID);
MESSAGE_CHECK(sourceFrame);
RefPtr<WebFormSubmissionListenerProxy> listener = frame->setUpFormSubmissionListenerProxy(listenerID);
@@ -2349,7 +2349,7 @@ void WebPageProxy::willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, cons
void WebPageProxy::didInitiateLoadForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceRequest& request, bool pageIsProvisionallyLoading)
{
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
MESSAGE_CHECK_URL(request.url());
@@ -2358,7 +2358,7 @@ void WebPageProxy::didInitiateLoadForResource(uint64_t frameID, uint64_t resourc
void WebPageProxy::didSendRequestForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceRequest& request, const ResourceResponse& redirectResponse)
{
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
MESSAGE_CHECK_URL(request.url());
@@ -2367,7 +2367,7 @@ void WebPageProxy::didSendRequestForResource(uint64_t frameID, uint64_t resource
void WebPageProxy::didReceiveResponseForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceResponse& response)
{
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
MESSAGE_CHECK_URL(response.url());
@@ -2376,7 +2376,7 @@ void WebPageProxy::didReceiveResponseForResource(uint64_t frameID, uint64_t reso
void WebPageProxy::didReceiveContentLengthForResource(uint64_t frameID, uint64_t resourceIdentifier, uint64_t contentLength)
{
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
m_resourceLoadClient.didReceiveContentLengthForResource(this, frame, resourceIdentifier, contentLength);
@@ -2384,7 +2384,7 @@ void WebPageProxy::didReceiveContentLengthForResource(uint64_t frameID, uint64_t
void WebPageProxy::didFinishLoadForResource(uint64_t frameID, uint64_t resourceIdentifier)
{
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
m_resourceLoadClient.didFinishLoadForResource(this, frame, resourceIdentifier);
@@ -2392,7 +2392,7 @@ void WebPageProxy::didFinishLoadForResource(uint64_t frameID, uint64_t resourceI
void WebPageProxy::didFailLoadForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceError& error)
{
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
m_resourceLoadClient.didFailLoadForResource(this, frame, resourceIdentifier, error);
@@ -2418,7 +2418,7 @@ void WebPageProxy::showPage()
void WebPageProxy::closePage(bool stopResponsivenessTimer)
{
if (stopResponsivenessTimer)
- process()->responsivenessTimer()->stop();
+ m_process->responsivenessTimer()->stop();
m_pageClient->clearAllEditCommands();
m_uiClient.close(this);
@@ -2426,33 +2426,33 @@ void WebPageProxy::closePage(bool stopResponsivenessTimer)
void WebPageProxy::runJavaScriptAlert(uint64_t frameID, const String& message)
{
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
// Since runJavaScriptAlert() can spin a nested run loop we need to turn off the responsiveness timer.
- process()->responsivenessTimer()->stop();
+ m_process->responsivenessTimer()->stop();
m_uiClient.runJavaScriptAlert(this, message, frame);
}
void WebPageProxy::runJavaScriptConfirm(uint64_t frameID, const String& message, bool& result)
{
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
// Since runJavaScriptConfirm() can spin a nested run loop we need to turn off the responsiveness timer.
- process()->responsivenessTimer()->stop();
+ m_process->responsivenessTimer()->stop();
result = m_uiClient.runJavaScriptConfirm(this, message, frame);
}
void WebPageProxy::runJavaScriptPrompt(uint64_t frameID, const String& message, const String& defaultValue, String& result)
{
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
// Since runJavaScriptPrompt() can spin a nested run loop we need to turn off the responsiveness timer.
- process()->responsivenessTimer()->stop();
+ m_process->responsivenessTimer()->stop();
result = m_uiClient.runJavaScriptPrompt(this, message, defaultValue, frame);
}
@@ -2460,7 +2460,7 @@ void WebPageProxy::runJavaScriptPrompt(uint64_t frameID, const String& message,
void WebPageProxy::shouldInterruptJavaScript(bool& result)
{
// Since shouldInterruptJavaScript() can spin a nested run loop we need to turn off the responsiveness timer.
- process()->responsivenessTimer()->stop();
+ m_process->responsivenessTimer()->stop();
result = m_uiClient.shouldInterruptJavaScript(this);
}
@@ -2568,11 +2568,11 @@ void WebPageProxy::windowToScreen(const IntRect& viewRect, IntRect& result)
void WebPageProxy::runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose)
{
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
// Since runBeforeUnloadConfirmPanel() can spin a nested run loop we need to turn off the responsiveness timer.
- process()->responsivenessTimer()->stop();
+ m_process->responsivenessTimer()->stop();
shouldClose = m_uiClient.runBeforeUnloadConfirmPanel(this, message, frame);
}
@@ -2604,14 +2604,14 @@ void WebPageProxy::runOpenPanel(uint64_t frameID, const FileChooserSettings& set
m_openPanelResultListener = 0;
}
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
RefPtr<WebOpenPanelParameters> parameters = WebOpenPanelParameters::create(settings);
m_openPanelResultListener = WebOpenPanelResultListenerProxy::create(this);
// Since runOpenPanel() can spin a nested run loop we need to turn off the responsiveness timer.
- process()->responsivenessTimer()->stop();
+ m_process->responsivenessTimer()->stop();
if (!m_uiClient.runOpenPanel(this, frame, parameters.get(), m_openPanelResultListener.get()))
didCancelForOpenPanel();
@@ -2622,7 +2622,7 @@ void WebPageProxy::printFrame(uint64_t frameID)
ASSERT(!m_isPerformingDOMPrintOperation);
m_isPerformingDOMPrintOperation = true;
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
m_uiClient.printFrame(this, frame);
@@ -2646,7 +2646,7 @@ void WebPageProxy::setMediaVolume(float volume)
if (!isValid())
return;
- process()->send(Messages::WebPage::SetMediaVolume(volume), m_pageID);
+ m_process->send(Messages::WebPage::SetMediaVolume(volume), m_pageID);
}
#if PLATFORM(QT)
@@ -2660,7 +2660,7 @@ void WebPageProxy::findZoomableAreaForPoint(const IntPoint& point, const IntSize
if (!isValid())
return;
- process()->send(Messages::WebPage::FindZoomableAreaForPoint(point, area), m_pageID);
+ m_process->send(Messages::WebPage::FindZoomableAreaForPoint(point, area), m_pageID);
}
void WebPageProxy::didReceiveMessageFromNavigatorQtObject(const String& contents)
@@ -2732,7 +2732,7 @@ void WebPageProxy::didChooseColor(const WebCore::Color& color)
if (!isValid())
return;
- process()->send(Messages::WebPage::DidChooseColor(color), m_pageID);
+ m_process->send(Messages::WebPage::DidChooseColor(color), m_pageID);
}
void WebPageProxy::didEndColorChooser()
@@ -2745,7 +2745,7 @@ void WebPageProxy::didEndColorChooser()
m_colorChooser->invalidate();
m_colorChooser = nullptr;
- process()->send(Messages::WebPage::DidEndColorChooser(), m_pageID);
+ m_process->send(Messages::WebPage::DidEndColorChooser(), m_pageID);
}
#endif
@@ -2782,18 +2782,18 @@ WebFullScreenManagerProxy* WebPageProxy::fullScreenManager()
void WebPageProxy::backForwardAddItem(uint64_t itemID)
{
- m_backForwardList->addItem(process()->webBackForwardItem(itemID));
+ m_backForwardList->addItem(m_process->webBackForwardItem(itemID));
}
void WebPageProxy::backForwardGoToItem(uint64_t itemID, SandboxExtension::Handle& sandboxExtensionHandle)
{
- WebBackForwardListItem* item = process()->webBackForwardItem(itemID);
+ WebBackForwardListItem* item = m_process->webBackForwardItem(itemID);
if (!item)
return;
bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), item->url()), sandboxExtensionHandle);
if (createdExtension)
- process()->willAcquireUniversalFileReadSandboxExtension();
+ m_process->willAcquireUniversalFileReadSandboxExtension();
m_backForwardList->goToItem(item);
}
@@ -2874,12 +2874,12 @@ void WebPageProxy::didFailToFindString(const String& string)
void WebPageProxy::valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex)
{
- process()->send(Messages::WebPage::DidChangeSelectedIndexForActivePopupMenu(newSelectedIndex), m_pageID);
+ m_process->send(Messages::WebPage::DidChangeSelectedIndexForActivePopupMenu(newSelectedIndex), m_pageID);
}
void WebPageProxy::setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index)
{
- process()->send(Messages::WebPage::SetTextForActivePopupMenu(index), m_pageID);
+ m_process->send(Messages::WebPage::SetTextForActivePopupMenu(index), m_pageID);
}
NativeWebMouseEvent* WebPageProxy::currentlyProcessedMouseDownEvent()
@@ -2890,7 +2890,7 @@ NativeWebMouseEvent* WebPageProxy::currentlyProcessedMouseDownEvent()
#if PLATFORM(GTK)
void WebPageProxy::failedToShowPopupMenu()
{
- process()->send(Messages::WebPage::FailedToShowPopupMenu(), m_pageID);
+ m_process->send(Messages::WebPage::FailedToShowPopupMenu(), m_pageID);
}
#endif
@@ -2905,7 +2905,7 @@ void WebPageProxy::showPopupMenu(const IntRect& rect, uint64_t textDirection, co
m_activePopupMenu = m_pageClient->createPopupMenuProxy(this);
// Since showPopupMenu() can spin a nested run loop we need to turn off the responsiveness timer.
- process()->responsivenessTimer()->stop();
+ m_process->responsivenessTimer()->stop();
RefPtr<WebPopupMenuProxy> protectedActivePopupMenu = m_activePopupMenu;
@@ -2934,7 +2934,7 @@ void WebPageProxy::showContextMenu(const IntPoint& menuLocation, const WebHitTes
internalShowContextMenu(menuLocation, hitTestResultData, proposedItems, arguments);
// No matter the result of internalShowContextMenu, always notify the WebProcess that the menu is hidden so it starts handling mouse events again.
- process()->send(Messages::WebPage::ContextMenuHidden(), m_pageID);
+ m_process->send(Messages::WebPage::ContextMenuHidden(), m_pageID);
}
void WebPageProxy::internalShowContextMenu(const IntPoint& menuLocation, const WebHitTestResult::Data& hitTestResultData, const Vector<WebContextMenuItemData>& proposedItems, CoreIPC::ArgumentDecoder* arguments)
@@ -2954,7 +2954,7 @@ void WebPageProxy::internalShowContextMenu(const IntPoint& menuLocation, const W
m_activeContextMenu = m_pageClient->createContextMenuProxy(this);
// Since showContextMenu() can spin a nested run loop we need to turn off the responsiveness timer.
- process()->responsivenessTimer()->stop();
+ m_process->responsivenessTimer()->stop();
// Give the PageContextMenuClient one last swipe at changing the menu.
Vector<WebContextMenuItemData> items;
@@ -2981,27 +2981,27 @@ void WebPageProxy::contextMenuItemSelected(const WebContextMenuItemData& item)
}
if (item.action() == ContextMenuItemTagSmartQuotes) {
TextChecker::setAutomaticQuoteSubstitutionEnabled(!TextChecker::state().isAutomaticQuoteSubstitutionEnabled);
- process()->updateTextCheckerState();
+ m_process->updateTextCheckerState();
return;
}
if (item.action() == ContextMenuItemTagSmartDashes) {
TextChecker::setAutomaticDashSubstitutionEnabled(!TextChecker::state().isAutomaticDashSubstitutionEnabled);
- process()->updateTextCheckerState();
+ m_process->updateTextCheckerState();
return;
}
if (item.action() == ContextMenuItemTagSmartLinks) {
TextChecker::setAutomaticLinkDetectionEnabled(!TextChecker::state().isAutomaticLinkDetectionEnabled);
- process()->updateTextCheckerState();
+ m_process->updateTextCheckerState();
return;
}
if (item.action() == ContextMenuItemTagTextReplacement) {
TextChecker::setAutomaticTextReplacementEnabled(!TextChecker::state().isAutomaticTextReplacementEnabled);
- process()->updateTextCheckerState();
+ m_process->updateTextCheckerState();
return;
}
if (item.action() == ContextMenuItemTagCorrectSpellingAutomatically) {
TextChecker::setAutomaticSpellingCorrectionEnabled(!TextChecker::state().isAutomaticSpellingCorrectionEnabled);
- process()->updateTextCheckerState();
+ m_process->updateTextCheckerState();
return;
}
if (item.action() == ContextMenuItemTagShowSubstitutions) {
@@ -3019,12 +3019,12 @@ void WebPageProxy::contextMenuItemSelected(const WebContextMenuItemData& item)
}
if (item.action() == ContextMenuItemTagCheckSpellingWhileTyping) {
TextChecker::setContinuousSpellCheckingEnabled(!TextChecker::state().isContinuousSpellCheckingEnabled);
- process()->updateTextCheckerState();
+ m_process->updateTextCheckerState();
return;
}
if (item.action() == ContextMenuItemTagCheckGrammarWithSpelling) {
TextChecker::setGrammarCheckingEnabled(!TextChecker::state().isGrammarCheckingEnabled);
- process()->updateTextCheckerState();
+ m_process->updateTextCheckerState();
return;
}
if (item.action() == ContextMenuItemTagShowSpellingPanel) {
@@ -3036,7 +3036,7 @@ void WebPageProxy::contextMenuItemSelected(const WebContextMenuItemData& item)
if (item.action() == ContextMenuItemTagLearnSpelling || item.action() == ContextMenuItemTagIgnoreSpelling)
++m_pendingLearnOrIgnoreWordMessageCount;
- process()->send(Messages::WebPage::DidSelectItemFromActiveContextMenu(item), m_pageID);
+ m_process->send(Messages::WebPage::DidSelectItemFromActiveContextMenu(item), m_pageID);
}
#endif // ENABLE(CONTEXT_MENUS)
@@ -3051,11 +3051,11 @@ void WebPageProxy::didChooseFilesForOpenPanel(const Vector<String>& fileURLs)
for (size_t i = 0; i < fileURLs.size(); ++i) {
SandboxExtension::Handle sandboxExtensionHandle;
SandboxExtension::createHandle(fileURLs[i], SandboxExtension::ReadOnly, sandboxExtensionHandle);
- process()->send(Messages::WebPage::ExtendSandboxForFileFromOpenPanel(sandboxExtensionHandle), m_pageID);
+ m_process->send(Messages::WebPage::ExtendSandboxForFileFromOpenPanel(sandboxExtensionHandle), m_pageID);
}
#endif
- process()->send(Messages::WebPage::DidChooseFilesForOpenPanel(fileURLs), m_pageID);
+ m_process->send(Messages::WebPage::DidChooseFilesForOpenPanel(fileURLs), m_pageID);
m_openPanelResultListener->invalidate();
m_openPanelResultListener = 0;
@@ -3066,7 +3066,7 @@ void WebPageProxy::didCancelForOpenPanel()
if (!isValid())
return;
- process()->send(Messages::WebPage::DidCancelForOpenPanel(), m_pageID);
+ m_process->send(Messages::WebPage::DidCancelForOpenPanel(), m_pageID);
m_openPanelResultListener->invalidate();
m_openPanelResultListener = 0;
@@ -3074,7 +3074,7 @@ void WebPageProxy::didCancelForOpenPanel()
void WebPageProxy::advanceToNextMisspelling(bool startBeforeSelection) const
{
- process()->send(Messages::WebPage::AdvanceToNextMisspelling(startBeforeSelection), m_pageID);
+ m_process->send(Messages::WebPage::AdvanceToNextMisspelling(startBeforeSelection), m_pageID);
}
void WebPageProxy::changeSpellingToWord(const String& word) const
@@ -3082,7 +3082,7 @@ void WebPageProxy::changeSpellingToWord(const String& word) const
if (word.isEmpty())
return;
- process()->send(Messages::WebPage::ChangeSpellingToWord(word), m_pageID);
+ m_process->send(Messages::WebPage::ChangeSpellingToWord(word), m_pageID);
}
void WebPageProxy::registerEditCommand(PassRefPtr<WebEditCommandProxy> commandProxy, UndoOrRedo undoOrRedo)
@@ -3101,7 +3101,7 @@ void WebPageProxy::removeEditCommand(WebEditCommandProxy* command)
if (!isValid())
return;
- process()->send(Messages::WebPage::DidRemoveEditCommand(command->commandID()), m_pageID);
+ m_process->send(Messages::WebPage::DidRemoveEditCommand(command->commandID()), m_pageID);
}
bool WebPageProxy::isValidEditCommand(WebEditCommandProxy* command)
@@ -3196,7 +3196,10 @@ void WebPageProxy::setToolTip(const String& toolTip)
void WebPageProxy::setCursor(const WebCore::Cursor& cursor)
{
- m_pageClient->setCursor(cursor);
+ // The Web process may have asked to change the cursor when the view was in an active window, but
+ // if it is no longer in a window or the window is not active, then the cursor should not change.
+ if (m_pageClient->isViewWindowActive())
+ m_pageClient->setCursor(cursor);
}
void WebPageProxy::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
@@ -3231,7 +3234,7 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
case WebEvent::TouchEnd:
case WebEvent::TouchCancel:
#endif
- process()->responsivenessTimer()->stop();
+ m_process->responsivenessTimer()->stop();
break;
}
@@ -3289,7 +3292,7 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
m_keyEventQueue.removeFirst();
if (!m_keyEventQueue.isEmpty())
- process()->send(Messages::WebPage::KeyEvent(m_keyEventQueue.first()), m_pageID);
+ m_process->send(Messages::WebPage::KeyEvent(m_keyEventQueue.first()), m_pageID);
m_pageClient->doneWithKeyEvent(event, handled);
if (handled)
@@ -3325,7 +3328,7 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
void WebPageProxy::stopResponsivenessTimer()
{
- process()->responsivenessTimer()->stop();
+ m_process->responsivenessTimer()->stop();
}
void WebPageProxy::voidCallback(uint64_t callbackID)
@@ -3422,7 +3425,7 @@ void WebPageProxy::focusedFrameChanged(uint64_t frameID)
return;
}
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
m_focusedFrame = frame;
@@ -3435,7 +3438,7 @@ void WebPageProxy::frameSetLargestFrameChanged(uint64_t frameID)
return;
}
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
m_frameSetLargestFrame = frame;
@@ -3648,7 +3651,7 @@ void WebPageProxy::backForwardClear()
void WebPageProxy::canAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, const ProtectionSpace& coreProtectionSpace, bool& canAuthenticate)
{
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
RefPtr<WebProtectionSpace> protectionSpace = WebProtectionSpace::create(coreProtectionSpace);
@@ -3658,17 +3661,17 @@ void WebPageProxy::canAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID
void WebPageProxy::didReceiveAuthenticationChallenge(uint64_t frameID, const AuthenticationChallenge& coreChallenge, uint64_t challengeID)
{
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
- RefPtr<AuthenticationChallengeProxy> authenticationChallenge = AuthenticationChallengeProxy::create(coreChallenge, challengeID, process());
+ RefPtr<AuthenticationChallengeProxy> authenticationChallenge = AuthenticationChallengeProxy::create(coreChallenge, challengeID, m_process.get());
m_loaderClient.didReceiveAuthenticationChallengeInFrame(this, frame, authenticationChallenge.get());
}
void WebPageProxy::exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, uint64_t& newQuota)
{
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
@@ -3678,7 +3681,7 @@ void WebPageProxy::exceededDatabaseQuota(uint64_t frameID, const String& originI
void WebPageProxy::requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier)
{
- WebFrameProxy* frame = process()->webFrame(frameID);
+ WebFrameProxy* frame = m_process->webFrame(frameID);
MESSAGE_CHECK(frame);
// FIXME: Geolocation should probably be using toString() as its string representation instead of databaseIdentifier().
@@ -3737,13 +3740,13 @@ void WebPageProxy::drawFooter(WebFrameProxy* frame, const FloatRect& rect)
void WebPageProxy::runModal()
{
// Since runModal() can (and probably will) spin a nested run loop we need to turn off the responsiveness timer.
- process()->responsivenessTimer()->stop();
+ m_process->responsivenessTimer()->stop();
// Our Connection's run loop might have more messages waiting to be handled after this RunModal message.
// To make sure they are handled inside of the the nested modal run loop we must first signal the Connection's
// run loop so we're guaranteed that it has a chance to wake up.
// See http://webkit.org/b/89590 for more discussion.
- process()->connection()->wakeUpRunLoop();
+ m_process->connection()->wakeUpRunLoop();
m_uiClient.runModal(this);
}
@@ -3812,7 +3815,7 @@ void WebPageProxy::didFinishLoadingDataForCustomRepresentation(const String& sug
void WebPageProxy::backForwardRemovedItem(uint64_t itemID)
{
- process()->send(Messages::WebPage::DidRemoveBackForwardItem(itemID), m_pageID);
+ m_process->send(Messages::WebPage::DidRemoveBackForwardItem(itemID), m_pageID);
}
void WebPageProxy::setCanRunModal(bool canRunModal)
@@ -3824,7 +3827,7 @@ void WebPageProxy::setCanRunModal(bool canRunModal)
// already qualifies for running modal child web pages, otherwise
// there's no other possibility than not allowing it.
m_canRunModal = m_uiClient.canRunModal() && canRunModal;
- process()->send(Messages::WebPage::SetCanRunModal(m_canRunModal), m_pageID);
+ m_process->send(Messages::WebPage::SetCanRunModal(m_canRunModal), m_pageID);
}
bool WebPageProxy::canRunModal()
@@ -3838,7 +3841,7 @@ void WebPageProxy::beginPrinting(WebFrameProxy* frame, const PrintInfo& printInf
return;
m_isInPrintingMode = true;
- process()->send(Messages::WebPage::BeginPrinting(frame->frameID(), printInfo), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
+ m_process->send(Messages::WebPage::BeginPrinting(frame->frameID(), printInfo), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
}
void WebPageProxy::endPrinting()
@@ -3847,7 +3850,7 @@ void WebPageProxy::endPrinting()
return;
m_isInPrintingMode = false;
- process()->send(Messages::WebPage::EndPrinting(), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
+ m_process->send(Messages::WebPage::EndPrinting(), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
}
void WebPageProxy::computePagesForPrinting(WebFrameProxy* frame, const PrintInfo& printInfo, PassRefPtr<ComputedPagesCallback> prpCallback)
@@ -3861,7 +3864,7 @@ void WebPageProxy::computePagesForPrinting(WebFrameProxy* frame, const PrintInfo
uint64_t callbackID = callback->callbackID();
m_computedPagesCallbacks.set(callbackID, callback.get());
m_isInPrintingMode = true;
- process()->send(Messages::WebPage::ComputePagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
+ m_process->send(Messages::WebPage::ComputePagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
}
#if PLATFORM(MAC) || PLATFORM(WIN)
@@ -3875,7 +3878,7 @@ void WebPageProxy::drawRectToPDF(WebFrameProxy* frame, const PrintInfo& printInf
uint64_t callbackID = callback->callbackID();
m_dataCallbacks.set(callbackID, callback.get());
- process()->send(Messages::WebPage::DrawRectToPDF(frame->frameID(), printInfo, rect, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
+ m_process->send(Messages::WebPage::DrawRectToPDF(frame->frameID(), printInfo, rect, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
}
void WebPageProxy::drawPagesToPDF(WebFrameProxy* frame, const PrintInfo& printInfo, uint32_t first, uint32_t count, PassRefPtr<DataCallback> prpCallback)
@@ -3888,7 +3891,7 @@ void WebPageProxy::drawPagesToPDF(WebFrameProxy* frame, const PrintInfo& printIn
uint64_t callbackID = callback->callbackID();
m_dataCallbacks.set(callbackID, callback.get());
- process()->send(Messages::WebPage::DrawPagesToPDF(frame->frameID(), printInfo, first, count, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
+ m_process->send(Messages::WebPage::DrawPagesToPDF(frame->frameID(), printInfo, first, count, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
}
#elif PLATFORM(GTK)
void WebPageProxy::drawPagesForPrinting(WebFrameProxy* frame, const PrintInfo& printInfo, PassRefPtr<PrintFinishedCallback> didPrintCallback)
@@ -3902,7 +3905,7 @@ void WebPageProxy::drawPagesForPrinting(WebFrameProxy* frame, const PrintInfo& p
uint64_t callbackID = callback->callbackID();
m_printFinishedCallbacks.set(callbackID, callback.get());
m_isInPrintingMode = true;
- process()->send(Messages::WebPage::DrawPagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
+ m_process->send(Messages::WebPage::DrawPagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
}
#endif
@@ -3917,7 +3920,7 @@ void WebPageProxy::updateBackingStoreDiscardableState()
bool isDiscardable;
- if (!process()->responsivenessTimer()->isResponsive())
+ if (!m_process->responsivenessTimer()->isResponsive())
isDiscardable = false;
else
isDiscardable = !m_pageClient->isViewWindowActive() || !isViewVisible();
@@ -3942,7 +3945,7 @@ void WebPageProxy::saveDataToFileInDownloadsFolder(const String& suggestedFilena
void WebPageProxy::linkClicked(const String& url, const WebMouseEvent& event)
{
- process()->send(Messages::WebPage::LinkClicked(url, event), m_pageID, 0);
+ m_process->send(Messages::WebPage::LinkClicked(url, event), m_pageID, 0);
}
#if PLATFORM(MAC)
@@ -3978,7 +3981,7 @@ void WebPageProxy::handleAlternativeTextUIResult(const String& result)
{
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
if (!isClosed())
- process()->send(Messages::WebPage::HandleAlternativeTextUIResult(result), m_pageID, 0);
+ m_process->send(Messages::WebPage::HandleAlternativeTextUIResult(result), m_pageID, 0);
#endif
}
diff --git a/Source/WebKit2/UIProcess/WebProcessProxy.cpp b/Source/WebKit2/UIProcess/WebProcessProxy.cpp
index d90355c4e..22a2b7f2c 100644
--- a/Source/WebKit2/UIProcess/WebProcessProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebProcessProxy.cpp
@@ -36,13 +36,19 @@
#include "WebNavigationDataStore.h"
#include "WebNotificationManagerProxy.h"
#include "WebPageProxy.h"
+#include "WebPluginSiteDataManager.h"
#include "WebProcessMessages.h"
#include "WebProcessProxyMessages.h"
#include <WebCore/KURL.h>
#include <stdio.h>
+#include <wtf/MainThread.h>
#include <wtf/text/CString.h>
#include <wtf/text/WTFString.h>
+#if PLATFORM(MAC)
+#include "BuiltInPDFView.h"
+#endif
+
using namespace WebCore;
using namespace std;
@@ -63,6 +69,12 @@ static uint64_t generatePageID()
return uniquePageID++;
}
+static WorkQueue& pluginWorkQueue()
+{
+ DEFINE_STATIC_LOCAL(WorkQueue, queue, ("com.apple.CoreIPC.PluginQueue"));
+ return queue;
+}
+
PassRefPtr<WebProcessProxy> WebProcessProxy::create(PassRefPtr<WebContext> context)
{
return adoptRef(new WebProcessProxy(context));
@@ -171,8 +183,6 @@ WebPageProxy* WebProcessProxy::webPage(uint64_t pageID) const
PassRefPtr<WebPageProxy> WebProcessProxy::createWebPage(PageClient* pageClient, WebContext* context, WebPageGroup* pageGroup)
{
- ASSERT(context->process() == this);
-
uint64_t pageID = generatePageID();
RefPtr<WebPageProxy> webPage = WebPageProxy::create(pageClient, this, pageGroup, pageID);
m_pageMap.set(pageID, webPage.get());
@@ -189,6 +199,16 @@ void WebProcessProxy::removeWebPage(uint64_t pageID)
m_pageMap.remove(pageID);
}
+#if ENABLE(WEB_INTENTS)
+void WebProcessProxy::removeMessagePortChannel(uint64_t channelID)
+{
+ if (!isValid())
+ return;
+
+ send(Messages::WebProcess::RemoveMessagePortChannel(channelID), /* destinationID */ 0);
+}
+#endif
+
WebBackForwardListItem* WebProcessProxy::webBackForwardItem(uint64_t itemID) const
{
return m_backForwardListItemMap.get(itemID).get();
@@ -282,16 +302,86 @@ void WebProcessProxy::addBackForwardItem(uint64_t itemID, const String& original
result.iterator->second->setBackForwardData(backForwardData.data(), backForwardData.size());
}
+void WebProcessProxy::sendDidGetPlugins(uint64_t requestID, PassOwnPtr<Vector<PluginInfo> > pluginInfos)
+{
+ ASSERT(isMainThread());
+
+ OwnPtr<Vector<PluginInfo> > plugins(pluginInfos);
+
+#if PLATFORM(MAC)
+ // Add built-in PDF last, so that it's not used when a real plug-in is installed.
+ // NOTE: This has to be done on the main thread as it calls localizedString().
+ if (!m_context->omitPDFSupport())
+ plugins->append(BuiltInPDFView::pluginInfo());
+#endif
+
+ send(Messages::WebProcess::DidGetPlugins(requestID, *plugins), 0);
+}
+
+void WebProcessProxy::handleGetPlugins(uint64_t requestID, bool refresh)
+{
+ if (refresh)
+ m_context->pluginInfoStore().refresh();
+
+ OwnPtr<Vector<PluginInfo> > pluginInfos = adoptPtr(new Vector<PluginInfo>);
+
+ Vector<PluginModuleInfo> plugins = m_context->pluginInfoStore().plugins();
+ for (size_t i = 0; i < plugins.size(); ++i)
+ pluginInfos->append(plugins[i].info);
+
+ // NOTE: We have to pass the PluginInfo vector to the secondary thread via a pointer as otherwise
+ // we'd end up with a deref() race on all the WTF::Strings it contains.
+ RunLoop::main()->dispatch(bind(&WebProcessProxy::sendDidGetPlugins, this, requestID, pluginInfos.release()));
+}
+
+void WebProcessProxy::getPlugins(CoreIPC::Connection*, uint64_t requestID, bool refresh)
+{
+ pluginWorkQueue().dispatch(bind(&WebProcessProxy::handleGetPlugins, this, requestID, refresh));
+}
+
+void WebProcessProxy::getPluginPath(const String& mimeType, const String& urlString, String& pluginPath, bool& blocked)
+{
+ MESSAGE_CHECK_URL(urlString);
+
+ String newMimeType = mimeType.lower();
+
+ blocked = false;
+ PluginModuleInfo plugin = m_context->pluginInfoStore().findPlugin(newMimeType, KURL(KURL(), urlString));
+ if (!plugin.path)
+ return;
+
+ if (m_context->pluginInfoStore().shouldBlockPlugin(plugin)) {
+ blocked = true;
+ return;
+ }
+
+ pluginPath = plugin.path;
+}
+
#if ENABLE(PLUGIN_PROCESS)
+
void WebProcessProxy::getPluginProcessConnection(const String& pluginPath, PassRefPtr<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply> reply)
{
- PluginProcessManager::shared().getPluginProcessConnection(context()->pluginInfoStore(), pluginPath, reply);
+ PluginProcessManager::shared().getPluginProcessConnection(m_context->pluginInfoStore(), pluginPath, reply);
}
void WebProcessProxy::pluginSyncMessageSendTimedOut(const String& pluginPath)
{
PluginProcessManager::shared().pluginSyncMessageSendTimedOut(pluginPath);
}
+
+#else
+
+void WebProcessProxy::didGetSitesWithPluginData(const Vector<String>& sites, uint64_t callbackID)
+{
+ m_context->pluginSiteDataManager()->didGetSitesWithData(sites, callbackID);
+}
+
+void WebProcessProxy::didClearPluginSiteData(uint64_t callbackID)
+{
+ m_context->pluginSiteDataManager()->didClearSiteData(callbackID);
+}
+
#endif
void WebProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
diff --git a/Source/WebKit2/UIProcess/WebProcessProxy.h b/Source/WebKit2/UIProcess/WebProcessProxy.h
index 09d861a0e..2dc204f89 100644
--- a/Source/WebKit2/UIProcess/WebProcessProxy.h
+++ b/Source/WebKit2/UIProcess/WebProcessProxy.h
@@ -55,7 +55,7 @@ class WebContext;
class WebPageGroup;
struct WebNavigationDataStore;
-class WebProcessProxy : public RefCounted<WebProcessProxy>, CoreIPC::Connection::Client, ResponsivenessTimer::Client, ProcessLauncher::Client, CoreIPC::Connection::QueueClient {
+class WebProcessProxy : public ThreadSafeRefCounted<WebProcessProxy>, CoreIPC::Connection::Client, ResponsivenessTimer::Client, ProcessLauncher::Client, CoreIPC::Connection::QueueClient {
public:
typedef HashMap<uint64_t, RefPtr<WebFrameProxy> > WebFrameProxyMap;
typedef HashMap<uint64_t, RefPtr<WebBackForwardListItem> > WebBackForwardListItemMap;
@@ -85,6 +85,10 @@ public:
void addExistingWebPage(WebPageProxy*, uint64_t pageID);
void removeWebPage(uint64_t pageID);
+#if ENABLE(WEB_INTENTS)
+ void removeMessagePortChannel(uint64_t channelID);
+#endif
+
WebBackForwardListItem* webBackForwardItem(uint64_t itemID) const;
ResponsivenessTimer* responsivenessTimer() { return &m_responsivenessTimer; }
@@ -132,10 +136,20 @@ private:
void shouldTerminate(bool& shouldTerminate);
+ // Plugins
+ void getPlugins(CoreIPC::Connection*, uint64_t requestID, bool refresh);
+ void getPluginPath(const String& mimeType, const String& urlString, String& pluginPath, bool& blocked);
#if ENABLE(PLUGIN_PROCESS)
void getPluginProcessConnection(const String& pluginPath, PassRefPtr<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply>);
void pluginSyncMessageSendTimedOut(const String& pluginPath);
+#else
+ void didGetSitesWithPluginData(const Vector<String>& sites, uint64_t callbackID);
+ void didClearPluginSiteData(uint64_t callbackID);
#endif
+
+ void handleGetPlugins(uint64_t requestID, bool refresh);
+ void sendDidGetPlugins(uint64_t requestID, PassOwnPtr<Vector<WebCore::PluginInfo> >);
+
#if USE(SECURITY_FRAMEWORK)
void secItemRequest(CoreIPC::Connection*, uint64_t requestID, const SecItemRequestData&);
void secKeychainItemRequest(CoreIPC::Connection*, uint64_t requestID, const SecKeychainItemRequestData&);
diff --git a/Source/WebKit2/UIProcess/WebProcessProxy.messages.in b/Source/WebKit2/UIProcess/WebProcessProxy.messages.in
index 84805df32..2c3d58b93 100644
--- a/Source/WebKit2/UIProcess/WebProcessProxy.messages.in
+++ b/Source/WebKit2/UIProcess/WebProcessProxy.messages.in
@@ -33,10 +33,17 @@ messages -> WebProcessProxy {
ShouldTerminate() -> (bool shouldTerminate)
+ # Plugin messages.
+ GetPlugins(uint64_t requestID, bool refresh) DispatchOnConnectionQueue
+ GetPluginPath(WTF::String mimeType, WTF::String urlString) -> (WTF::String pluginPath, bool blocked)
#if ENABLE(PLUGIN_PROCESS)
GetPluginProcessConnection(WTF::String pluginPath) -> (CoreIPC::Attachment connectionHandle, bool supportsAsynchronousInitialization) Delayed
PluginSyncMessageSendTimedOut(WTF::String pluginPath)
#endif
+#if !ENABLE(PLUGIN_PROCESS)
+ void DidGetSitesWithPluginData(Vector<WTF::String> sites, uint64_t callbackID)
+ void DidClearPluginSiteData(uint64_t callbackID)
+#endif
#if USE(SECURITY_FRAMEWORK)
SecItemRequest(uint64_t requestID, WebKit::SecItemRequestData request) DispatchOnConnectionQueue
diff --git a/Source/WebKit2/UIProcess/WebTextChecker.cpp b/Source/WebKit2/UIProcess/WebTextChecker.cpp
index 276184419..f4a65526a 100644
--- a/Source/WebKit2/UIProcess/WebTextChecker.cpp
+++ b/Source/WebKit2/UIProcess/WebTextChecker.cpp
@@ -48,27 +48,23 @@ void WebTextChecker::setClient(const WKTextCheckerClient* client)
m_client.initialize(client);
}
-static void updateStateForAllWebProcesses()
+static void updateStateForAllContexts()
{
const Vector<WebContext*>& contexts = WebContext::allContexts();
- for (size_t i = 0; i < contexts.size(); ++i) {
- WebProcessProxy* webProcess = contexts[i]->process();
- if (!webProcess)
- continue;
- webProcess->updateTextCheckerState();
- }
+ for (size_t i = 0; i < contexts.size(); ++i)
+ contexts[i]->textCheckerStateChanged();
}
void WebTextChecker::continuousSpellCheckingEnabledStateChanged(bool enabled)
{
TextChecker::continuousSpellCheckingEnabledStateChanged(enabled);
- updateStateForAllWebProcesses();
+ updateStateForAllContexts();
}
void WebTextChecker::grammarCheckingEnabledStateChanged(bool enabled)
{
TextChecker::grammarCheckingEnabledStateChanged(enabled);
- updateStateForAllWebProcesses();
+ updateStateForAllContexts();
}
void WebTextChecker::checkSpelling(const WebPageProxy* page, bool startBeforeSelection)
diff --git a/Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp b/Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp
index 236ffca05..ed2b4df8f 100644
--- a/Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp
+++ b/Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp
@@ -53,22 +53,78 @@ static void contextMenuItemActivatedCallback(GtkAction* action, WebPageProxy* pa
page->contextMenuItemSelected(item);
}
+static void contextMenuItemVisibilityChanged(GtkAction* action, GParamSpec*, WebContextMenuProxyGtk* contextMenuProxy)
+{
+ GtkMenu* menu = contextMenuProxy->gtkMenu();
+ if (!menu)
+ return;
+
+ GOwnPtr<GList> items(gtk_container_get_children(GTK_CONTAINER(menu)));
+ bool previousVisibleItemIsNotASeparator = false;
+ GtkWidget* lastItemVisibleSeparator = 0;
+ for (GList* iter = items.get(); iter; iter = g_list_next(iter)) {
+ GtkWidget* widget = GTK_WIDGET(iter->data);
+
+ if (GTK_IS_SEPARATOR_MENU_ITEM(widget)) {
+ if (previousVisibleItemIsNotASeparator) {
+ gtk_widget_show(widget);
+ lastItemVisibleSeparator = widget;
+ previousVisibleItemIsNotASeparator = false;
+ } else
+ gtk_widget_hide(widget);
+ } else if (gtk_widget_get_visible(widget)) {
+ lastItemVisibleSeparator = 0;
+ previousVisibleItemIsNotASeparator = true;
+ }
+ }
+
+ if (lastItemVisibleSeparator)
+ gtk_widget_hide(lastItemVisibleSeparator);
+}
+
void WebContextMenuProxyGtk::append(ContextMenuItem& menuItem)
{
GtkAction* action = menuItem.gtkAction();
-
- if (action && (menuItem.type() == ActionType || menuItem.type() == CheckableActionType)) {
- g_object_set_data(G_OBJECT(action), gContextMenuActionId, GINT_TO_POINTER(menuItem.action()));
- g_signal_connect(action, "activate", G_CALLBACK(contextMenuItemActivatedCallback), m_page);
+ if (action) {
+ switch (menuItem.type()) {
+ case ActionType:
+ case CheckableActionType:
+ g_object_set_data(G_OBJECT(action), gContextMenuActionId, GINT_TO_POINTER(menuItem.action()));
+ g_signal_connect(action, "activate", G_CALLBACK(contextMenuItemActivatedCallback), m_page);
+ // Fall through.
+ case SubmenuType:
+ g_signal_connect(action, "notify::visible", G_CALLBACK(contextMenuItemVisibilityChanged), this);
+ break;
+ case SeparatorType:
+ break;
+ }
}
m_menu.appendItem(menuItem);
}
+// Populate the context menu ensuring that:
+// - There aren't separators next to each other.
+// - There aren't separators at the beginning of the menu.
+// - There aren't separators at the end of the menu.
void WebContextMenuProxyGtk::populate(Vector<ContextMenuItem>& items)
{
- for (size_t i = 0; i < items.size(); i++)
- append(items.at(i));
+ bool previousIsSeparator = false;
+ bool isEmpty = true;
+ for (size_t i = 0; i < items.size(); i++) {
+ ContextMenuItem& menuItem = items.at(i);
+ if (menuItem.type() == SeparatorType) {
+ previousIsSeparator = true;
+ continue;
+ }
+
+ if (previousIsSeparator && !isEmpty)
+ append(items.at(i - 1));
+ previousIsSeparator = false;
+
+ append(menuItem);
+ isEmpty = false;
+ }
}
void WebContextMenuProxyGtk::populate(const Vector<WebContextMenuItemData>& items)
diff --git a/Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp b/Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp
index 638715fb1..0dd547102 100644
--- a/Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp
@@ -57,7 +57,7 @@ public:
{
}
-public slots:
+public Q_SLOTS:
// Allows clients to call dismiss() directly, while also
// being able to hook up signals to automatically also
// dismiss the dialog since it's a slot.
@@ -68,7 +68,7 @@ public slots:
emit dismissed();
}
-signals:
+Q_SIGNALS:
void dismissed();
private:
@@ -95,11 +95,11 @@ public:
QString message() const { return m_message; }
QString defaultValue() const { return m_defaultValue; }
-public slots:
+public Q_SLOTS:
void accept(const QString& result = QString()) { emit accepted(result); }
void reject() { emit rejected(); }
-signals:
+Q_SIGNALS:
void accepted(const QString& result);
void rejected();
@@ -126,11 +126,11 @@ public:
QString hostname() const { return m_hostname; }
QString prefilledUsername() const { return m_prefilledUsername; }
-public slots:
+public Q_SLOTS:
void accept(const QString& username, const QString& password) { emit accepted(username, password); }
void reject() { emit rejected(); }
-signals:
+Q_SIGNALS:
void accepted(const QString& username, const QString& password);
void rejected();
@@ -188,11 +188,11 @@ public:
QString hostname() const { return m_hostname; }
-public slots:
+public Q_SLOTS:
void accept() { emit accepted(); }
void reject() { emit rejected(); }
-signals:
+Q_SIGNALS:
void accepted();
void rejected();
@@ -218,7 +218,7 @@ public:
QStringList fileList() const { return m_fileList; }
bool allowMultipleFiles() const { return m_allowMultiple;}
-public slots:
+public Q_SLOTS:
void reject() { emit rejected();}
void accept(const QVariant& path)
{
@@ -235,7 +235,7 @@ public slots:
emit fileSelected(filesPath);
}
-signals:
+Q_SIGNALS:
void rejected();
void fileSelected(const QStringList&);
@@ -283,11 +283,11 @@ public:
quint64 expectedUsage() const { return m_expectedUsage; }
QtWebSecurityOrigin* securityOrigin() { return &m_securityOrigin; }
-public slots:
+public Q_SLOTS:
void accept(quint64 size) { emit accepted(size); }
void reject() { emit rejected(); }
-signals:
+Q_SIGNALS:
void accepted(quint64 size);
void rejected();
diff --git a/Source/WebKit2/UIProcess/qt/QtDialogRunner.h b/Source/WebKit2/UIProcess/qt/QtDialogRunner.h
index c04043d34..b70044076 100644
--- a/Source/WebKit2/UIProcess/qt/QtDialogRunner.h
+++ b/Source/WebKit2/UIProcess/qt/QtDialogRunner.h
@@ -65,7 +65,7 @@ public:
QStringList filePaths() const { return m_filepaths; }
-public slots:
+public Q_SLOTS:
void onAccepted(const QString& result = QString());
void onAuthenticationAccepted(const QString& username, const QString& password);
void onFileSelected(const QStringList& filePaths);
diff --git a/Source/WebKit2/UIProcess/qt/QtWebContext.cpp b/Source/WebKit2/UIProcess/qt/QtWebContext.cpp
index 50fa17f66..f8d384cc2 100644
--- a/Source/WebKit2/UIProcess/qt/QtWebContext.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtWebContext.cpp
@@ -116,6 +116,9 @@ PassRefPtr<QtWebContext> QtWebContext::defaultContext()
return PassRefPtr<QtWebContext>(s_defaultContext);
RefPtr<WebContext> context = WebContext::create(String());
+ // A good all-around default.
+ context->setCacheModel(CacheModelDocumentBrowser);
+
RefPtr<QtWebContext> defaultContext = QtWebContext::create(context.get());
s_defaultContext = defaultContext.get();
// Make sure that this doesn't get called in WebKitTestRunner (defaultContext isn't used there).
diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.h b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.h
index 4cc9f3372..446db753d 100644
--- a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.h
+++ b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.h
@@ -104,7 +104,7 @@ protected:
QQuickWebPage* m_webPage;
QQuickWebView* m_webView;
-private slots:
+private Q_SLOTS:
void inputPanelVisibleChanged();
private:
diff --git a/Source/WebKit2/WebProcess/Cookies/soup/WebCookieManagerSoup.cpp b/Source/WebKit2/WebProcess/Cookies/soup/WebCookieManagerSoup.cpp
index 9b3fbaf16..982c774f8 100644
--- a/Source/WebKit2/WebProcess/Cookies/soup/WebCookieManagerSoup.cpp
+++ b/Source/WebKit2/WebProcess/Cookies/soup/WebCookieManagerSoup.cpp
@@ -27,6 +27,7 @@
#include "WebCookieManager.h"
#include "WebKitSoupCookieJarSqlite.h"
+#include "WebProcess.h"
#include <WebCore/CookieJarSoup.h>
#include <WebCore/ResourceHandle.h>
#include <libsoup/soup.h>
@@ -83,6 +84,8 @@ HTTPCookieAcceptPolicy WebCookieManager::platformGetHTTPCookieAcceptPolicy()
void WebCookieManager::setCookiePersistentStorage(const String& storagePath, uint32_t storageType)
{
+ WebProcess::LocalTerminationDisabler terminationDisabler(WebProcess::shared());
+
GRefPtr<SoupCookieJar> jar;
switch (storageType) {
case SoupCookiePersistentStorageText:
diff --git a/Source/WebKit2/WebProcess/Downloads/qt/QtFileDownloader.h b/Source/WebKit2/WebProcess/Downloads/qt/QtFileDownloader.h
index 0ae0fd84a..f688063af 100644
--- a/Source/WebKit2/WebProcess/Downloads/qt/QtFileDownloader.h
+++ b/Source/WebKit2/WebProcess/Downloads/qt/QtFileDownloader.h
@@ -58,7 +58,7 @@ public:
DownloadErrorNetworkFailure
};
-private slots:
+private Q_SLOTS:
void onReadyRead();
void onFinished();
void onError(QNetworkReply::NetworkError);
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
index 3355d086d..018ef7970 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
@@ -46,6 +46,7 @@ class InjectedBundleBackForwardList;
class InjectedBundleBackForwardListItem;
class InjectedBundleDOMWindowExtension;
class InjectedBundleHitTestResult;
+class InjectedBundleIntent;
class InjectedBundleIntentRequest;
class InjectedBundleNavigationAction;
class InjectedBundleNodeHandle;
@@ -64,6 +65,7 @@ WK_ADD_API_MAPPING(WKBundleDOMWindowExtensionRef, InjectedBundleDOMWindowExtensi
WK_ADD_API_MAPPING(WKBundleFrameRef, WebFrame)
WK_ADD_API_MAPPING(WKBundleHitTestResultRef, InjectedBundleHitTestResult)
WK_ADD_API_MAPPING(WKBundleInspectorRef, WebInspector)
+WK_ADD_API_MAPPING(WKBundleIntentRef, InjectedBundleIntent)
WK_ADD_API_MAPPING(WKBundleIntentRequestRef, InjectedBundleIntentRequest)
WK_ADD_API_MAPPING(WKBundleNavigationActionRef, InjectedBundleNavigationAction)
WK_ADD_API_MAPPING(WKBundleNodeHandleRef, InjectedBundleNodeHandle)
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp
new file mode 100644
index 000000000..561a514eb
--- /dev/null
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp
@@ -0,0 +1,134 @@
+/*
+ * 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 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 "WKBundleIntent.h"
+
+#if ENABLE(WEB_INTENTS)
+#include "ImmutableArray.h"
+#include "ImmutableDictionary.h"
+#include "InjectedBundleIntent.h"
+#include "WKAPICast.h"
+#include "WKBundleAPICast.h"
+#include "WKDictionary.h"
+#include "WKString.h"
+#include "WebSerializedScriptValue.h"
+
+using namespace WebCore;
+using namespace WebKit;
+#endif
+
+WKTypeID WKBundleIntentGetTypeID()
+{
+#if ENABLE(WEB_INTENTS)
+ return toAPI(InjectedBundleIntent::APIType);
+#else
+ return 0;
+#endif
+}
+
+WKBundleIntentRef WKBundleIntentCreate(WKDictionaryRef dictionaryRef)
+{
+#if ENABLE(WEB_INTENTS)
+ WKStringRef action = static_cast<WKStringRef>(WKDictionaryGetItemForKey(dictionaryRef, WKStringCreateWithUTF8CString("action")));
+ ASSERT(action);
+ WKStringRef type = static_cast<WKStringRef>(WKDictionaryGetItemForKey(dictionaryRef, WKStringCreateWithUTF8CString("type")));
+ ASSERT(type);
+ WKSerializedScriptValueRef data = static_cast<WKSerializedScriptValueRef>(WKDictionaryGetItemForKey(dictionaryRef, WKStringCreateWithUTF8CString("data")));
+ MessagePortArray dummyPorts;
+ ExceptionCode ec;
+
+ RefPtr<Intent> coreIntent = Intent::create(toImpl(action)->string(), toImpl(type)->string(), data ? static_cast<SerializedScriptValue*>(toImpl(data)->internalRepresentation()) : 0, dummyPorts, ec);
+
+ return toAPI(InjectedBundleIntent::create(coreIntent.get()).leakRef());
+#else
+ return 0;
+#endif
+}
+
+WKStringRef WKBundleIntentCopyAction(WKBundleIntentRef intentRef)
+{
+#if ENABLE(WEB_INTENTS)
+ return toCopiedAPI(toImpl(intentRef)->action());
+#else
+ return 0;
+#endif
+}
+
+WKStringRef WKBundleIntentCopyType(WKBundleIntentRef intentRef)
+{
+#if ENABLE(WEB_INTENTS)
+ return toCopiedAPI(toImpl(intentRef)->payloadType());
+#else
+ return 0;
+#endif
+}
+
+WKURLRef WKBundleIntentCopyService(WKBundleIntentRef intentRef)
+{
+#if ENABLE(WEB_INTENTS)
+ return toCopiedURLAPI(toImpl(intentRef)->service());
+#else
+ return 0;
+#endif
+}
+
+WKArrayRef WKBundleIntentCopySuggestions(WKBundleIntentRef intentRef)
+{
+#if ENABLE(WEB_INTENTS)
+ return toAPI(toImpl(intentRef)->suggestions().leakRef());
+#else
+ return 0;
+#endif
+}
+
+WKStringRef WKBundleIntentCopyExtraValue(WKBundleIntentRef intentRef, WKStringRef key)
+{
+#if ENABLE(WEB_INTENTS)
+ return toCopiedAPI(toImpl(intentRef)->extra(toWTFString(key)));
+#else
+ return 0;
+#endif
+}
+
+WKDictionaryRef WKBundleIntentCopyExtras(WKBundleIntentRef intentRef)
+{
+#if ENABLE(WEB_INTENTS)
+ return toAPI(toImpl(intentRef)->extras().leakRef());
+#else
+ return 0;
+#endif
+}
+
+size_t WKBundleIntentMessagePortCount(WKBundleIntentRef intentRef)
+{
+#if ENABLE(WEB_INTENTS)
+ MessagePortChannelArray* messagePorts = toImpl(intentRef)->coreIntent()->messagePorts();
+
+ return messagePorts ? messagePorts->size() : 0;
+#else
+ return 0;
+#endif
+}
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.h
new file mode 100644
index 000000000..503fe0284
--- /dev/null
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.h
@@ -0,0 +1,51 @@
+/*
+ * 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 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 WKBundleIntent_h
+#define WKBundleIntent_h
+
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKBundleIntentGetTypeID();
+
+WK_EXPORT WKBundleIntentRef WKBundleIntentCreate(WKDictionaryRef dictionaryRef);
+
+WK_EXPORT WKStringRef WKBundleIntentCopyAction(WKBundleIntentRef intentRef);
+WK_EXPORT WKStringRef WKBundleIntentCopyType(WKBundleIntentRef intentRef);
+WK_EXPORT WKURLRef WKBundleIntentCopyService(WKBundleIntentRef intentRef);
+WK_EXPORT WKArrayRef WKBundleIntentCopySuggestions(WKBundleIntentRef intentRef);
+WK_EXPORT WKStringRef WKBundleIntentCopyExtraValue(WKBundleIntentRef intentRef, WKStringRef key);
+WK_EXPORT WKDictionaryRef WKBundleIntentCopyExtras(WKBundleIntentRef intentRef);
+WK_EXPORT size_t WKBundleIntentMessagePortCount(WKBundleIntentRef intentRef);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKBundleIntent_h
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.cpp
index 81c95c6c5..a4772ea56 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.cpp
@@ -27,10 +27,10 @@
#include "WKBundleIntentRequest.h"
#if ENABLE(WEB_INTENTS)
+#include "InjectedBundleIntent.h"
#include "InjectedBundleIntentRequest.h"
#include "WKAPICast.h"
#include "WKBundleAPICast.h"
-#include "WebIntentData.h"
using namespace WebKit;
#endif
@@ -44,11 +44,11 @@ WKTypeID WKBundleIntentRequestGetTypeID()
#endif
}
-WKIntentDataRef WKBundleIntentRequestCopyIntentData(WKBundleIntentRequestRef requestRef)
+WKBundleIntentRef WKBundleIntentRequestCopyIntent(WKBundleIntentRequestRef requestRef)
{
#if ENABLE(WEB_INTENTS)
- RefPtr<WebIntentData> webIntentData = toImpl(requestRef)->intent();
- return toAPI(webIntentData.release().leakRef());
+ RefPtr<InjectedBundleIntent> webIntent = toImpl(requestRef)->intent();
+ return toAPI(webIntent.release().leakRef());
#else
return 0;
#endif
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.h
index b18136d13..105afa4f9 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.h
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.h
@@ -34,7 +34,7 @@ extern "C" {
WK_EXPORT WKTypeID WKBundleIntentRequestGetTypeID();
-WK_EXPORT WKIntentDataRef WKBundleIntentRequestCopyIntentData(WKBundleIntentRequestRef request);
+WK_EXPORT WKBundleIntentRef WKBundleIntentRequestCopyIntent(WKBundleIntentRequestRef request);
WK_EXPORT void WKBundleIntentRequestPostResult(WKBundleIntentRequestRef request, WKSerializedScriptValueRef serializedData);
WK_EXPORT void WKBundleIntentRequestPostFailure(WKBundleIntentRequestRef request, WKSerializedScriptValueRef serializedData);
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
index 1f43a1220..91d0ad865 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
@@ -47,7 +47,7 @@
#include <WebCore/Page.h>
#if ENABLE(WEB_INTENTS)
-#include "WebIntentData.h"
+#include "InjectedBundleIntent.h"
#endif
using namespace WebKit;
@@ -295,7 +295,9 @@ WKImageRef WKBundlePageCreateSnapshotWithOptions(WKBundlePageRef pageRef, WKRect
WKImageRef WKBundlePageCreateSnapshotInViewCoordinates(WKBundlePageRef pageRef, WKRect rect, WKImageOptions options)
{
- RefPtr<WebImage> webImage = toImpl(pageRef)->scaledSnapshotWithOptions(toIntRect(rect), 1, snapshotOptionsFromImageOptions(options));
+ SnapshotOptions snapshotOptions = snapshotOptionsFromImageOptions(options);
+ snapshotOptions |= SnapshotOptionsInViewCoordinates;
+ RefPtr<WebImage> webImage = toImpl(pageRef)->scaledSnapshotWithOptions(toIntRect(rect), 1, snapshotOptions);
return toAPI(webImage.release().leakRef());
}
@@ -316,10 +318,10 @@ double WKBundlePageGetBackingScaleFactor(WKBundlePageRef pageRef)
return toImpl(pageRef)->deviceScaleFactor();
}
-void WKBundlePageDeliverIntentToFrame(WKBundlePageRef pageRef, WKBundleFrameRef frameRef, WKIntentDataRef intentRef)
+void WKBundlePageDeliverIntentToFrame(WKBundlePageRef pageRef, WKBundleFrameRef frameRef, WKBundleIntentRef intentRef)
{
#if ENABLE(WEB_INTENTS)
- toImpl(pageRef)->deliverIntentToFrame(toImpl(frameRef)->frameID(), toImpl(intentRef)->store());
+ toImpl(pageRef)->deliverCoreIntentToFrame(toImpl(frameRef)->frameID(), toImpl(intentRef)->coreIntent());
#endif
}
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
index 28eee5c73..8bc7670cf 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
@@ -410,7 +410,7 @@ WK_EXPORT WKImageRef WKBundlePageCreateScaledSnapshotInDocumentCoordinates(WKBun
WK_EXPORT double WKBundlePageGetBackingScaleFactor(WKBundlePageRef page);
-WK_EXPORT void WKBundlePageDeliverIntentToFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKIntentDataRef intent);
+WK_EXPORT void WKBundlePageDeliverIntentToFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleIntentRef intent);
#if defined(ENABLE_INSPECTOR) && ENABLE_INSPECTOR
WK_EXPORT WKBundleInspectorRef WKBundlePageGetInspector(WKBundlePageRef page);
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntent.cpp b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntent.cpp
new file mode 100644
index 000000000..92de61c6c
--- /dev/null
+++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntent.cpp
@@ -0,0 +1,100 @@
+/*
+ * 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 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 "InjectedBundleIntent.h"
+
+#if ENABLE(WEB_INTENTS)
+
+#include "ImmutableArray.h"
+#include "ImmutableDictionary.h"
+#include "WebSerializedScriptValue.h"
+#include "WebString.h"
+#include "WebURL.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+PassRefPtr<InjectedBundleIntent> InjectedBundleIntent::create(WebCore::Intent* intent)
+{
+ return adoptRef(new InjectedBundleIntent(intent));
+}
+
+InjectedBundleIntent::InjectedBundleIntent(WebCore::Intent* intent)
+ : m_intent(intent)
+{
+}
+
+String InjectedBundleIntent::action() const
+{
+ return m_intent->action();
+}
+
+String InjectedBundleIntent::payloadType() const
+{
+ return m_intent->type();
+}
+
+WebCore::KURL InjectedBundleIntent::service() const
+{
+ return m_intent->service();
+}
+
+PassRefPtr<WebSerializedScriptValue> InjectedBundleIntent::data() const
+{
+ return WebSerializedScriptValue::create(m_intent->data());
+}
+
+String InjectedBundleIntent::extra(const String& key) const
+{
+ return m_intent->extras().get(key);
+}
+
+PassRefPtr<ImmutableDictionary> InjectedBundleIntent::extras() const
+{
+ const HashMap<String, String>& extras = m_intent->extras();
+ ImmutableDictionary::MapType wkExtras;
+ HashMap<String, String>::const_iterator end = extras.end();
+ for (HashMap<String, String>::const_iterator it = extras.begin(); it != end; ++it)
+ wkExtras.set(it->first, WebString::create(it->second));
+
+ return ImmutableDictionary::adopt(wkExtras);
+}
+
+PassRefPtr<ImmutableArray> InjectedBundleIntent::suggestions() const
+{
+ const Vector<KURL>& suggestions = m_intent->suggestions();
+ const size_t numSuggestions = suggestions.size();
+ Vector<RefPtr<APIObject> > wkSuggestions(numSuggestions);
+ for (unsigned i = 0; i < numSuggestions; ++i)
+ wkSuggestions[i] = WebURL::create(suggestions[i]);
+
+ return ImmutableArray::adopt(wkSuggestions);
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(WEB_INTENTS)
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntent.h b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntent.h
new file mode 100644
index 000000000..5d3f06c7b
--- /dev/null
+++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntent.h
@@ -0,0 +1,72 @@
+/*
+ * 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 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 InjectedBundleIntent_h
+#define InjectedBundleIntent_h
+
+#if ENABLE(WEB_INTENTS)
+
+#include "APIObject.h"
+#include <WebCore/Intent.h>
+#include <WebCore/KURL.h>
+#include <wtf/Forward.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+
+namespace WebKit {
+
+class ImmutableArray;
+class ImmutableDictionary;
+class WebSerializedScriptValue;
+
+class InjectedBundleIntent : public APIObject {
+public:
+ static const Type APIType = TypeBundleIntent;
+
+ static PassRefPtr<InjectedBundleIntent> create(WebCore::Intent*);
+
+ String action() const;
+ String payloadType() const;
+ WebCore::KURL service() const;
+ PassRefPtr<WebSerializedScriptValue> data() const;
+ String extra(const String& key) const;
+ PassRefPtr<ImmutableDictionary> extras() const;
+ PassRefPtr<ImmutableArray> suggestions() const;
+
+ WebCore::Intent* coreIntent() const { return m_intent.get(); }
+
+private:
+ explicit InjectedBundleIntent(WebCore::Intent*);
+
+ virtual Type type() const { return APIType; }
+
+ RefPtr<WebCore::Intent> m_intent;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(WEB_INTENTS)
+
+#endif // InjectedBundleIntent_h
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntentRequest.cpp b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntentRequest.cpp
index 5ccb19cad..eac0b83bd 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntentRequest.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntentRequest.cpp
@@ -27,6 +27,7 @@
#include "InjectedBundleIntentRequest.h"
#if ENABLE(WEB_INTENTS)
+#include "InjectedBundleIntent.h"
#include <WebCore/IntentRequest.h>
#include <WebSerializedScriptValue.h>
@@ -54,9 +55,9 @@ void InjectedBundleIntentRequest::postFailure(WebSerializedScriptValue* data)
m_intentRequest->postFailure(static_cast<SerializedScriptValue*>(data->internalRepresentation()));
}
-PassRefPtr<WebIntentData> InjectedBundleIntentRequest::intent() const
+PassRefPtr<InjectedBundleIntent> InjectedBundleIntentRequest::intent() const
{
- return WebIntentData::create(IntentData(m_intentRequest->intent()));
+ return InjectedBundleIntent::create(m_intentRequest->intent());
}
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntentRequest.h b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntentRequest.h
index b5870d9a2..33a31922f 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntentRequest.h
+++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntentRequest.h
@@ -29,7 +29,6 @@
#if ENABLE(WEB_INTENTS)
#include "APIObject.h"
-#include "WebIntentData.h"
#include <wtf/Forward.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
@@ -40,6 +39,7 @@ class IntentRequest;
namespace WebKit {
+class InjectedBundleIntent;
class WebSerializedScriptValue;
class InjectedBundleIntentRequest : public APIObject {
@@ -51,7 +51,7 @@ public:
void postResult(WebSerializedScriptValue*);
void postFailure(WebSerializedScriptValue*);
- PassRefPtr<WebIntentData> intent() const;
+ PassRefPtr<InjectedBundleIntent> intent() const;
private:
explicit InjectedBundleIntentRequest(WebCore::IntentRequest*);
diff --git a/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp b/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp
index 4edfe5a4e..6d89fc0c9 100644
--- a/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp
+++ b/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp
@@ -55,8 +55,11 @@ PassRefPtr<NotificationPermissionRequestManager> NotificationPermissionRequestMa
}
NotificationPermissionRequestManager::NotificationPermissionRequestManager(WebPage* page)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
: m_page(page)
+#endif
{
+ (void)page;
}
#if ENABLE(NOTIFICATIONS)
diff --git a/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.h b/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.h
index 3b3799ae3..138a184cb 100644
--- a/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.h
+++ b/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.h
@@ -72,7 +72,9 @@ private:
HashMap<RefPtr<WebCore::SecurityOrigin>, uint64_t> m_originToIDMap;
HashMap<uint64_t, RefPtr<WebCore::SecurityOrigin> > m_idToOriginMap;
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
WebPage* m_page;
+#endif
};
inline bool isRequestIDValid(uint64_t id)
diff --git a/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp b/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
index 17db25708..e380eef94 100644
--- a/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
@@ -199,10 +199,12 @@ void PluginProxy::didFailToCreatePluginInternal()
void PluginProxy::destroy()
{
- m_connection->connection()->sendSync(Messages::WebProcessConnection::DestroyPlugin(m_pluginInstanceID, m_waitingOnAsynchronousInitialization), Messages::WebProcessConnection::DestroyPlugin::Reply(), 0);
-
m_isStarted = false;
+ if (!m_connection)
+ return;
+
+ m_connection->connection()->sendSync(Messages::WebProcessConnection::DestroyPlugin(m_pluginInstanceID, m_waitingOnAsynchronousInitialization), Messages::WebProcessConnection::DestroyPlugin::Reply(), 0);
m_connection->removePluginProxy(this);
}
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
index ceccd6af1..a3c0cc14a 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -1356,9 +1356,6 @@ PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugIn
void WebFrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget)
{
- ASSERT(!m_pluginView);
- ASSERT(pluginWidget);
-
m_pluginView = static_cast<PluginView*>(pluginWidget);
}
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
index c14798c6d..5d250ea59 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
@@ -34,6 +34,7 @@
#include "WebCookieManager.h"
#include "WebCoreArgumentCoders.h"
#include "WebProcess.h"
+#include "WebProcessProxyMessages.h"
#include <WebCore/Color.h>
#include <WebCore/KURL.h>
#include <WebCore/Page.h>
@@ -130,7 +131,7 @@ void WebPlatformStrategies::populatePluginCache()
// FIXME: Should we do something in case of error here?
uint64_t requestID = generateRequestID();
- WebProcess::shared().connection()->send(Messages::WebContext::GetPlugins(requestID, m_shouldRefreshPlugins), 0);
+ WebProcess::shared().connection()->send(Messages::WebProcessProxy::GetPlugins(requestID, m_shouldRefreshPlugins), 0);
m_cachedPlugins = *responseMap().waitForResponse(requestID);
diff --git a/Source/WebKit2/WebProcess/WebPage/AreaAllocator.cpp b/Source/WebKit2/WebProcess/WebPage/AreaAllocator.cpp
new file mode 100644
index 000000000..602efeb5f
--- /dev/null
+++ b/Source/WebKit2/WebProcess/WebPage/AreaAllocator.cpp
@@ -0,0 +1,331 @@
+/*
+ * 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 Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "config.h"
+
+#include "AreaAllocator.h"
+
+namespace WebKit {
+
+AreaAllocator::AreaAllocator(const WebCore::IntSize& size)
+ : m_size(size)
+ , m_minAlloc(1, 1)
+ , m_margin(0, 0)
+{
+}
+
+AreaAllocator::~AreaAllocator()
+{
+}
+
+void AreaAllocator::expand(const WebCore::IntSize& size)
+{
+ m_size = m_size.expandedTo(size);
+}
+
+void AreaAllocator::expandBy(const WebCore::IntSize& size)
+{
+ m_size += size;
+}
+
+void AreaAllocator::release(const WebCore::IntRect&)
+{
+}
+
+int AreaAllocator::overhead() const
+{
+ return 0;
+}
+
+WebCore::IntSize AreaAllocator::roundAllocation(const WebCore::IntSize& size) const
+{
+ int width = size.width() + m_margin.width();
+ int height = size.height() + m_margin.height();
+ int extra = width % m_minAlloc.width();
+ if (extra)
+ width += m_minAlloc.width() - extra;
+ extra = height % m_minAlloc.height();
+ if (extra)
+ height += m_minAlloc.height() - extra;
+
+ return WebCore::IntSize(width, height);
+}
+
+GeneralAreaAllocator::GeneralAreaAllocator(const WebCore::IntSize& size)
+ : AreaAllocator(WebCore::nextPowerOfTwo(size))
+{
+ m_root = new Node();
+ m_root->rect = WebCore::IntRect(0, 0, m_size.width(), m_size.height());
+ m_root->largestFree = m_size;
+ m_root->parent = 0;
+ m_root->left = 0;
+ m_root->right = 0;
+ m_nodeCount = 1;
+ setMinimumAllocation(WebCore::IntSize(8, 8));
+}
+
+GeneralAreaAllocator::~GeneralAreaAllocator()
+{
+ freeNode(m_root);
+}
+
+void GeneralAreaAllocator::freeNode(Node* node)
+{
+ if (node) {
+ freeNode(node->left);
+ freeNode(node->right);
+ }
+ delete node;
+}
+
+void GeneralAreaAllocator::expand(const WebCore::IntSize& size)
+{
+ AreaAllocator::expand(WebCore::nextPowerOfTwo(size));
+
+ if (m_root->rect.size() == m_size)
+ return; // No change.
+
+ if (!m_root->left && m_root->largestFree.width() > 0) {
+ // No allocations have occurred, so just adjust the root size.
+ m_root->rect = WebCore::IntRect(0, 0, m_size.width(), m_size.height());
+ m_root->largestFree = m_size;
+ return;
+ }
+
+ // Add extra nodes above the current root to expand the tree.
+ Node* oldRoot = m_root;
+ Split split;
+ if (m_size.width() >= m_size.height())
+ split = SplitOnX;
+ else
+ split = SplitOnY;
+
+ while (m_root->rect.size() != m_size) {
+ if (m_root->rect.width() == m_size.width())
+ split = SplitOnY;
+ else if (m_root->rect.height() == m_size.height())
+ split = SplitOnX;
+ Node* parent = new Node();
+ Node* right = new Node();
+ m_nodeCount += 2;
+ m_root->parent = parent;
+ parent->parent = 0;
+ parent->left = m_root;
+ parent->right = right;
+ parent->largestFree = m_root->rect.size();
+ right->parent = parent;
+ right->left = 0;
+ right->right = 0;
+ right->largestFree = m_root->rect.size();
+ if (split == SplitOnX) {
+ parent->rect = WebCore::IntRect(m_root->rect.x(), m_root->rect.y(),
+ m_root->rect.width() * 2, m_root->rect.height());
+ right->rect = WebCore::IntRect(m_root->rect.x() + m_root->rect.width(), m_root->rect.y(),
+ m_root->rect.width(), m_root->rect.height());
+ } else {
+ parent->rect = WebCore::IntRect(m_root->rect.x(), m_root->rect.y(),
+ m_root->rect.width(), m_root->rect.height() * 2);
+ right->rect = WebCore::IntRect(m_root->rect.x(), m_root->rect.y() + m_root->rect.width(),
+ m_root->rect.width(), m_root->rect.height());
+ }
+ split = (split == SplitOnX ? SplitOnY : SplitOnX);
+ m_root = parent;
+ }
+ updateLargestFree(oldRoot);
+}
+
+static inline bool fitsWithin(const WebCore::IntSize& size1, const WebCore::IntSize& size2)
+{
+ return size1.width() <= size2.width() && size1.height() <= size2.height();
+}
+
+WebCore::IntRect GeneralAreaAllocator::allocate(const WebCore::IntSize& size)
+{
+ WebCore::IntSize rounded = roundAllocation(size);
+ rounded = WebCore::nextPowerOfTwo(rounded);
+ if (rounded.width() <= 0 || rounded.width() > m_size.width()
+ || rounded.height() <= 0 || rounded.height() > m_size.height())
+ return WebCore::IntRect();
+
+ WebCore::IntPoint point = allocateFromNode(rounded, m_root);
+ if (point.x() >= 0)
+ return WebCore::IntRect(point, size);
+ return WebCore::IntRect();
+}
+
+WebCore::IntPoint GeneralAreaAllocator::allocateFromNode(const WebCore::IntSize& size, Node* node)
+{
+ // Find the best node to insert into, which should be
+ // a node with the least amount of unused space that is
+ // big enough to contain the requested size.
+ while (node) {
+ // Go down a level and determine if the left or right
+ // sub-tree contains the best chance of allocation.
+ Node* left = node->left;
+ Node* right = node->right;
+ if (left && fitsWithin(size, left->largestFree)) {
+ if (right && fitsWithin(size, right->largestFree)) {
+ if (left->largestFree.width() < right->largestFree.width()
+ || left->largestFree.height() < right->largestFree.height()) {
+ // The largestFree values may be a little oversized,
+ // so try the left sub-tree and then the right sub-tree.
+ WebCore::IntPoint point = allocateFromNode(size, left);
+ if (point.x() >= 0)
+ return point;
+ return allocateFromNode(size, right);
+ }
+ node = right;
+ } else
+ node = left;
+ } else if (right && fitsWithin(size, right->largestFree))
+ node = right;
+ else if (left || right) {
+ // Neither sub-node has enough space to allocate from.
+ return WebCore::IntPoint(-1, -1);
+ } else if (fitsWithin(size, node->largestFree)) {
+ // Do we need to split this node into smaller pieces?
+ Split split;
+ if (fitsWithin(WebCore::IntSize(size.width() * 2, size.height() * 2), node->largestFree)) {
+ // Split in either direction: choose the inverse of
+ // the parent node's split direction to try to balance
+ // out the wasted space as further subdivisions happen.
+ if (node->parent
+ && node->parent->left->rect.x() == node->parent->right->rect.x())
+ split = SplitOnX;
+ else if (node->parent)
+ split = SplitOnY;
+ else if (node->rect.width() >= node->rect.height())
+ split = SplitOnX;
+ else
+ split = SplitOnY;
+ } else if (fitsWithin(WebCore::IntSize(size.width() * 2, size.height()), node->largestFree)) {
+ // Split along the X direction.
+ split = SplitOnX;
+ } else if (fitsWithin(WebCore::IntSize(size.width(), size.height() * 2), node->largestFree)) {
+ // Split along the Y direction.
+ split = SplitOnY;
+ } else {
+ // Cannot split further - allocate this node.
+ node->largestFree = WebCore::IntSize(0, 0);
+ updateLargestFree(node);
+ return node->rect.location();
+ }
+
+ // Split the node, then go around again using the left sub-tree.
+ node = splitNode(node, split);
+ } else {
+ // Cannot possibly fit into this node.
+ break;
+ }
+ }
+ return WebCore::IntPoint(-1, -1);
+}
+
+GeneralAreaAllocator::Node* GeneralAreaAllocator::splitNode
+ (Node* node, Split split)
+{
+ Node* left = new Node();
+ Node* right = new Node();
+ m_nodeCount += 2;
+ left->parent = node;
+ left->left = 0;
+ left->right = 0;
+ right->parent = node;
+ right->left = 0;
+ right->right = 0;
+ node->left = left;
+ node->right = right;
+
+ if (split == SplitOnX) {
+ left->rect = WebCore::IntRect(node->rect.x(), node->rect.y(),
+ node->rect.width() / 2, node->rect.height());
+ right->rect = WebCore::IntRect(left->rect.maxX(), node->rect.y(),
+ node->rect.width() / 2, node->rect.height());
+ } else {
+ left->rect = WebCore::IntRect(node->rect.x(), node->rect.y(),
+ node->rect.width(), node->rect.height() / 2);
+ right->rect = WebCore::IntRect(node->rect.x(), left->rect.maxY(),
+ node->rect.width(), node->rect.height() / 2);
+ }
+
+ left->largestFree = left->rect.size();
+ right->largestFree = right->rect.size();
+ node->largestFree = right->largestFree;
+ return left;
+}
+
+void GeneralAreaAllocator::updateLargestFree(Node* node)
+{
+ while ((node = node->parent)) {
+ node->largestFree = WebCore::IntSize(
+ std::max(node->left->largestFree.width(), node->right->largestFree.width()),
+ std::max(node->left->largestFree.height(), node->right->largestFree.height())
+ );
+ }
+}
+
+void GeneralAreaAllocator::release(const WebCore::IntRect& rect)
+{
+ // Locate the node that contains the allocated region.
+ Node* node = m_root;
+ WebCore::IntPoint point = rect.location();
+ while (node) {
+ if (node->left && node->left->rect.contains(point))
+ node = node->left;
+ else if (node->right && node->right->rect.contains(point))
+ node = node->right;
+ else if (node->rect.contains(point))
+ break;
+ else
+ return; // Point is completely outside the tree.
+ }
+ if (!node)
+ return;
+
+ // Mark the node as free and then work upwards through the tree
+ // recombining and deleting nodes until we reach a sibling
+ // that is still allocated.
+ node->largestFree = node->rect.size();
+ while (node->parent) {
+ if (node->parent->left == node) {
+ if (node->parent->right->largestFree != node->parent->right->rect.size())
+ break;
+ } else {
+ if (node->parent->left->largestFree != node->parent->left->rect.size())
+ break;
+ }
+ node = node->parent;
+ freeNode(node->left);
+ freeNode(node->right);
+ m_nodeCount -= 2;
+ node->left = 0;
+ node->right = 0;
+ node->largestFree = node->rect.size();
+ }
+
+ // Make the rest of our ancestors have the correct "largest free size".
+ updateLargestFree(node);
+}
+
+int GeneralAreaAllocator::overhead() const
+{
+ return m_nodeCount * sizeof(Node);
+}
+
+} // namespace
diff --git a/Source/WebKit2/WebProcess/WebPage/AreaAllocator.h b/Source/WebKit2/WebProcess/WebPage/AreaAllocator.h
new file mode 100644
index 000000000..ae88716c8
--- /dev/null
+++ b/Source/WebKit2/WebProcess/WebPage/AreaAllocator.h
@@ -0,0 +1,110 @@
+/*
+ * 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 Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifndef AreaAllocator_h
+#define AreaAllocator_h
+
+#include <IntPoint.h>
+#include <IntRect.h>
+#include <IntSize.h>
+
+namespace WebCore {
+inline int nextPowerOfTwo(int number)
+{
+ // This is a fast trick to get nextPowerOfTwo for an integer.
+ --number;
+ number |= number >> 1;
+ number |= number >> 2;
+ number |= number >> 4;
+ number |= number >> 8;
+ number |= number >> 16;
+ number++;
+ return number;
+}
+
+inline IntSize nextPowerOfTwo(const IntSize& size)
+{
+ return IntSize(nextPowerOfTwo(size.width()), nextPowerOfTwo(size.height()));
+}
+} // namespace WebCore
+
+namespace WebKit {
+
+class AreaAllocator {
+public:
+ AreaAllocator(const WebCore::IntSize&);
+ virtual ~AreaAllocator();
+
+ WebCore::IntSize size() const { return m_size; }
+
+ WebCore::IntSize minimumAllocation() const { return m_minAlloc; }
+ void setMinimumAllocation(const WebCore::IntSize& size) { m_minAlloc = size; }
+
+ WebCore::IntSize margin() const { return m_margin; }
+ void setMargin(const WebCore::IntSize &margin) { m_margin = margin; }
+
+ virtual void expand(const WebCore::IntSize&);
+ void expandBy(const WebCore::IntSize&);
+
+ virtual WebCore::IntRect allocate(const WebCore::IntSize&) = 0;
+ virtual void release(const WebCore::IntRect&);
+
+ virtual int overhead() const;
+
+protected:
+ WebCore::IntSize m_size;
+ WebCore::IntSize m_minAlloc;
+ WebCore::IntSize m_margin;
+
+ WebCore::IntSize roundAllocation(const WebCore::IntSize&) const;
+};
+
+class GeneralAreaAllocator : public AreaAllocator {
+public:
+ GeneralAreaAllocator(const WebCore::IntSize&);
+ virtual ~GeneralAreaAllocator();
+
+ void expand(const WebCore::IntSize&);
+ WebCore::IntRect allocate(const WebCore::IntSize&);
+ void release(const WebCore::IntRect&);
+ int overhead() const;
+
+private:
+ enum Split { SplitOnX, SplitOnY };
+
+ struct Node {
+ WebCore::IntRect rect;
+ WebCore::IntSize largestFree;
+ Node* parent;
+ Node* left;
+ Node* right;
+ };
+
+ Node* m_root;
+ int m_nodeCount;
+
+ static void freeNode(Node*);
+ WebCore::IntPoint allocateFromNode(const WebCore::IntSize&, Node*);
+ Node* splitNode(Node*, Split);
+ static void updateLargestFree(Node*);
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp
index 26a7ddb29..141d2e603 100644
--- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp
@@ -529,8 +529,10 @@ void CoordinatedGraphicsLayer::syncCanvas()
return;
#if USE(GRAPHICS_SURFACE)
- uint32_t graphicsSurfaceToken = m_canvasPlatformLayer->copyToGraphicsSurface();
- m_CoordinatedGraphicsLayerClient->syncCanvas(m_id, IntSize(size().width(), size().height()), graphicsSurfaceToken);
+ uint32_t frontBuffer = m_canvasPlatformLayer->copyToGraphicsSurface();
+ uint64_t token = m_canvasPlatformLayer->graphicsSurfaceToken();
+
+ m_CoordinatedGraphicsLayerClient->syncCanvas(m_id, IntSize(size().width(), size().height()), token, frontBuffer);
#endif
m_canvasNeedsDisplay = false;
}
diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h
index 25ccd9454..f4ea2fb92 100644
--- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h
+++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h
@@ -62,7 +62,7 @@ public:
virtual void syncLayerFilters(WebLayerID, const WebCore::FilterOperations&) = 0;
#endif
#if PLATFORM(QT)
- virtual void syncCanvas(WebLayerID, const WebCore::IntSize& canvasSize, uint32_t graphicsSurfaceToken) = 0;
+ virtual void syncCanvas(WebLayerID, const WebCore::IntSize& canvasSize, uint64_t graphicsSurfaceToken, uint32_t frontBuffer) = 0;
#endif
virtual void setLayerAnimatedOpacity(WebLayerID, float) = 0;
diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp
index 7095c438b..a3a572907 100644
--- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp
@@ -298,10 +298,10 @@ void LayerTreeCoordinator::syncLayerChildren(WebLayerID id, const Vector<WebLaye
m_webPage->send(Messages::LayerTreeCoordinatorProxy::SetCompositingLayerChildren(id, children));
}
-void LayerTreeCoordinator::syncCanvas(WebLayerID id, const IntSize& canvasSize, uint32_t graphicsSurfaceToken)
+void LayerTreeCoordinator::syncCanvas(WebLayerID id, const IntSize& canvasSize, uint64_t graphicsSurfaceToken, uint32_t frontBuffer)
{
m_shouldSyncFrame = true;
- m_webPage->send(Messages::LayerTreeCoordinatorProxy::SyncCanvas(id, canvasSize, graphicsSurfaceToken));
+ m_webPage->send(Messages::LayerTreeCoordinatorProxy::SyncCanvas(id, canvasSize, graphicsSurfaceToken, frontBuffer));
}
#if ENABLE(CSS_FILTERS)
@@ -601,7 +601,7 @@ void LayerTreeCoordinator::renderNextFrame()
m_waitingForUIProcess = false;
scheduleLayerFlush();
for (int i = 0; i < m_updateAtlases.size(); ++i)
- m_updateAtlases[i].didSwapBuffers();
+ m_updateAtlases[i]->didSwapBuffers();
}
bool LayerTreeCoordinator::layerTreeTileUpdatesAllowed() const
@@ -623,18 +623,18 @@ PassOwnPtr<WebCore::GraphicsContext> LayerTreeCoordinator::beginContentUpdate(co
{
OwnPtr<WebCore::GraphicsContext> graphicsContext;
for (int i = 0; i < m_updateAtlases.size(); ++i) {
- UpdateAtlas& atlas = m_updateAtlases[i];
- if (atlas.flags() == flags) {
+ UpdateAtlas* atlas = m_updateAtlases[i].get();
+ if (atlas->flags() == flags) {
// This will return null if there is no available buffer space.
- graphicsContext = atlas.beginPaintingOnAvailableBuffer(handle, size, offset);
+ graphicsContext = atlas->beginPaintingOnAvailableBuffer(handle, size, offset);
if (graphicsContext)
return graphicsContext.release();
}
}
- static const int ScratchBufferDimension = 2000;
- m_updateAtlases.append(UpdateAtlas(ScratchBufferDimension, flags));
- return m_updateAtlases.last().beginPaintingOnAvailableBuffer(handle, size, offset);
+ static const int ScratchBufferDimension = 1024; // Should be a power of two.
+ m_updateAtlases.append(adoptPtr(new UpdateAtlas(ScratchBufferDimension, flags)));
+ return m_updateAtlases.last()->beginPaintingOnAvailableBuffer(handle, size, offset);
}
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h
index 3fd59d218..c8ef54a68 100644
--- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h
+++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h
@@ -85,7 +85,7 @@ public:
#if ENABLE(CSS_FILTERS)
virtual void syncLayerFilters(WebLayerID, const WebCore::FilterOperations&);
#endif
- virtual void syncCanvas(WebLayerID, const WebCore::IntSize& canvasSize, uint32_t graphicsSurfaceToken) OVERRIDE;
+ virtual void syncCanvas(WebLayerID, const WebCore::IntSize& canvasSize, uint64_t graphicsSurfaceToken, uint32_t frontBuffer) OVERRIDE;
virtual void attachLayer(WebCore::CoordinatedGraphicsLayer*);
virtual void detachLayer(WebCore::CoordinatedGraphicsLayer*);
virtual void syncFixedLayers();
@@ -123,7 +123,7 @@ private:
HashSet<WebCore::CoordinatedGraphicsLayer*> m_registeredLayers;
HashMap<int64_t, int> m_directlyCompositedImageRefCounts;
- Vector<UpdateAtlas> m_updateAtlases;
+ Vector<OwnPtr<UpdateAtlas> > m_updateAtlases;
bool m_notifyAfterScheduledLayerFlush;
bool m_isValid;
diff --git a/Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp b/Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp
index 82af01d73..60b9c9744 100644
--- a/Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp
@@ -105,9 +105,9 @@ void TapHighlightController::drawRect(PageOverlay* pageOverlay, GraphicsContext&
{
GraphicsContextStateSaver stateSaver(context);
if (m_webPage->drawingArea()->pageOverlayShouldApplyFadeWhenPainting())
- context.setFillColor(highlightColor(m_color, pageOverlay->fractionFadedIn()), ColorSpaceSRGB);
+ context.setFillColor(highlightColor(m_color, pageOverlay->fractionFadedIn() * 0.5f), ColorSpaceSRGB);
else
- context.setFillColor(m_color, ColorSpaceSRGB);
+ context.setFillColor(highlightColor(m_color, 0.5f), ColorSpaceSRGB);
context.fillPath(m_path);
}
}
diff --git a/Source/WebKit2/WebProcess/WebPage/UpdateAtlas.cpp b/Source/WebKit2/WebProcess/WebPage/UpdateAtlas.cpp
index 58869f399..10a35d885 100644
--- a/Source/WebKit2/WebProcess/WebPage/UpdateAtlas.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/UpdateAtlas.cpp
@@ -25,6 +25,7 @@
#include "GraphicsContext.h"
#include "IntRect.h"
#include <wtf/MathExtras.h>
+
using namespace WebCore;
namespace WebKit {
@@ -32,112 +33,48 @@ namespace WebKit {
UpdateAtlas::UpdateAtlas(int dimension, ShareableBitmap::Flags flags)
: m_flags(flags)
{
- m_surface = ShareableSurface::create(IntSize(dimension, dimension), flags, ShareableSurface::SupportsGraphicsSurface);
-}
-
-static int nextPowerOfTwo(int number)
-{
- // This is a fast trick to get nextPowerOfTwo for an integer.
- --number;
- number |= number >> 1;
- number |= number >> 2;
- number |= number >> 4;
- number |= number >> 8;
- number |= number >> 16;
- number++;
- return number;
+ IntSize size = nextPowerOfTwo(IntSize(dimension, dimension));
+ m_surface = ShareableSurface::create(size, flags, ShareableSurface::SupportsGraphicsSurface);
}
void UpdateAtlas::buildLayoutIfNeeded()
{
- if (!m_layout.isEmpty())
- return;
-
- static const int MinTileSize = 32;
- static const int MaxTileSize = 512;
-
- // Divide our square to square power-of-two boxes.
- for (int cursor = 0; cursor < size().width(); ) {
- int remainder = size().width() - cursor;
- int dimension = std::min(remainder, std::min(MaxTileSize, std::max(MinTileSize, nextPowerOfTwo(remainder / 2))));
- cursor += dimension;
- m_layout.append(dimension);
+ if (!m_areaAllocator) {
+ m_areaAllocator = adoptPtr(new GeneralAreaAllocator(size()));
+ m_areaAllocator->setMinimumAllocation(IntSize(32, 32));
}
-
- m_bufferStates.resize(m_layout.size() * m_layout.size());
- for (int i = 0; i < m_bufferStates.size(); ++i)
- m_bufferStates[i] = Available;
-}
-
-int UpdateAtlas::findAvailableIndex(const WebCore::IntSize& size)
-{
- int dimension = m_layout.size();
- int stride = dimension;
- int requiredDimension = std::max(size.width(), size.height());
-
- // Begin from the smallest buffer, until we reach the smallest available buffer that's big enough to contain our rect.
- for (int i = m_bufferStates.size() - 1; i >= 0; i -= (dimension + 1), --stride) {
- // Need a bigger buffer.
- if (m_layout[i / dimension] < requiredDimension)
- continue;
-
- // Check all buffers of current size, to find an available one.
- for (int offset = 0; offset < stride; ++offset) {
- int index = i - offset;
- if (m_bufferStates[index] == Available)
- return index;
- }
- }
-
- return -1;
}
void UpdateAtlas::didSwapBuffers()
{
+ m_areaAllocator.clear();
buildLayoutIfNeeded();
- for (int i = 0; i < m_bufferStates.size(); ++i)
- m_bufferStates[i] = Available;
}
PassOwnPtr<GraphicsContext> UpdateAtlas::beginPaintingOnAvailableBuffer(ShareableSurface::Handle& handle, const WebCore::IntSize& size, IntPoint& offset)
{
buildLayoutIfNeeded();
- int index = findAvailableIndex(size);
+ IntRect rect = m_areaAllocator->allocate(size);
// No available buffer was found, returning null.
- if (index < 0)
+ if (rect.isEmpty())
return PassOwnPtr<GraphicsContext>();
if (!m_surface->createHandle(handle))
return PassOwnPtr<WebCore::GraphicsContext>();
// FIXME: Use tri-state buffers, to allow faster updates.
- m_bufferStates[index] = Taken;
- offset = offsetForIndex(index);
- IntRect rect(IntPoint::zero(), size);
- OwnPtr<GraphicsContext> graphicsContext = m_surface->createGraphicsContext(IntRect(offset, size));
+ offset = rect.location();
+ OwnPtr<GraphicsContext> graphicsContext = m_surface->createGraphicsContext(rect);
if (flags() & ShareableBitmap::SupportsAlpha) {
graphicsContext->setCompositeOperation(CompositeCopy);
- graphicsContext->fillRect(rect, Color::transparent, ColorSpaceDeviceRGB);
+ graphicsContext->fillRect(IntRect(IntPoint::zero(), size), Color::transparent, ColorSpaceDeviceRGB);
graphicsContext->setCompositeOperation(CompositeSourceOver);
}
return graphicsContext.release();
}
-IntPoint UpdateAtlas::offsetForIndex(int index) const
-{
- IntPoint coord(index % m_layout.size(), index / m_layout.size());
- int x = 0;
- int y = 0;
- for (int i = 0; i < coord.x(); ++i)
- x += m_layout[i];
- for (int i = 0; i < coord.y(); ++i)
- y += m_layout[i];
-
- return IntPoint(x, y);
-}
-
}
#endif
diff --git a/Source/WebKit2/WebProcess/WebPage/UpdateAtlas.h b/Source/WebKit2/WebProcess/WebPage/UpdateAtlas.h
index 7d2223769..774ccfdd3 100644
--- a/Source/WebKit2/WebProcess/WebPage/UpdateAtlas.h
+++ b/Source/WebKit2/WebProcess/WebPage/UpdateAtlas.h
@@ -20,17 +20,20 @@
#ifndef UpdateAtlas_h
#define UpdateAtlas_h
+#include "AreaAllocator.h"
+#include "IntSize.h"
#include "ShareableSurface.h"
#if USE(COORDINATED_GRAPHICS)
namespace WebCore {
class GraphicsContext;
-class IntRect;
+class IntPoint;
}
namespace WebKit {
class UpdateAtlas {
+ WTF_MAKE_NONCOPYABLE(UpdateAtlas);
public:
UpdateAtlas(int dimension, ShareableBitmap::Flags);
@@ -43,17 +46,9 @@ public:
private:
void buildLayoutIfNeeded();
- WebCore::IntPoint offsetForIndex(int) const;
- int findAvailableIndex(const WebCore::IntSize&);
private:
- enum State {
- Available,
- Taken
- };
-
- Vector<State> m_bufferStates;
- Vector<int> m_layout;
+ OwnPtr<GeneralAreaAllocator> m_areaAllocator;
ShareableBitmap::Flags m_flags;
RefPtr<ShareableSurface> m_surface;
};
diff --git a/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp b/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
index f36fc0238..fd6f4c8d2 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
@@ -63,6 +63,8 @@
#include "IntentData.h"
#include <WebCore/DOMWindowIntents.h>
#include <WebCore/DeliveredIntent.h>
+#include <WebCore/Intent.h>
+#include <WebCore/PlatformMessagePortChannel.h>
#endif
#if PLATFORM(MAC) || PLATFORM(WIN)
@@ -246,12 +248,38 @@ void WebFrame::convertHandleToDownload(ResourceHandle* handle, const ResourceReq
void WebFrame::deliverIntent(const IntentData& intentData)
{
OwnPtr<DeliveredIntentClient> dummyClient;
- OwnPtr<MessagePortArray> dummyPorts;
Vector<uint8_t> dataCopy = intentData.data;
+
+ OwnPtr<WebCore::MessagePortChannelArray> channels;
+ if (!intentData.messagePorts.isEmpty()) {
+ channels = adoptPtr(new WebCore::MessagePortChannelArray(intentData.messagePorts.size()));
+ for (size_t i = 0; i < intentData.messagePorts.size(); ++i)
+ (*channels)[i] = MessagePortChannel::create(WebProcess::shared().messagePortChannel(intentData.messagePorts.at(i)));
+ }
+ OwnPtr<WebCore::MessagePortArray> messagePorts = WebCore::MessagePort::entanglePorts(*m_coreFrame->document()->domWindow()->scriptExecutionContext(), channels.release());
+
RefPtr<DeliveredIntent> deliveredIntent = DeliveredIntent::create(m_coreFrame, dummyClient.release(), intentData.action, intentData.type,
- SerializedScriptValue::adopt(dataCopy), dummyPorts.release(),
+ SerializedScriptValue::adopt(dataCopy), messagePorts.release(),
intentData.extras);
- WebCore::DOMWindowIntents::from(m_coreFrame->domWindow())->deliver(deliveredIntent.release());
+ WebCore::DOMWindowIntents::from(m_coreFrame->document()->domWindow())->deliver(deliveredIntent.release());
+}
+
+void WebFrame::deliverIntent(WebCore::Intent* intent)
+{
+ OwnPtr<DeliveredIntentClient> dummyClient;
+
+ OwnPtr<WebCore::MessagePortChannelArray> channels;
+ WebCore::MessagePortChannelArray* origChannels = intent->messagePorts();
+ if (origChannels && origChannels->size()) {
+ channels = adoptPtr(new WebCore::MessagePortChannelArray(origChannels->size()));
+ for (size_t i = 0; i < origChannels->size(); ++i)
+ (*channels)[i] = origChannels->at(i).release();
+ }
+ OwnPtr<WebCore::MessagePortArray> messagePorts = WebCore::MessagePort::entanglePorts(*m_coreFrame->document()->domWindow()->scriptExecutionContext(), channels.release());
+
+ RefPtr<DeliveredIntent> deliveredIntent = DeliveredIntent::create(m_coreFrame, dummyClient.release(), intent->action(), intent->type(),
+ intent->data(), messagePorts.release(), intent->extras());
+ WebCore::DOMWindowIntents::from(m_coreFrame->document()->domWindow())->deliver(deliveredIntent.release());
}
#endif
@@ -493,7 +521,7 @@ unsigned WebFrame::pendingUnloadCount() const
if (!m_coreFrame)
return 0;
- return m_coreFrame->domWindow()->pendingUnloadEventListeners();
+ return m_coreFrame->document()->domWindow()->pendingUnloadEventListeners();
}
bool WebFrame::allowsFollowingLink(const WebCore::KURL& url) const
diff --git a/Source/WebKit2/WebProcess/WebPage/WebFrame.h b/Source/WebKit2/WebProcess/WebPage/WebFrame.h
index bd6c038ee..eea09b74a 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebFrame.h
+++ b/Source/WebKit2/WebProcess/WebPage/WebFrame.h
@@ -42,6 +42,9 @@
namespace WebCore {
class Frame;
class HTMLFrameOwnerElement;
+#if ENABLE(WEB_INTENTS)
+ class Intent;
+#endif
class KURL;
}
@@ -81,6 +84,7 @@ public:
#if ENABLE(WEB_INTENTS)
void deliverIntent(const IntentData&);
+ void deliverIntent(WebCore::Intent*);
#endif
String source() const;
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
index 59617dfd3..947a06a43 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -140,6 +140,7 @@
#if ENABLE(WEB_INTENTS)
#include "IntentData.h"
+#include <WebCore/Intent.h>
#endif
#if ENABLE(VIBRATION)
@@ -432,8 +433,8 @@ PassRefPtr<Plugin> WebPage::createPlugin(WebFrame* frame, HTMLPlugInElement* plu
bool blocked;
if (!WebProcess::shared().connection()->sendSync(
- Messages::WebContext::GetPluginPath(parameters.mimeType, parameters.url.string()),
- Messages::WebContext::GetPluginPath::Reply(pluginPath, blocked), 0)) {
+ Messages::WebProcessProxy::GetPluginPath(parameters.mimeType, parameters.url.string()),
+ Messages::WebProcessProxy::GetPluginPath::Reply(pluginPath, blocked), 0)) {
return 0;
}
@@ -484,7 +485,7 @@ EditorState WebPage::editorState() const
size_t location = 0;
size_t length = 0;
- Element* selectionRoot = frame->selection()->rootEditableElement();
+ Element* selectionRoot = frame->selection()->rootEditableElementRespectingShadowTree();
Element* scope = selectionRoot ? selectionRoot : frame->document()->documentElement();
if (!scope)
@@ -1114,7 +1115,9 @@ void WebPage::setFixedLayoutSize(const IntSize& size)
return;
view->setFixedLayoutSize(size);
- view->forceLayout();
+ // Do not force it until the first layout, this would then become our first layout prematurely.
+ if (view->didFirstLayout())
+ view->forceLayout();
}
void WebPage::setPaginationMode(uint32_t mode)
@@ -1224,7 +1227,11 @@ PassRefPtr<WebImage> WebPage::scaledSnapshotWithOptions(const IntRect& rect, dou
if (options & SnapshotOptionsExcludeSelectionHighlighting)
shouldPaintSelection = FrameView::ExcludeSelection;
- frameView->paintContentsForSnapshot(graphicsContext.get(), rect, shouldPaintSelection);
+ FrameView::CoordinateSpaceForSnapshot coordinateSpace = FrameView::DocumentCoordinates;
+ if (options & SnapshotOptionsInViewCoordinates)
+ coordinateSpace = FrameView::ViewCoordinates;
+
+ frameView->paintContentsForSnapshot(graphicsContext.get(), rect, shouldPaintSelection, coordinateSpace);
return snapshot.release();
}
@@ -1959,6 +1966,12 @@ void WebPage::deliverIntentToFrame(uint64_t frameID, const IntentData& intentDat
frame->deliverIntent(intentData);
}
+
+void WebPage::deliverCoreIntentToFrame(uint64_t frameID, Intent* coreIntent)
+{
+ if (WebFrame* frame = WebProcess::shared().webFrame(frameID))
+ frame->deliverIntent(coreIntent);
+}
#endif
void WebPage::preferencesDidChange(const WebPreferencesStore& store)
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h
index bbfabd04a..ec5af0e96 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h
@@ -106,6 +106,9 @@ namespace WebCore {
class Frame;
class FrameView;
class HTMLPlugInElement;
+#if ENABLE(WEB_INTENTS)
+ class Intent;
+#endif
class KeyboardEvent;
class Page;
class PrintContext;
@@ -476,7 +479,7 @@ public:
#endif
#if ENABLE(WEB_INTENTS)
- void deliverIntentToFrame(uint64_t frameID, const IntentData&);
+ void deliverCoreIntentToFrame(uint64_t frameID, WebCore::Intent*);
#endif
void replaceSelectionWithText(WebCore::Frame*, const String&);
@@ -641,6 +644,10 @@ private:
void contextMenuHidden() { m_isShowingContextMenu = false; }
#endif
+#if ENABLE(WEB_INTENTS)
+ void deliverIntentToFrame(uint64_t frameID, const IntentData&);
+#endif
+
static void scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
static void logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
diff --git a/Source/WebKit2/WebProcess/WebProcess.cpp b/Source/WebKit2/WebProcess/WebProcess.cpp
index 6eb8ab7ee..1490ff3ca 100644
--- a/Source/WebKit2/WebProcess/WebProcess.cpp
+++ b/Source/WebKit2/WebProcess/WebProcess.cpp
@@ -80,6 +80,10 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RandomNumber.h>
+#if ENABLE(WEB_INTENTS)
+#include <WebCore/PlatformMessagePortChannel.h>
+#endif
+
#if ENABLE(NETWORK_INFO)
#include "WebNetworkInfoManagerMessages.h"
#endif
@@ -311,6 +315,7 @@ void WebProcess::setShouldUseFontSmoothing(bool useFontSmoothing)
void WebProcess::userPreferredLanguagesChanged(const Vector<String>& languages) const
{
overrideUserPreferredLanguages(languages);
+ languageDidChange();
}
void WebProcess::fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled)
@@ -791,12 +796,32 @@ WebPageGroupProxy* WebProcess::webPageGroup(const WebPageGroupData& pageGroupDat
return result.iterator->second.get();
}
+#if ENABLE(WEB_INTENTS)
+uint64_t WebProcess::addMessagePortChannel(PassRefPtr<PlatformMessagePortChannel> messagePortChannel)
+{
+ static uint64_t channelID = 0;
+ m_messagePortChannels.add(++channelID, messagePortChannel);
+
+ return channelID;
+}
+
+PlatformMessagePortChannel* WebProcess::messagePortChannel(uint64_t channelID)
+{
+ return m_messagePortChannels.get(channelID).get();
+}
+
+void WebProcess::removeMessagePortChannel(uint64_t channelID)
+{
+ m_messagePortChannels.remove(channelID);
+}
+#endif
+
static bool canPluginHandleResponse(const ResourceResponse& response)
{
String pluginPath;
bool blocked;
- if (!WebProcess::shared().connection()->sendSync(Messages::WebContext::GetPluginPath(response.mimeType(), response.url().string()), Messages::WebContext::GetPluginPath::Reply(pluginPath, blocked), 0))
+ if (!WebProcess::shared().connection()->sendSync(Messages::WebProcessProxy::GetPluginPath(response.mimeType(), response.url().string()), Messages::WebProcessProxy::GetPluginPath::Reply(pluginPath, blocked), 0))
return false;
return !blocked && !pluginPath.isEmpty();
@@ -855,7 +880,7 @@ void WebProcess::getSitesWithPluginData(const Vector<String>& pluginPaths, uint6
Vector<String> sites;
copyToVector(sitesSet, sites);
- connection()->send(Messages::WebContext::DidGetSitesWithPluginData(sites, callbackID), 0);
+ connection()->send(Messages::WebProcessProxy::DidGetSitesWithPluginData(sites, callbackID), 0);
}
void WebProcess::clearPluginSiteData(const Vector<String>& pluginPaths, const Vector<String>& sites, uint64_t flags, uint64_t maxAgeInSeconds, uint64_t callbackID)
@@ -879,7 +904,7 @@ void WebProcess::clearPluginSiteData(const Vector<String>& pluginPaths, const Ve
}
#endif
- connection()->send(Messages::WebContext::DidClearPluginSiteData(callbackID), 0);
+ connection()->send(Messages::WebProcessProxy::DidClearPluginSiteData(callbackID), 0);
}
#endif
@@ -981,9 +1006,7 @@ void WebProcess::getWebCoreStatistics(uint64_t callbackID)
data.statisticsNumbers.set("CachedFontDataInactiveCount", fontCache()->inactiveFontDataCount());
// Gather glyph page statistics.
-#if !(PLATFORM(QT) && !HAVE(QRAWFONT)) // Qt doesn't use the glyph page tree currently. See: bug 63467.
data.statisticsNumbers.set("GlyphPageCount", GlyphPageTreeNode::treeGlyphPageCount());
-#endif
// Get WebCore memory cache statistics
getWebCoreMemoryCacheStatistics(data.webCoreCacheStatistics);
diff --git a/Source/WebKit2/WebProcess/WebProcess.h b/Source/WebKit2/WebProcess/WebProcess.h
index 0d005a4b7..d3df1b778 100644
--- a/Source/WebKit2/WebProcess/WebProcess.h
+++ b/Source/WebKit2/WebProcess/WebProcess.h
@@ -78,6 +78,9 @@ QT_END_NAMESPACE
namespace WebCore {
class IntSize;
class PageGroup;
+#if ENABLE(WEB_INTENTS)
+ class PlatformMessagePortChannel;
+#endif
class ResourceRequest;
class ResourceResponse;
}
@@ -112,7 +115,13 @@ public:
void createWebPage(uint64_t pageID, const WebPageCreationParameters&);
void removeWebPage(uint64_t pageID);
WebPage* focusedWebPage() const;
-
+
+#if ENABLE(WEB_INTENTS)
+ uint64_t addMessagePortChannel(PassRefPtr<WebCore::PlatformMessagePortChannel>);
+ WebCore::PlatformMessagePortChannel* messagePortChannel(uint64_t);
+ void removeMessagePortChannel(uint64_t);
+#endif
+
InjectedBundle* injectedBundle() const { return m_injectedBundle.get(); }
bool isSeparateProcess() const;
@@ -300,6 +309,10 @@ private:
HashMap<uint64_t, WebFrame*> m_frameMap;
+#if ENABLE(WEB_INTENTS)
+ HashMap<uint64_t, RefPtr<WebCore::PlatformMessagePortChannel> > m_messagePortChannels;
+#endif
+
HashSet<String, CaseFoldingHash> m_mimeTypesWithCustomRepresentations;
TextCheckerState m_textCheckerState;
diff --git a/Source/WebKit2/WebProcess/WebProcess.messages.in b/Source/WebKit2/WebProcess/WebProcess.messages.in
index 0f83d5bc1..22716cea5 100644
--- a/Source/WebKit2/WebProcess/WebProcess.messages.in
+++ b/Source/WebKit2/WebProcess/WebProcess.messages.in
@@ -27,6 +27,10 @@ messages -> WebProcess {
# Create a new page.
CreateWebPage(uint64_t newPageID, WebKit::WebPageCreationParameters pageCreationParameters)
+#if ENABLE(WEB_INTENTS)
+ RemoveMessagePortChannel(uint64_t channelID);
+#endif
+
# Visited link tracking.
SetVisitedLinkTable(WebKit::SharedMemory::Handle handle)
VisitedLinkStateChanged(Vector<WebCore::LinkHash> linkHashes)
diff --git a/Source/WebKit2/WebProcess/gtk/WebProcessGtk.cpp b/Source/WebKit2/WebProcess/gtk/WebProcessGtk.cpp
index d8d0167f3..24ca203a7 100644
--- a/Source/WebKit2/WebProcess/gtk/WebProcessGtk.cpp
+++ b/Source/WebKit2/WebProcess/gtk/WebProcessGtk.cpp
@@ -31,6 +31,7 @@
#include "WebProcessCreationParameters.h"
#include <WebCore/FileSystem.h>
+#include <WebCore/Language.h>
#include <WebCore/MemoryCache.h>
#include <WebCore/NotImplemented.h>
#include <WebCore/PageCache.h>
@@ -38,6 +39,8 @@
#include <libsoup/soup-cache.h>
#include <wtf/gobject/GOwnPtr.h>
#include <wtf/gobject/GRefPtr.h>
+#include <wtf/text/CString.h>
+#include <wtf/text/StringBuilder.h>
#if !OS(WINDOWS)
#include <unistd.h>
@@ -113,9 +116,62 @@ void WebProcess::platformClearResourceCaches(ResourceCachesToClear cachesToClear
soup_cache_clear(SOUP_CACHE(soup_session_get_feature(session, SOUP_TYPE_CACHE)));
}
-void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters&, CoreIPC::ArgumentDecoder*)
+// This function is based on Epiphany code in ephy-embed-prefs.c.
+static CString buildAcceptLanguages(Vector<String> languages)
{
- notImplemented();
+ // Ignore "C" locale.
+ size_t position = languages.find("c");
+ if (position != notFound)
+ languages.remove(position);
+
+ // Fallback to "en" if the list is empty.
+ if (languages.isEmpty())
+ return "en";
+
+ // Calculate deltas for the quality values.
+ int delta;
+ if (languages.size() < 10)
+ delta = 10;
+ else if (languages.size() < 20)
+ delta = 5;
+ else
+ delta = 1;
+
+ // Set quality values for each language.
+ StringBuilder builder;
+ for (size_t i = 0; i < languages.size(); ++i) {
+ if (i)
+ builder.append(", ");
+
+ builder.append(languages[i]);
+
+ int quality = 100 - i * delta;
+ if (quality > 0 && quality < 100) {
+ char buffer[8];
+ g_ascii_formatd(buffer, 8, "%.2f", quality / 100.0);
+ builder.append(String::format(";q=%s", buffer));
+ }
+ }
+
+ return builder.toString().utf8();
+}
+
+static void setSoupSessionAcceptLanguage(Vector<String> languages)
+{
+ g_object_set(WebCore::ResourceHandle::defaultSession(), "accept-language", buildAcceptLanguages(languages).data(), NULL);
+}
+
+static void languageChanged(void*)
+{
+ setSoupSessionAcceptLanguage(WebCore::userPreferredLanguages());
+}
+
+void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters& parameters, CoreIPC::ArgumentDecoder*)
+{
+ if (!parameters.languages.isEmpty())
+ setSoupSessionAcceptLanguage(parameters.languages);
+
+ WebCore::addLanguageChangeObserver(this, languageChanged);
}
void WebProcess::platformTerminate()
@@ -124,6 +180,8 @@ void WebProcess::platformTerminate()
SoupCache* cache = SOUP_CACHE(soup_session_get_feature(session, SOUP_TYPE_CACHE));
soup_cache_flush(cache);
soup_cache_dump(cache);
+
+ WebCore::removeLanguageChangeObserver(this);
}
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/mac/WebProcessMainMac.mm b/Source/WebKit2/WebProcess/mac/WebProcessMainMac.mm
index 7e926ad3a..35a85a780 100644
--- a/Source/WebKit2/WebProcess/mac/WebProcessMainMac.mm
+++ b/Source/WebKit2/WebProcess/mac/WebProcessMainMac.mm
@@ -110,6 +110,10 @@ int WebProcessMainXPC(xpc_connection_t xpcConnection, mach_port_t serverPort)
int WebProcessMain(const CommandLine& commandLine)
{
+ // Remove the WebProcess shim from the DYLD_INSERT_LIBRARIES environment variable so any processes spawned by
+ // the WebProcess don't try to insert the shim and crash.
+ EnvironmentUtilities::stripValuesEndingWithString("DYLD_INSERT_LIBRARIES", "/WebProcessShim.dylib");
+
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
String serviceName = commandLine["servicename"];
diff --git a/Source/WebKit2/win/WebKit2.def b/Source/WebKit2/win/WebKit2.def
index dea36ed90..12c1f3033 100644
--- a/Source/WebKit2/win/WebKit2.def
+++ b/Source/WebKit2/win/WebKit2.def
@@ -181,6 +181,7 @@ EXPORTS
?getElementById@TreeScope@WebCore@@QBEPAVElement@2@ABVAtomicString@WTF@@@Z
?getHighlight@InspectorController@WebCore@@QBEXPAUHighlight@2@@Z
?getLocationAndLengthFromRange@TextIterator@WebCore@@SA_NPAVElement@2@PBVRange@2@AAI2@Z
+ ?getReferencedFilePaths@FormController@WebCore@@SA?AV?$Vector@VString@WTF@@$0A@@WTF@@ABV34@@Z
?inputTag@HTMLNames@WebCore@@3VQualifiedName@2@B
?instrumentingAgentsForPage@InspectorInstrumentation@WebCore@@CAPAVInstrumentingAgents@2@PAVPage@2@@Z
?isActiveInsertionPoint@WebCore@@YA_NPBVNode@1@@Z
@@ -207,9 +208,11 @@ EXPORTS
?removedLastRef@Node@WebCore@@AAEXXZ
?reverseFind@StringImpl@WTF@@QAEI_WI@Z
?s_frontendCounter@InspectorInstrumentation@WebCore@@0HA
+ ?saveDocumentAndScrollState@HistoryController@WebCore@@QAEXXZ
?scriptExecutionContext@JSDOMGlobalObject@WebCore@@QBEPAVScriptExecutionContext@2@XZ
?scriptNameToCode@WebCore@@YA?AW4UScriptCode@@ABVString@WTF@@@Z
?scrollElementToRect@FrameView@WebCore@@QAEXPAVElement@2@ABVIntRect@2@@Z
+ ?setCanStartMedia@Page@WebCore@@QAEX_N@Z
?setCursiveFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
?setDeviceScaleFactor@Page@WebCore@@QAEXM@Z
?setDocumentState@HistoryItem@WebCore@@QAEXABV?$Vector@VString@WTF@@$0A@@WTF@@@Z
diff --git a/Source/api.pri b/Source/api.pri
index 7e53cc99d..4ac64c31b 100644
--- a/Source/api.pri
+++ b/Source/api.pri
@@ -84,3 +84,14 @@ WEBKIT += webcore
}
!no_webkit1: WEBKIT += webkit1
+
+qnx {
+ # see: https://bugs.webkit.org/show_bug.cgi?id=93460
+ # the gcc 4.4.2 used in the qnx bbndk cannot cope with
+ # the linkage step of libQtWebKit, adding a dummy .cpp
+ # file fixes this though - so do this here
+ dummyfile.target = dummy.cpp
+ dummyfile.commands = touch $$dummyfile.target
+ QMAKE_EXTRA_TARGETS += dummyfile
+ GENERATED_SOURCES += $$dummyfile.target
+}
diff --git a/Source/autotools/symbols.filter b/Source/autotools/symbols.filter
index 82ffc2e9a..44d7c60a7 100644
--- a/Source/autotools/symbols.filter
+++ b/Source/autotools/symbols.filter
@@ -30,6 +30,7 @@ _ZN24DumpRenderTreeSupportGtk*;
_ZN7WebCore4Page13setPaginationERKNS0_10PaginationE;
_ZN7WebCore4Page18setPageScaleFactorEfRKNS_8IntPointE;
_ZN7WebCore4Page20setDeviceScaleFactorEf;
+_ZN7WebCore4Page16setCanStartMediaEb;
_ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10ClientRectE;
_ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10ShadowRootE;
_ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_14ClientRectListE;
@@ -59,6 +60,8 @@ _ZN7WebCore14ClientRectListC1ERKN3WTF6VectorINS_9FloatQuadELj0EEE;
_ZN7WebCore14ClientRectListC1ERKN3WTF6VectorINS_9FloatQuadELm0EEE;
_ZN7WebCore14ClientRectListC1Ev;
_ZN7WebCore14ClientRectListD1Ev;
+_ZN7WebCore14FormController22getReferencedFilePathsERKN3WTF6VectorINS1_6StringELj0EEE;
+_ZN7WebCore14FormController22getReferencedFilePathsERKN3WTF6VectorINS1_6StringELm0EEE;
_ZN7WebCore14FrameSelection19absoluteCaretBoundsEv;
_ZN7WebCore14SchemeRegistry49registerURLSchemeAsBypassingContentSecurityPolicyERKN3WTF6StringE;
_ZN7WebCore14SchemeRegistry57removeURLSchemeRegisteredAsBypassingContentSecurityPolicyERKN3WTF6StringE;
@@ -69,6 +72,7 @@ _ZN7WebCore16HTMLInputElement15setEditingValueERKN3WTF6StringE;
_ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_7PtrHashIS6_EENS3_10HashTraitsIS6_EENSC_IS9_EEEES6_;
_ZN7WebCore16scriptNameToCodeERKN3WTF6StringE;
_ZN7WebCore17cacheDOMStructureEPNS_17JSDOMGlobalObjectEPN3JSC9StructureEPKNS2_9ClassInfoE;
+_ZN7WebCore17HistoryController26saveDocumentAndScrollStateEv;
_ZN7WebCore17InspectorCounters12counterValueENS0_11CounterTypeE;
_ZN7WebCore18HTMLContentElement6createEPNS_8DocumentE;
_ZN7WebCore19InspectorController39setResourcesDataSizeLimitsFromInternalsEii;
@@ -171,6 +175,7 @@ _ZNK7WebCore14InsertionPoint8isActiveEv;
_ZN7WebCore26ContextDestructionObserverD2Ev;
_ZN7WebCore26ContextDestructionObserverC2EPNS_22ScriptExecutionContextE;
_ZN7WebCore26ContextDestructionObserver16contextDestroyedEv;
+
local:
_Z*;
cti*;
diff --git a/Source/cmake/FindDBus.cmake b/Source/cmake/FindDBus.cmake
new file mode 100644
index 000000000..4a1a18056
--- /dev/null
+++ b/Source/cmake/FindDBus.cmake
@@ -0,0 +1,59 @@
+# - Try to find DBus
+# Once done, this will define
+#
+# DBUS_FOUND - system has DBus
+# DBUS_INCLUDE_DIRS - the DBus include directories
+# DBUS_LIBRARIES - link these to use DBus
+#
+# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
+#
+# 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 THE COPYRIGHT HOLDER 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 THE COPYRIGHT HOLDER 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.
+
+FIND_PACKAGE(PkgConfig)
+PKG_CHECK_MODULES(PC_DBUS QUIET dbus-1)
+
+FIND_LIBRARY(DBUS_LIBRARIES
+ NAMES dbus-1
+ HINTS ${PC_DBUS_LIBDIR}
+ ${PC_DBUS_LIBRARY_DIRS}
+)
+
+FIND_PATH(DBUS_INCLUDE_DIR
+ NAMES dbus/dbus.h
+ HINTS ${PC_DBUS_INCLUDEDIR}
+ ${PC_DBUS_INCLUDE_DIRS}
+)
+
+GET_FILENAME_COMPONENT(_DBUS_LIBRARY_DIR ${DBUS_LIBRARIES} PATH)
+FIND_PATH(DBUS_ARCH_INCLUDE_DIR
+ NAMES dbus/dbus-arch-deps.h
+ HINTS ${PC_DBUS_INCLUDEDIR}
+ ${PC_DBUS_INCLUDE_DIRS}
+ ${_DBUS_LIBRARY_DIR}
+ ${DBUS_INCLUDE_DIR}
+ PATH_SUFFIXES include
+)
+
+SET(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR})
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(DBUS REQUIRED_VARS DBUS_INCLUDE_DIRS DBUS_LIBRARIES)
diff --git a/Source/cmake/FindGIO.cmake b/Source/cmake/FindGIO.cmake
deleted file mode 100644
index c32a3bf2d..000000000
--- a/Source/cmake/FindGIO.cmake
+++ /dev/null
@@ -1,27 +0,0 @@
-# - Try to find GIO 2.0
-# Once done, this will define
-#
-# GIO_FOUND - system has GIO
-# GIO_INCLUDE_DIRS - the GIO include directories
-# GIO_LIBRARIES - link these to use GIO
-
-include(LibFindMacros)
-
-# Dependencies
-libfind_package(GIO Glib)
-
-# Use pkg-config to get hints about paths
-libfind_pkg_check_modules(GIO_PKGCONF gio-2.0)
-
-# Find the library
-find_library(GIO_LIBRARY
- NAMES gio-2.0
- PATHS ${GIO_PKGCONF_LIBRARY_DIRS}
-)
-
-# Set the include dir variables and the libraries and let libfind_process do the rest.
-# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
-set(GIO_PROCESS_INCLUDES Glib_INCLUDE_DIRS)
-set(GIO_PROCESS_LIBS GIO_LIBRARY Glib_LIBRARIES)
-libfind_process(GIO)
-
diff --git a/Source/cmake/FindGLIB.cmake b/Source/cmake/FindGLIB.cmake
new file mode 100644
index 000000000..86bf8c025
--- /dev/null
+++ b/Source/cmake/FindGLIB.cmake
@@ -0,0 +1,102 @@
+# - Try to find Glib and its components (gio, gobject etc)
+# Once done, this will define
+#
+# GLIB_FOUND - system has Glib
+# GLIB_INCLUDE_DIRS - the Glib include directories
+# GLIB_LIBRARIES - link these to use Glib
+#
+# Optionally, the COMPONENTS keyword can be passed to FIND_PACKAGE()
+# and Glib components can be looked for. Currently, the following
+# components can be used, and they define the following variables if
+# found:
+#
+# gio: GLIB_GIO_LIBRARIES
+# gobject: GLIB_GOBJECT_LIBRARIES
+# gmodule: GLIB_GMODULE_LIBRARIES
+# gthread: GLIB_GTHREAD_LIBRARIES
+#
+# Note that the respective _INCLUDE_DIR variables are not set, since
+# all headers are in the same directory as GLIB_INCLUDE_DIRS.
+#
+# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
+#
+# 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 THE COPYRIGHT HOLDER 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 THE COPYRIGHT HOLDER 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.
+
+FIND_PACKAGE(PkgConfig)
+PKG_CHECK_MODULES(PC_GLIB QUIET glib-2.0)
+
+FIND_LIBRARY(GLIB_LIBRARIES
+ NAMES glib-2.0
+ HINTS ${PC_GLIB_LIBDIR}
+ ${PC_GLIB_LIBRARY_DIRS}
+)
+
+# Files in glib's main include path may include glibconfig.h, which,
+# for some odd reason, is normally in $LIBDIR/glib-2.0/include.
+GET_FILENAME_COMPONENT(_GLIB_LIBRARY_DIR ${GLIB_LIBRARIES} PATH)
+FIND_PATH(GLIBCONFIG_INCLUDE_DIR
+ NAMES glibconfig.h
+ HINTS ${PC_LIBDIR} ${PC_LIBRARY_DIRS} ${_GLIB_LIBRARY_DIR}
+ PATH_SUFFIXES glib-2.0/include
+)
+
+FIND_PATH(GLIB_INCLUDE_DIR
+ NAMES glib.h
+ HINTS ${PC_GLIB_INCLUDEDIR}
+ ${PC_GLIB_INCLUDE_DIRS}
+ PATH_SUFFIXES glib-2.0
+)
+
+SET(GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR} ${GLIBCONFIG_INCLUDE_DIR})
+
+# Version detection
+FILE(READ "${GLIBCONFIG_INCLUDE_DIR}/glibconfig.h" GLIBCONFIG_H_CONTENTS)
+STRING(REGEX MATCH "#define GLIB_MAJOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
+SET(GLIB_VERSION_MAJOR "${CMAKE_MATCH_1}")
+STRING(REGEX MATCH "#define GLIB_MINOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
+SET(GLIB_VERSION_MINOR "${CMAKE_MATCH_1}")
+STRING(REGEX MATCH "#define GLIB_MICRO_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
+SET(GLIB_VERSION_MICRO "${CMAKE_MATCH_1}")
+SET(GLIB_VERSION "${GLIB_VERSION_MAJOR}.${GLIB_VERSION_MINOR}.${GLIB_VERSION_MICRO}")
+
+# Additional Glib components. We only look for libraries, as not all of them
+# have corresponding headers and all headers are installed alongside the main
+# glib ones.
+FOREACH (_component ${GLIB_FIND_COMPONENTS})
+ IF (${_component} STREQUAL "gio")
+ FIND_LIBRARY(GLIB_GIO_LIBRARIES NAMES gio-2.0 HINTS ${_GLIB_LIBRARY_DIR})
+ SET(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GIO_LIBRARIES)
+ ELSEIF (${_component} STREQUAL "gobject")
+ FIND_LIBRARY(GLIB_GOBJECT_LIBRARIES NAMES gobject-2.0 HINTS ${_GLIB_LIBRARY_DIR})
+ SET(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GOBJECT_LIBRARIES)
+ ELSEIF (${_component} STREQUAL "gmodule")
+ FIND_LIBRARY(GLIB_GMODULE_LIBRARIES NAMES gmodule-2.0 HINTS ${_GLIB_LIBRARY_DIR})
+ SET(ADDITIONAL_REQUIRED_VARS "${ADDITIONAL_REQUIRED_VARS} GLIB_GMODULE_LIBRARIES")
+ ELSEIF (${_component} STREQUAL "gthread")
+ FIND_LIBRARY(GLIB_GTHREAD_LIBRARIES NAMES gthread-2.0 HINTS ${_GLIB_LIBRARY_DIR})
+ SET(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GTHREAD_LIBRARIES)
+ ENDIF ()
+ENDFOREACH ()
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLIB REQUIRED_VARS GLIB_INCLUDE_DIRS GLIB_LIBRARIES ${ADDITIONAL_REQUIRED_VARS}
+ VERSION_VAR GLIB_VERSION)
diff --git a/Source/cmake/FindGlib.cmake b/Source/cmake/FindGlib.cmake
deleted file mode 100644
index d4b73affd..000000000
--- a/Source/cmake/FindGlib.cmake
+++ /dev/null
@@ -1,43 +0,0 @@
-# - Try to find Glib-2.0 (with gobject)
-# Once done, this will define
-#
-# Glib_FOUND - system has Glib
-# Glib_INCLUDE_DIRS - the Glib include directories
-# Glib_LIBRARIES - link these to use Glib
-
-include(LibFindMacros)
-
-# Use pkg-config to get hints about paths
-libfind_pkg_check_modules(Glib_PKGCONF glib-2.0)
-
-# Main include dir
-find_path(Glib_INCLUDE_DIR
- NAMES glib.h
- PATHS ${Glib_PKGCONF_INCLUDE_DIRS}
- PATH_SUFFIXES glib-2.0
-)
-
-# Glib-related libraries also use a separate config header, which is in lib dir
-find_path(GlibConfig_INCLUDE_DIR
- NAMES glibconfig.h
- PATHS ${Glib_PKGCONF_INCLUDE_DIRS} /usr
- PATH_SUFFIXES lib/glib-2.0/include
-)
-
-# Finally the library itself
-find_library(Glib_LIBRARY
- NAMES glib-2.0
- PATHS ${Glib_PKGCONF_LIBRARY_DIRS}
-)
-find_library(Gobject_LIBRARY
- NAMES gobject-2.0
- PATHS ${Glib_PKGCONF_LIBRARY_DIRS}
-)
-
-# Set the include dir variables and the libraries and let libfind_process do the rest.
-# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
-set(Glib_PROCESS_INCLUDES Glib_INCLUDE_DIR GlibConfig_INCLUDE_DIR)
-set(Glib_PROCESS_LIBS Glib_LIBRARY Gobject_LIBRARY)
-libfind_process(Glib)
-
-
diff --git a/Source/cmake/FindGthread.cmake b/Source/cmake/FindGthread.cmake
deleted file mode 100644
index 281e657b3..000000000
--- a/Source/cmake/FindGthread.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-# Find include and libraries for Gthread library
-
-INCLUDE(FindPkgConfig)
-PKG_CHECK_MODULES (Gthread REQUIRED gthread-2.0>=2.20.0)
diff --git a/Source/cmake/FindLibSoup.cmake b/Source/cmake/FindLibSoup.cmake
new file mode 100644
index 000000000..cb8e4e243
--- /dev/null
+++ b/Source/cmake/FindLibSoup.cmake
@@ -0,0 +1,52 @@
+# - Try to find LibSoup 2.4
+# This module defines the following variables:
+#
+# LIBSOUP_FOUND - LibSoup 2.4 was found
+# LIBSOUP_INCLUDE_DIRS - the LibSoup 2.4 include directories
+# LIBSOUP_LIBRARIES - link these to use LibSoup 2.4
+#
+# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
+#
+# 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 THE COPYRIGHT HOLDER 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 THE COPYRIGHT HOLDER 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.
+
+# LibSoup does not provide an easy way to retrieve its version other than its
+# .pc file, so we need to rely on PC_LIBSOUP_VERSION and REQUIRE the .pc file
+# to be found.
+FIND_PACKAGE(PkgConfig)
+PKG_CHECK_MODULES(PC_LIBSOUP REQUIRED QUIET libsoup-2.4)
+
+FIND_PATH(LIBSOUP_INCLUDE_DIRS
+ NAMES libsoup/soup.h
+ HINTS ${PC_LIBSOUP_INCLUDEDIR}
+ ${PC_LIBSOUP_INCLUDE_DIRS}
+ PATH_SUFFIXES libsoup-2.4
+)
+
+FIND_LIBRARY(LIBSOUP_LIBRARIES
+ NAMES soup-2.4
+ HINTS ${PC_LIBSOUP_LIBDIR}
+ ${PC_LIBSOUP_LIBRARY_DIRS}
+)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibSoup REQUIRED_VARS LIBSOUP_INCLUDE_DIRS LIBSOUP_LIBRARIES
+ VERSION_VAR PC_LIBSOUP_VERSION)
diff --git a/Source/cmake/FindLibSoup2.cmake b/Source/cmake/FindLibSoup2.cmake
deleted file mode 100644
index e023a63c8..000000000
--- a/Source/cmake/FindLibSoup2.cmake
+++ /dev/null
@@ -1,191 +0,0 @@
-# - Try to find libsoup
-# Find libsoup headers, libraries and the answer to all questions.
-#
-# LIBSOUP2_FOUND True if libsoup2 got found
-# LIBSOUP2_INCLUDE_DIRS Location of libsoup2 headers
-# LIBSOUP2_LIBRARIES List of libaries to use libsoup2
-# LIBSOUP2_LIBRARY_DIRS Location of libsoup2 library
-#
-# LIBSOUP22_FOUND True if libsoup2.2 got found
-# LIBSOUP22_INCLUDE_DIRS Location of libsoup2.2 headers
-# LIBSOUP22_LIBRARIES List of libaries to use libsoup2.2
-# LIBSOUP22_LIBRARY_DIRS Location of libsoup2.2 library
-#
-# LIBSOUP24_FOUND True if libsoup2.4 got found
-# LIBSOUP24_INCLUDE_DIRS Location of libsoup2.4 headers
-# LIBSOUP24_LIBRARIES List of libaries to use libsoup2.4
-# LIBSOUP24_LIBRARY_DIRS Location of libsoup2.4 library
-#
-# Set LIBSOUP2_MIN_VERSION to find libsoup2.2 or libsoup2.4 if only
-# one of both libraries is supported
-#
-# Don't use LIBSOUP2_MIN_VERSION if you want to support
-# libsoup2.2 and libsoup2.4.
-# Instead use LIBSPOUP22_MIN_VERSION and LIBSPOUP24_MIN_VERSION.
-#
-# Set LIBSPOUP22_MIN_VERSION to find libsoup2.2 which version is
-# greater than LIBSPOUP22_MIN_VERSION
-#
-# Set LIBSPOUP24_MIN_VERSION to find libsoup2.4 which version is
-# greater than LIBSPOUP24_MIN_VERSION
-#
-# WARNING: It is not possible to set LIBSPOUP22_MIN_VERSION
-# and support any version of libsoup2.4 at the same time.
-# In this situation you have to set LIBSPOUP24_MIN_VERSION also.
-# The same applies to LIBSPOUP24_MIN_VERSION and libsoup2.2.
-#
-# Copyright (c) 2007 Daniel Gollub <gollub@b1-systems.de>
-# Copyright (c) 2008 Bjoern Ricks <bjoern.ricks@gmail.com>
-#
-# 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 copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. The name of the author may not be used to endorse or promote products
-# derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR 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( FindPkgConfig )
-
-IF ( LibSoup2_FIND_VERSION AND NOT LIBSOUP2_MIN_VERSION AND NOT LIBSOUP24_MIN_VERSION )
- SET( LIBSOUP2_MIN_VERSION "${LibSoup2_FIND_VERSION}" )
- SET( LIBSOUP24_MIN_VERSION "${LibSoup2_FIND_VERSION}" )
-ENDIF ( LibSoup2_FIND_VERSION AND NOT LIBSOUP2_MIN_VERSION AND NOT LIBSOUP24_MIN_VERSION )
-
-IF ( LibSoup2_FIND_REQUIRED )
- SET( _pkgconfig_REQUIRED "REQUIRED" )
-ELSE( LibSoup2_FIND_REQUIRED )
- SET( _pkgconfig_REQUIRED "" )
-ENDIF ( LibSoup2_FIND_REQUIRED )
-
-IF ( LIBSOUP2_MIN_VERSION )
- STRING(REGEX REPLACE "^(2)(\\.)([0-9]*)(\\.?)(.*)" "\\3" LIBSOUP2_VERSION_MINOR "${LIBSOUP2_MIN_VERSION}")
- IF ( LIBSOUP2_VERSION_MINOR EQUAL "2" )
- SET( LIBSOUP22_MIN_VERSION "${LIBSOUP2_MIN_VERSION}" )
- ELSE ( LIBSOUP2_VERSION_MINOR EQUAL "2" )
- SET( LIBSOUP24_MIN_VERSION "${LIBSOUP2_MIN_VERSION}" )
- ENDIF ( LIBSOUP2_VERSION_MINOR EQUAL "2" )
-ENDIF ( LIBSOUP2_MIN_VERSION )
-
-# try to find libsoup2.2>=LIBSOUP22_MIN_VERSION
-IF ( LIBSOUP22_MIN_VERSION )
- PKG_SEARCH_MODULE( LIBSOUP22 libsoup-2.2>=${LIBSOUP22_MIN_VERSION} libsoup2>=${LIBSOUP22_MIN_VERSION} )
-ENDIF ( LIBSOUP22_MIN_VERSION )
-
-# try to find libsoup2.4>=LIBSOUP24_MIN_VERSION
-IF ( LIBSOUP24_MIN_VERSION )
- PKG_SEARCH_MODULE( LIBSOUP24 libsoup-2.4>=${LIBSOUP24_MIN_VERSION} libsoup2>=${LIBSOUP24_MIN_VERSION} )
-ENDIF ( LIBSOUP24_MIN_VERSION )
-
-# try to find any version of libsoup2.4 if LIBSOUP22_MIN_VERSION is not set
-IF ( NOT LIBSOUP24_FOUND AND NOT LIBSOUP22_MIN_VERSION AND NOT LIBSOUP24_MIN_VERSION )
- PKG_SEARCH_MODULE( LIBSOUP24 libsoup-2.4 libsoup2 )
-ENDIF ( NOT LIBSOUP24_FOUND AND NOT LIBSOUP22_MIN_VERSION AND NOT LIBSOUP24_MIN_VERSION )
-
-# try to find any version of libsoup2.2 if LIBSOUP24_MIN_VERSION is not set
-IF ( NOT LIBSOUP22_FOUND AND NOT LIBSOUP24_MIN_VERSION AND NOT LIBSOUP24_MIN_VERSION )
- PKG_SEARCH_MODULE( LIBSOUP22 libsoup-2.2 libsoup2 )
-ENDIF ( NOT LIBSOUP22_FOUND AND NOT LIBSOUP24_MIN_VERSION AND NOT LIBSOUP24_MIN_VERSION )
-
-# set LIBSOUP2_ variables
-IF ( LIBSOUP24_FOUND )
- # prefer libsoup2.4 to libsoup2.2 if both are found
- SET( LIBSOUP2_FOUND ${LIBSOUP24_FOUND} CACHE INTERNAL "" )
- SET( LIBSOUP2_INCLUDE_DIRS ${LIBSOUP24_INCLUDE_DIRS} CACHE INTERNAL "" )
- SET( LIBSOUP2_LIBRARIES ${LIBSOUP24_LIBRARIES} CACHE INTERNAL "" )
- SET( LIBSOUP2_LIBRARY_DIRS ${LIBSOUP24_LIBRARY_DIRS} CACHE INTERNAL "" )
- SET( LIBSOUP2_VERSION ${LIBSOUP24_VERSION} CACHE INTERNAL "" )
-ELSEIF ( LIBSOUP22_FOUND )
- SET( LIBSOUP2_FOUND ${LIBSOUP22_FOUND} CACHE INTERNAL "" )
- SET( LIBSOUP2_INCLUDE_DIRS ${LIBSOUP22_INCLUDE_DIRS} CACHE INTERNAL "" )
- SET( LIBSOUP2_LIBRARIES ${LIBSOUP22_LIBRARIES} CACHE INTERNAL "" )
- SET( LIBSOUP2_LIBRARY_DIRS ${LIBSOUP22_LIBRARY_DIRS} CACHE INTERNAL "" )
- SET( LIBSOUP2_VERSION ${LIBSOUP22_VERSION} CACHE INTERNAL "" )
-ELSEIF( PKG_CONFIG_FOUND AND LibSoup2_FIND_REQUIRED )
- # raise an error if both libs are not found
- # and FIND_PACKAGE( LibSoup2 REQUIRED ) was called
- MESSAGE( FATAL_ERROR "package libsoup2 not found" )
-ENDIF ( LIBSOUP24_FOUND )
-
-IF( NOT LIBSOUP2_FOUND AND NOT PKG_CONFIG_FOUND )
- # WARNING:
- # This case is executed if pkg-config isn't installed.
- # Currently in this case it is only checked if libsoup2.2 is available.
- # Therefore please don't use this cmake module without pkg-config!
- FIND_PATH( _libsoup2_include_DIR libsoup/soup.h PATH_SUFFIXES libsoup libsoup-2.2 )
- FIND_LIBRARY( _libsoup2_LIBRARY soup-2.2)
-
- IF ( _libsoup2_include_DIR AND _libsoup2_LIBRARY )
- SET ( _libsoup2_FOUND TRUE )
- ENDIF ( _libsoup2_include_DIR AND _libsoup2_LIBRARY )
-
- IF ( _libsoup2_FOUND )
- SET ( LIBSOUP2_INCLUDE_DIRS ${_libsoup2_include_DIR} )
- SET ( LIBSOUP2_LIBRARIES ${_libsoup2_LIBRARY} )
-
- # find requited glib2
- IF( NOT GLIB2_FOUND )
- FIND_PACKAGE( GLIB2 REQUIRED )
- IF ( GLIB2_FOUND )
- SET ( LIBSOUP2_INCLUDE_DIRS ${LIBSOUP2_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS} )
- SET ( LIBSOUP2_LIBRARIES ${LIBSOUP2_LIBRARIES} ${GLIB2_LIBRARIES} )
- ENDIF ( GLIB2_FOUND )
- ENDIF( NOT GLIB2_FOUND )
-
- # find required libxml2
- IF( NOT LIBXML2_FOUND )
- FIND_PACKAGE( LibXml2 REQUIRED )
- IF ( LIBXML2_FOUND )
- SET ( LIBSOUP2_INCLUDE_DIRS ${LIBSOUP2_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIRS} )
- SET ( LIBSOUP2_LIBRARIES ${LIBSOUP2_LIBRARIES} ${LIBXML2_LIBRARIES} )
- ENDIF( LIBXML2_FOUND )
- ENDIF( NOT LIBXML2_FOUND )
-
- # find required gnutls
- IF( NOT GNUTLS_FOUND )
- FIND_PACKAGE( GNUTLS REQUIRED )
- IF ( GNUTLS_FOUND )
- SET ( LIBSOUP2_INCLUDE_DIRS ${LIBSOUP2_INCLUDE_DIRS} ${GNUTLS_INCLUDE_DIRS} )
- SET ( LIBSOUP2_LIBRARIES ${LIBSOUP2_LIBRARIES} ${GNUTLS_LIBRARIES} )
- ENDIF( GNUTLS_FOUND )
- ENDIF( NOT GNUTLS_FOUND )
- ENDIF ( _libsoup2_FOUND )
-
- MARK_AS_ADVANCED( _libsoup2_include_DIR _libsoup2_LIBRARY )
-
- # Report results
- IF ( LIBSOUP2_LIBRARIES AND LIBSOUP2_INCLUDE_DIRS AND _libsoup2_FOUND )
- SET( LIBSOUP2_FOUND 1 )
- IF ( NOT LibSoup2_FIND_QUIETLY )
- MESSAGE( STATUS "Found libsoup2: ${_libsoup2_LIBRARY}" )
- ENDIF ( NOT LibSoup2_FIND_QUIETLY )
- ELSE ( LIBSOUP2_LIBRARIES AND LIBSOUP_INCLUDE_DIRS AND _libsoup2_FOUND )
- IF ( LibSoup2_FIND_REQUIRED )
- MESSAGE( SEND_ERROR "Could NOT find libsoup2" )
- ELSE ( LibSoup2_FIND_REQUIRED )
- IF ( NOT LibSoup2_FIND_QUIETLY )
- MESSAGE( STATUS "Could NOT find libsoup2" )
- ENDIF ( NOT LibSoup2_FIND_QUIETLY )
- ENDIF ( LibSoup2_FIND_REQUIRED )
- ENDIF ( LIBSOUP2_LIBRARIES AND LIBSOUP2_INCLUDE_DIRS AND _libsoup2_FOUND )
-ENDIF( NOT LIBSOUP2_FOUND AND NOT PKG_CONFIG_FOUND )
-
-# Hide advanced variables from CMake GUIs
-MARK_AS_ADVANCED( LIBSOUP2_LIBRARIES LIBSOUP2_INCLUDE_DIRS )
-
diff --git a/Source/cmake/FindPango.cmake b/Source/cmake/FindPango.cmake
deleted file mode 100644
index 2353df3f3..000000000
--- a/Source/cmake/FindPango.cmake
+++ /dev/null
@@ -1,46 +0,0 @@
-# - Try to find Pango
-# Once done, this will define
-#
-# Pango_FOUND - system has Pango
-# Pango_INCLUDE_DIRS - the Pango include directories
-# Pango_LIBRARIES - link these to use Pango
-
-include(LibFindMacros)
-
-# Dependencies
-libfind_package(Pango Freetype)
-
-# Use pkg-config to get hints about paths
-libfind_pkg_check_modules(Pango_PKGCONF pango)
-libfind_pkg_check_modules(Pango_Cairo_PKGCONF pango)
-
-# Include dir
-find_path(Pango_INCLUDE_DIR
- NAMES pango/pango.h
- PATHS ${Pango_PKGCONF_INCLUDE_DIRS}
- PATH_SUFFIXES pango-1.0
-)
-
-find_path(Pango_Cairo_INCLUDE_DIR
- NAMES pango/pangocairo.h
- PATHS ${Pango_Cairo_PKGCONF_INCLUDE_DIRS}
- PATH_SUFFIXES pango-1.0
-)
-
-# Finally the library itself
-find_library(Pango_LIBRARY
- NAMES pango-1.0
- PATHS ${Pango_PKGCONF_LIBRARY_DIRS}
-)
-
-find_library(Pango_Cairo_LIBRARY
- NAMES pangocairo-1.0
- PATHS ${Pango_Cairo_PKGCONF_LIBRARY_DIRS}
-)
-
-# Set the include dir variables and the libraries and let libfind_process do the rest.
-# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
-set(Pango_PROCESS_INCLUDES Pango_INCLUDE_DIR FREETYPE_INCLUDE_DIRS)
-set(Pango_PROCESS_LIBS Pango_LIBRARY FREETYPE_LIBRARIES)
-libfind_process(Pango)
-
diff --git a/Source/cmake/LibFindMacros.cmake b/Source/cmake/LibFindMacros.cmake
deleted file mode 100644
index 69975c51b..000000000
--- a/Source/cmake/LibFindMacros.cmake
+++ /dev/null
@@ -1,99 +0,0 @@
-# Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments
-# used for the current package. For this to work, the first parameter must be the
-# prefix of the current package, then the prefix of the new package etc, which are
-# passed to find_package.
-macro (libfind_package PREFIX)
- set (LIBFIND_PACKAGE_ARGS ${ARGN})
- if (${PREFIX}_FIND_QUIETLY)
- set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} QUIET)
- endif (${PREFIX}_FIND_QUIETLY)
- if (${PREFIX}_FIND_REQUIRED)
- set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} REQUIRED)
- endif (${PREFIX}_FIND_REQUIRED)
- find_package(${LIBFIND_PACKAGE_ARGS})
-endmacro (libfind_package)
-
-# CMake developers made the UsePkgConfig system deprecated in the same release (2.6)
-# where they added pkg_check_modules. Consequently I need to support both in my scripts
-# to avoid those deprecated warnings. Here's a helper that does just that.
-# Works identically to pkg_check_modules, except that no checks are needed prior to use.
-macro (libfind_pkg_check_modules PREFIX PKGNAME)
- if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
- include(UsePkgConfig)
- pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS)
- else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
- find_package(PkgConfig)
- if (PKG_CONFIG_FOUND)
- pkg_check_modules(${PREFIX} ${PKGNAME})
- endif (PKG_CONFIG_FOUND)
- endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
-endmacro (libfind_pkg_check_modules)
-
-# Do the final processing once the paths have been detected.
-# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain
-# all the variables, each of which contain one include directory.
-# Ditto for ${PREFIX}_PROCESS_LIBS and library files.
-# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES.
-# Also handles errors in case library detection was required, etc.
-macro (libfind_process PREFIX)
- # Skip processing if already processed during this run
- if (NOT ${PREFIX}_FOUND)
- # Start with the assumption that the library was found
- set (${PREFIX}_FOUND TRUE)
-
- # Process all includes and set _FOUND to false if any are missing
- foreach (i ${${PREFIX}_PROCESS_INCLUDES})
- if (${i})
- set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}})
- mark_as_advanced(${i})
- else (${i})
- set (${PREFIX}_FOUND FALSE)
- endif (${i})
- endforeach (i)
-
- # Process all libraries and set _FOUND to false if any are missing
- foreach (i ${${PREFIX}_PROCESS_LIBS})
- if (${i})
- set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}})
- mark_as_advanced(${i})
- else (${i})
- set (${PREFIX}_FOUND FALSE)
- endif (${i})
- endforeach (i)
-
- # Print message and/or exit on fatal error
- if (${PREFIX}_FOUND)
- if (NOT ${PREFIX}_FIND_QUIETLY)
- message (STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
- endif (NOT ${PREFIX}_FIND_QUIETLY)
- else (${PREFIX}_FOUND)
- if (${PREFIX}_FIND_REQUIRED)
- foreach (i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS})
- message("${i}=${${i}}")
- endforeach (i)
- message (FATAL_ERROR "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually.")
- endif (${PREFIX}_FIND_REQUIRED)
- endif (${PREFIX}_FOUND)
- endif (NOT ${PREFIX}_FOUND)
-endmacro (libfind_process)
-
-macro(libfind_library PREFIX basename)
- set(TMP "")
- if(MSVC80)
- set(TMP -vc80)
- endif(MSVC80)
- if(MSVC90)
- set(TMP -vc90)
- endif(MSVC90)
- set(${PREFIX}_LIBNAMES ${basename}${TMP})
- if(${ARGC} GREATER 2)
- set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2})
- string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES})
- set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP})
- endif(${ARGC} GREATER 2)
- find_library(${PREFIX}_LIBRARY
- NAMES ${${PREFIX}_LIBNAMES}
- PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS}
- )
-endmacro(libfind_library)
-
diff --git a/Source/cmake/OptionsBlackBerry.cmake b/Source/cmake/OptionsBlackBerry.cmake
index 59d05bc52..14aca088f 100644
--- a/Source/cmake/OptionsBlackBerry.cmake
+++ b/Source/cmake/OptionsBlackBerry.cmake
@@ -67,29 +67,20 @@ FIND_STAGING_LIBRARY(XML2_LIBRARY xml2)
FIND_STAGING_LIBRARY(XSLT_LIBRARY xslt)
FIND_STAGING_LIBRARY(SQLITE3_LIBRARY sqlite3)
FIND_STAGING_LIBRARY(M_LIBRARY m)
-FIND_STAGING_LIBRARY(NBUTIL_LIBRARY nbutil)
FIND_STAGING_LIBRARY(FREETYPE_LIBRARY freetype)
FIND_STAGING_LIBRARY(ICUData_LIBRARY icudata)
FIND_STAGING_LIBRARY(ICUI18N_LIBRARY icui18n)
FIND_STAGING_LIBRARY(ICUUC_LIBRARY icuuc)
-FIND_STAGING_LIBRARY(Iconv_LIBRARY iconv)
FIND_STAGING_LIBRARY(INTL_LIBRARY intl)
FIND_STAGING_LIBRARY(Z_LIBRARY z)
-FIND_STAGING_LIBRARY(Socket_LIBRARY socket)
FIND_STAGING_LIBRARY(CURL_LIBRARY curl)
-FIND_STAGING_LIBRARY(SSL_LIBRARY ssl)
-FIND_STAGING_LIBRARY(Crypto_LIBRARY crypto)
FIND_STAGING_LIBRARY(WebKitPlatform_LIBRARY webkitplatform)
FIND_STAGING_LIBRARY(UUID_LIBRARY uuid-browser)
-FIND_STAGING_LIBRARY(Screen_LIBRARY screen)
FIND_STAGING_LIBRARY(MMR_LIBRARY mmrndclient)
FIND_STAGING_LIBRARY(PPSCache_LIBRARY ppscache)
FIND_STAGING_LIBRARY(MD_LIBRARY md)
-FIND_STAGING_LIBRARY(AOI_LIBRARY aoi)
-FIND_STAGING_LIBRARY(CLIPBOARD_LIBRARY clipboard)
FIND_STAGING_LIBRARY(EGL_LIBRARY EGL)
FIND_STAGING_LIBRARY(GLESv2_LIBRARY GLESv2)
-FIND_STAGING_LIBRARY(STRM_LIBRARY strm)
FIND_STAGING_LIBRARY(HARFBUZZ_LIBRARY harfbuzz)
FIND_STAGING_LIBRARY(FONTCONFIG_LIBRARY fontconfig)
FIND_STAGING_LIBRARY(PROFILING_LIBRARY profilingS)
@@ -175,6 +166,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VIBRATION ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VIDEO ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_TIMING ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WORKERS ON)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_XHR_RESPONSE_BLOB ON)
IF (ENABLE_GLES2)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_3D_RENDERING ON)
diff --git a/Source/cmake/OptionsEfl.cmake b/Source/cmake/OptionsEfl.cmake
index d96d22c5c..23e769bdf 100644
--- a/Source/cmake/OptionsEfl.cmake
+++ b/Source/cmake/OptionsEfl.cmake
@@ -15,12 +15,6 @@ ADD_DEFINITIONS(-DBUILDING_EFL__=1)
ADD_DEFINITIONS(-DWTF_PLATFORM_EFL=1)
SET(WTF_PLATFORM_EFL 1)
-# -----------------------------------------------------------------------------
-# Determine which font backend will be used
-# -----------------------------------------------------------------------------
-SET(ALL_FONT_BACKENDS freetype pango)
-SET(FONT_BACKEND "freetype" CACHE STRING "choose which network backend to use (one of ${ALL_FONT_BACKENDS})")
-
FIND_PACKAGE(Cairo 1.10 REQUIRED)
FIND_PACKAGE(EFL REQUIRED)
FIND_PACKAGE(Fontconfig 2.8.0 REQUIRED)
@@ -33,9 +27,8 @@ FIND_PACKAGE(JPEG REQUIRED)
FIND_PACKAGE(PNG REQUIRED)
FIND_PACKAGE(ZLIB REQUIRED)
-FIND_PACKAGE(Glib 2.31.8 REQUIRED)
-FIND_PACKAGE(Gthread REQUIRED)
-FIND_PACKAGE(LibSoup2 2.39.4.1 REQUIRED)
+FIND_PACKAGE(GLIB 2.31.8 REQUIRED COMPONENTS gio gobject gthread)
+FIND_PACKAGE(LibSoup 2.39.4.1 REQUIRED)
SET(ENABLE_GLIB_SUPPORT ON)
SET(WTF_USE_SOUP 1)
@@ -120,23 +113,21 @@ IF (ENABLE_ECORE_X)
ENDIF ()
ENDIF ()
-IF (FONT_BACKEND STREQUAL "freetype")
- FIND_PACKAGE(Freetype REQUIRED)
- FIND_PACKAGE(HarfBuzz REQUIRED)
- SET(WTF_USE_FREETYPE 1)
- SET(WTF_USE_HARFBUZZ_NG 1)
- ADD_DEFINITIONS(-DWTF_USE_FREETYPE=1)
- ADD_DEFINITIONS(-DWTF_USE_HARFBUZZ_NG=1)
-ELSE ()
- FIND_PACKAGE(Pango REQUIRED)
- SET(WTF_USE_PANGO 1)
- ADD_DEFINITIONS(-DWTF_USE_PANGO=1)
-ENDIF ()
+FIND_PACKAGE(Freetype REQUIRED)
+FIND_PACKAGE(HarfBuzz REQUIRED)
+SET(WTF_USE_FREETYPE 1)
+SET(WTF_USE_HARFBUZZ_NG 1)
+ADD_DEFINITIONS(-DWTF_USE_FREETYPE=1)
+ADD_DEFINITIONS(-DWTF_USE_HARFBUZZ_NG=1)
IF (NOT ENABLE_SVG)
SET(ENABLE_SVG_FONTS 0)
ENDIF ()
+IF (ENABLE_BATTERY_STATUS)
+ FIND_PACKAGE(DBus REQUIRED)
+ENDIF ()
+
IF (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
SET(GSTREAMER_COMPONENTS app interfaces pbutils)
SET(WTF_USE_GSTREAMER 1)
diff --git a/Source/cmake/WebKitFeatures.cmake b/Source/cmake/WebKitFeatures.cmake
index 23bf1447b..7eaba01e3 100644
--- a/Source/cmake/WebKitFeatures.cmake
+++ b/Source/cmake/WebKitFeatures.cmake
@@ -21,6 +21,7 @@ MACRO (WEBKIT_OPTION_BEGIN)
WEBKIT_OPTION_DEFINE(ENABLE_CHANNEL_MESSAGING "Toggle MessageChannel and MessagePort support" ON)
WEBKIT_OPTION_DEFINE(ENABLE_CSP_NEXT "Toggle Content Security Policy 1.1 support" OFF)
WEBKIT_OPTION_DEFINE(ENABLE_CSS3_FLEXBOX "Toggle CSS3 Flexbox support" ON)
+ WEBKIT_OPTION_DEFINE(ENABLE_CSS3_TEXT_DECORATION "Toggle CSS3 Text Decoration support" OFF)
WEBKIT_OPTION_DEFINE(ENABLE_CSS_BOX_DECORATION_BREAK "Toggle Box Decoration Break (CSS Backgrounds and Borders) support" ON)
WEBKIT_OPTION_DEFINE(ENABLE_CSS_COMPOSITING "Toggle CSS COMPOSITING support" OFF)
WEBKIT_OPTION_DEFINE(ENABLE_CSS_EXCLUSIONS "Toggle CSS Exclusion support" OFF)
diff --git a/Source/cmakeconfig.h.cmake b/Source/cmakeconfig.h.cmake
index df8cb176c..597e4c31f 100644
--- a/Source/cmakeconfig.h.cmake
+++ b/Source/cmakeconfig.h.cmake
@@ -25,6 +25,7 @@
#cmakedefine01 ENABLE_CSS_STICKY_POSITION
#cmakedefine01 ENABLE_CSS_VARIABLES
#cmakedefine01 ENABLE_CSS3_FLEXBOX
+#cmakedefine01 ENABLE_CSS3_TEXT_DECORATION
#cmakedefine01 ENABLE_CSS_FILTERS
#cmakedefine01 ENABLE_CSS_SHADERS
#cmakedefine01 ENABLE_CUSTOM_SCHEME_HANDLER
@@ -101,6 +102,7 @@
#cmakedefine01 ENABLE_WEB_SOCKETS
#cmakedefine01 ENABLE_WEB_TIMING
#cmakedefine01 ENABLE_WORKERS
+#cmakedefine01 ENABLE_XHR_RESPONSE_BLOB
#cmakedefine01 ENABLE_XSLT
#cmakedefine01 USE_SYSTEM_MALLOC
#cmakedefine01 WTF_USE_TILED_BACKING_STORE
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/config.json b/Tools/BuildSlaveSupport/build.webkit.org-config/config.json
index c4f98ae69..d6f12ccfe 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/config.json
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/config.json
@@ -51,7 +51,7 @@
{ "name": "szeged-windows-1", "platform": "qt-win"},
{ "name": "szeged-windows-2", "platform": "qt-win"},
- { "name": "indt-snowleopard", "platform": "qt-mac"},
+ { "name": "indt-mountainlion", "platform": "qt-mac"},
{ "name": "google-windows-1", "platform": "chromium-win" },
{ "name": "google-windows-2", "platform": "chromium-win" },
@@ -233,9 +233,9 @@
"slavenames": ["szeged-windows-2"]
},
{
- "name": "Qt SnowLeopard Release", "type": "Build", "builddir": "qt-snowleopard-release",
+ "name": "Qt Mountain Lion Release", "type": "Build", "builddir": "qt-mountainlion-release",
"platform": "qt-mac", "configuration": "release", "architectures": ["x86_64"],
- "slavenames": ["indt-snowleopard"]
+ "slavenames": ["indt-mountainlion"]
},
{
"name": "Chromium Win Release", "type": "Build", "builddir": "chromium-win-release",
@@ -326,7 +326,7 @@
"builderNames": ["GTK Linux 32-bit Release", "GTK Linux 64-bit Release", "GTK Linux 64-bit Debug",
"Qt Linux Release", "Qt Linux Release minimal", "Qt Linux 64-bit Release (Perf)",
"Qt Linux 64-bit Release (WebKit2 Perf)", "Qt Linux ARMv7 Release",
- "Qt Windows 32-bit Release", "Qt Windows 32-bit Debug", "Qt SnowLeopard Release",
+ "Qt Windows 32-bit Release", "Qt Windows 32-bit Debug", "Qt Mountain Lion Release",
"Chromium Win Release", "Chromium Mac Release", "Chromium Linux Release",
"Chromium Android Release",
"EFL Linux 64-bit Release", "EFL Linux 64-bit Debug", "EFL Linux 32-bit Release (Build)", "EFL Linux 64-bit Debug WK2",
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg b/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg
index 546844b38..363e8921a 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg
@@ -107,6 +107,7 @@ class ConfigureBuild(buildstep.BuildStep):
self.setProperty("configuration", self.configuration)
self.setProperty("architecture", self.architecture)
self.setProperty("buildOnly", self.buildOnly)
+ self.setProperty("shouldAbortEarly", True)
self.finished(SUCCESS)
return defer.succeed(None)
@@ -298,9 +299,7 @@ class RunWebKitTests(shell.Test):
"--build-number", WithProperties("%(buildnumber)s"),
"--master-name", "webkit.org",
"--test-results-server", "test-results.appspot.com",
- WithProperties("--%(configuration)s"),
- "--exit-after-n-crashes-or-timeouts", "20",
- "--exit-after-n-failures", "500"]
+ WithProperties("--%(configuration)s")]
def __init__(self, buildJSCTool=True, *args, **kwargs):
self.buildJSCTool = buildJSCTool
@@ -309,9 +308,13 @@ class RunWebKitTests(shell.Test):
def start(self):
platform = self.getProperty('platform')
+ shouldAbortEarly = self.getProperty('shouldAbortEarly')
appendCustomBuildFlags(self, platform, self.getProperty('fullPlatform'))
if platform.startswith('mac'):
self.setCommand(self.command + ['--no-build'])
+ if shouldAbortEarly:
+ self.setCommand(self.command + ["--exit-after-n-crashes-or-timeouts", "20", "--exit-after-n-failures", "500"])
+
if platform == "win":
rootArgument = ['--root=' + os.path.join("WebKitBuild", self.getProperty('configuration'), "bin")]
self.setCommand(self.command + ['--no-build'])
@@ -351,7 +354,7 @@ class RunWebKitTests(shell.Test):
expressions = [
('flakes', re.compile(r'[Uu]nexpected flakiness.+:?\s*\((\d+)\)')),
('new passes', re.compile(r'Expected to .+, but passed:\s+\((\d+)\)')),
- ('missing results', re.compile(r'(no expected results found|missing results)\s*:\s+\((\d+)\)')),
+ ('missing results', re.compile(r'(?:no expected results found|missing results)\s*:\s+\((\d+)\)')),
('failures', re.compile(r'Regressions: [Uu]nexpected.+:?\s*\((\d+)\)')),
]
testFailures = {}
@@ -596,6 +599,7 @@ class RunWebKitLeakTests(RunWebKitTests):
class RunWebKit2Tests(RunWebKitTests):
def start(self):
+ self.setProperty("shouldAbortEarly", False)
self.setCommand(self.command + ["--webkit-test-runner"])
return RunWebKitTests.start(self)
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py b/Tools/BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py
index 813ff22d6..857344005 100755
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py
@@ -5,6 +5,10 @@ import os
import StringIO
import unittest
+# Show DepricationWarnings come from buildbot - it isn't default with Python 2.7 or newer.
+# See https://bugs.webkit.org/show_bug.cgi?id=90161 for details.
+import warnings
+warnings.simplefilter('default')
class BuildBotConfigLoader(object):
def _add_webkitpy_to_sys_path(self):
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/templates/root.html b/Tools/BuildSlaveSupport/build.webkit.org-config/templates/root.html
index 0180eab0c..467f24016 100755
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/templates/root.html
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/templates/root.html
@@ -24,6 +24,7 @@
<li><a href="results">Test Results</a></li>
<li><a href="LeaksViewer">Leaks Viewer</a></li>
<li><a href="TestFailures">Test Failures</a></li>
+ <li><a href="http://webkit-perf.appspot.com/">Perf-o-matic</a> (external website) results submitted by <a href="http://build.webkit.org/waterfall?show=Apple%20Lion%20Release%20%28Perf%29&show=Chromium%20Linux%20Release%20%28Perf%29&show=Chromium%20Mac%20Release%20%28Perf%29&show=Chromium%20Win%20Release%20%28Perf%29&show=Qt%20Linux%2064-bit%20Release%20%28Perf%29&show=Qt%20Linux%2064-bit%20Release%20%28WebKit2%20Perf%29">performance bots</a></li>
</ul>
</body> </html>
diff --git a/Tools/BuildSlaveSupport/built-product-archive b/Tools/BuildSlaveSupport/built-product-archive
index ac9ae3d50..6c4c8eede 100644
--- a/Tools/BuildSlaveSupport/built-product-archive
+++ b/Tools/BuildSlaveSupport/built-product-archive
@@ -145,7 +145,7 @@ def archiveBuiltProduct(configuration, platform, fullPlatform):
if platform == 'qt' or platform == 'efl':
neededDirectories = ["bin", "lib"]
elif platform == 'gtk':
- neededDirectories = ["Programs", ".libs", "Libraries"]
+ neededDirectories = ["Programs", ".libs", "Libraries", "TestNetscapePlugin"]
for dirname in neededDirectories:
fromDir = os.path.join(configurationBuildDirectory, dirname, ".")
diff --git a/Tools/CLWrapper/CLWrapper.vcproj b/Tools/CLWrapper/CLWrapper.vcproj
index 844d72a7c..3563692b3 100644
--- a/Tools/CLWrapper/CLWrapper.vcproj
+++ b/Tools/CLWrapper/CLWrapper.vcproj
@@ -60,6 +60,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
OutputFile="$(OutDir)\cl.exe"
LinkIncremental="2"
GenerateDebugInformation="true"
@@ -134,6 +135,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
OutputFile="$(OutDir)\cl.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index f8a5d2e64..a3cb05bd9 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,1309 @@
+2012-08-21 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed build fix for newer Qt 5: The meaning of private_includes changed to be fully
+ self-contained. The module name is not appended automatically anymore.
+
+ * qmake/qt_webkit.pri:
+
+2012-08-20 Xianzhu Wang <wangxianzhu@chromium.org>
+
+ [Chromium-Android] Add stop_when_done parameter to ChromiumAndroidDriver.run_test()
+ https://bugs.webkit.org/show_bug.cgi?id=94558
+
+ Reviewed by Dirk Pranke.
+
+ * Scripts/webkitpy/layout_tests/port/chromium_android.py:
+ (ChromiumAndroidDriver.run_test):
+
+2012-08-20 Ryosuke Niwa <rniwa@webkit.org>
+
+ Cleanup TestExpectationParser.parse
+ https://bugs.webkit.org/show_bug.cgi?id=94545
+
+ Reviewed by Dirk Pranke.
+
+ Refactor TestExpectations to simplify the code.
+
+ * Scripts/webkitpy/layout_tests/models/test_expectations.py:
+ (TestExpectationParser.parse): Merged _tokenize_list.
+ (TestExpectationParser._parse_line): Removed the call to _check_modifiers_against_expectations
+ since the check is now done in _parser_modifiers.
+ (TestExpectationParser._parse_modifiers): Merged _check_modifiers_against_expectations.
+ (TestExpectationParser._tokenize_line): Renamed from _tokenize.
+ (TestExpectationParser._split_space_separated): No longer calls lower() on all modifiers.
+ This is done on a local variable in _parse_modifiers, preserving the original case.
+ (TestExpectations.remove_rebaselined_tests.without_rebaseline_modifier): Check the existence
+ of 'rebaseline' against parsed modifiers.
+ * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:
+ (TestExpectationParserTests._tokenize):
+ (TestExpectationParserTests.test_tokenize_valid_with_comment): Preserves case.
+ (TestExpectationParserTests.test_tokenize_valid_with_multiple_modifiers): Ditto.
+ (TestExpectationSerializerTests._tokenize):
+ (TestExpectationSerializerTests.assert_list_round_trip): Call parse since _tokenize_list has
+ been merged into parse.
+ * Scripts/webkitpy/tool/commands/queries_unittest.py:
+ (PrintExpectationsTest.test_csv): Preserves the case.
+
+2012-08-20 Gustavo Noronha Silva <gns@gnome.org>
+
+ [jhbuild] EFL now runs jhbuild update for every build
+ https://bugs.webkit.org/show_bug.cgi?id=94267
+
+ Reviewed by Martin Robinson.
+
+ Try to fix WinCE build by returning the empty string instead of
+ env when no jhbuild infrastructure is found.
+
+ * Scripts/webkitdirs.pm:
+ (jhbuildWrapperPrefixIfNeeded):
+
+2012-08-20 Benjamin Poulain <benjamin@webkit.org>
+
+ Add a watcher for WTF changes
+
+ Unreviewed.
+
+ Add myself as a watcher for changes in WTF.
+
+ * Scripts/webkitpy/common/config/watchlist:
+
+2012-08-20 Thiago Marcos P. Santos <thiago.santos@intel.com>
+
+ [EFL] Move jhbuild dependencies based on SVN to tarballs
+ https://bugs.webkit.org/show_bug.cgi?id=90374
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Moved all the dependencies based on SVN to tarballs taken from a
+ equivalent snapshot from the official git mirror. This will make
+ update-webkitefl not dependent on network connection after the first
+ run. The bots will not fail if EFL SVN server in unreachable.
+ The reason why git mirror is not used directly is to minimize the
+ total size of source code we need to download.
+
+ * efl/jhbuild.modules:
+
+2012-08-20 Simon Fraser <simon.fraser@apple.com>
+
+ Lots of "error, test and reference image have different properties" in pixel test output
+ https://bugs.webkit.org/show_bug.cgi?id=92578
+
+ Reviewed by Dirk Pranke.
+
+ Improve ImageDiff's error reporting when test result image and expected image
+ differ in their properties.
+
+ * DumpRenderTree/cg/ImageDiffCG.cpp:
+
+2012-08-20 Nate Chapin <japhet@chromium.org>
+
+ Unsafe vsprintf usage in TestNetscapePlugin
+ https://bugs.webkit.org/show_bug.cgi?id=94522
+
+ Reviewed by Adam Barth.
+
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+ (pluginLogWithArguments): Using vsnprintf instead of vsprintf to ensure we don't overflow
+ the message buffer.
+ (testDocumentOpen):
+ (testWindowOpen):
+
+2012-08-20 George Staikos <staikos@webkit.org>
+
+ [BlackBerry] Enable XHR Response BLOB
+ https://bugs.webkit.org/show_bug.cgi?id=94525
+
+ Reviewed by Rob Buis.
+
+ Turn on the XHR response blob feature for the BlackBerry port.
+
+ * Scripts/webkitperl/FeatureList.pm: Add the feature and enable it.
+
+2012-08-20 Dirk Pranke <dpranke@chromium.org>
+
+ Fix change for timeout detection to not crash if we have no output :)
+ https://bugs.webkit.org/show_bug.cgi?id=94505
+
+ Unreviewed, build fix.
+
+ * Scripts/webkitpy/layout_tests/port/driver.py:
+ (Driver.run_test):
+
+2012-08-20 Dirk Pranke <dpranke@chromium.org>
+
+ temporarily disable ImageDiff on WK2 ports for ref tests
+ https://bugs.webkit.org/show_bug.cgi?id=94517
+
+ Reviewed by Brady Eidson.
+
+ ImageDiff appears to be unable to handle the pngs returned from
+ WebKitTestRunner, so we disable checking images by default
+ for ref tests on wk2 ports (unless pixel tests is explicitly enabled).
+
+ * Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:
+ (SingleTestRunner._compare_output_with_reference):
+
+2012-08-20 Dirk Pranke <dpranke@chromium.org>
+
+ Add missing FIXME: to previous change.
+ https://bugs.webkit.org/show_bug.cgi?id=94505
+
+ Reviewed by Ojan Vafai.
+
+ * Scripts/webkitpy/layout_tests/port/driver.py:
+ (Driver.run_test):
+
+2012-08-20 Dirk Pranke <dpranke@chromium.org>
+
+ Intermittenly, many WebKit2 tests have results from the wrong test compared to the test just run, giving false failures.
+ https://bugs.webkit.org/show_bug.cgi?id=94505
+
+ Reviewed by Ojan Vafai.
+
+ It looks like if the webprocess times out, WTR may tell NRWT
+ that the test completed, but not properly reset its internal
+ state, and then return stale output for subsequent tests.
+
+ This patch modifies NRWT temporarily to check for
+ "Timed out waiting for final message from web process" in stdout
+ and treat that as a timeout (and thus kill WTR); this seems
+ to solve the cascade of failures, but of course there's probably
+ still a bug in WTR that needs to be fixed.
+
+ * Scripts/webkitpy/layout_tests/port/driver.py:
+ (Driver.run_test):
+
+2012-08-20 Dirk Pranke <dpranke@chromium.org>
+
+ NRWT reports unexpected EOF
+ https://bugs.webkit.org/show_bug.cgi?id=94387
+
+ Reviewed by Adam Barth.
+
+ Stop logging "Unexpected EOF" when we are reading the last few
+ bytes from stdout/stderr after stopping the subprocess.
+
+ * Scripts/webkitpy/layout_tests/port/server_process.py:
+ (ServerProcess._wait_for_data_and_update_buffers_using_select):
+ (ServerProcess.stop):
+
+2012-08-20 Brady Eidson <beidson@apple.com>
+
+ Temporarily disable the 20+ crash and 500+ failure options on WK2 bots.
+ https://bugs.webkit.org/show_bug.cgi?id=94506
+
+ Reviewed by Dirk Pranke.
+
+ When running WK2 tests, don't add the "abort early" command line options.
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+ (ConfigureBuild.start):
+ (RunWebKitTests):
+ (RunWebKitTests.start):
+ (RunWebKit2Tests.start):
+
+2012-08-19 Stephanie Lewis <slewis@apple.com>
+
+ Add mountain lion to build config.
+ https://bugs.webkit.org/show_bug.cgi?id=94441
+
+ Reviewed by Adam Barth.
+
+ Add Mountain Lion to the build trigger configurations.
+
+ * Scripts/webkitpy/common/config/build.py:
+ (_should_file_trigger_build):
+ * Scripts/webkitpy/common/config/build_unittest.py:
+ (ShouldBuildTest):
+ (ShouldBuildTest.test_should_build):
+
+2012-08-17 Kiran Muppala <cmuppala@apple.com>
+
+ Add self to webkit contributors list
+ https://bugs.webkit.org/show_bug.cgi?id=94409
+
+ Reviewed by Dirk Pranke.
+
+ Add name, email and irc handle to webkit contributors list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2012-08-17 Ryosuke Niwa <rniwa@webkit.org>
+
+ Perfalizer should differentiate results with and without the patch
+ https://bugs.webkit.org/show_bug.cgi?id=94399
+
+ Reviewed by Dirk Pranke.
+
+ Add "with 12345" and "without 12345" descriptions in results JSON so that graphs in
+ the results page are labled accordingly.
+
+ Also use _build_without_patch when building without a patch so that we get the right error message.
+
+ * Scripts/webkitpy/tool/commands/perfalizer.py:
+ (PerfalizerTask.run):
+ (PerfalizerTask._run_perf_test):
+ * Scripts/webkitpy/tool/commands/perfalizer_unittest.py:
+ (PerfalizerTaskTest._create_and_run_perfalizer.run_perf_test):
+
+2012-08-17 Dirk Pranke <dpranke@chromium.org>
+
+ nrwt: don't fail tests if ImageDiff fails on the wk2 ports
+ https://bugs.webkit.org/show_bug.cgi?id=94396
+
+ Reviewed by Ryosuke Niwa.
+
+ It appears that WTR is generating PNGs that ImageDiff doesn't
+ like, and so we're getting lots of "can not get ImageDiff"
+ errors (see bug 81962). The change in r124581 made this a test
+ failure, and this is causing the WK2 bots to frequently abort
+ with 500+ failures.
+
+ This change makes ImageDiff errors not be test failures just for
+ WK2 for now until we can better triage what's going on.
+
+ * Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:
+ (SingleTestRunner._compare_image):
+
+2012-08-17 James Robinson <jamesr@chromium.org>
+
+ [chromium] Add a style check for #include "cc/..." in chromium files
+ https://bugs.webkit.org/show_bug.cgi?id=94382
+
+ Reviewed by Adam Barth.
+
+ Adds a style check to make sure new chromium code follows the correct convention for including cc files.
+
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ (check_include_line):
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+ (OrderOfIncludesTest.test_check_cc_includes):
+
+2012-08-17 Ojan Vafai <ojan@chromium.org>
+
+ Delete some dead code from the flakiness dashboard
+ https://bugs.webkit.org/show_bug.cgi?id=94380
+
+ Reviewed by Dirk Pranke.
+
+ This code became dead in one of the refactors of how we handle BuilderGroups.
+ There's no bug here, it's just dead code.
+ * TestResultServer/static-dashboards/builders.js:
+ (requestBuilderList):
+ (loadBuildersList):
+
+2012-08-17 Jochen Eisinger <jochen@chromium.org>
+
+ [chromium] Add content shell bots to the flakiness dashboard
+ https://bugs.webkit.org/show_bug.cgi?id=94369
+
+ Reviewed by Ojan Vafai.
+
+ The bots are named $OS (Content Shell).
+
+ * TestResultServer/static-dashboards/builders.js:
+ (isChromiumWebkitTipOfTreeTestRunner):
+ * TestResultServer/static-dashboards/flakiness_dashboard_unittests.js:
+
+2012-08-17 Shadi Khalek <shadi@chromium.org>
+
+ Add AV perf layout tests to webkit flakiness dashboard
+ https://bugs.webkit.org/show_bug.cgi?id=94255
+
+ Reviewed by Ojan Vafai.
+
+ Added missing mappings to LEGACY_BUILDER_MASTERS_TO_GROUPS.
+ The isChromiumDepsAVTestRunner() filter does not work on current builder names.
+ It assumes the new names they are getting renamed to (AV Linux, AV Win7).
+
+ * TestResultServer/static-dashboards/builders.js:
+ (isChromiumTipOfTreeAVTestRunner):
+ (loadBuildersList):
+
+2012-08-17 Milian Wolff <milian.wolff@kdab.com>
+
+ [Qt] QtWebKit fails to build with OpenGL support on QNX
+ https://bugs.webkit.org/show_bug.cgi?id=93278
+
+ Reviewed by Noam Rosenthal.
+
+ Change the order in which we define WTF_USE_3D_GRAPHICS and ENABLE_WEBGL.
+ First, we now defined WTF_USE_3D_GRAPHICS=1, but only if QT_CONFIG
+ contains opengl. Furthermore, we disable this feature on win32-* as usual,
+ but now also disable it on QNX.
+
+ Then, we set ENABLE_WEBGL=1 but only if we previously set WTF_USE_3D_GRAPHICS=1.
+
+ * qmake/mkspecs/features/features.prf:
+
+2012-08-16 Gustavo Noronha Silva <gns@gnome.org>
+
+ [jhbuild] EFL now runs jhbuild update for every build
+ https://bugs.webkit.org/show_bug.cgi?id=94267
+
+ Reviewed by Dirk Pranke.
+
+ This change makes EFL's approach to jhbuild more in line with the one
+ used by WebKitGTK+. update-webkitefl-libs will only be called by build-
+ webkit if --update-efl is given explicitly. The EWS bot will do that
+ from now on.
+
+ * Scripts/webkitdirs.pm:
+ (jhbuildWrapperPrefixIfNeeded): return jhbuild wrapper only if the
+ Dependencies directory exists also for EFL
+ (generateBuildSystemFromCMakeProject): no longer run update-webkitefl-libs
+ (buildCMakeProjectOrExit): build update-webkitefl-libs if --update-efl is
+ given
+ * Scripts/webkitpy/common/config/ports.py:
+ (EflPort.build_webkit_command): make EWS bots pass --update-efl to build-webkit
+ * Scripts/webkitpy/common/config/ports_unittest.py:
+ (DeprecatedPortTest.test_efl_port): add unit testing for EFL port
+
+2012-08-16 Kent Tamura <tkent@chromium.org>
+
+ Add forms-bugs@chromium.org as a contributor.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2012-08-16 Gustavo Noronha Silva <gns@gnome.org>
+
+ Unreviewed warning fix, sys.argv is a python construct.
+
+ * Scripts/update-webkitefl-libs:
+
+2012-08-16 Dirk Pranke <dpranke@chromium.org>
+
+ NRWT cutting off the output from LayoutTest run under Valgrind
+ https://bugs.webkit.org/show_bug.cgi?id=94011
+
+ Reviewed by Ojan Vafai.
+
+ Make NRWT work with valgrind again ... I needed to rework the
+ driver infrastructure so that we could get the stderr written
+ between a test completing and a process being stopped and
+ associate it with the DriverOutput for the test; this meant that
+ run_test() needed to stop the driver at the end of the test
+ directly if/when appropriate. This also entailed reworking
+ run_test() so that we would gather stderr and stdout
+ consistently regardless of whether this was a normal test, or
+ stop_when_done, or a crash or timeout.
+
+ Also, I had to rework the process_stop_time() (and renamed it to
+ driver_stop_timeout) so that it would be longer if --time-out-ms
+ was long as well (so that valgrind would get enough time to
+ run), and I reworked driver.stop(kill_directly=True) to just
+ driver.stop(timeout=0.0).
+
+ Lastly, adding the new stop_when_done parameter entailed
+ touching a lot of test mock functions :(.
+
+ This change appeared to be well-covered by existing tests.
+
+ * Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:
+ (Worker._run_test):
+ (Worker._run_test_with_timeout):
+ (Worker._run_test_in_another_thread):
+ (Worker._run_test_in_another_thread.SingleTestThread.run):
+ (Worker._run_test_in_this_thread):
+ (Worker._run_single_test):
+ * Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:
+ (run_single_test):
+ (SingleTestRunner.__init__):
+ (SingleTestRunner._run_compare_test):
+ (SingleTestRunner._run_rebaseline):
+ (SingleTestRunner._run_reftest):
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ (Port.driver_stop_timeout):
+ (Port.variable.default_configuration):
+ * Scripts/webkitpy/layout_tests/port/chromium_android.py:
+ (ChromiumAndroidPort.driver_stop_timeout):
+ (ChromiumAndroidDriver.stop):
+ * Scripts/webkitpy/layout_tests/port/driver.py:
+ (Driver.run_test):
+ (Driver.stop):
+ (DriverProxy.run_test):
+ * Scripts/webkitpy/layout_tests/port/driver_unittest.py:
+ (DriverTest.test_check_for_driver_crash.FakeServerProcess.stop):
+ * Scripts/webkitpy/layout_tests/port/server_process.py:
+ (ServerProcess.write):
+ (ServerProcess._wait_for_data_and_update_buffers_using_select):
+ (ServerProcess.stop):
+ (ServerProcess.kill):
+ (ServerProcess):
+ (ServerProcess._kill):
+ * Scripts/webkitpy/layout_tests/port/server_process_unittest.py:
+ (TrivialMockPort.__init__):
+ (MockProc.wait):
+ (TestServerProcess.test_basic):
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ (TestDriver.run_test):
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
+ (get_tests_run.RecordingTestDriver.run_test):
+ * Scripts/webkitpy/performance_tests/perftest.py:
+ (PerfTest.run_single):
+ * Scripts/webkitpy/performance_tests/perftest_unittest.py:
+ (TestPageLoadingPerfTest.MockDriver.run_test):
+ (TestReplayPerfTest.ReplayTestPort.__init__.ReplayTestDriver.run_test):
+ (TestReplayPerfTest.test_run_single.run_test):
+ (TestReplayPerfTest.test_run_single_fails_when_output_has_error.run_test):
+ (TestReplayPerfTest.test_prepare.run_test):
+ * Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:
+ (MainTest.TestDriver.run_test):
+
+2012-08-16 Roger Fong <roger_fong@apple.com>
+
+ Typo in old-run-webkit-tests script from https://bugs.webkit.org/show_bug.cgi?id=93904.
+ https://bugs.webkit.org/show_bug.cgi?id=94228
+
+ Reviewed by Tim Horton.
+
+ I previously made the change but made a typo that causes the script not ignore mismatch ref tests.
+
+ * Scripts/old-run-webkit-tests:
+ (isUsedInReftest):
+
+2012-08-16 Peter Beverloo <peter@chromium.org>
+
+ [Chromium] Pass the --strip-binary argument to the apk test generator
+ https://bugs.webkit.org/show_bug.cgi?id=94224
+
+ Reviewed by Adam Barth.
+
+ The native test generator currently relies on the $STRIP environment
+ variable to be available, which it shouldn't do. Instead, pass it as an
+ argument to the script. The $STRIP variable is being deprecated.
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+ * TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp:
+
+2012-08-16 Xiaobo Wang <xbwang@torchmobile.com.cn>
+
+ [BlackBerry] Update format of JS console message to keep consistent with other ports.
+ https://bugs.webkit.org/show_bug.cgi?id=94058
+
+ Reviewed by Yong Li.
+ Reviewed internally by George Staikos.
+
+ 1. Remove line number if it's zero.
+ 2. Print only file name for "file://" URL.
+
+ * DumpRenderTree/blackberry/DumpRenderTree.cpp:
+ (BlackBerry::WebKit::DumpRenderTree::addMessageToConsole):
+
+2012-08-16 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Make DRT results more reliable on X11
+
+ Reviewed by Jocelyn Turcotte.
+
+ Disable desktop setting awareness, to prevent QApplication on X11 from reading palette settings from
+ the running desktop environment.
+
+ * DumpRenderTree/qt/main.cpp:
+ (main):
+
+2012-08-16 Pierre Rossi <pierre.rossi@gmail.com>
+
+ [Qt] Remove FontQt4, HAVE_QRAWFONT flag and the related dead code
+ https://bugs.webkit.org/show_bug.cgi?id=93960
+
+ Reviewed by Simon Hausmann.
+
+ Following the removal of Qt 4 support from trunk in r124879.
+
+ * qmake/mkspecs/features/features.prf:
+
+2012-08-16 Taiju Tsuiki <tzik@chromium.org>
+
+ Add deleteFileSystem support to DumpRenderTree for chromium
+ https://bugs.webkit.org/show_bug.cgi?id=94071
+
+ Reviewed by Kent Tamura.
+
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::deleteFileSystem): Added
+ * DumpRenderTree/chromium/WebViewHost.h:
+ (WebViewHost):
+
+2012-08-15 Ryosuke Niwa <rniwa@webkit.org>
+
+ Rename LayoutTestController to TestRunner in WebKitTestRunner
+ https://bugs.webkit.org/show_bug.cgi?id=93942
+
+ Reviewed by Simon Fraser.
+
+ Renamed the class and relevant files.
+
+ * WebKitTestRunner/CMakeLists.txt:
+ * WebKitTestRunner/DerivedSources.make:
+ * WebKitTestRunner/GNUmakefile.am:
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl: Removed.
+ * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: Copied from Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl.
+ * WebKitTestRunner/InjectedBundle/DerivedSources.pri:
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::didReceiveMessage):
+ (WTR::InjectedBundle::beginTesting):
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+ (WTR::InjectedBundle::testRunner):
+ (InjectedBundle):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: Removed.
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Removed.
+ * WebKitTestRunner/InjectedBundle/Target.pri:
+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp.
+ * WebKitTestRunner/InjectedBundle/TestRunner.h: Copied from Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h.
+ (TestRunner):
+ * WebKitTestRunner/InjectedBundle/efl/LayoutTestControllerEfl.cpp: Removed.
+ * WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/efl/LayoutTestControllerEfl.cpp.
+ (WTR::waitToDumpWatchdogTimerCallback):
+ (WTR::TestRunner::platformInitialize):
+ (WTR::TestRunner::invalidateWaitToDumpWatchdogTimer):
+ (WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded):
+ (WTR::TestRunner::pathToLocalResource):
+ (WTR::TestRunner::platformName):
+ * WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp: Removed.
+ * WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp.
+ (WTR::waitToDumpWatchdogTimerCallback):
+ (WTR::TestRunner::platformInitialize):
+ (WTR::TestRunner::invalidateWaitToDumpWatchdogTimer):
+ (WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded):
+ (WTR::TestRunner::pathToLocalResource):
+ (WTR::TestRunner::platformName):
+ * WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm: Removed.
+ * WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm: Copied from Tools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm.
+ (WTR::TestRunner::platformInitialize):
+ (WTR::TestRunner::invalidateWaitToDumpWatchdogTimer):
+ (WTR::waitUntilDoneWatchdogTimerFired):
+ (WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded):
+ (WTR::TestRunner::pathToLocalResource):
+ (WTR::TestRunner::platformName):
+ * WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp: Removed.
+ * WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp.
+ (WTR::WatchdogTimerHelper::timerFired):
+ (WTR::TestRunner::platformInitialize):
+ (WTR::TestRunner::invalidateWaitToDumpWatchdogTimer):
+ (WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded):
+ (WTR::TestRunner::pathToLocalResource):
+ (WTR::TestRunner::platformName):
+ * WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp: Removed.
+ * WebKitTestRunner/InjectedBundle/win/TestRunnerWin.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp.
+ (WTR::TestRunner::platformInitialize):
+ (WTR::TestRunner::invalidateWaitToDumpWatchdogTimer):
+ (WTR::waitToDumpWatchdogTimerFired):
+ (WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded):
+ (WTR::TestRunner::pathToLocalResource):
+ (WTR::TestRunner::platformName):
+ * WebKitTestRunner/PlatformEfl.cmake:
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+ * WebKitTestRunner/win/InjectedBundle.vcproj:
+
+2012-08-15 Xianzhu Wang <wangxianzhu@chromium.org>
+
+ [Chromium-Android] DumpRenderTree timeouts before NRWT timeouts
+ https://bugs.webkit.org/show_bug.cgi?id=94155
+
+ Reviewed by Dirk Pranke.
+
+ * Scripts/webkitpy/layout_tests/port/chromium_android.py:
+ (ChromiumAndroidPort.create_driver): Force no_timeout=True
+
+2012-08-15 Ryosuke Niwa <rniwa@webkit.org>
+
+ Add a hyperlink to perf-o-matic from build.webkit.org/root.html
+ https://bugs.webkit.org/show_bug.cgi?id=93749
+
+ Reviewed by Csaba Osztrogonác.
+
+ Added the hyperlink to webkit-perf.appspot.com. Also added hyperlinks to the waterfall display
+ of performance tests.
+
+ * BuildSlaveSupport/build.webkit.org-config/templates/root.html:
+
+2012-08-15 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com>
+
+ [css3-text] Add CSS3 Text decoration compile flag
+ https://bugs.webkit.org/show_bug.cgi?id=93863
+
+ Reviewed by Julien Chaffraix.
+
+ This patch handles the compile flag implementation, which will come disabled by
+ default, thus not exposing the CSS3 text decoration features to the web, unless
+ when explicitly enabling it with "--css3-text-decoration" build parameter.
+
+ * Scripts/webkitperl/FeatureList.pm:
+ * qmake/mkspecs/features/features.pri:
+
+2012-08-15 Beth Dakin <bdakin@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=93693
+ [WK2] REGRESSION(125091): pixel results don't sow scrollbars
+ anymore
+
+ Reviewed by Sam Weinig.
+
+ Use new API WKBundlePageCreateSnapshotWithOptions().
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::dump):
+
+2012-08-15 Alexey Proskuryakov <ap@apple.com>
+
+ Add rfong to Bugzilla CC "contributor" list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2012-08-15 Scott Graham <scottmg@chromium.org>
+
+ Rename window.internals.fastMallocStatistics to mallocStatistics
+ https://bugs.webkit.org/show_bug.cgi?id=94033
+
+ Reviewed by Adam Barth.
+
+ * GNUmakefile.am:
+ * Scripts/webkitpy/performance_tests/perftest.py:
+ (PerfTest):
+ * Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:
+ (test_run_memory_test):
+
+2012-08-15 Peter Beverloo <peter@chromium.org>
+
+ Fix a warning in TestWebKitAPI's MediaTime test-suite
+ https://bugs.webkit.org/show_bug.cgi?id=94096
+
+ Reviewed by Adam Barth.
+
+ This warning is visible when building the file with certain GCC versions,
+ including the one used by Chromium for Android. The warning is visible in
+ the cr-android build bot output:
+
+ MediaTime.cpp:152: warning: this decimal constant is unsigned only in ISO C90
+
+ * TestWebKitAPI/Tests/WTF/MediaTime.cpp:
+ (TestWebKitAPI::TEST):
+
+2012-08-15 Kevin Funk <kevin.funk@kdab.com>
+
+ Fix the 'git log' call in VCSUtils.pm for Windows
+ https://bugs.webkit.org/show_bug.cgi?id=94113
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Failed because of invalid enquoting characters.
+
+ * Scripts/VCSUtils.pm:
+
+2012-08-14 Gustavo Noronha Silva <gns@gnome.org>
+
+ [jhbuild] move md5sum checking to update-webkit-libs-jhbuild
+ https://bugs.webkit.org/show_bug.cgi?id=93208
+
+ Reviewed by Martin Robinson.
+
+ This change makes the md5sum check and saving be done by the script
+ that performs the dependencies update. build-webkit no longer prefixes
+ calls to commands with jhbuild-wrapper if jhbuild has not been
+ bootstrapped by the developer and --update-gtk is not given.
+
+ * Scripts/update-webkit-libs-jhbuild:
+ (getMD5HashForFile): moved from webkitdirs.
+ (jhbuildConfigurationChanged): ditto.
+ (saveJhbuildMd5): ditto.
+ (cleanJhbuild): ditto, and changed to run jhbuild clean before removing
+ jhbuild.
+ * Scripts/webkitdirs.pm:
+ (runAutogenForAutotoolsProjectIfNecessary): use jhbuildWrapperPrefixIfNeeded.
+ (buildAutotoolsProject): ditto.
+ (jhbuildWrapperPrefixIfNeeded): add a code branch for GTK+.
+ (generateBuildSystemFromCMakeProject): call update-webkitefl-libs
+ unconditionally for EFL.
+ * jhbuild/jhbuild-wrapper:
+ (update_webkit_libs_jhbuild): removed, jhbuild-wrapper no longer runs the
+ update script itself
+ (ensure_jhbuild): remove update call.
+
+2012-08-15 Christophe Dumez <christophe.dumez@intel.com>
+
+ [WK2] Add support for Web Intents MessagePorts
+ https://bugs.webkit.org/show_bug.cgi?id=89072
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Use WKBundleIntent instead of WebIntentData in
+ WebKitTestRunner. WTR now prints the number of
+ MessagePorts in received Web intents as
+ expected by the following layout tests:
+ webintents/web-intents-invoke-port.html
+ webintents/web-intents-obj-constructor.html
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::didReceiveIntentForFrame):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::deliverWebIntent):
+
+2012-08-14 Ryosuke Niwa <rniwa@webkit.org>
+
+ Build fix after r125516. Revert the erroneous rename since we need to keep exposing
+ layoutTestController in Chromium port as explained r124785.
+
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::bindJSObjectsToWindow):
+
+2012-08-14 Dan Bernstein <mitz@apple.com>
+
+ fast/events/overflow-scroll-fake-mouse-move.html and fast/events/frame-scroll-fake-mouse-move.html are failing in WebKit1
+ https://bugs.webkit.org/show_bug.cgi?id=94045
+
+ Reviewed by Geoff Garen.
+
+ * DumpRenderTree/mac/DumpRenderTreeWindow.mm:
+ (-[DumpRenderTreeWindow _hasKeyAppearance]): Added. Returns [self isKeyWindow]. This is
+ needed now that WebView uses -_hasKeyAppearance instead of -isKeyWindow.
+
+2012-08-14 Alexey Proskuryakov <ap@apple.com>
+
+ [WK2] Fix some typos in MiniBrowser
+ https://bugs.webkit.org/show_bug.cgi?id=94047
+
+ Reviewed by Jon Honeycutt.
+
+ * MiniBrowser/mac/AppDelegate.m:
+ (didReceiveMessageFromInjectedBundle): (-[BrowserAppDelegate init]):
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (didReceiveMessage):
+ (WKBundleInitialize):
+
+2012-08-14 Roger Fong <roger_fong@apple.com>
+
+ old-run-webkit-tests should skip all file extensions for ref tests, not just .html.
+ https://bugs.webkit.org/show_bug.cgi?id=93904
+
+ Reviewed by Tim Horton.
+
+ old-run-webkit-tests ref test only skipped .html test.
+ They need to skip .html, .shtml, .xml, .xhtml, .pl, .htm, .php, .svg, .mht.
+
+ * Scripts/old-run-webkit-tests:
+ (isUsedInReftest): Skip all extensions for ref tests.
+
+2012-08-14 Lauro Neto <lauro.neto@openbossa.org>
+
+ Convert signals/slots to Q_* macros.
+
+ [Qt] Use Q_SLOTS and Q_SIGNALS instead of slots and signals
+ https://bugs.webkit.org/show_bug.cgi?id=93996
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Change usage of keyword-conflicting 'signals' and 'slots' for
+ Q_SIGNALS and Q_SLOTS macro.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ (NetworkAccessManager):
+ (WebPage):
+ * DumpRenderTree/qt/EventSenderQt.h:
+ (EventSender):
+ * DumpRenderTree/qt/GCControllerQt.h:
+ (GCController):
+ * DumpRenderTree/qt/TestRunnerQt.h:
+ (TestRunner):
+ * DumpRenderTree/qt/TextInputControllerQt.h:
+ (TextInputController):
+ * MiniBrowser/qt/BrowserWindow.h:
+ (BrowserWindow):
+ * MiniBrowser/qt/MiniBrowserApplication.h:
+ (WindowOptions):
+ * MiniBrowser/qt/UrlLoader.h:
+ (UrlLoader):
+ * QtTestBrowser/cookiejar.h:
+ (TestBrowserCookieJar):
+ * QtTestBrowser/fpstimer.h:
+ (FpsTimer):
+ * QtTestBrowser/launcherwindow.h:
+ (LauncherWindow):
+ * QtTestBrowser/locationedit.h:
+ (LocationEdit):
+ * QtTestBrowser/mainwindow.h:
+ (MainWindow):
+ * QtTestBrowser/urlloader.h:
+ (UrlLoader):
+ * QtTestBrowser/webinspector.h:
+ (WebInspector):
+ * QtTestBrowser/webpage.h:
+ (WebPage):
+ * QtTestBrowser/webview.h:
+ (WebViewGraphicsBased):
+ * WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp:
+ (WatchdogTimerHelper):
+ * WebKitTestRunner/qt/PlatformWebViewQt.cpp:
+ (WrapperWindow):
+ * WebKitTestRunner/qt/main.cpp:
+ (Launcher):
+
+2012-08-14 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ WebKitTestRunner needs layoutTestController.dumpResourceLoadCallbacks
+ https://bugs.webkit.org/show_bug.cgi?id=42332
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Added Resource Callbacks logging. Several aux dumping functions are added.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::isFileScheme):
+ (WTR):
+ (WTR::pathSuitableForTestResult):
+ (WTR::urlSuitableForTestResult):
+ (WTR::InjectedBundlePage::resetAfterTest):
+ (WTR::dumpRequestDescriptionSuitableForTestResult):
+ (WTR::dumpResponseDescriptionSuitableForTestResult):
+ (WTR::dumpErrorDescriptionSuitableForTestResult):
+ (WTR::InjectedBundlePage::didInitiateLoadForResource):
+ (WTR::InjectedBundlePage::willSendRequestForFrame):
+ (WTR::InjectedBundlePage::didReceiveResponseForResource):
+ (WTR::InjectedBundlePage::didFinishLoadForResource):
+ (WTR::InjectedBundlePage::didFailLoadForResource):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::LayoutTestController):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ (WTR::LayoutTestController::dumpResourceLoadCallbacks):
+ (WTR::LayoutTestController::shouldDumpResourceLoadCallbacks):
+ (LayoutTestController):
+
+2012-08-14 Alexis Menard <alexis.menard@openbossa.org>
+
+ Update INdT build bot to Mountain Lion.
+ https://bugs.webkit.org/show_bug.cgi?id=93963
+
+ Reviewed by Csaba Osztrogonác.
+
+ We updated the machine as well as the OS as the Qt port is now running
+ on top of Qt5.
+
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
+
+2012-08-14 Peter Beverloo <peter@chromium.org>
+
+ [Chromium] Remove unneeded build logic for Android
+ https://bugs.webkit.org/show_bug.cgi?id=93962
+
+ Reviewed by Dimitri Glazkov.
+
+ The Android SDK and NDK have been checked in to the Chromium tree, which
+ allows WebKit to leverage those as well. They will already be pulled in
+ through a DEPS change made last week, and by not setting the ANDROID_NDK_ROOT
+ environment variable, the envsetup.sh will set the project files up
+ appropriately for us.
+
+ * Scripts/webkitdirs.pm:
+
+2012-08-14 Sergio Villar Senin <svillar@igalia.com>
+
+ [WK2] [GTK] Plugin tests failing in WK2 bot
+ https://bugs.webkit.org/show_bug.cgi?id=93954
+
+ Reviewed by Carlos Garcia Campos.
+
+ Plugin tests are failing in the WK2 bot because we aren't exporting
+ the Netscape plugin when creating the product archive.
+
+ * BuildSlaveSupport/built-product-archive: added TestNetscapePlugin
+ to the list of directories to export.
+ (archiveBuiltProduct):
+
+2012-08-14 Peter Beverloo <peter@chromium.org>
+
+ [Chromium] Fix apk generation for the Android platform
+ https://bugs.webkit.org/show_bug.cgi?id=93841
+
+ Unreviewed build fix.
+
+ APK generation was broken as the configuration file assumed compilation
+ would only occur in the Chromium tree. Pass the path to Chromium's source
+ base directory as a property to ant.
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+ * TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp:
+
+2012-08-14 Sergio Villar Senin <svillar@igalia.com>
+
+ [GTK] REGRESSION (r122428) WebKit2APITests/TestWebKitFindController fails "next" test
+ https://bugs.webkit.org/show_bug.cgi?id=91083
+
+ Reviewed by Carlos Garcia Campos.
+
+ Unskipped a couple of API tests that should work fine from now on.
+
+ * Scripts/run-gtk-tests:
+ (TestRunner):
+
+2012-08-14 Kristóf Kosztyó <kkristof@inf.u-szeged.hu>
+
+ [NRWT] Compare results between different platforms
+ https://bugs.webkit.org/show_bug.cgi?id=90555
+
+ Reviewed by Dirk Pranke.
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ (Port.baseline_search_path):
+ (Port):
+ (Port.compare_baseline):
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ (parse_args):
+
+2012-08-13 Ryosuke Niwa <rniwa@webkit.org>
+
+ Rename LayoutTestController to TestRunner in DumpRenderTree
+ https://bugs.webkit.org/show_bug.cgi?id=93758
+
+ Reviewed by Tony Chang.
+
+ Renamed LayoutTestController to TestRunner. For Chromium port, it's renamed to DRTTestRunner
+ since it already has TestRunner class shared between DumpRenderTree and content_shell.
+
+ * DumpRenderTree/DumpRenderTree.h:
+ * DumpRenderTree/PixelDumpSupport.cpp:
+ * DumpRenderTree/StorageTrackerDelegate.h:
+ * DumpRenderTree/StorageTrackerDelegate.mm:
+ * DumpRenderTree/TestRunner.cpp:
+ * DumpRenderTree/TestRunner.h:
+ * DumpRenderTree/blackberry/DumpRenderTree.cpp:
+ * DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp:
+ * DumpRenderTree/chromium/DRTTestRunner.cpp:
+ * DumpRenderTree/chromium/DRTTestRunner.h:
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ * DumpRenderTree/chromium/NotificationPresenter.h:
+ * DumpRenderTree/chromium/TestShell.cpp:
+ * DumpRenderTree/chromium/TestShell.h:
+ * DumpRenderTree/chromium/WebPermissions.cpp:
+ * DumpRenderTree/chromium/WebPermissions.h:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ * DumpRenderTree/chromium/WebViewHost.h:
+ * DumpRenderTree/efl/DumpRenderTree.cpp:
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+ * DumpRenderTree/efl/DumpRenderTreeView.cpp:
+ * DumpRenderTree/efl/EditingCallbacks.cpp:
+ * DumpRenderTree/efl/TestRunnerEfl.cpp:
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ * DumpRenderTree/gtk/EditingCallbacks.cpp:
+ * DumpRenderTree/gtk/TestRunnerGtk.cpp:
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ * DumpRenderTree/mac/DumpRenderTreeWindow.mm:
+ * DumpRenderTree/mac/EditingDelegate.mm:
+ * DumpRenderTree/mac/FrameLoadDelegate.mm:
+ * DumpRenderTree/mac/HistoryDelegate.mm:
+ * DumpRenderTree/mac/PixelDumpSupportMac.mm:
+ * DumpRenderTree/mac/PolicyDelegate.h:
+ * DumpRenderTree/mac/PolicyDelegate.mm:
+ * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+ * DumpRenderTree/mac/TestRunnerMac.mm:
+ * DumpRenderTree/mac/UIDelegate.mm:
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/TestRunnerQt.cpp:
+ * DumpRenderTree/qt/TestRunnerQt.h:
+ * DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp:
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ * DumpRenderTree/win/EditingDelegate.cpp:
+ * DumpRenderTree/win/FrameLoadDelegate.cpp:
+ * DumpRenderTree/win/HistoryDelegate.cpp:
+ * DumpRenderTree/win/PolicyDelegate.h:
+ * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+ * DumpRenderTree/win/TestRunnerWin.cpp:
+ * DumpRenderTree/win/UIDelegate.cpp:
+ * DumpRenderTree/wx/DumpRenderTreeWx.cpp:
+ * DumpRenderTree/wx/TestRunnerWx.cpp:
+
+2012-08-14 Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com>
+
+ [GTK] String returned by g_path_get_dirname() must be freed
+ https://bugs.webkit.org/show_bug.cgi?id=93885
+
+ Reviewed by Philippe Normand.
+
+ Fix a memory leak in GTK's DRT code.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (pathFromSoupURI): Free the string returned by g_path_get_dirname().
+
+2012-08-14 Zan Dobersek <zandobersek@gmail.com>
+
+ Unreviewed GTK build fix after r125508.
+
+ Do the renaming in GNUmakefile.am as well, LayoutTestController -> TestRunner.
+
+ * GNUmakefile.am:
+
+2012-08-13 Ryosuke Niwa <rniwa@webkit.org>
+
+ Rename files that declare and define LayoutTestController in DumpRenderTree
+ https://bugs.webkit.org/show_bug.cgi?id=93899
+
+ Reviewed by Tony Chang.
+
+ Renamed files and fixed style errors.
+
+ * DumpRenderTree/DumpRenderTree.gypi:
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * DumpRenderTree/LayoutTestController.cpp: Removed.
+ * DumpRenderTree/LayoutTestController.h: Removed.
+ * DumpRenderTree/PixelDumpSupport.cpp:
+ * DumpRenderTree/StorageTrackerDelegate.mm:
+ * DumpRenderTree/TestRunner.cpp: Copied from Tools/DumpRenderTree/LayoutTestController.cpp.
+ * DumpRenderTree/TestRunner.h: Copied from Tools/DumpRenderTree/LayoutTestController.h.
+ (LayoutTestController):
+ * DumpRenderTree/blackberry/DumpRenderTree.cpp:
+ * DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp: Removed.
+ * DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp: Copied from Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp.
+ * DumpRenderTree/chromium/DRTTestRunner.cpp: Copied from Tools/DumpRenderTree/chromium/LayoutTestController.cpp.
+ * DumpRenderTree/chromium/DRTTestRunner.h: Copied from Tools/DumpRenderTree/chromium/LayoutTestController.h.
+ * DumpRenderTree/chromium/LayoutTestController.cpp: Removed.
+ * DumpRenderTree/chromium/LayoutTestController.h: Removed.
+ * DumpRenderTree/chromium/TestShell.cpp:
+ * DumpRenderTree/chromium/TestShell.h:
+ * DumpRenderTree/chromium/WebPermissions.cpp:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ * DumpRenderTree/efl/CMakeLists.txt:
+ * DumpRenderTree/efl/DumpRenderTree.cpp:
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+ * DumpRenderTree/efl/DumpRenderTreeView.cpp:
+ * DumpRenderTree/efl/EditingCallbacks.cpp:
+ * DumpRenderTree/efl/LayoutTestControllerEfl.cpp: Removed.
+ * DumpRenderTree/efl/TestRunnerEfl.cpp: Copied from Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp.
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ * DumpRenderTree/gtk/EditingCallbacks.cpp:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: Removed.
+ * DumpRenderTree/gtk/TestRunnerGtk.cpp: Copied from Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp.
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ * DumpRenderTree/mac/DumpRenderTreeWindow.mm:
+ * DumpRenderTree/mac/EditingDelegate.mm:
+ * DumpRenderTree/mac/FrameLoadDelegate.mm:
+ * DumpRenderTree/mac/HistoryDelegate.mm:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm: Removed.
+ * DumpRenderTree/mac/PixelDumpSupportMac.mm:
+ * DumpRenderTree/mac/PolicyDelegate.mm:
+ * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+ * DumpRenderTree/mac/TestRunnerMac.mm: Copied from Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm.
+ * DumpRenderTree/mac/UIDelegate.mm:
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp: Removed.
+ * DumpRenderTree/qt/LayoutTestControllerQt.h: Removed.
+ * DumpRenderTree/qt/TestRunnerQt.cpp: Copied from Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp.
+ * DumpRenderTree/qt/TestRunnerQt.h: Copied from Tools/DumpRenderTree/qt/LayoutTestControllerQt.h.
+ (WebCore):
+ (LayoutTestController):
+ (LayoutTestController::setCloseRemainingWindowsWhenComplete):
+ (LayoutTestController::dumpSelectionRect):
+ (LayoutTestController::setCallCloseOnWebViews):
+ (LayoutTestController::addDisallowedURL):
+ (LayoutTestController::abortModal):
+ * DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp:
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ * DumpRenderTree/win/DumpRenderTree.vcproj:
+ * DumpRenderTree/win/EditingDelegate.cpp:
+ * DumpRenderTree/win/FrameLoadDelegate.cpp:
+ * DumpRenderTree/win/HistoryDelegate.cpp:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp: Removed.
+ * DumpRenderTree/win/PolicyDelegate.cpp:
+ * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+ * DumpRenderTree/win/TestRunnerWin.cpp: Copied from Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp.
+ (LayoutTestController::setUserStyleSheetEnabled):
+ (resolveCygwinPath):
+ * DumpRenderTree/win/UIDelegate.cpp:
+ * DumpRenderTree/wscript:
+ * DumpRenderTree/wx/DumpRenderTreeWx.cpp:
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp: Removed.
+ * DumpRenderTree/wx/TestRunnerWx.cpp: Copied from Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp.
+
+2012-08-13 Alex Christensen <alex.christensen@flexsim.com>
+
+ Windows 64 bit compliance
+ https://bugs.webkit.org/show_bug.cgi?id=93275
+
+ Reviewed by Brent Fulgham.
+
+ Fixed a few compile and link problems for Win64
+
+ * WinLauncher/WinLauncher.cpp:
+ * win/DLLLauncher/DLLLauncherMain.cpp:
+
+2012-08-13 MORITA Hajime <morrita@google.com>
+
+ Unreviewed update for webcomponents-bugzilla address.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2012-08-11 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] Rewrite FindLibSoup2.cmake.
+ https://bugs.webkit.org/show_bug.cgi?id=93191
+
+ Reviewed by Rob Buis.
+
+ * DumpRenderTree/efl/CMakeLists.txt: Use LIBSOUP_FOO instead of
+ LIBSOUP24_FOO, and do not use LIBSOUP24_LDFLAGS, as it is not
+ needed anymore.
+ * EWebLauncher/CMakeLists.txt: Ditto.
+ * MiniBrowser/efl/CMakeLists.txt: Ditto.
+ * TestWebKitAPI/PlatformEfl.cmake: Ditto.
+ * WebKitTestRunner/CMakeLists.txt: Ditto.
+ * WebKitTestRunner/PlatformEfl.cmake: Ditto.
+
+2012-08-13 Brady Eidson <beidson@apple.com>
+
+ With asynchronous plug-in initialization, WebProcess and PluginProcess can deadlock
+ <rdar://problem/12062125> and https://bugs.webkit.org/show_bug.cgi?id=93894
+
+ Reviewed by Alexey Proskuryakov.
+
+ Add a test that calls out to NPP_Evaluate for some JS inside of NPP_New.
+
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSWithinNPP_New.cpp: Added.
+ (EvaluteJSWithinNPP_New):
+ (EvaluteJSWithinNPP_New::EvaluteJSWithinNPP_New):
+ (EvaluteJSWithinNPP_New::NPP_New):
+
+2012-08-13 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r125422.
+ http://trac.webkit.org/changeset/125422
+ https://bugs.webkit.org/show_bug.cgi?id=93902
+
+ Broke the Android canary build (Requested by fmalita on
+ #webkit).
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+ * TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp:
+
+2012-08-13 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] Remove glib-related Find modules and write single new one instead.
+ https://bugs.webkit.org/show_bug.cgi?id=93786
+
+ Reviewed by Rob Buis.
+
+ * DumpRenderTree/efl/CMakeLists.txt: Use GLIB_* instead of Glib_*.
+ * EWebLauncher/CMakeLists.txt: Ditto.
+ * MiniBrowser/efl/CMakeLists.txt: Ditto.
+ * WebKitTestRunner/PlatformEfl.cmake: Ditto.
+
+2012-08-13 Peter Beverloo <peter@chromium.org>
+
+ [Chromium] Fix apk generation for the Android platform
+ https://bugs.webkit.org/show_bug.cgi?id=93841
+
+ Reviewed by Dimitri Glazkov.
+
+ APK generation was broken as the configuration file assumed compilation
+ would only occur in the Chromium tree. Pass the path to Chromium's source
+ base directory as a property to ant.
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+ * TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp:
+
+2012-08-13 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ [WK2] [WTR] InjectedBundlePage::didFailLoadForResource invokes wrong callback
+ https://bugs.webkit.org/show_bug.cgi?id=93825
+
+ Reviewed by Antonio Gomes.
+
+ Corrected from didFinishLoadForResource() invoke to didFailLoadForResource() invoke.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::didFailLoadForResource):
+
+2012-08-13 Kwang Yul Seo <skyul@company100.net>
+
+ [Qt] Add gprof.prf to build WebKit with gprof enabled
+ https://bugs.webkit.org/show_bug.cgi?id=90283
+
+ Reviewed by Eric Seidel.
+
+ * qmake/mkspecs/features/functions.prf:
+ gprof does not support profiling a shared library.
+ To profile WebKit, applications must link QtWebKit statically.
+
+ * qmake/mkspecs/features/gprof.prf: Added.
+ Add -pg option to both QMAKE_CXXFLAGS and QMAKE_LFLAGS.
+
+2012-08-13 KwangYong Choi <ky0.choi@samsung.com>
+
+ [TestNetscapePlugin][X11] Additional key up event handler routine is required
+ https://bugs.webkit.org/show_bug.cgi?id=91357
+
+ Reviewed by Eric Seidel.
+
+ Fixed key up event handler routine to pass http/tests/plugins/plugin-document-
+ has-focus.html on X11 architecture. The test can not be done without this patch.
+ All other ports implemented it already.
+
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (handleEventX11): Modified key up event handler for X11
+
+2012-08-13 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL][WK2] Replace Skipped list by TestExpectations
+ https://bugs.webkit.org/show_bug.cgi?id=93796
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Enable cascaded TestExpectations for EFL port so
+ that we can use TestExpectations in WK2-EFL.
+
+ * Scripts/webkitpy/layout_tests/port/efl.py:
+ (EflPort._search_paths):
+ (EflPort):
+ (EflPort.expectations_files):
+
+2012-08-13 Peter Gal <galpeter@inf.u-szeged.hu>
+
+ REGRESSION(r125153): It broke the 'Unexpected no expected results' case
+ https://bugs.webkit.org/show_bug.cgi?id=93789
+
+ Reviewed by Csaba Osztrogonác.
+
+ Fix the regex, so the text won't be a capturing group.
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+ (RunWebKitTests._parseNewRunWebKitTestsOutput):
+
+2012-08-12 MORITA Hajime <morrita@google.com>
+
+ Unreviewed, added a proxy address to contributors_who_are_not_committers.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2012-08-12 Loïc Yhuel <loic.yhuel@softathome.com>
+
+ [Qt] Make it possible to build without QtTest/QtPrintSupport
+ https://bugs.webkit.org/show_bug.cgi?id=93492
+
+ Reviewed by Tor Arne Vestbø.
+
+ * DumpRenderTree/qt/DumpRenderTree.pro: Optional printsupport
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore):
+ (WebCore::DumpRenderTree::dryRunPrint): Does nothing if no printsupport
+ * QtTestBrowser/QtTestBrowser.pro: Optional printsupport
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::createChrome): No print menu if no printsupport
+ (LauncherWindow::print): Does nothing if no printsupport
+ * QtTestBrowser/launcherwindow.h:
+ * Tools.pro: Disable DRT/WTR if QtTest not present
+ * qmake/mkspecs/features/default_pre.prf: printsupport no more mandatory
+ * qmake/mkspecs/features/features.prf: Qt module availability tests
+
+2012-08-12 Csaba Osztrogonác <ossy@webkit.org>
+
+ master.cfg unittest cleanup: Show DeprecationWarnings with python >= 2.7 too
+ https://bugs.webkit.org/show_bug.cgi?id=90161
+
+ Reviewed by Eric Seidel.
+
+ * BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py:
+
2012-08-12 Simon Hausmann <simon.hausmann@nokia.com>
[Qt] Unreviewed trivial build fix: Newer Qt versions don't implicitly include qwindowsysteminterface.h
diff --git a/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp b/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp
index f04708322..8277ce35f 100644
--- a/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp
+++ b/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp
@@ -464,6 +464,13 @@
'<(PRODUCT_DIR)/lib.java/chromium_net.jar',
'<(PRODUCT_DIR)/lib.java/chromium_media.jar',
],
+ 'conditions': [
+ ['inside_chromium_build==1', {
+ 'ant_build_to_chromium_src': '<(ant_build_out)/../../',
+ }, {
+ 'ant_build_to_chromium_src': '<(chromium_src_dir)',
+ }],
+ ],
},
# Part of the following was copied from <(chromium_src_dir)/build/apk_test.gpyi.
# Not including it because gyp include doesn't support variable in path or under
@@ -488,6 +495,7 @@
'"<@(input_jars_paths)"',
'--output',
'<(PRODUCT_DIR)/DumpRenderTree_apk',
+ '--strip-binary=<(android_strip)',
'--ant-args',
'-DANDROID_SDK=<(android_sdk)',
'--ant-args',
@@ -500,6 +508,8 @@
'-DANDROID_TOOLCHAIN=<(android_toolchain)',
'--ant-args',
'-DPRODUCT_DIR=<(ant_build_out)',
+ '--ant-args',
+ '-DCHROMIUM_SRC=<(ant_build_to_chromium_src)',
'--sdk-build=<(sdk_build)',
'--app_abi',
'<(android_app_abi)',
diff --git a/Tools/DumpRenderTree/DumpRenderTree.gypi b/Tools/DumpRenderTree/DumpRenderTree.gypi
index 996c83d87..cfc478ec9 100644
--- a/Tools/DumpRenderTree/DumpRenderTree.gypi
+++ b/Tools/DumpRenderTree/DumpRenderTree.gypi
@@ -6,8 +6,8 @@
'chromium/DRTDevToolsClient.cpp',
'chromium/DRTDevToolsClient.h',
'chromium/DumpRenderTree.cpp',
- 'chromium/LayoutTestController.cpp',
- 'chromium/LayoutTestController.h',
+ 'chromium/DRTTestRunner.cpp',
+ 'chromium/DRTTestRunner.h',
'chromium/MockGrammarCheck.cpp',
'chromium/MockGrammarCheck.h',
'chromium/MockSpellCheck.cpp',
diff --git a/Tools/DumpRenderTree/DumpRenderTree.h b/Tools/DumpRenderTree/DumpRenderTree.h
index 18d8cda0e..4c6a47210 100644
--- a/Tools/DumpRenderTree/DumpRenderTree.h
+++ b/Tools/DumpRenderTree/DumpRenderTree.h
@@ -55,12 +55,12 @@
std::wstring urlSuitableForTestResult(const std::wstring& url);
#endif
-class LayoutTestController;
+class TestRunner;
extern volatile bool done;
// FIXME: This is a bad abstraction. We should insted pass this to other controller objects which need access to it.
-extern RefPtr<LayoutTestController> gLayoutTestController;
+extern RefPtr<TestRunner> gTestRunner;
void dump();
void displayWebView();
diff --git a/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj b/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
index b7904f6e3..c2ac67940 100644
--- a/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
+++ b/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
@@ -71,6 +71,7 @@
515F429C15C07872007C8F90 /* PluginScriptableObjectOverridesAllProperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 515F429B15C07872007C8F90 /* PluginScriptableObjectOverridesAllProperties.cpp */; };
5185F6B210714E07007AA393 /* HistoryDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5185F69F10714A57007AA393 /* HistoryDelegate.mm */; };
5185F6B310714E12007AA393 /* HistoryDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5185F69E10714A57007AA393 /* HistoryDelegate.h */; };
+ 51CACBD815D96FD000EB53A2 /* EvaluateJSWithinNPP_New.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51CACBD715D96FD000EB53A2 /* EvaluateJSWithinNPP_New.cpp */; };
53CBB832134E42F3001CE6A4 /* CyclicRedundancyCheck.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53CBB830134E42F3001CE6A4 /* CyclicRedundancyCheck.cpp */; };
53CBB833134E42F3001CE6A4 /* CyclicRedundancyCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = 53CBB831134E42F3001CE6A4 /* CyclicRedundancyCheck.h */; };
5DB9AC970F722C3600684641 /* AHEM____.TTF in Copy Font Files */ = {isa = PBXBuildFile; fileRef = AA7F10C20CB3C1030003BDC9 /* AHEM____.TTF */; };
@@ -105,8 +106,8 @@
AE8259F308D22463000507AB /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE8257EF08D22389000507AB /* Carbon.framework */; };
AE8259F408D22463000507AB /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE8257EF08D22389000507AB /* Carbon.framework */; };
B5A752A208AF5D1F00138E45 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5A752A108AF5D1F00138E45 /* QuartzCore.framework */; };
- BC0131DA0C9772010087317D /* LayoutTestController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0131D80C9772010087317D /* LayoutTestController.cpp */; };
- BC0131DB0C9772010087317D /* LayoutTestController.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0131D90C9772010087317D /* LayoutTestController.h */; };
+ BC0131DA0C9772010087317D /* TestRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0131D80C9772010087317D /* TestRunner.cpp */; };
+ BC0131DB0C9772010087317D /* TestRunner.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0131D90C9772010087317D /* TestRunner.h */; };
BC0E24E00E2D9451001B6BC2 /* AccessibilityUIElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0E24DE0E2D9451001B6BC2 /* AccessibilityUIElement.h */; };
BC0E24E10E2D9451001B6BC2 /* AccessibilityUIElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0E24DF0E2D9451001B6BC2 /* AccessibilityUIElement.cpp */; };
BC0E26150E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC0E26140E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm */; };
@@ -116,7 +117,7 @@
BC9D90250C97472E0099A4A3 /* WorkQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9D90220C97472E0099A4A3 /* WorkQueue.h */; };
BC9D90260C97472E0099A4A3 /* WorkQueueItem.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9D90230C97472E0099A4A3 /* WorkQueueItem.h */; };
BCA18B230C9B014B00114369 /* GCControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCA18B210C9B014B00114369 /* GCControllerMac.mm */; };
- BCA18B240C9B014B00114369 /* LayoutTestControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCA18B220C9B014B00114369 /* LayoutTestControllerMac.mm */; };
+ BCA18B240C9B014B00114369 /* TestRunnerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCA18B220C9B014B00114369 /* TestRunnerMac.mm */; };
BCA18B260C9B015C00114369 /* WorkQueueItemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCA18B250C9B015C00114369 /* WorkQueueItemMac.mm */; };
BCA18B310C9B01B400114369 /* ObjCController.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA18B2F0C9B01B400114369 /* ObjCController.h */; };
BCA18B320C9B01B400114369 /* ObjCController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA18B300C9B01B400114369 /* ObjCController.m */; };
@@ -283,6 +284,7 @@
515F429B15C07872007C8F90 /* PluginScriptableObjectOverridesAllProperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginScriptableObjectOverridesAllProperties.cpp; sourceTree = "<group>"; };
5185F69E10714A57007AA393 /* HistoryDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HistoryDelegate.h; path = mac/HistoryDelegate.h; sourceTree = "<group>"; };
5185F69F10714A57007AA393 /* HistoryDelegate.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = HistoryDelegate.mm; path = mac/HistoryDelegate.mm; sourceTree = "<group>"; };
+ 51CACBD715D96FD000EB53A2 /* EvaluateJSWithinNPP_New.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EvaluateJSWithinNPP_New.cpp; path = TestNetscapePlugIn/Tests/EvaluateJSWithinNPP_New.cpp; sourceTree = SOURCE_ROOT; };
53CBB830134E42F3001CE6A4 /* CyclicRedundancyCheck.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CyclicRedundancyCheck.cpp; sourceTree = "<group>"; };
53CBB831134E42F3001CE6A4 /* CyclicRedundancyCheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CyclicRedundancyCheck.h; sourceTree = "<group>"; };
5DE8AE4313A2C15800D6A37D /* libWebCoreTestSupport.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libWebCoreTestSupport.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -308,8 +310,8 @@
AE8257EF08D22389000507AB /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
B5A7526708AF4A4A00138E45 /* ImageDiff */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ImageDiff; sourceTree = BUILT_PRODUCTS_DIR; };
B5A752A108AF5D1F00138E45 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
- BC0131D80C9772010087317D /* LayoutTestController.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutTestController.cpp; sourceTree = "<group>"; };
- BC0131D90C9772010087317D /* LayoutTestController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LayoutTestController.h; sourceTree = "<group>"; };
+ BC0131D80C9772010087317D /* TestRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TestRunner.cpp; sourceTree = "<group>"; };
+ BC0131D90C9772010087317D /* TestRunner.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TestRunner.h; sourceTree = "<group>"; };
BC0E24DE0E2D9451001B6BC2 /* AccessibilityUIElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityUIElement.h; sourceTree = "<group>"; };
BC0E24DF0E2D9451001B6BC2 /* AccessibilityUIElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityUIElement.cpp; sourceTree = "<group>"; };
BC0E26140E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityUIElementMac.mm; path = mac/AccessibilityUIElementMac.mm; sourceTree = "<group>"; };
@@ -320,7 +322,7 @@
BC9D90220C97472E0099A4A3 /* WorkQueue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WorkQueue.h; sourceTree = "<group>"; };
BC9D90230C97472E0099A4A3 /* WorkQueueItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WorkQueueItem.h; sourceTree = "<group>"; };
BCA18B210C9B014B00114369 /* GCControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = GCControllerMac.mm; path = mac/GCControllerMac.mm; sourceTree = "<group>"; };
- BCA18B220C9B014B00114369 /* LayoutTestControllerMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = LayoutTestControllerMac.mm; path = mac/LayoutTestControllerMac.mm; sourceTree = "<group>"; };
+ BCA18B220C9B014B00114369 /* TestRunnerMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = TestRunnerMac.mm; path = mac/TestRunnerMac.mm; sourceTree = "<group>"; };
BCA18B250C9B015C00114369 /* WorkQueueItemMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = WorkQueueItemMac.mm; path = mac/WorkQueueItemMac.mm; sourceTree = "<group>"; };
BCA18B2F0C9B01B400114369 /* ObjCController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ObjCController.h; path = mac/ObjCController.h; sourceTree = "<group>"; };
BCA18B300C9B01B400114369 /* ObjCController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = ObjCController.m; path = mac/ObjCController.m; sourceTree = "<group>"; };
@@ -498,9 +500,9 @@
BCF6C64F0C98E9C000AC063E /* GCController.cpp */,
14770FE00A22ADF7009342EE /* GCController.h */,
BCA18B210C9B014B00114369 /* GCControllerMac.mm */,
- BC0131D80C9772010087317D /* LayoutTestController.cpp */,
- BC0131D90C9772010087317D /* LayoutTestController.h */,
- BCA18B220C9B014B00114369 /* LayoutTestControllerMac.mm */,
+ BC0131D80C9772010087317D /* TestRunner.cpp */,
+ BC0131D90C9772010087317D /* TestRunner.h */,
+ BCA18B220C9B014B00114369 /* TestRunnerMac.mm */,
E1B7808511AF1643007E1BC2 /* MockGeolocationProvider.h */,
E1B7808711AF1669007E1BC2 /* MockGeolocationProvider.mm */,
BCA18B6D0C9B08DB00114369 /* NavigationController.h */,
@@ -541,6 +543,7 @@
1A31EB3613466AC100017372 /* mac */,
1A215A7511F26072008AD0F5 /* DocumentOpenInDestroyStream.cpp */,
C0E720741281C828004EF533 /* EvaluateJSAfterRemovingPluginElement.cpp */,
+ 51CACBD715D96FD000EB53A2 /* EvaluateJSWithinNPP_New.cpp */,
4AD6A11313C8124000EA9737 /* FormValue.cpp */,
1AFF66BB137DEA8300791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp */,
1A5CC1F3137DD2EC00A5D7E7 /* GetURLWithJavaScriptURL.cpp */,
@@ -713,7 +716,7 @@
BCA18B630C9B08C200114369 /* FrameLoadDelegate.h in Headers */,
14770FE20A22ADF7009342EE /* GCController.h in Headers */,
BC47412A0D038A4C0072B006 /* JavaScriptThreading.h in Headers */,
- BC0131DB0C9772010087317D /* LayoutTestController.h in Headers */,
+ BC0131DB0C9772010087317D /* TestRunner.h in Headers */,
BCA18B710C9B08DB00114369 /* NavigationController.h in Headers */,
BCA18B310C9B01B400114369 /* ObjCController.h in Headers */,
BCA18B7D0C9B08F100114369 /* ObjCPlugin.h in Headers */,
@@ -906,6 +909,7 @@
1A66C35114576A920099A115 /* ContentsScaleFactor.cpp in Sources */,
515F429C15C07872007C8F90 /* PluginScriptableObjectOverridesAllProperties.cpp in Sources */,
5106803E15CC7B10001A8A23 /* SlowNPPNew.cpp in Sources */,
+ 51CACBD815D96FD000EB53A2 /* EvaluateJSWithinNPP_New.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -939,8 +943,8 @@
BCF6C6500C98E9C000AC063E /* GCController.cpp in Sources */,
BCA18B230C9B014B00114369 /* GCControllerMac.mm in Sources */,
BC4741410D038A570072B006 /* JavaScriptThreadingPthreads.cpp in Sources */,
- BC0131DA0C9772010087317D /* LayoutTestController.cpp in Sources */,
- BCA18B240C9B014B00114369 /* LayoutTestControllerMac.mm in Sources */,
+ BC0131DA0C9772010087317D /* TestRunner.cpp in Sources */,
+ BCA18B240C9B014B00114369 /* TestRunnerMac.mm in Sources */,
BCA18B720C9B08DB00114369 /* NavigationController.m in Sources */,
BCA18B320C9B01B400114369 /* ObjCController.m in Sources */,
BCA18B7E0C9B08F100114369 /* ObjCPlugin.m in Sources */,
diff --git a/Tools/DumpRenderTree/PixelDumpSupport.cpp b/Tools/DumpRenderTree/PixelDumpSupport.cpp
index 1d53d589b..165291174 100644
--- a/Tools/DumpRenderTree/PixelDumpSupport.cpp
+++ b/Tools/DumpRenderTree/PixelDumpSupport.cpp
@@ -31,7 +31,7 @@
#include "CyclicRedundancyCheck.h"
#include "DumpRenderTree.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include <cstdio>
#include <wtf/Assertions.h>
#include <wtf/RefPtr.h>
@@ -49,11 +49,11 @@ void dumpWebViewAsPixelsAndCompareWithExpected(const std::string& expectedHash)
{
RefPtr<BitmapContext> context;
#if PLATFORM(MAC)
- if (gLayoutTestController->isPrinting())
+ if (gTestRunner->isPrinting())
context = createPagedBitmapContext();
else
#endif
- context = createBitmapContextFromWebView(gLayoutTestController->testOnscreen(), gLayoutTestController->testRepaint(), gLayoutTestController->testRepaintSweepHorizontally(), gLayoutTestController->dumpSelectionRect());
+ context = createBitmapContextFromWebView(gTestRunner->testOnscreen(), gTestRunner->testRepaint(), gTestRunner->testRepaintSweepHorizontally(), gTestRunner->dumpSelectionRect());
ASSERT(context);
// Compute the hash of the bitmap context pixels
diff --git a/Tools/DumpRenderTree/StorageTrackerDelegate.h b/Tools/DumpRenderTree/StorageTrackerDelegate.h
index e025a4476..73032ef59 100644
--- a/Tools/DumpRenderTree/StorageTrackerDelegate.h
+++ b/Tools/DumpRenderTree/StorageTrackerDelegate.h
@@ -23,15 +23,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-class LayoutTestController;
+class TestRunner;
@interface StorageTrackerDelegate : NSObject {
unsigned numberOfNotificationsToLog;
- LayoutTestController* controllerToNotifyDone;
+ TestRunner* controllerToNotifyDone;
}
-- (void)logNotifications:(unsigned)number controller:(LayoutTestController*)controller;
+- (void)logNotifications:(unsigned)number controller:(TestRunner*)controller;
- (void)originModified:(NSNotification *)notification;
-- (void)setControllerToNotifyDone:(LayoutTestController*)controller;
+- (void)setControllerToNotifyDone:(TestRunner*)controller;
@end
diff --git a/Tools/DumpRenderTree/StorageTrackerDelegate.mm b/Tools/DumpRenderTree/StorageTrackerDelegate.mm
index 343880ba1..121fa1753 100644
--- a/Tools/DumpRenderTree/StorageTrackerDelegate.mm
+++ b/Tools/DumpRenderTree/StorageTrackerDelegate.mm
@@ -26,7 +26,7 @@
#import "config.h"
#import "StorageTrackerDelegate.h"
-#import "LayoutTestController.h"
+#import "TestRunner.h"
#import <WebKit/WebSecurityOriginPrivate.h>
#import <WebKit/WebStorageManagerPrivate.h>
@@ -43,7 +43,7 @@
return self;
}
-- (void)logNotifications:(unsigned)number controller:(LayoutTestController*)controller
+- (void)logNotifications:(unsigned)number controller:(TestRunner*)controller
{
controllerToNotifyDone = controller;
@@ -73,7 +73,7 @@
[super dealloc];
}
-- (void)setControllerToNotifyDone:(LayoutTestController*)controller
+- (void)setControllerToNotifyDone:(TestRunner*)controller
{
controllerToNotifyDone = controller;
}
diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp
index 05f3a8c21..75631842f 100644
--- a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp
+++ b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp
@@ -60,23 +60,13 @@ static void pluginLogWithWindowObject(NPObject* windowObject, NPP instance, cons
browser->releaseobject(consoleObject);
}
-// Helper function which takes in the plugin window object for logging to the console object. This function supports variable
-// arguments.
-static void pluginLogWithWindowObjectVariableArgs(NPObject* windowObject, NPP instance, const char* format, ...)
-{
- va_list args;
- va_start(args, format);
- char message[2048] = "PLUGIN: ";
- vsprintf(message + strlen(message), format, args);
- va_end(args);
-
- pluginLogWithWindowObject(windowObject, instance, message);
-}
-
void pluginLogWithArguments(NPP instance, const char* format, va_list args)
{
- char message[2048] = "PLUGIN: ";
- vsprintf(message + strlen(message), format, args);
+ const size_t messageBufferSize = 2048;
+ char message[messageBufferSize] = "PLUGIN: ";
+ int messageLength = sizeof("PLUGIN: ") - 1;
+ messageLength += vsnprintf(message + messageLength, messageBufferSize - 1 - messageLength, format, args);
+ message[messageLength] = '\0';
NPObject* windowObject = 0;
NPError error = browser->getvalue(instance, NPNVWindowNPObject, &windowObject);
@@ -936,7 +926,7 @@ bool testDocumentOpen(NPP npp)
return false;
}
- pluginLogWithWindowObjectVariableArgs(windowObject, npp, "DOCUMENT OPEN SUCCESS");
+ pluginLogWithWindowObject(windowObject, npp, "PLUGIN: DOCUMENT OPEN SUCCESS");
notifyTestCompletion(npp, result.value.objectValue);
browser->releaseobject(result.value.objectValue);
browser->releaseobject(windowObject);
@@ -968,7 +958,7 @@ bool testWindowOpen(NPP npp)
return false;
}
- pluginLogWithWindowObjectVariableArgs(windowObject, npp, "WINDOW OPEN SUCCESS");
+ pluginLogWithWindowObject(windowObject, npp, "PLUGIN: WINDOW OPEN SUCCESS");
notifyTestCompletion(npp, result.value.objectValue);
browser->releaseobject(result.value.objectValue);
browser->releaseobject(windowObject);
diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSWithinNPP_New.cpp b/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSWithinNPP_New.cpp
new file mode 100644
index 000000000..c066db59f
--- /dev/null
+++ b/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSWithinNPP_New.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "PluginTest.h"
+
+#include "PluginObject.h"
+
+using namespace std;
+
+// Executing JS within NPP_New when initializing asynchronously should not be able to deadlock with the WebProcess
+
+class EvaluteJSWithinNPP_New : public PluginTest {
+public:
+ EvaluteJSWithinNPP_New(NPP, const string& identifier);
+
+private:
+ virtual NPError NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *);
+
+};
+
+EvaluteJSWithinNPP_New::EvaluteJSWithinNPP_New(NPP npp, const string& identifier)
+ : PluginTest(npp, identifier)
+{
+}
+
+NPError EvaluteJSWithinNPP_New::NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *saved)
+{
+ // Give the WebProcess enough time to be deadlocked waiting for the PluginProcess.
+ usleep(15000);
+ executeScript("var theLocation = window.location;");
+ return NPERR_NO_ERROR;
+}
+
+static PluginTest::Register<EvaluteJSWithinNPP_New> registrar("evalute-js-within-npp-new");
diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp b/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp
index fd92bfdac..97a4cf389 100644
--- a/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp
+++ b/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp
@@ -671,6 +671,11 @@ static int16_t handleEventX11(NPP instance, PluginObject* obj, XEvent* event)
// FIXME: extract key code
if (obj->eventLogging)
pluginLog(instance, "keyUp '%c'", keyEventToChar(&event->xkey));
+ if (obj->testKeyboardFocusForPlugins) {
+ obj->eventLogging = false;
+ obj->testKeyboardFocusForPlugins = FALSE;
+ executeScript(obj, "testRunner.notifyDone();");
+ }
break;
case GraphicsExpose:
if (obj->eventLogging)
diff --git a/Tools/DumpRenderTree/LayoutTestController.cpp b/Tools/DumpRenderTree/TestRunner.cpp
index 2bd2c9a09..229bf0680 100644
--- a/Tools/DumpRenderTree/LayoutTestController.cpp
+++ b/Tools/DumpRenderTree/TestRunner.cpp
@@ -28,7 +28,7 @@
*/
#include "config.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include "WorkQueue.h"
#include "WorkQueueItem.h"
@@ -44,7 +44,7 @@
#include <wtf/OwnArrayPtr.h>
#include <wtf/RefPtr.h>
-LayoutTestController::LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash)
+TestRunner::TestRunner(const std::string& testPathOrURL, const std::string& expectedPixelHash)
: m_disallowIncreaseForApplicationCacheQuota(false)
, m_dumpApplicationCacheDelegateCallbacks(false)
, m_dumpAsAudio(false)
@@ -100,37 +100,37 @@ LayoutTestController::LayoutTestController(const std::string& testPathOrURL, con
{
}
-PassRefPtr<LayoutTestController> LayoutTestController::create(const std::string& testPathOrURL, const std::string& expectedPixelHash)
+PassRefPtr<TestRunner> TestRunner::create(const std::string& testPathOrURL, const std::string& expectedPixelHash)
{
- return adoptRef(new LayoutTestController(testPathOrURL, expectedPixelHash));
+ return adoptRef(new TestRunner(testPathOrURL, expectedPixelHash));
}
// Static Functions
static JSValueRef disallowIncreaseForApplicationCacheQuotaCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDisallowIncreaseForApplicationCacheQuota(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpApplicationCacheDelegateCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpApplicationCacheDelegateCallbacks(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpAsPDFCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpAsPDF(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpAsTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpAsText(true);
// Optional paramater, describing whether it's allowed to dump pixel results in dumpAsText mode.
@@ -141,119 +141,119 @@ static JSValueRef dumpAsTextCallback(JSContextRef context, JSObjectRef function,
static JSValueRef dumpBackForwardListCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpBackForwardList(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpChildFramesAsTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpChildFramesAsText(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpChildFrameScrollPositionsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpChildFrameScrollPositions(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpDatabaseCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpDatabaseCallbacks(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpDOMAsWebArchiveCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpDOMAsWebArchive(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpEditingCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpEditingCallbacks(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpFrameLoadCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpFrameLoadCallbacks(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpProgressFinishedCallbackCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpProgressFinishedCallback(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpUserGestureInFrameLoadCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpUserGestureInFrameLoadCallbacks(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpResourceLoadCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpResourceLoadCallbacks(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpResourceResponseMIMETypesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpResourceResponseMIMETypes(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpSelectionRectCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpSelectionRect(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpSourceAsWebArchiveCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpSourceAsWebArchive(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpStatusCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpStatusCallbacks(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpTitleChangesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpTitleChanges(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpIconChangesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpIconChanges(true);
return JSValueMakeUndefined(context);
}
static JSValueRef dumpWillCacheResponseCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpWillCacheResponse(true);
return JSValueMakeUndefined(context);
}
@@ -263,7 +263,7 @@ static JSValueRef pathToLocalResourceCallback(JSContextRef context, JSObjectRef
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
JSRetainPtr<JSStringRef> localPath(Adopt, JSValueToStringCopy(context, arguments[0], exception));
ASSERT(!*exception);
@@ -276,7 +276,7 @@ static JSValueRef pathToLocalResourceCallback(JSContextRef context, JSObjectRef
static JSValueRef removeAllVisitedLinksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDumpVisitedLinksCallback(true);
controller->removeAllVisitedLinks();
return JSValueMakeUndefined(context);
@@ -284,7 +284,7 @@ static JSValueRef removeAllVisitedLinksCallback(JSContextRef context, JSObjectRe
static JSValueRef repaintSweepHorizontallyCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setTestRepaintSweepHorizontally(true);
return JSValueMakeUndefined(context);
}
@@ -294,14 +294,14 @@ static JSValueRef setCallCloseOnWebViewsCallback(JSContextRef context, JSObjectR
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setCallCloseOnWebViews(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
}
static JSValueRef setCanOpenWindowsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setCanOpenWindows(true);
return JSValueMakeUndefined(context);
}
@@ -311,7 +311,7 @@ static JSValueRef setCloseRemainingWindowsWhenCompleteCallback(JSContextRef cont
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setCloseRemainingWindowsWhenComplete(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
}
@@ -328,7 +328,7 @@ static JSValueRef setEncodedAudioDataCallback(JSContextRef context, JSObjectRef
OwnArrayPtr<char> encodedAudioDataBuffer = adoptArrayPtr(new char[maxLength + 1]);
JSStringGetUTF8CString(encodedAudioData.get(), encodedAudioDataBuffer.get(), maxLength + 1);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setEncodedAudioData(encodedAudioDataBuffer.get());
controller->setDumpAsAudio(true);
@@ -337,14 +337,14 @@ static JSValueRef setEncodedAudioDataCallback(JSContextRef context, JSObjectRef
static JSValueRef testOnscreenCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setTestOnscreen(true);
return JSValueMakeUndefined(context);
}
static JSValueRef testRepaintCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setTestRepaint(true);
return JSValueMakeUndefined(context);
}
@@ -358,7 +358,7 @@ static JSValueRef addDisallowedURLCallback(JSContextRef context, JSObjectRef fun
JSRetainPtr<JSStringRef> url(Adopt, JSValueToStringCopy(context, arguments[0], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->addDisallowedURL(url.get());
return JSValueMakeUndefined(context);
@@ -383,7 +383,7 @@ static JSValueRef addURLToRedirectCallback(JSContextRef context, JSObjectRef fun
OwnArrayPtr<char> destinationBuffer = adoptArrayPtr(new char[maxLength + 1]);
JSStringGetUTF8CString(destination.get(), destinationBuffer.get(), maxLength + 1);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->addURLToRedirect(originBuffer.get(), destinationBuffer.get());
return JSValueMakeUndefined(context);
@@ -392,7 +392,7 @@ static JSValueRef addURLToRedirectCallback(JSContextRef context, JSObjectRef fun
static JSValueRef callShouldCloseOnWebViewCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
return JSValueMakeBoolean(context, controller->callShouldCloseOnWebView());
}
@@ -400,7 +400,7 @@ static JSValueRef callShouldCloseOnWebViewCallback(JSContextRef context, JSObjec
static JSValueRef clearAllApplicationCachesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac implementation
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->clearAllApplicationCaches();
return JSValueMakeUndefined(context);
@@ -414,7 +414,7 @@ static JSValueRef clearApplicationCacheForOriginCallback(JSContextRef context, J
JSRetainPtr<JSStringRef> originURL(Adopt, JSValueToStringCopy(context, arguments[0], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->clearApplicationCacheForOrigin(originURL.get());
return JSValueMakeUndefined(context);
@@ -428,21 +428,21 @@ static JSValueRef applicationCacheDiskUsageForOriginCallback(JSContextRef contex
JSRetainPtr<JSStringRef> originURL(Adopt, JSValueToStringCopy(context, arguments[0], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
return JSValueMakeNumber(context, controller->applicationCacheDiskUsageForOrigin(originURL.get()));
}
static JSValueRef originsWithApplicationCacheCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
return controller->originsWithApplicationCache(context);
}
static JSValueRef clearAllDatabasesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->clearAllDatabases();
return JSValueMakeUndefined(context);
@@ -450,7 +450,7 @@ static JSValueRef clearAllDatabasesCallback(JSContextRef context, JSObjectRef fu
static JSValueRef syncLocalStorageCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->syncLocalStorage();
@@ -459,7 +459,7 @@ static JSValueRef syncLocalStorageCallback(JSContextRef context, JSObjectRef fun
static JSValueRef observeStorageTrackerNotificationsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
if (argumentCount < 1)
return JSValueMakeUndefined(context);
@@ -475,7 +475,7 @@ static JSValueRef observeStorageTrackerNotificationsCallback(JSContextRef contex
static JSValueRef deleteAllLocalStorageCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->deleteAllLocalStorage();
return JSValueMakeUndefined(context);
@@ -483,7 +483,7 @@ static JSValueRef deleteAllLocalStorageCallback(JSContextRef context, JSObjectRe
static JSValueRef deleteLocalStorageForOriginCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
if (argumentCount < 1)
return JSValueMakeUndefined(context);
@@ -498,7 +498,7 @@ static JSValueRef deleteLocalStorageForOriginCallback(JSContextRef context, JSOb
static JSValueRef localStorageDiskUsageForOriginCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
if (argumentCount < 1)
return JSValueMakeUndefined(context);
@@ -511,14 +511,14 @@ static JSValueRef localStorageDiskUsageForOriginCallback(JSContextRef context, J
static JSValueRef originsWithLocalStorageCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
return controller->originsWithLocalStorage(context);
}
static JSValueRef clearBackForwardListCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->clearBackForwardList();
return JSValueMakeUndefined(context);
@@ -527,7 +527,7 @@ static JSValueRef clearBackForwardListCallback(JSContextRef context, JSObjectRef
static JSValueRef clearPersistentUserStyleSheetCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->clearPersistentUserStyleSheet();
return JSValueMakeUndefined(context);
@@ -542,7 +542,7 @@ static JSValueRef decodeHostNameCallback(JSContextRef context, JSObjectRef funct
JSRetainPtr<JSStringRef> name(Adopt, JSValueToStringCopy(context, arguments[0], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
JSRetainPtr<JSStringRef> decodedHostName(Adopt, controller->copyDecodedHostName(name.get()));
return JSValueMakeString(context, decodedHostName.get());
}
@@ -550,7 +550,7 @@ static JSValueRef decodeHostNameCallback(JSContextRef context, JSObjectRef funct
static JSValueRef disableImageLoadingCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac implementation, needs windows implementation
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->disableImageLoading();
return JSValueMakeUndefined(context);
@@ -559,7 +559,7 @@ static JSValueRef disableImageLoadingCallback(JSContextRef context, JSObjectRef
static JSValueRef dispatchPendingLoadRequestsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac implementation, needs windows implementation
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->dispatchPendingLoadRequests();
return JSValueMakeUndefined(context);
@@ -568,7 +568,7 @@ static JSValueRef dispatchPendingLoadRequestsCallback(JSContextRef context, JSOb
static JSValueRef displayCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->display();
return JSValueMakeUndefined(context);
@@ -577,8 +577,8 @@ static JSValueRef displayCallback(JSContextRef context, JSObjectRef function, JS
static JSValueRef displayInvalidatedRegionCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
- // LayoutTestController::display() only renders the invalidated region so
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
+ // TestRunner::display() only renders the invalidated region so
// we can just use that.
controller->display();
@@ -594,7 +594,7 @@ static JSValueRef encodeHostNameCallback(JSContextRef context, JSObjectRef funct
JSRetainPtr<JSStringRef> name(Adopt, JSValueToStringCopy(context, arguments[0], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
JSRetainPtr<JSStringRef> encodedHostName(Adopt, controller->copyEncodedHostName(name.get()));
return JSValueMakeString(context, encodedHostName.get());
}
@@ -618,7 +618,7 @@ static JSValueRef execCommandCallback(JSContextRef context, JSObjectRef function
value.adopt(JSStringCreateWithUTF8CString(""));
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->execCommand(name.get(), value.get());
return JSValueMakeUndefined(context);
@@ -636,13 +636,13 @@ static JSValueRef findStringCallback(JSContextRef context, JSObjectRef function,
JSObjectRef options = JSValueToObject(context, arguments[1], exception);
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
return JSValueMakeBoolean(context, controller->findString(context, target.get(), options));
}
static JSValueRef goBackCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->goBack();
return JSValueMakeUndefined(context);
@@ -654,7 +654,7 @@ static JSValueRef grantDesktopNotificationPermissionCallback(JSContextRef contex
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->grantDesktopNotificationPermission(JSValueToStringCopy(context, arguments[0], NULL));
@@ -671,7 +671,7 @@ static JSValueRef isCommandEnabledCallback(JSContextRef context, JSObjectRef fun
JSRetainPtr<JSStringRef> name(Adopt, JSValueToStringCopy(context, arguments[0], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
return JSValueMakeBoolean(context, controller->isCommandEnabled(name.get()));
}
@@ -686,7 +686,7 @@ static JSValueRef overridePreferenceCallback(JSContextRef context, JSObjectRef f
JSRetainPtr<JSStringRef> value(Adopt, JSValueToStringCopy(context, arguments[1], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->overridePreference(key.get(), value.get());
return JSValueMakeUndefined(context);
@@ -695,7 +695,7 @@ static JSValueRef overridePreferenceCallback(JSContextRef context, JSObjectRef f
static JSValueRef keepWebHistoryCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac implementation
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->keepWebHistory();
return JSValueMakeUndefined(context);
@@ -707,14 +707,14 @@ static JSValueRef computedStyleIncludingVisitedInfoCallback(JSContextRef context
return JSValueMakeUndefined(context);
// Has mac implementation
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
return controller->computedStyleIncludingVisitedInfo(context, arguments[0]);
}
static JSValueRef layerTreeAsTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
return JSValueMakeString(context, controller->layerTreeAsText().get());
}
@@ -722,15 +722,15 @@ static JSValueRef notifyDoneCallback(JSContextRef context, JSObjectRef function,
{
// Has mac & windows implementation
// May be able to be made platform independant by using shared WorkQueue
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->notifyDone();
return JSValueMakeUndefined(context);
}
static bool parsePageParameters(JSContextRef context, int argumentCount, const JSValueRef* arguments, JSValueRef* exception, float& pageWidthInPixels, float& pageHeightInPixels)
{
- pageWidthInPixels = LayoutTestController::maxViewWidth;
- pageHeightInPixels = LayoutTestController::maxViewHeight;
+ pageWidthInPixels = TestRunner::maxViewWidth;
+ pageHeightInPixels = TestRunner::maxViewHeight;
switch (argumentCount) {
case 2:
pageWidthInPixels = static_cast<float>(JSValueToNumber(context, arguments[0], exception));
@@ -828,13 +828,13 @@ static JSValueRef numberOfPagesCallback(JSContextRef context, JSObjectRef functi
if (!parsePageParameters(context, argumentCount, arguments, exception, pageWidthInPixels, pageHeightInPixels))
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
return JSValueMakeNumber(context, controller->numberOfPages(pageWidthInPixels, pageHeightInPixels));
}
static JSValueRef numberOfPendingGeolocationPermissionRequestsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
return JSValueMakeNumber(context, controller->numberOfPendingGeolocationPermissionRequests());
}
@@ -845,7 +845,7 @@ static JSValueRef pagePropertyCallback(JSContextRef context, JSObjectRef functio
if (!parsePagePropertyParameters(context, argumentCount, arguments, exception, propertyName, pageNumber))
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
JSValueRef value = JSValueMakeString(context, controller->pageProperty(propertyName, pageNumber).get());
delete[] propertyName;
@@ -860,7 +860,7 @@ static JSValueRef pageSizeAndMarginsInPixelsCallback(JSContextRef context, JSObj
if (!parsePageNumberSizeMarings(context, argumentCount, arguments, exception, pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft))
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
return JSValueMakeString(context, controller->pageSizeAndMarginsInPixels(pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft).get());
}
@@ -874,7 +874,7 @@ static JSValueRef queueBackNavigationCallback(JSContextRef context, JSObjectRef
double howFarBackDouble = JSValueToNumber(context, arguments[0], exception);
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->queueBackNavigation(static_cast<int>(howFarBackDouble));
return JSValueMakeUndefined(context);
@@ -890,7 +890,7 @@ static JSValueRef queueForwardNavigationCallback(JSContextRef context, JSObjectR
double howFarForwardDouble = JSValueToNumber(context, arguments[0], exception);
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->queueForwardNavigation(static_cast<int>(howFarForwardDouble));
return JSValueMakeUndefined(context);
@@ -913,7 +913,7 @@ static JSValueRef queueLoadCallback(JSContextRef context, JSObjectRef function,
} else
target.adopt(JSStringCreateWithUTF8CString(""));
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->queueLoad(url.get(), target.get());
return JSValueMakeUndefined(context);
@@ -935,7 +935,7 @@ static JSValueRef queueLoadHTMLStringCallback(JSContextRef context, JSObjectRef
} else
baseURL.adopt(JSStringCreateWithUTF8CString(""));
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
if (argumentCount >= 3) {
JSRetainPtr<JSStringRef> unreachableURL;
@@ -954,7 +954,7 @@ static JSValueRef queueReloadCallback(JSContextRef context, JSObjectRef function
// Has mac & windows implementation
// May be able to be made platform independant by using shared WorkQueue
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->queueReload();
return JSValueMakeUndefined(context);
@@ -970,7 +970,7 @@ static JSValueRef queueLoadingScriptCallback(JSContextRef context, JSObjectRef f
JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[0], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->queueLoadingScript(script.get());
return JSValueMakeUndefined(context);
@@ -986,7 +986,7 @@ static JSValueRef queueNonLoadingScriptCallback(JSContextRef context, JSObjectRe
JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[0], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->queueNonLoadingScript(script.get());
return JSValueMakeUndefined(context);
@@ -998,7 +998,7 @@ static JSValueRef setAcceptsEditingCallback(JSContextRef context, JSObjectRef fu
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setAcceptsEditing(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1010,7 +1010,7 @@ static JSValueRef setAlwaysAcceptCookiesCallback(JSContextRef context, JSObjectR
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setAlwaysAcceptCookies(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1022,7 +1022,7 @@ static JSValueRef setAppCacheMaximumSizeCallback(JSContextRef context, JSObjectR
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
double size = JSValueToNumber(context, arguments[0], NULL);
if (!isnan(size))
@@ -1037,7 +1037,7 @@ static JSValueRef setApplicationCacheOriginQuotaCallback(JSContextRef context, J
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
double size = JSValueToNumber(context, arguments[0], NULL);
if (!isnan(size))
@@ -1059,7 +1059,7 @@ static JSValueRef setAuthenticationPasswordCallback(JSContextRef context, JSObje
char* passwordBuffer = new char[maxLength + 1];
JSStringGetUTF8CString(password.get(), passwordBuffer, maxLength + 1);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setAuthenticationPassword(passwordBuffer);
delete[] passwordBuffer;
@@ -1079,7 +1079,7 @@ static JSValueRef setAuthenticationUsernameCallback(JSContextRef context, JSObje
char* usernameBuffer = new char[maxLength + 1];
JSStringGetUTF8CString(username.get(), usernameBuffer, maxLength + 1);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setAuthenticationUsername(usernameBuffer);
delete[] usernameBuffer;
@@ -1092,7 +1092,7 @@ static JSValueRef setAuthorAndUserStylesEnabledCallback(JSContextRef context, JS
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setAuthorAndUserStylesEnabled(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1103,7 +1103,7 @@ static JSValueRef setAutofilledCallback(JSContextRef context, JSObjectRef functi
if (argumentCount != 2 || !arguments[0])
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setAutofilled(context, arguments[0], JSValueToBoolean(context, arguments[1]));
return JSValueMakeUndefined(context);
@@ -1118,7 +1118,7 @@ static JSValueRef setCacheModelCallback(JSContextRef context, JSObjectRef functi
int cacheModel = JSValueToNumber(context, arguments[0], exception);
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setCacheModel(cacheModel);
return JSValueMakeUndefined(context);
@@ -1134,7 +1134,7 @@ static JSValueRef setCustomPolicyDelegateCallback(JSContextRef context, JSObject
if (argumentCount >= 2)
permissive = JSValueToBoolean(context, arguments[1]);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setCustomPolicyDelegate(JSValueToBoolean(context, arguments[0]), permissive);
return JSValueMakeUndefined(context);
@@ -1146,7 +1146,7 @@ static JSValueRef setDatabaseQuotaCallback(JSContextRef context, JSObjectRef fun
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
double quota = JSValueToNumber(context, arguments[0], NULL);
if (!isnan(quota))
@@ -1161,7 +1161,7 @@ static JSValueRef setDeferMainResourceDataLoadCallback(JSContextRef context, JSO
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDeferMainResourceDataLoad(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1172,7 +1172,7 @@ static JSValueRef setDefersLoadingCallback(JSContextRef context, JSObjectRef fun
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setDefersLoading(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1183,7 +1183,7 @@ static JSValueRef setUseDeferredFrameLoadingCallback(JSContextRef context, JSObj
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setUseDeferredFrameLoading(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1195,7 +1195,7 @@ static JSValueRef setDomainRelaxationForbiddenForURLSchemeCallback(JSContextRef
if (argumentCount < 2)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
bool forbidden = JSValueToBoolean(context, arguments[0]);
JSRetainPtr<JSStringRef> scheme(Adopt, JSValueToStringCopy(context, arguments[1], 0));
@@ -1219,7 +1219,7 @@ static JSValueRef setMockDeviceOrientationCallback(JSContextRef context, JSObjec
double gamma = JSValueToNumber(context, arguments[5], exception);
ASSERT(!*exception);
- LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = reinterpret_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setMockDeviceOrientation(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma);
return JSValueMakeUndefined(context);
@@ -1230,7 +1230,7 @@ static JSValueRef setMockGeolocationPositionCallback(JSContextRef context, JSObj
if (argumentCount < 3)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = reinterpret_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setMockGeolocationPosition(JSValueToNumber(context, arguments[0], NULL), // latitude
JSValueToNumber(context, arguments[1], NULL), // longitude
JSValueToNumber(context, arguments[2], NULL)); // accuracy
@@ -1247,7 +1247,7 @@ static JSValueRef setMockGeolocationErrorCallback(JSContextRef context, JSObject
JSRetainPtr<JSStringRef> message(Adopt, JSValueToStringCopy(context, arguments[1], exception));
ASSERT(!*exception);
- LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = reinterpret_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setMockGeolocationError(code, message.get());
return JSValueMakeUndefined(context);
@@ -1266,7 +1266,7 @@ static JSValueRef addMockSpeechInputResultCallback(JSContextRef context, JSObjec
JSRetainPtr<JSStringRef> language(Adopt, JSValueToStringCopy(context, arguments[2], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->addMockSpeechInputResult(result.get(), confidence, language.get());
return JSValueMakeUndefined(context);
@@ -1279,7 +1279,7 @@ static JSValueRef setMockSpeechInputDumpRectCallback(JSContextRef context, JSObj
bool dumpRect = JSValueToBoolean(context, arguments[0]);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setMockSpeechInputDumpRect(dumpRect);
return JSValueMakeUndefined(context);
@@ -1291,7 +1291,7 @@ static JSValueRef setNewWindowsCopyBackForwardListCallback(JSContextRef context,
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setNewWindowsCopyBackForwardList(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1303,7 +1303,7 @@ static JSValueRef setGeolocationPermissionCallback(JSContextRef context, JSObjec
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setGeolocationPermission(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1315,7 +1315,7 @@ static JSValueRef setHandlesAuthenticationChallengesCallback(JSContextRef contex
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setHandlesAuthenticationChallenges(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1326,7 +1326,7 @@ static JSValueRef setPOSIXLocaleCallback(JSContextRef context, JSObjectRef funct
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
JSRetainPtr<JSStringRef> locale(Adopt, JSValueToStringCopy(context, arguments[0], exception));
ASSERT(!*exception);
controller->setPOSIXLocale(locale.get());
@@ -1340,7 +1340,7 @@ static JSValueRef setIconDatabaseEnabledCallback(JSContextRef context, JSObjectR
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setIconDatabaseEnabled(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1352,7 +1352,7 @@ static JSValueRef setMainFrameIsFirstResponderCallback(JSContextRef context, JSO
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setMainFrameIsFirstResponder(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1367,7 +1367,7 @@ static JSValueRef setPersistentUserStyleSheetLocationCallback(JSContextRef conte
JSRetainPtr<JSStringRef> path(Adopt, JSValueToStringCopy(context, arguments[0], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setPersistentUserStyleSheetLocation(path.get());
return JSValueMakeUndefined(context);
@@ -1379,7 +1379,7 @@ static JSValueRef setPrivateBrowsingEnabledCallback(JSContextRef context, JSObje
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setPrivateBrowsingEnabled(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1391,7 +1391,7 @@ static JSValueRef setJavaScriptCanAccessClipboardCallback(JSContextRef context,
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setJavaScriptCanAccessClipboard(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1403,7 +1403,7 @@ static JSValueRef setXSSAuditorEnabledCallback(JSContextRef context, JSObjectRef
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setXSSAuditorEnabled(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1415,7 +1415,7 @@ static JSValueRef setSpatialNavigationEnabledCallback(JSContextRef context, JSOb
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setSpatialNavigationEnabled(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1423,7 +1423,7 @@ static JSValueRef setSpatialNavigationEnabledCallback(JSContextRef context, JSOb
static JSValueRef setPrintingCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setIsPrinting(true);
return JSValueMakeUndefined(context);
}
@@ -1435,7 +1435,7 @@ static JSValueRef setFrameFlatteningEnabledCallback(JSContextRef context, JSObje
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setFrameFlatteningEnabled(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1447,7 +1447,7 @@ static JSValueRef setAllowUniversalAccessFromFileURLsCallback(JSContextRef conte
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setAllowUniversalAccessFromFileURLs(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1459,7 +1459,7 @@ static JSValueRef setAllowFileAccessFromFileURLsCallback(JSContextRef context, J
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setAllowFileAccessFromFileURLs(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1471,7 +1471,7 @@ static JSValueRef setTabKeyCyclesThroughElementsCallback(JSContextRef context, J
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setTabKeyCyclesThroughElements(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1483,7 +1483,7 @@ static JSValueRef setUseDashboardCompatibilityModeCallback(JSContextRef context,
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setUseDashboardCompatibilityMode(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1495,7 +1495,7 @@ static JSValueRef setUserStyleSheetEnabledCallback(JSContextRef context, JSObjec
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setUserStyleSheetEnabled(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1510,7 +1510,7 @@ static JSValueRef setUserStyleSheetLocationCallback(JSContextRef context, JSObje
JSRetainPtr<JSStringRef> path(Adopt, JSValueToStringCopy(context, arguments[0], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setUserStyleSheetLocation(path.get());
return JSValueMakeUndefined(context);
@@ -1525,7 +1525,7 @@ static JSValueRef setValueForUserCallback(JSContextRef context, JSObjectRef func
JSRetainPtr<JSStringRef> value(Adopt, JSValueToStringCopy(context, arguments[1], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setValueForUser(context, arguments[0], value.get());
return JSValueMakeUndefined(context);
@@ -1540,7 +1540,7 @@ static JSValueRef setViewModeMediaFeatureCallback(JSContextRef context, JSObject
JSRetainPtr<JSStringRef> mode(Adopt, JSValueToStringCopy(context, arguments[0], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setViewModeMediaFeature(mode.get());
return JSValueMakeUndefined(context);
@@ -1559,7 +1559,7 @@ static JSValueRef setWillSendRequestClearHeaderCallback(JSContextRef context, JS
OwnArrayPtr<char> headerBuffer = adoptArrayPtr(new char[maxLength + 1]);
JSStringGetUTF8CString(header.get(), headerBuffer.get(), maxLength + 1);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setWillSendRequestClearHeader(headerBuffer.get());
return JSValueMakeUndefined(context);
@@ -1571,7 +1571,7 @@ static JSValueRef setWillSendRequestReturnsNullCallback(JSContextRef context, JS
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setWillSendRequestReturnsNull(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1583,7 +1583,7 @@ static JSValueRef setWillSendRequestReturnsNullOnRedirectCallback(JSContextRef c
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setWillSendRequestReturnsNullOnRedirect(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1595,7 +1595,7 @@ static JSValueRef setWindowIsKeyCallback(JSContextRef context, JSObjectRef funct
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setWindowIsKey(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1604,7 +1604,7 @@ static JSValueRef setWindowIsKeyCallback(JSContextRef context, JSObjectRef funct
static JSValueRef waitUntilDoneCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setWaitToDump(true);
return JSValueMakeUndefined(context);
@@ -1613,7 +1613,7 @@ static JSValueRef waitUntilDoneCallback(JSContextRef context, JSObjectRef functi
static JSValueRef windowCountCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac implementation
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
int windows = controller->windowCount();
return JSValueMakeNumber(context, windows);
}
@@ -1624,7 +1624,7 @@ static JSValueRef setPopupBlockingEnabledCallback(JSContextRef context, JSObject
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setPopupBlockingEnabled(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1636,7 +1636,7 @@ static JSValueRef setPluginsEnabledCallback(JSContextRef context, JSObjectRef fu
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setPluginsEnabled(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1655,7 +1655,7 @@ static JSValueRef setPageVisibilityCallback(JSContextRef context, JSObjectRef fu
char* visibilityBuffer = new char[maxLength + 1];
JSStringGetUTF8CString(visibility.get(), visibilityBuffer, maxLength + 1);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setPageVisibility(visibilityBuffer);
delete[] visibilityBuffer;
@@ -1664,7 +1664,7 @@ static JSValueRef setPageVisibilityCallback(JSContextRef context, JSObjectRef fu
static JSValueRef resetPageVisibilityCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->resetPageVisibility();
return JSValueMakeUndefined(context);
}
@@ -1674,7 +1674,7 @@ static JSValueRef setSmartInsertDeleteEnabledCallback(JSContextRef context, JSOb
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setSmartInsertDeleteEnabled(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
}
@@ -1684,7 +1684,7 @@ static JSValueRef setAutomaticLinkDetectionEnabledCallback(JSContextRef context,
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setAutomaticLinkDetectionEnabled(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
}
@@ -1694,14 +1694,14 @@ static JSValueRef setSelectTrailingWhitespaceEnabledCallback(JSContextRef contex
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setSelectTrailingWhitespaceEnabled(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
}
static JSValueRef setStopProvisionalFrameLoadsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setStopProvisionalFrameLoads(true);
return JSValueMakeUndefined(context);
}
@@ -1711,28 +1711,28 @@ static JSValueRef setAsynchronousSpellCheckingEnabledCallback(JSContextRef conte
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setAsynchronousSpellCheckingEnabled(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
}
static JSValueRef showWebInspectorCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->showWebInspector();
return JSValueMakeUndefined(context);
}
static JSValueRef closeWebInspectorCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->closeWebInspector();
return JSValueMakeUndefined(context);
}
static JSValueRef evaluateInWebInspectorCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
double callId = JSValueToNumber(context, arguments[0], exception);
ASSERT(!*exception);
JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[1], exception));
@@ -1744,7 +1744,7 @@ static JSValueRef evaluateInWebInspectorCallback(JSContextRef context, JSObjectR
static JSValueRef evaluateScriptInIsolatedWorldCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
double worldID = JSValueToNumber(context, arguments[0], exception);
ASSERT(!*exception);
JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[1], exception));
@@ -1756,7 +1756,7 @@ static JSValueRef evaluateScriptInIsolatedWorldCallback(JSContextRef context, JS
static JSValueRef evaluateScriptInIsolatedWorldAndReturnValueCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
double worldID = JSValueToNumber(context, arguments[0], exception);
ASSERT(!*exception);
JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[1], exception));
@@ -1768,7 +1768,7 @@ static JSValueRef evaluateScriptInIsolatedWorldAndReturnValueCallback(JSContextR
static JSValueRef elementDoesAutoCompleteForElementWithIdCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
JSRetainPtr<JSStringRef> elementId(Adopt, JSValueToStringCopy(context, arguments[0], exception));
ASSERT(!*exception);
@@ -1789,7 +1789,7 @@ static JSValueRef pauseAnimationAtTimeOnElementWithIdCallback(JSContextRef conte
JSRetainPtr<JSStringRef> elementId(Adopt, JSValueToStringCopy(context, arguments[2], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
return JSValueMakeBoolean(context, controller->pauseAnimationAtTimeOnElementWithId(animationName.get(), time, elementId.get()));
}
@@ -1805,7 +1805,7 @@ static JSValueRef pauseTransitionAtTimeOnElementWithIdCallback(JSContextRef cont
JSRetainPtr<JSStringRef> elementId(Adopt, JSValueToStringCopy(context, arguments[2], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
return JSValueMakeBoolean(context, controller->pauseTransitionAtTimeOnElementWithId(propertyName.get(), time, elementId.get()));
}
@@ -1814,13 +1814,13 @@ static JSValueRef numberOfActiveAnimationsCallback(JSContextRef context, JSObjec
if (argumentCount != 0)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
return JSValueMakeNumber(context, controller->numberOfActiveAnimations());
}
static JSValueRef waitForPolicyDelegateCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t, const JSValueRef[], JSValueRef*)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->waitForPolicyDelegate();
return JSValueMakeUndefined(context);
}
@@ -1838,7 +1838,7 @@ static JSValueRef addOriginAccessWhitelistEntryCallback(JSContextRef context, JS
ASSERT(!*exception);
bool allowDestinationSubdomains = JSValueToBoolean(context, arguments[3]);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->addOriginAccessWhitelistEntry(sourceOrigin.get(), destinationProtocol.get(), destinationHost.get(), allowDestinationSubdomains);
return JSValueMakeUndefined(context);
}
@@ -1856,7 +1856,7 @@ static JSValueRef removeOriginAccessWhitelistEntryCallback(JSContextRef context,
ASSERT(!*exception);
bool allowDestinationSubdomains = JSValueToBoolean(context, arguments[3]);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->removeOriginAccessWhitelistEntry(sourceOrigin.get(), destinationProtocol.get(), destinationHost.get(), allowDestinationSubdomains);
return JSValueMakeUndefined(context);
}
@@ -1871,7 +1871,7 @@ static JSValueRef setScrollbarPolicyCallback(JSContextRef context, JSObjectRef,
JSRetainPtr<JSStringRef> policy(Adopt, JSValueToStringCopy(context, arguments[1], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setScrollbarPolicy(orientation.get(), policy.get());
return JSValueMakeUndefined(context);
}
@@ -1886,7 +1886,7 @@ static JSValueRef addUserScriptCallback(JSContextRef context, JSObjectRef, JSObj
bool runAtStart = JSValueToBoolean(context, arguments[1]);
bool allFrames = JSValueToBoolean(context, arguments[2]);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->addUserScript(source.get(), runAtStart, allFrames);
return JSValueMakeUndefined(context);
}
@@ -1900,7 +1900,7 @@ static JSValueRef addUserStyleSheetCallback(JSContextRef context, JSObjectRef, J
ASSERT(!*exception);
bool allFrames = JSValueToBoolean(context, arguments[1]);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->addUserStyleSheet(source.get(), allFrames);
return JSValueMakeUndefined(context);
}
@@ -1911,7 +1911,7 @@ static JSValueRef setShouldPaintBrokenImageCallback(JSContextRef context, JSObje
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setShouldPaintBrokenImage(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1928,14 +1928,14 @@ static JSValueRef apiTestNewWindowDataLoadBaseURLCallback(JSContextRef context,
JSRetainPtr<JSStringRef> baseURL(Adopt, JSValueToStringCopy(context, arguments[1], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->apiTestNewWindowDataLoadBaseURL(utf8Data.get(), baseURL.get());
return JSValueMakeUndefined(context);
}
static JSValueRef apiTestGoToCurrentBackForwardItemCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->apiTestGoToCurrentBackForwardItem();
return JSValueMakeUndefined(context);
}
@@ -1946,7 +1946,7 @@ static JSValueRef setWebViewEditableCallback(JSContextRef context, JSObjectRef f
if (argumentCount < 1)
return JSValueMakeUndefined(context);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setWebViewEditable(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
@@ -1961,7 +1961,7 @@ static JSValueRef sendWebIntentResponseCallback(JSContextRef context, JSObjectRe
} else
response.adopt(JSStringCreateWithUTF8CString(0));
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->sendWebIntentResponse(response.get());
return JSValueMakeUndefined(context);
@@ -1979,7 +1979,7 @@ static JSValueRef deliverWebIntentCallback(JSContextRef context, JSObjectRef fun
JSRetainPtr<JSStringRef> data(Adopt, JSValueToStringCopy(context, arguments[2], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->deliverWebIntent(action.get(), type.get(), data.get());
return JSValueMakeUndefined(context);
@@ -1987,14 +1987,14 @@ static JSValueRef deliverWebIntentCallback(JSContextRef context, JSObjectRef fun
static JSValueRef abortModalCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->abortModal();
return JSValueMakeUndefined(context);
}
static JSValueRef markerTextForListItemCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
if (argumentCount < 1)
return JSValueMakeUndefined(context);
return JSValueMakeString(context, controller->markerTextForListItem(context, arguments[0]).get());
@@ -2013,7 +2013,7 @@ static JSValueRef authenticateSessionCallback(JSContextRef context, JSObjectRef,
JSRetainPtr<JSStringRef> password(Adopt, JSValueToStringCopy(context, arguments[2], exception));
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->authenticateSession(url.get(), username.get(), password.get());
return JSValueMakeUndefined(context);
}
@@ -2024,13 +2024,13 @@ static JSValueRef setSerializeHTTPLoadsCallback(JSContextRef context, JSObjectRe
if (argumentCount == 1)
serialize = JSValueToBoolean(context, arguments[0]);
- LayoutTestController::setSerializeHTTPLoads(serialize);
+ TestRunner::setSerializeHTTPLoads(serialize);
return JSValueMakeUndefined(context);
}
static JSValueRef setShouldStayOnPageAfterHandlingBeforeUnloadCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
if (argumentCount == 1)
controller->setShouldStayOnPageAfterHandlingBeforeUnload(JSValueToBoolean(context, arguments[0]));
@@ -2040,7 +2040,7 @@ static JSValueRef setShouldStayOnPageAfterHandlingBeforeUnloadCallback(JSContext
static JSValueRef addChromeInputFieldCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->addChromeInputField();
// the first argument is a callback that is called once the input field has been added
if (argumentCount == 1)
@@ -2050,7 +2050,7 @@ static JSValueRef addChromeInputFieldCallback(JSContextRef context, JSObjectRef,
static JSValueRef removeChromeInputFieldCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->removeChromeInputField();
// the first argument is a callback that is called once the input field has been added
if (argumentCount == 1)
@@ -2060,7 +2060,7 @@ static JSValueRef removeChromeInputFieldCallback(JSContextRef context, JSObjectR
static JSValueRef focusWebViewCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->focusWebView();
// the first argument is a callback that is called once the input field has been added
if (argumentCount == 1)
@@ -2076,7 +2076,7 @@ static JSValueRef setBackingScaleFactorCallback(JSContextRef context, JSObjectRe
double backingScaleFactor = JSValueToNumber(context, arguments[0], exception);
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setBackingScaleFactor(backingScaleFactor);
// The second argument is a callback that is called once the backing scale factor has been set.
@@ -2093,26 +2093,26 @@ static JSValueRef preciseTimeCallback(JSContextRef context, JSObjectRef, JSObjec
static JSValueRef getGlobalFlagCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
return JSValueMakeBoolean(context, controller->globalFlag());
}
static JSValueRef getWebHistoryItemCountCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
return JSValueMakeNumber(context, controller->webHistoryItemCount());
}
static JSValueRef getWorkerThreadCountCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
return JSValueMakeNumber(context, controller->workerThreadCount());
}
#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(WIN)
static JSValueRef getPlatformNameCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
JSRetainPtr<JSStringRef> platformName(controller->platformName());
if (!platformName.get())
return JSValueMakeUndefined(context);
@@ -2122,28 +2122,28 @@ static JSValueRef getPlatformNameCallback(JSContextRef context, JSObjectRef this
static JSValueRef getTitleTextDirectionCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
JSRetainPtr<JSStringRef> titleDirection(Adopt, JSStringCreateWithUTF8CString(controller->titleTextDirection().c_str()));
return JSValueMakeString(context, titleDirection.get());
}
static bool setGlobalFlagCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setGlobalFlag(JSValueToBoolean(context, value));
return true;
}
static JSValueRef ignoreDesktopNotificationPermissionRequestsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->ignoreDesktopNotificationPermissionRequests();
return JSValueMakeUndefined(context);
}
static JSValueRef simulateDesktopNotificationClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
JSRetainPtr<JSStringRef> title(Adopt, JSValueToStringCopy(context, arguments[0], exception));
controller->simulateDesktopNotificationClick(title.get());
return JSValueMakeUndefined(context);
@@ -2157,7 +2157,7 @@ static JSValueRef setMinimumTimerIntervalCallback(JSContextRef context, JSObject
double minimum = JSValueToNumber(context, arguments[0], exception);
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setMinimumTimerInterval(minimum);
return JSValueMakeUndefined(context);
@@ -2167,7 +2167,7 @@ static JSValueRef setTextDirectionCallback(JSContextRef context, JSObjectRef fun
{
if (argumentCount == 1) {
JSRetainPtr<JSStringRef> direction(Adopt, JSValueToStringCopy(context, arguments[0], exception));
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setTextDirection(direction.get());
}
@@ -2179,7 +2179,7 @@ static JSValueRef setHasCustomFullScreenBehaviorCallback(JSContextRef context, J
{
if (argumentCount == 1) {
bool hasCustomBehavior = JSValueToBoolean(context, arguments[0]);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setHasCustomFullScreenBehavior(hasCustomBehavior);
}
@@ -2194,21 +2194,21 @@ static JSValueRef setStorageDatabaseIdleIntervalCallback(JSContextRef context, J
double interval = JSValueToNumber(context, arguments[0], exception);
ASSERT(!*exception);
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
controller->setStorageDatabaseIdleInterval(interval);
return JSValueMakeUndefined(context);
}
-static void layoutTestControllerObjectFinalize(JSObjectRef object)
+static void testRunnerObjectFinalize(JSObjectRef object)
{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(object));
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(object));
controller->deref();
}
// Object Creation
-void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
+void TestRunner::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
{
JSRetainPtr<JSStringRef> testRunnerStr(Adopt, JSStringCreateWithUTF8CString("testRunner"));
ref();
@@ -2221,19 +2221,19 @@ void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef wi
JSObjectSetProperty(context, windowObject, testRunnerStr.get(), layoutTestContollerObject, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception);
}
-JSClassRef LayoutTestController::getJSClass()
+JSClassRef TestRunner::getJSClass()
{
- static JSStaticValue* staticValues = LayoutTestController::staticValues();
- static JSStaticFunction* staticFunctions = LayoutTestController::staticFunctions();
+ static JSStaticValue* staticValues = TestRunner::staticValues();
+ static JSStaticFunction* staticFunctions = TestRunner::staticFunctions();
static JSClassDefinition classDefinition = {
- 0, kJSClassAttributeNone, "LayoutTestController", 0, staticValues, staticFunctions,
- 0, layoutTestControllerObjectFinalize, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ 0, kJSClassAttributeNone, "TestRunner", 0, staticValues, staticFunctions,
+ 0, testRunnerObjectFinalize, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
return JSClassCreate(&classDefinition);
}
-JSStaticValue* LayoutTestController::staticValues()
+JSStaticValue* TestRunner::staticValues()
{
static JSStaticValue staticValues[] = {
{ "globalFlag", getGlobalFlagCallback, setGlobalFlagCallback, kJSPropertyAttributeNone },
@@ -2248,7 +2248,7 @@ JSStaticValue* LayoutTestController::staticValues()
return staticValues;
}
-JSStaticFunction* LayoutTestController::staticFunctions()
+JSStaticFunction* TestRunner::staticFunctions()
{
static JSStaticFunction staticFunctions[] = {
{ "abortModal", abortModalCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -2423,47 +2423,47 @@ JSStaticFunction* LayoutTestController::staticFunctions()
return staticFunctions;
}
-void LayoutTestController::queueLoadHTMLString(JSStringRef content, JSStringRef baseURL)
+void TestRunner::queueLoadHTMLString(JSStringRef content, JSStringRef baseURL)
{
WorkQueue::shared()->queue(new LoadHTMLStringItem(content, baseURL));
}
-void LayoutTestController::queueLoadAlternateHTMLString(JSStringRef content, JSStringRef baseURL, JSStringRef unreachableURL)
+void TestRunner::queueLoadAlternateHTMLString(JSStringRef content, JSStringRef baseURL, JSStringRef unreachableURL)
{
WorkQueue::shared()->queue(new LoadHTMLStringItem(content, baseURL, unreachableURL));
}
-void LayoutTestController::queueBackNavigation(int howFarBack)
+void TestRunner::queueBackNavigation(int howFarBack)
{
WorkQueue::shared()->queue(new BackItem(howFarBack));
}
-void LayoutTestController::queueForwardNavigation(int howFarForward)
+void TestRunner::queueForwardNavigation(int howFarForward)
{
WorkQueue::shared()->queue(new ForwardItem(howFarForward));
}
-void LayoutTestController::queueLoadingScript(JSStringRef script)
+void TestRunner::queueLoadingScript(JSStringRef script)
{
WorkQueue::shared()->queue(new LoadingScriptItem(script));
}
-void LayoutTestController::queueNonLoadingScript(JSStringRef script)
+void TestRunner::queueNonLoadingScript(JSStringRef script)
{
WorkQueue::shared()->queue(new NonLoadingScriptItem(script));
}
-void LayoutTestController::queueReload()
+void TestRunner::queueReload()
{
WorkQueue::shared()->queue(new ReloadItem);
}
-void LayoutTestController::grantDesktopNotificationPermission(JSStringRef origin)
+void TestRunner::grantDesktopNotificationPermission(JSStringRef origin)
{
m_desktopNotificationAllowedOrigins.push_back(JSStringRetain(origin));
}
-bool LayoutTestController::checkDesktopNotificationPermission(JSStringRef origin)
+bool TestRunner::checkDesktopNotificationPermission(JSStringRef origin)
{
std::vector<JSStringRef>::iterator i;
for (i = m_desktopNotificationAllowedOrigins.begin();
@@ -2475,12 +2475,12 @@ bool LayoutTestController::checkDesktopNotificationPermission(JSStringRef origin
return false;
}
-void LayoutTestController::ignoreDesktopNotificationPermissionRequests()
+void TestRunner::ignoreDesktopNotificationPermissionRequests()
{
m_areDesktopNotificationPermissionRequestsIgnored = false;
}
-void LayoutTestController::waitToDumpWatchdogTimerFired()
+void TestRunner::waitToDumpWatchdogTimerFired()
{
const char* message = "FAIL: Timed out waiting for notifyDone to be called\n";
fprintf(stderr, "%s", message);
@@ -2488,33 +2488,33 @@ void LayoutTestController::waitToDumpWatchdogTimerFired()
notifyDone();
}
-void LayoutTestController::setGeolocationPermissionCommon(bool allow)
+void TestRunner::setGeolocationPermissionCommon(bool allow)
{
m_isGeolocationPermissionSet = true;
m_geolocationPermission = allow;
}
-void LayoutTestController::setPOSIXLocale(JSStringRef locale)
+void TestRunner::setPOSIXLocale(JSStringRef locale)
{
char localeBuf[32];
JSStringGetUTF8CString(locale, localeBuf, sizeof(localeBuf));
setlocale(LC_ALL, localeBuf);
}
-void LayoutTestController::addURLToRedirect(std::string origin, std::string destination)
+void TestRunner::addURLToRedirect(std::string origin, std::string destination)
{
m_URLsToRedirect[origin] = destination;
}
-const std::string& LayoutTestController::redirectionDestinationForURL(std::string origin)
+const std::string& TestRunner::redirectionDestinationForURL(std::string origin)
{
return m_URLsToRedirect[origin];
}
-void LayoutTestController::setShouldPaintBrokenImage(bool shouldPaintBrokenImage)
+void TestRunner::setShouldPaintBrokenImage(bool shouldPaintBrokenImage)
{
m_shouldPaintBrokenImage = shouldPaintBrokenImage;
}
-const unsigned LayoutTestController::maxViewWidth = 800;
-const unsigned LayoutTestController::maxViewHeight = 600;
+const unsigned TestRunner::maxViewWidth = 800;
+const unsigned TestRunner::maxViewHeight = 600;
diff --git a/Tools/DumpRenderTree/LayoutTestController.h b/Tools/DumpRenderTree/TestRunner.h
index 3072c7fc9..885b1de72 100644
--- a/Tools/DumpRenderTree/LayoutTestController.h
+++ b/Tools/DumpRenderTree/TestRunner.h
@@ -26,8 +26,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef LayoutTestController_h
-#define LayoutTestController_h
+#ifndef TestRunner_h
+#define TestRunner_h
#include <JavaScriptCore/JSObjectRef.h>
#include <JavaScriptCore/JSRetainPtr.h>
@@ -38,12 +38,12 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
-class LayoutTestController : public RefCounted<LayoutTestController> {
+class TestRunner : public RefCounted<TestRunner> {
public:
- static PassRefPtr<LayoutTestController> create(const std::string& testPathOrURL, const std::string& expectedPixelHash);
- ~LayoutTestController();
+ static PassRefPtr<TestRunner> create(const std::string& testPathOrURL, const std::string& expectedPixelHash);
+ ~TestRunner();
- void makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception);
+ void makeWindowObject(JSContextRef, JSObjectRef windowObject, JSValueRef* exception);
void addDisallowedURL(JSStringRef url);
void addURLToRedirect(std::string origin, std::string destination);
@@ -86,11 +86,11 @@ public:
void queueReload();
void removeAllVisitedLinks();
void sendWebIntentResponse(JSStringRef response);
- void setAcceptsEditing(bool acceptsEditing);
+ void setAcceptsEditing(bool);
void setAllowUniversalAccessFromFileURLs(bool);
void setAllowFileAccessFromFileURLs(bool);
void setAppCacheMaximumSize(unsigned long long quota);
- void setApplicationCacheOriginQuota(unsigned long long quota);
+ void setApplicationCacheOriginQuota(unsigned long long);
void setAuthorAndUserStylesEnabled(bool);
void setAutofilled(JSContextRef, JSValueRef nodeObject, bool autofilled);
void setCacheModel(int);
@@ -98,7 +98,7 @@ public:
void setDatabaseQuota(unsigned long long quota);
void setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme);
void setDefersLoading(bool);
- void setIconDatabaseEnabled(bool iconDatabaseEnabled);
+ void setIconDatabaseEnabled(bool);
void setJavaScriptCanAccessClipboard(bool flag);
void setAutomaticLinkDetectionEnabled(bool flag);
void setMainFrameIsFirstResponder(bool flag);
@@ -108,20 +108,20 @@ public:
void addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language);
void setMockSpeechInputDumpRect(bool flag);
void setPersistentUserStyleSheetLocation(JSStringRef path);
- void setPluginsEnabled(bool flag);
- void setPopupBlockingEnabled(bool flag);
- void setPrivateBrowsingEnabled(bool flag);
- void setSelectTrailingWhitespaceEnabled(bool flag);
- void setSmartInsertDeleteEnabled(bool flag);
- void setTabKeyCyclesThroughElements(bool cycles);
+ void setPluginsEnabled(bool);
+ void setPopupBlockingEnabled(bool);
+ void setPrivateBrowsingEnabled(bool);
+ void setSelectTrailingWhitespaceEnabled(bool);
+ void setSmartInsertDeleteEnabled(bool);
+ void setTabKeyCyclesThroughElements(bool);
void setUseDashboardCompatibilityMode(bool flag);
void setUserStyleSheetEnabled(bool flag);
void setUserStyleSheetLocation(JSStringRef path);
void setValueForUser(JSContextRef, JSValueRef nodeObject, JSStringRef value);
- void setViewModeMediaFeature(JSStringRef mode);
+ void setViewModeMediaFeature(JSStringRef);
void setXSSAuditorEnabled(bool flag);
- void setFrameFlatteningEnabled(bool enable);
- void setSpatialNavigationEnabled(bool enable);
+ void setFrameFlatteningEnabled(bool);
+ void setSpatialNavigationEnabled(bool);
void setScrollbarPolicy(JSStringRef orientation, JSStringRef policy);
void startSpeechInput(JSContextRef inputElement);
void setPageVisibility(const char*);
@@ -244,7 +244,7 @@ public:
void setTestRepaintSweepHorizontally(bool testRepaintSweepHorizontally) { m_testRepaintSweepHorizontally = testRepaintSweepHorizontally; }
bool waitToDump() const { return m_waitToDump; }
- void setWaitToDump(bool waitToDump);
+ void setWaitToDump(bool);
void waitToDumpWatchdogTimerFired();
const std::set<std::string>& willSendRequestClearHeaders() const { return m_willSendRequestClearHeaders; }
@@ -257,10 +257,10 @@ public:
void setWillSendRequestReturnsNullOnRedirect(bool returnsNull) { m_willSendRequestReturnsNullOnRedirect = returnsNull; }
bool windowIsKey() const { return m_windowIsKey; }
- void setWindowIsKey(bool windowIsKey);
+ void setWindowIsKey(bool);
bool alwaysAcceptCookies() const { return m_alwaysAcceptCookies; }
- void setAlwaysAcceptCookies(bool alwaysAcceptCookies);
+ void setAlwaysAcceptCookies(bool);
bool handlesAuthenticationChallenges() const { return m_handlesAuthenticationChallenges; }
void setHandlesAuthenticationChallenges(bool handlesAuthenticationChallenges) { m_handlesAuthenticationChallenges = handlesAuthenticationChallenges; }
@@ -320,13 +320,13 @@ public:
void setBackingScaleFactor(double);
- void setPOSIXLocale(JSStringRef locale);
+ void setPOSIXLocale(JSStringRef);
void setWebViewEditable(bool);
void abortModal();
- static void setSerializeHTTPLoads(bool serialize);
+ static void setSerializeHTTPLoads(bool);
// The following API test functions should probably be moved to platform-specific
// unit tests outside of DRT once they exist.
@@ -338,7 +338,7 @@ public:
JSRetainPtr<JSStringRef> layerTreeAsText() const;
- JSRetainPtr<JSStringRef> markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const;
+ JSRetainPtr<JSStringRef> markerTextForListItem(JSContextRef, JSValueRef nodeObject) const;
JSValueRef originsWithLocalStorage(JSContextRef);
void deleteAllLocalStorage();
@@ -366,7 +366,7 @@ public:
void setStorageDatabaseIdleInterval(double);
private:
- LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash);
+ TestRunner(const std::string& testPathOrURL, const std::string& expectedPixelHash);
void setGeolocationPermissionCommon(bool allow);
@@ -423,7 +423,7 @@ private:
std::string m_authenticationUsername;
std::string m_authenticationPassword;
std::string m_testPathOrURL;
- std::string m_expectedPixelHash; // empty string if no hash
+ std::string m_expectedPixelHash; // empty string if no hash
std::string m_titleTextDirection;
std::set<std::string> m_willSendRequestClearHeaders;
@@ -441,4 +441,4 @@ private:
static JSStaticFunction* staticFunctions();
};
-#endif // LayoutTestController_h
+#endif // TestRunner_h
diff --git a/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp b/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp
index 11f390e3b..b778771ce 100644
--- a/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp
@@ -41,7 +41,6 @@
#include "HistoryItem.h"
#include "IntSize.h"
#include "JSDOMBinding.h"
-#include "LayoutTestController.h"
#include "NotImplemented.h"
#include "OwnArrayPtr.h"
#include "Page.h"
@@ -53,6 +52,7 @@
#include "ScriptController.h"
#include "SecurityOrigin.h"
#include "Settings.h"
+#include "TestRunner.h"
#include "TextAffinity.h"
#include "Timer.h"
#include "Vector.h"
@@ -72,7 +72,7 @@
volatile bool testDone;
-RefPtr<LayoutTestController> gLayoutTestController;
+RefPtr<TestRunner> gTestRunner;
WebCore::Frame* mainFrame = 0;
WebCore::Frame* topLoadingFrame = 0;
@@ -181,7 +181,7 @@ void DumpRenderTree::runTest(const String& url)
mainFrame->loader()->stopForUserCancel();
resetToConsistentStateBeforeTesting();
if (shouldLogFrameLoadDelegates(url))
- gLayoutTestController->setDumpFrameLoadCallbacks(true);
+ gTestRunner->setDumpFrameLoadCallbacks(true);
String stdoutFile = m_resultsDir + *m_currentTest + ".dump";
String stderrFile = m_resultsDir + *m_currentTest + ".stderr";
@@ -241,11 +241,11 @@ void DumpRenderTree::runRemainingTests()
void DumpRenderTree::resetToConsistentStateBeforeTesting()
{
if (isHTTPTest(m_currentTest->utf8().data()))
- gLayoutTestController = LayoutTestController::create(String(httpPrefixURL + *m_currentTest).utf8().data(), "");
+ gTestRunner = TestRunner::create(String(httpPrefixURL + *m_currentTest).utf8().data(), "");
else
- gLayoutTestController = LayoutTestController::create(String(kSDCLayoutTestsURI + *m_currentTest).utf8().data(), "");
+ gTestRunner = TestRunner::create(String(kSDCLayoutTestsURI + *m_currentTest).utf8().data(), "");
- gLayoutTestController->setIconDatabaseEnabled(false);
+ gTestRunner->setIconDatabaseEnabled(false);
DumpRenderTreeSupport::resetGeolocationMock(m_page);
@@ -361,7 +361,7 @@ String DumpRenderTree::dumpFramesAsText(WebCore::Frame* frame)
s += documentElement->innerText() + "\n";
- if (gLayoutTestController->dumpChildFramesAsText()) {
+ if (gTestRunner->dumpChildFramesAsText()) {
WebCore::FrameTree* tree = frame->tree();
for (WebCore::Frame* child = tree->firstChild(); child; child = child->tree()->nextSibling())
s += dumpFramesAsText(child);
@@ -488,17 +488,17 @@ void DumpRenderTree::dump()
String resultMimeType = "text/plain";
String responseMimeType = mainFrame->loader()->documentLoader()->responseMIMEType();
- bool dumpAsText = gLayoutTestController->dumpAsText() || responseMimeType == "text/plain";
+ bool dumpAsText = gTestRunner->dumpAsText() || responseMimeType == "text/plain";
String data = dumpAsText ? dumpFramesAsText(mainFrame) : renderTreeDump();
- if (gLayoutTestController->dumpBackForwardList())
+ if (gTestRunner->dumpBackForwardList())
data += dumpBackForwardListForWebView();
String result = "Content-Type: " + resultMimeType + "\n" + data;
dumpToFile(result);
- if (m_dumpPixels && !dumpAsText && gLayoutTestController->generatePixelResults())
- dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash());
+ if (m_dumpPixels && !dumpAsText && gTestRunner->generatePixelResults())
+ dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash());
String crashFile = dumpFile + ".crash";
unlink(crashFile.utf8().data());
@@ -518,7 +518,7 @@ void DumpRenderTree::setWaitToDumpWatchdog(double interval)
void DumpRenderTree::waitToDumpWatchdogTimerFired(WebCore::Timer<DumpRenderTree>*)
{
- gLayoutTestController->waitToDumpWatchdogTimerFired();
+ gTestRunner->waitToDumpWatchdogTimerFired();
}
void DumpRenderTree::processWork(WebCore::Timer<DumpRenderTree>*)
@@ -526,7 +526,7 @@ void DumpRenderTree::processWork(WebCore::Timer<DumpRenderTree>*)
if (topLoadingFrame)
return;
- if (WorkQueue::shared()->processWork() && !gLayoutTestController->waitToDump())
+ if (WorkQueue::shared()->processWork() && !gTestRunner->waitToDump())
dump();
}
@@ -537,7 +537,7 @@ void DumpRenderTree::locationChangeForFrame(WebCore::Frame* frame)
topLoadingFrame = 0;
WorkQueue::shared()->setFrozen(true); // first complete load freezes the queue
- if (gLayoutTestController->waitToDump())
+ if (gTestRunner->waitToDump())
return;
if (WorkQueue::shared()->count())
@@ -549,16 +549,16 @@ void DumpRenderTree::locationChangeForFrame(WebCore::Frame* frame)
// FrameLoadClient delegates.
void DumpRenderTree::didStartProvisionalLoadForFrame(WebCore::Frame* frame)
{
- if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!testDone && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didStartProvisionalLoadForFrame\n", drtFrameDescription(frame).utf8().data());
- if (!testDone && gLayoutTestController->dumpUserGestureInFrameLoadCallbacks())
+ if (!testDone && gTestRunner->dumpUserGestureInFrameLoadCallbacks())
printf("Frame with user gesture \"%s\" - in didStartProvisionalLoadForFrame\n", WebCore::ScriptController::processingUserGesture() ? "true" : "false");
if (!topLoadingFrame && !testDone)
topLoadingFrame = frame;
- if (!testDone && gLayoutTestController->stopProvisionalFrameLoads()) {
+ if (!testDone && gTestRunner->stopProvisionalFrameLoads()) {
printf("%s - stopping load in didStartProvisionalLoadForFrame callback\n", drtFrameDescription(frame).utf8().data());
frame->loader()->stopForUserCancel();
}
@@ -566,15 +566,15 @@ void DumpRenderTree::didStartProvisionalLoadForFrame(WebCore::Frame* frame)
void DumpRenderTree::didCommitLoadForFrame(WebCore::Frame* frame)
{
- if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!testDone && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didCommitLoadForFrame\n", drtFrameDescription(frame).utf8().data());
- gLayoutTestController->setWindowIsKey(true);
+ gTestRunner->setWindowIsKey(true);
}
void DumpRenderTree::didFailProvisionalLoadForFrame(WebCore::Frame* frame)
{
- if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!testDone && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didFailProvisionalLoadWithError\n", drtFrameDescription(frame).utf8().data());
locationChangeForFrame(frame);
@@ -582,7 +582,7 @@ void DumpRenderTree::didFailProvisionalLoadForFrame(WebCore::Frame* frame)
void DumpRenderTree::didFailLoadForFrame(WebCore::Frame* frame)
{
- if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!testDone && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didFailLoadWithError\n", drtFrameDescription(frame).utf8().data());
locationChangeForFrame(frame);
@@ -590,7 +590,7 @@ void DumpRenderTree::didFailLoadForFrame(WebCore::Frame* frame)
void DumpRenderTree::didFinishLoadForFrame(WebCore::Frame* frame)
{
- if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!testDone && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didFinishLoadForFrame\n", drtFrameDescription(frame).utf8().data());
if (frame == topLoadingFrame)
@@ -601,7 +601,7 @@ void DumpRenderTree::didFinishLoadForFrame(WebCore::Frame* frame)
void DumpRenderTree::didFinishDocumentLoadForFrame(WebCore::Frame* frame)
{
if (!testDone) {
- if (gLayoutTestController->dumpFrameLoadCallbacks())
+ if (gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didFinishDocumentLoadForFrame\n", drtFrameDescription(frame).utf8().data());
else {
unsigned pendingFrameUnloadEvents = frame->domWindow()->pendingUnloadEventListeners();
@@ -615,7 +615,7 @@ void DumpRenderTree::didClearWindowObjectInWorld(WebCore::DOMWrapperWorld*, JSGl
{
JSValueRef exception = 0;
- gLayoutTestController->makeWindowObject(context, windowObject, &exception);
+ gTestRunner->makeWindowObject(context, windowObject, &exception);
ASSERT(!exception);
m_gcController->makeWindowObject(context, windowObject, &exception);
@@ -633,17 +633,33 @@ void DumpRenderTree::didClearWindowObjectInWorld(WebCore::DOMWrapperWorld*, JSGl
void DumpRenderTree::didReceiveTitleForFrame(const String& title, WebCore::Frame* frame)
{
- if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!testDone && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didReceiveTitle: %s\n", drtFrameDescription(frame).utf8().data(), title.utf8().data());
- if (gLayoutTestController->dumpTitleChanges())
+ if (gTestRunner->dumpTitleChanges())
printf("TITLE CHANGED: %s\n", title.utf8().data());
}
// ChromeClient delegates.
void DumpRenderTree::addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID)
{
- printf("CONSOLE MESSAGE: line %d: %s\n", lineNumber, message.utf8().data());
+ printf("CONSOLE MESSAGE: ");
+ if (lineNumber)
+ printf("line %d: ", lineNumber);
+ String newMessage = message;
+ int pos = message.find("file://");
+ if (pos >= 0) {
+ newMessage = message.substring(0, pos);
+ String remaining = message.substring(pos);
+ String fileName;
+ int indexFile = remaining.reverseFind('/') + 1;
+ if (indexFile > 0 && indexFile < remaining.length())
+ fileName = remaining.substring(indexFile);
+ else
+ fileName = "file:";
+ newMessage.append(fileName);
+ }
+ printf("%s\n", newMessage.utf8().data());
}
void DumpRenderTree::runJavaScriptAlert(const String& message)
@@ -675,13 +691,13 @@ bool DumpRenderTree::runBeforeUnloadConfirmPanel(const String& message)
void DumpRenderTree::setStatusText(const String& status)
{
- if (gLayoutTestController->dumpStatusCallbacks())
+ if (gTestRunner->dumpStatusCallbacks())
printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", status.utf8().data());
}
void DumpRenderTree::exceededDatabaseQuota(WebCore::SecurityOrigin* origin, const String& name)
{
- if (!testDone && gLayoutTestController->dumpDatabaseCallbacks())
+ if (!testDone && gTestRunner->dumpDatabaseCallbacks())
printf("UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%s, %s, %i} database:%s\n", origin->protocol().utf8().data(), origin->host().utf8().data(), origin->port(), name.utf8().data());
WebCore::DatabaseTracker::tracker().setQuota(mainFrame->document()->securityOrigin(), 5 * 1024 * 1024);
@@ -689,7 +705,7 @@ void DumpRenderTree::exceededDatabaseQuota(WebCore::SecurityOrigin* origin, cons
bool DumpRenderTree::allowsOpeningWindow()
{
- return gLayoutTestController->canOpenWindows();
+ return gTestRunner->canOpenWindows();
}
void DumpRenderTree::windowCreated(BlackBerry::WebKit::WebPage* page)
@@ -700,25 +716,25 @@ void DumpRenderTree::windowCreated(BlackBerry::WebKit::WebPage* page)
// EditorClient delegates.
void DumpRenderTree::didBeginEditing()
{
- if (!testDone && gLayoutTestController->dumpEditingCallbacks())
+ if (!testDone && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: webViewDidBeginEditing:%s\n", "WebViewDidBeginEditingNotification");
}
void DumpRenderTree::didEndEditing()
{
- if (!testDone && gLayoutTestController->dumpEditingCallbacks())
+ if (!testDone && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: webViewDidEndEditing:%s\n", "WebViewDidEndEditingNotification");
}
void DumpRenderTree::didChange()
{
- if (!testDone && gLayoutTestController->dumpEditingCallbacks())
+ if (!testDone && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: webViewDidChange:%s\n", "WebViewDidChangeNotification");
}
void DumpRenderTree::didChangeSelection()
{
- if (!testDone && gLayoutTestController->dumpEditingCallbacks())
+ if (!testDone && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: webViewDidChangeSelection:%s\n", "WebViewDidChangeSelectionNotification");
}
@@ -730,28 +746,28 @@ bool DumpRenderTree::findString(const String& string, WebCore::FindOptions optio
bool DumpRenderTree::shouldBeginEditingInDOMRange(WebCore::Range* range)
{
- if (!testDone && gLayoutTestController->dumpEditingCallbacks())
+ if (!testDone && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", drtRangeDescription(range).utf8().data());
return m_acceptsEditing;
}
bool DumpRenderTree::shouldEndEditingInDOMRange(WebCore::Range* range)
{
- if (!testDone && gLayoutTestController->dumpEditingCallbacks())
+ if (!testDone && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n", drtRangeDescription(range).utf8().data());
return m_acceptsEditing;
}
bool DumpRenderTree::shouldDeleteDOMRange(WebCore::Range* range)
{
- if (!testDone && gLayoutTestController->dumpEditingCallbacks())
+ if (!testDone && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: shouldDeleteDOMRange:%s\n", drtRangeDescription(range).utf8().data());
return m_acceptsEditing;
}
bool DumpRenderTree::shouldChangeSelectedDOMRangeToDOMRangeAffinityStillSelecting(WebCore::Range* fromRange, WebCore::Range* toRange, int affinity, bool stillSelecting)
{
- if (!testDone && gLayoutTestController->dumpEditingCallbacks())
+ if (!testDone && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n", drtRangeDescription(fromRange).utf8().data(), drtRangeDescription(toRange).utf8().data(), drtAffinityDescription(static_cast<WebCore::EAffinity>(affinity)).utf8().data(), stillSelecting ? "TRUE" : "FALSE");
return m_acceptsEditing;
}
@@ -772,14 +788,14 @@ static const char* insertActionString(WebCore::EditorInsertAction action)
bool DumpRenderTree::shouldInsertNode(WebCore::Node* node, WebCore::Range* range, int action)
{
- if (!testDone && gLayoutTestController->dumpEditingCallbacks())
+ if (!testDone && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n", drtDumpPath(node).utf8().data(), drtRangeDescription(range).utf8().data(), insertActionString((WebCore::EditorInsertAction)action));
return m_acceptsEditing;
}
bool DumpRenderTree::shouldInsertText(const String& text, WebCore::Range* range, int action)
{
- if (!testDone && gLayoutTestController->dumpEditingCallbacks())
+ if (!testDone && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n", text.utf8().data(), drtRangeDescription(range).utf8().data(), insertActionString((WebCore::EditorInsertAction)action));
return m_acceptsEditing;
}
@@ -816,36 +832,36 @@ void DumpRenderTree::didDecidePolicyForNavigationAction(const WebCore::Navigatio
printf("Policy delegate: attempt to load %s with navigation type '%s'\n", request.url().string().utf8().data(), typeDescription);
// FIXME: do originating part.
- gLayoutTestController->notifyDone();
+ gTestRunner->notifyDone();
}
void DumpRenderTree::didDispatchWillPerformClientRedirect()
{
- if (!testDone && gLayoutTestController->dumpUserGestureInFrameLoadCallbacks())
+ if (!testDone && gTestRunner->dumpUserGestureInFrameLoadCallbacks())
printf("Frame with user gesture \"%s\" - in willPerformClientRedirect\n", WebCore::ScriptController::processingUserGesture() ? "true" : "false");
}
void DumpRenderTree::didHandleOnloadEventsForFrame(WebCore::Frame* frame)
{
- if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!testDone && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didHandleOnloadEventsForFrame\n", drtFrameDescription(frame).utf8().data());
}
void DumpRenderTree::didReceiveResponseForFrame(WebCore::Frame* frame, const WebCore::ResourceResponse& response)
{
- if (!testDone && gLayoutTestController->dumpResourceResponseMIMETypes())
+ if (!testDone && gTestRunner->dumpResourceResponseMIMETypes())
printf("%s has MIME type %s\n", response.url().lastPathComponent().utf8().data(), response.mimeType().utf8().data());
}
bool DumpRenderTree::didReceiveAuthenticationChallenge(WebCore::Credential& credential)
{
- if (!gLayoutTestController->handlesAuthenticationChallenges()) {
+ if (!gTestRunner->handlesAuthenticationChallenges()) {
credential = WebCore::Credential();
printf("%s - didReceiveAuthenticationChallenge - Simulating cancelled authentication\n", drtCredentialDescription(credential).utf8().data());
return false;
}
- const char* user = gLayoutTestController->authenticationUsername().c_str();
- const char* password = gLayoutTestController->authenticationPassword().c_str();
+ const char* user = gTestRunner->authenticationUsername().c_str();
+ const char* password = gTestRunner->authenticationPassword().c_str();
credential = WebCore::Credential(user, password, WebCore::CredentialPersistenceForSession);
printf("%s - didReceiveAuthenticationChallenge - Responding with %s:%s\n", drtCredentialDescription(credential).utf8().data(), user, password);
return true;
diff --git a/Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp b/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp
index fd59a417e..f6395fbf0 100644
--- a/Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp
+++ b/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp
@@ -17,7 +17,7 @@
*/
#include "config.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include "CString.h"
#include "DatabaseTracker.h"
@@ -55,53 +55,53 @@
using WebCore::toElement;
using WebCore::toJS;
-LayoutTestController::~LayoutTestController()
+TestRunner::~TestRunner()
{
}
-void LayoutTestController::addDisallowedURL(JSStringRef url)
+void TestRunner::addDisallowedURL(JSStringRef url)
{
UNUSED_PARAM(url);
notImplemented();
}
-void LayoutTestController::clearAllDatabases()
+void TestRunner::clearAllDatabases()
{
#if ENABLE(DATABASE)
WebCore::DatabaseTracker::tracker().deleteAllDatabases();
#endif
}
-void LayoutTestController::clearBackForwardList()
+void TestRunner::clearBackForwardList()
{
BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->clearBackForwardList(true);
}
-void LayoutTestController::clearPersistentUserStyleSheet()
+void TestRunner::clearPersistentUserStyleSheet()
{
notImplemented();
}
-JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name)
+JSStringRef TestRunner::copyDecodedHostName(JSStringRef name)
{
UNUSED_PARAM(name);
notImplemented();
return 0;
}
-JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name)
+JSStringRef TestRunner::copyEncodedHostName(JSStringRef name)
{
UNUSED_PARAM(name);
notImplemented();
return 0;
}
-void LayoutTestController::dispatchPendingLoadRequests()
+void TestRunner::dispatchPendingLoadRequests()
{
notImplemented();
}
-void LayoutTestController::display()
+void TestRunner::display()
{
notImplemented();
}
@@ -114,7 +114,7 @@ static String jsStringRefToWebCoreString(JSStringRef str)
return String::fromUTF8(strArr.get());
}
-void LayoutTestController::execCommand(JSStringRef name, JSStringRef value)
+void TestRunner::execCommand(JSStringRef name, JSStringRef value)
{
if (!mainFrame)
return;
@@ -125,7 +125,7 @@ void LayoutTestController::execCommand(JSStringRef name, JSStringRef value)
mainFrame->editor()->command(nameStr).execute(valueStr);
}
-bool LayoutTestController::isCommandEnabled(JSStringRef name)
+bool TestRunner::isCommandEnabled(JSStringRef name)
{
if (!mainFrame)
return false;
@@ -135,12 +135,12 @@ bool LayoutTestController::isCommandEnabled(JSStringRef name)
return mainFrame->editor()->command(nameStr).isEnabled();
}
-void LayoutTestController::keepWebHistory()
+void TestRunner::keepWebHistory()
{
notImplemented();
}
-void LayoutTestController::notifyDone()
+void TestRunner::notifyDone()
{
if (m_waitToDump && (!topLoadingFrame || BlackBerry::WebKit::DumpRenderTree::currentInstance()->loadFinished()) && !WorkQueue::shared()->count())
dump();
@@ -149,12 +149,12 @@ void LayoutTestController::notifyDone()
waitForPolicy = false;
}
-JSStringRef LayoutTestController::pathToLocalResource(JSContextRef, JSStringRef url)
+JSStringRef TestRunner::pathToLocalResource(JSContextRef, JSStringRef url)
{
return JSStringRetain(url);
}
-void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target)
+void TestRunner::queueLoad(JSStringRef url, JSStringRef target)
{
size_t urlArrSize = JSStringGetMaximumUTF8CStringSize(url);
OwnArrayPtr<char> urlArr = adoptArrayPtr(new char[urlArrSize]);
@@ -167,55 +167,55 @@ void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target)
WorkQueue::shared()->queue(new LoadItem(absoluteURL.get(), target));
}
-void LayoutTestController::setAcceptsEditing(bool acceptsEditing)
+void TestRunner::setAcceptsEditing(bool acceptsEditing)
{
BlackBerry::WebKit::DumpRenderTree::currentInstance()->setAcceptsEditing(acceptsEditing);
}
-void LayoutTestController::setAppCacheMaximumSize(unsigned long long quota)
+void TestRunner::setAppCacheMaximumSize(unsigned long long quota)
{
UNUSED_PARAM(quota);
notImplemented();
}
-void LayoutTestController::setAuthorAndUserStylesEnabled(bool enable)
+void TestRunner::setAuthorAndUserStylesEnabled(bool enable)
{
mainFrame->page()->settings()->setAuthorAndUserStylesEnabled(enable);
}
-void LayoutTestController::setCacheModel(int)
+void TestRunner::setCacheModel(int)
{
notImplemented();
}
-void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive)
+void TestRunner::setCustomPolicyDelegate(bool setDelegate, bool permissive)
{
UNUSED_PARAM(setDelegate);
UNUSED_PARAM(permissive);
notImplemented();
}
-void LayoutTestController::clearApplicationCacheForOrigin(OpaqueJSString*)
+void TestRunner::clearApplicationCacheForOrigin(OpaqueJSString*)
{
// FIXME: Implement to support deleting all application caches for an origin.
notImplemented();
}
-long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef)
+long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef)
{
// FIXME: Implement to support getting disk usage in bytes for an origin.
notImplemented();
return 0;
}
-JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context)
+JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context)
{
// FIXME: Implement to get origins that contain application caches.
notImplemented();
return JSValueMakeUndefined(context);
}
-void LayoutTestController::setDatabaseQuota(unsigned long long quota)
+void TestRunner::setDatabaseQuota(unsigned long long quota)
{
if (!mainFrame)
return;
@@ -223,57 +223,57 @@ void LayoutTestController::setDatabaseQuota(unsigned long long quota)
WebCore::DatabaseTracker::tracker().setQuota(mainFrame->document()->securityOrigin(), quota);
}
-void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme)
+void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme)
{
WebCore::SchemeRegistry::setDomainRelaxationForbiddenForURLScheme(forbidden, jsStringRefToWebCoreString(scheme));
}
-void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
+void TestRunner::setIconDatabaseEnabled(bool iconDatabaseEnabled)
{
UNUSED_PARAM(iconDatabaseEnabled);
notImplemented();
}
-void LayoutTestController::setMainFrameIsFirstResponder(bool flag)
+void TestRunner::setMainFrameIsFirstResponder(bool flag)
{
UNUSED_PARAM(flag);
notImplemented();
}
-void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef path)
+void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef path)
{
UNUSED_PARAM(path);
notImplemented();
}
-void LayoutTestController::setPopupBlockingEnabled(bool flag)
+void TestRunner::setPopupBlockingEnabled(bool flag)
{
BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setJavaScriptOpenWindowsAutomatically(!flag);
}
-void LayoutTestController::setPrivateBrowsingEnabled(bool flag)
+void TestRunner::setPrivateBrowsingEnabled(bool flag)
{
UNUSED_PARAM(flag);
notImplemented();
}
-void LayoutTestController::setXSSAuditorEnabled(bool flag)
+void TestRunner::setXSSAuditorEnabled(bool flag)
{
BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setXSSAuditorEnabled(flag);
}
-void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag)
+void TestRunner::setSelectTrailingWhitespaceEnabled(bool flag)
{
BlackBerry::WebKit::DumpRenderTree::currentInstance()->setSelectTrailingWhitespaceEnabled(flag);
}
-void LayoutTestController::setSmartInsertDeleteEnabled(bool flag)
+void TestRunner::setSmartInsertDeleteEnabled(bool flag)
{
UNUSED_PARAM(flag);
notImplemented();
}
-void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles)
+void TestRunner::setTabKeyCyclesThroughElements(bool cycles)
{
if (!mainFrame)
return;
@@ -281,51 +281,51 @@ void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles)
mainFrame->page()->setTabKeyCyclesThroughElements(cycles);
}
-void LayoutTestController::setUseDashboardCompatibilityMode(bool flag)
+void TestRunner::setUseDashboardCompatibilityMode(bool flag)
{
UNUSED_PARAM(flag);
notImplemented();
}
-void LayoutTestController::setUserStyleSheetEnabled(bool flag)
+void TestRunner::setUserStyleSheetEnabled(bool flag)
{
UNUSED_PARAM(flag);
notImplemented();
}
-void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
+void TestRunner::setUserStyleSheetLocation(JSStringRef path)
{
String pathStr = jsStringRefToWebCoreString(path);
BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setUserStyleSheetLocation(pathStr.utf8().data());
}
-void LayoutTestController::waitForPolicyDelegate()
+void TestRunner::waitForPolicyDelegate()
{
setWaitToDump(true);
waitForPolicy = true;
}
-size_t LayoutTestController::webHistoryItemCount()
+size_t TestRunner::webHistoryItemCount()
{
SharedArray<BlackBerry::WebKit::WebPage::BackForwardEntry> backForwardList;
BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->getBackForwardList(backForwardList);
return backForwardList.length();
}
-int LayoutTestController::windowCount()
+int TestRunner::windowCount()
{
notImplemented();
return 0;
}
-bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id)
+bool TestRunner::elementDoesAutoCompleteForElementWithId(JSStringRef id)
{
UNUSED_PARAM(id);
notImplemented();
return false;
}
-JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const
+JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const
{
UNUSED_PARAM(propertyName);
UNUSED_PARAM(pageNumber);
@@ -333,7 +333,7 @@ JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* property
return 0;
}
-void LayoutTestController::setWaitToDump(bool waitToDump)
+void TestRunner::setWaitToDump(bool waitToDump)
{
// Change from 30s to 35s because some test cases in multipart need 30 seconds,
// refer to http/tests/multipart/resources/multipart-wait-before-boundary.php please.
@@ -343,13 +343,13 @@ void LayoutTestController::setWaitToDump(bool waitToDump)
BlackBerry::WebKit::DumpRenderTree::currentInstance()->setWaitToDumpWatchdog(kWaitToDumpWatchdogInterval);
}
-void LayoutTestController::setWindowIsKey(bool windowIsKey)
+void TestRunner::setWindowIsKey(bool windowIsKey)
{
m_windowIsKey = windowIsKey;
notImplemented();
}
-bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
+bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
{
if (!mainFrame)
return false;
@@ -373,7 +373,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef anima
return animationController->pauseAnimationAtTime(node->renderer(), name.get(), time);
}
-bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
+bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
{
if (!mainFrame)
return false;
@@ -397,7 +397,7 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop
return animationController->pauseTransitionAtTime(node->renderer(), name.get(), time);
}
-unsigned LayoutTestController::numberOfActiveAnimations() const
+unsigned TestRunner::numberOfActiveAnimations() const
{
if (!mainFrame)
return false;
@@ -409,7 +409,7 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return animationController->numberOfActiveAnimations(mainFrame->document());
}
-unsigned int LayoutTestController::workerThreadCount() const
+unsigned int TestRunner::workerThreadCount() const
{
#if ENABLE_WORKERS
return WebCore::WorkerThread::workerThreadCount();
@@ -418,17 +418,17 @@ unsigned int LayoutTestController::workerThreadCount() const
#endif
}
-void LayoutTestController::removeAllVisitedLinks()
+void TestRunner::removeAllVisitedLinks()
{
notImplemented();
}
-void LayoutTestController::disableImageLoading()
+void TestRunner::disableImageLoading()
{
BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setLoadsImagesAutomatically(false);
}
-void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value)
+void TestRunner::overridePreference(JSStringRef key, JSStringRef value)
{
if (!mainFrame)
return;
@@ -446,41 +446,41 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value
mainFrame->page()->settings()->setHyperlinkAuditingEnabled(valueStr == "true" || valueStr == "1");
}
-void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
+void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
{
UNUSED_PARAM(alwaysAcceptCookies);
notImplemented();
}
-void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
+void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
{
DumpRenderTreeSupport::setMockGeolocationPosition(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page(), latitude, longitude, accuracy);
}
-void LayoutTestController::setMockGeolocationError(int code, JSStringRef message)
+void TestRunner::setMockGeolocationError(int code, JSStringRef message)
{
String messageStr = jsStringRefToWebCoreString(message);
DumpRenderTreeSupport::setMockGeolocationError(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page(), code, messageStr);
}
-void LayoutTestController::showWebInspector()
+void TestRunner::showWebInspector()
{
notImplemented();
}
-void LayoutTestController::closeWebInspector()
+void TestRunner::closeWebInspector()
{
notImplemented();
}
-void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script)
+void TestRunner::evaluateInWebInspector(long callId, JSStringRef script)
{
UNUSED_PARAM(callId);
UNUSED_PARAM(script);
notImplemented();
}
-void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
+void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
{
UNUSED_PARAM(worldID);
UNUSED_PARAM(globalObject);
@@ -488,7 +488,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned
notImplemented();
}
-void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
+void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
{
UNUSED_PARAM(worldID);
UNUSED_PARAM(globalObject);
@@ -496,7 +496,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObj
notImplemented();
}
-void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
+void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
{
UNUSED_PARAM(source);
UNUSED_PARAM(runAtStart);
@@ -504,55 +504,55 @@ void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bo
notImplemented();
}
-void LayoutTestController::addUserStyleSheet(JSStringRef, bool)
+void TestRunner::addUserStyleSheet(JSStringRef, bool)
{
notImplemented();
}
-JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int, int, int, int, int, int, int) const
+JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int, int, int, int, int, int, int) const
{
notImplemented();
return 0;
}
-int LayoutTestController::numberOfPages(float, float)
+int TestRunner::numberOfPages(float, float)
{
notImplemented();
return -1;
}
-void LayoutTestController::setScrollbarPolicy(JSStringRef, JSStringRef)
+void TestRunner::setScrollbarPolicy(JSStringRef, JSStringRef)
{
notImplemented();
}
-void LayoutTestController::setWebViewEditable(bool)
+void TestRunner::setWebViewEditable(bool)
{
notImplemented();
}
-void LayoutTestController::authenticateSession(JSStringRef url, JSStringRef username, JSStringRef password)
+void TestRunner::authenticateSession(JSStringRef url, JSStringRef username, JSStringRef password)
{
notImplemented();
}
-bool LayoutTestController::callShouldCloseOnWebView()
+bool TestRunner::callShouldCloseOnWebView()
{
notImplemented();
return false;
}
-void LayoutTestController::setFrameFlatteningEnabled(bool enable)
+void TestRunner::setFrameFlatteningEnabled(bool enable)
{
BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setFrameFlatteningEnabled(enable);
}
-void LayoutTestController::setSpatialNavigationEnabled(bool enable)
+void TestRunner::setSpatialNavigationEnabled(bool enable)
{
notImplemented();
}
-void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
{
WebCore::SecurityPolicy::addOriginAccessWhitelistEntry(*WebCore::SecurityOrigin::createFromString(jsStringRefToWebCoreString(sourceOrigin)),
jsStringRefToWebCoreString(destinationProtocol),
@@ -560,7 +560,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigi
allowDestinationSubdomains);
}
-void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
{
WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry(*WebCore::SecurityOrigin::createFromString(jsStringRefToWebCoreString(sourceOrigin)),
jsStringRefToWebCoreString(destinationProtocol),
@@ -568,7 +568,7 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOr
allowDestinationSubdomains);
}
-void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled)
+void TestRunner::setAllowFileAccessFromFileURLs(bool enabled)
{
if (!mainFrame)
return;
@@ -576,7 +576,7 @@ void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled)
mainFrame->page()->settings()->setAllowFileAccessFromFileURLs(enabled);
}
-void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
+void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled)
{
if (!mainFrame)
return;
@@ -584,33 +584,33 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
mainFrame->page()->settings()->setAllowUniversalAccessFromFileURLs(enabled);
}
-void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
+void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
{
notImplemented();
}
-void LayoutTestController::apiTestGoToCurrentBackForwardItem()
+void TestRunner::apiTestGoToCurrentBackForwardItem()
{
notImplemented();
}
-void LayoutTestController::setJavaScriptCanAccessClipboard(bool flag)
+void TestRunner::setJavaScriptCanAccessClipboard(bool flag)
{
BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->setJavaScriptCanAccessClipboard(flag);
}
-JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
+JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
{
return DumpRenderTreeSupport::computedStyleIncludingVisitedInfo(context, value);
}
-JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
+JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const
{
notImplemented();
return 0;
}
-JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
+JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
{
WebCore::Element* element = toElement(toJS(toJS(context), nodeObject));
if (!element)
@@ -620,102 +620,102 @@ JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRe
return markerText;
}
-void LayoutTestController::setPluginsEnabled(bool flag)
+void TestRunner::setPluginsEnabled(bool flag)
{
notImplemented();
}
-void LayoutTestController::abortModal()
+void TestRunner::abortModal()
{
notImplemented();
}
-void LayoutTestController::clearAllApplicationCaches()
+void TestRunner::clearAllApplicationCaches()
{
notImplemented();
}
-void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota)
+void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota)
{
notImplemented();
}
-void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
{
notImplemented();
}
-void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
+void TestRunner::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
{
notImplemented();
}
-void LayoutTestController::setGeolocationPermission(bool allow)
+void TestRunner::setGeolocationPermission(bool allow)
{
setGeolocationPermissionCommon(allow);
DumpRenderTreeSupport::setMockGeolocationPermission(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page(), allow);
}
-void LayoutTestController::setViewModeMediaFeature(const JSStringRef mode)
+void TestRunner::setViewModeMediaFeature(const JSStringRef mode)
{
notImplemented();
}
-void LayoutTestController::setSerializeHTTPLoads(bool)
+void TestRunner::setSerializeHTTPLoads(bool)
{
// FIXME: Implement if needed for https://bugs.webkit.org/show_bug.cgi?id=50758.
notImplemented();
}
-void LayoutTestController::setMinimumTimerInterval(double)
+void TestRunner::setMinimumTimerInterval(double)
{
notImplemented();
}
-void LayoutTestController::setTextDirection(JSStringRef)
+void TestRunner::setTextDirection(JSStringRef)
{
notImplemented();
}
-void LayoutTestController::goBack()
+void TestRunner::goBack()
{
// FIXME: implement to enable loader/navigation-while-deferring-loads.html
notImplemented();
}
-void LayoutTestController::setDefersLoading(bool)
+void TestRunner::setDefersLoading(bool)
{
// FIXME: implement to enable loader/navigation-while-deferring-loads.html
notImplemented();
}
-JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context)
+JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context)
{
notImplemented();
return JSValueMakeUndefined(context);
}
-void LayoutTestController::observeStorageTrackerNotifications(unsigned)
+void TestRunner::observeStorageTrackerNotifications(unsigned)
{
notImplemented();
}
-void LayoutTestController::syncLocalStorage()
+void TestRunner::syncLocalStorage()
{
notImplemented();
}
-void LayoutTestController::deleteAllLocalStorage()
+void TestRunner::deleteAllLocalStorage()
{
notImplemented();
}
-void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool)
+void TestRunner::setAsynchronousSpellCheckingEnabled(bool)
{
notImplemented();
}
-void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled)
+void TestRunner::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled)
{
JSC::ExecState* exec = toJS(context);
WebCore::Element* element = toElement(toJS(exec, nodeObject));
@@ -728,12 +728,12 @@ void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeOb
inputElement->setAutofilled(autofilled);
}
-int LayoutTestController::numberOfPendingGeolocationPermissionRequests()
+int TestRunner::numberOfPendingGeolocationPermissionRequests()
{
return DumpRenderTreeSupport::numberOfPendingGeolocationPermissionRequests(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page());
}
-bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray)
+bool TestRunner::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray)
{
WebCore::FindOptions options = 0;
@@ -774,12 +774,12 @@ bool LayoutTestController::findString(JSContextRef context, JSStringRef target,
!(options & WebCore::Backwards), !(options & WebCore::CaseInsensitive), true /* wrap */, true /* highlightAllMatches */);
}
-void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef URL)
+void TestRunner::deleteLocalStorageForOrigin(JSStringRef URL)
{
// FIXME: Implement.
}
-void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value)
+void TestRunner::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value)
{
JSC::ExecState* exec = toJS(context);
WebCore::Element* element = toElement(toJS(exec, nodeObject));
@@ -792,57 +792,57 @@ void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef node
inputElement->setValueForUser(jsStringRefToWebCoreString(value));
}
-long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef origin)
+long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef origin)
{
// FIXME: Implement to support getting disk usage by all application caches for an origin.
return 0;
}
-void LayoutTestController::addChromeInputField()
+void TestRunner::addChromeInputField()
{
}
-void LayoutTestController::removeChromeInputField()
+void TestRunner::removeChromeInputField()
{
}
-void LayoutTestController::focusWebView()
+void TestRunner::focusWebView()
{
}
-void LayoutTestController::setBackingScaleFactor(double)
+void TestRunner::setBackingScaleFactor(double)
{
}
-void LayoutTestController::setMockSpeechInputDumpRect(bool)
+void TestRunner::setMockSpeechInputDumpRect(bool)
{
}
-void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title)
+void TestRunner::simulateDesktopNotificationClick(JSStringRef title)
{
}
-void LayoutTestController::resetPageVisibility()
+void TestRunner::resetPageVisibility()
{
notImplemented();
}
-void LayoutTestController::setPageVisibility(const char*)
+void TestRunner::setPageVisibility(const char*)
{
notImplemented();
}
-void LayoutTestController::setAutomaticLinkDetectionEnabled(bool)
+void TestRunner::setAutomaticLinkDetectionEnabled(bool)
{
notImplemented();
}
-void LayoutTestController::sendWebIntentResponse(JSStringRef)
+void TestRunner::sendWebIntentResponse(JSStringRef)
{
notImplemented();
}
-void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)
+void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)
{
notImplemented();
}
diff --git a/Tools/DumpRenderTree/cg/ImageDiffCG.cpp b/Tools/DumpRenderTree/cg/ImageDiffCG.cpp
index db3543730..7fa5110bb 100644
--- a/Tools/DumpRenderTree/cg/ImageDiffCG.cpp
+++ b/Tools/DumpRenderTree/cg/ImageDiffCG.cpp
@@ -214,7 +214,7 @@ int main(int argc, const char* argv[])
else if (imageSize > 0 && !baselineImage)
baselineImage = createImageFromStdin(imageSize);
else
- fputs("error, image size must be specified.\n", stderr);
+ fputs("Error: image size must be specified.\n", stderr);
}
if (actualImage && baselineImage) {
@@ -229,9 +229,17 @@ int main(int argc, const char* argv[])
difference = roundf(difference * 100.0f) / 100.0f;
difference = max(difference, 0.01f); // round to 2 decimal places
}
- } else
- fputs("error, test and reference image have different properties.\n", stderr);
-
+ } else {
+ if (CGImageGetWidth(actualImage.get()) != CGImageGetWidth(baselineImage.get()) || CGImageGetHeight(actualImage.get()) != CGImageGetHeight(baselineImage.get()))
+ fprintf(stderr, "Error: test and reference images have different sizes. Test image is %lux%lu, reference image is %lux%lu\n",
+ CGImageGetWidth(actualImage.get()), CGImageGetHeight(actualImage.get()),
+ CGImageGetWidth(baselineImage.get()), CGImageGetHeight(baselineImage.get()));
+ else if (imageHasAlpha(actualImage.get()) != imageHasAlpha(baselineImage.get()))
+ fprintf(stderr, "Error: test and reference images differ in alpha. Test image %s alpha, reference image %s alpha.\n",
+ imageHasAlpha(actualImage.get()) ? "has" : "does not have",
+ imageHasAlpha(baselineImage.get()) ? "has" : "does not have");
+ }
+
if (difference > 0.0f) {
if (diffImage) {
RetainPtr<CFMutableDataRef> imageData(AdoptCF, CFDataCreateMutable(0, 0));
diff --git a/Tools/DumpRenderTree/chromium/LayoutTestController.cpp b/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp
index 046e1ec2d..bbc9f9bc6 100644
--- a/Tools/DumpRenderTree/chromium/LayoutTestController.cpp
+++ b/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp
@@ -30,7 +30,7 @@
*/
#include "config.h"
-#include "LayoutTestController.h"
+#include "DRTTestRunner.h"
#include "DRTDevToolsAgent.h"
#include "MockWebSpeechInputController.h"
@@ -94,7 +94,7 @@ public:
virtual void destroy() { }
};
-LayoutTestController::LayoutTestController(TestShell* shell)
+DRTTestRunner::DRTTestRunner(TestShell* shell)
: m_shell(shell)
, m_closeRemainingWindows(false)
, m_deferMainResourceDataLoad(false)
@@ -107,178 +107,178 @@ LayoutTestController::LayoutTestController(TestShell* shell)
// Initialize the map that associates methods of this class with the names
// they will use when called by JavaScript. The actual binding of those
// names to their methods will be done by calling bindToJavaScript() (defined
- // by CppBoundClass, the parent to LayoutTestController).
- bindMethod("addFileToPasteboardOnDrag", &LayoutTestController::addFileToPasteboardOnDrag);
+ // by CppBoundClass, the parent to DRTTestRunner).
+ bindMethod("addFileToPasteboardOnDrag", &DRTTestRunner::addFileToPasteboardOnDrag);
#if ENABLE(INPUT_SPEECH)
- bindMethod("addMockSpeechInputResult", &LayoutTestController::addMockSpeechInputResult);
- bindMethod("setMockSpeechInputDumpRect", &LayoutTestController::setMockSpeechInputDumpRect);
+ bindMethod("addMockSpeechInputResult", &DRTTestRunner::addMockSpeechInputResult);
+ bindMethod("setMockSpeechInputDumpRect", &DRTTestRunner::setMockSpeechInputDumpRect);
#endif
#if ENABLE(SCRIPTED_SPEECH)
- bindMethod("addMockSpeechRecognitionResult", &LayoutTestController::addMockSpeechRecognitionResult);
- bindMethod("setMockSpeechRecognitionError", &LayoutTestController::setMockSpeechRecognitionError);
- bindMethod("wasMockSpeechRecognitionAborted", &LayoutTestController::wasMockSpeechRecognitionAborted);
+ bindMethod("addMockSpeechRecognitionResult", &DRTTestRunner::addMockSpeechRecognitionResult);
+ bindMethod("setMockSpeechRecognitionError", &DRTTestRunner::setMockSpeechRecognitionError);
+ bindMethod("wasMockSpeechRecognitionAborted", &DRTTestRunner::wasMockSpeechRecognitionAborted);
#endif
- bindMethod("addOriginAccessWhitelistEntry", &LayoutTestController::addOriginAccessWhitelistEntry);
- bindMethod("addUserScript", &LayoutTestController::addUserScript);
- bindMethod("addUserStyleSheet", &LayoutTestController::addUserStyleSheet);
- bindMethod("clearAllDatabases", &LayoutTestController::clearAllDatabases);
- bindMethod("closeWebInspector", &LayoutTestController::closeWebInspector);
+ bindMethod("addOriginAccessWhitelistEntry", &DRTTestRunner::addOriginAccessWhitelistEntry);
+ bindMethod("addUserScript", &DRTTestRunner::addUserScript);
+ bindMethod("addUserStyleSheet", &DRTTestRunner::addUserStyleSheet);
+ bindMethod("clearAllDatabases", &DRTTestRunner::clearAllDatabases);
+ bindMethod("closeWebInspector", &DRTTestRunner::closeWebInspector);
#if ENABLE(POINTER_LOCK)
- bindMethod("didLosePointerLock", &LayoutTestController::didLosePointerLock);
+ bindMethod("didLosePointerLock", &DRTTestRunner::didLosePointerLock);
#endif
- bindMethod("disableAutoResizeMode", &LayoutTestController::disableAutoResizeMode);
- bindMethod("disableImageLoading", &LayoutTestController::disableImageLoading);
- bindMethod("display", &LayoutTestController::display);
- bindMethod("displayInvalidatedRegion", &LayoutTestController::displayInvalidatedRegion);
- bindMethod("dumpAsText", &LayoutTestController::dumpAsText);
- bindMethod("dumpBackForwardList", &LayoutTestController::dumpBackForwardList);
- bindMethod("dumpChildFramesAsText", &LayoutTestController::dumpChildFramesAsText);
- bindMethod("dumpChildFrameScrollPositions", &LayoutTestController::dumpChildFrameScrollPositions);
- bindMethod("dumpDatabaseCallbacks", &LayoutTestController::dumpDatabaseCallbacks);
- bindMethod("dumpEditingCallbacks", &LayoutTestController::dumpEditingCallbacks);
- bindMethod("dumpFrameLoadCallbacks", &LayoutTestController::dumpFrameLoadCallbacks);
- bindMethod("dumpProgressFinishedCallback", &LayoutTestController::dumpProgressFinishedCallback);
- bindMethod("dumpUserGestureInFrameLoadCallbacks", &LayoutTestController::dumpUserGestureInFrameLoadCallbacks);
- bindMethod("dumpResourceLoadCallbacks", &LayoutTestController::dumpResourceLoadCallbacks);
- bindMethod("dumpResourceResponseMIMETypes", &LayoutTestController::dumpResourceResponseMIMETypes);
- bindMethod("dumpSelectionRect", &LayoutTestController::dumpSelectionRect);
- bindMethod("dumpStatusCallbacks", &LayoutTestController::dumpWindowStatusChanges);
- bindMethod("dumpTitleChanges", &LayoutTestController::dumpTitleChanges);
- bindMethod("dumpPermissionClientCallbacks", &LayoutTestController::dumpPermissionClientCallbacks);
- bindMethod("dumpCreateView", &LayoutTestController::dumpCreateView);
- bindMethod("elementDoesAutoCompleteForElementWithId", &LayoutTestController::elementDoesAutoCompleteForElementWithId);
- bindMethod("enableAutoResizeMode", &LayoutTestController::enableAutoResizeMode);
- bindMethod("evaluateInWebInspector", &LayoutTestController::evaluateInWebInspector);
- bindMethod("evaluateScriptInIsolatedWorld", &LayoutTestController::evaluateScriptInIsolatedWorld);
- bindMethod("evaluateScriptInIsolatedWorldAndReturnValue", &LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue);
- bindMethod("setIsolatedWorldSecurityOrigin", &LayoutTestController::setIsolatedWorldSecurityOrigin);
- bindMethod("execCommand", &LayoutTestController::execCommand);
- bindMethod("forceRedSelectionColors", &LayoutTestController::forceRedSelectionColors);
+ bindMethod("disableAutoResizeMode", &DRTTestRunner::disableAutoResizeMode);
+ bindMethod("disableImageLoading", &DRTTestRunner::disableImageLoading);
+ bindMethod("display", &DRTTestRunner::display);
+ bindMethod("displayInvalidatedRegion", &DRTTestRunner::displayInvalidatedRegion);
+ bindMethod("dumpAsText", &DRTTestRunner::dumpAsText);
+ bindMethod("dumpBackForwardList", &DRTTestRunner::dumpBackForwardList);
+ bindMethod("dumpChildFramesAsText", &DRTTestRunner::dumpChildFramesAsText);
+ bindMethod("dumpChildFrameScrollPositions", &DRTTestRunner::dumpChildFrameScrollPositions);
+ bindMethod("dumpDatabaseCallbacks", &DRTTestRunner::dumpDatabaseCallbacks);
+ bindMethod("dumpEditingCallbacks", &DRTTestRunner::dumpEditingCallbacks);
+ bindMethod("dumpFrameLoadCallbacks", &DRTTestRunner::dumpFrameLoadCallbacks);
+ bindMethod("dumpProgressFinishedCallback", &DRTTestRunner::dumpProgressFinishedCallback);
+ bindMethod("dumpUserGestureInFrameLoadCallbacks", &DRTTestRunner::dumpUserGestureInFrameLoadCallbacks);
+ bindMethod("dumpResourceLoadCallbacks", &DRTTestRunner::dumpResourceLoadCallbacks);
+ bindMethod("dumpResourceResponseMIMETypes", &DRTTestRunner::dumpResourceResponseMIMETypes);
+ bindMethod("dumpSelectionRect", &DRTTestRunner::dumpSelectionRect);
+ bindMethod("dumpStatusCallbacks", &DRTTestRunner::dumpWindowStatusChanges);
+ bindMethod("dumpTitleChanges", &DRTTestRunner::dumpTitleChanges);
+ bindMethod("dumpPermissionClientCallbacks", &DRTTestRunner::dumpPermissionClientCallbacks);
+ bindMethod("dumpCreateView", &DRTTestRunner::dumpCreateView);
+ bindMethod("elementDoesAutoCompleteForElementWithId", &DRTTestRunner::elementDoesAutoCompleteForElementWithId);
+ bindMethod("enableAutoResizeMode", &DRTTestRunner::enableAutoResizeMode);
+ bindMethod("evaluateInWebInspector", &DRTTestRunner::evaluateInWebInspector);
+ bindMethod("evaluateScriptInIsolatedWorld", &DRTTestRunner::evaluateScriptInIsolatedWorld);
+ bindMethod("evaluateScriptInIsolatedWorldAndReturnValue", &DRTTestRunner::evaluateScriptInIsolatedWorldAndReturnValue);
+ bindMethod("setIsolatedWorldSecurityOrigin", &DRTTestRunner::setIsolatedWorldSecurityOrigin);
+ bindMethod("execCommand", &DRTTestRunner::execCommand);
+ bindMethod("forceRedSelectionColors", &DRTTestRunner::forceRedSelectionColors);
#if ENABLE(NOTIFICATIONS)
- bindMethod("grantDesktopNotificationPermission", &LayoutTestController::grantDesktopNotificationPermission);
+ bindMethod("grantDesktopNotificationPermission", &DRTTestRunner::grantDesktopNotificationPermission);
#endif
- bindMethod("findString", &LayoutTestController::findString);
- bindMethod("isCommandEnabled", &LayoutTestController::isCommandEnabled);
- bindMethod("hasCustomPageSizeStyle", &LayoutTestController::hasCustomPageSizeStyle);
- bindMethod("layerTreeAsText", &LayoutTestController::layerTreeAsText);
- bindMethod("loseCompositorContext", &LayoutTestController::loseCompositorContext);
- bindMethod("markerTextForListItem", &LayoutTestController::markerTextForListItem);
- bindMethod("notifyDone", &LayoutTestController::notifyDone);
- bindMethod("numberOfActiveAnimations", &LayoutTestController::numberOfActiveAnimations);
- bindMethod("numberOfPages", &LayoutTestController::numberOfPages);
- bindMethod("numberOfPendingGeolocationPermissionRequests", &LayoutTestController:: numberOfPendingGeolocationPermissionRequests);
- bindMethod("objCIdentityIsEqual", &LayoutTestController::objCIdentityIsEqual);
- bindMethod("overridePreference", &LayoutTestController::overridePreference);
- bindMethod("pageProperty", &LayoutTestController::pageProperty);
- bindMethod("pageSizeAndMarginsInPixels", &LayoutTestController::pageSizeAndMarginsInPixels);
- bindMethod("pathToLocalResource", &LayoutTestController::pathToLocalResource);
- bindMethod("pauseAnimationAtTimeOnElementWithId", &LayoutTestController::pauseAnimationAtTimeOnElementWithId);
- bindMethod("pauseTransitionAtTimeOnElementWithId", &LayoutTestController::pauseTransitionAtTimeOnElementWithId);
- bindMethod("queueBackNavigation", &LayoutTestController::queueBackNavigation);
- bindMethod("queueForwardNavigation", &LayoutTestController::queueForwardNavigation);
- bindMethod("queueLoadingScript", &LayoutTestController::queueLoadingScript);
- bindMethod("queueLoad", &LayoutTestController::queueLoad);
- bindMethod("queueLoadHTMLString", &LayoutTestController::queueLoadHTMLString);
- bindMethod("queueNonLoadingScript", &LayoutTestController::queueNonLoadingScript);
- bindMethod("queueReload", &LayoutTestController::queueReload);
- bindMethod("removeOriginAccessWhitelistEntry", &LayoutTestController::removeOriginAccessWhitelistEntry);
- bindMethod("repaintSweepHorizontally", &LayoutTestController::repaintSweepHorizontally);
- bindMethod("resetPageVisibility", &LayoutTestController::resetPageVisibility);
- bindMethod("setAcceptsEditing", &LayoutTestController::setAcceptsEditing);
- bindMethod("setAllowDisplayOfInsecureContent", &LayoutTestController::setAllowDisplayOfInsecureContent);
- bindMethod("setAllowFileAccessFromFileURLs", &LayoutTestController::setAllowFileAccessFromFileURLs);
- bindMethod("setAllowRunningOfInsecureContent", &LayoutTestController::setAllowRunningOfInsecureContent);
- bindMethod("setAllowUniversalAccessFromFileURLs", &LayoutTestController::setAllowUniversalAccessFromFileURLs);
- bindMethod("setAlwaysAcceptCookies", &LayoutTestController::setAlwaysAcceptCookies);
- bindMethod("setAuthorAndUserStylesEnabled", &LayoutTestController::setAuthorAndUserStylesEnabled);
- bindMethod("setAutofilled", &LayoutTestController::setAutofilled);
- bindMethod("setCanOpenWindows", &LayoutTestController::setCanOpenWindows);
- bindMethod("setCloseRemainingWindowsWhenComplete", &LayoutTestController::setCloseRemainingWindowsWhenComplete);
- bindMethod("setCustomPolicyDelegate", &LayoutTestController::setCustomPolicyDelegate);
- bindMethod("setDatabaseQuota", &LayoutTestController::setDatabaseQuota);
- bindMethod("setDeferMainResourceDataLoad", &LayoutTestController::setDeferMainResourceDataLoad);
- bindMethod("setDomainRelaxationForbiddenForURLScheme", &LayoutTestController::setDomainRelaxationForbiddenForURLScheme);
- bindMethod("setAudioData", &LayoutTestController::setAudioData);
- bindMethod("setGeolocationPermission", &LayoutTestController::setGeolocationPermission);
- bindMethod("setIconDatabaseEnabled", &LayoutTestController::setIconDatabaseEnabled);
- bindMethod("setJavaScriptCanAccessClipboard", &LayoutTestController::setJavaScriptCanAccessClipboard);
- bindMethod("setMinimumTimerInterval", &LayoutTestController::setMinimumTimerInterval);
- bindMethod("setMockDeviceOrientation", &LayoutTestController::setMockDeviceOrientation);
- bindMethod("setMockGeolocationError", &LayoutTestController::setMockGeolocationError);
- bindMethod("setMockGeolocationPosition", &LayoutTestController::setMockGeolocationPosition);
- bindMethod("setPageVisibility", &LayoutTestController::setPageVisibility);
- bindMethod("setPluginsEnabled", &LayoutTestController::setPluginsEnabled);
+ bindMethod("findString", &DRTTestRunner::findString);
+ bindMethod("isCommandEnabled", &DRTTestRunner::isCommandEnabled);
+ bindMethod("hasCustomPageSizeStyle", &DRTTestRunner::hasCustomPageSizeStyle);
+ bindMethod("layerTreeAsText", &DRTTestRunner::layerTreeAsText);
+ bindMethod("loseCompositorContext", &DRTTestRunner::loseCompositorContext);
+ bindMethod("markerTextForListItem", &DRTTestRunner::markerTextForListItem);
+ bindMethod("notifyDone", &DRTTestRunner::notifyDone);
+ bindMethod("numberOfActiveAnimations", &DRTTestRunner::numberOfActiveAnimations);
+ bindMethod("numberOfPages", &DRTTestRunner::numberOfPages);
+ bindMethod("numberOfPendingGeolocationPermissionRequests", &DRTTestRunner:: numberOfPendingGeolocationPermissionRequests);
+ bindMethod("objCIdentityIsEqual", &DRTTestRunner::objCIdentityIsEqual);
+ bindMethod("overridePreference", &DRTTestRunner::overridePreference);
+ bindMethod("pageProperty", &DRTTestRunner::pageProperty);
+ bindMethod("pageSizeAndMarginsInPixels", &DRTTestRunner::pageSizeAndMarginsInPixels);
+ bindMethod("pathToLocalResource", &DRTTestRunner::pathToLocalResource);
+ bindMethod("pauseAnimationAtTimeOnElementWithId", &DRTTestRunner::pauseAnimationAtTimeOnElementWithId);
+ bindMethod("pauseTransitionAtTimeOnElementWithId", &DRTTestRunner::pauseTransitionAtTimeOnElementWithId);
+ bindMethod("queueBackNavigation", &DRTTestRunner::queueBackNavigation);
+ bindMethod("queueForwardNavigation", &DRTTestRunner::queueForwardNavigation);
+ bindMethod("queueLoadingScript", &DRTTestRunner::queueLoadingScript);
+ bindMethod("queueLoad", &DRTTestRunner::queueLoad);
+ bindMethod("queueLoadHTMLString", &DRTTestRunner::queueLoadHTMLString);
+ bindMethod("queueNonLoadingScript", &DRTTestRunner::queueNonLoadingScript);
+ bindMethod("queueReload", &DRTTestRunner::queueReload);
+ bindMethod("removeOriginAccessWhitelistEntry", &DRTTestRunner::removeOriginAccessWhitelistEntry);
+ bindMethod("repaintSweepHorizontally", &DRTTestRunner::repaintSweepHorizontally);
+ bindMethod("resetPageVisibility", &DRTTestRunner::resetPageVisibility);
+ bindMethod("setAcceptsEditing", &DRTTestRunner::setAcceptsEditing);
+ bindMethod("setAllowDisplayOfInsecureContent", &DRTTestRunner::setAllowDisplayOfInsecureContent);
+ bindMethod("setAllowFileAccessFromFileURLs", &DRTTestRunner::setAllowFileAccessFromFileURLs);
+ bindMethod("setAllowRunningOfInsecureContent", &DRTTestRunner::setAllowRunningOfInsecureContent);
+ bindMethod("setAllowUniversalAccessFromFileURLs", &DRTTestRunner::setAllowUniversalAccessFromFileURLs);
+ bindMethod("setAlwaysAcceptCookies", &DRTTestRunner::setAlwaysAcceptCookies);
+ bindMethod("setAuthorAndUserStylesEnabled", &DRTTestRunner::setAuthorAndUserStylesEnabled);
+ bindMethod("setAutofilled", &DRTTestRunner::setAutofilled);
+ bindMethod("setCanOpenWindows", &DRTTestRunner::setCanOpenWindows);
+ bindMethod("setCloseRemainingWindowsWhenComplete", &DRTTestRunner::setCloseRemainingWindowsWhenComplete);
+ bindMethod("setCustomPolicyDelegate", &DRTTestRunner::setCustomPolicyDelegate);
+ bindMethod("setDatabaseQuota", &DRTTestRunner::setDatabaseQuota);
+ bindMethod("setDeferMainResourceDataLoad", &DRTTestRunner::setDeferMainResourceDataLoad);
+ bindMethod("setDomainRelaxationForbiddenForURLScheme", &DRTTestRunner::setDomainRelaxationForbiddenForURLScheme);
+ bindMethod("setAudioData", &DRTTestRunner::setAudioData);
+ bindMethod("setGeolocationPermission", &DRTTestRunner::setGeolocationPermission);
+ bindMethod("setIconDatabaseEnabled", &DRTTestRunner::setIconDatabaseEnabled);
+ bindMethod("setJavaScriptCanAccessClipboard", &DRTTestRunner::setJavaScriptCanAccessClipboard);
+ bindMethod("setMinimumTimerInterval", &DRTTestRunner::setMinimumTimerInterval);
+ bindMethod("setMockDeviceOrientation", &DRTTestRunner::setMockDeviceOrientation);
+ bindMethod("setMockGeolocationError", &DRTTestRunner::setMockGeolocationError);
+ bindMethod("setMockGeolocationPosition", &DRTTestRunner::setMockGeolocationPosition);
+ bindMethod("setPageVisibility", &DRTTestRunner::setPageVisibility);
+ bindMethod("setPluginsEnabled", &DRTTestRunner::setPluginsEnabled);
#if ENABLE(POINTER_LOCK)
- bindMethod("setPointerLockWillFailAsynchronously", &LayoutTestController::setPointerLockWillFailAsynchronously);
- bindMethod("setPointerLockWillFailSynchronously", &LayoutTestController::setPointerLockWillFailSynchronously);
+ bindMethod("setPointerLockWillFailAsynchronously", &DRTTestRunner::setPointerLockWillFailAsynchronously);
+ bindMethod("setPointerLockWillFailSynchronously", &DRTTestRunner::setPointerLockWillFailSynchronously);
#endif
- bindMethod("setPopupBlockingEnabled", &LayoutTestController::setPopupBlockingEnabled);
- bindMethod("setPOSIXLocale", &LayoutTestController::setPOSIXLocale);
- bindMethod("setPrinting", &LayoutTestController::setPrinting);
- bindMethod("setScrollbarPolicy", &LayoutTestController::setScrollbarPolicy);
- bindMethod("setSelectTrailingWhitespaceEnabled", &LayoutTestController::setSelectTrailingWhitespaceEnabled);
- bindMethod("setTextSubpixelPositioning", &LayoutTestController::setTextSubpixelPositioning);
- bindMethod("setBackingScaleFactor", &LayoutTestController::setBackingScaleFactor);
- bindMethod("setSmartInsertDeleteEnabled", &LayoutTestController::setSmartInsertDeleteEnabled);
- bindMethod("setStopProvisionalFrameLoads", &LayoutTestController::setStopProvisionalFrameLoads);
- bindMethod("setTabKeyCyclesThroughElements", &LayoutTestController::setTabKeyCyclesThroughElements);
- bindMethod("setUserStyleSheetEnabled", &LayoutTestController::setUserStyleSheetEnabled);
- bindMethod("setUserStyleSheetLocation", &LayoutTestController::setUserStyleSheetLocation);
- bindMethod("setValueForUser", &LayoutTestController::setValueForUser);
- bindMethod("setWillSendRequestClearHeader", &LayoutTestController::setWillSendRequestClearHeader);
- bindMethod("setWillSendRequestReturnsNull", &LayoutTestController::setWillSendRequestReturnsNull);
- bindMethod("setWillSendRequestReturnsNullOnRedirect", &LayoutTestController::setWillSendRequestReturnsNullOnRedirect);
- bindMethod("setWindowIsKey", &LayoutTestController::setWindowIsKey);
- bindMethod("setXSSAuditorEnabled", &LayoutTestController::setXSSAuditorEnabled);
- bindMethod("setAsynchronousSpellCheckingEnabled", &LayoutTestController::setAsynchronousSpellCheckingEnabled);
- bindMethod("showWebInspector", &LayoutTestController::showWebInspector);
+ bindMethod("setPopupBlockingEnabled", &DRTTestRunner::setPopupBlockingEnabled);
+ bindMethod("setPOSIXLocale", &DRTTestRunner::setPOSIXLocale);
+ bindMethod("setPrinting", &DRTTestRunner::setPrinting);
+ bindMethod("setScrollbarPolicy", &DRTTestRunner::setScrollbarPolicy);
+ bindMethod("setSelectTrailingWhitespaceEnabled", &DRTTestRunner::setSelectTrailingWhitespaceEnabled);
+ bindMethod("setTextSubpixelPositioning", &DRTTestRunner::setTextSubpixelPositioning);
+ bindMethod("setBackingScaleFactor", &DRTTestRunner::setBackingScaleFactor);
+ bindMethod("setSmartInsertDeleteEnabled", &DRTTestRunner::setSmartInsertDeleteEnabled);
+ bindMethod("setStopProvisionalFrameLoads", &DRTTestRunner::setStopProvisionalFrameLoads);
+ bindMethod("setTabKeyCyclesThroughElements", &DRTTestRunner::setTabKeyCyclesThroughElements);
+ bindMethod("setUserStyleSheetEnabled", &DRTTestRunner::setUserStyleSheetEnabled);
+ bindMethod("setUserStyleSheetLocation", &DRTTestRunner::setUserStyleSheetLocation);
+ bindMethod("setValueForUser", &DRTTestRunner::setValueForUser);
+ bindMethod("setWillSendRequestClearHeader", &DRTTestRunner::setWillSendRequestClearHeader);
+ bindMethod("setWillSendRequestReturnsNull", &DRTTestRunner::setWillSendRequestReturnsNull);
+ bindMethod("setWillSendRequestReturnsNullOnRedirect", &DRTTestRunner::setWillSendRequestReturnsNullOnRedirect);
+ bindMethod("setWindowIsKey", &DRTTestRunner::setWindowIsKey);
+ bindMethod("setXSSAuditorEnabled", &DRTTestRunner::setXSSAuditorEnabled);
+ bindMethod("setAsynchronousSpellCheckingEnabled", &DRTTestRunner::setAsynchronousSpellCheckingEnabled);
+ bindMethod("showWebInspector", &DRTTestRunner::showWebInspector);
#if ENABLE(NOTIFICATIONS)
- bindMethod("simulateDesktopNotificationClick", &LayoutTestController::simulateDesktopNotificationClick);
+ bindMethod("simulateDesktopNotificationClick", &DRTTestRunner::simulateDesktopNotificationClick);
#endif
- bindMethod("startSpeechInput", &LayoutTestController::startSpeechInput);
- bindMethod("testRepaint", &LayoutTestController::testRepaint);
- bindMethod("waitForPolicyDelegate", &LayoutTestController::waitForPolicyDelegate);
- bindMethod("waitUntilDone", &LayoutTestController::waitUntilDone);
- bindMethod("windowCount", &LayoutTestController::windowCount);
- bindMethod("setTextDirection", &LayoutTestController::setTextDirection);
- bindMethod("setImagesAllowed", &LayoutTestController::setImagesAllowed);
- bindMethod("setScriptsAllowed", &LayoutTestController::setScriptsAllowed);
- bindMethod("setStorageAllowed", &LayoutTestController::setStorageAllowed);
- bindMethod("setPluginsAllowed", &LayoutTestController::setPluginsAllowed);
+ bindMethod("startSpeechInput", &DRTTestRunner::startSpeechInput);
+ bindMethod("testRepaint", &DRTTestRunner::testRepaint);
+ bindMethod("waitForPolicyDelegate", &DRTTestRunner::waitForPolicyDelegate);
+ bindMethod("waitUntilDone", &DRTTestRunner::waitUntilDone);
+ bindMethod("windowCount", &DRTTestRunner::windowCount);
+ bindMethod("setTextDirection", &DRTTestRunner::setTextDirection);
+ bindMethod("setImagesAllowed", &DRTTestRunner::setImagesAllowed);
+ bindMethod("setScriptsAllowed", &DRTTestRunner::setScriptsAllowed);
+ bindMethod("setStorageAllowed", &DRTTestRunner::setStorageAllowed);
+ bindMethod("setPluginsAllowed", &DRTTestRunner::setPluginsAllowed);
// The following are stubs.
- bindMethod("abortModal", &LayoutTestController::abortModal);
- bindMethod("accessStoredWebScriptObject", &LayoutTestController::accessStoredWebScriptObject);
- bindMethod("addDisallowedURL", &LayoutTestController::addDisallowedURL);
- bindMethod("applicationCacheDiskUsageForOrigin", &LayoutTestController::applicationCacheDiskUsageForOrigin);
- bindMethod("callShouldCloseOnWebView", &LayoutTestController::callShouldCloseOnWebView);
- bindMethod("clearAllApplicationCaches", &LayoutTestController::clearAllApplicationCaches);
- bindMethod("clearApplicationCacheForOrigin", &LayoutTestController::clearApplicationCacheForOrigin);
- bindMethod("clearBackForwardList", &LayoutTestController::clearBackForwardList);
- bindMethod("dumpAsWebArchive", &LayoutTestController::dumpAsWebArchive);
- bindMethod("keepWebHistory", &LayoutTestController::keepWebHistory);
- bindMethod("objCClassNameOf", &LayoutTestController::objCClassNameOf);
- bindMethod("setApplicationCacheOriginQuota", &LayoutTestController::setApplicationCacheOriginQuota);
- bindMethod("setCallCloseOnWebViews", &LayoutTestController::setCallCloseOnWebViews);
- bindMethod("setMainFrameIsFirstResponder", &LayoutTestController::setMainFrameIsFirstResponder);
- bindMethod("setPrivateBrowsingEnabled", &LayoutTestController::setPrivateBrowsingEnabled);
- bindMethod("setUseDashboardCompatibilityMode", &LayoutTestController::setUseDashboardCompatibilityMode);
- bindMethod("storeWebScriptObject", &LayoutTestController::storeWebScriptObject);
- bindMethod("deleteAllLocalStorage", &LayoutTestController::deleteAllLocalStorage);
- bindMethod("localStorageDiskUsageForOrigin", &LayoutTestController::localStorageDiskUsageForOrigin);
- bindMethod("originsWithLocalStorage", &LayoutTestController::originsWithLocalStorage);
- bindMethod("deleteLocalStorageForOrigin", &LayoutTestController::deleteLocalStorageForOrigin);
- bindMethod("observeStorageTrackerNotifications", &LayoutTestController::observeStorageTrackerNotifications);
- bindMethod("syncLocalStorage", &LayoutTestController::syncLocalStorage);
- bindMethod("setShouldStayOnPageAfterHandlingBeforeUnload", &LayoutTestController::setShouldStayOnPageAfterHandlingBeforeUnload);
- bindMethod("enableFixedLayoutMode", &LayoutTestController::enableFixedLayoutMode);
- bindMethod("setFixedLayoutSize", &LayoutTestController::setFixedLayoutSize);
- bindMethod("selectionAsMarkup", &LayoutTestController::selectionAsMarkup);
- bindMethod("setHasCustomFullScreenBehavior", &LayoutTestController::setHasCustomFullScreenBehavior);
- bindMethod("textSurroundingNode", &LayoutTestController::textSurroundingNode);
+ bindMethod("abortModal", &DRTTestRunner::abortModal);
+ bindMethod("accessStoredWebScriptObject", &DRTTestRunner::accessStoredWebScriptObject);
+ bindMethod("addDisallowedURL", &DRTTestRunner::addDisallowedURL);
+ bindMethod("applicationCacheDiskUsageForOrigin", &DRTTestRunner::applicationCacheDiskUsageForOrigin);
+ bindMethod("callShouldCloseOnWebView", &DRTTestRunner::callShouldCloseOnWebView);
+ bindMethod("clearAllApplicationCaches", &DRTTestRunner::clearAllApplicationCaches);
+ bindMethod("clearApplicationCacheForOrigin", &DRTTestRunner::clearApplicationCacheForOrigin);
+ bindMethod("clearBackForwardList", &DRTTestRunner::clearBackForwardList);
+ bindMethod("dumpAsWebArchive", &DRTTestRunner::dumpAsWebArchive);
+ bindMethod("keepWebHistory", &DRTTestRunner::keepWebHistory);
+ bindMethod("objCClassNameOf", &DRTTestRunner::objCClassNameOf);
+ bindMethod("setApplicationCacheOriginQuota", &DRTTestRunner::setApplicationCacheOriginQuota);
+ bindMethod("setCallCloseOnWebViews", &DRTTestRunner::setCallCloseOnWebViews);
+ bindMethod("setMainFrameIsFirstResponder", &DRTTestRunner::setMainFrameIsFirstResponder);
+ bindMethod("setPrivateBrowsingEnabled", &DRTTestRunner::setPrivateBrowsingEnabled);
+ bindMethod("setUseDashboardCompatibilityMode", &DRTTestRunner::setUseDashboardCompatibilityMode);
+ bindMethod("storeWebScriptObject", &DRTTestRunner::storeWebScriptObject);
+ bindMethod("deleteAllLocalStorage", &DRTTestRunner::deleteAllLocalStorage);
+ bindMethod("localStorageDiskUsageForOrigin", &DRTTestRunner::localStorageDiskUsageForOrigin);
+ bindMethod("originsWithLocalStorage", &DRTTestRunner::originsWithLocalStorage);
+ bindMethod("deleteLocalStorageForOrigin", &DRTTestRunner::deleteLocalStorageForOrigin);
+ bindMethod("observeStorageTrackerNotifications", &DRTTestRunner::observeStorageTrackerNotifications);
+ bindMethod("syncLocalStorage", &DRTTestRunner::syncLocalStorage);
+ bindMethod("setShouldStayOnPageAfterHandlingBeforeUnload", &DRTTestRunner::setShouldStayOnPageAfterHandlingBeforeUnload);
+ bindMethod("enableFixedLayoutMode", &DRTTestRunner::enableFixedLayoutMode);
+ bindMethod("setFixedLayoutSize", &DRTTestRunner::setFixedLayoutSize);
+ bindMethod("selectionAsMarkup", &DRTTestRunner::selectionAsMarkup);
+ bindMethod("setHasCustomFullScreenBehavior", &DRTTestRunner::setHasCustomFullScreenBehavior);
+ bindMethod("textSurroundingNode", &DRTTestRunner::textSurroundingNode);
// The fallback method is called when an unknown method is invoked.
- bindFallbackMethod(&LayoutTestController::fallbackMethod);
+ bindFallbackMethod(&DRTTestRunner::fallbackMethod);
// Shared properties.
// globalFlag is used by a number of layout tests in
@@ -289,21 +289,21 @@ LayoutTestController::LayoutTestController(TestShell* shell)
bindProperty("titleTextDirection", &m_titleTextDirection);
bindProperty("platformName", &m_platformName);
bindProperty("interceptPostMessage", &m_interceptPostMessage);
- bindProperty("workerThreadCount", &LayoutTestController::workerThreadCount);
- bindMethod("sendWebIntentResponse", &LayoutTestController::sendWebIntentResponse);
- bindMethod("deliverWebIntent", &LayoutTestController::deliverWebIntent);
+ bindProperty("workerThreadCount", &DRTTestRunner::workerThreadCount);
+ bindMethod("sendWebIntentResponse", &DRTTestRunner::sendWebIntentResponse);
+ bindMethod("deliverWebIntent", &DRTTestRunner::deliverWebIntent);
}
-LayoutTestController::~LayoutTestController()
+DRTTestRunner::~DRTTestRunner()
{
}
-LayoutTestController::WorkQueue::~WorkQueue()
+DRTTestRunner::WorkQueue::~WorkQueue()
{
reset();
}
-void LayoutTestController::WorkQueue::processWorkSoon()
+void DRTTestRunner::WorkQueue::processWorkSoon()
{
if (m_controller->m_shell->webViewHost()->topLoadingFrame())
return;
@@ -315,7 +315,7 @@ void LayoutTestController::WorkQueue::processWorkSoon()
m_controller->m_shell->testFinished();
}
-void LayoutTestController::WorkQueue::processWork()
+void DRTTestRunner::WorkQueue::processWork()
{
TestShell* shell = m_controller->m_shell;
// Quit doing work once a load is in progress.
@@ -330,14 +330,14 @@ void LayoutTestController::WorkQueue::processWork()
shell->testFinished();
}
-void LayoutTestController::WorkQueue::reset()
+void DRTTestRunner::WorkQueue::reset()
{
m_frozen = false;
while (!m_queue.isEmpty())
delete m_queue.takeFirst();
}
-void LayoutTestController::WorkQueue::addWork(WorkItem* work)
+void DRTTestRunner::WorkQueue::addWork(WorkItem* work)
{
if (m_frozen) {
delete work;
@@ -346,7 +346,7 @@ void LayoutTestController::WorkQueue::addWork(WorkItem* work)
m_queue.append(work);
}
-void LayoutTestController::dumpAsText(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::dumpAsText(const CppArgumentList& arguments, CppVariant* result)
{
m_dumpAsText = true;
m_generatePixelResults = false;
@@ -358,98 +358,98 @@ void LayoutTestController::dumpAsText(const CppArgumentList& arguments, CppVaria
result->setNull();
}
-void LayoutTestController::dumpDatabaseCallbacks(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::dumpDatabaseCallbacks(const CppArgumentList&, CppVariant* result)
{
// Do nothing; we don't use this flag anywhere for now
result->setNull();
}
-void LayoutTestController::dumpEditingCallbacks(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::dumpEditingCallbacks(const CppArgumentList&, CppVariant* result)
{
m_dumpEditingCallbacks = true;
result->setNull();
}
-void LayoutTestController::dumpBackForwardList(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::dumpBackForwardList(const CppArgumentList&, CppVariant* result)
{
m_dumpBackForwardList = true;
result->setNull();
}
-void LayoutTestController::dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant* result)
{
m_dumpFrameLoadCallbacks = true;
result->setNull();
}
-void LayoutTestController::dumpProgressFinishedCallback(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::dumpProgressFinishedCallback(const CppArgumentList&, CppVariant* result)
{
m_dumpProgressFinishedCallback = true;
result->setNull();
}
-void LayoutTestController::dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant* result)
{
m_dumpUserGestureInFrameLoadCallbacks = true;
result->setNull();
}
-void LayoutTestController::dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant* result)
{
m_dumpResourceLoadCallbacks = true;
result->setNull();
}
-void LayoutTestController::dumpResourceResponseMIMETypes(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::dumpResourceResponseMIMETypes(const CppArgumentList&, CppVariant* result)
{
m_dumpResourceResponseMIMETypes = true;
result->setNull();
}
-void LayoutTestController::dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant* result)
{
m_dumpChildFrameScrollPositions = true;
result->setNull();
}
-void LayoutTestController::dumpChildFramesAsText(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::dumpChildFramesAsText(const CppArgumentList&, CppVariant* result)
{
m_dumpChildFramesAsText = true;
result->setNull();
}
-void LayoutTestController::dumpWindowStatusChanges(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::dumpWindowStatusChanges(const CppArgumentList&, CppVariant* result)
{
m_dumpWindowStatusChanges = true;
result->setNull();
}
-void LayoutTestController::dumpTitleChanges(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::dumpTitleChanges(const CppArgumentList&, CppVariant* result)
{
m_dumpTitleChanges = true;
result->setNull();
}
-void LayoutTestController::dumpPermissionClientCallbacks(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::dumpPermissionClientCallbacks(const CppArgumentList&, CppVariant* result)
{
m_dumpPermissionClientCallbacks = true;
result->setNull();
}
-void LayoutTestController::dumpCreateView(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::dumpCreateView(const CppArgumentList&, CppVariant* result)
{
m_dumpCreateView = true;
result->setNull();
}
-void LayoutTestController::setAcceptsEditing(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setAcceptsEditing(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool())
m_acceptsEditing = arguments[0].value.boolValue;
result->setNull();
}
-void LayoutTestController::waitUntilDone(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::waitUntilDone(const CppArgumentList&, CppVariant* result)
{
if (!webkit_support::BeingDebugged())
postDelayedTask(new NotifyDoneTimedOutTask(this), m_shell->layoutTestTimeout());
@@ -457,7 +457,7 @@ void LayoutTestController::waitUntilDone(const CppArgumentList&, CppVariant* res
result->setNull();
}
-void LayoutTestController::notifyDone(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::notifyDone(const CppArgumentList&, CppVariant* result)
{
// Test didn't timeout. Kill the timeout timer.
m_taskList.revokeAll();
@@ -466,7 +466,7 @@ void LayoutTestController::notifyDone(const CppArgumentList&, CppVariant* result
result->setNull();
}
-void LayoutTestController::completeNotifyDone(bool isTimeout)
+void DRTTestRunner::completeNotifyDone(bool isTimeout)
{
if (m_waitUntilDone && !m_shell->webViewHost()->topLoadingFrame() && m_workQueue.isEmpty()) {
if (isTimeout)
@@ -477,7 +477,7 @@ void LayoutTestController::completeNotifyDone(bool isTimeout)
m_waitUntilDone = false;
}
-class WorkItemBackForward : public LayoutTestController::WorkItem {
+class WorkItemBackForward : public DRTTestRunner::WorkItem {
public:
WorkItemBackForward(int distance) : m_distance(distance) { }
bool run(TestShell* shell)
@@ -490,21 +490,21 @@ private:
int m_distance;
};
-void LayoutTestController::queueBackNavigation(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::queueBackNavigation(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isNumber())
m_workQueue.addWork(new WorkItemBackForward(-arguments[0].toInt32()));
result->setNull();
}
-void LayoutTestController::queueForwardNavigation(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::queueForwardNavigation(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isNumber())
m_workQueue.addWork(new WorkItemBackForward(arguments[0].toInt32()));
result->setNull();
}
-class WorkItemReload : public LayoutTestController::WorkItem {
+class WorkItemReload : public DRTTestRunner::WorkItem {
public:
bool run(TestShell* shell)
{
@@ -513,13 +513,13 @@ public:
}
};
-void LayoutTestController::queueReload(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::queueReload(const CppArgumentList&, CppVariant* result)
{
m_workQueue.addWork(new WorkItemReload);
result->setNull();
}
-class WorkItemLoadingScript : public LayoutTestController::WorkItem {
+class WorkItemLoadingScript : public DRTTestRunner::WorkItem {
public:
WorkItemLoadingScript(const string& script) : m_script(script) { }
bool run(TestShell* shell)
@@ -532,7 +532,7 @@ private:
string m_script;
};
-class WorkItemNonLoadingScript : public LayoutTestController::WorkItem {
+class WorkItemNonLoadingScript : public DRTTestRunner::WorkItem {
public:
WorkItemNonLoadingScript(const string& script) : m_script(script) { }
bool run(TestShell* shell)
@@ -545,21 +545,21 @@ private:
string m_script;
};
-void LayoutTestController::queueLoadingScript(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::queueLoadingScript(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isString())
m_workQueue.addWork(new WorkItemLoadingScript(arguments[0].toString()));
result->setNull();
}
-void LayoutTestController::queueNonLoadingScript(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::queueNonLoadingScript(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isString())
m_workQueue.addWork(new WorkItemNonLoadingScript(arguments[0].toString()));
result->setNull();
}
-class WorkItemLoad : public LayoutTestController::WorkItem {
+class WorkItemLoad : public DRTTestRunner::WorkItem {
public:
WorkItemLoad(const WebURL& url, const WebString& target)
: m_url(url)
@@ -575,7 +575,7 @@ private:
WebString m_target;
};
-void LayoutTestController::queueLoad(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::queueLoad(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isString()) {
// FIXME: Implement WebURL::resolve() and avoid GURL.
@@ -591,7 +591,7 @@ void LayoutTestController::queueLoad(const CppArgumentList& arguments, CppVarian
result->setNull();
}
-class WorkItemLoadHTMLString : public LayoutTestController::WorkItem {
+class WorkItemLoadHTMLString : public DRTTestRunner::WorkItem {
public:
WorkItemLoadHTMLString(const std::string& html, const WebURL& baseURL)
: m_html(html)
@@ -613,7 +613,7 @@ private:
WebURL m_unreachableURL;
};
-void LayoutTestController::queueLoadHTMLString(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::queueLoadHTMLString(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isString()) {
string html = arguments[0].toString();
@@ -628,7 +628,7 @@ void LayoutTestController::queueLoadHTMLString(const CppArgumentList& arguments,
result->setNull();
}
-void LayoutTestController::objCIdentityIsEqual(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::objCIdentityIsEqual(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() < 2) {
// This is the best we can do to return an error.
@@ -638,7 +638,7 @@ void LayoutTestController::objCIdentityIsEqual(const CppArgumentList& arguments,
result->set(arguments[0].isEqual(arguments[1]));
}
-void LayoutTestController::reset()
+void DRTTestRunner::reset()
{
if (m_shell) {
m_shell->webView()->setZoomLevel(false, 0);
@@ -707,7 +707,7 @@ void LayoutTestController::reset()
#endif
}
-void LayoutTestController::locationChangeDone()
+void DRTTestRunner::locationChangeDone()
{
m_webHistoryItemCount.set(m_shell->navigationEntryCount());
@@ -718,72 +718,72 @@ void LayoutTestController::locationChangeDone()
m_workQueue.processWorkSoon();
}
-void LayoutTestController::policyDelegateDone()
+void DRTTestRunner::policyDelegateDone()
{
ASSERT(m_waitUntilDone);
m_shell->testFinished();
m_waitUntilDone = false;
}
-void LayoutTestController::setCanOpenWindows(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::setCanOpenWindows(const CppArgumentList&, CppVariant* result)
{
m_canOpenWindows = true;
result->setNull();
}
-void LayoutTestController::setTabKeyCyclesThroughElements(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setTabKeyCyclesThroughElements(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool())
m_shell->webView()->setTabKeyCyclesThroughElements(arguments[0].toBoolean());
result->setNull();
}
-void LayoutTestController::windowCount(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::windowCount(const CppArgumentList&, CppVariant* result)
{
result->set(static_cast<int>(m_shell->windowCount()));
}
-void LayoutTestController::setCloseRemainingWindowsWhenComplete(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setCloseRemainingWindowsWhenComplete(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool())
m_closeRemainingWindows = arguments[0].value.boolValue;
result->setNull();
}
-void LayoutTestController::setAlwaysAcceptCookies(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setAlwaysAcceptCookies(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0)
webkit_support::SetAcceptAllCookies(cppVariantToBool(arguments[0]));
result->setNull();
}
-void LayoutTestController::setAsynchronousSpellCheckingEnabled(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setAsynchronousSpellCheckingEnabled(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool())
m_shell->webView()->settings()->setAsynchronousSpellCheckingEnabled(cppVariantToBool(arguments[0]));
result->setNull();
}
-void LayoutTestController::showWebInspector(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::showWebInspector(const CppArgumentList&, CppVariant* result)
{
m_shell->showDevTools();
result->setNull();
}
-void LayoutTestController::closeWebInspector(const CppArgumentList& args, CppVariant* result)
+void DRTTestRunner::closeWebInspector(const CppArgumentList& args, CppVariant* result)
{
m_shell->closeDevTools();
result->setNull();
}
-void LayoutTestController::setWindowIsKey(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setWindowIsKey(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool())
m_shell->setFocus(m_shell->webView(), arguments[0].value.boolValue);
result->setNull();
}
-void LayoutTestController::setUserStyleSheetEnabled(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setUserStyleSheetEnabled(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool()) {
m_shell->preferences()->userStyleSheetLocation = arguments[0].value.boolValue ? m_userStyleSheetLocation : WebURL();
@@ -792,7 +792,7 @@ void LayoutTestController::setUserStyleSheetEnabled(const CppArgumentList& argum
result->setNull();
}
-void LayoutTestController::setUserStyleSheetLocation(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setUserStyleSheetLocation(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isString()) {
m_userStyleSheetLocation = webkit_support::LocalFileToDataURL(
@@ -803,7 +803,7 @@ void LayoutTestController::setUserStyleSheetLocation(const CppArgumentList& argu
result->setNull();
}
-void LayoutTestController::setAuthorAndUserStylesEnabled(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setAuthorAndUserStylesEnabled(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool()) {
m_shell->preferences()->authorAndUserStylesEnabled = arguments[0].value.boolValue;
@@ -812,7 +812,7 @@ void LayoutTestController::setAuthorAndUserStylesEnabled(const CppArgumentList&
result->setNull();
}
-void LayoutTestController::execCommand(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::execCommand(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() <= 0 || !arguments[0].isString())
@@ -829,7 +829,7 @@ void LayoutTestController::execCommand(const CppArgumentList& arguments, CppVari
m_shell->webView()->focusedFrame()->executeCommand(WebString::fromUTF8(command), WebString::fromUTF8(value));
}
-void LayoutTestController::isCommandEnabled(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::isCommandEnabled(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() <= 0 || !arguments[0].isString()) {
result->setNull();
@@ -841,7 +841,7 @@ void LayoutTestController::isCommandEnabled(const CppArgumentList& arguments, Cp
result->set(rv);
}
-void LayoutTestController::setPopupBlockingEnabled(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setPopupBlockingEnabled(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool()) {
bool blockPopups = arguments[0].toBoolean();
@@ -851,78 +851,78 @@ void LayoutTestController::setPopupBlockingEnabled(const CppArgumentList& argume
result->setNull();
}
-void LayoutTestController::setImagesAllowed(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setImagesAllowed(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool())
m_shell->webPermissions()->setImagesAllowed(arguments[0].toBoolean());
result->setNull();
}
-void LayoutTestController::setScriptsAllowed(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setScriptsAllowed(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool())
m_shell->webPermissions()->setScriptsAllowed(arguments[0].toBoolean());
result->setNull();
}
-void LayoutTestController::setStorageAllowed(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setStorageAllowed(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool())
m_shell->webPermissions()->setStorageAllowed(arguments[0].toBoolean());
result->setNull();
}
-void LayoutTestController::setPluginsAllowed(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setPluginsAllowed(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool())
m_shell->webPermissions()->setPluginsAllowed(arguments[0].toBoolean());
result->setNull();
}
-void LayoutTestController::setUseDashboardCompatibilityMode(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::setUseDashboardCompatibilityMode(const CppArgumentList&, CppVariant* result)
{
// We have no need to support Dashboard Compatibility Mode (mac-only)
result->setNull();
}
-void LayoutTestController::clearAllApplicationCaches(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::clearAllApplicationCaches(const CppArgumentList&, CppVariant* result)
{
// FIXME: Implement to support application cache quotas.
result->setNull();
}
-void LayoutTestController::clearApplicationCacheForOrigin(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::clearApplicationCacheForOrigin(const CppArgumentList&, CppVariant* result)
{
// FIXME: Implement to support deleting all application cache for an origin.
result->setNull();
}
-void LayoutTestController::setApplicationCacheOriginQuota(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::setApplicationCacheOriginQuota(const CppArgumentList&, CppVariant* result)
{
// FIXME: Implement to support application cache quotas.
result->setNull();
}
-void LayoutTestController::originsWithApplicationCache(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::originsWithApplicationCache(const CppArgumentList&, CppVariant* result)
{
// FIXME: Implement to support getting origins that have application caches.
result->setNull();
}
-void LayoutTestController::applicationCacheDiskUsageForOrigin(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::applicationCacheDiskUsageForOrigin(const CppArgumentList&, CppVariant* result)
{
// FIXME: Implement to support getting disk usage by all application cache for an origin.
result->setNull();
}
-void LayoutTestController::setScrollbarPolicy(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::setScrollbarPolicy(const CppArgumentList&, CppVariant* result)
{
// FIXME: implement.
// Currently only has a non-null implementation on QT.
result->setNull();
}
-void LayoutTestController::setCustomPolicyDelegate(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setCustomPolicyDelegate(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool()) {
bool enable = arguments[0].value.boolValue;
@@ -934,14 +934,14 @@ void LayoutTestController::setCustomPolicyDelegate(const CppArgumentList& argume
result->setNull();
}
-void LayoutTestController::waitForPolicyDelegate(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::waitForPolicyDelegate(const CppArgumentList&, CppVariant* result)
{
m_shell->webViewHost()->waitForPolicyDelegate();
m_waitUntilDone = true;
result->setNull();
}
-void LayoutTestController::setWillSendRequestClearHeader(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setWillSendRequestClearHeader(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isString()) {
string header = arguments[0].toString();
@@ -951,21 +951,21 @@ void LayoutTestController::setWillSendRequestClearHeader(const CppArgumentList&
result->setNull();
}
-void LayoutTestController::setWillSendRequestReturnsNullOnRedirect(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setWillSendRequestReturnsNullOnRedirect(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool())
m_shell->webViewHost()->setBlockRedirects(arguments[0].value.boolValue);
result->setNull();
}
-void LayoutTestController::setWillSendRequestReturnsNull(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setWillSendRequestReturnsNull(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool())
m_shell->webViewHost()->setRequestReturnNull(arguments[0].value.boolValue);
result->setNull();
}
-void LayoutTestController::pathToLocalResource(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::pathToLocalResource(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() <= 0 || !arguments[0].isString())
@@ -1003,33 +1003,33 @@ void LayoutTestController::pathToLocalResource(const CppArgumentList& arguments,
result->set(webkit_support::RewriteLayoutTestsURL(url).spec());
}
-void LayoutTestController::addFileToPasteboardOnDrag(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::addFileToPasteboardOnDrag(const CppArgumentList&, CppVariant* result)
{
result->setNull();
m_shouldAddFileToPasteboard = true;
}
-void LayoutTestController::setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant* result)
{
result->setNull();
m_stopProvisionalFrameLoads = true;
}
-void LayoutTestController::setSmartInsertDeleteEnabled(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setSmartInsertDeleteEnabled(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool())
m_shell->webViewHost()->setSmartInsertDeleteEnabled(arguments[0].value.boolValue);
result->setNull();
}
-void LayoutTestController::setSelectTrailingWhitespaceEnabled(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setSelectTrailingWhitespaceEnabled(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool())
m_shell->webViewHost()->setSelectTrailingWhitespaceEnabled(arguments[0].value.boolValue);
result->setNull();
}
-bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const WebString& animationName, double time, const WebString& elementId)
+bool DRTTestRunner::pauseAnimationAtTimeOnElementWithId(const WebString& animationName, double time, const WebString& elementId)
{
WebFrame* webFrame = m_shell->webView()->mainFrame();
if (!webFrame)
@@ -1045,7 +1045,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const WebString&
return controller->pauseAnimationAtTime(element, animationName, time);
}
-bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const WebString& propertyName, double time, const WebString& elementId)
+bool DRTTestRunner::pauseTransitionAtTimeOnElementWithId(const WebString& propertyName, double time, const WebString& elementId)
{
WebFrame* webFrame = m_shell->webView()->mainFrame();
if (!webFrame)
@@ -1061,7 +1061,7 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const WebString&
return controller->pauseTransitionAtTime(element, propertyName, time);
}
-bool LayoutTestController::elementDoesAutoCompleteForElementWithId(const WebString& elementId)
+bool DRTTestRunner::elementDoesAutoCompleteForElementWithId(const WebString& elementId)
{
WebFrame* webFrame = m_shell->webView()->mainFrame();
if (!webFrame)
@@ -1075,7 +1075,7 @@ bool LayoutTestController::elementDoesAutoCompleteForElementWithId(const WebStri
return inputElement.autoComplete();
}
-int LayoutTestController::numberOfActiveAnimations()
+int DRTTestRunner::numberOfActiveAnimations()
{
WebFrame* webFrame = m_shell->webView()->mainFrame();
if (!webFrame)
@@ -1088,7 +1088,7 @@ int LayoutTestController::numberOfActiveAnimations()
return controller->numberOfActiveAnimations();
}
-void LayoutTestController::pauseAnimationAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::pauseAnimationAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result)
{
result->set(false);
if (arguments.size() > 2 && arguments[0].isString() && arguments[1].isNumber() && arguments[2].isString()) {
@@ -1099,7 +1099,7 @@ void LayoutTestController::pauseAnimationAtTimeOnElementWithId(const CppArgument
}
}
-void LayoutTestController::pauseTransitionAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::pauseTransitionAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result)
{
result->set(false);
if (arguments.size() > 2 && arguments[0].isString() && arguments[1].isNumber() && arguments[2].isString()) {
@@ -1110,7 +1110,7 @@ void LayoutTestController::pauseTransitionAtTimeOnElementWithId(const CppArgumen
}
}
-void LayoutTestController::elementDoesAutoCompleteForElementWithId(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::elementDoesAutoCompleteForElementWithId(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() != 1 || !arguments[0].isString()) {
result->set(false);
@@ -1120,7 +1120,7 @@ void LayoutTestController::elementDoesAutoCompleteForElementWithId(const CppArgu
result->set(elementDoesAutoCompleteForElementWithId(elementId));
}
-void LayoutTestController::enableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::enableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() != 4) {
result->set(false);
@@ -1138,7 +1138,7 @@ void LayoutTestController::enableAutoResizeMode(const CppArgumentList& arguments
result->set(true);
}
-void LayoutTestController::disableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::disableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() !=2) {
result->set(false);
@@ -1154,31 +1154,31 @@ void LayoutTestController::disableAutoResizeMode(const CppArgumentList& argument
result->set(true);
}
-void LayoutTestController::numberOfActiveAnimations(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::numberOfActiveAnimations(const CppArgumentList&, CppVariant* result)
{
result->set(numberOfActiveAnimations());
}
-void LayoutTestController::disableImageLoading(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::disableImageLoading(const CppArgumentList&, CppVariant* result)
{
m_shell->preferences()->loadsImagesAutomatically = false;
m_shell->applyPreferences();
result->setNull();
}
-void LayoutTestController::setIconDatabaseEnabled(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::setIconDatabaseEnabled(const CppArgumentList&, CppVariant* result)
{
// We don't use the WebKit icon database.
result->setNull();
}
-void LayoutTestController::callShouldCloseOnWebView(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::callShouldCloseOnWebView(const CppArgumentList&, CppVariant* result)
{
result->set(m_shell->webView()->dispatchBeforeUnloadEvent());
}
#if ENABLE(NOTIFICATIONS)
-void LayoutTestController::grantDesktopNotificationPermission(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::grantDesktopNotificationPermission(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() != 1 || !arguments[0].isString()) {
result->set(false);
@@ -1190,7 +1190,7 @@ void LayoutTestController::grantDesktopNotificationPermission(const CppArgumentL
result->set(true);
}
-void LayoutTestController::simulateDesktopNotificationClick(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::simulateDesktopNotificationClick(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() != 1 || !arguments[0].isString()) {
result->set(false);
@@ -1205,14 +1205,14 @@ void LayoutTestController::simulateDesktopNotificationClick(const CppArgumentLis
}
#endif
-void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setDomainRelaxationForbiddenForURLScheme(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() != 2 || !arguments[0].isBool() || !arguments[1].isString())
return;
m_shell->webView()->setDomainRelaxationForbidden(cppVariantToBool(arguments[0]), cppVariantToWebString(arguments[1]));
}
-void LayoutTestController::setDeferMainResourceDataLoad(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setDeferMainResourceDataLoad(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() == 1)
m_deferMainResourceDataLoad = cppVariantToBool(arguments[0]);
@@ -1222,23 +1222,23 @@ void LayoutTestController::setDeferMainResourceDataLoad(const CppArgumentList& a
// Unimplemented stubs
//
-void LayoutTestController::dumpAsWebArchive(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::dumpAsWebArchive(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
}
-void LayoutTestController::setMainFrameIsFirstResponder(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setMainFrameIsFirstResponder(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
}
-void LayoutTestController::dumpSelectionRect(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::dumpSelectionRect(const CppArgumentList& arguments, CppVariant* result)
{
m_dumpSelectionRect = true;
result->setNull();
}
-void LayoutTestController::display(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::display(const CppArgumentList& arguments, CppVariant* result)
{
WebViewHost* host = m_shell->webViewHost();
const WebKit::WebSize& size = m_shell->webView()->size();
@@ -1249,7 +1249,7 @@ void LayoutTestController::display(const CppArgumentList& arguments, CppVariant*
result->setNull();
}
-void LayoutTestController::displayInvalidatedRegion(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::displayInvalidatedRegion(const CppArgumentList& arguments, CppVariant* result)
{
WebViewHost* host = m_shell->webViewHost();
host->paintInvalidatedRegion();
@@ -1257,59 +1257,59 @@ void LayoutTestController::displayInvalidatedRegion(const CppArgumentList& argum
result->setNull();
}
-void LayoutTestController::testRepaint(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::testRepaint(const CppArgumentList&, CppVariant* result)
{
m_testRepaint = true;
result->setNull();
}
-void LayoutTestController::repaintSweepHorizontally(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::repaintSweepHorizontally(const CppArgumentList&, CppVariant* result)
{
m_sweepHorizontally = true;
result->setNull();
}
-void LayoutTestController::clearBackForwardList(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::clearBackForwardList(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
}
-void LayoutTestController::keepWebHistory(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::keepWebHistory(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
}
-void LayoutTestController::storeWebScriptObject(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::storeWebScriptObject(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
}
-void LayoutTestController::accessStoredWebScriptObject(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::accessStoredWebScriptObject(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
}
-void LayoutTestController::objCClassNameOf(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::objCClassNameOf(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
}
-void LayoutTestController::addDisallowedURL(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::addDisallowedURL(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
}
-void LayoutTestController::setCallCloseOnWebViews(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setCallCloseOnWebViews(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
}
-void LayoutTestController::setPrivateBrowsingEnabled(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setPrivateBrowsingEnabled(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
}
-void LayoutTestController::setJavaScriptCanAccessClipboard(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setJavaScriptCanAccessClipboard(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool()) {
m_shell->preferences()->javaScriptCanAccessClipboard = arguments[0].value.boolValue;
@@ -1318,7 +1318,7 @@ void LayoutTestController::setJavaScriptCanAccessClipboard(const CppArgumentList
result->setNull();
}
-void LayoutTestController::setXSSAuditorEnabled(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setXSSAuditorEnabled(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool()) {
m_shell->preferences()->XSSAuditorEnabled = arguments[0].value.boolValue;
@@ -1327,7 +1327,7 @@ void LayoutTestController::setXSSAuditorEnabled(const CppArgumentList& arguments
result->setNull();
}
-void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::evaluateScriptInIsolatedWorldAndReturnValue(const CppArgumentList& arguments, CppVariant* result)
{
v8::HandleScope scope;
WebVector<v8::Local<v8::Value> > values;
@@ -1357,7 +1357,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(const Cpp
}
}
-void LayoutTestController::evaluateScriptInIsolatedWorld(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::evaluateScriptInIsolatedWorld(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() >= 2 && arguments[0].isNumber() && arguments[1].isString()) {
WebScriptSource source(cppVariantToWebString(arguments[1]));
@@ -1368,7 +1368,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(const CppArgumentList&
result->setNull();
}
-void LayoutTestController::setIsolatedWorldSecurityOrigin(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setIsolatedWorldSecurityOrigin(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
@@ -1380,7 +1380,7 @@ void LayoutTestController::setIsolatedWorldSecurityOrigin(const CppArgumentList&
WebSecurityOrigin::createFromString(cppVariantToWebString(arguments[1])));
}
-void LayoutTestController::setAllowUniversalAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setAllowUniversalAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool()) {
m_shell->preferences()->allowUniversalAccessFromFileURLs = arguments[0].value.boolValue;
@@ -1389,7 +1389,7 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(const CppArgument
result->setNull();
}
-void LayoutTestController::setAllowDisplayOfInsecureContent(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setAllowDisplayOfInsecureContent(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool())
m_shell->webPermissions()->setDisplayingInsecureContentAllowed(arguments[0].toBoolean());
@@ -1397,7 +1397,7 @@ void LayoutTestController::setAllowDisplayOfInsecureContent(const CppArgumentLis
result->setNull();
}
-void LayoutTestController::setAllowFileAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setAllowFileAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool()) {
m_shell->preferences()->allowFileAccessFromFileURLs = arguments[0].value.boolValue;
@@ -1406,7 +1406,7 @@ void LayoutTestController::setAllowFileAccessFromFileURLs(const CppArgumentList&
result->setNull();
}
-void LayoutTestController::setAllowRunningOfInsecureContent(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setAllowRunningOfInsecureContent(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool())
m_shell->webPermissions()->setRunningInsecureContentAllowed(arguments[0].value.boolValue);
@@ -1416,7 +1416,7 @@ void LayoutTestController::setAllowRunningOfInsecureContent(const CppArgumentLis
// Need these conversions because the format of the value for booleans
// may vary - for example, on mac "1" and "0" are used for boolean.
-bool LayoutTestController::cppVariantToBool(const CppVariant& value)
+bool DRTTestRunner::cppVariantToBool(const CppVariant& value)
{
if (value.isBool())
return value.toBoolean();
@@ -1433,7 +1433,7 @@ bool LayoutTestController::cppVariantToBool(const CppVariant& value)
return false;
}
-int32_t LayoutTestController::cppVariantToInt32(const CppVariant& value)
+int32_t DRTTestRunner::cppVariantToInt32(const CppVariant& value)
{
if (value.isNumber())
return value.toInt32();
@@ -1449,7 +1449,7 @@ int32_t LayoutTestController::cppVariantToInt32(const CppVariant& value)
return 0;
}
-WebString LayoutTestController::cppVariantToWebString(const CppVariant& value)
+WebString DRTTestRunner::cppVariantToWebString(const CppVariant& value)
{
if (!value.isString()) {
logErrorToConsole("Invalid value for preference. Expected string value.");
@@ -1458,7 +1458,7 @@ WebString LayoutTestController::cppVariantToWebString(const CppVariant& value)
return WebString::fromUTF8(value.toString());
}
-Vector<WebString> LayoutTestController::cppVariantToWebStringArray(const CppVariant& value)
+Vector<WebString> DRTTestRunner::cppVariantToWebStringArray(const CppVariant& value)
{
if (!value.isObject()) {
logErrorToConsole("Invalid value for preference. Expected object value.");
@@ -1488,7 +1488,7 @@ static void setFontMap(WebPreferences::ScriptFontFamilyMap& map, const Vector<We
}
}
-void LayoutTestController::overridePreference(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::overridePreference(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() != 2 || !arguments[0].isString())
@@ -1591,13 +1591,13 @@ void LayoutTestController::overridePreference(const CppArgumentList& arguments,
m_shell->applyPreferences();
}
-void LayoutTestController::fallbackMethod(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::fallbackMethod(const CppArgumentList&, CppVariant* result)
{
- printf("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on LayoutTestController\n");
+ printf("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on DRTTestRunner\n");
result->setNull();
}
-void LayoutTestController::addOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::addOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
@@ -1616,7 +1616,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(const CppArgumentList&
arguments[3].toBoolean());
}
-void LayoutTestController::removeOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::removeOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
@@ -1635,20 +1635,20 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(const CppArgumentLis
arguments[3].toBoolean());
}
-void LayoutTestController::clearAllDatabases(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::clearAllDatabases(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
webkit_support::ClearAllDatabases();
}
-void LayoutTestController::setDatabaseQuota(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setDatabaseQuota(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if ((arguments.size() >= 1) && arguments[0].isNumber())
webkit_support::SetDatabaseQuota(arguments[0].toInt32());
}
-void LayoutTestController::setPOSIXLocale(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setPOSIXLocale(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() == 1 && arguments[0].isString())
@@ -1715,13 +1715,13 @@ static bool parsePageNumberSizeMargins(const CppArgumentList& arguments, int arg
return true;
}
-void LayoutTestController::setPrinting(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setPrinting(const CppArgumentList& arguments, CppVariant* result)
{
setIsPrinting(true);
result->setNull();
}
-void LayoutTestController::pageSizeAndMarginsInPixels(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::pageSizeAndMarginsInPixels(const CppArgumentList& arguments, CppVariant* result)
{
result->set("");
int pageNumber = 0;
@@ -1746,7 +1746,7 @@ void LayoutTestController::pageSizeAndMarginsInPixels(const CppArgumentList& arg
result->set(resultString.str());
}
-void LayoutTestController::hasCustomPageSizeStyle(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::hasCustomPageSizeStyle(const CppArgumentList& arguments, CppVariant* result)
{
result->set(false);
int pageIndex = 0;
@@ -1758,7 +1758,7 @@ void LayoutTestController::hasCustomPageSizeStyle(const CppArgumentList& argumen
result->set(frame->hasCustomPageSizeStyle(pageIndex));
}
-void LayoutTestController::pageProperty(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::pageProperty(const CppArgumentList& arguments, CppVariant* result)
{
result->set("");
int pageNumber = 0;
@@ -1775,7 +1775,7 @@ void LayoutTestController::pageProperty(const CppArgumentList& arguments, CppVar
frame->printEnd();
}
-void LayoutTestController::numberOfPages(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::numberOfPages(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
int pageWidthInPixels = 0;
@@ -1792,7 +1792,7 @@ void LayoutTestController::numberOfPages(const CppArgumentList& arguments, CppVa
result->set(numberOfPages);
}
-void LayoutTestController::numberOfPendingGeolocationPermissionRequests(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::numberOfPendingGeolocationPermissionRequests(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
Vector<WebViewHost*> windowList = m_shell->windowList();
@@ -1802,14 +1802,14 @@ void LayoutTestController::numberOfPendingGeolocationPermissionRequests(const Cp
result->set(numberOfRequests);
}
-void LayoutTestController::logErrorToConsole(const std::string& text)
+void DRTTestRunner::logErrorToConsole(const std::string& text)
{
m_shell->webViewHost()->didAddMessageToConsole(
WebConsoleMessage(WebConsoleMessage::LevelError, WebString::fromUTF8(text)),
WebString(), 0);
}
-void LayoutTestController::evaluateInWebInspector(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::evaluateInWebInspector(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isString())
@@ -1817,13 +1817,13 @@ void LayoutTestController::evaluateInWebInspector(const CppArgumentList& argumen
m_shell->drtDevToolsAgent()->evaluateInWebInspector(arguments[0].toInt32(), arguments[1].toString());
}
-void LayoutTestController::forceRedSelectionColors(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::forceRedSelectionColors(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
m_shell->webView()->setSelectionColors(0xffee0000, 0xff00ee00, 0xff000000, 0xffc0c0c0);
}
-void LayoutTestController::addUserScript(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::addUserScript(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 3 || !arguments[0].isString() || !arguments[1].isBool() || !arguments[2].isBool())
@@ -1834,7 +1834,7 @@ void LayoutTestController::addUserScript(const CppArgumentList& arguments, CppVa
arguments[2].toBoolean() ? WebView::UserContentInjectInAllFrames : WebView::UserContentInjectInTopFrameOnly);
}
-void LayoutTestController::addUserStyleSheet(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::addUserStyleSheet(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isBool())
@@ -1847,7 +1847,7 @@ void LayoutTestController::addUserStyleSheet(const CppArgumentList& arguments, C
WebView::UserStyleInjectInExistingDocuments);
}
-void LayoutTestController::setMockDeviceOrientation(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setMockDeviceOrientation(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 6 || !arguments[0].isBool() || !arguments[1].isNumber() || !arguments[2].isBool() || !arguments[3].isNumber() || !arguments[4].isBool() || !arguments[5].isNumber())
@@ -1870,7 +1870,7 @@ void LayoutTestController::setMockDeviceOrientation(const CppArgumentList& argum
// FIXME: For greater test flexibility, we should be able to set each page's geolocation mock individually.
// https://bugs.webkit.org/show_bug.cgi?id=52368
-void LayoutTestController::setGeolocationPermission(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setGeolocationPermission(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 1 || !arguments[0].isBool())
@@ -1880,7 +1880,7 @@ void LayoutTestController::setGeolocationPermission(const CppArgumentList& argum
windowList[i]->geolocationClientMock()->setPermission(arguments[0].toBoolean());
}
-void LayoutTestController::setMockGeolocationPosition(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setMockGeolocationPosition(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 3 || !arguments[0].isNumber() || !arguments[1].isNumber() || !arguments[2].isNumber())
@@ -1890,7 +1890,7 @@ void LayoutTestController::setMockGeolocationPosition(const CppArgumentList& arg
windowList[i]->geolocationClientMock()->setPosition(arguments[0].toDouble(), arguments[1].toDouble(), arguments[2].toDouble());
}
-void LayoutTestController::setMockGeolocationError(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setMockGeolocationError(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isString())
@@ -1900,13 +1900,13 @@ void LayoutTestController::setMockGeolocationError(const CppArgumentList& argume
windowList[i]->geolocationClientMock()->setError(arguments[0].toInt32(), cppVariantToWebString(arguments[1]));
}
-void LayoutTestController::abortModal(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::abortModal(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
}
#if ENABLE(INPUT_SPEECH)
-void LayoutTestController::addMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::addMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 3 || !arguments[0].isString() || !arguments[1].isNumber() || !arguments[2].isString())
@@ -1916,7 +1916,7 @@ void LayoutTestController::addMockSpeechInputResult(const CppArgumentList& argum
controller->addMockRecognitionResult(cppVariantToWebString(arguments[0]), arguments[1].toDouble(), cppVariantToWebString(arguments[2]));
}
-void LayoutTestController::setMockSpeechInputDumpRect(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setMockSpeechInputDumpRect(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 1 || !arguments[0].isBool())
@@ -1928,7 +1928,7 @@ void LayoutTestController::setMockSpeechInputDumpRect(const CppArgumentList& arg
#endif
#if ENABLE(SCRIPTED_SPEECH)
-void LayoutTestController::addMockSpeechRecognitionResult(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::addMockSpeechRecognitionResult(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isNumber())
@@ -1938,7 +1938,7 @@ void LayoutTestController::addMockSpeechRecognitionResult(const CppArgumentList&
recognizer->addMockResult(cppVariantToWebString(arguments[0]), arguments[1].toDouble());
}
-void LayoutTestController::setMockSpeechRecognitionError(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setMockSpeechRecognitionError(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isString())
@@ -1948,7 +1948,7 @@ void LayoutTestController::setMockSpeechRecognitionError(const CppArgumentList&
recognizer->setError(arguments[0].toInt32(), cppVariantToWebString(arguments[1]));
}
-void LayoutTestController::wasMockSpeechRecognitionAborted(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::wasMockSpeechRecognitionAborted(const CppArgumentList&, CppVariant* result)
{
result->set(false);
if (MockWebSpeechRecognizer* recognizer = m_shell->webViewHost()->mockSpeechRecognizer())
@@ -1956,7 +1956,7 @@ void LayoutTestController::wasMockSpeechRecognitionAborted(const CppArgumentList
}
#endif
-void LayoutTestController::startSpeechInput(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::startSpeechInput(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() != 1)
@@ -1976,12 +1976,12 @@ void LayoutTestController::startSpeechInput(const CppArgumentList& arguments, Cp
input->startSpeechInput();
}
-void LayoutTestController::layerTreeAsText(const CppArgumentList& args, CppVariant* result)
+void DRTTestRunner::layerTreeAsText(const CppArgumentList& args, CppVariant* result)
{
result->set(m_shell->webView()->mainFrame()->layerTreeAsText(m_showDebugLayerTree).utf8());
}
-void LayoutTestController::loseCompositorContext(const CppArgumentList& args, CppVariant*)
+void DRTTestRunner::loseCompositorContext(const CppArgumentList& args, CppVariant*)
{
int numTimes;
if (args.size() == 1 || !args[0].isNumber())
@@ -1991,7 +1991,7 @@ void LayoutTestController::loseCompositorContext(const CppArgumentList& args, Cp
m_shell->webView()->loseCompositorContext(numTimes);
}
-void LayoutTestController::markerTextForListItem(const CppArgumentList& args, CppVariant* result)
+void DRTTestRunner::markerTextForListItem(const CppArgumentList& args, CppVariant* result)
{
WebElement element;
if (!WebBindings::getElement(args[0].value.objectValue, &element))
@@ -2000,7 +2000,7 @@ void LayoutTestController::markerTextForListItem(const CppArgumentList& args, Cp
result->set(element.document().frame()->markerTextForListItem(element).utf8());
}
-void LayoutTestController::findString(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::findString(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() < 1 || !arguments[0].isString())
return;
@@ -2028,7 +2028,7 @@ void LayoutTestController::findString(const CppArgumentList& arguments, CppVaria
result->set(findResult);
}
-void LayoutTestController::setMinimumTimerInterval(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setMinimumTimerInterval(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 1 || !arguments[0].isNumber())
@@ -2036,7 +2036,7 @@ void LayoutTestController::setMinimumTimerInterval(const CppArgumentList& argume
m_shell->webView()->settings()->setMinimumTimerInterval(arguments[0].toDouble());
}
-void LayoutTestController::setAutofilled(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setAutofilled(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() != 2 || !arguments[1].isBool())
@@ -2053,7 +2053,7 @@ void LayoutTestController::setAutofilled(const CppArgumentList& arguments, CppVa
input->setAutofilled(arguments[1].value.boolValue);
}
-void LayoutTestController::setValueForUser(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setValueForUser(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() != 2)
@@ -2070,37 +2070,37 @@ void LayoutTestController::setValueForUser(const CppArgumentList& arguments, Cpp
input->setValue(cppVariantToWebString(arguments[1]), true);
}
-void LayoutTestController::deleteAllLocalStorage(const CppArgumentList& arguments, CppVariant*)
+void DRTTestRunner::deleteAllLocalStorage(const CppArgumentList& arguments, CppVariant*)
{
// Not Implemented
}
-void LayoutTestController::localStorageDiskUsageForOrigin(const CppArgumentList& arguments, CppVariant*)
+void DRTTestRunner::localStorageDiskUsageForOrigin(const CppArgumentList& arguments, CppVariant*)
{
// Not Implemented
}
-void LayoutTestController::originsWithLocalStorage(const CppArgumentList& arguments, CppVariant*)
+void DRTTestRunner::originsWithLocalStorage(const CppArgumentList& arguments, CppVariant*)
{
// Not Implemented
}
-void LayoutTestController::deleteLocalStorageForOrigin(const CppArgumentList& arguments, CppVariant*)
+void DRTTestRunner::deleteLocalStorageForOrigin(const CppArgumentList& arguments, CppVariant*)
{
// Not Implemented
}
-void LayoutTestController::observeStorageTrackerNotifications(const CppArgumentList&, CppVariant*)
+void DRTTestRunner::observeStorageTrackerNotifications(const CppArgumentList&, CppVariant*)
{
// Not Implemented
}
-void LayoutTestController::syncLocalStorage(const CppArgumentList&, CppVariant*)
+void DRTTestRunner::syncLocalStorage(const CppArgumentList&, CppVariant*)
{
// Not Implemented
}
-void LayoutTestController::setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() == 1 && arguments[0].isBool())
m_shouldStayOnPageAfterHandlingBeforeUnload = arguments[0].toBoolean();
@@ -2108,7 +2108,7 @@ void LayoutTestController::setShouldStayOnPageAfterHandlingBeforeUnload(const Cp
result->setNull();
}
-void LayoutTestController::enableFixedLayoutMode(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::enableFixedLayoutMode(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 1 || !arguments[0].isBool())
@@ -2117,7 +2117,7 @@ void LayoutTestController::enableFixedLayoutMode(const CppArgumentList& argument
m_shell->webView()->enableFixedLayoutMode(enableFixedLayout);
}
-void LayoutTestController::setFixedLayoutSize(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setFixedLayoutSize(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber())
@@ -2127,17 +2127,17 @@ void LayoutTestController::setFixedLayoutSize(const CppArgumentList& arguments,
m_shell->webView()->setFixedLayoutSize(WebSize(width, height));
}
-void LayoutTestController::selectionAsMarkup(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::selectionAsMarkup(const CppArgumentList& arguments, CppVariant* result)
{
result->set(m_shell->webView()->mainFrame()->selectionAsMarkup().utf8());
}
-void LayoutTestController::workerThreadCount(CppVariant* result)
+void DRTTestRunner::workerThreadCount(CppVariant* result)
{
result->set(static_cast<int>(WebWorkerInfo::dedicatedWorkerCount()));
}
-void LayoutTestController::sendWebIntentResponse(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::sendWebIntentResponse(const CppArgumentList& arguments, CppVariant* result)
{
v8::HandleScope scope;
v8::Local<v8::Context> ctx = m_shell->webView()->mainFrame()->mainWorldScriptContext();
@@ -2159,7 +2159,7 @@ void LayoutTestController::sendWebIntentResponse(const CppArgumentList& argument
result->setNull();
}
-void LayoutTestController::deliverWebIntent(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::deliverWebIntent(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() < 3)
return;
@@ -2180,7 +2180,7 @@ void LayoutTestController::deliverWebIntent(const CppArgumentList& arguments, Cp
m_shell->webView()->mainFrame()->deliverIntent(intent, 0, m_intentClient.get());
}
-void LayoutTestController::setTextSubpixelPositioning(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setTextSubpixelPositioning(const CppArgumentList& arguments, CppVariant* result)
{
#if OS(LINUX) || OS(ANDROID)
// Since FontConfig doesn't provide a variable to control subpixel positioning, we'll fall back
@@ -2191,10 +2191,10 @@ void LayoutTestController::setTextSubpixelPositioning(const CppArgumentList& arg
result->setNull();
}
-class InvokeCallbackTask : public MethodTask<LayoutTestController> {
+class InvokeCallbackTask : public MethodTask<DRTTestRunner> {
public:
- InvokeCallbackTask(LayoutTestController* object, PassOwnArrayPtr<CppVariant> callbackArguments, uint32_t numberOfArguments)
- : MethodTask<LayoutTestController>(object)
+ InvokeCallbackTask(DRTTestRunner* object, PassOwnArrayPtr<CppVariant> callbackArguments, uint32_t numberOfArguments)
+ : MethodTask<DRTTestRunner>(object)
, m_callbackArguments(callbackArguments)
, m_numberOfArguments(numberOfArguments)
{
@@ -2211,7 +2211,7 @@ private:
uint32_t m_numberOfArguments;
};
-void LayoutTestController::setBackingScaleFactor(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setBackingScaleFactor(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isObject())
return;
@@ -2225,7 +2225,7 @@ void LayoutTestController::setBackingScaleFactor(const CppArgumentList& argument
postTask(new InvokeCallbackTask(this, callbackArguments.release(), 1));
}
-void LayoutTestController::setPluginsEnabled(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setPluginsEnabled(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool()) {
m_shell->preferences()->pluginsEnabled = arguments[0].toBoolean();
@@ -2234,12 +2234,12 @@ void LayoutTestController::setPluginsEnabled(const CppArgumentList& arguments, C
result->setNull();
}
-void LayoutTestController::resetPageVisibility(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::resetPageVisibility(const CppArgumentList& arguments, CppVariant* result)
{
m_shell->webView()->setVisibilityState(WebPageVisibilityStateVisible, true);
}
-void LayoutTestController::setPageVisibility(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setPageVisibility(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isString()) {
string newVisibility = arguments[0].toString();
@@ -2254,12 +2254,12 @@ void LayoutTestController::setPageVisibility(const CppArgumentList& arguments, C
}
}
-void LayoutTestController::setAutomaticLinkDetectionEnabled(bool)
+void DRTTestRunner::setAutomaticLinkDetectionEnabled(bool)
{
// Not Implemented
}
-void LayoutTestController::setTextDirection(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setTextDirection(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() != 1 || !arguments[0].isString())
@@ -2280,7 +2280,7 @@ void LayoutTestController::setTextDirection(const CppArgumentList& arguments, Cp
m_shell->webView()->setTextDirection(direction);
}
-void LayoutTestController::setAudioData(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setAudioData(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
@@ -2297,7 +2297,7 @@ void LayoutTestController::setAudioData(const CppArgumentList& arguments, CppVar
setShouldDumpAsAudio(true);
}
-void LayoutTestController::setHasCustomFullScreenBehavior(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::setHasCustomFullScreenBehavior(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 1 || !arguments[0].isBool())
@@ -2306,26 +2306,26 @@ void LayoutTestController::setHasCustomFullScreenBehavior(const CppArgumentList&
}
#if ENABLE(POINTER_LOCK)
-void LayoutTestController::didLosePointerLock(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::didLosePointerLock(const CppArgumentList&, CppVariant* result)
{
m_shell->webViewHost()->didLosePointerLock();
result->setNull();
}
-void LayoutTestController::setPointerLockWillFailAsynchronously(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::setPointerLockWillFailAsynchronously(const CppArgumentList&, CppVariant* result)
{
m_shell->webViewHost()->setPointerLockWillFailAsynchronously();
result->setNull();
}
-void LayoutTestController::setPointerLockWillFailSynchronously(const CppArgumentList&, CppVariant* result)
+void DRTTestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, CppVariant* result)
{
m_shell->webViewHost()->setPointerLockWillFailSynchronously();
result->setNull();
}
#endif
-void LayoutTestController::textSurroundingNode(const CppArgumentList& arguments, CppVariant* result)
+void DRTTestRunner::textSurroundingNode(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 4 || !arguments[0].isObject() || !arguments[1].isNumber() || !arguments[2].isNumber() || !arguments[3].isNumber())
diff --git a/Tools/DumpRenderTree/chromium/LayoutTestController.h b/Tools/DumpRenderTree/chromium/DRTTestRunner.h
index 9cfd12359..e9c0171f9 100644
--- a/Tools/DumpRenderTree/chromium/LayoutTestController.h
+++ b/Tools/DumpRenderTree/chromium/DRTTestRunner.h
@@ -30,28 +30,28 @@
*/
/*
- LayoutTestController class:
- Bound to a JavaScript window.layoutTestController object using the
+ DRTTestRunner class:
+ Bound to a JavaScript window.testRunner object using the
CppBoundClass::bindToJavascript(), this allows layout tests that are run in
the test_shell (or, in principle, any web page loaded into a client app built
with this class) to control various aspects of how the tests are run and what
sort of output they produce.
*/
-#ifndef LayoutTestController_h
-#define LayoutTestController_h
+#ifndef DRTTestRunner_h
+#define DRTTestRunner_h
-#include "TestRunner.h"
+#include "TestRunner/TestRunner.h"
class TestShell;
-class LayoutTestController : public TestRunner {
+class DRTTestRunner : public TestRunner {
public:
// Builds the property and method lists needed to bind this class to a JS
// object.
- LayoutTestController(TestShell*);
+ DRTTestRunner(TestShell*);
- ~LayoutTestController();
+ ~DRTTestRunner();
// This function sets a flag that tells the test_shell to dump pages as
// plain text, rather than as a text representation of the renderer's state.
@@ -345,7 +345,7 @@ public:
void setMockGeolocationPosition(const CppArgumentList&, CppVariant*);
void setMockGeolocationError(const CppArgumentList&, CppVariant*);
- // Empty stub method to keep parity with object model exposed by global LayoutTestController.
+ // Empty stub method to keep parity with object model exposed by global DRTTestRunner.
void abortModal(const CppArgumentList&, CppVariant*);
// Speech input related functions.
@@ -528,7 +528,7 @@ private:
// queueScript.
class WorkQueue {
public:
- WorkQueue(LayoutTestController* controller) : m_frozen(false), m_controller(controller) { }
+ WorkQueue(DRTTestRunner* controller) : m_frozen(false), m_controller(controller) { }
virtual ~WorkQueue();
void processWorkSoon();
@@ -552,7 +552,7 @@ private:
TaskList m_taskList;
Deque<WorkItem*> m_queue;
bool m_frozen;
- LayoutTestController* m_controller;
+ DRTTestRunner* m_controller;
};
// Support for overridePreference.
@@ -563,9 +563,9 @@ private:
void logErrorToConsole(const std::string&);
void completeNotifyDone(bool isTimeout);
- class NotifyDoneTimedOutTask: public MethodTask<LayoutTestController> {
+ class NotifyDoneTimedOutTask: public MethodTask<DRTTestRunner> {
public:
- NotifyDoneTimedOutTask(LayoutTestController* object): MethodTask<LayoutTestController>(object) { }
+ NotifyDoneTimedOutTask(DRTTestRunner* object): MethodTask<DRTTestRunner>(object) { }
virtual void runIfValid() { m_object->completeNotifyDone(true); }
};
@@ -578,7 +578,7 @@ private:
// Used for test timeouts.
TaskList m_taskList;
- // Non-owning pointer. The LayoutTestController is owned by the host.
+ // Non-owning pointer. The DRTTestRunner is owned by the host.
TestShell* m_shell;
// If true, the test_shell will produce a plain text dump rather than a
@@ -717,4 +717,4 @@ private:
bool m_hasCustomFullScreenBehavior;
};
-#endif // LayoutTestController_h
+#endif // DRTTestRunner_h
diff --git a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
index ae5502cd2..9a8bd7fd4 100644
--- a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
@@ -252,7 +252,7 @@ int main(int argc, char* argv[])
shell.callJSGC();
shell.callJSGC();
- // When we finish the last test, cleanup the LayoutTestController.
+ // When we finish the last test, cleanup the DRTTestRunner.
// It may have references to not-yet-cleaned up windows. By cleaning up
// here we help purify reports.
shell.resetTestController();
diff --git a/Tools/DumpRenderTree/chromium/NotificationPresenter.h b/Tools/DumpRenderTree/chromium/NotificationPresenter.h
index 5fed178da..e98cc7294 100644
--- a/Tools/DumpRenderTree/chromium/NotificationPresenter.h
+++ b/Tools/DumpRenderTree/chromium/NotificationPresenter.h
@@ -46,10 +46,10 @@ public:
explicit NotificationPresenter(TestShell*) { }
virtual ~NotificationPresenter();
- // Called by the LayoutTestController to simulate a user granting permission.
+ // Called by the DRTTestRunner to simulate a user granting permission.
void grantPermission(const WebKit::WebString& origin);
- // Called by the LayoutTestController to simulate a user clicking on a notification.
+ // Called by the DRTTestRunner to simulate a user clicking on a notification.
bool simulateClick(const WebKit::WebString& notificationIdentifier);
// WebKit::WebNotificationPresenter interface
diff --git a/Tools/DumpRenderTree/chromium/TestShell.cpp b/Tools/DumpRenderTree/chromium/TestShell.cpp
index 29a2a3130..9abb13fac 100644
--- a/Tools/DumpRenderTree/chromium/TestShell.cpp
+++ b/Tools/DumpRenderTree/chromium/TestShell.cpp
@@ -33,9 +33,8 @@
#include "DRTDevToolsAgent.h"
#include "DRTDevToolsClient.h"
-#include "LayoutTestController.h"
+#include "DRTTestRunner.h"
#include "MockWebPrerenderingSupport.h"
-#include "platform/WebArrayBufferView.h"
#include "WebDataSource.h"
#include "WebDocument.h"
#include "WebElement.h"
@@ -49,6 +48,7 @@
#include "WebSettings.h"
#include "WebView.h"
#include "WebViewHost.h"
+#include "platform/WebArrayBufferView.h"
#include "skia/ext/platform_canvas.h"
#include "webkit/support/webkit_support.h"
#include "webkit/support/webkit_support_gfx.h"
@@ -119,6 +119,7 @@ TestShell::TestShell()
, m_isDisplayingModalDialog(false)
{
WebRuntimeFeatures::enableDataTransferItems(true);
+ WebRuntimeFeatures::enableDeviceMotion(false);
WebRuntimeFeatures::enableGeolocation(true);
WebRuntimeFeatures::enablePointerLock(true);
WebRuntimeFeatures::enableIndexedDatabase(true);
@@ -151,7 +152,7 @@ void TestShell::initialize()
{
m_webPermissions = adoptPtr(new WebPermissions(this));
m_testInterfaces = adoptPtr(new TestInterfaces());
- m_layoutTestController = adoptPtr(new LayoutTestController(this));
+ m_testRunner = adoptPtr(new DRTTestRunner(this));
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
m_notificationPresenter = adoptPtr(new NotificationPresenter(this));
#endif
@@ -240,11 +241,11 @@ void TestShell::runFileTest(const TestParams& params, bool shouldDumpPixels)
m_params = params;
string testUrl = m_params.testUrl.spec();
- m_layoutTestController->setShouldGeneratePixelResults(shouldDumpPixels);
+ m_testRunner->setShouldGeneratePixelResults(shouldDumpPixels);
if (testUrl.find("loading/") != string::npos
|| testUrl.find("loading\\") != string::npos)
- m_layoutTestController->setShouldDumpFrameLoadCallbacks(true);
+ m_testRunner->setShouldDumpFrameLoadCallbacks(true);
if (testUrl.find("compositing/") != string::npos || testUrl.find("compositing\\") != string::npos) {
m_prefs.acceleratedCompositingForVideoEnabled = true;
@@ -256,8 +257,8 @@ void TestShell::runFileTest(const TestParams& params, bool shouldDumpPixels)
if (testUrl.find("/dumpAsText/") != string::npos
|| testUrl.find("\\dumpAsText\\") != string::npos) {
- m_layoutTestController->setShouldDumpAsText(true);
- m_layoutTestController->setShouldGeneratePixelResults(false);
+ m_testRunner->setShouldDumpAsText(true);
+ m_testRunner->setShouldGeneratePixelResults(false);
}
if (testUrl.find("/inspector/") != string::npos
@@ -265,7 +266,7 @@ void TestShell::runFileTest(const TestParams& params, bool shouldDumpPixels)
showDevTools();
if (m_params.debugLayerTree)
- m_layoutTestController->setShowDebugLayerTree(true);
+ m_testRunner->setShowDebugLayerTree(true);
if (m_dumpWhenFinished)
m_printer.handleTestHeader(testUrl.c_str());
@@ -298,7 +299,7 @@ void TestShell::resetTestController()
resetWebSettings(*webView());
m_webPermissions->reset();
m_testInterfaces->resetAll();
- m_layoutTestController->reset();
+ m_testRunner->reset();
m_webViewHost->reset();
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
m_notificationPresenter->reset();
@@ -555,14 +556,14 @@ void TestShell::dump()
WebFrame* frame = m_webView->mainFrame();
if (!frame)
return;
- bool shouldDumpAsText = m_layoutTestController->shouldDumpAsText();
- bool shouldDumpAsAudio = m_layoutTestController->shouldDumpAsAudio();
- bool shouldGeneratePixelResults = m_layoutTestController->shouldGeneratePixelResults();
- bool shouldDumpAsPrinted = m_layoutTestController->isPrinting();
+ bool shouldDumpAsText = m_testRunner->shouldDumpAsText();
+ bool shouldDumpAsAudio = m_testRunner->shouldDumpAsAudio();
+ bool shouldGeneratePixelResults = m_testRunner->shouldGeneratePixelResults();
+ bool shouldDumpAsPrinted = m_testRunner->isPrinting();
bool dumpedAnything = false;
if (shouldDumpAsAudio) {
- const WebKit::WebArrayBufferView& webArrayBufferView = m_layoutTestController->audioData();
+ const WebKit::WebArrayBufferView& webArrayBufferView = m_testRunner->audioData();
m_printer.handleAudio(webArrayBufferView.baseAddress(), webArrayBufferView.byteLength());
m_printer.handleAudioFooter();
m_printer.handleTestFooter(true);
@@ -586,7 +587,7 @@ void TestShell::dump()
}
}
if (shouldDumpAsText) {
- bool recursive = m_layoutTestController->shouldDumpChildFramesAsText();
+ bool recursive = m_testRunner->shouldDumpChildFramesAsText();
string dataUtf8 = shouldDumpAsPrinted ? dumpFramesAsPrintedText(frame, recursive) : dumpFramesAsText(frame, recursive);
if (fwrite(dataUtf8.c_str(), 1, dataUtf8.size(), stdout) != dataUtf8.size())
FATAL("Short write to stdout, disk full?\n");
@@ -597,10 +598,10 @@ void TestShell::dump()
if (m_params.debugRenderTree)
renderTextBehavior |= WebFrame::RenderAsTextDebug;
printf("%s", frame->renderTreeAsText(renderTextBehavior).utf8().data());
- bool recursive = m_layoutTestController->shouldDumpChildFrameScrollPositions();
+ bool recursive = m_testRunner->shouldDumpChildFrameScrollPositions();
dumpFrameScrollPosition(frame, recursive);
}
- if (m_layoutTestController->shouldDumpBackForwardList())
+ if (m_testRunner->shouldDumpBackForwardList())
printf("%s", dumpAllBackForwardLists().c_str());
}
if (dumpedAnything && m_params.printSeparators)
@@ -612,18 +613,18 @@ void TestShell::dump()
// stdout.
dumpedAnything = true;
m_webView->layout();
- if (m_layoutTestController->testRepaint()) {
+ if (m_testRunner->testRepaint()) {
WebSize viewSize = m_webView->size();
int width = viewSize.width;
int height = viewSize.height;
- if (m_layoutTestController->sweepHorizontally()) {
+ if (m_testRunner->sweepHorizontally()) {
for (WebRect column(0, 0, 1, height); column.x < width; column.x++)
m_webViewHost->paintRect(column);
} else {
for (WebRect line(0, 0, width, 1); line.y < height; line.y++)
m_webViewHost->paintRect(line);
}
- } else if (m_layoutTestController->isPrinting())
+ } else if (m_testRunner->isPrinting())
m_webViewHost->paintPagesWithBoundaries();
else
m_webViewHost->paintInvalidatedRegion();
@@ -631,7 +632,7 @@ void TestShell::dump()
// See if we need to draw the selection bounds rect. Selection bounds
// rect is the rect enclosing the (possibly transformed) selection.
// The rect should be drawn after everything is laid out and painted.
- if (m_layoutTestController->shouldDumpSelectionRect()) {
+ if (m_testRunner->shouldDumpSelectionRect()) {
// If there is a selection rect - draw a red 1px border enclosing rect
WebRect wr = frame->selectionBoundsRect();
if (!wr.isEmpty()) {
@@ -725,8 +726,8 @@ void TestShell::bindJSObjectsToWindow(WebFrame* frame)
{
WebTestingSupport::injectInternalsObject(frame);
m_testInterfaces->bindTo(frame);
- m_layoutTestController->bindToJavascript(frame, WebString::fromUTF8("layoutTestController"));
- m_layoutTestController->bindToJavascript(frame, WebString::fromUTF8("testRunner"));
+ m_testRunner->bindToJavascript(frame, WebString::fromUTF8("testRunner"));
+ m_testRunner->bindToJavascript(frame, WebString::fromUTF8("layoutTestController"));
}
WebViewHost* TestShell::createNewWindow(const WebKit::WebURL& url)
diff --git a/Tools/DumpRenderTree/chromium/TestShell.h b/Tools/DumpRenderTree/chromium/TestShell.h
index 005d374a2..405034a4e 100644
--- a/Tools/DumpRenderTree/chromium/TestShell.h
+++ b/Tools/DumpRenderTree/chromium/TestShell.h
@@ -32,8 +32,8 @@
#define TestShell_h
#include "AccessibilityControllerChromium.h"
+#include "DRTTestRunner.h"
#include "GamepadController.h"
-#include "LayoutTestController.h"
#include "NotificationPresenter.h"
#include "TestEventPrinter.h"
#include "TestInterfaces.h"
@@ -87,7 +87,7 @@ public:
WebKit::WebView* webView() const { return m_webView; }
// Returns the host for the main WebView.
WebViewHost* webViewHost() const { return m_webViewHost.get(); }
- LayoutTestController* layoutTestController() const { return m_layoutTestController.get(); }
+ DRTTestRunner* testRunner() const { return m_testRunner.get(); }
EventSender* eventSender() const { return m_testInterfaces->eventSender(); }
AccessibilityController* accessibilityController() const { return m_testInterfaces->accessibilityController(); }
#if ENABLE(NOTIFICATIONS)
@@ -113,15 +113,15 @@ public:
int navigationEntryCount() const;
void setFocus(WebKit::WebWidget*, bool enable);
- bool shouldDumpFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpFrameLoadCallbacks(); }
- bool shouldDumpUserGestureInFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpUserGestureInFrameLoadCallbacks(); }
- bool shouldDumpResourceLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceLoadCallbacks(); }
- bool shouldDumpResourceResponseMIMETypes() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceResponseMIMETypes(); }
+ bool shouldDumpFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpFrameLoadCallbacks(); }
+ bool shouldDumpUserGestureInFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpUserGestureInFrameLoadCallbacks(); }
+ bool shouldDumpResourceLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpResourceLoadCallbacks(); }
+ bool shouldDumpResourceResponseMIMETypes() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpResourceResponseMIMETypes(); }
void setIsLoading(bool flag) { m_isLoading = flag; }
- // Called by the LayoutTestController to signal test completion.
+ // Called by the DRTTestRunner to signal test completion.
void testFinished();
- // Called by LayoutTestController when a test hits the timeout, but does not
+ // Called by DRTTestRunner when a test hits the timeout, but does not
// cause a hang. We can avoid killing TestShell in this case and still dump
// the test results.
void testTimedOut();
@@ -211,7 +211,7 @@ private:
OwnPtr<DRTDevToolsAgent> m_drtDevToolsAgent;
OwnPtr<DRTDevToolsClient> m_drtDevToolsClient;
OwnPtr<TestInterfaces> m_testInterfaces;
- OwnPtr<LayoutTestController> m_layoutTestController;
+ OwnPtr<DRTTestRunner> m_testRunner;
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
OwnPtr<NotificationPresenter> m_notificationPresenter;
#endif
diff --git a/Tools/DumpRenderTree/chromium/WebPermissions.cpp b/Tools/DumpRenderTree/chromium/WebPermissions.cpp
index ee90a7b2c..2c7c9eee8 100644
--- a/Tools/DumpRenderTree/chromium/WebPermissions.cpp
+++ b/Tools/DumpRenderTree/chromium/WebPermissions.cpp
@@ -31,7 +31,7 @@
#include "config.h"
#include "WebPermissions.h"
-#include "LayoutTestController.h"
+#include "DRTTestRunner.h"
#include "TestShell.h"
#include "platform/WebCString.h"
#include "platform/WebURL.h"
@@ -49,7 +49,7 @@ WebPermissions::~WebPermissions()
bool WebPermissions::allowImage(WebKit::WebFrame*, bool enabledPerSettings, const WebKit::WebURL& imageURL)
{
bool allowed = enabledPerSettings && m_imagesAllowed;
- if (layoutTestController()->shouldDumpPermissionClientCallbacks())
+ if (testRunner()->shouldDumpPermissionClientCallbacks())
fprintf(stdout, "PERMISSION CLIENT: allowImage(%s): %s\n", m_shell->normalizeLayoutTestURL(imageURL.spec()).c_str(), allowed ? "true" : "false");
return allowed;
}
@@ -57,7 +57,7 @@ bool WebPermissions::allowImage(WebKit::WebFrame*, bool enabledPerSettings, cons
bool WebPermissions::allowScriptFromSource(WebKit::WebFrame*, bool enabledPerSettings, const WebKit::WebURL& scriptURL)
{
bool allowed = enabledPerSettings && m_scriptsAllowed;
- if (layoutTestController()->shouldDumpPermissionClientCallbacks())
+ if (testRunner()->shouldDumpPermissionClientCallbacks())
fprintf(stdout, "PERMISSION CLIENT: allowScriptFromSource(%s): %s\n", m_shell->normalizeLayoutTestURL(scriptURL.spec()).c_str(), allowed ? "true" : "false");
return allowed;
}
@@ -126,7 +126,7 @@ void WebPermissions::reset()
// Private functions ----------------------------------------------------------
-LayoutTestController* WebPermissions::layoutTestController() const
+DRTTestRunner* WebPermissions::testRunner() const
{
- return m_shell->layoutTestController();
+ return m_shell->testRunner();
}
diff --git a/Tools/DumpRenderTree/chromium/WebPermissions.h b/Tools/DumpRenderTree/chromium/WebPermissions.h
index 184046a0a..c625077e8 100644
--- a/Tools/DumpRenderTree/chromium/WebPermissions.h
+++ b/Tools/DumpRenderTree/chromium/WebPermissions.h
@@ -33,7 +33,7 @@
#include "WebPermissionClient.h"
-class LayoutTestController;
+class DRTTestRunner;
class TestShell;
class WebPermissions : public WebKit::WebPermissionClient {
@@ -63,7 +63,7 @@ public:
void reset();
private:
- LayoutTestController* layoutTestController() const;
+ DRTTestRunner* testRunner() const;
// Non-owning pointer. The WebPermissions instance is owned by this TestShell instance.
TestShell* m_shell;
diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp
index 115c405ec..a67d1e304 100644
--- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp
+++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -31,8 +31,8 @@
#include "config.h"
#include "WebViewHost.h"
+#include "DRTTestRunner.h"
#include "EventSender.h"
-#include "LayoutTestController.h"
#include "MockGrammarCheck.h"
#include "MockWebSpeechInputController.h"
#include "MockWebSpeechRecognizer.h"
@@ -251,9 +251,9 @@ static string textAffinityDescription(WebTextAffinity affinity)
WebView* WebViewHost::createView(WebFrame*, const WebURLRequest& request, const WebWindowFeatures&, const WebString&, WebNavigationPolicy)
{
- if (!layoutTestController()->canOpenWindows())
+ if (!testRunner()->canOpenWindows())
return 0;
- if (layoutTestController()->shouldDumpCreateView())
+ if (testRunner()->shouldDumpCreateView())
fprintf(stdout, "createView(%s)\n", URLDescription(request.url()).c_str());
return m_shell->createNewWindow(WebURL())->webView();
}
@@ -319,7 +319,7 @@ void WebViewHost::didStartLoading()
void WebViewHost::didStopLoading()
{
- if (layoutTestController()->shouldDumpProgressFinishedCallback())
+ if (testRunner()->shouldDumpProgressFinishedCallback())
fputs("postProgressFinishedNotification\n", stdout);
m_shell->setIsLoading(false);
}
@@ -329,50 +329,50 @@ void WebViewHost::didStopLoading()
bool WebViewHost::shouldBeginEditing(const WebRange& range)
{
- if (layoutTestController()->shouldDumpEditingCallbacks()) {
+ if (testRunner()->shouldDumpEditingCallbacks()) {
fputs("EDITING DELEGATE: shouldBeginEditingInDOMRange:", stdout);
printRangeDescription(range);
fputs("\n", stdout);
}
- return layoutTestController()->acceptsEditing();
+ return testRunner()->acceptsEditing();
}
bool WebViewHost::shouldEndEditing(const WebRange& range)
{
- if (layoutTestController()->shouldDumpEditingCallbacks()) {
+ if (testRunner()->shouldDumpEditingCallbacks()) {
fputs("EDITING DELEGATE: shouldEndEditingInDOMRange:", stdout);
printRangeDescription(range);
fputs("\n", stdout);
}
- return layoutTestController()->acceptsEditing();
+ return testRunner()->acceptsEditing();
}
bool WebViewHost::shouldInsertNode(const WebNode& node, const WebRange& range, WebEditingAction action)
{
- if (layoutTestController()->shouldDumpEditingCallbacks()) {
+ if (testRunner()->shouldDumpEditingCallbacks()) {
fputs("EDITING DELEGATE: shouldInsertNode:", stdout);
printNodeDescription(node, 0);
fputs(" replacingDOMRange:", stdout);
printRangeDescription(range);
printf(" givenAction:%s\n", editingActionDescription(action).c_str());
}
- return layoutTestController()->acceptsEditing();
+ return testRunner()->acceptsEditing();
}
bool WebViewHost::shouldInsertText(const WebString& text, const WebRange& range, WebEditingAction action)
{
- if (layoutTestController()->shouldDumpEditingCallbacks()) {
+ if (testRunner()->shouldDumpEditingCallbacks()) {
printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:", text.utf8().data());
printRangeDescription(range);
printf(" givenAction:%s\n", editingActionDescription(action).c_str());
}
- return layoutTestController()->acceptsEditing();
+ return testRunner()->acceptsEditing();
}
bool WebViewHost::shouldChangeSelectedRange(
const WebRange& fromRange, const WebRange& toRange, WebTextAffinity affinity, bool stillSelecting)
{
- if (layoutTestController()->shouldDumpEditingCallbacks()) {
+ if (testRunner()->shouldDumpEditingCallbacks()) {
fputs("EDITING DELEGATE: shouldChangeSelectedDOMRange:", stdout);
printRangeDescription(fromRange);
fputs(" toDOMRange:", stdout);
@@ -381,27 +381,27 @@ bool WebViewHost::shouldChangeSelectedRange(
textAffinityDescription(affinity).c_str(),
(stillSelecting ? "TRUE" : "FALSE"));
}
- return layoutTestController()->acceptsEditing();
+ return testRunner()->acceptsEditing();
}
bool WebViewHost::shouldDeleteRange(const WebRange& range)
{
- if (layoutTestController()->shouldDumpEditingCallbacks()) {
+ if (testRunner()->shouldDumpEditingCallbacks()) {
fputs("EDITING DELEGATE: shouldDeleteDOMRange:", stdout);
printRangeDescription(range);
fputs("\n", stdout);
}
- return layoutTestController()->acceptsEditing();
+ return testRunner()->acceptsEditing();
}
bool WebViewHost::shouldApplyStyle(const WebString& style, const WebRange& range)
{
- if (layoutTestController()->shouldDumpEditingCallbacks()) {
+ if (testRunner()->shouldDumpEditingCallbacks()) {
printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:", style.utf8().data());
printRangeDescription(range);
fputs("\n", stdout);
}
- return layoutTestController()->acceptsEditing();
+ return testRunner()->acceptsEditing();
}
bool WebViewHost::isSmartInsertDeleteEnabled()
@@ -416,28 +416,28 @@ bool WebViewHost::isSelectTrailingWhitespaceEnabled()
void WebViewHost::didBeginEditing()
{
- if (!layoutTestController()->shouldDumpEditingCallbacks())
+ if (!testRunner()->shouldDumpEditingCallbacks())
return;
fputs("EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification\n", stdout);
}
void WebViewHost::didChangeSelection(bool isEmptySelection)
{
- if (layoutTestController()->shouldDumpEditingCallbacks())
+ if (testRunner()->shouldDumpEditingCallbacks())
fputs("EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n", stdout);
// No need to update clipboard with the selected text in DRT.
}
void WebViewHost::didChangeContents()
{
- if (!layoutTestController()->shouldDumpEditingCallbacks())
+ if (!testRunner()->shouldDumpEditingCallbacks())
return;
fputs("EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n", stdout);
}
void WebViewHost::didEndEditing()
{
- if (!layoutTestController()->shouldDumpEditingCallbacks())
+ if (!testRunner()->shouldDumpEditingCallbacks())
return;
fputs("EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification\n", stdout);
}
@@ -561,7 +561,7 @@ bool WebViewHost::runModalPromptDialog(WebFrame* frame, const WebString& message
bool WebViewHost::runModalBeforeUnloadDialog(WebFrame*, const WebString& message)
{
printf("CONFIRM NAVIGATION: %s\n", message.utf8().data());
- return !layoutTestController()->shouldStayOnPageAfterHandlingBeforeUnload();
+ return !testRunner()->shouldStayOnPageAfterHandlingBeforeUnload();
}
void WebViewHost::showContextMenu(WebFrame*, const WebContextMenuData& contextMenuData)
@@ -581,7 +581,7 @@ WebContextMenuData* WebViewHost::lastContextMenuData() const
void WebViewHost::setStatusText(const WebString& text)
{
- if (!layoutTestController()->shouldDumpStatusCallbacks())
+ if (!testRunner()->shouldDumpStatusCallbacks())
return;
// When running tests, write to stdout.
printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", text.utf8().data());
@@ -590,7 +590,7 @@ void WebViewHost::setStatusText(const WebString& text)
void WebViewHost::startDragging(WebFrame*, const WebDragData& data, WebDragOperationsMask mask, const WebImage&, const WebPoint&)
{
WebDragData mutableDragData = data;
- if (layoutTestController()->shouldAddFileToPasteboard()) {
+ if (testRunner()->shouldAddFileToPasteboard()) {
// Add a file called DRTFakeFile to the drag&drop clipboard.
addDRTFakeFileToDataObject(&mutableDragData);
}
@@ -1055,7 +1055,7 @@ WebNavigationPolicy WebViewHost::decidePolicyForNavigation(
result = WebKit::WebNavigationPolicyIgnore;
if (m_policyDelegateShouldNotifyDone)
- layoutTestController()->policyDelegateDone();
+ testRunner()->policyDelegateDone();
return result;
}
@@ -1113,7 +1113,7 @@ void WebViewHost::didCancelClientRedirect(WebFrame* frame)
void WebViewHost::didCreateDataSource(WebFrame*, WebDataSource* ds)
{
ds->setExtraData(m_pendingExtraData.leakPtr());
- if (!layoutTestController()->deferMainResourceDataLoad())
+ if (!testRunner()->deferMainResourceDataLoad())
ds->setDeferMainResourceDataLoad(false);
}
@@ -1130,7 +1130,7 @@ void WebViewHost::didStartProvisionalLoad(WebFrame* frame)
if (!m_topLoadingFrame)
m_topLoadingFrame = frame;
- if (layoutTestController()->stopProvisionalFrameLoads()) {
+ if (testRunner()->stopProvisionalFrameLoads()) {
printFrameDescription(frame);
fputs(" - stopping load in didStartProvisionalLoadForFrame callback\n", stdout);
frame->stopLoading();
@@ -1183,11 +1183,11 @@ void WebViewHost::didReceiveTitle(WebFrame* frame, const WebString& title, WebTe
printf(" - didReceiveTitle: %s\n", title8.data());
}
- if (layoutTestController()->shouldDumpTitleChanges())
+ if (testRunner()->shouldDumpTitleChanges())
printf("TITLE CHANGED: %s\n", title8.data());
setPageTitle(title);
- layoutTestController()->setTitleTextDirection(direction);
+ testRunner()->setTitleTextDirection(direction);
}
void WebViewHost::didFinishDocumentLoad(WebFrame* frame)
@@ -1281,7 +1281,7 @@ void WebViewHost::willSendRequest(WebFrame* frame, unsigned identifier, WebURLRe
string requestURL = url.possibly_invalid_spec();
GURL mainDocumentURL = request.firstPartyForCookies();
- if (layoutTestController()->shouldDumpResourceLoadCallbacks()) {
+ if (testRunner()->shouldDumpResourceLoadCallbacks()) {
printResourceDescription(identifier);
printf(" - willSendRequest <NSURLRequest URL %s, main document URL %s,"
" http method %s> redirectResponse ",
@@ -1385,9 +1385,14 @@ void WebViewHost::openFileSystem(WebFrame* frame, WebFileSystem::Type type, long
webkit_support::OpenFileSystem(frame, type, size, create, callbacks);
}
+void WebViewHost::deleteFileSystem(WebKit::WebFrame* frame, WebKit::WebFileSystem::Type type, WebKit::WebFileSystemCallbacks* callbacks)
+{
+ webkit_support::DeleteFileSystem(frame, type, callbacks);
+}
+
bool WebViewHost::willCheckAndDispatchMessageEvent(WebFrame* source, WebSecurityOrigin target, WebDOMMessageEvent event)
{
- if (m_shell->layoutTestController()->shouldInterceptPostMessage()) {
+ if (m_shell->testRunner()->shouldInterceptPostMessage()) {
fputs("intercepted postMessage\n", stdout);
return true;
}
@@ -1638,9 +1643,9 @@ bool WebViewHost::navigate(const TestNavigationEntry& entry, bool reload)
// Private functions ----------------------------------------------------------
-LayoutTestController* WebViewHost::layoutTestController() const
+DRTTestRunner* WebViewHost::testRunner() const
{
- return m_shell->layoutTestController();
+ return m_shell->testRunner();
}
void WebViewHost::updateAddressBar(WebView* webView)
@@ -1660,7 +1665,7 @@ void WebViewHost::locationChangeDone(WebFrame* frame)
if (frame != m_topLoadingFrame)
return;
m_topLoadingFrame = 0;
- layoutTestController()->locationChangeDone();
+ testRunner()->locationChangeDone();
}
void WebViewHost::updateForCommittedLoad(WebFrame* frame, bool isNewNavigation)
@@ -1780,7 +1785,7 @@ void WebViewHost::setAddressBarURL(const WebURL&)
void WebViewHost::enterFullScreenNow()
{
- if (layoutTestController()->hasCustomFullScreenBehavior())
+ if (testRunner()->hasCustomFullScreenBehavior())
return;
webView()->willEnterFullScreen();
@@ -1789,7 +1794,7 @@ void WebViewHost::enterFullScreenNow()
void WebViewHost::exitFullScreenNow()
{
- if (layoutTestController()->hasCustomFullScreenBehavior())
+ if (testRunner()->hasCustomFullScreenBehavior())
return;
webView()->willExitFullScreen();
diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.h b/Tools/DumpRenderTree/chromium/WebViewHost.h
index 13f2e1ec5..94ed4cd8d 100644
--- a/Tools/DumpRenderTree/chromium/WebViewHost.h
+++ b/Tools/DumpRenderTree/chromium/WebViewHost.h
@@ -47,7 +47,7 @@
#include <wtf/Vector.h>
#include <wtf/text/WTFString.h>
-class LayoutTestController;
+class DRTTestRunner;
class MockWebSpeechInputController;
class MockWebSpeechRecognizer;
class SkCanvas;
@@ -264,6 +264,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient,
virtual void didRunInsecureContent(WebKit::WebFrame*, const WebKit::WebSecurityOrigin&, const WebKit::WebURL&);
virtual void didDetectXSS(WebKit::WebFrame*, const WebKit::WebURL&, bool didBlockEntirePage);
virtual void openFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, long long size, bool create, WebKit::WebFileSystemCallbacks*);
+ virtual void deleteFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, WebKit::WebFileSystemCallbacks*);
virtual bool willCheckAndDispatchMessageEvent(WebKit::WebFrame* source, WebKit::WebSecurityOrigin target, WebKit::WebDOMMessageEvent);
virtual void registerIntentService(WebKit::WebFrame*, const WebKit::WebIntentServiceInfo&);
virtual void dispatchIntent(WebKit::WebFrame*, const WebKit::WebIntentRequest&);
@@ -277,7 +278,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient,
void finishLastTextCheck();
virtual void fillSpellingSuggestionList(const WebKit::WebString& word, Vector<WebKit::WebString>* suggestions) OVERRIDE;
- // Geolocation client mocks for LayoutTestController
+ // Geolocation client mocks for DRTTestRunner
WebKit::WebGeolocationClientMock* geolocationClientMock();
// Pending task list, Note taht the method is referred from MethodTask class.
@@ -302,7 +303,7 @@ private:
CallbackMethodType m_callback;
};
- LayoutTestController* layoutTestController() const;
+ DRTTestRunner* testRunner() const;
// Called the title of the page changes.
// Can be used to update the title of the window.
diff --git a/Tools/DumpRenderTree/efl/CMakeLists.txt b/Tools/DumpRenderTree/efl/CMakeLists.txt
index 067dbd32b..7d99f073f 100644
--- a/Tools/DumpRenderTree/efl/CMakeLists.txt
+++ b/Tools/DumpRenderTree/efl/CMakeLists.txt
@@ -2,7 +2,7 @@ SET(DumpRenderTree_SOURCES
${TOOLS_DIR}/DumpRenderTree/DumpRenderTreeCommon.cpp
${TOOLS_DIR}/DumpRenderTree/CyclicRedundancyCheck.cpp
${TOOLS_DIR}/DumpRenderTree/GCController.cpp
- ${TOOLS_DIR}/DumpRenderTree/LayoutTestController.cpp
+ ${TOOLS_DIR}/DumpRenderTree/TestRunner.cpp
${TOOLS_DIR}/DumpRenderTree/PixelDumpSupport.cpp
${TOOLS_DIR}/DumpRenderTree/WorkQueue.cpp
${TOOLS_DIR}/DumpRenderTree/cairo/PixelDumpSupportCairo.cpp
@@ -15,7 +15,7 @@ SET(DumpRenderTree_SOURCES
${TOOLS_DIR}/DumpRenderTree/efl/FontManagement.cpp
${TOOLS_DIR}/DumpRenderTree/efl/GCControllerEfl.cpp
${TOOLS_DIR}/DumpRenderTree/efl/JSStringUtils.cpp
- ${TOOLS_DIR}/DumpRenderTree/efl/LayoutTestControllerEfl.cpp
+ ${TOOLS_DIR}/DumpRenderTree/efl/TestRunnerEfl.cpp
${TOOLS_DIR}/DumpRenderTree/efl/PixelDumpSupportEfl.cpp
${TOOLS_DIR}/DumpRenderTree/efl/TextInputController.cpp
${TOOLS_DIR}/DumpRenderTree/efl/WorkQueueItemEfl.cpp
@@ -40,8 +40,8 @@ SET(DumpRenderTree_LIBRARIES
${LIBXML2_LIBRARIES}
${LIBXSLT_LIBRARIES}
${SQLITE_LIBRARIES}
- ${Glib_LIBRARIES}
- ${LIBSOUP24_LIBRARIES}
+ ${GLIB_LIBRARIES}
+ ${LIBSOUP_LIBRARIES}
)
SET(DumpRenderTree_INCLUDE_DIRECTORIES
@@ -100,8 +100,8 @@ SET(DumpRenderTree_INCLUDE_DIRECTORIES
${EFLDEPS_INCLUDE_DIRS}
${EVAS_INCLUDE_DIRS}
${FONTCONFIG_INCLUDE_DIR}
- ${Glib_INCLUDE_DIRS}
- ${LIBSOUP24_INCLUDE_DIRS}
+ ${GLIB_INCLUDE_DIRS}
+ ${LIBSOUP_INCLUDE_DIRS}
)
SET(DumpRenderTree_LINK_FLAGS
@@ -109,7 +109,6 @@ SET(DumpRenderTree_LINK_FLAGS
${EDJE_LDFLAGS}
${EFLDEPS_LDFLAGS}
${EVAS_LDFLAGS}
- ${LIBSOUP24_LDFLAGS}
)
# FIXME: DOWNLOADED_FONTS_DIR should not hardcode the directory
diff --git a/Tools/DumpRenderTree/efl/DumpRenderTree.cpp b/Tools/DumpRenderTree/efl/DumpRenderTree.cpp
index 0713cb60c..c1e480134 100644
--- a/Tools/DumpRenderTree/efl/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/efl/DumpRenderTree.cpp
@@ -31,9 +31,9 @@
#include "DumpRenderTreeView.h"
#include "EventSender.h"
#include "FontManagement.h"
-#include "LayoutTestController.h"
#include "NotImplemented.h"
#include "PixelDumpSupport.h"
+#include "TestRunner.h"
#include "WebCoreSupport/DumpRenderTreeSupportEfl.h"
#include "WebCoreTestSupport.h"
#include "WorkQueue.h"
@@ -62,7 +62,7 @@ Ecore_Timer* waitToDumpWatchdog = 0;
extern Ewk_History_Item* prevTestBFItem;
// From the top-level DumpRenderTree.h
-RefPtr<LayoutTestController> gLayoutTestController;
+RefPtr<TestRunner> gTestRunner;
volatile bool done = false;
static bool dumpPixelsForCurrentTest;
@@ -85,7 +85,7 @@ static String dumpFramesAsText(Evas_Object* frame)
result.append("\n");
eina_stringshare_del(frameContents);
- if (gLayoutTestController->dumpChildFramesAsText()) {
+ if (gTestRunner->dumpChildFramesAsText()) {
Eina_List* children = DumpRenderTreeSupportEfl::frameChildren(frame);
void* iterator;
@@ -128,7 +128,7 @@ static void dumpFrameScrollPosition(Evas_Object* frame)
printf("%s", result.toString().utf8().data());
}
- if (gLayoutTestController->dumpChildFrameScrollPositions()) {
+ if (gTestRunner->dumpChildFrameScrollPositions()) {
Eina_List* children = DumpRenderTreeSupportEfl::frameChildren(frame);
void* iterator;
@@ -215,29 +215,29 @@ static inline bool isGlobalHistoryTest(const String& cTestPathOrURL)
return cTestPathOrURL.contains("/globalhistory/");
}
-static void createLayoutTestController(const String& testURL, const String& expectedPixelHash)
+static void createTestRunner(const String& testURL, const String& expectedPixelHash)
{
- gLayoutTestController =
- LayoutTestController::create(std::string(testURL.utf8().data()),
+ gTestRunner =
+ TestRunner::create(std::string(testURL.utf8().data()),
std::string(expectedPixelHash.utf8().data()));
topLoadingFrame = 0;
done = false;
- gLayoutTestController->setIconDatabaseEnabled(false);
+ gTestRunner->setIconDatabaseEnabled(false);
if (shouldLogFrameLoadDelegates(testURL))
- gLayoutTestController->setDumpFrameLoadCallbacks(true);
+ gTestRunner->setDumpFrameLoadCallbacks(true);
- gLayoutTestController->setDeveloperExtrasEnabled(true);
+ gTestRunner->setDeveloperExtrasEnabled(true);
if (shouldOpenWebInspector(testURL))
- gLayoutTestController->showWebInspector();
+ gTestRunner->showWebInspector();
- gLayoutTestController->setDumpHistoryDelegateCallbacks(isGlobalHistoryTest(testURL));
+ gTestRunner->setDumpHistoryDelegateCallbacks(isGlobalHistoryTest(testURL));
if (shouldDumpAsText(testURL)) {
- gLayoutTestController->setDumpAsText(true);
- gLayoutTestController->setGeneratePixelResults(false);
+ gTestRunner->setDumpAsText(true);
+ gTestRunner->setGeneratePixelResults(false);
}
}
@@ -268,14 +268,14 @@ static void runTest(const char* inputLine)
const String testURL = getFinalTestURL(testPathOrURL);
browser->resetDefaultsToConsistentValues();
- createLayoutTestController(testURL, expectedPixelHash);
+ createTestRunner(testURL, expectedPixelHash);
WorkQueue::shared()->clear();
WorkQueue::shared()->setFrozen(false);
const bool isSVGW3CTest = testURL.contains("svg/W3C-SVG-1.1");
- const int width = isSVGW3CTest ? 480 : LayoutTestController::maxViewWidth;
- const int height = isSVGW3CTest ? 360 : LayoutTestController::maxViewHeight;
+ const int width = isSVGW3CTest ? 480 : TestRunner::maxViewWidth;
+ const int height = isSVGW3CTest ? 360 : TestRunner::maxViewHeight;
evas_object_resize(browser->mainView(), width, height);
if (prevTestBFItem)
@@ -288,8 +288,8 @@ static void runTest(const char* inputLine)
ecore_main_loop_begin();
- gLayoutTestController->closeWebInspector();
- gLayoutTestController->setDeveloperExtrasEnabled(false);
+ gTestRunner->closeWebInspector();
+ gTestRunner->setDeveloperExtrasEnabled(false);
browser->clearExtraViews();
@@ -298,7 +298,7 @@ static void runTest(const char* inputLine)
ewk_view_uri_set(browser->mainView(), "about:blank");
- gLayoutTestController.clear();
+ gTestRunner.clear();
sendPixelResultsEOF();
}
@@ -320,15 +320,15 @@ static void adjustOutputTypeByMimeType(const Evas_Object* frame)
{
const String responseMimeType(DumpRenderTreeSupportEfl::responseMimeType(frame));
if (responseMimeType == "text/plain") {
- gLayoutTestController->setDumpAsText(true);
- gLayoutTestController->setGeneratePixelResults(false);
+ gTestRunner->setDumpAsText(true);
+ gTestRunner->setGeneratePixelResults(false);
}
}
static void dumpFrameContentsAsText(Evas_Object* frame)
{
String result;
- if (gLayoutTestController->dumpAsText())
+ if (gTestRunner->dumpAsText())
result = dumpFramesAsText(frame);
else
result = DumpRenderTreeSupportEfl::renderTreeDump(frame);
@@ -338,17 +338,17 @@ static void dumpFrameContentsAsText(Evas_Object* frame)
static bool shouldDumpFrameScrollPosition()
{
- return !gLayoutTestController->dumpAsText() && !gLayoutTestController->dumpDOMAsWebArchive() && !gLayoutTestController->dumpSourceAsWebArchive();
+ return !gTestRunner->dumpAsText() && !gTestRunner->dumpDOMAsWebArchive() && !gTestRunner->dumpSourceAsWebArchive();
}
static bool shouldDumpPixelsAndCompareWithExpected()
{
- return dumpPixelsForCurrentTest && gLayoutTestController->generatePixelResults() && !gLayoutTestController->dumpDOMAsWebArchive() && !gLayoutTestController->dumpSourceAsWebArchive();
+ return dumpPixelsForCurrentTest && gTestRunner->generatePixelResults() && !gTestRunner->dumpDOMAsWebArchive() && !gTestRunner->dumpSourceAsWebArchive();
}
static bool shouldDumpBackForwardList()
{
- return gLayoutTestController->dumpBackForwardList();
+ return gTestRunner->dumpBackForwardList();
}
static bool initEfl()
@@ -412,7 +412,7 @@ void dump()
}
if (shouldDumpPixelsAndCompareWithExpected())
- dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash());
+ dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash());
done = true;
ecore_main_loop_quit();
diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
index 0d1fa4b63..c167aca51 100644
--- a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
+++ b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
@@ -34,8 +34,8 @@
#include "EventSender.h"
#include "GCController.h"
#include "KURL.h"
-#include "LayoutTestController.h"
#include "NotImplemented.h"
+#include "TestRunner.h"
#include "TextInputController.h"
#include "WebCoreSupport/DumpRenderTreeSupportEfl.h"
#include "WebCoreTestSupport.h"
@@ -148,7 +148,7 @@ Evas_Object* DumpRenderTreeChrome::createWebInspectorView()
Evas_Object* mainFrame = ewk_view_frame_main_get(inspectorView);
evas_object_smart_callback_add(mainFrame, "load,finished", onInspectorFrameLoadFinished, 0);
- evas_object_resize(inspectorView, LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight);
+ evas_object_resize(inspectorView, TestRunner::maxViewWidth, TestRunner::maxViewHeight);
evas_object_show(inspectorView);
evas_object_focus_set(inspectorView, true);
@@ -418,12 +418,12 @@ void DumpRenderTreeChrome::onWindowObjectCleared(void* userData, Evas_Object*, v
{
Ewk_Window_Object_Cleared_Event* objectClearedInfo = static_cast<Ewk_Window_Object_Cleared_Event*>(eventInfo);
JSValueRef exception = 0;
- ASSERT(gLayoutTestController);
+ ASSERT(gTestRunner);
GCController* gcController = static_cast<GCController*>(userData);
ASSERT(gcController);
- gLayoutTestController->makeWindowObject(objectClearedInfo->context, objectClearedInfo->windowObject, &exception);
+ gTestRunner->makeWindowObject(objectClearedInfo->context, objectClearedInfo->windowObject, &exception);
ASSERT(!exception);
gcController->makeWindowObject(objectClearedInfo->context, objectClearedInfo->windowObject, &exception);
@@ -456,7 +456,7 @@ void DumpRenderTreeChrome::onLoadStarted(void*, Evas_Object* view, void* eventIn
Eina_Bool DumpRenderTreeChrome::processWork(void*)
{
- if (WorkQueue::shared()->processWork() && !gLayoutTestController->waitToDump())
+ if (WorkQueue::shared()->processWork() && !gTestRunner->waitToDump())
dump();
return ECORE_CALLBACK_CANCEL;
@@ -467,7 +467,7 @@ void DumpRenderTreeChrome::topLoadingFrameLoadFinished()
topLoadingFrame = 0;
WorkQueue::shared()->setFrozen(true);
- if (gLayoutTestController->waitToDump())
+ if (gTestRunner->waitToDump())
return;
if (WorkQueue::shared()->count())
@@ -478,7 +478,7 @@ void DumpRenderTreeChrome::topLoadingFrameLoadFinished()
void DumpRenderTreeChrome::onStatusbarTextSet(void*, Evas_Object*, void* eventInfo)
{
- if (!gLayoutTestController->dumpStatusCallbacks())
+ if (!gTestRunner->dumpStatusCallbacks())
return;
const char* statusbarText = static_cast<const char*>(eventInfo);
@@ -487,7 +487,7 @@ void DumpRenderTreeChrome::onStatusbarTextSet(void*, Evas_Object*, void* eventIn
void DumpRenderTreeChrome::onFrameIconChanged(void*, Evas_Object* frame, void*)
{
- if (!done && gLayoutTestController->dumpIconChanges()) {
+ if (!done && gTestRunner->dumpIconChanges()) {
const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame));
printf("%s - didChangeIcons\n", frameName.utf8().data());
}
@@ -497,19 +497,19 @@ void DumpRenderTreeChrome::onFrameTitleChanged(void*, Evas_Object* frame, void*
{
const Ewk_Text_With_Direction* titleText = static_cast<const Ewk_Text_With_Direction*>(eventInfo);
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame));
printf("%s - didReceiveTitle: %s\n", frameName.utf8().data(), (titleText && titleText->string) ? titleText->string : "");
}
- if (!done && gLayoutTestController->dumpTitleChanges())
+ if (!done && gTestRunner->dumpTitleChanges())
printf("TITLE CHANGED: %s\n", (titleText && titleText->string) ? titleText->string : "");
- if (!done && gLayoutTestController->dumpHistoryDelegateCallbacks())
+ if (!done && gTestRunner->dumpHistoryDelegateCallbacks())
printf("WebView updated the title for history URL \"%s\" to \"%s\".\n", ewk_frame_uri_get(frame)
, (titleText && titleText->string) ? titleText->string : "");
- gLayoutTestController->setTitleTextDirection(titleText->direction == EWK_TEXT_DIRECTION_LEFT_TO_RIGHT ? "ltr" : "rtl");
+ gTestRunner->setTitleTextDirection(titleText->direction == EWK_TEXT_DIRECTION_LEFT_TO_RIGHT ? "ltr" : "rtl");
}
void DumpRenderTreeChrome::onDocumentLoadFinished(void*, Evas_Object*, void* eventInfo)
@@ -517,7 +517,7 @@ void DumpRenderTreeChrome::onDocumentLoadFinished(void*, Evas_Object*, void* eve
const Evas_Object* frame = static_cast<Evas_Object*>(eventInfo);
const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame));
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didFinishDocumentLoadForFrame\n", frameName.utf8().data());
else if (!done) {
const unsigned pendingFrameUnloadEvents = DumpRenderTreeSupportEfl::pendingUnloadEventCount(frame);
@@ -530,19 +530,19 @@ void DumpRenderTreeChrome::onWillSendRequest(void*, Evas_Object*, void* eventInf
{
Ewk_Frame_Resource_Messages* messages = static_cast<Ewk_Frame_Resource_Messages*>(eventInfo);
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks())
+ if (!done && gTestRunner->dumpResourceLoadCallbacks())
printf("%s - willSendRequest %s redirectResponse %s\n",
m_dumpAssignedUrls.contains(messages->request->identifier) ? m_dumpAssignedUrls.get(messages->request->identifier).data() : "<unknown>",
descriptionSuitableForTestResult(messages->request).data(),
descriptionSuitableForTestResult(messages->redirect_response).data());
- if (!done && gLayoutTestController->willSendRequestReturnsNull()) {
- // As requested by the LayoutTestController, don't perform the request.
+ if (!done && gTestRunner->willSendRequestReturnsNull()) {
+ // As requested by the TestRunner, don't perform the request.
messages->request->url = 0;
return;
}
- if (!done && gLayoutTestController->willSendRequestReturnsNullOnRedirect() && messages->redirect_response) {
+ if (!done && gTestRunner->willSendRequestReturnsNullOnRedirect() && messages->redirect_response) {
printf("Returning null for this redirect\n");
messages->request->url = 0;
return;
@@ -560,7 +560,7 @@ void DumpRenderTreeChrome::onWillSendRequest(void*, Evas_Object*, void* eventInf
return;
}
- const std::string& destination = gLayoutTestController->redirectionDestinationForURL(url.string().utf8().data());
+ const std::string& destination = gTestRunner->redirectionDestinationForURL(url.string().utf8().data());
if (destination.length())
messages->request->url = strdup(destination.c_str());
}
@@ -569,7 +569,7 @@ void DumpRenderTreeChrome::onWebViewOnloadEvent(void*, Evas_Object*, void* event
{
const Evas_Object* frame = static_cast<Evas_Object*>(eventInfo);
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame));
printf("%s - didHandleOnloadEventsForFrame\n", frameName.utf8().data());
}
@@ -577,13 +577,13 @@ void DumpRenderTreeChrome::onWebViewOnloadEvent(void*, Evas_Object*, void* event
void DumpRenderTreeChrome::onInsecureContentRun(void*, Evas_Object*, void*)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf("didRunInsecureContent\n");
}
void DumpRenderTreeChrome::onInsecureContentDisplayed(void*, Evas_Object*, void*)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf("didDisplayInsecureContent\n");
}
@@ -608,7 +608,7 @@ void DumpRenderTreeChrome::onFrameCreated(void*, Evas_Object*, void* eventInfo)
void DumpRenderTreeChrome::onWebViewNavigatedWithData(void*, Evas_Object*, void* eventInfo)
{
- if (done || !gLayoutTestController->dumpHistoryDelegateCallbacks())
+ if (done || !gTestRunner->dumpHistoryDelegateCallbacks())
return;
ASSERT(eventInfo);
@@ -631,7 +631,7 @@ void DumpRenderTreeChrome::onWebViewNavigatedWithData(void*, Evas_Object*, void*
void DumpRenderTreeChrome::onWebViewServerRedirect(void*, Evas_Object*, void* eventInfo)
{
- if (done || !gLayoutTestController->dumpHistoryDelegateCallbacks())
+ if (done || !gTestRunner->dumpHistoryDelegateCallbacks())
return;
ASSERT(eventInfo);
@@ -641,7 +641,7 @@ void DumpRenderTreeChrome::onWebViewServerRedirect(void*, Evas_Object*, void* ev
void DumpRenderTreeChrome::onWebViewClientRedirect(void*, Evas_Object*, void* eventInfo)
{
- if (done || !gLayoutTestController->dumpHistoryDelegateCallbacks())
+ if (done || !gTestRunner->dumpHistoryDelegateCallbacks())
return;
ASSERT(eventInfo);
@@ -651,7 +651,7 @@ void DumpRenderTreeChrome::onWebViewClientRedirect(void*, Evas_Object*, void* ev
void DumpRenderTreeChrome::onWebViewPopulateVisitedLinks(void*, Evas_Object* ewkView, void*)
{
- if (done || !gLayoutTestController->dumpHistoryDelegateCallbacks())
+ if (done || !gTestRunner->dumpHistoryDelegateCallbacks())
return;
printf("Asked to populate visited links for WebView \"%s\"\n", ewk_view_uri_get(ewkView));
@@ -678,7 +678,7 @@ void DumpRenderTreeChrome::onInspectorFrameLoadFinished(void*, Evas_Object*, voi
void DumpRenderTreeChrome::onFrameProvisionalLoad(void*, Evas_Object* frame, void*)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame));
printf("%s - didStartProvisionalLoadForFrame\n", frameName.utf8().data());
}
@@ -686,7 +686,7 @@ void DumpRenderTreeChrome::onFrameProvisionalLoad(void*, Evas_Object* frame, voi
if (!topLoadingFrame && !done)
topLoadingFrame = frame;
- if (!done && gLayoutTestController->stopProvisionalFrameLoads()) {
+ if (!done && gTestRunner->stopProvisionalFrameLoads()) {
const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame));
printf("%s - stopping load in didStartProvisionalLoadForFrame callback\n", frameName.utf8().data());
ewk_frame_stop(frame);
@@ -697,7 +697,7 @@ void DumpRenderTreeChrome::onFrameProvisionalLoadFailed(void*, Evas_Object* fram
{
m_provisionalLoadFailedFrame = frame;
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame));
printf("%s - didFailProvisionalLoadWithError\n", frameName.utf8().data());
}
@@ -705,7 +705,7 @@ void DumpRenderTreeChrome::onFrameProvisionalLoadFailed(void*, Evas_Object* fram
void DumpRenderTreeChrome::onFrameLoadCommitted(void*, Evas_Object* frame, void*)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame));
printf("%s - didCommitLoadForFrame\n", frameName.utf8().data());
}
@@ -721,10 +721,10 @@ void DumpRenderTreeChrome::onFrameLoadFinished(void*, Evas_Object* frame, void*
if (error)
return;
- if (!done && gLayoutTestController->dumpProgressFinishedCallback())
+ if (!done && gTestRunner->dumpProgressFinishedCallback())
printf("postProgressFinishedNotification\n");
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame));
printf("%s - didFinishLoadForFrame\n", frameName.utf8().data());
}
@@ -738,7 +738,7 @@ void DumpRenderTreeChrome::onFrameLoadError(void*, Evas_Object* frame, void*)
// In case of provisional load error, we receive both "load,error" and "load,provisional,failed"
// signals. m_provisionalLoadFailedFrame is used to avoid printing twice the load error: in
// onFrameProvisionalLoadFailed() and onFrameLoadError().
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks() && frame != m_provisionalLoadFailedFrame) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks() && frame != m_provisionalLoadFailedFrame) {
const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame));
printf("%s - didFailLoadWithError\n", frameName.utf8().data());
}
@@ -752,7 +752,7 @@ void DumpRenderTreeChrome::onFrameLoadError(void*, Evas_Object* frame, void*)
void DumpRenderTreeChrome::onFrameRedirectCancelled(void*, Evas_Object* frame, void*)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame));
printf("%s - didCancelClientRedirectForFrame\n", frameName.utf8().data());
}
@@ -760,7 +760,7 @@ void DumpRenderTreeChrome::onFrameRedirectCancelled(void*, Evas_Object* frame, v
void DumpRenderTreeChrome::onFrameRedirectForProvisionalLoad(void*, Evas_Object* frame, void*)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame));
printf("%s - didReceiveServerRedirectForProvisionalLoadForFrame\n", frameName.utf8().data());
}
@@ -770,7 +770,7 @@ void DumpRenderTreeChrome::onFrameRedirectRequested(void*, Evas_Object* frame, v
{
const char* url = static_cast<const char*>(eventInfo);
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame));
printf("%s - willPerformClientRedirectToURL: %s \n", frameName.utf8().data(), pathSuitableForTestResult(url).data());
}
@@ -778,7 +778,7 @@ void DumpRenderTreeChrome::onFrameRedirectRequested(void*, Evas_Object* frame, v
void DumpRenderTreeChrome::onDidDetectXSS(void*, Evas_Object* view, void*)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf("didDetectXSS\n");
}
@@ -786,14 +786,14 @@ void DumpRenderTreeChrome::onResponseReceived(void*, Evas_Object*, void* eventIn
{
Ewk_Frame_Resource_Response* response = static_cast<Ewk_Frame_Resource_Response*>(eventInfo);
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
+ if (!done && gTestRunner->dumpResourceLoadCallbacks()) {
CString responseDescription(descriptionSuitableForTestResult(response));
printf("%s - didReceiveResponse %s\n",
m_dumpAssignedUrls.contains(response->identifier) ? m_dumpAssignedUrls.get(response->identifier).data() : "<unknown>",
responseDescription.data());
}
- if (!done && gLayoutTestController->dumpResourceResponseMIMETypes()) {
+ if (!done && gTestRunner->dumpResourceResponseMIMETypes()) {
printf("%s has MIME type %s\n",
KURL(ParsedURLString, response->url).lastPathComponent().utf8().data(),
response->mime_type);
@@ -804,7 +804,7 @@ void DumpRenderTreeChrome::onResourceLoadFinished(void*, Evas_Object*, void* eve
{
unsigned long identifier = *static_cast<unsigned long*>(eventInfo);
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks())
+ if (!done && gTestRunner->dumpResourceLoadCallbacks())
printf("%s - didFinishLoading\n",
(m_dumpAssignedUrls.contains(identifier) ? m_dumpAssignedUrls.take(identifier).data() : "<unknown>"));
}
@@ -813,7 +813,7 @@ void DumpRenderTreeChrome::onResourceLoadFailed(void*, Evas_Object*, void* event
{
Ewk_Frame_Load_Error* error = static_cast<Ewk_Frame_Load_Error*>(eventInfo);
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks())
+ if (!done && gTestRunner->dumpResourceLoadCallbacks())
printf("%s - didFailLoadingWithError: %s\n",
(m_dumpAssignedUrls.contains(error->resource_identifier) ? m_dumpAssignedUrls.take(error->resource_identifier).data() : "<unknown>"),
descriptionSuitableForTestResult(error).data());
@@ -823,7 +823,7 @@ void DumpRenderTreeChrome::onNewResourceRequest(void*, Evas_Object*, void* event
{
Ewk_Frame_Resource_Request* request = static_cast<Ewk_Frame_Resource_Request*>(eventInfo);
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks())
+ if (!done && gTestRunner->dumpResourceLoadCallbacks())
m_dumpAssignedUrls.add(request->identifier, pathSuitableForTestResult(request->url));
}
diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp b/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp
index eb15a8409..f801c3cef 100644
--- a/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp
+++ b/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp
@@ -30,7 +30,7 @@
#include "DumpRenderTree.h"
#include "DumpRenderTreeChrome.h"
#include "DumpRenderTreeEfl.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include <EWebKit.h>
#include <Ecore.h>
#include <Eina.h>
@@ -95,7 +95,7 @@ static Eina_Bool onJavaScriptPrompt(Ewk_View_Smart_Data*, Evas_Object*, const ch
static Evas_Object* onWindowCreate(Ewk_View_Smart_Data*, Eina_Bool, const Ewk_Window_Features*)
{
- return gLayoutTestController->canOpenWindows() ? browser->createNewWindow() : 0;
+ return gTestRunner->canOpenWindows() ? browser->createNewWindow() : 0;
}
static Eina_Bool onWindowCloseDelayed(void* data)
@@ -113,7 +113,7 @@ static void onWindowClose(Ewk_View_Smart_Data* smartData)
static uint64_t onExceededDatabaseQuota(Ewk_View_Smart_Data* smartData, Evas_Object* frame, const char* databaseName, uint64_t currentSize, uint64_t expectedSize)
{
- if (!gLayoutTestController->dumpDatabaseCallbacks())
+ if (!gTestRunner->dumpDatabaseCallbacks())
return 0;
Ewk_Security_Origin* origin = ewk_frame_security_origin_get(frame);
@@ -129,7 +129,7 @@ static uint64_t onExceededDatabaseQuota(Ewk_View_Smart_Data* smartData, Evas_Obj
static int64_t onExceededApplicationCacheQuota(Ewk_View_Smart_Data*, Ewk_Security_Origin *origin, int64_t defaultOriginQuota, int64_t totalSpaceNeeded)
{
- if (gLayoutTestController->dumpApplicationCacheDelegateCallbacks()) {
+ if (gTestRunner->dumpApplicationCacheDelegateCallbacks()) {
// For example, numbers from 30000 - 39999 will output as 30000.
// Rounding up or down does not really matter for these tests. It's
// sufficient to just get a range of 10000 to determine if we were
@@ -142,7 +142,7 @@ static int64_t onExceededApplicationCacheQuota(Ewk_View_Smart_Data*, Ewk_Securit
truncatedSpaceNeeded);
}
- if (gLayoutTestController->disallowIncreaseForApplicationCacheQuota())
+ if (gTestRunner->disallowIncreaseForApplicationCacheQuota())
return 0;
return defaultOriginQuota;
@@ -187,8 +187,8 @@ static Eina_Bool onNavigationPolicyDecision(Ewk_View_Smart_Data*, Ewk_Frame_Reso
printf("Policy delegate: attempt to load %s with navigation type '%s'\n", urlSuitableForTestResult(request->url).utf8().data(),
navigationTypeToString(navigationType));
- if (gLayoutTestController)
- gLayoutTestController->notifyDone();
+ if (gTestRunner)
+ gTestRunner->notifyDone();
return policyDelegatePermissive;
}
diff --git a/Tools/DumpRenderTree/efl/EditingCallbacks.cpp b/Tools/DumpRenderTree/efl/EditingCallbacks.cpp
index 896d83f7e..7a03cddd1 100644
--- a/Tools/DumpRenderTree/efl/EditingCallbacks.cpp
+++ b/Tools/DumpRenderTree/efl/EditingCallbacks.cpp
@@ -33,10 +33,10 @@
#include "DumpRenderTree.h"
#include "EditorClientEfl.h"
#include "EditorInsertAction.h"
-#include "LayoutTestController.h"
#include "Node.h"
#include "Range.h"
#include "StylePropertySet.h"
+#include "TestRunner.h"
#include "TextAffinity.h"
#include <wtf/text/CString.h>
#include <wtf/text/WTFString.h>
@@ -87,7 +87,7 @@ static const char* selectionAffinityString(WebCore::EAffinity affinity)
void shouldBeginEditing(void*, Evas_Object*, void* eventInfo)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks()) {
+ if (!done && gTestRunner->dumpEditingCallbacks()) {
WebCore::Range* range = static_cast<WebCore::Range*>(eventInfo);
printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", dumpRange(range).utf8().data());
}
@@ -95,7 +95,7 @@ void shouldBeginEditing(void*, Evas_Object*, void* eventInfo)
void shouldEndEditing(void*, Evas_Object*, void* eventInfo)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks()) {
+ if (!done && gTestRunner->dumpEditingCallbacks()) {
WebCore::Range* range = static_cast<WebCore::Range*>(eventInfo);
printf("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n", dumpRange(range).utf8().data());
}
@@ -103,7 +103,7 @@ void shouldEndEditing(void*, Evas_Object*, void* eventInfo)
void shouldInsertNode(void*, Evas_Object*, void* eventInfo)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks()) {
+ if (!done && gTestRunner->dumpEditingCallbacks()) {
Ewk_Should_Insert_Node_Event* shouldInsertNodeEvent = static_cast<Ewk_Should_Insert_Node_Event*>(eventInfo);
printf("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n",
dumpPath(shouldInsertNodeEvent->node).utf8().data(), dumpRange(shouldInsertNodeEvent->range).utf8().data(),
@@ -113,7 +113,7 @@ void shouldInsertNode(void*, Evas_Object*, void* eventInfo)
void shouldInsertText(void*, Evas_Object*, void* eventInfo)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks()) {
+ if (!done && gTestRunner->dumpEditingCallbacks()) {
Ewk_Should_Insert_Text_Event* shouldInsertTextEvent = static_cast<Ewk_Should_Insert_Text_Event*>(eventInfo);
printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n",
shouldInsertTextEvent->text, dumpRange(shouldInsertTextEvent->range).utf8().data(), insertActionString(shouldInsertTextEvent->action));
@@ -122,7 +122,7 @@ void shouldInsertText(void*, Evas_Object*, void* eventInfo)
void shouldDeleteRange(void*, Evas_Object*, void* eventInfo)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks()) {
+ if (!done && gTestRunner->dumpEditingCallbacks()) {
WebCore::Range* range = static_cast<WebCore::Range*>(eventInfo);
printf("EDITING DELEGATE: shouldDeleteDOMRange:%s\n", dumpRange(range).utf8().data());
}
@@ -130,7 +130,7 @@ void shouldDeleteRange(void*, Evas_Object*, void* eventInfo)
void shouldChangeSelectedRange(void*, Evas_Object*, void* eventInfo)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks()) {
+ if (!done && gTestRunner->dumpEditingCallbacks()) {
Ewk_Should_Change_Selected_Range_Event* shouldChangeSelectedRangeEvent = static_cast<Ewk_Should_Change_Selected_Range_Event*>(eventInfo);
printf("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n",
dumpRange(shouldChangeSelectedRangeEvent->fromRange).utf8().data(), dumpRange(shouldChangeSelectedRangeEvent->toRange).utf8().data(),
@@ -140,7 +140,7 @@ void shouldChangeSelectedRange(void*, Evas_Object*, void* eventInfo)
void shouldApplyStyle(void*, Evas_Object*, void* eventInfo)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks()) {
+ if (!done && gTestRunner->dumpEditingCallbacks()) {
Ewk_Should_Apply_Style_Event* shouldApplyStyleEvent = static_cast<Ewk_Should_Apply_Style_Event*>(eventInfo);
printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n",
shouldApplyStyleEvent->style->asText().utf8().data(), dumpRange(shouldApplyStyleEvent->range).utf8().data());
@@ -149,25 +149,25 @@ void shouldApplyStyle(void*, Evas_Object*, void* eventInfo)
void editingBegan(void*, Evas_Object*, void*)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification\n");
}
void userChangedContents(void*, Evas_Object*, void*)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n");
}
void editingEnded(void*, Evas_Object*, void*)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification\n");
}
void selectionChanged(void*, Evas_Object*, void*)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n");
}
diff --git a/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp b/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp
index 71891dcb4..1b1dca326 100644
--- a/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp
+++ b/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp
@@ -35,7 +35,7 @@
*/
#include "config.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include "DumpRenderTree.h"
#include "DumpRenderTreeChrome.h"
@@ -62,16 +62,16 @@ enum {
WebCacheModelPrimaryWebBrowser = 2
};
-LayoutTestController::~LayoutTestController()
+TestRunner::~TestRunner()
{
}
-void LayoutTestController::addDisallowedURL(JSStringRef)
+void TestRunner::addDisallowedURL(JSStringRef)
{
notImplemented();
}
-void LayoutTestController::clearBackForwardList()
+void TestRunner::clearBackForwardList()
{
Ewk_History* history = ewk_view_history_get(browser->mainView());
if (!history)
@@ -84,51 +84,51 @@ void LayoutTestController::clearBackForwardList()
ewk_history_item_free(item);
}
-JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef)
+JSStringRef TestRunner::copyDecodedHostName(JSStringRef)
{
notImplemented();
return 0;
}
-JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef)
+JSStringRef TestRunner::copyEncodedHostName(JSStringRef)
{
notImplemented();
return 0;
}
-void LayoutTestController::dispatchPendingLoadRequests()
+void TestRunner::dispatchPendingLoadRequests()
{
// FIXME: Implement for testing fix for 6727495
notImplemented();
}
-void LayoutTestController::display()
+void TestRunner::display()
{
displayWebView();
}
-void LayoutTestController::keepWebHistory()
+void TestRunner::keepWebHistory()
{
notImplemented();
}
-JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
+JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
{
return DumpRenderTreeSupportEfl::computedStyleIncludingVisitedInfo(context, value);
}
-JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
+JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const
{
notImplemented();
return JSRetainPtr<JSStringRef>(Adopt, JSStringCreateWithUTF8CString(""));
}
-int LayoutTestController::numberOfPages(float pageWidth, float pageHeight)
+int TestRunner::numberOfPages(float pageWidth, float pageHeight)
{
return DumpRenderTreeSupportEfl::numberOfPages(browser->mainFrame(), pageWidth, pageHeight);
}
-JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const
+JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const
{
const String property = DumpRenderTreeSupportEfl::pageProperty(browser->mainFrame(), propertyName, pageNumber);
if (property.isEmpty())
@@ -138,7 +138,7 @@ JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* property
return propertyValue;
}
-JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
+JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
{
String pageSizeAndMargins = DumpRenderTreeSupportEfl::pageSizeAndMarginsInPixels(browser->mainFrame(), pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft);
@@ -149,7 +149,7 @@ JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pa
return returnValue;
}
-size_t LayoutTestController::webHistoryItemCount()
+size_t TestRunner::webHistoryItemCount()
{
const Ewk_History* history = ewk_view_history_get(browser->mainView());
if (!history)
@@ -158,12 +158,12 @@ size_t LayoutTestController::webHistoryItemCount()
return ewk_history_back_list_length(history) + ewk_history_forward_list_length(history);
}
-unsigned LayoutTestController::workerThreadCount() const
+unsigned TestRunner::workerThreadCount() const
{
return DumpRenderTreeSupportEfl::workerThreadCount();
}
-void LayoutTestController::notifyDone()
+void TestRunner::notifyDone()
{
if (m_waitToDump && !topLoadingFrame && !WorkQueue::shared()->count())
dump();
@@ -171,7 +171,7 @@ void LayoutTestController::notifyDone()
waitForPolicy = false;
}
-JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef url)
+JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef url)
{
String requestedUrl(url->characters(), url->length());
String resourceRoot;
@@ -197,7 +197,7 @@ JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSSt
return JSStringCreateWithUTF8CString(fullPathToUrl.utf8().data());
}
-void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target)
+void TestRunner::queueLoad(JSStringRef url, JSStringRef target)
{
WebCore::KURL baseURL(WebCore::KURL(), String::fromUTF8(ewk_frame_uri_get(browser->mainFrame())));
WebCore::KURL absoluteURL(baseURL, WTF::String(url->ustring().impl()));
@@ -208,35 +208,35 @@ void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target)
WorkQueue::shared()->queue(new LoadItem(jsAbsoluteURL.get(), target));
}
-void LayoutTestController::setAcceptsEditing(bool acceptsEditing)
+void TestRunner::setAcceptsEditing(bool acceptsEditing)
{
ewk_view_editable_set(browser->mainView(), acceptsEditing);
}
-void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
+void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
{
ewk_cookies_policy_set(alwaysAcceptCookies ? EWK_COOKIE_JAR_ACCEPT_ALWAYS : EWK_COOKIE_JAR_ACCEPT_NEVER);
}
-void LayoutTestController::setCustomPolicyDelegate(bool enabled, bool permissive)
+void TestRunner::setCustomPolicyDelegate(bool enabled, bool permissive)
{
policyDelegateEnabled = enabled;
policyDelegatePermissive = permissive;
}
-void LayoutTestController::waitForPolicyDelegate()
+void TestRunner::waitForPolicyDelegate()
{
setCustomPolicyDelegate(true, false);
waitForPolicy = true;
setWaitToDump(true);
}
-void LayoutTestController::setScrollbarPolicy(JSStringRef, JSStringRef)
+void TestRunner::setScrollbarPolicy(JSStringRef, JSStringRef)
{
notImplemented();
}
-void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains)
+void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains)
{
WebCore::KURL kurl;
kurl.setProtocol(String(protocol->characters(), protocol->length()));
@@ -245,7 +245,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigi
ewk_security_policy_whitelist_origin_add(sourceOrigin->ustring().utf8().data(), kurl.string().utf8().data(), includeSubdomains);
}
-void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains)
+void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains)
{
WebCore::KURL kurl;
kurl.setProtocol(String(protocol->characters(), protocol->length()));
@@ -254,17 +254,17 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOr
ewk_security_policy_whitelist_origin_del(sourceOrigin->ustring().utf8().data(), kurl.string().utf8().data(), includeSubdomains);
}
-void LayoutTestController::setMainFrameIsFirstResponder(bool)
+void TestRunner::setMainFrameIsFirstResponder(bool)
{
notImplemented();
}
-void LayoutTestController::setTabKeyCyclesThroughElements(bool)
+void TestRunner::setTabKeyCyclesThroughElements(bool)
{
notImplemented();
}
-void LayoutTestController::setUseDashboardCompatibilityMode(bool)
+void TestRunner::setUseDashboardCompatibilityMode(bool)
{
notImplemented();
}
@@ -272,13 +272,13 @@ void LayoutTestController::setUseDashboardCompatibilityMode(bool)
static CString gUserStyleSheet;
static bool gUserStyleSheetEnabled = true;
-void LayoutTestController::setUserStyleSheetEnabled(bool flag)
+void TestRunner::setUserStyleSheetEnabled(bool flag)
{
gUserStyleSheetEnabled = flag;
ewk_view_setting_user_stylesheet_set(browser->mainView(), flag ? gUserStyleSheet.data() : 0);
}
-void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
+void TestRunner::setUserStyleSheetLocation(JSStringRef path)
{
gUserStyleSheet = path->ustring().utf8();
@@ -286,12 +286,12 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
setUserStyleSheetEnabled(true);
}
-void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value)
+void TestRunner::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value)
{
DumpRenderTreeSupportEfl::setValueForUser(context, nodeObject, WTF::String(value->ustring().impl()));
}
-void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
+void TestRunner::setViewModeMediaFeature(JSStringRef mode)
{
Evas_Object* view = browser->mainView();
if (!view)
@@ -309,12 +309,12 @@ void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
ewk_view_mode_set(view, EWK_VIEW_MODE_MINIMIZED);
}
-void LayoutTestController::setWindowIsKey(bool)
+void TestRunner::setWindowIsKey(bool)
{
notImplemented();
}
-void LayoutTestController::setSmartInsertDeleteEnabled(bool flag)
+void TestRunner::setSmartInsertDeleteEnabled(bool flag)
{
DumpRenderTreeSupportEfl::setSmartInsertDeleteEnabled(browser->mainView(), flag);
}
@@ -322,11 +322,11 @@ void LayoutTestController::setSmartInsertDeleteEnabled(bool flag)
static Eina_Bool waitToDumpWatchdogFired(void*)
{
waitToDumpWatchdog = 0;
- gLayoutTestController->waitToDumpWatchdogTimerFired();
+ gTestRunner->waitToDumpWatchdogTimerFired();
return ECORE_CALLBACK_CANCEL;
}
-void LayoutTestController::setWaitToDump(bool waitUntilDone)
+void TestRunner::setWaitToDump(bool waitUntilDone)
{
static const double timeoutSeconds = 30;
@@ -335,116 +335,116 @@ void LayoutTestController::setWaitToDump(bool waitUntilDone)
waitToDumpWatchdog = ecore_timer_add(timeoutSeconds, waitToDumpWatchdogFired, 0);
}
-int LayoutTestController::windowCount()
+int TestRunner::windowCount()
{
return browser->extraViews().size() + 1; // + 1 for the main view.
}
-void LayoutTestController::setPrivateBrowsingEnabled(bool flag)
+void TestRunner::setPrivateBrowsingEnabled(bool flag)
{
ewk_view_setting_private_browsing_set(browser->mainView(), flag);
}
-void LayoutTestController::setJavaScriptCanAccessClipboard(bool flag)
+void TestRunner::setJavaScriptCanAccessClipboard(bool flag)
{
ewk_view_setting_scripts_can_access_clipboard_set(browser->mainView(), flag);
}
-void LayoutTestController::setXSSAuditorEnabled(bool flag)
+void TestRunner::setXSSAuditorEnabled(bool flag)
{
ewk_view_setting_enable_xss_auditor_set(browser->mainView(), flag);
}
-void LayoutTestController::setFrameFlatteningEnabled(bool flag)
+void TestRunner::setFrameFlatteningEnabled(bool flag)
{
ewk_view_setting_enable_frame_flattening_set(browser->mainView(), flag);
}
-void LayoutTestController::setSpatialNavigationEnabled(bool flag)
+void TestRunner::setSpatialNavigationEnabled(bool flag)
{
ewk_view_setting_spatial_navigation_set(browser->mainView(), flag);
}
-void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool)
+void TestRunner::setAllowUniversalAccessFromFileURLs(bool)
{
notImplemented();
}
-void LayoutTestController::setAllowFileAccessFromFileURLs(bool)
+void TestRunner::setAllowFileAccessFromFileURLs(bool)
{
notImplemented();
}
-void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
+void TestRunner::setAuthorAndUserStylesEnabled(bool flag)
{
DumpRenderTreeSupportEfl::setAuthorAndUserStylesEnabled(browser->mainView(), flag);
}
-void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled)
+void TestRunner::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled)
{
DumpRenderTreeSupportEfl::setAutofilled(context, nodeObject, autofilled);
}
-void LayoutTestController::disableImageLoading()
+void TestRunner::disableImageLoading()
{
ewk_view_setting_auto_load_images_set(browser->mainView(), EINA_FALSE);
}
-void LayoutTestController::setMockDeviceOrientation(bool, double, bool, double, bool, double)
+void TestRunner::setMockDeviceOrientation(bool, double, bool, double, bool, double)
{
// FIXME: Implement for DeviceOrientation layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=30335.
notImplemented();
}
-void LayoutTestController::setMockGeolocationPosition(double, double, double)
+void TestRunner::setMockGeolocationPosition(double, double, double)
{
// FIXME: Implement for Geolocation layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=28264.
notImplemented();
}
-void LayoutTestController::setMockGeolocationError(int, JSStringRef)
+void TestRunner::setMockGeolocationError(int, JSStringRef)
{
// FIXME: Implement for Geolocation layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=28264.
notImplemented();
}
-void LayoutTestController::setGeolocationPermission(bool allow)
+void TestRunner::setGeolocationPermission(bool allow)
{
// FIXME: Implement for Geolocation layout tests.
setGeolocationPermissionCommon(allow);
}
-int LayoutTestController::numberOfPendingGeolocationPermissionRequests()
+int TestRunner::numberOfPendingGeolocationPermissionRequests()
{
// FIXME: Implement for Geolocation layout tests.
return -1;
}
-void LayoutTestController::addMockSpeechInputResult(JSStringRef, double, JSStringRef)
+void TestRunner::addMockSpeechInputResult(JSStringRef, double, JSStringRef)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
notImplemented();
}
-void LayoutTestController::setMockSpeechInputDumpRect(bool)
+void TestRunner::setMockSpeechInputDumpRect(bool)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
notImplemented();
}
-void LayoutTestController::startSpeechInput(JSContextRef inputElement)
+void TestRunner::startSpeechInput(JSContextRef inputElement)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
notImplemented();
}
-void LayoutTestController::setIconDatabaseEnabled(bool enabled)
+void TestRunner::setIconDatabaseEnabled(bool enabled)
{
ewk_settings_icon_database_path_set(0);
@@ -467,34 +467,34 @@ void LayoutTestController::setIconDatabaseEnabled(bool enabled)
ewk_settings_icon_database_path_set(databasePath.utf8().data());
}
-void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag)
+void TestRunner::setSelectTrailingWhitespaceEnabled(bool flag)
{
DumpRenderTreeSupportEfl::setSelectTrailingWhitespaceEnabled(browser->mainView(), flag);
}
-void LayoutTestController::setPopupBlockingEnabled(bool flag)
+void TestRunner::setPopupBlockingEnabled(bool flag)
{
ewk_view_setting_scripts_can_open_windows_set(browser->mainView(), !flag);
}
-void LayoutTestController::setPluginsEnabled(bool flag)
+void TestRunner::setPluginsEnabled(bool flag)
{
ewk_view_setting_enable_plugins_set(browser->mainView(), flag);
}
-bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id)
+bool TestRunner::elementDoesAutoCompleteForElementWithId(JSStringRef id)
{
const String elementId(id->ustring().impl());
const Evas_Object* mainFrame = browser->mainFrame();
return DumpRenderTreeSupportEfl::elementDoesAutoCompleteForElementWithId(mainFrame, elementId);
}
-void LayoutTestController::execCommand(JSStringRef name, JSStringRef value)
+void TestRunner::execCommand(JSStringRef name, JSStringRef value)
{
DumpRenderTreeSupportEfl::executeCoreCommandByName(browser->mainView(), name->ustring().utf8().data(), value->ustring().utf8().data());
}
-bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray)
+bool TestRunner::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray)
{
JSRetainPtr<JSStringRef> lengthPropertyName(Adopt, JSStringCreateWithUTF8CString("length"));
JSValueRef lengthValue = JSObjectGetProperty(context, optionsArray, lengthPropertyName.get(), 0);
@@ -528,12 +528,12 @@ bool LayoutTestController::findString(JSContextRef context, JSStringRef target,
return DumpRenderTreeSupportEfl::findString(browser->mainView(), WTF::String(target->ustring().impl()), options);
}
-bool LayoutTestController::isCommandEnabled(JSStringRef name)
+bool TestRunner::isCommandEnabled(JSStringRef name)
{
return DumpRenderTreeSupportEfl::isCommandEnabled(browser->mainView(), name->ustring().utf8().data());
}
-void LayoutTestController::setCacheModel(int cacheModel)
+void TestRunner::setCacheModel(int cacheModel)
{
unsigned int cacheTotalCapacity;
unsigned int cacheMinDeadCapacity;
@@ -574,124 +574,124 @@ void LayoutTestController::setCacheModel(int cacheModel)
ewk_settings_page_cache_capacity_set(pageCacheCapacity);
}
-void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef)
+void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef)
{
notImplemented();
}
-void LayoutTestController::clearPersistentUserStyleSheet()
+void TestRunner::clearPersistentUserStyleSheet()
{
notImplemented();
}
-void LayoutTestController::clearAllApplicationCaches()
+void TestRunner::clearAllApplicationCaches()
{
ewk_settings_application_cache_clear();
}
-void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota)
+void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota)
{
Ewk_Security_Origin* origin = ewk_frame_security_origin_get(browser->mainFrame());
ewk_security_origin_application_cache_quota_set(origin, quota);
ewk_security_origin_free(origin);
}
-void LayoutTestController::clearApplicationCacheForOrigin(OpaqueJSString* url)
+void TestRunner::clearApplicationCacheForOrigin(OpaqueJSString* url)
{
Ewk_Security_Origin* origin = ewk_security_origin_new_from_string(url->ustring().utf8().data());
ewk_security_origin_application_cache_clear(origin);
ewk_security_origin_free(origin);
}
-long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef)
+long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef)
{
// FIXME: Implement to support getting disk usage in bytes for an origin.
notImplemented();
return 0;
}
-JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context)
+JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context)
{
// FIXME: Implement to get origins that contain application caches.
notImplemented();
return JSValueMakeUndefined(context);
}
-long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef)
+long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef)
{
notImplemented();
return 0;
}
-void LayoutTestController::clearAllDatabases()
+void TestRunner::clearAllDatabases()
{
ewk_web_database_remove_all();
}
-void LayoutTestController::setDatabaseQuota(unsigned long long quota)
+void TestRunner::setDatabaseQuota(unsigned long long quota)
{
Ewk_Security_Origin* origin = ewk_frame_security_origin_get(browser->mainFrame());
ewk_security_origin_web_database_quota_set(origin, quota);
ewk_security_origin_free(origin);
}
-JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context)
+JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context)
{
notImplemented();
return JSValueMakeUndefined(context);
}
-void LayoutTestController::deleteAllLocalStorage()
+void TestRunner::deleteAllLocalStorage()
{
notImplemented();
}
-void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef)
+void TestRunner::deleteLocalStorageForOrigin(JSStringRef)
{
notImplemented();
}
-void LayoutTestController::observeStorageTrackerNotifications(unsigned)
+void TestRunner::observeStorageTrackerNotifications(unsigned)
{
notImplemented();
}
-void LayoutTestController::syncLocalStorage()
+void TestRunner::syncLocalStorage()
{
notImplemented();
}
-void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme)
+void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme)
{
DumpRenderTreeSupportEfl::setDomainRelaxationForbiddenForURLScheme(forbidden, WTF::String(scheme->ustring().impl()));
}
-void LayoutTestController::goBack()
+void TestRunner::goBack()
{
ewk_frame_back(browser->mainFrame());
}
-void LayoutTestController::setDefersLoading(bool defers)
+void TestRunner::setDefersLoading(bool defers)
{
DumpRenderTreeSupportEfl::setDefersLoading(browser->mainView(), defers);
}
-void LayoutTestController::setAppCacheMaximumSize(unsigned long long size)
+void TestRunner::setAppCacheMaximumSize(unsigned long long size)
{
ewk_settings_application_cache_max_quota_set(size);
}
-bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
+bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
{
return DumpRenderTreeSupportEfl::pauseAnimation(browser->mainFrame(), animationName->ustring().utf8().data(), elementId->ustring().utf8().data(), time);
}
-bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
+bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
{
return DumpRenderTreeSupportEfl::pauseTransition(browser->mainFrame(), propertyName->ustring().utf8().data(), elementId->ustring().utf8().data(), time);
}
-unsigned LayoutTestController::numberOfActiveAnimations() const
+unsigned TestRunner::numberOfActiveAnimations() const
{
return DumpRenderTreeSupportEfl::activeAnimationsCount(browser->mainFrame());
}
@@ -706,7 +706,7 @@ static inline int toInt(JSStringRef value)
return atoi(value->ustring().utf8().data());
}
-void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value)
+void TestRunner::overridePreference(JSStringRef key, JSStringRef value)
{
if (equals(key, "WebKitJavaScriptEnabled"))
ewk_view_setting_enable_scripts_set(browser->mainView(), toBool(value));
@@ -735,56 +735,56 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value
else if (equals(key, "WebKitWebAudioEnabled"))
ewk_view_setting_web_audio_set(browser->mainView(), toBool(value));
else
- fprintf(stderr, "LayoutTestController::overridePreference tried to override unknown preference '%s'.\n", value->ustring().utf8().data());
+ fprintf(stderr, "TestRunner::overridePreference tried to override unknown preference '%s'.\n", value->ustring().utf8().data());
}
-void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
+void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
{
DumpRenderTreeSupportEfl::addUserScript(browser->mainView(), String(source->ustring().impl()), runAtStart, allFrames);
}
-void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
+void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames)
{
DumpRenderTreeSupportEfl::addUserStyleSheet(browser->mainView(), WTF::String(source->ustring().impl()), allFrames);
}
-void LayoutTestController::setDeveloperExtrasEnabled(bool enabled)
+void TestRunner::setDeveloperExtrasEnabled(bool enabled)
{
ewk_view_setting_enable_developer_extras_set(browser->mainView(), enabled);
}
-void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool)
+void TestRunner::setAsynchronousSpellCheckingEnabled(bool)
{
notImplemented();
}
-void LayoutTestController::showWebInspector()
+void TestRunner::showWebInspector()
{
ewk_view_web_inspector_show(browser->mainView());
browser->waitInspectorLoadFinished();
}
-void LayoutTestController::closeWebInspector()
+void TestRunner::closeWebInspector()
{
ewk_view_web_inspector_close(browser->mainView());
}
-void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script)
+void TestRunner::evaluateInWebInspector(long callId, JSStringRef script)
{
DumpRenderTreeSupportEfl::evaluateInWebInspector(browser->mainView(), callId, String(script->ustring().impl()));
}
-void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned, JSObjectRef, JSStringRef)
+void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned, JSObjectRef, JSStringRef)
{
notImplemented();
}
-void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
+void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
{
DumpRenderTreeSupportEfl::evaluateScriptInIsolatedWorld(browser->mainFrame(), worldID, globalObject, String(script->ustring().impl()));
}
-void LayoutTestController::removeAllVisitedLinks()
+void TestRunner::removeAllVisitedLinks()
{
Ewk_History* history = ewk_view_history_get(browser->mainView());
if (!history)
@@ -793,27 +793,27 @@ void LayoutTestController::removeAllVisitedLinks()
ewk_history_clear(history);
}
-bool LayoutTestController::callShouldCloseOnWebView()
+bool TestRunner::callShouldCloseOnWebView()
{
return DumpRenderTreeSupportEfl::callShouldCloseOnWebView(browser->mainFrame());
}
-void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef, JSStringRef)
+void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef, JSStringRef)
{
notImplemented();
}
-void LayoutTestController::apiTestGoToCurrentBackForwardItem()
+void TestRunner::apiTestGoToCurrentBackForwardItem()
{
notImplemented();
}
-void LayoutTestController::setWebViewEditable(bool)
+void TestRunner::setWebViewEditable(bool)
{
ewk_frame_editable_set(browser->mainFrame(), EINA_TRUE);
}
-JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
+JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
{
String markerTextChar = DumpRenderTreeSupportEfl::markerTextForListItem(context, nodeObject);
if (markerTextChar.isEmpty())
@@ -823,27 +823,27 @@ JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRe
return markerText;
}
-void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
+void TestRunner::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
{
notImplemented();
}
-void LayoutTestController::abortModal()
+void TestRunner::abortModal()
{
notImplemented();
}
-void LayoutTestController::setSerializeHTTPLoads(bool serialize)
+void TestRunner::setSerializeHTTPLoads(bool serialize)
{
DumpRenderTreeSupportEfl::setSerializeHTTPLoads(serialize);
}
-void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval)
+void TestRunner::setMinimumTimerInterval(double minimumTimerInterval)
{
ewk_view_setting_minimum_timer_interval_set(browser->mainView(), minimumTimerInterval);
}
-void LayoutTestController::setTextDirection(JSStringRef direction)
+void TestRunner::setTextDirection(JSStringRef direction)
{
Ewk_Text_Direction ewkDirection;
if (JSStringIsEqualToUTF8CString(direction, "auto"))
@@ -853,43 +853,43 @@ void LayoutTestController::setTextDirection(JSStringRef direction)
else if (JSStringIsEqualToUTF8CString(direction, "ltr"))
ewkDirection = EWK_TEXT_DIRECTION_LEFT_TO_RIGHT;
else {
- fprintf(stderr, "LayoutTestController::setTextDirection called with unknown direction: '%s'.\n", direction->ustring().utf8().data());
+ fprintf(stderr, "TestRunner::setTextDirection called with unknown direction: '%s'.\n", direction->ustring().utf8().data());
return;
}
ewk_view_text_direction_set(browser->mainView(), ewkDirection);
}
-void LayoutTestController::addChromeInputField()
+void TestRunner::addChromeInputField()
{
notImplemented();
}
-void LayoutTestController::removeChromeInputField()
+void TestRunner::removeChromeInputField()
{
notImplemented();
}
-void LayoutTestController::focusWebView()
+void TestRunner::focusWebView()
{
notImplemented();
}
-void LayoutTestController::setBackingScaleFactor(double)
+void TestRunner::setBackingScaleFactor(double)
{
notImplemented();
}
-void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title)
+void TestRunner::simulateDesktopNotificationClick(JSStringRef title)
{
}
-void LayoutTestController::resetPageVisibility()
+void TestRunner::resetPageVisibility()
{
ewk_view_visibility_state_set(browser->mainView(), EWK_PAGE_VISIBILITY_STATE_VISIBLE, true);
}
-void LayoutTestController::setPageVisibility(const char* visibility)
+void TestRunner::setPageVisibility(const char* visibility)
{
String newVisibility(visibility);
if (newVisibility == "visible")
@@ -902,12 +902,12 @@ void LayoutTestController::setPageVisibility(const char* visibility)
ewk_view_visibility_state_set(browser->mainView(), EWK_PAGE_VISIBILITY_STATE_PREVIEW, false);
}
-void LayoutTestController::setAutomaticLinkDetectionEnabled(bool)
+void TestRunner::setAutomaticLinkDetectionEnabled(bool)
{
notImplemented();
}
-void LayoutTestController::sendWebIntentResponse(JSStringRef response)
+void TestRunner::sendWebIntentResponse(JSStringRef response)
{
Ewk_Intent_Request* request = browser->currentIntentRequest();
if (!request)
@@ -916,12 +916,12 @@ void LayoutTestController::sendWebIntentResponse(JSStringRef response)
DumpRenderTreeSupportEfl::sendWebIntentResponse(request, response);
}
-void LayoutTestController::deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data)
+void TestRunner::deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data)
{
DumpRenderTreeSupportEfl::deliverWebIntent(browser->mainFrame(), action, type, data);
}
-void LayoutTestController::setStorageDatabaseIdleInterval(double)
+void TestRunner::setStorageDatabaseIdleInterval(double)
{
notImplemented();
}
diff --git a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
index fae866609..75986d82e 100644
--- a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
@@ -36,9 +36,9 @@
#include "EditingCallbacks.h"
#include "EventSender.h"
#include "GCController.h"
-#include "LayoutTestController.h"
#include "PixelDumpSupport.h"
#include "SelfScrollingWebKitWebView.h"
+#include "TestRunner.h"
#include "TextInputController.h"
#include "WebCoreSupport/DumpRenderTreeSupportGtk.h"
#include "WebCoreTestSupport.h"
@@ -78,7 +78,7 @@ static int dumpTree = 1;
static int useTimeoutWatchdog = 1;
AccessibilityController* axController = 0;
-RefPtr<LayoutTestController> gLayoutTestController;
+RefPtr<TestRunner> gTestRunner;
static GCController* gcController = 0;
static WebKitWebView* webView;
static GtkWidget* window;
@@ -140,7 +140,7 @@ void dumpFrameScrollPosition(WebKitWebFrame* frame)
printf("scrolled to %ld,%ld\n", x, y);
}
- if (gLayoutTestController->dumpChildFrameScrollPositions()) {
+ if (gTestRunner->dumpChildFrameScrollPositions()) {
GSList* children = DumpRenderTreeSupportGtk::getFrameChildren(frame);
for (GSList* child = children; child; child = g_slist_next(child))
dumpFrameScrollPosition(static_cast<WebKitWebFrame*>(child->data));
@@ -292,7 +292,7 @@ static gchar* dumpFramesAsText(WebKitWebFrame* frame)
result = g_strdup_printf("\n--------\nFrame: '%s'\n--------\n%s\n", frameName, innerText.data());
}
- if (gLayoutTestController->dumpChildFramesAsText()) {
+ if (gTestRunner->dumpChildFramesAsText()) {
GSList* children = DumpRenderTreeSupportGtk::getFrameChildren(frame);
for (GSList* child = children; child; child = g_slist_next(child)) {
GOwnPtr<gchar> childData(dumpFramesAsText(static_cast<WebKitWebFrame*>(child->data)));
@@ -574,12 +574,12 @@ void dump()
gchar* responseMimeType = webkit_web_frame_get_response_mime_type(mainFrame);
if (g_str_equal(responseMimeType, "text/plain")) {
- gLayoutTestController->setDumpAsText(true);
- gLayoutTestController->setGeneratePixelResults(false);
+ gTestRunner->setDumpAsText(true);
+ gTestRunner->setGeneratePixelResults(false);
}
g_free(responseMimeType);
- if (gLayoutTestController->dumpAsText())
+ if (gTestRunner->dumpAsText())
result = dumpFramesAsText(mainFrame);
else {
// Widget resizing is done asynchronously in GTK+. We pump the main
@@ -596,11 +596,11 @@ void dump()
if (!result) {
const char* errorMessage;
- if (gLayoutTestController->dumpAsText())
+ if (gTestRunner->dumpAsText())
errorMessage = "[documentElement innerText]";
- else if (gLayoutTestController->dumpDOMAsWebArchive())
+ else if (gTestRunner->dumpDOMAsWebArchive())
errorMessage = "[[mainFrame DOMDocument] webArchive]";
- else if (gLayoutTestController->dumpSourceAsWebArchive())
+ else if (gTestRunner->dumpSourceAsWebArchive())
errorMessage = "[[mainFrame dataSource] webArchive]";
else
errorMessage = "[mainFrame renderTreeAsExternalRepresentation]";
@@ -608,10 +608,10 @@ void dump()
} else {
printf("%s", result);
g_free(result);
- if (!gLayoutTestController->dumpAsText() && !gLayoutTestController->dumpDOMAsWebArchive() && !gLayoutTestController->dumpSourceAsWebArchive())
+ if (!gTestRunner->dumpAsText() && !gTestRunner->dumpDOMAsWebArchive() && !gTestRunner->dumpSourceAsWebArchive())
dumpFrameScrollPosition(mainFrame);
- if (gLayoutTestController->dumpBackForwardList())
+ if (gTestRunner->dumpBackForwardList())
dumpBackForwardListForAllWebViews();
}
@@ -624,11 +624,11 @@ void dump()
}
if (dumpPixelsForCurrentTest
- && gLayoutTestController->generatePixelResults()
- && !gLayoutTestController->dumpDOMAsWebArchive()
- && !gLayoutTestController->dumpSourceAsWebArchive()) {
+ && gTestRunner->generatePixelResults()
+ && !gTestRunner->dumpDOMAsWebArchive()
+ && !gTestRunner->dumpSourceAsWebArchive()) {
DumpRenderTreeSupportGtk::forceWebViewPaint(webView);
- dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash());
+ dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash());
}
// FIXME: call displayWebView here when we support --paint
@@ -706,22 +706,22 @@ static void runTest(const string& inputLine)
resetDefaultsToConsistentValues();
- gLayoutTestController = LayoutTestController::create(testURL, command.expectedPixelHash);
+ gTestRunner = TestRunner::create(testURL, command.expectedPixelHash);
topLoadingFrame = 0;
done = false;
- gLayoutTestController->setIconDatabaseEnabled(false);
+ gTestRunner->setIconDatabaseEnabled(false);
if (shouldLogFrameLoadDelegates(testURL))
- gLayoutTestController->setDumpFrameLoadCallbacks(true);
+ gTestRunner->setDumpFrameLoadCallbacks(true);
if (shouldEnableDeveloperExtras(testURL)) {
- gLayoutTestController->setDeveloperExtrasEnabled(true);
+ gTestRunner->setDeveloperExtrasEnabled(true);
if (shouldOpenWebInspector(testURL))
- gLayoutTestController->showWebInspector();
+ gTestRunner->showWebInspector();
if (shouldDumpAsText(testURL)) {
- gLayoutTestController->setDumpAsText(true);
- gLayoutTestController->setGeneratePixelResults(false);
+ gTestRunner->setDumpAsText(true);
+ gTestRunner->setGeneratePixelResults(false);
}
}
@@ -731,8 +731,8 @@ static void runTest(const string& inputLine)
bool isSVGW3CTest = (testURL.find("svg/W3C-SVG-1.1") != string::npos);
GtkAllocation size;
size.x = size.y = 0;
- size.width = isSVGW3CTest ? 480 : LayoutTestController::maxViewWidth;
- size.height = isSVGW3CTest ? 360 : LayoutTestController::maxViewHeight;
+ size.width = isSVGW3CTest ? 480 : TestRunner::maxViewWidth;
+ size.height = isSVGW3CTest ? 360 : TestRunner::maxViewHeight;
gtk_window_resize(GTK_WINDOW(window), size.width, size.height);
gtk_widget_size_allocate(container, &size);
@@ -753,12 +753,12 @@ static void runTest(const string& inputLine)
// If developer extras enabled Web Inspector may have been open by the test.
if (shouldEnableDeveloperExtras(testURL)) {
- gLayoutTestController->closeWebInspector();
- gLayoutTestController->setDeveloperExtrasEnabled(false);
+ gTestRunner->closeWebInspector();
+ gTestRunner->setDeveloperExtrasEnabled(false);
}
// Also check if we still have opened webViews and free them.
- if (gLayoutTestController->closeRemainingWindowsWhenComplete() || webViewList) {
+ if (gTestRunner->closeRemainingWindowsWhenComplete() || webViewList) {
while (webViewList) {
g_object_unref(WEBKIT_WEB_VIEW(webViewList->data));
webViewList = g_slist_next(webViewList);
@@ -772,7 +772,7 @@ static void runTest(const string& inputLine)
// A blank load seems to be necessary to reset state after certain tests.
webkit_web_view_open(webView, "about:blank");
- gLayoutTestController.clear();
+ gTestRunner.clear();
// terminate the (possibly empty) pixels block after all the state reset
sendPixelResultsEOF();
@@ -789,7 +789,7 @@ void webViewLoadStarted(WebKitWebView* view, WebKitWebFrame* frame, void*)
static gboolean processWork(void* data)
{
// if we finish all the commands, we're ready to dump state
- if (WorkQueue::shared()->processWork() && !gLayoutTestController->waitToDump())
+ if (WorkQueue::shared()->processWork() && !gTestRunner->waitToDump())
dump();
return FALSE;
@@ -827,7 +827,7 @@ static void webViewLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void
// so we can use it here in the DRT to provide the correct dump.
if (frame != topLoadingFrame)
return;
- if (gLayoutTestController->dumpProgressFinishedCallback())
+ if (gTestRunner->dumpProgressFinishedCallback())
printf("postProgressFinishedNotification\n");
}
@@ -838,7 +838,7 @@ static gboolean webViewLoadError(WebKitWebView*, WebKitWebFrame*, gchar*, gpoint
static void webViewDocumentLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void*)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
char* frameName = getFrameNameSuitableForTestResult(view, frame);
printf("%s - didFinishDocumentLoadForFrame\n", frameName);
g_free(frameName);
@@ -854,7 +854,7 @@ static void webViewDocumentLoadFinished(WebKitWebView* view, WebKitWebFrame* fra
static void webViewOnloadEvent(WebKitWebView* view, WebKitWebFrame* frame, void*)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
char* frameName = getFrameNameSuitableForTestResult(view, frame);
printf("%s - didHandleOnloadEventsForFrame\n", frameName);
g_free(frameName);
@@ -871,9 +871,9 @@ static void addControllerToWindow(JSContextRef context, JSObjectRef windowObject
static void webViewWindowObjectCleared(WebKitWebView* view, WebKitWebFrame* frame, JSGlobalContextRef context, JSObjectRef windowObject, gpointer data)
{
JSValueRef exception = 0;
- ASSERT(gLayoutTestController);
+ ASSERT(gTestRunner);
- gLayoutTestController->makeWindowObject(context, windowObject, &exception);
+ gTestRunner->makeWindowObject(context, windowObject, &exception);
ASSERT(!exception);
gcController->makeWindowObject(context, windowObject, &exception);
@@ -940,7 +940,7 @@ static gboolean webViewScriptConfirm(WebKitWebView* view, WebKitWebFrame* frame,
static void webViewTitleChanged(WebKitWebView* view, WebKitWebFrame* frame, const gchar* title, gpointer data)
{
- if (gLayoutTestController->dumpTitleChanges() && !done)
+ if (gTestRunner->dumpTitleChanges() && !done)
printf("TITLE CHANGED: %s\n", title ? title : "");
}
@@ -950,7 +950,7 @@ static bool webViewNavigationPolicyDecisionRequested(WebKitWebView* view, WebKit
WebKitWebPolicyDecision* policyDecision)
{
// Use the default handler if we're not waiting for policy,
- // i.e., LayoutTestController::waitForPolicyDelegate
+ // i.e., TestRunner::waitForPolicyDelegate
if (!waitForPolicy)
return FALSE;
@@ -985,7 +985,7 @@ static bool webViewNavigationPolicyDecisionRequested(WebKitWebView* view, WebKit
g_free(typeDescription);
webkit_web_policy_decision_ignore(policyDecision);
- gLayoutTestController->notifyDone();
+ gTestRunner->notifyDone();
return TRUE;
}
@@ -994,7 +994,7 @@ static void webViewStatusBarTextChanged(WebKitWebView* view, const gchar* messag
{
// Are we doing anything wrong? One test that does not call
// dumpStatusCallbacks gets true here
- if (gLayoutTestController->dumpStatusCallbacks())
+ if (gTestRunner->dumpStatusCallbacks())
printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", message);
}
@@ -1015,7 +1015,7 @@ static void databaseQuotaExceeded(WebKitWebView* view, WebKitWebFrame* frame, We
ASSERT(database);
WebKitSecurityOrigin* origin = webkit_web_database_get_security_origin(database);
- if (gLayoutTestController->dumpDatabaseCallbacks()) {
+ if (gTestRunner->dumpDatabaseCallbacks()) {
printf("UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%s, %s, %i} database:%s\n",
webkit_security_origin_get_protocol(origin),
webkit_security_origin_get_host(origin),
@@ -1028,9 +1028,9 @@ static void databaseQuotaExceeded(WebKitWebView* view, WebKitWebFrame* frame, We
static bool
geolocationPolicyDecisionRequested(WebKitWebView*, WebKitWebFrame*, WebKitGeolocationPolicyDecision* decision)
{
- if (!gLayoutTestController->isGeolocationPermissionSet())
+ if (!gTestRunner->isGeolocationPermissionSet())
return FALSE;
- if (gLayoutTestController->geolocationPermission())
+ if (gTestRunner->geolocationPermission())
webkit_geolocation_policy_allow(decision);
else
webkit_geolocation_policy_deny(decision);
@@ -1070,7 +1070,7 @@ static void topLoadingFrameLoadFinished()
{
topLoadingFrame = 0;
WorkQueue::shared()->setFrozen(true); // first complete load freezes the queue for the rest of this test
- if (gLayoutTestController->waitToDump())
+ if (gTestRunner->waitToDump())
return;
if (WorkQueue::shared()->count())
@@ -1083,7 +1083,7 @@ static void webFrameLoadStatusNotified(WebKitWebFrame* frame, gpointer user_data
{
WebKitLoadStatus loadStatus = webkit_web_frame_get_load_status(frame);
- if (gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (gTestRunner->dumpFrameLoadCallbacks()) {
GOwnPtr<char> frameName(getFrameNameSuitableForTestResult(webkit_web_frame_get_web_view(frame), frame));
switch (loadStatus) {
@@ -1126,7 +1126,8 @@ static CString pathFromSoupURI(SoupURI* uri)
return CString(uriString.get());
}
- GOwnPtr<gchar> pathDirname(g_path_get_basename(g_path_get_dirname(uri->path)));
+ GOwnPtr<gchar> parentPath(g_path_get_dirname(uri->path));
+ GOwnPtr<gchar> pathDirname(g_path_get_basename(parentPath.get()));
GOwnPtr<gchar> pathBasename(g_path_get_basename(uri->path));
GOwnPtr<gchar> urlPath(g_strdup_printf("%s/%s", pathDirname.get(), pathBasename.get()));
return CString(urlPath.get());
@@ -1249,13 +1250,13 @@ static void willSendRequestCallback(WebKitWebView* webView, WebKitWebFrame* webF
{
- if (!done && gLayoutTestController->willSendRequestReturnsNull()) {
- // As requested by the LayoutTestController, don't perform the request.
+ if (!done && gTestRunner->willSendRequestReturnsNull()) {
+ // As requested by the TestRunner, don't perform the request.
webkit_network_request_set_uri(request, "about:blank");
return;
}
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks())
+ if (!done && gTestRunner->dumpResourceLoadCallbacks())
printf("%s - willSendRequest %s redirectResponse %s\n",
convertNetworkRequestToURLPath(request).data(),
descriptionSuitableForTestResult(request).data(),
@@ -1279,7 +1280,7 @@ static void willSendRequestCallback(WebKitWebView* webView, WebKitWebFrame* webF
soup_uri_free(uri);
if (soupMessage) {
- const set<string>& clearHeaders = gLayoutTestController->willSendRequestClearHeaders();
+ const set<string>& clearHeaders = gTestRunner->willSendRequestClearHeaders();
for (set<string>::const_iterator header = clearHeaders.begin(); header != clearHeaders.end(); ++header)
soup_message_headers_remove(soupMessage->request_headers, header->c_str());
}
@@ -1288,7 +1289,7 @@ static void willSendRequestCallback(WebKitWebView* webView, WebKitWebFrame* webF
static void didReceiveResponse(WebKitWebView* webView, WebKitWebFrame*, WebKitWebResource* webResource, WebKitNetworkResponse* response)
{
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
+ if (!done && gTestRunner->dumpResourceLoadCallbacks()) {
CString responseDescription(descriptionSuitableForTestResult(response));
CString path(convertWebResourceToURLPath(webResource));
printf("%s - didReceiveResponse %s\n", path.data(), responseDescription.data());
@@ -1300,13 +1301,13 @@ static void didReceiveResponse(WebKitWebView* webView, WebKitWebFrame*, WebKitWe
static void didFinishLoading(WebKitWebView* webView, WebKitWebFrame* webFrame, WebKitWebResource* webResource)
{
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks())
+ if (!done && gTestRunner->dumpResourceLoadCallbacks())
printf("%s - didFinishLoading\n", descriptionSuitableForTestResult(webView, webFrame, webResource).data());
}
static void didFailLoadingWithError(WebKitWebView* webView, WebKitWebFrame* webFrame, WebKitWebResource* webResource, GError* webError)
{
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
+ if (!done && gTestRunner->dumpResourceLoadCallbacks()) {
CString webErrorString(descriptionSuitableForTestResult(webError, webResource));
printf("%s - didFailLoadingWithError: %s\n", descriptionSuitableForTestResult(webView, webFrame, webResource).data(),
webErrorString.data());
@@ -1315,7 +1316,7 @@ static void didFailLoadingWithError(WebKitWebView* webView, WebKitWebFrame* webF
static void didRunInsecureContent(WebKitWebFrame*, WebKitSecurityOrigin*, const char* url)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf("didRunInsecureContent\n");
}
@@ -1386,11 +1387,11 @@ static WebKitWebView* createWebView()
static WebKitWebView* webViewCreate(WebKitWebView* view, WebKitWebFrame* frame)
{
- if (!gLayoutTestController->canOpenWindows())
+ if (!gTestRunner->canOpenWindows())
return 0;
// Make sure that waitUntilDone has been called.
- ASSERT(gLayoutTestController->waitToDump());
+ ASSERT(gTestRunner->waitToDump());
WebKitWebView* newWebView = createWebView();
g_object_ref_sink(G_OBJECT(newWebView));
diff --git a/Tools/DumpRenderTree/gtk/EditingCallbacks.cpp b/Tools/DumpRenderTree/gtk/EditingCallbacks.cpp
index c5fa009fb..4c968d9f4 100644
--- a/Tools/DumpRenderTree/gtk/EditingCallbacks.cpp
+++ b/Tools/DumpRenderTree/gtk/EditingCallbacks.cpp
@@ -30,7 +30,7 @@
#include "EditingCallbacks.h"
#include "DumpRenderTree.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include <gtk/gtk.h>
#include <webkit/webkit.h>
#include <wtf/gobject/GOwnPtr.h>
@@ -99,21 +99,21 @@ static const char* selectionAffinityString(WebKitSelectionAffinity affinity)
gboolean shouldBeginEditing(WebKitWebView* webView, WebKitDOMRange* range)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", dumpRange(range).data());
return TRUE;
}
gboolean shouldEndEditing(WebKitWebView* webView, WebKitDOMRange* range)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n", dumpRange(range).data());
return TRUE;
}
gboolean shouldInsertNode(WebKitWebView* webView, WebKitDOMNode* node, WebKitDOMRange* range, WebKitInsertAction action)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks()) {
+ if (!done && gTestRunner->dumpEditingCallbacks()) {
printf("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n",
dumpNodePath(node).data(), dumpRange(range).data(), insertActionString(action));
}
@@ -122,7 +122,7 @@ gboolean shouldInsertNode(WebKitWebView* webView, WebKitDOMNode* node, WebKitDOM
gboolean shouldInsertText(WebKitWebView* webView, const gchar* text, WebKitDOMRange* range, WebKitInsertAction action)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks()) {
+ if (!done && gTestRunner->dumpEditingCallbacks()) {
printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n",
text, dumpRange(range).data(), insertActionString(action));
}
@@ -131,7 +131,7 @@ gboolean shouldInsertText(WebKitWebView* webView, const gchar* text, WebKitDOMRa
gboolean shouldDeleteRange(WebKitWebView* webView, WebKitDOMRange* range)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: shouldDeleteDOMRange:%s\n", dumpRange(range).data());
return TRUE;
}
@@ -144,7 +144,7 @@ gboolean shouldShowDeleteInterfaceForElement(WebKitWebView* webView, WebKitDOMHT
gboolean shouldChangeSelectedRange(WebKitWebView* webView, WebKitDOMRange* fromRange, WebKitDOMRange* toRange, WebKitSelectionAffinity affinity, gboolean stillSelecting)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks()) {
+ if (!done && gTestRunner->dumpEditingCallbacks()) {
printf("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n",
dumpRange(fromRange).data(), dumpRange(toRange).data(), selectionAffinityString(affinity),
stillSelecting ? "TRUE" : "FALSE");
@@ -154,7 +154,7 @@ gboolean shouldChangeSelectedRange(WebKitWebView* webView, WebKitDOMRange* fromR
gboolean shouldApplyStyle(WebKitWebView* webView, WebKitDOMCSSStyleDeclaration* style, WebKitDOMRange* range)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks()) {
+ if (!done && gTestRunner->dumpEditingCallbacks()) {
GOwnPtr<gchar> styleText(webkit_dom_css_style_declaration_get_css_text(style));
printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n",
styleText.get(), dumpRange(range).data());
@@ -164,25 +164,25 @@ gboolean shouldApplyStyle(WebKitWebView* webView, WebKitDOMCSSStyleDeclaration*
void editingBegan(WebKitWebView*)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification\n");
}
void userChangedContents(WebKitWebView*)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n");
}
void editingEnded(WebKitWebView*)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification\n");
}
void selectionChanged(WebKitWebView*)
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n");
}
diff --git a/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp
index fffd92422..41575d72f 100644
--- a/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
+++ b/Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp
@@ -32,7 +32,7 @@
*/
#include "config.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include "DumpRenderTree.h"
#include "WebCoreSupport/DumpRenderTreeSupportGtk.h"
@@ -53,17 +53,17 @@ extern "C" {
void webkit_web_inspector_execute_script(WebKitWebInspector* inspector, long callId, const gchar* script);
}
-LayoutTestController::~LayoutTestController()
+TestRunner::~TestRunner()
{
// FIXME: implement
}
-void LayoutTestController::addDisallowedURL(JSStringRef url)
+void TestRunner::addDisallowedURL(JSStringRef url)
{
// FIXME: implement
}
-void LayoutTestController::clearBackForwardList()
+void TestRunner::clearBackForwardList()
{
WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
WebKitWebBackForwardList* list = webkit_web_view_get_back_forward_list(webView);
@@ -80,63 +80,63 @@ void LayoutTestController::clearBackForwardList()
g_object_unref(item);
}
-JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name)
+JSStringRef TestRunner::copyDecodedHostName(JSStringRef name)
{
// FIXME: implement
return 0;
}
-JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name)
+JSStringRef TestRunner::copyEncodedHostName(JSStringRef name)
{
// FIXME: implement
return 0;
}
-void LayoutTestController::dispatchPendingLoadRequests()
+void TestRunner::dispatchPendingLoadRequests()
{
// FIXME: Implement for testing fix for 6727495
}
-void LayoutTestController::display()
+void TestRunner::display()
{
displayWebView();
}
-void LayoutTestController::keepWebHistory()
+void TestRunner::keepWebHistory()
{
// FIXME: implement
}
-JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
+JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
{
return DumpRenderTreeSupportGtk::computedStyleIncludingVisitedInfo(context, value);
}
-JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
+JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const
{
// FIXME: implement
JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithUTF8CString(""));
return string;
}
-int LayoutTestController::numberOfPages(float pageWidth, float pageHeight)
+int TestRunner::numberOfPages(float pageWidth, float pageHeight)
{
return DumpRenderTreeSupportGtk::numberOfPagesForFrame(mainFrame, pageWidth, pageHeight);
}
-JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const
+JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const
{
JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithUTF8CString(DumpRenderTreeSupportGtk::pageProperty(mainFrame, propertyName, pageNumber).data()));
return propertyValue;
}
-JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
+JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
{
JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithUTF8CString(DumpRenderTreeSupportGtk::pageSizeAndMarginsInPixels(mainFrame, pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft).data()));
return propertyValue;
}
-size_t LayoutTestController::webHistoryItemCount()
+size_t TestRunner::webHistoryItemCount()
{
WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
WebKitWebBackForwardList* list = webkit_web_view_get_back_forward_list(webView);
@@ -150,18 +150,18 @@ size_t LayoutTestController::webHistoryItemCount()
webkit_web_back_forward_list_get_forward_length(list);
}
-unsigned LayoutTestController::workerThreadCount() const
+unsigned TestRunner::workerThreadCount() const
{
return DumpRenderTreeSupportGtk::workerThreadCount();
}
-JSRetainPtr<JSStringRef> LayoutTestController::platformName() const
+JSRetainPtr<JSStringRef> TestRunner::platformName() const
{
JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("gtk"));
return platformName;
}
-void LayoutTestController::notifyDone()
+void TestRunner::notifyDone()
{
if (m_waitToDump && !topLoadingFrame && !WorkQueue::shared()->count())
dump();
@@ -169,7 +169,7 @@ void LayoutTestController::notifyDone()
waitForPolicy = false;
}
-JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef url)
+JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef url)
{
GOwnPtr<char> urlCString(JSStringCopyUTF8CString(url));
if (!g_str_has_prefix(urlCString.get(), "file:///tmp/LayoutTests/"))
@@ -181,7 +181,7 @@ JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSSt
return JSStringCreateWithUTF8CString(testURI.get());
}
-void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target)
+void TestRunner::queueLoad(JSStringRef url, JSStringRef target)
{
gchar* relativeURL = JSStringCopyUTF8CString(url);
SoupURI* baseURI = soup_uri_new(webkit_web_frame_get_uri(mainFrame));
@@ -203,13 +203,13 @@ void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target)
WorkQueue::shared()->queue(new LoadItem(absoluteURL.get(), target));
}
-void LayoutTestController::setAcceptsEditing(bool acceptsEditing)
+void TestRunner::setAcceptsEditing(bool acceptsEditing)
{
WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
webkit_web_view_set_editable(webView, acceptsEditing);
}
-void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
+void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
{
SoupSession* session = webkit_get_default_session();
SoupCookieJar* jar = reinterpret_cast<SoupCookieJar*>(soup_session_get_feature(session, SOUP_TYPE_COOKIE_JAR));
@@ -233,23 +233,23 @@ void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
g_object_set(G_OBJECT(jar), SOUP_COOKIE_JAR_ACCEPT_POLICY, policy, NULL);
}
-void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive)
+void TestRunner::setCustomPolicyDelegate(bool setDelegate, bool permissive)
{
// FIXME: implement
}
-void LayoutTestController::waitForPolicyDelegate()
+void TestRunner::waitForPolicyDelegate()
{
waitForPolicy = true;
setWaitToDump(true);
}
-void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
+void TestRunner::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
{
// FIXME: implement
}
-void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains)
+void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains)
{
gchar* sourceOriginGChar = JSStringCopyUTF8CString(sourceOrigin);
gchar* protocolGChar = JSStringCopyUTF8CString(protocol);
@@ -260,7 +260,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigi
g_free(hostGChar);
}
-void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains)
+void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains)
{
GOwnPtr<gchar> sourceOriginGChar(JSStringCopyUTF8CString(sourceOrigin));
GOwnPtr<gchar> protocolGChar(JSStringCopyUTF8CString(protocol));
@@ -268,19 +268,19 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOr
DumpRenderTreeSupportGtk::removeWhiteListAccessFromOrigin(sourceOriginGChar.get(), protocolGChar.get(), hostGChar.get(), includeSubdomains);
}
-void LayoutTestController::setMainFrameIsFirstResponder(bool flag)
+void TestRunner::setMainFrameIsFirstResponder(bool flag)
{
// FIXME: implement
}
-void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles)
+void TestRunner::setTabKeyCyclesThroughElements(bool cycles)
{
WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
WebKitWebSettings* settings = webkit_web_view_get_settings(webView);
g_object_set(G_OBJECT(settings), "tab-key-cycles-through-elements", cycles, NULL);
}
-void LayoutTestController::setUseDashboardCompatibilityMode(bool flag)
+void TestRunner::setUseDashboardCompatibilityMode(bool flag)
{
// FIXME: implement
}
@@ -288,7 +288,7 @@ void LayoutTestController::setUseDashboardCompatibilityMode(bool flag)
static gchar* userStyleSheet = NULL;
static gboolean userStyleSheetEnabled = TRUE;
-void LayoutTestController::setUserStyleSheetEnabled(bool flag)
+void TestRunner::setUserStyleSheetEnabled(bool flag)
{
userStyleSheetEnabled = flag;
@@ -300,7 +300,7 @@ void LayoutTestController::setUserStyleSheetEnabled(bool flag)
g_object_set(G_OBJECT(settings), "user-stylesheet-uri", "", NULL);
}
-void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
+void TestRunner::setUserStyleSheetLocation(JSStringRef path)
{
g_free(userStyleSheet);
userStyleSheet = JSStringCopyUTF8CString(path);
@@ -308,12 +308,12 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
setUserStyleSheetEnabled(true);
}
-void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value)
+void TestRunner::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value)
{
DumpRenderTreeSupportGtk::setValueForUser(context, nodeObject, value);
}
-void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
+void TestRunner::setViewModeMediaFeature(JSStringRef mode)
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
ASSERT(view);
@@ -334,12 +334,12 @@ void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
g_free(viewMode);
}
-void LayoutTestController::setWindowIsKey(bool windowIsKey)
+void TestRunner::setWindowIsKey(bool windowIsKey)
{
// FIXME: implement
}
-void LayoutTestController::setSmartInsertDeleteEnabled(bool flag)
+void TestRunner::setSmartInsertDeleteEnabled(bool flag)
{
DumpRenderTreeSupportGtk::setSmartInsertDeleteEnabled(webkit_web_frame_get_web_view(mainFrame), flag);
}
@@ -347,11 +347,11 @@ void LayoutTestController::setSmartInsertDeleteEnabled(bool flag)
static gboolean waitToDumpWatchdogFired(void*)
{
setWaitToDumpWatchdog(0);
- gLayoutTestController->waitToDumpWatchdogTimerFired();
+ gTestRunner->waitToDumpWatchdogTimerFired();
return FALSE;
}
-void LayoutTestController::setWaitToDump(bool waitUntilDone)
+void TestRunner::setWaitToDump(bool waitUntilDone)
{
static const int timeoutSeconds = 30;
@@ -360,13 +360,13 @@ void LayoutTestController::setWaitToDump(bool waitUntilDone)
setWaitToDumpWatchdog(g_timeout_add_seconds(timeoutSeconds, waitToDumpWatchdogFired, 0));
}
-int LayoutTestController::windowCount()
+int TestRunner::windowCount()
{
// +1 -> including the main view
return g_slist_length(webViewList) + 1;
}
-void LayoutTestController::setPrivateBrowsingEnabled(bool flag)
+void TestRunner::setPrivateBrowsingEnabled(bool flag)
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
ASSERT(view);
@@ -375,7 +375,7 @@ void LayoutTestController::setPrivateBrowsingEnabled(bool flag)
g_object_set(G_OBJECT(settings), "enable-private-browsing", flag, NULL);
}
-void LayoutTestController::setJavaScriptCanAccessClipboard(bool flag)
+void TestRunner::setJavaScriptCanAccessClipboard(bool flag)
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
ASSERT(view);
@@ -384,7 +384,7 @@ void LayoutTestController::setJavaScriptCanAccessClipboard(bool flag)
g_object_set(G_OBJECT(settings), "javascript-can-access-clipboard", flag, NULL);
}
-void LayoutTestController::setXSSAuditorEnabled(bool flag)
+void TestRunner::setXSSAuditorEnabled(bool flag)
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
ASSERT(view);
@@ -393,7 +393,7 @@ void LayoutTestController::setXSSAuditorEnabled(bool flag)
g_object_set(G_OBJECT(settings), "enable-xss-auditor", flag, NULL);
}
-void LayoutTestController::setFrameFlatteningEnabled(bool flag)
+void TestRunner::setFrameFlatteningEnabled(bool flag)
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
ASSERT(view);
@@ -402,7 +402,7 @@ void LayoutTestController::setFrameFlatteningEnabled(bool flag)
g_object_set(G_OBJECT(settings), "enable-frame-flattening", flag, NULL);
}
-void LayoutTestController::setSpatialNavigationEnabled(bool flag)
+void TestRunner::setSpatialNavigationEnabled(bool flag)
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
ASSERT(view);
@@ -411,7 +411,7 @@ void LayoutTestController::setSpatialNavigationEnabled(bool flag)
g_object_set(G_OBJECT(settings), "enable-spatial-navigation", flag, NULL);
}
-void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool flag)
+void TestRunner::setAllowUniversalAccessFromFileURLs(bool flag)
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
ASSERT(view);
@@ -420,7 +420,7 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool flag)
g_object_set(G_OBJECT(settings), "enable-universal-access-from-file-uris", flag, NULL);
}
-void LayoutTestController::setAllowFileAccessFromFileURLs(bool flag)
+void TestRunner::setAllowFileAccessFromFileURLs(bool flag)
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
ASSERT(view);
@@ -429,17 +429,17 @@ void LayoutTestController::setAllowFileAccessFromFileURLs(bool flag)
g_object_set(G_OBJECT(settings), "enable-file-access-from-file-uris", flag, NULL);
}
-void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
+void TestRunner::setAuthorAndUserStylesEnabled(bool flag)
{
// FIXME: implement
}
-void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool isAutofilled)
+void TestRunner::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool isAutofilled)
{
DumpRenderTreeSupportGtk::setAutofilled(context, nodeObject, isAutofilled);
}
-void LayoutTestController::disableImageLoading()
+void TestRunner::disableImageLoading()
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
ASSERT(view);
@@ -448,13 +448,13 @@ void LayoutTestController::disableImageLoading()
g_object_set(G_OBJECT(settings), "auto-load-images", FALSE, NULL);
}
-void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
{
// FIXME: Implement for DeviceOrientation layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=30335.
}
-void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
+void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
{
WebKitWebView* view = WEBKIT_WEB_VIEW(g_slist_nth_data(webViewList, 0));
if (!view)
@@ -464,7 +464,7 @@ void LayoutTestController::setMockGeolocationPosition(double latitude, double lo
DumpRenderTreeSupportGtk::setMockGeolocationPosition(view, latitude, longitude, accuracy);
}
-void LayoutTestController::setMockGeolocationError(int code, JSStringRef message)
+void TestRunner::setMockGeolocationError(int code, JSStringRef message)
{
WebKitWebView* view = WEBKIT_WEB_VIEW(g_slist_nth_data(webViewList, 0));
if (!view)
@@ -475,7 +475,7 @@ void LayoutTestController::setMockGeolocationError(int code, JSStringRef message
DumpRenderTreeSupportGtk::setMockGeolocationError(view, code, cMessage.get());
}
-void LayoutTestController::setGeolocationPermission(bool allow)
+void TestRunner::setGeolocationPermission(bool allow)
{
setGeolocationPermissionCommon(allow);
WebKitWebView* view = WEBKIT_WEB_VIEW(g_slist_nth_data(webViewList, 0));
@@ -486,7 +486,7 @@ void LayoutTestController::setGeolocationPermission(bool allow)
DumpRenderTreeSupportGtk::setMockGeolocationPermission(view, allow);
}
-int LayoutTestController::numberOfPendingGeolocationPermissionRequests()
+int TestRunner::numberOfPendingGeolocationPermissionRequests()
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
if (!view)
@@ -496,25 +496,25 @@ int LayoutTestController::numberOfPendingGeolocationPermissionRequests()
return DumpRenderTreeSupportGtk::numberOfPendingGeolocationPermissionRequests(view);
}
-void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
+void TestRunner::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
}
-void LayoutTestController::setMockSpeechInputDumpRect(bool flag)
+void TestRunner::setMockSpeechInputDumpRect(bool flag)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
}
-void LayoutTestController::startSpeechInput(JSContextRef inputElement)
+void TestRunner::startSpeechInput(JSContextRef inputElement)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
}
-void LayoutTestController::setIconDatabaseEnabled(bool enabled)
+void TestRunner::setIconDatabaseEnabled(bool enabled)
{
WebKitIconDatabase* database = webkit_get_icon_database();
if (enabled) {
@@ -524,12 +524,12 @@ void LayoutTestController::setIconDatabaseEnabled(bool enabled)
webkit_icon_database_set_path(database, 0);
}
-void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag)
+void TestRunner::setSelectTrailingWhitespaceEnabled(bool flag)
{
DumpRenderTreeSupportGtk::setSelectTrailingWhitespaceEnabled(flag);
}
-void LayoutTestController::setPopupBlockingEnabled(bool flag)
+void TestRunner::setPopupBlockingEnabled(bool flag)
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
ASSERT(view);
@@ -539,7 +539,7 @@ void LayoutTestController::setPopupBlockingEnabled(bool flag)
}
-void LayoutTestController::setPluginsEnabled(bool flag)
+void TestRunner::setPluginsEnabled(bool flag)
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
ASSERT(view);
@@ -548,12 +548,12 @@ void LayoutTestController::setPluginsEnabled(bool flag)
g_object_set(G_OBJECT(settings), "enable-plugins", flag, NULL);
}
-bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id)
+bool TestRunner::elementDoesAutoCompleteForElementWithId(JSStringRef id)
{
return DumpRenderTreeSupportGtk::elementDoesAutoCompleteForElementWithId(mainFrame, id);
}
-void LayoutTestController::execCommand(JSStringRef name, JSStringRef value)
+void TestRunner::execCommand(JSStringRef name, JSStringRef value)
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
ASSERT(view);
@@ -565,7 +565,7 @@ void LayoutTestController::execCommand(JSStringRef name, JSStringRef value)
g_free(cValue);
}
-bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray)
+bool TestRunner::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray)
{
WebKitFindOptions findOptions = 0;
WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
@@ -603,7 +603,7 @@ bool LayoutTestController::findString(JSContextRef context, JSStringRef target,
return DumpRenderTreeSupportGtk::findString(webView, targetString.get(), findOptions);
}
-bool LayoutTestController::isCommandEnabled(JSStringRef name)
+bool TestRunner::isCommandEnabled(JSStringRef name)
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
ASSERT(view);
@@ -614,7 +614,7 @@ bool LayoutTestController::isCommandEnabled(JSStringRef name)
return result;
}
-void LayoutTestController::setCacheModel(int cacheModel)
+void TestRunner::setCacheModel(int cacheModel)
{
// These constants are derived from the Mac cache model enum in Source/WebKit/mac/WebView/WebPreferences.h.
switch (cacheModel) {
@@ -632,110 +632,110 @@ void LayoutTestController::setCacheModel(int cacheModel)
}
}
-void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL)
+void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef jsURL)
{
// FIXME: implement
}
-void LayoutTestController::clearPersistentUserStyleSheet()
+void TestRunner::clearPersistentUserStyleSheet()
{
// FIXME: implement
}
-void LayoutTestController::clearAllApplicationCaches()
+void TestRunner::clearAllApplicationCaches()
{
// FIXME: Implement to support application cache quotas.
}
-void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota)
+void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota)
{
// FIXME: Implement to support application cache quotas.
}
-void LayoutTestController::clearApplicationCacheForOrigin(OpaqueJSString*)
+void TestRunner::clearApplicationCacheForOrigin(OpaqueJSString*)
{
// FIXME: Implement to support deleting all application caches for an origin.
}
-long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef originIdentifier)
+long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef originIdentifier)
{
// FIXME: Implement to support getting disk usage in bytes for an origin.
return 0;
}
-JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context)
+JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context)
{
// FIXME: Implement to get origins that contain application caches.
return JSValueMakeUndefined(context);
}
-long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef name)
+long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef name)
{
// FIXME: implement
return 0;
}
-void LayoutTestController::clearAllDatabases()
+void TestRunner::clearAllDatabases()
{
webkit_remove_all_web_databases();
}
-void LayoutTestController::setDatabaseQuota(unsigned long long quota)
+void TestRunner::setDatabaseQuota(unsigned long long quota)
{
WebKitSecurityOrigin* origin = webkit_web_frame_get_security_origin(mainFrame);
webkit_security_origin_set_web_database_quota(origin, quota);
}
-JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context)
+JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context)
{
// FIXME: implement
return JSValueMakeUndefined(context);
}
-void LayoutTestController::deleteAllLocalStorage()
+void TestRunner::deleteAllLocalStorage()
{
// FIXME: implement
}
-void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef originIdentifier)
+void TestRunner::deleteLocalStorageForOrigin(JSStringRef originIdentifier)
{
// FIXME: implement
}
-void LayoutTestController::observeStorageTrackerNotifications(unsigned number)
+void TestRunner::observeStorageTrackerNotifications(unsigned number)
{
// FIXME: implement
}
-void LayoutTestController::syncLocalStorage()
+void TestRunner::syncLocalStorage()
{
// FIXME: implement
}
-void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme)
+void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme)
{
GOwnPtr<gchar> urlScheme(JSStringCopyUTF8CString(scheme));
DumpRenderTreeSupportGtk::setDomainRelaxationForbiddenForURLScheme(forbidden, urlScheme.get());
}
-void LayoutTestController::goBack()
+void TestRunner::goBack()
{
WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
webkit_web_view_go_back(webView);
}
-void LayoutTestController::setDefersLoading(bool defers)
+void TestRunner::setDefersLoading(bool defers)
{
WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
DumpRenderTreeSupportGtk::setDefersLoading(webView, defers);
}
-void LayoutTestController::setAppCacheMaximumSize(unsigned long long size)
+void TestRunner::setAppCacheMaximumSize(unsigned long long size)
{
webkit_application_cache_set_maximum_size(size);
}
-bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
+bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
{
gchar* name = JSStringCopyUTF8CString(animationName);
gchar* element = JSStringCopyUTF8CString(elementId);
@@ -745,7 +745,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef anima
return returnValue;
}
-bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
+bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
{
gchar* name = JSStringCopyUTF8CString(propertyName);
gchar* element = JSStringCopyUTF8CString(elementId);
@@ -755,7 +755,7 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop
return returnValue;
}
-unsigned LayoutTestController::numberOfActiveAnimations() const
+unsigned TestRunner::numberOfActiveAnimations() const
{
return DumpRenderTreeSupportGtk::numberOfActiveAnimations(mainFrame);
}
@@ -765,7 +765,7 @@ static gboolean booleanFromValue(gchar* value)
return !g_ascii_strcasecmp(value, "true") || !g_ascii_strcasecmp(value, "1");
}
-void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value)
+void TestRunner::overridePreference(JSStringRef key, JSStringRef value)
{
GOwnPtr<gchar> originalName(JSStringCopyUTF8CString(key));
GOwnPtr<gchar> valueAsString(JSStringCopyUTF8CString(value));
@@ -806,7 +806,7 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value
DumpRenderTreeSupportGtk::setCSSRegionsEnabled(webkit_web_frame_get_web_view(mainFrame), booleanFromValue(valueAsString.get()));
return;
} else {
- fprintf(stderr, "LayoutTestController::overridePreference tried to override "
+ fprintf(stderr, "TestRunner::overridePreference tried to override "
"unknown preference '%s'.\n", originalName.get());
return;
}
@@ -827,16 +827,16 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value
gfloat newValue = g_ascii_strtod(valueAsString.get(), 0);
g_object_set(G_OBJECT(settings), propertyName, newValue, NULL);
} else
- fprintf(stderr, "LayoutTestController::overridePreference failed to override "
+ fprintf(stderr, "TestRunner::overridePreference failed to override "
"preference '%s'.\n", originalName.get());
}
-void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
+void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
{
- printf("LayoutTestController::addUserScript not implemented.\n");
+ printf("TestRunner::addUserScript not implemented.\n");
}
-void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
+void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames)
{
GOwnPtr<gchar> sourceCode(JSStringCopyUTF8CString(source));
DumpRenderTreeSupportGtk::addUserStyleSheet(mainFrame, sourceCode.get(), allFrames);
@@ -844,7 +844,7 @@ void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
}
-void LayoutTestController::setDeveloperExtrasEnabled(bool enabled)
+void TestRunner::setDeveloperExtrasEnabled(bool enabled)
{
WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
WebKitWebSettings* webSettings = webkit_web_view_get_settings(webView);
@@ -852,12 +852,12 @@ void LayoutTestController::setDeveloperExtrasEnabled(bool enabled)
g_object_set(webSettings, "enable-developer-extras", enabled, NULL);
}
-void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool)
+void TestRunner::setAsynchronousSpellCheckingEnabled(bool)
{
// FIXME: Implement this.
}
-void LayoutTestController::showWebInspector()
+void TestRunner::showWebInspector()
{
WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
WebKitWebInspector* inspector = webkit_web_view_get_inspector(webView);
@@ -865,7 +865,7 @@ void LayoutTestController::showWebInspector()
webkit_web_inspector_show(inspector);
}
-void LayoutTestController::closeWebInspector()
+void TestRunner::closeWebInspector()
{
WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
WebKitWebInspector* inspector = webkit_web_view_get_inspector(webView);
@@ -873,7 +873,7 @@ void LayoutTestController::closeWebInspector()
webkit_web_inspector_close(inspector);
}
-void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script)
+void TestRunner::evaluateInWebInspector(long callId, JSStringRef script)
{
WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
WebKitWebInspector* inspector = webkit_web_view_get_inspector(webView);
@@ -883,41 +883,41 @@ void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef scrip
g_free(scriptString);
}
-void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
+void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
{
// FIXME: Implement this.
}
-void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
+void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
{
// FIXME: Implement this.
}
-void LayoutTestController::removeAllVisitedLinks()
+void TestRunner::removeAllVisitedLinks()
{
// FIXME: Implement this.
}
-bool LayoutTestController::callShouldCloseOnWebView()
+bool TestRunner::callShouldCloseOnWebView()
{
return DumpRenderTreeSupportGtk::shouldClose(mainFrame);
}
-void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
+void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
{
}
-void LayoutTestController::apiTestGoToCurrentBackForwardItem()
+void TestRunner::apiTestGoToCurrentBackForwardItem()
{
}
-void LayoutTestController::setWebViewEditable(bool)
+void TestRunner::setWebViewEditable(bool)
{
}
-JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
+JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
{
CString markerTextGChar = DumpRenderTreeSupportGtk::markerTextForListItem(mainFrame, context, nodeObject);
if (markerTextGChar.isNull())
@@ -927,76 +927,76 @@ JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRe
return markerText;
}
-void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
+void TestRunner::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
{
}
-void LayoutTestController::abortModal()
+void TestRunner::abortModal()
{
}
-void LayoutTestController::setSerializeHTTPLoads(bool serialize)
+void TestRunner::setSerializeHTTPLoads(bool serialize)
{
DumpRenderTreeSupportGtk::setSerializeHTTPLoads(serialize);
}
-void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval)
+void TestRunner::setMinimumTimerInterval(double minimumTimerInterval)
{
WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
DumpRenderTreeSupportGtk::setMinimumTimerInterval(webView, minimumTimerInterval);
}
-void LayoutTestController::setTextDirection(JSStringRef direction)
+void TestRunner::setTextDirection(JSStringRef direction)
{
// FIXME: Implement.
}
-void LayoutTestController::addChromeInputField()
+void TestRunner::addChromeInputField()
{
}
-void LayoutTestController::removeChromeInputField()
+void TestRunner::removeChromeInputField()
{
}
-void LayoutTestController::focusWebView()
+void TestRunner::focusWebView()
{
}
-void LayoutTestController::setBackingScaleFactor(double)
+void TestRunner::setBackingScaleFactor(double)
{
}
-void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title)
+void TestRunner::simulateDesktopNotificationClick(JSStringRef title)
{
}
-void LayoutTestController::resetPageVisibility()
+void TestRunner::resetPageVisibility()
{
// FIXME: Implement this.
}
-void LayoutTestController::setPageVisibility(const char*)
+void TestRunner::setPageVisibility(const char*)
{
// FIXME: Implement this.
}
-void LayoutTestController::setAutomaticLinkDetectionEnabled(bool)
+void TestRunner::setAutomaticLinkDetectionEnabled(bool)
{
// FIXME: Implement this.
}
-void LayoutTestController::sendWebIntentResponse(JSStringRef)
+void TestRunner::sendWebIntentResponse(JSStringRef)
{
// FIXME: Implement this.
}
-void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)
+void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)
{
// FIXME: Implement this.
}
-void LayoutTestController::setStorageDatabaseIdleInterval(double)
+void TestRunner::setStorageDatabaseIdleInterval(double)
{
// FIXME: Implement this.
}
diff --git a/Tools/DumpRenderTree/mac/DumpRenderTree.mm b/Tools/DumpRenderTree/mac/DumpRenderTree.mm
index cbd893f85..2bd54bb70 100644
--- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm
+++ b/Tools/DumpRenderTree/mac/DumpRenderTree.mm
@@ -40,7 +40,7 @@
#import "FrameLoadDelegate.h"
#import "HistoryDelegate.h"
#import "JavaScriptThreading.h"
-#import "LayoutTestController.h"
+#import "TestRunner.h"
#import "MockGeolocationProvider.h"
#import "NavigationController.h"
#import "ObjCPlugin.h"
@@ -118,7 +118,7 @@ static void runTest(const string& testPathOrURL);
volatile bool done;
NavigationController* gNavigationController = 0;
-RefPtr<LayoutTestController> gLayoutTestController;
+RefPtr<TestRunner> gTestRunner;
WebFrame *mainFrame = 0;
// This is the topmost frame that is loading, during a given load, or nil when no load is
@@ -510,7 +510,7 @@ static void registerMockScrollbars()
WebView *createWebViewAndOffscreenWindow()
{
- NSRect rect = NSMakeRect(0, 0, LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight);
+ NSRect rect = NSMakeRect(0, 0, TestRunner::maxViewWidth, TestRunner::maxViewHeight);
WebView *webView = [[WebView alloc] initWithFrame:rect frameName:nil groupName:@"org.webkit.DumpRenderTree"];
[webView setUIDelegate:uiDelegate];
@@ -673,7 +673,7 @@ static void resetDefaultsToConsistentValues()
[WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain];
- LayoutTestController::setSerializeHTTPLoads(false);
+ TestRunner::setSerializeHTTPLoads(false);
setlocale(LC_ALL, "");
}
@@ -899,7 +899,7 @@ void dumpRenderTree(int argc, const char *argv[])
[DumpRenderTreePasteboard releaseLocalPasteboards];
- // FIXME: This should be moved onto LayoutTestController and made into a HashSet
+ // FIXME: This should be moved onto TestRunner and made into a HashSet
if (disallowedURLs) {
CFRelease(disallowedURLs);
disallowedURLs = 0;
@@ -924,9 +924,9 @@ static NSInteger compareHistoryItems(id item1, id item2, void *context)
static NSData *dumpAudio()
{
- const char *encodedAudioData = gLayoutTestController->encodedAudioData().c_str();
+ const char *encodedAudioData = gTestRunner->encodedAudioData().c_str();
- NSData *data = [NSData dataWithBytes:encodedAudioData length:gLayoutTestController->encodedAudioData().length()];
+ NSData *data = [NSData dataWithBytes:encodedAudioData length:gTestRunner->encodedAudioData().length()];
return data;
}
@@ -974,7 +974,7 @@ static void dumpFrameScrollPosition(WebFrame *f)
printf("scrolled to %.f,%.f\n", scrollPosition.x, scrollPosition.y);
}
- if (gLayoutTestController->dumpChildFrameScrollPositions()) {
+ if (gTestRunner->dumpChildFrameScrollPositions()) {
NSArray *kids = [f childFrames];
if (kids)
for (unsigned i = 0; i < [kids count]; i++)
@@ -998,7 +998,7 @@ static NSString *dumpFramesAsText(WebFrame *frame)
[result appendFormat:@"%@\n", [documentElement innerText]];
- if (gLayoutTestController->dumpChildFramesAsText()) {
+ if (gTestRunner->dumpChildFramesAsText()) {
NSArray *kids = [frame childFrames];
if (kids) {
for (unsigned i = 0; i < [kids count]; i++)
@@ -1078,21 +1078,21 @@ static void dumpBackForwardListForWebView(WebView *view)
static void sizeWebViewForCurrentTest()
{
// W3C SVG tests expect to be 480x360
- bool isSVGW3CTest = (gLayoutTestController->testPathOrURL().find("svg/W3C-SVG-1.1") != string::npos);
+ bool isSVGW3CTest = (gTestRunner->testPathOrURL().find("svg/W3C-SVG-1.1") != string::npos);
if (isSVGW3CTest)
[[mainFrame webView] setFrameSize:NSMakeSize(480, 360)];
else
- [[mainFrame webView] setFrameSize:NSMakeSize(LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight)];
+ [[mainFrame webView] setFrameSize:NSMakeSize(TestRunner::maxViewWidth, TestRunner::maxViewHeight)];
}
static const char *methodNameStringForFailedTest()
{
const char *errorMessage;
- if (gLayoutTestController->dumpAsText())
+ if (gTestRunner->dumpAsText())
errorMessage = "[documentElement innerText]";
- else if (gLayoutTestController->dumpDOMAsWebArchive())
+ else if (gTestRunner->dumpDOMAsWebArchive())
errorMessage = "[[mainFrame DOMDocument] webArchive]";
- else if (gLayoutTestController->dumpSourceAsWebArchive())
+ else if (gTestRunner->dumpSourceAsWebArchive())
errorMessage = "[[mainFrame dataSource] webArchive]";
else
errorMessage = "[mainFrame renderTreeAsExternalRepresentation]";
@@ -1143,43 +1143,43 @@ void dump()
NSString *resultMimeType = @"text/plain";
if ([[[mainFrame dataSource] _responseMIMEType] isEqualToString:@"text/plain"]) {
- gLayoutTestController->setDumpAsText(true);
- gLayoutTestController->setGeneratePixelResults(false);
+ gTestRunner->setDumpAsText(true);
+ gTestRunner->setGeneratePixelResults(false);
}
- if (gLayoutTestController->dumpAsAudio()) {
+ if (gTestRunner->dumpAsAudio()) {
resultData = dumpAudio();
resultMimeType = @"audio/wav";
- } else if (gLayoutTestController->dumpAsText()) {
+ } else if (gTestRunner->dumpAsText()) {
resultString = dumpFramesAsText(mainFrame);
- } else if (gLayoutTestController->dumpAsPDF()) {
+ } else if (gTestRunner->dumpAsPDF()) {
resultData = dumpFrameAsPDF(mainFrame);
resultMimeType = @"application/pdf";
- } else if (gLayoutTestController->dumpDOMAsWebArchive()) {
+ } else if (gTestRunner->dumpDOMAsWebArchive()) {
WebArchive *webArchive = [[mainFrame DOMDocument] webArchive];
resultString = HardAutorelease(createXMLStringFromWebArchiveData((CFDataRef)[webArchive data]));
resultMimeType = @"application/x-webarchive";
- } else if (gLayoutTestController->dumpSourceAsWebArchive()) {
+ } else if (gTestRunner->dumpSourceAsWebArchive()) {
WebArchive *webArchive = [[mainFrame dataSource] webArchive];
resultString = HardAutorelease(createXMLStringFromWebArchiveData((CFDataRef)[webArchive data]));
resultMimeType = @"application/x-webarchive";
} else
- resultString = [mainFrame renderTreeAsExternalRepresentationForPrinting:gLayoutTestController->isPrinting()];
+ resultString = [mainFrame renderTreeAsExternalRepresentationForPrinting:gTestRunner->isPrinting()];
if (resultString && !resultData)
resultData = [resultString dataUsingEncoding:NSUTF8StringEncoding];
printf("Content-Type: %s\n", [resultMimeType UTF8String]);
- if (gLayoutTestController->dumpAsAudio())
+ if (gTestRunner->dumpAsAudio())
printf("Content-Transfer-Encoding: base64\n");
if (resultData) {
fwrite([resultData bytes], 1, [resultData length], stdout);
- if (!gLayoutTestController->dumpAsText() && !gLayoutTestController->dumpDOMAsWebArchive() && !gLayoutTestController->dumpSourceAsWebArchive())
+ if (!gTestRunner->dumpAsText() && !gTestRunner->dumpDOMAsWebArchive() && !gTestRunner->dumpSourceAsWebArchive())
dumpFrameScrollPosition(mainFrame);
- if (gLayoutTestController->dumpBackForwardList())
+ if (gTestRunner->dumpBackForwardList())
dumpBackForwardListForAllWindows();
} else
printf("ERROR: nil result from %s", methodNameStringForFailedTest());
@@ -1195,9 +1195,9 @@ void dump()
}
}
- if (dumpPixelsForCurrentTest && gLayoutTestController->generatePixelResults())
+ if (dumpPixelsForCurrentTest && gTestRunner->generatePixelResults())
// FIXME: when isPrinting is set, dump the image with page separators.
- dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash());
+ dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash());
puts("#EOF"); // terminate the (possibly empty) pixels block
@@ -1256,10 +1256,10 @@ static void resetWebViewToConsistentStateBeforeTesting()
resetDefaultsToConsistentValues();
- if (gLayoutTestController) {
+ if (gTestRunner) {
WebCoreTestSupport::resetInternalsObject([mainFrame globalContext]);
// in the case that a test using the chrome input field failed, be sure to clean up for the next test
- gLayoutTestController->removeChromeInputField();
+ gTestRunner->removeChromeInputField();
}
[[mainFrame webView] setSmartInsertDeleteEnabled:YES];
@@ -1304,19 +1304,19 @@ static void runTest(const string& inputLine)
resetWebViewToConsistentStateBeforeTesting();
- gLayoutTestController = LayoutTestController::create(testURL, command.expectedPixelHash);
+ gTestRunner = TestRunner::create(testURL, command.expectedPixelHash);
topLoadingFrame = nil;
ASSERT(!draggingInfo); // the previous test should have called eventSender.mouseUp to drop!
releaseAndZero(&draggingInfo);
done = NO;
sizeWebViewForCurrentTest();
- gLayoutTestController->setIconDatabaseEnabled(false);
+ gTestRunner->setIconDatabaseEnabled(false);
if (disallowedURLs)
CFSetRemoveAllValues(disallowedURLs);
if (shouldLogFrameLoadDelegates(pathOrURL.c_str()))
- gLayoutTestController->setDumpFrameLoadCallbacks(true);
+ gTestRunner->setDumpFrameLoadCallbacks(true);
if (shouldLogHistoryDelegates(pathOrURL.c_str()))
[[mainFrame webView] setHistoryDelegate:historyDelegate];
@@ -1324,12 +1324,12 @@ static void runTest(const string& inputLine)
[[mainFrame webView] setHistoryDelegate:nil];
if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
- gLayoutTestController->setDeveloperExtrasEnabled(true);
+ gTestRunner->setDeveloperExtrasEnabled(true);
if (shouldOpenWebInspector(pathOrURL.c_str()))
- gLayoutTestController->showWebInspector();
+ gTestRunner->showWebInspector();
if (shouldDumpAsText(pathOrURL.c_str())) {
- gLayoutTestController->setDumpAsText(true);
- gLayoutTestController->setGeneratePixelResults(false);
+ gTestRunner->setDumpAsText(true);
+ gTestRunner->setGeneratePixelResults(false);
}
}
@@ -1364,7 +1364,7 @@ static void runTest(const string& inputLine)
WorkQueue::shared()->clear();
- if (gLayoutTestController->closeRemainingWindowsWhenComplete()) {
+ if (gTestRunner->closeRemainingWindowsWhenComplete()) {
NSArray* array = [DumpRenderTreeWindow openWindows];
unsigned count = [array count];
@@ -1384,8 +1384,8 @@ static void runTest(const string& inputLine)
// If developer extras enabled Web Inspector may have been open by the test.
if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
- gLayoutTestController->closeWebInspector();
- gLayoutTestController->setDeveloperExtrasEnabled(false);
+ gTestRunner->closeWebInspector();
+ gTestRunner->setDeveloperExtrasEnabled(false);
}
resetWebViewToConsistentStateBeforeTesting();
@@ -1399,7 +1399,7 @@ static void runTest(const string& inputLine)
ASSERT(CFArrayGetCount(openWindowsRef) == 1);
ASSERT(CFArrayGetValueAtIndex(openWindowsRef, 0) == [[mainFrame webView] window]);
- gLayoutTestController.clear();
+ gTestRunner.clear();
if (ignoreWebCoreNodeLeaks)
[WebCoreStatistics stopIgnoringWebCoreNodeLeaks];
diff --git a/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm b/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm
index e0cdc6b6e..17a114ba0 100644
--- a/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm
+++ b/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm
@@ -34,7 +34,7 @@
#import "DumpRenderTree.h"
// FIXME: This file is ObjC++ only because of this include. :(
-#import "LayoutTestController.h"
+#import "TestRunner.h"
#import <WebKit/WebViewPrivate.h>
#import <WebKit/WebTypesInternal.h>
@@ -79,7 +79,12 @@ static CFArrayCallBacks NonRetainingArrayCallbacks = {
- (BOOL)isKeyWindow
{
- return gLayoutTestController ? gLayoutTestController->windowIsKey() : YES;
+ return gTestRunner ? gTestRunner->windowIsKey() : YES;
+}
+
+- (BOOL)_hasKeyAppearance
+{
+ return [self isKeyWindow];
}
- (void)keyDown:(NSEvent *)event
diff --git a/Tools/DumpRenderTree/mac/EditingDelegate.mm b/Tools/DumpRenderTree/mac/EditingDelegate.mm
index b1e48c5fa..d6227a72c 100644
--- a/Tools/DumpRenderTree/mac/EditingDelegate.mm
+++ b/Tools/DumpRenderTree/mac/EditingDelegate.mm
@@ -30,7 +30,7 @@
#import "EditingDelegate.h"
#import "DumpRenderTree.h"
-#import "LayoutTestController.h"
+#import "TestRunner.h"
#import <WebKit/WebKit.h>
@interface DOMNode (dumpPath)
@@ -74,14 +74,14 @@
- (BOOL)webView:(WebView *)webView shouldBeginEditingInDOMRange:(DOMRange *)range
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", [[range dump] UTF8String]);
return acceptsEditing;
}
- (BOOL)webView:(WebView *)webView shouldEndEditingInDOMRange:(DOMRange *)range
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n", [[range dump] UTF8String]);
return acceptsEditing;
}
@@ -94,7 +94,7 @@
"WebViewInsertActionDropped",
};
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n", [[node dumpPath] UTF8String], [[range dump] UTF8String], insertactionstring[action]);
return acceptsEditing;
}
@@ -107,14 +107,14 @@
"WebViewInsertActionDropped",
};
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n", [[text description] UTF8String], [[range dump] UTF8String], insertactionstring[action]);
return acceptsEditing;
}
- (BOOL)webView:(WebView *)webView shouldDeleteDOMRange:(DOMRange *)range
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: shouldDeleteDOMRange:%s\n", [[range dump] UTF8String]);
return acceptsEditing;
}
@@ -135,52 +135,52 @@
"TRUE"
};
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n", [[currentRange dump] UTF8String], [[proposedRange dump] UTF8String], affinitystring[selectionAffinity], boolstring[flag]);
return acceptsEditing;
}
- (BOOL)webView:(WebView *)webView shouldApplyStyle:(DOMCSSStyleDeclaration *)style toElementsInDOMRange:(DOMRange *)range
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n", [[style description] UTF8String], [[range dump] UTF8String]);
return acceptsEditing;
}
- (BOOL)webView:(WebView *)webView shouldChangeTypingStyle:(DOMCSSStyleDeclaration *)currentStyle toStyle:(DOMCSSStyleDeclaration *)proposedStyle
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: shouldChangeTypingStyle:%s toStyle:%s\n", [[currentStyle description] UTF8String], [[proposedStyle description] UTF8String]);
return acceptsEditing;
}
- (void)webViewDidBeginEditing:(NSNotification *)notification
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: webViewDidBeginEditing:%s\n", [[notification name] UTF8String]);
}
- (void)webViewDidChange:(NSNotification *)notification
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: webViewDidChange:%s\n", [[notification name] UTF8String]);
}
- (void)webViewDidEndEditing:(NSNotification *)notification
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: webViewDidEndEditing:%s\n", [[notification name] UTF8String]);
}
- (void)webViewDidChangeTypingStyle:(NSNotification *)notification
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: webViewDidChangeTypingStyle:%s\n", [[notification name] UTF8String]);
}
- (void)webViewDidChangeSelection:(NSNotification *)notification
{
- if (!done && gLayoutTestController->dumpEditingCallbacks())
+ if (!done && gTestRunner->dumpEditingCallbacks())
printf("EDITING DELEGATE: webViewDidChangeSelection:%s\n", [[notification name] UTF8String]);
}
diff --git a/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm b/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm
index 69c246197..88cc7c920 100644
--- a/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm
+++ b/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm
@@ -35,7 +35,7 @@
#import "EventSendingController.h"
#import "Foundation/NSNotification.h"
#import "GCController.h"
-#import "LayoutTestController.h"
+#import "TestRunner.h"
#import "NavigationController.h"
#import "ObjCController.h"
#import "ObjCPlugin.h"
@@ -131,7 +131,7 @@
return;
// if we finish all the commands, we're ready to dump state
- if (WorkQueue::shared()->processWork() && !gLayoutTestController->waitToDump())
+ if (WorkQueue::shared()->processWork() && !gTestRunner->waitToDump())
dump();
}
@@ -145,7 +145,7 @@
if ([dataSource webFrame] == topLoadingFrame) {
topLoadingFrame = nil;
WorkQueue::shared()->setFrozen(true); // first complete load freezes the queue for the rest of this test
- if (!gLayoutTestController->waitToDump()) {
+ if (!gTestRunner->waitToDump()) {
if (WorkQueue::shared()->count())
[self performSelector:@selector(processWork:) withObject:nil afterDelay:0];
else
@@ -156,12 +156,12 @@
- (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - didStartProvisionalLoadForFrame", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
}
- if (!done && gLayoutTestController->dumpUserGestureInFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpUserGestureInFrameLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - in didStartProvisionalLoadForFrame", [frame _drt_printFrameUserGestureStatus]];
printf ("%s\n", [string UTF8String]);
}
@@ -172,13 +172,13 @@
if (!topLoadingFrame && !done)
topLoadingFrame = frame;
- if (!done && gLayoutTestController->stopProvisionalFrameLoads()) {
+ if (!done && gTestRunner->stopProvisionalFrameLoads()) {
NSString *string = [NSString stringWithFormat:@"%@ - stopping load in didStartProvisionalLoadForFrame callback", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
[frame stopLoading];
}
- if (!done && gLayoutTestController->useDeferredFrameLoading()) {
+ if (!done && gTestRunner->useDeferredFrameLoading()) {
[sender setDefersCallbacks:YES];
int64_t deferredWaitTime = 5 * NSEC_PER_MSEC;
dispatch_time_t when = dispatch_time(DISPATCH_TIME_NOW, deferredWaitTime);
@@ -190,7 +190,7 @@
- (void)webView:(WebView *)sender didCommitLoadForFrame:(WebFrame *)frame
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - didCommitLoadForFrame", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
}
@@ -198,14 +198,14 @@
ASSERT(![frame provisionalDataSource]);
ASSERT([frame dataSource]);
- gLayoutTestController->setWindowIsKey(true);
+ gTestRunner->setWindowIsKey(true);
NSView *documentView = [[mainFrame frameView] documentView];
[[[mainFrame webView] window] makeFirstResponder:documentView];
}
- (void)webView:(WebView *)sender didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - didFailProvisionalLoadWithError", [frame _drt_descriptionSuitableForTestResult]];
printf("%s\n", [string UTF8String]);
}
@@ -228,7 +228,7 @@
ASSERT([frame dataSource]);
ASSERT(frame == [[frame dataSource] webFrame]);
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - didFinishLoadForFrame", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
}
@@ -244,7 +244,7 @@
- (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - didFailLoadWithError", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
}
@@ -257,7 +257,7 @@
- (void)webView:(WebView *)webView windowScriptObjectAvailable:(WebScriptObject *)windowScriptObject
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"?? - windowScriptObjectAvailable"];
printf ("%s\n", [string UTF8String]);
}
@@ -267,13 +267,13 @@
- (void)didClearWindowObjectInStandardWorldForFrame:(WebFrame *)frame
{
- // Make New-Style LayoutTestController
+ // Make New-Style TestRunner
JSContextRef context = [frame globalContext];
JSObjectRef globalObject = JSContextGetGlobalObject(context);
JSValueRef exception = 0;
- ASSERT(gLayoutTestController);
- gLayoutTestController->makeWindowObject(context, globalObject, &exception);
+ ASSERT(gTestRunner);
+ gTestRunner->makeWindowObject(context, globalObject, &exception);
ASSERT(!exception);
gcController->makeWindowObject(context, globalObject, &exception);
@@ -338,18 +338,18 @@
- (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - didReceiveTitle: %@", [frame _drt_descriptionSuitableForTestResult], title];
printf ("%s\n", [string UTF8String]);
}
- if (gLayoutTestController->dumpTitleChanges())
+ if (gTestRunner->dumpTitleChanges())
printf("TITLE CHANGED: %s\n", [title UTF8String]);
}
- (void)webView:(WebView *)sender didReceiveServerRedirectForProvisionalLoadForFrame:(WebFrame *)frame
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - didReceiveServerRedirectForProvisionalLoadForFrame", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
}
@@ -357,7 +357,7 @@
- (void)webView:(WebView *)sender didChangeLocationWithinPageForFrame:(WebFrame *)frame
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - didChangeLocationWithinPageForFrame", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
}
@@ -365,12 +365,12 @@
- (void)webView:(WebView *)sender willPerformClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date forFrame:(WebFrame *)frame
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - willPerformClientRedirectToURL: %@ ", [frame _drt_descriptionSuitableForTestResult], [URL _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
}
- if (!done && gLayoutTestController->dumpUserGestureInFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpUserGestureInFrameLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - in willPerformClientRedirect", [frame _drt_printFrameUserGestureStatus]];
printf ("%s\n", [string UTF8String]);
}
@@ -378,7 +378,7 @@
- (void)webView:(WebView *)sender didCancelClientRedirectForFrame:(WebFrame *)frame
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - didCancelClientRedirectForFrame", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
}
@@ -386,7 +386,7 @@
- (void)webView:(WebView *)sender didFinishDocumentLoadForFrame:(WebFrame *)frame
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - didFinishDocumentLoadForFrame", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
} else if (!done) {
@@ -400,7 +400,7 @@
- (void)webView:(WebView *)sender didHandleOnloadEventsForFrame:(WebFrame *)frame
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - didHandleOnloadEventsForFrame", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
}
@@ -408,25 +408,25 @@
- (void)webViewDidDisplayInsecureContent:(WebView *)sender
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf ("didDisplayInsecureContent\n");
}
- (void)webView:(WebView *)sender didRunInsecureContent:(WebSecurityOrigin *)origin
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf ("didRunInsecureContent\n");
}
- (void)webView:(WebView *)sender didDetectXSS:(NSURL *)insecureURL
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf ("didDetectXSS\n");
}
- (void)webViewProgressFinishedNotification:(NSNotification *)notification
{
- if (!done && gLayoutTestController->dumpProgressFinishedCallback())
+ if (!done && gTestRunner->dumpProgressFinishedCallback())
printf ("postProgressFinishedNotification\n");
}
diff --git a/Tools/DumpRenderTree/mac/HistoryDelegate.mm b/Tools/DumpRenderTree/mac/HistoryDelegate.mm
index cbc409327..4c703f90a 100644
--- a/Tools/DumpRenderTree/mac/HistoryDelegate.mm
+++ b/Tools/DumpRenderTree/mac/HistoryDelegate.mm
@@ -26,7 +26,7 @@
#import "HistoryDelegate.h"
#import "DumpRenderTree.h"
-#import "LayoutTestController.h"
+#import "TestRunner.h"
#import <WebKit/WebNavigationData.h>
#import <WebKit/WebView.h>
@@ -74,7 +74,7 @@
- (void)populateVisitedLinksForWebView:(WebView *)webView
{
- if (gLayoutTestController->dumpVisitedLinksCallback())
+ if (gTestRunner->dumpVisitedLinksCallback())
printf("Asked to populate visited links for WebView \"%s\"\n", [[[NSURL URLWithString:[webView mainFrameURL]] _drt_descriptionSuitableForTestResult] UTF8String]);
}
diff --git a/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm b/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm
index eaef0d523..71f739063 100644
--- a/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm
+++ b/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm
@@ -33,7 +33,7 @@
#include "PixelDumpSupportCG.h"
#include "DumpRenderTree.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include <CoreGraphics/CGBitmapContext.h>
#include <wtf/Assertions.h>
#include <wtf/RefPtr.h>
@@ -184,8 +184,8 @@ PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool onscreen, bool inc
PassRefPtr<BitmapContext> createPagedBitmapContext()
{
- int pageWidthInPixels = LayoutTestController::maxViewWidth;
- int pageHeightInPixels = LayoutTestController::maxViewHeight;
+ int pageWidthInPixels = TestRunner::maxViewWidth;
+ int pageHeightInPixels = TestRunner::maxViewHeight;
int numberOfPages = [mainFrame numberOfPages:pageWidthInPixels:pageHeightInPixels];
size_t rowBytes = 0;
void* buffer = 0;
diff --git a/Tools/DumpRenderTree/mac/PolicyDelegate.h b/Tools/DumpRenderTree/mac/PolicyDelegate.h
index 3b954557d..c1a7e6f25 100644
--- a/Tools/DumpRenderTree/mac/PolicyDelegate.h
+++ b/Tools/DumpRenderTree/mac/PolicyDelegate.h
@@ -28,14 +28,14 @@
#import <Cocoa/Cocoa.h>
-class LayoutTestController;
+class TestRunner;
@interface PolicyDelegate : NSObject {
BOOL permissiveDelegate;
- LayoutTestController* controllerToNotifyDone;
+ TestRunner* controllerToNotifyDone;
}
- (void)setPermissive:(BOOL)permissive;
-- (void)setControllerToNotifyDone:(LayoutTestController*)controller;
+- (void)setControllerToNotifyDone:(TestRunner*)controller;
@end
diff --git a/Tools/DumpRenderTree/mac/PolicyDelegate.mm b/Tools/DumpRenderTree/mac/PolicyDelegate.mm
index 5ad7368f3..6a0eeb9ec 100644
--- a/Tools/DumpRenderTree/mac/PolicyDelegate.mm
+++ b/Tools/DumpRenderTree/mac/PolicyDelegate.mm
@@ -30,7 +30,7 @@
#import "PolicyDelegate.h"
#import "DumpRenderTree.h"
-#import "LayoutTestController.h"
+#import "TestRunner.h"
#import <WebKit/DOMElement.h>
#import <WebKit/WebFrame.h>
#import <WebKit/WebPolicyDelegate.h>
@@ -133,7 +133,7 @@ static NSString *dispositionTypeFromContentDispositionHeader(NSString *header)
permissiveDelegate = permissive;
}
-- (void)setControllerToNotifyDone:(LayoutTestController*)controller
+- (void)setControllerToNotifyDone:(TestRunner*)controller
{
controllerToNotifyDone = controller;
}
diff --git a/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm b/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm
index a1e4f17a2..c5b26442c 100644
--- a/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm
+++ b/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm
@@ -30,7 +30,7 @@
#import "ResourceLoadDelegate.h"
#import "DumpRenderTree.h"
-#import "LayoutTestController.h"
+#import "TestRunner.h"
#import <WebKit/WebKit.h>
#import <WebKit/WebTypesInternal.h>
#import <WebKit/WebDataSourcePrivate.h>
@@ -121,7 +121,7 @@ using namespace std;
{
ASSERT([[dataSource webFrame] dataSource] || [[dataSource webFrame] provisionalDataSource]);
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks())
+ if (!done && gTestRunner->dumpResourceLoadCallbacks())
return [[request URL] _drt_descriptionSuitableForTestResult];
return @"<unknown>";
@@ -140,20 +140,20 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host)
-(NSURLRequest *)webView: (WebView *)wv resource:identifier willSendRequest: (NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse fromDataSource:(WebDataSource *)dataSource
{
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
+ if (!done && gTestRunner->dumpResourceLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - willSendRequest %@ redirectResponse %@", identifier, [request _drt_descriptionSuitableForTestResult],
[redirectResponse _drt_descriptionSuitableForTestResult]];
printf("%s\n", [string UTF8String]);
}
- if (!done && !gLayoutTestController->deferMainResourceDataLoad()) {
+ if (!done && !gTestRunner->deferMainResourceDataLoad()) {
[dataSource _setDeferMainResourceDataLoad:false];
}
- if (!done && gLayoutTestController->willSendRequestReturnsNull())
+ if (!done && gTestRunner->willSendRequestReturnsNull())
return nil;
- if (!done && gLayoutTestController->willSendRequestReturnsNullOnRedirect() && redirectResponse) {
+ if (!done && gTestRunner->willSendRequestReturnsNullOnRedirect() && redirectResponse) {
printf("Returning null for this redirect\n");
return nil;
}
@@ -161,7 +161,7 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host)
NSURL *url = [request URL];
NSString *host = [url host];
if (host && (NSOrderedSame == [[url scheme] caseInsensitiveCompare:@"http"] || NSOrderedSame == [[url scheme] caseInsensitiveCompare:@"https"])) {
- NSString *testPathOrURL = [NSString stringWithUTF8String:gLayoutTestController->testPathOrURL().c_str()];
+ NSString *testPathOrURL = [NSString stringWithUTF8String:gTestRunner->testPathOrURL().c_str()];
NSString *lowercaseTestPathOrURL = [testPathOrURL lowercaseString];
NSString *testHost = 0;
if ([lowercaseTestPathOrURL hasPrefix:@"http:"] || [lowercaseTestPathOrURL hasPrefix:@"https:"])
@@ -176,13 +176,13 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host)
return nil;
NSMutableURLRequest *newRequest = [request mutableCopy];
- const set<string>& clearHeaders = gLayoutTestController->willSendRequestClearHeaders();
+ const set<string>& clearHeaders = gTestRunner->willSendRequestClearHeaders();
for (set<string>::const_iterator header = clearHeaders.begin(); header != clearHeaders.end(); ++header) {
NSString *nsHeader = [[NSString alloc] initWithUTF8String:header->c_str()];
[newRequest setValue:nil forHTTPHeaderField:nsHeader];
[nsHeader release];
}
- const std::string& destination = gLayoutTestController->redirectionDestinationForURL([[url absoluteString] UTF8String]);
+ const std::string& destination = gTestRunner->redirectionDestinationForURL([[url absoluteString] UTF8String]);
if (destination.length())
[newRequest setURL:[NSURL URLWithString:[NSString stringWithUTF8String:destination.data()]]];
@@ -191,7 +191,7 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host)
- (void)webView:(WebView *)wv resource:(id)identifier didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource
{
- if (!gLayoutTestController->handlesAuthenticationChallenges()) {
+ if (!gTestRunner->handlesAuthenticationChallenges()) {
NSString *string = [NSString stringWithFormat:@"%@ - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet", identifier];
printf("%s\n", [string UTF8String]);
@@ -199,10 +199,10 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host)
return;
}
- const char* user = gLayoutTestController->authenticationUsername().c_str();
+ const char* user = gTestRunner->authenticationUsername().c_str();
NSString *nsUser = [NSString stringWithFormat:@"%s", user ? user : ""];
- const char* password = gLayoutTestController->authenticationPassword().c_str();
+ const char* password = gTestRunner->authenticationPassword().c_str();
NSString *nsPassword = [NSString stringWithFormat:@"%s", password ? password : ""];
NSString *string = [NSString stringWithFormat:@"%@ - didReceiveAuthenticationChallenge - Responding with %@:%@", identifier, nsUser, nsPassword];
@@ -218,11 +218,11 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host)
-(void)webView: (WebView *)wv resource:identifier didReceiveResponse: (NSURLResponse *)response fromDataSource:(WebDataSource *)dataSource
{
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
+ if (!done && gTestRunner->dumpResourceLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - didReceiveResponse %@", identifier, [response _drt_descriptionSuitableForTestResult]];
printf("%s\n", [string UTF8String]);
}
- if (!done && gLayoutTestController->dumpResourceResponseMIMETypes())
+ if (!done && gTestRunner->dumpResourceResponseMIMETypes())
printf("%s has MIME type %s\n", [[[[response URL] relativePath] lastPathComponent] UTF8String], [[response MIMEType] UTF8String]);
}
@@ -232,7 +232,7 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host)
-(void)webView: (WebView *)wv resource:identifier didFinishLoadingFromDataSource:(WebDataSource *)dataSource
{
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
+ if (!done && gTestRunner->dumpResourceLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - didFinishLoading", identifier];
printf("%s\n", [string UTF8String]);
}
@@ -240,7 +240,7 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host)
-(void)webView: (WebView *)wv resource:identifier didFailLoadingWithError:(NSError *)error fromDataSource:(WebDataSource *)dataSource
{
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
+ if (!done && gTestRunner->dumpResourceLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - didFailLoadingWithError: %@", identifier, [error _drt_descriptionSuitableForTestResult]];
printf("%s\n", [string UTF8String]);
}
@@ -255,7 +255,7 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host)
-(NSCachedURLResponse *) webView: (WebView *)wv resource:(id)identifier willCacheResponse:(NSCachedURLResponse *)response fromDataSource:(WebDataSource *)dataSource
{
- if (!done && gLayoutTestController->dumpWillCacheResponse()) {
+ if (!done && gTestRunner->dumpWillCacheResponse()) {
NSString *string = [NSString stringWithFormat:@"%@ - willCacheResponse: called", identifier];
printf("%s\n", [string UTF8String]);
}
@@ -266,11 +266,11 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host)
{
// Only log the message when shouldPaintBrokenImage() returns NO; this avoids changing results of layout tests with failed
// images, e.g., security/block-test-no-port.html.
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks() && !gLayoutTestController->shouldPaintBrokenImage()) {
+ if (!done && gTestRunner->dumpResourceLoadCallbacks() && !gTestRunner->shouldPaintBrokenImage()) {
NSString *string = [NSString stringWithFormat:@"%@ - shouldPaintBrokenImage: NO", [imageURL _drt_descriptionSuitableForTestResult]];
printf("%s\n", [string UTF8String]);
}
- return gLayoutTestController->shouldPaintBrokenImage();
+ return gTestRunner->shouldPaintBrokenImage();
}
@end
diff --git a/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/Tools/DumpRenderTree/mac/TestRunnerMac.mm
index a32287141..1d7de85e2 100644
--- a/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm
+++ b/Tools/DumpRenderTree/mac/TestRunnerMac.mm
@@ -28,7 +28,7 @@
#import "config.h"
#import "DumpRenderTree.h"
-#import "LayoutTestController.h"
+#import "TestRunner.h"
#import "EditingDelegate.h"
#import "MockGeolocationProvider.h"
@@ -107,11 +107,11 @@
@end
-LayoutTestController::~LayoutTestController()
+TestRunner::~TestRunner()
{
}
-void LayoutTestController::addDisallowedURL(JSStringRef url)
+void TestRunner::addDisallowedURL(JSStringRef url)
{
RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, url));
@@ -125,17 +125,17 @@ void LayoutTestController::addDisallowedURL(JSStringRef url)
CFSetAddValue(disallowedURLs, [request URL]);
}
-bool LayoutTestController::callShouldCloseOnWebView()
+bool TestRunner::callShouldCloseOnWebView()
{
return [[mainFrame webView] shouldClose];
}
-void LayoutTestController::clearAllApplicationCaches()
+void TestRunner::clearAllApplicationCaches()
{
[WebApplicationCache deleteAllApplicationCaches];
}
-long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef url)
+long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef url)
{
RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, url));
WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:(NSString *)urlCF.get()]];
@@ -144,12 +144,12 @@ long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef u
return usage;
}
-void LayoutTestController::syncLocalStorage()
+void TestRunner::syncLocalStorage()
{
[[WebStorageManager sharedWebStorageManager] syncLocalStorage];
}
-long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef url)
+long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef url)
{
RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, url));
WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:(NSString *)urlCF.get()]];
@@ -158,12 +158,12 @@ long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef url)
return usage;
}
-void LayoutTestController::observeStorageTrackerNotifications(unsigned number)
+void TestRunner::observeStorageTrackerNotifications(unsigned number)
{
[storageDelegate logNotifications:number controller:this];
}
-void LayoutTestController::clearApplicationCacheForOrigin(JSStringRef url)
+void TestRunner::clearApplicationCacheForOrigin(JSStringRef url)
{
RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, url));
@@ -186,32 +186,32 @@ JSValueRef originsArrayToJS(JSContextRef context, NSArray *origins)
return JSObjectMakeArray(context, count, jsOriginsArray, NULL);
}
-JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context)
+JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context)
{
return originsArrayToJS(context, [WebApplicationCache originsWithCache]);
}
-void LayoutTestController::clearAllDatabases()
+void TestRunner::clearAllDatabases()
{
[[WebDatabaseManager sharedWebDatabaseManager] deleteAllDatabases];
}
-void LayoutTestController::deleteAllLocalStorage()
+void TestRunner::deleteAllLocalStorage()
{
[[WebStorageManager sharedWebStorageManager] deleteAllOrigins];
}
-void LayoutTestController::setStorageDatabaseIdleInterval(double interval)
+void TestRunner::setStorageDatabaseIdleInterval(double interval)
{
[WebStorageManager setStorageDatabaseIdleInterval:interval];
}
-JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context)
+JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context)
{
return originsArrayToJS(context, [[WebStorageManager sharedWebStorageManager] origins]);
}
-void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef URL)
+void TestRunner::deleteLocalStorageForOrigin(JSStringRef URL)
{
RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, URL));
@@ -220,7 +220,7 @@ void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef URL)
[origin release];
}
-void LayoutTestController::clearBackForwardList()
+void TestRunner::clearBackForwardList()
{
WebBackForwardList *backForwardList = [[mainFrame webView] backForwardList];
WebHistoryItem *item = [[backForwardList currentItem] retain];
@@ -235,26 +235,26 @@ void LayoutTestController::clearBackForwardList()
[item release];
}
-JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name)
+JSStringRef TestRunner::copyDecodedHostName(JSStringRef name)
{
RetainPtr<CFStringRef> nameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, name));
NSString *nameNS = (NSString *)nameCF.get();
return JSStringCreateWithCFString((CFStringRef)[nameNS _web_decodeHostName]);
}
-JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name)
+JSStringRef TestRunner::copyEncodedHostName(JSStringRef name)
{
RetainPtr<CFStringRef> nameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, name));
NSString *nameNS = (NSString *)nameCF.get();
return JSStringCreateWithCFString((CFStringRef)[nameNS _web_encodeHostName]);
}
-void LayoutTestController::display()
+void TestRunner::display()
{
displayWebView();
}
-void LayoutTestController::keepWebHistory()
+void TestRunner::keepWebHistory()
{
if (![WebHistory optionalSharedHistory]) {
WebHistory *history = [[WebHistory alloc] init];
@@ -263,18 +263,18 @@ void LayoutTestController::keepWebHistory()
}
}
-JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
+JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
{
return [[mainFrame webView] _computedStyleIncludingVisitedInfo:context forElement:value];
}
-JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
+JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const
{
JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame _layerTreeAsText]));
return string;
}
-JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
+JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
{
DOMElement *element = [DOMElement _DOMElementFromJSContext:context value:nodeObject];
if (!element)
@@ -284,45 +284,45 @@ JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRe
return markerText;
}
-JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const
+JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const
{
JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame pageProperty:propertyName:pageNumber]));
return propertyValue;
}
-JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
+JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
{
JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame pageSizeAndMarginsInPixels:pageNumber:width:height:marginTop:marginRight:marginBottom:marginLeft]));
return propertyValue;
}
-int LayoutTestController::numberOfPages(float pageWidthInPixels, float pageHeightInPixels)
+int TestRunner::numberOfPages(float pageWidthInPixels, float pageHeightInPixels)
{
return [mainFrame numberOfPages:pageWidthInPixels:pageHeightInPixels];
}
-int LayoutTestController::numberOfPendingGeolocationPermissionRequests()
+int TestRunner::numberOfPendingGeolocationPermissionRequests()
{
return [[[mainFrame webView] UIDelegate] numberOfPendingGeolocationPermissionRequests];
}
-size_t LayoutTestController::webHistoryItemCount()
+size_t TestRunner::webHistoryItemCount()
{
return [[[WebHistory optionalSharedHistory] allItems] count];
}
-unsigned LayoutTestController::workerThreadCount() const
+unsigned TestRunner::workerThreadCount() const
{
return [WebWorkersPrivate workerThreadCount];
}
-JSRetainPtr<JSStringRef> LayoutTestController::platformName() const
+JSRetainPtr<JSStringRef> TestRunner::platformName() const
{
JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("mac"));
return platformName;
}
-void LayoutTestController::notifyDone()
+void TestRunner::notifyDone()
{
if (m_waitToDump && !topLoadingFrame && !WorkQueue::shared()->count())
dump();
@@ -362,12 +362,12 @@ static inline std::string resourceRootAbsolutePath(const std::string& testPathOr
return testPathOrURL.substr(0, indexOfSeparatorAfterDirectoryName(expectedRootName, testPathOrURL));
}
-JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef localResourceJSString)
+JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef localResourceJSString)
{
// The passed in path will be an absolute path to the resource starting
// with "/tmp" or "/tmp/LayoutTests", optionally starting with the explicit file:// protocol.
// /tmp maps to DUMPRENDERTREE_TEMP, and /tmp/LayoutTests maps to LOCAL_RESOURCE_ROOT.
- // FIXME: This code should work on all *nix platforms and can be moved into LayoutTestController.cpp.
+ // FIXME: This code should work on all *nix platforms and can be moved into TestRunner.cpp.
std::string expectedRootName;
std::string absolutePathToResourceRoot;
std::string localResourceString = stringFromJSString(localResourceJSString);
@@ -393,7 +393,7 @@ JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSSt
return JSStringCreateWithUTF8CString(absolutePathToLocalResource.c_str());
}
-void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target)
+void TestRunner::queueLoad(JSStringRef url, JSStringRef target)
{
RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, url));
NSString *urlNS = (NSString *)urlCF.get();
@@ -405,12 +405,12 @@ void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target)
WorkQueue::shared()->queue(new LoadItem(absoluteURL.get(), target));
}
-void LayoutTestController::setAcceptsEditing(bool newAcceptsEditing)
+void TestRunner::setAcceptsEditing(bool newAcceptsEditing)
{
[(EditingDelegate *)[[mainFrame webView] editingDelegate] setAcceptsEditing:newAcceptsEditing];
}
-void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
+void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
{
if (alwaysAcceptCookies == m_alwaysAcceptCookies)
return;
@@ -420,24 +420,24 @@ void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
[WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:cookieAcceptPolicy];
}
-void LayoutTestController::setAppCacheMaximumSize(unsigned long long size)
+void TestRunner::setAppCacheMaximumSize(unsigned long long size)
{
[WebApplicationCache setMaximumSize:size];
}
-void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota)
+void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota)
{
WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:@"http://127.0.0.1:8000"]];
[[origin applicationCacheQuotaManager] setQuota:quota];
[origin release];
}
-void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
+void TestRunner::setAuthorAndUserStylesEnabled(bool flag)
{
[[[mainFrame webView] preferences] setAuthorAndUserStylesEnabled:flag];
}
-void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled)
+void TestRunner::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled)
{
DOMElement *element = [DOMElement _DOMElementFromJSContext:context value:nodeObject];
if (!element || ![element isKindOfClass:[DOMHTMLInputElement class]])
@@ -446,7 +446,7 @@ void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeOb
[(DOMHTMLInputElement *)element _setAutofilled:autofilled];
}
-void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive)
+void TestRunner::setCustomPolicyDelegate(bool setDelegate, bool permissive)
{
if (setDelegate) {
[policyDelegate setPermissive:permissive];
@@ -455,30 +455,30 @@ void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permis
[[mainFrame webView] setPolicyDelegate:nil];
}
-void LayoutTestController::setDatabaseQuota(unsigned long long quota)
+void TestRunner::setDatabaseQuota(unsigned long long quota)
{
WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:@"file:///"]];
[[origin databaseQuotaManager] setQuota:quota];
[origin release];
}
-void LayoutTestController::goBack()
+void TestRunner::goBack()
{
[[mainFrame webView] goBack];
}
-void LayoutTestController::setDefersLoading(bool defers)
+void TestRunner::setDefersLoading(bool defers)
{
[[mainFrame webView] setDefersCallbacks:defers];
}
-void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme)
+void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme)
{
RetainPtr<CFStringRef> schemeCFString(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, scheme));
[WebView _setDomainRelaxationForbidden:forbidden forURLScheme:(NSString *)schemeCFString.get()];
}
-void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
{
// DumpRenderTree configured the WebView to use WebDeviceOrientationProviderMock.
id<WebDeviceOrientationProvider> provider = [[mainFrame webView] _deviceOrientationProvider];
@@ -488,14 +488,14 @@ void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double
[orientation release];
}
-void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
+void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
{
WebGeolocationPosition *position = [[WebGeolocationPosition alloc] initWithTimestamp:currentTime() latitude:latitude longitude:longitude accuracy:accuracy];
[[MockGeolocationProvider shared] setPosition:position];
[position release];
}
-void LayoutTestController::setMockGeolocationError(int code, JSStringRef message)
+void TestRunner::setMockGeolocationError(int code, JSStringRef message)
{
RetainPtr<CFStringRef> messageCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, message));
NSString *messageNS = (NSString *)messageCF.get();
@@ -503,31 +503,31 @@ void LayoutTestController::setMockGeolocationError(int code, JSStringRef message
[[MockGeolocationProvider shared] setError:error];
}
-void LayoutTestController::setGeolocationPermission(bool allow)
+void TestRunner::setGeolocationPermission(bool allow)
{
setGeolocationPermissionCommon(allow);
[[[mainFrame webView] UIDelegate] didSetMockGeolocationPermission];
}
-void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
+void TestRunner::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
}
-void LayoutTestController::setMockSpeechInputDumpRect(bool flag)
+void TestRunner::setMockSpeechInputDumpRect(bool flag)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
}
-void LayoutTestController::startSpeechInput(JSContextRef inputElement)
+void TestRunner::startSpeechInput(JSContextRef inputElement)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
}
-void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
+void TestRunner::setIconDatabaseEnabled(bool iconDatabaseEnabled)
{
// FIXME: Workaround <rdar://problem/6480108>
static WebIconDatabase *sharedWebIconDatabase = NULL;
@@ -541,7 +541,7 @@ void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
[sharedWebIconDatabase setEnabled:iconDatabaseEnabled];
}
-void LayoutTestController::setMainFrameIsFirstResponder(bool flag)
+void TestRunner::setMainFrameIsFirstResponder(bool flag)
{
NSView *documentView = [[mainFrame frameView] documentView];
@@ -549,79 +549,79 @@ void LayoutTestController::setMainFrameIsFirstResponder(bool flag)
[[[mainFrame webView] window] makeFirstResponder:firstResponder];
}
-void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
+void TestRunner::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
{
[[[mainFrame webView] preferences] setPrivateBrowsingEnabled:privateBrowsingEnabled];
}
-void LayoutTestController::setXSSAuditorEnabled(bool enabled)
+void TestRunner::setXSSAuditorEnabled(bool enabled)
{
[[[mainFrame webView] preferences] setXSSAuditorEnabled:enabled];
}
-void LayoutTestController::setFrameFlatteningEnabled(bool enabled)
+void TestRunner::setFrameFlatteningEnabled(bool enabled)
{
[[[mainFrame webView] preferences] setFrameFlatteningEnabled:enabled];
}
-void LayoutTestController::setSpatialNavigationEnabled(bool enabled)
+void TestRunner::setSpatialNavigationEnabled(bool enabled)
{
[[[mainFrame webView] preferences] setSpatialNavigationEnabled:enabled];
}
-void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
+void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled)
{
[[[mainFrame webView] preferences] setAllowUniversalAccessFromFileURLs:enabled];
}
-void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled)
+void TestRunner::setAllowFileAccessFromFileURLs(bool enabled)
{
[[[mainFrame webView] preferences] setAllowFileAccessFromFileURLs:enabled];
}
-void LayoutTestController::setPopupBlockingEnabled(bool popupBlockingEnabled)
+void TestRunner::setPopupBlockingEnabled(bool popupBlockingEnabled)
{
[[[mainFrame webView] preferences] setJavaScriptCanOpenWindowsAutomatically:!popupBlockingEnabled];
}
-void LayoutTestController::setPluginsEnabled(bool pluginsEnabled)
+void TestRunner::setPluginsEnabled(bool pluginsEnabled)
{
[[[mainFrame webView] preferences] setPlugInsEnabled:pluginsEnabled];
}
-void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled)
+void TestRunner::setJavaScriptCanAccessClipboard(bool enabled)
{
[[[mainFrame webView] preferences] setJavaScriptCanAccessClipboard:enabled];
}
-void LayoutTestController::setAutomaticLinkDetectionEnabled(bool enabled)
+void TestRunner::setAutomaticLinkDetectionEnabled(bool enabled)
{
[[mainFrame webView] setAutomaticLinkDetectionEnabled:enabled];
}
-void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles)
+void TestRunner::setTabKeyCyclesThroughElements(bool cycles)
{
[[mainFrame webView] setTabKeyCyclesThroughElements:cycles];
}
-void LayoutTestController::setUseDashboardCompatibilityMode(bool flag)
+void TestRunner::setUseDashboardCompatibilityMode(bool flag)
{
[[mainFrame webView] _setDashboardBehavior:WebDashboardBehaviorUseBackwardCompatibilityMode to:flag];
}
-void LayoutTestController::setUserStyleSheetEnabled(bool flag)
+void TestRunner::setUserStyleSheetEnabled(bool flag)
{
[[WebPreferences standardPreferences] setUserStyleSheetEnabled:flag];
}
-void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
+void TestRunner::setUserStyleSheetLocation(JSStringRef path)
{
RetainPtr<CFStringRef> pathCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, path));
NSURL *url = [NSURL URLWithString:(NSString *)pathCF.get()];
[[WebPreferences standardPreferences] setUserStyleSheetLocation:url];
}
-void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value)
+void TestRunner::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value)
{
DOMElement *element = [DOMElement _DOMElementFromJSContext:context value:nodeObject];
if (!element || ![element isKindOfClass:[DOMHTMLInputElement class]])
@@ -631,22 +631,22 @@ void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef node
[(DOMHTMLInputElement *)element _setValueForUser:(NSString *)valueCF.get()];
}
-void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
+void TestRunner::setViewModeMediaFeature(JSStringRef mode)
{
// FIXME: implement
}
-void LayoutTestController::disableImageLoading()
+void TestRunner::disableImageLoading()
{
[[WebPreferences standardPreferences] setLoadsImagesAutomatically:NO];
}
-void LayoutTestController::dispatchPendingLoadRequests()
+void TestRunner::dispatchPendingLoadRequests()
{
[[mainFrame webView] _dispatchPendingLoadRequests];
}
-void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value)
+void TestRunner::overridePreference(JSStringRef key, JSStringRef value)
{
RetainPtr<CFStringRef> keyCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, key));
NSString *keyNS = (NSString *)keyCF.get();
@@ -657,34 +657,34 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value
[[WebPreferences standardPreferences] _setPreferenceForTestWithValue:valueNS forKey:keyNS];
}
-void LayoutTestController::removeAllVisitedLinks()
+void TestRunner::removeAllVisitedLinks()
{
[WebHistory _removeAllVisitedLinks];
}
-void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL)
+void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef jsURL)
{
RetainPtr<CFStringRef> urlString(AdoptCF, JSStringCopyCFString(0, jsURL));
::setPersistentUserStyleSheetLocation(urlString.get());
}
-void LayoutTestController::clearPersistentUserStyleSheet()
+void TestRunner::clearPersistentUserStyleSheet()
{
::setPersistentUserStyleSheetLocation(0);
}
-void LayoutTestController::setWindowIsKey(bool windowIsKey)
+void TestRunner::setWindowIsKey(bool windowIsKey)
{
m_windowIsKey = windowIsKey;
[[mainFrame webView] _updateActiveState];
}
-void LayoutTestController::setSmartInsertDeleteEnabled(bool flag)
+void TestRunner::setSmartInsertDeleteEnabled(bool flag)
{
[[mainFrame webView] setSmartInsertDeleteEnabled:flag];
}
-void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag)
+void TestRunner::setSelectTrailingWhitespaceEnabled(bool flag)
{
[[mainFrame webView] setSelectTrailingWhitespaceEnabled:flag];
}
@@ -693,22 +693,22 @@ static const CFTimeInterval waitToDumpWatchdogInterval = 30.0;
static void waitUntilDoneWatchdogFired(CFRunLoopTimerRef timer, void* info)
{
- gLayoutTestController->waitToDumpWatchdogTimerFired();
+ gTestRunner->waitToDumpWatchdogTimerFired();
}
-void LayoutTestController::setWaitToDump(bool waitUntilDone)
+void TestRunner::setWaitToDump(bool waitUntilDone)
{
m_waitToDump = waitUntilDone;
if (m_waitToDump && shouldSetWaitToDumpWatchdog())
setWaitToDumpWatchdog(CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + waitToDumpWatchdogInterval, 0, 0, 0, waitUntilDoneWatchdogFired, NULL));
}
-int LayoutTestController::windowCount()
+int TestRunner::windowCount()
{
return CFArrayGetCount(openWindowsRef);
}
-bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef jsString)
+bool TestRunner::elementDoesAutoCompleteForElementWithId(JSStringRef jsString)
{
RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, jsString));
NSString *idNS = (NSString *)idCF.get();
@@ -722,7 +722,7 @@ bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef j
return false;
}
-void LayoutTestController::execCommand(JSStringRef name, JSStringRef value)
+void TestRunner::execCommand(JSStringRef name, JSStringRef value)
{
RetainPtr<CFStringRef> nameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, name));
NSString *nameNS = (NSString *)nameCF.get();
@@ -733,7 +733,7 @@ void LayoutTestController::execCommand(JSStringRef name, JSStringRef value)
[[mainFrame webView] _executeCoreCommandByName:nameNS value:valueNS];
}
-bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray)
+bool TestRunner::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray)
{
WebFindOptions options = 0;
@@ -769,12 +769,12 @@ bool LayoutTestController::findString(JSContextRef context, JSStringRef target,
return [[mainFrame webView] findString:(NSString *)targetCFString.get() options:options];
}
-void LayoutTestController::setCacheModel(int cacheModel)
+void TestRunner::setCacheModel(int cacheModel)
{
[[WebPreferences standardPreferences] setCacheModel:cacheModel];
}
-bool LayoutTestController::isCommandEnabled(JSStringRef name)
+bool TestRunner::isCommandEnabled(JSStringRef name)
{
RetainPtr<CFStringRef> nameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, name));
NSString *nameNS = (NSString *)nameCF.get();
@@ -798,7 +798,7 @@ bool LayoutTestController::isCommandEnabled(JSStringRef name)
return [validator validateUserInterfaceItem:target.get()];
}
-bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
+bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
{
RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, elementId));
NSString *idNS = (NSString *)idCF.get();
@@ -808,7 +808,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef anima
return [mainFrame _pauseAnimation:nameNS onNode:[[mainFrame DOMDocument] getElementById:idNS] atTime:time];
}
-bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
+bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
{
RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, elementId));
NSString *idNS = (NSString *)idCF.get();
@@ -818,19 +818,19 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop
return [mainFrame _pauseTransitionOfProperty:nameNS onNode:[[mainFrame DOMDocument] getElementById:idNS] atTime:time];
}
-unsigned LayoutTestController::numberOfActiveAnimations() const
+unsigned TestRunner::numberOfActiveAnimations() const
{
return [mainFrame _numberOfActiveAnimations];
}
-void LayoutTestController::waitForPolicyDelegate()
+void TestRunner::waitForPolicyDelegate()
{
setWaitToDump(true);
[policyDelegate setControllerToNotifyDone:this];
[[mainFrame webView] setPolicyDelegate:policyDelegate];
}
-void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
{
RetainPtr<CFStringRef> sourceOriginCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, sourceOrigin));
NSString *sourceOriginNS = (NSString *)sourceOriginCF.get();
@@ -841,7 +841,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigi
[WebView _addOriginAccessWhitelistEntryWithSourceOrigin:sourceOriginNS destinationProtocol:destinationProtocolNS destinationHost:destinationHostNS allowDestinationSubdomains:allowDestinationSubdomains];
}
-void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
{
RetainPtr<CFStringRef> sourceOriginCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, sourceOrigin));
NSString *sourceOriginNS = (NSString *)sourceOriginCF.get();
@@ -852,46 +852,46 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOr
[WebView _removeOriginAccessWhitelistEntryWithSourceOrigin:sourceOriginNS destinationProtocol:destinationProtocolNS destinationHost:destinationHostNS allowDestinationSubdomains:allowDestinationSubdomains];
}
-void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
+void TestRunner::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
{
// FIXME: implement
}
-void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
+void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
{
RetainPtr<CFStringRef> sourceCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, source));
NSString *sourceNS = (NSString *)sourceCF.get();
[WebView _addUserScriptToGroup:@"org.webkit.DumpRenderTree" world:[WebScriptWorld world] source:sourceNS url:nil whitelist:nil blacklist:nil injectionTime:(runAtStart ? WebInjectAtDocumentStart : WebInjectAtDocumentEnd) injectedFrames:(allFrames ? WebInjectInAllFrames : WebInjectInTopFrameOnly)];
}
-void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
+void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames)
{
RetainPtr<CFStringRef> sourceCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, source));
NSString *sourceNS = (NSString *)sourceCF.get();
[WebView _addUserStyleSheetToGroup:@"org.webkit.DumpRenderTree" world:[WebScriptWorld world] source:sourceNS url:nil whitelist:nil blacklist:nil injectedFrames:(allFrames ? WebInjectInAllFrames : WebInjectInTopFrameOnly)];
}
-void LayoutTestController::setDeveloperExtrasEnabled(bool enabled)
+void TestRunner::setDeveloperExtrasEnabled(bool enabled)
{
[[[mainFrame webView] preferences] setDeveloperExtrasEnabled:enabled];
}
-void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool enabled)
+void TestRunner::setAsynchronousSpellCheckingEnabled(bool enabled)
{
[[[mainFrame webView] preferences] setAsynchronousSpellCheckingEnabled:enabled];
}
-void LayoutTestController::showWebInspector()
+void TestRunner::showWebInspector()
{
[[[mainFrame webView] inspector] show:nil];
}
-void LayoutTestController::closeWebInspector()
+void TestRunner::closeWebInspector()
{
[[[mainFrame webView] inspector] close:nil];
}
-void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script)
+void TestRunner::evaluateInWebInspector(long callId, JSStringRef script)
{
RetainPtr<CFStringRef> scriptCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, script));
NSString *scriptNS = (NSString *)scriptCF.get();
@@ -916,12 +916,12 @@ unsigned worldIDForWorld(WebScriptWorld *world)
return 0;
}
-void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
+void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
{
// FIXME: Implement this.
}
-void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
+void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
{
RetainPtr<CFStringRef> scriptCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, script));
NSString *scriptNS = (NSString *)scriptCF.get();
@@ -978,7 +978,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObj
@end
-void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
+void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@@ -1005,13 +1005,13 @@ void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data,
[pool release];
}
-void LayoutTestController::apiTestGoToCurrentBackForwardItem()
+void TestRunner::apiTestGoToCurrentBackForwardItem()
{
WebView *view = [mainFrame webView];
[view goToBackForwardItem:[[view backForwardList] currentItem]];
}
-void LayoutTestController::setWebViewEditable(bool editable)
+void TestRunner::setWebViewEditable(bool editable)
{
WebView *view = [mainFrame webView];
[view setEditable:editable];
@@ -1092,7 +1092,7 @@ static NSString *SynchronousLoaderRunLoopMode = @"DumpRenderTreeSynchronousLoade
@end
-void LayoutTestController::authenticateSession(JSStringRef url, JSStringRef username, JSStringRef password)
+void TestRunner::authenticateSession(JSStringRef url, JSStringRef username, JSStringRef password)
{
// See <rdar://problem/7880699>.
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
@@ -1106,22 +1106,22 @@ void LayoutTestController::authenticateSession(JSStringRef url, JSStringRef user
#endif
}
-void LayoutTestController::abortModal()
+void TestRunner::abortModal()
{
[NSApp abortModal];
}
-void LayoutTestController::setSerializeHTTPLoads(bool serialize)
+void TestRunner::setSerializeHTTPLoads(bool serialize)
{
[WebView _setLoadResourcesSerially:serialize];
}
-void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval)
+void TestRunner::setMinimumTimerInterval(double minimumTimerInterval)
{
[[mainFrame webView] _setMinimumTimerInterval:minimumTimerInterval];
}
-void LayoutTestController::setTextDirection(JSStringRef directionName)
+void TestRunner::setTextDirection(JSStringRef directionName)
{
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
if (JSStringIsEqualToUTF8CString(directionName, "ltr"))
@@ -1133,7 +1133,7 @@ void LayoutTestController::setTextDirection(JSStringRef directionName)
#endif
}
-void LayoutTestController::addChromeInputField()
+void TestRunner::addChromeInputField()
{
NSTextField *textField = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 20)];
textField.tag = 1;
@@ -1144,7 +1144,7 @@ void LayoutTestController::addChromeInputField()
[[mainFrame webView] setNextKeyView:textField];
}
-void LayoutTestController::removeChromeInputField()
+void TestRunner::removeChromeInputField()
{
NSView* textField = [[[[mainFrame webView] window] contentView] viewWithTag:1];
if (textField) {
@@ -1153,37 +1153,37 @@ void LayoutTestController::removeChromeInputField()
}
}
-void LayoutTestController::focusWebView()
+void TestRunner::focusWebView()
{
[[[mainFrame webView] window] makeFirstResponder:[mainFrame webView]];
}
-void LayoutTestController::setBackingScaleFactor(double backingScaleFactor)
+void TestRunner::setBackingScaleFactor(double backingScaleFactor)
{
[[mainFrame webView] _setCustomBackingScaleFactor:backingScaleFactor];
}
-void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title)
+void TestRunner::simulateDesktopNotificationClick(JSStringRef title)
{
// FIXME: Implement.
}
-void LayoutTestController::resetPageVisibility()
+void TestRunner::resetPageVisibility()
{
// FIXME: Implement.
}
-void LayoutTestController::setPageVisibility(const char*)
+void TestRunner::setPageVisibility(const char*)
{
// FIXME: Implement.
}
-void LayoutTestController::sendWebIntentResponse(JSStringRef)
+void TestRunner::sendWebIntentResponse(JSStringRef)
{
// FIXME: Implement.
}
-void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)
+void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)
{
// FIXME: Implement.
}
diff --git a/Tools/DumpRenderTree/mac/UIDelegate.mm b/Tools/DumpRenderTree/mac/UIDelegate.mm
index 840fdc209..dddec7af1 100644
--- a/Tools/DumpRenderTree/mac/UIDelegate.mm
+++ b/Tools/DumpRenderTree/mac/UIDelegate.mm
@@ -32,7 +32,7 @@
#import "DumpRenderTree.h"
#import "DumpRenderTreeDraggingInfo.h"
#import "EventSendingController.h"
-#import "LayoutTestController.h"
+#import "TestRunner.h"
#import <WebKit/WebApplicationCache.h>
#import <WebKit/WebFramePrivate.h>
#import <WebKit/WebHTMLViewPrivate.h>
@@ -80,10 +80,10 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil;
- (void)webViewRunModal:(WebView *)sender
{
- gLayoutTestController->setWindowIsKey(false);
+ gTestRunner->setWindowIsKey(false);
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(modalWindowWillClose:) name:NSWindowWillCloseNotification object:nil];
[NSApp runModalForWindow:[sender window]];
- gLayoutTestController->setWindowIsKey(true);
+ gTestRunner->setWindowIsKey(true);
}
- (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame
@@ -111,7 +111,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil;
if (!done)
printf("CONFIRM NAVIGATION: %s\n", [message UTF8String]);
- return !gLayoutTestController->shouldStayOnPageAfterHandlingBeforeUnload();
+ return !gTestRunner->shouldStayOnPageAfterHandlingBeforeUnload();
}
@@ -125,25 +125,25 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil;
- (void)webViewFocus:(WebView *)webView
{
- gLayoutTestController->setWindowIsKey(true);
+ gTestRunner->setWindowIsKey(true);
}
- (void)webViewUnfocus:(WebView *)webView
{
- gLayoutTestController->setWindowIsKey(false);
+ gTestRunner->setWindowIsKey(false);
}
- (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request
{
- if (!gLayoutTestController->canOpenWindows())
+ if (!gTestRunner->canOpenWindows())
return nil;
// Make sure that waitUntilDone has been called.
- ASSERT(gLayoutTestController->waitToDump());
+ ASSERT(gTestRunner->waitToDump());
WebView *webView = createWebViewAndOffscreenWindow();
- if (gLayoutTestController->newWindowsCopyBackForwardList())
+ if (gTestRunner->newWindowsCopyBackForwardList())
[webView _loadBackForwardListFromOtherView:sender];
return [webView autorelease];
@@ -153,7 +153,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil;
{
NSWindow* window = [sender window];
- if (gLayoutTestController->callCloseOnWebViews())
+ if (gTestRunner->callCloseOnWebViews())
[sender close];
[window close];
@@ -161,7 +161,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil;
- (void)webView:(WebView *)sender frame:(WebFrame *)frame exceededDatabaseQuotaForSecurityOrigin:(WebSecurityOrigin *)origin database:(NSString *)databaseIdentifier
{
- if (!done && gLayoutTestController->dumpDatabaseCallbacks()) {
+ if (!done && gTestRunner->dumpDatabaseCallbacks()) {
printf("UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%s, %s, %i} database:%s\n", [[origin protocol] UTF8String], [[origin host] UTF8String],
[origin port], [databaseIdentifier UTF8String]);
}
@@ -172,7 +172,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil;
- (void)webView:(WebView *)sender exceededApplicationCacheOriginQuotaForSecurityOrigin:(WebSecurityOrigin *)origin totalSpaceNeeded:(NSUInteger)totalSpaceNeeded
{
- if (!done && gLayoutTestController->dumpApplicationCacheDelegateCallbacks()) {
+ if (!done && gTestRunner->dumpApplicationCacheDelegateCallbacks()) {
// For example, numbers from 30000 - 39999 will output as 30000.
// Rounding up or down not really matter for these tests. It's
// sufficient to just get a range of 10000 to determine if we were
@@ -182,7 +182,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil;
[[origin protocol] UTF8String], [[origin host] UTF8String], [origin port], truncatedSpaceNeeded);
}
- if (gLayoutTestController->disallowIncreaseForApplicationCacheQuota())
+ if (gTestRunner->disallowIncreaseForApplicationCacheQuota())
return;
static const unsigned long long defaultOriginQuota = [WebApplicationCache defaultOriginQuota];
@@ -191,20 +191,20 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil;
- (void)webView:(WebView *)sender setStatusText:(NSString *)text
{
- if (gLayoutTestController->dumpStatusCallbacks())
+ if (gTestRunner->dumpStatusCallbacks())
printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", [text UTF8String]);
}
- (void)webView:(WebView *)webView decidePolicyForGeolocationRequestFromOrigin:(WebSecurityOrigin *)origin frame:(WebFrame *)frame listener:(id<WebAllowDenyPolicyListener>)listener
{
- if (!gLayoutTestController->isGeolocationPermissionSet()) {
+ if (!gTestRunner->isGeolocationPermissionSet()) {
if (!m_pendingGeolocationPermissionListeners)
m_pendingGeolocationPermissionListeners = [[NSMutableSet set] retain];
[m_pendingGeolocationPermissionListeners addObject:listener];
return;
}
- if (gLayoutTestController->geolocationPermission())
+ if (gTestRunner->geolocationPermission())
[listener allow];
else
[listener deny];
@@ -212,7 +212,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil;
- (void)didSetMockGeolocationPermission
{
- ASSERT(gLayoutTestController->isGeolocationPermissionSet());
+ ASSERT(gTestRunner->isGeolocationPermissionSet());
if (m_pendingGeolocationPermissionListeners && !m_timer)
m_timer = [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(timerFired) userInfo:0 repeats:NO];
}
@@ -227,12 +227,12 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil;
- (void)timerFired
{
- ASSERT(gLayoutTestController->isGeolocationPermissionSet());
+ ASSERT(gTestRunner->isGeolocationPermissionSet());
m_timer = 0;
NSEnumerator* enumerator = [m_pendingGeolocationPermissionListeners objectEnumerator];
id<WebAllowDenyPolicyListener> listener;
while ((listener = [enumerator nextObject])) {
- if (gLayoutTestController->geolocationPermission())
+ if (gTestRunner->geolocationPermission())
[listener allow];
else
[listener deny];
@@ -260,7 +260,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil;
- (void)webView:(WebView *)webView enterFullScreenForElement:(DOMElement*)element listener:(NSObject<WebKitFullScreenListener>*)listener
{
- if (!gLayoutTestController->hasCustomFullScreenBehavior())
+ if (!gTestRunner->hasCustomFullScreenBehavior())
[self performSelector:@selector(enterFullScreenWithListener:) withObject:listener afterDelay:0];
}
@@ -272,7 +272,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil;
- (void)webView:(WebView *)webView exitFullScreenForElement:(DOMElement*)element listener:(NSObject<WebKitFullScreenListener>*)listener
{
- if (!gLayoutTestController->hasCustomFullScreenBehavior())
+ if (!gTestRunner->hasCustomFullScreenBehavior())
[self performSelector:@selector(exitFullScreenWithListener:) withObject:listener afterDelay:0];
}
diff --git a/Tools/DumpRenderTree/qt/DumpRenderTree.pro b/Tools/DumpRenderTree/qt/DumpRenderTree.pro
index 6cd068ccf..1936f644a 100644
--- a/Tools/DumpRenderTree/qt/DumpRenderTree.pro
+++ b/Tools/DumpRenderTree/qt/DumpRenderTree.pro
@@ -18,7 +18,8 @@ INCLUDEPATH += \
$${ROOT_WEBKIT_DIR}/Source/WebKit/qt/WebCoreSupport \
$${ROOT_WEBKIT_DIR}/Source/WTF
-QT = core gui network testlib webkit widgets printsupport
+QT = core gui network testlib webkit widgets
+contains(DEFINES, HAVE_QTPRINTSUPPORT=1): QT += printsupport
macx: QT += xml
contains(DEFINES, HAVE_FONTCONFIG=1): PKGCONFIG += fontconfig
@@ -30,7 +31,7 @@ HEADERS += \
EventSenderQt.h \
TextInputControllerQt.h \
WorkQueueItemQt.h \
- LayoutTestControllerQt.h \
+ TestRunnerQt.h \
GCControllerQt.h \
QtInitializeTestFonts.h \
testplugin.h
@@ -42,7 +43,7 @@ SOURCES += \
EventSenderQt.cpp \
TextInputControllerQt.cpp \
WorkQueueItemQt.cpp \
- LayoutTestControllerQt.cpp \
+ TestRunnerQt.cpp \
GCControllerQt.cpp \
QtInitializeTestFonts.cpp \
testplugin.cpp \
diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
index 8f64e2750..db09ad713 100755
--- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
+++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
@@ -36,7 +36,7 @@
#include "DumpRenderTreeSupportQt.h"
#include "EventSenderQt.h"
#include "GCControllerQt.h"
-#include "LayoutTestControllerQt.h"
+#include "TestRunnerQt.h"
#include "TextInputControllerQt.h"
#include "QtInitializeTestFonts.h"
#include "testplugin.h"
@@ -57,7 +57,7 @@
#include <QNetworkRequest>
#include <QPaintDevice>
#include <QPaintEngine>
-#ifndef QT_NO_PRINTER
+#if !defined(QT_NO_PRINTER) && HAVE(QTPRINTSUPPORT)
#include <QPrinter>
#endif
#include <QProgressBar>
@@ -110,7 +110,7 @@ void NetworkAccessManager::sslErrorsEncountered(QNetworkReply* reply, const QLis
#endif
-#ifndef QT_NO_PRINTER
+#if !defined(QT_NO_PRINTER) && HAVE(QTPRINTSUPPORT)
class NullPrinter : public QPrinter {
public:
class NullPaintEngine : public QPaintEngine {
@@ -176,7 +176,7 @@ QWebInspector* WebPage::webInspector()
void WebPage::resetSettings()
{
// After each layout test, reset the settings that may have been changed by
- // layoutTestController.overridePreference() or similar.
+ // testRunner.overridePreference() or similar.
settings()->resetFontSize(QWebSettings::DefaultFontSize);
settings()->resetAttribute(QWebSettings::JavascriptCanOpenWindows);
settings()->resetAttribute(QWebSettings::JavascriptEnabled);
@@ -194,16 +194,16 @@ void WebPage::resetSettings()
settings()->resetAttribute(QWebSettings::CSSGridLayoutEnabled);
settings()->resetAttribute(QWebSettings::AcceleratedCompositingEnabled);
- m_drt->layoutTestController()->setCaretBrowsingEnabled(false);
- m_drt->layoutTestController()->setAuthorAndUserStylesEnabled(true);
- m_drt->layoutTestController()->setFrameFlatteningEnabled(false);
- m_drt->layoutTestController()->setMockScrollbarsEnabled(false);
- m_drt->layoutTestController()->setSmartInsertDeleteEnabled(true);
- m_drt->layoutTestController()->setSelectTrailingWhitespaceEnabled(false);
- m_drt->layoutTestController()->setDefersLoading(false);
+ m_drt->testRunner()->setCaretBrowsingEnabled(false);
+ m_drt->testRunner()->setAuthorAndUserStylesEnabled(true);
+ m_drt->testRunner()->setFrameFlatteningEnabled(false);
+ m_drt->testRunner()->setMockScrollbarsEnabled(false);
+ m_drt->testRunner()->setSmartInsertDeleteEnabled(true);
+ m_drt->testRunner()->setSelectTrailingWhitespaceEnabled(false);
+ m_drt->testRunner()->setDefersLoading(false);
// globalSettings must be reset explicitly.
- m_drt->layoutTestController()->setXSSAuditorEnabled(false);
+ m_drt->testRunner()->setXSSAuditorEnabled(false);
QWebSettings::setMaximumPagesInCache(0); // reset to default
settings()->setUserStyleSheetUrl(QUrl()); // reset to default
@@ -232,12 +232,12 @@ void WebPage::requestPermission(QWebFrame* frame, QWebPage::Feature feature)
{
switch (feature) {
case Notifications:
- if (!m_drt->layoutTestController()->ignoreReqestForPermission())
+ if (!m_drt->testRunner()->ignoreReqestForPermission())
setFeaturePermission(frame, feature, PermissionGrantedByUser);
break;
case Geolocation:
- if (m_drt->layoutTestController()->isGeolocationPermissionSet())
- if (m_drt->layoutTestController()->geolocationPermission())
+ if (m_drt->testRunner()->isGeolocationPermissionSet())
+ if (m_drt->testRunner()->geolocationPermission())
setFeaturePermission(frame, feature, PermissionGrantedByUser);
else
setFeaturePermission(frame, feature, PermissionDeniedByUser);
@@ -265,9 +265,9 @@ void WebPage::permissionSet(QWebPage::Feature feature)
switch (feature) {
case Geolocation:
{
- Q_ASSERT(m_drt->layoutTestController()->isGeolocationPermissionSet());
+ Q_ASSERT(m_drt->testRunner()->isGeolocationPermissionSet());
foreach (QWebFrame* frame, m_pendingGeolocationRequests)
- if (m_drt->layoutTestController()->geolocationPermission())
+ if (m_drt->testRunner()->geolocationPermission())
setFeaturePermission(frame, feature, PermissionGrantedByUser);
else
setFeaturePermission(frame, feature, PermissionDeniedByUser);
@@ -330,8 +330,8 @@ bool WebPage::javaScriptPrompt(QWebFrame*, const QString& msg, const QString& de
bool WebPage::acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, NavigationType type)
{
- if (m_drt->layoutTestController()->waitForPolicy())
- m_drt->layoutTestController()->notifyDone();
+ if (m_drt->testRunner()->waitForPolicy())
+ m_drt->testRunner()->notifyDone();
return QWebPage::acceptNavigationRequest(frame, request, type);
}
@@ -339,7 +339,7 @@ bool WebPage::acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& r
bool WebPage::supportsExtension(QWebPage::Extension extension) const
{
if (extension == QWebPage::ErrorPageExtension)
- return m_drt->layoutTestController()->shouldHandleErrorPages();
+ return m_drt->testRunner()->shouldHandleErrorPages();
return false;
}
@@ -424,7 +424,7 @@ DumpRenderTree::DumpRenderTree()
DumpRenderTreeSupportQt::webPageSetGroupName(m_page, "org.webkit.qt.DumpRenderTree");
m_mainView->setContextMenuPolicy(Qt::NoContextMenu);
- m_mainView->resize(QSize(LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight));
+ m_mainView->resize(QSize(TestRunner::maxViewWidth, TestRunner::maxViewHeight));
// clean up cache by resetting quota.
qint64 quota = webPage()->settings()->offlineWebApplicationCacheQuota();
@@ -432,7 +432,7 @@ DumpRenderTree::DumpRenderTree()
// create our controllers. This has to be done before connectFrame,
// as it exports there to the JavaScript DOM window.
- m_controller = new LayoutTestController(this);
+ m_controller = new TestRunner(this);
connect(m_controller, SIGNAL(showPage()), this, SLOT(showPage()));
connect(m_controller, SIGNAL(hidePage()), this, SLOT(hidePage()));
@@ -500,7 +500,7 @@ static void clearHistory(QWebPage* page)
void DumpRenderTree::dryRunPrint(QWebFrame* frame)
{
-#ifndef QT_NO_PRINTER
+#if !defined(QT_NO_PRINTER) && HAVE(QTPRINTSUPPORT)
NullPrinter printer;
frame->print(&printer);
#endif
@@ -509,7 +509,7 @@ void DumpRenderTree::dryRunPrint(QWebFrame* frame)
void DumpRenderTree::resetToConsistentStateBeforeTesting(const QUrl& url)
{
// reset so that any current loads are stopped
- // NOTE: that this has to be done before the layoutTestController is
+ // NOTE: that this has to be done before the testRunner is
// reset or we get timeouts for some tests.
m_page->blockSignals(true);
m_page->triggerAction(QWebPage::Stop);
@@ -519,7 +519,7 @@ void DumpRenderTree::resetToConsistentStateBeforeTesting(const QUrl& url)
for (int i = 0; i < knownOrigins.size(); ++i)
knownOrigins[i].setDatabaseQuota(databaseDefaultQuota);
- // reset the layoutTestController at this point, so that we under no
+ // reset the testRunner at this point, so that we under no
// circumstance dump (stop the waitUntilDone timer) during the reset
// of the DRT.
m_controller->reset();
@@ -563,7 +563,7 @@ void DumpRenderTree::resetToConsistentStateBeforeTesting(const QUrl& url)
QLocale::setDefault(QLocale::c());
- layoutTestController()->setDeveloperExtrasEnabled(true);
+ testRunner()->setDeveloperExtrasEnabled(true);
#ifndef Q_OS_WINCE
setlocale(LC_ALL, "");
#endif
@@ -599,21 +599,21 @@ void DumpRenderTree::open(const QUrl& url)
resetToConsistentStateBeforeTesting(url);
if (isWebInspectorTest(m_page->mainFrame()->url()))
- layoutTestController()->closeWebInspector();
+ testRunner()->closeWebInspector();
if (isWebInspectorTest(url))
- layoutTestController()->showWebInspector();
+ testRunner()->showWebInspector();
if (isDumpAsTextTest(url))
- layoutTestController()->dumpAsText();
+ testRunner()->dumpAsText();
if (isGlobalHistoryTest(url))
- layoutTestController()->dumpHistoryCallbacks();
+ testRunner()->dumpHistoryCallbacks();
// W3C SVG tests expect to be 480x360
bool isW3CTest = url.toString().contains("svg/W3C-SVG-1.1");
- int width = isW3CTest ? 480 : LayoutTestController::maxViewWidth;
- int height = isW3CTest ? 360 : LayoutTestController::maxViewHeight;
+ int width = isW3CTest ? 480 : TestRunner::maxViewWidth;
+ int height = isW3CTest ? 360 : TestRunner::maxViewHeight;
m_mainView->resize(QSize(width, height));
m_page->setPreferredContentsSize(QSize());
m_page->setViewportSize(QSize(width, height));
@@ -876,7 +876,7 @@ QString DumpRenderTree::dumpBackForwardList(QWebPage* page)
return result;
}
-static const char *methodNameStringForFailedTest(LayoutTestController *controller)
+static const char *methodNameStringForFailedTest(TestRunner *controller)
{
const char *errorMessage;
if (controller->shouldDumpAsText())
@@ -1010,7 +1010,7 @@ void DumpRenderTree::connectFrame(QWebFrame *frame)
{
connect(frame, SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(initJSObjects()));
connect(frame, SIGNAL(provisionalLoad()),
- layoutTestController(), SLOT(provisionalLoad()));
+ testRunner(), SLOT(provisionalLoad()));
}
void DumpRenderTree::dumpDatabaseQuota(QWebFrame* frame, const QString& dbName)
diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h
index a9cf3cd73..710f17343 100644
--- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h
+++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h
@@ -55,7 +55,7 @@ QT_END_NAMESPACE
class QWebFrame;
-class LayoutTestController;
+class TestRunner;
class DumpRenderTreeSupportQt;
class EventSender;
class TextInputController;
@@ -85,7 +85,7 @@ public:
void closeRemainingWindows();
void resetToConsistentStateBeforeTesting(const QUrl&);
- LayoutTestController *layoutTestController() const { return m_controller; }
+ TestRunner *testRunner() const { return m_controller; }
EventSender *eventSender() const { return m_eventSender; }
TextInputController *textInputController() const { return m_textInputController; }
QString persistentStoragePath() const { return m_persistentStoragePath; }
@@ -138,7 +138,7 @@ private:
QString dumpFramesAsText(QWebFrame* frame);
QString dumpBackForwardList(QWebPage* page);
QString dumpFrameScrollPosition(QWebFrame* frame);
- LayoutTestController *m_controller;
+ TestRunner *m_controller;
bool m_dumpPixelsForCurrentTest;
QString m_expectedHash;
@@ -168,7 +168,7 @@ class NetworkAccessManager : public QNetworkAccessManager {
public:
NetworkAccessManager(QObject* parent);
-private slots:
+private Q_SLOTS:
#ifndef QT_NO_OPENSSL
void sslErrorsEncountered(QNetworkReply*, const QList<QSslError>&);
#endif
@@ -198,7 +198,7 @@ public:
void permissionSet(QWebPage::Feature feature);
-public slots:
+public Q_SLOTS:
bool shouldInterruptJavaScript() { return false; }
void requestPermission(QWebFrame* frame, QWebPage::Feature feature);
void cancelPermission(QWebFrame* frame, QWebPage::Feature feature);
@@ -207,7 +207,7 @@ protected:
bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, NavigationType type);
bool isTextOutputEnabled() { return m_drt->isTextOutputEnabled(); }
-private slots:
+private Q_SLOTS:
void setViewGeometry(const QRect&);
private:
diff --git a/Tools/DumpRenderTree/qt/EventSenderQt.h b/Tools/DumpRenderTree/qt/EventSenderQt.h
index 4ec6f92bb..1c4db0208 100644
--- a/Tools/DumpRenderTree/qt/EventSenderQt.h
+++ b/Tools/DumpRenderTree/qt/EventSenderQt.h
@@ -54,7 +54,7 @@ public:
virtual bool eventFilter(QObject* watched, QEvent* event);
void resetClickCount() { m_clickCount = 0; }
-public slots:
+public Q_SLOTS:
void mouseDown(int button = 0, const QStringList& modifiers = QStringList());
void mouseUp(int button = 0);
void mouseMoveTo(int x, int y);
diff --git a/Tools/DumpRenderTree/qt/GCControllerQt.h b/Tools/DumpRenderTree/qt/GCControllerQt.h
index d3c83b9fe..bcc9f2347 100644
--- a/Tools/DumpRenderTree/qt/GCControllerQt.h
+++ b/Tools/DumpRenderTree/qt/GCControllerQt.h
@@ -40,7 +40,7 @@ class GCController : public QObject
public:
GCController(QWebPage* parent);
-public slots:
+public Q_SLOTS:
void collect() const;
void collectOnAlternateThread(bool waitUntilDone) const;
unsigned int getJSObjectCount() const;
diff --git a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/Tools/DumpRenderTree/qt/TestRunnerQt.cpp
index 44d6da6a9..f35fe2614 100644
--- a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
+++ b/Tools/DumpRenderTree/qt/TestRunnerQt.cpp
@@ -27,10 +27,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
-#include "LayoutTestControllerQt.h"
-#include "DumpRenderTreeSupportQt.h"
+#include "TestRunnerQt.h"
#include "DumpRenderTreeQt.h"
+#include "DumpRenderTreeSupportQt.h"
#include "WorkQueue.h"
#include "WorkQueueItemQt.h"
#include <QCoreApplication>
@@ -38,7 +38,7 @@
#include <QLocale>
#include <qwebsettings.h>
-LayoutTestController::LayoutTestController(WebCore::DumpRenderTree* drt)
+TestRunner::TestRunner(WebCore::DumpRenderTree* drt)
: QObject()
, m_drt(drt)
, m_shouldTimeout(true)
@@ -48,7 +48,7 @@ LayoutTestController::LayoutTestController(WebCore::DumpRenderTree* drt)
DumpRenderTreeSupportQt::dumpNotification(true);
}
-void LayoutTestController::reset()
+void TestRunner::reset()
{
m_hasDumped = false;
m_loadFinished = false;
@@ -99,7 +99,7 @@ void LayoutTestController::reset()
emit hidePage();
}
-void LayoutTestController::processWork()
+void TestRunner::processWork()
{
// qDebug() << ">>>processWork";
@@ -111,7 +111,7 @@ void LayoutTestController::processWork()
}
// Called on loadFinished on WebPage
-void LayoutTestController::maybeDump(bool /*success*/)
+void TestRunner::maybeDump(bool /*success*/)
{
// This can happen on any of the http/tests/security/window-events-*.html tests, where the test opens
@@ -142,7 +142,7 @@ void LayoutTestController::maybeDump(bool /*success*/)
}
}
-void LayoutTestController::waitUntilDone()
+void TestRunner::waitUntilDone()
{
//qDebug() << ">>>>waitForDone";
m_waitForDone = true;
@@ -153,12 +153,12 @@ void LayoutTestController::waitUntilDone()
m_timeoutTimer.start(m_timeout, this);
}
-void LayoutTestController::setViewModeMediaFeature(const QString& mode)
+void TestRunner::setViewModeMediaFeature(const QString& mode)
{
m_drt->webPage()->setProperty("_q_viewMode", mode);
}
-int LayoutTestController::webHistoryItemCount()
+int TestRunner::webHistoryItemCount()
{
if (!m_webHistory)
return -1;
@@ -168,12 +168,12 @@ int LayoutTestController::webHistoryItemCount()
return m_webHistory->count() - 1;
}
-void LayoutTestController::keepWebHistory()
+void TestRunner::keepWebHistory()
{
m_webHistory = m_drt->webPage()->history();
}
-void LayoutTestController::notifyDone()
+void TestRunner::notifyDone()
{
qDebug() << ">>>>notifyDone";
@@ -197,49 +197,49 @@ void LayoutTestController::notifyDone()
m_waitForPolicy = false;
}
-int LayoutTestController::windowCount()
+int TestRunner::windowCount()
{
return m_drt->windowCount();
}
-void LayoutTestController::grantDesktopNotificationPermission(const QString& origin)
+void TestRunner::grantDesktopNotificationPermission(const QString& origin)
{
QWebFrame* frame = m_drt->webPage()->mainFrame();
m_drt->webPage()->setFeaturePermission(frame, QWebPage::Notifications, QWebPage::PermissionGrantedByUser);
m_desktopNotificationAllowedOrigins.append(origin);
}
-void LayoutTestController::ignoreDesktopNotificationPermissionRequests()
+void TestRunner::ignoreDesktopNotificationPermissionRequests()
{
m_ignoreDesktopNotification = true;
}
-bool LayoutTestController::checkDesktopNotificationPermission(const QString& origin)
+bool TestRunner::checkDesktopNotificationPermission(const QString& origin)
{
return !m_ignoreDesktopNotification && m_desktopNotificationAllowedOrigins.contains(origin);
}
-void LayoutTestController::simulateDesktopNotificationClick(const QString& title)
+void TestRunner::simulateDesktopNotificationClick(const QString& title)
{
DumpRenderTreeSupportQt::simulateDesktopNotificationClick(title);
}
-void LayoutTestController::display()
+void TestRunner::display()
{
emit showPage();
}
-void LayoutTestController::displayInvalidatedRegion()
+void TestRunner::displayInvalidatedRegion()
{
display();
}
-void LayoutTestController::clearBackForwardList()
+void TestRunner::clearBackForwardList()
{
m_drt->webPage()->history()->clear();
}
-QString LayoutTestController::pathToLocalResource(const QString& url)
+QString TestRunner::pathToLocalResource(const QString& url)
{
QString localTmpUrl(QLatin1String("file:///tmp/LayoutTests"));
@@ -256,82 +256,82 @@ QString LayoutTestController::pathToLocalResource(const QString& url)
return url;
}
-void LayoutTestController::dumpEditingCallbacks()
+void TestRunner::dumpEditingCallbacks()
{
qDebug() << ">>>dumpEditingCallbacks";
DumpRenderTreeSupportQt::dumpEditingCallbacks(true);
}
-void LayoutTestController::dumpFrameLoadCallbacks()
+void TestRunner::dumpFrameLoadCallbacks()
{
DumpRenderTreeSupportQt::dumpFrameLoader(true);
}
-void LayoutTestController::dumpProgressFinishedCallback()
+void TestRunner::dumpProgressFinishedCallback()
{
DumpRenderTreeSupportQt::dumpProgressFinishedCallback(true);
}
-void LayoutTestController::dumpUserGestureInFrameLoadCallbacks()
+void TestRunner::dumpUserGestureInFrameLoadCallbacks()
{
DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(true);
}
-void LayoutTestController::dumpResourceLoadCallbacks()
+void TestRunner::dumpResourceLoadCallbacks()
{
DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(true);
}
-void LayoutTestController::dumpResourceResponseMIMETypes()
+void TestRunner::dumpResourceResponseMIMETypes()
{
DumpRenderTreeSupportQt::dumpResourceResponseMIMETypes(true);
}
-void LayoutTestController::dumpWillCacheResponse()
+void TestRunner::dumpWillCacheResponse()
{
DumpRenderTreeSupportQt::dumpWillCacheResponseCallbacks(true);
}
-void LayoutTestController::dumpHistoryCallbacks()
+void TestRunner::dumpHistoryCallbacks()
{
DumpRenderTreeSupportQt::dumpHistoryCallbacks(true);
}
-void LayoutTestController::setWillSendRequestReturnsNullOnRedirect(bool enabled)
+void TestRunner::setWillSendRequestReturnsNullOnRedirect(bool enabled)
{
DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect(enabled);
}
-void LayoutTestController::setWillSendRequestReturnsNull(bool enabled)
+void TestRunner::setWillSendRequestReturnsNull(bool enabled)
{
DumpRenderTreeSupportQt::setWillSendRequestReturnsNull(enabled);
}
-void LayoutTestController::setWillSendRequestClearHeader(const QStringList& headers)
+void TestRunner::setWillSendRequestClearHeader(const QStringList& headers)
{
DumpRenderTreeSupportQt::setWillSendRequestClearHeaders(headers);
}
-void LayoutTestController::setDeferMainResourceDataLoad(bool defer)
+void TestRunner::setDeferMainResourceDataLoad(bool defer)
{
DumpRenderTreeSupportQt::setDeferMainResourceDataLoad(defer);
}
-void LayoutTestController::queueBackNavigation(int howFarBackward)
+void TestRunner::queueBackNavigation(int howFarBackward)
{
//qDebug() << ">>>queueBackNavigation" << howFarBackward;
for (int i = 0; i != howFarBackward; ++i)
WorkQueue::shared()->queue(new BackItem(1, m_drt->webPage()));
}
-void LayoutTestController::queueForwardNavigation(int howFarForward)
+void TestRunner::queueForwardNavigation(int howFarForward)
{
//qDebug() << ">>>queueForwardNavigation" << howFarForward;
for (int i = 0; i != howFarForward; ++i)
WorkQueue::shared()->queue(new ForwardItem(1, m_drt->webPage()));
}
-void LayoutTestController::queueLoad(const QString& url, const QString& target)
+void TestRunner::queueLoad(const QString& url, const QString& target)
{
//qDebug() << ">>>queueLoad" << url << target;
QUrl mainResourceUrl = m_drt->webPage()->mainFrame()->url();
@@ -339,7 +339,7 @@ void LayoutTestController::queueLoad(const QString& url, const QString& target)
WorkQueue::shared()->queue(new LoadItem(absoluteUrl, target, m_drt->webPage()));
}
-void LayoutTestController::queueLoadHTMLString(const QString& content, const QString& baseURL, const QString& failingURL)
+void TestRunner::queueLoadHTMLString(const QString& content, const QString& baseURL, const QString& failingURL)
{
if (failingURL.isEmpty())
WorkQueue::shared()->queue(new LoadHTMLStringItem(content, baseURL, m_drt->webPage()));
@@ -347,32 +347,32 @@ void LayoutTestController::queueLoadHTMLString(const QString& content, const QSt
WorkQueue::shared()->queue(new LoadAlternateHTMLStringItem(content, baseURL, failingURL, m_drt->webPage()));
}
-void LayoutTestController::queueReload()
+void TestRunner::queueReload()
{
//qDebug() << ">>>queueReload";
WorkQueue::shared()->queue(new ReloadItem(m_drt->webPage()));
}
-void LayoutTestController::queueLoadingScript(const QString& script)
+void TestRunner::queueLoadingScript(const QString& script)
{
//qDebug() << ">>>queueLoadingScript" << script;
WorkQueue::shared()->queue(new LoadingScriptItem(script, m_drt->webPage()));
}
-void LayoutTestController::queueNonLoadingScript(const QString& script)
+void TestRunner::queueNonLoadingScript(const QString& script)
{
//qDebug() << ">>>queueNonLoadingScript" << script;
WorkQueue::shared()->queue(new NonLoadingScriptItem(script, m_drt->webPage()));
}
-void LayoutTestController::provisionalLoad()
+void TestRunner::provisionalLoad()
{
QWebFrame* frame = qobject_cast<QWebFrame*>(sender());
if (!m_topLoadingFrame && !m_hasDumped)
m_topLoadingFrame = frame;
}
-void LayoutTestController::timerEvent(QTimerEvent *ev)
+void TestRunner::timerEvent(QTimerEvent *ev)
{
if (ev->timerId() == m_timeoutTimer.timerId()) {
const char* message = "FAIL: Timed out waiting for notifyDone to be called\n";
@@ -383,144 +383,144 @@ void LayoutTestController::timerEvent(QTimerEvent *ev)
QObject::timerEvent(ev);
}
-QString LayoutTestController::encodeHostName(const QString& host)
+QString TestRunner::encodeHostName(const QString& host)
{
QString encoded = QString::fromLatin1(QUrl::toAce(host + QLatin1String(".no")));
encoded.truncate(encoded.length() - 3); // strip .no
return encoded;
}
-QString LayoutTestController::decodeHostName(const QString& host)
+QString TestRunner::decodeHostName(const QString& host)
{
QString decoded = QUrl::fromAce(host.toLatin1() + QByteArray(".no"));
decoded.truncate(decoded.length() - 3);
return decoded;
}
-void LayoutTestController::setMediaType(const QString& type)
+void TestRunner::setMediaType(const QString& type)
{
DumpRenderTreeSupportQt::setMediaType(m_drt->webPage()->mainFrame(), type);
}
-void LayoutTestController::closeWebInspector()
+void TestRunner::closeWebInspector()
{
DumpRenderTreeSupportQt::webInspectorClose(m_drt->webPage());
m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, false);
}
-void LayoutTestController::setDeveloperExtrasEnabled(bool enabled)
+void TestRunner::setDeveloperExtrasEnabled(bool enabled)
{
m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, enabled);
}
-void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool)
+void TestRunner::setAsynchronousSpellCheckingEnabled(bool)
{
// FIXME: Implement this.
}
-void LayoutTestController::showWebInspector()
+void TestRunner::showWebInspector()
{
m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
DumpRenderTreeSupportQt::webInspectorShow(m_drt->webPage());
}
-void LayoutTestController::evaluateInWebInspector(long callId, const QString& script)
+void TestRunner::evaluateInWebInspector(long callId, const QString& script)
{
DumpRenderTreeSupportQt::webInspectorExecuteScript(m_drt->webPage(), callId, script);
}
-void LayoutTestController::setFrameFlatteningEnabled(bool enabled)
+void TestRunner::setFrameFlatteningEnabled(bool enabled)
{
DumpRenderTreeSupportQt::setFrameFlatteningEnabled(m_drt->webPage(), enabled);
}
-void LayoutTestController::setMockScrollbarsEnabled(bool enabled)
+void TestRunner::setMockScrollbarsEnabled(bool enabled)
{
DumpRenderTreeSupportQt::setMockScrollbarsEnabled(m_drt->webPage(), enabled);
}
-void LayoutTestController::goBack()
+void TestRunner::goBack()
{
DumpRenderTreeSupportQt::goBack(m_drt->webPage());
}
-void LayoutTestController::setDefersLoading(bool flag)
+void TestRunner::setDefersLoading(bool flag)
{
DumpRenderTreeSupportQt::setDefersLoading(m_drt->webPage(), flag);
}
-void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
+void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled)
{
m_drt->webPage()->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, enabled);
}
-void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled)
+void TestRunner::setAllowFileAccessFromFileURLs(bool enabled)
{
m_drt->webPage()->settings()->setAttribute(QWebSettings::LocalContentCanAccessFileUrls, enabled);
}
-void LayoutTestController::setAppCacheMaximumSize(unsigned long long quota)
+void TestRunner::setAppCacheMaximumSize(unsigned long long quota)
{
m_drt->webPage()->settings()->setOfflineWebApplicationCacheQuota(quota);
}
-void LayoutTestController::setAutofilled(const QWebElement& element, bool isAutofilled)
+void TestRunner::setAutofilled(const QWebElement& element, bool isAutofilled)
{
return DumpRenderTreeSupportQt::setAutofilled(element, isAutofilled);
}
-void LayoutTestController::setValueForUser(const QWebElement& element, const QString& value)
+void TestRunner::setValueForUser(const QWebElement& element, const QString& value)
{
DumpRenderTreeSupportQt::setValueForUser(element, value);
}
-void LayoutTestController::setFixedContentsSize(int width, int height)
+void TestRunner::setFixedContentsSize(int width, int height)
{
m_topLoadingFrame->page()->setPreferredContentsSize(QSize(width, height));
}
-void LayoutTestController::setPrivateBrowsingEnabled(bool enable)
+void TestRunner::setPrivateBrowsingEnabled(bool enable)
{
m_drt->webPage()->settings()->setAttribute(QWebSettings::PrivateBrowsingEnabled, enable);
}
-void LayoutTestController::setSpatialNavigationEnabled(bool enable)
+void TestRunner::setSpatialNavigationEnabled(bool enable)
{
m_drt->webPage()->settings()->setAttribute(QWebSettings::SpatialNavigationEnabled, enable);
}
-void LayoutTestController::setPopupBlockingEnabled(bool enable)
+void TestRunner::setPopupBlockingEnabled(bool enable)
{
m_drt->webPage()->settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, !enable);
}
-void LayoutTestController::setPluginsEnabled(bool flag)
+void TestRunner::setPluginsEnabled(bool flag)
{
// FIXME: Implement
}
-void LayoutTestController::setPOSIXLocale(const QString& locale)
+void TestRunner::setPOSIXLocale(const QString& locale)
{
QLocale qlocale(locale);
QLocale::setDefault(qlocale);
}
-void LayoutTestController::setWindowIsKey(bool isKey)
+void TestRunner::setWindowIsKey(bool isKey)
{
m_drt->switchFocus(isKey);
}
-void LayoutTestController::setMainFrameIsFirstResponder(bool isFirst)
+void TestRunner::setMainFrameIsFirstResponder(bool isFirst)
{
//FIXME: only need this for the moment: https://bugs.webkit.org/show_bug.cgi?id=32990
}
-void LayoutTestController::setJavaScriptCanAccessClipboard(bool enable)
+void TestRunner::setJavaScriptCanAccessClipboard(bool enable)
{
m_drt->webPage()->settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, enable);
}
-void LayoutTestController::setXSSAuditorEnabled(bool enable)
+void TestRunner::setXSSAuditorEnabled(bool enable)
{
// Set XSSAuditingEnabled globally so that windows created by the test inherit it too.
// resetSettings() will call this to reset the page and global setting to false again.
@@ -530,7 +530,7 @@ void LayoutTestController::setXSSAuditorEnabled(bool enable)
m_drt->webPage()->settings()->setAttribute(QWebSettings::XSSAuditingEnabled, enable);
}
-bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const QString& animationName,
+bool TestRunner::pauseAnimationAtTimeOnElementWithId(const QString& animationName,
double time,
const QString& elementId)
{
@@ -539,7 +539,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const QString& an
return DumpRenderTreeSupportQt::pauseAnimation(frame, animationName, time, elementId);
}
-bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const QString& propertyName,
+bool TestRunner::pauseTransitionAtTimeOnElementWithId(const QString& propertyName,
double time,
const QString& elementId)
{
@@ -548,59 +548,59 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const QString& p
return DumpRenderTreeSupportQt::pauseTransitionOfProperty(frame, propertyName, time, elementId);
}
-unsigned LayoutTestController::numberOfActiveAnimations() const
+unsigned TestRunner::numberOfActiveAnimations() const
{
QWebFrame* frame = m_drt->webPage()->mainFrame();
Q_ASSERT(frame);
return DumpRenderTreeSupportQt::numberOfActiveAnimations(frame);
}
-void LayoutTestController::disableImageLoading()
+void TestRunner::disableImageLoading()
{
m_drt->webPage()->settings()->setAttribute(QWebSettings::AutoLoadImages, false);
}
-void LayoutTestController::dispatchPendingLoadRequests()
+void TestRunner::dispatchPendingLoadRequests()
{
// FIXME: Implement for testing fix for 6727495
}
-void LayoutTestController::clearAllApplicationCaches()
+void TestRunner::clearAllApplicationCaches()
{
DumpRenderTreeSupportQt::clearAllApplicationCaches();
}
-void LayoutTestController::clearApplicationCacheForOrigin(const QString& url)
+void TestRunner::clearApplicationCacheForOrigin(const QString& url)
{
// FIXME: Implement to support deleting all application caches for an origin.
}
-long long LayoutTestController::localStorageDiskUsageForOrigin(const QString& originIdentifier)
+long long TestRunner::localStorageDiskUsageForOrigin(const QString& originIdentifier)
{
// FIXME: Implement to support getting disk usage in bytes for an origin.
return 0;
}
-void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota)
+void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota)
{
if (!m_topLoadingFrame)
return;
m_topLoadingFrame->securityOrigin().setApplicationCacheQuota(quota);
}
-long long LayoutTestController::applicationCacheDiskUsageForOrigin(const QString& origin)
+long long TestRunner::applicationCacheDiskUsageForOrigin(const QString& origin)
{
// FIXME: Implement to support getting disk usage by all application caches for an origin.
return 0;
}
-QStringList LayoutTestController::originsWithApplicationCache()
+QStringList TestRunner::originsWithApplicationCache()
{
// FIXME: Implement to get origins that have application caches.
return QStringList();
}
-void LayoutTestController::setCacheModel(int model)
+void TestRunner::setCacheModel(int model)
{
// qwebsetting doesn't have matched setting yet :
// WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER
@@ -610,41 +610,41 @@ void LayoutTestController::setCacheModel(int model)
// FIXME: Implement.
}
-void LayoutTestController::setDatabaseQuota(int size)
+void TestRunner::setDatabaseQuota(int size)
{
if (!m_topLoadingFrame)
return;
m_topLoadingFrame->securityOrigin().setDatabaseQuota(size);
}
-void LayoutTestController::clearAllDatabases()
+void TestRunner::clearAllDatabases()
{
QWebDatabase::removeAllDatabases();
}
-void LayoutTestController::addOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
+void TestRunner::addOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
{
DumpRenderTreeSupportQt::whiteListAccessFromOrigin(sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains);
}
-void LayoutTestController::removeOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
+void TestRunner::removeOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
{
DumpRenderTreeSupportQt::removeWhiteListAccessFromOrigin(sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains);
}
-void LayoutTestController::setCustomPolicyDelegate(bool enabled, bool permissive)
+void TestRunner::setCustomPolicyDelegate(bool enabled, bool permissive)
{
DumpRenderTreeSupportQt::setCustomPolicyDelegate(enabled, permissive);
}
-void LayoutTestController::waitForPolicyDelegate()
+void TestRunner::waitForPolicyDelegate()
{
setCustomPolicyDelegate(true);
m_waitForPolicy = true;
waitUntilDone();
}
-void LayoutTestController::overridePreference(const QString& name, const QVariant& value)
+void TestRunner::overridePreference(const QString& name, const QVariant& value)
{
QWebSettings* settings = m_topLoadingFrame->page()->settings();
@@ -673,11 +673,11 @@ void LayoutTestController::overridePreference(const QString& name, const QVarian
else if (name == "WebKitAcceleratedCompositingEnabled")
settings->setAttribute(QWebSettings::AcceleratedCompositingEnabled, value.toBool());
else
- printf("ERROR: LayoutTestController::overridePreference() does not support the '%s' preference\n",
+ printf("ERROR: TestRunner::overridePreference() does not support the '%s' preference\n",
name.toLatin1().data());
}
-void LayoutTestController::setUserStyleSheetLocation(const QString& url)
+void TestRunner::setUserStyleSheetLocation(const QString& url)
{
QByteArray urlData = pathToLocalResource(url).toLatin1();
m_userStyleSheetLocation = QUrl::fromEncoded(urlData, QUrl::StrictMode);
@@ -686,17 +686,17 @@ void LayoutTestController::setUserStyleSheetLocation(const QString& url)
setUserStyleSheetEnabled(true);
}
-void LayoutTestController::setCaretBrowsingEnabled(bool value)
+void TestRunner::setCaretBrowsingEnabled(bool value)
{
DumpRenderTreeSupportQt::setCaretBrowsingEnabled(m_drt->webPage(), value);
}
-void LayoutTestController::setAuthorAndUserStylesEnabled(bool value)
+void TestRunner::setAuthorAndUserStylesEnabled(bool value)
{
DumpRenderTreeSupportQt::setAuthorAndUserStylesEnabled(m_drt->webPage(), value);
}
-void LayoutTestController::setUserStyleSheetEnabled(bool enabled)
+void TestRunner::setUserStyleSheetEnabled(bool enabled)
{
m_userStyleSheetEnabled = enabled;
@@ -706,27 +706,27 @@ void LayoutTestController::setUserStyleSheetEnabled(bool enabled)
m_drt->webPage()->settings()->setUserStyleSheetUrl(QUrl());
}
-void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme)
+void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme)
{
DumpRenderTreeSupportQt::setDomainRelaxationForbiddenForURLScheme(forbidden, scheme);
}
-int LayoutTestController::workerThreadCount()
+int TestRunner::workerThreadCount()
{
return DumpRenderTreeSupportQt::workerThreadCount();
}
-int LayoutTestController::numberOfPages(float width, float height)
+int TestRunner::numberOfPages(float width, float height)
{
return DumpRenderTreeSupportQt::numberOfPages(m_drt->webPage()->mainFrame(), width, height);
}
-bool LayoutTestController::callShouldCloseOnWebView()
+bool TestRunner::callShouldCloseOnWebView()
{
return DumpRenderTreeSupportQt::shouldClose(m_drt->webPage()->mainFrame());
}
-void LayoutTestController::setScrollbarPolicy(const QString& orientation, const QString& policy)
+void TestRunner::setScrollbarPolicy(const QString& orientation, const QString& policy)
{
Qt::Orientation o;
Qt::ScrollBarPolicy p;
@@ -750,52 +750,52 @@ void LayoutTestController::setScrollbarPolicy(const QString& orientation, const
m_drt->webPage()->mainFrame()->setScrollBarPolicy(o, p);
}
-void LayoutTestController::setSmartInsertDeleteEnabled(bool enable)
+void TestRunner::setSmartInsertDeleteEnabled(bool enable)
{
DumpRenderTreeSupportQt::setSmartInsertDeleteEnabled(m_drt->webPage(), enable);
}
-void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool enable)
+void TestRunner::setSelectTrailingWhitespaceEnabled(bool enable)
{
DumpRenderTreeSupportQt::setSelectTrailingWhitespaceEnabled(m_drt->webPage(), enable);
}
-void LayoutTestController::execCommand(const QString& name, const QString& value)
+void TestRunner::execCommand(const QString& name, const QString& value)
{
DumpRenderTreeSupportQt::executeCoreCommandByName(m_drt->webPage(), name, value);
}
-bool LayoutTestController::isCommandEnabled(const QString& name) const
+bool TestRunner::isCommandEnabled(const QString& name) const
{
return DumpRenderTreeSupportQt::isCommandEnabled(m_drt->webPage(), name);
}
-bool LayoutTestController::findString(const QString& string, const QStringList& optionArray)
+bool TestRunner::findString(const QString& string, const QStringList& optionArray)
{
return DumpRenderTreeSupportQt::findString(m_drt->webPage(), string, optionArray);
}
-QString LayoutTestController::markerTextForListItem(const QWebElement& listItem)
+QString TestRunner::markerTextForListItem(const QWebElement& listItem)
{
return DumpRenderTreeSupportQt::markerTextForListItem(listItem);
}
-QVariantMap LayoutTestController::computedStyleIncludingVisitedInfo(const QWebElement& element) const
+QVariantMap TestRunner::computedStyleIncludingVisitedInfo(const QWebElement& element) const
{
return DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo(element);
}
-bool LayoutTestController::elementDoesAutoCompleteForElementWithId(const QString& elementId)
+bool TestRunner::elementDoesAutoCompleteForElementWithId(const QString& elementId)
{
return DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId(m_drt->webPage()->mainFrame(), elementId);
}
-void LayoutTestController::authenticateSession(const QString&, const QString&, const QString&)
+void TestRunner::authenticateSession(const QString&, const QString&, const QString&)
{
// FIXME: If there is a concept per-session (per-process) credential storage, the credentials should be added to it for later use.
}
-void LayoutTestController::setIconDatabaseEnabled(bool enable)
+void TestRunner::setIconDatabaseEnabled(bool enable)
{
if (enable && !m_drt->persistentStoragePath().isEmpty())
QWebSettings::setIconDatabasePath(m_drt->persistentStoragePath());
@@ -803,14 +803,14 @@ void LayoutTestController::setIconDatabaseEnabled(bool enable)
QWebSettings::setIconDatabasePath(QString());
}
-void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
{
QList<WebCore::WebPage*> pages = m_drt->getAllPages();
foreach (WebCore::WebPage* page, pages)
DumpRenderTreeSupportQt::setMockDeviceOrientation(page, canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma);
}
-void LayoutTestController::setGeolocationPermission(bool allow)
+void TestRunner::setGeolocationPermission(bool allow)
{
setGeolocationPermissionCommon(allow);
QList<WebCore::WebPage*> pages = m_drt->getAllPages();
@@ -818,7 +818,7 @@ void LayoutTestController::setGeolocationPermission(bool allow)
DumpRenderTreeSupportQt::setMockGeolocationPermission(page, allow);
}
-int LayoutTestController::numberOfPendingGeolocationPermissionRequests()
+int TestRunner::numberOfPendingGeolocationPermissionRequests()
{
int pendingPermissionCount = 0;
QList<WebCore::WebPage*> pages = m_drt->getAllPages();
@@ -828,133 +828,133 @@ int LayoutTestController::numberOfPendingGeolocationPermissionRequests()
return pendingPermissionCount;
}
-void LayoutTestController::setGeolocationPermissionCommon(bool allow)
+void TestRunner::setGeolocationPermissionCommon(bool allow)
{
m_isGeolocationPermissionSet = true;
m_geolocationPermission = allow;
}
-void LayoutTestController::setMockGeolocationError(int code, const QString& message)
+void TestRunner::setMockGeolocationError(int code, const QString& message)
{
QList<WebCore::WebPage*> pages = m_drt->getAllPages();
foreach (WebCore::WebPage* page, pages)
DumpRenderTreeSupportQt::setMockGeolocationError(page, code, message);
}
-void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
+void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
{
QList<WebCore::WebPage*> pages = m_drt->getAllPages();
foreach (WebCore::WebPage* page, pages)
DumpRenderTreeSupportQt::setMockGeolocationPosition(page, latitude, longitude, accuracy);
}
-void LayoutTestController::addMockSpeechInputResult(const QString& result, double confidence, const QString& language)
+void TestRunner::addMockSpeechInputResult(const QString& result, double confidence, const QString& language)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
}
-void LayoutTestController::setMockSpeechInputDumpRect(bool flag)
+void TestRunner::setMockSpeechInputDumpRect(bool flag)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
}
-void LayoutTestController::startSpeechInput(const QString& inputElement)
+void TestRunner::startSpeechInput(const QString& inputElement)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
}
-void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(int worldID, const QString& script)
+void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(int worldID, const QString& script)
{
// FIXME: Implement.
}
-void LayoutTestController::evaluateScriptInIsolatedWorld(int worldID, const QString& script)
+void TestRunner::evaluateScriptInIsolatedWorld(int worldID, const QString& script)
{
DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(m_drt->webPage()->mainFrame(), worldID, script);
}
-QString LayoutTestController::pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft)
+QString TestRunner::pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft)
{
return DumpRenderTreeSupportQt::pageSizeAndMarginsInPixels(m_drt->webPage()->mainFrame(), pageIndex,
width, height, marginTop, marginRight, marginBottom, marginLeft);
}
-QString LayoutTestController::pageProperty(const QString& propertyName, int pageNumber)
+QString TestRunner::pageProperty(const QString& propertyName, int pageNumber)
{
return DumpRenderTreeSupportQt::pageProperty(m_drt->webPage()->mainFrame(), propertyName, pageNumber);
}
-void LayoutTestController::addUserStyleSheet(const QString& sourceCode)
+void TestRunner::addUserStyleSheet(const QString& sourceCode)
{
DumpRenderTreeSupportQt::addUserStyleSheet(m_drt->webPage(), sourceCode);
}
-void LayoutTestController::removeAllVisitedLinks()
+void TestRunner::removeAllVisitedLinks()
{
QWebHistory* history = m_drt->webPage()->history();
history->clear();
DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks(true);
}
-void LayoutTestController::addURLToRedirect(const QString& origin, const QString& destination)
+void TestRunner::addURLToRedirect(const QString& origin, const QString& destination)
{
DumpRenderTreeSupportQt::addURLToRedirect(origin, destination);
}
-void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval)
+void TestRunner::setMinimumTimerInterval(double minimumTimerInterval)
{
DumpRenderTreeSupportQt::setMinimumTimerInterval(m_drt->webPage(), minimumTimerInterval);
}
-void LayoutTestController::originsWithLocalStorage()
+void TestRunner::originsWithLocalStorage()
{
// FIXME: Implement.
}
-void LayoutTestController::deleteAllLocalStorage()
+void TestRunner::deleteAllLocalStorage()
{
// FIXME: Implement.
}
-void LayoutTestController::deleteLocalStorageForOrigin(const QString& originIdentifier)
+void TestRunner::deleteLocalStorageForOrigin(const QString& originIdentifier)
{
// FIXME: Implement.
}
-void LayoutTestController::observeStorageTrackerNotifications(unsigned number)
+void TestRunner::observeStorageTrackerNotifications(unsigned number)
{
// FIXME: Implement.
}
-void LayoutTestController::syncLocalStorage()
+void TestRunner::syncLocalStorage()
{
// FIXME: Implement.
}
-void LayoutTestController::resetPageVisibility()
+void TestRunner::resetPageVisibility()
{
// FIXME: Implement this.
}
-void LayoutTestController::setPageVisibility(const char*)
+void TestRunner::setPageVisibility(const char*)
{
// FIXME: Implement this.
}
-void LayoutTestController::setAutomaticLinkDetectionEnabled(bool)
+void TestRunner::setAutomaticLinkDetectionEnabled(bool)
{
// FIXME: Implement this.
}
-QString LayoutTestController::layerTreeAsText()
+QString TestRunner::layerTreeAsText()
{
return DumpRenderTreeSupportQt::layerTreeAsText(m_drt->webPage()->mainFrame());
}
-void LayoutTestController::setTextDirection(const QString& directionName)
+void TestRunner::setTextDirection(const QString& directionName)
{
if (directionName == "auto")
m_drt->webPage()->triggerAction(QWebPage::SetTextDirectionDefault);
@@ -964,7 +964,7 @@ void LayoutTestController::setTextDirection(const QString& directionName)
m_drt->webPage()->triggerAction(QWebPage::SetTextDirectionLeftToRight);
}
-void LayoutTestController::setAlwaysAcceptCookies(bool accept)
+void TestRunner::setAlwaysAcceptCookies(bool accept)
{
QWebSettings* globalSettings = QWebSettings::globalSettings();
if (accept)
@@ -975,7 +975,7 @@ void LayoutTestController::setAlwaysAcceptCookies(bool accept)
}
}
-void LayoutTestController::setAlwaysBlockCookies(bool block)
+void TestRunner::setAlwaysBlockCookies(bool block)
{
QWebSettings* globalSettings = QWebSettings::globalSettings();
if (block)
@@ -984,5 +984,5 @@ void LayoutTestController::setAlwaysBlockCookies(bool block)
globalSettings->setThirdPartyCookiePolicy(QWebSettings::AlwaysAllowThirdPartyCookies);
}
-const unsigned LayoutTestController::maxViewWidth = 800;
-const unsigned LayoutTestController::maxViewHeight = 600;
+const unsigned TestRunner::maxViewWidth = 800;
+const unsigned TestRunner::maxViewHeight = 600;
diff --git a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h b/Tools/DumpRenderTree/qt/TestRunnerQt.h
index 6626f8471..52d512ca0 100644
--- a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h
+++ b/Tools/DumpRenderTree/qt/TestRunnerQt.h
@@ -27,17 +27,17 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef LayoutTestControllerQt_h
-#define LayoutTestControllerQt_h
+#ifndef TestRunnerQt_h
+#define TestRunnerQt_h
#include <QBasicTimer>
#include <QObject>
#include <QSize>
#include <QString>
-#include <QtDebug>
#include <QTimer>
#include <QTimerEvent>
#include <QVariant>
+#include <QtDebug>
#include <qwebdatabase.h>
#include <qwebelement.h>
@@ -49,15 +49,16 @@
class QWebFrame;
class DumpRenderTreeSupportQt;
namespace WebCore {
- class DumpRenderTree;
+class DumpRenderTree;
}
-class LayoutTestController : public QObject {
+
+class TestRunner : public QObject {
Q_OBJECT
Q_PROPERTY(int webHistoryItemCount READ webHistoryItemCount)
Q_PROPERTY(int workerThreadCount READ workerThreadCount)
Q_PROPERTY(bool globalFlag READ globalFlag WRITE setGlobalFlag)
public:
- LayoutTestController(WebCore::DumpRenderTree* drt);
+ TestRunner(WebCore::DumpRenderTree*);
bool shouldDisallowIncreaseForApplicationCacheQuota() const { return m_disallowIncreaseForApplicationCacheQuota; }
bool shouldDumpAsText() const { return m_textDump; }
@@ -86,14 +87,14 @@ public:
protected:
void timerEvent(QTimerEvent*);
-signals:
+Q_SIGNALS:
void done();
void showPage();
void hidePage();
void geolocationPermissionSet();
-public slots:
+public Q_SLOTS:
void maybeDump(bool ok);
void disallowIncreaseForApplicationCacheQuota() { m_disallowIncreaseForApplicationCacheQuota = true; }
void dumpAsText() { m_textDump = true; }
@@ -131,7 +132,7 @@ public slots:
void queueLoadingScript(const QString& script);
void queueNonLoadingScript(const QString& script);
void provisionalLoad();
- void setCloseRemainingWindowsWhenComplete(bool = false) {}
+ void setCloseRemainingWindowsWhenComplete(bool = false) { }
int windowCount();
void grantDesktopNotificationPermission(const QString& origin);
void ignoreDesktopNotificationPermissionRequests();
@@ -144,41 +145,41 @@ public slots:
void dumpTitleChanges() { m_dumpTitleChanges = true; }
QString encodeHostName(const QString& host);
QString decodeHostName(const QString& host);
- void dumpSelectionRect() const {}
+ void dumpSelectionRect() const { }
void setDeveloperExtrasEnabled(bool);
void setAsynchronousSpellCheckingEnabled(bool);
void showWebInspector();
void closeWebInspector();
void evaluateInWebInspector(long callId, const QString& script);
void removeAllVisitedLinks();
- void setMediaType(const QString& type);
- void setFrameFlatteningEnabled(bool enable);
- void setMockScrollbarsEnabled(bool enable);
+ void setMediaType(const QString&);
+ void setFrameFlatteningEnabled(bool);
+ void setMockScrollbarsEnabled(bool);
void setAllowUniversalAccessFromFileURLs(bool enable);
void setAllowFileAccessFromFileURLs(bool enable);
void setAppCacheMaximumSize(unsigned long long quota);
void setAutofilled(const QWebElement&, bool enable);
void setValueForUser(const QWebElement&, const QString& value);
void setFixedContentsSize(int width, int height);
- void setPrivateBrowsingEnabled(bool enable);
- void setSpatialNavigationEnabled(bool enabled);
+ void setPrivateBrowsingEnabled(bool);
+ void setSpatialNavigationEnabled(bool);
void setPluginsEnabled(bool flag);
- void setPopupBlockingEnabled(bool enable);
+ void setPopupBlockingEnabled(bool);
void setPOSIXLocale(const QString& locale);
void resetLoadFinished() { m_loadFinished = false; }
- void setWindowIsKey(bool isKey);
- void setMainFrameIsFirstResponder(bool isFirst);
+ void setWindowIsKey(bool);
+ void setMainFrameIsFirstResponder(bool);
void setDeferMainResourceDataLoad(bool);
void setJavaScriptCanAccessClipboard(bool enable);
- void setXSSAuditorEnabled(bool enable);
- void setCaretBrowsingEnabled(bool enable);
+ void setXSSAuditorEnabled(bool);
+ void setCaretBrowsingEnabled(bool);
void setAuthorAndUserStylesEnabled(bool);
void setViewModeMediaFeature(const QString& mode);
- void setSmartInsertDeleteEnabled(bool enable);
- void setSelectTrailingWhitespaceEnabled(bool enable);
+ void setSmartInsertDeleteEnabled(bool);
+ void setSelectTrailingWhitespaceEnabled(bool);
void execCommand(const QString& name, const QString& value = QString());
bool isCommandEnabled(const QString& name) const;
- bool findString(const QString& string, const QStringList& optionArray);
+ bool findString(const QString&, const QStringList& optionArray);
bool pauseAnimationAtTimeOnElementWithId(const QString& animationName, double time, const QString& elementId);
bool pauseTransitionAtTimeOnElementWithId(const QString& propertyName, double time, const QString& elementId);
@@ -194,32 +195,32 @@ public slots:
void clearAllApplicationCaches();
void clearApplicationCacheForOrigin(const QString& url);
- void setApplicationCacheOriginQuota(unsigned long long quota);
+ void setApplicationCacheOriginQuota(unsigned long long);
QStringList originsWithApplicationCache();
long long applicationCacheDiskUsageForOrigin(const QString&);
void setCacheModel(int);
void setDatabaseQuota(int size);
void clearAllDatabases();
- void setIconDatabaseEnabled(bool enable);
+ void setIconDatabaseEnabled(bool);
void setCustomPolicyDelegate(bool enabled, bool permissive = false);
void waitForPolicyDelegate();
void overridePreference(const QString& name, const QVariant& value);
void setUserStyleSheetLocation(const QString& url);
- void setUserStyleSheetEnabled(bool enabled);
+ void setUserStyleSheetEnabled(bool);
void setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme);
int workerThreadCount();
int numberOfPages(float width = maxViewWidth, float height = maxViewHeight);
bool callShouldCloseOnWebView();
// For now, this is a no-op. This may change depending on outcome of
// https://bugs.webkit.org/show_bug.cgi?id=33333
- void setCallCloseOnWebViews() {}
+ void setCallCloseOnWebViews() { }
// This is a no-op - it allows us to pass
// plugins/get-url-that-the-resource-load-delegate-will-disallow.html
// which is a Mac-specific test.
- void addDisallowedURL(const QString&) {}
+ void addDisallowedURL(const QString&) { }
void setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma);
@@ -239,8 +240,8 @@ public slots:
void setAutomaticLinkDetectionEnabled(bool);
- // Empty stub method to keep parity with object model exposed by global LayoutTestController.
- void abortModal() {}
+ // Empty stub method to keep parity with object model exposed by global TestRunner.
+ void abortModal() { }
void addURLToRedirect(const QString& origin, const QString& destination);
@@ -251,7 +252,7 @@ public slots:
void setScrollbarPolicy(const QString& orientation, const QString& policy);
QString markerTextForListItem(const QWebElement& listItem);
- QVariantMap computedStyleIncludingVisitedInfo(const QWebElement& element) const;
+ QVariantMap computedStyleIncludingVisitedInfo(const QWebElement&) const;
// Simulate a request an embedding application could make, populating per-session credential storage.
void authenticateSession(const QString& url, const QString& username, const QString& password);
@@ -277,7 +278,7 @@ public slots:
void setAlwaysAcceptCookies(bool);
void setAlwaysBlockCookies(bool);
-private slots:
+private Q_SLOTS:
void processWork();
private:
@@ -317,4 +318,4 @@ private:
int m_timeout;
};
-#endif // LayoutTestControllerQt_h
+#endif // TestRunnerQt_h
diff --git a/Tools/DumpRenderTree/qt/TextInputControllerQt.h b/Tools/DumpRenderTree/qt/TextInputControllerQt.h
index 572abfd7c..294027340 100644
--- a/Tools/DumpRenderTree/qt/TextInputControllerQt.h
+++ b/Tools/DumpRenderTree/qt/TextInputControllerQt.h
@@ -40,7 +40,7 @@ class TextInputController : public QObject {
public:
TextInputController(QWebPage* parent);
-public slots:
+public Q_SLOTS:
void doCommand(const QString& command);
void setMarkedText(const QString& string, int start, int end);
// bool hasMarkedText();
diff --git a/Tools/DumpRenderTree/qt/main.cpp b/Tools/DumpRenderTree/qt/main.cpp
index 410ac7c35..0d37ee819 100644
--- a/Tools/DumpRenderTree/qt/main.cpp
+++ b/Tools/DumpRenderTree/qt/main.cpp
@@ -119,6 +119,7 @@ int main(int argc, char* argv[])
QApplication::setGraphicsSystem("raster");
QApplication::setStyle(new QWindowsStyle);
+ QApplication::setDesktopSettingsAware(false);
QApplication app(argc, argv);
app.setQuitOnLastWindowClosed(false);
diff --git a/Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp b/Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp
index 830afd3c4..a7bfc6d44 100644
--- a/Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp
+++ b/Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp
@@ -32,7 +32,7 @@
#include "DRTDesktopNotificationPresenter.h"
#include "DumpRenderTree.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include <JavaScriptCore/JSStringRef.h>
#include <JavaScriptCore/JSStringRefBSTR.h>
#include <WebCore/NotificationClient.h>
@@ -125,7 +125,7 @@ HRESULT STDMETHODCALLTYPE DRTDesktopNotificationPresenter::checkNotificationPerm
{
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
JSStringRef jsOrigin = JSStringCreateWithBSTR(origin);
- bool allowed = ::gLayoutTestController->checkDesktopNotificationPermission(jsOrigin);
+ bool allowed = ::gTestRunner->checkDesktopNotificationPermission(jsOrigin);
if (allowed)
*result = WebCore::NotificationClient::PermissionAllowed;
diff --git a/Tools/DumpRenderTree/win/DumpRenderTree.cpp b/Tools/DumpRenderTree/win/DumpRenderTree.cpp
index 312430d56..ad1726dc9 100644
--- a/Tools/DumpRenderTree/win/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/win/DumpRenderTree.cpp
@@ -32,10 +32,10 @@
#include "EditingDelegate.h"
#include "FrameLoadDelegate.h"
#include "HistoryDelegate.h"
-#include "LayoutTestController.h"
#include "PixelDumpSupport.h"
#include "PolicyDelegate.h"
#include "ResourceLoadDelegate.h"
+#include "TestRunner.h"
#include "UIDelegate.h"
#include "WebCoreTestSupport.h"
#include "WorkQueueItem.h"
@@ -105,7 +105,7 @@ COMPtr<HistoryDelegate> sharedHistoryDelegate;
IWebFrame* frame;
HWND webViewWindow;
-RefPtr<LayoutTestController> gLayoutTestController;
+RefPtr<TestRunner> gTestRunner;
UINT_PTR waitToDumpWatchdog = 0;
@@ -424,7 +424,7 @@ void dumpFrameScrollPosition(IWebFrame* frame)
printf("scrolled to %.f,%.f\n", (double)scrollPosition.cx, (double)scrollPosition.cy);
}
- if (::gLayoutTestController->dumpChildFrameScrollPositions()) {
+ if (::gTestRunner->dumpChildFrameScrollPositions()) {
COMPtr<IEnumVARIANT> enumKids;
if (FAILED(frame->childFrames(&enumKids)))
return;
@@ -481,7 +481,7 @@ static wstring dumpFramesAsText(IWebFrame* frame)
SysFreeString(innerText);
- if (::gLayoutTestController->dumpChildFramesAsText()) {
+ if (::gTestRunner->dumpChildFramesAsText()) {
COMPtr<IEnumVARIANT> enumKids;
if (FAILED(frame->childFrames(&enumKids)))
return L"";
@@ -713,8 +713,8 @@ void dump()
if (SUCCEEDED(dataSource->response(&response)) && response) {
BSTR mimeType;
if (SUCCEEDED(response->MIMEType(&mimeType)) && !_tcscmp(mimeType, TEXT("text/plain"))) {
- ::gLayoutTestController->setDumpAsText(true);
- ::gLayoutTestController->setGeneratePixelResults(false);
+ ::gTestRunner->setDumpAsText(true);
+ ::gTestRunner->setGeneratePixelResults(false);
}
SysFreeString(mimeType);
}
@@ -726,18 +726,18 @@ void dump()
::InvalidateRect(webViewWindow, 0, TRUE);
::SendMessage(webViewWindow, WM_PAINT, 0, 0);
- if (::gLayoutTestController->dumpAsText()) {
+ if (::gTestRunner->dumpAsText()) {
wstring result = dumpFramesAsText(frame);
resultString = SysAllocStringLen(result.data(), result.size());
} else {
COMPtr<IWebFramePrivate> framePrivate;
if (FAILED(frame->QueryInterface(&framePrivate)))
goto fail;
- framePrivate->renderTreeAsExternalRepresentation(gLayoutTestController->isPrinting(), &resultString);
+ framePrivate->renderTreeAsExternalRepresentation(gTestRunner->isPrinting(), &resultString);
}
if (!resultString)
- printf("ERROR: nil result from %s", ::gLayoutTestController->dumpAsText() ? "IDOMElement::innerText" : "IFrameViewPrivate::renderTreeAsExternalRepresentation");
+ printf("ERROR: nil result from %s", ::gTestRunner->dumpAsText() ? "IDOMElement::innerText" : "IFrameViewPrivate::renderTreeAsExternalRepresentation");
else {
unsigned stringLength = SysStringLen(resultString);
int bufferSize = ::WideCharToMultiByte(CP_UTF8, 0, resultString, stringLength, 0, 0, 0, 0);
@@ -745,10 +745,10 @@ void dump()
::WideCharToMultiByte(CP_UTF8, 0, resultString, stringLength, buffer, bufferSize + 1, 0, 0);
fwrite(buffer, 1, bufferSize, stdout);
free(buffer);
- if (!::gLayoutTestController->dumpAsText())
+ if (!::gTestRunner->dumpAsText())
dumpFrameScrollPosition(frame);
}
- if (::gLayoutTestController->dumpBackForwardList())
+ if (::gTestRunner->dumpBackForwardList())
dumpBackForwardListForAllWindows();
}
@@ -760,10 +760,10 @@ void dump()
}
if (dumpPixelsForCurrentTest
- && gLayoutTestController->generatePixelResults()
- && !gLayoutTestController->dumpDOMAsWebArchive()
- && !gLayoutTestController->dumpSourceAsWebArchive())
- dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash());
+ && gTestRunner->generatePixelResults()
+ && !gTestRunner->dumpDOMAsWebArchive()
+ && !gTestRunner->dumpSourceAsWebArchive())
+ dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash());
printf("#EOF\n"); // terminate the (possibly empty) pixels block
fflush(stdout);
@@ -893,7 +893,7 @@ static void resetWebViewToConsistentStateBeforeTesting()
if (SUCCEEDED(webView->preferences(&preferences)))
resetDefaultsToConsistentValues(preferences.get());
- if (gLayoutTestController) {
+ if (gTestRunner) {
JSGlobalContextRef context = frame->globalContext();
WebCoreTestSupport::resetInternalsObject(context);
}
@@ -934,15 +934,15 @@ static void resetWebViewToConsistentStateBeforeTesting()
static void sizeWebViewForCurrentTest()
{
- bool isSVGW3CTest = (gLayoutTestController->testPathOrURL().find("svg\\W3C-SVG-1.1") != string::npos);
+ bool isSVGW3CTest = (gTestRunner->testPathOrURL().find("svg\\W3C-SVG-1.1") != string::npos);
unsigned width;
unsigned height;
if (isSVGW3CTest) {
width = 480;
height = 360;
} else {
- width = LayoutTestController::maxViewWidth;
- height = LayoutTestController::maxViewHeight;
+ width = TestRunner::maxViewWidth;
+ height = TestRunner::maxViewHeight;
}
::SetWindowPos(webViewWindow, 0, 0, 0, width, height, SWP_NOMOVE);
@@ -977,22 +977,22 @@ static void runTest(const string& inputLine)
CFRelease(url);
- ::gLayoutTestController = LayoutTestController::create(pathOrURL, command.expectedPixelHash);
+ ::gTestRunner = TestRunner::create(pathOrURL, command.expectedPixelHash);
done = false;
topLoadingFrame = 0;
sizeWebViewForCurrentTest();
- gLayoutTestController->setIconDatabaseEnabled(false);
+ gTestRunner->setIconDatabaseEnabled(false);
if (shouldLogFrameLoadDelegates(pathOrURL.c_str()))
- gLayoutTestController->setDumpFrameLoadCallbacks(true);
+ gTestRunner->setDumpFrameLoadCallbacks(true);
COMPtr<IWebView> webView;
if (SUCCEEDED(frame->webView(&webView))) {
COMPtr<IWebViewPrivate> viewPrivate;
if (SUCCEEDED(webView->QueryInterface(&viewPrivate))) {
if (shouldLogHistoryDelegates(pathOrURL.c_str())) {
- gLayoutTestController->setDumpHistoryDelegateCallbacks(true);
+ gTestRunner->setDumpHistoryDelegateCallbacks(true);
viewPrivate->setHistoryDelegate(sharedHistoryDelegate.get());
} else
viewPrivate->setHistoryDelegate(0);
@@ -1005,13 +1005,13 @@ static void runTest(const string& inputLine)
resetWebViewToConsistentStateBeforeTesting();
if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
- gLayoutTestController->setDeveloperExtrasEnabled(true);
+ gTestRunner->setDeveloperExtrasEnabled(true);
if (shouldOpenWebInspector(pathOrURL.c_str()))
- gLayoutTestController->showWebInspector();
+ gTestRunner->showWebInspector();
}
if (shouldDumpAsText(pathOrURL.c_str())) {
- gLayoutTestController->setDumpAsText(true);
- gLayoutTestController->setGeneratePixelResults(false);
+ gTestRunner->setDumpAsText(true);
+ gTestRunner->setGeneratePixelResults(false);
}
prevTestBFItem = 0;
@@ -1049,15 +1049,15 @@ static void runTest(const string& inputLine)
}
if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
- gLayoutTestController->closeWebInspector();
- gLayoutTestController->setDeveloperExtrasEnabled(false);
+ gTestRunner->closeWebInspector();
+ gTestRunner->setDeveloperExtrasEnabled(false);
}
resetWebViewToConsistentStateBeforeTesting();
frame->stopLoading();
- if (::gLayoutTestController->closeRemainingWindowsWhenComplete()) {
+ if (::gTestRunner->closeRemainingWindowsWhenComplete()) {
Vector<HWND> windows = openWindows();
unsigned size = windows.size();
for (unsigned i = 0; i < size; i++) {
@@ -1073,7 +1073,7 @@ static void runTest(const string& inputLine)
exit:
SysFreeString(urlBStr);
- ::gLayoutTestController.clear();
+ ::gTestRunner.clear();
return;
}
@@ -1197,8 +1197,8 @@ WindowToWebViewMap& windowToWebViewMap()
IWebView* createWebViewAndOffscreenWindow(HWND* webViewWindow)
{
- unsigned maxViewWidth = LayoutTestController::maxViewWidth;
- unsigned maxViewHeight = LayoutTestController::maxViewHeight;
+ unsigned maxViewWidth = TestRunner::maxViewWidth;
+ unsigned maxViewHeight = TestRunner::maxViewHeight;
HWND hostWindow = CreateWindowEx(WS_EX_TOOLWINDOW, kDumpRenderTreeClassName, TEXT("DumpRenderTree"), WS_POPUP,
-maxViewWidth, -maxViewHeight, maxViewWidth, maxViewHeight, 0, 0, GetModuleHandle(0), 0);
diff --git a/Tools/DumpRenderTree/win/DumpRenderTree.vcproj b/Tools/DumpRenderTree/win/DumpRenderTree.vcproj
index 7e242a1cd..cde6d5b0b 100644
--- a/Tools/DumpRenderTree/win/DumpRenderTree.vcproj
+++ b/Tools/DumpRenderTree/win/DumpRenderTree.vcproj
@@ -438,15 +438,15 @@
>
</File>
<File
- RelativePath="..\LayoutTestController.cpp"
+ RelativePath="..\TestRunner.cpp"
>
</File>
<File
- RelativePath="..\LayoutTestController.h"
+ RelativePath="..\TestRunner.h"
>
</File>
<File
- RelativePath=".\LayoutTestControllerWin.cpp"
+ RelativePath=".\TestRunnerWin.cpp"
>
</File>
<File
diff --git a/Tools/DumpRenderTree/win/DumpRenderTreeLauncher.vcproj b/Tools/DumpRenderTree/win/DumpRenderTreeLauncher.vcproj
index 72050b14b..de8a1db62 100644
--- a/Tools/DumpRenderTree/win/DumpRenderTreeLauncher.vcproj
+++ b/Tools/DumpRenderTree/win/DumpRenderTreeLauncher.vcproj
@@ -50,6 +50,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
/>
<Tool
Name="VCALinkTool"
@@ -111,6 +112,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
/>
<Tool
Name="VCALinkTool"
@@ -172,6 +174,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
/>
<Tool
Name="VCALinkTool"
@@ -233,6 +236,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
/>
<Tool
Name="VCALinkTool"
@@ -295,6 +299,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
/>
<Tool
Name="VCALinkTool"
@@ -356,6 +361,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
/>
<Tool
Name="VCALinkTool"
diff --git a/Tools/DumpRenderTree/win/EditingDelegate.cpp b/Tools/DumpRenderTree/win/EditingDelegate.cpp
index d08db1430..0975c54d4 100644
--- a/Tools/DumpRenderTree/win/EditingDelegate.cpp
+++ b/Tools/DumpRenderTree/win/EditingDelegate.cpp
@@ -30,7 +30,7 @@
#include "EditingDelegate.h"
#include "DumpRenderTree.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include <WebCore/COMPtr.h>
#include <wtf/Assertions.h>
#include <wtf/Platform.h>
@@ -128,7 +128,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldBeginEditingInDOMRange(
return E_POINTER;
}
- if (::gLayoutTestController->dumpEditingCallbacks() && !done)
+ if (::gTestRunner->dumpEditingCallbacks() && !done)
_tprintf(TEXT("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n"), dump(range));
*result = m_acceptsEditing;
@@ -145,7 +145,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldEndEditingInDOMRange(
return E_POINTER;
}
- if (::gLayoutTestController->dumpEditingCallbacks() && !done)
+ if (::gTestRunner->dumpEditingCallbacks() && !done)
_tprintf(TEXT("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n"), dump(range));
*result = m_acceptsEditing;
@@ -164,7 +164,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldInsertNode(
TEXT("WebViewInsertActionDropped"),
};
- if (::gLayoutTestController->dumpEditingCallbacks() && !done)
+ if (::gTestRunner->dumpEditingCallbacks() && !done)
_tprintf(TEXT("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n"), dumpPath(node), dump(range), insertactionstring[action]);
return S_OK;
@@ -188,7 +188,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldInsertText(
TEXT("WebViewInsertActionDropped"),
};
- if (::gLayoutTestController->dumpEditingCallbacks() && !done)
+ if (::gTestRunner->dumpEditingCallbacks() && !done)
_tprintf(TEXT("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n"), text ? text : TEXT(""), dump(range), insertactionstring[action]);
*result = m_acceptsEditing;
@@ -205,7 +205,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldDeleteDOMRange(
return E_POINTER;
}
- if (::gLayoutTestController->dumpEditingCallbacks() && !done)
+ if (::gTestRunner->dumpEditingCallbacks() && !done)
_tprintf(TEXT("EDITING DELEGATE: shouldDeleteDOMRange:%s\n"), dump(range));
*result = m_acceptsEditing;
@@ -234,7 +234,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldChangeSelectedDOMRange(
TEXT("TRUE")
};
- if (::gLayoutTestController->dumpEditingCallbacks() && !done)
+ if (::gTestRunner->dumpEditingCallbacks() && !done)
_tprintf(TEXT("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n"), dump(currentRange), dump(proposedRange), affinitystring[selectionAffinity], boolstring[stillSelecting]);
*result = m_acceptsEditing;
@@ -252,7 +252,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldApplyStyle(
return E_POINTER;
}
- if (::gLayoutTestController->dumpEditingCallbacks() && !done)
+ if (::gTestRunner->dumpEditingCallbacks() && !done)
_tprintf(TEXT("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n"), TEXT("'style description'")/*[[style description] UTF8String]*/, dump(range));
*result = m_acceptsEditing;
@@ -270,7 +270,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldChangeTypingStyle(
return E_POINTER;
}
- if (::gLayoutTestController->dumpEditingCallbacks() && !done)
+ if (::gTestRunner->dumpEditingCallbacks() && !done)
_tprintf(TEXT("EDITING DELEGATE: shouldChangeTypingStyle:%s toStyle:%s\n"), TEXT("'currentStyle description'"), TEXT("'proposedStyle description'"));
*result = m_acceptsEditing;
@@ -287,7 +287,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::doPlatformCommand(
return E_POINTER;
}
- if (::gLayoutTestController->dumpEditingCallbacks() && !done)
+ if (::gTestRunner->dumpEditingCallbacks() && !done)
_tprintf(TEXT("EDITING DELEGATE: doPlatformCommand:%s\n"), command ? command : TEXT(""));
*result = m_acceptsEditing;
@@ -297,7 +297,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::doPlatformCommand(
HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidBeginEditing(
/* [in] */ IWebNotification* notification)
{
- if (::gLayoutTestController->dumpEditingCallbacks() && !done) {
+ if (::gTestRunner->dumpEditingCallbacks() && !done) {
BSTR name;
notification->name(&name);
_tprintf(TEXT("EDITING DELEGATE: webViewDidBeginEditing:%s\n"), name ? name : TEXT(""));
@@ -309,7 +309,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidBeginEditing(
HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChange(
/* [in] */ IWebNotification *notification)
{
- if (::gLayoutTestController->dumpEditingCallbacks() && !done) {
+ if (::gTestRunner->dumpEditingCallbacks() && !done) {
BSTR name;
notification->name(&name);
_tprintf(TEXT("EDITING DELEGATE: webViewDidBeginEditing:%s\n"), name ? name : TEXT(""));
@@ -321,7 +321,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChange(
HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidEndEditing(
/* [in] */ IWebNotification *notification)
{
- if (::gLayoutTestController->dumpEditingCallbacks() && !done) {
+ if (::gTestRunner->dumpEditingCallbacks() && !done) {
BSTR name;
notification->name(&name);
_tprintf(TEXT("EDITING DELEGATE: webViewDidEndEditing:%s\n"), name ? name : TEXT(""));
@@ -333,7 +333,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidEndEditing(
HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChangeTypingStyle(
/* [in] */ IWebNotification *notification)
{
- if (::gLayoutTestController->dumpEditingCallbacks() && !done) {
+ if (::gTestRunner->dumpEditingCallbacks() && !done) {
BSTR name;
notification->name(&name);
_tprintf(TEXT("EDITING DELEGATE: webViewDidChangeTypingStyle:%s\n"), name ? name : TEXT(""));
@@ -345,7 +345,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChangeTypingStyle(
HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChangeSelection(
/* [in] */ IWebNotification *notification)
{
- if (::gLayoutTestController->dumpEditingCallbacks() && !done) {
+ if (::gTestRunner->dumpEditingCallbacks() && !done) {
BSTR name;
notification->name(&name);
_tprintf(TEXT("EDITING DELEGATE: webViewDidChangeSelection:%s\n"), name ? name : TEXT(""));
diff --git a/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp b/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp
index dcf5da18c..28d1317a6 100644
--- a/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp
+++ b/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp
@@ -34,7 +34,7 @@
#include "DumpRenderTree.h"
#include "EventSender.h"
#include "GCController.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include "TextInputController.h"
#include "WebCoreTestSupport.h"
#include "WorkQueueItem.h"
@@ -122,7 +122,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didStartProvisionalLoadForFrame(
/* [in] */ IWebView* webView,
/* [in] */ IWebFrame* frame)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didStartProvisionalLoadForFrame\n", descriptionSuitableForTestResult(frame).c_str());
// Make sure we only set this once per test. If it gets cleared, and then set again, we might
@@ -137,7 +137,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didReceiveServerRedirectForProvisio
/* [in] */ IWebView *webView,
/* [in] */ IWebFrame *frame)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didReceiveServerRedirectForProvisionalLoadForFrame\n", descriptionSuitableForTestResult(frame).c_str());
return S_OK;
@@ -148,7 +148,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFailProvisionalLoadWithError(
/* [in] */ IWebError *error,
/* [in] */ IWebFrame *frame)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didFailProvisionalLoadWithError\n", descriptionSuitableForTestResult(frame).c_str());
locationChangeDone(error, frame);
@@ -159,7 +159,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didCommitLoadForFrame(
/* [in] */ IWebView *webView,
/* [in] */ IWebFrame *frame)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didCommitLoadForFrame\n", descriptionSuitableForTestResult(frame).c_str());
COMPtr<IWebViewPrivate> webViewPrivate;
@@ -176,10 +176,10 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didReceiveTitle(
/* [in] */ BSTR title,
/* [in] */ IWebFrame *frame)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didReceiveTitle: %S\n", descriptionSuitableForTestResult(frame).c_str(), title);
- if (::gLayoutTestController->dumpTitleChanges() && !done)
+ if (::gTestRunner->dumpTitleChanges() && !done)
printf("TITLE CHANGED: %S\n", title ? title : L"");
return S_OK;
}
@@ -188,7 +188,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didChangeIcons(
/* [in] */ IWebView* webView,
/* [in] */ IWebFrame* frame)
{
- if (!done && gLayoutTestController->dumpIconChanges())
+ if (!done && gTestRunner->dumpIconChanges())
printf("%s - didChangeIcons\n", descriptionSuitableForTestResult(frame).c_str());
return S_OK;
@@ -201,7 +201,7 @@ void FrameLoadDelegate::processWork()
return;
// if we finish all the commands, we're ready to dump state
- if (WorkQueue::shared()->processWork() && !::gLayoutTestController->waitToDump())
+ if (WorkQueue::shared()->processWork() && !::gTestRunner->waitToDump())
dump();
}
@@ -240,7 +240,7 @@ void FrameLoadDelegate::locationChangeDone(IWebError*, IWebFrame* frame)
topLoadingFrame = 0;
WorkQueue::shared()->setFrozen(true);
- if (::gLayoutTestController->waitToDump())
+ if (::gTestRunner->waitToDump())
return;
if (WorkQueue::shared()->count()) {
@@ -257,7 +257,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFinishLoadForFrame(
/* [in] */ IWebView* webView,
/* [in] */ IWebFrame* frame)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didFinishLoadForFrame\n", descriptionSuitableForTestResult(frame).c_str());
locationChangeDone(0, frame);
@@ -269,7 +269,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFailLoadWithError(
/* [in] */ IWebError* error,
/* [in] */ IWebFrame* frame)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didFailLoadWithError\n", descriptionSuitableForTestResult(frame).c_str());
locationChangeDone(error, frame);
@@ -283,7 +283,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::willPerformClientRedirectToURL(
/* [in] */ DATE fireDate,
/* [in] */ IWebFrame *frame)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - willPerformClientRedirectToURL: %S \n", descriptionSuitableForTestResult(frame).c_str(),
urlSuitableForTestResult(std::wstring(url, ::SysStringLen(url))).c_str());
@@ -294,7 +294,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didCancelClientRedirectForFrame(
/* [in] */ IWebView *webView,
/* [in] */ IWebFrame *frame)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didCancelClientRedirectForFrame\n", descriptionSuitableForTestResult(frame).c_str());
return S_OK;
@@ -360,7 +360,7 @@ void FrameLoadDelegate::didClearWindowObjectForFrameInStandardWorld(IWebFrame* f
JSValueRef exception = 0;
- ::gLayoutTestController->makeWindowObject(context, windowObject, &exception);
+ ::gTestRunner->makeWindowObject(context, windowObject, &exception);
ASSERT(!exception);
m_gcController->makeWindowObject(context, windowObject, &exception);
@@ -384,7 +384,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFinishDocumentLoadForFrame(
/* [in] */ IWebView *sender,
/* [in] */ IWebFrame *frame)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didFinishDocumentLoadForFrame\n",
descriptionSuitableForTestResult(frame).c_str());
if (!done) {
@@ -408,7 +408,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didHandleOnloadEventsForFrame(
/* [in] */ IWebView *sender,
/* [in] */ IWebFrame *frame)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf("%s - didHandleOnloadEventsForFrame\n",
descriptionSuitableForTestResult(frame).c_str());
@@ -425,7 +425,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFirstVisuallyNonEmptyLayoutInFra
HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didDisplayInsecureContent(
/* [in] */ IWebView *sender)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf("didDisplayInsecureContent\n");
return S_OK;
@@ -435,7 +435,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didRunInsecureContent(
/* [in] */ IWebView *sender,
/* [in] */ IWebSecurityOrigin *origin)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
+ if (!done && gTestRunner->dumpFrameLoadCallbacks())
printf("didRunInsecureContent\n");
return S_OK;
diff --git a/Tools/DumpRenderTree/win/HistoryDelegate.cpp b/Tools/DumpRenderTree/win/HistoryDelegate.cpp
index 8a41facfc..ab92b0928 100644
--- a/Tools/DumpRenderTree/win/HistoryDelegate.cpp
+++ b/Tools/DumpRenderTree/win/HistoryDelegate.cpp
@@ -28,7 +28,7 @@
#include "DumpRenderTree.h"
#include "DumpRenderTreeWin.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include <string>
#include <WebKit/WebKit.h>
@@ -80,7 +80,7 @@ ULONG HistoryDelegate::Release(void)
// IWebHistoryDelegate
HRESULT HistoryDelegate::didNavigateWithNavigationData(IWebView* webView, IWebNavigationData* navigationData, IWebFrame* webFrame)
{
- if (!gLayoutTestController->dumpHistoryDelegateCallbacks())
+ if (!gTestRunner->dumpHistoryDelegateCallbacks())
return S_OK;
BSTR urlBSTR;
@@ -151,7 +151,7 @@ HRESULT HistoryDelegate::didNavigateWithNavigationData(IWebView* webView, IWebNa
HRESULT HistoryDelegate::didPerformClientRedirectFromURL(IWebView*, BSTR sourceURL, BSTR destinationURL, IWebFrame*)
{
- if (!gLayoutTestController->dumpHistoryDelegateCallbacks())
+ if (!gTestRunner->dumpHistoryDelegateCallbacks())
return S_OK;
wstring source;
@@ -168,7 +168,7 @@ HRESULT HistoryDelegate::didPerformClientRedirectFromURL(IWebView*, BSTR sourceU
HRESULT HistoryDelegate::didPerformServerRedirectFromURL(IWebView* webView, BSTR sourceURL, BSTR destinationURL, IWebFrame* webFrame)
{
- if (!gLayoutTestController->dumpHistoryDelegateCallbacks())
+ if (!gTestRunner->dumpHistoryDelegateCallbacks())
return S_OK;
wstring source;
@@ -185,7 +185,7 @@ HRESULT HistoryDelegate::didPerformServerRedirectFromURL(IWebView* webView, BSTR
HRESULT HistoryDelegate::updateHistoryTitle(IWebView* webView, BSTR titleBSTR, BSTR urlBSTR)
{
- if (!gLayoutTestController->dumpHistoryDelegateCallbacks())
+ if (!gTestRunner->dumpHistoryDelegateCallbacks())
return S_OK;
wstring url;
@@ -202,7 +202,7 @@ HRESULT HistoryDelegate::updateHistoryTitle(IWebView* webView, BSTR titleBSTR, B
HRESULT HistoryDelegate::populateVisitedLinksForWebView(IWebView* webView)
{
- if (!gLayoutTestController->dumpHistoryDelegateCallbacks())
+ if (!gTestRunner->dumpHistoryDelegateCallbacks())
return S_OK;
BSTR urlBSTR;
@@ -214,7 +214,7 @@ HRESULT HistoryDelegate::populateVisitedLinksForWebView(IWebView* webView)
url = urlSuitableForTestResult(wstringFromBSTR(urlBSTR));
SysFreeString(urlBSTR);
- if (gLayoutTestController->dumpVisitedLinksCallback())
+ if (gTestRunner->dumpVisitedLinksCallback())
printf("Asked to populate visited links for WebView \"%S\"\n", url.c_str());
return S_OK;
diff --git a/Tools/DumpRenderTree/win/PolicyDelegate.cpp b/Tools/DumpRenderTree/win/PolicyDelegate.cpp
index 7d87c4539..5d7177e53 100644
--- a/Tools/DumpRenderTree/win/PolicyDelegate.cpp
+++ b/Tools/DumpRenderTree/win/PolicyDelegate.cpp
@@ -30,7 +30,7 @@
#include "PolicyDelegate.h"
#include "DumpRenderTree.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include <string>
using std::wstring;
diff --git a/Tools/DumpRenderTree/win/PolicyDelegate.h b/Tools/DumpRenderTree/win/PolicyDelegate.h
index c808dc9c4..b6036fead 100644
--- a/Tools/DumpRenderTree/win/PolicyDelegate.h
+++ b/Tools/DumpRenderTree/win/PolicyDelegate.h
@@ -31,7 +31,7 @@
#include <WebKit/WebKit.h>
-class LayoutTestController;
+class TestRunner;
class PolicyDelegate : public IWebPolicyDelegate {
public:
@@ -71,12 +71,12 @@ public:
// PolicyDelegate
void setPermissive(bool permissive) { m_permissiveDelegate = permissive; }
- void setControllerToNotifyDone(LayoutTestController* controller) { m_controllerToNotifyDone = controller; }
+ void setControllerToNotifyDone(TestRunner* controller) { m_controllerToNotifyDone = controller; }
private:
ULONG m_refCount;
bool m_permissiveDelegate;
- LayoutTestController* m_controllerToNotifyDone;
+ TestRunner* m_controllerToNotifyDone;
};
#endif // PolicyDelegate_h
diff --git a/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp b/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp
index 26b722a4e..90b9ae0fc 100644
--- a/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp
+++ b/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp
@@ -30,7 +30,7 @@
#include "ResourceLoadDelegate.h"
#include "DumpRenderTree.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include <WebKit/WebKitCOMAPI.h>
#include <comutil.h>
#include <sstream>
@@ -209,7 +209,7 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::identifierForInitialRequest(
/* [in] */ IWebDataSource* dataSource,
/* [in] */ unsigned long identifier)
{
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
+ if (!done && gTestRunner->dumpResourceLoadCallbacks()) {
BSTR urlStr;
if (FAILED(request->URL(&urlStr)))
return E_FAIL;
@@ -238,26 +238,26 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::willSendRequest(
/* [in] */ IWebDataSource* dataSource,
/* [retval][out] */ IWebURLRequest **newRequest)
{
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
+ if (!done && gTestRunner->dumpResourceLoadCallbacks()) {
printf("%S - willSendRequest %S redirectResponse %S\n",
descriptionSuitableForTestResult(identifier).c_str(),
descriptionSuitableForTestResult(request).c_str(),
descriptionSuitableForTestResult(redirectResponse).c_str());
}
- if (!done && !gLayoutTestController->deferMainResourceDataLoad()) {
+ if (!done && !gTestRunner->deferMainResourceDataLoad()) {
COMPtr<IWebDataSourcePrivate> dataSourcePrivate(Query, dataSource);
if (!dataSourcePrivate)
return E_FAIL;
dataSourcePrivate->setDeferMainResourceDataLoad(FALSE);
}
- if (!done && gLayoutTestController->willSendRequestReturnsNull()) {
+ if (!done && gTestRunner->willSendRequestReturnsNull()) {
*newRequest = 0;
return S_OK;
}
- if (!done && gLayoutTestController->willSendRequestReturnsNullOnRedirect() && redirectResponse) {
+ if (!done && gTestRunner->willSendRequestReturnsNullOnRedirect() && redirectResponse) {
printf("Returning null for this redirect\n");
*newRequest = 0;
return S_OK;
@@ -265,7 +265,7 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::willSendRequest(
IWebMutableURLRequest* requestCopy = 0;
request->mutableCopy(&requestCopy);
- const set<string>& clearHeaders = gLayoutTestController->willSendRequestClearHeaders();
+ const set<string>& clearHeaders = gTestRunner->willSendRequestClearHeaders();
for (set<string>::const_iterator header = clearHeaders.begin(); header != clearHeaders.end(); ++header) {
BSTR bstrHeader = BSTRFromString(*header);
requestCopy->setValue(0, bstrHeader);
@@ -286,14 +286,14 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didReceiveAuthenticationChalleng
if (!challenge || FAILED(challenge->sender(&sender)))
return E_FAIL;
- if (!gLayoutTestController->handlesAuthenticationChallenges()) {
+ if (!gTestRunner->handlesAuthenticationChallenges()) {
printf("%S - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet\n", descriptionSuitableForTestResult(identifier).c_str());
sender->continueWithoutCredentialForAuthenticationChallenge(challenge);
return S_OK;
}
- const char* user = gLayoutTestController->authenticationUsername().c_str();
- const char* password = gLayoutTestController->authenticationPassword().c_str();
+ const char* user = gTestRunner->authenticationUsername().c_str();
+ const char* password = gTestRunner->authenticationPassword().c_str();
printf("%S - didReceiveAuthenticationChallenge - Responding with %s:%s\n", descriptionSuitableForTestResult(identifier).c_str(), user, password);
@@ -312,12 +312,12 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didReceiveResponse(
/* [in] */ IWebURLResponse* response,
/* [in] */ IWebDataSource* dataSource)
{
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
+ if (!done && gTestRunner->dumpResourceLoadCallbacks()) {
printf("%S - didReceiveResponse %S\n",
descriptionSuitableForTestResult(identifier).c_str(),
descriptionSuitableForTestResult(response).c_str());
}
- if (!done && gLayoutTestController->dumpResourceResponseMIMETypes()) {
+ if (!done && gTestRunner->dumpResourceResponseMIMETypes()) {
BSTR mimeTypeBSTR;
if (FAILED(response->MIMEType(&mimeTypeBSTR)))
E_FAIL;
@@ -344,7 +344,7 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didFinishLoadingFromDataSource(
/* [in] */ unsigned long identifier,
/* [in] */ IWebDataSource* dataSource)
{
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
+ if (!done && gTestRunner->dumpResourceLoadCallbacks()) {
printf("%S - didFinishLoading\n",
descriptionSuitableForTestResult(identifier).c_str());
}
@@ -360,7 +360,7 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didFailLoadingWithError(
/* [in] */ IWebError* error,
/* [in] */ IWebDataSource* dataSource)
{
- if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
+ if (!done && gTestRunner->dumpResourceLoadCallbacks()) {
printf("%S - didFailLoadingWithError: %S\n",
descriptionSuitableForTestResult(identifier).c_str(),
descriptionSuitableForTestResult(error, identifier).c_str());
diff --git a/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/Tools/DumpRenderTree/win/TestRunnerWin.cpp
index ffc3d26dc..a2c15e30d 100644
--- a/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp
+++ b/Tools/DumpRenderTree/win/TestRunnerWin.cpp
@@ -27,7 +27,7 @@
*/
#include "config.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include "DumpRenderTree.h"
#include "EditingDelegate.h"
@@ -42,8 +42,8 @@
#include <WebKit/WebKit.h>
#include <WebKit/WebKitCOMAPI.h>
#include <comutil.h>
-#include <shlwapi.h>
#include <shlguid.h>
+#include <shlwapi.h>
#include <shobjidl.h>
#include <string>
#include <wtf/Assertions.h>
@@ -56,7 +56,7 @@ using std::wstring;
static bool resolveCygwinPath(const wstring& cygwinPath, wstring& windowsPath);
-LayoutTestController::~LayoutTestController()
+TestRunner::~TestRunner()
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -79,12 +79,12 @@ LayoutTestController::~LayoutTestController()
editingDelegate->setAcceptsEditing(TRUE);
}
-void LayoutTestController::addDisallowedURL(JSStringRef url)
+void TestRunner::addDisallowedURL(JSStringRef url)
{
// FIXME: Implement!
}
-void LayoutTestController::clearBackForwardList()
+void TestRunner::clearBackForwardList()
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -110,7 +110,7 @@ void LayoutTestController::clearBackForwardList()
backForwardList->goToItem(item.get());
}
-bool LayoutTestController::callShouldCloseOnWebView()
+bool TestRunner::callShouldCloseOnWebView()
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -125,19 +125,19 @@ bool LayoutTestController::callShouldCloseOnWebView()
return result;
}
-JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name)
+JSStringRef TestRunner::copyDecodedHostName(JSStringRef name)
{
// FIXME: Implement!
return 0;
}
-JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name)
+JSStringRef TestRunner::copyEncodedHostName(JSStringRef name)
{
// FIXME: Implement!
return 0;
}
-void LayoutTestController::disableImageLoading()
+void TestRunner::disableImageLoading()
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -150,17 +150,17 @@ void LayoutTestController::disableImageLoading()
preferences->setLoadsImagesAutomatically(FALSE);
}
-void LayoutTestController::dispatchPendingLoadRequests()
+void TestRunner::dispatchPendingLoadRequests()
{
// FIXME: Implement for testing fix for 6727495
}
-void LayoutTestController::display()
+void TestRunner::display()
{
displayWebView();
}
-void LayoutTestController::keepWebHistory()
+void TestRunner::keepWebHistory()
{
COMPtr<IWebHistory> history;
if (FAILED(WebKitCreateInstance(CLSID_WebHistory, 0, __uuidof(history), reinterpret_cast<void**>(&history))))
@@ -173,13 +173,13 @@ void LayoutTestController::keepWebHistory()
history->setOptionalSharedHistory(sharedHistory.get());
}
-JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
+JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
{
// FIXME: Implement this.
return JSValueMakeUndefined(context);
}
-JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
+JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const
{
COMPtr<IWebFramePrivate> framePrivate(Query, frame);
if (!framePrivate)
@@ -194,7 +194,7 @@ JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
return textValueJS;
}
-JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
+JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -221,7 +221,7 @@ JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRe
return markerText;
}
-void LayoutTestController::waitForPolicyDelegate()
+void TestRunner::waitForPolicyDelegate()
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -232,7 +232,7 @@ void LayoutTestController::waitForPolicyDelegate()
webView->setPolicyDelegate(policyDelegate);
}
-size_t LayoutTestController::webHistoryItemCount()
+size_t TestRunner::webHistoryItemCount()
{
COMPtr<IWebHistory> history;
if (FAILED(WebKitCreateInstance(CLSID_WebHistory, 0, __uuidof(history), reinterpret_cast<void**>(&history))))
@@ -253,7 +253,7 @@ size_t LayoutTestController::webHistoryItemCount()
return count;
}
-unsigned LayoutTestController::workerThreadCount() const
+unsigned TestRunner::workerThreadCount() const
{
COMPtr<IWebWorkersPrivate> workers;
if (FAILED(WebKitCreateInstance(CLSID_WebWorkersPrivate, 0, __uuidof(workers), reinterpret_cast<void**>(&workers))))
@@ -264,13 +264,13 @@ unsigned LayoutTestController::workerThreadCount() const
return count;
}
-JSRetainPtr<JSStringRef> LayoutTestController::platformName() const
+JSRetainPtr<JSStringRef> TestRunner::platformName() const
{
JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("win"));
return platformName;
}
-void LayoutTestController::notifyDone()
+void TestRunner::notifyDone()
{
// Same as on mac. This can be shared.
if (m_waitToDump && !topLoadingFrame && !WorkQueue::shared()->count())
@@ -278,7 +278,7 @@ void LayoutTestController::notifyDone()
m_waitToDump = false;
}
-JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef url)
+JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef url)
{
wstring input(JSStringGetCharactersPtr(url), JSStringGetLength(url));
@@ -301,7 +301,7 @@ static wstring jsStringRefToWString(JSStringRef jsStr)
return buffer.data();
}
-void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target)
+void TestRunner::queueLoad(JSStringRef url, JSStringRef target)
{
COMPtr<IWebDataSource> dataSource;
if (FAILED(frame->dataSource(&dataSource)))
@@ -329,7 +329,7 @@ void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target)
WorkQueue::shared()->queue(new LoadItem(jsAbsoluteURL.get(), target));
}
-void LayoutTestController::setAcceptsEditing(bool acceptsEditing)
+void TestRunner::setAcceptsEditing(bool acceptsEditing)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -347,7 +347,7 @@ void LayoutTestController::setAcceptsEditing(bool acceptsEditing)
editingDelegate->setAcceptsEditing(acceptsEditing);
}
-void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
+void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
{
if (alwaysAcceptCookies == m_alwaysAcceptCookies)
return;
@@ -357,7 +357,7 @@ void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
m_alwaysAcceptCookies = alwaysAcceptCookies;
}
-void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
+void TestRunner::setAuthorAndUserStylesEnabled(bool flag)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -374,7 +374,7 @@ void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
prefsPrivate->setAuthorAndUserStylesEnabled(flag);
}
-void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled)
+void TestRunner::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -395,7 +395,7 @@ void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeOb
autofillElement->setAutofilled(autofilled);
}
-void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive)
+void TestRunner::setCustomPolicyDelegate(bool setDelegate, bool permissive)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -408,55 +408,55 @@ void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permis
webView->setPolicyDelegate(0);
}
-void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
{
// FIXME: Implement for DeviceOrientation layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=30335.
}
-void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
+void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
{
// FIXME: Implement for Geolocation layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=28264.
}
-void LayoutTestController::setMockGeolocationError(int code, JSStringRef message)
+void TestRunner::setMockGeolocationError(int code, JSStringRef message)
{
// FIXME: Implement for Geolocation layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=28264.
}
-void LayoutTestController::setGeolocationPermission(bool allow)
+void TestRunner::setGeolocationPermission(bool allow)
{
// FIXME: Implement for Geolocation layout tests.
setGeolocationPermissionCommon(allow);
}
-int LayoutTestController::numberOfPendingGeolocationPermissionRequests()
+int TestRunner::numberOfPendingGeolocationPermissionRequests()
{
// FIXME: Implement for Geolocation layout tests.
return -1;
}
-void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
+void TestRunner::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
}
-void LayoutTestController::setMockSpeechInputDumpRect(bool flag)
+void TestRunner::setMockSpeechInputDumpRect(bool flag)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
}
-void LayoutTestController::startSpeechInput(JSContextRef inputElement)
+void TestRunner::startSpeechInput(JSContextRef inputElement)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
}
-void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
+void TestRunner::setIconDatabaseEnabled(bool iconDatabaseEnabled)
{
// See also <rdar://problem/6480108>
COMPtr<IWebIconDatabase> iconDatabase;
@@ -469,12 +469,12 @@ void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
iconDatabase->setEnabled(iconDatabaseEnabled);
}
-void LayoutTestController::setMainFrameIsFirstResponder(bool flag)
+void TestRunner::setMainFrameIsFirstResponder(bool flag)
{
// FIXME: Implement!
}
-void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
+void TestRunner::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -487,7 +487,7 @@ void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled
preferences->setPrivateBrowsingEnabled(privateBrowsingEnabled);
}
-void LayoutTestController::setXSSAuditorEnabled(bool enabled)
+void TestRunner::setXSSAuditorEnabled(bool enabled)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -504,7 +504,7 @@ void LayoutTestController::setXSSAuditorEnabled(bool enabled)
prefsPrivate->setXSSAuditorEnabled(enabled);
}
-void LayoutTestController::setFrameFlatteningEnabled(bool enabled)
+void TestRunner::setFrameFlatteningEnabled(bool enabled)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -521,12 +521,12 @@ void LayoutTestController::setFrameFlatteningEnabled(bool enabled)
prefsPrivate->setFrameFlatteningEnabled(enabled);
}
-void LayoutTestController::setSpatialNavigationEnabled(bool enabled)
+void TestRunner::setSpatialNavigationEnabled(bool enabled)
{
// FIXME: Implement for SpatialNavigation layout tests.
}
-void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
+void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -543,7 +543,7 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
prefsPrivate->setAllowUniversalAccessFromFileURLs(enabled);
}
-void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled)
+void TestRunner::setAllowFileAccessFromFileURLs(bool enabled)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -560,7 +560,7 @@ void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled)
prefsPrivate->setAllowFileAccessFromFileURLs(enabled);
}
-void LayoutTestController::setPopupBlockingEnabled(bool enabled)
+void TestRunner::setPopupBlockingEnabled(bool enabled)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -573,12 +573,12 @@ void LayoutTestController::setPopupBlockingEnabled(bool enabled)
preferences->setJavaScriptCanOpenWindowsAutomatically(!enabled);
}
-void LayoutTestController::setPluginsEnabled(bool flag)
+void TestRunner::setPluginsEnabled(bool flag)
{
// FIXME: Implement
}
-void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled)
+void TestRunner::setJavaScriptCanAccessClipboard(bool enabled)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -595,7 +595,7 @@ void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled)
prefsPrivate->setJavaScriptCanAccessClipboard(enabled);
}
-void LayoutTestController::setTabKeyCyclesThroughElements(bool shouldCycle)
+void TestRunner::setTabKeyCyclesThroughElements(bool shouldCycle)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -608,12 +608,12 @@ void LayoutTestController::setTabKeyCyclesThroughElements(bool shouldCycle)
viewPrivate->setTabKeyCyclesThroughElements(shouldCycle ? TRUE : FALSE);
}
-void LayoutTestController::setUseDashboardCompatibilityMode(bool flag)
+void TestRunner::setUseDashboardCompatibilityMode(bool flag)
{
// FIXME: Implement!
}
-void LayoutTestController::setUserStyleSheetEnabled(bool flag)
+void TestRunner::setUserStyleSheetEnabled(bool flag)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -623,7 +623,7 @@ void LayoutTestController::setUserStyleSheetEnabled(bool flag)
if (FAILED(webView->preferences(&preferences)))
return;
- preferences->setUserStyleSheetEnabled(flag);
+ preferences->setUserStyleSheetEnabled(flag);
}
bool appendComponentToPath(wstring& path, const wstring& component)
@@ -681,7 +681,7 @@ static bool resolveCygwinPath(const wstring& cygwinPath, wstring& windowsPath)
{
wstring fileProtocol = L"file://";
bool isFileProtocol = cygwinPath.find(fileProtocol) != string::npos;
- if (cygwinPath[isFileProtocol ? 7 : 0] != '/') // ensure path is absolute
+ if (cygwinPath[isFileProtocol ? 7 : 0] != '/') // ensure path is absolute
return false;
// Get the Root path.
@@ -733,7 +733,7 @@ static bool resolveCygwinPath(const wstring& cygwinPath, wstring& windowsPath)
return true;
}
-void LayoutTestController::setUserStyleSheetLocation(JSStringRef jsURL)
+void TestRunner::setUserStyleSheetLocation(JSStringRef jsURL)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -777,7 +777,7 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef jsURL)
SysFreeString(resultPathBSTR);
}
-void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value)
+void TestRunner::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -800,23 +800,23 @@ void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef elem
domInputElement->setValueForUser(valueBSTR);
}
-void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
+void TestRunner::setViewModeMediaFeature(JSStringRef mode)
{
// FIXME: implement
}
-void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL)
+void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef jsURL)
{
RetainPtr<CFStringRef> urlString(AdoptCF, JSStringCopyCFString(0, jsURL));
::setPersistentUserStyleSheetLocation(urlString.get());
}
-void LayoutTestController::clearPersistentUserStyleSheet()
+void TestRunner::clearPersistentUserStyleSheet()
{
::setPersistentUserStyleSheetLocation(0);
}
-void LayoutTestController::setWindowIsKey(bool flag)
+void TestRunner::setWindowIsKey(bool flag)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -833,7 +833,7 @@ void LayoutTestController::setWindowIsKey(bool flag)
::SendMessage(webViewWindow, flag ? WM_SETFOCUS : WM_KILLFOCUS, (WPARAM)::GetDesktopWindow(), 0);
}
-void LayoutTestController::setSmartInsertDeleteEnabled(bool flag)
+void TestRunner::setSmartInsertDeleteEnabled(bool flag)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -846,7 +846,7 @@ void LayoutTestController::setSmartInsertDeleteEnabled(bool flag)
viewEditing->setSmartInsertDeleteEnabled(flag ? TRUE : FALSE);
}
-void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag)
+void TestRunner::setSelectTrailingWhitespaceEnabled(bool flag)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -863,22 +863,22 @@ static const CFTimeInterval waitToDumpWatchdogInterval = 30.0;
static void CALLBACK waitUntilDoneWatchdogFired(HWND, UINT, UINT_PTR, DWORD)
{
- gLayoutTestController->waitToDumpWatchdogTimerFired();
+ gTestRunner->waitToDumpWatchdogTimerFired();
}
-void LayoutTestController::setWaitToDump(bool waitUntilDone)
+void TestRunner::setWaitToDump(bool waitUntilDone)
{
m_waitToDump = waitUntilDone;
if (m_waitToDump && !waitToDumpWatchdog)
waitToDumpWatchdog = SetTimer(0, 0, waitToDumpWatchdogInterval * 1000, waitUntilDoneWatchdogFired);
}
-int LayoutTestController::windowCount()
+int TestRunner::windowCount()
{
return openWindows().size();
}
-bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id)
+bool TestRunner::elementDoesAutoCompleteForElementWithId(JSStringRef id)
{
COMPtr<IDOMDocument> document;
if (FAILED(frame->DOMDocument(&document)))
@@ -904,7 +904,7 @@ bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef i
return autoCompletes;
}
-void LayoutTestController::execCommand(JSStringRef name, JSStringRef value)
+void TestRunner::execCommand(JSStringRef name, JSStringRef value)
{
wstring wName = jsStringRefToWString(name);
wstring wValue = jsStringRefToWString(value);
@@ -925,51 +925,51 @@ void LayoutTestController::execCommand(JSStringRef name, JSStringRef value)
SysFreeString(valueBSTR);
}
-bool LayoutTestController::findString(JSContextRef /* context */, JSStringRef /* target */, JSObjectRef /* optionsArray */)
+bool TestRunner::findString(JSContextRef /* context */, JSStringRef /* target */, JSObjectRef /* optionsArray */)
{
// FIXME: Implement
return false;
}
-void LayoutTestController::setCacheModel(int)
+void TestRunner::setCacheModel(int)
{
// FIXME: Implement
}
-bool LayoutTestController::isCommandEnabled(JSStringRef /*name*/)
+bool TestRunner::isCommandEnabled(JSStringRef /*name*/)
{
- printf("ERROR: LayoutTestController::isCommandEnabled() not implemented\n");
+ printf("ERROR: TestRunner::isCommandEnabled() not implemented\n");
return false;
}
-void LayoutTestController::clearAllApplicationCaches()
+void TestRunner::clearAllApplicationCaches()
{
// FIXME: Implement to support application cache quotas.
}
-void LayoutTestController::clearApplicationCacheForOrigin(JSStringRef origin)
+void TestRunner::clearApplicationCacheForOrigin(JSStringRef origin)
{
// FIXME: Implement to support deleting all application cache for an origin.
}
-void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota)
+void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota)
{
// FIXME: Implement to support application cache quotas.
}
-JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context)
+JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context)
{
// FIXME: Implement to get origins that have application caches.
return JSValueMakeUndefined(context);
}
-long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef name)
+long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef name)
{
// FIXME: Implement to get disk usage by all application caches for an origin.
return 0;
}
-void LayoutTestController::clearAllDatabases()
+void TestRunner::clearAllDatabases()
{
COMPtr<IWebDatabaseManager> databaseManager;
COMPtr<IWebDatabaseManager> tmpDatabaseManager;
@@ -981,7 +981,7 @@ void LayoutTestController::clearAllDatabases()
databaseManager->deleteAllDatabases();
}
-void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value)
+void TestRunner::overridePreference(JSStringRef key, JSStringRef value)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -1002,7 +1002,7 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value
SysFreeString(valueBSTR);
}
-void LayoutTestController::setDatabaseQuota(unsigned long long quota)
+void TestRunner::setDatabaseQuota(unsigned long long quota)
{
COMPtr<IWebDatabaseManager> databaseManager;
COMPtr<IWebDatabaseManager> tmpDatabaseManager;
@@ -1015,17 +1015,17 @@ void LayoutTestController::setDatabaseQuota(unsigned long long quota)
databaseManager->setQuota(TEXT("file:///"), quota);
}
-void LayoutTestController::goBack()
+void TestRunner::goBack()
{
// FIXME: implement to enable loader/navigation-while-deferring-loads.html
}
-void LayoutTestController::setDefersLoading(bool)
+void TestRunner::setDefersLoading(bool)
{
// FIXME: implement to enable loader/navigation-while-deferring-loads.html
}
-void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme)
+void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme)
{
COMPtr<IWebViewPrivate> webView;
if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView))))
@@ -1036,12 +1036,12 @@ void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidd
SysFreeString(schemeBSTR);
}
-void LayoutTestController::setAppCacheMaximumSize(unsigned long long size)
+void TestRunner::setAppCacheMaximumSize(unsigned long long size)
{
- printf("ERROR: LayoutTestController::setAppCacheMaximumSize() not implemented\n");
+ printf("ERROR: TestRunner::setAppCacheMaximumSize() not implemented\n");
}
-bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
+bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
{
COMPtr<IDOMDocument> document;
if (FAILED(frame->DOMDocument(&document)))
@@ -1066,7 +1066,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef anima
return SUCCEEDED(hr) && wasRunning;
}
-bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
+bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
{
COMPtr<IDOMDocument> document;
if (FAILED(frame->DOMDocument(&document)))
@@ -1091,7 +1091,7 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop
return SUCCEEDED(hr) && wasRunning;
}
-unsigned LayoutTestController::numberOfActiveAnimations() const
+unsigned TestRunner::numberOfActiveAnimations() const
{
COMPtr<IWebFramePrivate> framePrivate(Query, frame);
if (!framePrivate)
@@ -1110,7 +1110,7 @@ static _bstr_t bstrT(JSStringRef jsString)
return _bstr_t(JSStringCopyBSTR(jsString), false);
}
-void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
{
COMPtr<IWebViewPrivate> webView;
if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView))))
@@ -1119,7 +1119,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigi
webView->addOriginAccessWhitelistEntry(bstrT(sourceOrigin).GetBSTR(), bstrT(destinationProtocol).GetBSTR(), bstrT(destinationHost).GetBSTR(), allowDestinationSubdomains);
}
-void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
{
COMPtr<IWebViewPrivate> webView;
if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView))))
@@ -1128,12 +1128,12 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOr
webView->removeOriginAccessWhitelistEntry(bstrT(sourceOrigin).GetBSTR(), bstrT(destinationProtocol).GetBSTR(), bstrT(destinationHost).GetBSTR(), allowDestinationSubdomains);
}
-void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
+void TestRunner::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
{
// FIXME: implement
}
-void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
+void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
{
COMPtr<IWebViewPrivate> webView;
if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView))))
@@ -1147,7 +1147,7 @@ void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bo
}
-void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
+void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames)
{
COMPtr<IWebViewPrivate> webView;
if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView))))
@@ -1160,7 +1160,7 @@ void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
webView->addUserStyleSheetToGroup(_bstr_t(L"org.webkit.DumpRenderTree").GetBSTR(), world.get(), bstrT(source).GetBSTR(), 0, 0, 0, 0, 0);
}
-void LayoutTestController::setDeveloperExtrasEnabled(bool enabled)
+void TestRunner::setDeveloperExtrasEnabled(bool enabled)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -1177,12 +1177,12 @@ void LayoutTestController::setDeveloperExtrasEnabled(bool enabled)
prefsPrivate->setDeveloperExtrasEnabled(enabled);
}
-void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool)
+void TestRunner::setAsynchronousSpellCheckingEnabled(bool)
{
// FIXME: Implement this.
}
-void LayoutTestController::showWebInspector()
+void TestRunner::showWebInspector()
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -1197,7 +1197,7 @@ void LayoutTestController::showWebInspector()
inspector->show();
}
-void LayoutTestController::closeWebInspector()
+void TestRunner::closeWebInspector()
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -1214,7 +1214,7 @@ void LayoutTestController::closeWebInspector()
inspector->close();
}
-void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script)
+void TestRunner::evaluateInWebInspector(long callId, JSStringRef script)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -1253,12 +1253,12 @@ unsigned worldIDForWorld(IWebScriptWorld* world)
return 0;
}
-void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
+void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
{
// FIXME: Implement this.
}
-void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
+void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
{
COMPtr<IWebFramePrivate> framePrivate(Query, frame);
if (!framePrivate)
@@ -1283,7 +1283,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObj
SysFreeString(result);
}
-void LayoutTestController::removeAllVisitedLinks()
+void TestRunner::removeAllVisitedLinks()
{
COMPtr<IWebHistory> history;
if (FAILED(WebKitCreateInstance(CLSID_WebHistory, 0, __uuidof(history), reinterpret_cast<void**>(&history))))
@@ -1300,7 +1300,7 @@ void LayoutTestController::removeAllVisitedLinks()
sharedHistoryPrivate->removeAllVisitedLinks();
}
-int LayoutTestController::numberOfPages(float pageWidthInPixels, float pageHeightInPixels)
+int TestRunner::numberOfPages(float pageWidthInPixels, float pageHeightInPixels)
{
COMPtr<IWebFramePrivate> framePrivate(Query, frame);
if (!framePrivate)
@@ -1312,24 +1312,24 @@ int LayoutTestController::numberOfPages(float pageWidthInPixels, float pageHeigh
return pageNumber;
}
-JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const
+JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const
{
// FIXME: Implement this.
return JSRetainPtr<JSStringRef>();
}
-void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
+void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
{
}
-JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
+JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
{
// FIXME: implement
return JSRetainPtr<JSStringRef>();
}
-void LayoutTestController::apiTestGoToCurrentBackForwardItem()
+void TestRunner::apiTestGoToCurrentBackForwardItem()
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -1347,56 +1347,56 @@ void LayoutTestController::apiTestGoToCurrentBackForwardItem()
webView->goToBackForwardItem(item.get(), &success);
}
-void LayoutTestController::setWebViewEditable(bool)
+void TestRunner::setWebViewEditable(bool)
{
}
-void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
+void TestRunner::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
{
}
-void LayoutTestController::abortModal()
+void TestRunner::abortModal()
{
}
-void LayoutTestController::setSerializeHTTPLoads(bool)
+void TestRunner::setSerializeHTTPLoads(bool)
{
// FIXME: Implement.
}
-void LayoutTestController::syncLocalStorage()
+void TestRunner::syncLocalStorage()
{
// FIXME: Implement.
}
-void LayoutTestController::observeStorageTrackerNotifications(unsigned number)
+void TestRunner::observeStorageTrackerNotifications(unsigned number)
{
// FIXME: Implement.
}
-void LayoutTestController::deleteAllLocalStorage()
+void TestRunner::deleteAllLocalStorage()
{
// FIXME: Implement.
}
-JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context)
+JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context)
{
// FIXME: Implement.
return JSValueMakeUndefined(context);
}
-long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef originIdentifier)
+long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef originIdentifier)
{
// FIXME: Implement to support getting local storage disk usage for an origin.
return 0;
}
-void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef URL)
+void TestRunner::deleteLocalStorageForOrigin(JSStringRef URL)
{
// FIXME: Implement.
}
-void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval)
+void TestRunner::setMinimumTimerInterval(double minimumTimerInterval)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -1409,7 +1409,7 @@ void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval)
viewPrivate->setMinimumTimerInterval(minimumTimerInterval);
}
-void LayoutTestController::setTextDirection(JSStringRef direction)
+void TestRunner::setTextDirection(JSStringRef direction)
{
COMPtr<IWebFramePrivate> framePrivate(Query, frame);
if (!framePrivate)
@@ -1418,53 +1418,53 @@ void LayoutTestController::setTextDirection(JSStringRef direction)
framePrivate->setTextDirection(bstrT(direction).GetBSTR());
}
-void LayoutTestController::addChromeInputField()
+void TestRunner::addChromeInputField()
{
}
-void LayoutTestController::removeChromeInputField()
+void TestRunner::removeChromeInputField()
{
}
-void LayoutTestController::focusWebView()
+void TestRunner::focusWebView()
{
}
-void LayoutTestController::setBackingScaleFactor(double)
+void TestRunner::setBackingScaleFactor(double)
{
}
-void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title)
+void TestRunner::simulateDesktopNotificationClick(JSStringRef title)
{
// FIXME: Implement.
}
-void LayoutTestController::resetPageVisibility()
+void TestRunner::resetPageVisibility()
{
// FIXME: Implement this.
}
-void LayoutTestController::setPageVisibility(const char*)
+void TestRunner::setPageVisibility(const char*)
{
// FIXME: Implement this.
}
-void LayoutTestController::setAutomaticLinkDetectionEnabled(bool)
+void TestRunner::setAutomaticLinkDetectionEnabled(bool)
{
// FIXME: Implement this.
}
-void LayoutTestController::sendWebIntentResponse(JSStringRef)
+void TestRunner::sendWebIntentResponse(JSStringRef)
{
// FIXME: Implement this.
}
-void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)
+void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)
{
// FIXME: Implement this.
}
-void LayoutTestController::setStorageDatabaseIdleInterval(double)
+void TestRunner::setStorageDatabaseIdleInterval(double)
{
// FIXME: Implement this.
}
diff --git a/Tools/DumpRenderTree/win/UIDelegate.cpp b/Tools/DumpRenderTree/win/UIDelegate.cpp
index 6eb880c2c..fd6a8f842 100644
--- a/Tools/DumpRenderTree/win/UIDelegate.cpp
+++ b/Tools/DumpRenderTree/win/UIDelegate.cpp
@@ -32,9 +32,8 @@
#include "DumpRenderTree.h"
#include "DraggingInfo.h"
#include "EventSender.h"
-#include "LayoutTestController.h"
#include "DRTDesktopNotificationPresenter.h"
-
+#include "TestRunner.h"
#include <WebCore/COMPtr.h>
#include <wtf/Assertions.h>
#include <wtf/PassOwnPtr.h>
@@ -472,7 +471,7 @@ HRESULT STDMETHODCALLTYPE UIDelegate::runBeforeUnloadConfirmPanelWithMessage(
if (!result)
return E_POINTER;
printf("CONFIRM NAVIGATION: %S\n", message ? message : L"");
- *result = !gLayoutTestController->shouldStayOnPageAfterHandlingBeforeUnload();
+ *result = !gTestRunner->shouldStayOnPageAfterHandlingBeforeUnload();
return S_OK;
}
@@ -537,7 +536,7 @@ HRESULT STDMETHODCALLTYPE UIDelegate::createWebViewWithRequest(
/* [in] */ IWebURLRequest *request,
/* [retval][out] */ IWebView **newWebView)
{
- if (!::gLayoutTestController->canOpenWindows())
+ if (!::gTestRunner->canOpenWindows())
return E_FAIL;
*newWebView = createWebViewAndOffscreenWindow();
return S_OK;
@@ -588,7 +587,7 @@ HRESULT STDMETHODCALLTYPE UIDelegate::exceededDatabaseQuota(
origin->host(&host);
origin->port(&port);
- if (!done && gLayoutTestController->dumpDatabaseCallbacks())
+ if (!done && gTestRunner->dumpDatabaseCallbacks())
printf("UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%S, %S, %i} database:%S\n", protocol, host, port, databaseIdentifier);
SysFreeString(protocol);
@@ -633,7 +632,7 @@ HRESULT STDMETHODCALLTYPE UIDelegate::webViewDidInvalidate(
HRESULT STDMETHODCALLTYPE UIDelegate::setStatusText(IWebView*, BSTR text)
{
- if (gLayoutTestController->dumpStatusCallbacks())
+ if (gTestRunner->dumpStatusCallbacks())
printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", text ? toUTF8(text).c_str() : "");
return S_OK;
}
diff --git a/Tools/DumpRenderTree/wscript b/Tools/DumpRenderTree/wscript
index b32929450..b1a0356fa 100644
--- a/Tools/DumpRenderTree/wscript
+++ b/Tools/DumpRenderTree/wscript
@@ -41,10 +41,10 @@ include_paths = [
]
sources = [
'DumpRenderTreeCommon.cpp',
- 'LayoutTestController.cpp',
+ 'TestRunner.cpp',
'WorkQueue.cpp',
'wx/DumpRenderTreeWx.cpp',
- 'wx/LayoutTestControllerWx.cpp',
+ 'wx/TestRunnerWx.cpp',
'wx/WorkQueueItemWx.cpp'
]
diff --git a/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp b/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp
index 45b852d88..0f8788504 100644
--- a/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp
+++ b/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp
@@ -29,7 +29,7 @@
#include "config.h"
#include "DumpRenderTree.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include "WorkQueue.h"
#include "WorkQueueItem.h"
@@ -59,7 +59,7 @@ using namespace WebKit;
FILE* logOutput;
-RefPtr<LayoutTestController> gLayoutTestController;
+RefPtr<TestRunner> gTestRunner;
static WebView* webView;
static wxTimer* idleTimer;
@@ -95,7 +95,7 @@ public:
if (event.GetState() == WEBVIEW_LOAD_ONLOAD_HANDLED) {
done = true;
- if (!gLayoutTestController->waitToDump() || notified) {
+ if (!gTestRunner->waitToDump() || notified) {
dump();
}
}
@@ -128,14 +128,14 @@ public:
void OnReceivedTitleEvent(WebViewReceivedTitleEvent& event)
{
- if (gLayoutTestController->dumpTitleChanges() && !done)
+ if (gTestRunner->dumpTitleChanges() && !done)
wxFprintf(stdout, "TITLE CHANGED: %S\n", event.GetTitle());
}
void OnWindowObjectClearedEvent(WebViewWindowObjectClearedEvent& event)
{
JSValueRef exception = 0;
- gLayoutTestController->makeWindowObject(event.GetJSContext(), event.GetWindowObject(), &exception);
+ gTestRunner->makeWindowObject(event.GetJSContext(), event.GetWindowObject(), &exception);
}
private:
@@ -155,7 +155,7 @@ LayoutWebViewEventHandler* eventHandler = 0;
static wxString dumpFramesAsText(WebFrame* frame)
{
// TODO: implement this. leaving this here so we don't forget this case.
- if (gLayoutTestController->dumpChildFramesAsText()) {
+ if (gTestRunner->dumpChildFramesAsText()) {
}
return frame->GetInnerText();
@@ -166,15 +166,15 @@ void dump()
if (!done)
return;
- if (gLayoutTestController->waitToDump() && !notified)
+ if (gTestRunner->waitToDump() && !notified)
return;
if (dumpTree) {
const char* result = 0;
- bool dumpAsText = gLayoutTestController->dumpAsText();
+ bool dumpAsText = gTestRunner->dumpAsText();
wxString str;
- if (gLayoutTestController->dumpAsText())
+ if (gTestRunner->dumpAsText())
str = dumpFramesAsText(webView->GetMainFrame());
else
str = webView->GetMainFrame()->GetExternalRepresentation();
@@ -182,7 +182,7 @@ void dump()
result = str.ToUTF8();
if (!result) {
const char* errorMessage;
- if (gLayoutTestController->dumpAsText())
+ if (gTestRunner->dumpAsText())
errorMessage = "WebFrame::GetInnerText";
else
errorMessage = "WebFrame::GetExternalRepresentation";
@@ -191,7 +191,7 @@ void dump()
printf("%s\n", result);
}
- if (gLayoutTestController->dumpBackForwardList()) {
+ if (gTestRunner->dumpBackForwardList()) {
// FIXME: not implemented
}
@@ -204,9 +204,9 @@ void dump()
}
if (dumpPixelsForCurrentTest
- && gLayoutTestController->generatePixelResults()
- && !gLayoutTestController->dumpDOMAsWebArchive()
- && !gLayoutTestController->dumpSourceAsWebArchive()) {
+ && gTestRunner->generatePixelResults()
+ && !gTestRunner->dumpDOMAsWebArchive()
+ && !gTestRunner->dumpSourceAsWebArchive()) {
// FIXME: Add support for dumping pixels
fflush(stdout);
}
@@ -215,7 +215,7 @@ void dump()
fflush(stdout);
fflush(stderr);
- gLayoutTestController.clear();
+ gTestRunner.clear();
}
static void runTest(const wxString inputLine)
@@ -232,8 +232,8 @@ static void runTest(const wxString inputLine)
if (http == string::npos)
pathOrURL.insert(0, "file://");
- gLayoutTestController = LayoutTestController::create(pathOrURL, command.expectedPixelHash);
- if (!gLayoutTestController) {
+ gTestRunner = TestRunner::create(pathOrURL, command.expectedPixelHash);
+ if (!gTestRunner) {
wxTheApp->ExitMainLoop();
}
diff --git a/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
deleted file mode 100644
index fef8f4b09..000000000
--- a/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
+++ /dev/null
@@ -1,640 +0,0 @@
-/*
- * Copyright (C) 2008 Kevin Ollivier <kevino@theolliviers.com>
- *
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY 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 "LayoutTestController.h"
-
-#include "DumpRenderTree.h"
-#include "WorkQueue.h"
-#include "WorkQueueItem.h"
-#include <JavaScriptCore/JSRetainPtr.h>
-#include <JavaScriptCore/JSStringRef.h>
-
-#include <stdio.h>
-
-
-
-LayoutTestController::~LayoutTestController()
-{
- // FIXME: implement
-}
-
-void LayoutTestController::addDisallowedURL(JSStringRef url)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::clearBackForwardList()
-{
-}
-
-JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name)
-{
- // FIXME: implement
- return 0;
-}
-
-JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name)
-{
- // FIXME: implement
- return 0;
-}
-
-void LayoutTestController::dispatchPendingLoadRequests()
-{
- // FIXME: Implement for testing fix for 6727495
-}
-
-void LayoutTestController::display()
-{
-}
-
-void LayoutTestController::keepWebHistory()
-{
- // FIXME: implement
-}
-
-void LayoutTestController::notifyDone()
-{
- if (m_waitToDump && !WorkQueue::shared()->count())
- notifyDoneFired();
- m_waitToDump = false;
-}
-
-JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef url)
-{
- // Function introduced in r28690. This may need special-casing on Windows.
- return JSStringRetain(url); // Do nothing on Unix.
-}
-
-void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target)
-{
- // FIXME: We need to resolve relative URLs here
- WorkQueue::shared()->queue(new LoadItem(url, target));
-}
-
-void LayoutTestController::setAcceptsEditing(bool acceptsEditing)
-{
-}
-
-void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
-{
- // FIXME: Implement this (and restore the default value before running each test in DumpRenderTree.cpp).
-}
-
-void LayoutTestController::setCustomPolicyDelegate(bool, bool)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setMainFrameIsFirstResponder(bool flag)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setUseDashboardCompatibilityMode(bool flag)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setUserStyleSheetEnabled(bool flag)
-{
-}
-
-void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
-{
-}
-
-void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setWindowIsKey(bool windowIsKey)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setSmartInsertDeleteEnabled(bool flag)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setWaitToDump(bool waitUntilDone)
-{
- static const int timeoutSeconds = 10;
-
- m_waitToDump = waitUntilDone;
-}
-
-int LayoutTestController::windowCount()
-{
- // FIXME: implement
- return 1;
-}
-
-void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setXSSAuditorEnabled(bool enabled)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setFrameFlatteningEnabled(bool enabled)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setAutofilled(JSContextRef, JSValueRef element, bool isAutofilled)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setPopupBlockingEnabled(bool popupBlockingEnabled)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setPluginsEnabled(bool flag)
-{
- // FIXME: Implement
-}
-
-bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id)
-{
- // FIXME: implement
- return false;
-}
-
-void LayoutTestController::execCommand(JSStringRef name, JSStringRef value)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::clearPersistentUserStyleSheet()
-{
- // FIXME: implement
-}
-
-void LayoutTestController::clearAllApplicationCaches()
-{
- // FIXME: Implement to support application cache quotas.
-}
-
-void LayoutTestController::clearApplicationCacheForOrigin(JSStringRef url)
-{
- // FIXME: Implement to support deleting all application cache for an origin.
-}
-
-long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef originIdentifier)
-{
- // FIXME: Implement to support getting disk usage in bytes for an origin.
- return 0;
-}
-
-void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota)
-{
- // FIXME: Implement to support application cache quotas.
-}
-
-long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef origin)
-{
- // FIXME: Implement to support getting disk usage by all application caches for an origin.
- return 0;
-}
-
-
-JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context)
-{
- // FIXME: Implement to get origins that have application caches.
- return 0;
-}
-
-void LayoutTestController::clearAllDatabases()
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setDatabaseQuota(unsigned long long quota)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::goBack()
-{
- // FIXME: implement to enable loader/navigation-while-deferring-loads.html
-}
-
-void LayoutTestController::setDefersLoading(bool)
-{
- // FIXME: implement to enable loader/navigation-while-deferring-loads.html
-}
-
-void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool, JSStringRef)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setAppCacheMaximumSize(unsigned long long size)
-{
- // FIXME: implement
-}
-
-unsigned LayoutTestController::numberOfActiveAnimations() const
-{
- // FIXME: implement
- return 0;
-}
-
-unsigned LayoutTestController::workerThreadCount() const
-{
- // FIXME: implement
- return 0;
-}
-
-void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag)
-{
- // FIXME: implement
-}
-
-bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
-{
- // FIXME: implement
- return false;
-}
-
-void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
-{
- // FIXME: Implement for DeviceOrientation layout tests.
- // See https://bugs.webkit.org/show_bug.cgi?id=30335.
-}
-
-void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
-{
- // FIXME: Implement for Geolocation layout tests.
- // See https://bugs.webkit.org/show_bug.cgi?id=28264.
-}
-
-void LayoutTestController::setMockGeolocationError(int code, JSStringRef message)
-{
- // FIXME: Implement for Geolocation layout tests.
- // See https://bugs.webkit.org/show_bug.cgi?id=28264.
-}
-
-void LayoutTestController::setGeolocationPermission(bool allow)
-{
- // FIXME: Implement for Geolocation layout tests.
- setGeolocationPermissionCommon(allow);
-}
-
-int LayoutTestController::numberOfPendingGeolocationPermissionRequests()
-{
- // FIXME: Implement for Geolocation layout tests.
- return -1;
-}
-
-void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
-{
- // FIXME: Implement for speech input layout tests.
- // See https://bugs.webkit.org/show_bug.cgi?id=39485.
-}
-
-void LayoutTestController::setMockSpeechInputDumpRect(bool flag)
-{
- // FIXME: Implement for speech input layout tests.
- // See https://bugs.webkit.org/show_bug.cgi?id=39485.
-}
-
-void LayoutTestController::startSpeechInput(JSContextRef inputElement)
-{
- // FIXME: Implement for speech input layout tests.
- // See https://bugs.webkit.org/show_bug.cgi?id=39485.
-}
-
-void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
-{
- // FIXME: implement
-}
-
-bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
-{
- // FIXME: implement
- return false;
-}
-
-void LayoutTestController::setCacheModel(int)
-{
- // FIXME: implement
-}
-
-bool LayoutTestController::isCommandEnabled(JSStringRef /*name*/)
-{
- // FIXME: implement
- return false;
-}
-
-size_t LayoutTestController::webHistoryItemCount()
-{
- // FIXME: implement
- return 0;
-}
-
-void LayoutTestController::waitForPolicyDelegate()
-{
- // FIXME: Implement this.
-}
-
-void LayoutTestController::overridePreference(JSStringRef /* key */, JSStringRef /* value */)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
-{
- printf("LayoutTestController::addUserScript not implemented.\n");
-}
-
-void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
-{
- printf("LayoutTestController::addUserStyleSheet not implemented.\n");
-}
-
-void LayoutTestController::showWebInspector()
-{
- // FIXME: Implement this.
-}
-
-void LayoutTestController::closeWebInspector()
-{
- // FIXME: Implement this.
-}
-
-void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script)
-{
- // FIXME: Implement this.
-}
-
-void LayoutTestController::removeAllVisitedLinks()
-{
- // FIXME: Implement this.
-}
-
-void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
-{
-
-}
-
-void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
-{
-
-}
-
-void LayoutTestController::disableImageLoading()
-{
-
-}
-
-void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
-{
- // FIXME: implement
-}
-
-void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
-{
- // FIXME: implement
-}
-
-int LayoutTestController::numberOfPages(float, float)
-{
- // FIXME: implement
- return -1;
-}
-
-void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
-{
-
-}
-
-void LayoutTestController::apiTestGoToCurrentBackForwardItem()
-{
-
-}
-
-void LayoutTestController::setSpatialNavigationEnabled(bool)
-{
-
-}
-
-void LayoutTestController::setWebViewEditable(bool)
-{
-}
-
-bool LayoutTestController::callShouldCloseOnWebView()
-{
- return false;
-}
-
-JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
-{
- return 0;
-}
-
-JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
-{
- return 0;
-}
-
-JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef)
-{
- return 0;
-}
-
-void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
-{
-}
-
-void LayoutTestController::abortModal()
-{
-}
-
-JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const
-{
- // FIXME: Implement
- return 0;
-}
-
-JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
-{
- // FIXME: Implement
- return 0;
-}
-
-void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool)
-{
- // FIXME: Implement this.
-}
-
-bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray)
-{
- // FIXME: Implement
- return false;
-}
-
-void LayoutTestController::setSerializeHTTPLoads(bool)
-{
- // FIXME: Implement.
-}
-
-void LayoutTestController::setMinimumTimerInterval(double interval) {
-
-}
-
-void LayoutTestController::syncLocalStorage()
-{
- // FIXME: Implement.
-}
-
-void LayoutTestController::observeStorageTrackerNotifications(unsigned number)
-{
- // FIXME: Implement.
-}
-
-void LayoutTestController::deleteAllLocalStorage()
-{
- // FIXME: Implement.
-}
-
-JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context)
-{
- // FIXME: Implement.
- return 0;
-}
-
-void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef URL)
-{
- // FIXME: Implement.
-}
-
-void LayoutTestController::setTextDirection(JSStringRef direction)
-{
- // FIXME: Implement.
-}
-
-void LayoutTestController::addChromeInputField()
-{
-}
-
-void LayoutTestController::removeChromeInputField()
-{
-}
-
-void LayoutTestController::focusWebView()
-{
-}
-
-void LayoutTestController::setBackingScaleFactor(double)
-{
-}
-
-void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title)
-{
- // FIXME: Implement.
-}
-
-void LayoutTestController::resetPageVisibility()
-{
- // FIXME: Implement this.
-}
-
-void LayoutTestController::setPageVisibility(const char*)
-{
- // FIXME: Implement this.
-}
-
-void LayoutTestController::setAutomaticLinkDetectionEnabled(bool)
-{
- // FIXME: Implement this.
-}
-
-void LayoutTestController::sendWebIntentResponse(JSStringRef)
-{
- // FIXME: Implement this.
-}
-
-void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)
-{
- // FIXME: Implement this.
-}
-
-void LayoutTestController::setStorageDatabaseIdleInterval(double)
-{
- // FIXME: Implement this.
-}
diff --git a/Tools/DumpRenderTree/wx/TestRunnerWx.cpp b/Tools/DumpRenderTree/wx/TestRunnerWx.cpp
new file mode 100644
index 000000000..ee09cb0cc
--- /dev/null
+++ b/Tools/DumpRenderTree/wx/TestRunnerWx.cpp
@@ -0,0 +1,641 @@
+/*
+ * Copyright (C) 2008 Kevin Ollivier <kevino@theolliviers.com>
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY 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 "TestRunner.h"
+
+#include "DumpRenderTree.h"
+#include "WorkQueue.h"
+#include "WorkQueueItem.h"
+#include <JavaScriptCore/JSRetainPtr.h>
+#include <JavaScriptCore/JSStringRef.h>
+
+#include <stdio.h>
+
+
+
+TestRunner::~TestRunner()
+{
+ // FIXME: implement
+}
+
+void TestRunner::addDisallowedURL(JSStringRef url)
+{
+ // FIXME: implement
+}
+
+void TestRunner::clearBackForwardList()
+{
+}
+
+JSStringRef TestRunner::copyDecodedHostName(JSStringRef name)
+{
+ // FIXME: implement
+ return 0;
+}
+
+JSStringRef TestRunner::copyEncodedHostName(JSStringRef name)
+{
+ // FIXME: implement
+ return 0;
+}
+
+void TestRunner::dispatchPendingLoadRequests()
+{
+ // FIXME: Implement for testing fix for 6727495
+}
+
+void TestRunner::display()
+{
+}
+
+void TestRunner::keepWebHistory()
+{
+ // FIXME: implement
+}
+
+void TestRunner::notifyDone()
+{
+ if (m_waitToDump && !WorkQueue::shared()->count())
+ notifyDoneFired();
+ m_waitToDump = false;
+}
+
+JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef url)
+{
+ // Function introduced in r28690. This may need special-casing on Windows.
+ return JSStringRetain(url); // Do nothing on Unix.
+}
+
+void TestRunner::queueLoad(JSStringRef url, JSStringRef target)
+{
+ // FIXME: We need to resolve relative URLs here
+ WorkQueue::shared()->queue(new LoadItem(url, target));
+}
+
+void TestRunner::setAcceptsEditing(bool acceptsEditing)
+{
+}
+
+void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
+{
+ // FIXME: Implement this (and restore the default value before running each test in DumpRenderTree.cpp).
+}
+
+void TestRunner::setCustomPolicyDelegate(bool, bool)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setMainFrameIsFirstResponder(bool flag)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setTabKeyCyclesThroughElements(bool cycles)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setUseDashboardCompatibilityMode(bool flag)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setUserStyleSheetEnabled(bool flag)
+{
+}
+
+void TestRunner::setUserStyleSheetLocation(JSStringRef path)
+{
+}
+
+void TestRunner::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setViewModeMediaFeature(JSStringRef mode)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setWindowIsKey(bool windowIsKey)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setSmartInsertDeleteEnabled(bool flag)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setWaitToDump(bool waitUntilDone)
+{
+ static const int timeoutSeconds = 10;
+
+ m_waitToDump = waitUntilDone;
+}
+
+int TestRunner::windowCount()
+{
+ // FIXME: implement
+ return 1;
+}
+
+void TestRunner::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setJavaScriptCanAccessClipboard(bool enabled)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setXSSAuditorEnabled(bool enabled)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setFrameFlatteningEnabled(bool enabled)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setAllowFileAccessFromFileURLs(bool enabled)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setAuthorAndUserStylesEnabled(bool flag)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setAutofilled(JSContextRef, JSValueRef element, bool isAutofilled)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setPopupBlockingEnabled(bool popupBlockingEnabled)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setPluginsEnabled(bool flag)
+{
+ // FIXME: Implement
+}
+
+bool TestRunner::elementDoesAutoCompleteForElementWithId(JSStringRef id)
+{
+ // FIXME: implement
+ return false;
+}
+
+void TestRunner::execCommand(JSStringRef name, JSStringRef value)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef jsURL)
+{
+ // FIXME: implement
+}
+
+void TestRunner::clearPersistentUserStyleSheet()
+{
+ // FIXME: implement
+}
+
+void TestRunner::clearAllApplicationCaches()
+{
+ // FIXME: Implement to support application cache quotas.
+}
+
+void TestRunner::clearApplicationCacheForOrigin(JSStringRef url)
+{
+ // FIXME: Implement to support deleting all application cache for an origin.
+}
+
+long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef originIdentifier)
+{
+ // FIXME: Implement to support getting disk usage in bytes for an origin.
+ return 0;
+}
+
+void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota)
+{
+ // FIXME: Implement to support application cache quotas.
+}
+
+long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef origin)
+{
+ // FIXME: Implement to support getting disk usage by all application caches for an origin.
+ return 0;
+}
+
+
+JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context)
+{
+ // FIXME: Implement to get origins that have application caches.
+ return 0;
+}
+
+void TestRunner::clearAllDatabases()
+{
+ // FIXME: implement
+}
+
+void TestRunner::setDatabaseQuota(unsigned long long quota)
+{
+ // FIXME: implement
+}
+
+void TestRunner::goBack()
+{
+ // FIXME: implement to enable loader/navigation-while-deferring-loads.html
+}
+
+void TestRunner::setDefersLoading(bool)
+{
+ // FIXME: implement to enable loader/navigation-while-deferring-loads.html
+}
+
+void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool, JSStringRef)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setAppCacheMaximumSize(unsigned long long size)
+{
+ // FIXME: implement
+}
+
+unsigned TestRunner::numberOfActiveAnimations() const
+{
+ // FIXME: implement
+ return 0;
+}
+
+unsigned TestRunner::workerThreadCount() const
+{
+ // FIXME: implement
+ return 0;
+}
+
+void TestRunner::setSelectTrailingWhitespaceEnabled(bool flag)
+{
+ // FIXME: implement
+}
+
+bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
+{
+ // FIXME: implement
+ return false;
+}
+
+void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+{
+ // FIXME: Implement for DeviceOrientation layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=30335.
+}
+
+void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
+{
+ // FIXME: Implement for Geolocation layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=28264.
+}
+
+void TestRunner::setMockGeolocationError(int code, JSStringRef message)
+{
+ // FIXME: Implement for Geolocation layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=28264.
+}
+
+void TestRunner::setGeolocationPermission(bool allow)
+{
+ // FIXME: Implement for Geolocation layout tests.
+ setGeolocationPermissionCommon(allow);
+}
+
+int TestRunner::numberOfPendingGeolocationPermissionRequests()
+{
+ // FIXME: Implement for Geolocation layout tests.
+ return -1;
+}
+
+void TestRunner::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
+{
+ // FIXME: Implement for speech input layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=39485.
+}
+
+void TestRunner::setMockSpeechInputDumpRect(bool flag)
+{
+ // FIXME: Implement for speech input layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=39485.
+}
+
+void TestRunner::startSpeechInput(JSContextRef inputElement)
+{
+ // FIXME: Implement for speech input layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=39485.
+}
+
+void TestRunner::setIconDatabaseEnabled(bool iconDatabaseEnabled)
+{
+ // FIXME: implement
+}
+
+bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
+{
+ // FIXME: implement
+ return false;
+}
+
+void TestRunner::setCacheModel(int)
+{
+ // FIXME: implement
+}
+
+bool TestRunner::isCommandEnabled(JSStringRef /*name*/)
+{
+ // FIXME: implement
+ return false;
+}
+
+size_t TestRunner::webHistoryItemCount()
+{
+ // FIXME: implement
+ return 0;
+}
+
+void TestRunner::waitForPolicyDelegate()
+{
+ // FIXME: Implement this.
+}
+
+void TestRunner::overridePreference(JSStringRef /* key */, JSStringRef /* value */)
+{
+ // FIXME: implement
+}
+
+void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
+{
+ printf("TestRunner::addUserScript not implemented.\n");
+}
+
+void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames)
+{
+ printf("TestRunner::addUserStyleSheet not implemented.\n");
+}
+
+void TestRunner::showWebInspector()
+{
+ // FIXME: Implement this.
+}
+
+void TestRunner::closeWebInspector()
+{
+ // FIXME: Implement this.
+}
+
+void TestRunner::evaluateInWebInspector(long callId, JSStringRef script)
+{
+ // FIXME: Implement this.
+}
+
+void TestRunner::removeAllVisitedLinks()
+{
+ // FIXME: Implement this.
+}
+
+void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
+{
+
+}
+
+void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
+{
+
+}
+
+void TestRunner::disableImageLoading()
+{
+
+}
+
+void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+{
+ // FIXME: implement
+}
+
+void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+{
+ // FIXME: implement
+}
+
+void TestRunner::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
+{
+ // FIXME: implement
+}
+
+int TestRunner::numberOfPages(float, float)
+{
+ // FIXME: implement
+ return -1;
+}
+
+void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
+{
+
+}
+
+void TestRunner::apiTestGoToCurrentBackForwardItem()
+{
+
+}
+
+void TestRunner::setSpatialNavigationEnabled(bool)
+{
+
+}
+
+void TestRunner::setWebViewEditable(bool)
+{
+}
+
+bool TestRunner::callShouldCloseOnWebView()
+{
+ return false;
+}
+
+JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const
+{
+ return 0;
+}
+
+JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
+{
+ return 0;
+}
+
+JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef)
+{
+ return 0;
+}
+
+void TestRunner::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
+{
+}
+
+void TestRunner::abortModal()
+{
+}
+
+JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const
+{
+ // FIXME: Implement
+ return 0;
+}
+
+JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
+{
+ // FIXME: Implement
+ return 0;
+}
+
+void TestRunner::setAsynchronousSpellCheckingEnabled(bool)
+{
+ // FIXME: Implement this.
+}
+
+bool TestRunner::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray)
+{
+ // FIXME: Implement
+ return false;
+}
+
+void TestRunner::setSerializeHTTPLoads(bool)
+{
+ // FIXME: Implement.
+}
+
+void TestRunner::setMinimumTimerInterval(double interval)
+{
+
+}
+
+void TestRunner::syncLocalStorage()
+{
+ // FIXME: Implement.
+}
+
+void TestRunner::observeStorageTrackerNotifications(unsigned number)
+{
+ // FIXME: Implement.
+}
+
+void TestRunner::deleteAllLocalStorage()
+{
+ // FIXME: Implement.
+}
+
+JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context)
+{
+ // FIXME: Implement.
+ return 0;
+}
+
+void TestRunner::deleteLocalStorageForOrigin(JSStringRef URL)
+{
+ // FIXME: Implement.
+}
+
+void TestRunner::setTextDirection(JSStringRef direction)
+{
+ // FIXME: Implement.
+}
+
+void TestRunner::addChromeInputField()
+{
+}
+
+void TestRunner::removeChromeInputField()
+{
+}
+
+void TestRunner::focusWebView()
+{
+}
+
+void TestRunner::setBackingScaleFactor(double)
+{
+}
+
+void TestRunner::simulateDesktopNotificationClick(JSStringRef title)
+{
+ // FIXME: Implement.
+}
+
+void TestRunner::resetPageVisibility()
+{
+ // FIXME: Implement this.
+}
+
+void TestRunner::setPageVisibility(const char*)
+{
+ // FIXME: Implement this.
+}
+
+void TestRunner::setAutomaticLinkDetectionEnabled(bool)
+{
+ // FIXME: Implement this.
+}
+
+void TestRunner::sendWebIntentResponse(JSStringRef)
+{
+ // FIXME: Implement this.
+}
+
+void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)
+{
+ // FIXME: Implement this.
+}
+
+void TestRunner::setStorageDatabaseIdleInterval(double)
+{
+ // FIXME: Implement this.
+}
diff --git a/Tools/EWebLauncher/CMakeLists.txt b/Tools/EWebLauncher/CMakeLists.txt
index f2c263f33..3c489a4fd 100644
--- a/Tools/EWebLauncher/CMakeLists.txt
+++ b/Tools/EWebLauncher/CMakeLists.txt
@@ -14,8 +14,8 @@ SET(EWebLauncher_LIBRARIES
${LIBXML2_LIBRARIES}
${LIBXSLT_LIBRARIES}
${SQLITE_LIBRARIES}
- ${Glib_LIBRARIES}
- ${LIBSOUP24_LIBRARIES}
+ ${GLIB_LIBRARIES}
+ ${LIBSOUP_LIBRARIES}
)
SET(EWebLauncher_INCLUDE_DIRECTORIES
@@ -24,8 +24,8 @@ SET(EWebLauncher_INCLUDE_DIRECTORIES
${EDJE_INCLUDE_DIRS}
${EFLDEPS_INCLUDE_DIRS}
${EVAS_INCLUDE_DIRS}
- ${Glib_INCLUDE_DIRS}
- ${LIBSOUP24_INCLUDE_DIRS}
+ ${GLIB_INCLUDE_DIRS}
+ ${LIBSOUP_INCLUDE_DIRS}
)
SET(EWebLauncher_LINK_FLAGS
@@ -33,7 +33,6 @@ SET(EWebLauncher_LINK_FLAGS
${EDJE_LDFLAGS}
${EFLDEPS_LDFLAGS}
${EVAS_LDFLAGS}
- ${LIBSOUP24_LDFLAGS}
)
ADD_DEFINITIONS(-DDATA_DIR=\"${THEME_BINARY_DIR}\")
diff --git a/Tools/GNUmakefile.am b/Tools/GNUmakefile.am
index c1933565c..72ca88d7a 100644
--- a/Tools/GNUmakefile.am
+++ b/Tools/GNUmakefile.am
@@ -43,7 +43,7 @@ noinst_LTLIBRARIES += libWebCoreInternals.la
libWebCoreInternals_la_SOURCES = \
Source/WebCore/bindings/js/JSDOMWrapper.cpp \
Source/WebCore/bindings/js/JSDOMWrapper.h \
- Source/WebCore/testing/FastMallocStatistics.h \
+ Source/WebCore/testing/MallocStatistics.h \
Source/WebCore/testing/Internals.cpp \
Source/WebCore/testing/Internals.h \
Source/WebCore/testing/InternalSettings.cpp \
@@ -54,8 +54,8 @@ libWebCoreInternals_la_SOURCES = \
Source/WebCore/testing/js/WebCoreTestSupport.h
libwebcoreinternals_built_sources += \
- DerivedSources/WebCore/JSFastMallocStatistics.cpp \
- DerivedSources/WebCore/JSFastMallocStatistics.h \
+ DerivedSources/WebCore/JSMallocStatistics.cpp \
+ DerivedSources/WebCore/JSMallocStatistics.h \
DerivedSources/WebCore/JSInternals.cpp \
DerivedSources/WebCore/JSInternals.h \
DerivedSources/WebCore/JSInternalSettings.cpp \
@@ -119,8 +119,8 @@ Programs_DumpRenderTree_SOURCES = \
Tools/DumpRenderTree/GCController.cpp \
Tools/DumpRenderTree/GCController.h \
Tools/DumpRenderTree/JavaScriptThreading.h \
- Tools/DumpRenderTree/LayoutTestController.cpp \
- Tools/DumpRenderTree/LayoutTestController.h \
+ Tools/DumpRenderTree/TestRunner.cpp \
+ Tools/DumpRenderTree/TestRunner.h \
Tools/DumpRenderTree/PixelDumpSupport.cpp \
Tools/DumpRenderTree/PixelDumpSupport.h \
Tools/DumpRenderTree/WorkQueue.cpp \
@@ -140,7 +140,7 @@ Programs_DumpRenderTree_SOURCES = \
Tools/DumpRenderTree/gtk/EventSender.h \
Tools/DumpRenderTree/gtk/EventSender.cpp \
Tools/DumpRenderTree/gtk/GCControllerGtk.cpp \
- Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp \
+ Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp \
Tools/DumpRenderTree/gtk/PixelDumpSupportGtk.cpp \
Tools/DumpRenderTree/gtk/SelfScrollingWebKitWebView.cpp \
Tools/DumpRenderTree/gtk/SelfScrollingWebKitWebView.h \
diff --git a/Tools/MIDLWrapper/MIDLWrapper.vcproj b/Tools/MIDLWrapper/MIDLWrapper.vcproj
index d9ab9f93f..598f9ec68 100644
--- a/Tools/MIDLWrapper/MIDLWrapper.vcproj
+++ b/Tools/MIDLWrapper/MIDLWrapper.vcproj
@@ -60,6 +60,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
OutputFile="$(OutDir)\midl.exe"
LinkIncremental="2"
GenerateDebugInformation="true"
@@ -134,6 +135,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/SAFESEH"
OutputFile="$(OutDir)\midl.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
diff --git a/Tools/MiniBrowser/efl/CMakeLists.txt b/Tools/MiniBrowser/efl/CMakeLists.txt
index ae359a668..753c4495a 100644
--- a/Tools/MiniBrowser/efl/CMakeLists.txt
+++ b/Tools/MiniBrowser/efl/CMakeLists.txt
@@ -25,7 +25,7 @@ SET(MiniBrowser_LIBRARIES
${EFLDEPS_LIBRARIES}
${EVAS_LIBRARIES}
${FONTCONFIG_LIBRARIES}
- ${LIBSOUP24_LIBRARIES}
+ ${LIBSOUP_LIBRARIES}
${LIBXML2_LIBRARIES}
${LIBXSLT_LIBRARIES}
${OPENGL_LIBRARIES}
@@ -37,13 +37,12 @@ SET(MiniBrowser_LINK_FLAGS
${EDJE_LDFLAGS}
${EFLDEPS_LDFLAGS}
${EVAS_LDFLAGS}
- ${LIBSOUP24_LDFLAGS}
)
IF (ENABLE_GLIB_SUPPORT)
LIST(APPEND MiniBrowser_LIBRARIES
- ${Glib_LIBRARIES}
- ${Gthread_LIBRARIES}
+ ${GLIB_LIBRARIES}
+ ${GLIB_GTHREAD_LIBRARIES}
)
ENDIF ()
diff --git a/Tools/MiniBrowser/mac/AppDelegate.m b/Tools/MiniBrowser/mac/AppDelegate.m
index a620c798e..285736175 100644
--- a/Tools/MiniBrowser/mac/AppDelegate.m
+++ b/Tools/MiniBrowser/mac/AppDelegate.m
@@ -35,17 +35,17 @@ static NSString *defaultURL = @"http://www.webkit.org/";
@implementation BrowserAppDelegate
-void didRecieveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo)
+void didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo)
{
CFStringRef cfMessageName = WKStringCopyCFString(0, messageName);
WKTypeID typeID = WKGetTypeID(messageBody);
if (typeID == WKStringGetTypeID()) {
CFStringRef cfMessageBody = WKStringCopyCFString(0, (WKStringRef)messageBody);
- LOG(@"ContextInjectedBundleClient - didRecieveMessage - MessageName: %@ MessageBody %@", cfMessageName, cfMessageBody);
+ LOG(@"ContextInjectedBundleClient - didReceiveMessage - MessageName: %@ MessageBody %@", cfMessageName, cfMessageBody);
CFRelease(cfMessageBody);
} else {
- LOG(@"ContextInjectedBundleClient - didRecieveMessage - MessageName: %@ (MessageBody Unhandeled)\n", cfMessageName);
+ LOG(@"ContextInjectedBundleClient - didReceiveMessage - MessageName: %@ (MessageBody Unhandled)\n", cfMessageName);
}
CFRelease(cfMessageName);
@@ -130,7 +130,7 @@ static void populateVisitedLinks(WKContextRef context, const void *clientInfo)
WKContextInjectedBundleClient bundleClient = {
kWKContextInjectedBundleClientCurrentVersion,
0, /* clientInfo */
- didRecieveMessageFromInjectedBundle,
+ didReceiveMessageFromInjectedBundle,
0, /* didReceiveSynchronousMessageFromInjectedBundle */
0 /* getInjectedBundleInitializationUserData */
};
diff --git a/Tools/MiniBrowser/mac/WebBundle/WebBundleMain.m b/Tools/MiniBrowser/mac/WebBundle/WebBundleMain.m
index 509038a9c..46a8c1cbf 100644
--- a/Tools/MiniBrowser/mac/WebBundle/WebBundleMain.m
+++ b/Tools/MiniBrowser/mac/WebBundle/WebBundleMain.m
@@ -73,17 +73,17 @@ void willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clien
LOG(@"WKBundleClient - willDestroyPage\n");
}
-void didRecieveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo)
+void didReceiveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo)
{
CFStringRef cfMessageName = WKStringCopyCFString(0, messageName);
WKTypeID typeID = WKGetTypeID(messageBody);
if (typeID == WKStringGetTypeID()) {
CFStringRef cfMessageBody = WKStringCopyCFString(0, (WKStringRef)messageBody);
- LOG(@"WKBundleClient - didRecieveMessage - MessageName: %@ MessageBody %@", cfMessageName, cfMessageBody);
+ LOG(@"WKBundleClient - didReceiveMessage - MessageName: %@ MessageBody %@", cfMessageName, cfMessageBody);
CFRelease(cfMessageBody);
} else {
- LOG(@"WKBundleClient - didRecieveMessage - MessageName: %@ (MessageBody Unhandeled)\n", cfMessageName);
+ LOG(@"WKBundleClient - didReceiveMessage - MessageName: %@ (MessageBody Unhandled)\n", cfMessageName);
}
CFRelease(cfMessageName);
@@ -99,7 +99,7 @@ void WKBundleInitialize(WKBundleRef bundle, WKTypeRef initializationUserData)
didCreatePage,
willDestroyPage,
0, // didInitializePageGroup
- didRecieveMessage
+ didReceiveMessage
};
WKBundleSetClient(bundle, &client);
}
diff --git a/Tools/MiniBrowser/qt/BrowserWindow.h b/Tools/MiniBrowser/qt/BrowserWindow.h
index 1e7f7f52d..0f30e2c99 100644
--- a/Tools/MiniBrowser/qt/BrowserWindow.h
+++ b/Tools/MiniBrowser/qt/BrowserWindow.h
@@ -50,13 +50,13 @@ public:
void updateVisualMockTouchPoints(const QList<QTouchEvent::TouchPoint>& touchPoints);
-public slots:
+public Q_SLOTS:
BrowserWindow* newWindow(const QString& url = "about:blank");
-protected slots:
+protected Q_SLOTS:
void screenshot();
-private slots:
+private Q_SLOTS:
void onTitleChanged(QString);
private:
diff --git a/Tools/MiniBrowser/qt/MiniBrowserApplication.h b/Tools/MiniBrowser/qt/MiniBrowserApplication.h
index aa6ecdef3..3dc380aec 100644
--- a/Tools/MiniBrowser/qt/MiniBrowserApplication.h
+++ b/Tools/MiniBrowser/qt/MiniBrowserApplication.h
@@ -75,7 +75,7 @@ public:
}
}
-signals:
+Q_SIGNALS:
void touchMockingEnabledChanged();
private:
diff --git a/Tools/MiniBrowser/qt/UrlLoader.h b/Tools/MiniBrowser/qt/UrlLoader.h
index 01e67c3bd..8ac58dfdd 100644
--- a/Tools/MiniBrowser/qt/UrlLoader.h
+++ b/Tools/MiniBrowser/qt/UrlLoader.h
@@ -41,15 +41,15 @@ class UrlLoader : public QObject {
public:
UrlLoader(BrowserWindow*, const QString&, int, int);
-public slots:
+public Q_SLOTS:
void loadNext();
-private slots:
+private Q_SLOTS:
void checkIfFinished();
void frameLoadStarted();
void frameLoadFinished();
-signals:
+Q_SIGNALS:
void pageLoadFinished();
private:
diff --git a/Tools/QtTestBrowser/QtTestBrowser.pro b/Tools/QtTestBrowser/QtTestBrowser.pro
index 5c123f90f..4d64af9e8 100644
--- a/Tools/QtTestBrowser/QtTestBrowser.pro
+++ b/Tools/QtTestBrowser/QtTestBrowser.pro
@@ -42,7 +42,8 @@ WEBKIT += wtf webcore
DESTDIR = $$ROOT_BUILD_DIR/bin
-QT += network webkit printsupport widgets
+QT += network webkit widgets
+contains(DEFINES, HAVE_QTPRINTSUPPORT=1): QT += printsupport
macx:QT += xml
diff --git a/Tools/QtTestBrowser/cookiejar.h b/Tools/QtTestBrowser/cookiejar.h
index 6e5e73b93..da62fb829 100644
--- a/Tools/QtTestBrowser/cookiejar.h
+++ b/Tools/QtTestBrowser/cookiejar.h
@@ -44,12 +44,12 @@ public:
void setDiskStorageEnabled(bool);
-public slots:
+public Q_SLOTS:
void scheduleSaveToDisk();
void loadFromDisk();
void reset();
-private slots:
+private Q_SLOTS:
void saveToDisk();
private:
diff --git a/Tools/QtTestBrowser/fpstimer.h b/Tools/QtTestBrowser/fpstimer.h
index eed1198af..256745aa8 100644
--- a/Tools/QtTestBrowser/fpstimer.h
+++ b/Tools/QtTestBrowser/fpstimer.h
@@ -43,7 +43,7 @@ public Q_SLOTS:
void start();
void stop();
-protected slots:
+protected Q_SLOTS:
virtual void timerEvent(QTimerEvent*);
private:
diff --git a/Tools/QtTestBrowser/launcherwindow.cpp b/Tools/QtTestBrowser/launcherwindow.cpp
index 4fc90d702..caa79c994 100644
--- a/Tools/QtTestBrowser/launcherwindow.cpp
+++ b/Tools/QtTestBrowser/launcherwindow.cpp
@@ -51,6 +51,9 @@
#ifndef QT_NO_SHORTCUT
#include <QMenuBar>
#endif
+#if !defined(QT_NO_PRINTER) && HAVE(QTPRINTSUPPORT)
+#include <QPrintPreviewDialog>
+#endif
#include <QSlider>
#include <QSplitter>
#include <QStatusBar>
@@ -237,7 +240,7 @@ void LauncherWindow::createChrome()
fileMenu->addAction("Close Window", this, SLOT(close()), QKeySequence::Close);
fileMenu->addSeparator();
fileMenu->addAction("Take Screen Shot...", this, SLOT(screenshot()));
-#ifndef QT_NO_PRINTER
+#if !defined(QT_NO_PRINTER) && HAVE(QTPRINTSUPPORT)
fileMenu->addAction(tr("Print..."), this, SLOT(print()), QKeySequence::Print);
#endif
fileMenu->addSeparator();
@@ -724,7 +727,7 @@ void LauncherWindow::toggleZoomTextOnly(bool b)
void LauncherWindow::print()
{
-#if !defined(QT_NO_PRINTER)
+#if !defined(QT_NO_PRINTER) && HAVE(QTPRINTSUPPORT)
QPrintPreviewDialog dlg(this);
connect(&dlg, SIGNAL(paintRequested(QPrinter*)),
page()->mainFrame(), SLOT(print(QPrinter*)));
diff --git a/Tools/QtTestBrowser/launcherwindow.h b/Tools/QtTestBrowser/launcherwindow.h
index 348bf127d..69ebe65d2 100644
--- a/Tools/QtTestBrowser/launcherwindow.h
+++ b/Tools/QtTestBrowser/launcherwindow.h
@@ -39,10 +39,6 @@
#include <QtOpenGL/QGLWidget>
#endif
-#if !defined(QT_NO_PRINTER)
-#include <QPrintPreviewDialog>
-#endif
-
#include <QDebug>
#include <cstdio>
@@ -125,7 +121,7 @@ public:
bool eventFilter(QObject* obj, QEvent* event);
-protected slots:
+protected Q_SLOTS:
void loadStarted();
void loadFinished();
@@ -188,12 +184,12 @@ protected slots:
void fileDownloadFinished();
#endif
-public slots:
+public Q_SLOTS:
LauncherWindow* newWindow();
LauncherWindow* cloneWindow();
void updateFPS(int fps);
-signals:
+Q_SIGNALS:
void enteredFullScreenMode(bool on);
private:
diff --git a/Tools/QtTestBrowser/locationedit.h b/Tools/QtTestBrowser/locationedit.h
index 54d8a6835..dae069d7b 100644
--- a/Tools/QtTestBrowser/locationedit.h
+++ b/Tools/QtTestBrowser/locationedit.h
@@ -44,10 +44,10 @@ public:
void setPageIcon(const QIcon&);
-public slots:
+public Q_SLOTS:
void setProgress(int progress);
-private slots:
+private Q_SLOTS:
void reset();
protected:
diff --git a/Tools/QtTestBrowser/mainwindow.h b/Tools/QtTestBrowser/mainwindow.h
index a6a1bd29d..203695247 100644
--- a/Tools/QtTestBrowser/mainwindow.h
+++ b/Tools/QtTestBrowser/mainwindow.h
@@ -55,7 +55,7 @@ public:
WebPage* page() const;
void setPage(WebPage*);
-protected slots:
+protected Q_SLOTS:
void setAddressUrl(const QString& url);
void setAddressUrl(const QUrl& url);
void openFile();
diff --git a/Tools/QtTestBrowser/urlloader.h b/Tools/QtTestBrowser/urlloader.h
index 8ce24c0d0..84254090f 100644
--- a/Tools/QtTestBrowser/urlloader.h
+++ b/Tools/QtTestBrowser/urlloader.h
@@ -41,15 +41,15 @@ class UrlLoader : public QObject {
public:
UrlLoader(QWebFrame* frame, const QString& inputFileName, int timeoutSeconds, int extraTimeSeconds);
-public slots:
+public Q_SLOTS:
void loadNext();
-private slots:
+private Q_SLOTS:
void checkIfFinished();
void frameLoadStarted();
void frameLoadFinished();
-signals:
+Q_SIGNALS:
void pageLoadFinished();
private:
diff --git a/Tools/QtTestBrowser/webinspector.h b/Tools/QtTestBrowser/webinspector.h
index c24ecbf9c..c75bbdc2f 100644
--- a/Tools/QtTestBrowser/webinspector.h
+++ b/Tools/QtTestBrowser/webinspector.h
@@ -36,7 +36,7 @@ class WebInspector : public QWebInspector {
public:
WebInspector(QWidget* parent = 0) : QWebInspector(parent) {}
-signals:
+Q_SIGNALS:
void visibleChanged(bool nowVisible);
protected:
diff --git a/Tools/QtTestBrowser/webpage.h b/Tools/QtTestBrowser/webpage.h
index 01f3f6a86..9f98212d0 100644
--- a/Tools/QtTestBrowser/webpage.h
+++ b/Tools/QtTestBrowser/webpage.h
@@ -52,7 +52,7 @@ public:
QString userAgentForUrl(const QUrl& url) const;
void setInterruptingJavaScriptEnabled(bool enabled) { m_interruptingJavaScriptEnabled = enabled; }
-public slots:
+public Q_SLOTS:
void openUrlInDefaultBrowser(const QUrl& url = QUrl());
void setUserAgent(const QString& ua) { m_userAgent = ua; }
bool shouldInterruptJavaScript();
diff --git a/Tools/QtTestBrowser/webview.h b/Tools/QtTestBrowser/webview.h
index b50b764e6..56a61688a 100644
--- a/Tools/QtTestBrowser/webview.h
+++ b/Tools/QtTestBrowser/webview.h
@@ -94,14 +94,14 @@ public:
GraphicsWebView* graphicsWebView() const { return m_item; }
-public slots:
+public Q_SLOTS:
void updateFrameRate();
void animatedFlip();
void animatedYFlip();
void contentsSizeChanged(const QSize&);
void scrollRequested(int, int);
-signals:
+Q_SIGNALS:
void currentFPSUpdated(int fps);
private:
diff --git a/Tools/Scripts/VCSUtils.pm b/Tools/Scripts/VCSUtils.pm
index 4da78720a..6bba77407 100644
--- a/Tools/Scripts/VCSUtils.pm
+++ b/Tools/Scripts/VCSUtils.pm
@@ -383,7 +383,7 @@ sub svnRevisionForDirectory($)
my $svnInfo = `$command`;
($revision) = ($svnInfo =~ m/Revision: (\d+).*/g);
} elsif (isGitDirectory($dir)) {
- my $command = "git log --grep='git-svn-id: ' -n 1 | grep git-svn-id:";
+ my $command = "git log --grep=\"git-svn-id: \" -n 1 | grep git-svn-id:";
$command = "LC_ALL=C $command" if !isWindows();
$command = "cd $dir && $command";
my $gitLog = `$command`;
diff --git a/Tools/Scripts/old-run-webkit-tests b/Tools/Scripts/old-run-webkit-tests
index 18ae056a1..e6415da4d 100755
--- a/Tools/Scripts/old-run-webkit-tests
+++ b/Tools/Scripts/old-run-webkit-tests
@@ -2560,11 +2560,21 @@ my @testsFound;
sub isUsedInReftest($)
{
my $filename = $_[0];
- if ($filename =~ /-$expectedTag(-$mismatchTag)?\.html$/) {
+ my @extensions = ('html','shtml','xml','xhtml','htm','php','svg','mht','pl');
+ my $extensionsJoined = join("|", @extensions);
+ my $extensionExpression = "-$expectedTag(-$mismatchTag)?\\.(".$extensionsJoined.")\$";
+
+ if ($filename =~ /$extensionExpression/) {
return 1;
}
my $base = stripExtension($filename);
- return (-f "$base-$expectedTag.html" || -f "$base-$expectedTag-$mismatchTag.html");
+
+ foreach my $extension (@extensions) {
+ if (-f "$base-$expectedTag.$extension" || -f "$base-$expectedTag-$mismatchTag.$extension") {
+ return 1;
+ }
+ }
+ return 0;
}
sub directoryFilter
diff --git a/Tools/Scripts/run-gtk-tests b/Tools/Scripts/run-gtk-tests
index 4f1d4c15f..776f4cde3 100755
--- a/Tools/Scripts/run-gtk-tests
+++ b/Tools/Scripts/run-gtk-tests
@@ -67,8 +67,6 @@ class TestRunner:
SkippedTest("unittests/testwebinspector", "/webkit/webinspector/close-and-inspect", "Test is flaky in GTK Linux 32-bit Release bot", 82869),
SkippedTest("WebKit2APITests/TestWebKitWebView", "/webkit2/WebKitWebView/mouse-target", "Test is flaky in GTK Linux 32-bit Release bot", 82866),
SkippedTest("WebKit2APITests/TestResources", "/webkit2/WebKitWebView/resources", "Test is flaky in GTK Linux 32-bit Release bot", 82868),
- SkippedTest("WebKit2APITests/TestWebKitFindController", "/webkit2/WebKitFindController/next", "Test fails ", 91083),
- SkippedTest("WebKit2APITests/TestWebKitFindController", "/webkit2/WebKitFindController/previous", "Test fails", 91083),
SkippedTest("WebKit2APITests/TestWebKitFindController", "/webkit2/WebKitFindController/hide", "Test always fails in Xvfb", 89810),
SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.WKConnection", "Tests fail and time out out", 84959),
SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.RestoreSessionStateContainingFormData", "Session State is not implemented in GTK+ port", 84960),
diff --git a/Tools/Scripts/update-webkit-chromium b/Tools/Scripts/update-webkit-chromium
index a5c242442..b21d09ec5 100755
--- a/Tools/Scripts/update-webkit-chromium
+++ b/Tools/Scripts/update-webkit-chromium
@@ -1,5 +1,4 @@
#!/usr/bin/perl -w
-
# Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -59,26 +58,10 @@ if (! -e ".gclient") {
"--spec=solutions=[{'name':'./','url':None}]") == 0 or die $!;
}
-# When building WebKit's Chromium port for Android, we need the Android NDK as
-# it will allow us to cross-compile all sources to the target architecture.
+# When building Chromium for Android, the envsetup.sh script needs to be
+# executed prior to project file generation. We need to tell gyp_webkit to do
+# that, as it's a Chromium file and may not be available yet right now.
if (isChromiumAndroid()) {
- if (! -e "android-ndk-r7b") {
- print "Installing the Android NDK, version 7b...\n";
- my $host_os = isLinux() ? "linux" : "darwin";
- my $result = system("curl", "-o", "android-ndk-r7b.tar.bz2", "http://dl.google.com/android/ndk/android-ndk-r7b-" . $host_os . "-x86.tar.bz2");
- die "Couldn't download the Android NDK." if $result;
-
- $result = system("tar", "jx", "-f", "android-ndk-r7b.tar.bz2");
- die "Couldn't extract the Android NDK." if $result;
- }
-
- my $androidNdkRoot = sourceDir() . "/Source/WebKit/chromium/android-ndk-r7b";
-
- # Attempt to replace the NDK's linker with a 64-bit version if the host
- # OS is Linux. This will significantly speed up link times.
- chromiumInstall64BitAndroidLinkerIfNeeded($androidNdkRoot) if isLinux();
-
- $ENV{ANDROID_NDK_ROOT} = $androidNdkRoot;
$ENV{WEBKIT_ANDROID_BUILD} = 1;
}
diff --git a/Tools/Scripts/update-webkit-libs-jhbuild b/Tools/Scripts/update-webkit-libs-jhbuild
index 48343fb30..51605bded 100755
--- a/Tools/Scripts/update-webkit-libs-jhbuild
+++ b/Tools/Scripts/update-webkit-libs-jhbuild
@@ -41,6 +41,56 @@ if (!$getOptionsResult) {
}
}
+sub getMD5HashForFile($)
+{
+ my $file = shift;
+
+ open(FILE_CONTENTS, $file);
+
+ my $contents = "";
+ while (<FILE_CONTENTS>) {
+ $contents .= $_;
+ }
+
+ close(FILE_CONTENTS);
+
+ return md5_hex($contents);
+}
+
+sub jhbuildConfigurationChanged()
+{
+ foreach my $file (qw(jhbuildrc jhbuild.modules)) {
+ my $path = join('/', getJhbuildPath(), $file . '.md5sum');
+ if (! -e $path) {
+ return 1;
+ }
+
+ # Get the md5 sum of the file we're testing, look in the right platform directory.
+ my $actualFile = join('/', sourceDir(), 'Tools', $platform, $file);
+ my $currentSum = getMD5HashForFile($actualFile);
+
+ # Get our previous record.
+ open(PREVIOUS_MD5, $path);
+ chomp(my $previousSum = <PREVIOUS_MD5>);
+ close(PREVIOUS_MD5);
+
+ if ($previousSum ne $currentSum) {
+ return 1;
+ }
+ }
+}
+
+sub saveJhbuildMd5() {
+ # Save md5sum for jhbuild-related files.saveJhbuildMd5();
+ foreach my $file (qw(jhbuildrc jhbuild.modules)) {
+ my $source = join('/', sourceDir(), "Tools", $platform, $file);
+ my $destination = join('/', getJhbuildPath(), $file);
+ open(SUM, ">$destination" . ".md5sum");
+ print SUM getMD5HashForFile($source);
+ close(SUM);
+ }
+}
+
sub runJhbuild
{
my $command = shift;
@@ -49,10 +99,30 @@ sub runJhbuild
system(@jhbuildArgs) == 0 or die "Running jhbuild-wrapper " . $command . " failed.\n";
}
+sub cleanJhbuild()
+{
+ runJhbuild("clean");
+
+ # If the configuration changed, dependencies may have been removed.
+ # Since we lack a granular way of uninstalling those we wipe out the
+ # jhbuild root and start from scratch.
+ my $jhbuildPath = getJhbuildPath();
+ if (system("rm -rf $jhbuildPath/Root") ne 0) {
+ die "Cleaning jhbuild root failed!";
+ }
+}
+
delete $ENV{AR_FLAGS} if exists $ENV{AR_FLAGS};
chdir(relativeScriptsDir() . "/../jhbuild") or die $!;
my %prettyPlatform = ( "efl" => "EFL", "gtk" => "GTK+" );
+
+if (-e getJhbuildPath() && jhbuildConfigurationChanged()) {
+ cleanJhbuild();
+}
+
print "Updating " . $prettyPlatform{$platform} . " port dependencies using jhbuild...\n";
runJhbuild("build");
+
+saveJhbuildMd5();
diff --git a/Tools/Scripts/update-webkitefl-libs b/Tools/Scripts/update-webkitefl-libs
index cbdb55ca7..30b2104ab 100755
--- a/Tools/Scripts/update-webkitefl-libs
+++ b/Tools/Scripts/update-webkitefl-libs
@@ -20,4 +20,4 @@ use lib $FindBin::Bin;
use webkitdirs;
my $scriptsDir = relativeScriptsDir();
-system("perl", "$scriptsDir/update-webkit-libs-jhbuild", "--efl", sys.argv) == 0 or die $!;
+system("perl", "$scriptsDir/update-webkit-libs-jhbuild", "--efl") == 0 or die $!;
diff --git a/Tools/Scripts/webkitdirs.pm b/Tools/Scripts/webkitdirs.pm
index e5bf957c0..19c6c0046 100755
--- a/Tools/Scripts/webkitdirs.pm
+++ b/Tools/Scripts/webkitdirs.pm
@@ -1894,23 +1894,6 @@ sub autotoolsFlag($$)
return $prefix . '-' . $feature;
}
-sub getMD5HashForFile($)
-{
- my $file = shift;
-
- open(FILE_CONTENTS, $file);
-
- # Read the whole file.
- my $contents = "";
- while (<FILE_CONTENTS>) {
- $contents .= $_;
- }
-
- close(FILE_CONTENTS);
-
- return md5_hex($contents);
-}
-
sub runAutogenForAutotoolsProjectIfNecessary($@)
{
my ($dir, $prefix, $sourceDir, $project, @buildArgs) = @_;
@@ -1954,7 +1937,7 @@ sub runAutogenForAutotoolsProjectIfNecessary($@)
# Prefix the command with jhbuild run.
unshift(@buildArgs, "$relSourceDir/autogen.sh");
- unshift(@buildArgs, "$sourceDir/Tools/gtk/run-with-jhbuild");
+ unshift(@buildArgs, jhbuildWrapperPrefixIfNeeded());
if (system(@buildArgs) ne 0) {
die "Calling autogen.sh failed!\n";
}
@@ -1965,58 +1948,6 @@ sub getJhbuildPath()
return join('/', baseProductDir(), "Dependencies");
}
-sub jhbuildConfigurationChanged()
-{
- foreach my $file (qw(jhbuildrc.md5sum jhbuild.modules.md5sum)) {
- my $path = join('/', getJhbuildPath(), $file);
- if (! -e $path) {
- return 1;
- }
-
- # Get the md5 sum of the file we're testing, look in the right platform directory.
- $file =~ m/(.+)\.md5sum/;
- my $platformDir = isEfl() ? 'efl' : 'gtk';
- my $actualFile = join('/', $sourceDir, 'Tools', $platformDir, $1);
- my $currentSum = getMD5HashForFile($actualFile);
-
- # Get our previous record.
- open(PREVIOUS_MD5, $path);
- chomp(my $previousSum = <PREVIOUS_MD5>);
- close(PREVIOUS_MD5);
-
- if ($previousSum ne $currentSum) {
- return 1;
- }
- }
-}
-
-sub saveJhbuildMd5() {
- my $platform = isEfl() ? 'efl' : 'gtk';
- # Save md5sum for jhbuild-related files.
- foreach my $file (qw(jhbuildrc jhbuild.modules)) {
- my $source = join('/', $sourceDir, "Tools", $platform, $file);
- my $destination = join('/', getJhbuildPath(), $file);
- open(SUM, ">$destination" . ".md5sum");
- print SUM getMD5HashForFile($source);
- close(SUM);
- }
-}
-
-sub cleanJhbuild() {
- # If the configuration changed, dependencies may have been removed.
- # Since we lack a granular way of uninstalling those we wipe out the
- # jhbuild root and start from scratch.
- my $jhbuildPath = getJhbuildPath();
- if (system("rm -rf $jhbuildPath/Root") ne 0) {
- die "Cleaning jhbuild root failed!";
- }
-
- my $platform = isEfl() ? 'efl' : 'gtk';
- if (system("perl $sourceDir/Tools/jhbuild/jhbuild-wrapper --$platform clean") ne 0) {
- die "Cleaning jhbuild modules failed!";
- }
-}
-
sub mustReRunAutogen($@)
{
my ($sourceDir, $filename, @currentArguments) = @_;
@@ -2106,33 +2037,19 @@ sub buildAutotoolsProject($@)
# Enable unstable features when building through build-webkit.
push @buildArgs, "--enable-unstable-features";
- # We might need to update jhbuild dependencies.
- my $needUpdate = 0;
- if (jhbuildConfigurationChanged()) {
- cleanJhbuild();
- $needUpdate = 1;
- }
-
if (checkForArgumentAndRemoveFromArrayRef("--update-gtk", \@buildArgs)) {
- $needUpdate = 1;
- }
-
- if ($needUpdate) {
# Force autogen to run, to catch the possibly updated libraries.
system("rm -f previous-autogen-arguments.txt");
system("perl", "$sourceDir/Tools/Scripts/update-webkitgtk-libs") == 0 or die $!;
}
- saveJhbuildMd5();
-
# If GNUmakefile exists, don't run autogen.sh unless its arguments
# have changed. The makefile should be smart enough to track autotools
# dependencies and re-run autogen.sh when build files change.
runAutogenForAutotoolsProjectIfNecessary($dir, $prefix, $sourceDir, $project, @buildArgs);
- my $gtkScriptsPath = "$sourceDir/Tools/gtk";
- my $runWithJhbuild = "$gtkScriptsPath/run-with-jhbuild";
+ my $runWithJhbuild = jhbuildWrapperPrefixIfNeeded();
if (system("$runWithJhbuild $make $makeArgs") ne 0) {
die "\nFailed to build WebKit using '$make'!\n";
}
@@ -2140,7 +2057,7 @@ sub buildAutotoolsProject($@)
chdir ".." or die;
if ($project eq 'WebKit' && !isCrossCompilation()) {
- my @docGenerationOptions = ($runWithJhbuild, "$gtkScriptsPath/generate-gtkdoc", "--skip-html");
+ my @docGenerationOptions = ($runWithJhbuild, "$sourceDir/Tools/gtk/generate-gtkdoc", "--skip-html");
push(@docGenerationOptions, productDir());
if (system(@docGenerationOptions)) {
@@ -2153,9 +2070,14 @@ sub buildAutotoolsProject($@)
sub jhbuildWrapperPrefixIfNeeded()
{
- if (isEfl()) {
- return File::Spec->catfile(sourceDir(), "Tools", "efl", "run-with-jhbuild");
+ if (-e getJhbuildPath()) {
+ if (isEfl()) {
+ return File::Spec->catfile(sourceDir(), "Tools", "efl", "run-with-jhbuild");
+ } elsif (isGtk()) {
+ return File::Spec->catfile(sourceDir(), "Tools", "gtk", "run-with-jhbuild");
+ }
}
+
return "";
}
@@ -2195,15 +2117,6 @@ sub generateBuildSystemFromCMakeProject
$ENV{'CXXFLAGS'} = "-march=pentium4 -msse2 -mfpmath=sse " . ($ENV{'CXXFLAGS'} || "");
}
- if (isEfl() && jhbuildConfigurationChanged()) {
- cleanJhbuild();
- system("perl", "$sourceDir/Tools/Scripts/update-webkitefl-libs") == 0 or die $!;
- }
-
- if (isEfl()) {
- saveJhbuildMd5();
- }
-
# We call system("cmake @args") instead of system("cmake", @args) so that @args is
# parsed for shell metacharacters.
my $wrapper = jhbuildWrapperPrefixIfNeeded() . " ";
@@ -2247,6 +2160,11 @@ sub buildCMakeProjectOrExit($$$$@)
exit(exitStatus(cleanCMakeGeneratedProject())) if $clean;
+ if (isEfl() && checkForArgumentAndRemoveFromARGV("--update-efl")) {
+ system("perl", "$sourceDir/Tools/Scripts/update-webkitefl-libs") == 0 or die $!;
+ }
+
+
$returnCode = exitStatus(generateBuildSystemFromCMakeProject($port, $prefixPath, @cmakeArgs));
exit($returnCode) if $returnCode;
$returnCode = exitStatus(buildCMakeGeneratedProject($makeArgs));
@@ -2618,49 +2536,6 @@ sub buildChromium($@)
return $result;
}
-sub chromiumInstall64BitAndroidLinkerIfNeeded
-{
- my ($androidNdkRoot) = @_;
-
- # Resolve the toolchain version through glob().
- my $linkerDirPrefix = glob("$androidNdkRoot/toolchains/arm-linux-androideabi-*/prebuilt/linux-x86");
-
- my $linkerDirname1 = "$linkerDirPrefix/bin";
- my $linkerBasename1 = "arm-linux-androideabi-ld";
- my $linkerDirname2 = "$linkerDirPrefix/arm-linux-androideabi/bin";
- my $linkerBasename2 = "ld";
- my $newLinker = "arm-linux-androideabi-ld.e4df3e0a5bb640ccfa2f30ee67fe9b3146b152d6";
-
- # Do not continue if the new linker is not (yet) available.
- if (! -e "third_party/aosp/$newLinker") {
- return;
- }
-
- chromiumReplaceAndroidLinkerIfNeeded($linkerDirname1, $linkerBasename1, $newLinker);
- chromiumReplaceAndroidLinkerIfNeeded($linkerDirname2, $linkerBasename2, $newLinker);
-}
-
-sub chromiumReplaceAndroidLinkerIfNeeded
-{
- my ($linkerDirname, $linkerBasename, $newLinker) = @_;
-
- # If the destination directory does not exist, or the linker has already
- # been installed, replacing it will not be necessary.
- if (! -d "$linkerDirname" || -e "$linkerDirname/$newLinker") {
- return;
- }
-
- print "Installing 64-bit Android linker in $linkerDirname..\n";
- system("cp", "third_party/aosp/$newLinker", "$linkerDirname/$newLinker");
- system("mv", "$linkerDirname/$linkerBasename", "$linkerDirname/$linkerBasename.orig");
- system("ln", "-s", "$newLinker", "$linkerDirname/$linkerBasename");
-
- if (! -e "$linkerDirname/$newLinker") {
- print "Unable to copy the linker.\n";
- exit 1;
- }
-}
-
sub appleApplicationSupportPath
{
open INSTALL_DIR, "</proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Apple\ Inc./Apple\ Application\ Support/InstallDir";
diff --git a/Tools/Scripts/webkitperl/FeatureList.pm b/Tools/Scripts/webkitperl/FeatureList.pm
index 930947828..4ed314e4f 100644
--- a/Tools/Scripts/webkitperl/FeatureList.pm
+++ b/Tools/Scripts/webkitperl/FeatureList.pm
@@ -50,6 +50,7 @@ my (
$channelMessagingSupport,
$cspNextSupport,
$css3FlexboxSupport,
+ $css3TextDecorationSupport,
$cssBoxDecorationBreakSupport,
$cssExclusionsSupport,
$cssFiltersSupport,
@@ -135,6 +136,7 @@ my (
$webSocketsSupport,
$webTimingSupport,
$workersSupport,
+ $xhrResponseBlobSupport,
$xsltSupport,
);
@@ -169,6 +171,9 @@ my @features = (
{ option => "css3-flexbox", desc => "Toggle CSS3 Flexbox support",
define => "ENABLE_CSS3_FLEXBOX", default => 1, value => \$css3FlexboxSupport },
+ { option => "css3-text-decoration", desc => "Toggle CSS3 Text Decoration support",
+ define => "ENABLE_CSS3_TEXT_DECORATION", default => 0, value => \$css3TextDecorationSupport },
+
{ option => "css-hierarchies", desc => "Toggle CSS Hierarchy support",
define => "ENABLE_CSS_HIERARCHIES", default => 0, value => \$cssHierarchiesSupport },
@@ -415,6 +420,9 @@ my @features = (
{ option => "workers", desc => "Toggle Workers support",
define => "ENABLE_WORKERS", default => (isAppleWebKit() || isGtk() || isBlackBerry() || isEfl()), value => \$workersSupport },
+ { option => "xhr-response-blob", desc => "Toggle XHR Response BLOB support",
+ define => "ENABLE_XHR_RESPONSE_BLOB", default => isBlackBerry(), value => \$xhrResponseBlobSupport },
+
{ option => "xslt", desc => "Toggle XSLT support",
define => "ENABLE_XSLT", default => 1, value => \$xsltSupport },
);
diff --git a/Tools/Scripts/webkitpy/common/config/build.py b/Tools/Scripts/webkitpy/common/config/build.py
index fcb5e62c3..2ecacc7ad 100644
--- a/Tools/Scripts/webkitpy/common/config/build.py
+++ b/Tools/Scripts/webkitpy/common/config/build.py
@@ -37,7 +37,7 @@ def _should_file_trigger_build(target_platform, file):
# and start using it for their bots. Someone familiar with each platform
# will have to figure out what the right set of directories/patterns is for
# that platform.
- assert(target_platform in ("mac-leopard", "mac-lion", "mac-snowleopard", "win"))
+ assert(target_platform in ("mac-leopard", "mac-lion", "mac-mountainlion", "mac-snowleopard", "win"))
directories = [
# Directories that shouldn't trigger builds on any bots.
@@ -68,9 +68,9 @@ def _should_file_trigger_build(target_platform, file):
("gtk", ["gtk"]),
("mac", ["chromium-mac", "mac"]),
("mac-leopard", ["mac-leopard"]),
- ("mac-lion", ["mac", "win"]),
+ ("mac-lion", ["mac-leopard", "mac-lion", "mac-snowleopard", "win"]),
("mac-snowleopard", ["mac-leopard", "mac-snowleopard"]),
- ("mac-wk2", ["mac-lion", "mac-snowleopard", "win"]),
+ ("mac-wk2", ["mac-lion", "mac-snowleopard", "mac-mountainlion", "win"]),
("objc", ["mac"]),
("qt", ["qt"]),
("skia", ["chromium"]),
diff --git a/Tools/Scripts/webkitpy/common/config/build_unittest.py b/Tools/Scripts/webkitpy/common/config/build_unittest.py
index bdc340489..c496179e4 100644
--- a/Tools/Scripts/webkitpy/common/config/build_unittest.py
+++ b/Tools/Scripts/webkitpy/common/config/build_unittest.py
@@ -31,7 +31,7 @@ class ShouldBuildTest(unittest.TestCase):
(["GNUmakefile.am", "Source/WebCore/GNUmakefile.am"], ["gtk"]),
(["Websites/bugs.webkit.org/foo", "Source/WebCore/bar"], ["*"]),
(["Websites/bugs.webkit.org/foo"], []),
- (["Source/JavaScriptCore/JavaScriptCore.xcodeproj/foo"], ["mac-leopard", "mac-lion", "mac-snowleopard"]),
+ (["Source/JavaScriptCore/JavaScriptCore.xcodeproj/foo"], ["mac-leopard", "mac-lion", "mac-mountainlion", "mac-snowleopard"]),
(["Source/JavaScriptCore/JavaScriptCore.vcproj/foo", "Source/WebKit2/win/WebKit2.vcproj", "Source/WebKit/win/WebKit.sln", "Tools/WebKitTestRunner/Configurations/WebKitTestRunnerCommon.vsprops"], ["win"]),
(["LayoutTests/platform/mac/foo", "Source/WebCore/bar"], ["*"]),
(["LayoutTests/foo"], ["*"]),
@@ -41,17 +41,17 @@ class ShouldBuildTest(unittest.TestCase):
(["LayoutTests/platform/mac-leopard/foo"], ["mac-leopard"]),
(["LayoutTests/platform/mac-lion/foo"], ["mac-leopard", "mac-lion", "mac-snowleopard", "win"]),
(["LayoutTests/platform/mac-snowleopard/foo"], ["mac-leopard", "mac-snowleopard"]),
- (["LayoutTests/platform/mac-wk2/Skipped"], ["mac-lion", "mac-snowleopard", "win"]),
- (["LayoutTests/platform/mac/foo"], ["mac-leopard", "mac-lion", "mac-snowleopard", "win"]),
+ (["LayoutTests/platform/mac-wk2/Skipped"], ["mac-lion", "mac-mountainlion", "mac-snowleopard", "win"]),
+ (["LayoutTests/platform/mac/foo"], ["mac-leopard", "mac-lion", "mac-mountainlion", "mac-snowleopard", "win"]),
(["LayoutTests/platform/win-xp/foo"], ["win"]),
(["LayoutTests/platform/win-wk2/foo"], ["win"]),
(["LayoutTests/platform/win/foo"], ["win"]),
- (["Source/WebCore.exp.in", "Source/WebKit/mac/WebKit.exp"], ["mac-leopard", "mac-lion", "mac-snowleopard"]),
- (["Source/WebCore/mac/foo"], ["chromium-mac", "mac-leopard", "mac-lion", "mac-snowleopard"]),
+ (["Source/WebCore.exp.in", "Source/WebKit/mac/WebKit.exp"], ["mac-leopard", "mac-lion", "mac-mountainlion", "mac-snowleopard"]),
+ (["Source/WebCore/mac/foo"], ["chromium-mac", "mac-leopard", "mac-lion", "mac-mountainlion", "mac-snowleopard"]),
(["Source/WebCore/win/foo"], ["chromium-win", "win"]),
- (["Source/WebCore/platform/graphics/gpu/foo"], ["mac-leopard", "mac-lion", "mac-snowleopard"]),
+ (["Source/WebCore/platform/graphics/gpu/foo"], ["mac-leopard", "mac-lion", "mac-mountainlion", "mac-snowleopard"]),
(["Source/WebCore/platform/wx/wxcode/win/foo"], []),
- (["Source/WebCore/rendering/RenderThemeMac.mm", "Source/WebCore/rendering/RenderThemeMac.h"], ["mac-leopard", "mac-lion", "mac-snowleopard"]),
+ (["Source/WebCore/rendering/RenderThemeMac.mm", "Source/WebCore/rendering/RenderThemeMac.h"], ["mac-leopard", "mac-lion", "mac-mountainlion", "mac-snowleopard"]),
(["Source/WebCore/rendering/RenderThemeChromiumLinux.h"], ["chromium-linux"]),
(["Source/WebCore/rendering/RenderThemeWinCE.h"], []),
(["Tools/BuildSlaveSupport/build.webkit.org-config/public_html/LeaksViewer/LeaksViewer.js"], []),
@@ -61,7 +61,7 @@ class ShouldBuildTest(unittest.TestCase):
for files, platforms in self._should_build_tests:
# FIXME: We should test more platforms here once
# build._should_file_trigger_build is implemented for them.
- for platform in ["mac-leopard", "mac-lion", "mac-snowleopard", "win"]:
+ for platform in ["mac-leopard", "mac-lion", "mac-mountainlion", "mac-snowleopard", "win"]:
should_build = platform in platforms or "*" in platforms
self.assertEqual(build.should_build(platform, files), should_build, "%s should%s have built but did%s (files: %s)" % (platform, "" if should_build else "n't", "n't" if should_build else "", str(files)))
diff --git a/Tools/Scripts/webkitpy/common/config/committers.py b/Tools/Scripts/webkitpy/common/config/committers.py
index ddfddf9a9..4c2216289 100644
--- a/Tools/Scripts/webkitpy/common/config/committers.py
+++ b/Tools/Scripts/webkitpy/common/config/committers.py
@@ -131,6 +131,7 @@ contributors_who_are_not_committers = [
Contributor("Eric Penner", "epenner@chromium.org", "epenner"),
Contributor("Felician Marton", ["felician@inf.u-szeged.hu", "marton.felician.zoltan@stud.u-szeged.hu"], "Felician"),
Contributor("Finnur Thorarinsson", ["finnur@chromium.org", "finnur.webkit@gmail.com"], "finnur"),
+ Contributor("Forms Bugs", "forms-bugs@chromium.org"),
Contributor("Grace Kloba", "klobag@chromium.org", "klobag"),
Contributor("Greg Simon", "gregsimon@chromium.org", "gregsimon"),
Contributor("Gregg Tavares", ["gman@google.com", "gman@chromium.org"], "gman"),
@@ -143,6 +144,7 @@ contributors_who_are_not_committers = [
Contributor("John Bauman", ["jbauman@chromium.org", "jbauman@google.com"], "jbauman"),
Contributor("John Mellor", "johnme@chromium.org", "johnme"),
Contributor("Kulanthaivel Palanichamy", "kulanthaivel@codeaurora.org", "kvel"),
+ Contributor("Kiran Muppala", "cmuppala@apple.com", "kiranm"),
Contributor(u"Michael Br\u00fcning", "michael.bruning@nokia.com", "mibrunin"),
Contributor("Mihai Balan", "mibalan@adobe.com", "miChou"),
Contributor("Min Qin", "qinmin@chromium.org"),
@@ -153,6 +155,7 @@ contributors_who_are_not_committers = [
Contributor("Pravin D", "pravind.2k4@gmail.com", 'pravind'),
Contributor("Radar WebKit Bug Importer", "webkit-bug-importer@group.apple.com"),
Contributor("Raul Hudea", "rhudea@adobe.com", "rhudea"),
+ Contributor("Roger Fong", "roger_fong@apple.com", "rfong"),
Contributor("Roland Takacs", "rtakacs@inf.u-szeged.hu", "rtakacs"),
Contributor(u"Sami Ky\u00f6stil\u00e4", "skyostil@chromium.org", "skyostil"),
Contributor("Szilard Ledan-Muntean", "szledan@inf.u-szeged.hu", "szledan"),
@@ -161,6 +164,7 @@ contributors_who_are_not_committers = [
Contributor("Terry Anderson", "tdanderson@chromium.org", "tdanderson"),
Contributor("Tien-Ren Chen", "trchen@chromium.org", "trchen"),
Contributor("WebKit Review Bot", "webkit.review.bot@gmail.com", "sheriff-bot"),
+ Contributor("Web Components Team", "webcomponents-bugzilla@chromium.org"),
Contributor("Wyatt Carss", ["wcarss@chromium.org", "wcarss@google.com"], "wcarss"),
Contributor("Zeev Lieber", "zlieber@chromium.org"),
Contributor("Zoltan Arvai", "zarvai@inf.u-szeged.hu", "azbest_hu"),
diff --git a/Tools/Scripts/webkitpy/common/config/ports.py b/Tools/Scripts/webkitpy/common/config/ports.py
index 1d76b4218..884380e65 100644
--- a/Tools/Scripts/webkitpy/common/config/ports.py
+++ b/Tools/Scripts/webkitpy/common/config/ports.py
@@ -160,6 +160,7 @@ class EflPort(DeprecatedPort):
def build_webkit_command(self, build_style=None):
command = super(EflPort, self).build_webkit_command(build_style=build_style)
command.append("--efl")
+ command.append("--update-efl")
command.append(super(EflPort, self).makeArgs())
return command
diff --git a/Tools/Scripts/webkitpy/common/config/ports_unittest.py b/Tools/Scripts/webkitpy/common/config/ports_unittest.py
index df5bf7352..272052339 100644
--- a/Tools/Scripts/webkitpy/common/config/ports_unittest.py
+++ b/Tools/Scripts/webkitpy/common/config/ports_unittest.py
@@ -46,6 +46,11 @@ class DeprecatedPortTest(unittest.TestCase):
self.assertEquals(GtkPort().build_webkit_command(), DeprecatedPort().script_shell_command("build-webkit") + ["--gtk", "--update-gtk", DeprecatedPort().makeArgs()])
self.assertEquals(GtkPort().build_webkit_command(build_style="debug"), DeprecatedPort().script_shell_command("build-webkit") + ["--debug", "--gtk", "--update-gtk", DeprecatedPort().makeArgs()])
+ def test_efl_port(self):
+ self.assertEquals(EflPort().flag(), "--port=efl")
+ self.assertEquals(EflPort().build_webkit_command(), DeprecatedPort().script_shell_command("build-webkit") + ["--efl", "--update-efl", DeprecatedPort().makeArgs()])
+ self.assertEquals(EflPort().build_webkit_command(build_style="debug"), DeprecatedPort().script_shell_command("build-webkit") + ["--debug", "--efl", "--update-efl", DeprecatedPort().makeArgs()])
+
def test_qt_port(self):
self.assertEquals(QtPort().flag(), "--port=qt")
self.assertEquals(QtPort().run_webkit_tests_command(), DeprecatedPort().script_shell_command("run-webkit-tests"))
diff --git a/Tools/Scripts/webkitpy/common/config/watchlist b/Tools/Scripts/webkitpy/common/config/watchlist
index e5c9c2776..ce7b7fe9a 100755
--- a/Tools/Scripts/webkitpy/common/config/watchlist
+++ b/Tools/Scripts/webkitpy/common/config/watchlist
@@ -212,7 +212,9 @@
"Battery": {
"filename": r"Source/WebCore/Modules/battery",
},
-
+ "WTF": {
+ "filename": r"Source/WTF/wtf",
+ },
},
"CC_RULES": {
# Note: All email addresses listed must be registered with bugzilla.
@@ -257,6 +259,7 @@
"WebIDL": [ "abarth@webkit.org", "ojan@chromium.org" ],
"WebKitGTKTranslations": [ "gns@gnome.org", "mrobinson@webkit.org" ],
"webkitpy": [ "abarth@webkit.org", "ojan@chromium.org", "dpranke@chromium.org" ],
+ "WTF": [ "benjamin@webkit.org",],
},
"MESSAGE_RULES": {
"ChromiumPublicApi": [ "Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, "
diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py b/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py
index ae3422561..a9df942da 100644
--- a/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py
+++ b/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py
@@ -315,12 +315,19 @@ class Worker(object):
test_input.should_run_pixel_test = self._port.should_run_as_pixel_test(test_input)
def _run_test(self, test_input):
+ self._batch_count += 1
+
+ stop_when_done = False
+ if self._batch_size > 0 and self._batch_count >= self._batch_size:
+ self._batch_count = 0
+ stop_when_done = True
+
self._update_test_input(test_input)
test_timeout_sec = self._timeout(test_input)
start = time.time()
self._caller.post('started_test', test_input, test_timeout_sec)
- result = self._run_test_with_timeout(test_input, test_timeout_sec)
+ result = self._run_test_with_timeout(test_input, test_timeout_sec, stop_when_done)
elapsed_time = time.time() - start
self._caller.post('finished_test', result, elapsed_time)
@@ -359,13 +366,12 @@ class Worker(object):
_log.debug("%s killing driver" % self._name)
driver.stop()
- def _run_test_with_timeout(self, test_input, timeout):
+ def _run_test_with_timeout(self, test_input, timeout, stop_when_done):
if self._options.run_singly:
- return self._run_test_in_another_thread(test_input, timeout)
- return self._run_test_in_this_thread(test_input)
+ return self._run_test_in_another_thread(test_input, timeout, stop_when_done)
+ return self._run_test_in_this_thread(test_input, stop_when_done)
def _clean_up_after_test(self, test_input, result):
- self._batch_count += 1
test_name = test_input.test_name
self._tests_run_file.write(test_name + "\n")
@@ -385,11 +391,7 @@ class Worker(object):
else:
_log.debug("%s %s passed" % (self._name, test_name))
- if self._batch_size > 0 and self._batch_count >= self._batch_size:
- self._kill_driver()
- self._batch_count = 0
-
- def _run_test_in_another_thread(self, test_input, thread_timeout_sec):
+ def _run_test_in_another_thread(self, test_input, thread_timeout_sec, stop_when_done):
"""Run a test in a separate thread, enforcing a hard time limit.
Since we can only detect the termination of a thread, not any internal
@@ -412,7 +414,7 @@ class Worker(object):
self.result = None
def run(self):
- self.result = worker._run_single_test(driver, test_input)
+ self.result = worker._run_single_test(driver, test_input, stop_when_done)
thread = SingleTestThread()
thread.start()
@@ -435,7 +437,7 @@ class Worker(object):
result = test_results.TestResult(test_input.test_name, failures=[], test_run_time=0)
return result
- def _run_test_in_this_thread(self, test_input):
+ def _run_test_in_this_thread(self, test_input, stop_when_done):
"""Run a single test file using a shared DumpRenderTree process.
Args:
@@ -447,11 +449,11 @@ class Worker(object):
self._kill_driver()
if not self._driver:
self._driver = self._port.create_driver(self._worker_number)
- return self._run_single_test(self._driver, test_input)
+ return self._run_single_test(self._driver, test_input, stop_when_done)
- def _run_single_test(self, driver, test_input):
+ def _run_single_test(self, driver, test_input, stop_when_done):
return single_test_runner.run_single_test(self._port, self._options,
- test_input, driver, self._name)
+ test_input, driver, self._name, stop_when_done)
class TestShard(object):
diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py b/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py
index b36130ded..7379d97c3 100644
--- a/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py
+++ b/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py
@@ -41,15 +41,15 @@ from webkitpy.layout_tests.models.test_results import TestResult
_log = logging.getLogger(__name__)
-def run_single_test(port, options, test_input, driver, worker_name):
- runner = SingleTestRunner(options, port, driver, test_input, worker_name)
+def run_single_test(port, options, test_input, driver, worker_name, stop_when_done):
+ runner = SingleTestRunner(options, port, driver, test_input, worker_name, stop_when_done)
return runner.run()
class SingleTestRunner(object):
(ALONGSIDE_TEST, PLATFORM_DIR, VERSION_DIR, UPDATE) = ('alongside', 'platform', 'version', 'update')
- def __init__(self, options, port, driver, test_input, worker_name):
+ def __init__(self, options, port, driver, test_input, worker_name, stop_when_done):
self._options = options
self._port = port
self._filesystem = port.host.filesystem
@@ -59,6 +59,7 @@ class SingleTestRunner(object):
self._test_name = test_input.test_name
self._should_run_pixel_test = test_input.should_run_pixel_test
self._reference_files = test_input.reference_files
+ self._stop_when_done = stop_when_done
if self._reference_files:
# Detect and report a test which has a wrong combination of expectation files.
@@ -102,7 +103,7 @@ class SingleTestRunner(object):
return self._run_compare_test()
def _run_compare_test(self):
- driver_output = self._driver.run_test(self._driver_input())
+ driver_output = self._driver.run_test(self._driver_input(), self._stop_when_done)
expected_driver_output = self._expected_driver_output()
if self._options.ignore_metrics:
@@ -116,7 +117,7 @@ class SingleTestRunner(object):
return test_result
def _run_rebaseline(self):
- driver_output = self._driver.run_test(self._driver_input())
+ driver_output = self._driver.run_test(self._driver_input(), self._stop_when_done)
failures = self._handle_error(driver_output)
test_result_writer.write_test_result(self._filesystem, self._port, self._test_name, driver_output, None, failures)
# FIXME: It the test crashed or timed out, it might be better to avoid
@@ -265,7 +266,10 @@ class SingleTestRunner(object):
elif driver_output.image_hash != expected_driver_output.image_hash:
diff_result = self._port.diff_image(driver_output.image, expected_driver_output.image)
err_str = diff_result[2]
- if err_str:
+ # FIXME: see https://bugs.webkit.org/show_bug.cgi?id=94277 and
+ # https://bugs.webkit.org/show_bug.cgi?id=81962; ImageDiff doesn't
+ # seem to be working with WTR properly and tons of tests are failing.
+ if err_str and not self._options.webkit_test_runner:
_log.warning(' %s : %s' % (self._test_name, err_str))
failures.append(test_failures.FailureImageHashMismatch())
driver_output.error = (driver_output.error or '') + err_str
@@ -279,7 +283,7 @@ class SingleTestRunner(object):
return failures
def _run_reftest(self):
- test_output = self._driver.run_test(self._driver_input())
+ test_output = self._driver.run_test(self._driver_input(), self._stop_when_done)
total_test_time = 0
reference_output = None
test_result = None
@@ -293,7 +297,7 @@ class SingleTestRunner(object):
putAllMismatchBeforeMatch = sorted
for expectation, reference_filename in putAllMismatchBeforeMatch(self._reference_files):
reference_test_name = self._port.relative_test_filename(reference_filename)
- reference_output = self._driver.run_test(DriverInput(reference_test_name, self._timeout, test_output.image_hash, should_run_pixel_test=True))
+ reference_output = self._driver.run_test(DriverInput(reference_test_name, self._timeout, test_output.image_hash, should_run_pixel_test=True), self._stop_when_done)
test_result = self._compare_output_with_reference(test_output, reference_output, reference_filename, expectation == '!=')
if (expectation == '!=' and test_result.failures) or (expectation == '==' and not test_result.failures):
@@ -316,6 +320,10 @@ class SingleTestRunner(object):
if failures:
return TestResult(self._test_name, failures, total_test_time, has_stderr)
+ if self._options.webkit_test_runner and not self._options.pixel_tests:
+ # don't check pixel results for WTR/WK2; they're broken.
+ return TestResult(self._test_name, failures, total_test_time, has_stderr)
+
if not driver_output1.image_hash and not driver_output2.image_hash:
failures.append(test_failures.FailureReftestNoImagesGenerated(reference_filename))
elif mismatch:
diff --git a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
index bab741839..d3015dbdd 100644
--- a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
+++ b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
@@ -206,10 +206,14 @@ class TestExpectationParser(object):
self._allow_rebaseline_modifier = allow_rebaseline_modifier
def parse(self, filename, expectations_string):
- expectations = TestExpectationParser._tokenize_list(filename, expectations_string)
- for expectation_line in expectations:
- self._parse_line(expectation_line)
- return expectations
+ expectation_lines = []
+ line_number = 0
+ for line in expectations_string.split("\n"):
+ line_number += 1
+ test_expectation = self._tokenize_line(filename, line, line_number)
+ self._parse_line(test_expectation)
+ expectation_lines.append(test_expectation)
+ return expectation_lines
def expectation_for_skipped_test(self, test_name):
expectation_line = TestExpectationLine()
@@ -231,8 +235,6 @@ class TestExpectationParser(object):
if not expectation_line.name:
return
- self._check_modifiers_against_expectations(expectation_line)
-
expectation_line.is_file = self._port.test_isfile(expectation_line.name)
if not expectation_line.is_file and self._check_path_does_not_exist(expectation_line):
return
@@ -251,7 +253,14 @@ class TestExpectationParser(object):
has_wontfix = False
has_bugid = False
parsed_specifiers = set()
- for modifier in expectation_line.modifiers:
+
+ modifiers = [modifier.lower() for modifier in expectation_line.modifiers]
+ expectations = [expectation.lower() for expectation in expectation_line.expectations]
+
+ if self.SLOW_MODIFIER in modifiers and self.TIMEOUT_EXPECTATION in expectations:
+ expectation_line.warnings.append('A test can not be both SLOW and TIMEOUT. If it times out indefinitely, then it should be just TIMEOUT.')
+
+ for modifier in modifiers:
if modifier in TestExpectations.MODIFIERS:
expectation_line.parsed_modifiers.append(modifier)
if modifier == self.WONTFIX_MODIFIER:
@@ -268,7 +277,7 @@ class TestExpectationParser(object):
if not expectation_line.parsed_bug_modifiers and not has_wontfix and not has_bugid:
expectation_line.warnings.append('Test lacks BUG modifier.')
- if self._allow_rebaseline_modifier and self.REBASELINE_MODIFIER in expectation_line.modifiers:
+ if self._allow_rebaseline_modifier and self.REBASELINE_MODIFIER in modifiers:
expectation_line.warnings.append('REBASELINE should only be used for running rebaseline.py. Cannot be checked in.')
expectation_line.matching_configurations = self._test_configuration_converter.to_config_set(parsed_specifiers, expectation_line.warnings)
@@ -283,10 +292,6 @@ class TestExpectationParser(object):
result.add(expectation)
expectation_line.parsed_expectations = result
- def _check_modifiers_against_expectations(self, expectation_line):
- if self.SLOW_MODIFIER in expectation_line.modifiers and self.TIMEOUT_EXPECTATION in expectation_line.expectations:
- expectation_line.warnings.append('A test can not be both SLOW and TIMEOUT. If it times out indefinitely, then it should be just TIMEOUT.')
-
def _check_path_does_not_exist(self, expectation_line):
# WebKit's way of skipping tests is to add a -disabled suffix.
# So we should consider the path existing if the path or the
@@ -324,7 +329,7 @@ class TestExpectationParser(object):
expectation_line.matching_tests.append(expectation_line.path)
@classmethod
- def _tokenize(cls, filename, expectation_string, line_number):
+ def _tokenize_line(cls, filename, expectation_string, line_number):
"""Tokenizes a line from TestExpectations and returns an unparsed TestExpectationLine instance.
The format of a test expectation line is:
@@ -364,20 +369,9 @@ class TestExpectationParser(object):
return expectation_line
@classmethod
- def _tokenize_list(cls, filename, expectations_string):
- """Returns a list of TestExpectationLines, one for each line in expectations_string."""
- expectation_lines = []
- line_number = 0
- for line in expectations_string.split("\n"):
- line_number += 1
- expectation_lines.append(cls._tokenize(filename, line, line_number))
- return expectation_lines
-
- @classmethod
def _split_space_separated(cls, space_separated_string):
"""Splits a space-separated string into an array."""
- # FIXME: Lower-casing is necessary to support legacy code. Need to eliminate.
- return [part.strip().lower() for part in space_separated_string.strip().split(' ')]
+ return [part.strip() for part in space_separated_string.strip().split(' ')]
class TestExpectationLine(object):
@@ -857,7 +851,7 @@ class TestExpectations(object):
def without_rebaseline_modifier(expectation):
return not (not expectation.is_invalid() and
expectation.name in except_these_tests and
- "rebaseline" in expectation.modifiers and
+ 'rebaseline' in expectation.parsed_modifiers and
filename == expectation.filename)
return TestExpectationSerializer.list_to_string(filter(without_rebaseline_modifier, self._expectations))
diff --git a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
index b65151d72..9fc118360 100644
--- a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
@@ -488,7 +488,7 @@ class RebaseliningTest(Base):
class TestExpectationParserTests(unittest.TestCase):
def _tokenize(self, line):
- return TestExpectationParser._tokenize('path', line, 0)
+ return TestExpectationParser._tokenize_line('path', line, 0)
def test_tokenize_blank(self):
expectation = self._tokenize('')
@@ -529,15 +529,15 @@ class TestExpectationParserTests(unittest.TestCase):
def test_tokenize_valid_with_comment(self):
expectation = self._tokenize('FOO : bar = BAZ //Qux.')
self.assertEqual(expectation.comment, 'Qux.')
- self.assertEqual(str(expectation.modifiers), '[\'foo\']')
- self.assertEqual(str(expectation.expectations), '[\'baz\']')
+ self.assertEqual(str(expectation.modifiers), "['FOO']")
+ self.assertEqual(str(expectation.expectations), "['BAZ']")
self.assertEqual(len(expectation.warnings), 0)
def test_tokenize_valid_with_multiple_modifiers(self):
expectation = self._tokenize('FOO1 FOO2 : bar = BAZ //Qux.')
self.assertEqual(expectation.comment, 'Qux.')
- self.assertEqual(str(expectation.modifiers), '[\'foo1\', \'foo2\']')
- self.assertEqual(str(expectation.expectations), '[\'baz\']')
+ self.assertEqual(str(expectation.modifiers), "['FOO1', 'FOO2']")
+ self.assertEqual(str(expectation.expectations), "['BAZ']")
self.assertEqual(len(expectation.warnings), 0)
def test_parse_empty_string(self):
@@ -560,7 +560,7 @@ class TestExpectationSerializerTests(unittest.TestCase):
unittest.TestCase.__init__(self, testFunc)
def _tokenize(self, line):
- return TestExpectationParser._tokenize('path', line, 0)
+ return TestExpectationParser._tokenize_line('path', line, 0)
def assert_round_trip(self, in_string, expected_string=None):
expectation = self._tokenize(in_string)
@@ -569,7 +569,9 @@ class TestExpectationSerializerTests(unittest.TestCase):
self.assertEqual(expected_string, self._serializer.to_string(expectation))
def assert_list_round_trip(self, in_string, expected_string=None):
- expectations = TestExpectationParser._tokenize_list('path', in_string)
+ host = MockHost()
+ parser = TestExpectationParser(host.port_factory.get('test-win-xp', None), [], allow_rebaseline_modifier=False)
+ expectations = parser.parse('path', in_string)
if expected_string is None:
expected_string = in_string
self.assertEqual(expected_string, TestExpectationSerializer.list_to_string(expectations, self._converter))
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base.py b/Tools/Scripts/webkitpy/layout_tests/port/base.py
index cf7104c28..c6b5c6802 100755
--- a/Tools/Scripts/webkitpy/layout_tests/port/base.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/base.py
@@ -60,6 +60,7 @@ from webkitpy.layout_tests.port import driver
from webkitpy.layout_tests.port import http_lock
from webkitpy.layout_tests.port import image_diff
from webkitpy.layout_tests.port import server_process
+from webkitpy.layout_tests.port.factory import PortFactory
from webkitpy.layout_tests.servers import apache_http_server
from webkitpy.layout_tests.servers import http_server
from webkitpy.layout_tests.servers import websocket_server
@@ -158,6 +159,12 @@ class Port(object):
return 50 * 1000
return 35 * 1000
+ def driver_stop_timeout(self):
+ """ Returns the amount of time in seconds to wait before killing the process in driver.stop()."""
+ # We want to wait for at least 3 seconds, but if we are really slow, we want to be slow on cleanup as
+ # well (for things like ASAN, Valgrind, etc.)
+ return 3.0 * float(self.get_option('time_out_ms', '0')) / self.default_timeout_ms()
+
def wdiff_available(self):
if self._wdiff_available is None:
self._wdiff_available = self.check_wdiff(logging=False)
@@ -198,7 +205,7 @@ class Port(object):
def baseline_search_path(self):
- return self.get_option('additional_platform_directory', []) + self.default_baseline_search_path()
+ return self.get_option('additional_platform_directory', []) + self._compare_baseline() + self.default_baseline_search_path()
def default_baseline_search_path(self):
"""Return a list of absolute paths to directories to search under for
@@ -211,6 +218,14 @@ class Port(object):
search_paths.append(self.port_name)
return map(self._webkit_baseline_path, search_paths)
+ @memoized
+ def _compare_baseline(self):
+ factory = PortFactory(self.host)
+ target_port = self.get_option('compare_port')
+ if target_port:
+ return factory.get(target_port).default_baseline_search_path()
+ return []
+
def check_build(self, needs_http):
"""This routine is used to ensure that the build is up to date
and all the needed binaries are present."""
@@ -1099,15 +1114,6 @@ class Port(object):
def default_configuration(self):
return self._config.default_configuration()
- def process_kill_time(self):
- """ Returns the amount of time in seconds to wait before killing the process.
-
- Within server_process.stop there is a time delta before the test is explictly
- killed. By changing this the time can be extended in case the process needs
- more time to cleanly exit on its own.
- """
- return 3.0
-
#
# PROTECTED ROUTINES
#
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py
index 7106a20f5..64ba6003b 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py
@@ -173,6 +173,10 @@ class ChromiumAndroidPort(chromium.ChromiumPort):
# marked as slow tests on desktop platforms.
return 10 * 1000
+ def driver_stop_timeout(self):
+ # DRT doesn't respond to closing stdin, so we might as well stop the driver immediately.
+ return 0.0
+
def default_child_processes(self):
return len(self._get_devices())
@@ -262,7 +266,9 @@ class ChromiumAndroidPort(chromium.ChromiumPort):
def create_driver(self, worker_number, no_timeout=False):
# We don't want the default DriverProxy which is not compatible with our driver.
# See comments in ChromiumAndroidDriver.start().
- return ChromiumAndroidDriver(self, worker_number, pixel_tests=self.get_option('pixel_tests'), no_timeout=no_timeout)
+ return ChromiumAndroidDriver(self, worker_number, pixel_tests=self.get_option('pixel_tests'),
+ # Force no timeout to avoid DumpRenderTree timeouts before NRWT.
+ no_timeout=True)
def driver_cmd_line(self):
# Override to return the actual DumpRenderTree command line.
@@ -545,13 +551,13 @@ class ChromiumAndroidDriver(driver.Driver):
not self._file_exists_on_device(self._out_fifo_path) and
not self._file_exists_on_device(self._err_fifo_path))
- def run_test(self, driver_input):
+ def run_test(self, driver_input, stop_when_done):
base = self._port.lookup_virtual_test_base(driver_input.test_name)
if base:
driver_input = copy.copy(driver_input)
driver_input.args = self._port.lookup_virtual_test_args(driver_input.test_name)
driver_input.test_name = base
- return super(ChromiumAndroidDriver, self).run_test(driver_input)
+ return super(ChromiumAndroidDriver, self).run_test(driver_input, stop_when_done)
def start(self, pixel_tests, per_test_args):
# Only one driver instance is allowed because of the nature of Android activity.
@@ -657,15 +663,10 @@ class ChromiumAndroidDriver(driver.Driver):
self._read_stderr_process.kill()
self._read_stderr_process = None
- # Stop and kill server_process because our pipe reading/writing processes won't quit
- # by itself on close of the pipes.
- if self._server_process:
- self._server_process.stop(kill_directly=True)
- self._server_process = None
super(ChromiumAndroidDriver, self).stop()
if self._forwarder_process:
- self._forwarder_process.stop(kill_directly=True)
+ self._forwarder_process.kill()
self._forwarder_process = None
if not ChromiumAndroidDriver._loop_with_timeout(self._remove_all_pipes, DRT_START_STOP_TIMEOUT_SECS):
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/driver.py b/Tools/Scripts/webkitpy/layout_tests/port/driver.py
index 85049970b..c343c570d 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/driver.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/driver.py
@@ -136,7 +136,7 @@ class Driver(object):
def __del__(self):
self.stop()
- def run_test(self, driver_input):
+ def run_test(self, driver_input, stop_when_done):
"""Run a single test and return the results.
Note that it is okay if a test times out or crashes and leaves
@@ -158,14 +158,27 @@ class Driver(object):
text, audio = self._read_first_block(deadline) # First block is either text or audio
image, actual_image_hash = self._read_optional_image_block(deadline) # The second (optional) block is image data.
- # We may not have read all of the output if an error (crash) occured.
- # Since some platforms output the stacktrace over error, we should
- # dump any buffered error into self.error_from_test.
- # FIXME: We may need to also read stderr until the process dies?
- self.error_from_test += self._server_process.pop_all_buffered_stderr()
+ crashed = self.has_crashed()
+ timed_out = self._server_process.timed_out
+ if text and ('Timed out waiting for final message from web process' in text):
+ # FIXME: This is a hack to work around the issues in https://bugs.webkit.org/show_bug.cgi?id=94505.
+ # We need to either fix the underlying problem in WTR or return a more canonical error.
+ if not timed_out:
+ _log.warning("webprocess timed out but WTR didn't, killing WTR")
+ timed_out = True
+ else:
+ _log.warning("webprocess timed out and so did WTR")
+
+ if stop_when_done or crashed or timed_out:
+ # We call stop() even if we crashed or timed out in order to get any remaining stdout/stderr output.
+ # In the timeout case, we kill the hung process as well.
+ out, err = self._server_process.stop(self._port.driver_stop_timeout() if stop_when_done else 0.0)
+ text += out
+ self.error_from_test += err
+ self._server_process = None
crash_log = None
- if self.has_crashed():
+ if crashed:
self.error_from_test, crash_log = self._get_crash_log(text, self.error_from_test, newer_than=start_time)
# If we don't find a crash log use a placeholder error message instead.
@@ -175,15 +188,9 @@ class Driver(object):
if self._subprocess_was_unresponsive:
crash_log += ' Process failed to become responsive before timing out.'
- timeout = self._server_process.timed_out
- if timeout:
- # DRT doesn't have a built in timer to abort the test, so we might as well
- # kill the process directly and not wait for it to shut down cleanly (since it may not).
- self._server_process.kill()
-
return DriverOutput(text, image, actual_image_hash, audio,
- crash=self.has_crashed(), test_time=time.time() - test_begin_time,
- timeout=timeout, error=self.error_from_test,
+ crash=crashed, test_time=time.time() - test_begin_time,
+ timeout=timed_out, error=self.error_from_test,
crashed_process_name=self._crashed_process_name,
crashed_pid=self._crashed_pid, crash_log=crash_log)
@@ -273,7 +280,7 @@ class Driver(object):
def stop(self):
if self._server_process:
- self._server_process.stop()
+ self._server_process.stop(self._port.driver_stop_timeout())
self._server_process = None
if self._driver_tempdir:
@@ -476,20 +483,20 @@ class DriverProxy(object):
def uri_to_test(self, uri):
return self._driver.uri_to_test(uri)
- def run_test(self, driver_input):
+ def run_test(self, driver_input, stop_when_done):
base = self._port.lookup_virtual_test_base(driver_input.test_name)
if base:
virtual_driver_input = copy.copy(driver_input)
virtual_driver_input.test_name = base
virtual_driver_input.args = self._port.lookup_virtual_test_args(driver_input.test_name)
- return self.run_test(virtual_driver_input)
+ return self.run_test(virtual_driver_input, stop_when_done)
pixel_tests_needed = driver_input.should_run_pixel_test
cmd_line_key = self._cmd_line_as_key(pixel_tests_needed, driver_input.args)
if not cmd_line_key in self._running_drivers:
self._running_drivers[cmd_line_key] = self._make_driver(pixel_tests_needed)
- return self._running_drivers[cmd_line_key].run_test(driver_input)
+ return self._running_drivers[cmd_line_key].run_test(driver_input, stop_when_done)
def start(self):
# FIXME: Callers shouldn't normally call this, since this routine
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/driver_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/driver_unittest.py
index 5e2019b1b..2457c2ca0 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/driver_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/driver_unittest.py
@@ -182,7 +182,7 @@ class DriverTest(unittest.TestCase):
def has_crashed(self):
return self.crashed
- def stop(self):
+ def stop(self, timeout):
pass
def assert_crash(driver, error_line, crashed, name, pid, unresponsive=False):
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/efl.py b/Tools/Scripts/webkitpy/layout_tests/port/efl.py
index e5635744d..9301c4334 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/efl.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/efl.py
@@ -94,6 +94,16 @@ class EflPort(Port, PulseAudioSanitizer):
dyn_path = self._build_path('lib', 'libwebcore_efl.so')
return static_path if self._filesystem.exists(static_path) else dyn_path
+ def _search_paths(self):
+ search_paths = []
+ if self.get_option('webkit_test_runner'):
+ search_paths.append(self.port_name + '-wk2')
+ search_paths.append(self.port_name)
+ return search_paths
+
+ def expectations_files(self):
+ return list(reversed([self._filesystem.join(self._webkit_baseline_path(p), 'TestExpectations') for p in self._search_paths()]))
+
def show_results_html_file(self, results_filename):
# FIXME: We should find a way to share this implmentation with Gtk,
# or teach run-launcher how to call run-safari and move this down to WebKitPort.
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/server_process.py b/Tools/Scripts/webkitpy/layout_tests/port/server_process.py
index aa1e3024f..b772323b5 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/server_process.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/server_process.py
@@ -140,7 +140,7 @@ class ServerProcess(object):
try:
self._proc.stdin.write(bytes)
except IOError, e:
- self.stop()
+ self.stop(0.0)
# stop() calls _reset(), so we have to set crashed to True after calling stop().
self._crashed = True
@@ -213,12 +213,12 @@ class ServerProcess(object):
output, self._error = self._split_string_after_index(self._error, bytes_count)
return output
- def _wait_for_data_and_update_buffers_using_select(self, deadline):
+ def _wait_for_data_and_update_buffers_using_select(self, deadline, stopping=False):
out_fd = self._proc.stdout.fileno()
err_fd = self._proc.stderr.fileno()
select_fds = (out_fd, err_fd)
try:
- read_fds, _, _ = select.select(select_fds, [], select_fds, deadline - time.time())
+ read_fds, _, _ = select.select(select_fds, [], select_fds, max(deadline - time.time(), 0))
except select.error, e:
# We can ignore EINVAL since it's likely the process just crashed and we'll
# figure that out the next time through the loop in _read().
@@ -229,16 +229,22 @@ class ServerProcess(object):
try:
if out_fd in read_fds:
data = self._proc.stdout.read()
- if not data:
- _log.warning('unexpected EOF of stdout')
- self._crashed = True
+ if not data and not stopping:
+ if self._proc.poll() is not None:
+ _log.warning('unexpected EOF of stdout, %s crashed' % self._name)
+ self._crashed = True
+ else:
+ _log.warning('unexpected EOF of stdout, %s still alive' % self._name)
self._output += data
if err_fd in read_fds:
data = self._proc.stderr.read()
- if not data:
- _log.warning('unexpected EOF of stderr')
- self._crashed = True
+ if not data and not stopping:
+ if self._proc.poll() is not None:
+ _log.warning('unexpected EOF on stderr, %s crashed' % self._name)
+ self._crashed = True
+ else:
+ _log.warning('unexpected EOF on stderr, %s is still alive' % self._name)
self._error += data
except IOError, e:
# We can ignore the IOErrors because we will detect if the subporcess crashed
@@ -307,41 +313,44 @@ class ServerProcess(object):
if not self._proc:
self._start()
- def stop(self, kill_directly=False):
+ def stop(self, timeout_secs=3.0):
if not self._proc:
- return
+ return (None, None)
- # Only bother to check for leaks if the process is still running.
+ # Only bother to check for leaks or stderr if the process is still running.
if self.poll() is None:
self._port.check_for_leaks(self.name(), self.pid())
+ now = time.time()
self._proc.stdin.close()
- self._proc.stdout.close()
- if self._proc.stderr:
- self._proc.stderr.close()
-
- if kill_directly:
- self.kill()
+ if not timeout_secs:
+ self._kill()
elif not self._host.platform.is_win():
- # Closing stdin/stdout/stderr hangs sometimes on OS X,
- # and anyway we don't want to hang the harness if DumpRenderTree
- # is buggy, so we wait a couple seconds to give DumpRenderTree a
- # chance to clean up, but then force-kill the process if necessary.
- timeout = time.time() + self._port.process_kill_time()
- while self._proc.poll() is None and time.time() < timeout:
+ # FIXME: Why aren't we calling this on win?
+ deadline = now + timeout_secs
+ while self._proc.poll() is None and time.time() < deadline:
time.sleep(0.01)
if self._proc.poll() is None:
_log.warning('stopping %s timed out, killing it' % self._name)
- self.kill()
+ self._kill()
_log.warning('killed')
+
+ # read any remaining data on the pipes and return it.
+ if self._use_win32_apis:
+ self._wait_for_data_and_update_buffers_using_win32_apis(now)
+ else:
+ self._wait_for_data_and_update_buffers_using_select(now, stopping=True)
+ out, err = self._output, self._error
self._reset()
+ return (out, err)
def kill(self):
- if self._proc:
- self._host.executive.kill_process(self._proc.pid)
- if self._proc.poll() is not None:
- self._proc.wait()
- self._reset()
+ self.stop(0.0)
+
+ def _kill(self):
+ self._host.executive.kill_process(self._proc.pid)
+ if self._proc.poll() is not None:
+ self._proc.wait()
def replace_outputs(self, stdout, stderr):
assert self._proc
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/server_process_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/server_process_unittest.py
index db38615e0..48c41e6f2 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/server_process_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/server_process_unittest.py
@@ -41,6 +41,8 @@ from webkitpy.common.system.outputcapture import OutputCapture
class TrivialMockPort(object):
def __init__(self):
self.host = MockSystemHost()
+ self.host.executive.kill_process = lambda x: None
+ self.host.executive.kill_process = lambda x: None
def results_directory(self):
return "/mock-results"
@@ -77,6 +79,9 @@ class MockProc(object):
def poll(self):
return 1
+ def wait(self):
+ return 0
+
class FakeServerProcess(server_process.ServerProcess):
def _start(self):
@@ -114,7 +119,7 @@ class TestServerProcess(unittest.TestCase):
if line:
self.assertEquals(line.strip(), "stderr")
- proc.stop()
+ proc.stop(0)
def test_broken_pipe(self):
port_obj = TrivialMockPort()
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/test.py b/Tools/Scripts/webkitpy/layout_tests/port/test.py
index 6302120d2..cccb9ac1d 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/test.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/test.py
@@ -525,7 +525,7 @@ class TestDriver(Driver):
pixel_tests_flag = '-p' if pixel_tests else ''
return [self._port._path_to_driver()] + [pixel_tests_flag] + self._port.get_option('additional_drt_flag', []) + per_test_args
- def run_test(self, test_input):
+ def run_test(self, test_input, stop_when_done):
start_time = time.time()
test_name = test_input.test_name
test_args = test_input.args or []
@@ -563,6 +563,9 @@ class TestDriver(Driver):
crash_logs = CrashLogs(self._port.host)
crash_log = crash_logs.find_newest_log(crashed_process_name, None) or ''
+ if stop_when_done:
+ self.stop()
+
return DriverOutput(actual_text, test.actual_image, test.actual_checksum, audio,
crash=test.crash or test.web_process_crash, crashed_process_name=crashed_process_name,
crashed_pid=crashed_pid, crash_log=crash_log,
diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
index 06b3032ff..ddb0105c2 100755
--- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
+++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
@@ -331,6 +331,8 @@ def parse_args(args=None):
optparse.make_option("--additional-expectations", action="append", default=[],
help="Path to a test_expectations file that will override previous expectations. "
"Specify multiple times for multiple sets of overrides."),
+ optparse.make_option("--compare-port", action="store", default=None,
+ help="Use the specified port's baselines first"),
optparse.make_option("--no-show-results", action="store_false",
default=True, dest="show_results",
help="Don't launch a browser with results after the tests "
diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
index ecb58b89d..1f35857c4 100755
--- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
@@ -147,7 +147,7 @@ def get_tests_run(extra_args=None, tests_included=False, flatten_batches=False,
def stop(self):
self._current_test_batch = None
- def run_test(self, test_input):
+ def run_test(self, test_input, stop_when_done):
if self._current_test_batch is None:
self._current_test_batch = []
test_batches.append(self._current_test_batch)
@@ -159,7 +159,7 @@ def get_tests_run(extra_args=None, tests_included=False, flatten_batches=False,
dirname, filename = filesystem.split(test_name)
if include_reference_html or not Port.is_reference_html_file(filesystem, dirname, filename):
self._current_test_batch.append(test_name)
- return TestDriver.run_test(self, test_input)
+ return TestDriver.run_test(self, test_input, stop_when_done)
class RecordingTestPort(TestPort):
def create_driver(self, worker_number):
diff --git a/Tools/Scripts/webkitpy/performance_tests/perftest.py b/Tools/Scripts/webkitpy/performance_tests/perftest.py
index b111c9b4b..8ef945893 100644
--- a/Tools/Scripts/webkitpy/performance_tests/perftest.py
+++ b/Tools/Scripts/webkitpy/performance_tests/perftest.py
@@ -74,7 +74,7 @@ class PerfTest(object):
return self.parse_output(output)
def run_single(self, driver, path_or_url, time_out_ms, should_run_pixel_test=False):
- return driver.run_test(DriverInput(path_or_url, time_out_ms, image_hash=None, should_run_pixel_test=should_run_pixel_test))
+ return driver.run_test(DriverInput(path_or_url, time_out_ms, image_hash=None, should_run_pixel_test=should_run_pixel_test), stop_when_done=False)
def run_failed(self, output):
if output.text == None or output.error:
@@ -112,7 +112,7 @@ class PerfTest(object):
return False
_description_regex = re.compile(r'^Description: (?P<description>.*)$', re.IGNORECASE)
- _result_classes = ['Time', 'JS Heap', 'FastMalloc']
+ _result_classes = ['Time', 'JS Heap', 'Malloc']
_result_class_regex = re.compile(r'^(?P<resultclass>' + r'|'.join(_result_classes) + '):')
_statistics_keys = ['avg', 'median', 'stdev', 'min', 'max', 'unit']
_score_regex = re.compile(r'^(?P<key>' + r'|'.join(_statistics_keys) + r')\s+(?P<value>[0-9\.]+)\s*(?P<unit>.*)')
diff --git a/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py b/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py
index 47fe6231c..3b7c609ce 100755
--- a/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py
+++ b/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py
@@ -99,7 +99,7 @@ class TestPageLoadingPerfTest(unittest.TestCase):
self._values = values
self._index = 0
- def run_test(self, input):
+ def run_test(self, input, stop_when_done):
value = self._values[self._index]
self._index += 1
if isinstance(value, str):
@@ -141,8 +141,8 @@ class TestReplayPerfTest(unittest.TestCase):
def __init__(self, custom_run_test=None):
class ReplayTestDriver(TestDriver):
- def run_test(self, text_input):
- return custom_run_test(text_input) if custom_run_test else None
+ def run_test(self, text_input, stop_when_done):
+ return custom_run_test(text_input, stop_when_done) if custom_run_test else None
self._custom_driver_class = ReplayTestDriver
super(self.__class__, self).__init__(host=MockHost())
@@ -174,7 +174,7 @@ class TestReplayPerfTest(unittest.TestCase):
loaded_pages = []
- def run_test(test_input):
+ def run_test(test_input, stop_when_done):
if test_input.test_name != "about:blank":
self.assertEqual(test_input.test_name, 'http://some-test/')
loaded_pages.append(test_input)
@@ -243,7 +243,7 @@ class TestReplayPerfTest(unittest.TestCase):
loaded_pages = []
- def run_test(test_input):
+ def run_test(test_input, stop_when_done):
loaded_pages.append(test_input)
self._add_file(port, '/path/some-dir', 'some-test.wpr', 'wpr content')
return DriverOutput('actual text', 'actual image', 'actual checksum',
@@ -270,7 +270,7 @@ class TestReplayPerfTest(unittest.TestCase):
output_capture = OutputCapture()
output_capture.capture_output()
- def run_test(test_input):
+ def run_test(test_input, stop_when_done):
self._add_file(port, '/path/some-dir', 'some-test.wpr', 'wpr content')
return DriverOutput('actual text', 'actual image', 'actual checksum',
audio=None, crash=False, timeout=False, error=False)
diff --git a/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py b/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py
index ef459cd69..7e2f05ecd 100755
--- a/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py
+++ b/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py
@@ -49,7 +49,7 @@ class MainTest(unittest.TestCase):
self.assertEquals(stream.buflist, contents)
class TestDriver:
- def run_test(self, driver_input):
+ def run_test(self, driver_input, stop_when_done):
text = ''
timeout = False
crash = False
@@ -123,7 +123,7 @@ stdev 15000 bytes
min 811000 bytes
max 848000 bytes
-FastMalloc:
+Malloc:
avg 532000 bytes
median 529000 bytes
stdev 13000 bytes
@@ -274,13 +274,13 @@ max 548000 bytes
'median= 1101.0 ms, stdev= 11.0 ms, min= 1080.0 ms, max= 1120.0 ms',
'RESULT Parser: memory-test: JSHeap= 832000.0 bytes',
'median= 829000.0 bytes, stdev= 15000.0 bytes, min= 811000.0 bytes, max= 848000.0 bytes',
- 'RESULT Parser: memory-test: FastMalloc= 532000.0 bytes',
+ 'RESULT Parser: memory-test: Malloc= 532000.0 bytes',
'median= 529000.0 bytes, stdev= 13000.0 bytes, min= 511000.0 bytes, max= 548000.0 bytes',
'', '']))
results = runner.load_output_json()[0]['results']
self.assertEqual(results['Parser/memory-test'], {'min': 1080.0, 'max': 1120.0, 'median': 1101.0, 'stdev': 11.0, 'avg': 1100.0, 'unit': 'ms'})
self.assertEqual(results['Parser/memory-test:JSHeap'], {'min': 811000.0, 'max': 848000.0, 'median': 829000.0, 'stdev': 15000.0, 'avg': 832000.0, 'unit': 'bytes'})
- self.assertEqual(results['Parser/memory-test:FastMalloc'], {'min': 511000.0, 'max': 548000.0, 'median': 529000.0, 'stdev': 13000.0, 'avg': 532000.0, 'unit': 'bytes'})
+ self.assertEqual(results['Parser/memory-test:Malloc'], {'min': 511000.0, 'max': 548000.0, 'median': 529000.0, 'stdev': 13000.0, 'avg': 532000.0, 'unit': 'bytes'})
def _test_run_with_json_output(self, runner, filesystem, upload_suceeds=True, expected_exit_code=0):
filesystem.write_text_file(runner._base_path + '/inspector/pass.html', 'some content')
diff --git a/Tools/Scripts/webkitpy/style/checkers/cpp.py b/Tools/Scripts/webkitpy/style/checkers/cpp.py
index 78cd88250..45c49aab4 100644
--- a/Tools/Scripts/webkitpy/style/checkers/cpp.py
+++ b/Tools/Scripts/webkitpy/style/checkers/cpp.py
@@ -2747,6 +2747,10 @@ def check_include_line(filename, file_extension, clean_lines, line_number, inclu
error(line_number, 'build/include', 4,
'wtf includes should be <wtf/file.h> instead of "wtf/file.h".')
+ if filename.find('/chromium/') != -1 and include.startswith('cc/CC'):
+ error(line_number, 'build/include', 4,
+ 'cc includes should be "CCFoo.h" instead of "cc/CCFoo.h".')
+
duplicate_header = include in include_state
if duplicate_header:
error(line_number, 'build/include', 4,
diff --git a/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py b/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
index 339897fe8..a5a94b793 100644
--- a/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
+++ b/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
@@ -2736,6 +2736,15 @@ class OrderOfIncludesTest(CppStyleTestBase):
'wtf includes should be <wtf/file.h> instead of "wtf/file.h".'
' [build/include] [4]')
+ def test_check_cc_includes(self):
+ self.assert_language_rules_check('bar/chromium/foo.cpp',
+ '#include "config.h"\n'
+ '#include "foo.h"\n'
+ '\n'
+ '#include "cc/CCProxy.h"\n',
+ 'cc includes should be "CCFoo.h" instead of "cc/CCFoo.h".'
+ ' [build/include] [4]')
+
def test_classify_include(self):
classify_include = cpp_style._classify_include
include_state = cpp_style._IncludeState()
diff --git a/Tools/Scripts/webkitpy/tool/commands/perfalizer.py b/Tools/Scripts/webkitpy/tool/commands/perfalizer.py
index b9fc6fe5b..ae9f63a65 100644
--- a/Tools/Scripts/webkitpy/tool/commands/perfalizer.py
+++ b/Tools/Scripts/webkitpy/tool/commands/perfalizer.py
@@ -72,7 +72,7 @@ class PerfalizerTask(PatchAnalysisTask):
head_revision = self._tool.scm().head_svn_revision()
self._logger('Building WebKit at r%s without the patch' % head_revision)
- if not self._build():
+ if not self._build_without_patch():
return False
if not self._port.check_build(needs_http=False):
@@ -96,11 +96,11 @@ class PerfalizerTask(PatchAnalysisTask):
filesystem.remove(self._json_path())
self._logger("Running performance tests...")
- if self._run_perf_test(self._build_directory_without_patch) < 0:
+ if self._run_perf_test(self._build_directory_without_patch, 'without %d' % self._patch.id()) < 0:
self._logger('Failed to run performance tests without the patch.')
return False
- if self._run_perf_test(self._build_directory) < 0:
+ if self._run_perf_test(self._build_directory, 'with %d' % self._patch.id()) < 0:
self._logger('Failed to run performance tests with the patch.')
return False
@@ -129,11 +129,11 @@ class PerfalizerTask(PatchAnalysisTask):
def _results_page_path(self):
return self._tool.filesystem.join(self._build_directory, 'PerformanceTestResults.html')
- def _run_perf_test(self, build_path):
+ def _run_perf_test(self, build_path, description):
filesystem = self._tool.filesystem
script_path = filesystem.join(filesystem.dirname(self._tool.path()), 'run-perf-tests')
perf_test_runner_args = [script_path, '--no-build', '--no-show-results', '--build-directory', build_path,
- '--output-json-path', self._json_path()]
+ '--output-json-path', self._json_path(), '--description', description]
return self._tool.executive.run_and_throw_if_fail(perf_test_runner_args, cwd=self._tool.scm().checkout_root)
def run_command(self, command):
diff --git a/Tools/Scripts/webkitpy/tool/commands/perfalizer_unittest.py b/Tools/Scripts/webkitpy/tool/commands/perfalizer_unittest.py
index f519e3f78..feb7b05b3 100644
--- a/Tools/Scripts/webkitpy/tool/commands/perfalizer_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/commands/perfalizer_unittest.py
@@ -50,7 +50,8 @@ class PerfalizerTaskTest(unittest.TestCase):
if args[0] in commands_to_fail:
raise ScriptError
- def run_perf_test(build_path):
+ def run_perf_test(build_path, description):
+ self.assertTrue(description == 'without 10000' or description == 'with 10000')
if 'run-perf-tests' in commands_to_fail:
return -1
if 'results-page' not in commands_to_fail:
diff --git a/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py b/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
index 09b45ba55..115249916 100644
--- a/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
@@ -217,8 +217,8 @@ class PrintExpectationsTest(unittest.TestCase):
def test_csv(self):
self.run_test(['failures/expected/text.html', 'failures/expected/image.html'],
- ('test-win-xp,failures/expected/image.html,wontfix,image\n'
- 'test-win-xp,failures/expected/text.html,wontfix,text\n'),
+ ('test-win-xp,failures/expected/image.html,WONTFIX,IMAGE\n'
+ 'test-win-xp,failures/expected/text.html,WONTFIX,TEXT\n'),
csv=True)
diff --git a/Tools/TestResultServer/static-dashboards/builders.js b/Tools/TestResultServer/static-dashboards/builders.js
index f6dbdf564..044f94795 100644
--- a/Tools/TestResultServer/static-dashboards/builders.js
+++ b/Tools/TestResultServer/static-dashboards/builders.js
@@ -52,14 +52,19 @@ CHROMIUM_LINUX_BUILDER_MASTER = new BuilderMaster('ChromiumLinux', 'http://build
CHROMIUMOS_BUILDER_MASTER = new BuilderMaster('ChromiumChromiumOS', 'http://build.chromium.org/p/chromium.chromiumos/');
CHROMIUM_GPU_BUILDER_MASTER = new BuilderMaster('ChromiumGPU', 'http://build.chromium.org/p/chromium.gpu/');
CHROMIUM_GPU_FYI_BUILDER_MASTER = new BuilderMaster('ChromiumGPUFYI', 'http://build.chromium.org/p/chromium.gpu.fyi/');
+CHROMIUM_PERF_AV_BUILDER_MASTER = new BuilderMaster('ChromiumPerfAv', 'http://build.chromium.org/p/chromium.perf_av/');
CHROMIUM_WEBKIT_BUILDER_MASTER = new BuilderMaster('ChromiumWebkit', 'http://build.chromium.org/p/chromium.webkit/');
WEBKIT_BUILDER_MASTER = new BuilderMaster('webkit.org', 'http://build.webkit.org/');
var LEGACY_BUILDER_MASTERS_TO_GROUPS = {
'Chromium': '@DEPS - chromium.org',
+ 'ChromiumWin': '@DEPS - chromium.org',
+ 'ChromiumMac': '@DEPS - chromium.org',
+ 'ChromiumLinux': '@DEPS - chromium.org',
'ChromiumChromiumOS': '@DEPS CrOS - chromium.org',
'ChromiumGPU': '@DEPS - chromium.org',
'ChromiumGPUFYI': '@DEPS FYI - chromium.org',
+ 'ChromiumPerfAv': '@DEPS - chromium.org',
'ChromiumWebkit': '@ToT - chromium.org',
'webkit.org': '@ToT - webkit.org'
};
@@ -131,11 +136,11 @@ function doXHR(url, onLoad, builderGroups, groupName)
xhr.send();
}
-function requestBuilderList(builderGroups, builderFilter, master, groupName, groupEnum, builderGroup)
+function requestBuilderList(builderGroups, builderFilter, master, groupName, builderGroup)
{
if (!builderGroups[groupName])
builderGroups[groupName] = builderGroup;
- var onLoad = partial(onBuilderListLoad, builderGroups, builderFilter, master, groupName, groupEnum);
+ var onLoad = partial(onBuilderListLoad, builderGroups, builderFilter, master, groupName);
doXHR(master.builderJsonPath(), onLoad, builderGroups, groupName);
builderGroups[groupName].expectedGroups += 1;
}
@@ -167,7 +172,7 @@ function isWebkitTestRunner(builder)
function isChromiumWebkitTipOfTreeTestRunner(builder)
{
- return builder.indexOf('Webkit') != -1 && builder.indexOf('Builder') == -1 && builder.indexOf('(deps)') == -1 && builder.indexOf('ASAN') == -1;
+ return (builder.indexOf('Webkit') != -1 && builder.indexOf('Builder') == -1 && builder.indexOf('(deps)') == -1 && builder.indexOf('ASAN') == -1) || builder.indexOf('(Content Shell)') != -1;
}
function isChromiumWebkitDepsTestRunner(builder)
@@ -191,6 +196,11 @@ function isChromiumTipOfTreeGTestRunner(builder)
builder.indexOf('Webkit') == -1 && builder.indexOf('Valgrind') == -1 && builder.indexOf('Chrome Frame') == -1;
}
+function isChromiumDepsAVTestRunner(builder)
+{
+ return builder.indexOf('Builder') == -1;
+}
+
function generateBuildersFromBuilderList(builderList, filter)
{
return builderList.filter(filter).map(function(tester, index) {
@@ -201,7 +211,7 @@ function generateBuildersFromBuilderList(builderList, filter)
});
}
-function onBuilderListLoad(builderGroups, builderFilter, master, groupName, groupEnum, json)
+function onBuilderListLoad(builderGroups, builderFilter, master, groupName, json)
{
var builders = generateBuildersFromBuilderList(Object.keys(json), builderFilter);
associateBuildersWithMaster(builders, master);
@@ -223,17 +233,17 @@ function loadBuildersList(groupName, testType) {
switch(groupName) {
case '@DEPS - chromium.org':
var builderGroup = new BuilderGroup(BuilderGroup.DEPS_WEBKIT);
- requestBuilderList(CHROMIUM_GPU_TESTS_BUILDER_GROUPS, isChromiumDepsGpuTestRunner, CHROMIUM_GPU_BUILDER_MASTER, groupName, BuilderGroup.DEPS_WEBKIT, builderGroup);
+ requestBuilderList(CHROMIUM_GPU_TESTS_BUILDER_GROUPS, isChromiumDepsGpuTestRunner, CHROMIUM_GPU_BUILDER_MASTER, groupName, builderGroup);
break;
case '@DEPS FYI - chromium.org':
var builderGroup = new BuilderGroup(BuilderGroup.DEPS_WEBKIT);
- requestBuilderList(CHROMIUM_GPU_TESTS_BUILDER_GROUPS, isChromiumDepsFyiGpuTestRunner, CHROMIUM_GPU_FYI_BUILDER_MASTER, groupName, BuilderGroup.DEPS_WEBKIT, builderGroup);
+ requestBuilderList(CHROMIUM_GPU_TESTS_BUILDER_GROUPS, isChromiumDepsFyiGpuTestRunner, CHROMIUM_GPU_FYI_BUILDER_MASTER, groupName, builderGroup);
break;
case '@ToT - chromium.org':
var builderGroup = new BuilderGroup(BuilderGroup.TOT_WEBKIT);
- requestBuilderList(CHROMIUM_GPU_TESTS_BUILDER_GROUPS, isChromiumTipOfTreeGpuTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, groupName, BuilderGroup.TOT_WEBKIT, builderGroup);
+ requestBuilderList(CHROMIUM_GPU_TESTS_BUILDER_GROUPS, isChromiumTipOfTreeGpuTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, groupName, builderGroup);
break;
}
break;
@@ -242,17 +252,18 @@ function loadBuildersList(groupName, testType) {
switch(groupName) {
case '@ToT - chromium.org':
var builderGroup = new BuilderGroup(BuilderGroup.TOT_WEBKIT);
- requestBuilderList(LAYOUT_TESTS_BUILDER_GROUPS, isChromiumWebkitTipOfTreeTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, groupName, BuilderGroup.TOT_WEBKIT, builderGroup);
+ requestBuilderList(LAYOUT_TESTS_BUILDER_GROUPS, isChromiumWebkitTipOfTreeTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, groupName, builderGroup);
break;
case '@ToT - webkit.org':
var builderGroup = new BuilderGroup(BuilderGroup.TOT_WEBKIT);
- requestBuilderList(LAYOUT_TESTS_BUILDER_GROUPS, isWebkitTestRunner, WEBKIT_BUILDER_MASTER, groupName, BuilderGroup.TOT_WEBKIT, builderGroup);
+ requestBuilderList(LAYOUT_TESTS_BUILDER_GROUPS, isWebkitTestRunner, WEBKIT_BUILDER_MASTER, groupName, builderGroup);
break;
case '@DEPS - chromium.org':
var builderGroup = new BuilderGroup(BuilderGroup.DEPS_WEBKIT);
- requestBuilderList(LAYOUT_TESTS_BUILDER_GROUPS, isChromiumWebkitDepsTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, groupName, BuilderGroup.DEPS_WEBKIT, builderGroup);
+ requestBuilderList(LAYOUT_TESTS_BUILDER_GROUPS, isChromiumWebkitDepsTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, groupName, builderGroup);
+ requestBuilderList(LAYOUT_TESTS_BUILDER_GROUPS, isChromiumDepsAVTestRunner, CHROMIUM_PERF_AV_BUILDER_MASTER, groupName, builderGroup);
break;
}
break;
@@ -261,20 +272,20 @@ function loadBuildersList(groupName, testType) {
switch(groupName) {
case '@DEPS - chromium.org':
var builderGroup = new BuilderGroup(BuilderGroup.DEPS_WEBKIT);
- requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsGTestRunner, CHROMIUM_BUILDER_MASTER, groupName, BuilderGroup.DEPS_WEBKIT, builderGroup);
- requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsGTestRunner, CHROMIUM_WIN_BUILDER_MASTER, groupName, BuilderGroup.DEPS_WEBKIT, builderGroup);
- requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsGTestRunner, CHROMIUM_MAC_BUILDER_MASTER, groupName, BuilderGroup.DEPS_WEBKIT, builderGroup);
- requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsGTestRunner, CHROMIUM_LINUX_BUILDER_MASTER, groupName, BuilderGroup.DEPS_WEBKIT, builderGroup);
+ requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsGTestRunner, CHROMIUM_BUILDER_MASTER, groupName, builderGroup);
+ requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsGTestRunner, CHROMIUM_WIN_BUILDER_MASTER, groupName, builderGroup);
+ requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsGTestRunner, CHROMIUM_MAC_BUILDER_MASTER, groupName, builderGroup);
+ requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsGTestRunner, CHROMIUM_LINUX_BUILDER_MASTER, groupName, builderGroup);
break;
case '@DEPS CrOS - chromium.org':
var builderGroup = new BuilderGroup(BuilderGroup.DEPS_WEBKIT);
- requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsCrosGTestRunner, CHROMIUMOS_BUILDER_MASTER, groupName, BuilderGroup.DEPS_WEBKIT, builderGroup);
+ requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsCrosGTestRunner, CHROMIUMOS_BUILDER_MASTER, groupName, builderGroup);
break;
case '@ToT - chromium.org':
var builderGroup = new BuilderGroup(BuilderGroup.TOT_WEBKIT);
- requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumTipOfTreeGTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, groupName, BuilderGroup.TOT_WEBKIT, builderGroup);
+ requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumTipOfTreeGTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, groupName, builderGroup);
break;
}
break;
diff --git a/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js b/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js
index fec4c4d2c..32d2af225 100644
--- a/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js
+++ b/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js
@@ -523,9 +523,10 @@ test('generateChromiumWebkitTipOfTreeBuildersFromBuilderList', 1, function() {
"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.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"];
+ "Webkit Win Builder (deps)", "Webkit Win7", "Win (dbg)", "Win Builder",
+ "Linux (Content Shell)"];
var expectedBuilders = [["Webkit Linux", 2], ["Webkit Linux (dbg)"], ["Webkit Linux 32"], ["Webkit Mac10.6"],
- ["Webkit Mac10.6 (dbg)"], ["Webkit Mac10.7"], ["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"], ["Linux (Content Shell)"]];
deepEqual(generateBuildersFromBuilderList(builderList, isChromiumWebkitTipOfTreeTestRunner), expectedBuilders);
});
diff --git a/Tools/TestWebKitAPI/PlatformEfl.cmake b/Tools/TestWebKitAPI/PlatformEfl.cmake
index 4c4c90284..62f865ce5 100644
--- a/Tools/TestWebKitAPI/PlatformEfl.cmake
+++ b/Tools/TestWebKitAPI/PlatformEfl.cmake
@@ -8,7 +8,7 @@ ADD_CUSTOM_TARGET(forwarding-headersSoupForTestWebKitAPI
)
SET(ForwardingNetworkHeadersForTestWebKitAPI_NAME forwarding-headersSoupForTestWebKitAPI)
-INCLUDE_DIRECTORIES(${LIBSOUP24_INCLUDE_DIRS}
+INCLUDE_DIRECTORIES(${LIBSOUP_INCLUDE_DIRS}
${WEBKIT2_DIR}/UIProcess/API/C/soup
${WEBKIT2_DIR}/UIProcess/API/C/efl
${ECORE_INCLUDE_DIRS}
diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp b/Tools/TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp
index e84386f18..819a79d0d 100644
--- a/Tools/TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp
+++ b/Tools/TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp
@@ -107,6 +107,13 @@
'input_jars_paths': [
'<(PRODUCT_DIR)/lib.java/chromium_base.jar',
],
+ 'conditions': [
+ ['inside_chromium_build==1', {
+ 'ant_build_to_chromium_src': '<(ant_build_out)/../../',
+ }, {
+ 'ant_build_to_chromium_src': '<(chromium_src_dir)',
+ }],
+ ],
},
# Part of the following was copied from <(chromium_src_dir)/build/apk_test.gpyi.
# Not including it because gyp include doesn't support variable in path or under
@@ -131,6 +138,7 @@
'"<@(input_jars_paths)"',
'--output',
'<(PRODUCT_DIR)/TestWebKitAPI_apk',
+ '--strip-binary=<(android_strip)',
'--ant-args',
'-DANDROID_SDK=<(android_sdk)',
'--ant-args',
@@ -143,6 +151,8 @@
'-DANDROID_TOOLCHAIN=<(android_toolchain)',
'--ant-args',
'-DPRODUCT_DIR=<(ant_build_out)',
+ '--ant-args',
+ '-DCHROMIUM_SRC=<(ant_build_to_chromium_src)',
'--sdk-build=<(sdk_build)',
'--app_abi',
'<(android_app_abi)',
diff --git a/Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp b/Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp
index 3f02a0f67..d6d48fc61 100644
--- a/Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp
+++ b/Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp
@@ -149,7 +149,7 @@ TEST(WTF, MediaTime)
EXPECT_EQ(MediaTime(3, 2).toDouble(), 1.5);
EXPECT_EQ(MediaTime(1, 1 << 16).toFloat(), 1 / pow(2.0f, 16.0f));
EXPECT_EQ(MediaTime(1, 1 << 30).toDouble(), 1 / pow(2.0, 30.0));
- EXPECT_EQ(MediaTime::createWithDouble(M_PI, 1 << 30), MediaTime(3373259426, 1 << 30));
+ EXPECT_EQ(MediaTime::createWithDouble(M_PI, 1 << 30), MediaTime(3373259426U, 1 << 30));
EXPECT_EQ(MediaTime::createWithFloat(INFINITY), MediaTime::positiveInfiniteTime());
EXPECT_EQ(MediaTime::createWithFloat(-INFINITY), MediaTime::negativeInfiniteTime());
EXPECT_EQ(MediaTime::createWithFloat(NAN), MediaTime::invalidTime());
diff --git a/Tools/Tools.pro b/Tools/Tools.pro
index 9590c53a9..749013c34 100644
--- a/Tools/Tools.pro
+++ b/Tools/Tools.pro
@@ -9,13 +9,13 @@ CONFIG += ordered
!no_webkit1 {
SUBDIRS += QtTestBrowser/QtTestBrowser.pro
- SUBDIRS += DumpRenderTree/qt/DumpRenderTree.pro
+ contains(DEFINES, HAVE_QTTESTLIB=1): SUBDIRS += DumpRenderTree/qt/DumpRenderTree.pro
SUBDIRS += DumpRenderTree/qt/ImageDiff.pro
}
!no_webkit2 {
# WTR's InjectedBundle depends currently on WK1's DumpRenderTreeSupport
- !no_webkit1:contains(DEFINES, HAVE_QTQUICK=1): SUBDIRS += WebKitTestRunner/WebKitTestRunner.pro
+ !no_webkit1:contains(DEFINES, HAVE_QTQUICK=1):contains(DEFINES, HAVE_QTTESTLIB=1): SUBDIRS += WebKitTestRunner/WebKitTestRunner.pro
contains(DEFINES, HAVE_QTQUICK=1): SUBDIRS += MiniBrowser/qt/MiniBrowser.pro
SUBDIRS += MiniBrowser/qt/raw/MiniBrowserRaw.pro
diff --git a/Tools/WebKitTestRunner/CMakeLists.txt b/Tools/WebKitTestRunner/CMakeLists.txt
index badc2c471..4950fd9a9 100644
--- a/Tools/WebKitTestRunner/CMakeLists.txt
+++ b/Tools/WebKitTestRunner/CMakeLists.txt
@@ -42,7 +42,7 @@ SET(WebKitTestRunner_INCLUDE_DIRECTORIES
${DERIVED_SOURCES_DIR}/InjectedBundle
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/Source
- ${LIBSOUP24_INCLUDE_DIRS}
+ ${LIBSOUP_INCLUDE_DIRS}
)
SET(WebKitTestRunnerInjectedBundle_SOURCES
@@ -55,7 +55,7 @@ SET(WebKitTestRunnerInjectedBundle_SOURCES
${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/InjectedBundle.cpp
${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/InjectedBundleMain.cpp
${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/InjectedBundlePage.cpp
- ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/LayoutTestController.cpp
+ ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/TestRunner.cpp
${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/TextInputController.cpp
${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/JSWrapper.cpp
diff --git a/Tools/WebKitTestRunner/DerivedSources.make b/Tools/WebKitTestRunner/DerivedSources.make
index 187d41c4f..501df5911 100644
--- a/Tools/WebKitTestRunner/DerivedSources.make
+++ b/Tools/WebKitTestRunner/DerivedSources.make
@@ -32,7 +32,7 @@ INTERFACES = \
AccessibilityUIElement \
EventSendingController \
GCController \
- LayoutTestController \
+ TestRunner \
TextInputController \
#
diff --git a/Tools/WebKitTestRunner/GNUmakefile.am b/Tools/WebKitTestRunner/GNUmakefile.am
index 723ce77ee..85ad427de 100644
--- a/Tools/WebKitTestRunner/GNUmakefile.am
+++ b/Tools/WebKitTestRunner/GNUmakefile.am
@@ -72,7 +72,7 @@ webkittestrunner_built_sources += \
DerivedSources/InjectedBundle/JSAccessibilityUIElement.cpp \
DerivedSources/InjectedBundle/JSEventSendingController.cpp \
DerivedSources/InjectedBundle/JSGCController.cpp \
- DerivedSources/InjectedBundle/JSLayoutTestController.cpp \
+ DerivedSources/InjectedBundle/JSTestRunner.cpp \
DerivedSources/InjectedBundle/JSTextInputController.cpp
nodist_Libraries_libTestRunnerInjectedBundle_la_SOURCES = $(webkittestrunner_built_sources)
BUILT_SOURCES += $(webkittestrunner_built_sources)
@@ -98,14 +98,14 @@ Libraries_libTestRunnerInjectedBundle_la_SOURCES = \
Tools/WebKitTestRunner/InjectedBundle/gtk/AccessibilityUIElementGtk.cpp \
Tools/WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp \
Tools/WebKitTestRunner/InjectedBundle/gtk/InjectedBundleGtk.cpp \
- Tools/WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp \
+ Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp \
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp \
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h \
Tools/WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp \
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp \
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h \
- Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp \
- Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h \
+ Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp \
+ Tools/WebKitTestRunner/InjectedBundle/TestRunner.h \
Tools/WebKitTestRunner/InjectedBundle/TextInputController.cpp \
Tools/WebKitTestRunner/InjectedBundle/TextInputController.h
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
index df608da3a..ff91579e1 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
@@ -25,7 +25,7 @@
module WTR {
- interface LayoutTestController {
+ interface TestRunner {
// The basics.
void dumpAsText(in boolean dumpPixels);
void dumpChildFramesAsText();
@@ -44,6 +44,7 @@ module WTR {
void dumpFullScreenCallbacks();
void dumpFrameLoadCallbacks();
void dumpProgressFinishedCallback();
+ void dumpResourceLoadCallbacks();
void dumpResourceResponseMIMETypes();
// Special options.
diff --git a/Tools/WebKitTestRunner/InjectedBundle/DerivedSources.pri b/Tools/WebKitTestRunner/InjectedBundle/DerivedSources.pri
index 07cdc6719..15211830c 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/DerivedSources.pri
+++ b/Tools/WebKitTestRunner/InjectedBundle/DerivedSources.pri
@@ -18,7 +18,7 @@ IDL_BINDINGS += \
Bindings/AccessibilityUIElement.idl \
Bindings/EventSendingController.idl \
Bindings/GCController.idl \
- Bindings/LayoutTestController.idl \
+ Bindings/TestRunner.idl \
Bindings/TextInputController.idl \
# GENERATOR 1: IDL compiler
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
index 002e7f901..a44cc54d6 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
@@ -169,19 +169,19 @@ void InjectedBundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messag
return;
}
if (WKStringIsEqualToUTF8CString(messageName, "CallAddChromeInputFieldCallback")) {
- m_layoutTestController->callAddChromeInputFieldCallback();
+ m_testRunner->callAddChromeInputFieldCallback();
return;
}
if (WKStringIsEqualToUTF8CString(messageName, "CallRemoveChromeInputFieldCallback")) {
- m_layoutTestController->callRemoveChromeInputFieldCallback();
+ m_testRunner->callRemoveChromeInputFieldCallback();
return;
}
if (WKStringIsEqualToUTF8CString(messageName, "CallFocusWebViewCallback")) {
- m_layoutTestController->callFocusWebViewCallback();
+ m_testRunner->callFocusWebViewCallback();
return;
}
if (WKStringIsEqualToUTF8CString(messageName, "CallSetBackingScaleFactorCallback")) {
- m_layoutTestController->callSetBackingScaleFactorCallback();
+ m_testRunner->callSetBackingScaleFactorCallback();
return;
}
@@ -211,7 +211,7 @@ void InjectedBundle::beginTesting(WKDictionaryRef settings)
m_repaintRects.clear();
m_stringBuilder->clear();
- m_layoutTestController = LayoutTestController::create();
+ m_testRunner = TestRunner::create();
m_gcController = GCController::create();
m_eventSendingController = EventSendingController::create();
m_textInputController = TextInputController::create();
@@ -228,7 +228,7 @@ void InjectedBundle::beginTesting(WKDictionaryRef settings)
WKBundleRemoveAllUserContent(m_bundle, m_pageGroup);
- m_layoutTestController->setShouldDumpFrameLoadCallbacks(booleanForKey(settings, "DumpFrameLoadDelegates"));
+ m_testRunner->setShouldDumpFrameLoadCallbacks(booleanForKey(settings, "DumpFrameLoadDelegates"));
page()->prepare();
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
index 26bedc45d..5309900da 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
@@ -29,7 +29,7 @@
#include "AccessibilityController.h"
#include "EventSendingController.h"
#include "GCController.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include "TextInputController.h"
#include <WebKit2/WKBase.h>
#include <WebKit2/WKRetainPtr.h>
@@ -57,7 +57,7 @@ public:
WKBundleRef bundle() const { return m_bundle; }
WKBundlePageGroupRef pageGroup() const { return m_pageGroup; }
- LayoutTestController* layoutTestController() { return m_layoutTestController.get(); }
+ TestRunner* testRunner() { return m_testRunner.get(); }
GCController* gcController() { return m_gcController.get(); }
EventSendingController* eventSendingController() { return m_eventSendingController.get(); }
TextInputController* textInputController() { return m_textInputController.get(); }
@@ -115,7 +115,7 @@ private:
Vector<OwnPtr<InjectedBundlePage> > m_pages;
RefPtr<AccessibilityController> m_accessibilityController;
- RefPtr<LayoutTestController> m_layoutTestController;
+ RefPtr<TestRunner> m_testRunner;
RefPtr<GCController> m_gcController;
RefPtr<EventSendingController> m_eventSendingController;
RefPtr<TextInputController> m_textInputController;
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index de32cb08d..7d2cb9823 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -42,6 +42,7 @@
#include <WebKit2/WKBundleNodeHandlePrivate.h>
#include <WebKit2/WKBundlePagePrivate.h>
#include <WebKit2/WKURLRequest.h>
+#include <wtf/HashMap.h>
#include <wtf/text/CString.h>
#include <wtf/text/StringBuilder.h>
@@ -50,8 +51,8 @@
#endif
#if ENABLE(WEB_INTENTS)
+#include <WebKit2/WKBundleIntent.h>
#include <WebKit2/WKBundleIntentRequest.h>
-#include <WebKit2/WKIntentData.h>
#endif
#if ENABLE(WEB_INTENTS_TAG)
#include <WebKit2/WKIntentServiceInfo.h>
@@ -215,6 +216,58 @@ static WTF::String frameToStr(WKBundleFrameRef frame)
return stringBuilder.toString();
}
+static inline bool isLocalFileScheme(WKStringRef scheme)
+{
+ return WKStringIsEqualToUTF8CStringIgnoringCase(scheme, "file");
+}
+
+static const char divider = '/';
+
+static inline WTF::String pathSuitableForTestResult(WKURLRef fileUrl)
+{
+ if (!fileUrl)
+ return String();
+
+ WKRetainPtr<WKStringRef> schemeString = adoptWK(WKURLCopyScheme(fileUrl));
+ if (!isLocalFileScheme(schemeString.get()))
+ return toWTFString(adoptWK(WKURLCopyString(fileUrl)));
+
+ String pathString = toWTFString(adoptWK(WKURLCopyPath(fileUrl)));
+ WTF::StringBuilder stringBuilder;
+
+ // Remove the leading path from file urls.
+ const size_t indexBaseName = pathString.reverseFind(divider);
+ if (indexBaseName != notFound) {
+ const size_t indexDirName = pathString.reverseFind(divider, indexBaseName - 1);
+ if (indexDirName != notFound)
+ stringBuilder.append(pathString.substring(indexDirName + 1, indexBaseName - indexDirName - 1));
+ stringBuilder.append(divider);
+ stringBuilder.append(pathString.substring(indexBaseName + 1)); // Filename.
+ } else {
+ stringBuilder.append(divider);
+ stringBuilder.append(pathString); // Return "/pathString".
+ }
+
+ return stringBuilder.toString();
+}
+
+static inline WTF::String urlSuitableForTestResult(WKURLRef fileUrl)
+{
+ if (!fileUrl)
+ return String();
+
+ WKRetainPtr<WKStringRef> schemeString = adoptWK(WKURLCopyScheme(fileUrl));
+ if (!isLocalFileScheme(schemeString.get()))
+ return toWTFString(adoptWK(WKURLCopyString(fileUrl)));
+
+ WTF::String urlString = toWTFString(adoptWK(WKURLCopyString(fileUrl)));
+ const size_t indexBaseName = urlString.reverseFind(divider);
+
+ return (indexBaseName == notFound) ? urlString : urlString.substring(indexBaseName + 1);
+}
+
+static HashMap<uint64_t, String> assignedUrlsCache;
+
InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
: m_page(page)
, m_world(AdoptWK, WKBundleScriptWorldCreateWorld())
@@ -366,6 +419,7 @@ void InjectedBundlePage::resetAfterTest()
#else
WebCoreTestSupport::resetInternalsObject(context);
#endif
+ assignedUrlsCache.clear();
}
// Loader Client Callbacks
@@ -396,6 +450,70 @@ static void dumpFrameDescriptionSuitableForTestResult(WKBundleFrameRef frame)
InjectedBundle::shared().stringBuilder()->append("\"");
}
+static inline void dumpRequestDescriptionSuitableForTestResult(WKURLRequestRef request)
+{
+ WKRetainPtr<WKURLRef> url = adoptWK(WKURLRequestCopyURL(request));
+ WKRetainPtr<WKURLRef> firstParty = adoptWK(WKURLRequestCopyFirstPartyForCookies(request));
+ WKRetainPtr<WKStringRef> httpMethod = adoptWK(WKURLRequestCopyHTTPMethod(request));
+
+ InjectedBundle::shared().stringBuilder()->append("<NSURLRequest URL ");
+ InjectedBundle::shared().stringBuilder()->append(pathSuitableForTestResult(url.get()));
+ InjectedBundle::shared().stringBuilder()->append(", main document URL ");
+ InjectedBundle::shared().stringBuilder()->append(urlSuitableForTestResult(firstParty.get()));
+ InjectedBundle::shared().stringBuilder()->append(", http method ");
+
+ if (WKStringIsEmpty(httpMethod.get()))
+ InjectedBundle::shared().stringBuilder()->append("(none)");
+ else
+ InjectedBundle::shared().stringBuilder()->append(toWTFString(httpMethod));
+
+ InjectedBundle::shared().stringBuilder()->append(">");
+}
+
+static inline void dumpResponseDescriptionSuitableForTestResult(WKURLResponseRef response)
+{
+ WKRetainPtr<WKURLRef> url = adoptWK(WKURLResponseCopyURL(response));
+ if (!url) {
+ InjectedBundle::shared().stringBuilder()->append("(null)");
+ return;
+ }
+ InjectedBundle::shared().stringBuilder()->append("<NSURLResponse ");
+ InjectedBundle::shared().stringBuilder()->append(pathSuitableForTestResult(url.get()));
+ InjectedBundle::shared().stringBuilder()->append(", http status code ");
+ InjectedBundle::shared().stringBuilder()->append(WTF::String::number(WKURLResponseHTTPStatusCode(response)));
+ InjectedBundle::shared().stringBuilder()->append(">");
+}
+
+static inline void dumpErrorDescriptionSuitableForTestResult(WKErrorRef error)
+{
+ WKRetainPtr<WKStringRef> errorDomain = adoptWK(WKErrorCopyDomain(error));
+ int errorCode = WKErrorGetErrorCode(error);
+
+ // We need to do some error mapping here to match the test expectations (Mac error names are expected).
+ if (WKStringIsEqualToUTF8CString(errorDomain.get(), "WebKitNetworkError")) {
+ errorDomain = adoptWK(WKStringCreateWithUTF8CString("NSURLErrorDomain"));
+ errorCode = -999;
+ }
+
+ if (WKStringIsEqualToUTF8CString(errorDomain.get(), "WebKitPolicyError"))
+ errorDomain = adoptWK(WKStringCreateWithUTF8CString("WebKitErrorDomain"));
+
+ InjectedBundle::shared().stringBuilder()->append("<NSError domain ");
+ InjectedBundle::shared().stringBuilder()->append(toWTFString(errorDomain));
+ InjectedBundle::shared().stringBuilder()->append(", code ");
+ InjectedBundle::shared().stringBuilder()->append(String::number(errorCode));
+
+ WKRetainPtr<WKURLRef> url = adoptWK(WKErrorCopyFailingURL(error));
+ if (url.get()) {
+ WKRetainPtr<WKStringRef> urlString = adoptWK(WKURLCopyString(url.get()));
+ InjectedBundle::shared().stringBuilder()->append(", failing URL \"");
+ InjectedBundle::shared().stringBuilder()->append(toWTFString(urlString));
+ InjectedBundle::shared().stringBuilder()->append("\"");
+ }
+
+ InjectedBundle::shared().stringBuilder()->append(">");
+}
+
void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo)
{
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didStartProvisionalLoadForFrame(frame);
@@ -430,19 +548,24 @@ void InjectedBundlePage::didReceiveIntentForFrame(WKBundlePageRef page, WKBundle
{
#if ENABLE(WEB_INTENTS)
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->m_currentIntentRequest = intentRequest;
- WKRetainPtr<WKIntentDataRef> intent(AdoptWK, WKBundleIntentRequestCopyIntentData(intentRequest));
+ WKRetainPtr<WKBundleIntentRef> intent(AdoptWK, WKBundleIntentRequestCopyIntent(intentRequest));
InjectedBundle::shared().stringBuilder()->append("Received Web Intent: action=");
- WKRetainPtr<WKStringRef> wkAction(AdoptWK, WKIntentDataCopyAction(intent.get()));
+ WKRetainPtr<WKStringRef> wkAction(AdoptWK, WKBundleIntentCopyAction(intent.get()));
InjectedBundle::shared().stringBuilder()->append(toWTFString(wkAction.get()));
InjectedBundle::shared().stringBuilder()->append(" type=");
- WKRetainPtr<WKStringRef> wkType(AdoptWK, WKIntentDataCopyType(intent.get()));
+ WKRetainPtr<WKStringRef> wkType(AdoptWK, WKBundleIntentCopyType(intent.get()));
InjectedBundle::shared().stringBuilder()->append(toWTFString(wkType.get()));
InjectedBundle::shared().stringBuilder()->append("\n");
- // FIXME: Print number of ports when exposed in WebKit2
+ const size_t numMessagePorts = WKBundleIntentMessagePortCount(intent.get());
+ if (numMessagePorts) {
+ InjectedBundle::shared().stringBuilder()->append("Have ");
+ InjectedBundle::shared().stringBuilder()->append(WTF::String::number(numMessagePorts));
+ InjectedBundle::shared().stringBuilder()->append(" ports\n");
+ }
- WKRetainPtr<WKURLRef> wkServiceUrl(AdoptWK, WKIntentDataCopyService(intent.get()));
+ WKRetainPtr<WKURLRef> wkServiceUrl(AdoptWK, WKBundleIntentCopyService(intent.get()));
if (wkServiceUrl) {
WKRetainPtr<WKStringRef> wkService(AdoptWK, WKURLCopyString(wkServiceUrl.get()));
if (wkService && !WKStringIsEmpty(wkService.get())) {
@@ -452,7 +575,7 @@ void InjectedBundlePage::didReceiveIntentForFrame(WKBundlePageRef page, WKBundle
}
}
- WKRetainPtr<WKDictionaryRef> wkExtras(AdoptWK, WKIntentDataCopyExtras(intent.get()));
+ WKRetainPtr<WKDictionaryRef> wkExtras(AdoptWK, WKBundleIntentCopyExtras(intent.get()));
WKRetainPtr<WKArrayRef> wkExtraKeys(AdoptWK, WKDictionaryCopyKeys(wkExtras.get()));
const size_t numExtraKeys = WKArrayGetSize(wkExtraKeys.get());
for (size_t i = 0; i < numExtraKeys; ++i) {
@@ -465,7 +588,7 @@ void InjectedBundlePage::didReceiveIntentForFrame(WKBundlePageRef page, WKBundle
InjectedBundle::shared().stringBuilder()->append("\n");
}
- WKRetainPtr<WKArrayRef> wkSuggestions(AdoptWK, WKIntentDataCopySuggestions(intent.get()));
+ WKRetainPtr<WKArrayRef> wkSuggestions(AdoptWK, WKBundleIntentCopySuggestions(intent.get()));
const size_t numSuggestions = WKArrayGetSize(wkSuggestions.get());
for (size_t i = 0; i < numSuggestions; ++i) {
WKStringRef wkSuggestion = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkSuggestions.get(), i));
@@ -580,7 +703,7 @@ void InjectedBundlePage::didFinishLoadForResource(WKBundlePageRef page, WKBundle
void InjectedBundlePage::didFailLoadForResource(WKBundlePageRef page, WKBundleFrameRef frame, uint64_t identifier, WKErrorRef error, const void* clientInfo)
{
- static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFinishLoadForResource(page, frame, identifier, error);
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFailLoadForResource(page, frame, identifier, error);
}
void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundleFrameRef frame)
@@ -588,7 +711,7 @@ void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundleFrameRef frame)
if (!InjectedBundle::shared().isTestRunning())
return;
- if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) {
+ if (InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) {
dumpFrameDescriptionSuitableForTestResult(frame);
InjectedBundle::shared().stringBuilder()->append(" - didStartProvisionalLoadForFrame\n");
}
@@ -611,7 +734,7 @@ void InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame(WKBundleFrameRe
return;
InjectedBundle::shared().setTopLoadingFrame(0);
- if (InjectedBundle::shared().layoutTestController()->waitToDump())
+ if (InjectedBundle::shared().testRunner()->waitToDump())
return;
InjectedBundle::shared().done();
@@ -622,7 +745,7 @@ void InjectedBundlePage::didCommitLoadForFrame(WKBundleFrameRef frame)
if (!InjectedBundle::shared().isTestRunning())
return;
- if (!InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks())
+ if (!InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks())
return;
dumpFrameDescriptionSuitableForTestResult(frame);
@@ -634,7 +757,7 @@ void InjectedBundlePage::didFinishProgress()
if (!InjectedBundle::shared().isTestRunning())
return;
- if (!InjectedBundle::shared().layoutTestController()->shouldDumpProgressFinishedCallback())
+ if (!InjectedBundle::shared().testRunner()->shouldDumpProgressFinishedCallback())
return;
InjectedBundle::shared().stringBuilder()->append("postProgressFinishedNotification\n");
@@ -742,7 +865,7 @@ void InjectedBundlePage::dump()
{
ASSERT(InjectedBundle::shared().isTestRunning());
- InjectedBundle::shared().layoutTestController()->invalidateWaitToDumpWatchdogTimer();
+ InjectedBundle::shared().testRunner()->invalidateWaitToDumpWatchdogTimer();
// Force a paint before dumping. This matches DumpRenderTree on Windows. (DumpRenderTree on Mac
// does this at a slightly different time.) See <http://webkit.org/b/55469> for details.
@@ -751,32 +874,32 @@ void InjectedBundlePage::dump()
WKBundleFrameRef frame = WKBundlePageGetMainFrame(m_page);
WTF::String url = toWTFString(adoptWK(WKURLCopyString(adoptWK(WKBundleFrameCopyURL(frame)).get())));
if (url.find("dumpAsText/") != WTF::notFound)
- InjectedBundle::shared().layoutTestController()->dumpAsText(false);
+ InjectedBundle::shared().testRunner()->dumpAsText(false);
- switch (InjectedBundle::shared().layoutTestController()->whatToDump()) {
- case LayoutTestController::RenderTree: {
+ switch (InjectedBundle::shared().testRunner()->whatToDump()) {
+ case TestRunner::RenderTree: {
WKRetainPtr<WKStringRef> text(AdoptWK, WKBundlePageCopyRenderTreeExternalRepresentation(m_page));
InjectedBundle::shared().stringBuilder()->append(toWTFString(text));
break;
}
- case LayoutTestController::MainFrameText:
+ case TestRunner::MainFrameText:
dumpFrameText(WKBundlePageGetMainFrame(m_page));
break;
- case LayoutTestController::AllFramesText:
+ case TestRunner::AllFramesText:
dumpAllFramesText();
break;
}
- if (InjectedBundle::shared().layoutTestController()->shouldDumpAllFrameScrollPositions())
+ if (InjectedBundle::shared().testRunner()->shouldDumpAllFrameScrollPositions())
dumpAllFrameScrollPositions();
- else if (InjectedBundle::shared().layoutTestController()->shouldDumpMainFrameScrollPosition())
+ else if (InjectedBundle::shared().testRunner()->shouldDumpMainFrameScrollPosition())
dumpFrameScrollPosition(WKBundlePageGetMainFrame(m_page));
- if (InjectedBundle::shared().layoutTestController()->shouldDumpBackForwardListsForAllWindows())
+ if (InjectedBundle::shared().testRunner()->shouldDumpBackForwardListsForAllWindows())
InjectedBundle::shared().dumpBackForwardListsForAllPages();
- if (InjectedBundle::shared().shouldDumpPixels() && InjectedBundle::shared().layoutTestController()->shouldDumpPixels()) {
- InjectedBundle::shared().setPixelResult(adoptWK(WKBundlePageCreateSnapshotInViewCoordinates(m_page, WKBundleFrameGetVisibleContentBounds(WKBundlePageGetMainFrame(m_page)), kWKImageOptionsShareable)).get());
+ if (InjectedBundle::shared().shouldDumpPixels() && InjectedBundle::shared().testRunner()->shouldDumpPixels()) {
+ InjectedBundle::shared().setPixelResult(adoptWK(WKBundlePageCreateSnapshotWithOptions(m_page, WKBundleFrameGetVisibleContentBounds(WKBundlePageGetMainFrame(m_page)), kWKSnapshotOptionsShareable | kWKSnapshotOptionsInViewCoordinates)).get());
if (WKBundlePageIsTrackingRepaints(m_page))
InjectedBundle::shared().setRepaintRects(adoptWK(WKBundlePageCopyTrackedRepaintRects(m_page)).get());
}
@@ -789,7 +912,7 @@ void InjectedBundlePage::didFinishLoadForFrame(WKBundleFrameRef frame)
if (!InjectedBundle::shared().isTestRunning())
return;
- if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) {
+ if (InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) {
dumpFrameDescriptionSuitableForTestResult(frame);
InjectedBundle::shared().stringBuilder()->append(" - didFinishLoadForFrame\n");
}
@@ -798,7 +921,7 @@ void InjectedBundlePage::didFinishLoadForFrame(WKBundleFrameRef frame)
return;
InjectedBundle::shared().setTopLoadingFrame(0);
- if (InjectedBundle::shared().layoutTestController()->waitToDump())
+ if (InjectedBundle::shared().testRunner()->waitToDump())
return;
InjectedBundle::shared().page()->dump();
@@ -813,7 +936,7 @@ void InjectedBundlePage::didFailLoadWithErrorForFrame(WKBundleFrameRef frame, WK
return;
InjectedBundle::shared().setTopLoadingFrame(0);
- if (InjectedBundle::shared().layoutTestController()->waitToDump())
+ if (InjectedBundle::shared().testRunner()->waitToDump())
return;
InjectedBundle::shared().done();
@@ -824,14 +947,14 @@ void InjectedBundlePage::didReceiveTitleForFrame(WKStringRef title, WKBundleFram
if (!InjectedBundle::shared().isTestRunning())
return;
- if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) {
+ if (InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) {
dumpFrameDescriptionSuitableForTestResult(frame);
InjectedBundle::shared().stringBuilder()->append(" - didReceiveTitle: ");
InjectedBundle::shared().stringBuilder()->append(toWTFString(title));
InjectedBundle::shared().stringBuilder()->append("\n");
}
- if (!InjectedBundle::shared().layoutTestController()->shouldDumpTitleChanges())
+ if (!InjectedBundle::shared().testRunner()->shouldDumpTitleChanges())
return;
InjectedBundle::shared().stringBuilder()->append("TITLE CHANGED: ");
@@ -848,12 +971,12 @@ void InjectedBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, WKBundle
JSObjectRef window = JSContextGetGlobalObject(context);
if (WKBundleScriptWorldNormalWorld() != world) {
- JSObjectSetProperty(context, window, toJS("__worldID").get(), JSValueMakeNumber(context, LayoutTestController::worldIDForWorld(world)), kJSPropertyAttributeReadOnly, 0);
+ JSObjectSetProperty(context, window, toJS("__worldID").get(), JSValueMakeNumber(context, TestRunner::worldIDForWorld(world)), kJSPropertyAttributeReadOnly, 0);
return;
}
JSValueRef exception = 0;
- InjectedBundle::shared().layoutTestController()->makeWindowObject(context, window, &exception);
+ InjectedBundle::shared().testRunner()->makeWindowObject(context, window, &exception);
InjectedBundle::shared().gcController()->makeWindowObject(context, window, &exception);
InjectedBundle::shared().eventSendingController()->makeWindowObject(context, window, &exception);
InjectedBundle::shared().textInputController()->makeWindowObject(context, window, &exception);
@@ -871,7 +994,7 @@ void InjectedBundlePage::didCancelClientRedirectForFrame(WKBundleFrameRef frame)
if (!InjectedBundle::shared().isTestRunning())
return;
- if (!InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks())
+ if (!InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks())
return;
dumpFrameDescriptionSuitableForTestResult(frame);
@@ -883,7 +1006,7 @@ void InjectedBundlePage::willPerformClientRedirectForFrame(WKBundleFrameRef fram
if (!InjectedBundle::shared().isTestRunning())
return;
- if (!InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks())
+ if (!InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks())
return;
dumpFrameDescriptionSuitableForTestResult(frame);
@@ -901,7 +1024,7 @@ void InjectedBundlePage::didFinishDocumentLoadForFrame(WKBundleFrameRef frame)
if (!InjectedBundle::shared().isTestRunning())
return;
- if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) {
+ if (InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) {
dumpFrameDescriptionSuitableForTestResult(frame);
InjectedBundle::shared().stringBuilder()->append(" - didFinishDocumentLoadForFrame\n");
}
@@ -920,7 +1043,7 @@ void InjectedBundlePage::didHandleOnloadEventsForFrame(WKBundleFrameRef frame)
if (!InjectedBundle::shared().isTestRunning())
return;
- if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) {
+ if (InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) {
dumpFrameDescriptionSuitableForTestResult(frame);
InjectedBundle::shared().stringBuilder()->append(" - didHandleOnloadEventsForFrame\n");
}
@@ -938,8 +1061,16 @@ void InjectedBundlePage::didDetectXSSForFrame(WKBundleFrameRef frame)
{
}
-void InjectedBundlePage::didInitiateLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKURLRequestRef, bool)
+void InjectedBundlePage::didInitiateLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKURLRequestRef request, bool)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (!InjectedBundle::shared().testRunner()->shouldDumpResourceLoadCallbacks())
+ return;
+
+ WKRetainPtr<WKURLRef> url = adoptWK(WKURLRequestCopyURL(request));
+ assignedUrlsCache.add(identifier, pathSuitableForTestResult(url.get()));
}
// Resource Load Client Callbacks
@@ -954,11 +1085,23 @@ static inline bool isHTTPOrHTTPSScheme(WKStringRef scheme)
return WKStringIsEqualToUTF8CStringIgnoringCase(scheme, "http") || WKStringIsEqualToUTF8CStringIgnoringCase(scheme, "https");
}
-WKURLRequestRef InjectedBundlePage::willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef frame, uint64_t, WKURLRequestRef request, WKURLResponseRef)
+WKURLRequestRef InjectedBundlePage::willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef frame, uint64_t identifier, WKURLRequestRef request, WKURLResponseRef response)
{
- if (InjectedBundle::shared().isTestRunning() && InjectedBundle::shared().layoutTestController()->willSendRequestReturnsNull())
+ if (InjectedBundle::shared().isTestRunning() && InjectedBundle::shared().testRunner()->willSendRequestReturnsNull())
return 0;
+ if (InjectedBundle::shared().isTestRunning()
+ && InjectedBundle::shared().testRunner()->shouldDumpResourceLoadCallbacks()) {
+ InjectedBundle::shared().stringBuilder()->append(assignedUrlsCache.contains(identifier)
+ ? assignedUrlsCache.get(identifier)
+ : "<unknown>");
+ InjectedBundle::shared().stringBuilder()->append(" - willSendRequest ");
+ dumpRequestDescriptionSuitableForTestResult(request);
+ InjectedBundle::shared().stringBuilder()->append(" redirectResponse ");
+ dumpResponseDescriptionSuitableForTestResult(response);
+ InjectedBundle::shared().stringBuilder()->append("\n");
+ }
+
WKRetainPtr<WKURLRef> url = adoptWK(WKURLRequestCopyURL(request));
WKRetainPtr<WKStringRef> host = adoptWK(WKURLCopyHostName(url.get()));
WKRetainPtr<WKStringRef> scheme = adoptWK(WKURLCopyScheme(url.get()));
@@ -990,12 +1133,22 @@ WKURLRequestRef InjectedBundlePage::willSendRequestForFrame(WKBundlePageRef, WKB
return request;
}
-void InjectedBundlePage::didReceiveResponseForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t, WKURLResponseRef response)
+void InjectedBundlePage::didReceiveResponseForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKURLResponseRef response)
{
if (!InjectedBundle::shared().isTestRunning())
return;
- if (!InjectedBundle::shared().layoutTestController()->shouldDumpResourceResponseMIMETypes())
+ if (InjectedBundle::shared().testRunner()->shouldDumpResourceLoadCallbacks()) {
+ InjectedBundle::shared().stringBuilder()->append(assignedUrlsCache.contains(identifier)
+ ? assignedUrlsCache.get(identifier)
+ : "<unknown>");
+ InjectedBundle::shared().stringBuilder()->append(" - didReceiveResponse ");
+ dumpResponseDescriptionSuitableForTestResult(response);
+ InjectedBundle::shared().stringBuilder()->append("\n");
+ }
+
+
+ if (!InjectedBundle::shared().testRunner()->shouldDumpResourceResponseMIMETypes())
return;
WKRetainPtr<WKURLRef> url = adoptWK(WKURLResponseCopyURL(response));
@@ -1012,12 +1165,35 @@ void InjectedBundlePage::didReceiveContentLengthForResource(WKBundlePageRef, WKB
{
}
-void InjectedBundlePage::didFinishLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t)
+void InjectedBundlePage::didFinishLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (!InjectedBundle::shared().testRunner()->shouldDumpResourceLoadCallbacks())
+ return;
+
+ InjectedBundle::shared().stringBuilder()->append(assignedUrlsCache.contains(identifier)
+ ? assignedUrlsCache.get(identifier)
+ : "<unknown>");
+ InjectedBundle::shared().stringBuilder()->append(" - didFinishLoading\n");
}
-void InjectedBundlePage::didFailLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t, WKErrorRef)
+void InjectedBundlePage::didFailLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKErrorRef error)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (!InjectedBundle::shared().testRunner()->shouldDumpResourceLoadCallbacks())
+ return;
+
+ InjectedBundle::shared().stringBuilder()->append(assignedUrlsCache.contains(identifier)
+ ? assignedUrlsCache.get(identifier)
+ : "<unknown>");
+ InjectedBundle::shared().stringBuilder()->append(" - didFailLoadingWithError: ");
+
+ dumpErrorDescriptionSuitableForTestResult(error);
+ InjectedBundle::shared().stringBuilder()->append("\n");
}
@@ -1048,10 +1224,10 @@ WKBundlePagePolicyAction InjectedBundlePage::decidePolicyForNavigationAction(WKB
if (!InjectedBundle::shared().isTestRunning())
return WKBundlePagePolicyActionUse;
- if (!InjectedBundle::shared().layoutTestController()->isPolicyDelegateEnabled())
+ if (!InjectedBundle::shared().testRunner()->isPolicyDelegateEnabled())
return WKBundlePagePolicyActionUse;
- if (InjectedBundle::shared().layoutTestController()->waitToDump()) {
+ if (InjectedBundle::shared().testRunner()->waitToDump()) {
WKRetainPtr<WKStringRef> url = adoptWK(WKURLCopyString(WKURLRequestCopyURL(request)));
InjectedBundle::shared().stringBuilder()->append("Policy delegate: attempt to load ");
InjectedBundle::shared().stringBuilder()->append(toWTFString(url));
@@ -1065,10 +1241,10 @@ WKBundlePagePolicyAction InjectedBundlePage::decidePolicyForNavigationAction(WKB
}
InjectedBundle::shared().stringBuilder()->append("\n");
- InjectedBundle::shared().layoutTestController()->notifyDone();
+ InjectedBundle::shared().testRunner()->notifyDone();
}
- if (InjectedBundle::shared().layoutTestController()->isPolicyDelegatePermissive())
+ if (InjectedBundle::shared().testRunner()->isPolicyDelegatePermissive())
return WKBundlePagePolicyActionUse;
return WKBundlePagePolicyActionPassThrough;
}
@@ -1161,7 +1337,7 @@ void InjectedBundlePage::willSetStatusbarText(WKStringRef statusbarText)
if (!InjectedBundle::shared().isTestRunning())
return;
- if (!InjectedBundle::shared().layoutTestController()->shouldDumpStatusCallbacks())
+ if (!InjectedBundle::shared().testRunner()->shouldDumpStatusCallbacks())
return;
InjectedBundle::shared().stringBuilder()->append("UI DELEGATE STATUS CALLBACK: setStatusText:");
@@ -1260,12 +1436,12 @@ bool InjectedBundlePage::shouldBeginEditing(WKBundleRangeHandleRef range)
if (!InjectedBundle::shared().isTestRunning())
return true;
- if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) {
+ if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) {
InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldBeginEditingInDOMRange:");
InjectedBundle::shared().stringBuilder()->append(rangeToStr(m_page, m_world.get(), range));
InjectedBundle::shared().stringBuilder()->append("\n");
}
- return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+ return InjectedBundle::shared().testRunner()->shouldAllowEditing();
}
bool InjectedBundlePage::shouldEndEditing(WKBundleRangeHandleRef range)
@@ -1273,12 +1449,12 @@ bool InjectedBundlePage::shouldEndEditing(WKBundleRangeHandleRef range)
if (!InjectedBundle::shared().isTestRunning())
return true;
- if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) {
+ if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) {
InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldEndEditingInDOMRange:");
InjectedBundle::shared().stringBuilder()->append(rangeToStr(m_page, m_world.get(), range));
InjectedBundle::shared().stringBuilder()->append("\n");
}
- return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+ return InjectedBundle::shared().testRunner()->shouldAllowEditing();
}
bool InjectedBundlePage::shouldInsertNode(WKBundleNodeHandleRef node, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action)
@@ -1292,7 +1468,7 @@ bool InjectedBundlePage::shouldInsertNode(WKBundleNodeHandleRef node, WKBundleRa
"WebViewInsertActionDropped",
};
- if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) {
+ if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) {
InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldInsertNode:");
InjectedBundle::shared().stringBuilder()->append(dumpPath(m_page, m_world.get(), node));
InjectedBundle::shared().stringBuilder()->append(" replacingDOMRange:");
@@ -1301,7 +1477,7 @@ bool InjectedBundlePage::shouldInsertNode(WKBundleNodeHandleRef node, WKBundleRa
InjectedBundle::shared().stringBuilder()->append(insertactionstring[action]);
InjectedBundle::shared().stringBuilder()->append("\n");
}
- return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+ return InjectedBundle::shared().testRunner()->shouldAllowEditing();
}
bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action)
@@ -1315,7 +1491,7 @@ bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeHandleR
"WebViewInsertActionDropped",
};
- if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) {
+ if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) {
InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldInsertText:");
InjectedBundle::shared().stringBuilder()->append(toWTFString(text));
InjectedBundle::shared().stringBuilder()->append(" replacingDOMRange:");
@@ -1324,7 +1500,7 @@ bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeHandleR
InjectedBundle::shared().stringBuilder()->append(insertactionstring[action]);
InjectedBundle::shared().stringBuilder()->append("\n");
}
- return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+ return InjectedBundle::shared().testRunner()->shouldAllowEditing();
}
bool InjectedBundlePage::shouldDeleteRange(WKBundleRangeHandleRef range)
@@ -1332,12 +1508,12 @@ bool InjectedBundlePage::shouldDeleteRange(WKBundleRangeHandleRef range)
if (!InjectedBundle::shared().isTestRunning())
return true;
- if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) {
+ if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) {
InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldDeleteDOMRange:");
InjectedBundle::shared().stringBuilder()->append(rangeToStr(m_page, m_world.get(), range));
InjectedBundle::shared().stringBuilder()->append("\n");
}
- return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+ return InjectedBundle::shared().testRunner()->shouldAllowEditing();
}
bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeHandleRef fromRange, WKBundleRangeHandleRef toRange, WKAffinityType affinity, bool stillSelecting)
@@ -1354,7 +1530,7 @@ bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeHandleRef fromRa
"TRUE"
};
- if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) {
+ if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) {
InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldChangeSelectedDOMRange:");
InjectedBundle::shared().stringBuilder()->append(rangeToStr(m_page, m_world.get(), fromRange));
InjectedBundle::shared().stringBuilder()->append(" toDOMRange:");
@@ -1365,7 +1541,7 @@ bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeHandleRef fromRa
InjectedBundle::shared().stringBuilder()->append(boolstring[stillSelecting]);
InjectedBundle::shared().stringBuilder()->append("\n");
}
- return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+ return InjectedBundle::shared().testRunner()->shouldAllowEditing();
}
bool InjectedBundlePage::shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, WKBundleRangeHandleRef range)
@@ -1373,14 +1549,14 @@ bool InjectedBundlePage::shouldApplyStyle(WKBundleCSSStyleDeclarationRef style,
if (!InjectedBundle::shared().isTestRunning())
return true;
- if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) {
+ if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) {
InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldApplyStyle:");
InjectedBundle::shared().stringBuilder()->append(styleDecToStr(style));
InjectedBundle::shared().stringBuilder()->append(" toElementsInDOMRange:");
InjectedBundle::shared().stringBuilder()->append(rangeToStr(m_page, m_world.get(), range));
InjectedBundle::shared().stringBuilder()->append("\n");
}
- return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+ return InjectedBundle::shared().testRunner()->shouldAllowEditing();
}
void InjectedBundlePage::didBeginEditing(WKStringRef notificationName)
@@ -1388,7 +1564,7 @@ void InjectedBundlePage::didBeginEditing(WKStringRef notificationName)
if (!InjectedBundle::shared().isTestRunning())
return;
- if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) {
+ if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) {
InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: webViewDidBeginEditing:");
InjectedBundle::shared().stringBuilder()->append(toWTFString(notificationName));
InjectedBundle::shared().stringBuilder()->append("\n");
@@ -1400,7 +1576,7 @@ void InjectedBundlePage::didEndEditing(WKStringRef notificationName)
if (!InjectedBundle::shared().isTestRunning())
return;
- if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) {
+ if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) {
InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: webViewDidEndEditing:");
InjectedBundle::shared().stringBuilder()->append(toWTFString(notificationName));
InjectedBundle::shared().stringBuilder()->append("\n");
@@ -1412,7 +1588,7 @@ void InjectedBundlePage::didChange(WKStringRef notificationName)
if (!InjectedBundle::shared().isTestRunning())
return;
- if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) {
+ if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) {
InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: webViewDidChange:");
InjectedBundle::shared().stringBuilder()->append(toWTFString(notificationName));
InjectedBundle::shared().stringBuilder()->append("\n");
@@ -1424,7 +1600,7 @@ void InjectedBundlePage::didChangeSelection(WKStringRef notificationName)
if (!InjectedBundle::shared().isTestRunning())
return;
- if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) {
+ if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) {
InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: webViewDidChangeSelection:");
InjectedBundle::shared().stringBuilder()->append(toWTFString(notificationName));
InjectedBundle::shared().stringBuilder()->append("\n");
@@ -1434,17 +1610,17 @@ void InjectedBundlePage::didChangeSelection(WKStringRef notificationName)
#if ENABLE(FULLSCREEN_API)
bool InjectedBundlePage::supportsFullScreen(WKBundlePageRef pageRef, WKFullScreenKeyboardRequestType requestType)
{
- if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks())
+ if (InjectedBundle::shared().testRunner()->shouldDumpFullScreenCallbacks())
InjectedBundle::shared().stringBuilder()->append("supportsFullScreen() == true\n");
return true;
}
void InjectedBundlePage::enterFullScreenForElement(WKBundlePageRef pageRef, WKBundleNodeHandleRef elementRef)
{
- if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks())
+ if (InjectedBundle::shared().testRunner()->shouldDumpFullScreenCallbacks())
InjectedBundle::shared().stringBuilder()->append("enterFullScreenForElement()\n");
- if (!InjectedBundle::shared().layoutTestController()->hasCustomFullScreenBehavior()) {
+ if (!InjectedBundle::shared().testRunner()->hasCustomFullScreenBehavior()) {
WKBundlePageWillEnterFullScreen(pageRef);
WKBundlePageDidEnterFullScreen(pageRef);
}
@@ -1452,10 +1628,10 @@ void InjectedBundlePage::enterFullScreenForElement(WKBundlePageRef pageRef, WKBu
void InjectedBundlePage::exitFullScreenForElement(WKBundlePageRef pageRef, WKBundleNodeHandleRef elementRef)
{
- if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks())
+ if (InjectedBundle::shared().testRunner()->shouldDumpFullScreenCallbacks())
InjectedBundle::shared().stringBuilder()->append("exitFullScreenForElement()\n");
- if (!InjectedBundle::shared().layoutTestController()->hasCustomFullScreenBehavior()) {
+ if (!InjectedBundle::shared().testRunner()->hasCustomFullScreenBehavior()) {
WKBundlePageWillExitFullScreen(pageRef);
WKBundlePageDidExitFullScreen(pageRef);
}
@@ -1463,22 +1639,22 @@ void InjectedBundlePage::exitFullScreenForElement(WKBundlePageRef pageRef, WKBun
void InjectedBundlePage::beganEnterFullScreen(WKBundlePageRef, WKRect, WKRect)
{
- if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks())
+ if (InjectedBundle::shared().testRunner()->shouldDumpFullScreenCallbacks())
InjectedBundle::shared().stringBuilder()->append("beganEnterFullScreen()\n");
}
void InjectedBundlePage::beganExitFullScreen(WKBundlePageRef, WKRect, WKRect)
{
- if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks())
+ if (InjectedBundle::shared().testRunner()->shouldDumpFullScreenCallbacks())
InjectedBundle::shared().stringBuilder()->append("beganExitFullScreen()\n");
}
void InjectedBundlePage::closeFullScreen(WKBundlePageRef pageRef)
{
- if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks())
+ if (InjectedBundle::shared().testRunner()->shouldDumpFullScreenCallbacks())
InjectedBundle::shared().stringBuilder()->append("closeFullScreen()\n");
- if (!InjectedBundle::shared().layoutTestController()->hasCustomFullScreenBehavior()) {
+ if (!InjectedBundle::shared().testRunner()->hasCustomFullScreenBehavior()) {
WKBundlePageWillExitFullScreen(pageRef);
WKBundlePageDidExitFullScreen(pageRef);
}
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Target.pri b/Tools/WebKitTestRunner/InjectedBundle/Target.pri
index 1a117de89..f46e44caa 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Target.pri
+++ b/Tools/WebKitTestRunner/InjectedBundle/Target.pri
@@ -22,14 +22,14 @@ SOURCES += \
EventSendingController.h \
GCController.cpp \
GCController.h \
- LayoutTestController.cpp \
- LayoutTestController.h \
+ TestRunner.cpp \
+ TestRunner.h \
TextInputController.cpp \
TextInputController.h \
Bindings/JSWrapper.cpp \
qt/ActivateFontsQt.cpp \
qt/InjectedBundleQt.cpp \
- qt/LayoutTestControllerQt.cpp
+ qt/TestRunnerQt.cpp
# Adds the generated sources to SOURCES
include(DerivedSources.pri)
@@ -45,7 +45,7 @@ HEADERS += \
GCController.h \
InjectedBundle.h \
InjectedBundlePage.h \
- LayoutTestController.h \
+ TestRunner.h \
TextInputController.h \
DESTDIR = $${ROOT_BUILD_DIR}/lib
diff --git a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
index cdffcae08..b94e5d476 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
@@ -24,11 +24,11 @@
*/
#include "config.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include "InjectedBundle.h"
#include "InjectedBundlePage.h"
-#include "JSLayoutTestController.h"
+#include "JSTestRunner.h"
#include "PlatformWebView.h"
#include "StringFunctions.h"
#include "TestController.h"
@@ -49,22 +49,22 @@
#include <wtf/text/StringBuilder.h>
#if ENABLE(WEB_INTENTS)
+#include <WebKit2/WKBundleIntent.h>
#include <WebKit2/WKBundleIntentRequest.h>
-#include <WebKit2/WKIntentData.h>
#endif
namespace WTR {
// This is lower than DumpRenderTree's timeout, to make it easier to work through the failures
// Eventually it should be changed to match.
-const double LayoutTestController::waitToDumpWatchdogTimerInterval = 6;
+const double TestRunner::waitToDumpWatchdogTimerInterval = 6;
-PassRefPtr<LayoutTestController> LayoutTestController::create()
+PassRefPtr<TestRunner> TestRunner::create()
{
- return adoptRef(new LayoutTestController);
+ return adoptRef(new TestRunner);
}
-LayoutTestController::LayoutTestController()
+TestRunner::TestRunner()
: m_whatToDump(RenderTree)
, m_shouldDumpAllFrameScrollPositions(false)
, m_shouldDumpBackForwardListsForAllWindows(false)
@@ -77,6 +77,7 @@ LayoutTestController::LayoutTestController()
, m_dumpFullScreenCallbacks(false)
, m_dumpFrameLoadCallbacks(false)
, m_dumpProgressFinishedCallback(false)
+ , m_dumpResourceLoadCallbacks(false)
, m_dumpResourceResponseMIMETypes(false)
, m_waitToDump(false)
, m_testRepaint(false)
@@ -92,16 +93,16 @@ LayoutTestController::LayoutTestController()
platformInitialize();
}
-LayoutTestController::~LayoutTestController()
+TestRunner::~TestRunner()
{
}
-JSClassRef LayoutTestController::wrapperClass()
+JSClassRef TestRunner::wrapperClass()
{
- return JSLayoutTestController::layoutTestControllerClass();
+ return JSTestRunner::testRunnerClass();
}
-void LayoutTestController::display()
+void TestRunner::display()
{
WKBundlePageRef page = InjectedBundle::shared().page()->page();
WKBundlePageForceRepaint(page);
@@ -109,7 +110,7 @@ void LayoutTestController::display()
WKBundlePageResetTrackedRepaints(page);
}
-void LayoutTestController::dumpAsText(bool dumpPixels)
+void TestRunner::dumpAsText(bool dumpPixels)
{
if (m_whatToDump < MainFrameText)
m_whatToDump = MainFrameText;
@@ -117,26 +118,26 @@ void LayoutTestController::dumpAsText(bool dumpPixels)
}
// FIXME: Needs a full implementation see https://bugs.webkit.org/show_bug.cgi?id=42546
-void LayoutTestController::setCustomPolicyDelegate(bool enabled, bool permissive)
+void TestRunner::setCustomPolicyDelegate(bool enabled, bool permissive)
{
m_policyDelegateEnabled = enabled;
m_policyDelegatePermissive = permissive;
}
-void LayoutTestController::waitForPolicyDelegate()
+void TestRunner::waitForPolicyDelegate()
{
setCustomPolicyDelegate(true);
waitUntilDone();
}
-void LayoutTestController::waitUntilDone()
+void TestRunner::waitUntilDone()
{
m_waitToDump = true;
if (InjectedBundle::shared().useWaitToDumpWatchdogTimer())
initializeWaitToDumpWatchdogTimerIfNeeded();
}
-void LayoutTestController::waitToDumpWatchdogTimerFired()
+void TestRunner::waitToDumpWatchdogTimerFired()
{
invalidateWaitToDumpWatchdogTimer();
const char* message = "FAIL: Timed out waiting for notifyDone to be called\n";
@@ -145,7 +146,7 @@ void LayoutTestController::waitToDumpWatchdogTimerFired()
InjectedBundle::shared().done();
}
-void LayoutTestController::notifyDone()
+void TestRunner::notifyDone()
{
if (!InjectedBundle::shared().isTestRunning())
return;
@@ -156,7 +157,7 @@ void LayoutTestController::notifyDone()
m_waitToDump = false;
}
-unsigned LayoutTestController::numberOfActiveAnimations() const
+unsigned TestRunner::numberOfActiveAnimations() const
{
// FIXME: Is it OK this works only for the main frame?
// FIXME: If this is needed only for the main frame, then why is the function on WKBundleFrame instead of WKBundlePage?
@@ -164,7 +165,7 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return WKBundleFrameGetNumberOfActiveAnimations(mainFrame);
}
-bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
+bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
{
// FIXME: Is it OK this works only for the main frame?
// FIXME: If this is needed only for the main frame, then why is the function on WKBundleFrame instead of WKBundlePage?
@@ -172,7 +173,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef anima
return WKBundleFramePauseAnimationOnElementWithId(mainFrame, toWK(animationName).get(), toWK(elementId).get(), time);
}
-bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
+bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
{
// FIXME: Is it OK this works only for the main frame?
// FIXME: If this is needed only for the main frame, then why is the function on WKBundleFrame instead of WKBundlePage?
@@ -180,20 +181,20 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop
return WKBundleFramePauseTransitionOnElementWithId(mainFrame, toWK(propertyName).get(), toWK(elementId).get(), time);
}
-void LayoutTestController::suspendAnimations()
+void TestRunner::suspendAnimations()
{
WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
WKBundleFrameSuspendAnimations(mainFrame);
}
-JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
+JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const
{
WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
WKRetainPtr<WKStringRef> text(AdoptWK, WKBundleFrameCopyLayerTreeAsText(mainFrame));
return toJS(text);
}
-void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
+void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
{
WKRetainPtr<WKStringRef> sourceWK = toWK(source);
WKRetainPtr<WKBundleScriptWorldRef> scriptWorld(AdoptWK, WKBundleScriptWorldCreateWorld());
@@ -203,7 +204,7 @@ void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bo
(allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly));
}
-void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
+void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames)
{
WKRetainPtr<WKStringRef> sourceWK = toWK(source);
WKRetainPtr<WKBundleScriptWorldRef> scriptWorld(AdoptWK, WKBundleScriptWorldCreateWorld());
@@ -212,12 +213,12 @@ void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
(allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly));
}
-void LayoutTestController::keepWebHistory()
+void TestRunner::keepWebHistory()
{
WKBundleSetShouldTrackVisitedLinks(InjectedBundle::shared().bundle(), true);
}
-JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSValueRef element)
+JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSValueRef element)
{
// FIXME: Is it OK this works only for the main frame?
WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
@@ -230,7 +231,7 @@ JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSValueRef el
return value;
}
-JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSValueRef element)
+JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSValueRef element)
{
WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);
@@ -242,12 +243,12 @@ JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSValueRef
return toJS(text);
}
-void LayoutTestController::execCommand(JSStringRef name, JSStringRef argument)
+void TestRunner::execCommand(JSStringRef name, JSStringRef argument)
{
WKBundlePageExecuteEditingCommand(InjectedBundle::shared().page()->page(), toWK(name).get(), toWK(argument).get());
}
-bool LayoutTestController::findString(JSStringRef target, JSValueRef optionsArrayAsValue)
+bool TestRunner::findString(JSStringRef target, JSValueRef optionsArrayAsValue)
{
WKFindOptions options = 0;
@@ -285,117 +286,117 @@ bool LayoutTestController::findString(JSStringRef target, JSValueRef optionsArra
return WKBundlePageFindString(InjectedBundle::shared().page()->page(), toWK(target).get(), options);
}
-void LayoutTestController::clearAllDatabases()
+void TestRunner::clearAllDatabases()
{
WKBundleClearAllDatabases(InjectedBundle::shared().bundle());
}
-void LayoutTestController::setDatabaseQuota(uint64_t quota)
+void TestRunner::setDatabaseQuota(uint64_t quota)
{
return WKBundleSetDatabaseQuota(InjectedBundle::shared().bundle(), quota);
}
-void LayoutTestController::clearAllApplicationCaches()
+void TestRunner::clearAllApplicationCaches()
{
WKBundleClearApplicationCache(InjectedBundle::shared().bundle());
}
-void LayoutTestController::setAppCacheMaximumSize(uint64_t size)
+void TestRunner::setAppCacheMaximumSize(uint64_t size)
{
WKBundleSetAppCacheMaximumSize(InjectedBundle::shared().bundle(), size);
}
-bool LayoutTestController::isCommandEnabled(JSStringRef name)
+bool TestRunner::isCommandEnabled(JSStringRef name)
{
return WKBundlePageIsEditingCommandEnabled(InjectedBundle::shared().page()->page(), toWK(name).get());
}
-void LayoutTestController::setCanOpenWindows(bool)
+void TestRunner::setCanOpenWindows(bool)
{
// It's not clear if or why any tests require opening windows be forbidden.
// For now, just ignore this setting, and if we find later it's needed we can add it.
}
-void LayoutTestController::setXSSAuditorEnabled(bool enabled)
+void TestRunner::setXSSAuditorEnabled(bool enabled)
{
WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitXSSAuditorEnabled"));
WKBundleOverrideBoolPreferenceForTestRunner(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), key.get(), enabled);
}
-void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
+void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled)
{
WKBundleSetAllowUniversalAccessFromFileURLs(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
}
-void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled)
+void TestRunner::setAllowFileAccessFromFileURLs(bool enabled)
{
WKBundleSetAllowFileAccessFromFileURLs(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
}
-void LayoutTestController::setFrameFlatteningEnabled(bool enabled)
+void TestRunner::setFrameFlatteningEnabled(bool enabled)
{
WKBundleSetFrameFlatteningEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
}
-void LayoutTestController::setPluginsEnabled(bool enabled)
+void TestRunner::setPluginsEnabled(bool enabled)
{
WKBundleSetPluginsEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
}
-void LayoutTestController::setGeolocationPermission(bool enabled)
+void TestRunner::setGeolocationPermission(bool enabled)
{
WKBundleSetGeolocationPermission(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
}
-void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled)
+void TestRunner::setJavaScriptCanAccessClipboard(bool enabled)
{
WKBundleSetJavaScriptCanAccessClipboard(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
}
-void LayoutTestController::setPrivateBrowsingEnabled(bool enabled)
+void TestRunner::setPrivateBrowsingEnabled(bool enabled)
{
WKBundleSetPrivateBrowsingEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
}
-void LayoutTestController::setPopupBlockingEnabled(bool enabled)
+void TestRunner::setPopupBlockingEnabled(bool enabled)
{
WKBundleSetPopupBlockingEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
}
-void LayoutTestController::setAuthorAndUserStylesEnabled(bool enabled)
+void TestRunner::setAuthorAndUserStylesEnabled(bool enabled)
{
WKBundleSetAuthorAndUserStylesEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
}
-void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
{
WKBundleAddOriginAccessWhitelistEntry(InjectedBundle::shared().bundle(), toWK(sourceOrigin).get(), toWK(destinationProtocol).get(), toWK(destinationHost).get(), allowDestinationSubdomains);
}
-void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
{
WKBundleRemoveOriginAccessWhitelistEntry(InjectedBundle::shared().bundle(), toWK(sourceOrigin).get(), toWK(destinationProtocol).get(), toWK(destinationHost).get(), allowDestinationSubdomains);
}
-int LayoutTestController::numberOfPages(double pageWidthInPixels, double pageHeightInPixels)
+int TestRunner::numberOfPages(double pageWidthInPixels, double pageHeightInPixels)
{
WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
return WKBundleNumberOfPages(InjectedBundle::shared().bundle(), mainFrame, pageWidthInPixels, pageHeightInPixels);
}
-JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft)
+JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft)
{
WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
return toJS(WKBundlePageSizeAndMarginsInPixels(InjectedBundle::shared().bundle(), mainFrame, pageIndex, width, height, marginTop, marginRight, marginBottom, marginLeft));
}
-bool LayoutTestController::isPageBoxVisible(int pageIndex)
+bool TestRunner::isPageBoxVisible(int pageIndex)
{
WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
return WKBundleIsPageBoxVisible(InjectedBundle::shared().bundle(), mainFrame, pageIndex);
}
-void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value)
+void TestRunner::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value)
{
if (!element || !JSValueIsObject(context, element))
return;
@@ -404,38 +405,38 @@ void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef elem
WKBundleNodeHandleSetHTMLInputElementValueForUser(nodeHandle.get(), toWK(value).get());
}
-unsigned LayoutTestController::windowCount()
+unsigned TestRunner::windowCount()
{
return InjectedBundle::shared().pageCount();
}
-void LayoutTestController::clearBackForwardList()
+void TestRunner::clearBackForwardList()
{
WKBundleBackForwardListClear(WKBundlePageGetBackForwardList(InjectedBundle::shared().page()->page()));
}
// Object Creation
-void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
+void TestRunner::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
{
setProperty(context, windowObject, "testRunner", this, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception);
}
-void LayoutTestController::showWebInspector()
+void TestRunner::showWebInspector()
{
#if ENABLE(INSPECTOR)
WKBundleInspectorShow(WKBundlePageGetInspector(InjectedBundle::shared().page()->page()));
#endif // ENABLE(INSPECTOR)
}
-void LayoutTestController::closeWebInspector()
+void TestRunner::closeWebInspector()
{
#if ENABLE(INSPECTOR)
WKBundleInspectorClose(WKBundlePageGetInspector(InjectedBundle::shared().page()->page()));
#endif // ENABLE(INSPECTOR)
}
-void LayoutTestController::evaluateInWebInspector(long callID, JSStringRef script)
+void TestRunner::evaluateInWebInspector(long callID, JSStringRef script)
{
#if ENABLE(INSPECTOR)
WKRetainPtr<WKStringRef> scriptWK = toWK(script);
@@ -450,7 +451,7 @@ static WorldMap& worldMap()
return map;
}
-unsigned LayoutTestController::worldIDForWorld(WKBundleScriptWorldRef world)
+unsigned TestRunner::worldIDForWorld(WKBundleScriptWorldRef world)
{
WorldMap::const_iterator end = worldMap().end();
for (WorldMap::const_iterator it = worldMap().begin(); it != end; ++it) {
@@ -461,7 +462,7 @@ unsigned LayoutTestController::worldIDForWorld(WKBundleScriptWorldRef world)
return 0;
}
-void LayoutTestController::evaluateScriptInIsolatedWorld(JSContextRef context, unsigned worldID, JSStringRef script)
+void TestRunner::evaluateScriptInIsolatedWorld(JSContextRef context, unsigned worldID, JSStringRef script)
{
// A worldID of 0 always corresponds to a new world. Any other worldID corresponds to a world
// that is created once and cached forever.
@@ -483,30 +484,30 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(JSContextRef context, u
JSEvaluateScript(jsContext, script, 0, 0, 0, 0);
}
-void LayoutTestController::setPOSIXLocale(JSStringRef locale)
+void TestRunner::setPOSIXLocale(JSStringRef locale)
{
char localeBuf[32];
JSStringGetUTF8CString(locale, localeBuf, sizeof(localeBuf));
setlocale(LC_ALL, localeBuf);
}
-void LayoutTestController::setTextDirection(JSStringRef direction)
+void TestRunner::setTextDirection(JSStringRef direction)
{
WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
return WKBundleFrameSetTextDirection(mainFrame, toWK(direction).get());
}
-void LayoutTestController::setShouldStayOnPageAfterHandlingBeforeUnload(bool shouldStayOnPage)
+void TestRunner::setShouldStayOnPageAfterHandlingBeforeUnload(bool shouldStayOnPage)
{
InjectedBundle::shared().postNewBeforeUnloadReturnValue(!shouldStayOnPage);
}
-void LayoutTestController::setDefersLoading(bool shouldDeferLoading)
+void TestRunner::setDefersLoading(bool shouldDeferLoading)
{
WKBundlePageSetDefersLoading(InjectedBundle::shared().page()->page(), shouldDeferLoading);
}
-void LayoutTestController::setPageVisibility(JSStringRef state)
+void TestRunner::setPageVisibility(JSStringRef state)
{
WebCore::PageVisibilityState visibilityState = WebCore::PageVisibilityStateVisible;
@@ -520,7 +521,7 @@ void LayoutTestController::setPageVisibility(JSStringRef state)
WKBundleSetPageVisibilityState(InjectedBundle::shared().bundle(), InjectedBundle::shared().page()->page(), visibilityState, /* isInitialState */ false);
}
-void LayoutTestController::resetPageVisibility()
+void TestRunner::resetPageVisibility()
{
WKBundleSetPageVisibilityState(InjectedBundle::shared().bundle(), InjectedBundle::shared().page()->page(), WebCore::PageVisibilityStateVisible, /* isInitialState */ true);
}
@@ -539,7 +540,7 @@ enum {
SetBackingScaleFactorCallbackID
};
-static void cacheLayoutTestControllerCallback(unsigned index, JSValueRef callback)
+static void cacheTestRunnerCallback(unsigned index, JSValueRef callback)
{
if (!callback)
return;
@@ -550,7 +551,7 @@ static void cacheLayoutTestControllerCallback(unsigned index, JSValueRef callbac
callbackMap().add(index, callback);
}
-static void callLayoutTestControllerCallback(unsigned index)
+static void callTestRunnerCallback(unsigned index)
{
if (!callbackMap().contains(index))
return;
@@ -561,61 +562,61 @@ static void callLayoutTestControllerCallback(unsigned index)
JSValueUnprotect(context, callback);
}
-void LayoutTestController::addChromeInputField(JSValueRef callback)
+void TestRunner::addChromeInputField(JSValueRef callback)
{
- cacheLayoutTestControllerCallback(AddChromeInputFieldCallbackID, callback);
+ cacheTestRunnerCallback(AddChromeInputFieldCallbackID, callback);
InjectedBundle::shared().postAddChromeInputField();
}
-void LayoutTestController::removeChromeInputField(JSValueRef callback)
+void TestRunner::removeChromeInputField(JSValueRef callback)
{
- cacheLayoutTestControllerCallback(RemoveChromeInputFieldCallbackID, callback);
+ cacheTestRunnerCallback(RemoveChromeInputFieldCallbackID, callback);
InjectedBundle::shared().postRemoveChromeInputField();
}
-void LayoutTestController::focusWebView(JSValueRef callback)
+void TestRunner::focusWebView(JSValueRef callback)
{
- cacheLayoutTestControllerCallback(FocusWebViewCallbackID, callback);
+ cacheTestRunnerCallback(FocusWebViewCallbackID, callback);
InjectedBundle::shared().postFocusWebView();
}
-void LayoutTestController::setBackingScaleFactor(double backingScaleFactor, JSValueRef callback)
+void TestRunner::setBackingScaleFactor(double backingScaleFactor, JSValueRef callback)
{
- cacheLayoutTestControllerCallback(SetBackingScaleFactorCallbackID, callback);
+ cacheTestRunnerCallback(SetBackingScaleFactorCallbackID, callback);
InjectedBundle::shared().postSetBackingScaleFactor(backingScaleFactor);
}
-void LayoutTestController::setWindowIsKey(bool isKey)
+void TestRunner::setWindowIsKey(bool isKey)
{
InjectedBundle::shared().postSetWindowIsKey(isKey);
}
-void LayoutTestController::callAddChromeInputFieldCallback()
+void TestRunner::callAddChromeInputFieldCallback()
{
- callLayoutTestControllerCallback(AddChromeInputFieldCallbackID);
+ callTestRunnerCallback(AddChromeInputFieldCallbackID);
}
-void LayoutTestController::callRemoveChromeInputFieldCallback()
+void TestRunner::callRemoveChromeInputFieldCallback()
{
- callLayoutTestControllerCallback(RemoveChromeInputFieldCallbackID);
+ callTestRunnerCallback(RemoveChromeInputFieldCallbackID);
}
-void LayoutTestController::callFocusWebViewCallback()
+void TestRunner::callFocusWebViewCallback()
{
- callLayoutTestControllerCallback(FocusWebViewCallbackID);
+ callTestRunnerCallback(FocusWebViewCallbackID);
}
-void LayoutTestController::callSetBackingScaleFactorCallback()
+void TestRunner::callSetBackingScaleFactorCallback()
{
- callLayoutTestControllerCallback(SetBackingScaleFactorCallbackID);
+ callTestRunnerCallback(SetBackingScaleFactorCallbackID);
}
-void LayoutTestController::overridePreference(JSStringRef preference, bool value)
+void TestRunner::overridePreference(JSStringRef preference, bool value)
{
WKBundleOverrideBoolPreferenceForTestRunner(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), toWK(preference).get(), value);
}
-void LayoutTestController::sendWebIntentResponse(JSStringRef reply)
+void TestRunner::sendWebIntentResponse(JSStringRef reply)
{
#if ENABLE(WEB_INTENTS)
WKRetainPtr<WKBundleIntentRequestRef> currentRequest = InjectedBundle::shared().page()->currentIntentRequest();
@@ -636,7 +637,7 @@ void LayoutTestController::sendWebIntentResponse(JSStringRef reply)
#endif
}
-void LayoutTestController::deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data)
+void TestRunner::deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data)
{
#if ENABLE(WEB_INTENTS)
WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
@@ -651,22 +652,22 @@ void LayoutTestController::deliverWebIntent(JSStringRef action, JSStringRef type
WKDictionaryAddItem(intentInitDict.get(), WKStringCreateWithUTF8CString("type"), typeWK.get());
WKDictionaryAddItem(intentInitDict.get(), WKStringCreateWithUTF8CString("data"), dataWK.get());
- WKRetainPtr<WKIntentDataRef> wkIntentData(AdoptWK, WKIntentDataCreate(intentInitDict.get()));
- WKBundlePageDeliverIntentToFrame(InjectedBundle::shared().page()->page(), mainFrame, wkIntentData.get());
+ WKRetainPtr<WKBundleIntentRef> wkIntent(AdoptWK, WKBundleIntentCreate(intentInitDict.get()));
+ WKBundlePageDeliverIntentToFrame(InjectedBundle::shared().page()->page(), mainFrame, wkIntent.get());
#endif
}
-void LayoutTestController::setAlwaysAcceptCookies(bool accept)
+void TestRunner::setAlwaysAcceptCookies(bool accept)
{
WKBundleSetAlwaysAcceptCookies(InjectedBundle::shared().bundle(), accept);
}
-double LayoutTestController::preciseTime()
+double TestRunner::preciseTime()
{
return currentTime();
}
-void LayoutTestController::setUserStyleSheetEnabled(bool enabled)
+void TestRunner::setUserStyleSheetEnabled(bool enabled)
{
m_userStyleSheetEnabled = enabled;
@@ -675,7 +676,7 @@ void LayoutTestController::setUserStyleSheetEnabled(bool enabled)
WKBundleSetUserStyleSheetLocation(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), location);
}
-void LayoutTestController::setUserStyleSheetLocation(JSStringRef location)
+void TestRunner::setUserStyleSheetLocation(JSStringRef location)
{
m_userStyleSheetLocation = adoptWK(WKStringCreateWithJSString(location));
diff --git a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
index 517a5160a..32b43ff69 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
@@ -23,8 +23,8 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef LayoutTestController_h
-#define LayoutTestController_h
+#ifndef TestRunner_h
+#define TestRunner_h
#include "JSWrappable.h"
#include <JavaScriptCore/JSRetainPtr.h>
@@ -51,10 +51,10 @@ typedef Ecore_Timer* PlatformTimerRef;
namespace WTR {
-class LayoutTestController : public JSWrappable {
+class TestRunner : public JSWrappable {
public:
- static PassRefPtr<LayoutTestController> create();
- virtual ~LayoutTestController();
+ static PassRefPtr<TestRunner> create();
+ virtual ~TestRunner();
// JSWrappable
virtual JSClassRef wrapperClass();
@@ -79,6 +79,7 @@ public:
void dumpFullScreenCallbacks() { m_dumpFullScreenCallbacks = true; }
void dumpFrameLoadCallbacks() { setShouldDumpFrameLoadCallbacks(true); }
void dumpProgressFinishedCallback() { setShouldDumpProgressFinishedCallback(true); }
+ void dumpResourceLoadCallbacks() { m_dumpResourceLoadCallbacks = true; }
void dumpResourceResponseMIMETypes() { m_dumpResourceResponseMIMETypes = true; }
void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; }
@@ -163,6 +164,7 @@ public:
bool shouldDumpFullScreenCallbacks() const { return m_dumpFullScreenCallbacks; }
bool shouldDumpFrameLoadCallbacks() const { return m_dumpFrameLoadCallbacks; }
bool shouldDumpProgressFinishedCallback() const { return m_dumpProgressFinishedCallback; }
+ bool shouldDumpResourceLoadCallbacks() const { return m_dumpResourceLoadCallbacks; }
bool shouldDumpResourceResponseMIMETypes() const { return m_dumpResourceResponseMIMETypes; }
bool isPolicyDelegateEnabled() const { return m_policyDelegateEnabled; }
@@ -230,7 +232,7 @@ public:
private:
static const double waitToDumpWatchdogTimerInterval;
- LayoutTestController();
+ TestRunner();
void platformInitialize();
void initializeWaitToDumpWatchdogTimerIfNeeded();
@@ -249,6 +251,7 @@ private:
bool m_dumpFullScreenCallbacks;
bool m_dumpFrameLoadCallbacks;
bool m_dumpProgressFinishedCallback;
+ bool m_dumpResourceLoadCallbacks;
bool m_dumpResourceResponseMIMETypes;
bool m_waitToDump; // True if waitUntilDone() has been called, but notifyDone() has not yet been called.
bool m_testRepaint;
@@ -270,4 +273,4 @@ private:
} // namespace WTR
-#endif // LayoutTestController_h
+#endif // TestRunner_h
diff --git a/Tools/WebKitTestRunner/InjectedBundle/efl/LayoutTestControllerEfl.cpp b/Tools/WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp
index b1b6f844a..4c0ea22f8 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/efl/LayoutTestControllerEfl.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp
@@ -18,7 +18,7 @@
*/
#include "config.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include "InjectedBundle.h"
#include <Ecore.h>
@@ -27,16 +27,16 @@ namespace WTR {
static Eina_Bool waitToDumpWatchdogTimerCallback(void*)
{
- InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired();
+ InjectedBundle::shared().testRunner()->waitToDumpWatchdogTimerFired();
return false;
}
-void LayoutTestController::platformInitialize()
+void TestRunner::platformInitialize()
{
m_waitToDumpWatchdogTimer = 0;
}
-void LayoutTestController::invalidateWaitToDumpWatchdogTimer()
+void TestRunner::invalidateWaitToDumpWatchdogTimer()
{
if (!m_waitToDumpWatchdogTimer)
return;
@@ -45,7 +45,7 @@ void LayoutTestController::invalidateWaitToDumpWatchdogTimer()
m_waitToDumpWatchdogTimer = 0;
}
-void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded()
+void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded()
{
if (m_waitToDumpWatchdogTimer)
return;
@@ -54,12 +54,12 @@ void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded()
waitToDumpWatchdogTimerCallback, 0);
}
-JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef url)
+JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url)
{
return url;
}
-JSRetainPtr<JSStringRef> LayoutTestController::platformName()
+JSRetainPtr<JSStringRef> TestRunner::platformName()
{
JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("efl"));
return platformName;
diff --git a/Tools/WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp b/Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp
index d8d0ed5d0..301038294 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp
@@ -25,7 +25,7 @@
*/
#include "config.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include "InjectedBundle.h"
#include <glib.h>
@@ -34,16 +34,16 @@ namespace WTR {
static gboolean waitToDumpWatchdogTimerCallback(gpointer)
{
- InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired();
+ InjectedBundle::shared().testRunner()->waitToDumpWatchdogTimerFired();
return FALSE;
}
-void LayoutTestController::platformInitialize()
+void TestRunner::platformInitialize()
{
m_waitToDumpWatchdogTimer = 0;
}
-void LayoutTestController::invalidateWaitToDumpWatchdogTimer()
+void TestRunner::invalidateWaitToDumpWatchdogTimer()
{
if (!m_waitToDumpWatchdogTimer)
return;
@@ -51,7 +51,7 @@ void LayoutTestController::invalidateWaitToDumpWatchdogTimer()
m_waitToDumpWatchdogTimer = 0;
}
-void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded()
+void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded()
{
if (m_waitToDumpWatchdogTimer)
return;
@@ -60,12 +60,12 @@ void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded()
waitToDumpWatchdogTimerCallback, 0);
}
-JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef url)
+JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url)
{
return url;
}
-JSRetainPtr<JSStringRef> LayoutTestController::platformName()
+JSRetainPtr<JSStringRef> TestRunner::platformName()
{
JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("gtk"));
return platformName;
diff --git a/Tools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm b/Tools/WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm
index b1e0265bf..dca27e6a0 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm
+++ b/Tools/WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm
@@ -23,17 +23,17 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include "InjectedBundle.h"
namespace WTR {
-void LayoutTestController::platformInitialize()
+void TestRunner::platformInitialize()
{
}
-void LayoutTestController::invalidateWaitToDumpWatchdogTimer()
+void TestRunner::invalidateWaitToDumpWatchdogTimer()
{
if (!m_waitToDumpWatchdogTimer)
return;
@@ -44,10 +44,10 @@ void LayoutTestController::invalidateWaitToDumpWatchdogTimer()
static void waitUntilDoneWatchdogTimerFired(CFRunLoopTimerRef timer, void* info)
{
- InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired();
+ InjectedBundle::shared().testRunner()->waitToDumpWatchdogTimerFired();
}
-void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded()
+void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded()
{
if (m_waitToDumpWatchdogTimer)
return;
@@ -56,12 +56,12 @@ void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded()
CFRunLoopAddTimer(CFRunLoopGetCurrent(), m_waitToDumpWatchdogTimer.get(), kCFRunLoopCommonModes);
}
-JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef url)
+JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url)
{
return JSStringRetain(url); // Do nothing on mac.
}
-JSRetainPtr<JSStringRef> LayoutTestController::platformName()
+JSRetainPtr<JSStringRef> TestRunner::platformName()
{
JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("mac"));
return platformName;
diff --git a/Tools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp b/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp
index 5de8ae71a..f5d149b3d 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp
@@ -25,7 +25,7 @@
*/
#include "config.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include "ActivateFonts.h"
#include "InjectedBundle.h"
@@ -47,17 +47,17 @@ public:
return theInstance;
}
-public slots:
+public Q_SLOTS:
void timerFired()
{
- InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired();
+ InjectedBundle::shared().testRunner()->waitToDumpWatchdogTimerFired();
}
private:
WatchdogTimerHelper() {}
};
-void LayoutTestController::platformInitialize()
+void TestRunner::platformInitialize()
{
// Make WebKit2 mimic the behaviour of DumpRenderTree, which is incorrect,
// but tests are successfully passed. On the long run, Qt will move to QRawFont,
@@ -69,12 +69,12 @@ void LayoutTestController::platformInitialize()
QObject::connect(&m_waitToDumpWatchdogTimer, SIGNAL(timeout()), WatchdogTimerHelper::instance(), SLOT(timerFired()));
}
-void LayoutTestController::invalidateWaitToDumpWatchdogTimer()
+void TestRunner::invalidateWaitToDumpWatchdogTimer()
{
m_waitToDumpWatchdogTimer.stop();
}
-void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded()
+void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded()
{
if (qgetenv("QT_WEBKIT2_DEBUG") == "1")
return;
@@ -85,7 +85,7 @@ void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded()
m_waitToDumpWatchdogTimer.start(waitToDumpWatchdogTimerInterval * 1000);
}
-JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef url)
+JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url)
{
QString localTmpUrl(QStringLiteral("file:///tmp/LayoutTests"));
QString givenUrl(reinterpret_cast<const QChar*>(JSStringGetCharactersPtr(url)), JSStringGetLength(url));
@@ -104,7 +104,7 @@ JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef u
return url;
}
-JSRetainPtr<JSStringRef> LayoutTestController::platformName()
+JSRetainPtr<JSStringRef> TestRunner::platformName()
{
JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("qt"));
return platformName;
@@ -112,4 +112,4 @@ JSRetainPtr<JSStringRef> LayoutTestController::platformName()
} // namespace WTR
-#include "LayoutTestControllerQt.moc"
+#include "TestRunnerQt.moc"
diff --git a/Tools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp b/Tools/WebKitTestRunner/InjectedBundle/win/TestRunnerWin.cpp
index be9c414cf..225394276 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/win/TestRunnerWin.cpp
@@ -24,18 +24,18 @@
*/
#include "config.h"
-#include "LayoutTestController.h"
+#include "TestRunner.h"
#include "InjectedBundle.h"
namespace WTR {
-void LayoutTestController::platformInitialize()
+void TestRunner::platformInitialize()
{
m_waitToDumpWatchdogTimer = 0;
}
-void LayoutTestController::invalidateWaitToDumpWatchdogTimer()
+void TestRunner::invalidateWaitToDumpWatchdogTimer()
{
if (!m_waitToDumpWatchdogTimer)
return;
@@ -46,12 +46,12 @@ void LayoutTestController::invalidateWaitToDumpWatchdogTimer()
static void CALLBACK waitToDumpWatchdogTimerFired(HWND, UINT, UINT_PTR, DWORD)
{
- InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired();
+ InjectedBundle::shared().testRunner()->waitToDumpWatchdogTimerFired();
}
static const UINT_PTR waitToDumpWatchdogTimerIdentifier = 1;
-void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded()
+void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded()
{
if (m_waitToDumpWatchdogTimer)
return;
@@ -59,12 +59,12 @@ void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded()
m_waitToDumpWatchdogTimer = ::SetTimer(0, waitToDumpWatchdogTimerIdentifier, waitToDumpWatchdogTimerInterval * 1000, WTR::waitToDumpWatchdogTimerFired);
}
-JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef url)
+JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url)
{
return JSStringRetain(url); // TODO.
}
-JSRetainPtr<JSStringRef> LayoutTestController::platformName()
+JSRetainPtr<JSStringRef> TestRunner::platformName()
{
JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("win"));
return platformName;
diff --git a/Tools/WebKitTestRunner/PlatformEfl.cmake b/Tools/WebKitTestRunner/PlatformEfl.cmake
index e967d557c..084cb5045 100644
--- a/Tools/WebKitTestRunner/PlatformEfl.cmake
+++ b/Tools/WebKitTestRunner/PlatformEfl.cmake
@@ -3,7 +3,6 @@ LIST(APPEND WebKitTestRunner_LINK_FLAGS
${EDJE_LDFLAGS}
${EFLDEPS_LDFLAGS}
${EVAS_LDFLAGS}
- ${LIBSOUP24_LDFLAGS}
)
ADD_CUSTOM_TARGET(forwarding-headersEflForWebKitTestRunner
@@ -34,7 +33,7 @@ LIST(APPEND WebKitTestRunner_INCLUDE_DIRECTORIES
${ECORE_X_INCLUDE_DIRS}
${EFLDEPS_INCLUDE_DIRS}
${EVAS_INCLUDE_DIRS}
- ${Glib_INCLUDE_DIRS}
+ ${GLIB_INCLUDE_DIRS}
)
LIST(APPEND WebKitTestRunner_LIBRARIES
@@ -42,7 +41,7 @@ LIST(APPEND WebKitTestRunner_LIBRARIES
${ECORE_X_LIBRARIES}
${EDJE_LIBRARIES}
${EFLDEPS_LIBRARIES}
- ${Glib_LIBRARIES}
+ ${GLIB_LIBRARIES}
${OPENGL_LIBRARIES}
${WTF_LIBRARY_NAME}
)
@@ -52,7 +51,7 @@ LIST(APPEND WebKitTestRunnerInjectedBundle_SOURCES
${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/efl/ActivateFontsEfl.cpp
${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/efl/InjectedBundleEfl.cpp
- ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/efl/LayoutTestControllerEfl.cpp
+ ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/efl/TestRunnerEfl.cpp
)
# FIXME: DOWNLOADED_FONTS_DIR should not hardcode the directory
diff --git a/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
index 3ebf18e8c..be8262ff6 100644
--- a/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
+++ b/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
@@ -71,13 +71,13 @@
BC8FD8D2120E545B00F3E71A /* JSEventSendingController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8FD8D0120E545B00F3E71A /* JSEventSendingController.cpp */; };
BC9192051333E4F8003011DC /* TestInvocationCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC9192041333E4F8003011DC /* TestInvocationCG.cpp */; };
BC952C0D11F3B965003398B4 /* JSWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC952C0C11F3B965003398B4 /* JSWrapper.cpp */; };
- BC952F1F11F3C652003398B4 /* JSLayoutTestController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC952F1D11F3C652003398B4 /* JSLayoutTestController.cpp */; };
+ BC952F1F11F3C652003398B4 /* JSTestRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC952F1D11F3C652003398B4 /* JSTestRunner.cpp */; };
BCC997A411D3C8F60017BCA2 /* InjectedBundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC997A011D3C8F60017BCA2 /* InjectedBundle.cpp */; };
BCC997A511D3C8F60017BCA2 /* InjectedBundlePage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC997A211D3C8F60017BCA2 /* InjectedBundlePage.cpp */; };
- BCC9981811D3F51E0017BCA2 /* LayoutTestController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */; };
+ BCC9981811D3F51E0017BCA2 /* TestRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC9981711D3F51E0017BCA2 /* TestRunner.cpp */; };
BCD7D2F811921278006DB7EE /* TestInvocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD7D2F711921278006DB7EE /* TestInvocation.cpp */; };
BCDA2B9A1191051F00C3BC47 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */; };
- C0CE720B1247C93300BC0EC4 /* LayoutTestControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0CE720A1247C93300BC0EC4 /* LayoutTestControllerMac.mm */; };
+ C0CE720B1247C93300BC0EC4 /* TestRunnerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0CE720A1247C93300BC0EC4 /* TestRunnerMac.mm */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -185,21 +185,21 @@
BC952C0C11F3B965003398B4 /* JSWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWrapper.cpp; sourceTree = "<group>"; };
BC952C0E11F3B97B003398B4 /* JSWrappable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWrappable.h; sourceTree = "<group>"; };
BC952EC511F3C10F003398B4 /* DerivedSources.make */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DerivedSources.make; sourceTree = "<group>"; };
- BC952ED211F3C29F003398B4 /* LayoutTestController.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LayoutTestController.idl; sourceTree = "<group>"; };
+ BC952ED211F3C29F003398B4 /* TestRunner.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TestRunner.idl; sourceTree = "<group>"; };
BC952ED311F3C318003398B4 /* CodeGeneratorTestRunner.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = CodeGeneratorTestRunner.pm; sourceTree = "<group>"; };
- BC952F1D11F3C652003398B4 /* JSLayoutTestController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSLayoutTestController.cpp; path = DerivedSources/WebKitTestRunner/JSLayoutTestController.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
- BC952F1E11F3C652003398B4 /* JSLayoutTestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSLayoutTestController.h; path = DerivedSources/WebKitTestRunner/JSLayoutTestController.h; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC952F1D11F3C652003398B4 /* JSTestRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSTestRunner.cpp; path = DerivedSources/WebKitTestRunner/JSTestRunner.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC952F1E11F3C652003398B4 /* JSTestRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSTestRunner.h; path = DerivedSources/WebKitTestRunner/JSTestRunner.h; sourceTree = BUILT_PRODUCTS_DIR; };
BC99A4841208901A007E9F08 /* StringFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringFunctions.h; sourceTree = "<group>"; };
BCC997A011D3C8F60017BCA2 /* InjectedBundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundle.cpp; sourceTree = "<group>"; };
BCC997A111D3C8F60017BCA2 /* InjectedBundle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundle.h; sourceTree = "<group>"; };
BCC997A211D3C8F60017BCA2 /* InjectedBundlePage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePage.cpp; sourceTree = "<group>"; };
BCC997A311D3C8F60017BCA2 /* InjectedBundlePage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePage.h; sourceTree = "<group>"; };
- BCC9981611D3F51E0017BCA2 /* LayoutTestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutTestController.h; sourceTree = "<group>"; };
- BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutTestController.cpp; sourceTree = "<group>"; };
+ BCC9981611D3F51E0017BCA2 /* TestRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestRunner.h; sourceTree = "<group>"; };
+ BCC9981711D3F51E0017BCA2 /* TestRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestRunner.cpp; sourceTree = "<group>"; };
BCD7D2F611921278006DB7EE /* TestInvocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestInvocation.h; sourceTree = "<group>"; };
BCD7D2F711921278006DB7EE /* TestInvocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestInvocation.cpp; sourceTree = "<group>"; };
BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
- C0CE720A1247C93300BC0EC4 /* LayoutTestControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = LayoutTestControllerMac.mm; path = mac/LayoutTestControllerMac.mm; sourceTree = "<group>"; };
+ C0CE720A1247C93300BC0EC4 /* TestRunnerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TestRunnerMac.mm; path = mac/TestRunnerMac.mm; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -324,9 +324,9 @@
BC8FD8C8120E527F00F3E71A /* EventSendingController.h */,
BC14E4D9120E02D000826C0C /* GCController.cpp */,
BC14E4D8120E02D000826C0C /* GCController.h */,
- BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */,
- BCC9981611D3F51E0017BCA2 /* LayoutTestController.h */,
- C0CE720A1247C93300BC0EC4 /* LayoutTestControllerMac.mm */,
+ BCC9981711D3F51E0017BCA2 /* TestRunner.cpp */,
+ BCC9981611D3F51E0017BCA2 /* TestRunner.h */,
+ C0CE720A1247C93300BC0EC4 /* TestRunnerMac.mm */,
5664A49814326384008881BE /* TextInputController.cpp */,
5664A49914326384008881BE /* TextInputController.h */,
);
@@ -412,7 +412,7 @@
29210EDC144CD56E00835BB5 /* AccessibilityUIElement.idl */,
BC8FD8CB120E52B000F3E71A /* EventSendingController.idl */,
BC14E4E1120E032000826C0C /* GCController.idl */,
- BC952ED211F3C29F003398B4 /* LayoutTestController.idl */,
+ BC952ED211F3C29F003398B4 /* TestRunner.idl */,
5664A49614326377008881BE /* TextInputController.idl */,
);
path = Bindings;
@@ -433,8 +433,8 @@
BC8FD8D1120E545B00F3E71A /* JSEventSendingController.h */,
BC14E4E8120E03D800826C0C /* JSGCController.cpp */,
BC14E4E9120E03D800826C0C /* JSGCController.h */,
- BC952F1D11F3C652003398B4 /* JSLayoutTestController.cpp */,
- BC952F1E11F3C652003398B4 /* JSLayoutTestController.h */,
+ BC952F1D11F3C652003398B4 /* JSTestRunner.cpp */,
+ BC952F1E11F3C652003398B4 /* JSTestRunner.h */,
5641E2CE14335E95008307E5 /* JSTextInputController.cpp */,
5641E2CF14335E95008307E5 /* JSTextInputController.h */,
);
@@ -577,16 +577,16 @@
BC251A3E11D16831002EBC01 /* InjectedBundleMain.cpp in Sources */,
BCC997A411D3C8F60017BCA2 /* InjectedBundle.cpp in Sources */,
BCC997A511D3C8F60017BCA2 /* InjectedBundlePage.cpp in Sources */,
- BCC9981811D3F51E0017BCA2 /* LayoutTestController.cpp in Sources */,
+ BCC9981811D3F51E0017BCA2 /* TestRunner.cpp in Sources */,
65EB85A011EC67CC0034D300 /* ActivateFonts.mm in Sources */,
BC952C0D11F3B965003398B4 /* JSWrapper.cpp in Sources */,
- BC952F1F11F3C652003398B4 /* JSLayoutTestController.cpp in Sources */,
+ BC952F1F11F3C652003398B4 /* JSTestRunner.cpp in Sources */,
BC14E4DB120E02D000826C0C /* GCController.cpp in Sources */,
BC14E4EA120E03D800826C0C /* JSGCController.cpp in Sources */,
BC8DAD7B1316D91000EC96FC /* InjectedBundleMac.mm in Sources */,
BC8FD8CA120E527F00F3E71A /* EventSendingController.cpp in Sources */,
BC8FD8D2120E545B00F3E71A /* JSEventSendingController.cpp in Sources */,
- C0CE720B1247C93300BC0EC4 /* LayoutTestControllerMac.mm in Sources */,
+ C0CE720B1247C93300BC0EC4 /* TestRunnerMac.mm in Sources */,
5664A49A14326384008881BE /* TextInputController.cpp in Sources */,
5641E2D014335E95008307E5 /* JSTextInputController.cpp in Sources */,
29210EAE144CACB700835BB5 /* AccessibilityUIElement.cpp in Sources */,
diff --git a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
index 8a752a831..21ed91bb1 100644
--- a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
+++ b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
@@ -48,7 +48,7 @@ public:
connect(this, SIGNAL(statusChanged(QQuickView::Status)), SLOT(handleStatusChanged(QQuickView::Status)));
}
-private slots:
+private Q_SLOTS:
void handleStatusChanged(QQuickView::Status status)
{
if (status != QQuickView::Ready)
diff --git a/Tools/WebKitTestRunner/qt/main.cpp b/Tools/WebKitTestRunner/qt/main.cpp
index 1da12a7b2..d7abf16e6 100644
--- a/Tools/WebKitTestRunner/qt/main.cpp
+++ b/Tools/WebKitTestRunner/qt/main.cpp
@@ -55,7 +55,7 @@ public:
delete m_controller;
}
-public slots:
+public Q_SLOTS:
void launch()
{
m_controller = new WTR::TestController(m_argc, const_cast<const char**>(m_argv));
diff --git a/Tools/WebKitTestRunner/win/InjectedBundle.vcproj b/Tools/WebKitTestRunner/win/InjectedBundle.vcproj
index 045ad6d52..c20bad946 100644
--- a/Tools/WebKitTestRunner/win/InjectedBundle.vcproj
+++ b/Tools/WebKitTestRunner/win/InjectedBundle.vcproj
@@ -718,7 +718,7 @@
>
</File>
<File
- RelativePath="..\InjectedBundle\Bindings\LayoutTestController.idl"
+ RelativePath="..\InjectedBundle\Bindings\TestRunner.idl"
>
<FileConfiguration
Name="Debug|Win32"
@@ -874,11 +874,11 @@
>
</File>
<File
- RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSLayoutTestController.cpp"
+ RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSTestRunner.cpp"
>
</File>
<File
- RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSLayoutTestController.h"
+ RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSTestRunner.h"
>
</File>
<File
@@ -967,15 +967,15 @@
>
</File>
<File
- RelativePath="..\InjectedBundle\LayoutTestController.cpp"
+ RelativePath="..\InjectedBundle\TestRunner.cpp"
>
</File>
<File
- RelativePath="..\InjectedBundle\LayoutTestController.h"
+ RelativePath="..\InjectedBundle\TestRunner.h"
>
</File>
<File
- RelativePath="..\InjectedBundle\win\LayoutTestControllerWin.cpp"
+ RelativePath="..\InjectedBundle\win\TestRunnerWin.cpp"
>
</File>
<File
diff --git a/Tools/WinLauncher/WinLauncher.cpp b/Tools/WinLauncher/WinLauncher.cpp
index 0e47f9996..405d1b209 100644
--- a/Tools/WinLauncher/WinLauncher.cpp
+++ b/Tools/WinLauncher/WinLauncher.cpp
@@ -228,8 +228,13 @@ static void resizeSubViews()
static void subclassForLayeredWindow()
{
hMainWnd = gViewWindow;
- DefWebKitProc = reinterpret_cast<WNDPROC>(::GetWindowLongPtr(hMainWnd, GWL_WNDPROC));
- ::SetWindowLongPtr(hMainWnd, GWL_WNDPROC, reinterpret_cast<LONG_PTR>(WndProc));
+#if defined _M_AMD64 || defined _WIN64
+ DefWebKitProc = reinterpret_cast<WNDPROC>(::GetWindowLongPtr(hMainWnd, GWLP_WNDPROC));
+ ::SetWindowLongPtr(hMainWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(WndProc));
+#else
+ DefWebKitProc = reinterpret_cast<WNDPROC>(::GetWindowLong(hMainWnd, GWL_WNDPROC));
+ ::SetWindowLong(hMainWnd, GWL_WNDPROC, reinterpret_cast<LONG_PTR>(WndProc));
+#endif
}
static void computeFullDesktopFrame()
@@ -314,8 +319,14 @@ extern "C" __declspec(dllexport) int WINAPI dllLauncherEntryPoint(HINSTANCE, HIN
UpdateWindow(hMainWnd);
}
- DefEditProc = reinterpret_cast<WNDPROC>(GetWindowLongPtr(hURLBarWnd, GWL_WNDPROC));
- SetWindowLongPtr(hURLBarWnd, GWL_WNDPROC, reinterpret_cast<LONG_PTR>(MyEditProc));
+#if defined _M_AMD64 || defined _WIN64
+ DefEditProc = reinterpret_cast<WNDPROC>(GetWindowLongPtr(hURLBarWnd, GWLP_WNDPROC));
+ SetWindowLongPtr(hURLBarWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(MyEditProc));
+#else
+ DefEditProc = reinterpret_cast<WNDPROC>(GetWindowLong(hURLBarWnd, GWL_WNDPROC));
+ SetWindowLong(hURLBarWnd, GWL_WNDPROC, reinterpret_cast<LONG_PTR>(MyEditProc));
+#endif
+
SetFocus(hURLBarWnd);
RECT clientRect = { s_windowPosition.x, s_windowPosition.y, s_windowPosition.x + s_windowSize.cx, s_windowPosition.y + s_windowSize.cy };
diff --git a/Tools/efl/jhbuild.modules b/Tools/efl/jhbuild.modules
index 82e5da84f..d1f05e309 100644
--- a/Tools/efl/jhbuild.modules
+++ b/Tools/efl/jhbuild.modules
@@ -36,9 +36,8 @@
href="http://cairographics.org"/>
<repository type="tarball" name="freedesktop.org"
href="http://www.freedesktop.org"/>
- <repository type="svn" name="enlightenment.org"
- href="http://svn.enlightenment.org/svn/e/trunk/"
- trunk-template="%(module)s/"/>
+ <repository type="tarball" name="enlightenment.fr"
+ href="http://git.enlightenment.fr/cgit.cgi/svn/"/>
<autotools id="cairo" autogen-sh="configure">
<dependencies>
@@ -155,31 +154,43 @@
</branch>
</autotools>
- <autotools id="eina" >
- <branch module="eina"
- repo="enlightenment.org"
- revision="73027"/>
+ <autotools id="eina">
+ <branch module="eina.git/snapshot/eina-f90926dd9bf19ea946d7572b36335cc0c5cd3ab5.tar.bz2" version="73027"
+ checkoutdir="eina-f90926dd9bf19ea946d7572b36335cc0c5cd3ab5"
+ repo="enlightenment.fr"
+ hash="sha256:388214434dbe3726aa3894e6f9838adfc43d8bd63bb9597f86a4efbc48b42cad"
+ md5sum="db756dbda2b8b77e5f807c3ecccd34e4">
+ </branch>
</autotools>
<autotools id="embryo">
- <branch module="embryo"
- repo="enlightenment.org"
- revision="73027"/>
+ <branch module="embryo.git/snapshot/embryo-191e1b5f022f769d62abec6112f51e5fbecd6db9.tar.bz2" version="73027"
+ checkoutdir="embryo-191e1b5f022f769d62abec6112f51e5fbecd6db9"
+ repo="enlightenment.fr"
+ hash="sha256:d8a57f51985ee16ee6a7fde2d3b931e83da5d26a1a62efc012d64e6d5fe3748b"
+ md5sum="adebeb8c704e70912a920e8ef4ec43cd">
+ </branch>
<dependencies>
<dep package="eina"/>
</dependencies>
</autotools>
<autotools id="evas">
- <branch module="evas"
- repo="enlightenment.org"
- revision="73027"/>
+ <branch module="evas.git/snapshot/evas-169cf1bb962001f1cf3e59eb950380a9dc1fced3.tar.bz2" version="73027"
+ checkoutdir="evas-169cf1bb962001f1cf3e59eb950380a9dc1fced3"
+ repo="enlightenment.fr"
+ hash="sha256:2b59350e0fe33a8fe49fcbe04192d05ab37345684c4eb9b10fb0e0a35545e7da"
+ md5sum="bfb5442e50551c64c709481a9a35b4a2">
+ </branch>
</autotools>
<autotools id="ecore">
- <branch module="ecore"
- repo="enlightenment.org"
- revision="73027"/>
+ <branch module="ecore.git/snapshot/ecore-9c96f9c140320e52030d1a206d8d330aa46abc44.tar.bz2" version="73027"
+ checkoutdir="ecore-9c96f9c140320e52030d1a206d8d330aa46abc44"
+ repo="enlightenment.fr"
+ hash="sha256:546b9c389556074ad4982a0e389ccb0e55ced59ce725ea2b5c065c4d60310068"
+ md5sum="b15571f271a9960b562f98cb09268408">
+ </branch>
<dependencies>
<dep package="eina"/>
<dep package="evas"/>
@@ -187,9 +198,12 @@
</autotools>
<autotools id="eet">
- <branch module="eet"
- repo="enlightenment.org"
- revision="73027"/>
+ <branch module="eet.git/snapshot/eet-15fd52e4831b946308a80df9a25357dc18c97ca2.tar.bz2" version="73027"
+ checkoutdir="eet-15fd52e4831b946308a80df9a25357dc18c97ca2"
+ repo="enlightenment.fr"
+ hash="sha256:62eff1248923be7918beff46e8598ff2b139b0224f0a1b845142cf1b078422e6"
+ md5sum="be08634c70712bb44a5534ef5b2a7af3">
+ </branch>
<dependencies>
<dep package="libgcrypt"/>
<dep package="eina"/>
@@ -197,9 +211,12 @@
</autotools>
<autotools id="edje">
- <branch module="edje"
- repo="enlightenment.org"
- revision="73027"/>
+ <branch module="edje.git/snapshot/edje-14738eefac54d1a8cfead2b5aed3b7f05c5b4bd8.tar.bz2" version="73027"
+ checkoutdir="edje-14738eefac54d1a8cfead2b5aed3b7f05c5b4bd8"
+ repo="enlightenment.fr"
+ hash="sha256:9e102f0b47e9cdfa737b5f81b11d352ae01206209729e5815c28d826186b247e"
+ md5sum="5f1995901c848bdaec56ff1f913ef02f">
+ </branch>
<dependencies>
<dep package="eet"/>
<dep package="ecore"/>
@@ -209,9 +226,12 @@
</autotools>
<autotools id="e_dbus">
- <branch module="e_dbus"
- repo="enlightenment.org"
- revision="73027"/>
+ <branch module="e_dbus.git/snapshot/e_dbus-9de0a3e0c959cdbaba022eb888b9670bd766d38f.tar.bz2" version="73027"
+ checkoutdir="e_dbus-9de0a3e0c959cdbaba022eb888b9670bd766d38f"
+ repo="enlightenment.fr"
+ hash="sha256:f9655c3ba69174dbd65b5220a492b970aa9264ff3283cbd960a89b69e53591b6"
+ md5sum="4cca1f994e17823ca9be1985f5c4ad09">
+ </branch>
<dependencies>
<dep package="ecore"/>
<dep package="eina"/>
@@ -219,9 +239,12 @@
</autotools>
<autotools id="eeze">
- <branch module="eeze"
- repo="enlightenment.org"
- revision="73027"/>
+ <branch module="eeze.git/snapshot/eeze-09a379bc2cc6c1c7aab0478991a104b0c6af1844.tar.bz2" version="73027"
+ checkoutdir="eeze-09a379bc2cc6c1c7aab0478991a104b0c6af1844"
+ repo="enlightenment.fr"
+ hash="sha256:312d61429af845a6333c0c968ec7b0902982082f171453ee14343a8efe773cfc"
+ md5sum="c163caedcbab532b4dc16014b14bb9bc">
+ </branch>
<dependencies>
<dep package="ecore"/>
<dep package="eina"/>
@@ -229,9 +252,12 @@
</autotools>
<autotools id="efreet">
- <branch module="efreet"
- repo="enlightenment.org"
- revision="73027"/>
+ <branch module="efreet.git/snapshot/efreet-e7712c830f3a3cb4c197695de4c981387be8f214.tar.bz2" version="73027"
+ checkoutdir="efreet-e7712c830f3a3cb4c197695de4c981387be8f214"
+ repo="enlightenment.fr"
+ hash="sha256:4839187c3cc099eb6b6986c6924f4e4f6dffd22eccbc3f1bddd1a6312bc8c84c"
+ md5sum="bf28ee9d7b5211d72c27412a7f1cdb80">
+ </branch>
<dependencies>
<deb package="ecore"/>
<deb package="eina"/>
diff --git a/Tools/jhbuild/jhbuild-wrapper b/Tools/jhbuild/jhbuild-wrapper
index 390fc7821..40bbb0101 100755
--- a/Tools/jhbuild/jhbuild-wrapper
+++ b/Tools/jhbuild/jhbuild-wrapper
@@ -90,13 +90,6 @@ def install_jhbuild():
raise Exception('jhbuild configure failed with return code: %i' % process.returncode)
-def update_webkit_libs_jhbuild(platform):
- process = subprocess.Popen([jhbuildutils.top_level_path('Tools', 'Scripts', 'update-webkit-libs-jhbuild'), '--' + platform])
- process.wait()
- if process.returncode != 0:
- raise Exception('jhbuild configure failed with return code: %i' % process.returncode)
-
-
def determine_platform():
if '--efl' in sys.argv:
return "efl";
@@ -110,7 +103,6 @@ def ensure_jhbuild(platform):
clone_jhbuild()
update_jhbuild()
install_jhbuild()
- update_webkit_libs_jhbuild(platform)
elif not jhbuild_installed() \
or not jhbuild_at_expected_revision():
update_jhbuild()
diff --git a/Tools/qmake/mkspecs/features/default_pre.prf b/Tools/qmake/mkspecs/features/default_pre.prf
index c91aab9b3..efc1ad9dd 100644
--- a/Tools/qmake/mkspecs/features/default_pre.prf
+++ b/Tools/qmake/mkspecs/features/default_pre.prf
@@ -78,8 +78,8 @@ else: PYTHON = python
!haveQt(5):!recursive_include: error("Building WebKit with Qt versions older than 5.0 is not supported.")
-!haveQtModule(widgets)|!haveQtModule(printsupport) {
- root_project_file: message("WebKit1 requires the QtWidgets and QtPrintSupport modules. Disabling WebKit1.")
+!haveQtModule(widgets) {
+ root_project_file: message("WebKit1 requires the QtWidgets module. Disabling WebKit1.")
CONFIG += no_webkit1
}
diff --git a/Tools/qmake/mkspecs/features/features.prf b/Tools/qmake/mkspecs/features/features.prf
index 4f6ddca51..4307bc727 100644
--- a/Tools/qmake/mkspecs/features/features.prf
+++ b/Tools/qmake/mkspecs/features/features.prf
@@ -34,11 +34,6 @@ load(mobilityconfig, true)
DEFINES += WTF_USE_ICU_UNICODE=1
DEFINES -= WTF_USE_QT4_UNICODE=1
-!contains(DEFINES, HAVE_QRAWFONT=.) {
- # Use of QRawFont in Qt 5:
- DEFINES += HAVE_QRAWFONT=1
-}
-
# We need fontconfig to set up the test fonts for DumpRenderTree and WebKitTestRunner.
config_fontconfig:!mac {
DEFINES += HAVE_FONTCONFIG=1
@@ -48,6 +43,18 @@ config_fontconfig:!mac {
haveQtModule(quick): DEFINES += HAVE_QTQUICK=1
}
+!contains(DEFINES, HAVE_QTPRINTSUPPORT=.) {
+ haveQtModule(printsupport): DEFINES += HAVE_QTPRINTSUPPORT=1
+}
+
+!contains(DEFINES, HAVE_QTTESTLIB=.) {
+ haveQtModule(testlib) {
+ DEFINES += HAVE_QTTESTLIB=1
+ } else {
+ message("Missing QtTest module, disabling DumpRenderTree, WebKitTestRunner and tests")
+ }
+}
+
# We need libxml2 config test to determine to use libxml2 or not
!contains(DEFINES, WTF_USE_LIBXML2=.) {
config_libxml2: DEFINES += WTF_USE_LIBXML2=1
@@ -98,9 +105,18 @@ config_fontconfig:!mac {
# QStyle detection
haveQtModule(widgets): DEFINES += HAVE_QSTYLE=1
-# WebGL support
-!contains(DEFINES, ENABLE_WEBGL=.) {
- contains(QT_CONFIG, opengl):!win32-*: DEFINES += ENABLE_WEBGL=1
+# Enable the USE(3D_GRAPHICS) flag when QtOpenGL is enabled.
+!contains(DEFINES, WTF_USE_3D_GRAPHICS=.):contains(QT_CONFIG, opengl) {
+ # Disable USE(3D_GRAPHICS) on Windows temporarily, see https://bugs.webkit.org/show_bug.cgi?id=90850 for details.
+ # Also disable on QNX, see https://bugs.webkit.org/show_bug.cgi?id=93278
+ !win32-*:!qnx {
+ DEFINES += WTF_USE_3D_GRAPHICS=1
+ }
+}
+
+# WebGL support - only enabled if we can use 3D graphics
+!contains(DEFINES, ENABLE_WEBGL=.):contains(DEFINES, WTF_USE_3D_GRAPHICS=1) {
+ DEFINES += ENABLE_WEBGL=1
}
# CSS Shaders support
@@ -189,8 +205,8 @@ for(feature, FEATURE_DEFAULTS) {
# ---------------- Sanitize defines -------------------
-# Disable SVG fonts if SVG is disabled or we don't have raw fonts
-contains(DEFINES, ENABLE_SVG=0)|!contains(DEFINES, HAVE_QRAWFONT=1): DEFINES += ENABLE_SVG_FONTS=0
+# Disable SVG fonts if SVG is disabled
+contains(DEFINES, ENABLE_SVG=0): DEFINES += ENABLE_SVG_FONTS=0
# JavaScript debugger requires the inspector
contains(DEFINES, ENABLE_INSPECTOR=0) {
@@ -212,14 +228,6 @@ for(define, DEFINES) {
contains(DEFINES, $$opposite): DEFINES -= $$define
}
-# Enable the USE(3D_GRAPHICS) flag for Qt5 or when QtOpenGL is enabled.
-!contains(DEFINES, WTF_USE_3D_GRAPHICS=.) {
- # Disable USE(3D_GRAPHICS) on Windows temporarily, see https://bugs.webkit.org/show_bug.cgi?id=90850 for details.
- !win32-* {
- DEFINES += WTF_USE_3D_GRAPHICS=1
- }
-}
-
contains(DEFINES, ENABLE_GAMEPAD=1) {
!packagesExist(libudev) {
error("Gamepad API requires libudev to build. Please install libudev development files, or build WebKit without gamepad.")
diff --git a/Tools/qmake/mkspecs/features/features.pri b/Tools/qmake/mkspecs/features/features.pri
index 97dd7ae41..99cc70b78 100644
--- a/Tools/qmake/mkspecs/features/features.pri
+++ b/Tools/qmake/mkspecs/features/features.pri
@@ -31,6 +31,7 @@ FEATURE_DEFAULTS = \
ENABLE_CSS_SHADERS=0 \
ENABLE_CSS_VARIABLES=0 \
ENABLE_CSS3_FLEXBOX=1 \
+ ENABLE_CSS3_TEXT_DECORATION=0 \
ENABLE_DASHBOARD_SUPPORT=0 \
ENABLE_DATAGRID=0 \
ENABLE_DATALIST_ELEMENT=1 \
diff --git a/Tools/qmake/mkspecs/features/functions.prf b/Tools/qmake/mkspecs/features/functions.prf
index 972a2079f..c38f80d6a 100644
--- a/Tools/qmake/mkspecs/features/functions.prf
+++ b/Tools/qmake/mkspecs/features/functions.prf
@@ -260,11 +260,15 @@ defineTest(linkAgainstLibrary) {
POST_TARGETDEPS += $${path}$${QMAKE_DIR_SEP}lib$${target}.a
}
- # The following line is to prevent qmake from adding jscore to libQtWebKit's prl dependencies.
- # The compromise we have to accept by disabling explicitlib is to drop support to link QtWebKit
- # statically in applications (which isn't used often because, among other things, of licensing obstacles).
- CONFIG -= explicitlib
- CONFIG -= staticlib
+ # gprof does not support profiling a shared library.
+ # To profile WebKit, applications must link QtWebKit statically.
+ !contains(CONFIG, gprof) {
+ # The following line is to prevent qmake from adding jscore to libQtWebKit's prl dependencies.
+ # The compromise we have to accept by disabling explicitlib is to drop support to link QtWebKit
+ # statically in applications (which isn't used often because, among other things, of licensing obstacles).
+ CONFIG -= explicitlib
+ CONFIG -= staticlib
+ }
}
export(LIBS)
diff --git a/Tools/qmake/mkspecs/features/gprof.prf b/Tools/qmake/mkspecs/features/gprof.prf
new file mode 100644
index 000000000..38a77555b
--- /dev/null
+++ b/Tools/qmake/mkspecs/features/gprof.prf
@@ -0,0 +1,11 @@
+# -------------------------------------------------------------------
+# This optional feature file adds rules that make running gprof
+# on QtWebKit easier.
+#
+# See 'Tools/qmake/README' for an overview of the build system
+# -------------------------------------------------------------------
+
+!contains(CONFIG,no_webkit2): error("WebKit2 is not supported with gprof")
+
+QMAKE_CXXFLAGS += -pg
+QMAKE_LFLAGS += -pg
diff --git a/Tools/qmake/qt_webkit.pri b/Tools/qmake/qt_webkit.pri
index 343467583..e221bd26d 100644
--- a/Tools/qmake/qt_webkit.pri
+++ b/Tools/qmake/qt_webkit.pri
@@ -9,7 +9,7 @@ QT.webkit.name = QtWebKit
QT.webkit.bins = $$QT_MODULE_BIN_BASE
QT.webkit.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/QtWebKit
QT.webkit.imports = $$QT_MODULE_IMPORT_BASE
-QT.webkit.private_includes = $$QT_MODULE_INCLUDE_BASE/$$QT.webkit.name/$$QT.webkit.VERSION
+QT.webkit.private_includes = $$QT_MODULE_INCLUDE_BASE/$$QT.webkit.name/$$QT.webkit.VERSION $$QT_MODULE_INCLUDE_BASE/$$QT.webkit.name/$$QT.webkit.VERSION/$$QT.webkit.name
QT.webkit.sources = $$QT_MODULE_BASE
QT.webkit.libs = $$QT_MODULE_LIB_BASE
QT.webkit.depends = core gui opengl network
diff --git a/Tools/win/DLLLauncher/DLLLauncherMain.cpp b/Tools/win/DLLLauncher/DLLLauncherMain.cpp
index 93e77f485..961335dbe 100644
--- a/Tools/win/DLLLauncher/DLLLauncherMain.cpp
+++ b/Tools/win/DLLLauncher/DLLLauncherMain.cpp
@@ -184,11 +184,19 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpstrCm
#if USE_CONSOLE_ENTRY_POINT
typedef int (WINAPI*EntryPoint)(int, const char*[]);
+#if defined _M_AMD64 || defined _WIN64
+ const char* entryPointName = "_dllLauncherEntryPoint";
+#else
const char* entryPointName = "_dllLauncherEntryPoint@8";
+#endif
#else
typedef int (WINAPI*EntryPoint)(HINSTANCE, HINSTANCE, LPWSTR, int);
+#if defined _M_AMD64 || defined _WIN64
+ const char* entryPointName = "_dllLauncherEntryPoint";
+#else
const char* entryPointName = "_dllLauncherEntryPoint@16";
#endif
+#endif
EntryPoint entryPoint = reinterpret_cast<EntryPoint>(::GetProcAddress(module, entryPointName));
if (!entryPoint)
diff --git a/WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme b/WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme
index fd2cca7eb..f7a1785be 100644
--- a/WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme
+++ b/WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme
@@ -118,13 +118,14 @@
</Testables>
</TestAction>
<LaunchAction
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "YES"
debugDocumentVersioning = "YES"
+ enableOpenGLFrameCaptureMode = "0"
allowLocationSimulation = "YES">
<PathRunnable
FilePath = "/Applications/Safari.app/Contents/MacOS/SafariForWebKitDevelopment">
diff --git a/WebKitLibraries/ChangeLog b/WebKitLibraries/ChangeLog
index a5dd4a4ef..b211864b7 100644
--- a/WebKitLibraries/ChangeLog
+++ b/WebKitLibraries/ChangeLog
@@ -1,3 +1,39 @@
+2012-08-15 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com>
+
+ [css3-text] Add CSS3 Text decoration compile flag
+ https://bugs.webkit.org/show_bug.cgi?id=93863
+
+ Reviewed by Julien Chaffraix.
+
+ This patch handles the compile flag implementation, which will come disabled by
+ default, thus not exposing the CSS3 text decoration features to the web, unless
+ when explicitly enabling it with "--css3-text-decoration" build parameter.
+
+ * win/tools/vsprops/FeatureDefines.vsprops:
+ * win/tools/vsprops/FeatureDefinesCairo.vsprops:
+
+2012-08-14 Alex Christensen <alex.christensen@flexsim.com>
+
+ /SAFESEH should not be a common linker option
+ https://bugs.webkit.org/show_bug.cgi?id=89372
+
+ Reviewed by Darin Adler.
+
+ * win/tools/vsprops/common.vsprops:
+ removed /SAFESEH as a default option for the linker (doesn't work for x64)
+
+2012-08-13 Roger Fong <roger_fong@apple.com>
+
+ Enable CSS Sticky Position on Windows.
+ https://bugs.webkit.org/show_bug.cgi?id=93905
+
+ Reviewed by Tim Horton.
+
+ As per https://bugs.webkit.org/show_bug.cgi?id=90046, the ENABLE_CSS_STICKY_POSITION needs to be turned on for Windows as well.
+
+ * win/tools/vsprops/FeatureDefines.vsprops:
+ Include ENABLE_CSS_STICKY_POSITION flag.
+
2012-08-06 Anders Carlsson <andersca@apple.com>
If the Apple Java plug-in is blocked and no runtime is installed, don't load it
diff --git a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops b/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
index 946c0a878..9cd78c361 100644
--- a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
+++ b/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
@@ -9,7 +9,7 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="$(ENABLE_IFRAME_SEAMLESS);$(ENABLE_REQUEST_ANIMATION_FRAME);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_FLEXBOX);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_FILTERS);$(ENABLE_CSS_GRID_LAYOUT);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_EXCLUSIONS);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_SQL_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DETAILS_ELEMENT);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_NOTIFICATIONS);$(ENABLE_LINK_PREFETCH);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MUTATION_OBSERVERS);$(ENABLE_NOTIFICATIONS);$(ENABLE_PAGE_VISIBILITY_API);$(ENABLE_PROGRESS_ELEMENT);$(ENABLE_QUOTA);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHADOW_DOM);$(ENABLE_SHARED_WORKERS);$(ENABLE_STYLE_SCOPED);$(ENABLE_SVG);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_TEXT_AUTOSIZING);$(ENABLE_UNDO_MANAGER);$(ENABLE_VIDEO);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WORKERS);$(ENABLE_XSLT)"
+ PreprocessorDefinitions="$(ENABLE_IFRAME_SEAMLESS);$(ENABLE_REQUEST_ANIMATION_FRAME);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_FLEXBOX);$(ENABLE_CSS3_TEXT_DECORATION);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_FILTERS);$(ENABLE_CSS_GRID_LAYOUT);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_EXCLUSIONS);$(ENABLE_CSS_STICKY_POSITION);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_SQL_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DETAILS_ELEMENT);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_NOTIFICATIONS);$(ENABLE_LINK_PREFETCH);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MUTATION_OBSERVERS);$(ENABLE_NOTIFICATIONS);$(ENABLE_PAGE_VISIBILITY_API);$(ENABLE_PROGRESS_ELEMENT);$(ENABLE_QUOTA);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHADOW_DOM);$(ENABLE_SHARED_WORKERS);$(ENABLE_STYLE_SCOPED);$(ENABLE_SVG);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_TEXT_AUTOSIZING);$(ENABLE_UNDO_MANAGER);$(ENABLE_VIDEO);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WORKERS);$(ENABLE_XSLT)"
/>
<UserMacro
Name="ENABLE_3D_RENDERING"
@@ -42,11 +42,21 @@
PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_CSS3_TEXT_DECORATION"
+ Value=""
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
Name="ENABLE_CSS_BOX_DECORATION_BREAK"
Value="ENABLE_CSS_BOX_DECORATION_BREAK"
PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_CSS_COMPOSITING"
+ Value=""
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
Name="ENABLE_CSS_EXCLUSIONS"
Value=""
PerformEnvironmentSet="true"
@@ -72,10 +82,10 @@
PerformEnvironmentSet="true"
/>
<UserMacro
- Name="ENABLE_CSS_COMPOSITING"
- Value=""
- PerformEnvironmentSet="true"
- />
+ Name="ENABLE_CSS_STICKY_POSITION"
+ Value="ENABLE_CSS_STICKY_POSITION"
+ PerformEnvironmentSet="true"
+ />
<UserMacro
Name="ENABLE_CUSTOM_SCHEME_HANDLER"
Value=""
diff --git a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops b/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
index 9d0b77f1a..e3d82677c 100644
--- a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
+++ b/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
@@ -9,7 +9,7 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="$(ENABLE_IFRAME_SEAMLESS);$(ENABLE_REQUEST_ANIMATION_FRAME);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_FLEXBOX);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_FILTERS);$(ENABLE_CSS_GRID_LAYOUT);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_EXCLUSIONS);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_SQL_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DETAILS_ELEMENT);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_NOTIFICATIONS);$(ENABLE_LINK_PREFETCH);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MUTATION_OBSERVERS);$(ENABLE_NOTIFICATIONS);$(ENABLE_PAGE_VISIBILITY_API);$(ENABLE_PROGRESS_ELEMENT);$(ENABLE_QUOTA);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHADOW_DOM);$(ENABLE_SHARED_WORKERS);$(ENABLE_STYLE_SCOPED);$(ENABLE_SVG);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_TEXT_AUTOSIZING);$(ENABLE_UNDO_MANAGER);$(ENABLE_VIDEO);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WORKERS);$(ENABLE_XSLT)"
+ PreprocessorDefinitions="$(ENABLE_IFRAME_SEAMLESS);$(ENABLE_REQUEST_ANIMATION_FRAME);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_FLEXBOX);$(ENABLE_CSS3_TEXT_DECORATION);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_FILTERS);$(ENABLE_CSS_GRID_LAYOUT);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_EXCLUSIONS);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_SQL_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DETAILS_ELEMENT);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_NOTIFICATIONS);$(ENABLE_LINK_PREFETCH);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MUTATION_OBSERVERS);$(ENABLE_NOTIFICATIONS);$(ENABLE_PAGE_VISIBILITY_API);$(ENABLE_PROGRESS_ELEMENT);$(ENABLE_QUOTA);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHADOW_DOM);$(ENABLE_SHARED_WORKERS);$(ENABLE_STYLE_SCOPED);$(ENABLE_SVG);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_TEXT_AUTOSIZING);$(ENABLE_UNDO_MANAGER);$(ENABLE_VIDEO);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WORKERS);$(ENABLE_XSLT)"
/>
<UserMacro
Name="ENABLE_3D_RENDERING"
@@ -42,6 +42,11 @@
PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_CSS3_TEXT_DECORATION"
+ Value=""
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
Name="ENABLE_CSS_BOX_DECORATION_BREAK"
Value="ENABLE_CSS_BOX_DECORATION_BREAK"
PerformEnvironmentSet="true"
diff --git a/WebKitLibraries/win/tools/vsprops/common.vsprops b/WebKitLibraries/win/tools/vsprops/common.vsprops
index 6a6a874e3..b1ef21c0c 100644
--- a/WebKitLibraries/win/tools/vsprops/common.vsprops
+++ b/WebKitLibraries/win/tools/vsprops/common.vsprops
@@ -25,7 +25,7 @@
<Tool
Name="VCLinkerTool"
LinkLibraryDependencies="false"
- AdditionalOptions="/SAFESEH /FIXED:NO /dynamicbase /ignore:4221"
+ AdditionalOptions="/FIXED:NO /dynamicbase /ignore:4221"
OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix).exe"
AdditionalLibraryDirectories="&quot;$(ConfigurationBuildDir)\lib&quot;;&quot;$(WebKitLibrariesDir)\lib&quot;"
GenerateDebugInformation="true"
diff --git a/configure.ac b/configure.ac
index 7ea5b95ee..78f2067e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -937,12 +937,9 @@ AC_ARG_ENABLE(svg_fonts,
AC_MSG_RESULT([$enable_svg_fonts])
# check for SVG features, enabling SVG if necessary
-if test "$enable_svg_fonts" = "yes"; then
- svg_flags=yes
- if test "$enable_svg" = "no"; then
- AC_MSG_WARN([SVG feature(s) requested but SVG is disabled.. Enabling SVG support])
- enable_svg=yes
- fi
+if test "$enable_svg_fonts" = "yes" && test "$enable_svg" = "no"; then
+ AC_MSG_WARN([SVG feature(s) requested but SVG is disabled.. Enabling SVG support])
+ enable_svg=yes
fi
# check whether to enable Web Socket support
@@ -1009,6 +1006,14 @@ AC_ARG_ENABLE(css3_flexbox,
[],[enable_css3_flexbox=$enable_unstable_features])
AC_MSG_RESULT([$enable_css3_flexbox])
+# check whether to enable CSS3 text decoration support
+AC_MSG_CHECKING([whether to enable CSS3 text decoration support])
+AC_ARG_ENABLE(css3_text_decoration,
+ AC_HELP_STRING([--enable-css3-text-decoration],
+ [enable CSS3 text decoration support [default=no]]),
+ [],[enable_css3_text_decoration=$enable_unstable_features])
+AC_MSG_RESULT([$enable_css3_text_decoration])
+
# check whether to enable FastMalloc
AC_MSG_CHECKING([whether to enable optimized memory allocator])
AC_ARG_ENABLE(fast_malloc,
@@ -1332,11 +1337,6 @@ if test "$enable_coverage" = "yes"; then
AC_SUBST([COVERAGE_LDFLAGS])
fi
-# check for HTML features
-if test "$enable_video" = "yes"; then
- html_flags=yes
-fi
-
# WebKit2
# If you change the default here, please also make sure the assumptions made
# in Tools/Scripts/webkitdirs.pm:buildAutotoolsProject still make sense.
@@ -1472,12 +1472,11 @@ AM_CONDITIONAL([ENABLE_SVG],[test "$enable_svg" = "yes"])
AM_CONDITIONAL([ENABLE_SVG_FONTS],[test "$enable_svg_fonts" = "yes"])
AM_CONDITIONAL([ENABLE_COVERAGE],[test "$enable_coverage" = "yes"])
AM_CONDITIONAL([ENABLE_CSS3_FLEXBOX],[test "$enable_css3_flexbox" = "yes"])
+AM_CONDITIONAL([ENABLE_CSS3_TEXT_DECORATION],[test "$enable_css3_text_decoration" = "yes"])
AM_CONDITIONAL([ENABLE_FAST_MALLOC],[test "$enable_fast_malloc" = "yes"])
AM_CONDITIONAL([ENABLE_WORKERS],[test "$enable_workers" = "yes"])
AM_CONDITIONAL([ENABLE_SHADOW_DOM],[test "$enable_shadow_dom" = "yes"])
AM_CONDITIONAL([ENABLE_SHARED_WORKERS],[test "$enable_shared_workers" = "yes"])
-AM_CONDITIONAL([SVG_FLAGS],[test "$svg_flags" = "yes"])
-AM_CONDITIONAL([HTML_FLAGS],[test "$html_flags" = "yes"])
AM_CONDITIONAL([ENABLE_WEB_SOCKETS],[test "$enable_web_sockets" = "yes"])
AM_CONDITIONAL([ENABLE_WEB_AUDIO],[test "$enable_web_audio" = "yes"])
AM_CONDITIONAL([ENABLE_WEB_TIMING],[test "$enable_web_timing" = "yes"])
@@ -1560,6 +1559,7 @@ Features:
CSS Regions support : $enable_css_regions
CSS box-decoration-break support : $enable_css_box_decoration_break
CSS3 Flexbox support : $enable_css3_flexbox
+ CSS3 Text Decoration support : $enable_css3_text_decoration
Color input support : $enable_input_type_color
DOM mutation observer support : $enable_mutation_observers
DeviceOrientation support : $enable_device_orientation